query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Method used to set new week data on update/create
public function setNewWeekData($week) { $week->title = request()->title; $week->description = request()->description; $week->week_number = request()->week_number; $week->maximum_points = $week->calculateMaxPoints(); return $week; }
[ "function updateForWeek() {\r\n $this->prevWeekPoints = $this->points;\r\n }", "private function addUpdatedWeeks() {\n $query = db_query('SELECT begintime FROM {tzreport} tzreport INNER JOIN {tzintellitime} tzintellitime ON tzreport.vid = tzintellitime.vid WHERE tzreport.assignedto = %d AND tzintellitime.intellitime_local_changes > 0', $this->account->uid);\n while($time = db_result($query)) {\n $this->addWeek(tzbase_make_date($time));\n }\n }", "private function setAsWeekend()\n {\n $this->work_day = 0; \n }", "private function updateCurrentWeekInDbTo($thisWeek){\r\n\t\t$sql = \"UPDATE zz_Exercise_User_Data SET ex_current_week = '\".$thisWeek.\"', ex_total_weekly_minutes = '0', ex_total_weekly_exercises = '0' WHERE ex_user_id = '\".$this->user_id.\"'\";\r\n\t\t$result = mysql_query($sql);\r\n\t\tmysql_close($sql);\r\n\t}", "public function addWeekday();", "public function setWeekNumber()\n {\n $this->weekNumber = date('W', strtotime($this->date));\n }", "function setToCurrentWeek() {\n $_SESSION[\"todaydate\"] = date('Ymd');\n $_SESSION[\"mondate\"] = findMonDate($_SESSION[\"todaydate\"]);\n $_POST[\"currentweek\"] = null;\n }", "function _setWeekday() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $yui_day_names = array('WEEKDAYS_SHORT' => '', 'WEEKDAYS_MEDIUM' => 'short','WEEKDAYS_LONG' => 'long');\n foreach($yui_day_names as $key => $val) {\n $day_names = $this->CI->calendar->get_day_names($val);\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $day_names;\n }\n\n $day_names = $this->CI->calendar->get_day_names('short');\n foreach($day_names as $key => $val) {\n $day_names[$key] = substr($val,0,1);\n }\n $this->CI->ciwy->component_config[$instance]['Config']['WEEKDAYS_1CHAR'] = $day_names;\n }", "function setWeek($tmstp){\n $timestamp = GetMondayTimestamp($tmstp);\n $semaine = setDays($timestamp,5);\n $semaine['sem'] = date('W',$timestamp);\n $semaine['tmstp'] = $timestamp;\n $m = getWeekDescription($timestamp);\n $semaine['moisannee'] = $m['moisannee'];\n $semaine['moisnumeric'] = $m['moisnumeric'];\n return $semaine;\n }", "public function updated(Week $week)\n {\n //\n }", "public function setUpdateWeeks(?WindowsUpdateForBusinessUpdateWeeks $value): void {\n $this->getBackingStore()->set('updateWeeks', $value);\n }", "public function weekly() {\n\n $data = $this->mdl_reports->scheduled_reports(\"weekly\");\n for ($i = 0; $i < count($data); $i++) {\n $this->create_report($data[$i]['report_type_id'], $data[$i]['company_id'], $data[$i]['tab_one_ids'], $data[$i]['tab_two_ids'], $data[$i]['email']);\n }\n }", "public function addWeek(): static\n {\n return $this->addWeeks();\n }", "function mcal_event_set_recur_weekly($stream_id, $year, $month, $day, $interval, $weekdays) {}", "public function getWeeklyData();", "public function setWeek() {\n\t\t$this->_billingPeriod = self::WEEK;\n\t\treturn $this;\n\t}", "public function setReputationChangeWeek($week);", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"week\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $week = Week::findFirstByid($id);\n\n if (!$week) {\n $this->flash->error(\"week does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"week\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $week->name = $this->request->getPost(\"name\");\n $week->userID = $this->request->getPost(\"userID\");\n $week->monthId = $this->request->getPost(\"monthId\");\n $week->year = $this->request->getPost(\"year\");\n $week->month = $this->request->getPost(\"month\");\n \n\n if (!$week->save()) {\n\n foreach ($week->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"week\",\n 'action' => 'edit',\n 'params' => [$week->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"week was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"week\",\n 'action' => 'index'\n ]);\n }", "public function resetWeeklyViews();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks for a working and installed application. If the application is not installed, the command exits with an error code of 1.
public function status() { $this->stopOnFail(FALSE); $result = $this->invokeManifestCommand('status') ->run(); if ($result->getExitCode() != 0) { $return = new ResultData(ResultData::EXITCODE_ERROR, 'Application is not installed.'); } else { $return = new ResultData(ResultData::EXITCODE_OK, 'Application is installed.'); } $return->provideOutputdata(); return $return; }
[ "public function testCheckIfApplicationExists()\n {\n $app = $this->bootApplication();\n\n $command = $app->find('new');\n $commandTester = new CommandTester($command);\n $commandTester->execute(['command' => $command->getName(), 'name' => 'test', 'version' => 'LTS']);\n\n $this->assertRegExp('/Application ready! Build something amazing./', $commandTester->getDisplay());\n }", "private function _checkInstalled()\n {\n $request = $this->_symfonyContext->getRequest();\n\n // Prepare the symfony application if it has not been prepared yet\n if (!$this->_symfonyContext->getUser() instanceof sfSympalUser)\n {\n chdir(sfConfig::get('sf_root_dir'));\n $task = new sfSympalEnableForAppTask($this->_dispatcher, new sfFormatter());\n $task->run(array($this->_invoker->getProjectConfiguration()->getApplication()), array());\n\n $this->_symfonyContext->getController()->redirect('@homepage');\n }\n\n /*\n * Redirect to install module if...\n * * not in test environment\n * * sympal has not been installed\n * * module is not already sympal_install\n */\n if (sfConfig::get('sf_environment') != 'test'\n && !sfSympalConfig::get('installed')\n && $request->getParameter('module') != 'sympal_install')\n {\n $this->_symfonyContext->getController()->redirect('@sympal_install');\n }\n\n /*\n * Redirect to homepage if no site record exists so we can prompt the\n * user to create a site record for this application.\n * \n * This check is only ran in dev mode\n */\n if (sfConfig::get('sf_environment') == 'dev'\n && !$this->_sympalContext->getSite()\n && $this->_symfonyContext->getRequest()->getPathInfo() != '/')\n {\n $this->_symfonyContext->getController()->redirect('@homepage');\n }\n }", "private function isInstalled()\n {\n $command = 'which transmission-daemon';\n\n $process = new Process($command);\n $process->run();\n\n if (!$process->isSuccessful()) {\n throw new ProcessFailedException($command);\n }\n\n return true;\n }", "function isProgrammInstalled($progName)\n{\n\t$out = shell_exec(\"whereis $progName\");\n\n\t$infoPath = explode(\":\",$out);\n\n\treturn(strlen(trim($infoPath[1])) > 0);\n}", "public function isInstalled(): bool\n {\n return $this->program->isInstalled();\n }", "public function isInstalled();", "function SERVER_isProgramRunning($progname)\n{\n\t\n\t$ret = exec(\"sudo ps -A | grep $progname | wc -l\");\n\treturn($ret > 0);\n}", "function isRunning()\n {\n return file_exists(\"/tmp/.onInstall\");\n }", "public static function systemCommandExists($name)\n {\n $ret = shell_exec('which ' . $name);\n return ! empty($ret);\n }", "public function isExecutable();", "private function checkImagickCmd(){\n\t\t//First, we need to see if we can run anything externally.\n\t\tif($this->execCheck()){\n\t\t\t $output='';\n\t\t\t $returnCode = -1;\n\t\t\t //Execute 'convert -version' to see if it does anything.\t\n\t\t\t exec($this->imagickCmdPath.\"convert -version\", $output, $returnCode);\n\t\t\t if(intval($returnCode) == 0){\n\t\t\t \t\t//Return code 0 means the file exists and works\n\t\t\t \t\treturn true;\n\t\t\t }else{\n\t\t\t \t\t//Anything else means there is no program there\n\t\t\t \t return false;\n\t\t\t }\n\t\t}else{\n\t\t\t//Since we can't execute things on the commant line with exec(), we can't \n\t\t\t//use this method.\n\t\t\treturn false;\n\t\t}\n\t}", "function canBeInstalled() ;", "static function executableExists($path = null) {\n $mercurial_path = '';\n if (!$path) {\n $mercurial_path = ConfigOptions::getValue('source_mercurial_path');\n } else {\n $mercurial_path = $path;\n } // if\n\n $mercurial_path = with_slash($mercurial_path);\n exec(escapeshellcmd($mercurial_path . 'hg --version --quiet'). \" 2>&1\", $output);\n $output = first($output);\n $position = strpos($output, \"version\");\n $version = str_replace(\"version \",\"\",substr($output,$position,13));\n if ((boolean) version_compare($version, '1.0.0', '>')) {\n return true;\n } else {\n return $output;\n } // if\n }", "function checkInstall() {\n if (file_exists($this->_addon . \"install.php\"))\n return true;\n }", "function checkInstallationProcess() {\r\n \r\n }", "public function isExecutable(): bool;", "public function isExecutable () {}", "function checkIsRunning($app) {\n\n $cmd = \"ps aux | grep \\\"\".$app.\"\\\" | grep -c -v grep\";\n $num = `$cmd`;\n\n if ($num > 0) return true;\n else return false;\n\n}", "public function doTest()\n {\n $this->setMessage('Check if a valid PHP CLI executable is available.');\n\n $this->log = new BufferedOutput();\n\n // Prefer compile time configuration over path environment.\n if ($this->isBinaryAvailableFromConstants()) {\n return;\n }\n\n if ($this->isBinaryAvailableInPath()) {\n return;\n }\n\n $this->markFailed(\n 'Could not find any PHP CLI executable, running tenside tasks will not work. ' . $this->log->fetch()\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Form POST request, adds new user to database and sends verification email and then renders login page
public function add_user(){ $this->model('LoginModel'); $email = $_POST['email']; $password = $_POST['password']; //https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425 $token = substr(md5(mt_rand()), 0, 100); $mail = new Mail('Oblig.tarves.no epost verifisering',$email,'/login/verify'); $mail->setMailBody('Trykk på linken for å verifisere epost',$token,'Link'); $successfullyAdded = $this->model->register($email,$password,$token); if($successfullyAdded){ $mail->sendMail(); } $this->view('login'.'/'.'register.php',[$successfullyAdded]); $this->view->render(); }
[ "function newUserSubmitted() {\n\t\terror_log(\"newUserSubmitted\");\n\n\t\t$firstname = $this->config->getRequestVar(\"firstName\");\n\t\t$lastname = $this->config->getRequestVar(\"lastName\");\n\t\t$email = $this->config->getRequestVar(\"email\");\n\t\t$user = User::NewUser($firstname,$lastname,$email);\n\t\t$user->save();\n\t\t\n\t\t$redirect = $this->config->getRequestVar(\"r\");\n\t\t$versionUUID = $this->config->getRequestVar(\"v\");\n\t\t$redirectURL = $this->config->baseURL . \"?a=\" . $redirect;\n\t\tif($versionUUID) {\n\t\t\t$redirect .= '&v=' . $versionUUID;\n\t\t}\n\t\theader(\"Location: \" . $this->config->baseURL . \"?a=\" . $redirect);\n\t}", "protected function post() {\n $this->negotiateContentType();\n \n $user = $this->importRequestData([\n User::EMAIL,\n User::PASSWORD\n ]);\n $userRepo = new Repository\\User($this->db);\n $userId = $userRepo->signupUser($user, $this->app->getRequestIp());\n \n /**\n * TODO: Send a confirmation email to user.\n */\n \n $this->app->setResponseStatus(201);\n $this->app->setResponseHeaders([\n 'Location' => $this->app->getRequestScheme().'://'.$this->app->getRequestHost().$this->app->getRequestUri().$userId\n ]);\n $this->renderBody([\n User::USER_ID => $userId\n ]);\n }", "public function new_user() {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get new user template\n $this->body = 'admin/new-user';\n $this->admin_layout();\n }", "public function process_new_user()\n\t{\n\t\t$this->load->library('form_validation', $this->Dashboard_m->user_form_rules);\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t$this->create_user_account();\n\t\t} else {\n\t\t\t$data = $this->Dashboard_m->process_new_user();\n\t\t\t$this->load_my_views('Agency/new_user_result_v', $data);\n\t\t}\n\t}", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function registerUser()\n {\n if (Helper::checkCSRF()) {\n //check if submitted Data is not empty - redirct if Data empty\n foreach ($_POST as $input){\n if(Helper::check($input)==FALSE)\n $_SESSION['missingInputRegistration'] = TRUE;\n header('Location: /register');\n }\n //Validate EmailAddress\n $validEmail = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);\n $emailExists = $this->User->checkIFEmailExists($validEmail);\n if ($validEmail==FALSE) {\n $_SESSION['validEmail'] = FALSE;\n header('Location: /register');\n }\n if($emailExists==TRUE) {\n $_SESSION['emailExists'] = TRUE;\n header('Location: /register');\n }\n $userData = $_POST;\n $userData['password'] = password_hash($_POST['password'],PASSWORD_DEFAULT);\n $userID = $this->User->insertUser($userData);\n $this->User->insertAddress($userData, $userID);\n\n //clear possible flags after successful registration\n unset($_SESSION['UserEmail']);\n unset($_SESSION['emailExists']);\n unset($_SESSION['missingInputRegistration']);\n //Login the User\n $_SESSION['UserID']= $userID;\n $_SESSION['LoginStatus']= TRUE;\n $_SESSION['LoginTime'] = time();\n header('Location: ../basket');\n }else{\n throw new \\Error(\"CSRF Token ivalid\");\n }\n }", "public function processUserCreateAction()\r\n {\r\n \t// 1. user has to be logged in and the right user/group permissions\r\n \t$this->testPermisions();\r\n \t// 2.\r\n \t$params = Helper::getRequestParams('post');\r\n \t \r\n \t// post is coming through\r\n \tif(is_array($params) && count($params)) {\r\n \r\n \t\t// add params to the session to refill form on error an reload\r\n \t\t$this->Session->setPostData($params);\r\n \t\t \r\n \t\tif($this->Data->addNewUser($params) === true) {\r\n \t\t\t \r\n \t\t\t// clear the form date from session\r\n \t\t\t$this->Session->clearFormData();\r\n \t\t\t \r\n \t\t\t$this->Session->setSuccess($this->Lang->get('account_user_edit_form_base_success'));\r\n \t\t\tHelper::redirectTo('/account/user/index/');\r\n \t\t\texit;\r\n \t\t\t \r\n \t\t} else {\r\n \t\t\t \r\n \t\t\tHelper::redirectTo('/account/user/adduser/');\r\n \t\t\texit;\r\n \t\t}\r\n \t\t \r\n \t} else {\r\n \t\t \r\n \t\t$this->Session->setError($this->Lang->get('account_user_edit_form_base_error_nodatagiven'));\r\n \t\tHelper::redirectTo('/account/user/adduser/');\r\n \t\texit;\r\n \t\t \r\n \t}\r\n \t \r\n \treturn false;\r\n }", "private function signup(){\t\n\t\t\tinclude_once 'biz/indexbiz.php';\n\t\t\t$ind = new indexbiz();\t\t\t\t\t\t\t\n\t\t\t// Cross validation if the request method is GET else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\")\n\t\t\t\t$this->response('',406);\n\t\t\t$userDetails['name'] = $this->_REQUEST['signname'];\n\t\t\t$userDetails['pass'] = $this->_REQUEST['signconfirmpassword'];\n\t\t\t$userDetails['email'] = $this->_REQUEST['signemail'];\n\t\t\t$userDetails['age'] = $this->_REQUEST['signage'];\n\t\t\t$userDetails['zip'] = $this->_REQUEST['signzip'];\n\t\t\t$ind->addUser($userDetails);\t\t\t\n\t\t\t$this->response('',201);\t// If no records \"No Content\" status\n\t\t}", "public function newInvitedUser() {\n\t\t\t// Inicialize variables\n\t\t\t$email\t\t\t= (isset($GLOBALS['params'][1])) ? trim(($GLOBALS['params'][1])) : false;\n\t\t\t// If values were sent\n\t\t\tif ($email) {\n\t\t\t\t// Prepare reuturn\n\t\t\t\tView::set('email', $email);\n\t\t\t\t// Return\n\t\t\t\tView::render('newInvitedUser');\n\t\t\t}\n\t\t}", "public function createAction() {\n\t\t$user = new User($_POST);\n\n\t\tif ($user->save()) {\n\t\t\t$user->sendActivationEmail();\n\t\t\t$this->redirect('users/success');\n\t\t} else {\n\t\t\tFlash::addMessage('Unable to create user', Flash::DANGER);\n\t\t\tViews::renderTemplate('users/new.html.twig', [ 'user' => $user ]);\n\t\t}\n\n\t}", "public function p_signup() {\n if($this->user) {\n Flash::set(\"You are already logged in.\");\n Router::redirect(\"/stories/welcome\");\n return;\n }\n $newuser = new MyUser();\n if(!$newuser->valid($_POST)) {\n Flash::set(\"Signup failed: \" . $newuser->error_message());\n Router::redirect(\"/users/signup\");\n return;\n }\n\n # Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # More data we want stored with the user \n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n # Dump out the results of POST to see what the form submitted\n # print_r($_POST);\n\n # Insert this user into the database\n $user_id = DB::instance(DB_NAME)->insert(\"users\", $_POST);\n\n Flash::set(\"Thanks for signing up. Please log in now.\");\n Router::redirect(\"/users/login\");\n }", "private function addNewUser(){\n try {\n $user = new User($this->registerView->getUserName(), $this->registerModel->getCryptPassword());\n $this->userRepository->add($user);\n $this->loginView->setRegistrationSuccesMessae();\n return $this->loginView->renderLoginForm();\n\n } catch (UserExistsException $e) {\n $this->registerView->setUserExistsMessage();\n\n } catch(DbException $e){\n NavigationView::redirectToErrorPage();\n }\n return $this->registerView->renderRegisterForm();\n }", "public function create() {\n\t\t\n\t\t\n\t\t//Form has been submitted\n\t\tif(isset($_POST['name']) && isset($_POST['email'])) {\n\t\t\t$user = new User();\n\t\t\t//3b. Check the validity of datas\n\t\t\t$user->setName($_POST['name']);\n\t\t\t$user->setEmail($_POST['email']);\n\t\t\t$userManager = new UserManager();\n\t\t\t$userManager->createUser($user);\n\n\t\t\theader('Location: index.php?ctrl=user&action=index');\n\t\t}\n\n\t\t//3. Display the form\n\t\trequire __DIR__ . '/../view/user/create.php';\n\t}", "public function submit(): void\n {\n\n $user = $this->model;\n\n $postArray = $user->collectInput('POST'); // collect global $_POST data\n\n $style = 'success';\n $message = '';\n \n if (!empty($postArray) AND isset($postArray['submit']) AND isset($postArray['email_address']))\n {\n $user_exist = $user->find($postArray['email_address'], 'email_address'); // search if a user with this email address already exists\n \n if($user_exist)\n {\n $style = 'warning';\n $message = 'Cette adresse email existe déjà dans la base des utilisateurs. Connectez-vous à votre compte ou choisissez une autre adresse email.';\n }\n \n if(!$user_exist)\n {\n $user->status = self::STATUS_SUBMITTED;\n $user->role = self::ROLE_AUTHOR;\n $this->dataTransform($user, $postArray);\n\n $user->id = $user->insert();\n\n if($user->id == 0)\n {\n $style = 'danger';\n $message = 'Une erreur est survenue pendant l\\'enregistrement.';\n } \n if($user->id !== 0)\n {\n $message = 'Votre demande d\\'inscription a bien été enregistrée pour validation par un administrateur.';\n\n if(NOTIFY['new_user'] == 1) // if new user notification is enabled\n {\n // Try to notify the site owner of the new registration\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouvel utilisateur vient d'être enregistré : {$baseUrl}?controller=user&task=edit&id={$user->id}\";\n if (!$this->sendEmail(SITE_NAME,'noreply@myblog.fr','Nouvel utilisateur enregistré',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n }\n\n }\n\n $this->display('front', 'register', 'Inscription', compact('message','style'));\n\n }", "public function addNewUser()\n\t{\n\t\t$elaboratedForm = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\r\n\t\t\n\t\t$name = $elaboratedForm->get('nameUser');\n\t\t$surname = $elaboratedForm->get('surname');\n\t\t$username = $elaboratedForm->get('username');\n\t\t\n\t\t// NOT SUPPORTED IN PHP 5.3.x\n\t\t//$password = password_hash($elaboratedForm->get('password'), PASSWORD_DEFAULT);\n\t\t$password = md5($elaboratedForm->get('password'));\n\t\t$email = $elaboratedForm->get('email');\n\t\t$degreeCourse = $elaboratedForm->get('degreeCourse');\n\t\t\n\t\t$user= new \\Entity\\User($name, $surname, $username, $password , $email, $degreeCourse,0);\n\t\t//var_dump($user);\n\t\t\n\t\t$userDb= new \\Foundation\\User();\n\t\t\n\t\tif($userDb->getByUsername($username)==false) // if the username is not already taken\n\t\t{\n\t\t\tif($userDb->store($user))\n\t\t\t{\n\t\t\t\t$elaboratedForm->assign('user',$user);\n\t\t\t\t$elaboratedForm->assign('error',false); \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$elaboratedForm->assign('error','Error while storing the user on the database');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$elaboratedForm->assign('error','Username already exist');\n\t\t}\n\t\t\t\t\n\t\treturn $elaboratedForm->fetch('registrationResult.tpl');\n\t}", "public function postSignIn(){\n $username = $this->params->get('username');\n $password = $this->params->get('password');\n if($username && $password){\n try{\n $users = $this->service('database')->from('users')\n ->where('Username = :username AND Password = :password')\n ->param('username', $username)\n ->param('password', hash('sha256', $password))\n ->model($this->model('User'))\n ->limit(0, 1)\n ->fetch();\n if($users->count() > 0){\n $user = (array)$users[0];\n $this->service('security')->identity($user);\n $this->redirect($this->route('admin.home'));\n return;\n }else{\n $this->service('messenger')->send(\n 'loginFail',\n __CLASS__ . ':getSignIn',\n self::INVALID_LOGIN\n );\n }\n }catch(Exception $ex){\n $this->service('messenger')->send(\n 'loginFail',\n __CLASS__ . ':getSignIn',\n $ex->getMessage()\n );\n }\n }else{\n $this->service('messenger')->send(\n 'loginFail',\n __CLASS__ . ':getSignIn',\n self::INVALID_LOGIN\n );\n }\n $this->redirect($this->route('adminSignIn'));\n }", "public function add()\n\t{\n\t\tif ($this->method === 'GET') {\n\t\t\t$this->render('add');\n\t\t} else if ($this->method === 'POST') {\n\t\t\tif ($this->validate('uniqueEmail')) {\n\t\t\t\t$affected = $this->model->create($_POST);\n\t\t\t\tif ($affected >= 1) {\n\t\t\t\t\t$result = $this->model->getOneByEmail($_POST['email']);\n\t\t\t\t\t$_SESSION['sessionUserId'] = $result['id'];\n\t\t\t\t\t$_SESSION['active'] = true;\n\t\t\t\t\t$this->setAlert('success', array(\n\t\t\t\t\t\t'title' => 'REGISTRATION SUCCESS!',\n\t\t\t\t\t\t'text' => 'Welcome: ' . $_POST['name'] . ' you are now able to post messages'\n\t\t\t\t\t));\n\t\t\t\t\t$this->redirect();\n\t\t\t\t} else {\n\t\t\t\t\t$this->setAlert('error');\n\t\t\t\t\t$this->redirect();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->setAlert('error', array(\n\t\t\t\t\t'title' => 'EMAIL USED',\n\t\t\t\t\t'text' => 'this email is already registered. Pls login or contact the admin in case you\n\t\t\t\t\tforgot your credentials.'\n\t\t\t\t));\n\t\t\t\t$this->set('user', $_POST);\n\t\t\t\t$this->redirect('User', 'add');\n\t\t\t}\n\t\t}\n\t}", "public function newAction()\n {\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $loggedUser->getRole(),\n ));\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $user = new \\Core\\Entity\\User();\n $form->bind($user);\n\n $dataForm = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()-> phone,\n 'birthDate' => $request->getPost()-> birthDate,\n 'height' => $request->getPost()-> height,\n 'tmrModifier' => $request->getPost()-> tmrModifier,\n 'goalWeight' => $request->getPost()-> goalWeight,\n 'personality' => $request->getPost()-> personality,\n 'activityLevel' => $request->getPost()-> activityLevel,\n 'isFemale' => $request->getPost()-> isFemale,\n 'status' => $request->getPost()-> status,\n 'role' => $request->getPost()-> role,\n );\n\n $form->setData($dataForm);\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n $password = ($request->getPost()->password!='')\n ? $request->getPost()->password\n : $this->getRandomString(8);\n\n $entityManager->persist($user);\n $entityManager->flush();\n\n $user->setPassword($password);\n\n $entityManager->persist($user);\n $entityManager->flush();\n\n $message = new Message( 'panel/password-send' );\n $message->addTo( $user->getEmail(), $user->getName() );\n $message->setVar( 'password', $password );\n\n $mailService = $this->getServiceLocator()\n ->get('MailService');\n\n $mailService->send( $message );\n\n $this->flashMessenger()->addSuccessMessage( 'User has been created. Check your e-mail' );\n return $this->redirect()->toRoute(\n 'panel/:controller', array(\n 'controller' => 'user'\n )\n );\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('form', $form);\n return $view;\n }", "private function registerNewUser()\n {\n if (empty($_POST['user_email'])) {\n $this->errors[] = \"Empty Email\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Empty Password\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Password and password repeat are not the same\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Password has a minimum length of 6 characters\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email cannot be longer than 64 characters\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Your email address is not in a valid email format\";\n } elseif( preg_match('/^\\S+@(gulls\\.)?salisbury\\.edu$/i', $_POST['user_email']) !== 1) {\n $this->errors[] = \"Email must be from an SU domain.\";\n } elseif (empty($_POST['user_id'])) {\n $this->errors[] = \"No Student ID provided\";\n } elseif (strlen($_POST['user_id']) != 7) {\n $this->errors[] = \"Student ID must have a length of 7 characters\";\n } else {\n\n global $db;\n\n $user_email = strip_tags($_POST['user_email'], ENT_QUOTES);\n $user_password = $_POST['user_password_new'];\n $user_id = $_POST['user_id'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // Check for existing account\n $db->where('email', $user_email);\n $existing = $db->get('users');\n\n // Check for existing userID\n $db->where('id', $user_id);\n $IDexisting = $db->get('users');\n\n if (count($existing) > 0) {\n $this->errors = array(\"Sorry, that username / email address is already taken.\", print_r($existing[0]));\n }\n elseif (count($IDexisting) > 0) {\n $this->errors[] = \"Student ID is already being used\";\n } else {\n\n $data = array(\n 'id' => $_POST['user_id'],\n 'email' => $user_email,\n 'preferred_email' => $user_email, //temp\n 'password' => $user_password_hash,\n 'name' => $_POST['user_firstname'] . ' ' . $_POST['user_lastname'],\n 'year' => $_POST['user_year'],\n 'major' => $_POST['user_major'],\n 'bio' => \"This user has not yet created a bio.\",\n 'reset_token' => bin2hex(openssl_random_pseudo_bytes(16))\n );\n\n // write new user's data into database\n $id = $db->insert('users', $data);\n\n // if user has been added successfully\n if ($id) {\n $params = ['user' => $data['id'], 'confirm_token' => $data['reset_token']];\n $msg = \"Welcome to the Salisbury University Math & Computer Science Club! To confirm your account, please click the link below:\\n\\nhttp://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]?\" . http_build_query($params);\n $err = Utils::sendMail(\"noreply@sumathcsclub.com\", $user_email, \"SU Math/CS Club Account Confirm\", $msg, [], \"SU Math/CS Club\");\n if ($err) {\n $this->errors[] = $err;\n $db->where('id', $data['id'])->delete('users');\n } else {\n $this->messages[] = \"You have been sent a confirmation email. Please click the link to confirm your account.\";\n $this->registered = true;\n }\n } else {\n $this->errors[] = $db->getLastError();\n }\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created Kalender in storage.
public function store(CreateKalenderRequest $request) { $input = $request->all(); $kalender = $this->kalenderRepository->create($input); Flash::success('Kalender saved successfully.'); return redirect(route('kalenders.index')); }
[ "public function store()\n {\n // store the object itself\n parent::store();\n }", "public function store()\n {\n // store the object itself\n parent::store();\n \n }", "public function store()\n {\n Statistic::updateStatistics();\n }", "function store(){\r\n\t\t//store to file\r\n\t}", "public function store() {\n $this->seriesForm->validate(Input::all());\n\n extract(Input::only('name', 'image', 'text'));\n\n $this->execute(new CreateSerieCommand($name, $image, $text));\n\n Flash::success('The serie has been created');\n\n return Redirect::back();\n }", "public function store(CreateSeekerRequest $request)\n {\n $input = $request->all();\n\n $seeker = $this->seekerRepository->create($input);\n\n Flash::success('Seeker saved successfully.');\n\n return redirect(route('seekers.index'));\n }", "public function persist()\n {\n $this->logger->info('Persisting state to Keen IO', ['projectID' => $this->secrets->get(self::PROJECT_ID_SECRET_NAME)]);\n $this->keenio->addEvent(self::EVENT_NAME, $this->state);\n }", "public function store(StoreKlantensRequest $request)\n {\n if (! Gate::allows('klanten_create')) {\n return abort(401);\n }\n $klanten = Klanten::create($request->all());\n\n\n\n return redirect()->route('admin.klantens.index');\n }", "public function create_store();", "private function store()\n {\n $settings = [];\n foreach ($this->settings as $key => $value) {\n $settings[$key] = serialize($value);\n }\n $this->files->put($this->filepath, json_encode($settings));\n }", "public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $db->lock( \"eZImageCatalogue_ImageVariationGroup\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_ImageVariationGroup\", \"ID\" );\r\n \r\n $res = $db->query( \"INSERT INTO eZImageCatalogue_ImageVariationGroup \r\n ( ID, Width, Height ) VALUES ( '$this->ID', '$this->Width', '$this->Height' )\" );\r\n\r\n $db->unlock();\r\n \r\n if ( $res == false )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n }", "public function store(CreateShareDkRequest $request)\n {\n $input = $request->all();\n\n if (!array_key_exists('shelf', $input)) {\n $input['shelf'] = 0;\n }\n\n if (array_key_exists('intro', $input)) {\n $input['intro'] = str_replace(\"../../../\", $request->getSchemeAndHttpHost().'/' ,$input['intro']);\n $input['intro'] = str_replace(\"../../\", $request->getSchemeAndHttpHost().'/' ,$input['intro']);\n }\n\n $shareDk = $this->shareDkRepository->create($input);\n\n Flash::success('Share Dk saved successfully.');\n\n return redirect(route('shareDks.index'));\n }", "private function saveData()\n {\n $this->storageAdapter->save($this->serviceName, json_encode($this->toArray()));\n }", "protected function _saveData()\n {\n if (!$this->_saved) {\n $this->_saved = true;\n $this->_storage->write(new ListingSnapshot($this));\n }\n }", "public function createStorage();", "public function store()\n {\n $this->validate();\n if (auth()->user()->can('create roles')) {\n $this->createRole();\n $this->resetAllData();\n $this->emit('refreshRolesIndex');\n } else {\n Session::flash('accessDenied', 'no permission to create a role.');\n }\n }", "private function store()\n {\n $settings = [];\n foreach ($this->settings as $key => $value) {\n $settings[$key] = serialize($value);\n }\n file_put_contents($this->cacheFile, json_encode($settings));\n }", "public function store()\n {\n $inputs = Input::except( '_token', 'characteristic_id');\n $race = Input::except( '_token', 'characteristic_id', 'characteristic_date', 'characteristic_racial_type', 'characteristic_aggressivness_level', 'characteristic_swarming_level', 'characteristic_winter_hardiness_level', 'characteristic_wake_up_month', 'characteristic_comment' );\n\n $race['name'] = [ 'name' => $race[ 'name' ] ]; // dans l'attente de modification ws $race_name\n\n $characteristics = [];\n foreach ( $inputs as $key => $input )\n if( str_contains( $key, 'characteristic_' ) )\n $characteristics[ str_replace( 'characteristic_', '', $key ) ] = $input;\n\n $characteristics['racial_type'] = null;// dans l'attente de modification ws $characteristics_race_name\n\n $characteristics[ 'date' ] = date( 'Y-m-d', strtotime( $characteristics[ 'date' ] ) );\n\n $response_characteristic = BeeTools::entityStore( $characteristics, 'characteristics' );\n $view = BeeTools::isError( $response_characteristic );\n if( $view ) return $view;\n\n $race['characteristic'] = $response_characteristic;\n\n $race = BeeTools::cleanElement( $race );\n $response_race = BeeTools::entityStore( $race, 'races' );\n $view = BeeTools::isError( $response_race );\n if( $view ) return $view;\n\n return Redirect::to( 'races' );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the ACL objects
public function testAclObjects() { $this->specify( 'Acl search does not return correct results', function () { $acl = new PhTAclMem(); $aclRole = new PhTAclRole('Administrators', 'Super User access'); $aclResource = new PhTAclResource('Customers', 'Customer management'); $acl->setDefaultAction(PhAcl::DENY); $acl->addRole($aclRole); $acl->addResource($aclResource, ['search', 'destroy']); $acl->allow('Administrators', 'Customers', 'search'); $acl->deny('Administrators', 'Customers', 'destroy'); $expected = PhAcl::ALLOW; $actual = $acl->isAllowed('Administrators', 'Customers', 'search'); expect($actual)->equals($expected); } ); $this->specify( 'Acl destroy does not return correct results', function () { $acl = new PhTAclMem(); $aclRole = new PhTAclRole('Administrators', 'Super User access'); $aclResource = new PhTAclResource('Customers', 'Customer management'); $acl->setDefaultAction(PhAcl::DENY); $acl->addRole($aclRole); $acl->addResource($aclResource, array('search', 'destroy')); $acl->allow('Administrators', 'Customers', 'search'); $acl->deny('Administrators', 'Customers', 'destroy'); $expected = PhAcl::DENY; $actual = $acl->isAllowed('Administrators', 'Customers', 'destroy'); expect($actual)->equals($expected); } ); }
[ "public function testAclOperations()\n {\n //there is no public-read-write\n $result = $this->client->getBucketAcl($this->bucket);\n $found = false;\n foreach($result->accessControlList as $acl) {\n if(strcmp($acl->grantee[0]->id, '*') == 0) {\n $this->assertEquals($acl->permission[0], 'READ');\n $this->assertEquals($acl->permission[1], 'WRITE');\n $found = true;\n }\n }\n $this->assertFalse($found);\n //there is public-read-write\n $this->client->setBucketCannedAcl($this->bucket, CannedAcl::ACL_PUBLIC_READ_WRITE);\n $result = $this->client->getBucketAcl($this->bucket);\n $found = false;\n foreach($result->accessControlList as $acl) {\n if(strcmp($acl->grantee[0]->id, '*') == 0) {\n $this->assertEquals($acl->permission[0], 'READ');\n $this->assertEquals($acl->permission[1], 'WRITE');\n $found = true;\n }\n }\n $this->assertTrue($found);\n //upload customized acl\n $found = false;\n $myAcl = array(\n array(\n 'grantee' => array(\n array(\n 'id' => 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',\n ),\n array(\n 'id' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n ),\n ),\n 'permission' => array('FULL_CONTROL'),\n ),\n );\n $this->client->setBucketAcl($this->bucket, $myAcl);\n $result = $this->client->getBucketAcl($this->bucket);\n foreach($result->accessControlList as $acl) {\n foreach($acl->grantee as $grantee) {\n if(strcmp($grantee->id, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') == 0) {\n $found = true;\n $this->assertEquals($acl->permission[0], 'FULL_CONTROL');\n }\n }\n }\n $this->assertTrue($found);\n }", "public function testGetContainerByAcl()\n {\n $this->assertTrue($this->_instance->hasGrant(Tinebase_Core::getUser(), $this->objects['initialContainer'], Tinebase_Model_Grants::GRANT_READ));\n\n $readableContainer = $this->_instance->getContainerByAcl(Tinebase_Core::getUser(), 'Addressbook', Tinebase_Model_Grants::GRANT_READ);\n $this->assertEquals('Tinebase_Record_RecordSet', get_class($readableContainer), 'wrong type');\n $this->assertTrue(count($readableContainer) >= 2);\n foreach($readableContainer as $container) {\n $this->_validateOwnerId($container);\n $this->_validatePath($container);\n }\n }", "public function testGetAllValidAccess() {\n\t\t//count all the rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"access\");\n\n\t\t//create a new access and insert into mySQL\n\t\t$access = new Access(null, $this->VALID_ACCESSNAME);\n\t\t$access->insert($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Access::getAllAccess($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"access\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Timecrunchers\\\\Access\", $results);\n\n\t\t//grab the result from the array and validate it\n\t\t$pdoAccess = $results[0];\n\t\t$this->assertEquals($pdoAccess->getAccessName(), $this->VALID_ACCESSNAME);\n\t}", "public function testGetObjectsByGroupsModuleControllerObject_valid() {\n $this->createTestGroupAcls();\n $result = $this->service->getObjectsByGroupsModuleControllerObject(array(1, 2), 'test', 'test', 1);\n\n $this->assertEquals(2, count($result));\n\n foreach ($result as $result2) {\n\n $this->assertEquals(1, count($result2));\n\n foreach ($result2 as $acl) {\n $this->assertNotNull($acl->id);\n $this->assertTrue(in_array($acl->group, array(1, 2)));\n $this->assertTrue(in_array($acl->module, array('test',null)));\n $this->assertTrue(in_array($acl->controller, array('test',null)));\n $this->assertTrue(in_array($acl->object, array(1,null)));\n $this->assertEquals(1, $acl->permission);\n }\n }\n }", "function run_acl_test() {\n\tglobal $user;\n\t$def_user_id = array();\n\t$def_group_id = array();\n\n\t/* START SET TEST VARIABLES */\n\t// set user ids\n\t$def_user_id['user1'] = 2;\n\t$def_user_id['user2'] = 3; // must be member of group 1\n\t$def_user_id['user3'] = 4;\n\t// set group ids\n\t$def_group_id['group1'] = 2; // must contain user 2 as member (not owner)\n\t$def_group_id['group2'] = 3;\n\t/* END SET TEST VARIABLES */\n\n\t$output['introduction'] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"ACL tests are executed and the result is listed in the table below\"),\n\t\t\t'#weight' => 0,\n\t);\n\t$success = t('success');\n\t$fail = t('fail');\n\t$tableHeader = array();\n\t$tableHeader[] = t('#');\n\t$tableHeader[] = t('Name');\n\t$tableHeader[] = t('Description');\n\t$tableHeader[] = t('Result');\n\n\t// cerate new acl with user 1\n\t$row = array();\n\t$rowCount = 1;\n\t$displayCount = 1;\n\t$user_id = $def_user_id['user1'];\n\t$row[] = $rowCount;\n\t$row[] = t('Create new ACL');\n\t$row[] = t('Create a new ACL by user_id = ' . $user_id);\n\t$acl_id = new_acl(\"Description #2\", $user_id);\n\t$do_next = FALSE;\n\tif ($acl_id != NULL) {\n\t\t$row[] = $success;\n\t\t$do_next = TRUE;\n\t} else {\n\t\t$row[] = $fail;\n\t}\n\t$rows[] = $row;\n\n\t// check if new user is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' is in created ACL id = '\n\t\t\t\t\t. $acl_id . ' and lvl = ' . variable_get(\"ACL_ADMIN\"));\n\t\t$lvl = check_user_in_acl($acl_id, $user_id);\n\t\t$do_next = FALSE;\n\t\tif ($lvl == variable_get(\"ACL_ADMIN\")) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if new user owns acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User owns ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' owns ACL with id = ' . $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (check_user_owns_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// add user 2, lvl 2 to acl\n\t$user_id = $def_user_id['user2'];\n\t$acl_lvl = 2;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Add user to ACL');\n\t\t$row[] = t(\n\t\t\t'Add user with id = ' . $user_id . ' to ACL with id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$do_next = FALSE;\n\t\tif (add_user_to_acl($acl_id, $user_id, $acl_lvl)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if user 2 is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' is in ACL id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$lvl = check_user_in_acl($acl_id, $user_id);\n\t\t$do_next = FALSE;\n\t\tif ($lvl == $acl_lvl) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if new user owns acl (negative test)\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User owns ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' owns ACL with id = ' . $acl_id\n\t\t\t\t\t. ' (negative test)');\n\t\t$do_next = FALSE;\n\t\tif (!check_user_owns_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// change lvl of user 2 in acl\n\t$user_id = $def_user_id['user2'];\n\t$acl_lvl = 3;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Change user level');\n\t\t$row[] = t(\n\t\t\t'Chenge level of user with id = ' . $user_id . ' in ACL with id = '\n\t\t\t\t\t. $acl_id . ' to level = ' . $acl_lvl);\n\t\t$do_next = FALSE;\n\t\tif (update_user_in_acl($acl_id, $user_id, $acl_lvl)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if user 2 is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' is in ACL id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$lvl = check_user_in_acl($acl_id, $user_id);\n\t\t$do_next = FALSE;\n\t\tif ($lvl == $acl_lvl) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// change ownership of acl to user 3\n\t$user_id = $def_user_id['user3'];\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Chown ACL');\n\t\t$row[] = t(\n\t\t\t'Change ownsership of acl with id = ' . $acl_id\n\t\t\t\t\t. ' to user with id = ' . $user_id);\n\t\t$do_next = FALSE;\n\t\tif (chown_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if new user owns acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User owns ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' owns ACL with id = ' . $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (check_user_owns_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\t$displayCount++;\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// add group 1, lvl 2 to acl\n\t$group_id = $def_group_id['group1'];\n\t$acl_lvl = 3;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Add group to ACL');\n\t\t$row[] = t(\n\t\t\t'Add group with id = ' . $group_id . ' to ACL with id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$do_next = FALSE;\n\t\tif (add_group_to_acl($acl_id, $group_id, $acl_lvl)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if group 1 is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Group in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if group_id = ' . $group_id . ' is in ACL id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$lvl = check_group_in_acl($acl_id, $group_id);\n\t\t$do_next = FALSE;\n\t\tif ($lvl == $acl_lvl) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// add group 2, lvl 4 to acl\n\t$group_id = $def_group_id['group2'];\n\t$acl_lvl = 4;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Add group to ACL');\n\t\t$row[] = t(\n\t\t\t'Add group with id = ' . $group_id . ' to ACL with id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$do_next = FALSE;\n\t\tif (add_group_to_acl($acl_id, $group_id, $acl_lvl)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if group 1 is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Group in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if group_id = ' . $group_id . ' is in ACL id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$lvl = check_group_in_acl($acl_id, $group_id);\n\t\t$do_next = FALSE;\n\t\tif ($lvl == $acl_lvl) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// change group lvl of group 1 in acl\n\t$group_id = $def_group_id['group1'];\n\t$acl_lvl = 2;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Change group level');\n\t\t$row[] = t(\n\t\t\t'Change level of group with id = ' . $group_id\n\t\t\t\t\t. ' in ACL with id = ' . $acl_id . ' to level = '\n\t\t\t\t\t. $acl_lvl);\n\t\t$do_next = FALSE;\n\t\tif (update_group_in_acl($acl_id, $group_id, $acl_lvl)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if group 1 is in acl and if lvl is ok\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Group in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if group_id = ' . $group_id . ' is in ACL id = ' . $acl_id\n\t\t\t\t\t. ' with level = ' . $acl_lvl);\n\t\t$lvl = check_group_in_acl($acl_id, $group_id);\n\t\t$do_next = TRUE;\n\t\tif ($lvl == $acl_lvl) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// check permission of user 2 (all permissions)\n\t// this user is in group 1\n\t$user_id = $def_user_id['user2'];\n\t$acl_lvl = 3;\n\t// user 2 has lvl 3 -> wins\n\t// group 1 has lvl 2\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check Permission All');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' in ACL id = ' . $acl_id\n\t\t\t\t\t. ' has permission level = ' . $acl_lvl);\n\t\t$do_next = TRUE;\n\t\tif (check_permission($acl_id, $acl_lvl, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check permission of user 2 (only group permission)\n\t// this user is in group 1\n\t$user_id = $def_user_id['user2'];\n\t$acl_lvl = 2;\n\t// user 2 has lvl 3\n\t// group 1 has lvl 2 -> wins (only group lvls are checked)\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check Permission Group');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' in ACL id = ' . $acl_id\n\t\t\t\t\t. ' has permission level = ' . $acl_lvl\n\t\t\t\t\t. ' (only group-permission check)');\n\t\t$do_next = TRUE;\n\t\tif (check_permission($acl_id, $acl_lvl, $user_id, true)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check permission of user 1 (all permissions)\n\t// this user is in no group\n\t$user_id = $def_user_id['user1'];\n\t$acl_lvl = variable_get(\"ACL_ADMIN\");\n\t// user 1 has lvl variable_get(\"ACL_ADMIN\")\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check Permission All');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' (in no group) in ACL id = '\n\t\t\t\t\t. $acl_id . ' has permission level = ' . $acl_lvl);\n\t\t$do_next = TRUE;\n\t\tif (check_permission($acl_id, $acl_lvl, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check permission of user_id 2 (only group permission)\n\t// this user is in no group\n\t// this is a negative-test\n\t$user_id = $def_user_id['user1'];\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check Permission Group');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' (in no group) in ACL id = '\n\t\t\t\t\t. $acl_id\n\t\t\t\t\t. ' has no permission (only group-permission check)');\n\t\t$do_next = TRUE;\n\t\tif (!check_permission($acl_id, $acl_lvl, $user_id, true)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// remove user 3 from acl\n\t$user_id = $def_user_id['user3'];\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Remove user from ACL');\n\t\t$row[] = t(\n\t\t\t'Remove user with id = ' . $user_id . ' from ACL with id = '\n\t\t\t\t\t. $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (delete_user_from_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if user 3 is not in acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('User in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if user_id = ' . $user_id . ' is not in ACL id = ' . $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (!check_user_in_acl($acl_id, $user_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// remove group 2 from acl\n\t$group_id = $def_group_id['group2'];\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Remove group from ACL');\n\t\t$row[] = t(\n\t\t\t'Remove group with id = ' . $group_id . ' from ACL with id = '\n\t\t\t\t\t. $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (delete_group_from_acl($acl_id, $group_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if group 2 is not in acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Group in ACL');\n\t\t$row[] = t(\n\t\t\t'Check if group_id = ' . $group_id . ' is not in ACL id = '\n\t\t\t\t\t. $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (!check_group_in_acl($acl_id, $group_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// copy acl\n\t$acl_id_copy = 0;\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Copy ACL');\n\t\t$row[] = t('Copy the ACL id = ' . $acl_id);\n\t\t$acl_id_copy = copy_acl($acl_id);\n\t\t$do_next = FALSE;\n\t\tif ($acl_id_copy) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id_copy\n\t\t\t\t\t\t. \" after testcase \" . $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id_copy);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id_copy\n\t\t\t\t\t\t. \" after testcase \" . $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id_copy);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// clear acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Clear ACL');\n\t\t$row[] = t('Clear the ACL id = ' . $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (clear_acl($acl_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t/* DISPLAY START */\n\t// show user in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All users in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_users = get_users_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_users as $my_user) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_user->uid;\n\t\t$t_row[] = $my_user->name;\n\t\t$t_row[] = $my_user->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t/* DISPLAY START */\n\t// show group in acl\n\t$output['info_display' . $displayCount] = array(\n\t\t\t'#markup' => t(\n\t\t\t\t\"All groups in ACL with id = \" . $acl_id . \" after testcase \"\n\t\t\t\t\t\t. $rowCount),\n\t\t\t'#weight' => $displayCount * 10,\n\t);\n\n\t$t_tableHeader = array();\n\t$t_tableHeader[] = t('Id');\n\t$t_tableHeader[] = t('Name');\n\t$t_tableHeader[] = t('Level');\n\n\t$my_groups = get_groups_in_acl($acl_id);\n\t$t_rows = array();\n\tforeach ($my_groups as $my_group) {\n\t\t$t_row = array();\n\t\t$t_row[] = $my_group->id;\n\t\t$t_row[] = $my_group->name;\n\t\t$t_row[] = $my_group->level;\n\t\t$t_rows[] = $t_row;\n\t}\n\n\t$t_table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $t_tableHeader,\n\t\t\t'#rows' => $t_rows,\n\t\t\t'#weight' => $displayCount * 10 + 1,\n\t);\n\t$output['table_display' . $displayCount] = $t_table;\n\t$displayCount++;\n\t/* DISPLAY END */\n\n\t// delete acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Delete ACL');\n\t\t$row[] = t('Delete the ACL id = ' . $acl_id);\n\t\t$do_next = FALSE;\n\t\tif (delete_acl($acl_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if acl is deleted\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check ACL deleted');\n\t\t$row[] = t('Check if the ACL with id = ' . $acl_id . ' is deleted');\n\t\t$do_next = FALSE;\n\t\tif (!get_acl($acl_id)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// delete acl\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Delete ACL');\n\t\t$row[] = t('Delete the ACL id = ' . $acl_id_copy);\n\t\t$do_next = FALSE;\n\t\tif (delete_acl($acl_id_copy)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t// check if acl is deleted\n\tif ($do_next) {\n\t\t$rowCount++;\n\t\t$row = array();\n\t\t$row[] = $rowCount;\n\t\t$row[] = t('Check ACL deleted');\n\t\t$row[] = t('Check if the ACL with id = ' . $acl_id_copy . ' is deleted');\n\t\t$do_next = FALSE;\n\t\tif (!get_acl($acl_id_copy)) {\n\t\t\t$row[] = $success;\n\t\t\t$do_next = TRUE;\n\t\t} else {\n\t\t\t$row[] = $fail;\n\t\t}\n\t\t$rows[] = $row;\n\t}\n\n\t$table = array(\n\t\t\t'#theme' => 'table',\n\t\t\t'#header' => $tableHeader,\n\t\t\t'#rows' => $rows,\n\t\t\t'#weight' => 1,\n\t);\n\t$output['table_test1'] = $table;\n\n\t$theme = array(\n\t\t\t'#theme' => 'c_acl_form',\n\t\t\t'#weight' => -1,\n\t);\n\n\t$output['theme'] = $theme;\n\n\treturn $output;\n}", "public function testSetup()\n {\n $User = TableRegistry::getTableLocator()->get('AclUsers');\n $this->assertSame('requester', $User->behaviors()->Acl->getConfig('type'));\n $this->assertTrue(is_object($User->Aro));\n\n $Post = TableRegistry::getTableLocator()->get('AclPosts');\n $this->assertSame('controlled', $Post->behaviors()->Acl->getConfig('type'));\n $this->assertTrue(is_object($Post->Aco));\n }", "public function testRoleResourceObjects()\n {\n $this->specify(\n \"Role and Resource objects doesn't work with isAllowed method\",\n function () {\n $acl = new Memory();\n $acl->setDefaultAction(Acl::DENY);\n $role = new Role('Guests');\n $resource = new Resource('Post');\n $acl->addRole($role);\n $acl->addResource($resource, ['index', 'update', 'create']);\n\n $acl->allow('Guests', 'Post', 'index');\n\n expect($acl->isAllowed($role, $resource, 'index'))->true();\n expect($acl->isAllowed($role, $resource, 'update'))->false();\n }\n );\n }", "public function testIsAllowed()\n {\n $this->server = [\n 'HTTP_HOST' => 'unittest.dev',\n 'SERVER_NAME' => 'unittest.dev',\n 'REQUEST_URI' => '/',\n 'QUERY_STRING' => '',\n 'REQUEST_METHOD' => 'POST'\n ];\n\n $config = new Config($this->config);\n $environmentManager = new EmptyEnvironmentManager(\n $config,\n $this->get,\n $this->post,\n $this->server,\n $this->cookie,\n $this->files\n );\n\n $userStorage = new UserStorage(\n self::$adapter,\n new EntitySet(),\n new UserEntity(),\n new UserGroupEntity()\n );\n\n $policyStorage = new PolicyStorage(\n self::$adapter,\n new EntitySet(),\n new PolicyEntity()\n );\n\n $aclAdapter = new Acl(\n $environmentManager,\n $userStorage,\n $policyStorage\n );\n\n $userEntity = new UserEntity();\n\n $resourceEntity = new ResourceEntity();\n $resourceEntity->setResourceId(90000);\n\n $applicationEntity = new ApplicationEntity();\n $applicationEntity->setApplicationId(90000);\n\n $userA = clone $userEntity;\n $userA->setUserId(90000);\n\n $userB = clone $userEntity;\n $userB->setUserId(90001);\n\n\n // POLICY 90000\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, null, null, null));\n // FALSE because User B isn't assigned to Policy 90000 and not member of User Group 90000\n $this->assertFalse($aclAdapter->isAllowed($userB, null, null, null));\n\n // POLICY 90001\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, 'GET'));\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, 'POST'));\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, null));\n // TRUE for GET, FALSE otherwise\n $this->assertTrue($aclAdapter->isAllowed($userB, $resourceEntity, null, 'GET'));\n $this->assertFalse($aclAdapter->isAllowed($userB, $resourceEntity, null, 'POST'));\n $this->assertFalse($aclAdapter->isAllowed($userB, $resourceEntity, null, null));\n\n // POLICY 90002\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, 'GET'));\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, 'POST'));\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, null));\n // always FALSE because User B isn't assigned to Policy 90002 and no User Group is assigned to Policy 90002\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, 'GET'));\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, 'POST'));\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, null));\n\n // POLICY 90003\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, $applicationEntity, null));\n // TRUE because User B is assigned to Policy 90003 and/or assigned to User Group 90001\n $this->assertTrue($aclAdapter->isAllowed($userB, $resourceEntity, $applicationEntity, null));\n }", "public function testAclSerialize()\n {\n $this->specify(\n 'Acl serialization/unserialization does not return a correct object back',\n function () {\n\n $filename = newFileName('acl', 'log');\n\n $acl = new PhTAclMem();\n $aclRole = new PhTAclRole('Administrators', 'Super User access');\n $aclResource = new PhTAclResource('Customers', 'Customer management');\n\n $acl->addRole($aclRole);\n $acl->addResource($aclResource, ['search', 'destroy']);\n\n $acl->allow('Administrators', 'Customers', 'search');\n $acl->deny('Administrators', 'Customers', 'destroy');\n\n $contents = serialize($acl);\n file_put_contents(PATH_CACHE . $filename, $contents);\n\n $acl = null;\n\n $contents = file_get_contents(PATH_CACHE . $filename);\n\n cleanFile(PATH_CACHE, $filename);\n\n $acl = unserialize($contents);\n $actual = ($acl instanceof \\Phalcon\\Acl\\Adapter\\Memory);\n expect($actual)->true();\n\n $actual = $acl->isRole('Administrators');\n expect($actual)->true();\n\n $actual = $acl->isResource('Customers');\n expect($actual)->true();\n\n $expected = PhAcl::ALLOW;\n $actual = $acl->isAllowed('Administrators', 'Customers', 'search');\n expect($actual)->equals($expected);\n\n $expected = PhAcl::DENY;\n $actual = $acl->isAllowed('Administrators', 'Customers', 'destroy');\n expect($actual)->equals($expected);\n }\n );\n }", "public function testGetAccess()\n\t{\n\t\t$access = $this->object->getAccess();\n\t\t$this->assertEquals($access, 'protected');\n\t}", "function testAuthorizeActions() {\n\t\t$this->AuthUser = new AuthUser();\n\t\t$user = $this->AuthUser->find();\n\t\t$this->Controller->Session->write('Auth', $user);\n\t\t$this->Controller->params['controller'] = 'auth_test';\n\t\t$this->Controller->params['action'] = 'add';\n\n\t\t$this->Controller->Acl = new AuthTestMockAclComponent();\n\t\t$this->Controller->Acl->setReturnValue('check', true);\n\n\t\t$this->Controller->Auth->initialize($this->Controller);\n\n\t\t$this->Controller->Auth->userModel = 'AuthUser';\n\t\t$this->Controller->Auth->authorize = 'actions';\n\t\t$this->Controller->Auth->actionPath = 'Root/';\n\n\t\t$this->Controller->Acl->expectAt(0, 'check', array(\n\t\t\t$user, 'Root/AuthTest/add'\n\t\t));\n\n\t\t$this->Controller->Auth->startup($this->Controller);\n\t\t$this->assertTrue($this->Controller->Auth->isAuthorized());\n\t}", "public function testUpdateObjectAcl() {\n\t\t// Create an object with an ACL\n\t\t$acl = new Acl();\n\t\t$acl->addGrant( new Grant( new Grantee( $this->uid, Grantee::USER ), Permission::FULL_CONTROL ) );\n\t\t$other = new Grant( Grantee::$OTHER, Permission::READ );\n\t\t$acl->addGrant( $other );\n\t\t$id = $this->esu->createObject( $acl, null, null, null );\n\t\tPHPUnit_Framework_Assert::assertNotNull( $id, 'null ID returned' );\n\t\t$this->cleanup[] = $id;\n\t\t\n\t\t// Read back the ACL and make sure it matches\n\t\t$newacl = $this->esu->getAcl( $id );\n\t\tPHPUnit_Framework_Assert::assertEquals( $acl, $newacl, \"ACLs don't match\" );\n\n\t\t// Change the ACL\n\t\t$other->setPermission( Permission::NONE );\n\t\t$this->esu->setAcl( $id, $acl );\n\t\t\n\t\t// Read back the ACL and make sure it matches\n\t\t$newacl = $this->esu->getAcl( $id );\n\t\tPHPUnit_Framework_Assert::assertEquals( $acl, $newacl, \"ACLs don't match\" );\n\t}", "public function testPrivileges()\n {\n $this->_acl->allow(null, null, array('p1', 'p2', 'p3'));\n $this->assertTrue($this->_acl->isAllowed(null, null, 'p1'));\n $this->assertTrue($this->_acl->isAllowed(null, null, 'p2'));\n $this->assertTrue($this->_acl->isAllowed(null, null, 'p3'));\n $this->assertFalse($this->_acl->isAllowed(null, null, 'p4'));\n $this->_acl->deny(null, null, 'p1');\n $this->assertFalse($this->_acl->isAllowed(null, null, 'p1'));\n $this->_acl->deny(null, null, array('p2', 'p3'));\n $this->assertFalse($this->_acl->isAllowed(null, null, 'p2'));\n $this->assertFalse($this->_acl->isAllowed(null, null, 'p3'));\n }", "public function testIndexAction()\n {\n $this->utility->impersonate('administrator');\n\n // verify that acl grid is accessible\n $this->dispatch('/user/acl');\n\n $this->assertModule('user', 'Expected module for dispatching /user/acl action.');\n $this->assertController('acl', 'Expected controller for dispatching /user/acl action.');\n $this->assertAction('index', 'Expected action for dispatching /user/acl action.');\n\n // verify that table and dojo data elements exist\n $this->assertXpath('//div[@dojotype=\"dojox.data.QueryReadStore\"]', 'Expected dojo.data div');\n $this->assertXpath(\n '//table[@dojotype=\"p4cms.ui.grid.DataGrid\" and @jsid=\"p4cms.user.acl.grid.instance\"]',\n 'Expected dojox.grid table.'\n );\n\n // verify save and restore buttons appear\n $this->assertQueryContentContains(\n \"div.button button\",\n \"Save Changes\",\n \"Expected existence of save button.\"\n );\n $this->assertQueryContentContains(\n \"div.button button\",\n \"Reset to Defaults\",\n \"Expected existence of save button.\"\n );\n\n // check initial JSON output\n $this->resetRequest()\n ->resetResponse();\n $this->dispatch('/user/acl/format/json');\n $body = $this->response->getBody();\n $this->assertModule('user', 'Expected module, dispatch #2. '. $body);\n $this->assertController('acl', 'Expected controller, dispatch #2 '. $body);\n $this->assertAction('index', 'Expected action, dispatch #2 '. $body);\n\n $data = Zend_Json::decode($body);\n\n // check number of resources and privileges\n $resources = array();\n $privileges = array();\n foreach ($data['items'] as $item) {\n if ($item['type'] == 'resource') {\n $resources[] = $item;\n } else if ($item['type'] == 'privilege') {\n $privileges[] = $item;\n }\n }\n\n $this->assertSame(\n 9,\n count($resources),\n \"Expected matching number of resources.\"\n );\n\n $this->assertSame(\n 34,\n count($privileges),\n \"Expected matching number of privileges.\"\n );\n }", "public function testIsAllowed()\n {\n $class = new \\ReflectionClass(get_class($this->mvcKeeper));\n $method = $class->getMethod('isAllowed');\n $method->setAccessible(true);\n\n $authorizeByPermission = new Authorize([\n 'value' => [\n 'permissions' => [\n 'render-default-page'\n ]\n ]\n ]);\n\n $authorizeByRole = new Authorize([\n 'value' => [\n 'roles' => [\n 'Download'\n ]\n ]\n ]);\n\n $this->assertTrue($method->invoke($this->mvcKeeper, $authorizeByPermission));\n $this->assertTrue($method->invoke($this->mvcKeeper, $authorizeByRole));\n }", "public function testCustomFieldAcl()\n {\n $createdCustomField = $this->_instance->addCustomField($this->_getCustomField());\n $this->_objects[] = $createdCustomField;\n $this->_instance->setGrants($createdCustomField);\n \n $application = Tinebase_Application::getInstance()->getApplicationByName('Tinebase');\n $appCustomFields = $this->_instance->getCustomFieldsForApplication(\n $application->getId()\n );\n \n $this->assertEquals(0, count($appCustomFields));\n }", "public function testHasAreaRoleEntityByMod()\n {\n\n $this->user->switchUser('test_annon_2');\n\n $orm = $this->db->orm;\n $textTest = $orm->get('WbfsysText',\"access_key='text_1'\");\n $textSecret = $orm->get('WbfsysText',\"access_key='secret'\");\n\n // testen auf rolle in relation zu mod-test\n $res = $this->acl->hasRole('test_annon_2', 'mod-test_2/entity-test_2');\n $this->assertTrue('hasRole test_annon_2 returned false',$res);\n\n $res = $this->acl->hasRole('test_annon_2', 'mod-test_2/entity-test_2', $textTest);\n $this->assertTrue('hasRole test_annon_2 for text test returned false',$res);\n\n $res = $this->acl->hasRole('test_annon_2', 'mod-test_2/entity-test_2', $textSecret);\n $this->assertTrue('hasRole test_annon_2 text secret returned false',$res);\n\n // testen auf globale rolle\n $res = $this->acl->hasRole('test_annon2');\n $this->assertFalse('hasRole test_annon_2 for: mod-test_2 returned true',$res);\n\n // testen auf existierende rolle\n $res = $this->acl->hasRole('test_annon', 'mod-test_2/entity-test_2');\n $this->assertFalse('hasRole test_annon_2 for: mod-test returned true',$res);\n\n // testen auf existierende rolle global\n $res = $this->acl->hasRole('test_annon');\n $this->assertFalse('hasRole test_annon_2 for: global returned true',$res);\n\n // test auf nicht existierend rolle\n $res = $this->acl->hasRole('fubar', 'mod-test_2/entity-test_2');\n $this->assertFalse('hasRole fubar for: \"mod-test\" returned true',$res);\n\n // test auf nicht existierend rolle global\n $res = $this->acl->hasRole('fubar');\n $this->assertFalse('hasRole fubar for: global returned true',$res);\n\n }", "public function testAllResourcesWithRoles() {\r\n\r\n $this -> assertIsArray($this -> acl -> getResourcesWithRoles());\r\n $this -> assertCount(0, $this -> acl -> getResourcesWithRoles());\r\n\r\n $this -> acl -> addRole('guest', ['blog.view']);\r\n $this -> acl -> addRole('administrator') -> addResources(['blog.edit', 'blog.delete', 'blog.create']);\r\n $this -> acl -> inherit('administrator', 'guest');\r\n\r\n $this -> assertIsArray($this -> acl -> getResourcesWithRoles());\r\n $this -> assertCount(4, $this -> acl -> getResourcesWithRoles());\r\n }", "public function testAclSerialize()\n {\n $this->specify(\n 'Acl serialization/unserialization does not return a correct object back',\n function () {\n $filename = $this->tester->getNewFileName('acl', 'log');\n\n $acl = new Memory();\n $aclRole = new Role('Administrators', 'Super User access');\n $aclResource = new Resource('Customers', 'Customer management');\n\n $acl->addRole($aclRole);\n $acl->addResource($aclResource, ['search', 'destroy']);\n\n $acl->allow('Administrators', 'Customers', 'search');\n $acl->deny('Administrators', 'Customers', 'destroy');\n\n $contents = serialize($acl);\n file_put_contents(PATH_CACHE . $filename, $contents);\n\n $acl = null;\n\n $contents = file_get_contents(PATH_CACHE . $filename);\n\n $this->tester->cleanFile(PATH_CACHE, $filename);\n\n $acl = unserialize($contents);\n $actual = ($acl instanceof Memory);\n expect($actual)->true();\n\n $actual = $acl->isRole('Administrators');\n expect($actual)->true();\n\n $actual = $acl->isResource('Customers');\n expect($actual)->true();\n\n $expected = Acl::ALLOW;\n $actual = $acl->isAllowed('Administrators', 'Customers', 'search');\n expect($actual)->equals($expected);\n\n $expected = Acl::DENY;\n $actual = $acl->isAllowed('Administrators', 'Customers', 'destroy');\n expect($actual)->equals($expected);\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove all phpCAS session values.
protected function clearSessionValues() { unset($_SESSION[static::PHPCAS_SESSION_PREFIX]); }
[ "public function clearAll() {\n\t\tparent::clearAll();\n\t\tforeach ($_SESSION as $k=>$v) {\n\t\t\tunset($_SESSION[$k]);\n\t\t}\n\t}", "function delAllValues(){\n unset($_SESSION);\n }", "public static function clearSessionOfFinTsValues()\n {\n Session::remove(AppConstants::$SESSION_FINTS_OBJECT);\n Session::remove(AppConstants::$SESSION_TAN_ACTION);\n Session::remove(AppConstants::$SESSION_TAN_MEDIUM);\n Session::remove(AppConstants::$SESSION_TAN_MODE);\n Session::remove(AppConstants::$SESSION_AVAILABLE_TAN_MEDIA);\n Session::remove(AppConstants::$SESSION_SEPA_ACCOUNT);\n }", "public function clear() {\n\t\tforeach ( array_keys ( $_SESSION ) as $key )\n\t\t\tunset ( $_SESSION [$key] );\n\t}", "static function clear() {\n\t\tforeach (array_keys(Session::$_data) as $key) {\n\t\t\tunset(Session::$_data[$key]);\n\t\t}\n\t}", "function clearRegData(){\n\t\tforeach($_SESSION as $name => $val){\n\t\t\tif(isset($_SESSION[$name])){\n\t\t\t\tunset($_SESSION[$name]);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(is_array($_SESSION[$name])){\n\t\t\t\t\tfor($i=0;$i<count($_SESSION[$name]);$i++){\n\t\t\t\t\t\tunset($_SESSION[$name][$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function unsetAll() \r\n {\r\n session_unset();\r\n }", "public function clearSessionData()\n {\n foreach ($_SESSION as $key => $value) {\n unset($_SESSION[$key]);\n }\n }", "private function clearSessionSc() {\n unset( $_SESSION['USERNAME'] );\n unset( $_SESSION['activeloginadmin'] );\n unset( $_SESSION['m_dmpid'] );\n unset( $_SESSION['sc_emp_status'] );\n unset( $_SESSION['sc_user_profile'] );\n }", "public function clearAll()\n {\n $_SESSION = [];\n }", "function clearEditCompanyCreditsSessions(){\n\tunset($_SESSION['EditCompanyCreditsChangeCredits']);\n\tunset($_SESSION['EditCompanyCreditsChangeAlternativeCreditsAmount']);\n\tunset($_SESSION['EditCompanyCreditsCreditsArray']);\n\tunset($_SESSION['EditCompanyCreditsOriginalInfo']);\n\tunset($_SESSION['EditCompanyCreditsSelectedCreditsID']);\n\tunset($_SESSION['EditCompanyCreditsPreviouslySelectedCreditsID']);\n\tunset($_SESSION['EditCompanyCreditsNewAlternativeAmount']);\n}", "public static function clearSessionTokens()\n {\n unset($_SESSION['mailup_access_token']);\n unset($_SESSION['mailup_refresh_token']);\n unset($_SESSION['mailup_token_expiry']);\n }", "function clearAddCreditsSessions(){\n\tunset($_SESSION['AddCreditsDescription']);\n\tunset($_SESSION['AddCreditsName']);\n}", "private static function clearLocalSessionData()\n {\n self::$logger->debug('Clear Session Data');\n self::$gid_things->setAccessToken(null);\n self::$gid_things->setRefreshToken(null);\n self::$gid_things->setLoginStatus(null);\n\n OAuth::deleteStoredToken(iTokenTypes::ACCESS_TOKEN);\n OAuth::deleteStoredToken(iTokenTypes::REFRESH_TOKEN);\n\n if (isset($_SESSION)) {\n unset($_SESSION['Things']);\n foreach ($_SESSION as $key => $val) {\n if (preg_match('#^headerAuth#Ui', $key) || in_array($key, array('nickUserLogged', 'isConnected'))) {\n unset($_SESSION[$key]);\n }\n }\n }\n }", "protected function clearSessionData()\n\t{\n\t\t$this->sessionData = array();\n \n\t\t$GLOBALS[ 'TSFE' ]->fe_user->setKey( 'ses', $this->sessionDataStorageKey, $this->sessionData );\n\t\t$GLOBALS[ 'TSFE' ]->fe_user->storeSessionData();\n\t}", "private function clearSession() {\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_code\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_access_token\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_user_id\");\n\t\t$this->session->delete(\"ot\");\n\t\t$this->session->delete(\"ots\");\n\t\t$this->session->delete(\"oauth.linkedin\");\n\t\t$this->session->delete(\"fs_access_token\");\n\t\t$this->session->delete(\"G_token\");\n\t}", "public function removeAll()\n {\n unset($_SESSION[$this->goodidSessionKey]);\n }", "public function clearSessions()\n {\n $this->collSessions = null; // important to set this to NULL since that means it is uninitialized\n }", "public function unsetAllSession()\n {\n $_SESSION=array();\n session_destroy();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
should support streaming profile
public function test_streaming_profile() { $options = array("streaming_profile" => "some-profile"); $this->cloudinary_url_assertion("test", $options, CloudinaryTest::DEFAULT_UPLOAD_PATH . "sp_some-profile/test"); }
[ "public function getIccProfileStream() {}", "public function profile()\n {\n }", "function get_streaming_profile($name, $options=array()) {\n $uri = array(\"streaming_profiles/\" . $name);\n return $this->call_api(\"get\", $uri, array(), $options);\n }", "function create_streaming_profile($name, $options = array()) {\n $uri = array(\"streaming_profiles\");\n $params = $this->prepare_streaming_profile_params($options);\n $params[\"name\"] = $name;\n return $this->call_api(\"post\", $uri, $params, $options);\n }", "public function testProfileCreateChangeStreamGetProfilesChangeStream()\n {\n\n }", "public function test_profileCreateChangeStreamGetProfilesChangeStream() {\n\n }", "public function testProfileRead()\n {\n }", "public function getProfile()\n {\n }", "public function profiles();", "function _profileLoad(){\n global $conf;\n $profiles = $conf['metadir'].'/sync.profiles';\n if(file_exists($profiles)){\n $this->profiles = unserialize(io_readFile($profiles,false));\n }\n }", "public function getUserProfile()\n {\n }", "function _profileSave(){\n global $conf;\n $profiles = $conf['metadir'].'/sync.profiles';\n io_saveFile($profiles,serialize($this->profiles));\n }", "private function write_single_profile($profile) {\n //$this -> write_aliases($profile['id']);\n //$this -> write_domains($profile['id']);\n //$this -> write_gateways($profile['id']);\n $this -> write_settings($profile['id']);\n //$this -> xmlw -> endElement(); //reserved for multi-profile\n }", "public function readProfile($offset) {\n $this->setDataOffset($offset + $this->headers['profile_offset']);\n\n $profile = array();\n\n $profile['component_id'] = FileReader::readByte($this->dataFile);\n $profile['unique_id'] = FileReader::readInt($this->dataFile);\n $profile['profile_value_count'] = FileReader::readInt($this->dataFile);\n $profile['signature_count'] = FileReader::readInt($this->dataFile);\n $profile['profile_values'] = array();\n for ($i = 0; $i < $profile['profile_value_count']; $i++) {\n $profile['profile_values'][] = FileReader::readInt($this->dataFile);\n }\n\n return $profile;\n }", "public function testProfileCreateChangeStreamPostProfilesChangeStream()\n {\n\n }", "public function testProfile() {\n $profile = <<<PROFILE_TEST\ncore_version_requirement: '*'\nname: The Perfect Profile\ntype: profile\ndescription: 'This profile makes Drupal perfect. You should have no complaints.'\nPROFILE_TEST;\n\n vfsStream::setup('profiles');\n vfsStream::create([\n 'fixtures' => [\n 'invalid_profile.info.txt' => $profile,\n ],\n ]);\n $info = $this->infoParser->parse(vfsStream::url('profiles/fixtures/invalid_profile.info.txt'));\n $this->assertFalse($info['core_incompatible']);\n }", "function stream_get_meta_data($stream)\n{\n if (\\PhowerTest\\Http\\StreamTest::$streamGetMetaDataReturns !== null) {\n return \\PhowerTest\\Http\\StreamTest::$streamGetMetaDataReturns;\n }\n return \\stream_get_meta_data($stream);\n}", "protected function loadProfile()\n {\n }", "public function getStream()\r\n {\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows or not to continue if the user is or not in exammode.
public static function exammode_check() { global $SCRIPT, $USER, $CFG; if (isset($USER->id)) { $manager = \local_exammode\manager::get_instance(); if ($manager->is_user_in_exammode($USER->id)) { redirect( $CFG->wwwroot, get_string('nauthz_exammode', 'local_exammode', $SCRIPT), 5, \core\output\notification::NOTIFY_INFO ); } } }
[ "function check_userquiz_monitor_review_applicability($attemptobj) {\n\n $course = $attemptobj->get_course();\n\n if ($config = block_userquiz_monitor_check_has_quiz($course, $attemptobj->get_quizid())) {\n if ($config->directreturn && ($config->mode == 'exam')) {\n if ($config->examdeadend) {\n $params = array('id' => $course->id, 'blockid' => $config->uqm->id);\n redirect(new moodle_url('/blocks/userquiz_monitor/examfinish.php', $params));\n } else {\n redirect(new moodle_url('/course/view.php', array('id' => $course->id)));\n }\n }\n }\n}", "public function startedQuiz() {\n\t\tif (isset($_POST[self::$startQuiz])) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function canAdvance()\n {\n if ( $this->atWar() ||\n ( $this->getStepsFromWar() === 1 && !$this->getActive() ) )\n {\n return false;\n } else \n {\n return true;\n }\n }", "public function autospeakEnabled(){\r\n//checks if quiz is in multi options mode\r\nif($this->Get_Quiz_Data('autospeak') == 1) return true;\r\nreturn false; //else\r\n}", "public function checkPractise()\n {\n // do double check, to be sure this is called only on practice mode\n if ($this->practiceMode == false) return;\n\n foreach ($this->storage->players as $login => $player) {\n // if player has been forced to spectate, release to play\n if ($player->forceSpectator == 1) {\n $this->connection->forceSpectator($login, 0);\n $this->connection->forceSpectator($login, 2);\n }\n // if author has made the current map, force to specate\n if ($this->storage->currentMap->author == $login) {\n $this->eXpChatSendServerMessage(\"[YOLOcup notice] You are not allowed to practice, since you're the author of this map!\",\n $login);\n $msg = \"[YOLOcup notice]Player \" . $player->nickName . '$z$s is forced to spec since rule: author of the map on practice mode is not allowed to play!';\n $ag = AdminGroups::getInstance();\n $ag->announceToPermission(\"yolo_admin\", $msg);\n $this->connection->forceSpectator($login, 1);\n }\n }\n }", "private function is_advance() {\n\t\t$step = Param::request( 'step' );\n\t\treturn $step && in_array( $step, [ 'role', 'redirection', 'schema-markup' ], true );\n\t}", "function confirmExpertMode()\n\t{\n\t\tglobal $ilCtrl, $tpl, $lng, $ilTabs;\n\t\t\n\t\t$ilTabs->setTabActive(\"sahs_sequencing\");\n\t\t\t\n\t\tinclude_once(\"./Services/Utilities/classes/class.ilConfirmationGUI.php\");\n\t\t$cgui = new ilConfirmationGUI();\n\t\t$cgui->setFormAction($ilCtrl->getFormAction($this));\n\t\t$cgui->setHeaderText($lng->txt(\"sahs_activate_expert_mode_info\"));\n\t\t$cgui->setCancel($lng->txt(\"cancel\"), \"showSequencing\");\n\t\t$cgui->setConfirm($lng->txt(\"sahs_activate_expert_mode\"), \"activateExpertMode\");\n\t\t\n\t\t$tpl->setContent($cgui->getHTML());\n\t}", "function demo_check() {\n\n\tif (defined('DESKPRO_DEBUG_DEMOMODE')) {\n\t\tmistake(DP_NAME . ' is currently running in DEMO MODE. This action was cancelled and was not processed or saved.');\n\t}\n}", "public function gradeExam() {\n $data = $this->loadResults();\n // do grading\n $this->dData = $data;\n if (isset($this->input[\"m\"])) {\n $m = $this->input[\"m\"];\n if ($m == \"done\")\n $this->dData[\"message\"] = \"There are no more of that question to grade.\";\n else if ($m == \"checkin\")\n $this->dData[\"message\"] = \"Ungraded questions checked in.\";\n else if ($m == \"submitall\")\n $this->dData[\"message\"] = \"Any unsubmitted assessments have been submitted.\";\n }\n\n return $this->display(\"gradehome\");\n }", "function isAdvance(){\n return ($this->status == 'advance');\n }", "private function prevent_direct_user_input() {\n global $DB, $USER, $COURSE;\n\n $cansubmit = has_capability('mod/surveypro:submit', $this->context);\n $canseeotherssubmissions = has_capability('mod/surveypro:seeotherssubmissions', $this->context);\n $canignoremaxentries = has_capability('mod/surveypro:ignoremaxentries', $this->context);\n $caneditotherssubmissions = has_capability('mod/surveypro:editotherssubmissions', $this->context);\n $caneditownsubmissions = has_capability('mod/surveypro:editownsubmissions', $this->context);\n\n if (($this->view == SURVEYPRO_READONLYRESPONSE) || ($this->view == SURVEYPRO_EDITRESPONSE)) {\n $where = array('id' => $this->get_submissionid());\n if (!$submission = $DB->get_record('surveypro_submission', $where, '*', IGNORE_MISSING)) {\n throw new \\moodle_exception('incorrectaccessdetected', 'mod_surveypro');\n }\n if ($submission->userid != $USER->id) {\n $groupmode = groups_get_activity_groupmode($this->cm, $COURSE);\n if ($groupmode == SEPARATEGROUPS) {\n $utilitysubmissionman = new utility_submission($cm, $surveypro);\n $mygroupmates = $utilitysubmissionman->get_groupmates($this->cm);\n // If I am a teacher, $mygroupmates is empty but I still have the right to see all my students.\n if (!$mygroupmates) { // I have no $mygroupmates. I am a teacher. I am active part of each group.\n $groupuser = true;\n } else {\n $groupuser = in_array($submission->userid, $mygroupmates);\n }\n }\n }\n }\n\n switch ($this->view) {\n case SURVEYPRO_NEWRESPONSE:\n $timenow = time();\n $allowed = $cansubmit;\n if ($this->surveypro->timeopen) {\n $allowed = $allowed && ($this->surveypro->timeopen < $timenow);\n }\n if ($this->surveypro->timeclose) {\n $allowed = $allowed && ($this->surveypro->timeclose > $timenow);\n }\n\n if (!$canignoremaxentries) {\n // Take care! Let's suppose this scenario:\n // $this->surveypro->maxentries = N\n // $utilitylayoutman->has_submissions(true, SURVEYPRO_STATUSALL, $USER->id) = N - 1.\n // When I fill the FIRST page of a survey, I get $next = N\n // but when I go to fill the SECOND page of a survey I have one more \"in progress\" survey\n // that is the one that I created when I saved the FIRST page, so...\n // when $this->user_sent_submissions(SURVEYPRO_STATUSALL) = N, I get\n // $next = N + 1\n // and I am wrongly stopped here!\n // Because of this, I increase $next only if submissionid == 0.\n $utilitylayoutman = new utility_layout($this->cm, $this->surveypro);\n $next = $utilitylayoutman->has_submissions(true, SURVEYPRO_STATUSALL, $USER->id);\n if (!$this->get_submissionid()) {\n $next += 1;\n }\n\n $allowed = $allowed && (($this->surveypro->maxentries == 0) || ($next <= $this->surveypro->maxentries));\n }\n break;\n case SURVEYPRO_EDITRESPONSE:\n if ($USER->id == $submission->userid) {\n // Whether in progress, always allow.\n $allowed = ($submission->status == SURVEYPRO_STATUSINPROGRESS) ? true : $caneditownsubmissions;\n } else {\n if ($groupmode == SEPARATEGROUPS) {\n $allowed = $groupuser && $caneditotherssubmissions;\n } else { // NOGROUPS || VISIBLEGROUPS.\n $allowed = $caneditotherssubmissions;\n }\n }\n break;\n case SURVEYPRO_READONLYRESPONSE:\n if ($USER->id == $submission->userid) {\n $allowed = true;\n } else {\n if ($groupmode == SEPARATEGROUPS) {\n $allowed = $groupuser && $canseeotherssubmissions;\n } else { // NOGROUPS || VISIBLEGROUPS.\n $allowed = $canseeotherssubmissions;\n }\n }\n break;\n default:\n $allowed = false;\n }\n if (!$allowed) {\n throw new \\moodle_exception('incorrectaccessdetected', 'mod_surveypro');\n }\n }", "function learndash_can_attempt_again( $user_id, $quiz_id ) {\n\t$quizmeta = get_post_meta( $quiz_id, '_sfwd-quiz', true );\n\n\tif ( isset( $quizmeta['sfwd-quiz_repeats'] ) ) {\n\t\t$repeats = $quizmeta['sfwd-quiz_repeats'];\n\t} else {\n\t\t$repeats = '';\n\t}\n\n\t/**\n\t * Number of repeats for quiz\n\t *\n\t * @param int $repeats\n\t */\n\t$repeats = apply_filters( 'learndash_allowed_repeats', $repeats, $user_id, $quiz_id );\n\n\tif ( $repeats == '' ) {\n\t\treturn true;\n\t}\n\n\t$quiz_results = get_user_meta( $user_id, '_sfwd-quizzes', true );\n\n\t$count = 0;\n\n\tif ( ! empty( $quiz_results ) ) {\n\t\tforeach ( $quiz_results as $quiz ) {\n\t\t\tif ( $quiz['quiz'] == $quiz_id ) {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $repeats > $count - 1 ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function is_allow_multi_on_quiz() {\n\t\treturn true;\n\t}", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "function shouldLaunchWizard()\n {\n $done = request()->user()->wizard;\n if(!$done){\n return true;\n }\n return false;\n \n }", "protected function isInFullScreenMode()\n {\n return GeneralUtility::_GP('route') === '/wizard/rte';\n }", "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "public function is_require_enrollment() {\r\n\t\t$is_require = $this->course_enrolled_require;\r\n\t\t$is_require = empty( $is_require ) || ( $is_require == 'yes' ) ? true : false;\r\n\t\treturn apply_filters( 'learn_press_is_require_enrollment', $is_require, $this );\r\n\t}", "function userIsGuard() {\r\n\t\treturn false;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The public method set_contents_category_option adds contents category option
public function set_contents_category_option($category_slug, $args) { // Verify if the contents category option has valid fields if ( $category_slug && isset($args['name']) ) { // Verify if already an option with same category slug exists if ( !isset(self::$the_contents_categories_options[$category_slug]) ) { self::$the_contents_categories_options[$category_slug] = array(); } self::$the_contents_categories_options[$category_slug][] = $args; } }
[ "function md_set_contents_category($category_slug, $args) {\n\n // Call the contents_categories class\n $contents_categories = (new MidrubBaseClassesContents\\Contents_categories);\n\n // Set contents category in the queue\n $contents_categories->set_contents_category($category_slug, $args);\n \n }", "public function set_contents_category($category_slug, $args) {\n\n // Verify if the contents category has valid fields\n if ( $category_slug && isset($args['category_name']) && isset($args['category_icon']) ) {\n\n self::$the_contents_categories[][$category_slug] = $args;\n \n }\n\n }", "public function set_contents_category_meta($category_slug, $args) {\n\n // Verify if the contents category has valid fields\n if ( $category_slug && isset($args['name']) ) {\n\n // Verify if already a meta with same category slug exists\n if ( !isset(self::$the_contents_categories_meta[$category_slug]) ) {\n self::$the_contents_categories_meta[$category_slug] = array();\n }\n\n self::$the_contents_categories_meta[$category_slug][] = $args;\n \n }\n\n }", "function md_set_contents_category_meta($category_slug, $args) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if meta has a template\n if ( isset($args[\"template\"]) ) {\n\n // Verify if template doesn't meet the query template\n if ( $CI->input->get('template', true) === $args[\"template\"] ) {\n\n // Call the contents_categories class\n $contents_categories = (new MidrubBaseClassesContents\\Contents_categories);\n\n // Set contents category meta in the queue\n $contents_categories->set_contents_category_meta($category_slug, $args);\n \n }\n\n } else {\n\n // Call the contents_categories class\n $contents_categories = (new MidrubBaseClassesContents\\Contents_categories);\n\n // Set contents category meta in the queue\n $contents_categories->set_contents_category_meta($category_slug, $args);\n\n }\n \n }", "public function load_contents_by_category() {\n \n // Get contents\n (new MidrubBaseAdminCollectionFrontendHelpers\\Contents)->load_contents_by_category();\n \n }", "public function addCategory($options);", "public function set($section, $contents) {\n\t\t\t$this->{strtolower($section) . \"Content\"} = $contents;\n\t\t}", "function qa_db_category_set_content($categoryid, $content)\n{\n\tqa_db_query_sub(\n\t\t'UPDATE ^categories SET content=$ WHERE categoryid=#',\n\t\t$content, $categoryid\n\t);\n}", "public function getContentCategory()\n {\n return false;\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "function categories_options( $prefix, $title, $wp_customize ) {\n\tglobal $hrb_options;\n\n\t$wp_customize->add_section( 'hrb_'.$prefix.'_categories', array(\n\t\t'title' => $title,\n\t\t'priority' => 999,\n\t));\n\n\tif ( 'categories_menu' == $prefix ) {\n\n\t\t$wp_customize->add_setting( 'hrb_options['.$prefix.'][show]', array(\n\t\t\t'default' => 'yes',\n\t\t\t'type' => 'option',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'hrb_'.$prefix.'_show', array(\n\t\t\t\t'label' => __( 'Categories Menu Behavior', APP_TD ),\n\t\t\t\t'section' => 'hrb_'.$prefix.'_categories',\n\t\t\t\t'settings' => 'hrb_options['.$prefix.'][show]',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'choices' => array(\n\t\t\t\t\t'always' => __( 'Always Visible', APP_TD ),\n\t\t\t\t\t'click' => __( 'Visible on Click', APP_TD ),\n\t\t\t\t\t'' => __( 'Hide', APP_TD ),\n\t\t\t\t),\n\t\t\t\t'default' => 'click',\n\t\t\t) );\n\t}\n\n\t$wp_customize->add_setting( 'hrb_options['.$prefix.'][count]', array(\n\t\t'default' => $hrb_options->projects_per_page,\n\t\t'type' => 'option',\n\t) );\n\n\t$wp_customize->add_control( 'hrb_'.$prefix.'_count', array(\n\t\t'label' => __( 'Count Listings in Category', APP_TD ),\n\t\t'section' => 'hrb_'.$prefix.'_categories',\n\t\t'settings' => 'hrb_options['.$prefix.'][count]',\n\t\t'type' => 'checkbox',\n\t) );\n\n\t$wp_customize->add_setting( 'hrb_options['.$prefix.'][hide_empty]', array(\n\t\t'default' => '',\n\t\t'type' => 'option',\n\t) );\n\n\t$wp_customize->add_control( 'hrb_'.$prefix.'_hide_empty', array(\n\t\t'label' => __( 'Hide Empty Categories', APP_TD ),\n\t\t'section' => 'hrb_'.$prefix.'_categories',\n\t\t'settings' => 'hrb_options['.$prefix.'][hide_empty]',\n\t\t'type' => 'checkbox',\n\t) );\n\n\t$wp_customize->add_setting( 'hrb_options['.$prefix.'][depth]', array(\n\t\t'default' => 1,\n\t\t'type' => 'option',\n\t) );\n\n\t$wp_customize->add_control( 'hrb_'.$prefix.'_depth', array(\n\t\t'label' => __( 'Category Depth', APP_TD ),\n\t\t'section' => 'hrb_'.$prefix.'_categories',\n\t\t'settings' => 'hrb_options['.$prefix.'][depth]',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\t'999' => __( 'Show All', APP_TD ),\n\t\t\t'0' => '0',\n\t\t\t'1' => '1',\n\t\t\t'2' => '2',\n\t\t\t'3' => '3',\n\t\t\t'4' => '4',\n\t\t\t'5' => '5',\n\t\t\t'6' => '6',\n\t\t\t'7' => '7',\n\t\t\t'8' => '8',\n\t\t\t'9' => '9',\n\t\t\t'10' => '10',\n\t\t),\n\t) );\n\n\t$wp_customize->add_setting( 'hrb_options['.$prefix.'][sub_num]', array(\n\t\t'default' => $hrb_options->projects_per_page,\n\t\t'type' => 'option',\n\t) );\n\n\t$wp_customize->add_control( 'hrb_'.$prefix.'_sub_num', array(\n\t\t'label' => __( 'Number of Sub-Categories', APP_TD ),\n\t\t'section' => 'hrb_'.$prefix.'_categories',\n\t\t'settings' => 'hrb_options['.$prefix.'][sub_num]',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\t'999' => __( 'Show All', APP_TD ),\n\t\t\t'0' => '0',\n\t\t\t'1' => '1',\n\t\t\t'2' => '2',\n\t\t\t'3' => '3',\n\t\t\t'4' => '4',\n\t\t\t'5' => '5',\n\t\t\t'6' => '6',\n\t\t\t'7' => '7',\n\t\t\t'8' => '8',\n\t\t\t'9' => '9',\n\t\t\t'10' => '10',\n\t\t),\n\t) );\n}", "public function settingsController_addEditCategory_handler($sender) {\n // Only put the checkbox on edit. On creation the default value will be used.\n if ($sender->data('CategoryID')) {\n $sender->Data['_PermissionFields']['AllowFileUploads'] = ['Control' => 'CheckBox'];\n }\n }", "public function setCategory($category) {$this->category = $category;}", "function magpaper_is_blog_section_content_category_enable( $control ) {\n\t$content_type = $control->manager->get_setting( 'magpaper_theme_options[blog_content_type]' )->value();\n\treturn magpaper_is_blog_section_enable( $control ) && ( 'category' == $content_type );\n}", "function admin_add_category() {\n\t\t//\n\t}", "public function wpmediacategory_add_category_filter() {\r\n global $pagenow;\r\n if ( 'upload.php' == $pagenow ) {\r\n // Get taxonomy slug\r\n $taxonomy = $this->get_wpmlc_taxonomy();\r\n if ( $taxonomy != 'category' ) {\r\n $dropdown_options = array(\r\n 'taxonomy' => $taxonomy,\r\n 'class' => 'postform wpmlc-taxonomy-filter',\r\n 'name' => $taxonomy,\r\n 'show_option_all' => __( 'View all categories', 'wp-media-library-categories' ),\r\n 'hide_empty' => false,\r\n 'hierarchical' => true,\r\n 'orderby' => 'name',\r\n 'show_count' => true,\r\n 'walker' => new wpmediacategory_walker_category_filter(),\r\n 'value' => 'slug'\r\n );\r\n } else {\r\n $dropdown_options = array(\r\n 'taxonomy' => $taxonomy,\r\n 'class' => 'postform wpmlc-taxonomy-filter',\r\n 'show_option_all' => __( 'View all categories', 'wp-media-library-categories' ),\r\n 'hide_empty' => false,\r\n 'hierarchical' => true,\r\n 'orderby' => 'name',\r\n 'show_count' => false,\r\n 'walker' => new wpmediacategory_walker_category_filter(),\r\n 'value' => 'id'\r\n );\r\n }\r\n wp_dropdown_categories( $dropdown_options );\r\n }\r\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function mp_category_meta_box_markup( $post ) {\n\twp_nonce_field( basename( __FILE__ ), 'mp-category-nonce' );\n\t?>\n\t<select name=\"mp-category-dropdown\">\n\t\t<option disabled selected value> -- select a primary category -- </option>\n\t\t<?php\n\t\t$term_query = new WP_Term_Query( array( 'taxonomy' => 'category' ) );\n\t\tif ( ! empty( $term_query->terms ) ) {\n\t\t\tforeach ( $term_query->terms as $term ) {\n\t\t\t\t$primary_category = get_post_meta(\n\t\t\t\t\t$post->ID,\n\t\t\t\t\t'_minimal-primary-category',\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tif ( (int) $primary_category === $term->term_id ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<option selected value=\"<?php echo esc_attr( $term->term_id ); ?>\">\n\t\t\t\t\t\t<?php echo esc_textarea( $term->name ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<?php\n\t\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $term->term_id ); ?>\">\n\t\t\t\t\t\t<?php echo esc_textarea( $term->name ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t</select>\n\t<?php\n}", "function add_homepage_setting() {\r\n \r\n $setting = $this->input->post();\r\n \r\n if(isset($setting['category_select'])) {\r\n $model_type = 2; //Menu item\r\n $this->delete_homepage_product($model_type);\r\n $this->add_homepage_product($setting['category_select'], $model_type);\r\n }else{\r\n $model_type = 2; //Menu item\r\n $this->delete_homepage_product($model_type);\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepare orderDataArray with order info.
private function _setOrderDataArray() { foreach ($this->orderCollection->getItems() as $order){ $this->_prepareOrderStatusArray($order); $this->_prepareOrderPaymentArray($order); $this->_prepareOrderTrackingArray($order); $this->_prepareOrderProductsArray($order); } }
[ "private function _prepareOrderData()\n {\n foreach( $this->getOrderItems() as $item )\n {\n if( $item->getProductType() == 'virtual' )\n $this->_hasDigitalProducts = true;\n\n if( $item->getQtyBackordered() )\n $this->_hasBackOrder = true;\n }\n }", "public function prepareForStorage($orderData);", "private function prepareOrderData($raw_data)\n {\n $prepared_data = [\n 'history' => []\n ];\n \n $accepted_keys = [\n 'tracking_number', 'status', 'subtotal', 'shipping', 'tax', 'fee',\n 'insurance', 'discount', 'total', 'shipping_fee', 'insurance_fee',\n 'transaction_fee'\n ];\n \n foreach ($accepted_keys as $key) {\n $prepared_data[$key] = (!empty($raw_data[$key]) ? $raw_data[$key] : '');\n }\n \n if (!empty($raw_data['tat'])) {\n foreach ($raw_data['tat'] as $status => $timestamp) {\n $prepared_data['history'][$timestamp] = [\n 'date' => date('Y-m-d H:i:s.u', intval($timestamp)),\n 'status' => $status\n ];\n }\n \n ksort($prepared_data['history']);\n $prepared_data['history'] = array_values($prepared_data['history']);\n }\n \n return $prepared_data;\n }", "public function prepare_order(array $order);", "private function _prepareOrderPaymentArray(\\Magento\\Sales\\Model\\Order $order)\n {\n $paymentInstance = $this->paymentHelper->getMethodInstance($order->getPayment()->getMethod());\n\n $this->orderDataArray['payment_title'] = [\n 'label' => __(\"Payment Title\"),\n 'value' => $paymentInstance->getTitle()\n ];\n }", "protected function prepareData()\n {\n \n foreach ($this->data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->urlPath = $value;\n break;\n case 'paramName':\n $this->paramName = $value;\n break;\n default:\n $this->additionalData[$key] = $value;\n break;\n }\n }\n }", "protected function preparePurchaseData()\n {\n if (!empty($this->invoice->getDetails()['description'])) {\n $description = $this->invoice->getDetails()['description'];\n } else {\n $description = $this->settings->description;\n }\n\n $payerId = $this->invoice->getDetails()['payerId'] ?? 0;\n\n return array(\n 'terminalId' => $this->settings->terminalId,\n 'userName' => $this->settings->username,\n 'userPassword' => $this->settings->password,\n 'callBackUrl' => $this->settings->callbackUrl,\n 'amount' => $this->invoice->getAmount() * 10, // convert to rial\n 'localDate' => Carbon::now()->format('Ymd'),\n 'localTime' => Carbon::now()->format('Gis'),\n 'orderId' => crc32($this->invoice->getUuid()),\n 'additionalData' => $description,\n 'payerId' => $payerId\n );\n }", "public function prepareData()\n {\n foreach ($this->data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->urlPath = $value;\n break;\n case 'paramName':\n $this->paramName = $value;\n break;\n default:\n $this->additionalData[$key] = $value;\n break;\n }\n }\n }", "private function _prepareOrderTrackingArray(\\Magento\\Sales\\Model\\Order $order)\n {\n $this->orderDataArray['track']['label'] = __(\"Tracking Number\");\n\n foreach ($order->getTracksCollection()->getItems() as $track) {\n $this->orderDataArray['track']['value'][$track->getTrackNumber()] = $this->shippingHelper->getTrackingPopupUrlBySalesModel($track);\n }\n }", "public function getOrderData()\n {\n $data = [];\n $data['Contents'] = $this->getOrderContents();\n $data['Transit'] = $this->getOrderTransit();\n $data['Shipper'] = $this->getOrderShipper();\n $data['Value'] = $this->getOrderValue();\n\n return $data;\n }", "protected function preparePurchaseData()\n {\n if (!empty($this->invoice->getDetails()['description'])) {\n $description = $this->invoice->getDetails()['description'];\n } else {\n $description = $this->settings->description;\n }\n\n return array(\n 'LoginAccount' => $this->settings->merchantId,\n 'Amount' => $this->invoice->getAmount() * 10, // convert to rial\n 'OrderId' => crc32($this->invoice->getUuid()),\n 'CallBackUrl' => $this->settings->callbackUrl,\n 'AdditionalData' => $description,\n );\n }", "private function prepareConsignment()\r\n {\r\n $this->extractItemDetailsOfOrder();\r\n $this->setTotals();\r\n $this->setCourier();\r\n }", "public function organizeData()\n {\n $this->data = [\n 'date6'=>['value'=> $this->timeData['pay_time']],// 成交时间\n 'character_string1'=>['value'=> $this->checkDataLength($this->order->order_sn,32)],//订单号\n 'thing3'=>['value'=> $this->checkDataLength($this->member->nickname,20)],//购买者\n 'thing4'=>['value'=> $this->checkDataLength($this->goodsTitle,20)],// 购买商品\n 'number5'=>['value'=> $this->goodsNum],// 购买数量\n ];\n }", "private function buildMetaData()\n {\n $this->data['salesOrder']['SalesTable'] = [\n 'CustAccount' => $this->order->getCustomersId(),\n 'EOrderNumber' => $this->order->getId(),\n 'PaymentId' => $this->getPaymentTransactionId(),\n 'HomePartyId' => $this->getAttribute('global', 'HomePartyId'),\n 'SalesResponsible' => $this->getAttribute('global', 'SalesResponsible'),\n 'CurrencyCode' => $this->order->getCurrencyCode(),\n 'SalesName' => $this->order->getCustomersName(),\n 'InvoiceAccount' => $this->order->getCustomersId(),\n 'FreightType' => $this->order->getDeliveryMethod(),\n 'FreightFeeAmt' => $this->calculateCost(['shipping']),\n 'HandlingFeeAmt' => $this->calculateCost(['shipping.fee', 'payment.fee']),\n 'PayByBillFeeAmt' => $this->calculateCost(['payment']),\n 'BankAccountNumber' => $this->getAttribute('payment', 'bank_account_no'),\n 'BankId' => $this->getAttribute('payment', 'bank_id'),\n 'DeliveryDropPointId' => $this->order->getDeliveryExternalAddressId(),\n 'DeliveryCompanyName' => $this->order->getDeliveryCompanyName(),\n 'DeliveryCity' => $this->order->getDeliveryCity(),\n 'DeliveryName' => $this->order->getDeliveryFullName($this->translator),\n 'DeliveryStreet' => $this->order->getDeliveryAddressLine1(),\n 'DeliveryZipCode' => $this->order->getDeliveryPostalCode(),\n 'DeliveryCountryRegionId' => $this->getIso2CountryCode($this->order->getDeliveryCountriesId()),\n\n // static info\n 'Completed' => 1,\n 'HandlingFeeType' => 90,\n 'PayByBillFeeType' => 91,\n 'SalesType' => 'Sales',\n 'TransactionType' => 'Write',\n ];\n\n // CustAccount needs to be set before we set the CustPaymMode.\n $this->data['salesOrder']['SalesTable']['CustPaymMode'] = $this->getCustPaymMode();\n\n // purge empty\n foreach ($this->data['salesOrder']['SalesTable'] as $key => $value) {\n // some needs to be there - and empty ... ??\n if (in_array($key, ['SmoreContactInfo'])) {\n continue;\n }\n\n if (empty($value)) {\n unset($this->data['salesOrder']['SalesTable'][$key]);\n }\n }\n\n // only set SalesGroup on event orders.\n if ($this->order->getEventsId() && ($event = $this->order->getEvents($this->getDBConnection()))) {\n $st['SalesGroup'] = $event\n ->getCustomersRelatedByConsultantsId($this->getDBConnection())\n ->getConsultants($this->getDBConnection())\n ->getInitials();\n }\n }", "public function prepareData()\n {\n // Get the payment token\n $this->paymentToken = $this->vaultHandler->getLastSavedCard();\n\n // Get the instant purchase option\n $this->instantPurchaseOption = $this->loadOption();\n\n // Get the shipping and billing data\n if ($this->instantPurchaseOption) {\n $this->shippingAddress = $this->instantPurchaseOption->getShippingAddress();\n $this->billingAddress = $this->instantPurchaseOption->getBillingAddress();\n $this->shippingMethod = $this->instantPurchaseOption->getShippingMethod();\n }\n }", "public function prepareOrderDetailsGroupedByCustomer($orderDetails): array\n {\n $preparedOrderDetails = [];\n foreach ($orderDetails as $orderDetail) {\n $key = $orderDetail->id_customer;\n $preparedOrderDetails[$key]['sum_price'] = $orderDetail->sum_price;\n $preparedOrderDetails[$key]['sum_amount'] = $orderDetail->sum_amount;\n $preparedOrderDetails[$key]['sum_deposit'] = $orderDetail->sum_deposit;\n $preparedOrderDetails[$key]['order_detail_count'] = $orderDetail->order_detail_count;\n $preparedOrderDetails[$key]['customer_id'] = $key;\n $preparedOrderDetails[$key]['name'] = Configure::read('app.htmlHelper')->getNameRespectingIsDeleted($orderDetail->customer);\n $preparedOrderDetails[$key]['email'] = '';\n if ($orderDetail->customer) {\n $preparedOrderDetails[$key]['email'] = $orderDetail->customer->email;\n }\n $productsPickedUp = false;\n if (!empty($orderDetail->pickup_day_entity)) {\n $preparedOrderDetails[$key]['comment'] = $orderDetail->pickup_day_entity->comment;\n $preparedOrderDetails[$key]['products_picked_up_tmp'] = $orderDetail->pickup_day_entity->products_picked_up;\n }\n if (!isset($preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'])) {\n $preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'] = 0;\n }\n $preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'] = $orderDetail->timebased_currency_order_detail_seconds_sum;\n if (isset($preparedOrderDetails[$key]['products_picked_up_tmp']) && $preparedOrderDetails[$key]['products_picked_up_tmp']) {\n $productsPickedUp = true;\n $preparedOrderDetails[$key]['row_class'] = ['selected'];\n }\n $preparedOrderDetails[$key]['products_picked_up'] = $productsPickedUp;\n unset($preparedOrderDetails[$key]['products_picked_up_tmp']);\n }\n\n foreach($preparedOrderDetails as &$orderDetail) {\n $orderDetail['different_pickup_day_count'] = $this->getDifferentPickupDayCountByCustomerId($orderDetail['customer_id']);\n }\n return $preparedOrderDetails;\n }", "private function _setupDummyData()\n {\n $this->orderData = array(\n\n // 'charset' => 'ISO-8859-1',\n // 'currency' => 'SEK',\n 'description' => 'Payer Sdk Test ' . date('Y-m-d H:i:s'),\n 'reference_id' => base64_encode(rand()),\n 'test_mode' => true,\n\n 'customer' => array(\n 'identity_number' => '556736-8724',\n 'organisation' => 'Payer Financial Services AB',\n 'your_reference' => 'Test Reference',\n 'first_name' => 'Test',\n 'last_name' => 'Person',\n\n 'address' => array(\n 'address_1' => 'Testvägen 123',\n // 'address_2' => ''\n // 'co' => '',\n ),\n\n 'zip_code' => 12345,\n 'city' => 'Teststaden',\n 'country_code' => 'SE',\n\n 'phone' => array(\n 'home' => '1234567890',\n 'work' => '0987654321',\n 'mobile' => '111222333444'\n ),\n\n 'email' => 'demo@payer.se'\n ),\n\n // 'options' => array(\n // 'delivery_type' => '',\n // 'template_type' => 2,\n // 'style' => 'relax'\n // ),\n\n 'items' => array(\n array(\n 'type' => 'freeform',\n 'line_number' => 1,\n 'article_number' => 'ABC123',\n 'description' => \"This is an freeform description\",\n 'unit_price' => 40,\n 'unit_vat_percentage' => 20,\n 'quantity' => 10,\n 'unit' => null,\n // 'account' => null,\n // 'dist_agent_id' => null\n ),\n array(\n 'type' => 'infoline',\n 'line_number' => 2,\n 'article_number' => 'ABC123',\n 'description' => \"This is an infoline description\",\n // 'unit' => null,\n // 'account' => null,\n // 'dist_agent_id' => null\n )\n )\n\n );\n\n $this->purchaseData = array(\n 'payment' => array(\n 'language' => 'sv',\n 'method' => 'card',\n 'url' => array(\n 'authorize' => 'http://example.com/CallbackEndpointAuthorizeExample.php', // Authorization Resource\n 'settle' => 'http://example.com/CallbackEndpointSettlementExample.php', // Settlement Resource\n 'redirect' => 'http://example.com',\n 'success' => 'http://example.com'\n )\n ),\n 'purchase' => $this->orderData\n );\n\n }", "protected function sortDataArray() {}", "public function prepareData() {\n $this->criteria = new Criteria();\n\n foreach($this->options as $key=>$value) {\n switch($key) {\n case 'join': $this->criteria->setJoin($value);\n break;\n case 'condition': $this->criteria->setCondition($this->addConstant($value));\n break;\n case 'order': $this->criteria->setOrder($value);\n break;\n case 'limit': $this->criteria->setLimit($value);\n break;\n case 'params':\n $value = json_decode($value);\n\n foreach($value as $name => $param) {\n $this->criteria->addParam($name, $param);\n }\n break;\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update invoice setting logo
public function updateInvoiceSettingLogo() { //--logic for image upload if get else blank if (isset($_FILES['logo']) && !empty($_FILES['logo']['tmp_name'])){ $logoName = $this->CommonModel->imageUpload('logo','./uploads/companyLogo'); $this->CommonModel->createThumbnail($logoName); } else{ $logoName = ''; } //-- get params $invsetId = isset($this->requestData->invsetId)?$this->requestData->invsetId:""; $logoType = isset($this->requestData->logoType)?$this->requestData->logoType:""; $isactive = isset($this->requestData->isactive)?$this->requestData->isactive:""; try { //--call model function updateInvoiceSettingLogo $arrayResponse = $this->InvoiceModel->updateInvoiceSettingLogo($invsetId,$logoName,$logoType,$isactive); if(empty($arrayResponse)) throw new Exception('Response not get, please try again.'); } catch (Exception $e) { echo $this->CommonModel->getJsonData(array('success'=> false, 'message' => $e->getMessage())); exit(); } //-- convert arrayResponse to json echo $this->CommonModel->getJsonData($arrayResponse); }
[ "public function editlogo()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'setting', 'update')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_FILES)) {\n\t\t\tif(!empty($_FILES['picture']['tmp_name'])){\n\t\t\t\tif (file_exists('../'.DIR_INC.'/images/logo.png')){\n\t\t\t\t\tunlink('../'.DIR_INC.'/images/logo.png');\n\t\t\t\t}\n\t\t\t\t$upload = new PoUpload($_FILES['picture']);\n\t\t\t\tif ($upload->uploaded) {\n\t\t\t\t\t$upload->file_new_name_body = 'logo';\n\t\t\t\t\t$upload->image_convert = 'png';\n\t\t\t\t\t$upload->process('../'.DIR_INC.'/images/');\n\t\t\t\t\tif ($upload->processed) {\n\t\t\t\t\t\t$setting = array(\n\t\t\t\t\t\t\t'value' => $upload->file_dst_name\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$query_setting = $this->podb->update('setting')\n\t\t\t\t\t\t\t->set($setting)\n\t\t\t\t\t\t\t->where('id_setting', '12');\n\t\t\t\t\t\t$query_setting->execute();\n\t\t\t\t\t\t$upload->clean();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->poflash->success($GLOBALS['_']['setting_message_3'], 'admin.php?mod=setting#image');\n\t\t\t} else {\n\t\t\t\t$this->poflash->error($GLOBALS['_']['setting_message_4'], 'admin.php?mod=setting#image');\n\t\t\t}\n\t\t}\n\t}", "public function changelogo()\n\t {\t\n\t\t\t$this->_chk_if_login();\n\t\t\t$where = array('id'=>$this->session->userdata('admin_id'));\n\t $config['edit_data'] = $this->Admin_model->getSingle(ADMIN,$where);\n\t\t\n\t\t\t$this->load->view('admin/changelogo',$config);\n\t }", "public function setLogo($value)\n {\n $this->logo = $value;\n }", "public function setLogo($logo)\n {\n $this->logo = $this->savePhoto($logo,'brand');\n\n \n }", "private function updateLogo()\n {\n if ($this->isLogoUploaded()) {\n $oLogo = new FileStorageImage($_FILES['logo']['tmp_name']);\n if (!$oLogo->validate()) {\n \\PFBC\\Form::setError('form_setting', Form::wrongImgFileTypeMsg());\n $this->bIsErr = true;\n } else {\n /**\n * @internal File::deleteFile() first tests if the file exists, and then deletes it.\n */\n $sPathName = PH7_PATH_TPL . PH7_TPL_NAME . PH7_DS . PH7_IMG . self::LOGO_FILENAME;\n $this->file->deleteFile($sPathName); // It erases the old logo.\n $oLogo->dynamicResize(self::LOGO_WIDTH, self::LOGO_HEIGHT);\n $oLogo->save($sPathName);\n\n // Clear CSS cache, because the logo is stored with data URI in the CSS cache file\n $this->file->deleteDir(PH7_PATH_CACHE . Gzip::CACHE_DIR);\n\n // Clear the Web browser's cache\n $this->browser->noCache();\n }\n }\n }", "function wpec_change_logo() {\n\t$options = get_option( 'wpec_gd_options_array' );\n\n\tif( ! empty( $options['gd_logo_upload'] ) ) :\n\t?>\n\t<style>\n\th1#logo a {\n\t\tbackground: url( '<?php echo esc_url( $options['gd_logo_upload'] ); ?>' ) no-repeat;\n\t}\n\t</style>\n\t<?php\n\tendif;\n}", "public function logo()\n\t{\n\t\t$url_path\t= $this->assets->assets_url();\n\t\t\n\t\tif(!empty($_POST['banner']))\n\t\t{\n\t\t\t$banner = str_replace(\"$url_path/\",'', $_POST['banner']);\n\t\t\t\n\t\t\t$site = ORM::factory('site', $this->site_id);\n\t\t\t$site->banner = $banner;\n\t\t\t$site->save();\n\n\t\t\tif(yaml::edit_site_value($this->site_name, 'site_config', 'banner', $banner))\n\t\t\t\tdie('Banner changed.'); # success\t\t\t\n\t\t}\n\t\t\n\t\t$primary = new View(\"theme/logo\");\t\t\n\t\t$primary->img_path = $url_path;\n\t\tdie($primary);\n\t}", "public function setCasemakerLogoAttribute($value){\n\n \t\t //$this->deleteImage($this->attributes['casemaker_logo']);\n\n \t\t $this->attributes['casemaker_logo']= $value;\n \t}", "function updateClubModuleLogo($params){\n $this->query(\"\n UPDATE\n `{$this->_sPrefix}{$this->_sTableMain}`\n SET \n `icon` = '{$params['logo']}'\n WHERE\n `id` = '{$params['club_id']}'\n \");\n }", "function _sync_custom_logo_to_site_logo( $value ) {\n\tif ( empty( $value ) ) {\n\t\tdelete_option( 'site_logo' );\n\t} else {\n\t\tupdate_option( 'site_logo', $value );\n\t}\n\n\treturn $value;\n}", "public function setLogo($value) {\n return $this->set(self::LOGO, $value);\n }", "public function save_logo_url() {\n $url = comparrot_var( 'url' );\n\n update_option( 'compt-logo', $url );\n\n wp_send_json_success(\n [\n 'msg' => __( 'Logo uploaded succesfully', 'comparrot' ),\n ]\n );\n exit;\n }", "function _delete_site_logo_on_remove_custom_logo($old_value, $value)\n {\n }", "public function setLogo($logo)\n {\n $this->logo = $logo;\n }", "public function update_logo()\n {\n if ($this->isLoggedIn()) {\n if ($_FILES) {\n $id = 1;\n $this->Admin_model->update_logo($id);\n echo json_encode(([\"msg_type\" => \"success\", \"message\" => \"Logo Updated Successfully\"]));\n }\n } else {\n redirect(base_url());\n }\n }", "public function setLogo($logo) {\n\t\t$this->logo = $logo;\n\t}", "function set_secondary_logo($wp_customize) {\n\n\t// add a setting \n\t$wp_customize->add_setting('secondary_logo');\n\t \n\t// Add a control to upload the hover logo\n\t$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'secondary_logo', array(\n\t\t'label' => 'Logo Secundário',\n\t\t'section' => 'title_tagline', //this is the section where the custom-logo from WordPress is\n\t\t'settings' => 'secondary_logo',\n\t\t'priority' => 8 // show it just below the custom-logo\n\t)));\n}", "public function generate_company_logo_meta()\n {\n }", "function setLogoPointer($conn, $filename)\n{\n\t$vendorId = $_SESSION['vendorId'];\n\t$conn->connectToDatabase();\n\t$sql = 'UPDATE Vendor SET vendorLogoImageName = \"logo.png\" WHERE vendorId = '.$vendorId.' ';\n\tif(!($conn->insertData($sql)))\n\t{\n\t\treturn false;\n\t}else\n\t\t{\n\t\treturn true;\n\t\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts a vendor specific int|string and converts that into a loadBalancer object. If the loadBalancer does not exist in the platform, then an exception should be thrown.
public function convertToLoadBalancer($loadBalancer);
[ "abstract public function describeLoadBalancer();", "public function get($load_balancer);", "public function bridgeLoad( $class_name ){\r\n\t!defined('BAY_OMIT_CONTROLLER_CONSTRUCT') && define('BAY_OMIT_CONTROLLER_CONSTRUCT',true);\r\n\tif( !isset($this->bridge) ){\r\n\t require_once 'iSellBase.php';\r\n\t $this->bridge=new iSellBase();\r\n\t}\r\n\treturn $this->bridge->LoadClass($class_name);\r\n }", "public function LoadBalancerService($name = null, $region = null, $urltype = null)\n {\n return $this->Service('LoadBalancer', $name, $region, $urltype);\n }", "function translate_resource_components_to_instance_type($cpu, $memory) {\n\n\t\tif ($this->account_type == 'lc-openstack') {\n\t\t\t$available_sizes = $this->get_sizes();\n\t\t\tforeach ($available_sizes as $k => $size) {\n\t\t\t\tif (($size['cpu'] == $cpu) && ($size['memory'] == $memory)) {\n\t\t\t\t\treturn $size['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// we did not found a correct fitting size, try to get a close as possible\n\t\t\t$mem_difference = 999999999999999999999999;\n\t\t\t$best_size = 0;\n\t\t\tforeach ($available_sizes as $k => $size) {\n\t\t\t\tif ($size['cpu'] == $cpu) {\n\t\t\t\t\tif ($size['memory'] >= $memory) {\n\t\t\t\t\t\tif (($size['memory'] - $memory) < $mem_difference) {\n\t\t\t\t\t\t\t$mem_difference = $size['memory'] - $memory;\n\t\t\t\t\t\t\t$best_size = $k;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $available_sizes[$best_size]['name'];\n\t\t}\n\t\t\n\t\tif ($this->account_type == 'lc-azure') {\n\t\t\t$available_sizes = $this->get_sizes();\n\t\t\tforeach ($available_sizes as $k => $size) {\n\t\t\t\tif ($size['memory'] == $memory) {\n\t\t\t\t\treturn $size['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// we did not found a correct fitting size, try to get a close as possible\n\t\t\t$mem_difference = 999999999999999999999999;\n\t\t\t$best_size = 0;\n\t\t\tforeach ($available_sizes as $k => $size) {\n\t\t\t\tif ($size['memory'] >= $memory) {\n\t\t\t\t\tif (($size['memory'] - $memory) < $mem_difference) {\n\t\t\t\t\t\t$mem_difference = $size['memory'] - $memory;\n\t\t\t\t\t\t$best_size = $k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $available_sizes[$best_size]['id'];\n\n\t\t}\n\t\t\n\t\tif (($this->account_type == 'aws') || ($this->account_type == 'euca')) {\n\n\t\t\t$instance_type = 0;\n\t\t\t$instance_types[0] = 'm1.small';\n\t\t\t$instance_types[1] = 'm1.small';\n\t\t\t$instance_types[2] = 'm1.medium';\n\t\t\t$instance_types[3] = 'm1.large';\n\t\t\t$instance_types[4] = 'm1.xlarge';\n\t\t\t$instance_types[5] = 'm3.xlarge';\n\t\t\t$instance_types[6] = 'm3.2xlarge';\n\t\t\t$instance_types[7] = 'm2.xlarge';\n\t\t\t$instance_types[8] = 'm2.2xlarge';\n\t\t\t$instance_types[9] = 'm2.4xlarge';\n\n\t\t\tswitch($cpu) {\n\t\t\t\tcase '1':\n\t\t\t\t\t$instance_type = 0;\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\tif ($instance_type < 3) {\n\t\t\t\t\t\t$instance_type = 3;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\tif ($instance_type < 4) {\n\t\t\t\t\t\t$instance_type = 4;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t\t$instance_type = 6;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '16':\n\t\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t\t$instance_type = 6;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '32':\n\t\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t\t$instance_type = 6;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '64':\n\t\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t\t$instance_type = 6;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase '128':\n\t\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t\t$instance_type = 6;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ($memory > 615) {\n\t\t\t\tif ($instance_type < 1) {\n\t\t\t\t\t$instance_type = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($memory > 1700) {\n\t\t\t\tif ($instance_type < 2) {\n\t\t\t\t\t$instance_type = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($memory > 3750) {\n\t\t\t\tif ($instance_type < 3) {\n\t\t\t\t\t$instance_type = 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($memory > 7500) {\n\t\t\t\tif ($instance_type < 4) {\n\t\t\t\t\t$instance_type = 4;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($memory > 15000) {\n\t\t\t\tif ($instance_type < 5) {\n\t\t\t\t\t$instance_type = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($memory > 30000) {\n\t\t\t\tif ($instance_type < 6) {\n\t\t\t\t\t$instance_type = 6;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $instance_types[$instance_type];\n\t\t}\n\t}", "public function getByName(string $name): ?LoadBalancer\n {\n $loadBalancers = $this->list(new LoadBalancerRequestOpts($name));\n\n return (count($loadBalancers->load_balancers) > 0) ? $loadBalancers->load_balancers[0] : null;\n }", "private function convertLoadCarState($state)\n {\n switch ($state) {\n case 1:\n return LoadCar::USED_CAR;\n case 2:\n return LoadCar::NEW_CAR;\n case 3:\n return LoadCar::NOT_DRIVING_CAR;\n default:\n return LoadCar::DEFAULT_STATE;\n }\n }", "function binary_to_subnet($binary, $class = null)\n{\n if ($class === null) {\n return new Subnet(binary_to_long($binary));\n }\n\n if (is_object($class) && is_a($class, __NAMESPACE__ . '\\\\Subnet')) {\n $class = get_class($class);\n } else if (!is_subclass_of($class = (string)$class, __NAMESPACE__ . '\\\\Subnet')) {\n throw new \\InvalidArgumentException('Supplied class does not inherit ' . __NAMESPACE__ . '\\\\Subnet');\n }\n\n return new $class(binary_to_long($binary));\n}", "public function updateLoadBalancer($oa)\n {\n }", "public function loadBalancerList() {\n\t\t$url = \"/loadbalancers\";\n\n\t\t$response = $this->makeLbApiCall($url);\n\t\tif (isset($response['loadBalancers'])) {\n\t\t\treturn $response['loadBalancers'];\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getLoadBalancerPort()\n {\n return $this->_lbPort;\n }", "public function loadBalancers(): LoadBalancers\r\n {\r\n $lb = new LoadBalancers($this);\r\n return $lb;\r\n }", "public function create(array $parameters): NodeBalancer;", "private function convertLoadCityType($vieta)\n {\n return $vieta['ar_pasikrovimo'] ? LoadCity::LOADING : LoadCity::UNLOADING;\n }", "function healthstring_to_int($healthstring) {\n\n\t$healthint = intval(substr($healthstring, 0, -1));\n\treturn $healthstring;\n}", "public function get($load_balancer)\n {\n $resource = $this->connection->get(\"/load_balancers/{$load_balancer}\");\n return $this->load(['load_balancer' => $resource], 'LoadBalancer', 'load_balancer');\n }", "public static function detectAdapterClass() {\n\t\t\n\t\t$map = array(\n\t\t\t'Requests'\t\t\t=> 'xpl\\WebServices\\Client\\RequestsAdapter',\n\t\t\t'GuzzleHttp\\Client'\t=> 'xpl\\WebServices\\Client\\GuzzleAdapter',\n\t\t\t'Buzz\\Browser'\t\t=> 'xpl\\WebServices\\Client\\BuzzAdapter',\n\t\t);\n\t\t\n\t\tforeach($map as $library => $adapter) {\n\t\t\t\n\t\t\tif (class_exists($library, true)) {\n\t\t\t\treturn $adapter;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (ini_get('allow_url_fopen')) {\n\t\t\treturn 'xpl\\WebServices\\Client\\FopenAdapter';\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function LoadBalancer($id = null) \n {\n return new LoadBalancer($this, $id);\n }", "protected function normalize(string $value): int\n {\n if (is_numeric($value)) {\n return (int) $value;\n }\n return $this->registers[$value];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
builds a Day, unique by Date
public function build(\DateTime $date = null) { $date = $date ?: new \DateTime(); $date = clone $date; $date->modify('-' . $this->midnightHour . ' hours'); $key = $date->format('Y-m-d') . '|' . $date->getTimezone()->getName(); if (!isset($this->daysBuild[$key])) { $this->daysBuild[$key] = new Day($date); } return $this->daysBuild[$key]; }
[ "public function makeDay()\n {\n $randDay = strval(mt_rand(1, 28));\n \n if (mb_strlen($randDay, \"UTF-8\") === 1) {\n $day = '0'.$randDay;\n \n return($day);\n \n } else {\n $day = $randDay;\n \n return($day);\n }\n\n // Possible syntax for allowing for a proper number of days depending on the month\n // Generate a random day.\n // $the30s = [4, 6, 9, 11];\n // $the31s = [1, 3, 5, 7, 8, 10, 12];\n // $day = function makeDay($month)\n // {\n // if ($month = 2) {\n // $day = mt_rand(1, 28);\n // return();\n //\n // } elseif ($month = 4 | $month = 6 | $month = 9 | $month = 11) {\n // $day = mt_rand(1, 30);\n // return();\n // \n // } elseif ($month = 1 | $month = 3 | $month = 5 | $month = 7 | $month = 8 | $month = 10 | $month = 12) {\n // $day = mt_rand(1, 31);\n // return();\n // }\n // }\n }", "public static function createDay($date = null)\n\t{\n\t\t$newDay = new Day;\n\n\t\tif ($date != null)\n\t\t{\n\t\t\t$newDay->date = $date;\n\t\t} else {\n\t\t\t$newDay->date = Carbon::today();\n\t\t}\n\t\t$newDay->save();\n\n\t\treturn $newDay;\n\t}", "private static function getUniqueDay(string $date)\n {\n // Reset unavailable days, if all days in month already have been set as unavailable\n if (count(self::$unavailable_days) === (self::getLastDayOfMonth($date) - 1)) {\n self::$unavailable_days = [];\n }\n\n $day = rand(1, self::getLastDayOfMonth($date));\n\n // Reset day if it is in unavailable days array\n while (in_array($day, self::$unavailable_days)) {\n $day = rand(1, self::getLastDayOfMonth($date));\n }\n\n // Set day as unavailable\n array_push(self::$unavailable_days, $day);\n\n return $day ?? 'error';\n }", "public static function buildDay(): array\n {\n $results_array = array();\n\n while(true)\n {\n if(count($results_array) == 24)\n {\n break;\n }\n\n $results_array[count($results_array) + 1] = 0;\n }\n\n return $results_array;\n }", "function DDtoDay( $inputDate ) {\r\n\t\t $dateString = array(0 =>'','st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'); \r\n\t\t\t$returnDate = ''; \r\n\t\t\t$tempDate = intval($inputDate); \r\n\t\t\t\tif ($tempDate >= 1 && $tempDate <= 31){\r\n\t\t\t\t $returnDate = $inputDate . $dateString[$tempDate];\r\n\t\t\t}\r\n\t\t\treturn $returnDate;\r\n\t\t}", "function nextDay() {\n $next = Date::load($this);\n $next->seconds = 0; $next->day++;\n return $next;\n }", "function getNextDay(){\r\n $dia = Data_Calc::proxDia($this->dia, $this->mes, $this->ano, \"%Y-%m-%d\");\r\n $data = sprintf(\"%s %02d:%02d:%02d\", $dia, $this->hora, $this->minuto, $this->segundo);\r\n $newDate = new Date();\r\n $newDate->setData($data);\r\n return $newDate;\r\n }", "public function getDayBasedOnDate(){\n $timestamp = strtotime($this->date);\n $day = date('l', $timestamp);\n return $day;\n }", "public function build()\n {\n $week = new Week;\n for ($day = 1; $day <= $this->daysInMonth; ++$day) {\n $date = sprintf('%s-%s-%s', date('Y', strtotime($this->date)), date('m', strtotime($this->date)), $day);\n $cDay = new Day($day);\n $cDay->dayWeek = date('N', strtotime($date));\n $cDay->isToday = strtotime($date) == strtotime(date('Y-m-d'));\n // Data\n if (isset($this->dataDateField)) {\n for ($i = 0; $i < count($this->data); ++$i) {\n if ((\n is_array($this->data[$i])\n && $this->data[$i][$this->dataDateField]\n && strtotime($date) === strtotime($this->data[$i][$this->dataDateField])\n )\n || (\n is_object($this->data[$i])\n && $this->data[$i]->{$this->dataDateField}\n && strtotime($date) === strtotime($this->data[$i]->{$this->dataDateField})\n )\n )\n $cDay->data[] = $this->data[$i];\n }\n }\n // Check if we need to fill previous month days\n if ($day == 1 && $cDay->dayWeek > 1) {\n for ($dummyDay = 1; $dummyDay < $cDay->dayWeek; ++$dummyDay) {\n $week->days[] = new Day('');\n }\n }\n // Add day to calendar\n $week->days[] = $cDay;\n // Check if this is the last day to fill with dummies\n if ($day == $this->daysInMonth) {\n for ($dummyDay = $cDay->dayWeek + 1; $dummyDay <= 7; ++$dummyDay) {\n $week->days[] = new Day('');\n }\n }\n // Add row to calendar if days are full\n if (count($week->days) == 7) {\n $this->weeks[] = $week;\n $week = new Week;\n }\n }\n return $this;\n }", "protected function repeatedDatesByRelativeDayType()\n {\n $repeatedDates = array();\n\n $this->date->setTimestamp($this->begin);\n\n // Skip some months\n if ($this->begin < $this->from) {\n $from = $this->date->createNewWithSameI18nInfo();\n $from->setTimestamp($this->from);\n $this->date->setDay(1);\n $this->date->addMonth(ceil($this->date->diffAbsoluteMonth($from) / $this->ruleInfo['freq']) * $this->ruleInfo['freq']);\n $this->date->gotoNthDayOfMonth($this->ruleInfo['day'], $this->ruleInfo['position']);\n }\n\n while ($this->date->getTimestamp() <= $this->to) {\n if ($this->date->getTimestamp() >= $this->begin && $this->date->getTimestamp() >= $this->from) {\n $repeatedDates[] = $this->date->getDateWithExtendedYear();\n }\n\n // Prevent run date goes to next month\n $this->date->setDay(1)->addMonth($this->ruleInfo['freq']);\n $this->date->gotoNthDayOfMonth($this->ruleInfo['day'], $this->ruleInfo['position']);\n }\n\n return $repeatedDates;\n }", "protected function setRepeatedDays()\n {\n $repeatedDays = $this->stage->getRepeatedDays();\n\n $leftouts = $this->stage->getLeftouts();\n\n if($leftouts != null) {\n $rawLeftouts = explode(',', $leftouts);\n $dateLeftout = array();\n foreach($rawLeftouts as $r) {\n $dateLeftout[] = \\DateTime::createFromFormat('d/m/Y', $r);\n }\n }\n\n $startDate = $this->stage->getDepartureDate();\n $endDate = $this->stage->getArrivalDate();\n\n for($i = $startDate; $i <= $endDate; $i = $i->modify('+1 day')) {\n if(in_array($i->format('w'), $repeatedDays)) {\n $clonedDate = clone $i;\n\n $isLeftout = false;\n\n if(isset($dateLeftout)) {\n foreach ($dateLeftout as $d) {\n if($d->format('d/m/Y') == $clonedDate->format('d/m/Y')) $isLeftout = true;\n\n }\n }\n\n if($isLeftout === false) $this->repeatedDays[] = $clonedDate;\n }\n }\n return true;\n }", "function DateToDay($Date)\n {\n\treturn date(\"d\", strtotime($Date));\n }", "public function createIntervalDay(): DateContainerInterface\n {\n return $this->createFromFormat('Y-m-d');\n }", "public function setRepeatedDay($day)\n {\n $this->repeatedDay = $this->fixInt($day, 0, 9);\n\n return $this;\n }", "function CreateDateFromToday($day_zero, $n = 0) \n{\n $time_interval_string = \"P\" . $n . \"D\"; \n $day_zero_string = $day_zero->format('Y-m-d');\n $day = new DateTime($day_zero_string);\n date_add($day, new DateInterval($time_interval_string)); \n $day_name = $day->format('Y-m-d');\n return $day_name; \n}", "public function setDay($day)\n {\n $ts = $this->timestamp;\n $result = mktime(\n date('H', $ts),\n date('i', $ts),\n date('s', $ts),\n date('n', $ts),\n $day,\n date('Y', $ts)\n );\n return new Date($result, $this->timezone);\n }", "protected function seedDays()\n {\n $this->output->info('### Seeding days###');\n //%u\tISO-8601 numeric representation of the day of the week\t1 (for Monday) through 7 (for Sunday)\n $timestamp = strtotime('next Monday');\n $days = array();\n for ($i = 1; $i < 8; $i++) {\n $days[$i] = strftime('%A', $timestamp);\n $timestamp = strtotime('+1 day', $timestamp);\n }\n\n foreach ($days as $dayNumber => $day) {\n $this->output->info('### Seeding day: ' . $day . ' ###');\n $dayModel = Day::firstOrNew([\n 'code' => $dayNumber,\n ]\n );\n $dayModel->name = $day;\n $dayModel->code = $dayNumber;\n $dayModel->lective = true;\n if ($dayNumber == 6 || $dayNumber == 7) {\n $dayModel->lective = false;\n }\n $dayModel->save();\n }\n $this->output->info('### END Seeding days###');\n }", "public function addDay();", "private function getFirstDate()\n {\n $days = $this->getUniqueDays()->{0}->date;\n\n return $days;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the URL of the selected font, with Open Sans as a default
function example_font_url() { $face = get_theme_mod('body_typeface', 'noto' ); switch ( $face ) { case 'lora': return '//fonts.googleapis.com/css?family=Lora:400,400italic,700,700italic'; case 'merriweather': return '//fonts.googleapis.com/css?family=Merriweather:400,700,700italic,400italic,300italic,300,900,900italic'; case 'montserrat': return '//fonts.googleapis.com/css?family=Montserrat:400,700'; case 'opensans': return '//fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,700'; case 'oswald': return '//fonts.googleapis.com/css?family=Oswald:400,700,300'; default: return twentyfifteen_fonts_url(); } }
[ "function sls_get_font_url() {\n\t$font_url = '';\n\n\t/* translators: If there are characters in your language that are not supported\n\t by Open Sans, translate this to 'off'. Do not translate into your own language. */\n\tif ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'sls' ) ) {\n\t\t$subsets = 'latin,latin-ext';\n\n\t\t/* translators: To add an additional Open Sans character subset specific to your language, translate\n\t\t this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */\n\t\t$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'sls' );\n\n\t\tif ( 'cyrillic' == $subset )\n\t\t\t$subsets .= ',cyrillic,cyrillic-ext';\n\t\telseif ( 'greek' == $subset )\n\t\t\t$subsets .= ',greek,greek-ext';\n\t\telseif ( 'vietnamese' == $subset )\n\t\t\t$subsets .= ',vietnamese';\n\n\t\t$protocol = is_ssl() ? 'https' : 'http';\n\t\t$query_args = array(\n\t\t\t'family' => 'Open+Sans:400italic,700italic,400,700',\n\t\t\t'subset' => $subsets,\n\t\t);\n\t\t$font_url = add_query_arg( $query_args, \"$protocol://fonts.googleapis.com/css\" );\n\t}\n\n\treturn $font_url;\n}", "function wosci_get_font_url() {\n\t$font_url = '';\n\n\t/* translators: If there are characters in your language that are not supported\n\t by Open Sans, translate this to 'off'. Do not translate into your own language. */\n\tif ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'wosci-language' ) ) {\n\t\t$subsets = 'latin,latin-ext';\n\n\t\t/* translators: To add an additional Open Sans character subset specific to your language, translate\n\t\t this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */\n\t\t$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'wosci-language' );\n\n\t\tif ( 'cyrillic' == $subset )\n\t\t\t$subsets .= ',cyrillic,cyrillic-ext';\n\t\telseif ( 'greek' == $subset )\n\t\t\t$subsets .= ',greek,greek-ext';\n\t\telseif ( 'vietnamese' == $subset )\n\t\t\t$subsets .= ',vietnamese';\n\n\t\t$protocol = is_ssl() ? 'https' : 'http';\n\t\t$query_args = array(\n\t\t\t'family' => 'Open+Sans:400italic,700italic,400,700',\n\t\t\t'subset' => $subsets,\n\t\t);\n\t\t$font_url = add_query_arg( $query_args, \"$protocol://fonts.googleapis.com/css\" );\n\t}\n\n\treturn $font_url;\n}", "function twentytwelve_get_font_url() {\n $font_url = '';\n\n /* translators: If there are characters in your language that are not supported\n * by Open Sans, translate this to 'off'. Do not translate into your own language.\n */\n if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {\n $subsets = 'latin,latin-ext';\n\n /* translators: To add an additional Open Sans character subset specific to your language,\n * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.\n */\n $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );\n\n if ( 'cyrillic' == $subset ) {\n $subsets .= ',cyrillic,cyrillic-ext';\n } elseif ( 'greek' == $subset ) {\n $subsets .= ',greek,greek-ext';\n } elseif ( 'vietnamese' == $subset ) {\n $subsets .= ',vietnamese';\n }\n\n $query_args = array(\n 'family' => 'Open+Sans:400italic,700italic,400,700',\n 'subset' => $subsets,\n );\n $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );\n }\n\n return $font_url;\n}", "function alehouse_theme_mods_font() {\n\n\t$font= get_theme_mod( 'alehouse_theme_font', 'Open Sans' );\n\t$font_url = add_query_arg( 'family', urlencode( $font . ':400,400italic,700,800' ), \"//fonts.googleapis.com/css\" );\n\n\treturn $font_url;\n}", "function tve_custom_font_get_link( $font ) {\n\tif ( is_array( $font ) ) {\n\t\t$font = (object) $font;\n\t}\n\n\tif ( Tve_Dash_Font_Import_Manager::isImportedFont( $font ) ) {\n\t\treturn Tve_Dash_Font_Import_Manager::getCssFile();\n\t}\n\n\treturn '//fonts.googleapis.com/css?family=' . str_replace( ' ', '+',\n\t\t\t$font->font_name ) .\n\t ( $font->font_style ? ':' . $font->font_style : '' ) .\n\t ( $font->font_bold ? ',' . $font->font_bold : '' ) .\n\t ( $font->font_italic ? $font->font_italic : '' ) .\n\t ( $font->font_character_set ? '&subset=' . $font->font_character_set : '' );\n}", "public function getFontFileUrl()\n {\n try {\n return $this->storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA).'svg_fonts/'.$this->getFontFileName();\n } catch (NoSuchEntityException $e) {\n return '';\n }\n }", "public function googleFontsURI()\n {\n return self::WEBFONTURL . '?' . $this->buildQueryString();\n }", "function GetChosenFont(){}", "private static function getFontPath(): string {\n return dirname(__FILE__) . '/resources/OpenSans-Regular.ttf';\n }", "public function jog_gdpr_options_custom_font_url_cb() {\n\t\t$custom_font_url = get_option( $this->option_name . '_custom_font_url' );\n\t\techo '<input\n\t\t\ttype=\"text\"\n\t\t\tname=\"' . $this->option_name . '_custom_font_url' . '\"\n\t\t\tid=\"' . $this->option_name . '_custom_font_url' . '\"\n\t\t\tvalue=\"' . $custom_font_url . '\"\n\t\t\tclass=\"regular-text\"\n\t\t>';\n\t}", "function lipi__fonts_url() {\n\tglobal $lipi_theme_options; \n\t\n\t$fonts_url = $font_add = '';\n\t$fonts = $user_define_fonts = array();\n\t$subsets = 'latin,latin-ext';\n\t$subset = _x( 'no-subset', 'PT Sans font: add new subset (greek, cyrillic, vietnamese)', 'lipi' );\n\n\tif ( 'cyrillic' == $subset )\n\t\t$subsets .= ',cyrillic,cyrillic-ext';\n\telseif ( 'greek' == $subset )\n\t\t$subsets .= ',greek,greek-ext';\n\telseif ( 'vietnamese' == $subset )\n\t\t$subsets .= ',vietnamese';\n\t\n\t// Google Dynamic Fonts\n\t$font_weight_str = '100,200,300,400,500,600,700,800,900';\n\t$fonts_array = array('Montserrat:'.$font_weight_str, 'Rubik:'.$font_weight_str, 'Poppins:'.$font_weight_str);\n\t$user_define_fonts = array($lipi_theme_options['theme-typography-body']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h1-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h2-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h3-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h4-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h5-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-h6-typography']['font-family'].':'.$font_weight_str, $lipi_theme_options['theme-typography-nav']['font-family'].':'.$font_weight_str );\n\t$is_plugin_active = lipi__plugin_active('ReduxFramework');\n\tif($is_plugin_active == false){\n\t\t$process_font_1 = array_unique($fonts_array);\n\t} else {\n\t\t$process_font_1 = array_unique(array_merge($fonts_array, $user_define_fonts));\n\t}\n\t$google_fonts_string = implode( '%7C', $process_font_1);\n\t\n\t$protocol = is_ssl() ? 'https' : 'http';\n\t$query_args = add_query_arg(array(\n\t\t\t\t\t\t'family' => str_replace(' ', '+', $google_fonts_string),\n\t\t\t\t\t\t'subset' => $subsets,\n\t\t\t\t\t), '//fonts.googleapis.com/css');\n\n\treturn $query_args;\n}", "public function getFont () {}", "function link_google_font()\n\t\t{\n\t\t\tif(empty($this->google_fontlist)) return;\n\t\t\n\t\t\t$this->extra_output .= \"\\n<!-- google webfont font replacement -->\\n\";\n\t\t\t$this->extra_output .= \"<link rel='stylesheet' id='avia-google-webfont' href='//fonts.googleapis.com/css?family=\".apply_filters('avf_google_fontlist', $this->google_fontlist).\"' type='text/css' media='all'/> \\n\";\n\t\t\t\n\t\t\treturn $this->extra_output;\n\t\t}", "function get_google_fonts_url( array $font_families ) {\n $query_args = array( 'family' => implode( '|', $font_families ), 'subset' => urlencode( 'latin,latin-ext' ) );\n\n return add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );\n}", "public final function getDefaultFontPath()\n {\n return $this->getDefaultFilePath().'/font';\n }", "function jackrose_generate_google_fonts_url() {\r\n\tglobal $jackrose_data;\r\n\r\n\t$filtered_fonts = array();\r\n\t$fonts = array();\r\n\t$types = array_keys( $jackrose_data['typography_types'] );\r\n\t\r\n\tforeach ( $types as $type ) {\r\n\t\t$family = jackrose_get_theme_mod( 'typography_' . $type . '_font_family' );\r\n\t\t\r\n\t\t$variant = '';\r\n\t\tfor ( $weight = 100; $weight <= 900; $weight += 100 ) {\r\n\t\t\t$variant .= $weight . ',' . $weight . 'italic';\r\n\t\t\tif ( $weight < 900 ) {\r\n\t\t\t\t$variant .= ',';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Skip Standard Font.\r\n\t\tif ( in_array( $family, array( 'serif', 'sans-serif', 'monospace' ) ) ) continue;\r\n\r\n\t\t// Add / Create Font Family.\r\n\t\tif ( ! array_key_exists( $family, $filtered_fonts ) ) $filtered_fonts[ $family ] = array();\r\n\r\n\t\t// Add / Create Font Variants.\r\n\t\tif ( ! in_array( $variant, $filtered_fonts[ $family ] ) ) $filtered_fonts[ $family ][] = $variant;\r\n\t}\r\n\r\n\t// Fonts.\r\n\tforeach ( $filtered_fonts as $key => $value ) {\r\n\t\t$fonts[] = str_replace( ' ', '+', $key ) . ':' . implode( ',', $value );\r\n\t}\r\n\tif ( empty( $fonts ) ) return '';\r\n\r\n\t// Subsets.\r\n\t$subsets = jackrose_get_theme_mod( 'typography_subsets' );\r\n\tif ( is_serialized( $subsets ) ) $subsets = unserialize( $subsets );\r\n\t$subsets = (array) $subsets;\r\n\r\n\t// Generate URL.\r\n\t$url = '//fonts.googleapis.com/css?family=' . implode( '|', $fonts ) . '&subset=' . implode( ',', $subsets );\r\n\r\n\treturn $url;\r\n}", "function ra_font_name($font_url){\n\t\t\t$patterns = array(\n\t\t\t //replace the path root\n\t\t\t'!^http://fonts.googleapis.com/css\\?!',\n\t\t\t //capture the family and avoid and any following attributes in the URI.\n\t\t\t'!(family=[^&:]+).*$!',\n\t\t\t //delete the variable name\n\t\t\t'!family=!',\n\t\t\t //replace the plus sign\n\t\t\t'!\\+!');\n\t\t\t$replacements = array(\n\t\t\t\"\",\n\t\t\t'$1',\n\t\t\t'',\n\t\t\t' ');\n\t\t\t\n\t\t\t$font = preg_replace($patterns,$replacements,$font_url);\n\t\t\treturn $font;\n\n\t\t}", "public function getFontFamily () {}", "protected function getDefaultFont() {\n return \"Lato\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
consumes array of first and second passwords submitted in form data produces true if passwords match and false otherwise
private function matchPasswords($passArray) { if (strcmp($passArray['first'], $passArray['second']) != 0) { $this->get('session')->getFlashBag() ->add('error','passwords did not match!'); return false; } return true; }
[ "public function passwordsMatch($data) {\n return ($data['password2'] == $this->data[$this->alias]['password1']);\n }", "public function passwordsMatch($pw1,$pw2){\n if ($pw1 == $pw2) {\n return true;\n } else {\n return false;\n }\n }", "function passwordMatch($pass1, $pass2){\n\n if($pass1 !== $pass2){\n $output = true;\n\n }\n else{\n $output = false;\n\n }\n return $output;\n}", "function checkIfPasswordsMatch($password1, $password2) {\r\n return $password1 == $password2;\r\n}", "function validatePasswords($password1, $password2){\n if($password1 == $password2){\n return true;\n }\n else{\n return false;\n }\n}", "function ComparePasswords($password_one, $password_two)\n{\n // compare values\n // if ($password_one != $password_two) { return false; }\n return ($password_one == $password_two) ? true : false;\n\n \n}", "function validations_password($password1, $password2)\n\t{\n\t// Controlla la prima PASSWORD\n\t// 1) deve avere almeno 1 numero (?=.*[0-9])\n\t// 2) deve avere almeno 1 lettera (?=.*[a-zA-Z])\n\t// 3) deve essera da 6 a 12 caratteri di lunghezza {6,12}\n\t// $condizione = \"/((?=.*[0-9])(?=.*[a-zA-Z]).{6,12})/\";\n\t// if ((preg_match($condizione, $password1)) and\n\t\t// (preg_match($condizione, $password2))\n\t\t// ) :\n\t\t// Controllo le password inserite\n\t\tif ($password1 == $password2) :\n\t\t\t// Le password sono UGUALI e rispettano i criteri\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\t// Le password sono DIVERSE\n\t\t\treturn FALSE;\n\t\tendif;\n\t// else :\n\t\t// La password inserita non corrisponde ai criteri base\n\t // return FALSE;\n\t//endif;\n\t}", "function CheckPasswordsMatch($pwd1, $pwd2) {\n if($pwd1 === $pwd2){\n return true;\n }\n return false;\n }", "public function passwordMatches()\n\t{\n\t\tif (($this->hash($this->modelData['password'])) == ($this->modelData['old_password'])) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function confirmPassword(&$errors, $field_list, $field_name_a, $field_name_b)\n\t{\n\tif($field_list[$field_name_a] != $field_list[$field_name_b]) \n\t$errors[$field_name_a] = 'Passwords do not match!<br/>';\n\t}", "private function matchPasswordAndConfirmPassword(){\n if ($this->newPassword===$this->confirmNewPassword){\n return true;\n }\n return false;\n }", "function REGEX_TEST_PASSWORD($checkPass)\n\t{\n\t\t//this statement checks the input variable against each regular expression\n\t\tif(preg_match(REGEX_PATTERN_LENGTH_CHECK,$checkPass) && preg_match(REGEX_PATTERN_DIGIT_CHECK,($checkPass)) && preg_match(REGEX_PATTERN_ALPHA_CHECK, $checkPass))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false; \n\t\t}\n\t}", "function check_common_password($password)\n{\n\n $common_password = false;\n\n if (in_array(strtolower($password), worst_passwords())) {\n\n $common_password = true;\n \n } else {\n\n $common_password = false;\n\n }\n\n return $common_password;\n\n}", "function comparePassword($string1, $string2) {\n\tif($string1 === $string2){\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "protected function validate(){\r\n\t\t$errors = parent::validate();\r\n\t\t$valFirst = $this->newPass->getValue();\r\n\t\t$valSecond = $this->newPassSecond->getValue();\r\n\t\t\r\n\t\tif($valFirst !== $valSecond){\r\n\t\t\t$errors[$this->newPassSecond->getName()] = __('The two passwords must be the same');\r\n\t\t}\r\n\t\treturn $errors;\r\n\t}", "function password($password, $password2)\n{\n if ($password == $password2)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function verify_form($un, $ln, $fn, $em, $p1, $p2){\n global $suERRpwm, $suERRivu, $suERRivn, $suERRive, $suERRivp;\n $flag = true;\n // Username: alphanumeric-_ 6-20 chars\n $userx = \"/^[A-Za-z0-9_\\-]{6,20}$/\";\n // Name: one or more ASCII or UTF-8 letters\n $namex = \"/^[A-Za-z\\\\p{L}]+$/u\";\n // Email: contains an @ with at least one . following it: [any]@[any].[any]\n $emailx = \"/^[^@]+?@([^@\\\\.]+?)(\\\\.([^@\\\\.])+?)+$/\";\n // Password: 8-20 characters, any chars\n $passx = \"/[^\\\\n]{8,20}/\"; //\"/^[\\w\\d]{8,20}$/\";\n\n // Check for Password Mismatch\n if($p1 != $p2){\n $flag = false;\n set_error($suERRpwm);\n }\n // Check valid username\n if(!preg_match($userx,$un)){\n $flag = false;\n set_error($suERRivu);\n }\n // Check valid name: need at least one name\n if(!(preg_match($namex,$fn)||preg_match($namex, $ln))){\n $flag = false;\n set_error($suERRivn); // \n }\n // check valid email\n if(!preg_match($emailx,$em)){\n $flag = false;\n set_error($suERRive);\n }\n // check valid password length\n if(!preg_match($passx,$p1)){\n $flag = false;\n set_error($suERRivp);\n }\n return $flag;\n}", "private function checkpasswordUnicity () {\r\n\t\tif (preg_match (\"/(\".$this->firstname.\")/i\", $this->password)) return false;\r\n\t\tif (preg_match (\"/(\".$this->lastname.\")/i\", $this->password)) return false;\r\n\t\treturn true;\r\n\t}", "function isPasswordPinMatch($dbValue, $postValue){\n if($dbValue == $postValue){\n return true;\n }\n return false;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this is where you can add your own fuctions to twig
function add_to_twig( $twig ) { //$twig->addExtension( new Twig_Extension_StringLoader() ); //$twig->addFilter( 'myfoo', new Twig_Filter_Function( 'myfoo' ) ); //return $twig; }
[ "public function twig()\n {\n }", "public function onTwigRegistration()\n {\n // your code\n }", "function mymodule_foo_bar_twig() {\n\n}", "public function getFunctions() {\n return array(\n new \\Twig_SimpleFunction('drupal_title', array($this,'setTitle')),\n );\n }", "public function getFunctions()\n {\n\treturn array(\n new \\Twig_SimpleFunction('snide_extra_form_addDoubleList', array($this, 'addDoubleList'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('snide_extra_form_init', array($this, 'init'), array('is_safe' => array('html'))),\n );\n }", "public function postRender(TwigPostRenderEvent $event): void\n {\n }", "public function contactFunction() \n {\n\n\n\n\n return $this->render(\"page/contact.html.twig\");\n }", "function micro_create_twig_function( string $fnName, $class, string $methodName, $params )\n{\n global $app;\n return $app->createTwigFunction( $fnName, $class, $methodName, $params );\n}", "function init()\n {\n // Initialize the Twig function\n $this->addTwigFunction('evaluatephp', 'twigEvaluatephp');\n }", "public function onTwigInitialized()\n {\n $this->grav['twig']->twig()->addFunction(\n new \\Twig_SimpleFunction('sharer', [$this, 'renderTemplate'])\n );\n\n $this->grav['twig']->twig()->addFilter(\n new \\Twig_SimpleFilter('sharer_sort_buttons', [$this, 'sortButtonsByPriority'])\n );\n }", "public function addFunction($name, $function) {\n $this->twig->addFunction(new \\Twig_Function($name, $function));\n }", "private function _function_Route()\n\t{\n\t\treturn new \\Twig_SimpleFunction('Route', function($page, $params = Array())\n\t\t{\n\t\t\treturn URL::route($page, $params);\n\t\t});\n\t}", "protected function registerTwigFunctions()\n {\n $map = $this->commandEventMap;\n $this->twig->addFunction(new \\Twig_Function(\n 'command_event',\n function (string $in) use ($map): string {\n return $map[$in] ?? '';\n },\n ['is_safe' => ['html']]\n ));\n\n $rootNS = $this->env->getNamespace();\n $this->twig->addFunction(new \\Twig_function(\n 'namespace_stmt',\n function (string $in = '') use ($rootNS): string {\n if ('' === $rootNS) {\n if ('' === $in) {\n return '';\n }\n return \"namespace {$in};\";\n }\n if ('' === $in) {\n return \"namespace {$rootNS};\";\n }\n return \"namespace {$rootNS}\\\\{$in};\";\n },\n ['is_safe' => ['html']]\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'namespace_path',\n function (string $in = '', bool $prefix = false) use ($rootNS): string {\n if ('' === $rootNS) {\n if ('' === $in) {\n return '';\n }\n return $prefix ? \"\\\\{$in}\" : $in;\n }\n if ('' === $in) {\n return $prefix ? \"\\\\{$rootNS}\" : $rootNS;\n }\n return $prefix ? \"\\\\{$rootNS}\\\\{$in}\" : \"{$rootNS}\\\\{$in}\";\n },\n ['is_safe' => ['html']]\n ));\n\n $now = new \\DateTime();\n $this->twig->addFunction(new \\Twig_Function(\n 'now',\n function (string $format = '') use ($now) : string {\n if ('' === $format) {\n $format = 'Y-m-d';\n }\n return $now->format($format);\n },\n ['is_safe' => ['html']]\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'var_export',\n 'var_export',\n ['is_safe' => ['html']]\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'json_decode',\n 'json_decode',\n ['is_safe' => ['html']]\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'tag_indent',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\tagIndent',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'swagger_definition_tag',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\buildSwaggerDefinitionTag',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'escape_swagger_string',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\escapeSwaggerString',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'since_tag_line',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\buildSinceTagLine',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'required_tag_line',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\buildRequiredTagLine',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'bor',\n function (int ...$ints): int {\n $v = 0x0;\n foreach ($ints as $int) {\n $v |= $int;\n }\n return $v;\n }\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'file_header',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\buildFileHeader',\n ['is_safe' => ['html']]\n ));\n\n $this->twig->addFunction(new \\Twig_Function(\n 'determine_class',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\determineClass',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'determine_swagger_name',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\determineSwaggerName',\n ['is_safe' => ['html']]\n ));\n $this->twig->addFunction(new \\Twig_Function(\n 'object_constructor',\n '\\\\MyENA\\\\CloudStackClientGenerator\\\\objectConstructor',\n ['is_safe' => ['html']]\n ));\n }", "public function postRender(TwigPostRenderEvent $event)\n {\n }", "public function twig_function_dump(){\n\t\treturn new \\Twig_SimpleFunction('dump', function () {\n\t\t});\n\t}", "private function registerFunctions() {\n $functions = [\n // Theme functions\n 'wp_head',\n 'wp_footer',\n 'language_attributes',\n 'bloginfo',\n 'dynamic_sidebar',\n\n // i18n functions\n '__',\n '_n',\n '_x',\n '_nx',\n 'esc_html__',\n 'esc_attr_x',\n 'esc_html_x',\n '_e',\n '_ex',\n 'esc_html_e'\n ];\n\n foreach ($functions as $function) {\n $this->engine->addFunction(new Twig_Function($function, $function));\n }\n }", "public function onTwigExtensions()\n {\n require_once(__DIR__ . '/twig/WidgetTwigExtension.php');\n\n /* @var Twig $twig */\n $twig = $this->grav['twig'];\n $twig->twig->addExtension(new WidgetTwigExtension());\n\n }", "function new_twig_filters($twig) {\n\t\t$twig->addExtension(new \\Twig\\Extension\\StringLoaderExtension());\n\t\t$twig->addFilter(new \\Twig_SimpleFilter('toProperText', array($this, 'toProperText')));\n\t\treturn $twig;\n }", "public function onTwigInitialized()\n {\n // Expose tocFilter and tocifyFilter\n $this->grav['twig']->twig()->addFilter(\n new \\Twig_SimpleFilter('toc', [$this, 'tocFilter'], ['is_safe' => ['html']])\n );\n $this->grav['twig']->twig()->addFilter(\n new \\Twig_SimpleFilter('tocify', [$this, 'tocifyFilter'], ['is_safe' => ['html']])\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
verification du paiement CA, etransactions, solution de paiement du CA VERSIOn API 500 ATOS origine CA, BPOP, SOciete Gen
function cacheck($ar=NULL){ $p = new XParam($ar,array()); $ot = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.$this->table); $tableau = $p->get("tableau"); $code = $tableau[1]; $error = $tableau[2]; $merchant_id = $tableau[3]; $merchant_country = $tableau[4]; $montant = $tableau[5]/100; $transaction_id = $tableau[6]; $payment_means = $tableau[7]; $transmission_date= $tableau[8]; $payment_time = $tableau[9]; $payment_date = $tableau[10]; $response_code = $tableau[11]; $payment_certificate = $tableau[12]; $authorisation_id = $tableau[13]; $currency_code = $tableau[14]; $card_number = $tableau[15]; $cvv_flag = $tableau[16]; $cvv_response_code = $tableau[17]; $bank_response_code = $tableau[18]; $complementary_code = $tableau[19]; $return_context = $tableau[20]; $reference = $tableau[21]; $receipt_complement = $tableau[22]; $merchant_language = $tableau[23]; $language = $tableau[24]; $customer_id = $tableau[25]; $order_id = $tableau[26]; $customer_email = $tableau[27]; $customer_ip_address = $tableau[28]; $capture_day = $tableau[29]; $capture_mode = $tableau[30]; $data = $tableau[31]; XLogs::debug($tableau); // code response banque $ret['00'] = 'Autorisation acceptee'; $ret['02'] = 'demande autorisation par tel, depasst plafond'; $ret['03'] = 'merchant_id invalide, voir contrat banque'; $ret['05'] = 'Autorisation refusee'; $ret['12'] = 'Transaction invalide'; $ret['13'] = 'Montant invalide'; $ret['17'] = 'Annulation de internaute'; $ret['30'] = 'Erreur de format'; $ret['63'] = 'Regles de securite non respectees'; $ret['75'] = 'Nombre de tentatives trop importantes'; $ret['90'] = 'Service indisponible'; // test des codes erreurs de transactions if (( $code == "" ) && ( $error == "" ) ){ XLogs::critical("XModCart::cacheck"," executable response non trouve $path_bin"); } else if ( $code != 0 ){ XLogs::critical("XModCart::cacheck"," API call error."); } else { $msglog = "transaction_id : $transaction_id "; $msglog .= "transmission_date: $transmission_date - "; $msglog .= "payment_time : $payment_time - "; $msglog .= "payment_date : $payment_date - "; $msglog .= "payment_amount : $montant - "; $msglog .= "response_code : $response_code - "; $msglog .= "payment_certificate : $payment_certificate - "; $msglog .= "authorisation_id : $authorisation_id - "; $msglog .= "currency_code : $currency_code - "; $msglog .= "card_number : $card_number - "; $msglog .= "cvv_flag: $cvv_flag - "; $msglog .= "cvv_response_code: $cvv_response_code - "; $msglog .= "bank_response_code: $bank_response_code - "; $msglog .= "complementary_code: $complementary_code - "; $msglog .= "return_context: $return_context - "; $msglog .= "reference : $reference - "; $msglog .= "receipt_complement: $receipt_complement - "; $msglog .= "merchant_language: $merchant_language - "; $msglog .= "language: $language - "; $msglog .= "customer_id: $customer_id - "; $msglog .= "order_id: $order_id - "; $msglog .= "customer_email: $customer_email - "; $msglog .= "customer_ip_address: $customer_ip_address - "; $msglog .= "capture_day: $capture_day - "; $msglog .= "capture_mode: $capture_mode - "; $msglog .= "data: $data - "; XLogs::notice("cart","order $msglog "); // verification que la commande existe if(isset($reference)) { $rs=selectQuery("select * from ".$this->table." where ".$this->orderreffield." ='$reference'"); if(!$ors=$rs->fetch()) { XLogs::critical("XModCart::cacheck"," order $reference amount $montant reference not found"); die("Commande non existante"); } $rs->closeCursor(); $oid=$ors['KOID']; // verification qu'il y a bien un montant affiché if(empty($montant)) { XLogs::critical("XModCart::cacheck"," order $reference amount $montant probleme dans les montants"); die("Montant non renseigne"); } if(!empty($this->acompte) && !empty($this->alreadypaidfield)) { $paidfield=$this->alreadypaidfield; $nmontant = $ors[$paidfield]; } else { $nmontant=sprintf("%.2f",$ors['F0004']); } if($montant != $nmontant) { XLogs::critical("XModCart::cacheck"," order $reference amount $montant<>$nmontant probleme dans les montants (2)"); die("Montant non exact"); } $etat=$response_code; $val=$ret[$etat]; $ot->procEdit(array($this->paidfield=>$val,"oid"=>$oid)); XLogs::notice("cart","order $reference oid $oid amount $montant status $val"); $label = XLabels::getSysLabel('xmodcart','paimentreturn'); $this->_sendOrderEmail($oid,$this->backofficeemail,$label); if($etat=="00") $this->_sendOrderEmail($oid,$customer_email,"Votre commande"); } die(); } }
[ "function verify_verotel_sale() // NOT COMPLETE\r\n\t\t{\r\n\t\t\t$statusparams = array();\r\n\t\t\t$statusparams['shopID'] = $this->shop_id;\r\n\t\t\t$statusparams['referenceID'] = $params['saleID'];\t\t\t\t\r\n\t\t\t$url = FlexPay::get_status_URL($this->sig_key,$statusparams);\r\n\r\n\t\t\t$ch = curl_init();\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\t\tcurl_setopt($ch, CURLOPT_FAILONERROR,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 15);\r\n\t\t\t$response = curl_exec($ch);\t\t\t \r\n\t\t\tcurl_close($ch);\r\n\r\n\t\t\tif (!$response)\r\n\t\t\t{\t\r\n\t\t\t\t$error = \"Invalid / No response from Verotel\";\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\t$response = explode(\"\\n\",$response);\r\n\t\t\t\t\r\n\t\t\t\tif ($response[0] == \"response: NOTFOUND\")\r\n\t\t\t\t{\t\r\n\t\t\t\t\t$error = \"Verotel says transaction not found\";\r\n\t\t\t\t} \r\n\t\t\t\telse if ($response[0] == \"response: ERROR\")\r\n\t\t\t\t{\t\r\n\t\t\t\t\t$error = \"Verotel says \".$response[2];\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{\t\r\n\t\t\t\t\tprint_r($response);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function check_status() {\n\n if ($this->isCompleted()){\n //do not check if it is already completed\n //also a workaround for manual old payments without transaction_id\n return true;\n }\n\n //todo: put this sensitive data in a secure place\n $url = 'http://argentina.dineromail.com/Vender/Consulta_IPN.asp';\n $tmpl = 'DATA=<REPORTE><NROCTA>%s</NROCTA><DETALLE><CONSULTA><CLAVE>%s</CLAVE><TIPO>1</TIPO><OPERACIONES><ID>%s</ID></OPERACIONES></CONSULTA></DETALLE></REPORTE>';\n $cuenta = '2790688';\n $clave = 'Ipn123Ahorra';\n $data = sprintf($tmpl,$cuenta,$clave,$this->getId());\n\n $ch = curl_init($url);\n \n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n $doc = new SimpleXMLElement($response);\n\n\n $values = array();\n\n\n if ($doc->ESTADOREPORTE==1){\n $op = $doc->DETALLE->OPERACIONES->OPERACION;\n\n if ($this->getId() == (int)$op->ID){\n $values = array_merge($values, array(\n 'dm_id' => (string)$op->NUMTRANSACCION,\n 'dm_bought_on' => date('Y-m-d H:i:s', strtotime($op->FECHA)),\n 'dm_amount' => (float)$op->MONTO,\n 'dm_net_amount' => (float)$op->MONTONETO,\n 'dm_method' => (int)$op->METODOPAGO,\n 'dm_medium' => (string)$op->MEDIOPAGO,\n 'dm_installments' => (int)$op->CUOTAS,\n 'dm_buyer_email' => (string)$op->COMPRADOR->EMAIL,\n 'dm_buyer_address' => (string)$op->COMPRADOR->DIRECCION,\n 'dm_buyer_comment' => (string)$op->COMPRADOR->COMENTARIO,\n 'dm_buyer_name' => (string)$op->COMPRADOR->NOMBRE,\n 'dm_buyer_phone' => (string)$op->COMPRADOR->TELEFONO,\n 'dm_buyer_tipodoc' => (string)$op->COMPRADOR->TIPODOC,\n 'dm_buyer_numdoc' => (string)$op->COMPRADOR->NUMERODOC,\n ));\n \n switch ((int)$op->ESTADO) {\n case 1:\n //PENDIENTE DE PAGO\n $values['status'] = 'P';\n break;\n case 2:\n //ACREDITADO\n $values['status'] = 'A';\n $this->getDeal()->increaseBought();\n break;\n case 3:\n //CANCELADO\n $values['status'] = 'C';\n break;\n }\n \n }else{\n $values['status'] = 'E';\n }\n\n }elseif($doc->ESTADOREPORTE==8){\n $values['status'] = 'E';\n }\n \n $this->fromArray($values);\n $this->save();\n return $this->isCompleted();\n \n }", "function bank_response_simple($mode){\n\t$vars = array('id_transaction','transaction_hash','autorisation_id','abo');\n\t$response = array();\n\tforeach($vars as $k) {\n\t\tif (!is_null($v = _request($k)))\n\t\t$response[$k] = $v;\n\t}\n\n\tif (!$s = _request('sign')\n\t\tOR $s !== bank_sign_response_simple($mode,$response)){\n\n\t\tspip_log(\"bank_response_simple : signature invalide\",\"bank\"._LOG_ERREUR);\n\t\treturn false;\n\t}\n\treturn $response;\n}", "public function trnVerify()\n {\n $crc = md5($this->postData[\"p24_session_id\"] . \"|\" . $this->postData[\"p24_order_id\"] . \"|\" . $this->postData[\"p24_amount\"] . \"|\" . $this->postData[\"p24_currency\"] . \"|\" . $this->salt);\n $this->addValue(\"p24_sign\", $crc);\n $RES = $this->callUrl(\"trnVerify\", $this->postData);\n return $RES;\n }", "public function verifyCardPayment()\r\n {\r\n $ravePaymentSession = $this->ravePaymentSession;\r\n $em = $this->entityManager;\r\n $generalService = $this->clientGeneralService->getGeneralService();\r\n $clientGeneralService = $this->clientGeneralService;\r\n if ($ravePaymentSession->responseCode == \"00\" && $ravePaymentSession->chargeResponseCode == \"00\") {\r\n $client = new Client();\r\n $client->setUri(RavePaymentService::RAVE_LIVE_URL . \"flwv3-pug/getpaidx/api/v2/verify\");\r\n $client->setMethod(\"POST\");\r\n $client->setHeaders(array(\r\n 'Content-Type' => 'application/json'\r\n ));\r\n $post = array(\r\n \"txref\" => $ravePaymentSession->txRef,\r\n \"SECKEY\" => RavePaymentService::RAVE_SECRET_KEY\r\n );\r\n \r\n $client->setRawBody(json_encode($post));\r\n $response = $client->send();\r\n if ($response->isSuccess()) {\r\n $body = json_decode($response->getBody());\r\n if ($body->data->chargecode == \"00\") {\r\n $ravePaymentSession->embedtoken = $body->data->card->card_tokens[0]->embedtoken;\r\n $ravePaymentSession->cardExpiryMonth = $body->data->card->expirymonth;\r\n $ravePaymentSession->cardExpiryYear = $body->data->card->expiryyear;\r\n $ravePaymentSession->shortcode = $body->data->card->card_tokens[0]->shortcode;\r\n $ravePaymentSession->last4Digit = $body->data->card->last4digits;\r\n $ravePaymentSession->customerPhone = $body->data->custphone;\r\n \r\n \r\n \r\n //TODO Send email to broker inidicating a transfer has been initiated also inicating the invoice paid for\r\n // TODO Complete this email notification\r\n $userEntity = $em->find(\"CsnUser\\Entity\\User\", $clientGeneralService->getUserId());\r\n $brokerEntity = $em->find(\"Users\\Entity\\InsuranceBrokerRegistered\", $clientGeneralService->getBrokerId());\r\n $messagePointer['to'] = $userEntity->getEmail();\r\n $messagePointer['subject'] = \"Customer Payment\";\r\n $messagePointer['fromName'] = \"IMAPP CM\"; // $clientGeneralService->getBrokerName();\r\n \r\n $template['template'] = \"\";\r\n $template['var'] = array(\r\n \"logo\" => $clientGeneralService->getBrokerLogo(),\r\n \"brokername \" => $clientGeneralService->getBrokerName(),\r\n \"broker\" => $brokerEntity\r\n );\r\n $generalService->sendMails($messagePointer, $template);\r\n \r\n // send a mail to child broker initcating the invoice paid for\r\n // TODO Complete this email notification\r\n $messagePointer['to'] = $userEntity->getEmail();\r\n $messagePointer['subject'] = \"Customer Payment\";\r\n $messagePointer['fromName'] = \"IMAPP CM\"; // $clientGeneralService->getBrokerName();\r\n \r\n $template['template'] = \"\";\r\n $template['var'] = array(\r\n \"logo\" => $clientGeneralService->getBrokerLogo(),\r\n \"brokername \" => $clientGeneralService->getBrokerName(),\r\n \"broker\" => $brokerEntity\r\n );\r\n $generalService->sendMails($messagePointer, $template);\r\n \r\n return TRUE; // meaning verification was successfull\r\n } else {\r\n return FALSE; // meaning there was something wrong with the verification\r\n }\r\n } else {\r\n throw new \\Exception(\"The verification process had some challenges\");\r\n }\r\n }\r\n // Verify the card payment\r\n // Send a notification to the broker\r\n // copy the child broker(s)\r\n // If the\r\n }", "public function testGenerateSign2()\n {\n $token = \"NopUsBuSbT3eNrQTfcEZN2aAL52JT1SlRgoL1MIslsX5gGIgv4YUf\";\n $arrayAccNumber = array('0063001004');\n $arraySplit = implode(\",\", $arrayAccNumber);\n $uriSign = \"GET:/banking/v2/corporates/corpid/accounts/$arraySplit\";\n $isoTime = \"2019-02-30T22:03:35.800+07:00\";\n\n $bodyData = array();\n $bodyData['Amount'] = \"100000.00\";\n $bodyData['BeneficiaryAccountNumber'] = strtolower(str_replace(' ', '', \"8329389\"));\n $bodyData['CorporateID'] = strtolower(str_replace(' ', '', \"8293489283499\"));\n $bodyData['CurrencyCode'] = \"idr\";\n $bodyData['ReferenceID'] = strtolower(str_replace(' ', '', \"\"));\n $bodyData['Remark1'] = strtolower(str_replace(' ', '', \"Ini adalah remark1\"));\n $bodyData['Remark2'] = strtolower(str_replace(' ', '', \"Ini adalah remark2\"));\n $bodyData['SourceAccountNumber'] = strtolower(str_replace(' ', '', \"09202990\"));\n $bodyData['TransactionDate'] = $isoTime;\n $bodyData['TransactionID'] = strtolower(str_replace(' ', '', \"0020292\"));\n\n $authSignature = \\Bca\\BcaHttp::generateSign($uriSign, $token, \"9db65b91-01ff-46ec-9274-3f234b677450\", $isoTime, $bodyData);\n\n $output = \"1878f0eedcd93ff53054c8fc9ea271a29c99ea2f752f636c1cc765948009a90b\";\n\n $this->assertEquals($authSignature, $output);\n }", "public function testTsExcellence()\n {\n if (isSUBSHOP) {\n $this->markTestSkipped('This test case is only actual when SubShops are available.');\n }\n $this->_prepareTestTsExcellence();\n\n $oValidator = $this->getObjectValidator();\n\n //checking in frontend. order < 500eur\n $this->clearCache();\n $this->openShop();\n\n $this->switchLanguage(\"Deutsch\");\n $this->clickAndWait(\"//ul[@id='newItems']/li[2]/form//a\");\n $this->clickAndWait(\"toBasket\");\n $this->openBasket(\"Deutsch\");\n $this->loginInFrontend(\"example_test@oxid-esales.dev\", \"useruser\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / %PAY%\", $this->getText(\"breadCrumb\"));\n $this->click(\"payment_oxidcashondel\");\n $this->waitForItemAppear(\"bltsprotection\");\n $this->assertFalse($this->isVisible(\"stsprotection\"));\n $this->assertTextPresent(\"%TRUSTED_SHOP_PROTECTION_FROM% 500,00 € (0,90 € %INCLUDE_VAT%)\");\n $this->check(\"bltsprotection\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->assertTextPresent(\"0,90 €\");\n $this->assertTextPresent(\"%TRUSTED_SHOP_BUYER_PROTECTION%\");\n $this->check(\"//form[@id='orderConfirmAgbTop']//input[@name='ord_agb' and @value='1']\");\n $this->clickAndWait(\"//form[@id='orderConfirmAgbTop']//button\");\n\n $this->assertTrue($oValidator->validate('oxorder', array(\"OXTSPROTECTCOSTS\" => \"0.9\")), $oValidator->getErrorMessage());\n\n //order > 500eur\n $this->clickAndWait(\"link=%HOME%\");\n $this->clickAndWait(\"//ul[@id='newItems']/li[2]/form//a\");\n $this->type(\"amountToBasket\", \"6\");\n $this->clickAndWait(\"toBasket\");\n $this->openBasket(\"Deutsch\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->assertElementPresent(\"bltsprotection\");\n $this->assertElementPresent(\"stsprotection\");\n $this->assertEquals(\"%TRUSTED_SHOP_PROTECTION_FROM% 500,00 € (0,90 € %INCLUDE_VAT%) %TRUSTED_SHOP_PROTECTION_FROM% 1.500,00 € (2,72 € %INCLUDE_VAT%)\", $this->getText(\"stsprotection\"));\n $this->select(\"stsprotection\", \"label=%TRUSTED_SHOP_PROTECTION_FROM% 1.500,00 € (2,72 € %INCLUDE_VAT%)\");\n $this->check(\"bltsprotection\");\n $this->clickAndWait(\"//button[text()='%CONTINUE_TO_NEXT_STEP%']\");\n $this->assertTextPresent(\"2,72 €\");\n $this->assertTextPresent(\"%TRUSTED_SHOP_BUYER_PROTECTION%\");\n $this->check(\"//form[@id='orderConfirmAgbTop']//input[@name='ord_agb' and @value='1']\");\n $this->clickAndWait(\"//form[@id='orderConfirmAgbTop']//button\");\n\n $this->assertTrue($oValidator->validate('oxorder', array(\"OXTSPROTECTCOSTS\" => \"2.72\")), $oValidator->getErrorMessage());\n }", "public function sendVerification();", "private function transactionExecute() {\n\n $bd = new caDialogueBD();\n\n $countrydb = $this->getCountryDatabase();\n\n //type = 2 refers to Offers only.(see Transaction entity for more details). Check only Cashback and Subscription gain offer types\n $condition_transaction = 'validation_date IS NOT NULL AND status ='.TRANSACTION_STATUS_PENDING_CONFIRMATION .' and type ='.TRANSACTION_TYPE_OFFER .' and offer_type in ('.OFFER_TYPE_CASHBACK.','.OFFER_TYPE_SUBSCRIPTION_GAIN.')';\n $transactions = $bd->select($countrydb . '.transactions', array('id', 'merchant_id', 'validation_date'), $condition_transaction);\n\n if ($transactions === FALSE) {\n $this->exitlog('SQL error selecting the transactions from the country database', self::$logFile);\n }\n\n if (!$transactions) {\n $message = 'There are no records to update the status to confirmed in the transactions table';\n $this->exitlog($message, self::$logFile);\n }\n\n $rows_transactions = $bd->toutesLignes();\n\n $fields = array();\n $i = 0;\n foreach ($rows_transactions as $trans) {\n\n $merchants[] = $trans['merchant_id'];\n echo $trans['merchant_id'];\n echo $trans['validation_date'];\n $fields[$i]['id'] = $trans['merchant_id'];\n $fields[$i]['days'] = $this->getDaysDifference($trans['validation_date']);\n $fields[$i]['transaction_id'] = $trans['id'];\n echo $fields[$i]['days']; \n $i++;\n }\n\n $merchants = array_unique($merchants);\n $condition_merchants = 'id in(' . implode(\",\", $merchants) . ')';\n $merchants = $bd->select($countrydb . '.merchants', array('id', 'offer_maturity_period'), $condition_merchants);\n\n if ($merchants === FALSE) {\n $this->exitlog('SQL error selecting the merchants from the country database');\n }\n\n $merchants_period = $bd->toutesLignes();\n $updateRecord = array();\n\n foreach ($fields as $final) {\n \n $period = intval($this->searchForOfferMaturity($final['id'], $merchants_period));\n if (intval($final['days']) > $period && intval($final['days']) > 15 ) { \n $updateRecord[] = $final['transaction_id'];\n }\n }\n\n if (count($updateRecord) > 0) {\n $currentTime = new DateTime(\"now\", new DateTimeZone(self::$localTimeZone));\n $currentTime = $currentTime->format('Y-m-d H:i:s');\n $condition_update = 'id in(' . implode(\",\", $updateRecord) . ') and status ='.TRANSACTION_STATUS_PENDING_CONFIRMATION;\n $this->updated = $bd->update($countrydb . '.transactions', array('status' => TRANSACTION_STATUS_CONFIRMED, 'confirmation_date' => $currentTime, 'updated_at' => $currentTime, 'validation_date' => $currentTime), $condition_update);\n if ($this->updated === FALSE) {\n $this->exitlog('SQL Error updating the status to confirmed ', self::$logFile);\n }\n }\n $bd->ferme();\n }", "function reporteCertificacionPMod(){\n //Definicion de variables para ejecucion del procedimiento\n $this->procedimiento='pre.ft_presupuesto_sel';\n $this->transaccion='PR_REPCERPRE_MOD_SEL';\n $this->tipo_procedimiento='SEL';\n\n //Define los parametros para la funcion\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\n\n $this->captura('id_cp', 'int4');\n $this->captura('centro_costo', 'varchar');\n $this->captura('codigo_programa', 'varchar');\n $this->captura('codigo_proyecto', 'varchar');\n $this->captura('codigo_actividad', 'varchar');\n $this->captura('codigo_fuente_fin', 'varchar');\n $this->captura('codigo_origen_fin', 'varchar');\n\n $this->captura('codigo_partida', 'varchar');\n $this->captura('nombre_partidad', 'varchar');\n $this->captura('codigo_cg', 'varchar');\n $this->captura('nombre_cg', 'varchar');\n $this->captura('precio_total', 'numeric');\n $this->captura('codigo_moneda', 'varchar');\n $this->captura('num_tramite', 'varchar');\n $this->captura('nombre_entidad', 'varchar');\n $this->captura('direccion_admin', 'varchar');\n $this->captura('unidad_ejecutora', 'varchar');\n $this->captura('codigo_ue', 'varchar');\n $this->captura('firmas', 'varchar');\n $this->captura('justificacion', 'varchar');\n $this->captura('codigo_transf', 'varchar');\n $this->captura('unidad_solicitante', 'varchar');\n $this->captura('funcionario_solicitante', 'varchar');\n $this->captura('fecha_soli', 'date');\n $this->captura('gestion', 'integer');\n\n $this->captura('tipo_ajuste', 'varchar');\n $this->captura('correlativo', 'integer');\n $this->captura('tipo_proceso', 'varchar');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->consulta);exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function verify()\n {\n $req = Request::getInstance();\n $data = json_decode($req->getContent());\n $client = Paypal::client();\n $response = $client->execute(new OrdersGetRequest($data->orderID));\n /**\n *Enable the following line to print complete response as JSON.\n */\n //print json_encode($response->result);\n //print \"Status Code: {$response->statusCode}\\n\";\n //print \"Status: {$response->result->status}\\n\";\n //print \"Order ID: {$response->result->id}\\n\";\n //print \"Intent: {$response->result->intent}\\n\";\n //print \"Links:\\n\";\n //foreach($response->result->links as $link)\n {\n //print \"\\t{$link->rel}: {$link->href}\\tCall Type: {$link->method}\\n\";\n }\n if ($response->result->status == 'COMPLETED') {\n // 4. Save the transaction in your database. Implement logic to save transaction to your database for future reference.\n $paymentHandle = explode('-', base64_decode($response->result->purchase_units[0]->custom_id))[0];\n $userID = explode('-', base64_decode($response->result->purchase_units[0]->custom_id))[1];\n\n if ($paymentHandle == 'tgc_balance') {\n $this->updateBalance(User::getByUserID($userID), $response->result->purchase_units[0]->amount->value);\n } else {\n $this->setEventPaid(User::getByUserID($userID), $paymentHandle);\n }\n $success = t('Paypal: Payment verification successful').' - status:'.$response->result->status.' - paymentHandle:'.$paymentHandle.' - UserID:'.$userID.' - orderID:'.$response->result->id;\n Log::addNotice($success);\n echo json_encode($success);\n } else {\n $error = t('Paypal: Payment Verification Failed - ').' - status:'.$response->result->status.' - orderID:'.$response->result->id;\n Log::addError($error);\n echo json_encode($error);\n }\n die;\n }", "public function testEnvelopeApproval()\n {\n }", "function pcfme_verify_envato_purchase_code() {\n\t\n\t $extra_settings = get_option('pcfme_extra_settings');\n $purchase_code = $extra_settings['purchase_code'];\n $rand_keys = array(\"jp9ejo07ow5bfuz7wf02g208okrs63fc\", \"wq65342y3horxhksyvvxd92d610on095\", \"lp3hvd45yzlfexlsghh9exv0w1m4q8uj\", \"bd4qfswnv2p190773z5z2pv4dgfok4h4\", \"pig58dtwc3e3bpvo49m0gou2ig3xqkwa\");\n $api_key = $rand_keys[array_rand($rand_keys, 1)];\n $user_name = 'phppoet';\n $item_id = 9799777;\n \n\t\t\n \t$ch = curl_init();\n\n // Set cURL options\n curl_setopt($ch, CURLOPT_URL, \"http://marketplace.envato.com/api/edge/$user_name/$api_key/verify-purchase:$purchase_code.json\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'ENVATO-PURCHASE-VERIFY'); //api requires any user agent to be set\n\n \n $result = json_decode( curl_exec($ch) , true );\n \n \n if ( !empty($result['verify-purchase']['item_id']) && $result['verify-purchase']['item_id'] ) {\n \n if ( !$item_id ) return true;\n \n if ($result['verify-purchase']['item_id'] == $item_id) {\n\t\t\t\tupdate_option( 'pcfme_activation_status', \"active\" );\n\t\t\t} else {\n\t\t\t\tupdate_option( 'pcfme_activation_status', \"inactive\" );\n\t\t\t}\n } else {\n\t\t\tupdate_option( 'pcfme_activation_status', \"inactive\" );\n\t\t}\n\n}", "public function testCadesSignAndCoSignFromResult()\r\n {\r\n $this->_testCadesSignAndCoSignFromResult(false);\r\n }", "function _check_status() {\n global $platnoscipl_config;\n global $database;\n\n $order_id=$database->sql_select(\"order_id\",\"order_register\",\"session_id=$this->_session_id\");\n \n $sig=md5($this->_pos_id.$this->_session_id.$this->_ts.$platnoscipl_config->pl_md5_one);\n\n //$this->_save_error(\"\",$this->_session_id.\"::\".$order_id);\n\n // pobierz status transakcji\n $http =& new HTTP_Client;\n $res=$http->post(\"https://www.platnosci.pl/paygw/ISO/Payment/get/txt\",array(\n \"pos_id\"=>$this->_pos_id,\n \"session_id\"=>$this->_session_id,\n \"ts\"=>$this->_ts,\n \"sig\"=>$sig,\n )\n );\n\n $result=$http->_responses[0]['body'];\n\n if(preg_match(\"/trans_status: 1/\",$result)) {\n // ustaw kwadracik pomaranczowy\n /*$database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pay_status\"=>'000'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);*/\n $this->_save_error('status 1');\n $result=\"transakcja nowa\";\n }\n if(preg_match(\"/trans_status: 2/\",$result)) {\n $result=\"transakcja anulowana\";\n $this->_save_error('status 2');\n }\n if(preg_match(\"/trans_status: 3/\",$result)) {\n $result=\"transakcja odrzucona\";\n $this->_save_error('status 3');\n }\n if(preg_match(\"/trans_status: 4/\",$result)) {\n /*$database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pay_status\"=>'000'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);*/\n $this->_save_error('status 4');\n $result=\"transakcja rozpoczeta\";\n }\n if(preg_match(\"/trans_status: 5/\",$result)) {\n $result=\"oczekuje na odbior\";\n $this->_save_error('status 5');\n }\n if(preg_match(\"/trans_status: 6/\",$result)) {\n $result=\"autoryzacja odmowna\";\n $this->_save_error('status 6');\n }\n if(preg_match(\"/trans_status: 99/\",$result)) {\n $database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\"confirm_online\"=>\"1\",\n \"pay_status\"=>\"001\",\n \"confirm\"=>\"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t$this->_save_error(\"status 99 [ $order_id ]\");\n $result=\"płatnosc odebrana\";\n }\n if(preg_match(\"/trans_status: 888/\",$result)) {\n $result=\"bledny status\";\n $this->_save_error('status 888');\n }\n $res=serialize($res);\n $this->_save_error('',$res);\n $this->_save_error(\"\",$result);\n return true;\n }", "public function getIsRequestToCorrectCvvOrAvsError();", "function obtener_CAE($cuit,$tipo_cbte,$pto_vta,$cbte,$imp_total,$imp_tot_conc,$imp_neto,$neto_21,$neto_105,$ImpTrib,$imp_op_ex,$fecha_cbte,$FchVencPago,$impIVA,$impALICUOTA,$FchServDesde,$FchServHasta,$Concepto)\n{\n\n$cmp=array();\n\n$cmp['Concepto']=$Concepto; //1 producto 2 servicios 3 productos y servicios\n$cmp['DocTipo']=80;\n$cmp['DocNro']=$cuit;\n$cmp['CbteDesde']=$cbte;\n$cmp['CbteHasta']=$cbte;\n$cmp['CbteFch']=$fecha_cbte;\n$cmp['ImpTotal']=$imp_total;\n$cmp['ImpTotConc']=$imp_tot_conc;\n$cmp['ImpNeto']=$imp_neto;\n$cmp['ImpOpEx']=$imp_op_ex;\n$cmp['ImpTrib']=$impALICUOTA;\n$cmp['ImpIVA']=($tipo_cbte==11)?0:$impIVA;\n$cmp['FchServDesde']=$FchServDesde; //Fecha de inicio del abono para el servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd\n$cmp['FchServHasta']=$FchServHasta;\n$cmp['FchVtoPago']=$FchVencPago; //Fecha de vencimiento del pago servicio a facturar. Dato obligatorio para concepto 2 o 3 (Servicios / Productos y Servicios). Formato yyyymmdd. Debe ser igual o posterior a la fecha delcomprobante\n$cmp['FchVtoPago']='';\n$cmp['MonId']='PES';\n$cmp['MonCotiz']=1;\n\n\nif($impIVA>0 && !($tipo_cbte==2 && $tipo_cbte==3 && $tipo_cbte==7 && $tipo_cbte==8 && $tipo_cbte==11 && $tipo_cbte==12 && $tipo_cbte==13 && $tipo_cbte==15)){\n/*Aca entran facturas A y B*/\n$arrAli=array();\n$arrAli['AlicIva']=array();\n$arrTributos['Tributo']=array();\nif($impALICUOTA>0)\n{\n/*<IvaTipo><Id>3</Id><Desc>0%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>4</Id><Desc>10.5%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>5</Id><Desc>21%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>6</Id><Desc>27%</Desc><FchDesde>20090220</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>8</Id><Desc>5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo><IvaTipo><Id>9</Id><Desc>2.5%</Desc><FchDesde>20141020</FchDesde><FchHasta>NULL</FchHasta></IvaTipo>*/\n\n $tributo=array();\n\n $tributo['Id']=99; //99->otros impuestos\n $tributo['Desc']='Impuesto provincial';\n $tributo['BaseImp']=3000;\n $tributo['Alic']=2;\n $tributo['Importe']=$impALICUOTA;\n $arrTributos['Tributo'][]=$tributo;\n\n $cmp['Tributos']=$arrTributos; \n}\n\n // echo $imp_neto.\" = \".$imp105.\"+\".$imp21;\n\n\n\n if($neto_21>0)\n { \n $arr21=array();\n $arr21['Id']=5; //->21%\n $arr21['BaseImp']=$neto_21;\n $arr21['Importe']=round($neto_21*0.21,2);\n $arrAli['AlicIva'][]=$arr21;\n \n }\n if($neto_105>0)\n { \n $arr105=array();\n $arr105['Id']=4; //->10.5%\n $arr105['BaseImp']=$neto_105;\n $arr105['Importe']=round($neto_105*0.105,2);\n $arrAli['AlicIva'][]=$arr105; \n }\n\nif($tipo_cbte!=6){ $cmp['Iva']=$arrAli; } #Solo Si es Factura A\n\n/*<AlicIva>\n <Id>5</Id> --> 21%\n <BaseImp>100</BaseImp>\n<Importe>21</Importe>\n </AlicIva>\n<AlicIva>\n <Id>4</Id> --> 10.5%\n <BaseImp>50</BaseImp>\n <Importe>5.25</Importe>\n </AlicIva>*/\n \n//$cmp['Iva']=$arrAli;\n\n/*\n if($impALICUOTA>0){\n\n // <Tributos>\n // <Tributo>\n // <Id>99</Id>\n // <Desc>Impuesto Municipal Matanza</Desc>\n // <BaseImp>150</BaseImp>\n // <Alic>5.2</Alic>\n // <Importe>7.8</Importe>\n // </Tributo>\n // </Tributos>\n\n $idALIC='';\n $descALIC='';\n $BaseImpALIC='';\n $alicALIC='';\n $impALIC='';\n \n\n $arrTrib['ImpTrib']=array();\n\n $arrTrib['ImpTrib']['Id']=$idALIC;\n $arrTrib['ImpTrib']['Desc']=$descALIC;\n $arrTrib['ImpTrib']['BaseImp']=$BaseImpALIC;\n $arrTrib['ImpTrib']['Alic']=$alicALIC; \n $arrTrib['ImpTrib']['Importe']=$impALIC;\n\n $cmp['Tributos']['Tributo']=$arrTrib; \n }*/\n\n\n}\n\n//si es factura B no discrimina IVA\n if($tipo_cbte==6 || $tipo_cbte==8)\n {\n $cmp['ImpNeto']=0;\n $cmp['ImpTotConc']=$imp_neto;\n $cmp['ImpIVA']=0;\n }\n //si es factura C o recibo C\n if($tipo_cbte==11 || $tipo_cbte==13 || $tipo_cbte==15)\n {\n if($imp_total<1000){\n $cmp['DocTipo']=99;\n $cmp['DocNro']=0;\n }\n $cmp['ImpOpEx']=0;\n $cmp['ImpTotConc']=0;\n $cmp['ImpIVA']=0;\n }\n \n//$cmp['CbtesAsoc']=array();\n//$cmp['Tributos']='';\n//if($tipo_cbte==6 || $tipo_cbte==8) $cmp['Iva']=''; \n/*\nArray para informar las alícuotas y sus importes asociados a un comprobante <AlicIva>. \nPara comprobantes tipo C y Bienes Usados – Emisor Monotributista no debe informar el array.N \n*/\n//$cmp['Opcionales']=array();\n\n\n //echo \"fecha pago:\".$cmp['FchVtoPago'];\n\n // echo \"ImpTotal\".$cmp['ImpTotal'].\", debe ser igual a la suma de ImpTotConc\".$cmp['ImpTotConc'].\"+ ImpNeto\".$cmp['ImpNeto'].\" + ImpOpEx\".$cmp['ImpOpEx'].\" + ImpTrib\".$cmp['ImpTrib'].\" + ImpIVA.\".$cmp['ImpIVA'];\n // var_dump($cmp);\n // die();\n\n $this->reg_respuesta=array(); \n $this->logPedidoCAERegistro=array();\n $this->logPedidoCAE=array();\n \n\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n if($this->TA_expirado())\n {if(!$this->obtener_TA())\n {\n return false;\n }\n //en caso de que haya traido el TA, q lo vuelva a cargar a las clase para poder tomar sus datos\n if(!$this->cargar_TA())\n {\n return false;\n }\n \n }\n\n $cant_reg=1;\n $results=$this->client_wsfe->FECAESolicitar(\n array('Auth' => array('Token' => $this->token,'Sign' => $this->sign,'Cuit' => $this->cuit),\n 'FeCAEReq' => array('FeCabReq' => array('CantReg' => $cant_reg,'PtoVta' => $pto_vta,'CbteTipo'=>$tipo_cbte),\n 'FeDetReq' => array('FECAEDetRequest' =>$cmp))\n ));\n //print_r($results);\n $this->CheckErrors($results,'FECAESolicitar');\n \n if ( $results->FECAESolicitarResult->Errors->Err->Code != 0 )\n {\n\n $this->descError=\" MENSAJE DEL WEBSERVICE AFIP: Percode: \".$results->FECAESolicitarResult->Errors->Err->Code.\"\\nPerrmsg: \".$results->FECAESolicitarResult->Errors->Err->Msg.\"\\n\";\n return false;\n }\n \n//consulto por la cabecera\n if($results->FECAESolicitarResult->FeCabResp->Resultado ==\"R\")\n {\n $arrComp=array();\n $arrComp['cuit']=$results->FECAESolicitarResult->FeCabResp->Cuit;\n $arrComp['PtoVta']=$results->FECAESolicitarResult->FeCabResp->PtoVta;\n $arrComp['CbteTipo']=$results->FECAESolicitarResult->FeCabResp->CbteTipo;\n $arrComp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrComp['CantReg']=$results->FECAESolicitarResult->FeCabResp->CantReg;\n $arrComp['Resultado']=$results->FECAESolicitarResult->FeCabResp->Resultado;\n $arrComp['Reproceso']=$results->FECAESolicitarResult->FeCabResp->Reproceso;\n $this->logPedidoCAE[]=$arrComp;\n\n $comp=$results->FECAESolicitarResult->FeDetResp->FEDetResponse;\n $arrResp=array();\n \n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n $arrResp['Obs']=$comp->Obs->Observaciones;\n $this->logPedidoCAERegistro=$arrResp;\n \n \n return false;\n }//fin del if que analiza errores cuando el resultado del envio arrojo R\nelse \n { \n $comp=$results->FECAESolicitarResult->FeDetResp->FECAEDetResponse;\n $arrResp=array();\n $arrResp['Concepto']=$comp->Concepto;\n $arrResp['FchProceso']=$results->FECAESolicitarResult->FeCabResp->FchProceso;\n $arrResp['DocTipo']=$comp->DocTipo;\n $arrResp['DocNro']=$comp->DocNro;\n $arrResp['CbteDesde']=$comp->CbteDesde;\n $arrResp['CbteHasta']=$comp->CbteHasta;\n $arrResp['Resultado']=$comp->Resultado;\n $arrResp['CAE']=$comp->CAE;\n $arrResp['CbteFch']=$comp->CbteFch;\n $arrResp['CAEFchVto']=$comp->CAEFchVto;\n \n $this->reg_respuesta[]=$arrResp;\n \n return true;\n }//fin del if\n \n return false;\n\n\n}", "function test_lowerTransaction_card_success() { \n \n // not yet implemented, requires webdriver support\n\n // Stop here and mark this test as incomplete.\n $this->markTestIncomplete(\n 'not yet implemented, requires webdriver support' // TODO\n );\n \n // also, needs to have SUCCESS status set on transaction\n\n // set up order (from testUtil?)\n $order = TestUtil::createOrder();\n \n // pay with card, receive transactionId\n $form = $order\n ->UsePaymentMethod( PaymentMethod::KORTCERT )\n ->setReturnUrl(\"http://myurl.se\")\n //->setCancelUrl()\n //->setCardPageLanguage(\"SE\")\n ->getPaymentForm();\n \n $url = \"https://test.sveaekonomi.se/webpay/payment\";\n\n // do request modeled on CardPymentIntegrationTest.php\n \n // make sure the transaction has status SUCCESS at Svea\n \n // credit transcation using above the transaction transactionId\n \n // assert response from lowerTransactionAmount equals success\n }", "function CheckMerchantData() {\n\t //$timedif = $this->GMT_TUR*3600-(date(\"Z\")-(date(\"I\")*3600));\n\t //$now = (time()+$timedif) * 1000;\n $now = time() * 1000;\n $minTime = $now - INTERVALTIMEFORPOSNETTRAN;\n $maxTime = $now + INTERVALTIMEFORPOSNETTRAN;\n\n if ($this->posnetOOSResponse->trantime < $minTime || $this->posnetOOSResponse->trantime > $maxTime ) {\n $this->posnetOOSResponse->errorcode = \"444\";\n $this->posnetOOSResponse->errormessage = \"ISLEM ZAMANI UYUMSUZ\";\n if ($this->debug)\n echo($this->posnetOOSResponse->errormessage);\n return false;\n }\n if (strcmp($this->posnetOOSResponse->mid, $this->merchantInfo->mid) != 0 || strcmp($this->posnetOOSResponse->tid, $this->merchantInfo->tid) != 0 ) {\n $this->posnetOOSResponse->errorcode = \"444\";\n $this->posnetOOSResponse->errormessage = \"MID TID UYUMSUZ\";\n if ($this->debug)\n echo($this->posnetOOSResponse->errormessage);\n return false;\n }\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion para crear un respaldo de los archivos procesados de AMEX
function crearRespaldo($APP_EEXPENSES_DIR, $archivo){ $dirBackup = $APP_EEXPENSES_DIR.'backup/'; $dirbackupMes = $dirBackup.'/'.date("Y_m"); if(!is_dir($dirBackup)) mkdir($dirBackup, 0777, true); if(!is_dir($dirbackupMes)) mkdir($dirbackupMes, 0777, true); if(copy($APP_EEXPENSES_DIR.$archivo, $dirbackupMes.'/'.$archivo)) unlink($APP_EEXPENSES_DIR.$archivo); else{ $dataElements["code"] = 5; $dataElements["file"] = $archivo; $dataElements["url"] = $APP_EEXPENSES_DIR; log_amex($dataElements); } }
[ "function crear_ArchivosPlanos(){\n try {\n $id_user = $this->crypt->decrypt($_SESSION['id_user'],_PASS_);// llama la clase crypt de decrypt para decodificar los 2 parametros\n $id_productoventa = $_POST['id'];\n $estado_enviado = $_POST['envio_sunat'];\n //$cliente_data = $this->client->listAll();\n $comprobante = $this->sell->datos_comprobante($id_productoventa); //CONSULTA DONDE SE REALACIONA TODO LO QUE SE USA EN SELLPRODUCTGAS\n $comprobante_saleproduct = $this->sell->listSale($id_productoventa);\n $saledetail_data = $this->sell->todos_saledetaill($id_productoventa);\n $fecha_bolsa = date(\"Y\");\n if ($fecha_bolsa == \"2020\"){\n $impuesto_icbper = 0.20;\n } else if ($fecha_bolsa == \"2021\"){\n $impuesto_icbper = 0.30;\n } else if ($fecha_bolsa == \"2022\") {\n $impuesto_icbper = 0.40;\n } else{\n $impuesto_icbper = 0.50;\n }\n $rutaArchivos = \"C:/FacturadorBufeo/sunat_archivos/sfs/DATA/\";\n if ($estado_enviado == 0) {\n if ($comprobante->saleproductgas_type < 4) {\n // FACTURA , BOLETA\n\n /*nombre archivo*/\n $fechaHoraEmision = new DateTime($comprobante->fecha_sunat);\n $fechaVencimiento = new DateTime($comprobante->fecha_de_vencimiento);\n $sql = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.CAB';\n $f = fopen($sql, 'w'); //crea la libreria (con nombre especificado)\n//HASTA ACA SE CREA EL ARCHIVO .CAB\n /*cuerpo documento cabecera*/\n $linea = \"0101|\";//tipo operacion\n $linea .= \"{$fechaHoraEmision->format('Y-m-d')}|\";//fecha emision\n $linea .= \"{$fechaHoraEmision->format('H:i:s')}|\";//hora emision\n $linea .= \"{$fechaVencimiento->format('Y-m-d')}|\";//:fecha vencimiento\n $linea .= \"0000|\";//codigo domicilio fiscal\n $linea .= \"{$comprobante->tipodocumento_codigo}|\";//tipo de documento de identidad\n $linea .= trim(\"{$comprobante->client_number}\").\"|\";//:numero de documento identidad || trmi(Elimina espacio en blanco (u otro tipo de caracteres) del inicio y el final de la cadena)\n if ($comprobante->client_razonsocial == \"\"){\n $linea .= \"{$comprobante->client_name}|\";//apellidos y nombres o razon social\n } else{\n $linea .= \"{$comprobante->client_razonsocial}|\";//apellidos y nombres o razon social\n }\n $linea .= \"{$comprobante->abrstandar}|\";//:tipo de moneda\n $linea .= \"{$comprobante->saleproductgas_totaligv}|\";//:sumatoria tributos\n if($comprobante->saleproductgas_totalgravada == \"0.00\"){\n $linea .= \"{$comprobante->saleproductgas_total}|\";//:total valor venta\n } else{\n $linea .= \"{$comprobante->saleproductgas_totalgravada}|\";//:total valor venta\n }\n\n $linea .= \"{$comprobante->saleproductgas_total}|\";//total precio venta\n $linea .= \"$comprobante_saleproduct->total_descuentos|\";//total descuento\n $linea .= \"0.00|\";//sumatoria otros cargos\n /*buscamos si el comprobante a enviar tiene anticipos*/\n /*$this->db->from(\"comprobante_anticipo\");\n $this->db->join(\"comprobantes\", \"comprobante_anticipo.comprobante_id=comprobantes.id\");\n $this->db->where(\"comprobante_id\" , $comprobante_id);\n $query = $this->db->get();\n $anticipos = $query->result();\n if(count($anticipos))\n {\n $totalAnticipos = 0;\n foreach($anticipos as $anticipo)\n {\n $totalAnticipo += $anticipo->total_a_pagar;\n }\n $linea .= \"{$totalAnticipo}|\";\n }else{\n $linea .= \"0|\";//total anticipo\n }*/\n $linea .= \"0.00|\";//total anticipo\n $importetotal = $comprobante->saleproductgas_total - $comprobante_saleproduct->total_descuentos + 0 - 0;\n $linea .= \"{$importetotal}|\";//Importe total de la venta, cesión en uso o del servicio prestado\n $linea .= \"2.1|\";//version UBL\n $linea .= \"2.0|\\r\\n\";//customization\n\n fwrite($f, $linea); // Escritura de un archivo en modo binario seguro\n fclose($f); //CERRAMOS EL FICHERO\n //empezamos con el archivo .DET\n $rut = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.DET';\n $f = fopen($rut, 'w');\n foreach ($saledetail_data as $value) {\n $result = $this->sell->Buscarproduct_detalle($value->id_productforsale);\n\n // $precioBaseUnidad = ($value['total']-$value['igv'])/$value['cantidad'];//precio unitario sin igv\n /*if($comprobante1->comprobante_anticipo == '1')\n {\n $precioBaseUnidad = (($value['subtotal']/$value['cantidad'])/1.18);\n }else{\n $precioBaseUnidad = ($value['subtotal']/$value['cantidad']);\n }\n\n $precioConIgv = $precioBaseUnidad*1.18;\n $igvUnitario = $precioConIgv-$precioBaseUnidad ; */\n\n // $igvPorUnidad = $precioBaseUnidad;\n $descripction = $this->sanear_string(utf8_decode($value->sale_productnamegas));\n\n $linea = \"{$result->medida_codigo_unidad}|\";//Código de unidad de medida por ítem\n $linea .= \"{$value->sale_productscantgas}|\";//Cantidad de unidades por ítem\n $linea .= \"{$result->product_barcode}|\";//Código de producto\n $linea .= \"-|\";//Codigo producto SUNAT\n $linea .= str_replace(\"&\", \"Y\", trim(utf8_decode($descripction))).\"|\";//Descripción detallada del servicio prestado, bien vendido o cedido en uso, indicando las características.\n $linea .= round($value->precio_base, 2).\"|\";//Valor Unitario (cac:InvoiceLine/cac:Price/cbc:PriceAmount)\n $linea .= \"{$value->igv}|\";//Sumatoria Tributos por item\n //TRIBUTO IGV\n $linea .= \"{$value->igv_codigo}|\";//Tributo: Códigos de tipos de tributos IGV(1000 - 1016 - 9995 - 9996 - 9997 - 9998)\n $linea .= \"{$value->igv}|\";//Tributo: Monto de IGV por ítem\n if($value->igv_codigoafectacion == '40')//gratuitas la base es 0\n {\n $linea .= \"0|\";//Tributo: Base Imponible IGV por Item\n }else\n {\n $linea .= \"{$value->subtotal}|\";//Tributo: Base Imponible IGV por Item\n }\n\n $linea .= \"{$value->igv_nombre}|\";//Tributo: Nombre de tributo por item\n //$linea .= $this->tipoCodigoDeTributo($value['tipo_igv_codigo']).\"|\";//Tributo: Código de tipo de tributo por Item\n $linea .= \"{$value->igv_codigoInternacional}|\";//Tributo: Código de tipo de tributo por Item\n $linea .= \"{$value->igv_codigoafectacion}|\";//Tributo: Afectación al IGV por ítem\n if($value->igv == \"0.00\"){\n $linea .= \"0.00|\";//Tributo: Porcentaje de IGV\n } else{\n $linea .= \"18.00|\";//Tributo: Porcentaje de IGV\n }\n /*Tributo ISC (2000)*/\n $linea .= \"-|\";//Tributo ISC: Códigos de tipos de tributos ISC\n $linea .= \"|\";//Tributo ISC: Monto de ISC por ítem\n $linea .= \"|\";//Tributo ISC: Base Imponible ISC por Item\n $linea .= \"|\";//Tributo ISC: Nombre de tributo por item\n $linea .= \"|\";//Tributo ISC: Código de tipo de tributo por Item\n $linea .= \"|\";//Tributo ISC: Tipo de sistema ISC\n $linea .= \"|\";//Tributo ISC: Porcentaje de ISC\n /*Tributo Otro 9999*/\n $linea .= \"-|\";//Tributo Otro: Códigos de tipos de tributos OTRO\n $linea .= \"|\";//Tributo Otro: Monto de tributo OTRO por iItem\n $linea .= \"|\";//Tributo Otro: Base Imponible de tributo OTRO por Item\n $linea .= \"|\";//Tributo Otro: Nombre de tributo OTRO por item\n $linea .= \"|\";//Tributo Otro: Código de tipo de tributo OTRO por Item\n $linea .= \"|\";//Tributo Otro: Porcentaje de tributo OTRO por Item\n //Tributo ICBPER 7152\n\n if ($value->total_icbper > 0){\n $linea .= \"7152|\";//Tributo ICBPER: Códigos de tipos de tributos ICBPER\n $linea .= \"{$value->total_icbper}|\";//Tributo ICBPER: Monto de tributo ICBPER por iItem\n $linea .= \"{$value->sale_productscantgas}|\";//Tributo ICBPER: Cantidad de bolsas plásticas por Item\n $linea .= \"ICBPER|\";//Tributo ICBPER: Nombre de tributo ICBPER por item\n $linea .= \"OTH|\";//Tributo ICBPER: Código de tipo de tributo ICBPER por Item\n $linea .= number_format($impuesto_icbper , 2).\"|\";//Tributo ICBPER: Monto de tributo ICBPER por Unidad\n } else {\n $linea .= \"-|\";//Tributo ICBPER: Códigos de tipos de tributos ICBPER\n $linea .= \"|\";//Tributo ICBPER: Monto de tributo ICBPER por iItem\n $linea .= \"|\";//Tributo ICBPER: Cantidad de bolsas plásticas por Item\n $linea .= \"|\";//Tributo ICBPER: Nombre de tributo ICBPER por item\n $linea .= \"|\";//Tributo ICBPER: Código de tipo de tributo ICBPER por Item\n $linea .= \"|\";//Tributo ICBPER: Monto de tributo ICBPER por Unidad\n\n }\n\n if($value->igv_tipoigv == 1){\n $linea .= ($value->precio_base * 1.18).\"|\";//Precio de venta unitario(base+igv)\n } else{\n $linea .= ($value->precio_base).\"|\";\n }\n\n $linea .= round($value->subtotal, 2).\"|\";//Valor de venta por Item\n $linea .= \"0.00|\\r\\n\";//Valor REFERENCIAL unitario (gratuitos)*/\n fwrite($f, $linea);\n }\n fclose($f);\n /*DOCUMENTO TRIBUTO*/\n $rut_tributo = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.TRI';\n $f = fopen($rut_tributo, 'w');\n //si tributo es igv\n if($comprobante->saleproductgas_totalgravada > 0)\n {\n $linea = \"1000|\";//Identificador de tributo\n $linea .= \"IGV|\";//Nombre de tributo\n $linea .= \"VAT|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalgravada}|\";//Base imponible\n $linea .= \"{$comprobante->saleproductgas_totaligv}|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es exonerada\n if($comprobante->saleproductgas_totalexonerada > 0)\n {\n $linea = \"9997|\";//Identificador de tributo\n $linea .= \"EXO|\";//Nombre de tributo\n $linea .= \"VAT|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalexonerada}|\";//Base imponible\n $linea .= \"0|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es inafecto\n if($comprobante->saleproductgas_totalinafecta > 0)\n {\n $linea = \"9998|\";//Identificador de tributo\n $linea .= \"INA|\";//Nombre de tributo\n $linea .= \"FRE|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalinafecta}|\";//Base imponible\n $linea .= \"0|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es gratuita/exportacion\n /*if($comprobante['total_gratuita'] > 0)\n {\n $linea = \"9996|\";//Identificador de tributo\n $linea .= \"GRA|\";//Nombre de tributo\n $linea .= \"FRE|\";//Código de tipo de tributo\n $linea .= \"{$comprobante['total_gratuita']}|\";//Base imponible\n $linea .= \"0|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }*/\n //tributo de bolsa\n if($comprobante->saleproductgas_icbper > 0)\n {\n $linea = \"7152|\";//Identificador de tributo\n $linea .= \"ICBPER|\";//Nombre de tributo\n $linea .= \"OTH|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_total}|\";//Base imponible\n $linea .= \"{$comprobante->saleproductgas_icbper}|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n\n fclose($f);\n /*DOCUMENTO LEYENDA*/\n $importe_letra = $this->numLetra->num2letras(intval($comprobante->saleproductgas_total));\n $arrayImporte = explode(\".\",$comprobante->saleproductgas_total);\n $montoLetras = $importe_letra.' con ' .$arrayImporte[1].'/100 '.$comprobante->moneda;\n $rut_leyenda = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.LEY';\n $f = fopen($rut_leyenda, 'w');\n $linea = \"1000|\";//Código de leyenda\n $linea .= \"{$montoLetras}|\";//Descripción de leyenda\n fwrite($f, $linea);\n fclose($f);\n \n $cambiar_enviosunat = $this->sell->envio_sunat($id_productoventa);\n $return = 1;\n } else{\n //NOTA DE CREDITO , DEBITO\n /*obtenemos el archivo adjunto a esa nota de credito o debito*/\n $tipo_docuemnto = $comprobante->saleproductgas_type;\n if($comprobante->saleproductgas_type == \"07\"){\n $rsAdjunto = $this->sell->tipo_nota_credito($id_productoventa,$tipo_docuemnto);\n } else{\n $rsAdjunto = $this->sell->tipo_nota_debito($id_productoventa, $tipo_docuemnto);\n }\n $fechaHoraEmision = new DateTime($comprobante->fecha_sunat);\n $linea = \"0101|\"; //Tipo de Operacion\n $linea .= \"{$fechaHoraEmision->format('Y-m-d')}|\";//Fecha de Emision\n $linea .= \"{$fechaHoraEmision->format('H:i:s')}|\"; //Hora de Emision\n $linea .= \"0000|\"; //Código del domicilio fiscal o de local anexo del emisor\n $linea .= \"{$comprobante->tipodocumento_codigo}|\"; //Tipo de documento de identidad del adquirente o usuario\n $linea .= trim(\"{$comprobante->client_number}\").\"|\";//:numero de documento identidad || trmi(Elimina espacio en blanco (u otro tipo de caracteres) del inicio y el final de la cadena)\n if ($comprobante->client_razonsocial == \"\"){\n $linea .= \"{$comprobante->client_name}|\";//apellidos y nombres o razon social\n } else{\n $linea .= \"{$comprobante->client_razonsocial}|\";//apellidos y nombres o razon social\n }\n $linea .= \"{$comprobante->abrstandar}|\";//:tipo de moneda\n $linea .= \"{$rsAdjunto->codigo}|\";//Código del tipo de Nota electrónica\n $linea .= \"{$rsAdjunto->tipo_nota_descripcion}|\";//Descripción de motivo o sustento\n $linea .= \" |\";//Tipo de documento del documento que modifica\n $linea .= \"-|\";//Serie y número del documento que modifica\n $linea .= \"{$comprobante->saleproductgas_totaligv}|\";//:sumatoria tributos\n if($comprobante->saleproductgas_totalgravada == \"0.00\"){\n $linea .= \"{$comprobante->saleproductgas_total}|\";//:total valor venta -\n } else{\n $linea .= \"{$comprobante->saleproductgas_totalgravada}|\";//:total valor venta -\n }\n\n $linea .= \"{$comprobante->saleproductgas_total}|\";//total precio venta - 15\n $linea .= \"$comprobante_saleproduct->total_descuentos|\";//total descuento - 16\n $linea .= \"0.00|\";//sumatoria otros cargos - 17\n $linea .= \"0.00|\";//Total Anticipos - 18\n $importetotal = $comprobante->saleproductgas_total - $comprobante_saleproduct->total_descuentos + 0 - 0;\n $linea .= \"{$importetotal}|\";//Importe total de la venta, cesión en uso o del servicio prestado\n $linea .= \"2.1|\";//version UBL\n $linea .= \"2.0|\\r\\n\";//customization\n /*creamos archivo nota*/\n $sql = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.NOT';\n $f = fopen($sql, 'w');\n fwrite($f, $linea);\n fclose($f);\n\n //empezamos con el archivo .DET\n $rut = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.DET';\n $f = fopen($rut, 'w');\n foreach ($saledetail_data as $value) {\n $result = $this->sell->Buscarproduct_detalle($value->id_productforsale);\n\n // $precioBaseUnidad = ($value['total']-$value['igv'])/$value['cantidad'];//precio unitario sin igv\n /*if($comprobante1->comprobante_anticipo == '1')\n {\n $precioBaseUnidad = (($value['subtotal']/$value['cantidad'])/1.18);\n }else{\n $precioBaseUnidad = ($value['subtotal']/$value['cantidad']);\n }\n\n $precioConIgv = $precioBaseUnidad*1.18;\n $igvUnitario = $precioConIgv-$precioBaseUnidad ; */\n\n // $igvPorUnidad = $precioBaseUnidad;\n $descripction = $this->sanear_string(utf8_decode($value->sale_productnamegas));\n\n $linea = \"{$result->medida_codigo_unidad}|\";//Código de unidad de medida por ítem\n $linea .= \"{$value->sale_productscantgas}|\";//Cantidad de unidades por ítem\n $linea .= \"{$result->product_barcode}|\";//Código de producto\n $linea .= \"-|\";//Codigo producto SUNAT\n $linea .= str_replace(\"&\", \"Y\", trim(utf8_decode($descripction))).\"|\";//Descripción detallada del servicio prestado, bien vendido o cedido en uso, indicando las características.\n $linea .= round($value->precio_base, 2).\"|\";//Valor Unitario (cac:InvoiceLine/cac:Price/cbc:PriceAmount)\n $linea .= \"{$value->igv}|\";//Sumatoria Tributos por item\n //TRIBUTO IGV\n $linea .= \"{$value->igv_codigo}|\";//Tributo: Códigos de tipos de tributos IGV(1000 - 1016 - 9995 - 9996 - 9997 - 9998)\n $linea .= \"{$value->igv}|\";//Tributo: Monto de IGV por ítem\n if($value->igv_codigoafectacion == '40')//gratuitas la base es 0\n {\n $linea .= \"0|\";//Tributo: Base Imponible IGV por Item\n }else\n {\n $linea .= \"{$value->subtotal}|\";//Tributo: Base Imponible IGV por Item\n }\n\n $linea .= \"{$value->igv_nombre}|\";//Tributo: Nombre de tributo por item\n //$linea .= $this->tipoCodigoDeTributo($value['tipo_igv_codigo']).\"|\";//Tributo: Código de tipo de tributo por Item\n $linea .= \"{$value->igv_codigoInternacional}|\";//Tributo: Código de tipo de tributo por Item\n $linea .= \"{$value->igv_codigoafectacion}|\";//Tributo: Afectación al IGV por ítem\n if($value->igv == \"0.00\"){\n $linea .= \"0.00|\";//Tributo: Porcentaje de IGV\n } else{\n $linea .= \"18.00|\";//Tributo: Porcentaje de IGV\n }\n /*Tributo ISC (2000)*/\n $linea .= \"-|\";//Tributo ISC: Códigos de tipos de tributos ISC\n $linea .= \"|\";//Tributo ISC: Monto de ISC por ítem\n $linea .= \"|\";//Tributo ISC: Base Imponible ISC por Item\n $linea .= \"|\";//Tributo ISC: Nombre de tributo por item\n $linea .= \"|\";//Tributo ISC: Código de tipo de tributo por Item\n $linea .= \"|\";//Tributo ISC: Tipo de sistema ISC\n $linea .= \"|\";//Tributo ISC: Porcentaje de ISC\n /*Tributo Otro 9999*/\n $linea .= \"-|\";//Tributo Otro: Códigos de tipos de tributos OTRO\n $linea .= \"|\";//Tributo Otro: Monto de tributo OTRO por iItem\n $linea .= \"|\";//Tributo Otro: Base Imponible de tributo OTRO por Item\n $linea .= \"|\";//Tributo Otro: Nombre de tributo OTRO por item\n $linea .= \"|\";//Tributo Otro: Código de tipo de tributo OTRO por Item\n $linea .= \"|\";//Tributo Otro: Porcentaje de tributo OTRO por Item\n //Tributo ICBPER 7152\n\n if ($value->total_icbper > 0){\n $linea .= \"7152|\";//Tributo ICBPER: Códigos de tipos de tributos ICBPER\n $linea .= \"{$value->total_icbper}|\";//Tributo ICBPER: Monto de tributo ICBPER por iItem\n $linea .= \"{$value->sale_productscantgas}|\";//Tributo ICBPER: Cantidad de bolsas plásticas por Item\n $linea .= \"ICBPER|\";//Tributo ICBPER: Nombre de tributo ICBPER por item\n $linea .= \"OTH|\";//Tributo ICBPER: Código de tipo de tributo ICBPER por Item\n $linea .= number_format($impuesto_icbper , 2).\"|\";//Tributo ICBPER: Monto de tributo ICBPER por Unidad\n } else {\n $linea .= \"-|\";//Tributo ICBPER: Códigos de tipos de tributos ICBPER\n $linea .= \"|\";//Tributo ICBPER: Monto de tributo ICBPER por iItem\n $linea .= \"|\";//Tributo ICBPER: Cantidad de bolsas plásticas por Item\n $linea .= \"|\";//Tributo ICBPER: Nombre de tributo ICBPER por item\n $linea .= \"|\";//Tributo ICBPER: Código de tipo de tributo ICBPER por Item\n $linea .= \"|\";//Tributo ICBPER: Monto de tributo ICBPER por Unidad\n\n }\n\n if($value->igv_tipoigv == 1){\n $linea .= ($value->precio_base * 1.18).\"|\";//Precio de venta unitario(base+igv)\n } else{\n $linea .= ($value->precio_base).\"|\";\n }\n\n $linea .= round($value->subtotal, 2).\"|\";//Valor de venta por Item\n $linea .= \"0.00|\\r\\n\";//Valor REFERENCIAL unitario (gratuitos)*/\n fwrite($f, $linea);\n }\n fclose($f);\n /*DOCUMENTO TRIBUTO*/\n $rut_tributo = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.TRI';\n $f = fopen($rut_tributo, 'w');\n //si tributo es igv\n if($comprobante->saleproductgas_totalgravada > 0)\n {\n $linea = \"1000|\";//Identificador de tributo\n $linea .= \"IGV|\";//Nombre de tributo\n $linea .= \"VAT|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalgravada}|\";//Base imponible\n $linea .= \"{$comprobante->saleproductgas_totaligv}|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es exonerada\n if($comprobante->saleproductgas_totalexonerada > 0)\n {\n $linea = \"9997|\";//Identificador de tributo\n $linea .= \"EXO|\";//Nombre de tributo\n $linea .= \"VAT|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalexonerada}|\";//Base imponible\n $linea .= \"0.00|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es inafecto\n if($comprobante->saleproductgas_totalinafecta > 0)\n {\n $linea = \"9998|\";//Identificador de tributo\n $linea .= \"INA|\";//Nombre de tributo\n $linea .= \"FRE|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_totalinafecta}|\";//Base imponible\n $linea .= \"0|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n //si tributo es gratuita/exportacion\n /*if($comprobante['total_gratuita'] > 0)\n {\n $linea = \"9996|\";//Identificador de tributo\n $linea .= \"GRA|\";//Nombre de tributo\n $linea .= \"FRE|\";//Código de tipo de tributo\n $linea .= \"{$comprobante['total_gratuita']}|\";//Base imponible\n $linea .= \"0|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }*/\n //tributo de bolsa\n if($comprobante->saleproductgas_icbper > 0)\n {\n $linea = \"7152|\";//Identificador de tributo\n $linea .= \"ICBPER|\";//Nombre de tributo\n $linea .= \"OTH|\";//Código de tipo de tributo\n $linea .= \"{$comprobante->saleproductgas_total}|\";//Base imponible\n $linea .= \"{$comprobante->saleproductgas_icbper}|\\r\\n\";//Monto de Tirbuto por ítem\n fwrite($f, $linea);\n }\n\n fclose($f);\n /*DOCUMENTO LEYENDA*/\n $importe_letra = $this->numLetra->num2letras(intval($comprobante->saleproductgas_total));\n $arrayImporte = explode(\".\",$comprobante->saleproductgas_total);\n $montoLetras = $importe_letra.' con ' .$arrayImporte[1].'/100 '.$comprobante->moneda;\n $rut_leyenda = $rutaArchivos . $comprobante->empresa_ruc . '-' . $comprobante->saleproductgas_type . '-' . $comprobante->saleproductgas_correlativo . '.LEY';\n $f = fopen($rut_leyenda, 'w');\n $linea = \"1000|\";//Código de leyenda\n $linea .= \"{$montoLetras}|\";//Descripción de leyenda\n fwrite($f, $linea);\n fclose($f);\n\n $cambiar_enviosunat = $this->sell->envio_sunat($id_productoventa);\n $return = 1;\n\n }\n\n } else{\n // COMUNICACION DE BAJA\n $this->sell_anulados = new SellGasAnulados();\n $fecha1 = date(\"Ymd\"); //fecha que ira en el nombre del archivo\n $fechaanulado = date(\"Y-m-d\"); //fecha que ira a la base de datos\n $resultado_fecha = $this->sell_anulados->seleccionar($fechaanulado);\n if ($resultado_fecha->numero > 0){\n $numero_correlativo = $resultado_fecha->numero + 1;\n } else{\n $numero_correlativo = 1;\n }\n $f = fopen($rutaArchivos . $comprobante->empresa_ruc . '-RA-' . $fecha1 . '-' . $numero_correlativo . '.CBA', 'w');\n\n $linea = (new DateTime($comprobante_saleproduct->saleproductgas_date))->format('Y-m-d').'|';\n $linea .= (new DateTime())->format('Y-m-d').\"|\";\n $linea .= $comprobante->saleproductgas_type.\"|\";\n $linea .= $comprobante->saleproductgas_correlativo.'|';\n $linea .= \"anulacion|\";\n fwrite($f, $linea);\n fclose($f);\n\n $this->sell_anulados->insertar_anulacion($fechaanulado, $numero_correlativo, $id_productoventa, $id_user);\n $this->sell->anular_sunat($id_productoventa , $fechaanulado);\n $return = 3;\n }\n }catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $return = 2;\n }\n echo $return;\n\n }", "function opcion__compilar_perfiles()\n {\n $param = $this->get_parametros();\n $id = isset($param[\"-p\"]) ? $param[\"-p\"] : $this->get_id_proyecto_actual(true);\n\n try {\n $proyecto = $this->get_proyecto($id);\n $path = $proyecto->get_dir_generales_compilados();\n if (!\\file_exists($path) || !\\is_writable($path)) {\n $this->consola->error('ATENCION!!: Considere ejecutar el comando compilar para abarcar todos los metadatos'. PHP_EOL);\n throw new toba_error('No existe o no es accesible la carpeta de metadatos compilados!!'. PHP_EOL);\n }\n toba_manejador_archivos::crear_arbol_directorios($path);\n $proyecto->compilar_metadatos_generales_grupos_acceso(true);\n } catch ( toba_error $e ) {\n\t\t$this->consola->error( \"PROYECTO $id: Ha ocurrido un error durante la compilacion:\\n\".$e->getMessage());\n exit(-1);\n }\n }", "public static function descargar($param) {\n extract($param);\n $totalArchivos=$param;\n \n try {\n if ($totalArchivos) {\n $totalArchivos = count($archivos);\n if ($totalArchivos == 1) {\n $nombreArchivo = $archivos[0];\n } else if ($totalArchivos > 1) { // Crear un ZIP para enviar todos los archivos\n $nombreArchivoZIP = $descarga['carpeta'] . $descarga['nombreZIP'] . '.zip';\n $zip = new ZipArchive;\n if ($zip->open($nombreArchivoZIP, ZIPARCHIVE::OVERWRITE) === TRUE) {\n foreach ($archivos as $archivo) {\n if (file_exists($archivo)) {\n $zip->addFile($archivo, $descarga['nombreZIP'] . '/' . \n pathinfo($archivo, PATHINFO_BASENAME));\n } else {\n error_log(\"Intentando agregar <<\" . pathinfo($archivo,\n PATHINFO_BASENAME) . \n \">> a \" . $descarga['nombreZIP'] . \" pero no existe.\", 0);\n }\n }\n $zip->close();\n $nombreArchivo = $nombreArchivoZIP;\n } else {\n throw new Exception('Falló la creación de ' .\n $descarga['nombreZIP'] . '.zip');\n }\n } else {\n throw new Exception(\"No se encontraron archivos\");\n }\n } else {\n throw new Exception(\"No se encontró....\");\n }\n if (!is_file($nombreArchivo)) {\n $nombreArchivo = pathinfo($nombreArchivo,\n PATHINFO_BASENAME);\n throw new Exception(\"El archivo $nombreArchivo no ….\");\n } else {\n $rutaArchivo = $nombreArchivo;\n $nombreArchivo = pathinfo($nombreArchivo,\n PATHINFO_BASENAME);\n // Se inicia la descarga\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, \n pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Disposition: attachment;\n filename=\\\"$nombreArchivo\\\"\\n\"); // Oculta la ruta de descarga\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Length: \" . filesize($rutaArchivo));\n @readfile($rutaArchivo);\n }\n } catch (Exception $e) {\n echo json_encode(['ok' => 0, 'mensaje' => $e->getMessage()]); }\n }", "public function verificarArchivoPlanoCovinoc($_post, $_files){\r\n $file = $_POST['idTmpFile'];\r\n $usuario_creacion = $_POST['usuario_creacion'];\r\n $servicio = $_POST['servicio'];\r\n $fechaProceso = $_POST['fecha_proceso'];\r\n $nameFile = \"\";\r\n $factoryConnection = FactoryConnection::create('mysql');\r\n $connection = $factoryConnection->getConnection();\r\n $confCobrast = parse_ini_file('../conf/cobrast.ini', true);\r\n $randon = date(\"Y_m_d_H_i_s\") . rand(100,1000);\r\n $nameFile_separado = \"\";\r\n $cadena_proceso = array();\r\n $array_importar = array();\r\n //tmp_filDatDem_\r\n $campos_tmp_filDatDem = array('tip_doc varchar(50)','doc varchar(50)','contrato varchar(50)',\r\n 'obligacion varchar(50)','nombre varchar(50)','tip_deudor varchar(50)');\r\n $pauta_length_filDatDem = array('0','1','13','9','30','80','20');\r\n $pauta_posicion_filDatDem = array('0','1','14','23','53','133');\r\n //tmp_filOblMor\r\n $campos_tmp_filOblMor = array('contrato varchar(50)','obligacion varchar(50)','producto varchar(50)',\r\n 'saldo_actual varchar(50)','mora varchar(50)','fecha_corte varchar(50)');\r\n $pauta_length_filOblMor = array('0','9','30','20','13','13','10');\r\n $pauta_posicion_filOblMor = array('0','9','39','59','72','85');\r\n //tmp_filDatAdiObl\r\n $campos_tmp_filDatAdiObl = array('contrato varchar(50)','obligacion varchar(50)','portafolio varchar(50)',\r\n 'originador varchar(50)','sub_prod varchar(50)','capital varchar(50)',\r\n 'interes_corriente varchar(50)','interes_mora varchar(50)','otros varchar(50)');\r\n $pauta_length_filDatAdiObl = array('0','9','30','20','25','20','13','13','13','13');\r\n $pauta_posicion_filDatAdiObl = array('0','9','39','59','84','104','117','130','143');\r\n //tmp_filOtrDatAdiObl\r\n $campos_tmp_filOtrDatAdiObl = array('contrato varchar(50)','obligacion varchar(50)','producto varchar(50)',\r\n 'fecha_inicio_mora varchar(50)');\r\n $pauta_length_filOtrDatAdiObl = array('0','9','30','20','10');\r\n $pauta_posicion_filOtrDatAdiObl = array('0','9','39','59');\r\n //tmp_filDatTel\r\n $campos_tmp_filDatTel = array('tip_doc varchar(50)','doc varchar(50)','telefono varchar(50)',\r\n 'extension varchar(50)','tip_tel varchar(50)','ciudad varchar(50)'\r\n ,'departamento varchar(50)');\r\n $pauta_length_filDatTel = array('0','1','13','11','5','1','30','20');\r\n $pauta_posicion_filDatTel = array('0','1','14','25','30','31','61');\r\n //tmp_filDatDir\r\n $campos_tmp_filDatDir = array('tip_doc varchar(50)','doc varchar(50)','direccion varchar(50)',\r\n 'ciudad varchar(50)','tip_direccion varchar(50)');\r\n $pauta_length_filDatDir = array('0','1','13','100','30','1');\r\n $pauta_posicion_filDatDir = array('0','1','14','114','144');\r\n //tmp_filDatEma\r\n $campos_tmp_filDatEma = array('tip_doc varchar(50)','doc varchar(50)','email varchar(50)');\r\n $pauta_length_filDatEma = array('0','1','13','100');\r\n $pauta_posicion_filDatEma = array('0','1','14');\r\n // vamos a verificar uno por uno .\r\n if (@opendir('../documents/carteras/COVINOC/preparacion_archivos_planos')) {\r\n if (@move_uploaded_file($_files[$file]['tmp_name'], '../documents/carteras/COVINOC/preparacion_archivos_planos' . '/' . $_files[$file]['name'])) {\r\n $nameFile = $_files[$file]['name'];\r\n $nameFile_separado = $randon.$_files[$file]['name'];\r\n // echo json_encode(array('rst' => true, 'msg' => 'okas'));\r\n } else {\r\n echo json_encode(array('rst' => false, 'msg' => 'Error al subir archivo al servidor'));\r\n }\r\n switch ($_POST['caso']) {\r\n case 'fileDatosDemograficos':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filDatDem);$i++){\r\n if($i!=count($pauta_length_filDatDem)-1){\r\n array_push($cadena_proceso, str_replace(array(\"\\\"\",\"\\\\\"),\" \",trim(substr($lineas[$j],$pauta_posicion_filDatDem[$i],$pauta_length_filDatDem[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n // echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n \r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filDatDem_\".$randon.\" (\".implode(',', $campos_tmp_filDatDem).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filDatDem_\".$randon.\" FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filDatDem_\".$randon.\r\n \" WHERE tip_doc = '' OR doc = '' \".\r\n \"OR obligacion='' OR tip_deudor='' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n $sqlTruncateInProceso = \"TRUNCATE proc_prep_covinoc \";\r\n $prTruncateInProceso = $connection->prepare($sqlTruncateInProceso);\r\n $prTruncateInProceso->execute();\r\n $sqlTruncateInConsolidado = \"TRUNCATE data_preparacion_covinoc \";\r\n $prTruncateInConsolidado = $connection->prepare($sqlTruncateInConsolidado);\r\n $prTruncateInConsolidado->execute();\r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlInsertInProceso = \"INSERT INTO proc_prep_covinoc (estado, fecha_creacion, usuario_creacion, idservicio, isload_datos_demograficos ) VALUES(1, now(), \".$usuario_creacion.\", \".$servicio.\", 1 )\";\r\n $prInsertInProceso = $connection->prepare($sqlInsertInProceso);\r\n $prInsertInProceso->execute();\r\n\r\n $sqlInsertInConsolidado = \"INSERT INTO data_preparacion_covinoc (CODCENT, TIPO_DOCUMENTO, DOCUMENTO, CONTRATO, OBLIGACION, NOMBRE, TIPO_DEUDOR ) ( SELECT doc, tip_doc, doc, contrato,obligacion, nombre, tip_deudor FROM tmp_filDatDem_\".$randon.\" )\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n\r\n $sqlUpdateCodCentInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN ca_cliente cli ON LPAD(cli.numero_documento,13,0)=dat.DOCUMENTO SET dat.CODCENT=cli.codigo WHERE cli.estado = 1\";\r\n $prUpdateCodCentInConsolidado = $connection->prepare($sqlUpdateCodCentInConsolidado);\r\n $prUpdateCodCentInConsolidado->execute();\r\n\r\n $sqlUpdateFechaProcesoInConsolidado = \"UPDATE data_preparacion_covinoc dat SET dat.FPROCESO='\".$fechaProceso.\"'\";\r\n $prUpdateFechaProcesoInConsolidado = $connection->prepare($sqlUpdateFechaProcesoInConsolidado);\r\n $prUpdateFechaProcesoInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Pasó la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 'fileObligacionesMora':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filOblMor);$i++){\r\n if($i!=count($pauta_length_filOblMor)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filOblMor[$i],$pauta_length_filOblMor[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filOblMor_\".$randon.\" (\".implode(',', $campos_tmp_filOblMor).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filOblMor_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filOblMor_\".$randon.\r\n \" WHERE obligacion = '' OR producto= '' \".\r\n \"OR saldo_actual='' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_obligaciones_en_mora=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n\r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filOblMor_\".$randon.\" tmp on tmp.obligacion=dat.OBLIGACION SET dat.PRODUCTO=tmp.producto, dat.SALDO_ACTUAL=tmp.saldo_actual, dat.MORA=tmp.mora, dat.FECHA_CORTE=tmp.fecha_corte\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n\r\n break;\r\n case 'fileDatosAdicObligaciones':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filDatAdiObl);$i++){\r\n if($i!=count($pauta_length_filDatAdiObl)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filDatAdiObl[$i],$pauta_length_filDatAdiObl[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filDatAdiObl_\".$randon.\" (\".implode(',', $campos_tmp_filDatAdiObl).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filDatAdiObl_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filDatAdiObl_\".$randon.\r\n \" WHERE obligacion = '' \".\r\n \" \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_dat_adi_obligaciones=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n\r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filDatAdiObl_\".$randon.\" tmp on tmp.obligacion=dat.OBLIGACION SET dat.PORTAFOLIO=tmp.portafolio, dat.ORIGINADOR=tmp.originador, dat.SUB_PRODUCTO=tmp.sub_prod, dat.CAPITAL=tmp.capital, dat.INTERES_CORRIENTE=tmp.interes_corriente, dat.INTERES_MORA=tmp.interes_mora, dat.OTROS=tmp.otros\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 'fileOtrosDatosAdicObligaciones':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filOtrDatAdiObl);$i++){\r\n if($i!=count($pauta_length_filOtrDatAdiObl)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filOtrDatAdiObl[$i],$pauta_length_filOtrDatAdiObl[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filOtrDatAdiObl_\".$randon.\" (\".implode(',', $campos_tmp_filOtrDatAdiObl).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filOtrDatAdiObl_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filOtrDatAdiObl_\".$randon.\r\n \" WHERE obligacion = '' OR producto= '' \".\r\n \"OR fecha_inicio_mora='' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_otr_dat_adi_obligaciones=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n\r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filOtrDatAdiObl_\".$randon.\" tmp on tmp.obligacion=dat.OBLIGACION and tmp.producto=dat.PRODUCTO SET dat.FECHA_INICIO_MORA=tmp.fecha_inicio_mora\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 'fileDatosTelefonos':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filDatTel);$i++){\r\n if($i!=count($pauta_length_filDatTel)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filDatTel[$i],$pauta_length_filDatTel[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filDatTel_\".$randon.\" (\".implode(',', $campos_tmp_filDatTel).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filDatTel_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filDatTel_\".$randon.\r\n \" WHERE tip_doc = '' OR doc = '' OR telefono= '' \".\r\n \"OR tip_tel='' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_datos_telefonos=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n\r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filDatTel_\".$randon.\" tmp on tmp.doc=dat.DOCUMENTO SET dat.TELEFONO=tmp.telefono, dat.EXTENSION=tmp.extension, dat.TIPO_TELEFONO=tmp.tip_tel, dat.CIUDAD=tmp.ciudad, dat.DEPARTAMENTO=tmp.departamento\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 'fileDatosDirecciones':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filDatDir);$i++){\r\n if($i!=count($pauta_length_filDatDir)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filDatDir[$i],$pauta_length_filDatDir[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filDatDir_\".$randon.\" (\".implode(',', $campos_tmp_filDatDir).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filDatDir_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filDatDir_\".$randon.\r\n \" WHERE tip_doc = '' OR doc = '' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n\r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado\r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_datos_direcciones=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n \r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filDatDir_\".$randon.\" tmp on tmp.doc=dat.DOCUMENTO SET dat.DIRECCION=tmp.direccion, dat.TIPO_DIRECCION=tmp.tip_direccion\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.' ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 'fileDatosEmails':\r\n //procesando el archivo\r\n $lineas = file('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile, FILE_SKIP_EMPTY_LINES );\r\n $file_separado= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/'.$nameFile_separado, 'w');\r\n\r\n for($j=0;$j<count($lineas);$j++){\r\n for($i=0;$i<count($pauta_length_filDatEma);$i++){\r\n if($i!=count($pauta_length_filDatEma)-1){\r\n array_push($cadena_proceso, str_replace(\"\\\"\",\" \",trim(substr($lineas[$j],$pauta_posicion_filDatEma[$i],$pauta_length_filDatEma[($i+1)]))));\r\n }\r\n } \r\n $cadena_final = implode(\"\\t\",$cadena_proceso);\r\n array_push($array_importar, $cadena_final);\r\n fwrite($file_separado,$array_importar[$j].\"\\n\");\r\n unset($cadena_proceso);\r\n $cadena_proceso = array();\r\n }\r\n fclose($file_separado);\r\n //echo json_encode(array('rst' => true, 'msg' => $array_importar));\r\n $sqlCreateTemporary = \"CREATE TEMPORARY TABLE tmp_filDatEma_\".$randon.\" (\".implode(',', $campos_tmp_filDatEma).\")\";\r\n $prCreateTemporary = $connection->prepare($sqlCreateTemporary);\r\n if ( $prCreateTemporary->execute() ) {\r\n $sqlLoadTemporary = \" LOAD DATA INFILE '\" . $confCobrast['ruta_cobrast']['document_root_cobrast'] . \"/\" .\r\n $confCobrast['ruta_cobrast']['nombre_carpeta'] . \"/documents/carteras/COVINOC/preparacion_archivos_planos\".\r\n \"/\" . $nameFile_separado . \r\n \"'INTO TABLE tmp_filDatEma_\".$randon.\r\n \" CHARACTER SET utf8 FIELDS TERMINATED BY '\\\\t' LINES TERMINATED BY '\\\\n' \";\r\n $prLoadTemporary = $connection->prepare($sqlLoadTemporary);\r\n if ( $prLoadTemporary->execute() ){\r\n //validaciones\r\n $sqlData = \"SELECT count(*) AS COUNT from tmp_filDatEma_\".$randon.\r\n \" WHERE tip_doc = '' OR doc = '' \";\r\n $prData = $connection->prepare($sqlData);\r\n $prData->execute();\r\n $data = $prData->fetchAll(PDO::FETCH_ASSOC);\r\n if($data[0]['COUNT'] > 0){\r\n echo json_encode(array('rst' => false, 'msg' => 'Verificar - El archivo contiene campos vacios.' ));\r\n exit();\r\n }\r\n \r\n // correcto : actualizar el registro de procesos e insertar la data al consolidado \r\n $sqlUpdateInProceso = \"UPDATE proc_prep_covinoc SET fecha_modificacion = DATE(now()), usuario_modificacion= \".$usuario_creacion.\", isload_datos_emails=1 WHERE usuario_creacion = \".$usuario_creacion.\" and fecha_creacion = DATE(now())\";\r\n $prUpdateInProceso = $connection->prepare($sqlUpdateInProceso);\r\n $prUpdateInProceso->execute();\r\n $sqlInsertInConsolidado = \"UPDATE data_preparacion_covinoc dat INNER JOIN tmp_filDatEma_\".$randon.\" tmp on tmp.doc=dat.DOCUMENTO SET dat.EMAIL=tmp.email\";\r\n $prInsertInConsolidado = $connection->prepare($sqlInsertInConsolidado);\r\n $prInsertInConsolidado->execute();\r\n $sqlDATA = \"SELECT * FROM data_preparacion_covinoc ;\";\r\n $prDATA = $connection->prepare($sqlDATA);\r\n $prDATA->execute();\r\n $arrayDATA = $prDATA->fetchAll(PDO::FETCH_ASSOC);\r\n $file_download= fopen('../documents/carteras/COVINOC/preparacion_archivos_planos/file_download.txt', 'w');\r\n $array_cabecera = array('FPROCESO','CODCENT','TIPO_DOCUMENTO','DOCUMENTO','CONTRATO','OBLIGACION','NOMBRE','TIPO_DEUDOR',\r\n 'PRODUCTO','SALDO_ACTUAL','MORA','FECHA_CORTE','PORTAFOLIO','ORIGINADOR','SUB_PRODUCTO','CAPITAL','INTERES_CORRIENTE','INTERES_MORA','OTROS','FECHA_INICIO_MORA',\r\n 'TELEFONO','EXTENSION','TIPO_TELEFONO','CIUDAD','DEPARTAMENTO','DIRECCION','TIPO_DIRECCION','EMAIL');\r\n $cab = implode(\"\\t\", $array_cabecera);\r\n\r\n fwrite($file_download,$cab.\"\\n\");\r\n for($i=0;$i<count($arrayDATA);$i++){\r\n \r\n $data = $arrayDATA[$i]['FPROCESO'].\"\\t\".$arrayDATA[$i]['CODCENT'].\"\\t\".$arrayDATA[$i]['TIPO_DOCUMENTO'].\"\\t\".$arrayDATA[$i]['DOCUMENTO'].\r\n \"\\t\".$arrayDATA[$i]['CONTRATO'].\"\\t\".$arrayDATA[$i]['OBLIGACION'].\"\\t\".$arrayDATA[$i]['NOMBRE'].\"\\t\".$arrayDATA[$i]['TIPO_DEUDOR'].\"\\t\".\r\n $arrayDATA[$i]['PRODUCTO'].\"\\t\".$arrayDATA[$i]['SALDO_ACTUAL'].\"\\t\".$arrayDATA[$i]['MORA'].\"\\t\".$arrayDATA[$i]['FECHA_CORTE'].\"\\t\".$arrayDATA[$i]['PORTAFOLIO'].\"\\t\".$arrayDATA[$i]['ORIGINADOR'].\r\n \"\\t\".$arrayDATA[$i]['SUB_PRODUCTO'].\"\\t\".$arrayDATA[$i]['CAPITAL'].\"\\t\".$arrayDATA[$i]['INTERES_CORRIENTE'].\"\\t\".$arrayDATA[$i]['INTERES_MORA'].\"\\t\".$arrayDATA[$i]['OTROS'].\"\\t\".$arrayDATA[$i]['FECHA_INICIO_MORA'].\"\\t\".$arrayDATA[$i]['TELEFONO'].\"\\t\".$arrayDATA[$i]['EXTENSION'].\"\\t\".\r\n $arrayDATA[$i]['TIPO_TELEFONO'].\"\\t\".$arrayDATA[$i]['CIUDAD'].\"\\t\".$arrayDATA[$i]['DEPARTAMENTO'].\"\\t\".$arrayDATA[$i]['DIRECCION'].\"\\t\".$arrayDATA[$i]['TIPO_DIRECCION'].\"\\t\".$arrayDATA[$i]['EMAIL'];\r\n \r\n fwrite($file_download,$data.\"\\n\");\r\n }\r\n fclose($file_download);\r\n\r\n echo json_encode(array('rst' => true, 'msg' => 'Complete - Paso la prueba.', 'isfile'=>true ));\r\n exit();\r\n\r\n \r\n }\r\n\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n \r\n \r\n }", "public function processarArquivoRetorno() {\n\n /**\n * processa os dados do arquivo atraves do cadastro de layout; \n */\n $oLayoutReader = new DBLayoutReader($this->iCodigoLayout, $this->sCaminhoArquivo, false, false);\n $oLayoutReader->processarArquivo(0, false, true);\n $oDadosRetorno = new stdClass();\n $oDadosRetorno->header = new stdClass();\n $oDadosRetorno->registros = array();\n \n /**\n * processa cada linha do arquivo, conforme o tipo de linha.\n */\n foreach ($oLayoutReader->getLines() as $iInd => $oArquivo) {\n\n switch ($oArquivo->codigo_registro) {\n case '0':\n \n /**\n * Header de arquivo\n */\n $oDadosRetorno->header->febraban = $oArquivo->exclusivo_febraban; // e75_febraban\n $oDadosRetorno->header->uso_banco = $oArquivo->uso_banco; // e75_arquivoret\n $oDadosRetorno->header->codigo_banco = $oArquivo->codigo_banco; // e75_codfebraban\n $oDadosRetorno->header->seq_arquivo = $oArquivo->seq_arquivo; // e75_seqarq\n $oDadosRetorno->header->lote_servico = $oArquivo->lote_servico;\n \n break;\n \n case '1':\n \n /*\n * Codigo do lote\n */\n $sNumeroLote = $oArquivo->lote_servico;\n break;\n \n case '3' :\n\n /**\n * Registros de cada lote. é separado em dois segmentos.\n * Segmento A: Informações sobre o pagamento do registro no banco.\n */\n if ($oArquivo->codigo_segmento == \"A\") {\n \n $sValorEfetivado = substr($oArquivo->vlr_real_efetivado, 0, 13).\".\";\n $sValorEfetivado .= substr($oArquivo->vlr_real_efetivado,13,2);\n \n $sDataEfetivacao = substr($oArquivo->data_efetivacao, 4, 4);\n $sDataEfetivacao .= \"-\".substr($oArquivo->data_efetivacao, 2, 2);\n $sDataEfetivacao .= \"-\".substr($oArquivo->data_efetivacao, 0, 2);\n if ($sDataEfetivacao == '0000-00-00') {\n $sDataEfetivacao = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n }\n $oRegistro = new stdClass();\n $oRegistro->codigo_movimento = trim($oArquivo->documento_empresa);\n $oRegistro->numero_lote = trim($sNumeroLote);\n $oRegistro->mov_lote = trim($oArquivo->sequencial_reg_lote); \n $oRegistro->numero_banco = trim($oArquivo->num_documento_banco); \n $oRegistro->valor_efetivado = (float)$sValorEfetivado; \n $oRegistro->data_efetivacao = $sDataEfetivacao;\n \n /*\n * Informa qual o tipo de retorno do banco. \n * Para saber se o registro pode ser baixado no sistema.\n */\n $oRegistro->retorno_banco = trim($oArquivo->ocorrencias);\n $oRegistro->codigo_retorno = $this->getCodigoErro($oRegistro->retorno_banco);\n $oDadosRetorno->registros[] = $oRegistro;\n }\n break;\n }\n }\n $this->oDadosArquivo = $oDadosRetorno;\n return true;\n }", "private function agregarContenidoArchivo($filename, $contenido) {\n /* $password= \"ethereal\";\n $username=\"ethereal\"; */\n $url = \"http://ethgame.com:14000/webhdfs/v1/user/ethereal/funnels/queries/$filename.hql?op=APPEND&user.name=ethereal\";\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_NOBODY, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $contenido);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/octet-stream'));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n //curl_setopt($ch, CURLOPT_USERPWD, \"$username:$password\"); \n $output = curl_exec($ch);\n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n if ($httpcode == 200) {\n curl_close($ch);\n return true;\n } else {\n // responder con error\n curl_close($ch);\n return false;\n }\n }", "public function gerarArquivosHomologacao()\n {\n $this->repositorioBoletos->setLogoEmpresa('logo.png');\n $this->repositorioBoletos->setPagador([\n 'nome' => 'Cliente',\n 'endereco' => 'Rua um, 123',\n 'bairro' => 'Bairro',\n 'cep' => '99999-999',\n 'uf' => 'UF',\n 'cidade' => 'CIDADE',\n 'documento' => '999.999.999-99',\n ]);\n\n //Gerando os 10 boletos\n for ($sequencial = 1; $sequencial < 11; $sequencial++) {\n $this->repositorioBoletos->setDadosBoleto(\n [\n 'instrucoesCobranca' => [ 'Linha 1 - Instruções', 'Linha 2 - Instruções', 'Linha 3 - Instruções' ],\n 'descDemonstrativo' => [ 'Linha 1 - Descrição', 'Linha 2 - Descrição', 'Linha 3 - Descrição' ],\n 'dataVencimento' => (new \\Carbon\\Carbon())->addDays(rand(1,5)),\n 'valorBoleto' => rand(1, 5),\n 'sequencialNossoNumero' => $sequencial\n ]\n );\n $boleto = $this->repositorioBoletos->gerarBoleto();\n $boletos[] = $boleto;\n }\n\n $arquivos = $this->repositorioBoletos->gerarPDFs($boletos);\n $remessa = $this->repositorioBoletos->gerarRemessa($boletos);\n $remessa->save('arquivos' . DIRECTORY_SEPARATOR . 'remessa-homologacao.txt');\n $arquivos[] = 'remessa-homologacao.txt';\n\n //Criando arquivos.zip com os 10 titulos e o arquivo remessa\n $zipname = 'arquivos.zip';\n $zip = new ZipArchive;\n $zip->open($zipname, ZipArchive::CREATE);\n foreach ($arquivos as $nomeArquivo) {\n $zip->addFile('arquivos/'.$nomeArquivo);\n }\n $zip->close();\n\n header('Content-Type: application/zip');\n header('Content-disposition: attachment; filename='.$zipname);\n header('Content-Length: ' . filesize($zipname));\n readfile($zipname);\n }", "public function cogerXmlRespuesta()\n {\n $clave = $this->clave;\n\n //Guardar el archivo\n $storage_path = \"{$this->id}/20\" . \\substr($clave, 7, 2) . \\substr($clave, 5, 2) . '/';\n\n $filename = $this->tipo == 'E' ? 'MH' : 'MHMR';\n $filename .= $clave . '.xml';\n $zip_name = $this->tipo . $clave . '.zip';\n\n $filesystem = $this->container['filesystem'];\n $tmpfile = sys_get_temp_dir() . '/' . $zip_name;\n try {\n $contents = $filesystem->read($storage_path . $zip_name);\n file_put_contents($tmpfile, $contents);\n } catch (FilesystemException | UnableToReadFile $exception) {\n throw new \\Exception(\"No se pudo leer el archivo $zip_name\");\n }\n\n $zip = new \\ZipArchive();\n if ($zip->open($tmpfile) !== true) {\n throw new \\Exception(\"Fallo al abrir <$zip_name> abriendo MR\\n\");\n }\n\n if ($zip->locateName($filename) !== false) {\n //XML esta guardado\n $xml = $zip->getFromName($filename);\n } else {\n unlink($tmpfile);\n $zip->close();\n return false;\n }\n unlink($tmpfile);\n $zip->close();\n return $xml;\n }", "public function archivos($d=[]){\n \t\t \n \t\t$carpetas = explode('/', $d['ruta']);\n\t\t$key=md5(json_encode($datos));\n\t\t/* RUTINA PARA CREAR FICHEROS EN CASO DE NO EXISTIR */\n\t\tfor($i=0;$i< count($carpetas);$i++){\t\t\n\t\t\t$fichero = '';\n\t\t\tfor($u=0;$u<=$i ;$u++){\t\t\n\t\t\t\t$fichero .= $carpetas[$u];\n\t\t\t\tif($u>=0 && $u<$i ){$fichero .= '/';}\n\t\t\t}\n\t\t\tif (!file_exists(BASE_ARCHIVO.$fichero)) { // CREAR FICHERO\n\t\t\t\tif (mkdir(BASE_ARCHIVO.$fichero, 0755, true))\n\t\t\t\t\tchmod(BASE_ARCHIVO.$fichero, 0755);\n\t\t\t}\n\t\t}\t\n\t\t/* PERMISOS DE ARCHIVOS */\n\t\tif(count($datos['permisos'])>0){\n\t\t\t$perKey = array_keys($datos['permisos']);\n\t\t\tfor($i=0;$i<count($perKey) ;$i++){\n\t\t\t\t$_SESSION[$this->token_variable('archivos'.$key)][$this->token_variable($perKey[$i])]=$datos['permisos'][$perKey[$i]];\n\t\t\t}\n\t\t\tif(is_array($datos['bloquer_archivos']))\n\t\t\t\t$_SESSION[$this->token_variable('archivos'.$key)][$this->token_variable('bloquer_archivos')]=$datos['bloquer_archivos'];\n\t\t}\n\t\t$d['height']=($d['height']!='')?$d['height']:\"100%\";\n\t\t$out = '<iframe width=\"'.$d['width'].'\" height=\"'.$d['height'].'\" style=\"'.$d['style'].'\" frameborder=\"0\" allowtransparency=\"true\"\n src=\"'.RUTA_ACTUAL.'app/vendor/filemanager/dialog.php?type=2&editor=mce_0&lang=eng&key='.$key.'&fldr='.urlencode($fichero).'&jmy_url='.$datos['bread'].'\"></iframe>';\n return $out;\n \t}", "function cre_zip_CR()\n{\n\tglobal $identificationCIl, $crRecupere, $gen_arch;\n\tglobal $path_download;\n\tglobal $langue_browser, $edition_ctg;\n\tglobal $passwd,$login_user;//JNG \n\t\n\n\t\n\t\n\tif ($langue_browser == \"FR\")\n\t{\n\t\t\t$string1=\"Compte rendu du téléchargement\";\n\t\t\t$string2=\"Nombre de fichiers (ZIP) par chapitre : \";\n\t\t\t$string3=\"NR\";\n\t\t\t$string4=\"Fichier zip par chapitre\";\n\t\t\t$string5=\"Titre du chapitre \";\n\t\t\t$string6=\"Impossible de créer le fichier body\";\n\t\t\t$string7=\"Impossible de créer le fichier head\";\n\t}else{\n\t\t\t$string1=\"Report of the downloading\";\n\t\t\t$string2=\"Total number of (ZIP) files by chapter: \";\n\t\t\t$string3=\"FR NUMBER\";\n\t\t\t$string4=\"File zip by chapter\";\n\t\t\t$string5=\"Title of the chapter\";\n\t\t\t$string6=\"Can not create body file\";\n\t\t\t$string7=\"Can not create head file\";\n\t}\n\t\n\t//$ref_ctgp = $crRecupere->prefixDoc .$crRecupere->numberDoc.$crRecupere->variantDoc.$crRecupere->versionDoc.$crRecupere->typeDoc.$crRecupere->zzDoc.$crRecupere->lgueDoc.' .'.$crRecupere->editionDoctmp ;\n\t$ref_ctgp = $crRecupere->prefixDoc .$crRecupere->numberDoc.$crRecupere->variantDoc.$crRecupere->versionDoc.$crRecupere->typeDoc.$crRecupere->zzDoc.$crRecupere->lgueDoc.' .'.$edition_ctg ;\n\t$titre_doc_RC =\t$crRecupere->titleDoc;\n\t\n\n\n\t$res = $path_download.\"/res\";\n\t$nl =\" \\n\";\n\t$color = \"CCFFFF\";\n\t$ii = 0;\n\n\t$path_stp2 = $path_download;\n\t$nr = strlen ($path_stp2);\n\t$path_stp2 [$nr-1] = \"2\";\n\t$fic = \"CollectionFR.zip\";\n\tchdir($path_download);\n\t\n\t\n\t\t//JNG trace\n\t\t\t \t/* \n\t\t\t\t$string1000 = \" fonctionsStep2.cre_zip_CR ligne 3351 : debut cre_zip_CR<br>\";\n\t\t\t\t$string1001 = \"fichier zip = $fic <br>\";\n\t\t\t\terori ($string1000,$string1001);\n\t\t\t\t*/\t\n\t// fin trace\n\n //\n \t\t\t\t$file_zip_step2 = $path_stp2.\"/*.zip\";\t\t\n\t\t\t\tsystem(\"cp $file_zip_step2 $path_download\");\n\t\t\t\tsleep(1);\n\n\t\t\t\tsystem(\"rm -f $file_zip_step2 \");\n\t\t\t\tsleep(1);\n //\t\n\n\tif (!$file_title = fopen(\"$path_download/body\",\"w\")) {\n\t \tdie(\"$string6\");\n\t}else{\n\t$needle=\".zip\";\n\t//JNG \n\tif ($handle = opendir('.')) {\n\t$needle=\".zip\";\n\t$i=0;\n while (false !== ($file = readdir($handle))) {\n\n if ($file != \".\" && $file != \"..\" ) {\n\t\t\t$type = strstr($file, \".zip\");\n\t\t\tif ($type == $needle) {\n\t\t\t\tlist($file_name,$type) = explode(\".\",$file);\n\t\t\t\tlist($name,$num_chp) = explode(\"_\",$file_name);\n\t\t\t\tif ($num_chp==1){\n\t\t\t\t\t$num_chp=-1;\n\t\t\t\t}else{\n\t\t\t\t\t$num_chp=$num_chp-2;\n\t\t\t\t}\n\t\t\t\t$chapCourant = &$crRecupere->chapitres[$num_chp];\n\t\t\t\t$nom_chapitre=$chapCourant->nom;\n\n\t\t\t\t$i++;\n\t\t\t\t//ecrire le fichier zip du chapitre\n\t\t\t\tfwrite($file_title,\"<TR BGCOLOR=\\\"$color\\\" ><TD><CENTER>$file</CENTER></TD><TD><CENTER>$nom_chapitre</CENTER></TD></TR>\\n\");\n\t\t\t\t\n\t\t\t}\n }\n }\n closedir($handle);\n\t}\n\t//\n\t\n\n\tfwrite($file_title,\"</TBODY>\\n\");\n\tfwrite($file_title,\"</TABLE></CENTER>\\n\");\n\tfclose ($file_title);\n\t\n\tif (!$file_head = fopen(\"$path_download/head\",\"w\")) \n\t \tdie(\"$string7\");\n\telse \n\t{\t\n\t\tfwrite($file_head, \"<CENTER><FONT COLOR=\\\"FF0000\\\" SIZE=\\\"6\\\"><B>$string1</B><BR></FONT></CENTER><BR>\\n\");\n\t\tfwrite($file_head, \"<CENTER><FONT COLOR=\\\"FF0000\\\" SIZE=\\\"4\\\"><B>$titre_doc_RC</B><BR></FONT></CENTER><BR>\\n\");\n\t\tfwrite($file_head, \"<CENTER><FONT COLOR=\\\"FF0000\\\" SIZE=\\\"4\\\"><B>$ref_ctgp</B><BR><BR></FONT></CENTER><HR><BR>\\n\");\n\n\t\tfwrite($file_head, \"<FONT COLOR=\\\"000FFF\\\" SIZE=\\\"5\\\"> <CENTER>\t<B>$string2 $i</B></CENTER><BR><BR></FONT></CENTER><BR>\\n\");\n\t\tfwrite($file_head, \"<CENTER><TABLE BORDER = 1 BORDERCOLOR = 000FFF FONT COLOR=\\\"#000FF\\\">\\n\");\n\t\tfwrite($file_head, \"<THEAD><B><TR BGCOLOR=\\\"FFF000\\\" ><TD><CENTER>$string4</CENTER></TD><TD><CENTER>$string5</CENTER></TD></TR></B></THEAD>\\n\");\n\t\tfwrite($file_head, \"<TBODY>\\n\");\n\t\tfwrite($file_head, \"\\n\");\n\t\tfclose ($file_head);\n\t} // fin d'écriture dans le fichier head \n\t\n\t$chDirOk = chdir($path_download);\n \tif (!$chDirOk) {\n \t\t\tdie(\"pb chdir script step3!!\");\n \t}else{\n\t\tif ($i > 0){\t\n\t\t\t\t//echo \" Creation du fichier zip global : $fic <br>\";\n\t\t\t\tsystem(\"cat head body > readme.html\");\n\t\t\t\tsystem(\"zip $fic *zip* readme.html > $res\");\n\t\t\t\tsystem(\"cp $fic $path_stp2\");\n\t\t\t\t$erase = $path_download.\"/*\"; \t\t\t\t\n\t\t\t\t//nettoyer le rep step3 mettre en commentaire provisoirement\t\t\t\n\t\t\t\tsystem(\"rm -f $erase \");\n\t\t\t\t\n\t\t\t\t\n\t\t//}else{\n\t//\t\t\t$gen_arch = \"off\";\n\t\t}\t\n\t}\n\t}// fin d'écriture dans body\n\t\n}", "public function verificarArquivosBannerAction() {\r\n // Instanciando a sessão\r\n $sessao = new Container();\r\n $diretorioRoot = $this->Mkdir()->pegarDiretorioRoot($this->getRequest()->getServer('DOCUMENT_ROOT', false));\r\n $path = $diretorioRoot . \"storage/banners/\" . $sessao->idClienteBannerSession . \"/\";\r\n $diretorio = dir($path);\r\n $i = 1;\r\n $array = array();\r\n $array['tipoMsg'] = \"\";\r\n while ($arquivo = $diretorio->read()) {\r\n if ($arquivo != \".\" && $arquivo != \"..\") {\r\n $array['tipoMsg'] = \"S\";\r\n $array[$i]['dsArquivo'] = $arquivo;\r\n $i++;\r\n }\r\n }\r\n $diretorio->close();\r\n\r\n $result = new JsonModel($array);\r\n return $result;\r\n }", "public function abrirDocumentosPreProjetoAction()\n {\n $get = Zend_Registry::get('get');\n $id = (int)isset($get->id) ? $get->id : $this->_request->getParam('id');\n\n # Configuracao o php.ini para 10MB\n @ini_set(\"mssql.textsize\", 10485760);\n @ini_set(\"mssql.textlimit\", 10485760);\n @ini_set(\"upload_max_filesize\", \"10M\");\n\n # busca o arquivo\n $tbl = new Proposta_Model_DbTable_TbDocumentosPreProjeto();\n $resultado = $tbl->abrir($id)->current();\n\n # erro ao abrir o arquivo\n $this->_helper->layout->disableLayout(); # Desabilita o Zend Layout\n $this->_helper->viewRenderer->setNoRender(); # Desabilita o Zend Render\n if (!$resultado) {\n die(\"N&atilde;o existe o arquivo especificado\");\n $this->view->message = 'N&atilde;o foi poss&iacute;vel abrir o arquivo!';\n $this->view->message_type = 'ERROR';\n } else {\n Zend_Layout::getMvcInstance()->disableLayout(); # Desabilita o Zend MVC\n $this->_response->clearBody(); # Limpa o corpo html\n $this->_response->clearHeaders(); # Limpa os headers do Zend\n $up = new Upload();\n $tipoArquivo = method_exists($up, $up->getMimeType($resultado->noarquivo)) ? $up->getMimeType(\"jpg\") : \"application/pdf\";\n if ($tbl->getAdapter() instanceof Zend_Db_Adapter_Pdo_Mssql) {\n $this->getResponse()\n ->setHeader('Content-Type', $tipoArquivo)\n ->setHeader('Content-Disposition', 'attachment; filename=\"' . $resultado->noarquivo . '\"')\n ->setBody($resultado->imdocumento);\n } else {\n $this->getResponse()\n ->setHeader('Content-Type', $tipoArquivo)\n ->setHeader('Content-Disposition', 'attachment; filename=\"' . $resultado->noarquivo . '\"');\n readfile(APPLICATION_PATH . '/..' . $resultado->imdocumento);\n }\n }\n }", "public function ComprobarZip(){\r\n global $contract,$monthsComplete;\r\n if(empty($this->filesToUp))\r\n {\r\n $this->Util()->setError(0,\"error\",\"Error en el archivo\");\r\n return false;\r\n }\r\n $name = explode('_',$this->nameDestiny);\r\n $contract->setContractId($this->contractId);\r\n $contrato = $contract->Info();\r\n if(empty($contrato)){\r\n $this->Util()->setError(0,\"error\",\"Cliente no encontrado, comprobar con el administrador de sistema.\");\r\n return false;\r\n }\r\n\r\n $isValid = true;\r\n foreach($this->filesToUp as $file){\r\n $idTasks = [];\r\n $fileExplode = explode(\"/\",$file);\r\n $year = $fileExplode[0];\r\n if(!is_numeric($year))\r\n {\r\n $this->Util()->setError(0,\"error\",\"Nombre de carpeta principal no valida:\".$year);\r\n $isValid = false;\r\n break;\r\n }\r\n $mesExplode = explode(\" \",$fileExplode[2]);\r\n if(count($mesExplode)>1)\r\n $mesString = $mesExplode[1];\r\n else\r\n $mesString = $mesExplode[0];\r\n $mes = array_search(ucfirst(strtolower($mesString)),$monthsComplete);\r\n if((int)$mes<1||(int)$mes>12){\r\n $this->Util()->setError(0,\"error\",\"Nombre del mes no valido, en la siguiente ruta : \".$file);\r\n $isValid = false;\r\n break;\r\n }\r\n $this->Util()->DB()->setQuery(\"select tipoServicioId from tipoServicio where upper(trim(nombreServicio))='\".strtoupper(trim($fileExplode[1])).\"' and status='1' \");\r\n $tipoServicioId = $this->Util()->DB()->GetSingle();\r\n if(!$tipoServicioId)\r\n {\r\n $this->Util()->setError(0,\"error\",\"Nombre de servicio no valido, en la siguiente ruta : \".$file);\r\n $isValid = false;\r\n break;\r\n }\r\n\r\n $this->Util()->DB()->setQuery(\"select stepId from step where upper(trim(nombreStep))='\".strtoupper(trim($fileExplode[3])).\"' and servicioId='\".$tipoServicioId.\"' \");\r\n //echo $this->Util()->DB()->getQuery().chr(13);\r\n $stepId = $this->Util()->DB()->GetSingle();\r\n\r\n if(!$stepId)\r\n {\r\n $this->Util()->setError(0,\"error\",\"Nombre de paso no valido, en la siguiente ruta : \".$file);\r\n $isValid = false;\r\n break;\r\n }\r\n //archivos alojados en carpetas que no tengan prefijos numericos, se ignoran en la validacion.\r\n $numOrderTask =(int)explode('-',$fileExplode[4])[0];\r\n //obtener id tareas en 1 dimension\r\n $this->Util()->DB()->setQuery(\"select taskId from task where stepId='\".$stepId.\"' order by taskPosition asc\");\r\n //echo $this->Util()->DB()->getQuery().chr(13);\r\n $idTasks = $this->Util()->DB()->GetResult();\r\n $idTasks = $this->Util()->ConvertToLineal($idTasks,'taskId');\r\n //dd($idTasks);\r\n //en la comprobacion si no tiene paso no es error, se va ignorar al mover el archivo\r\n if(empty($idTasks)){\r\n continue;\r\n }\r\n if($idTasks[$numOrderTask-1]<=0){\r\n continue;\r\n }\r\n $extension = end(explode('.',$fileExplode[4]));\r\n $this->Util()->DB()->setQuery(\"select * from task where taskId='\".$idTasks[$numOrderTask-1].\"' \");\r\n //echo $this->Util()->DB()->getQuery().chr(13);\r\n $rowTask= $this->Util()->DB()->GetRow();\r\n //dd($rowTask);\r\n //comprobar extension, si esta vacio se acepta cualquier archivo\r\n if($rowTask['extensiones']!=''){\r\n $extExplode = explode(',',str_replace(\".\",\"\",strtolower($rowTask['extensiones'])));\r\n if(!in_array(strtolower($extension),$extExplode)){\r\n $this->Util()->setError(0,\"error\",\"Tipo de archivo no permitido en : \".$file.\", revisar archivos permitidos para la tarea \".$rowTask['nombreTask']);\r\n $isValid = false;\r\n break;\r\n }\r\n }\r\n\r\n\r\n }\r\n $this->Util()->PrintErrors();\r\n return $isValid;\r\n }", "public function adicionarAnexos()\n {\n $idProcesso = request('id_processo');\n $titulo = request('titulo');\n $arquivo = request()->file('anexo');\n\n $processo = Processo::find($idProcesso);\n $arquivo = $this->arquivoUploader->upload($arquivo, 'anexos');\n if ($arquivo) {\n $anexo = $processo->anexos()->create(\n [\n 'titulo' => $titulo\n ]\n );\n $anexo->update(['anexo' => $arquivo]);\n } else {\n return response()->json(false);\n }\n\n $anexos = $processo->anexos;\n $view = view('processos.abas._anexos_itens', compact('anexos'))->render();\n\n return response()->json(['view' => $view]);\n }", "public function scanAction()\n {\n $module = FilesModule::get($this->params['id']);\n $path = $module->getPath();\n if (!String::endsWith($path, '/'))\n {\n $path .= '/';\n }\n \n header('Content-type: application/json');\n \n if (!file_exists($path))\n {\n // TODO: no existe path\n return $this->renderString('{\"status\":\"error\", \"msg\":\"La ruta '.$path.' no existe\"}');\n }\n if (!is_readable($path))\n {\n // TODO: no se puede leer path\n return $this->renderString('{\"status\":\"error\", \"msg\":\"No se tienen permisos de lectura para la ruta '.$path.'\"}');\n }\n \n // Quiero actualizar solo los archivos que no esten registrados.\n $currentFiles = $module->getFiles();\n \n // TODO: falta implementar el except con la regex\n $names = FileSystem::getFileNames($path, $module->getFilter());\n \n // Solo los archivos que no estan ya en el modulo\n foreach ($currentFiles as $cf)\n {\n //echo array_search($cf->getFullName(), $names) . '<br/>';\n if ( ($i = array_search($cf->getFullName(), $names)) !== false)\n {\n $names[$i] = NULL;\n }\n }\n\n // Saca nulls del array de nombres de archivos\n $new_files = array_filter($names);\n //print_r($new_files);\n \n foreach ($new_files as $name)\n {\n // Filtrar archivos que empieza con ., por ejemplo .htaccess\n // Si el archivo no esta en los archivos actuales del modulo\n // Crear su FileInfo, asociarlo al modulo y guardarlo\n \n // Saco nombre y extension (si la tiene)\n $dot = strrpos($name, '.');\n if ($dot == 0) continue; // El nombre del archivo empieza con . (ej. .htaccess)\n if (!$dot)\n {\n $fnm = $name;\n $ext = '';\n }\n else\n {\n $fnm = substr($name, 0, $dot);\n $ext = substr($name, $dot+1);\n }\n //echo $fnm .'_'. $ext .'<br/>';\n \n \n // La descripcion se la pone el usuario despues\n $file = new FileInfo(array(\n 'fullName'=>$name,\n 'name'=>$fnm,\n 'extension'=>$ext,\n 'size'=>filesize($path.$name),\n 'module'=>$module\n ));\n \n if (!$file->save())\n {\n // TODO: mostrar error que ocurrio\n print_r($file->getErrors());\n return $this->renderString('{\"status\":\"error\", \"msg\":\"Ha ocurrido un problema al actualizar los archivos\"}');\n }\n }\n \n // Actualizar el lastScan del modulo\n \n // Devolver la informacion de los archivos del modulo\n // en json para que se actualice la vista con JS.\n return $this->renderString('{\"status\":\"ok\", \"msg\":\"Referencias a archivos actualizadas con éxito\", \"id\":'.$this->params['id'].', \"pageId\":'.$this->params['pageId'].', \"zone\":\"'.$this->params['zone'].'\"}');\n }", "protected function generar_archivo()\n\t{\n\t\t$formato = $this->_mapa->outputformat;\n\t\t$nombre_archivo = mt_rand() . '.' . $formato->getOption('name');\n\t\t$dir_temp = toba::instalacion()->get_path_temp();\n\t\t$salida = toba_manejador_archivos::path_a_unix( $dir_temp . \"/\" . $nombre_archivo );\n\n\t\t//Aca le digo cuales son los layers activos\n\t\t$this->mapa_setear_estado_layers();\n\n\t\t//Aca le digo cual es el extent activo\n\t\t$this->mapa_setear_extent_activo();\n\n\t\t//Dibujo el mapa y envio la salida a archivo.\n\t\t$this->generar_salida($salida);\n\n\t\treturn $nombre_archivo;\n\t}", "function exportFiles(&$browse){\n ini_set('max_execution_time', 600);\n $dirname = uniqid('exportfiles').'/';\n $dir=TZR_TMP_DIR.$dirname;\n $ret=mkdir($dir);\n if(!$ret){\n XDir::unlink($dir);\n return array('error'=>true,'message'=>'Can\\'t create export dir');\n }\n $fields=array();\n foreach($browse['header_fields'] as $j=>$f) {\n if(in_array($f->ftype,array('XImageDef','XFileDef','XFolderDef'))){\n\t$fields[$f->field]=$f->ftype;\n\t$ret=mkdir($dir.$f->field.'/');\n\tif(!$ret){\n\t XDir::unlink($dir);\n\t return array('error'=>true,'message'=>'Can\\'t create export dir');\n\t}\n }\n }\n foreach($browse['lines_oid'] as $i=>$oid) {\n foreach($fields as $field_name => $field_type) {\n $ofile = $browse['lines_o'.$field_name][$i];\n\tif($field_type=='XImageDef' || $field_type=='XFileDef'){\n\t if(empty($ofile->filename)) continue;\n// a voir, nom du fichier dans le zip\n// \t $ext=substr($ofile->originalname,strrpos($ofile->originalname,'.'));\n// \t $fn=basename($ofile->filename).$ext;\n $fn = $ofile->originalname;\n if ($ofile->filedef->gzipped == 1) {\n $fh = gzopen($ofile->filename, 'r');\n $content = gzread($fh, 100000000);\n gzclose($fh);\n $ret = file_put_contents($dir.$field_name.'/'.$fn, $content);\n } else\n $ret=copy($ofile->filename,$dir.$field_name.'/'.$fn);\n\t if(!$ret){\n\t XDir::unlink($dir);\n\t return array('error'=>true,'message'=>'Can\\'t copy '.$ofile->filename);\n\t }\n\t}elseif($field_type=='XFolderDef'){\n\t if(empty($ofile->catalog[0])) continue;\n\t $_ofile=$ofile->catalog[0];\n\t $dir2=basename(dirname($_ofile->filename)).'/';\n\t $ret=mkdir($dir.$dir2);\n\t if(!$ret){\n\t XDir::unlink($dir);\n\t return array('error'=>true,'message'=>'Can\\'t copy '.$ofile->filename);\n\t }\n\n\n\t foreach($ofile->catalog as $k => $ofile_inside){\n// a voir, nom du fichier dans le zip\n// \t $ext=substr($ofile_inside->originalname,strrpos($ofile_inside->originalname,'.'));\n// \t $fn=basename($ofile_inside->filename).$ext;\n $fn = $ofile_inside->originalname;\n if ($ofile_inside->filedef->gzipped == 1) {\n $fh = gzopen($ofile_inside->filename, 'r');\n $content = gzread($fh, 100000000);\n gzclose($fh);\n $ret = file_put_contents($dir.$dir2.$fn, $content);\n } else{\n\t\tif (file_exists($ofile_inside->filename))\n \t $ret=copy($ofile_inside->filename,$dir.$dir2.$fn);\n\t }\n\t if(!$ret){\n\t XDir::unlink($dir);\n\t return array('error'=>true,'message'=>'Can\\'t copy '.$ofile_inside->filename);\n\t }\n\t }\n\t}\n }\n }\n return array('dir'=>$dirname,'error'=>false);\n }", "public function enviarrespostasAction() {\n $params = $this->_request->getParams();\n \n $storage = new Zend_Auth_Storage_Session();\n $data = $storage->read();\n $dados = get_object_vars($data);\n \n $params['ID_USUARIO_USC'] = $dados['ID_ID_USU'];\n \n $slide = new Models_Slides();\n $slide->saveRespostas($params);\n \n $this->_calcularNuevosResultados($params);\n \n $this->getResponse()\n ->setHeader('Content-Type', 'application/json');\n \n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(TRUE);\n \n $this->_helper->json($params);\n }", "public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the serializerepresentation of the Structured Field as a textual HTTP field value.
public function toHttpValue(): string;
[ "public function getStringField()\n {\n $value = $this->get(self::STRING_FIELD);\n return $value === null ? (string)$value : $value;\n }", "public function getFieldValue(): string {\n\t\t\treturn $this->value;\n\t\t}", "public function serialize()\n {\n return $this->getInternalValue();\n }", "function format_value_for_api( $value, $field = null ) {\n return $value;\n }", "public function getStringField()\n {\n return $this->string_field;\n }", "public function json()\n {\n $field = $this;\n\n return $this->unescape()->as(function ($value) use ($field) {\n $content = is_string($value) ? json_decode($value, true) : $value;\n\n $field->wrap(false);\n\n return Dump::make($content);\n });\n }", "public function getStringField() {\n // explicit type cast just to be sure\n return (string) $this->stringField;\n }", "protected function getValueAsString() {\r\n\t\treturn (string)$this->Value;\r\n\t}", "public function getStringFieldUnwrapped()\n {\n $wrapper = $this->getStringField();\n return is_null($wrapper) ? null : $wrapper->getValue();\n }", "public function getFormattedValue(): string\n {\n return $this->formatValue($this->attributes->value);\n }", "public function getJsonString()\n {\n return $this->readOneof(3);\n }", "public function getValue()\n {\n return $this->_string;\n }", "public function serializeField($model, $field, $value) {\n return json_encode($value);\n }", "public function formatAsString()\n {\n return $this->value->format(self::FORMAT);\n }", "public function getRawField(): string\n {\n return $this->getConfig('raw');\n }", "public function getFieldsAsJSON() : string {\n return json_encode($this->fields);\n }", "public function getValueEncoded($field) {\n return htmlspecialchars($this->getValue($field));\n}", "function raw() {\n\t\treturn $this->value;\n\t}", "public function getViewValue() {\n\t\t$class = $this->owner;\n\n\t\t// Get country object\n\t\tif ($class instanceof EditableFieldCountryDropdown) {\n\t\t\treturn $this->countryFieldValue();\n\t\t}\n\n\t\t// Get date object\n\t\tif ($class instanceof EditableFieldDate) {\n\t\t\treturn $this->dateFieldValue();\n\t\t}\n\n\t\t// Get memeber object\n\t\tif ($class instanceof EditableFieldMemberList) {\n\t\t\treturn $this->memberListField();\n\t\t}\n\n\t\t// Get ArrayList object with one field \"name\"\n\t\tif ($class instanceof EditableFieldCheckboxGroup) {\n\t\t\treturn $this->nameListField();\n\t\t}\n\n\t\t// Get page type object\n\t\tif ($class instanceof EditableFieldPageTypeList) {\n\t\t\treturn $this->pageTypeField();\n\t\t}\n\n\t\t// Header field only used in page type\n\t\tif ($class instanceof EditableFieldHeading) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Default return string\n\t\treturn (string)$this->owner->Value;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a default map of the fields for the accessal of ajax data. This allowes the form to be populated with data from this instance.
public static function getFormFieldMap() { return array( 'user_name' => 'name', 'user_email' => 'email', 'user_password_1' => 'password', 'user_password_2' => 'password', ); }
[ "public static function getFormFieldMap() {\n return array(\n 'email' => 'email',\n 'location' => 'location',\n 'phone' => 'phone',\n );\n }", "public function get_form_defaults() {\r\n\t\treturn array(\r\n\t\t\t'id' => 0,\r\n\t\t\t'list_id' => '',\r\n\t\t\t'form_name' => '',\r\n\t\t\t'form_description' => '',\r\n\t\t\t'fields' => array(),\r\n\t\t\t'custom_styles' => '',\r\n\t\t\t'custom_template' => '',\r\n\t\t\t'redirect_user_on_submit' => 0,\r\n\t\t\t'redirect_page' => '',\r\n\t\t\t'submission_settings' => array(\r\n\t\t\t\t'ajax' => 1,\r\n\t\t\t\t'redirect_on_submission' => 0,\r\n\t\t\t\t'redirect_page' => 1,\r\n\t\t\t\t'hide_form_post_signup' => 0,\r\n\t\t\t),\r\n\t\t\t'optin_settings' => array(\r\n\t\t\t\t'optin' => 1,\r\n\t\t\t\t'update_existing_user' => 1,\r\n\t\t\t\t'send_update_email' => 1,\r\n\t\t\t),\r\n\t\t\t'form_settings' => array(\r\n\t\t\t\t'yikes-easy-mc-form-class-names' => '',\r\n\t\t\t\t'yikes-easy-mc-inline-form' => 0,\r\n\t\t\t\t'yikes-easy-mc-submit-button-type' => 'text',\r\n\t\t\t\t'yikes-easy-mc-submit-button-text' => __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ),\r\n\t\t\t\t'yikes-easy-mc-submit-button-image' => '',\r\n\t\t\t\t'yikes-easy-mc-submit-button-classes' => '',\r\n\t\t\t\t'yikes-easy-mc-form-schedule' => 0,\r\n\t\t\t\t'yikes-easy-mc-form-restriction-start' => 0,\r\n\t\t\t\t'yikes-easy-mc-form-restriction-end' => 0,\r\n\t\t\t\t'yikes-easy-mc-form-restriction-pending-message' => sprintf( __( 'Signup is not yet open, and will be available on %s. Please come back then to signup.', 'yikes-inc-easy-mailchimp-extender' ), current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . current_time( 'g:iA' ) ),\r\n\t\t\t\t'yikes-easy-mc-form-restriction-expired-message' => sprintf( __( 'This signup for this form ended on %s.', 'yikes-inc-easy-mailchimp-extender' ), date( str_replace( '-', '/', get_option( 'date_format' ) ), strtotime( current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) ) + ( 3600 * 24 ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . date( 'g:iA', strtotime( current_time( 'g:iA' ) ) + ( 3600 * 24 ) ) ),\r\n\t\t\t\t'yikes-easy-mc-form-login-required' => 0,\r\n\t\t\t\t'yikes-easy-mc-form-restriction-login-message' => __( 'You need to be logged in to sign up for this mailing list.', 'yikes-inc-easy-mailchimp-extender' ),\r\n\t\t\t),\r\n\t\t\t'error_messages'\t\t\t=> array(\r\n\t\t\t\t'success'\t\t\t\t=> '',\r\n\t\t\t\t'success-single-optin'\t=> '',\r\n\t\t\t\t'success-resubscribed'\t=> '',\r\n\t\t\t\t'general-error'\t\t\t=> '',\r\n\t\t\t\t'already-subscribed'\t=> '',\r\n\t\t\t\t'update-link'\t\t\t=> '',\r\n\t\t\t\t'email-subject'\t\t\t=> '',\r\n\t\t\t),\r\n\t\t\t'custom_notifications' => '',\r\n\t\t\t'impressions' => 0,\r\n\t\t\t'submissions' => 0,\r\n\t\t\t'custom_fields' => array(),\r\n\t\t);\r\n\t}", "public static function get_default_data() {\n $data = new \\stdClass;\n $data->name = get_string('dataformnew', 'dataform');\n $data->intro = null;\n $data->inlineview = 0;\n $data->embedded = 0;\n $data->timemodified = time();\n $data->timeavailable = 0;\n $data->timedue = 0;\n $data->timeinterval = 0;\n $data->intervalcount = 1;\n $data->grade = 0;\n $data->gradeitems = null;\n $data->entrytypes = null;\n $data->maxentries = -1;\n $data->entriesrequired = 0;\n $data->grouped = 0;\n $data->anonymous = 0;\n $data->individualized = 0;\n $data->timelimit = -1;\n $data->css = null;\n $data->cssincludes = null;\n $data->js = null;\n $data->jsincludes = null;\n $data->defaultview = 0;\n $data->defaultfilter = 0;\n $data->completionentries = 0;\n $data->completionspecificgrade = 0;\n\n return $data;\n }", "public function get_form_defaults();", "public function getFieldDefaults()\n {\n $defaults = array();\n $defaults['field'] = false; // Field name\n $defaults['label'] = false; // Field label\n $defaults['description'] = false; // Field description\n // Display options\n $defaults['show_in_form'] = true; // Display in form?\n $defaults['show_in_grid'] = true; // Display in grid?\n // Foreign key\n $defaults['foreign_key_relationship_type'] = 0; // FormBuilder::FOREIGN_KEY_ONE_TO_MANY;\n $defaults['foreign_key_table'] = false;\n $defaults['foreign_key_field'] = 'id';\n $defaults['foreign_key_label_field'] = 'id';\n $defaults['foreign_key_accept_null'] = false;\n $defaults['foreign_key_where_conditions'] = false; // TODO This is only implemented in FormBuilder, needs to be implemented in filters as well\n\n $defaults['foreign_key_junction_table'] = false;\n $defaults['foreign_key_junction_id_field_left'] = false;\n $defaults['foreign_key_junction_id_field_right'] = false;\n $defaults['foreign_key_junction_where_conditions'] = false;\n\n //\n // Input specific\n //\n $defaults['input_type'] = 0; //FormBuilder::TEXTFIELD;\t// Input type, see FormBuilder constants\n $defaults['input_default_value'] = false; // Default value for field\n $defaults['values'] = false; // Values for to select among them, must be an associative array\n $defaults['validation_rules'] = 'required'; // Validation rules\n $defaults['input_is_editable'] = true;\n $defaults['input_group'] = false;\n $defaults['input_css_class'] = false;\n $defaults['options'] = array();\n\n // File upload\n $defaults['upload_complete_callback'] = false;\n $defaults['upload_path'] = ''; //$this->default_uploads_path;\n $defaults['upload_display_path'] = ''; //$this->default_upload_display_path;\n $defaults['upload_allowed_types'] = '*';\n $defaults['upload_encrypt_name'] = false;\n\n //\n // Grid specific\n //\n $defaults['grid_formating_callback'] = false;\n $defaults['grid_is_orderable'] = true;\n $defaults['grid_css_class'] = false;\n $defaults['filter_type'] = false;\n $defaults['filter_values'] = false; // It is not always the same for values\n $defaults['filter_condition'] = 'like';\n\n //\n // Excel cell format column\n //\n $defaults['excel_cell_format'] = false;\n $defaults['excel_header_format'] = false;\n\n // Autocomplete\n $defaults['autocomplete_source'] = '';\n\n return $defaults;\n }", "public function getDataAttributes()\n {\n $attributes = parent::getDataAttributes();\n \n if ($this->isAjaxEnabled()) {\n \n foreach ($this->getFieldAjaxConfig() as $key => $value) {\n $attributes[sprintf('data-ajax--%s', $key)] = $this->getDataValue($value);\n }\n \n }\n \n return $attributes;\n }", "protected function getBaseContolsMapParams()\r\n\t{\r\n\t\t$ctrlsMap = array();\r\n\t\t$ctrlsMap['fieldName'] = $this->fName;\r\n\t\t$ctrlsMap['gfieldName'] = $this->gfName;\r\n\t\t$ctrlsMap['filterFormat'] = $this->filterFormat;\r\n\t\t$ctrlsMap['multiSelect'] = $this->multiSelect;\r\n\t\t$ctrlsMap['filtered'] = $this->filtered;\r\n\t\t$ctrlsMap['separator'] = $this->separator;\r\n\t\t\r\n\t\tif( $this->filtered )\r\n\t\t\t$ctrlsMap['defaultValuesArray'] = $this->filteredFields[ $this->fName ][\"values\"];\r\n\t\t\t\r\n\t\treturn $ctrlsMap;\t\r\n\t}", "private static function getFieldMap()\n {\n return array(\n 'user_id' => 'UserID',\n 'contact_id' => 'ContactID',\n 'first_name' => 'FirstName',\n 'last_name' => 'LastName',\n 'location_id' => 'LocationID',\n 'commitment' => 'Commitment',\n 'is_new' => 'IsNew',\n 'source' => 'Source',\n 'interest' => 'Interest',\n 'engage' => 'Engage',\n 'current_status_id' => 'CurrentStatusID',\n 'source_id' => 'ExternalSourceIdentifier',\n 'notes' => 'Notes',\n 'has_photo' => 'Photo',\n );\n }", "public function defaultFormAttr(){\n\t\treturn array ( \n\t\t'method' => 'post', \n\t\t'autocomplete' => 'on',\n\t\t'target' => '_blank',\n\t\t'enctype' => 'multipart/form-data',\n\t\t);\n\t}", "public function getFields(){\n $ret_map = array();\n\n foreach($this as $name => $field){\n \n // canary, skip submit buttons...\n if($field instanceof Submit){ continue; }//if\n \n $ret_map[$name] = $field;\n\n }//foreach\n\n return $ret_map;\n\n }", "public function widget_default_values() {\n\t\treturn array(\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'username',\n\t\t\t\t\t'label' => esc_html__( 'User Name', 'themeisle-companion' ),\n\t\t\t\t\t'placeholder' => esc_html__( 'User Name', 'themeisle-companion' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'required' => 'required',\n\t\t\t\t\t'field_map' => 'user_login',\n\t\t\t\t\t'field_width' => '100',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'email',\n\t\t\t\t\t'label' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t\t'placeholder' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t\t'type' => 'email',\n\t\t\t\t\t'required' => 'required',\n\t\t\t\t\t'field_map' => 'user_email',\n\t\t\t\t\t'field_width' => '100',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'password',\n\t\t\t\t\t'label' => esc_html__( 'Password', 'themeisle-companion' ),\n\t\t\t\t\t'placeholder' => esc_html__( 'Password', 'themeisle-companion' ),\n\t\t\t\t\t'type' => 'password',\n\t\t\t\t\t'required' => 'required',\n\t\t\t\t\t'field_map' => 'user_pass',\n\t\t\t\t\t'field_width' => '100',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'submit_label' => esc_html__( 'Register', 'themeisle-companion' ),\n\t\t);\n\t}", "public function getDefaultDataFieldsMapping()\r\n {\r\n return [\r\n self::FIELD_KEY_ENTITY_ID => self::SPECIFIC_FIELD_KEY_UNIQUE_ID,\r\n self::FIELD_KEY_PRODUCT_NAME => self::SPECIFIC_FIELD_KEY_TITLE,\r\n self::FIELD_KEY_IMAGE_PATH => self::SPECIFIC_FIELD_KEY_IMAGE_URL,\r\n self::FIELD_KEY_PRODUCT_URL_KEY => self::SPECIFIC_FIELD_KEY_PRODUCT_URL,\r\n self::FIELD_KEY_STOCK_STATUS => self::SPECIFIC_FIELD_KEY_AVAILABILITY,\r\n self::FIELD_KEY_CATEGORY_DATA => self::SPECIFIC_FIELD_KEY_CATEGORY_PATH_ID,\r\n self::FIELD_KEY_VISIBILITY => self::FIELD_KEY_VISIBILITY // use for retrieve label instead of ID\r\n ];\r\n }", "protected function get_initial_form_values()\n {\n // Create a new empty object, which will story each of the form's defaults.\n $data = new stdClass();\n\n // And specify the base defaults: every field is empty, and the user's message format is the same as their preferred mail format.\n $data->id = null;\n $data->subject = '';\n $data->message = '';\n $data->mailto = '';\n $data->format = $this->user->mailformat;\n\n // Create copies of the following two fields in the format that Moodle expects.\n $data->messagetext = $data->message;\n $data->messageformat = $data->format;\n\n // Return the newly created defaults.\n return $data;\n }", "abstract protected function get_default_fields();", "public function getFields(){ return $this->field_map; }", "private function _default_fields()\n\t{\n\t\tif (@$this->entry) $this->form->hidden('entry_id', $this->entry->id);\n\t\t\n\t\t\n\t\t$this->form->hidden('status', (@$this->entry) ? $this->entry->status : 'draft')\n\t\t ->hidden('parent_id', (@$this->entry) ? $this->entry->parent_id : null)\n\t\t ->hidden('user_id', user_id())\n\t\t ->hidden('in_categories', $this->_in_category_ids(Backend::$data->in_categories))\n\t\t ->hidden('active_field_group', null)\n\t\t ->hidden('published_at', (@$this->entry) ? date('Y/m/d H:i', $this->entry->published_at) : null)\n\t\t ->hidden('channel', $this->channel->slug)\n\t\t; // end form\n\n\t\t\n\t}", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'make' => array(\n 'type' => 'string',\n 'required' => true,\n ),\n 'model' => array(\n 'type' => 'string',\n 'required' => false,\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n 'slug' => array(\n 'type' => 'string',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "private function build_js_data() {\n\n\t\t$types_settings_action = Types_Ajax::get_instance()->get_action_js_name( Types_Ajax::CALLBACK_SETTINGS_ACTION );\n\n\t\treturn array(\n\t\t\t'ajaxInfo' => array(\n\t\t\t\t'fieldAction' => array(\n\t\t\t\t\t'name' => $types_settings_action,\n\t\t\t\t\t'nonce' => wp_create_nonce( $types_settings_action )\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}", "public function ajax_get_form()\n {\n return ajax_get_form();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the per reference nb heures.
public function setPerReferenceNbHeures(?float $perReferenceNbHeures): AttestationAt { $this->perReferenceNbHeures = $perReferenceNbHeures; return $this; }
[ "public function setPerReferenceNbHeures($perReferenceNbHeures) {\n $this->perReferenceNbHeures = $perReferenceNbHeures;\n return $this;\n }", "public function setNbHeures(?float $nbHeures): Articles {\n $this->nbHeures = $nbHeures;\n return $this;\n }", "public function setNbrHeures($nbrHeures) {\n $this->nbrHeures = $nbrHeures;\n return $this;\n }", "public function getNbHeures3() {\n return $this->nbHeures3;\n }", "public function setNbHeures(?float $nbHeures): BonsTravaux {\n $this->nbHeures = $nbHeures;\n return $this;\n }", "public function setNbHeuresRs(?float $nbHeuresRs): HistoPrepPaie {\n $this->nbHeuresRs = $nbHeuresRs;\n return $this;\n }", "public function setNbHeuresReelInterim(?float $nbHeuresReelInterim): Affaires {\n $this->nbHeuresReelInterim = $nbHeuresReelInterim;\n return $this;\n }", "protected function setReferenceNumber(array $value)\n {\n $this->referenceNumber = $value;\n }", "public function testSetNbrHeures() {\n\n $obj = new LettresMissionsLignes();\n\n $obj->setNbrHeures(10.092018);\n $this->assertEquals(10.092018, $obj->getNbrHeures());\n }", "public function setNbHeureSup($nbHeureSup) {\n $this->nbHeureSup = $nbHeureSup;\n return $this;\n }", "public function getNbHeuresRs() {\n return $this->nbHeuresRs;\n }", "public function testSetNbHeures() {\n\n $obj = new HistoPaieType2();\n\n $obj->setNbHeures(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHeures());\n }", "public function getNbHeuresInterim() {\n return $this->nbHeuresInterim;\n }", "public function setNbHeuresRs($nbHeuresRs) {\n $this->nbHeuresRs = $nbHeuresRs;\n return $this;\n }", "public function getNbHeuresReelInterim() {\n return $this->nbHeuresReelInterim;\n }", "public function setNbHeureSup(?float $nbHeureSup): Bulletins {\n $this->nbHeureSup = $nbHeureSup;\n return $this;\n }", "protected function setNumImprovements()\n {\n $slots = 0;\n $slots += $this->coalPower;\n $slots += $this->oilPower;\n $slots += $this->nuclearPower;\n $slots += $this->windPower;\n $slots += $this->coalMines;\n $slots += $this->ironMines;\n $slots += $this->oilWells;\n $slots += $this->bauxiteMines;\n $slots += $this->leadMines;\n $slots += $this->uraniumMines;\n $slots += $this->farms;\n $slots += $this->oilWells;\n $slots += $this->steelMills;\n $slots += $this->aluminumFactories;\n $slots += $this->munitionsFactories;\n $slots += $this->policeStations;\n $slots += $this->hospitals;\n $slots += $this->recyclingCenters;\n $slots += $this->subways;\n $slots += $this->supermarkets;\n $slots += $this->banks;\n $slots += $this->malls;\n $slots += $this->stadiums;\n $slots += $this->barracks;\n $slots += $this->factories;\n $slots += $this->hangars;\n $slots += $this->drydocks;\n\n $this->numImprovements = $slots;\n }", "public function set_num_links($num_links)\n\t{\n\t\t$this->_num_links = intval($num_links);\n\t}", "public function setNumberOfHMetrics($value) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return quota usage in KB
public function getQuotaUsage() { $quota = $this->getQuota(); if(is_array($quota)) { $quota = $quota['STORAGE']['usage']; } return $quota; }
[ "public function getQuotaBytesUsed() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"quotaBytesUsed\");\n\t}", "public function getQuotaUsage()\n {\n $quota = $this->getQuota();\n\n if ( is_array( $quota ) ) {\n $quota = $quota[ 'STORAGE' ][ 'usage' ];\n }\n\n return $quota;\n }", "public function get_upload_quota()\n\t{\n\t\treturn (Http::request('upload_quota', 'post') * Http::request('upload_quota_list', 'post'));\n\t}", "public function getDiskUsage()\n {\n return floatval($this->getUsage('quota'));\n }", "public function getQuotaUsage()\n {\n mailMethod::getQuotaUsage();\n if (!$this->quota_loaded) {\n $this->loadQuota();\n }\n return $this->quotaUsage;\n }", "function getQuota() {\n $quota = array();\n $data['acct'] = $this->account;\n preg_match('/\"quota\" value=\"([^\"]*)/', $this->HTTP->getData('ftp/editquota.html', $data), $quota);\n return ($quota[1] == 0) ? 'Unlimited' : intval($quota[1]);\n }", "public function getQuota()\n {\n return $this->quota;\n }", "public function getSendingQuotaUsage()\n {\n $tracker = $this->getQuotaTracker();\n return $tracker->getUsage();\n }", "public function getDiskUsage(): float\n {\n return floatval($this->getUsageItem('quota'));\n }", "public function getQuota() {\n\t\t$quota = $this->account->getQuota();\n\t\tif ($quota === null) {\n\t\t\treturn 'default';\n\t\t}\n\t\treturn $quota;\n\t}", "public function getSendingQuotaUsage(): string\n {\n $tracker = $this->getQuotaTracker();\n\n return $tracker->getUsage();\n }", "public function getSendingQuotaUsage()\n {\n $current = $this->getCurrentSubscription();\n if (is_null($current)) {\n return 0;\n }\n $tracker = $this->getQuotaTracker();\n return $tracker->getUsage();\n }", "public function getQuota()\n {\n return $this->_quota;\n }", "public function getStorageQuota() : int\n {\n }", "public function getQuotaUsage()\n {\n return(-1);\n }", "public function getQuotaLimit()\n {\n $quota = $this->getQuota();\n\n if ( is_array( $quota ) ) {\n $quota = $quota[ 'STORAGE' ][ 'limit' ];\n }\n\n return $quota;\n }", "public static function getQuotaLimit()\n {\n $quota = $this->getQuota();\n if (is_array($quota)) {\n $quota = $quota['STORAGE']['limit'];\n }\n\n return $quota;\n }", "public static function getRemainingQuota() {\r\n $user = Engine_Api::_()->user()->getViewer();\r\n $user_id = $user->getIdentity();\r\n if (empty($user_id))\r\n return 0;\r\n $level_id = $user->level_id;\r\n if (!empty($level_id)) {\r\n $space_limit = (int) Engine_Api::_()->authorization()->getPermission($level_id, 'user', 'quota');\r\n if (empty($space_limit))\r\n return 0;\r\n $tableStorage = Engine_Api::_()->getItemTable('storage_file');\r\n $tableName = $tableStorage->info('name');\r\n $space_used = (int) $tableStorage->select()\r\n ->from($tableName, new Zend_Db_Expr('SUM(size) AS space_used'))\r\n ->where(\"user_id = ?\", (int) $user_id)\r\n ->query()->fetchColumn(0);\r\n return $space_limit - $space_used ;\r\n }\r\n return 0;\r\n }", "public function getUsagePercent()\n {\n $usagePercent = $this->getUsage() / $this->hardQuota;\n\n if ($usagePercent > 1) {\n return 1;\n }\n\n return $usagePercent;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create an array of size n
function ArrayRand($n) { $some_data=0; $array = array_fill(0, $n, $some_data); for ($i = 1; $i < $n; $i++) { $array[$i] = rand(0, 1000); } return $array; }
[ "public static function createArray($m, $n, $value = 0) {\r\n\t\t$arr = array();\r\n\t\tfor ($i = 0; $i < $m; $i++) {\r\n\t\t\tfor ($j = 0; $j < $n; $j++) {\r\n\t\t\t\t$arr[$i][$j] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $arr;\r\n\t}", "function inputArray($n)\n{\n $arr = [];\n\n for ($i = 0; $i < $n; $i++) {\n\n $arr[$i] = inputInt();\n\n }\n\n return $arr;\n}", "public static function identity(int $n): \\CArray\n {\n return parent::identity($n);\n }", "function createNArray($length, $prepend = null) {\n $result = array();\n for ($i = 0; $i < $length; $i++) {\n if (!is_null($prepend)) {\n array_push($result, $prepend . $i);\n } else {\n array_push($result, $i);\n }\n }\n return $result;\n}", "public function allocateTo(int $n): array\n {\n if ($n <= 0) {\n throw new \\InvalidArgumentException('Cannot allocate to none, target must be greater than zero');\n }\n\n return $this->allocate(\\array_fill(0, $n, 1));\n }", "public function batch(int $n = 50) : array;", "public static function makeRandom($n) {\n $nd = 2 * $n;\n $data = [];\n for ($i = 0; $i < $nd; $i++)\n $data[$i] = mt_rand() / mt_getrandmax();\n return $data;\n }", "abstract public function batch(int $n = 50) : array;", "abstract protected function newArray();", "public static function chunks($array, $n) {\n\t\treturn array_chunk($array, $n);\n\t}", "final public static function identity(int $n): NdArray\n {\n Assert::integer($n, Message::ONLY_POSITIVE_INT);\n Assert::greaterThan($n, 0, Message::ONLY_POSITIVE_INT);\n\n return self::eye($n, $n);\n }", "protected static function __replicate(int $n, $item): array\n\t{\n\t\t$result = [];\n\n\t\tfor ($i = 0; $i < $n; $i++) {\n\t\t\t$result[] = $item;\n\t\t}\n\n\t\treturn $result;\n\t}", "function matrix(int $n): array {\n $spiral = [];\n\n for ($i = 0; $i < $n; ++$i) {\n $array = [];\n\n for ($j = 0; $j < $n; ++$j) {\n $array[] = 0;\n }\n\n $spiral[] = $array;\n }\n\n walk($spiral);\n\n return $spiral;\n}", "function createRandomValueArray($size)\n{\n $randomArray = array();\n for ($i = 0; $i < $size; $i++) {\n $randomArray[] = rand();\n }\n return $randomArray;\n}", "function arr(){return new __array(func_get_args());}", "function randomArray($n, $min, $max)\n{\n\n #if the minimum value is lower swift them \n if ($min > $max) {\n $aux = $max;\n $min = $aux;\n $max = $min;\n }\n\n $array = [];\n for ($i = 0; $i < $n; $i++) {\n $array[$i] = rand($min, $max);\n }\n return $array;\n}", "function arrayInit(&$array, $quantity){\n\tfor ($i = 1; $i <= $quantity; $i++){\n\t\t$array[$i] = $i;\n\t}\n}", "private function initMatrix($n) {\n global $matriz;\n // unset($matriz);\n $matriz = [];\n for ($x=1;$x<=$n;$x++) {\n for ($y=1;$y<=$n;$y++) {\n for ($z=1;$z<=$n;$z++) {\n $matriz[$x][$y][$z] = 0;\n }\n }\n }\n}", "public static function createAlmostOrderedArray(int$n,int$m=10,int $first = 10){\r\n $array = [];\r\n $array[0] = mt_rand(0,$first);\r\n for ($i=1; $i <=$n ; ++$i) { \r\n $array[$i] = $array[$i-1]+mt_rand(0,2);\r\n }\r\n for ($i=0; $i < $m; ++$i) { \r\n $a = mt_rand(0,$n);\r\n $b = mt_rand(0,$n);\r\n self::swap($array[$a],$array[$b]);\r\n }\r\n return $array;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a root category, and its child as default category
public function initCategory(Event $e) { // Skip if the initial data is exists $sqlPath = sprintf('%s/%s', Pi::path('module'), self::INIT_FILE_NAME); if (file_exists($sqlPath)) { return true; } // Add a root category and its child category $module = $this->event->getParam('module'); $model = Pi::model('category', $module); $data = [ 'id' => null, 'name' => 'root', 'slug' => 'root', 'title' => _a('Root'), 'description' => _a('Module root category'), ]; $result = $model->add($data); $defaultCategory = [ 'id' => null, 'name' => 'default', 'slug' => 'slug', 'title' => _a('Default'), 'description' => _a('The default category can not be delete, but can be modified!'), ]; $parent = $model->select(['name' => 'root'])->current(); $model->add($defaultCategory, $parent); return $result; }
[ "public function canAddRootCategory()\r\n {\r\n return true;\r\n }", "function ed_dynam_perks_create_default_cats(){\r\n\t$parent_term = term_exists( 'dynamic-perk-category' ); // array is returned if taxonomy is given\r\n\t$parent_term_id = $parent_term['term_id']; // get numeric term id\r\n\t$version = get_option( 'ed_dynam_perks_theme' );\r\n\tif($version == 'ed5'){\r\n\t\t$default_terms = array('Home Row 1', 'Home Row 2');\r\n\t} else {\r\n\t\t$default_terms = array('Home');\r\n\t}\r\n\r\n\tforeach ($default_terms as $term) {\r\n\t\t$term_slug = str_replace(' ', '-', strtolower($term));\r\n\t\t$term_descrip = $term . ' Perk Category';\r\n\t\twp_insert_term(\r\n\t\t $term, // the term \r\n\t\t 'dynamic-perk-category', // the taxonomy\r\n\t\t array(\r\n\t\t 'description'=> $term_descrip,\r\n\t\t 'slug' => $term_slug,\r\n\t\t 'parent'=> $parent_term_id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n}", "public static function makeDefaultCategory() {\n\t\t$category = new Category();\n\t\t$category->name = \"Default Category\";\n\t\t$category->save();\n\t\tConfig::setValue(Config::$KEYS['DEFAULT_CATEGORY'], $category->category_id);\n\t}", "public function findRootCategory()\n {\n }", "private function createCategoryTree()\n {\n $locale = $this->container->get('request_stack')->getCurrentRequest()->getLocale();\n $repo = $this->container->get('zikula_categories_module.category_repository');\n // create pages root category\n $parent = $repo->findOneBy(['name' => 'Modules']);\n $pagesRoot = new CategoryEntity();\n $pagesRoot->setParent($parent);\n $pagesRoot->setName($this->bundle->getName());\n $pagesRoot->setDisplay_name([\n $locale => $this->__('Gallery', 'kaikmediagallerymodule', $locale)\n ]);\n $pagesRoot->setDisplay_desc([\n $locale => $this->__('Gallery and media', 'kaikmediagallerymodule', $locale)\n ]);\n $this->entityManager->persist($pagesRoot);\n // create children\n $category1 = new CategoryEntity();\n $category1->setParent($pagesRoot);\n $category1->setName('Category1');\n $category1->setDisplay_name([\n $locale => $this->__('Category 1', 'kaikmediagallerymodule', $locale)\n ]);\n $category1->setDisplay_desc([\n $locale => $this->__('Initial sub-category created on install', 'kaikmediagallerymodule', $locale)\n ]);\n $attribute = new CategoryAttributeEntity();\n $attribute->setAttribute('color', '#99ccff');\n $category1->addAttribute($attribute);\n $this->entityManager->persist($category1);\n $category2 = new CategoryEntity();\n $category2->setParent($pagesRoot);\n $category2->setName('Category2');\n $category2->setDisplay_name([\n $locale => $this->__('Category 2', 'kaikmediagallerymodule', $locale)\n ]);\n $category2->setDisplay_desc([\n $locale => $this->__('Initial sub-category created on install', 'kaikmediagallerymodulee', $locale)\n ]);\n $attribute = new CategoryAttributeEntity();\n $attribute->setAttribute('color', '#cceecc');\n $category2->addAttribute($attribute);\n $this->entityManager->persist($category2);\n // create Registry\n $registry = new CategoryRegistryEntity();\n $registry->setCategory($pagesRoot);\n $registry->setEntityname('AlbumEntity');\n $registry->setModname($this->bundle->getName());\n $registry->setProperty('Main');\n $this->entityManager->persist($registry);\n $this->entityManager->flush();\n\n return true;\n }", "protected function getRoot()\r\n {\r\n if (!$this->rootCategory) {\r\n $this->rootCategory = $this->createCategory([\r\n 'name' => '0_ROOT',\r\n 'enabled' => 1\r\n ]);\r\n $this->rootCategory->refresh();\r\n $this->rootCategory->parent = 0;\r\n $this->rootCategory->save();\r\n }\r\n\r\n return $this->rootCategory;\r\n }", "public function testAddChildCategory(): void\n {\n $parentCategory = $this->categoryRepository->get(333);\n $postData = [\n 'name' => 'Custom category name',\n 'parent' => 333,\n 'is_active' => 1,\n 'include_in_menu' => 1,\n 'display_mode' => 'PRODUCTS',\n 'is_anchor' => true,\n 'use_config' => [\n 'available_sort_by' => 1,\n 'default_sort_by' => 1,\n 'filter_price_range' => 1,\n ],\n ];\n $responseData = $this->performSaveCategoryRequest($postData);\n $this->assertRequestIsSuccessfullyPerformed($responseData);\n $this->createdCategoryId = $responseData['category']['entity_id'];\n $this->categoryFlatIndexer->executeFull();\n $this->assertTrue(\n $this->categoryFlatResource->getConnection()->isTableExists($this->categoryFlatResource->getMainTable())\n );\n $this->assertEquals(1, $parentCategory->getChildrenCategories()->getSize());\n $categoryFlatCollection = $this->categoryFlatCollectionFactory->create();\n $categoryFlatCollection->addIdFilter([333, $this->createdCategoryId]);\n $this->assertCount(2, $categoryFlatCollection->getItems());\n /** @var Category $createdCategory */\n $createdCategory = $categoryFlatCollection->getItemByColumnValue('entity_id', $this->createdCategoryId);\n $this->assertEquals($parentCategory->getPath() . '/' . $this->createdCategoryId, $createdCategory->getPath());\n $this->assertEquals($parentCategory->getEntityId(), $createdCategory->getParentId());\n $this->assertEquals($parentCategory->getLevel() + 1, $createdCategory->getLevel());\n }", "function admin_add_category() {\n\t\t//\n\t}", "protected function getRoot()\n {\n if (!$this->rootCategory) {\n $this->rootCategory = $this->createCategory([\n 'name' => '0_ROOT',\n 'enabled' => 1,\n 'sort_order' => 100\n ]);\n $this->rootCategory->refresh();\n $this->rootCategory->parent = 0;\n $this->rootCategory->save();\n }\n\n return $this->rootCategory;\n }", "function addCategory()\n\t{\t$AS['ADD'] = new sql;\n\t\t$AS['ADD']->table=$this->table.\"cats\";\n\t\t$AS['ADD']->setValue('rPARENT',$_POST['parent']);\n\t\t$AS['ADD']->insert();\n\t\t\n\t\t$catID=$AS['ADD']->last_insert_id;\n\t\t\n\t\t$AS['ADD'] = new sql;\n\t\t$AS['ADD']->table=$this->table.\"cats\";\n\t\t$AS['ADD']->wherevar = ' WHERE fID='.$catID;\n\t\t$AS['ADD']->setValue('fSORTORDER',1000000+$catID);\n\t\t$AS['ADD']->update();\n\t\t\n\t\t\n\t\n\t\t$AS['ADD'] = new sql;\n\t\t$AS['ADD']->table=$this->table.\"cats_names\";\n\t\t$AS['ADD']->setValue('rCATID',$catID);\n\t\t$AS['ADD']->setValue('rCLANG',$this->config->getSetting('Languages','DefaultCLANG'));\n\t\t$AS['ADD']->setValue('fNAME',$_POST['catname']);\n\t\t$AS['ADD']->insert();\n\t\t\n\t\t$this->updateSEF($catID);\n\t\t\n\t}", "public function testCreationOfRootCategory()\n {\n // Generate index\n EcomDev_Utils_Reflection::invokeRestrictedMethod(\n $this->resourceModel, \n '_generateRootCategoryIndex'\n );\n \n $result = $this->resourceModel->getRootCategories();\n $this->assertEquals(\n $this->expected()->getResult(), \n $result\n );\n \n return $this;\n }", "public function root()\n {\n $category = $this->createModel();\n\n $category = $category->whereExists(function($query)\n {\n $query->select(\\DB::raw(1))\n ->from('category_hierarchy')\n ->whereRaw(DB::getTablePrefix().'categories.id = '.DB::getTablePrefix().'category_hierarchy.category_id')\n ->where('category_hierarchy.category_parent_id', 0);\n });\n\n return $category;\n }", "public function testCreateKnownRootCategory()\n {\n $json\n = <<<JSON\n[\n {\n \"display_mode\": \"PRODUCTS\",\n \"include_in_menu\": \"1\",\n \"is_active\": \"1\",\n \"level\": \"1\",\n \"name\": \"Root Category %1\\$s\",\n \"mf_guid\": \"%2\\$s\",\n \"position\": \"1\"\n }\n]\nJSON;\n $json = sprintf($json, mt_rand(10000, 99999), $this->knownRootMfGuid);\n $url = sprintf('%s/%s', $this->baseUrl, $this->resource);\n $this->postJson($url, $json);\n }", "public function createNode()\n {\n $lastRootIndex = \\App\\Category::where('parent_id', null)->count()+1;\n $root = \\App\\Category::create(['name' => 'Root category '.$lastRootIndex]);\n return $this->buildResultMessage('OK', '', $root->toJson());\n }", "private function addCategories()\n {\n $collection = $this->category->create();\n $collection->addAttributeToSelect('*');\n\n foreach ($collection as $category) {\n if ($category->getId() > 1) {\n $e = $this->eCategories->appendChild(\n $this->dd->createElement('category')\n );\n\n $e->appendChild($this->dd->createElement('name', \\htmlspecialchars($category->getName())));\n\n if ($category->getImageUrl()) {\n $e->appendChild($this->dd->createElement('picture', \\htmlspecialchars($category->getImageUrl())));\n }\n\n $e->setAttribute('id', $category->getId());\n\n if ($category->getParentId() > 1) {\n $e->setAttribute('parentId', $category->getParentId());\n }\n }\n }\n }", "protected function loadCategories() {\n\n\n $class = $this->getClass();\n\n// $categories = $this->getObjectManager()->createQuery(sprintf('SELECT c FROM %s c WHERE c.user = :user ORDER BY c.parent ASC', $class))\n// ->setParameter('user', $this->user)\n// ->execute();\n\n $categories = $this->getObjectManager()->createQuery(sprintf('SELECT c FROM %s c WHERE c.user = :user ORDER BY c.parent ASC', $class))\n ->setParameter('user', $this->user)\n ->execute();\n if (count($categories) == 0) {\n // no category, create one for the provided context\n $category = $this->create();\n $category->setName('default');\n $category->setTitle('default');\n \n $category->setEnabled(true);\n $category->setPublic(false);\n $category->setUser($this->user);\n $category->setDescription('default category created by system');\n\n $this->save($category);\n\n $categories = array($category);\n }\n $root = array();\n foreach ($categories as $pos => $category) {\n if ($category->getParent() == null) {\n array_push($root, $category);\n }\n $this->categories[$this->userId][$category->getId()] = $category;\n $parent = $category->getParent();\n $category->disableChildrenLazyLoading();\n if ($parent) {\n $parent->addChild($category);\n }\n }\n\n $this->categories = array(\n 0 => $root\n );\n }", "function initCategoryTree() {\n\n Varien_Profiler::start(\"export_product_initCategoryTree\");\n\n foreach ($this->rootCategoryIds as $rootId => $stores) {\n /**\n * define the store tu used to load the category tree :\n * use default store first\n */\n $defaultStoreId = null;\n //first take the default store of the default website\n foreach ($stores as $store) {\n $website = $store->getWebsite();\n if ($website->getIsDefault() && $website->getDefautStore() && $website->getDefautStore()->getId() == $store->getId()) {\n $defaultStoreId = $store->getId();\n }\n }\n //if not found take the first store of the default website\n if ($defaultStoreId == null) {\n foreach ($stores as $store) {\n $website = $store->getWebsite();\n if ($website->getIsDefault() && $defaultStoreId == null) {\n $defaultStoreId = $store->getId();\n }\n }\n }\n //if not found take the first store of the first website\n if ($defaultStoreId == null) {\n $store = current($stores);\n $defaultStoreId = $store->getId();\n }\n\n //LOAD TREE with $rootId and $defaultStoreId\n $tree = Mage::getResourceModel('catalog/category_tree')\n ->load($rootId);\n\n $collection = Mage::getModel('catalog/category')->getCollection();\n /** @var $collection Mage_Catalog_Model_Resource_Category_Collection */\n\n //Set Store Id\n $collection->setStoreId($defaultStoreId);\n\n //add attributes to display\n $collection->addAttributeToSelect(array('name', 'image'));\n\n //exclude categories not actives and without name\n $collection->addAttributeToFilter('name', array('neq' => '')); //Exclude empty name categories\n $collection->addAttributeToFilter('is_active', 1);\n\n //filter on the tree categories\n $nodeIds = array();\n foreach ($tree->getNodes() as $node) {\n $nodeIds[] = $node->getId();\n }\n $collection->addIdFilter($nodeIds);\n\n //join url-rewrite table\n if (class_exists ('Mage_Catalog_Model_Factory', false)) {\n Mage::getSingleton('catalog/factory')->getCategoryUrlRewriteHelper()\n ->joinTableToEavCollection($collection, $defaultStoreId);\n } else {\n /**\n * Join url rewrite table to eav collection\n *\n * @param Mage_Eav_Model_Entity_Collection_Abstract $collection\n * @param int $storeId\n * @return Mage_Catalog_Helper_Category_Url_Rewrite\n */\n\n $collection->joinTable(\n 'core/url_rewrite',\n 'category_id=entity_id',\n array('request_path'),\n \"{{table}}.is_system=1 AND \" .\n \"{{table}}.store_id='{$defaultStoreId}' AND \" .\n \"{{table}}.id_path LIKE 'category/%'\",\n 'left'\n );\n\n }\n\n //Add collection data to the tre nodes see Mage_Catalog_Model_Resource_Category_Tree#addCollectionData\n foreach ($collection as $category) {\n if ($node = $tree->getNodeById($category->getId())) {\n\n /* Calculate the url to export */\n if (method_exists($category, 'getUrlModel')) { //compatibility with older magento version where category#getUrlModel doesn't exist\n $category->getUrlModel()->getUrlInstance()->setStore($defaultStoreId);\n } else {\n $category->getUrlInstance()->setStore($defaultStoreId);\n }\n $category->setData('url', $category->getUrl());\n\n $node->addData($category->getData());\n }\n }\n\n foreach ($tree->getNodes() as $node) {\n //if the node is not in the collection (not active), remove it and all his descendant from the tree (except if it's the root node)\n if ($collection->getItemById($node->getId()) == null && $node->getLevel() > 1) {\n $this->removeBranch($tree, $node);\n }\n }\n\n //Mage::log(\"LOAD TREE \".$rootId. \" \". $defaultStoreId . ' '. spl_object_hash($tree), null, 'antidot.log');\n //Mage::log($collection->getSelect()->__toString() , null, 'antidot.log');\n //$i=0;\n //foreach ($tree->getNodes() as $node) {\n // $i++;\n //}\n //Mage::log('Tree nodes '.$i , null, 'antidot.log');\n\n $this->categoryTrees[] = $tree;\n\n }\n\n Varien_Profiler::stop(\"export_product_initCategoryTree\");\n\n }", "private function createCategoryInDb(): \\Magento\\Catalog\\Model\\Category\n {\n return CategoryBuilder::topLevelCategory()->build();\n }", "public static function createDefaultPayeverCategory()\n {\n $defaultPayeverCategory = oxNew('oxcategory');\n $data = [\n 'oxparentid' => 'oxrootid',\n 'oxtitle' => 'payever',\n ];\n $aLanguages = oxRegistry::getLang()->getLanguageArray();\n foreach ($aLanguages as $aLanguage) {\n if (property_exists($aLanguage, 'id')) {\n $defaultPayeverCategory->assign($data);\n $defaultPayeverCategory->setLanguage($aLanguage->id);\n $defaultPayeverCategory->save();\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines PAGE constant for pages and scripts. Pages and scripts will check for this constant and this constant need to be present for pages and scripts to work.
public static function definePage() { define("PAGE", true); }
[ "protected function page(){\n\t\t$pagePath = 'app/page/'.ucfirst(Request::instance()->page).'.php';\n\n\t\tif(file_exists($pagePath)){\n\t\t\trequire_once($pagePath);\n\t\t}\n\t}", "static public function createPage() {\n $session = Application::getInstance(\"session\");\n $config = Application::getConfig();\n\n if (isset($config[\"system\"][\"customPageClass\"])) {\n require $config[\"system\"][\"pages-folder\"] . \"/\" . $config[\"system\"][\"customPageClass\"] . \".php\";\n }\n\n include_once $config[\"system\"][\"pages-folder\"] . \"/\" . $session->currentPage . \".page.php\";\n $pageClass = $config[\"system\"][\"namespace\"] . \"\\\\pages\\\\Page\" . ucfirst($session->currentPage);\n\n\n $page = new $pageClass();\n\n Application::setInstance(\"page\", $page);\n }", "function clsPage() {\r\n\t\t}", "function static_page()\n\t{\n\t\tglobal $errors, $cache, $Cl_root_path, $lang_loader, $basic_lang, $template, $plug_clcode, $userdata;\n\t\t\n\t\t// get the name\n\t\t$name = ( isset( $_GET[ SUBMODE_URL ] ) ) ? str_replace( '%20', ' ', strval( $_GET[ SUBMODE_URL ] ) ) : '';\n\t\t\n\t\t// get the pages\n\t\tif ( !$pages_array = $cache->pull( 'static_pages' ) )\n\t\t{ // need to get them\n\t\t\tif ( !is_readable( $Cl_root_path . 'kernel/config/static_pages' . phpEx ) )\n\t\t\t{ // oh noes, run away\n\t\t\t\t$errors->report_error( $basic_lang[ 'Unknown_page' ], GENERAL_ERROR );\n\t\t\t}\n\t\t\t$pages_array = unserialize( @file_get_contents( $Cl_root_path . 'kernel/config/static_pages' . phpEx ) );\n\t\t\t$cache->push( 'static_pages', $pages_array, TRUE );\n\t\t}\n\t\t\n\t\tif ( !$page = $pages_array[ $lang_loader->board_lang ][ $name ] )\n\t\t{ // didn't get the bastard\n\t\t\t$errors->report_error( $basic_lang[ 'Unknown_page' ], GENERAL_ERROR );\n\t\t}\n\t\t// check auth\n\t\t// check the auth :)\n\t\tif ( isset( $page[ 'auth' ] ) )\n\t\t{\n\t\t\tif ( $page[ 'auth' ] < ADMIN )\n\t\t\t{ // for wee low folk\n\t\t\t\tif ( $page[ 'auth' ] > $userdata[ 'user_level' ] )\n\t\t\t\t{ // don't display this one\n\t\t\t\t\t$errors->report_error( $basic_lang[ 'Page_auth' ], GENERAL_ERROR );\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{ // for a tad normaler guys\n\t\t\t\tif ( $userdata[ 'user_level' ] < $page[ 'auth' ] )\n\t\t\t\t{ // don't display this one\n\t\t\t\t\t$errors->report_error( $basic_lang[ 'Page_auth' ], GENERAL_ERROR );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// fire up ze template\n\t\t$template->assign_files( array(\n\t\t\t'static_page' => 'static_page' . tplEx\n\t\t) );\n\t\t// stuff add\n\t\t$template->assign_block_vars( 'page', '', array(\n// \t\t\t'BODY' => $plug_clcode->parse( stripslashes( $page[ 'content' ] ), TRUE )\n\t\t\t'BODY' => stripslashes( $page[ 'content' ] )\n\t\t) );\n\t\t$template->assign_switch( 'page', TRUE );\n\t\t\n\t\t// some minor thingies eh\n\t\t$this->set_title( $name );\n\t\t$this->set_level( 1, 'pages', '', array( array( 'URL' => '?' . MODE_URL . '=pages&' . SUBMODE_URL . '=' . str_replace( ' ', '%20', $name ), 'title' => $name ) ) );\n\t\t\n\t\t// add to output\n\t\t$this->add_file( 'static_page' );\n\t}", "protected function initPage()\n {\n global $configArray;\n\n if (isset($_REQUEST['page'])) {\n $this->page = $_REQUEST['page'];\n }\n\n if(isset($configArray['Site']['max_pages']) && $configArray['Site']['max_pages'] < $this->page) {\n $this->page=$configArray['Site']['max_pages'];\n }\n \n $this->page = intval($this->page);\n if ($this->page < 1) {\n $this->page = 1;\n }\n\n }", "private static function define_page_elements($GET_array, $POST_array)\n {\n // Sanitizes the url input.\n $url_params = filter_var_array($GET_array, FILTER_SANITIZE_URL);\n\n // Sets the elements/files of the expected page (default is Home).\n if (isset($url_params['cat']))\n {\n if (isset($url_params['id_image']))\n {\n self::$page['id_image'] = $url_params['id_image'];\n self::$page['name'] = 'montage_image';\n self::$page['path'] = 'index.php?cat='.strtolower($url_params['cat']).'&id_image='.self::$page['id_image'];\n self::$page['controller'] = 'CMontageImage.php';\n self::$page['view'] = 'VMontageImage.php';\n }\n else\n {\n self::$page['name'] = strtolower($url_params['cat']);\n self::$page['path'] = 'index.php?cat='.self::$page['name'];\n self::$page['controller'] = 'C'.ucfirst(self::$page['name']).'.php';\n self::$page['view'] = 'V'.ucfirst(self::$page['name']).'.php';\n }\n }\n\n // Overrides the controller with login/logout for those actions.\n if (isset($POST_array['login']))\n {\n self::$page['action'] == 'login';\n self::$page['controller'] = 'CLogin.php';\n }\n else if (isset($GET_array['logout']))\n {\n self::$page['action'] == 'logout';\n self::$page['controller'] = 'CLogout.php';\n }\n\n // Sets the proper full paths for the page's url and files.\n self::$page['path'] = Config::ROOT.self::$page['path'];\n self::$page['controller'] = Config::CONTROLLERS_PATH.self::$page['controller'];\n self::$page['view'] = Config::VIEWS_PATH.self::$page['view'];\n }", "public function setPage() {\n }", "function elm_Page_SetCurrentPage($page)\n{\n global $elm_Page_CurrentPage;\n $elm_Page_CurrentPage = $page;\n}", "function pages_page_handler($page) {\n\n\telgg_load_library('elgg:pages');\n\t\n\tif (!isset($page[0])) {\n\t\t$page[0] = 'all';\n\t}\n\n\telgg_push_breadcrumb(elgg_echo('pages'), 'pages/all');\n\n\t$page_type = $page[0];\n\tswitch ($page_type) {\n\t\tcase 'owner':\n\t\t\techo elgg_view_resource('pages/owner');\n\t\t\tbreak;\n\t\tcase 'friends':\n\t\t\techo elgg_view_resource('pages/friends');\n\t\t\tbreak;\n\t\tcase 'view':\n\t\t\techo elgg_view_resource('pages/view', [\n\t\t\t\t'guid' => $page[1],\n\t\t\t]);\n\t\t\tbreak;\n\t\tcase 'add':\n\t\t\techo elgg_view_resource('pages/new', [\n\t\t\t\t'guid' => $page[1],\n\t\t\t]);\n\t\t\tbreak;\n\t\tcase 'edit':\n\t\t\techo elgg_view_resource('pages/edit', [\n\t\t\t\t'guid' => $page[1],\n\t\t\t]);\n\t\t\tbreak;\n\t\tcase 'group':\n\t\t\techo elgg_view_resource('pages/owner');\n\t\t\tbreak;\n\t\tcase 'history':\n\t\t\techo elgg_view_resource('pages/history', [\n\t\t\t\t'guid' => $page[1],\n\t\t\t]);\n\t\t\tbreak;\n\t\tcase 'revision':\n\t\t\techo elgg_view_resource('pages/revision', [\n\t\t\t\t'id' => $page[1],\n\t\t\t]);\n\t\t\tbreak;\n\t\tcase 'all':\n\t\t\techo elgg_view_resource('pages/world');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "protected function initialize_pages() {\n\t\t$this->pages['log_list_page'] = new Page\\LogListPage();\n\t\t$this->pages['settings_page'] = new Page\\SettingsPage();\n\t}", "private function getDefaultPage() {\n\t\t\treturn defined('DEFAULT_PAGE') ? DEFAULT_PAGE : NULL;\n\t\t}", "function createPages() { }", "public static function buildPages(){\r\n\t\techo \"\\nBuilding static pages\\n--------------------------------------------------------------------------------\\n\";\r\n\r\n\t\t// set the PageController buildMode to SHOW_EXPORT\r\n\t\tModulaiseController::$buildMode = SHOW_EXPORT;\r\n\r\n\t\t// set the static content path to right value\r\n\t\tModulaiseController::$staticContentPath = PATH_MODULES_BUILD;\r\n\t\t\r\n\t\t// Reset global modules\r\n\t\tModulaiseController::initialize();\r\n\r\n\t\t// read all modulenames\r\n\t\t$allPages = ModulaiseUtils::getDirectoryAsArray(ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES);\r\n\t\tforeach ($allPages as $file){\r\n\t\t\tif (ModulaiseUtils::EndsWith($file,\".php\")){\r\n\r\n\t\t\t\t// figure out filename to write\r\n\t\t\t\tif (PATH_PAGES_COMPILED!=\"\"){\r\n\t\t\t\t\techo \"Writing static page : \".ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES_COMPILED.DIRECTORY_SEPARATOR.substr($file, 0, -4).\".html\\n\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Writing static page : \".ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.substr($file, 0, -4).\".html\\n\";\r\n\t\t\t\t}\r\n\t\t\t\tinclude(ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES.DIRECTORY_SEPARATOR.$file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function page()\r\n\t{\r\n\t\t//Load dynamic page content\r\n\t\t$content =& model::create('content');\r\n\t\tif(ctype_digit($this->params['url_params']))\r\n\t\t\t$content->find($this->params['url_params']);\r\n\t\telse\r\n\t\t\t$content->find_by_field('url_name',$this->params['url_params']);\r\n\t\t\r\n\t\tif($content->id == null)\r\n\t\t\t$content->find(ERROR_404_CONTENT_ID);\r\n\t\t\t\r\n\t\t$this->template_data['content'] = $content->fields_as_associative_array();\t\r\n\t\r\n\t\t$this->breadcrumb[] = array('page/'.$content->url_name => $content->title);\r\n\t}", "public static function page()\n\t{\n\t\t// By default, the value of a parameter of type Xajax::PAGE_NUMBER is 0.\n\t\treturn array(Xajax::PAGE_NUMBER, 0);\n\t}", "private function pages_tab() {\n\t\t$this->pages_settings_appearance();\n\t}", "public function setPageID(){\n\t\t\n\t\t$id = 'page';\n\t\t$s = '-';\n\t\t$pound = (!self::USE_SPLASH)?'#':'';\n\t\t$prefix = $pound.$id.$s;\n\t\t$this->headerContainerId = $prefix.'header'.$s.'container';\n\t\t$this->headerId = $prefix.'header';\n\t\t$this->subtitleId = $prefix.'subtitle';\n\t\t$this->brandId = $prefix.'brand';\n\t\t\n\t}", "protected function _initPages() {\n }", "function addPage(){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deleteOldEthnicityTypeByIdWithHttpInfo Deletes an existing resource using the resource identifier.
public function deleteOldEthnicityTypeByIdWithHttpInfo($id, $if_match = null) { // verify the required parameter 'id' is set if ($id === null) { throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteOldEthnicityTypeById'); } // parse inputs $resourcePath = "/oldEthnicityTypes/{id}"; $httpBody = ''; $queryParams = array(); $headerParams = array(); $formParams = array(); $_header_accept = ApiClient::selectHeaderAccept(array('application/json')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); // header params if ($if_match !== null) { $headerParams['If-Match'] = $this->apiClient->getSerializer()->toHeaderValue($if_match); } // path params if ($id !== null) { $resourcePath = str_replace( "{" . "id" . "}", $this->apiClient->getSerializer()->toPathValue($id), $resourcePath ); } // default format to json $resourcePath = str_replace("{format}", "json", $resourcePath); // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'DELETE', $queryParams, $httpBody, $headerParams ); return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 500: $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\WebServiceError', $e->getResponseHeaders()); $e->setResponseObject($data); break; } throw $e; } }
[ "public function getOldEthnicityTypeByKeyWithHttpInfo($old_ethnicity_type_id, $if_none_match = null)\n {\n \n // verify the required parameter 'old_ethnicity_type_id' is set\n if ($old_ethnicity_type_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $old_ethnicity_type_id when calling getOldEthnicityTypeByKey');\n }\n \n // parse inputs\n $resourcePath = \"/oldEthnicityTypes\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n // query params\n \n if ($old_ethnicity_type_id !== null) {\n $queryParams['oldEthnicityTypeId'] = $this->apiClient->getSerializer()->toQueryValue($old_ethnicity_type_id);\n }\n // header params\n \n if ($if_none_match !== null) {\n $headerParams['If-None-Match'] = $this->apiClient->getSerializer()->toHeaderValue($if_none_match);\n }\n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'GET',\n $queryParams, $httpBody,\n $headerParams, '\\Swagger\\Client\\Model\\OldEthnicityType'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\Swagger\\Client\\ObjectSerializer::deserialize($response, '\\Swagger\\Client\\Model\\OldEthnicityType', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\Swagger\\Client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\OldEthnicityType', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = \\Swagger\\Client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\WebServiceError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function deleteAssessmentIdentificationSystemTypeByIdWithHttpInfo($id, $if_match = null)\n {\n \n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteAssessmentIdentificationSystemTypeById');\n }\n \n // parse inputs\n $resourcePath = \"/assessmentIdentificationSystemTypes/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n // header params\n \n if ($if_match !== null) {\n $headerParams['If-Match'] = $this->apiClient->getSerializer()->toHeaderValue($if_match);\n }\n // path params\n \n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'DELETE',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 500:\n $data = \\Swagger\\Client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\WebServiceError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function deleteCharterStatusTypeByIdWithHttpInfo($id, $if_match = null)\n {\n \n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteCharterStatusTypeById');\n }\n \n // parse inputs\n $resourcePath = \"/charterStatusTypes/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n // header params\n \n if ($if_match !== null) {\n $headerParams['If-Match'] = $this->apiClient->getSerializer()->toHeaderValue($if_match);\n }\n // path params\n \n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'DELETE',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 500:\n $data = \\Swagger\\Client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\WebServiceError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function delete($type, $id);", "function basiclti_delete_type($id){\r\n\tdelete_records('basiclti_types', 'id', $id);\r\n\tdelete_records('basiclti_types_config', 'typeid', $id);\r\n}", "public function deleteOperationalStatusTypeByIdWithHttpInfo($id, $if_match = null)\n {\n \n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteOperationalStatusTypeById');\n }\n \n // parse inputs\n $resourcePath = \"/operationalStatusTypes/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n // header params\n \n if ($if_match !== null) {\n $headerParams['If-Match'] = $this->apiClient->getSerializer()->toHeaderValue($if_match);\n }\n // path params\n \n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'DELETE',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 500:\n $data = \\Swagger\\Client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\WebServiceError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function removeFromIndexByTypeAndId($type, $id);", "public function delete_account_type($id){\n $account_type = AccountType::find($id)->delete();\n return response()->json('Account Type successfully deleted', 200);\n }", "function og_micro_type_delete($info) {\n variable_del('og_group_type_' . $info->machine_name);\n variable_del('og_group_content_type_' . $info->machine_name);\n}", "public function deleteTrainingTypeById($param)\n {\n $id = $param['id'];\n\n $result = TrainingTypeTable::deleteById($id);\n\n if ($result['rowCount']) {\n http_response_code(204);\n } else {\n if($result['data']['1'] && $result['data']['2']){\n http_response_code(400);\n echo json_encode(array(\n 'message' => Constant::cannotDelete . Constant::objectNames['trainingType']\n ));\n } else {\n http_response_code(404);\n echo json_encode(array(\n 'message' => Constant::notFoundText . Constant::objectNames['trainingType']\n ));\n }\n }\n }", "public function deleteAssessmentIdentificationSystemTypeById($id, $if_match = null)\n {\n list($response, $statusCode, $httpHeader) = $this->deleteAssessmentIdentificationSystemTypeByIdWithHttpInfo ($id, $if_match);\n return $response; \n }", "public function removeFromIndexByTypeAndId($type, $id)\n {\n $this->elasticsearch->delete(\n [\n 'index' => $this->indexName,\n 'type' => $type,\n 'id' => $id,\n ]\n );\n }", "public function postOldEthnicityTypes($old_ethnicity_type)\n {\n list($response, $statusCode, $httpHeader) = $this->postOldEthnicityTypesWithHttpInfo ($old_ethnicity_type);\n return $response; \n }", "public function delete_address_type($type_id){\n $address = AddressType::find($type_id)->delete();\n\n return response()->json('Address type successfully deleted', 200);\n }", "public function deleteNotifType(Request $request, $id) {\n $notif_type= NotifType::find($id);\n if (is_null($notif_type)) {\n return response()->json([\n 'success' => false,\n 'statusCode' => 404,\n 'message' => 'Notification Type not found']);\n }\n $notif_type->delete();\n return response()->json([\n 'success' => true,\n 'statusCode' => 204,\n 'message' => 'Successfully deleted notification type',\n 'data' => null]);\n }", "function deleteType()\n {\n global $objDatabase, $_ARRAYLANG;\n\n if (isset($_GET['typeId'])) {\n $typeId=intval($_GET['typeId']);\n $objResult = $objDatabase->Execute(\"SELECT id FROM \".DBPREFIX.\"module_news WHERE typeid=\".$typeId);\n\n if ($objResult !== false) {\n if (!$objResult->EOF) {\n $this->strErrMessage = $_ARRAYLANG['TXT_TYPE_NOT_DELETED_BECAUSE_IN_USE'];\n }\n else {\n if ($objDatabase->Execute(\n \"DELETE tblC, tblL\n FROM \".DBPREFIX.\"module_news_types AS tblC\n INNER JOIN \".DBPREFIX.\"module_news_types_locale AS tblL ON tblL.type_id=tblC.typeid\n WHERE tblC.typeid=\".$typeId\n ) !== false\n ) {\n $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_DELETED_SUCCESSFUL'];\n } else {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n }\n }\n }\n }\n }", "public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('SkaphandrusAppBundle:SkSexType')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find SkSexType entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('sex_admin'));\n }", "public function deleteType($typeId) {\n\t\tthrow new CmisNotImplementedException(\"deleteType\");\n\t}", "public function Ethnicity($optParams = array()) {\n $params = array();\n $params = array_merge($params, $optParams);\n $data = $this->__call('Ethnicity', array($params));\n return $data;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
read count file and add 1 to count.
function nextcounting(){ $countfile="KKDEV_OBTING_COUNT";//config:file to record how many keys used. if (file_exists($countfile)){ $file = fopen($countfile, "r"); $counts = fgets($file); fclose($file); $file = fopen($countfile, "w"); fputs($file, intval($counts) + 1); fclose($file); return $counts; } else{ $file = fopen($countfile, "w"); fputs($file, "1"); fclose($file); return 0; } }
[ "function putCount() {\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n // Opens countlog.data to change new hit number\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"w\");\n fwrite($datei, $count + 1);\n fclose($datei);\n return true;\n }", "function incrementFile($filename): int\n{\n // if the file exists\n if (file_exists($filename)) {\n // open the file for reading and writing\n $fp = fopen($filename, \"r+\") or die(\"Failed to open the file.\");\n // lock the file so it can't be opened by another user\n flock($fp, LOCK_EX);\n // read the file and add 1\n $count = fread($fp, filesize($filename)) + 1;\n // delete the contents\n ftruncate($fp, 0);\n // go to the beginning of the file\n fseek($fp, 0);\n // write the new count\n fwrite($fp, $count);\n // unlock the file\n flock($fp, LOCK_UN);\n // close the file\n fclose($fp);\n }\n // create the file if it doesn't exist\n else {\n // set the contents of the file to the number 1\n $count = 1;\n file_put_contents($filename, $count);\n }\n // return the current file contents\n return $count;\n}", "function GetCount( $file, $increment = true )\r\n{\r\nif( !($fp = fopen( $file, \"r\" )) )\r\n{\r\nprint \"\\nError reading counter file: $file.\\n\";\r\n$count = 0;\r\n}\r\nelse\r\n{\r\n$count = strtok(fgets($fp,80), \" \");\r\n$time = strtok(\" \");\r\nfclose($fp);\r\n}\r\n\r\nif( !$increment )\r\nreturn $count;\r\n\r\n$count++;\r\n\r\nif( !$time )\r\n$time = time();\r\n\r\nif( !($fp = fopen( $file, \"w\" )) )\r\n{\r\nprint \"\\nError writing counter file: $file.\\n\";\r\n}\r\nelse\r\n{\r\nfwrite($fp, sprintf( \"%d %d\", $count, $time ));\r\nfclose($fp);\r\n}\r\nreturn $count;\r\n}", "function _conn_log_file() {\r\n if (file_exists('count_feed.txt')) \r\n {\r\n $fil = fopen('count_feed.txt', 'r');\r\n $dat = fread($fil, filesize('count_feed.txt')); \r\n //echo $dat+1;\r\n fclose($fil);\r\n $fil = fopen('count_feed.txt', 'w');\r\n fwrite($fil, $dat+1);\r\n }\r\n\r\n else\r\n {\r\n $fil = fopen('count_feed.txt', 'w');\r\n fwrite($fil, 1);\r\n //echo '1';\r\n fclose($fil);\r\n }\r\n}", "public function incrementReadCount()\n {\n $this->readCount++;\n }", "function counter(){\t//function counter\nglobal $filename;\t//set global variabel $filename \nif(file_exists($filename)){\t//jika file counter.txt ada\n$value = file_get_contents($filename);\t//set value = nilai di notepad\n}else{\t//jika file counter.txt tidak ada maka akan membuat file counter.txt\n$value = 0;\t//kemudian set value = 0\n}\nfile_put_contents($filename, ++$value);\t//menuliskan kedalam file counter.txt value+1\n}", "function InsertCount( $file, $increment = true )\r\n{\r\nprint GetCount( $file, $increment );\r\n}", "function txt_counter($filename,$add=FALSE,$fixvalue=FALSE)\n\t\t{\n\t\t\tif(is_file($filename) ? TRUE : touch($filename))\n\t\t\t{\n\t\t\t\tif(is_readable($filename) && is_writable($filename))\n\t\t\t\t{\n\t\t\t\t\t$fp = @fopen($filename, 'r');\n\t\t\t\t\tif($fp)\n\t\t\t\t\t{\n\t\t\t\t\t\t$counter = (int)trim(fgets($fp));\n\t\t\t\t\t\tfclose($fp);\n\n\t\t\t\t\t\tif($add)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($fixvalue !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$counter = (int)$fixvalue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$counter++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$fp = @fopen($filename, 'w');\n\t\t\t\t\t\t\tif($fp)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfputs($fp,$counter);\n\t\t\t\t\t\t\t\tfclose($fp);\n\t\t\t\t\t\t\t\treturn $counter;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse return FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $counter;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse return FALSE;\n\t\t\t\t}\n\t\t\t\telse return FALSE;\n\t\t\t}\n\t\t\telse return FALSE;\n\t\t}", "function updateHitCounter()\n\t{\n\t\t$count = getApiHitCount();\n\t\t$count = $count + 1;\n\t\t$myfile = fopen(\"hitcounter.txt\", \"w\") or die(\"File Doesn't exist\");\n\t\t$txt = $count;\n\t\tfwrite($myfile, $txt);\n\t\tfclose($myfile);\n\t}", "function hit_count(){\n$ip_address = $_SERVER['REMOTE_ADDR'];\n \n $ip_file=file('ip.txt');\n foreach($ip_file as $ip){\n $ip_single= trim($ip);\n if($ip_address==$ip_single){//ip adress should be different for this to work\n $found= true;\n break;\n }else{\n $found = false;\n \n }\n }\n if($found==false){\n $filename= 'counter.txt';\n $handle = fopen($filename,'r');\n $current = fread($handle, filesize($filename));\n\n fclose($handle);\n$current_increment = $current + 1;\n $handle = fopen($filename,'w');//will increment counter if file opens\n fwrite($handle,$current_increment);\n fclose($handle);\n \n $handle = fopen('ip.txt','a');//will append ip address to ip.txt file\n fwrite($handle,$ip_address.\"\\n\");\n fclose($handle);\n \n } else {\n echo \"Sorry bitch \";\n } \n}", "function getCount() {\n // $countFile = 'data.txt'; // Change to the log file name\n $lines = file($GLOBALS['countFile']);//file in to an array\n return $lines[0];\n }", "public function incrementCount()\n {\n $this->count++;\n }", "private function _increment_daily_count()\n\t{\n\t\t$now = time();\n\t\t$last_modified_time = filemtime($this->_daily_count_file);\n\t\t$daily_seconds = 24 * 60 * 60;\n\t\t$daily_count = $this->_get_daily_count();\n\n\t\t// Was the last modified time of the daily count file today?\n\t\tif ( $last_modified_time > ($now - ($now % $daily_seconds)) ) {\n\t\t\t$daily_count = intval($daily_count) + 1;\n\t\t} else {\n\t\t\t// it was last modified before today - let's restart the count\n\t\t\t$daily_count = 0;\n\t\t}\n\t\t// update the daily count file\n\t\t$handle = fopen($this->_daily_count_file, 'w+') or die('Cannot open file: ' . $this->_daily_count_file);\n\t\tfwrite($handle, $daily_count);\n\t\tfclose($handle);\n\t}", "public function count()\n {\n $total = 0;\n foreach ($this->file as $line)\n {\n $total++;\n }\n if ($this->useFirstRecordAsHeader && $total > 0)\n {\n $total--;\n }\n return $total;\n }", "function loginCounterOnSite($fileName){\r\n// Check for the presence of a file with a counter\r\n// If the file is missing then create the file. Set counter to 0\r\n\tif(!file_exists($fileName)){\r\n\t\tfopen($fileName, \"w\");\r\n\t\t$count=0;\r\n\t}\r\n\t// Read the counter value from the file\r\n\telse{\r\n\t\t$count=file_get_contents($fileName, true);\r\n\t}\r\n\techo\"<h1 style=\\\"color:green\\\">Number of visits to the site: $count</h1>\";\r\n\t// Save the new counter value\r\n\tfile_put_contents($fileName, ++$count);\r\n}", "function incrementCount() {\n $x = 1 + getCount();\n saveCount($x);\n }", "function count() {\r\n\t\t$linecount = 0;\r\n\t\t$handle = fopen($this->dir.DIRECTORY_SEPARATOR.$this->file, \"r\");\r\n\t\twhile(!feof($handle)){\r\n\t\t\t$line = fgets($handle);\r\n\t\t\t$linecount++;\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t\t$line = null;\r\n\t\treturn $linecount-1; //last line is empty\r\n\t}", "public function incrementCount(): void\n {\n ++$this->count;\n }", "public function incrementCounter();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for getChangeField .
public function testGetChangeField() { }
[ "public function testAlterChangeFields() {\n $query = $this->connection->select('test');\n $name_field = $query->addField('test', 'name');\n $age_field = $query->addField('test', 'age', 'age');\n $query->orderBy('name');\n $query->addTag('database_test_alter_change_fields');\n\n $record = $query->execute()->fetch();\n $this->assertEquals('George', $record->{$name_field}, 'Correct data retrieved.');\n $this->assertFalse(isset($record->$age_field), 'Age field not found, as intended.');\n }", "protected function areFieldChangeFunctionsValid() {}", "public function test__fcpoCheckUpdateField_AlreadyChanged()\n {\n $blMockUserChanged = true;\n $sMockDbField = 'someDbField';\n $sMockType = 'kls';\n $sMockDynValueField = 'someDynValueField';\n $aMockDynValue = array(\n 'fcpo_' . $sMockType . '_fon' => '123456',\n 'fcpo_' . $sMockType . '_birthday' => 'someBirthday',\n 'fcpo_' . $sMockType . '_personalid' => 'someId',\n 'fcpo_' . $sMockType . '_sal' => 'someSal',\n 'fcpo_' . $sMockType . '_addinfo' => 'someAddinfo',\n 'fcpo_' . $sMockType . '_del_addinfo' => 'someDelAddinfo',\n );\n\n $oMockUser = oxNew('oxUser');\n $oTestObject = oxNew('fcPayOnePaymentView');\n\n $this->assertEquals(true, $oTestObject->_fcpoCheckUpdateField($blMockUserChanged, $sMockType, $aMockDynValue, $sMockDbField, $sMockDynValueField, $oMockUser));\n }", "public function getFieldUpdateEvent();", "public function isFieldChanged()\n {\n return $this->internalInitialValue !== $this->internalValue;\n }", "public function changeField( $table, $old_field, $new_field, $type='', $default=NULL );", "function getField($name) {\n if (!isset($this->changes[$name])) {\n $field = $this->model::getMeta()->getField($name);\n $this->changes[$name] = new FieldDescriptor($field, $name, self::TYPE_REPLACE);\n }\n return $this->changes[$name];\n }", "public function hasChangedField() {\n return $this->hasChangedField;\n }", "public function testDifferentModifiedByField() {\n\t\t// Stop here and mark this test as incomplete.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function executeEdit_field()\n {\n }", "function update_field($field)\n {\n }", "public static function getUpdatedByField();", "public function getOldValue($field)\n {\n \t$this->_assertValidField($field);\n\n return $this->_entityChangeSet[$field][0];\n }", "public function testCustomFieldsGet()\n {\n }", "function type_delta($fieldname, $nid, $uid, $orig_field_name=\"\", $reference=0) {\n\n\tglobal $src_db;\n\n\t$sql_tmp = \"SELECT c.{$orig_field_name} AS id, c.delta, c.vid \n\t\t\t\tFROM ur_content_field_{$fieldname} c\n\t\t\t\tWHERE c.nid={$nid} AND c.{$orig_field_name} IS NOT NULL\";\t\t\n\n\t$fieldname = \"st_{$fieldname}\";\n//echo \"<p>$sql_tmp</p>\";\n\t$res = mysql_query($sql_tmp, $src_db);\n\twhile($row_tmp = mysql_fetch_assoc($res)) {\n\t\t$fieldvalue = $row_tmp['id'];\n\t\t$rev_id = $row_tmp['vid'];\n\t\t$delta = $row_tmp['delta'];\n\t\tupdate_field($fieldname, $nid, $fieldvalue, $rev_id, $delta, $reference);\n\t}\n}", "public function _field() {\n }", "public function getModified($field = null);", "public function getUserChange();", "public function testUpdateCustomField()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return MRR for the given billing period.
public function getMrrValue(BillingPeriodInterface $billing_period): float;
[ "private function getBillingMonth() {\n $this->billingMonth = $this->billingMonthRepository->findOneByDate($this->monthDate);\n }", "public function monthlyRecurringRevenue();", "public function getbillingperiodAction() {\r\n if ($this->_request->isPost()) {\r\n $filter = new Zend_Filter_StripTags();\r\n $id = $filter->filter($this->_request->getPost('customer_id'));\r\n\r\n $membersTable = new members();\r\n if ($id > 0) {\r\n $members_data = $membersTable->fetchRow($membersTable->select()->where('id=' . $id));\r\n\r\n //echo $members_data['plan_start_date'];\r\n $thisusermonth = abs((time() - (strtotime($members_data['plan_start_date']))) / (60 * 60 * 24 * 30));\r\n\r\n $plan_start_date = explode('-', $members_data['plan_start_date']);\r\n $plan_start_month = $plan_start_date[1];\r\n $plan_start_months = $plan_start_date[1];\r\n $plan_start_day = explode(' ', abs($plan_start_date[2]));\r\n $plan_start_day = abs($plan_start_day[0]);\r\n $plan_start_days = $plan_start_day;\r\n $current_year = date('Y');\r\n\r\n //********START DATE FOR BILLING *********************************//\r\n $start_date_value[0] = strtotime($current_year . '-' . (date('m') - 1) . '-' . $plan_start_day);\r\n $plan_start_month = (date('m') - 1);\r\n //$plan_start_month=(date('m')-1);\r\n\r\n $end_date_value[0] = strtotime(date('Y-m-d')) - (24 * 60 * 60);\r\n // STARTING DATE OR BILLING DATE FOR CURRENT MONTH.\r\n for ($i = 1; $i < $thisusermonth; $i++) {\r\n $plan_start_month--;\r\n if ($plan_start_month < 1) {\r\n if ($plan_start_month == 0) {\r\n $plan_start_month_year_changed = 12;\r\n\r\n $start_date_value[$i] = strtotime(($current_year - 1) . '-' . ($plan_start_month_year_changed) . '-' . $plan_start_day);\r\n } else {\r\n\r\n $start_date_value[$i] = strtotime(($current_year - 1) . '-' . ($plan_start_month_year_changed - (abs($plan_start_month))) . '-' . $plan_start_day);\r\n }\r\n } else {\r\n $start_date_value[$i] = strtotime(($current_year) . '-' . ($plan_start_month) . '-' . $plan_start_day);\r\n }\r\n }\r\n\r\n //print_r($start_date_value); exit;\r\n //********END DATE FOR BILLING *********************************//\r\n // END DATE OR BILLING DATE FOR CURRENT MONTH.\r\n $plan_start_months = (date('m') - 1);\r\n\r\n for ($i = 1; $i < $thisusermonth; $i++) {\r\n\r\n if ($plan_start_months < 1) {\r\n if ($plan_start_months == 0) {\r\n $plan_start_month_year_changed = 12;\r\n $end_date_value[$i] = strtotime(($current_year - 1) . '-' . ($plan_start_month_year_changed) . '-' . $plan_start_days) - (24 * 60 * 60);\r\n ;\r\n } else {\r\n $end_date_value[$i] = strtotime(($current_year - 1) . '-' . ($plan_start_month_year_changed - (abs($plan_start_months))) . '-' . $plan_start_days) - (24 * 60 * 60);\r\n }\r\n } else {\r\n $end_date_value[$i] = strtotime(($current_year) . '-' . $plan_start_months . '-' . $plan_start_days) - (24 * 60 * 60);\r\n }\r\n $plan_start_months--;\r\n }\r\n //print_r($end_date_value);\r\n //********END DATE FOR BILLING *********************************//\r\n?>\t\r\n <option value=\"0\">Select</option>\r\n<? for ($report_date = 0; $report_date < $thisusermonth; $report_date++) {\r\n ?>\r\n <option value='fromdate/<?php echo date('m-d-Y', $start_date_value[$report_date]); ?>/todate/<?php echo date('m-d-Y', $end_date_value[$report_date]) ?>'><?php echo date('M j, Y', $start_date_value[$report_date]); ?> - <?php echo date('M j, Y', $end_date_value[$report_date]); ?></option>\r\n<? } ?>\r\n<?\r\n }\r\n }\r\n exit;\r\n }", "function getMonthlyBillingType() {\n return($this->monthlyBillingType);\n }", "public function monthlyPayment() {\n if ($this->monthlyPayment != null) {\n return $this->monthlyPayment;\n }\n\n $i = 1 / (1 + ($this->rate / $this->aP));\n $this->monthlyPayment = ((1 - $i) * $this->amount) / ($i * (1 - pow($i, $this->tP)));\n return $this->monthlyPayment;\n }", "public function repaidPerMonthWithRange()\n {\n return DB::select('SELECT DATE_FORMAT(date_paid, \\'%b %y\\') as month, \n SUM(amount) as amount\n FROM billings \n WHERE ' . $this->whereBetweenParams() . ' AND status = \\'paid\\'\n GROUP BY DATE_FORMAT(date_paid, \\'%b %y\\') \n ORDER BY date_paid');\n }", "public function setMonth() {\n\t\t$this->_billingPeriod = self::MONTH;\n\t\treturn $this;\n\t}", "public function getRevenueByMonth();", "public function get_recurring_period(){\n\t\treturn $this->payment['recurring_period'];\n\t}", "function wpsight_get_rental_period( $period ) {\n\n\t$rental_periods = wpsight_rental_periods();\n\t\n\treturn $rental_periods[$period];\n\t\n}", "function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }", "public function getBillPmt()\n {\n return $this->hasOne(BillingPmt::className(), ['bill_pmt_id' => 'bill_pmt_id']);\n }", "public function beingMonthly(): PlanQueryContract;", "public function getMaxPaymentsPerPeriod() : string;", "public static function calculate($mrr)\n {\n return $mrr * 12;\n }", "public static function mlmWithdrawalPeriod();", "public function testRetireSetsMrrValueToZero()\n {\n $this->insight->accounts->addPaid(12345, new PlanL(), new Monthly());\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(99, $row['mrr_value']);\n\n $this->insight->accounts->retire(12345);\n\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(0, $row['mrr_value']);\n }", "public function getBillingToken();", "public function getMonthCard()\n {\n return $this->get(self::_MONTH_CARD);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all Bank entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('BackendBundle:Bank')->findAll(); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $entities, $this->get('request')->query->get('page', 1), 10); return $this->render('BackendBundle:Bank:index.html.twig', array( 'entities' => $pagination )); }
[ "public function listBank()\n\t{\n\t\t$banks = Cekmutasi::bank()->list();\n\n\t\tdd($banks);\n\t}", "public function getAccountsList() {\r\n return $this->_em->getRepository(\"CommercialBankAccount\")->findAll();\r\n }", "public function getBankList();", "public function index()\n\t{\n\t\t$bankaccounts = $this->repo->all();\n\n\t\treturn $this->rest->response(200, $bankaccounts);\n\t}", "public function actionIndex()\n {\n $searchModel = new BankAccountSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'contacts' => Contact::getNameIndex()\n ]);\n }", "public function actionBankList()\n {\n if( ! $this->request->isAjax) {\n return $this->render('bank-list');\n }\n $params = $this->request->post();\n $params['deleted_at'] = '0';\n $query = MerchantBank::filters(['id', 'platform_id', 'merchant_number', 'paytype', 'status', 'deleted_at'], $params)->filterResource(AdminResource::TypePlatform);\n $pagination = Render::pagination((clone $query)->count());\n $data['infos'] = $query->orderBy(['id' => 'desc'])->offset($pagination->offset)->limit($pagination->limit)->asArray()->all();\n $data['page'] = Render::pager($pagination);\n return $this->json($data);\n }", "public function getBankListAction()\n {\n $adapter = $this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');\n $sql = \"SELECT siteId, bankName FROM bank\";\n $statement = $adapter->createStatement($sql, []);\n $result = $statement->execute();\n $count = $result->count();\n\n if ($count > 0) {\n $banks = [];\n\n foreach ($result as $item) {\n $banks[] = $item;\n }\n\n return [\n \"count\" => $count,\n \"banks\" => $banks\n ];\n } else {\n return [\n \"count\" => 0,\n \"banks\" => []\n ];\n }\n }", "function _erpal_invoice_helper_get_bank_accounts() {\n return _erpal_basic_helper_get_bank_accounts(); //this will return an array of entities\n}", "public function getBankList()\n {\n return $this->pse->getBankList();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PagosBundle:Banco')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function allAction()\n {\n $objectManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n $branchModel = new BranchModel($objectManager);\n $branches = $branchModel->getAllBranches();\n\n return $this->constructPaginatedView($branches, 'All Branches');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $accounts = $em->getRepository('AppBundle:Account')->findAll();\n\n return $this->render('account/index.html.twig', array(\n 'accounts' => $accounts,\n ));\n }", "public function indexAction() {\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$entities = $em->getRepository('GuepeCrmBankBundle:BankProduct')\n\t\t\t\t->findAll();\n\n\t\treturn array('entities' => $entities);\n\t}", "public function actionBank()\n\t{\n\t\t$db = User::qUserbank();\n\n\t\tforeach($db as &$item)\n\t\t{\n\t\t\t$item['balance'] = round($item['balance'],2);\n\t\t}\n\n\t\t$data=new ArrayDataProvider([\n\t\t\t'allModels'=>$db,\n\t\t\t'sort'=>[\n\t\t\t\t'attributes'=>[\n\t\t\t\t\t'id',\n\t\t\t\t\t'name'\n\t\t\t\t],\n\t\t\t\t//'defaultOrder'=>['name'=>SORT_ASC]\n\t\t\t],\n\t\t\t'pagination'=>[\n\t\t\t\t'pageSize'=>500,\n\t\t\t],\n\t\t]);\n\n\n\t\treturn $this->render('bank',['data'=>$data]);\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $suppliers_banks = $em->getRepository('AppBundle:suppliers_bank')->findAll();\n\n return $this->render('suppliers_bank/index.html.twig', array(\n 'suppliers_banks' => $suppliers_banks,\n ));\n }", "public function index()\n\t{\n\t\t$data['data'] = $this->bank_account_model->getBankAccount();\n\t\t$this->load->view('bank_account/list',$data);\n\t}", "public function meGetBankAccounts();", "public function glAccountList()\r\n {\r\n $criteria = array(\r\n 'isActive' => 1\r\n );\r\n $sort_criteria = array(\r\n 'accountNumber' => 'ASC'\r\n );\r\n\r\n $currency_list = $this->doctrineEM->getRepository('Application\\Entity\\FinAccount')->findBy($criteria, $sort_criteria);\r\n return $currency_list;\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n // $all = $em->getRepository('NvCargaBundle:Bill')->findBy(['canceled'=>FALSE, 'maincompany'=> $maincompany])\n $all = $em->getRepository('NvCargaBundle:Bill')->createQueryBuilder('b')\n ->where('b.status != :status')\n ->andwhere('b.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany, 'status' => 'ANULADA'))\n ->orderBy('b.number', 'DESC')\n ->setMaxResults(500)\n ->getQuery()\n ->getResult();\n if ($type == \"MASTER\") {\n $entities = $all;\n } else {\n $entities = [];\n foreach ($all as $entity) {\n $guide = $entity->getGuides()->last();\n if ($guide->getAgency() === $agency()) {\n $entities[] = $entity;\n }\n }\n }\n return array(\n 'entities' => $entities,\n );\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$Message = "SELECT FROM Message WHERE ArticleNumber = '" . $article . "' order by Time desc ;" ;
function message($article) { // $result = $this->databasecalling($Message) ; $pdo = new databasecalling_mod ; $pdolink = $pdo->startConnection() ; $Message = "SELECT * FROM `Message` WHERE `ArticleNumber` = :article order by `Time` desc ;" ; $prepare = $pdolink->prepare($Message); $prepare->bindParam(':article',$article); $prepare->execute(); $result = $prepare->fetchAll(PDO::FETCH_ASSOC); $pdo->closeConnection(); return $result ; }
[ "public function getLastMessage($pollId){\r\n $getLastMessage = $this->query(\"SELECT message_content FROM messages WHERE poll_id = '$pollId' ORDER BY message_date DESC LIMIT 1\");\r\n return ($getLastMessage);\r\n}", "function getMessage($delete = true, $lastMessage = true){\n $order = $lastMessage ? 'ASC' : 'DESC';\n $record = $this->db->query(\"SELECT * FROM Messages ORDER BY id {$order} LIMIT 1;\"); \n $record = $this->db->fetchNextObject($record);\n if($delete){\n $this->db->query(\"DELETE FROM Messages WHERE id = '{$record->id}' \");\n } \n return $record;\n }", "public function getArticle(){\r\n\t\t$sql=\"select * from article where time_at > '\" . date(\"Y-m-d\", time() - 3600 * 24 *21) .\"'order by reply_number desc limit 0,10\";\r\n\t\t$this->article15=$this->query($sql);\r\n\t\t//echo $sql;\r\n\t\t$time = $this->year.\"-\".$this->month.\"-\".$this->day;\r\n\t\t$timeNext = date(\"Y-m-d\", strtotime($time) + 24 * 3600);\r\n\t\t$sql=\"select * from article where city_id=\" . $this->city. \" and time_at between '\" . $time . \"' and '\" . $timeNext . \"' order by read_number desc limit 0,10\";\r\n\t\t$this->article=$this->query($sql);\r\n\t}", "function find_chat_messages($msg)\n{\n global $db;\n $sql = \"SELECT * FROM messages where (\";\n $sql .= \" sent_by='\" . $msg['sent_by'] . \"' AND \";\n $sql .= \" sent_to='\" . $msg['sent_to'] . \"') OR (\";\n $sql .= \" sent_by='\" . $msg['sent_to'] . \"' AND \";\n $sql .= \" sent_to='\" . $msg['sent_by'] . \"') \";\n $sql .= \"order by msg_id,text_time \";\n $result = mysqli_query($db, $sql);\n confirm_result_set($result);\n return $result;\n}", "function displayMessages($messageDB) {\n \n $result = $messageDB->findListByIdSorted(true,$_GET['employee']);\n foreach($result as $row) {\n echo '<tr><td>' . date(\"Y-M-d\", strtotime($row['MessageDate'])) . '</td><td>' . $row['Category'] . '</td><td>' . \n $row['FirstName'] . \" \" . $row['LastName'] . '</td><td style=\"text-align:left;\">' . substr($row['Content'], 0, 39) . '</td></tr>';\n }\n}", "function getLatestUpdates($articleID) {\n\t\tglobal $connection;\n\t\t$select = \"SELECT * FROM event_log INNER JOIN users ON event_log.user_id=users.user_id \n\t\t\t\t\tWHERE assoc_id = $articleID ORDER BY event_log.date_logged DESC LIMIT 2\";\n\t\t\t\t\t\n\t\tif(!$result = mysql_query($select, $connection)) {\n\t\t\tdie('Error:'.mysql_error());\n\t\t}\n\t\t\n\t\t$updates = \"\";\n\t\twhile($row = mysql_fetch_array($result, MYSQL_ASSOC)) {\n\t\t\t$updates .= '<b>'.date(\"D, M d, Y\",strtotime($row['date_logged'])).\" - \";\n\t\t\t$updates .= $row['first_name'].' '.$row['last_name'].\":</b><br> \";\n\t\t\t$updates .= $row['message'].'<br>';\n\t\t}\n\t\t\n\t\treturn $updates;\n\t}", "function simplechat_chat_load_latest_messages($node) {\n if (preg_match('/^\\d+$/', $node->chat->previous_messages_display_count)) {\n $limit = $node->chat->previous_messages_display_count;\n }\n else {\n $limit = 10;\n }\n $sql = \"SELECT cm.*, u.name, 0 AS guest_id\n FROM {simplechat_msg} cm\n INNER JOIN {users} u ON u.uid = cm.uid\n WHERE cm.ccid = :ccid \n ORDER BY cm.cmid DESC\n LIMIT $limit\";\n $messages = simplechat_chat_load_messages_helper($sql, array(':ccid' => $node->nid));\n return array_reverse($messages, TRUE);\n}", "function sql_message_of_id_message($id_message)\r\n {\r\n return mysql_fetch_assoc(mysql_query(\"select * from STUL_MESSAGE where MESSAGE_ID='\".$id_message.\"'\"));\r\n }", "public function show_recent_notice(){\n $sql = \"SELECT * \n FROM `tbl_notice` \n ORDER BY notice_publication_time DESC \n LIMIT 4\";\n \n if(mysql_query($sql)){\n $result = mysql_query($sql);\n return $result;\n }\n }", "function messages()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->array_query( $message_array, \"SELECT ID, PostingTime FROM\r\n eZForum_Message\r\n WHERE ForumID='$this->ID' AND IsTemporary='0'\r\n ORDER BY PostingTime DESC\" );\r\n\r\n $ret = array();\r\n\r\n foreach ( $message_array as $message )\r\n {\r\n $ret[] = new eZForumMessage( $message[$db->fieldName( \"ID\" )] );\r\n }\r\n\r\n return $ret;\r\n }", "function getMessage($id)\r\n{\r\n global $announcement_table, $db;\r\n\r\n $sql = \"select message from $announcement_table where id=$id\";\r\n $result = $db->query($sql);\r\n $row = $db->fetch_array($result);\r\n\r\n return $row[0];\r\n}", "public function retrieve_messages_query($channel_id,$count){\n $query = \"select * from (SELECT * FROM `channel_messages` where channel_id='\" . $channel_id . \"' and message_id<'\".$count.\"' ORDER BY timestamp DESC LIMIT 15)a order by timestamp ASC\";\n\n return $query;\n }", "function getMessageLastId(){\n $sql = \"SELECT idMessage FROM Message ORDER BY idMessage ASC\";\n $Messages = pg_query($sql); \n while($Message = pg_fetch_object($Messages)):\n $lastid = $Message->id_Message;\n endwhile;\n return $lastid;\n \n }", "function getSentMessages($db, $author) {\n $sql_get_messages = 'SELECT RECIP, MESSAGE_TITLE, MESSAGE_TEXT FROM MESSAGES_P2 WHERE AUTHOR = \"' \n . sanitizeString($db, $author) . '\" ORDER BY ID DESC'; // prepare the sql statement to find sent messages\n $query_get_messages = $db->query($sql_get_messages); // query the database\n $output = ''; // intitialize output\n while ($row = $query_get_messages->fetch_assoc()) { // while results exists format and append them to output\n $output .= '<div class=\"panel panel-default postcard-panel\"><div class=\"panel-heading\">\"' . $row['MESSAGE_TITLE']\n . '\" sent to ' . $row['RECIP'] \n . '</div><div class=\"body\">' . $row['MESSAGE_TEXT'] . '</div></div>';\n }\n return $output; // return output\n}", "function msgQueue()\n{\n global $smspi;\n $sql = \"SELECT * FROM msg_queue WHERE 1 ORDER BY q_id DESC LIMIT 30;\";\n $q = $smspi->db->query($sql) or die( $smspi->db->error );\n $dat=[];\n while ($r=$q->fetch_assoc()) {\n $dat[]=$r;\n }\n return $dat;\n}", "function read_last(){\n\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE times =(SELECT MAX(times) FROM \" . $this->table_name . \" WHERE m_id=\" . $this->m_id . \" GROUP BY m_id)\";\n\t// prepare query statement\n $stmt = $this->conn->prepare($query);\n\t// execute query\n $stmt->execute();\n return $stmt;\n}", "public function read_last_message_allgroups(){\n $sql=\"SELECT users.id, users.first_name, users.username, messages.message, messages.sent_at FROM users JOIN messages on messages.user_id=users.id WHERE messages.group_id=:id ORDER by messages.sent_at DESC LIMIT 1;\";\n\n // prepare the data \n $stmt=$this->conn->prepare($sql);\n\n // Bind param \n $stmt->bindParam(\":id\",$this->id);\n\n $stmt->execute();\n return $stmt;\n\n}", "function get_recent_post($num){\n $sql = \"SELECT * FROM post ORDER BY post_date DESC LIMIT $num\";\n return $this->query($sql);\n}", "function getLatest()\n {\n $this->db->order_by('PubDate','DESC');\n $query = $this->db->get('Articles', 400);\n \n return $query->result();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle storing boss made from TempUser
public function tempUserBossRegistrationStore() { $rules = array( 'name' => 'required|string|min:4|max:24', 'surname' => 'required|string|min:3|max:24', 'boss_email' => 'required|string|email|unique:users,email|max:33', 'boss_phone_number' => 'required|numeric|regex:/[0-9]/|min:7', 'password' => 'required|min:7|confirmed', 'property_name' => 'required|min:3', 'street' => 'required|min:3', 'street_number' => 'required', 'house_number' => 'required' ); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::to('temp-boss/register/' . Input::get('register_code')) ->withErrors($validator); } else { $tempBossEntity = TempUser::where([ 'register_code' => Input::get('register_code'), 'isBoss' => 1 ])->first(); $tempBossPropertyEntity = TempProperty::where('temp_user_id', $tempBossEntity->id)->first(); if ($tempBossEntity !== null && $tempBossPropertyEntity !== null) { $boss = new User(); $boss->name = Input::get('name'); $boss->surname = Input::get('surname'); $boss->email = Input::get('boss_email'); $boss->phone_number = Input::get('boss_phone_number'); $boss->password = Hash::make(Input::get('password')); $boss->isBoss = 1; $boss->save(); if ($boss !== null) { $property = new Property(); $property->name = Input::get('property_name'); $property->slug = str_slug(Input::get('property_name')); $property->street = Input::get('street'); $property->street_number = Input::get('street_number'); $property->house_number = Input::get('house_number'); $property->city = "Warszawa"; $property->boss_id = $boss->id; $property->save(); if ($property !== null) { // delete temporary entities $tempBossEntity->delete(); $tempBossPropertyEntity->delete(); $this->addCalendarToPropery($property->id, 12); \Mail::to($boss)->send(new AdminTempBossCreate2ndStep($boss)); auth()->login($boss); return redirect()->route('home')->with('success', 'Gratulacje, Twoje konto wraz z lokalizacją zostały stworzone!'); } else { $boss->delete(); } } return redirect('/temp-boss/register')->with([ 'error' => 'Coś poszło nie tak', 'code' => Input::get('register_code') ]); } return redirect()->route('welcome'); } }
[ "public function storeShinticketUser(){\n \n $data = array('userId' => $this->userId,\n 'idCustomer' => $this->idCustomer,\n );\n \n if(empty($this->oldUserId) && empty($this->oldCustomerId)) {\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->insert($this->table_name, $data);\n } else {\n \n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('userId', $this->oldUserId);\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idCustomer', $this->oldCustomerId);\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update($this->table_name, $data); \n }\n \n }", "function createTempuser()\n\t{\n\t\t// check dataArr for current username, password, password_again\n\t\tif ( ! trim( $this->dataArr[ 'username' ] ) )\n\t\t{\n\t\t\t// microsecond difference\n\t\t\t$tempuser\t\t\t= uniqid( 'visitor_' );\n\t\t\t$temppass\t\t\t= uniqid( '' );\n\n\t\t\t$this->dataArr[ 'username' ]\t\t= $tempuser;\n\n\t\t\t// create password from unique id, 6 char\n\t\t\t// create unique username from email\n\t\t\t$this->dataArr[ 'password' ]\t\t= $temppass;\n\t\t\t$this->dataArr[ 'password_again' ]\t= $temppass;\n\t\t}\n\n\t\tif ( ! trim( $this->dataArr[ 'endtime' ] ) )\n\t\t{\n\t\t\t// set endtime about x days later per\n\t\t\t// $this->conf[ 'tempuserTimelimit' ]\n\t\t\t$now\t\t\t\t= time();\n\t\t\t$later\t\t\t\t= $now\n\t\t\t\t\t\t\t\t\t+ ( $this->conf[ 'tempuserTimelimit' ]\n\t\t\t\t\t\t\t\t\t\t* 24 * 60 * 60 \n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t$this->dataArr[ 'endtime' ]\t= $later;\n\t\t}\n\t}", "function _timian_service_create_user($data)\n{\n $user = user_load_by_name($data['name']);\n\n if ($user) {\n if (!$user->status) {\n $user->status = \"1\";\n user_save($user);\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} activated\",\n ];\n\n } else {\n header(\"HTTP/1.0 409\");\n return [\n \"result\" => \"User {$data['name']} already exists\",\n ];\n }\n\n } else {\n\n $supplier_value = get_node_nid($data['birgi']); //get_node_nid_by_acronym($data['birgi']);\n\n $new_user = [\n 'name' => $data['name'],\n 'pass' => drupal_random_key(), // random password, user will be login trough sso\n 'mail' => $data['email'],\n 'status' => 1,\n 'init' => $data['email'],\n 'roles' => [\n DRUPAL_AUTHENTICATED_RID => 'authenticated user',\n 12 => 'suppliers',\n ],\n 'field_user_fullname' => [\n 'und' => [\n 0 => [\n 'value' => $data['name'],\n ],\n ],\n ],\n 'field_user_supplier' => [\n 'und' => [\n 0 => [\n 'value' => $supplier_value,\n ],\n ],\n ],\n ];\n user_save('', $new_user);\n\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} created\",\n ];\n }\n}", "public function save_user_basic()\r\n\t{\r\n\t\t\r\n\t}", "function jx_save_assign_user() {\n $user=$this->erpm->auth(ADMINISTRATOR_ROLE,true);\n $this->erpm->do_save_assign_user($user);\n }", "public function simulateUser() {}", "public function linkedinTempUserObject($obj){\n\t\t $email = $obj->emailAddress;\n\t\t $firstname = $obj->firstName;\n\t\t $lastname = $obj->lastName;\n\t\t $imagePath = $obj->pictureUrls->values[0];\n\n\t\t // creating json object to save in session.\n\t\t\t$objUser = '{\"email\":\"'.$email.'\",\"firstName\":\"'.$firstname.'\",\"lastName\":\"'.$lastname.'\",\"gender\":\"unknown\",\"imagePath\":\"'.$imagePath.'\",\"socialMediaId\":3}';\n\n\t\t\t$_SESSION[\"tempUser\"] = $objUser;\n\t \t}", "function eu4all_um_usercreated_handler($user){\n\tEU4ALL_UserModel::sendRegistrationEvent($user->username);\n\tEU4ALL_UserModel::setPersonalUserData($user->username);\n\t\n\treturn true;\n}", "public function saveMemberData()\n {\n $query = DB::query( Database::SELECT, 'SELECT save_user(:id,:name,:surname,:email,:pcode,:address,:country,:city)');\n $query->parameters(array(\n \":id\" => ( int ) $this->id,\n \":name\" => $this->name,\n \":surname\" => $this->surname,\n \":email\" => $this->email,\n \":pcode\" => $this->personal_code,\n \":address\" => $this->address,\n \":country\" => $this->country,\n \":city\" => $this->city\n ));\n \n $user_id = ( int ) $query->execute()->get( \"save_user\" );\n \n if( !empty( $user_id ) ){\n $this->set( 'id', $user_id );\n }\n }", "function _save_user_details()\n\t{\n\t\t$txn_id = $this->session->userdata('txn_id');\n\t\t$this->database->SaveUserIdOnCheckout($this->tank_auth->get_user_id(), $txn_id);\n\n\t\t//Address must be there else _validate_address() will fail\n\t}", "private function _createUser(){\r\n\r\n }", "protected function storeUser()\n {\n $this->repo->store($this->user);\n $this->flush();\n }", "public function save()\n {\n $this->storage->saveUser($this->id->getId(), $this->userName, $this->organization, $this->isAdmin());\n $this->authModule->saveNew();\n }", "private function createNewUser()\n {\n\n $name = (string) $this->ask('Name');\n $email = (string) $this->ask('E-Mail');\n $user = config('multi-tenant.user_class')::create([\n 'name' => $name,\n 'email' => $email,\n 'password' => bcrypt('tester'),\n ]);\n\n $add_to_tenant = $this->anticipate('Would you like to assign the user to a tenant?', ['Yes', 'No'], 'Yes');\n\n if ($add_to_tenant == 'Yes') {\n $headers = ['Name', 'ID'];\n $tenants = config('multi-tenant.tenant_class')::all('name', 'id');\n\n if($tenants->count() <= 0) {\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n } else {\n $this->table($headers, $tenants->toArray());\n\n $tenant_id = (int) $this->ask('Please enter the id of the desired tenant.');\n\n $tenant = config('multi-tenant.tenant_class')::findOrFail($tenant_id);\n\n $tenant->update(['owner_id' => $user->id]);\n\n $this->comment('The user ' . $user->email . ' is now the owner of ' . $tenant->name . ' with the password `tester`');\n }\n }\n else{\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n }\n\n }", "public function saveUser() {\n Database::executeQueryReturnSingle(\"UPDATE users \n SET user_name = ?, email = ?, user_password = ?, user_salt = ?, iterations = ?, access_level = ? \n WHERE user_id = ?\", \n array($this->name, $this->email, $this->password,\n $this->salt, $this->iterations, $this->access_level,\n $this->id));\n }", "public function saveUserInfo() {\n\t\t\tglobal $db;\n\n\t\t\t//Escapes out of special characters\n\t\t\t$this->first_name = $db->real_escape_string($this->first_name);\n\t\t\t$this->last_name = $db->real_escape_string($this->last_name);\n\t\t\t$this->username = $db->real_escape_string($this->username);\n\t\t\t$this->password = $db->real_escape_string($this->password);\n\t\t\t//encrypts password\n\t\t\t$this->password = password_hash($this->password, PASSWORD_BCRYPT, array(\n\t\t\t\t'cost' => 12\n\t\t\t));\n\t\t\t//create a query and fill it with passed values\n\t\t\t$save_query = \"INSERT INTO users (first_name, last_name, username, password) VALUES ( '{$this->first_name}', '{$this->last_name}', '{$this->username}', '{$this->password}')\";\n\n\t\t\t//error check it\n\t\t\tif(mysqli_query($db, $save_query)) {\n\t \t\t\treturn true;\n\t \t\t} \telse {\n\t \t\t\t\treturn false;\n\t \t\t\t}\n\t\t}", "public function save(){\n\n\t// needs to be set to $user object so they don't change someone elses for user\n\t$this->info['user_id']=1;\n\n\t$this->populate_post();\n\t\n\t//error checking\n\tif(!$this->validate($this->allow_change_username)){\n\t\treturn false;\n\t}\n\n\t// insert new record\n\tif(empty($this->info['user_id'])){\n\t\t$status=$this->default_status;\n\t\t$this->insert($status);\n\t\treturn true;\n\t}\n\t// update old\n\telse{\n\t\t$this->update($this->allow_change_username);\n\t\treturn true;\n\t}\n\n}", "private function saveBan(){\n $this->tmp_list->writeTmpBanUsers($this->file);\n }", "public function saveUser();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a report for the given phone number.
public function phoneNumbers($number) { $dates = $this->retrieveDates(); $report = Report::generateAllCalls($number, $dates); $data = [ 'report' => $report, 'dates' => $this->formatDates() ]; return view('report.phone_numbers', $data); }
[ "function printReport() {\n # You need both of these globals!!\n global $report, $page_index;\n\n # This turns the Name Field into a link to the correct contact.\n $report->setFieldRule( 'Account',\n '<a href=\"/ACCT_main_workspace_page.php?content_page='\n . urlencode(\"/py/account/view.pt\")\n . '&args=' . urlencode('account_number=') \n . '%Account\">%Account</a>');\n\n\n # This does the actual printing of the HTML\n $report->printHTML( $page_index );\n}", "function printReport() {\n # You need both of these globals!!\n global $report, $page_index, $page;\n\n # These are the default args. Useful for calling your page\n # again.\n $args = \"page=$page&page_index=$page_index\";\n\n # This turns the Name Field into a link to the correct contact.\n $report->setFieldRule( 'Name',\n '<a href=\"' . $GLOBALS[\"roster_url\"] . 'view_employee.jsf?contact_id=%cid\">%FirstName&nbsp;%LastName</a>' );\n\n # These add the sort arrows for each field.\n # The first argument is the field name\n # The second argument is the text to replace it with.\n $report->setHeaderReplacement( \"Name\",\n $report->strArrows('\"LastName\"',$args).\n ' Name' );\n $report->setHeaderReplacement( \"Title\",\n $report->strArrows('\"Title\"',$args).\n ' Title' );\n $report->setHeaderReplacement( \"Created\",\n $report->strArrows('\"Created\"',$args).\n ' Created' );\n\n # This does the actual printing of the HTML\n $report->printHTML( $page_index );\n}", "public function showReport()\n {\n $this->_rootElement->find($this->showReportButton)->click();\n }", "public function showAction()\n {\n $report = $this->findById();\n \n $reportFiles = $report->getFiles();\n \n $formats = netexport_get_output_formats();\n \n $this->view->formats = $formats;\n \n $this->view->report = $report;\n $this->view->reportFiles = $reportFiles;\n }", "function report()\n\t{\n\t\t$this->page->pageTitle \t\t\t\t\t= \"Listing Report\";\t\n\t\t$this->page->assign(\"reportMail\",$this->request->createURL(\"Listing\",\"reportMail\"));\n\t\t\n\t\tif(isset($_GET['business_id']) && $_GET['business_id'])\n\t\t{\n\t\t\t$san_data \t\t\t\t\t\t\t= array();\n\t\t\t$san_data['business_id'] \t\t\t= $_GET['business_id'];\n\t\t\t$san_data['page_size'] \t\t\t\t= (isset($_GET['page_size']) && !empty($_GET['page_size']))?$_GET['page_size']:DEFAULT_PAGING_SIZE;\n\t\t\t$san_data['period'] \t\t\t\t= (isset($_GET['period']) && !empty($_GET['period']))?$_GET['period']:\"Daily\";\n\t\t\t$san_data['fr'] \t\t\t\t\t= (isset($_GET['fr']))?$_GET['fr']:0;\n\t\t\t$san_data['to_date'] \t\t\t\t= $_GET['to_date'];\n\t\t\t$res \t\t\t\t\t\t\t\t= $this->listingFacade->getReport($san_data);\n\t\t\n\t\t\t$this->page->assign('to_date', $_GET['to_date']);\n\t\t\t$this->page->assign('business_id', $_GET['business_id']);\n\t\t\t$this->page->assign('do', $_GET['do']);\n\t\t\t$this->page->assign('action', $_GET['action']);\n\t\t\t$this->page->assign('paging', $res['paging']);\n\t\t\t$this->page->assign('all_data_arr', $res['all_data_arr']);\n\t\t\t$this->page->assign('page_size', $san_data['page_size']);\n\t\t\t$this->page->assign('period', $san_data['period']);\n\t\t\t$this->page->assign('business_name', $res['business_name']);\n\t\t}\n\t\telse{\n\t\t\t//invalid business\n\t\t}\n\t\t\t$this->page->getpage('business_report.tpl');\n\t}", "public function viewreportAction()\n {\n // get the session variables\n $namespace = new Container('user');\n $role = $namespace->role;\n \n // Get plan id from post data\n $planId = $this->params()->fromPost('id');\n // Get report that correlates to that plan\n $results = $this->getReports()->getReport($planId);\n \n // If there is one\n if(count($results) > 0){\n \n // Store descriptions(outcomes or assessment) in array\n $descriptions = array();\n foreach ($results as $result){\n \n array_push($descriptions, $result['text']);\n $reportArray[] = $result;\n }\n \n // Get documents for the report\n $results = $this->getReports()->getDocuments($reportArray[0]['id']);\n \n $documentArray = array();\n foreach ($results as $result){\n $documentArray[] = $result;\n }\n\n // Make view and give it data\n $partialView = new ViewModel(array(\n 'role' => $role,\n 'report' => $reportArray, 'descriptions' => $descriptions, 'documents' => $documentArray, 'results' => true,\n ));\n \n // If there is no report, tell the view to alert user\n }else{\n $partialView = new ViewModel(array('results' => false));\n }\n \n // Return view without headers/footers\n $partialView->setTerminal(true);\n return $partialView;\n }", "public function show()\n {\n $this->setTitle($this->reportCtrl->getFriendlyName() . ' Detail');\n $tpl = array();\n \n $tpl['NAME'] = $this->reportCtrl->getFriendlyName();\n \n $description = $this->reportCtrl->getDescription();\n if(!is_null($description)){\n $tpl['REPORT_DESC'] = $description;\n }else{\n $tpl['NO_DESC'] = \"\"; // dummy tag\n }\n \n if(is_null($this->report->getId())){\n $tpl['NEVER_RUN'] = \"\"; // dummy tag\n }else{\n $viewCmd = $this->report->getDefaultOutputViewCmd();\n $tpl['LAST_RUN_RELATIVE'] = $viewCmd->getLink($this->report->getRelativeLastRun());\n $tpl['LAST_RUN_USER'] = $this->report->getLastRunUser();\n }\n \n $resultsPager = new ReportHistoryPager($this->reportCtrl);\n $tpl['RESULTS_PAGER'] = $resultsPager->get();\n \n $schedulePager = new ReportSchedulePager($this->reportCtrl);\n $tpl['SCHEDULE_PAGER'] = $schedulePager->get();\n \n if($this->reportCtrl instanceof iSyncReport){\n $runNowCmd = $this->reportCtrl->getSyncExecCmd();\n $tpl['RUN_NOW'] = $runNowCmd->getLink('Run now');\n }else{\n $tpl['RUN_NOW_DISABLED'] = \"\"; // dummy tag\n }\n \n if($this->reportCtrl instanceof iAsyncReport){\n $bgSetupView = $this->reportCtrl->getAsyncSetupView();\n $tpl['RUN_BACKGROUND'] = $bgSetupView->show();\n }else{\n $tpl['RUN_BACKGROUND_DISABLED'] = \"\"; // dummy tag\n }\n \n if($this->reportCtrl instanceof iSchedReport){\n $schedSetupView = $this->reportCtrl->getSchedSetupView();\n $tpl['RUN_SCHEDULE'] = $schedSetupView->show();\n }else{\n $tpl['RUN_SCHEDULE_DISABLED'] = \"\"; // dummy tag\n }\n \n return PHPWS_Template::process($tpl, 'hms', 'admin/reports/reportDetailView.tpl');\n }", "public function crystal_report_view()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/crystal_report',$this->data);\n\t}", "public function runReport()\n {\n // get profession info\n $profession = \\Fisdap\\EntityUtils::getEntity('Profession', $this->config['profession']);\n\n // create the header row\n $header = array(\"ID\", \"Program\", \"Location\", \"Contact\", \"Last Order\");\n\n // make the table\n $programTable = array(\n 'title' => $profession->name . \" Programs\",\n 'nullMsg' => \"No programs found.\",\n 'head' => array('0' => $header),\n 'body' => array(),\n );\n\n // get the programs for this profession\n $programRepo = \\Fisdap\\EntityUtils::getRepository(\"ProgramLegacy\");\n $programs = $programRepo->getByProfession($profession->id);\n foreach ($programs as $program) {\n $mostRecentOrder = $programRepo->getMostRecentOrderDate($program->id);\n if ($mostRecentOrder) {\n $mostRecentOrderDate = new DateTime($mostRecentOrder);\n $order = \"<span class='hidden'>\".$mostRecentOrderDate->format('Ymd').\"</span>\".$mostRecentOrderDate->format(\"M j, Y\");\n } else {\n $order = \"\";\n }\n\n $programTable['body'][] = array(\n array(\n 'data' => $program->id,\n 'class' => '',\n ),\n array(\n 'data' => $program->name,\n 'class' => '',\n ),\n array(\n 'data' => $program->city . \", \" . $program->state . \" (\" .$program->country . \")\",\n 'class' => '',\n ),\n array(\n 'data' => $program->getProgramContactName(),\n 'class' => '',\n ),\n array(\n 'data' => $order,\n 'class' => '',\n )\n );\n }\n\n $this->data['programs'] = array(\"type\" => \"table\",\n \"content\" => $programTable);\n }", "public function format($phoneNumber);", "function external_number_display(&$record)\r\n\t{\r\n\t\tif ($record['external_number'])\r\n\t\t{\r\n\t\t\t$location_to = $this->getLocationData($record['external_number']);\r\n\t\t\t$record['external_number'] = $location_to['name'];\r\n\t\t}\r\n\r\n\t\treturn $this->m_attribList[\"external_number\"]->display($record);\r\n\t}", "public function display() {\n switch (strtolower($this->params['format'][0])) {\n case 'html':\n case 'csv':\n case 'xml':\n case 'json':\n $display_function = 'as_' . strtolower($this->params['format'][0]);\n $this->$display_function();\n break;\n default:\n var_dump($this->report_objects);\n break;\n }\n }", "public function viewprogram()\n {\n $this->db->from('program');\n $getprg = $this->db->get();\n $getres = $getprg->result();\n $data['prgres'] = $getres;\n $msg=\"\";\n $data['msg'] = $msg;\n $this->load->view('setup/viewprogram', $data);\n $this->logger->write_logmessage(\"view\",\" View Program Details\", \"View Program details...\");\n }", "public function get_phone(){\n\t\tprint $this->phone . \"\\n\";\n\t}", "public function displayPDF(){\n\n $fileName = $this->input->get('filename');\n $this->data['report'] = $fileName;\n $this->data['subview'] = 'engineer/user/report/singleReport_view';\n $this->load->view(\"engineer/_layout_main\", $this->data);\n }", "public function show() {\n\t\t\theader('Content-type: application/pdf');\n\t\t\tprint $this->pdf_content;\n\t\t}", "public function pos_sales_report_printAction() \n\n\t{\n\n\t\t$pos_uname=$this->getRequest()->getParam('pos_user_id');\n\n\t\t$date_from=$this->getRequest()->getParam('date_from');\n\n\t\t$date_to=$this->getRequest()->getParam('date_to');\n\n\t\t$helper = Mage::helper('pointofsales');\n\n\t\t$html=$helper->pos_sales_report_pdf($pos_uname,$date_from,$date_to);\t\t\n\n\t\techo $html;\n\n\t}", "function displayTechReport(TechReport $techReport): void\n{\n\t/* Display technical report and number */\n\t?>\n\tTechnical Report <?= $techReport->number ?>,\n\t<?php\n\t/* Display institute */\n\t?>\n\t<a href=\"<?= $techReport->institute->homepage ?>\"><?= $techReport->institute->name ?></a>,\n\t<?php\n\t/* Display address */\n\tprint($techReport->institute->address); ?>,\n\t<?php\n}", "public function show_shell() {\n // if the current user does not have permissions to run the report, then bail\n if ( ! current_user_can( 'view_woocommerce_reports' ) )\n return $this->_error( new WP_Error( 'no_permission', __( 'You do not have permission to use this report.', 'opentickets-community-edition' ) ) );\n\n // draw the shell of the form, and allow the individual report to specify some fields\n ?>\n <div class=\"report-form\" id=\"report-form\"><?php $this->_form() ?></div>\n <div class=\"report-results\" id=\"report-results\"><?php echo $results = $this->_results() ?></div>\n <?php\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the session_id column Example usage: $query>filterById(1234); // WHERE session_id = 1234 $query>filterById(array(12, 34)); // WHERE session_id IN (12, 34) $query>filterById(array('min' => 12)); // WHERE session_id >= 12 $query>filterById(array('max' => 12)); // WHERE session_id
public function filterById($id = null, $comparison = null) { if (is_array($id)) { $useMinMax = false; if (isset($id['min'])) { $this->addUsingAlias(SessionPeer::SESSION_ID, $id['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($id['max'])) { $this->addUsingAlias(SessionPeer::SESSION_ID, $id['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(SessionPeer::SESSION_ID, $id, $comparison); }
[ "function clients_getFilter($id) {\n\tglobal $Auth;\n\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\t\n\t## prepare the db-object\n\t$db = new DB_Sql();\n\n\t## then get the correct values\n\t$query = \"SELECT * FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_filters WHERE id='$id'\";\n\n\t$result = $db->query($query);\t\n\t$counter = 0;\n\t$return_value = array();\n\tif($db->next_record(MYSQL_ASSOC)) {\n\t\t$return_value = $db->Record;\n\t}\n\treturn $return_value;\t\n}", "public function getFilter($id);", "public function filterUser(int|UniqueId $id): self;", "public function testFilterById()\n {\n // find by single id\n $book = PropelQuery::from('Book b')\n ->where('b.Title like ?', 'Don%')\n ->orderBy('b.ISBN', 'desc')\n ->findOne();\n\n $c = BookQuery::create()->filterById($book->getId());\n\n $book2 = $c->findOne();\n\n $this->assertTrue($book2 instanceof Book);\n $this->assertEquals('Don Juan', $book2->getTitle());\n\n //find range\n $booksAll = PropelQuery::from('Book b')\n ->orderBy('b.ID', 'asc')\n ->find();\n\n $booksIn = BookQuery::create()\n ->filterById(array($booksAll[1]->getId(), $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[0] == $booksAll[1]);\n $this->assertTrue($booksIn[1] == $booksAll[2]);\n\n // filter by min value with greater equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[3]);\n\n // filter by max value with less equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('max' => $booksAll[1]->getId()) )\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[1]);\n\n // check backwards compatibility:\n // SELECT FROM `book` WHERE book.id IN (:p1,:p2)\n // must be the same as\n // SELECT FROM `book` WHERE (book.id>=:p1 AND book.id<=:p2)\n\n $minMax = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[1]->getId(),\n 'max' => $booksAll[2]->getId())\n )\n ->find();\n\n $In = BookQuery::create()\n ->filterById(\n array($booksAll[1]->getId(),\n $booksAll[2]->getId())\n )\n ->find();\n\n $this->assertTrue($minMax[0] === $In[0]);\n $this->assertTrue(count($minMax->getData()) === count($In->getData()));\n }", "public function filterByIDs($ids);", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "public function userIdFiltering(&$filter)\n {\n // Enter your code here\n }", "function UserID_Filtering(&$filter) {\r\n\r\n\t\t// Enter your code here\r\n\t}", "public function scopeFilterById($query, $id = null)\n {\n if (!$id) {\n return $query;\n }\n\n return $query->where('id', '=', $id);\n }", "public function filterByTypeId($typeId = null, $comparison = null)\n {\n if (is_array($typeId)) {\n $useMinMax = false;\n if (isset($typeId['min'])) {\n $this->addUsingAlias(SessionPeer::SESSION_STYPE_ID, $typeId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($typeId['max'])) {\n $this->addUsingAlias(SessionPeer::SESSION_STYPE_ID, $typeId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SessionPeer::SESSION_STYPE_ID, $typeId, $comparison);\n }", "public static function getFilterById($_id)\n {\n $obj = Tinebase_PersistentFilter::getInstance();\n $persistentFilter = $obj->get($_id);\n \n return $persistentFilter->filters;\n }", "public function filters($id) {\n return new Filter($this->client, $id);\n }", "function filter_id($filtername){}", "function filter_id ($filtername) {}", "function generateFilterFromSession($id_study_field = \"items_id_study\", $sample_type_field = \"items_sample_type\", $shipment_type_field = \"items_shipment_type\", $id_visit_field = \"items_id_visit\"){\r\n $id_study = mysql_real_escape_string(trim($_SESSION['id_study']));\r\n $sample_type = mysql_real_escape_string(trim($_SESSION['sample_type']));\r\n $shipment_type = mysql_real_escape_string(trim($_SESSION['shipment_type']));\r\n $id_visit = mysql_real_escape_string(trim($_SESSION['id_visit']));\r\n \r\n $filter = \"true\";\r\n $text = \"\";\r\n if(isset($id_study) && strlen($id_study) > 0 && ($id_study <> \"%\") && $id_study_field) {\r\n $filter .= \" and $id_study_field = '$id_study'\";\r\n $text .= \"id_study = '$id_study'<br/>\";\r\n }\r\n if(isset($sample_type) && strlen($sample_type) > 0 && ($sample_type <> \"%\") && $sample_type_field) {\r\n $filter .= \" and $sample_type_field = '$sample_type'\";\r\n $text .= \"sample_type = '$sample_type'<br/>\";\r\n }\r\n if(isset($shipment_type) && strlen($shipment_type) > 0 && ($shipment_type <> \"%\") && $shipment_type_field) {\r\n $filter .= \" and $shipment_type_field = '$shipment_type'\";\r\n $text .= \"shipment_type = '$shipment_type'<br/>\";\r\n }\r\n if(isset($id_visit) && strlen($id_visit) > 0 && ($id_visit <> \"%\") && $id_visit_field){\r\n $filter .= \" and $id_visit_field = '$id_visit'\";\r\n $text .= \"id_visit = '$id_visit'<br/>\";\r\n }\r\n \r\n if(strlen($text) == 0)\r\n $text = \"no filter<br/>\";\r\n return array(\"sql\" => $filter, \"text\" => $text);\r\n}", "public function filter($sql);", "public function find(int $id) : CategoryFilter;", "public function scopeGet_id($query , $session , $event){\n \t\t$session_ = new Session_Model();\n\t \t$idSession = $session_->where('nama' , '=' , $session )->first();\n $event_ = new Event_Model();\n\t\t $idEvent = $event_->where('nama' , '=' , $event )->first();\n\t\t //return $idEvent;\n\t\t return $query->where('idsession' , '=' , $idSession->id)->where('idevent' ,'=' , $idEvent->id);\n }", "public function scopeWhereId($query, int $id)\n {\n return $query->where('id', $id);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion para realizar la consulta.
function realizarConsultas($sql) { $this->resultado = $this->mysqli->query($sql); }
[ "abstract public function realizarConsulta($query);", "public function Consultar($estado, $tipo){\n\n $retorno;\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n $consulta =$objetoAccesoDato->RetornarConsulta(\"SELECT * FROM pedidos WHERE estado='$estado' AND tipo= '$tipo' \");\n $consulta->execute(); \n $retorno = $consulta->fetchAll(); \n if($retorno != null){\n return $retorno;\n }\n else{\n return null;\n }\n\n\n\n\n\n}", "public function consulta() {\n\n\t\t// Buscar as informações do usuario atual logado\n\t\t$this->sql = \"SELECT * FROM dados_usuario WHERE Id = '$this->id'\";\n\n\t\t$this->dados_usuario = mysqli_fetch_array(mysqli_query($this->con, $this->sql));\t\t\n\n\t}", "public function Consultar()\n {\n $condicion = $this->obtenerCondicion();\n $sentenciaSql = \"SELECT \n e.id_empleado\n ,e.correo_institucional\n ,e.fecha_ingreso\n ,e.arl\n ,e.salud\n ,e.pension\n ,e.estado\n ,c.id_cargo\n ,c.descripcion\n ,p.id_persona\n ,e.sueldo_basico\n ,CONCAT(p.nombre,' ',p.apellido) AS nombre\n FROM \n empleado AS e\n INNER JOIN cargo AS c ON e.id_cargo = c.id_cargo\n INNER JOIN persona AS p ON e.id_persona = p.id_persona \n $condicion\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n return true;\n }", "function prepararConsulta() {\n\t\t$campos = \"select id_componente from componentes where id_componente is not null and id_tipo = '1' and componentes.activo=1 \"; // Para que cuando se muestre el listado sin ningun campo de busqueda rellenado solo muestre las cabinas \n\t\t\n\t\tif($this->cabina != \"\") {\n\t\t\t$condiciones .= \"and nombre like '%\".$this->cabina.\"%'\";\n\t\t}\n\t\tif($this->referencia != \"\") {\n\t\t\t$condiciones .= \"and referencia like '%\".$this->referencia.\"%'\";\n\t\t}\n\t\tif($this->version != \"\") {\n\t\t\t$condiciones .= \"and version=\".$this->version.\" \";\n\t\t}\n\t\tif($this->descripcion != \"\") {\n\t\t\t$condiciones .= \"and descripcion like '%\".$this->descripcion.\"%'\";\n\t\t}\n\t\tif($this->estado != \"\") {\n\t\t\t$condiciones .= \"and estado like '%\".$this->estado.\"%'\";\n\t\t}\n\t\tif($this->prototipo != \"\") {\n\t\t\t$condiciones .= \"and prototipo=\".$this->prototipo.\" \";\n\t\t}\n\t\tif($this->fecha_desde != \"\") {\n\t\t\t$condiciones .= \"and componentes.fecha_creacion >= '\".$this->fecha_desde.\"' \";\n\t\t}\n\t\tif($this->fecha_hasta != \"\"){\n\t\t\t$condiciones .= \"and componentes.fecha_creacion <= '\".$this->fecha_hasta.\"' \";\t\n\t\t}\n\n\t\t$ordenado = \" order by componentes.nombre \";\n\t\t\t\t\n\t\t$this->consultaSql = $campos.$condiciones.$ordenado;\n\t}", "function bdConsultarPacienteCompleta($conexao, $nome_paciente, $data_nascimento){\n $sql = \"SELECT* FROM paciente WHERE (nome = '{$nome_paciente}' AND data_nasc = '{$data_nascimento}')\";\n $resultado = $conexao->query($sql);\n $consulta = $resultado->fetchAll(PDO::FETCH_ASSOC); \n return $consulta; \n}", "function ejecutarConsulta() {\n\t\t$this->openConnection();\n\t\t$res = $this->conn->query($this->consulta);\n\t\t$this->closeConnection();\n\t\treturn $res;\n\t}", "public function buscar(){\n\t\t\twrite_log(\"PersonaModel\",\"buscar()\",\"sin comentario\");\n\t\t\t$conexion = new Conexion(); //se crea el objeto controlador de la base de datos y se inserta el sql \n\t\t\t$sql =\"SELECT * FROM personas WHERE (dni='$this->dni')\";\n\t\t\t$resultado = $conexion->consultar($sql);\n\t\t\treturn $resultado;\n\t\t}", "public abstract function consultar($sql);", "function ejecutarConsultaSimpleFila($sql)\n {\n\n global $conexion;\n $query = $conexion->query($sql);\n //obtenemos una fila como resultado en un arreglo y lo almacena en $row\n $row = $query->fetch_assoc();\n //y devolvemos sola una fila \n return $row;\n }", "public function ConsultarAlquiler(){\r\n $resultado = $this->bd->query(\"SELECT * FROM alquiler\");\r\n return $resultado;\r\n }", "function consultar($consulta, $nomSimulador = \"\") {\n\n if ($this->conectado === false) {\n return 1;\n }\n $this->datosOdbc = new DatosOdbc();\n\n if ($this->simulador && $nomSimulador == \"\") {\n echo \"consulta no Simulada <br>\";\n }\n\n if (!$this->simulador || $nomSimulador == \"\") {\n $this->datosOdbc = new DatosOdbc();\n $this->datosOdbc->reset();\n\n $this->datosOdbc->setConsulta($consulta);\n {\n $result = @odbc_exec($this->conexion, $this->datosOdbc->getConsulta());\n if (!$result) {\n if ($this->salir === true) {\n echo @odbc_errormsg();\n echo \" $this->dsn <hr> odbc.lib::consultar <hr> \" . $this->datosOdbc->getConsulta();\n }\n return 1;\n }\n\n $this->datosOdbc->setCampos(@odbc_num_fields($result));\n $registros = array();\n $i = 0;\n\n while ($registro = @odbc_fetch_array($result)) {\n @array_push($registros, $registro);\n $i++;\n $registrotmp = $registro;\n }\n $this->datosOdbc->setRegistro($registros);\n\n $this->datosOdbc->setRegistros($i);\n }\n\n $campos = @array_keys($registrotmp);\n $arrCampos = array();\n\n @reset($campos);\n while ($campo = @current($campos)) {\n @next($campos);\n @array_push($arrCampos, $campo);\n }\n $this->datosOdbc->setCampo($arrCampos);\n\n $this->datosOdbc->resetCampo();\n $this->datosOdbc->resetRegistro();\n\n odbc_free_result($result);\n } else {\n \n @session_start();\n\n $this->datosOdbc->reset();\n $this->datosOdbc->setConsulta($consulta);\n\n $registros = array();\n\n if (!$this->iniciarTmp($nomSimulador)) {\n\n $result = @odbc_exec($this->conexion, $this->datosOdbc->getConsulta());\n\n while ($registro = @odbc_fetch_array($result)) {\n @array_push($registros, $registro);\n }\n\n $this->simuladorBd($nomSimulador, $registros);\n }\n\n $registros = $this->traerSimuladorBd($nomSimulador);\n\n $this->datosOdbc->setRegistro($registros);\n\n @session_write_close();\n }\n\n\n return 0;\n }", "public function consultar($valor){\r\n $oSicasLotacaoBD = new SicasLotacaoBD();\r\n return $oSicasLotacaoBD->consultar($valor);\r\n }", "public function consultar($valor){\r\n\t\t$oSicasCidBD = new SicasCidBD();\t\r\n\t\treturn $oSicasCidBD->consultar($valor);\r\n\t}", "function consultarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE CEDULA='\".$ced.\"' \";\n\n\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\n\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\n\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\t\t}\t\n\t\t$objConexion->cerrarBd(); \n\t\treturn $this->objEmpleado; \t\t\n}", "public function consulta() {\n return $this->db\n ->select(format_select(array(\n 'empleado.idEmpleado' => 'id_empleado',\n 'empleado.matricula' => 'matricula',\n 'empleado.nombre' => 'nombre',\n 'empleado.apellido_paterno' => 'a_paterno',\n 'empleado.apellido_materno' => 'a_materno',\n 'directorio.email' => 'correo',\n )))\n ->join('directorio','empleado.idEmpleado = directorio.idEmpleado AND empleado.status = \"1\"')\n ->get('empleado')\n ->result_array();\n }", "function consultar_empleado_empresas_todas(){\r\r\n\t\t$con= new dbConexion();\r\r\n\r\r\n\t\tif($con->conectar()==true){\r\r\n\t\t\t$query = \"SELECT * FROM empleados \r\r\n\t\t\tINNER JOIN empleados_empresa ON empleados.id_empleado = empleados_empresa.id_empleado\r\r\n\t\t\tinner join empresas on empleados_empresa.id_empresa=empresas.id_empresa\r\r\n\t\t\tWHERE empleados.estado = 'ACTIVO' ORDER BY empleados.nombre ASC\";\r\r\n\t\t\t$empleados = mysql_query($query); \t \r\r\n\r\r\n\t\t\tif (!$empleados)\r\r\n\t\t\t\treturn false; \t\t\t\t\t\t\t\t\r\r\n\t\t\telse\t\t\t\t\t\t\t\t\r\r\n\t\t\t\treturn $empleados;\t\t\t\t\t\r\r\n\t\t\t\t\r\r\n\t\t\t}\r\r\n\t\t}", "public function consultar($valor){\r\n\t\t$oSicasProcedimentoAutorizadoBD = new SicasProcedimentoAutorizadoBD();\t\r\n\t\treturn $oSicasProcedimentoAutorizadoBD->consultar($valor);\r\n\t}", "function consulta($campos=\"\", $tabla=\"\", $condicion=\"1\",$verquery=0){\n\t\t$query=\"SELECT \";\n\t\tif(($campos==\"\")||(!isset($campos))){\n\t\t\t$query.=\"*\";\n\t\t}else{\n\t\t\tfor($i=0;$i<sizeof($campos);$i++){\n\t\t\t\t$query.=\"$campos[$i]\";\n\t\t\t\tif($i<sizeof($campos)-1){\n\t\t\t\t\t$query.=\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$query.=\" FROM \".$tabla.\" WHERE \".$condicion;\nif($verquery)\n\t\techo\"<p><strong>consulta: </strong><em>\".$query.\"</em></p>\";\n\t\t$this->setQuery($query);\n//\t\techo\"<p><p>Antes de llamar a consulta_bd: query vale: \".$query.\"<p><p>\";\n\t\t$arreglo=$this->consulta_bd($query); \n\t\treturn $arreglo;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Before you call this operation, we recommend that you learn about the match rules of policybased routes and limits on policybased routes. For more information, see [Work with policybased routes](~~110777~~). Before you create a policybased route, make sure that an IPsecVPN connection is created. For more information, see [CreateVpnConnection](~~120391~~). CreateVpnPbrRouteEntry is an asynchronous operation. After you send the request, the route information is returned but the operation is still being performed in the background. You can call [DescribeVpnGateway](~~73720~~) to query the status of a VPN gateway. If a VPN gateway is in the updating state, the policybased route entry is being created. If a VPN gateway is in the active state, the policybased route entry is created. You cannot repeatedly call CreateVpnPbrRouteEntry to create a policybased route for a VPN gateway within the specified period of time.
public function createVpnPbrRouteEntry($request) { $runtime = new RuntimeOptions([]); return $this->createVpnPbrRouteEntryWithOptions($request, $runtime); }
[ "public function createVpnRouteEntryWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->description)) {\n $query['Description'] = $request->description;\n }\n if (!Utils::isUnset($request->nextHop)) {\n $query['NextHop'] = $request->nextHop;\n }\n if (!Utils::isUnset($request->overlayMode)) {\n $query['OverlayMode'] = $request->overlayMode;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->publishVpc)) {\n $query['PublishVpc'] = $request->publishVpc;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->routeDest)) {\n $query['RouteDest'] = $request->routeDest;\n }\n if (!Utils::isUnset($request->vpnGatewayId)) {\n $query['VpnGatewayId'] = $request->vpnGatewayId;\n }\n if (!Utils::isUnset($request->weight)) {\n $query['Weight'] = $request->weight;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'CreateVpnRouteEntry',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return CreateVpnRouteEntryResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function createRouteObject();", "public function createRoute($route_name);", "public function modifyVpnPbrRouteEntryAttribute($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->modifyVpnPbrRouteEntryAttributeWithOptions($request, $runtime);\n }", "public function createRoute()\n {\n if ($this->mapType !== 'country' && $this->mapType !== 'hotel') {\n $this->endPos=trim($this->destination->longtiude).','.trim($this->destination->latitude);\n // dd($this->endPos);\n }\n if ($this->currentUserLocation) {\n $this->emit('createRoute',['startPos'=> $this->currentUserLocation , 'endPos'=>$this->endPos]);\n return;\n }\n // \\dd($this->hotelLocation);\n $this->emit('createRoute',['startPos'=> $this->hotelLocation , 'endPos'=>$this->endPos]);\n }", "public function modifyVpnPbrRouteEntryAttributeWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->newPriority)) {\n $query['NewPriority'] = $request->newPriority;\n }\n if (!Utils::isUnset($request->newWeight)) {\n $query['NewWeight'] = $request->newWeight;\n }\n if (!Utils::isUnset($request->nextHop)) {\n $query['NextHop'] = $request->nextHop;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->priority)) {\n $query['Priority'] = $request->priority;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->routeDest)) {\n $query['RouteDest'] = $request->routeDest;\n }\n if (!Utils::isUnset($request->routeSource)) {\n $query['RouteSource'] = $request->routeSource;\n }\n if (!Utils::isUnset($request->vpnGatewayId)) {\n $query['VpnGatewayId'] = $request->vpnGatewayId;\n }\n if (!Utils::isUnset($request->weight)) {\n $query['Weight'] = $request->weight;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ModifyVpnPbrRouteEntryAttribute',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ModifyVpnPbrRouteEntryAttributeResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function create_route_table($vpc_id, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['VpcId'] = $vpc_id;\n\n\t\treturn $this->authenticate('CreateRouteTable', $opt, $this->hostname);\n\t}", "public function modifyVpnPbrRouteEntryPriorityWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->newPriority)) {\n $query['NewPriority'] = $request->newPriority;\n }\n if (!Utils::isUnset($request->nextHop)) {\n $query['NextHop'] = $request->nextHop;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->priority)) {\n $query['Priority'] = $request->priority;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->routeDest)) {\n $query['RouteDest'] = $request->routeDest;\n }\n if (!Utils::isUnset($request->routeSource)) {\n $query['RouteSource'] = $request->routeSource;\n }\n if (!Utils::isUnset($request->vpnGatewayId)) {\n $query['VpnGatewayId'] = $request->vpnGatewayId;\n }\n if (!Utils::isUnset($request->weight)) {\n $query['Weight'] = $request->weight;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ModifyVpnPbrRouteEntryPriority',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ModifyVpnPbrRouteEntryPriorityResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function findRouteForOptimalTavlePlan():Route;", "public function modifyVpnPbrRouteEntryWeightWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->newWeight)) {\n $query['NewWeight'] = $request->newWeight;\n }\n if (!Utils::isUnset($request->nextHop)) {\n $query['NextHop'] = $request->nextHop;\n }\n if (!Utils::isUnset($request->overlayMode)) {\n $query['OverlayMode'] = $request->overlayMode;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->priority)) {\n $query['Priority'] = $request->priority;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->routeDest)) {\n $query['RouteDest'] = $request->routeDest;\n }\n if (!Utils::isUnset($request->routeSource)) {\n $query['RouteSource'] = $request->routeSource;\n }\n if (!Utils::isUnset($request->vpnGatewayId)) {\n $query['VpnGatewayId'] = $request->vpnGatewayId;\n }\n if (!Utils::isUnset($request->weight)) {\n $query['Weight'] = $request->weight;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ModifyVpnPbrRouteEntryWeight',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ModifyVpnPbrRouteEntryWeightResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function deleteVpnPbrRouteEntry($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->deleteVpnPbrRouteEntryWithOptions($request, $runtime);\n }", "function createRouteInstance($d,$r,$b) {\n //Create data for route instance as array\n $data = array ( \n 'Route_no' => $r,\n 'Vehicle_id' => $b[\"Vehicle_id\"],\n 'DriverID' => $d\n );\n $url = 'insertRouteInstance.php';\n $returnval = sendReceiveJSONPOST($url,$data); // this is the route instance\n \n if($returnval[\"status\"] != 'true') {\n echo \"<p>\".$returnval[\"status\"].\"</p>\";\n echo \"<form action=\\\"index.php\\\" method=\\\"post\\\">\n <input type=\\\"submit\\\" value=\\\"Return to main page\\\">\n </form>\";\n exit;\n }\n \n //Grab the bus_type\n $data = array ( \n 'Model_no' => $b[\"Model_no\"],\n );\n $url = 'getBusType.php';\n $bustype = sendReceiveJSONPOST($url,$data);\n if($bustype[\"status\"] != 'true') {\n echo \"<p>\".$bustype[\"status\"].\"</p>\";\n echo \"<form action=\\\"index.php\\\" method=\\\"post\\\">\n <input type=\\\"submit\\\" value=\\\"Return to main page\\\">\n </form>\";\n exit;\n }\n \n //Set up the seats\n setUpSeats($returnval,$bustype);\n return $returnval;\n }", "public function create($route_) {\n\t\tif(gettype($route_['themes']) == 'string') {\n\t\t\tparse_str($route_['themes'],$themes);\n\t\t\t$route_['themes'] = $themes;\n\t\t}\n\t\tif(gettype($route_['points']) == 'string') {\n\t\t\tparse_str($route_['points'],$points);\n\t\t\t$route_['points'] = $points;\n\t\t}\n\t\t// build the query\n\t\t$query = \"INSERT INTO routes\n\t\t\t\t (title,\n\t\t\t\t description,\n\t\t\t\t circuit,\n\t\t\t\t duration,\n\t\t\t\t distance,\n\t\t\t\t author_id,\n\t\t\t\t created_at)\n\t\t\t\t VALUES ('\".$route_['title'].\"',\n\t\t\t\t \t\t '\".$route_['description'].\"',\n\t\t \t\t \t\t \".($route_['circuit'] ? 'TRUE' : 'FALSE').\",\n\t\t \t\t \t\t \".intval($route_['duration']).\",\n\t\t \t\t \t\t \".intval($route_['distance']).\",\n\t\t \t\t \t\t \".intval($route_['author_id']).\",\n \t\t \t\t\t\t NOW()\n\t\t\t\t\t\t )\";\n\t\t// send the command to the DB\n\t\t$result = $this->_dbConnection->query($query);\n\t\t// retrieve the id of the inserted route; this is used later for inserting route points and themes\n\t\t$routeID = mysql_insert_id();\n\t\t// insert themes\n\t\tforeach ($route_['themes'] as $key=>$theme) {\n\t\t\t// if the theme id is not set, add the new theme in the themes table\n\t\t\tif(!isset($theme['uid'])) {\n\t\t\t\t$theme['uid'] = $this->_themes->create($theme);\n\t\t\t}\n\t\t\t// and create the associations between the themes and the current route\n\t\t\t$this->addRouteTheme($routeID,$theme['uid']);\n\t\t}\n\t\t// insert points\n\t\tforeach ($route_['points'] as $key=>$point) {\n\t\t\t$point['route_id'] = $routeID;\n\t\t\t// insert the point into the points table\n\t\t\t$this->_points->create($point);\n\t\t}\n\t\treturn $routeID;\n\t}", "public function createRoute()\n {\n if (!$this->owner->isTransactional(ActiveRecord::OP_INSERT)) {\n throw new \\LogicException(\"Operation INSERT should be transactional for owner\");\n }\n\n if (($urlPattern = $this->resolveUrlPattern()) === null) {\n return;\n }\n\n /** @var Route $route */\n $route = Yii::createObject([\n 'class' => Route::className(),\n 'module' => $this->routeModule,\n 'default_url_pattern' => $urlPattern,\n 'url_pattern' => $urlPattern,\n 'route' => $this->routeAction,\n 'params' => $this->resolveRouteParams(),\n 'description' => Yii::t(\n 'app',\n $this->routeDescription,\n ['routeDescriptionParam' => $this->owner->getAttribute($this->routeDescriptionParam)]\n ),\n ]);\n\n if (!$route->save(false)) {\n throw new \\Exception('Unexpected error during route creation for owner');\n }\n\n $this->owner->link('route', $route);\n }", "public function createVpnConnection($request);", "public function getAddRoute();", "public function getRoutingPolicyType()\n {\n if (array_key_exists(\"routingPolicyType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"routingPolicyType\"], \"\\Beta\\Microsoft\\Graph\\Model\\VpnTrafficRuleRoutingPolicyType\") || is_null($this->_propDict[\"routingPolicyType\"])) {\n return $this->_propDict[\"routingPolicyType\"];\n } else {\n $this->_propDict[\"routingPolicyType\"] = new VpnTrafficRuleRoutingPolicyType($this->_propDict[\"routingPolicyType\"]);\n return $this->_propDict[\"routingPolicyType\"];\n }\n }\n return null;\n }", "public function attachVpnGateway($request);", "public function planRoute(Request $request){\n //JWT Validation\n if(!JWTValidation($request))\n return response()->json([\"Error\"=>\"Unauthorized.\"],401);\n\n //Validation\n $rules=[\n 'user_id'=>'required',\n 'location'=>'required',\n 'duration'=>'required',\n 'route'=>'required',\n 'distance'=>'required',\n 'locations'=>'required'\n ];\n\n $validator=Validator::make($request->all(),$rules);\n if($validator->fails())\n return response()->json($validator->errors(),400);\n\n //Save data into table routes\n self::savePlannedRoute($request);\n $userRoutes=Route::where('user_id',$request->user_id)->get();\n $newRouteId=$userRoutes[count($userRoutes)-1][\"id\"];\n //Save data into table route_items\n self::savePlannedRouteItems($request,$newRouteId);\n //Response\n return response()->json([\"Message\"=>\"Ok\",\"RouteId\"=>$newRouteId],200);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get all condiciones_venta count
function get_all_condiciones_venta_count() { $this->db->from('condicion_venta'); return $this->db->count_all_results(); }
[ "function get_all_condicion_venta_count()\n {\n $this->db->from('condicion_venta');\n return $this->db->count_all_results();\n }", "function get_all_detalle_venta_count()\r\n {\r\n $detalle_venta = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `detalle_venta`\r\n \")->row_array();\r\n\r\n return $detalle_venta['count'];\r\n }", "function get_all_venta_count()\r\n {\r\n $venta = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `venta`\r\n \")->row_array();\r\n\r\n return $venta['count'];\r\n }", "function get_all_inventario_count()\r\n {\r\n $inventario = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `inventario`\r\n \")->row_array();\r\n\r\n return $inventario['count'];\r\n }", "function get_all_categoria_cliente_count()\r\n {\r\n $categoria_cliente = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `categoria_cliente`\r\n \")->row_array();\r\n\r\n return $categoria_cliente['count'];\r\n }", "function get_all_detalle_serv_count()\r\n {\r\n $detalle_serv = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `detalle_serv`\r\n \")->row_array();\r\n\r\n return $detalle_serv['count'];\r\n }", "function get_all_comprobantes_timbraje_count()\n {\n $this->db->from('comprobantes_timbraje');\n return $this->db->count_all_results();\n }", "function get_all_tenerestadorecurso_count()\n {\n $this->db->from('tenerEstadoRecurso');\n return $this->db->count_all_results();\n }", "protected function cct_count_entidad(){\n \tif(isset($this->escuelas)){\n\t\t\n\t\tforeach($this->escuelas as $escuela){\n\t\t\t$id_entidad = isset($escuela->entidad->id)?$escuela->entidad->id:$escuela->entidad;\n\t\t\t$entidad = new entidad($id_entidad);\n\t\t\t$nivelNombre = isset($escuela->nivel->nombre)?$escuela->nivel->nombre:$escuela->nom_nivel;\n\t\t\tif($nivelNombre == \"TECNICO PROFESIONAL\")\n\t\t\t\t$nivelNombre = \"BACHILLERATO\";\n\t\t\t$nivel = \"numero_escuelas_\".strtolower($nivelNombre);\n\t\t\t$nivelNacional = \"numero_nacional_escuelas_\".strtolower($nivelNombre);\n\t\t\t$entidad->read($nivel.\",\".$nivelNacional);\n\t\t\t$escuela->entidad_cct_count = isset($entidad->$nivel) ? $entidad->$nivel : 0;\n\t\t\t$escuela->nacional_cct_count = isset($entidad->$nivelNacional) ? $entidad->$nivelNacional : 0;\n\t\t\t//var_dump($entidad);\n\t\t}\n\t}\n }", "function get_all_observacoes_count()\n {\n $this->db->from('observacoes');\n return $this->db->count_all_results();\n }", "public function countCondis(){\n\t\t\t\t\t return count($this->listeCondis());\n\t\t\t\t\t }", "function get_all_estado_inscripcion_final_count()\r\n {\r\n $this->db->from('estado_inscripcion_final');\r\n return $this->db->count_all_results();\r\n }", "function get_all_boton_articulo_count()\r\n {\r\n $boton_articulo = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `boton_articulo`\r\n \")->row_array();\r\n\r\n return $boton_articulo['count'];\r\n }", "function get_all_ciudades_count()\n {\n $this->db->from('ciudad');\n return $this->db->count_all_results();\n }", "public function countReport () {\n $connection = ConnectionManager::get('default');\n $query = sprintf(\"SELECT count(motivo) AS cuantos FROM tbl_report\");\n $report = $connection->execute($query)->fetchAll('assoc');\n return $report;\n }", "function get_all_produto_count()\n {\n $this->db->from('produto');\n return $this->db->count_all_results();\n }", "function get_all_colaboradores_count()\n {\n $this->db->from('colaboradores');\n return $this->db->count_all_results();\n }", "function get_all_factura_count()\n {\n $factura = $this->db->query(\"\n SELECT\n count(*) as count\n\n FROM\n `factura`\n \")->row_array();\n\n return $factura['count'];\n }", "function get_all_seccion_count()\r\n {\r\n $seccion = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `seccion`\r\n \")->row_array();\r\n\r\n return $seccion['count'];\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that an exception is thrown when bad config is given
public function testInvalidConfig() { $this->model->setConfig('badconfig'); }
[ "public function testSetConfigInvalid()\n {\n $this->expectException(Zend_Uri_Exception::class);\n Zend_Uri::setConfig('This should cause an exception');\n }", "public function testInvalidConfigFile(): void\n {\n $invalidConfig = array(\n 'host' => 'localhost',\n 'foo' => 'bar'\n );\n\n $error = false;\n\n try {\n $this->database->addConnection('invalid', new Config($invalidConfig));\n } catch (InvalidConfigException $e) {\n $error = true;\n }\n\n $this->assertTrue($error);\n }", "public function testInvalidConfigParams(): void\n {\n $this->Logger->expects($this->once())\n ->method('error')\n ->with($this->matchesRegularExpression('/Connection to database could not be established:/'));\n Queue::setConfig('invalid', [\n 'className' => 'Josegonzalez\\CakeQueuesadilla\\Engine\\CakeEngine',\n 'datasource' => 'wrong-datasource-params',\n ]);\n ConnectionManager::setConfig('wrong-datasource-params', [\n 'className' => 'Cake\\Database\\Connection',\n 'driver' => 'Cake\\Database\\Driver\\Mysql',\n 'user' => 'invalid-user',\n 'password' => 'invalid-password',\n 'host' => 'localhost',\n ]);\n $engine = Queue::engine('invalid');\n $engine->setLogger($this->Logger);\n $this->assertFalse($engine->connect());\n }", "public function test_invalid_configurations_produce_catchable_exceptions(array $config, string $exception = null)\n {\n $this->expectException($exception ?? \\InvalidArgumentException::class);\n $this->factory->build($config);\n }", "public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }", "public function testConstructWithBadConfigFile(): void\n {\n $this->expectException(\\Zephir\\Exception::class);\n $this->expectExceptionMessage('The config.json file is invalid: Syntax error, malformed JSON');\n\n chdir(\\constant('ZEPHIRPATH').'/tests/fixtures/badconfig');\n new Config();\n }", "public function testBaseConfigHttpExceptionConfig(): void\n {\n $http_cfg = $this->getExceptionHandlerConfig();\n $cfg = $http_cfg[ HttpException::class ][ RB::KEY_CONFIG ];\n\n foreach ($cfg as $code => $params) {\n if (\\is_int($code)) {\n $this->checkExHandlerConfigStructure($params, $code);\n } elseif (\\is_string($code) && $code == 'default') {\n $this->checkExHandlerConfigStructure($params, null, true);\n } else {\n $this->fail(\"Code '{$code}' is not allowed in config->exception_handler->http_exception.\");\n }\n }\n }", "public function testConfigFailedToParseThrowsExceptionWithFailedToParseConfigSource() {\n\t\tPHPArray::loadConfig(dirname(__FILE__) . \"/../config/invalid_source_structure.php\");\n\t}", "function it_disallows_invalid_config_options()\n {\n $config = ['namespace' => 'MyApp\\\\Controllers\\\\'];\n\n $this->beConstructedWith($this->app, $config);\n\n $expectedKey = 'food';\n\n $this->shouldThrow(new \\InvalidArgumentException('Invalid configuration option: ' . $expectedKey))\n ->duringGetConfig($expectedKey);\n }", "public function testExceptionThrownWhenConfigIsAppended()\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessage(\"Config values must contain a key.\");\n\n $config = new Config([]);\n $config[] = 'new value';\n }", "public function testBadFlag()\n\t{\n\t\t$this->setExpectedException('InvalidArgumentException');\n\t\t$this->debug_conf->setFlag('asdflkasdf!');\n\t}", "public function testMakeAuthWithInvalidBackendConfig()\n {\n $config = $this->config;\n $config['auth']['backend'] = 'foo';\n $factory = new Factory($config);\n $this->expectException(BasicAuthException::class);\n $basicAuth = $factory->makeAuth();\n }", "public function testExceptionSetConfigValue(): void\n {\n // assertions\n $this->expectException(\\Exception::class);\n $this->expectExceptionCode(- 1);\n $this->expectExceptionMessage('Unsupported value type');\n\n // test body\n Conf::setConfigValue('key', 1.1);\n }", "public function testInitWithException(): void\n {\n $this->expectException(InvalidConfigException::class);\n new Queue(static::$component->connection, static::$component);\n }", "public function testNotAuthorizedExceptionIfInvalidCredentials() {\n $configuration = new Configuration(array(\n 'username' => 'username',\n 'key' => ''\n ));\n }", "protected function throwExceptionOnInconsistentConfiguration() {}", "public function testInvalidTransportConfiguration()\n {\n Config::set('graylog2.connection.type', 'INVALID');\n $this->expectException(\\DomainException::class);\n Graylog2::log('emergency', 'test', []);\n }", "public function testUnknownUserConfig()\n {\n $this->expectException(InvalidConfigurationException::class);\n $this->expectExceptionMessage('Invalid user configuration');\n $container = new Container([], [\n 'not' => 'existing',\n ]);\n $container->init();\n }", "public function testException() {\n $destination = new Config(\n ['config_name' => 'test'],\n 'test',\n [],\n $this->prophesize(MigrationInterface::class)->reveal(),\n $this->prophesize(ConfigFactoryInterface::class)->reveal(),\n $this->prophesize(LanguageManagerInterface::class)->reveal()\n );\n $this->expectException(RequirementsException::class);\n $this->expectExceptionMessage(\"Destination plugin 'test' did not meet the requirements\");\n $destination->checkRequirements();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ set_other_options($arr) This function is used to set other where/ extra conditions that can not be managed by where and like method Accepts array of conditions returns whole object
public function set_other_options($arr = array()) { foreach ($arr as $where ) { //echo '<pre>';print_r($where);die; $this->otherConditions[] = $where; } return $this; }
[ "public function extra_where() {\r\n $where = & func_get_args();\r\n\r\n $this->_extra_where = count($where) == 1 ? $where[0] : array($where[0] => $where[1]);\r\n }", "public function extra_where()\n\t{\n\t\t$where =func_get_args();\n\t\t\n\t\t$this->_extra_where = count($where) == 1 ? $where[0] : array($where[0] => $where[1]);\n\t}", "protected function alter_conditions(array &$conditions)\n\t{\n\n\t}", "function setCondition($conditions, $setup = 0, $orand = \"and\"){\n $i = 0;\n if ($setup) $separator = ', ';\n else if ($orand == \"and\") {\n $separator = ' and ';\n } else {\n $separator = ' or ';\n }\n \n foreach ($conditions as $key => $value) {\n $temp .= mysqli_real_escape_string($this->link, $key).'=\"'.mysqli_real_escape_string($this->link, trim($value)).'\" ';\n $i++;\n if ($i != count($conditions)) $temp .= $separator;\n }\n if ($setup) {\n $this->setup = $temp;\n } else {\n $this->condition = 'WHERE '.$temp;\n }\n }", "function where() {\n\t\t$conditions = $this->_getArguments(func_get_args());\n\t\tforeach($conditions as $cond) {\n\t\t\tif(is_string($cond))\n\t\t\t\tif(!in_array($cond,$this->conditions)) $this->conditions[] = $cond;\n\t\t}\n\t}", "public function set_datatable_where($arrWhere = array())\n {\n// echo '<pre>';print_r($arrWhere);die;\n foreach ($arrWhere as $where ) {\n if(count($where) == 2)\n $this->dataTableWhere[] = array($where[0],$where[1]);\n else \n $this->dataTableWhere[] = $where[0];\n } \n return $this;\n }", "private function _getMultipleOptionFilterConditions($params, $field_name, $other_value, $table_name='Rental')\n\t{\n\t\t$safe_field_name = $this->_getSafeFieldName($field_name);\n\t\t$conditions = array();\n\t\t$possibleValues = json_decode($params[$safe_field_name]);\n\t\tif (count($possibleValues) === 0)\n\t\t\treturn null;\n\n\t\t$conditions['OR'] = array(array($table_name . '.' . $field_name => $possibleValues));\n\n\t\tif (in_array($other_value, $possibleValues))\n\t\t\tarray_push($conditions['OR'], array(\n\t\t\t\t$table_name . '.' . $field_name . ' >=' => $other_value\n\t\t\t));\n\n\t\treturn $conditions;\n\t}", "private function restoreWhere($where){ \r\n \r\n if(is_array($where)){\r\n \r\n foreach($where as $condition){\r\n \r\n if($condition[0] == 'AND')\r\n $this->dbobject->where($condition[2], $condition[1]);\r\n elseif($condition[0] == 'OR')\r\n $this->dbobject->where($condition[2], $condition[1]);\r\n }\r\n } \r\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "public function setConditions(array $conditions);", "public function where() {\r\n\t\t\t$this->where = func_get_args();\r\n\t\t}", "protected function applyConditions(array $where)\n {\n foreach ($where as $field => $value) {\n if (is_array($value)) {\n list($condition, $field, $val) = $value;\n $this->model = $this->query->andWhere([$field, $condition, $val]);\n } else {\n $this->model = $this->query->andWhere(['=', $field, $value]);\n }\n }\n }", "protected function applyConditions(array $where) {\n\t\t\tforeach($where as $field => $value) {\n\t\t\t\tif(is_array($value)) {\n\t\t\t\t\tlist($field, $condition, $val) = $value;\n\t\t\t\t\t$this->model = $this->model->where($field, $condition, $val);\n\t\t\t\t} else {\n\t\t\t\t\t$this->model = $this->model->where($field, '=', $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function applyConditions(array $where)\n {\n foreach ($where as $field => $value) {\n if (\\is_array($value)) {\n list($field, $condition, $val) = $value;\n $this->builder = $this->builder->where($field, $condition, $val);\n } else {\n $this->builder = $this->builder->where($field, '=', $value);\n }\n }\n }", "function add_where($cond)\n\t{\n\t\tif(empty($cond)) return;\n\t\tif( is_array($cond) ) { foreach($cond as $condition) $this->add_where($condition); return; }\n\t\tif(!$this->_where) \t\t\t\t$this->_where = array();\n\t\tif( !is_array($this->_where)) \t$this->_where = array($this->_where);\n\t\t$this->_where[] = $cond;\n\t\treturn;\n\t}", "private function setConditions()\n {\n $this->validateConditions();\n\n $unrequiredConditions = array_filter(\n $this->conditions,\n function ($item) {\n return !isset($item['required']);\n }\n );\n $this->unrequiredConditions = array_column($this->sortConditions($unrequiredConditions), 'object');\n\n $requiredConditions = array_filter(\n $this->conditions,\n function ($item) {\n return isset($item['required']) && (bool) $item['required'];\n }\n );\n $this->requiredConditions = array_column($requiredConditions, 'object');\n }", "protected function applyConditions(array $where)\n {\n foreach ($where as $field => $value) {\n if (is_array($value)) {\n [$field, $condition, $val] = $value;\n $this->model = $this->model->where($field, $condition, $val);\n } else {\n $this->model = $this->model->where($field, '=', $value);\n }\n }\n }", "protected function applyConditions(array $where)\n {\n foreach ($where as $field => $value) {\n if (is_array($value)) {\n list($field, $condition, $val) = $value;\n $this->model = $this->model->where($field, $condition, $val);\n } else {\n $this->model = $this->model->where($field, '=', $value);\n }\n }\n }", "protected function buildListWhereCustomConditions(&$where)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the filter when it is completely empty.
public function testEmptyFilter() { $context = new Context(); $result = $this->factory->filter('{{}}', $context); $this->assertEquals('', $result); }
[ "public function isFilterEmpty();", "public function testEmpty()\n {\n $value = 'something';\n $this->assertEquals($value, $this->_filter->filter($value));\n }", "public function testFilterEmptyResult() {\n $inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n $collection = new GenericCollection();\n $collection->addArray($inputArray);\n $filtered = $collection->filter(function($object) {\n return $object > 99;\n });\n self::assertEquals($inputArray, $collection->getAll());\n self::assertEquals([], $filtered->getAll());\n self::assertEquals(0, $filtered->count());\n }", "public function isEmpty() :bool\n\t{\n\t\t$this->removeEmpty();\n\n\t\treturn empty($this->_filters);\n\t}", "public function isFilterEmpty() {\n\t\t$isEmpty = parent::isFilterEmpty();\n\t\t\t// Call hook to extend the empty filter check\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['datafilter']['postprocessEmptyFilterCheck'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['datafilter']['postprocessEmptyFilterCheck'] as $className) {\n\t\t\t\t\t/** @var $postProcessor tx_datafilter_postprocessEmptyFilterCheck */\n\t\t\t\t$postProcessor = &t3lib_div::getUserObj($className);\n\t\t\t\tif ($postProcessor instanceof tx_datafilter_postprocessEmptyFilterCheck) {\n\t\t\t\t\t$isEmpty = $postProcessor->postprocessEmptyFilterCheck($isEmpty, $this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $isEmpty;\n\t}", "public function testEmptyFilter()\n {\n $filter = new LdapFilter(array());\n $this->assertInstanceOf('Gorg\\\\Bundle\\\\LdapOrmBundle\\\\Ldap\\\\Filter\\\\LdapFilter', $filter);\n $this->assertEquals($filter->format(), 'objectclass=*');\n }", "final public function isFilterEmptyNotEmpty():bool\n {\n return $this->getAttr('filterEmptyNotEmpty') === true;\n }", "public function testAddFilterWithEmptyArrayValue(): void {\n $model = $this->getModel('testdata');\n\n // NOTE: we have to override the error handler for a short period of time\n set_error_handler(null, E_USER_NOTICE);\n\n //\n // WARNING: to avoid any issue with error handlers\n // we try to keep the amount of calls not covered by the generic handler\n // at a minimum\n //\n try {\n @$model->addFilter('testdata_text', []); // this is discarded internally/has no effect\n } catch (\\Throwable $t) {}\n\n restore_error_handler();\n\n $this->assertEquals(error_get_last()['message'], 'Empty array filter values have no effect on resultset');\n $this->assertEquals(4, $model->getCount());\n }", "protected function getEmptyFilter()\n {\n return array('filters' => array());\n }", "#[@test]\n function filterWithEmptyHash() {\n $this->invoke('filter', array(\n array(),\n 'isBefore',\n Date::now()\n ));\n }", "public function checkFilters(): void\n {\n foreach ($this->filters() as $filter => $_default) {\n if (! isset($this->filters[$filter]) || $this->filters[$filter] === '') {\n $this->filters[$filter] = null;\n }\n }\n }", "public function testIsEmptyResult()\n {\n $this->assertFalse($this->fixture->isEmptyResult());\n }", "function hasFilter();", "public function testOnlyIfEmpty()\n\t{\n $config = array(\n 'scopeAttribute' => 'schacHomeOrganization',\n 'sourceAttribute' => 'eduPersonAffiliation',\n 'targetAttribute' => 'eduPersonScopedAffiliation',\n\t\t\t'onlyIfEmpty' => true,\n );\n $request = array(\n 'Attributes' => array(\n 'schacHomeOrganization' => array('example.org'),\n 'eduPersonAffiliation' => array('student'),\n\t\t\t\t'eduPersonScopedAffiliation' => array('staff@example.org', 'member@example.org'),\n )\n );\n $result = self::processFilter($config, $request);\n $attributes = $result['Attributes'];\n $this->assertEquals($attributes['eduPersonScopedAffiliation'], array('staff@example.org', 'member@example.org'));\n\t}", "public function hasFilter()\n\t{\n\t\treturn FALSE;\n\t}", "public function isEmpty(): bool\n {\n return $this->stats->isEmpty();\n }", "public function isEmpty()\n {\n return empty($this->count);\n }", "public function testForEmptyGenerateFilterText()\n {\n $filterTextGenerator = new Category();\n $param = new \\Magento\\Framework\\DataObject();\n $filterText = $filterTextGenerator->generateFilterText($param);\n $this->assertEmpty($filterText, \"Expected 'filterText' to be empty\");\n }", "public function empty()\n {\n return $this->length() === 0;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Determine if the given user can view the other user's dashboard
public function viewDashboard(User $user, User $otherUser) { if ($user->can('user-view-all-dashboard')) { return true; } if ($user->can('user-view-dashboard')) { return $user->id == $otherUser->id; } return false; }
[ "function checkAccess () {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) return true;\n else { return false; }\n }", "public function canUserView()\n\t{\n\t\tfor($i = 0; $i < sizeof($this->_nonViewers); $i++)\n\t\t{\n\t\t\tif($this->_userRole == $this->_nonViewers[$i] && $this->layout != null)\n\t\t\t{\n\t\t\t\t$this->actionIndex();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function canView($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('use_time_reports');\n }", "function _hasAccess()\n {\n // create user object\n $user =& User::singleton();\n\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\n $candID = $timePoint->getCandID();\n\n $candidate =& Candidate::singleton($candID);\n\n // check user permissions\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\n }", "function _hasAccess()\r\n {\r\n // create user object\r\n $user =& User::singleton();\r\n\r\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\r\n $candID = $timePoint->getCandID();\r\n\r\n $candidate =& Candidate::singleton($candID);\r\n\r\n // check user permissions\r\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\r\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "public function canAccessDashboard()\n {\n return $this->isAdmin();\n }", "function otherUserCanViewIssue( $user, $issueID ) {\r\n\t\t$query= \"SELECT Level FROM issues WHERE ID = '$issueID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$value = mysql_fetch_array($result);\r\n\t\textract($value);\r\n\t\t$query2 = \"SELECT Creator FROM issues WHERE ID = '$issueID'\";\r\n\t\t$result2 = mysql_query($query2);\r\n\t\t$value2 = mysql_fetch_array($result2);\r\n\t\textract($value2);\r\n\t\t$userID = $_SESSION['userid'];\r\n\t\tif($Level == 'A')\r\n\t\t\tif($this->getUserAccessLevel($user) > 7 || $this->getUserAccessLevel($user) == 5)\r\n\t\t\t\treturn TRUE;\r\n\t\t\telseif($Creator == $userID)\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\t\telseif($Level == 'B')\t\r\n\t\t\treturn $this->getUserAccessLevel($user) > 3;\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "public function allowOnlyOwner() {\n if (Yii::app()->user->getState('role') > 2) {\n return true;\n } else {\n return Step::model()->findByPk($_GET[\"id\"])->traveler->userId === Yii::app()->user->id;\n }\n }", "public function isUserAssignable(): bool;", "public function allowOnlyOwner(){\n if(Yii::app()->user->getState('role')>2){\n return true;\n }\n else{\n return Element::model()->findByPk($_GET[\"id\"])->step->traveler->userId === Yii::app()->user->id;\n }\n }", "public function isUserVisible(): bool;", "public function getVisibleForOtherUsers() {\r\n return ($this->visibleForOtherUsers) ? 1 : 0;\r\n }", "function pkg_autologin_check_view_permissions($user_id=NULL) {\n if ($user_id === NULL) {\n $user_id = wp_get_current_user()->ID;\n }\n \n return (defined(\"IS_PROFILE_PAGE\") && IS_PROFILE_PAGE) || pkg_autologin_check_modify_permissions();\n}", "public function shared_with_user()\n\t{\n\t\t$user = Auth::instance()->get_user();\n\t\t// Dashboard has been shared with everyone\n\t\t$shared_with_all = (count($this->sharing->find_all()) == 0);\n\t\t// Dashboard has been shared with the logged-in user's user group\n\t\t$shared_with_user = (count($this->sharing->where('group_id', '=', $user['role_id'])->find_all()) > 0);\n\n\t\treturn ($shared_with_user OR $shared_with_all);\n\t}", "static public function isUserHasSomeViewAccess()\n\t{\n\t\ttry{\n\t\t\tself::checkUserHasViewAccess( $idSites );\n\t\t\treturn true;\n\t\t} catch( Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "public function isVisibleTo($user) {\n if ($user) {\n $username = $user->username;\n $uid = $user->id;\n } else {\n $username = 'Guest';\n $uid = null;\n }\n if (!isset($this->_isVisibleTo[$username])) {\n $accessLevel = $this->getAccessLevel($uid);\n\n $hasViewPermission = false;\n\n if (!$this->isHidden ()) {\n switch ($accessLevel) {\n case self::QUERY_ALL:\n $hasViewPermission = true;\n break;\n case self::QUERY_PUBLIC:\n if ($this->owner->getAttribute($this->visibilityAttr) ==\n self::VISIBILITY_PUBLIC) {\n\n $hasViewPermission = true;\n break;\n }\n // Visible if marked with visibility \"Users' Groups\"\n // and the current user has groups in common with\n // assignees of the model:\n if ($this->owner->getAttribute($this->visibilityAttr) == \n self::VISIBILITY_GROUPS && \n (bool) $this->assignmentAttr && \n (bool) ($groupmatesRegex = self::getGroupmatesRegex()) && \n preg_match(\n '/' . $groupmatesRegex . '/', \n $this->owner->getAttribute($this->assignmentAttr))) {\n\n $hasViewPermission = true;\n break;\n }\n case self::QUERY_SELF:\n // Visible if assigned to current user\n if ($this->isAssignedTo($username, true)) {\n $hasViewPermission = true;\n break;\n }\n case self::QUERY_NONE:\n break;\n }\n }\n $this->_isVisibleTo[$username] = $hasViewPermission;\n }\n return $this->_isVisibleTo[$username];\n }", "function user_can_view($user)\r\n {\r\n // Make sure a user is loaded\r\n if (!$user->is_user_loaded()) return false;\r\n // Login the current user, and check capabilities\r\n if (!$user->login()) return false;\r\n return has_capability('mod/assignment:view', get_context_instance(CONTEXT_MODULE, $this->cm->id));\r\n }", "public function AllowAccessByCurrentUser()\n {\n $showNode = false;\n\n $oLinkedPage = $this->GetLinkedPageObject();\n if (false === $oLinkedPage) {\n $showNode = true;\n } else {\n if (isset($this->sqlData['show_extranet_page']) && '1' === $this->sqlData['show_extranet_page']) {\n $showNode = true;\n } else {\n $showNode = $oLinkedPage->AllowAccessByCurrentUser();\n }\n }\n\n return $showNode;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as pOBox Defines a Post Office Box number.
public function getPOBox() { return $this->pOBox; }
[ "public function getPostOfficeBoxNumber() {\n\t\treturn $this->postOfficeBoxNumber;\n\t}", "public function getPostOfficeBoxNumber()\n {\n return $this->postOfficeBoxNumber;\n }", "public function getPostOfficeBoxNumber(): ?string\n {\n return $this->postOfficeBoxNumber;\n }", "public function getPostOfficeBox()\n {\n return $this->_postOfficeBox;\n }", "public function getPostOfficeBox()\n {\n return $this->getFirstAttribute($this->schema->postOfficeBox());\n }", "public function getBoxOffice()\n {\n return $this -> boxOffice;\n }", "public function getBoxType() {\n\t\treturn $this->boxType;\n\t}", "public function get_box_type()\n\t{\n\t\treturn $this->box_type;\n\t}", "public function getBoxType()\n {\n return $this->get(self::_BOX_TYPE);\n }", "public final function getBoxId()\n {\n }", "public function getBoxId()\n {\n $value = $this->get(self::BOXID);\n return $value === null ? (string)$value : $value;\n }", "public function getPackgeBoxNum() {\n return $this->get(self::PACKGE_BOX_NUM);\n }", "public static function getNoBoxId()\n {\n return self::getIdByField(self::NO_BOX);\n }", "public function getToBoxId()\n {\n $value = $this->get(self::TOBOXID);\n return $value === null ? (string)$value : $value;\n }", "public function getBox()\n {\n CLI::line('What Vagrant image do you want to use?');\n\n $i = 1;\n foreach ($this->boxes as $box) {\n CLI::line(' ' . ($i) . '. ' . $box['humanname']);\n $i++;\n }\n CLI::line();\n $boxnumber = CLI::getLine('Select number', 1);\n if ($boxnumber < 1 || $boxnumber > count($this->boxes)+1) {\n $this->getBox();\n } else {\n $this->setSetting('boxname', $this->boxes[$boxnumber-1]['name']);\n $this->setSetting('boxurl', $this->boxes[$boxnumber-1]['url']);\n }\n }", "public function get_po_number(){\n\t\treturn $this->v_po_number;\n\t}", "public function setPostOfficeBoxNumber($postOfficeBoxNumber)\n {\n $this->postOfficeBoxNumber = $postOfficeBoxNumber;\n }", "public static function getBox($box)\n {\n return isset(self::$data[$box]) ? self::$data[$box] : null;\n }", "public function getType(): string\n {\n return self::$BOX_TYPE;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to delete a RutaSugerida entity by id.
private function createDeleteForm($id) { return $this->createFormBuilder() ->setAction($this->generateUrl('rutasugerida_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn btn-primary btn-sm'))) ->getForm() ; }
[ "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n //$eliminar=$this->get('translator')->trans('Eliminar');\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('seguimiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => \"Eliminar\", 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('secteur_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //--\n ->add('submit', 'submit', array('label' => ' ','attr'=>array('class'=>'btn-supp','title'=>'Supprimer')))\n //--\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ge_estudiante_delete', array('id' => $id)))\n ->setMethod('POST')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ud_salones_prestamo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solicitud_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn btn-danger btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('manu_statistique_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('visitalocalcomercial_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('komentarz_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Skasuj Komentarz','attr' => array('class' => 'btn btn-danger' )))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personne_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vehicule_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //--\n ->add('supprimer', 'submit', array('label' => 'S', 'attr' => array('class' => 'btn-supp btn-danger', 'title' => 'Supprimer')))\n //--\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('statistiques_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('profissao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('secteur_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer', 'attr' => array('class'=>'btn btn-danger btn-block margin-bottom')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('grupyuprawnien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Skasuj GrupyUprawnien','attr' => array('class' => 'btn btn-danger' )))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('grhcontrats_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', LegacyFormHelper::getType('Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType'), array('label' => 'Supprimer'))\r\n ->getForm()\r\n ;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation designsIdCommentsFkDelete Delete a related item by id for comments.
public function designsIdCommentsFkDelete($id, $fk) { list($response) = $this->designsIdCommentsFkDeleteWithHttpInfo($id, $fk); return $response; }
[ "public function delete_comments($id);", "public function deleteComment($commentId){\n\t\t\n\t}", "public function deleteGalleryItemComment($id)\r\n {\r\n // TODO: Implement\r\n }", "public function delete(\\Magento\\Sales\\Api\\Data\\CreditmemoCommentInterface $entity);", "public function templatesIdDesignsFkDelete($id, $fk)\n {\n list($response) = $this->templatesIdDesignsFkDeleteWithHttpInfo($id, $fk);\n return $response;\n }", "public function tagsIdDesignsFkDelete($id, $fk)\n {\n list($response) = $this->tagsIdDesignsFkDeleteWithHttpInfo($id, $fk);\n return $response;\n }", "public function teamMembersIdCommentedDesignsFkDeleteWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamMembersIdCommentedDesignsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamMembersIdCommentedDesignsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamMembers/{id}/commentedDesigns/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamMembers/{id}/commentedDesigns/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }", "public function deleteMediaComment($id, $commentID);", "public function deleteComment($comment_id, $issue_id = null);", "public function action_received_comment_delete()\n\t{\n\t\t// Auto render off\n\t\t$this->auto_render = FALSE;\n\n\t\t// Get ids, if When it is smaller than 2 then throw to 404\n\t\t$ids = explode('_', $this->request->param('key'));\n\t\tif (!(count($ids) == 2)) throw HTTP_Exception::factory(404);\n\n\t\t// idsをitem_idとreceived_comment_idに分ける\n\t\tlist($item_id, $received_comment_id) = $ids;\n\n\t\t// Get received_comment, if there is nothing then throw to 404\n\t\t$received_comment = Tbl::factory('received_comments')->get($received_comment_id);\n\t\tif (!$received_comment) throw HTTP_Exception::factory(404);\n\n\t\t// Get item, if there is nothing then throw to 404\n\t\t$this->item = Tbl::factory('items')->get($item_id);\n\t\tif (!$this->item) throw HTTP_Exception::factory(404);\n\n\t\t// Get division\n\t\t$division = Tbl::factory('divisions')\n\t\t\t->where('id', '=', $this->item->division_id)\n\t\t\t->read(1);\n\n\t\t// Database transaction start\n\t\tDatabase::instance()->begin();\n\n\t\t// Try\n\t\ttry\n\t\t{\n\t\t\t// Delete\n\t\t\t$received_comment->delete();\n\n\t\t\t// Database commit\n\t\t\tDatabase::instance()->commit();\n\n\t\t\t// Add success notice\n\t\t\tNotice::add(Notice::SUCCESS, Kohana::message('general', 'delete_success'));\n\n\t\t\t// redirect\n\t\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http'));\n\t\t}\n\t\tcatch (HTTP_Exception_302 $e)\n\t\t{\n\t\t\t$this->redirect($e->location());\n\t\t}\n\t\tcatch (Validation_Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add validation notice\n\t\t\tNotice::add(Notice::VALIDATION, Kohana::message('general', 'delete_failed'), NULL, $e->errors('validation'));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add error notice\n\t\t\tNotice::add(\n\t\t\t\tNotice::ERROR//, $e->getMessage()\n\t\t\t);\n\t\t}\n\n\t\t// Redirect to received_comments edit\n\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http').URL::query());\n\t}", "#[Route('/wishmap/{wishmapId}/comment/delete/{commentId}', name: 'delete_comment')]\n public function deleteComment(int $commentId, int $wishmapId,\n CommentsRepository $commentsRepository, WishMapRepository $wishMapRepository)\n {\n $comment = $commentsRepository->find($commentId);\n $wishMap = $wishMapRepository->find($wishmapId);\n\n $currentUserId = $this->getUser()->getId(); // current user\n $userId = $wishMap->getUser()->getId(); // user of wish map card\n $commentUserId = $comment->getSendUser()->getId(); // user, who sends comment to wish map card\n\n // if CURRENT USER not user of wish map card or who send this comment, cannot delete\n if ($userId != $currentUserId && $currentUserId != $commentUserId) {\n $this->addFlash('info',\n 'Chunchunmaru');\n return $this->redirect('/wishmap/' . $wishmapId . '/comments');\n }\n\n $entityManager = $this->getDoctrine()->getManager();\n $wishMap->getComments()->removeElement($comment);\n $entityManager->remove($comment);\n $entityManager->flush();\n\n $this->addFlash('info',\n 'Comment successfully deleted!');\n\n $response = new Response();\n return $response->send();\n }", "public function delete(\\Magento\\Sales\\Api\\Data\\ShipmentCommentInterface $entity);", "public function deleteComment() {\r\n $idComment = $_GET['id'];\r\n $sql = (\"delete from T_COMMENTAIRE where COM_ID=$idComment\");\r\n $this->executerRequete($sql);\r\n header('location: Admin-Commentaires');\r\n }", "public function delete()\n {\n $ids = array();\n \n foreach ($this->comments as $Comment) {\n $ids[] = $Comment->getId();\n } \n \n \n $pdo = DataBase::getInstance();\n $fpdo = new \\FluentPDO($pdo);\n \n $query = $fpdo->deleteFrom(COMMENTS_TABLE)->where('id', $ids); \n \n return $query->execute();\n }", "public function portalsIdDesignsNkCommentersFkDelete($id, $nk, $fk)\n {\n list($response) = $this->portalsIdDesignsNkCommentersFkDeleteWithHttpInfo($id, $nk, $fk);\n return $response;\n }", "public function portalsIdDesignsNkCommentsDelete($id, $nk)\n {\n list($response) = $this->portalsIdDesignsNkCommentsDeleteWithHttpInfo($id, $nk);\n return $response;\n }", "public function delete_comment($id)\n {\n \t return $this->db->delete('Comment',array('id' => $id));\n }", "public function teamMembersIdCommentedDesignsDelete($id)\n {\n list($response) = $this->teamMembersIdCommentedDesignsDeleteWithHttpInfo($id);\n return $response;\n }", "public function designsIdCommentersDelete($id)\n {\n list($response) = $this->designsIdCommentersDeleteWithHttpInfo($id);\n return $response;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used to be WP_Listings_Search_Widget
function WP_Listings_Search_Widget() { $widget_ops = array( 'classname' => 'listings-search wp-listings-search wp-listings-search-sidebar', 'description' => __( 'Display listings search dropdown', 'wp_listings' ) ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'listings-search' ); $this->__construct( 'listings-search', __( 'WP Listings - Search', 'wp_listings' ), $widget_ops, $control_ops ); }
[ "function esb_search_widget() {\n register_widget( 'ESB_Search' );\n}", "function theme_search_results() {\n // This function is never used; see the corresponding template file instead.\n}", "function search_load_widget() {\n register_widget( 'search_widget' );\n}", "function theme_search_result() {\n // This function is never used; see the corresponding template file instead.\n}", "function wsf_add_search_input() { ?>\n<div id=\"available-widgets-filter\">\n\t<label class=\"screen-reader-text\" for=\"widgets-search\"><?php _e( 'Search Widgets', 'widget-search-filter' ); ?></label>\n\t<input type=\"search\" id=\"widgets-search\" placeholder=\"<?php esc_attr_e( 'Search widgets&hellip;', 'widget-search-filter' ) ?>\" />\n</div>\n<?php }", "function dentalimplants_search_widget() {\n\tgenesis_widget_area ( 'search', array( \n\t'before' => '<div id=\"search-form-container\">',\n\t'after' => '</div>',));\n}", "function widget_search() {\n\t\tglobal $tag_widget_title;\n?>\n\t\t\t<div class=\"widget_search\">\n\t\t\t\t<h3><?php _e('Search', 'default'); ?></h3>\n\t\t\t\t<form action=\"<?php bloginfo('home'); ?>/\" method=\"post\">\n\t\t\t\t\t<div class=\"search-wrapper\">\n\t\t\t\t\t\t<input type=\"text\" value=\"\" class=\"textfield\" name=\"s\" />\n\t\t\t\t\t\t<input type=\"submit\" value=\"Find\" class=\"button\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\n<?php\n\t}", "function KRS_STG_stt2_function_prepare_searchterms_widget($searchterms, $list = true, $search = false)\r\n{\r\n global $post;\r\n $toReturn = ($list) ? '<ul>' : '';\r\n foreach ($searchterms as $term) {\r\n $toReturn .= ($list) ? '<li>' : '';\r\n if (!$search) {\r\n $permalink = (0 == $term->post_id) ? get_bloginfo('url') : get_permalink($term->post_id);\r\n } else {\r\n $permalink = get_bloginfo('url') . '/search/' . user_trailingslashit(KRS_STG_stt2_function_sanitize_search_link($term->meta_value));\r\n }\r\n $toReturn .= \"<a href=\\\"$permalink\\\" title=\\\"$term->meta_value\\\">$term->meta_value</a>\";\r\n $toReturn .= ($list) ? '</li>' : ', ';\r\n }\r\n $toReturn = trim($toReturn, ', ');\r\n $toReturn .= ($list) ? '</ul>' : '';\r\n //$toReturn = htmlspecialchars_decode($toReturn);\r\n //$toReturn .= KRS_STG_WATERMARK;\r\n return $toReturn;\r\n}", "function register_search_autocomplete() {\n register_widget( 'Search_Autocomplete_widget' );\n}", "function tkno_location_search_widget_load() {\n register_widget( 'tkno_location_search_widget' );\n}", "function widget_sandbox_search($args) {\n\textract($args);\n\tif ( empty($title) )\n\t\t$title = __('Search', 'sandbox');\n?>\n\t\t<?php echo $before_widget ?>\n\t\t\t<?php echo $before_title ?><label for=\"s\"><?php echo $title ?></label><?php echo $after_title ?>\n\t\t\t<form id=\"searchform\" method=\"get\" action=\"<?php bloginfo('home') ?>\">\n\t\t\t\t<div>\n\t\t\t\t\t<input id=\"s\" name=\"s\" type=\"text\" value=\"<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>\" size=\"10\" tabindex=\"1\" />\n\t\t\t\t\t<input id=\"searchsubmit\" name=\"searchsubmit\" type=\"submit\" value=\"<?php _e('Find', 'sandbox') ?>\" tabindex=\"2\" />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t<?php echo $after_widget ?>\n\n<?php\n}", "function wpcareers_display_search(){\n global $_GET, $_POST, $table_prefix, $wpdb, $PHP_SELF;\n\n $wpca_settings = get_option('wpcareers');\n $tpl = wpcareers_display_header();\n if ($message) $tpl->assign('message', $message);\n $results_limit = 10;\n $tpl->assign('results_limit', $results_limit); \n $type = $_POST['type'];\n $search_terms = $_POST['search_terms'];\n $tpl->assign('search_terms',$search_terms);\n if(isset($search_terms)){\n $search_terms = stripslashes($_POST['search_terms']);\n $searchwords = addslashes(htmlspecialchars($search_terms));\n }\n if(!$searchwords){\n $tpl->assign('message', \"You didn't search for anything!\");\n } else {\n if($type == \"jobs\"){\n $list = wpcareers_search_by_job($searchwords);\n } elseif($type == \"resume\"){\n $list = wpcareers_search_by_resume($searchwords);\n } elseif($type == \"all\"){\n $jobList = wpcareers_search_by_job($searchwords);\n $resList = wpcareers_search_by_resume($searchwords);\n $list = array_merge((array)$jobList, (array)$resList);\n }\n $tpl->assign('results', $list);\n //$jp_advanced = wpcareers_create_link(\"searchlink\", array(\"name\"=>'Advanced'));\n //$tpl->assign('jp_advanced', $jp_advanced);\n wpcareers_footer($tpl);\n $tpl->display('search.tpl');\n }\n}", "function wp_ajax_menu_quick_search()\n {\n }", "function honeycomb_handheld_footer_bar_search() {\n\t\t//echo '<a href=\"\">' . esc_attr__( 'Search', 'honeycomb' ) . '</a>';\n\t\t//honeycomb_property_search();\n\t}", "function ajax_search() {\n\t\tglobal $wpdb;\n\t\t$term = (isset($_POST['term']) ? $wpdb->escape($_POST['term']) : false);\n\t\t\n\t\tif($term) {\n\t\t\t$textbins = $this->search($term);\n\t\t} else {\n\t\t\t$textbins = $this->readAll();\n\t\t}\n\t\trequire_once('views/list.php');\n\t\tdie();\n\t}", "function bbp_admin_repair_list_search_form()\n{\n}", "function aprsfisearch_load_widgets() {\r\n\tregister_widget( 'APRSfiSearch_Widget' );\r\n}", "function discy_admin_live_search() {\n\t$search_value = esc_attr($_POST['search_value']);\n\tif ($search_value != \"\") {\n\t\t$search_value_ucfirst = ucfirst(esc_attr($_POST['search_value']));\n\t\t$discy_admin_options = discy_admin_options();\n\t\t$k = 0;\n\t\tif (isset($discy_admin_options) && is_array($discy_admin_options)) {?>\n\t\t\t<ul>\n\t\t\t\t<?php foreach ($discy_admin_options as $key => $value) {\n\t\t\t\t\tif (isset($value[\"type\"]) && $value[\"type\"] != \"content\" && $value[\"type\"] != \"info\" && $value[\"type\"] != \"heading\" && $value[\"type\"] != \"heading-2\" && $value['type'] != \"heading-3\" && ((isset($value[\"name\"]) && $value[\"name\"] != \"\" && (strpos($value[\"name\"],$search_value) !== false || strpos($value[\"name\"],$search_value_ucfirst) !== false)) || (isset($value[\"desc\"]) && $value[\"desc\"] != \"\" && (strpos($value[\"desc\"],$search_value) !== false || strpos($value[\"desc\"],$search_value_ucfirst) !== false)))) {\n\t\t\t\t\t\t$find_resluts = true;\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t\tif ((isset($value[\"name\"]) && $value[\"name\"] != \"\" && (strpos($value[\"name\"],$search_value) !== false || strpos($value[\"name\"],$search_value_ucfirst) !== false))) {?>\n\t\t\t\t\t\t\t<li><a href=\"section-<?php echo esc_html($value[\"id\"])?>\"><?php echo str_ireplace($search_value,\"<strong>\".$search_value.\"</strong>\",esc_html($value[\"name\"]))?></a></li>\n\t\t\t\t\t\t<?php }else {?>\n\t\t\t\t\t\t\t<li><a href=\"section-<?php echo esc_html($value[\"id\"])?>\"><?php echo str_ireplace($search_value,\"<strong>\".$search_value.\"</strong>\",esc_html($value[\"desc\"]))?></a></li>\n\t\t\t\t\t\t<?php }\n\t\t\t\t\t\tif ($k == 10) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isset($find_resluts)) {?>\n\t\t\t\t\t<li><?php esc_html_e(\"Sorry, no results.\",\"discy\")?></li>\n\t\t\t\t<?php }?>\n\t\t\t</ul>\n\t\t<?php }\n\t}\n\tdie();\n}", "function add_search_form($items, $args) {\nif( $args->theme_location == 'main' )\n $items .= '<li class=\"search d-xs-none nav-item\"><a class=\"search_icon nav-link dropdown-item\"><i class=\"fa fa-search pl-1 pr-1\"></i></a><div style=\"display:none;\" class=\"spicewpsearchform\">'. get_search_form(false) .'</div></li>';\n return $items;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation deleteProjectApiKeyAsyncWithHttpInfo Delete project API token
public function deleteProjectApiKeyAsyncWithHttpInfo($project, $tokenId) { $returnType = ''; $request = $this->deleteProjectApiKeyRequest($project, $tokenId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
[ "public function deleteProjectApiKeyWithHttpInfo($project, $tokenId)\n {\n $request = $this->deleteProjectApiKeyRequest($project, $tokenId);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n default:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Ory\\Client\\Model\\ErrorGeneric',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function deleteApikey();", "public function deleteProjectAsyncWithHttpInfo($project_key)\n {\n $returnType = '';\n $request = $this->deleteProjectRequest($project_key);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "function delete_project($token) {\n send(501, ['error' => 'Not yet implemented']);\n}", "public function delete(ApiKey $key);", "public function testDeleteProjectKey()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function delete($project);", "public function teamsProjectsDeleteAsyncWithHttpInfo($account_id, $team_id, $id, $x_phrase_app_otp = null)\n {\n $returnType = '';\n $request = $this->teamsProjectsDeleteRequest($account_id, $team_id, $id, $x_phrase_app_otp);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function deleteProject(Project $project);", "public function purgeProjectWithHttpInfo($projectId)\n {\n $request = $this->purgeProjectRequest($projectId);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Ory\\Client\\Model\\GenericError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Ory\\Client\\Model\\GenericError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Ory\\Client\\Model\\GenericError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n default:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Ory\\Client\\Model\\GenericError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function deleteApiProduct(string $consumerKey, string $apiProduct): AppCredentialInterface;", "function projectDelete($project_id){\r\n\t\t$method='project.delete';\r\n\t\t$tags=array(\r\n\t\t\t'project_id'=>$project_id\r\n\t\t);\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response);\r\n\t\treturn $obj;\r\n\t}", "public function deleted(ApiKey $apiKey)\n {\n //\n }", "public function teamsProjectsDeleteWithHttpInfo($account_id, $team_id, $id, $x_phrase_app_otp = null)\n {\n $request = $this->teamsProjectsDeleteRequest($account_id, $team_id, $id, $x_phrase_app_otp);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function deleteLayerAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $returnType = '';\n $request = $this->deleteLayerRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function jobKeysDeleteWithHttpInfo($project_id, $id, $x_phrase_app_otp = null, $branch = null, $translation_key_ids = null)\n {\n $request = $this->jobKeysDeleteRequest($project_id, $id, $x_phrase_app_otp, $branch, $translation_key_ids);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function deleteApiKey($apiKey) {\n DB::table($this->_tableName)->where('ApiKey', $apiKey)->delete();\n }", "public function deleteDeleteTeamProjectAsyncWithHttpInfo($id, $project_id)\n {\n $returnType = '\\Swagger\\Client\\Model\\Team';\n $request = $this->deleteDeleteTeamProjectRequest($id, $project_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function revoke( ApiKey $api_key );" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Load user password or return null if not found.
function ioLoadUserPassword($uid) { global $res_users; include($res_users.'/accounts.php'); if (isset($passwords[$uid])) return $passwords[$uid]; return null; }
[ "private function getUserPassword() {\n return $this->userPassword;\n }", "protected function readPassword()\n {\n return F::read($this->root() . '/.htpasswd');\n }", "public function loadUserByCredentials($login, $password);", "function getUserPassword() { return $this->_userpassword; }", "public function getFieldPassword()\n\t{\n\t\treturn $this->GetDAL()->GetField(DotCoreUserDAL::USER_PASSWORD);\n\t}", "protected function getConfiguredPassword() {}", "public function getPassword() {}", "public function getPassword(): ?string\n {\n return $this->parsedUrlParts['password'] ?? null;\n }", "public function getUser_password()\n {\n return $this->user_password;\n }", "public function getPassword();", "public function getUserPassword()\n\t{\n\t\treturn $this->user_password;\n\t}", "public function getUserPassword()\n {\n return $this->userPassword;\n }", "function get_ldap_bind_password()\n\t{\n\t\tif($this->user_setting_exists(\"ldap_password\"))\n\t\t\treturn $this->get_user_setting(\"ldap_password\");\n\t\telse\n\t\t{\n\t\t\t// Resume existing session (if any exists) in order to get\n\t\t\t// currently logged in user\n\t\t\tif(!isset($_SESSION)) session_start();\n\n\t\t\treturn base64_decode($_SESSION[\"LOGIN_PASSWORD\"]);\n\t\t}\n\t}", "public function getUser_pass()\n {\n return $this->user_pass;\n }", "public function getPassword()\n {\n return isset($this->password) ? $this->password : null;\n }", "public static function password()\n {\n return Config::get('auth.password', 'password');\n }", "public function obtain_password_user(){\n\t\t$con=$this->conexion();\n\t\t//select statement using bind params\n\t\t$sql=$con-> prepare(\"\");\n\t\t$sql->bind_param();\n\t\t$sql->execute();\n\t\t$sql->bind_result($password);\n\t\t$sql->fetch();\n\t\t$sql->close();\n\t\treturn $password;\n\t}", "public function getDefaultPassword(): string|null;", "public function getPassword()\n {\n return isset($this->Password) ? $this->Password : null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the last change author
function getLastchangeAuthor() { return $this->get("lastchangeauthor"); }
[ "public function getVersionAuthor()\n {\n return $this->logs->last()->getUsername();\n }", "function get_the_modified_author() {\n\tif ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {\n\t\t$last_user = get_userdata($last_id);\n\n\t\t/**\n\t\t * Filters the display name of the author who last edited the current post.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $last_user->display_name The author's display name.\n\t\t */\n\t\treturn apply_filters('the_modified_author', $last_user->display_name);\n\t}\n}", "public function getRevisionAuthor();", "public function getlatestAuthorAttribute()\n {\n if ($this->latestMessage) {\n $last_message = $this->messages()->latest()->first();\n $author = $last_message->user;\n $user = AuthHelper::me();\n\n if ($author == $this->creator() && $author == $user) {\n return trans('chat.you');\n } else {\n return '';\n }\n } else {\n return '';\n }\n }", "public function getLastCommentAuthor()\n {\n return $this->last_comment_author;\n }", "public function getLastChangeUser()\n\t{\n\t\treturn $this->last_change_user;\n\t}", "public function get_author()\n {\n return 'Kamen Blaginov / Chris Graham / temp1024';\n }", "public function getAuthor() : string\n {\n return $this->author;\n }", "function GetAuthor()\r\n\t{\r\n\t\treturn \"Pierre-Luc Germain (plger on the forge & forum)\";\r\n\t}", "public static function getAuthor()\n {\n self::setLastTag('author');\n return self::$tags[self::getLastTag()];\n }", "function get_the_author_lastname()\n {\n }", "function get_the_author_lastname() {}", "public function getTodoAuthor() : string {\n\t\treturn($this->todoAuthor);\n\t}", "public static function author() {\n return self::getByName('author');\n }", "public function getAuthor() {\n\t\t\treturn $this->MODULE_AUTHOR;\n\t\t}", "public function getVersionAuthorUserName()\n {\n if ($this->cvAuthorUID > 0) {\n $app = Facade::getFacadeApplication();\n $db = $app->make('database')->connection();\n\n return $db->fetchColumn('select uName from Users where uID = ?', array(\n $this->cvAuthorUID,\n ));\n }\n }", "function getLastRevisionBy() {\n $last_revision = $this->getLastRevision();\n return instance_of($last_revision, 'Attachment') ? $last_revision->getCreatedBy() : null;\n }", "public function get_author() {\n\t\treturn $this->get_data( 'Author' );\n\t}", "public function getAuthor()\n {\n return $this->author;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function : iframe return an iframe with content Input : content url, name of the frame Returns : String
function iframe($str_url,$name,$Iframe_Width = '100%',$Iframe_Height = '350') { $_GLOBAL["str_backdir"] = '../'; $name_id = "NAME='ifrm' id='ifrm'"; $ret_var = ''; if ($str_url) { $ret_var = "<IFRAME SRC='" . $_GLOBAL["str_backdir"] . "$str_url' TITLE='$name' WIDTH='$Iframe_Width' HEIGHT='$Iframe_Height' $name_id FRAMEBORDER='0'�MARGINWIDTH='0' MARGINHEIGHT='0'> <!-- Alternate content for non-supporting browsers --> <H2>Start using Firefox or something else that supports Iframes</H2> </IFRAME>"; } return $ret_var; }
[ "function get_frame($page_url){\n\t\treturn $my_value = '<iframe name=\"frm_page\" frameborder=\"0\" height=\"100%\" width=\"100%\" scrolling=\"auto\" src=\"' . $page_url . '\" > Or!Frame</iframe>';\n\t}", "function clyp_iframe($url, $width, $height) {\n\t$html = '<iframe width=\"' . $width . '\" height=\"' . $height . '\" \n\t\tsrc=\"https://clyp.it/' . $url . '/widget\" frameborder=\"0\"></iframe>';\n\n\treturn $html;\n}", "function iframe_response($iframe_name = 'iframe_response') {\n\treturn '<iframe src=\"about:blank\" id=\"' . $iframe_name . '\" name=\"' . $iframe_name . '\" style=\"width:0; height:0; border: 0px #fff solid\"></iframe>';\n}", "function GetFrame($i){}", "abstract protected function getIframePattern();", "public function iframe($url)\n {\n echo \"<iframe style='display: block; width: 100%; height: 200px;' onload='resizeIframe(this)' src='$url'></iframe>\";\n }", "private static function get_valid_iframe_html() {\n $iframedomains = get_records_menu('iframe_source_icon', '', '', 'name');\n if (empty($iframedomains)) {\n return '';\n }\n\n $data = array();\n foreach ($iframedomains as $name => $host) {\n $data[$name] = array(\n 'name' => $name,\n 'url' => 'http://' . $host,\n 'icon' => favicon_display_url($host),\n );\n }\n\n $smarty = smarty_core();\n $smarty->assign('data', $data);\n return $smarty->fetch('blocktype:externalvideo:sitelist.tpl');\n }", "public function get_browser_iframe_html(){\n\t\tglobal $CFG;\n\t\t//get the default video title\n\t\t$videotitle = $this->get_video_title();\n\t\t\n\t\t//prepare the URL to our uploader page that will be loaded in an iframe\n\t\t$src = $CFG->httpswwwroot . $this->config->get('modroot') . '/browser.php';\n\t\t$src .= '?videotitle=' . urlencode($videotitle);\n\t\t\n\t\t//Here we make up the HTML for the browser iframe.\n\t\t$browserhtml = \"<div class='scroller'>\";\n\t\t$browserhtml .= \"<iframe src='$src' width='540' height='350' frameborder='0'></iframe>\";\n\t\t$browserhtml .= \"</div>\"; \n\t\t\n\t\treturn $browserhtml;\n\t}", "function HtmlIFrame($name, $link, $width, $height, $extra=\"\") {\n echo \"<iframe\";\n echo \" name='$name' src='$link' width='$width' height='$height' frameborder='0'\";\n if ( $extra ) echo \" $extra\";\n echo \"></iframe>\\n\";\n }", "public function getIframe()\n {\n return $this->iframe;\n }", "function iframe($src,$id,$attrs='')\n\t{\n\t\treturn self::_('iframe','',$id,self::attrs(\n\t\t\tarray(\t'src'=>$src,\n\t\t\t\t'frameborder'=>\"0\",\n\t\t\t\t'marginwidth'=>\"0\",\n\t\t\t\t'marginheight'=>\"0\"),$attrs));\n\t}", "function ag_iframe($atts, $content) {\n if (!$atts['width']) { $atts['width'] = 630; }\n if (!$atts['height']) { $atts['height'] = 1500; }\n\n return '<iframe border=\"0\" class=\"shortcode_iframe\" src=\"' . $atts['src'] . '\" width=\"' . $atts['width'] . '\" height=\"' . $atts['height'] . '\"></iframe>';\n}", "function iframe_wrapper($content) {\n // match any iframes\n $pattern = '~<iframe.*?<\\/iframe>|<embed.*?<\\/embed>~';\n preg_match_all($pattern, $content, $matches);\n\n foreach ($matches[0] as $match) {\n // Check if it is a video player iframe\n if (strpos($match, 'youtu') || strpos($match, 'vimeo')) {\n // wrap matched iframe with div\n $wrappedframe = '<div class=\"responsive-embed widescreen\">' . $match . '</div>';\n //replace original iframe with new in content\n $content = str_replace($match, $wrappedframe, $content);\n }\n }\n\n return $content;\n}", "function iframe($id){\r\n\t\t//$this->set(\"id\",$id);\r\n\t\t$this->Widget->id = $id;\r\n\t\t$widg = $this->Widget->read();\r\n\t\t//$output = array(\"name\"=>$widg['Widget']['name'], \"widgetcode\"=>$widg['Widget']['admin_xhtml'], \"id\"=>$widg['Widget']['id'], \"type\"=>$widg['Widget']['type'] );\r\n\t\t$this->set('output',$widg['Widget']['admin_xhtml']);\r\n\t\t$this->render('iframe','ajax');\r\n\t}", "public static function iframe($value = NULL)\n\t{\n\t\tif ($value === NULL)\n\t\t{\n\t\t\treturn Ku_AJAX::$iframe;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tKu_AJAX::$iframe = $value;\n\t\t}\n\t}", "public function iframe()\n\t{\n\t\treturn wp_iframe( array($this, 'render_list_page') );\n\t}", "function add_frame($path,$name)\n {\n $obj =& get_instance();\n $base = $base = _is_secure() ? $obj->config->item('base_url') : $obj->config->item('base_url');\n $index_page = $obj->config->item('index_page');\n if (!empty($index_page)) $base .= $index_page.\"/\";\n\n return '<frame src=\"'.$base.$path.'\" name=\"'.$name.'\" scrolling=\"auto\" noresize=\"noresize\" />';\n }", "function switchToIFrame($name = null)\n {\n \n }", "public function switchToIframe($name) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('switchToIframe', func_get_args()));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests build() method with wrong model class.
public function testBuildMethodWithWrongModelClass() { $table = $this->getFakeTable(); $formRequestFactory = $this->getFormRequestFactory($table); $formRequestFactoryConfig = $this->getFormRequestFactoryConfig(); $formRequestFactoryConfig->modelClassName = Carbon::class; $this->expectExceptionMessage('Class [Carbon\Carbon] is not a valid Model class name'); $formRequestFactory->configure($formRequestFactoryConfig)->build();; }
[ "public function testBuild(): void\n {\n $expected = new RequestStub();\n $provider = new Provider('id', 'name');\n\n $serializer = new SerializerStub($expected);\n $validator = new ObjectValidatorStub();\n $builder = $this->getBuilder($serializer, $validator);\n\n $result = $builder->build(RequestStub::class, $provider, '');\n\n self::assertSame($expected, $result);\n }", "public function testModelMustHaveCorrispondingBuilder() {\n $this->expectException(\\Illuminate\\Database\\Eloquent\\Exception\\MissingBuilderException::class);\n\n $userModel = new \\Illuminate\\Database\\Eloquent\\Test\\Valid\\Model\\MissingBuilder();\n $userQuery = $userModel->newQuery();\n }", "public function testModelReturnsBuilder(): void\n {\n $builder = Builder::model(ModelTest::class);\n $this->assertInstanceOf(Builder::class, $builder);\n }", "public function testModelMustHaveValidCorrispondingBuilder() {\n $this->expectException(\\Illuminate\\Database\\Eloquent\\Exception\\BuilderNotBuilderException::class);\n\n $userModel = new \\Illuminate\\Database\\Eloquent\\Test\\Valid\\Model\\InvalidBuilder();\n $userQuery = $userModel->newQuery();\n }", "public function testGetUnknownModel()\n {\n $this->assertInstanceOf('\\Phue\\SensorModel\\UnknownModel', \n SensorModelFactory::build('whatever'));\n }", "public function testFailingBuild() {\n $this->setExpectedException('\\notifyy\\Exception', \\notifyy\\Exception::UNKNOWN_ADAPTER);\n Builder::build('test');\n }", "public function testGetBuild(): void\n {\n $model = OsVersion::load([\n \"build\" => \"build\",\n ], $this->container);\n\n $this->assertSame(\"build\", $model->getBuild());\n }", "public function testBuildException()\n {\n $this->merchantDataBuilder->build(['payment' => null]);\n }", "public function test_create__invalid_class()\n {\n\n (new ElementFactory())->create(['attributes' => ['type' => ElementFactory::class, 'name' => '']]);\n }", "public function test_builder_class()\n {\n $builder = new Builder();\n $this->assertInstanceOf(Builder::class, $builder);\n }", "public function testGetModelByClass()\n {\n $this->todo('stub');\n }", "abstract protected function _build();", "public function testBuildException()\n {\n $this->paymentTokenBuilder->build(['payment' => null]);\n }", "protected function build() {\n // do nothing in most cases\n }", "public function testBuildForMisconfiguredProduct()\n {\n $itemId = 1;\n $buyRequest = ['product' => 123];\n $store = $this->getMockBuilder(\\Magento\\Store\\Api\\Data\\StoreInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $store->expects($this->atLeastOnce())->method('getId')->willReturn(1);\n $this->storeManager->expects($this->atLeastOnce())->method('getStore')->willReturn($store);\n $item = $this\n ->getMockBuilder(\\Magento\\RequisitionList\\Api\\Data\\RequisitionListItemInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $this->requisitionListItemLocator->expects($this->once())->method('getItem')->willReturn($item);\n $this->productHelper->expects($this->once())->method('addParamsToBuyRequest')\n ->willReturn(new \\Magento\\Framework\\DataObject($buyRequest));\n $typeInstance = $this->getMockBuilder(\\Magento\\Catalog\\Model\\Product\\Type\\AbstractType::class)\n ->disableOriginalConstructor()\n ->getMock();\n $product = $this->getMockBuilder(\\Magento\\Catalog\\Model\\Product::class)\n ->disableOriginalConstructor()\n ->setMethods(['getTypeInstance'])\n ->getMock();\n $product->expects($this->atLeastOnce())->method('getTypeInstance')->willReturn($typeInstance);\n $typeInstance->expects($this->atLeastOnce())->method('processConfiguration')->willReturn('error message');\n $this->productRepository->expects($this->atLeastOnce())->method('getById')->willReturn($product);\n\n $this->assertEquals([], $this->builder->build($buyRequest, $itemId, true));\n }", "public function testGetRelatedBuildTypes()\n {\n }", "public function testConstructMagicMethodWithoutModel()\n {\n $this->setExpectedException('UnexpectedValueException');\n\n $request = $this->container->get(self::REQUEST);\n\n $response = $this->container->get(self::RESPONSE);\n\n new NoModelController($request, $response);\n }", "public function testBuildsUpdateInstance()\n {\n }", "public function testWithInvalidModel(): void\n {\n $this->expectException(BadMethodCallException::class);\n $this->expectExceptionMessage('Call to undefined method ' . Movie::class . '::meiliSettings()');\n\n $this->app->make(SynchronizesModel::class)(Movie::class);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A Academic Term Has Many Assessment Setups
public function assessmentSetups(){ return $this->hasMany(AssessmentSetup::class, 'academic_term_id'); }
[ "public function assessments(){\n return $this->hasMany(Assessment::class, 'subject_classroom_id');\n }", "function insert_assessments()\n\t{\n\t\tforeach($this->assessments AS $assessment)\n\t\t{\n\t\t\t$unitID = $assessment->unitID;\n\t\t\t$criteria = $assessment->criteria;\n\t\t\tif($unitID != -1)\n\t\t\t{\n\t\t\t\t$criteria->insert_criteria($unitID);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we are just adding it to the qualification\n\t\t\t\t$criteria->insert_criteria_on_qual($unitID, $this->id);\n\t\t\t}\n\t\t}\n\t}", "public function assitences(){\n return $this->hasMany('App\\Models\\Assistence','training_id');\n }", "public function assessments(){\n return $this->hasMany('App\\Assessment');\n }", "protected function setSubjects() {\n $subj = array();\n foreach ($this->formulas as $formula) {\n $subj[$formula->getSubject()] = 1;\n }\n $this->subjects = array_keys($subj);\n }", "public function academicTerm(){\n return $this->belongsTo(AcademicTerm::class, 'academic_term_id');\n }", "public function renderAcademic() {\n\t\t$basisRetnd = $this->std->getBasisRetained();\n\t\t$assessmtns = $this->std->getFormativeAssessments();\n\t\t$taks = $this->std->getTaks();\n\t\t$subjects = $this->std->getSubjectsAndGrades();\n\t\t$tblSubjects = RCTable::factory('[border: 1px solid block; width: 400px;]')\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Subjects and Current Grades*', '.hr', 2)\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Subject' , '.hr')\n\t\t\t->addCell('Grade or Score', '.next-hr');\n\t\t# add rows\n\t\tforeach ($subjects as $row) {\n\t\t\t$tblSubjects->addRow('.row')\n\t\t\t\t->addCell('<i>' . $row['subject'] . '</i>', '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['score'] . '</i>' , '.cellBorder');\n\t\t}\n\n\t\t$layout = RCLayout::factory()\n\t\t\t->newLine()\n\t\t\t->addText('V. Academic Information:', $this->titleStyle())\n\t\t\t->newLine()\n\t\t\t->addObject($tblSubjects);\n\n\t\t$this->addYN($layout->newLine('.martop10'), $basisRetnd['retained']);\n\t\t$layout->addText(\n\t\t\t'Has the student been retained? <i>If yes, when and what was the basis: ' . $basisRetnd['basis'] . '</i>'\n\t\t\t, '.padtop5'\n\t\t);\n\n\t\t$tblAssessmnts = RCTable::factory('.table')\n\t\t\t->setCol('100px')\n\t\t\t->setCol('')\n\t\t\t->setCol()\n\t\t\t->setCol('100px')\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Formative Assessment', '.hr', 4)\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Date' , '.hr')\n\t\t\t->addCell('Name of Test', '.next-hr')\n\t\t\t->addCell('Subject Area', '.next-hr')\n\t\t\t->addCell('Grade/Score' , '.next-hr');\n\n\t\tforeach ($assessmtns as $row) {\n\t\t\t$tblAssessmnts->addRow('.row')\n\t\t\t\t->addCell('<i>' . $row['date'] . '</i>' , '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['testname'] . '</i>', '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['subjarea'] . '</i>', '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['score'] . '</i>' , '.cellBorder');\n\t\t}\n\n\t\t$tblTaks = RCTable::factory('.table')\n\t\t\t->setCol('100px')\n\t\t\t->setCol('')\n\t\t\t->setCol()\n\t\t\t->setCol('100px')\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Texas Assessment of Knowledge and Skills (TAKS)', '.hr', 4)\n\t\t\t->addRow('.row')\n\t\t\t->addCell('Date' , '.hr')\n\t\t\t->addCell('Subject' , '.next-hr')\n\t\t\t->addCell('Total Test Mastery', '.next-hr')\n\t\t\t->addCell('Scaled Score' , '.next-hr');\n\n\t\tforeach ($taks as $row) {\n\t\t\t$tblTaks->addRow('.row')\n\t\t\t\t->addCell('<i>' . $row['date'] . '</i>' , '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['subject'] . '</i>', '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['case'] . '</i>' , '.cellBorder')\n\t\t\t\t->addCell('<i>' . $row['score'] . '</i>' , '.cellBorder');\n\t\t}\n\n\t\t$layout->newLine('.martop10')\n\t\t\t->addObject($tblAssessmnts)\n\t\t\t->newLine()\n\t\t\t->addObject($tblTaks);\n\n\t\t$this->rcDoc->addObject($layout);\n\t}", "public function exams()\n {\n return $this->morphedByMany(Exam::class, 'subjectables');\n }", "public function exam_questions_anwser_choices()\n {\n return $this->hasMany(ExamQuestionsChoices::class, 'exam_question_id');\n }", "public function assessmentSetup(){\n return $this->belongsTo(AssessmentSetup::class, 'assessment_setup_id');\n }", "public function get_formal_assessments()\n { return Project::project_exist_for_qual($this->id);\n }", "public function getAssessment()\n {\n return $this->hasOne(Assessments::className(), ['id' => 'assessment_id']);\n }", "public function AllAssessments()\n {\n return $this->hasManyThrough(\n 'App\\Patient\\PatientPhaseAssessments', 'App\\Patient\\PatientPhases',\n 'therapy_plan_templates_id', 'phases_id', 'id'\n );\n }", "public function termAdmitted(){\n return $this->belongsTo(AcademicTerm::class, 'admitted_term_id');\n }", "public function assessments()\n {\n return $this->hasMany(EmployeeSalaryAssessment::class);\n }", "function getAllAssessment() {\n\n\t\treturn $this->man_course->getAllCourses(false, $this->courseType());\n\t}", "public function athleteEvaluation()\n {\n return $this->belongsTo(AthleteEvaluation::class);\n }", "public function expertises()\n {\n return $this->hasMany(TalentExpertise::class);\n }", "public function educationalQualification()\n {\n return $this->hasOne(EducationalQualification::class);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the onetailed probability of the chisquared distribution. The chisquared distribution is associated with a chisquared test. Use the chisquared test to compare observed and expected values. Adapted from: Hill, I. D. and Pike, M. C. Algorithm 299 Collected Algorithms for the CACM 1967 p. 243 Updated for rounding errors based on remark in ACM TOMS June 1985, page 185
public function chiDist ($x, $df) { $LOG_SQRT_PI=log(sqrt(pi())); $I_SQRT_PI=1 / sqrt(pi()); // define(LOG_SQRT_PI, log(sqrt(pi()))); // define(I_SQRT_PI, 1 / sqrt(pi())); if ($x <= 0 || $df < 1) { $result = 1; } $a = $x / 2; if ($df % 2 == 0) { $even = true; } else { $even = false; } if ($df > 1) { $y = exp(-1 * $a); } if ($even) { $s = $y; } else { $s = 2 * $this->normCDF(-1 * sqrt($x)); } if ($df > 2) { $x = ($df - 1) / 2; if ($even) { $z = 1; } else { $z = 0.5; } if ($a > 20) { if ($even) { $e = 0; } else { $e = $LOG_SQRT_PI; } $c = log($a); while ($z <= $x) { $e += log($z); $s += exp($c * $z - $a - $e); $z += 1; } $result = $s; } else { if ($even) { $e = 1; } else { $e = $I_SQRT_PI / sqrt($a); } $c = 0; while ($z <= $x) { $e *= ($a / $z); $c += $e; $z += 1; } $result = $c * $y + $s; } } else { $result = $s; } return $result; }
[ "function critchi($p,$df) { \n $minchisq = 0.0;\n $maxchisq = $this->CHI_MAX;\n $chisqval = null;\n\n if($p <= 0.0) { \n return $maxchisq;\n } else if( $p >= 1.0 ) { \n return 0.0;\n }\n\n $chisqval = $df / sqrt($p); // Whatevs, just the first value.\n while( $maxchisq - $minchisq > $this->CHI_EPSILON ) { \n if( $this->pochisq($chisqval, $df) < $p) { \n $maxchisq = $chisqval;\n } else { \n $minchisq = $chisqval;\n }\n $chisqval = ($maxchisq + $minchisq) * 0.5;\n }\n\n return $chisqval;\n }", "function chiDist ($x, $df)\n {\n define(LOG_SQRT_PI, log(sqrt(pi())));\n define(I_SQRT_PI, 1 / sqrt(pi()));\n\n if ($x <= 0 || $df < 1) {\n $result = 1;\n }\n\n $a = $x / 2;\n\n if ($df % 2 == 0) {\n $even = true;\n } else {\n $even = false;\n }\n\n if ($df > 1) {\n $y = exp(-1 * $a);\n }\n\n if ($even) {\n $s = $y;\n } else {\n $s = 2 * normCDF(-1 * sqrt($x));\n }\n\n if ($df > 2) {\n $x = ($df - 1) / 2;\n\n if ($even) {\n $z = 1;\n } else {\n $z = 0.5;\n }\n\n if ($a > 20) {\n if ($even) {\n $e = 0;\n } else {\n $e = LOG_SQRT_PI;\n }\n\n $c = log($a);\n\n while ($z <= $x) {\n $e += log($z);\n $s += exp($c * $z - $a - $e);\n $z += 1;\n }\n\n $result = $s;\n } else {\n if ($even) {\n $e = 1;\n } else {\n $e = I_SQRT_PI / sqrt($a);\n }\n\n $c = 0;\n\n while ($z <= $x) {\n $e *= ($a / $z);\n $c += $e;\n $z += 1;\n }\n\n $result = $c * $y + $s;\n }\n } else {\n $result = $s;\n }\n\n return $result;\n }", "function chiTest ($table)\n {\n $total = 0;\n $chi = 0;\n\n foreach ($table as $category => $row) {\n foreach ($row as $sample => $cell) {\n if (isset($rows[$category])) {\n $rows[$category] += $cell;\n } else {\n $rows[$category] = $cell;\n }\n\n if (isset($cols[$sample])) {\n $cols[$sample] += $cell;\n } else {\n $cols[$sample] = $cell;\n }\n\n $total += $cell;\n }\n }\n\n $r = count($rows);\n $c = count($cols);\n $df = ($r - 1) * ($c - 1);\n\n $expected = array();\n\n foreach ($table as $category => $row) {\n foreach ($row as $sample => $cell) {\n // fo frequency of the observed value\n // fe frequency of the expected value\n $fo = $cell;\n $fe = ($rows[$category] * $cols[$sample]) / $total;\n $chi += pow($fo - $fe, 2) / $fe;\n\n $expected[$category][$sample] = $fe;\n }\n }\n\n return array('chi'=>$chi, 'df'=>$df, 'expected'=>$expected);\n }", "public function chiTest ($table)\n {\n $total = 0;\n $chi = 0;\n\n foreach ($table as $category => $row) {\n foreach ($row as $sample => $cell) {\n if (isset($rows[$category])) {\n $rows[$category] += $cell;\n } else {\n $rows[$category] = $cell;\n }\n\n if (isset($cols[$sample])) {\n $cols[$sample] += $cell;\n } else {\n $cols[$sample] = $cell;\n }\n\n $total += $cell;\n }\n }\n\n $r = count($rows);\n $c = count($cols);\n $df = ($r - 1) * ($c - 1);\n\n $expected = array();\n\n foreach ($table as $category => $row) {\n foreach ($row as $sample => $cell) {\n // fo frequency of the observed value\n // fe frequency of the expected value\n $fo = $cell;\n $fe = ($rows[$category] * $cols[$sample]) / $total;\n $chi += pow($fo - $fe, 2) / $fe;\n\n $expected[$category][$sample] = $fe;\n }\n }\n\n return array('chi'=>$chi, 'df'=>$df, 'expected'=>$expected);\n }", "function stats_rand_gen_chisquare($df)\n{\n}", "public function getDefensivePowerRatio(Dominion $dominion);", "function powrand($growth,$probability,$n){\n\t/* left here for your entertainment the fun magic structural constant 1/137 */\n\t$powar= 1.0;\n\t$power= 1.0;\n\twhile($n-->0 && rand(1,137)<= 137*$probability){\n\t\t$powar= $power;\n\t\t$power*= $growth;\n\t\t//defined('DEBUG') and DEBUG and $GLOBALS['debugmsgs'][] = \"powrand($growth,$probability,$n) = ($powar,$power)\";\n\t}\n\t$fudge= rand(0,136)/137;\n\treturn rand( (int)(137.0*($powar+$fudge)), (int)(137.0*($power+$fudge)) )/137.0;\n}", "public function getDesiredProbabilityDistribution();", "public function getOffensivePowerRatio(Dominion $dominion);", "public function getGoodnessOfFit($dp = 0)\n {\n if ($dp != 0) {\n return round($this->goodnessOfFit, $dp);\n }\n\n return $this->goodnessOfFit;\n }", "function calcCritChanceUpgradeCost()\n\t{\n\t\t$aveDieDamage = ($this->DamageDie / 2) + 0.5;\n\t\t$aveDamage = ($aveDieDamage * $this->DamageQuantity) + $this->DamageOffset;\n\t\t$ave100 = $aveDamage * (100 + ($this->CritChance + 1));\n\t\t\n\t\treturn ceil($ave100);\n\t}", "function fitness($coursesExpected, $coursesSuggested){\n \n $totalFitness = 0.0;\n\n //adds 1/the rank of the course in the list.\n foreach($coursesExpected as $course){\n $totalFitness += 1/(array_search($course,$coursesSuggested));\n }\n\n return $totalFitness;\n }", "public function getPopulationPeasantPercentage(Dominion $dominion);", "public function getDefensivePowerRatioRaw(Dominion $dominion);", "public function getProbabilityToCatch()\n {\n return 25;\n }", "function getExpectedWinPct($ratingA,$ratingB) \n {\n $exp = ($ratingB - $ratingA) / ELO_DIVISOR;\n return 1 / (1 + pow(10, $exp)); \n }", "public function getSpyRatioMultiplier(Dominion $dominion): float\n {\n $multiplier = 0;\n\n // Racial bonus\n $multiplier += $dominion->race->getPerkMultiplier('spy_strength');\n\n // Wonder: Great Oracle (+30%)\n // todo\n\n return (1 + $multiplier);\n }", "public function calculateProfitability()\n {\n if (!$this->criminalInfo) {\n return 0.0;\n }\n\n $reward = $this->criminalInfo->getReward();\n $dangerPoints = $this->criminalInfo->getDangerPoints();\n\n return floatval($reward) / floatval($dangerPoints);\n }", "private function testGoldbachsOtherConjecture($upper_bound){\n $answer = 0;\n for ($i = 3; $i < $upper_bound; $i = $i+2) { \n if (! $this->isPrime($i)) {\n // echo \"\\nTesting $i to see if it fits Goldbach's other conjecture\\n\"; // debug\n $found = false;\n for ($p = 3; $p < $i; $p = $p+2) { \n if (! $this->isPrime($p)) { continue; }\n $tw_sq = $i - $p;\n if ($tw_sq < 2) { break; }\n $sq = $tw_sq / 2;\n // echo \"prime is $p, sqr_rt is \".sqrt($sq).\"\\n\"; // debug\n if (($sq == floor($sq)) && (sqrt($sq) == floor(sqrt($sq)))) {\n // echo \"For $i, prime is $p and square root is $sq\\n\"; // debug\n $found = true;\n break;\n } \n }\n if (!$found) {\n $answer = $i;\n // echo \"$i is an odd composite that does not fit the conjecture\\n\"; // debug\n break;\n }\n }\n }\n return ($answer > 0) ? $answer : \"not found\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that a transaction can be invoked.
public function testIsInvokable() { $command = new Transactional(); $transaction = new Transaction($command, new Dispatcher($this->app), new Connection()); $this->assertInstanceOf(Contract::class, $command, 'A command that should be run in a transaction must implement the '.Contract::class.' interface.'); $this->assertInstanceOf(Invokable::class, $transaction, 'A transaction must implement the '.Invokable::class.' interface.'); $this->assertInstanceOf(Runnable::class, $transaction, 'A transaction must implement the '.Runnable::class.' interface.'); $this->assertSame($transaction->run(), $transaction(), 'When a transaction is invoked it should run the transaction.'); $this->assertSame($transaction->run(), $command(), 'When a transaction is invoked it should run the command.'); }
[ "abstract function supportsTransactions();", "public function supports_transactions ();", "public function testNoTransaction()\n {\n $this->assertFalse($this->_object->isTransaction());\n }", "public function testGetTransaction()\n {\n putenv('DB_CONNECTION=sqlite_testing');\n\n $user = factory(\\App\\User::class)->make();\n\n $this->be($user);\n\n $user->save();\n\n $item = factory(\\App\\item::class)->make();\n\n $item->save();\n\n Log::shouldReceive('info');\n\n $repository = new Repositories\\TransactionRepository(new Transaction);\n $repository->insert($user->email, $item->id, '', 0);\n\n $this->assertDatabaseHas('transactions', [\n 'email' => $user->email,\n 'item_fk'=>$item->id,\n 'tokens_spent'=>0\n ]);\n\n $transaction = $repository->get($user->email, $item->id);\n \n $this->assertTrue($transaction->email = $user->email && $transaction->item_fk = $item->id);\n }", "public function isUnderTransaction();", "public function testTransaction2()\n {\n }", "public function testAdjustTransaction()\n {\n }", "public function testBeginTransaction()\n {\n $this->assertTrue($this->_object->beginTransaction());\n $this->assertTrue($this->_object->isTransaction());\n }", "public function testTransactionRaw()\n {\n }", "public function supportsTransactions(): bool;", "public function isUnderTransaction(){ }", "public function testTransactionPost()\n {\n }", "public function testPayinTransaction()\n {\n }", "public function ensureTransaction(): void;", "public function testPostTransactions()\n {\n }", "public function testAdjustTransaction1()\n {\n }", "public function test1()\n {\n try\n {\n $this->db->beginTransaction();\n $this->db->beginTransaction();\n $this->db->commit();\n $this->db->beginTransaction();\n $this->db->commit();\n $this->db->commit();\n }\n catch ( ezcDbTransactionException $e )\n {\n $this->fail( \"Exception (\" . get_class( $e ) . \") caught: \" . $e->getMessage() );\n }\n }", "public function testTransactionNested() {\n\t\t$conn = $this->getMock('MockPDO');\n\t\t$db = new DboTestSource();\n\t\t$db->setConnection($conn);\n\t\t$db->useNestedTransactions = true;\n\t\t$db->nestedSupport = true;\n\n\t\t$conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true));\n\t\t$conn->expects($this->at(1))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(2))->method('exec')->with($this->equalTo('RELEASE SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(3))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(4))->method('exec')->with($this->equalTo('ROLLBACK TO SAVEPOINT LEVEL1'))->will($this->returnValue(true));\n\t\t$conn->expects($this->at(5))->method('commit')->will($this->returnValue(true));\n\n\t\t$this->_runTransactions($db);\n\t}", "public function testEditTransaction()\r\n {\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the name of the nearest celestial the kill happened
public function getNearestCelestialName() { if(!isset($this->nearestCelestial)) { $this->calculateNearestCelestial(); } if(isset($this->nearestCelestial)) { return $this->nearestCelestial->getName(); } return null; }
[ "public function getKill() {\n return $this->kill;\n }", "public function onKill()\n {\n }", "function char_kills($char_id) {\n\t$info = char_info($char_id);\n\treturn $info['kills'];\n}", "public function getKillNum()\n {\n $value = $this->get(self::KILL_NUM);\n return $value === null ? (integer)$value : $value;\n }", "function kill_gangster($name) {\n\t\t$gangster = $this -> find_gangster_by_name_in_mafia($name);\n\t\tif (isset($gangster)) {\n\t\t\t$this -> hide_all_subordinates($gangster);\n\t\t\t$this -> promote_oldest_subordinate($gangster);\n\t\t}\n\t}", "function cycleDestroyed($name)\n{\n global $game;\n \n if (count($game->cycles) > 0)\n {\n foreach ($game->cycles as $cycle)\n {\n if ($cycle)\n {\n if ($cycle->player->log_name == $name)\n {\n if ($cycle->alive)\n {\n // give the cycle its survival time\n $cycle->survivalTime = $game->timer->gameTimer();\n \n $cycle->alive = false;\n \n // announce\n cm(\"zombie_challenge_survival_time\", array($cycle->player->screen_name, $cycle->survivalTime));\n }\n break;\n }\n }\n }\n }\n}", "public function kills()\n\t{\n\t\treturn $this->fetch('top_10_kills');\n\t}", "function getNpcName($nameid)\n{\n global $tabGatherInfos;\n \n $key = strtoupper($nameid);\n \n if (isset($tabGatherInfos[$key]))\n return $tabGatherInfos[$key]['name'];\n else\n {\n if (substr($key,0,4) == \"NPC_\" && substr($key,strlen($key)-3,3) == \"_SP\")\n {\n $key = substr($key,4,stripos($key,\"_SP\") - 4);\n \n if (isset($tabGatherInfos[$key]))\n return $tabGatherInfos[$key]['name'];\n else\n return \"\";\n }\n else\n return \"\";\n }\n}", "public function killAction()\n {\n $job_id = $this->params['job_id'];\n $time = $this->params['time'];\n $time = Task::timeFormat();\n\n $oTask = new Task();\n $oTask->setKilled($job_id, $time);\n }", "function killbyname($procname) {\n\treturn mwexec(\"/bin/killall \" . escapeshellarg($procname));\n}", "public static function getLastCrashMessage();", "function openlab_get_primary_help_term_name() {\n\tglobal $post;\n\t$child_terms = get_the_terms( $post->ID, 'help_category' );\n\t$term = array();\n\tforeach ( $child_terms as $child_term ) {\n\t\t$term[] = $child_term;\n\t}\n\n\t$current_term = get_term_by( 'id', $term[0]->term_id, 'help_category' );\n\treturn $current_term;\n}", "function KILL() {\n throw new KillException;\n}", "public function getDeathPlace() {\n\t\tforeach ($this->getAllDeathPlaces() as $place) {\n\t\t\tif ($place) {\n\t\t\t\treturn $place;\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}", "private function getActor() {\n\t\tpreg_match('/ by (.+)/', $this->logLineIn, $match);\n\t\tif (isset($match[1])) {\n\t\t\treturn $match[1];\n\t\t} else {\n\t\t\treturn 'name not found';\n\t\t}\n\t}", "protected function findFreeName()\n {\n $position = $this->position ?: '_unassigned_';\n $name = $this->get('type');\n $name = $name == 'particle' ? $this->get('options.type') : $name;\n\n /** @var UniformResourceLocator $locator */\n $locator = Gantry::instance()['locator'];\n\n if (!file_exists($locator->findResource(\"gantry-positions://{$position}/{$name}.yaml\", true, true))) {\n return $name;\n }\n\n $count = 1;\n\n do {\n $count++;\n } while (file_exists($locator->findResource(\"gantry-positions://{$position}/{$name}_{$count}.yaml\", true, true)));\n\n return \"{$name}_{$count}\";\n }", "public function getKills()\n {\n $stmt = $this->pdo->prepare('SELECT * FROM \"kill_log\" WHERE \"killer\"=:username LIMIT 10');\n $stmt->execute([':username' => $this->username]);\n $data = $stmt->fetchAll();\n\n $kills = [];\n if ($data)\n {\n foreach ($data as $kill)\n {\n array_push($kills, new Kill($kill[0], $kill[1], $kill[2]));\n }\n return $kills;\n }\n return null;\n }", "function getVictimCorpName()\n {\n return $this->getVictimCorp()->getName();\n }", "public static function getClassName ($c) {\n\t\tif ($c === null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn Boot::getHaxeName($c);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the enterprise in use
public function getEnterprise();
[ "public function enterpriseGetEnterprise() {\n \n $client = $this->client ? $this->client : $this->enterpriseLogin();\n \n $requestBody = [\n\t\t\t\"jsonrpc\"\t=> \"2.0\",\n\t\t\t\"method\" \t=> \"enterprise/getEnterprise\",\n \"id\" => 1\n\t\t];\n\t\t\n $data = $this->apiFetch($requestBody);\n if (isset($this->debug) && ($this->debug)) { error_log(\"Enterprise data: \".print_r($data,1)); }\n return($data);\n }", "public function isEnterprise()\n {\n return is_object(Mage::getConfig()->getNode('global/models/enterprise_enterprise'));\n }", "public function onEnterprise() : bool\n {\n return $this->isValidPlatform() && $this->getValue('MODE') == 'enterprise';\n }", "public function getIsEsiUsed()\n {\n return $this->_isEsiUsed;\n }", "public function isMageEnterprise()\r\n {\r\n return Mage::getConfig()->getModuleConfig('Enterprise_Enterprise') && Mage::getConfig()->getModuleConfig('Enterprise_AdminGws') && Mage::getConfig()->getModuleConfig('Enterprise_Checkout') && Mage::getConfig()->getModuleConfig('Enterprise_Customer');\r\n }", "public function getAlreadyEquityOffered()\n {\n return $this->already_equity_offered;\n }", "public function getProfessionalExits() {\n $this->loadDataFromDegree();\n return $this->data->info->profissionalExits;\n }", "public function getInwhavail()\n {\n return $this->inwhavail;\n }", "private function getEcStatus() {\n\n if ($this->companies[0]->ctr_id == 3) {\n return 'EC Services';\n }\n else {\n return \"Non-EC\";\n }\n }", "public function getSupporting() {\n\t\treturn $this->getEmpire();\n\t}", "public function getIndustry() {\n return $this->get(self::INDUSTRY);\n }", "public function getEmployee()\n {\n /*\n $leaveType = LeaveType::find($typeId);\n return $leaveType->quota;\n */\n }", "public function getUserEnterprises(Enterprise $enterprise, Request $request)\n {\n $enterpriseQueried = Enterprise::where(['user_id'=>$enterprise->user_id])->get();\n return $enterpriseQueried;\n }", "public function getAimEquityOffered()\n {\n return $this->aim_equity_offered;\n }", "public function getProductChannelExclusivity()\n {\n return $this->product_channel_exclusivity;\n }", "public function getIndustry()\n {\n return $this->Industry;\n }", "public function getCurrentEnrolment(){\r\n\t\treturn Mage::registry('current_timetable_enrolment');\r\n\t}", "public function getETicketDesired()\n {\n return $this->eTicketDesired;\n }", "public function getOffSell()\n {\n return $this->offSell;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the current header settings for all possible responsive states
function us_load_header_settings_once() { global $us_header_settings; if ( isset( $us_header_settings ) ) { return; } // Basic structure $us_header_settings = array_fill_keys( us_get_responsive_states( /* only keys */TRUE ), array( 'options' => array(), 'layout' => array() ) ); // Add space for data $us_header_settings['data'] = array(); $us_header_settings = apply_filters( 'us_load_header_settings', $us_header_settings ); }
[ "public function single_header_options() {\n\n\t\t\trequire_once get_template_directory() . '/extra/single/header/options/single-header-options.php';\n\n\t\t}", "public function settings_header() {\n\t\t$this->include_template('wp-admin/settings/header.php');\n\t}", "public function _set_header_options()\n\t{\n\t\t// posts, pages, attachments etc.\n\t\tif (is_singular()) {\n\t\t\t\n\t\t\twp_enqueue_script('comment-reply', null, null, null, true);\n\t\t\n\t\t\t// set layout\n\t\t\t$layout = Bunyad::posts()->meta('layout_style');\n\n\t\t\tif ($layout) {\n\t\t\t\t$this->set_sidebar(($layout == 'full' ? 'none' : $layout));\n\t\t\t}\n\t\t}\n\t}", "function sienna_mikado_get_header() {\n\n\t\t//will be read from options\n\t\t$header_type = sienna_mikado_options()->getOptionValue('header_type');\n\t\t$header_behavior = sienna_mikado_options()->getOptionValue('header_behaviour');\n\n\t\textract(sienna_mikado_get_page_options());\n\n\t\tif(HeaderFactory::getInstance()->validHeaderObject()) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => sienna_mikado_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n\t\t\t\t'show_sticky' => in_array($header_behavior, array(\n\t\t\t\t\t'sticky-header-on-scroll-up',\n\t\t\t\t\t'sticky-header-on-scroll-down-up'\n\t\t\t\t)) ? true : false,\n\t\t\t\t'show_fixed_wrapper' => in_array($header_behavior, array('fixed-on-scroll')) ? true : false,\n\t\t\t\t'menu_area_background_color' => $menu_area_background_color,\n\t\t\t\t'vertical_header_background_color' => $vertical_header_background_color,\n\t\t\t\t'vertical_header_opacity' => $vertical_header_opacity,\n\t\t\t\t'vertical_background_image' => $vertical_background_image\n\t\t\t);\n\n\t\t\t$parameters = apply_filters('sienna_mikado_header_type_parameters', $parameters, $header_type);\n\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n\t\t}\n\t}", "protected function setHeaders() {\n\t\tif(!self::$headerIncluded) {\n\n\t\t\tif($this->settings['includes']['jquery'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>');\n\n if($this->settings['includes']['mediaelement'])\n\t\t\t $this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelement-and-player.min.js\"></script>');\n\n\t\t\tif($this->settings['includes']['jquery-resize'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/jquery.ba-resize.min.js\"></script>');\n\t\t\tif($this->settings['includes']['modernizr'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/modernizr-2.5.3.js\"></script>');\n\t\t\t\t\t\t\n\t\t\tif($this->settings['includes']['css'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/CSS/tx-vibeo.css\" />');\n\n if($this->settings['includes']['mediaelement-css'])\n\t\t\t $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelementplayer.css\" />');\n\n if($this->settings['includes']['mediaelement-skin-css'])\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/skin-gray.css\" />');\n\n\t\t\tself::$headerIncluded = true;\n\t\t}\n\t}", "private function load_settings()\n {\n $this->columns = DiviRoids_Settings()->get($this->settings_prefix . '-columns', true);\n $this->columns_divilibrary = DiviRoids_Settings()->get($this->settings_prefix . '-columns-divilibrary', true);\n $this->actions = DiviRoids_Settings()->get($this->settings_prefix . '-actions', true);\n }", "function aton_qodef_get_header() {\n\n //will be read from options\n $header_type = aton_qodef_get_meta_field_intersect('header_type');\n $header_behavior = aton_qodef_get_meta_field_intersect('header_behaviour');\n\n extract(aton_qodef_get_page_options());\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => aton_qodef_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n 'show_fixed_wrapper' => in_array($header_behavior, array('fixed-on-scroll')) ? true : false,\n 'menu_area_background_color' => $menu_area_background_color,\n 'vertical_header_background_color' => $vertical_header_background_color,\n 'vertical_header_opacity' => $vertical_header_opacity,\n 'vertical_background_image' => $vertical_background_image\n );\n\n $parameters = apply_filters('aton_qodef_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "function _nighthawk_process_custom_header_settings() {\n\tif ( isset( $_POST['save-header-options'] ) ) {\n\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$display_title = 0;\n\t\tif ( isset( $_POST['nighthawk_display_site_title'] ) ) {\n\t\t\t$display_title = 1;\n\t\t}\n\t\tset_theme_mod( 'nighthawk_display_site_title', $display_title );\n\n\t\t$display_tagline = 0;\n\t\tif ( isset( $_POST['nighthawk_display_tagline'] ) ) {\n\t\t\t$display_tagline = 1;\n\t\t}\n\t\tset_theme_mod( 'nighthawk_display_tagline', $display_tagline );\n\t}\n}", "public function loadHeader(){\r\n\t\tglobal $p,$s_m,$isv_siteSettings,$isv_siteDetails,$memberinfo,$converter,$PAGE;\r\n\t\trequire_once(ISVIPI_ACT_THEME . 'ovr/header.php');\r\n\t}", "function optimize_mikado_get_mobile_header() {\n\t\tif(optimize_mikado_is_responsive_on()) {\n\t\t\t$header_type = optimize_mikado_options()->getOptionValue('header_type');\n\n\t\t\t//this could be read from theme options\n\t\t\t$mobile_header_type = 'mobile-header';\n\n\t\t\t$parameters = array(\n\t\t\t\t'show_logo' => optimize_mikado_options()->getOptionValue('hide_logo') == 'yes' ? false : true,\n\t\t\t\t'menu_opener_icon' => optimize_mikado_icon_collections()->getMobileMenuIcon(optimize_mikado_options()->getOptionValue('mobile_icon_pack'), true),\n\t\t\t\t'show_navigation_opener' => has_nav_menu('main-navigation')\n\t\t\t);\n\n\t\t\toptimize_mikado_get_module_template_part('templates/types/'.$mobile_header_type, 'header', $header_type, $parameters);\n\t\t}\n\t}", "function event_espresso_bp_screen_settings_menu_header() {\n\t}", "function newsroom_elated_get_mobile_header() {\n if(newsroom_elated_is_responsive_on()) {\n $header_type = 'header-type3';\n\n //this could be read from theme options\n $mobile_header_type = 'mobile-header';\n\n $parameters = array(\n 'show_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? false : true,\n 'show_navigation_opener' => has_nav_menu('main-navigation')\n );\n\n newsroom_elated_get_module_template_part('templates/types/'.$mobile_header_type, 'header', $header_type, $parameters);\n }\n }", "public static function setHeaderDefaultData() {\n\n $has_init = get_option('lastudio_has_init_header_builder', false);\n\n if ( !$has_init ) {\n $sample_data = self::getHeaderDefaultData();\n if($sample_data){\n update_option('lahb_preheaders', $sample_data);\n }\n $editor_components = self::get_default_components();\n update_option( 'lahb_data_frontend_components', $editor_components );\n update_option( 'lastudio_has_init_header_builder', true );\n update_option( 'lastudio_header_layout', 'builder' );\n }\n\n }", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function header() {\n\t\t// Include the settings page header template.\n\t\t$header_file_path = $this->plugin->template_path . self::SETTINGS_SLUG . '-header.php';\n\t\tif ( file_exists( $header_file_path ) ) {\n\t\t\tinclude $header_file_path; // phpcs:ignore\n\t\t}\n\t}", "function gotravel_mikado_get_header() {\n\n\t\t//will be read from options\n\t\t$header_type = gotravel_mikado_options()->getOptionValue('header_type');\n\t\t$header_behavior = gotravel_mikado_options()->getOptionValue('header_behaviour');\n\n\t\tif(HeaderFactory::getInstance()->validHeaderObject()) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => gotravel_mikado_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n\t\t\t\t'show_sticky' => in_array($header_behavior, array(\n\t\t\t\t\t'sticky-header-on-scroll-up',\n\t\t\t\t\t'sticky-header-on-scroll-down-up'\n\t\t\t\t)) ? true : false,\n\t\t\t\t'show_fixed_wrapper' => in_array($header_behavior, array('fixed-on-scroll')) ? true : false\n\t\t\t);\n\n\t\t\t$parameters = apply_filters('gotravel_mikado_header_type_parameters', $parameters, $header_type);\n\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n\t\t}\n\t}", "function load_settings_extras(){\n\t\tif( has_filter( 'siteorigin_page_settings' ) ) {\n\t\t\tSiteOrigin_Settings_Page_Settings::single();\n\t\t}\n\n\t\tif( has_filter( 'siteorigin_settings_font_settings' ) ) {\n\t\t\tSiteOrigin_Settings_Webfont_Manager::single();\n\t\t}\n\n\t\tif( is_admin() && has_filter( 'siteorigin_about_page' ) && apply_filters( 'siteorigin_about_page_show', true ) ) {\n\t\t\tSiteOrigin_Settings_About_Page::single();\n\t\t}\n\t}", "public static function dfd_header_layouts() {\n\t\t\treturn array(\n\t\t\t\t'boxed' => esc_html__('On', 'dfd-native'),\n\t\t\t\t'fullwidth' => esc_html__('Off', 'dfd-native'),\n\t\t\t);\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if 'InvoiceRevisionDate' has a value
public function hasInvoiceRevisionDate() { return $this->InvoiceRevisionDate !== null; }
[ "public function hasInvoiceDate()\n {\n return $this->InvoiceDate !== null;\n }", "public function isSetInvoiceDate()\n {\n return !is_null($this->_fields['InvoiceDate']['FieldValue']);\n }", "public function issetInvoiceDate(): bool\n {\n return isset($this->invoiceDate);\n }", "public function setInvoiceRevisionDate($value)\n {\n return $this->set(self::INVOICEREVISIONDATE, $value);\n }", "public function hasInvoiceCorrectionDate()\n {\n return $this->InvoiceCorrectionDate !== null;\n }", "public function hasEntryDate()\n {\n return $this->hasInteger('entry_date');\n }", "public function isSetStatusChangedDate()\n {\n return !is_null($this->_fields['StatusChangedDate']['FieldValue']);\n }", "public function hasDocumentDate()\n {\n return $this->DocumentDate !== null;\n }", "public function hasPurchaseDate(): bool\n {\n return isset($this->purchaseDate);\n }", "public function setInvoiceCorrectionRevisionDate($value)\n {\n return $this->set(self::INVOICECORRECTIONREVISIONDATE, $value);\n }", "private function compare_with_date()\n {\n }", "public function setOriginalInvoiceRevisionDate($value)\n {\n return $this->set(self::ORIGINALINVOICEREVISIONDATE, $value);\n }", "public function hasDate() : bool;", "public function editDateExpectedDetail() {\n\t\treturn $this->edit_date_expect_head_det == self::VALUE_HEAD_DETAIL_DETAIL;\n\t}", "private static function _hasDateFields() {\n return count(self::$dateFields) > 0;\n }", "public function hasDocumentDateAndNumber()\n {\n return $this->DocumentDateAndNumber !== null;\n }", "public function hasNotificationDate()\n {\n return $this->NotificationDate !== null;\n }", "public function hasDateFlag()\n {\n return $this->get(self::DATEFLAG) !== null;\n }", "public function getInvoiceDate();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to see if a insert statement has been built
public function hasInsert() { return !empty($this->insert); }
[ "public function is_insert_statement(): bool\n {\n $sql = $this->get_query();\n return StatementTypes::is_insert_statement($sql);\n }", "private function isInsertQuery()\n\t{\n\t\treturn $this->insert_table != null;\n\t}", "public function is_build_pgsql_insert() {\n echo $this->build_pgsql_insert();\n }", "public function isInsert() {\n\t\t\treturn $this->strQueryType == self::INSERT_QUERY;\n\t\t}", "private function isInsert() \n {\n\n return (!$this->id);\n\n }", "public static function is_insert_statement(string $sql): bool\n {\n return self::get_statement_type($sql) === self::STATEMENT_TYPE_INSERT;\n }", "function isInsertStatement($sql) {\n $table = self::getInsertTable($sql);\n return is_string($table);\n }", "public function isInserted(): bool\n {\n return $this->inserted;\n }", "public function is_insert_into($sql)\n\t{\t\n\t\t$req = explode(' ', $sql);\n\n\t\tif($req[0] == \"INSERT\" AND $req[1] == \"INTO\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function validateInsert()\n\t{\n\t\treturn true;\n\t}", "public function hasSql(): bool\n {\n return isset($this->sql);\n }", "private function isObjectInsertable()\n {\n return (!$this->_isObjectLoadedFromDB() && $this->_isObjectHaveNewFieldValue());\n }", "protected function validateInsert(): bool\n {\n if (empty($this->QBSet)) {\n if ($this->db->DBDebug) {\n throw new DatabaseException('You must use the \"set\" method to insert an entry.');\n }\n\n return false; // @codeCoverageIgnore\n }\n\n return true;\n }", "public function isBlockedForInsert()\n {\n return !$this->_blockedForInsert;\n }", "static public function check_sql_structure() {\n // past back true or false\n return $passed = isset(static::$sqlStructure);\n }", "protected function statementReady()\n {\n return !is_null($this->constraints);\n }", "function isInsertQuery(&$q) {\n\t\t$m=array();\n\t\t\n\t\tif(preg_match(\"/INSERT[[:space:]]+INTO[[:space:]]+([a-zA-Z0-9_-]+)/\",$q,$m)){\n\t\t\treturn $m[1];\n\t\t}\n\n\t\treturn '';\n\t}", "private function _prepareMessageInsertStatement()\n {\n $stmtName = '_insertMessageStatement';\n if ($this->$stmtName) {\n return true;\n }\n\n $prefix = $this->_tablePrefix;\n $queryString = 'INSERT INTO `'.$prefix.'Messages` ';\n $queryString .= '(`transaction`, `message`, `createDate`)';\n $queryString .= 'VALUES';\n $queryString .= '(:transID, :message, NOW())';\n return $this->_prepareGenericStatement(\n $stmtName,\n $queryString\n );\n }", "public function parseInsertStatement()\n {\n $sql = Sql::createSql($this->_adapter)->insert('users');\n $sql->set(\n [\n 'name' => 'filipe',\n 'email' => 'filipe@example.com'\n ]\n );\n $expected = \"INSERT INTO users (name, email) VALUES (:name, :email)\";\n $this->assertEquals($expected, $sql->getQueryString());\n $this->assertEquals(\n [\n ':name' => 'filipe',\n ':email' => 'filipe@example.com'\n ],\n $sql->getParameters()\n );\n\n $this->assertEquals(1, $sql->execute());\n $this->assertEquals($sql, InsertAdapter::$sql);\n $this->assertEquals($sql->getParameters(), InsertAdapter::$params);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show main blog with posts
public function showBlog() { // DB::connection()->enableQueryLog(); $posts = $this->post->fetchAll(); // $log = DB::getQueryLog(); $tags = Redis::sRandMember('article:tags', 4); return view('home')->with([ 'posts' => $posts , 'tags' => $tags]); }
[ "public function blog() {\n $data = [\n 'posts' => $this->postModel->allPosts()\n ];\n\n $this->view('pages/blog', $data);\n }", "public function index () {\n\t\t\t$data['title'] = 'Blog';\n\n\t\t\t$data['posts'] = $this->post_model->get($this->input->get('take', TRUE));\n\n\t\t\t$data['categories'] = $this->category_model->get();\n\n\t\t\trender('index', $data);\n\t\t}", "public function getBlog(){\n $displayListings = Posts::where('status', 'public')->paginate(5);\n $newestPosts = $this->getNewest(5);\n return view('lightBlog::blog.blogView',[\n 'posts' => $displayListings,\n 'newest' => $newestPosts,\n ]);\n }", "public function showBlogList()\n {\n $posts = Post::published()->type('post')->newest()->paginate(10);\n $data = [\n 'posts' => $posts\n ];\n return view('content.index.index.blog', $data);\n }", "public function showPosts() {\r\n\t\t$allposts = $this->renderPostTemplate();\r\n\t\tforeach($allposts as $post) {\r\n\t\t\techo $post;\r\n\t\t}\r\n\t}", "public function actionBlog() {\n $this->render('blog');\n }", "public function feedAction()\n {\n View::set('title', Config::get('title'));\n View::set('link', Config::get('base'));\n View::set('description', Config::get('slogan'));\n View::set('items', Post::getLatest(1000));\n View::renderFile('blog-feed.php');\n }", "public function blogActionGet() : object\n {\n $page = $this->app->page;\n $request = $this->app->request;\n\n $slug = $request->getGet(\"post\") ?? null;\n\n $data = [\n \"title\" => \"Blogg\"\n ];\n \n $this->app->page->add(\"content/header\", $data);\n\n if ($slug) {\n $res = $this->content->getPost($slug);\n $data[\"content\"] = $res;\n $page->add(\"content/blogpost\", $data);\n } else {\n $res = $this->content->getAllPosts();\n $data[\"resultset\"] = $res;\n $page->add(\"content/blog\", $data);\n }\n\n return $page->render($data);\n }", "public static function index() {\n $blog_page = new View('blog.php');\n $blog_page->render();\n }", "public function getIndex() {\n \t// Grab all of the posts from the DB\n \t$posts = Post::paginate(10);\n\n \t// Return the Index View\n \treturn view('blog.index')->withPosts($posts);\n }", "public function view() {\n \n if(isset($this->args[1]) && isset($this->args[2])) {\n $this->view->addViewFile('blog/blogPost');\n try {\n $post = $this->model->getPostFromURL($this->args[1], $this->args[2]);\n $isOwner = ($this->user && $this->user->model->userID == $post['userID']);\n $this->view->setVar('isOwner', $isOwner);\n $this->view->setVar('title', $post['postTitle']);\n $this->view->setVar('blogPost', $post);\n $this->model->updateViewCount($this->model->postID, 'postID', 'postViews');\n\n }\n catch(Exception $excpt) {\n $this->view->setError($excpt);\n }\n } else {\n HTML::redirect(''); // No username and postname is URL, show index\n }\n\t}", "public function index()\n {\n $articles = app(config('novablog.models.article', Article::class))::published()->includeRepeaters()->active()\n ->has('categories')\n ->orderBy('published_date', 'desc')\n ->paginate(config('novablog.pageSize', 12));\n\n $categories = app(config('novablog.models.category', Category::class))::has('articles')\n ->active()\n ->get();\n\n return View::first([\n 'blog.index',\n 'nova-blog::index',\n ])\n ->with('articles', $articles)\n ->with('categories', $categories)\n ->with('page', [\n 'canonical' => \\Maxfactor::urlWithQuerystring(route('blog.index'), $allowedParameters = 'page=[^1]')\n ]);\n }", "public function index(){\n $posts = $this->postRepo->allPublished();\n\n return view('posts.index', compact('posts'));\n }", "function view() {\r\n\t\t$sPermalink = $this->get(__FUNCTION__, '');\r\n\t\tif($sPermalink == '') {\r\n\t\t\tthrow new PPI_Exception('Invalid Permalink');\r\n\t\t}\r\n\t\t$oBlog = new App\\Model\\Blog();\r\n\t\t$post = $oBlog->getPostByPermalink($sPermalink);\r\n\t\tif(empty($post)) {\r\n\t\t\tthrow new PPI_Exception('Unable to obtain post information.');\r\n\t\t}\r\n\t\t$this->load('blog/view', compact('post'));\r\n\t}", "public function blog()\n {\n return view('blog');\n }", "public function show()\n {\n App::getInstance()->setTitle(\"Blog - Article\");\n $post = $this->post->findWithCategory($this->request->getGetValue('id'));\n if ($post === false) {\n $this->notFound();\n }\n if ($post->published != POST_PUBLISHED & $this->session->get('role') < ROLE_ADMIN) {\n $this->flash->danger('Cet article n\\'est pas publié');\n return $this->redirect('index.php?p=blog.index');\n }\n $session = $this->session;\n $comments = $this->comment->listValidated($this->request->getGetValue('id'));\n $form = new Form();\n $this->render('blog.show', compact('post', 'comments', 'session', 'form'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $blogposts = $em->getRepository('AppBundle:Blogpost')->findAll();\n\n return $this->render('blog/index.html.twig', array(\n 'blogposts' => $blogposts,\n ));\n }", "public function blogIndex()\n {\n if( !\\Auth::user()->admin ) die(403);\n\n return view('admin.pages', [\n 'pages' => Page::blogs()->get(),\n 'isBlog' => true\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new BlogPostSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will return all active Categories
public function getAllCategories() { $pdo = Logger::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "Select ID, Category from Category where Active = 1"; $q = $pdo->prepare($sql); if ($q->execute()){ return $q->fetchAll(PDO::FETCH_ASSOC); } Logger::disconnect(); }
[ "public function getAllActiveCategories()\r\n {\r\n return Category::where('status', Category::STATUS_ACTIVE)->get();\r\n }", "protected function _getCategories() {\n\t\treturn Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('is_active',array('1'))->load();\n\t}", "public function allCategories()\r\n {\r\n $model = \\Pi::model('category', 'discourse');\r\n \r\n $rowset = $model->select(array('1 = ?' => 1));\r\n $categories = $rowset->toArray();\r\n \r\n return $categories;\r\n }", "protected function getActiveCategories()\n {\n return Mage::getModel('catalog/category')\n ->getCollection()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('is_active', 1);\n }", "public function getAllCategories();", "public function CgetAllCategories() {\n\t\treturn $this->getAllCategories();\n\t}", "function findAllCategories() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM categories;'));\r\n\r\n\t}", "public function getActiveCategories()\n {\n return Category::where('status', Category::STATUS_ACTIVE)\n ->has('faq')->with(['faq' => function ($query) {\n $query->where('status', Faq::STATUS_ACTIVE);\n }])->get();\n }", "public function getCategories();", "private function getCategories()\n\t{\n\t\t$blogCategories = BlogCategory::where('status', '=', 1)->whereHas('blogPosts', function($query)\n\t\t{\n\t\t\t$query->active();\n\t\t})->get();\n\n\t\treturn $blogCategories;\n\t}", "public static function getCategories() {\n return Blog::category()->orderBy('name')->all();\n }", "public function getCategories()\n\t{\n\t\treturn $this->api()->getDbtable('categories', 'answer')->fetchAll('parent_cat_id = 0', 'category_name');\n\t}", "public static function getCategories() {\n return BookModel::getCategories();\n }", "public function getCategories()\n {\n $table = Engine_Api::_()->getDbTable('categories', 'blog');\n return $table->fetchAll($table->select()->order('category_name ASC'));\n }", "public function get_all_categories() {\n\n // Gets all categories\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Categories)->get_all_categories();\n\n }", "public static function getAllCategories () {\n\t\t$resultSet = ORM::for_table(self::INST_CAT_TABLE)->\n\t\t\tselect('id')->\n\t\t\tselect('name')->\n\t\t\tselect('display_sequence')->\n\t\t\torder_by_asc('display_sequence')->\n\t\t\tfind_many();\n//\t\t$selstmt = \"SELECT ID, NAME, DISPLAY_SEQUENCE FROM INSTRUMENT_CATEGORIES \" .\n//\t\t\t\"ORDER BY DISPLAY_SEQUENCE\";\n\t\t$cats = array();\n\t\tforeach ($resultSet as $result) {\n\t\t\t$cat = new InstrumentCategory();\n\t\t\t$cat->id = $result->id;\n\t\t\t$cat->name = $result->name;\n\t\t\t$cat->displaySequence = $result->display_sequence;\n\t\t\t$cats[] = $cat;\n\t\t}\n\t\t// The cats have all been herded\n\t\treturn $cats;\n\t}", "public function getCategories()\r\n\t{\r\n\t\t$categories = $this->db->get('item_category');\r\n\t\treturn $categories->result();\r\n\t}", "function getActiveCats() {\n\t\t$active = array('0' => $this->catObj->uid);\n\t\t$rootline = $this->catObj->get_categorie_rootline_uidlist();\n\t\tforeach($rootline as $cat) {\n\t\t\t$active[] = $cat;\n\t\t}\n\t\treturn $active;\n\t}", "public function listCategories() {\n return $this->makeRequest(\"listCategories\", NULL, NULL);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ unsigned int $monitorId, string $monitorType = MMaintenanceRule::MONITOR_, bool $isNotifyBackup, bool $isContinuousAlerts, unsigned int $failuresCount, string $periodType = MMaintenanceRule::PERIOD_ (PERIOD_ALWAYS by default), Must be specified if $periodType is PERIOD_WEEKDAYS: unsigned int $weekdayFrom = MNotoficationsRules::WEEKDAY_, unsigned int $weekdayTo = MNotoficationsRules::WEEKDAY_, Must be specified if $periodType is PERIOD_WEEKDAYS or PERIOD_TIME: string $timeFrom = 'hh:mm:ss', string $timeTo = 'hh:mm:ss', Must be specified if $periodType is PERIOD_DATE: string $dateTimeFrom = 'yyyy:mm:dd hh:mm:ss', string $dateTimeTo = 'yyyy:mm:dd hh:mm:ss'; unsigned int $timezone return [status] or [error]
public function addRule($monitorId, $monitorType, $periodType, $timeForm = null, $timeTo = null, $weekdayFrom, $weekdayTo, $dateTimeForm = null, $dateTimeTo = null, $timezone = null){ $params = array(); $params['monitorId'] = $monitorId; $params['monitorType'] = $monitorType; $params['period'] = $periodType; if($periodType == self::PERIOD_WEEKDAYS){ $params['weekdayFrom'] = $weekdayFrom; $params['weekdayTo'] = $weekdayTo; } if($periodType == self::PERIOD_TIME || $periodType == self::PERIOD_WEEKDAYS){ $params['timeFrom'] = $timeForm; $params['timeTo'] = $timeTo; } if($periodType == self::PERIOD_DATETIME){ $params['dateTimeFrom'] = $dateTimeForm; $params['dateTimeTo'] = $dateTimeTo; } if($timezone != null) $params['timezone'] = $timezone; return $this->makePostRequest('addMaintenanceRule', $params); }
[ "function mci_issue_set_monitors($p_issue_id, $p_requesting_user_id, array $p_monitors) {\n if (bug_is_readonly($p_issue_id)) {\n return mci_soap_fault_access_denied($p_requesting_user_id, 'Issue \\'' . $p_issue_id . '\\' is readonly');\n }\n\n # 1. get existing monitor ids\n $t_existing_monitor_ids = bug_get_monitors($p_issue_id);\n\n # 2. build new monitors ids\n $t_new_monitor_ids = array();\n foreach ($p_monitors as $t_monitor) {\n $t_monitor = SoapObjectsFactory::unwrapObject($t_monitor);\n $t_new_monitor_ids[] = $t_monitor['id'];\n }\n\n # 3. for each of the new monitor ids, add it if it does not already exist\n foreach ($t_new_monitor_ids as $t_user_id) {\n if ($p_requesting_user_id == $t_user_id) {\n if (!access_has_bug_level(config_get('monitor_bug_threshold'), $p_issue_id)) {\n continue;\n }\n } else {\n if (!access_has_bug_level(config_get('monitor_add_others_bug_threshold'), $p_issue_id)) {\n continue;\n }\n }\n\n if (in_array($t_user_id, $t_existing_monitor_ids)) {\n continue;\n }\n\n bug_monitor($p_issue_id, $t_user_id);\n }\n\n # 4. for each of the existing monitor ids, remove it if it is not found in the new monitor ids\n foreach ($t_existing_monitor_ids as $t_user_id) {\n if ($p_requesting_user_id == $t_user_id) {\n if (!access_has_bug_level(config_get('monitor_bug_threshold'), $p_issue_id)) {\n continue;\n }\n } else {\n if (!access_has_bug_level(config_get('monitor_delete_others_bug_threshold'), $p_issue_id)) {\n continue;\n }\n }\n\n if (in_array($t_user_id, $t_new_monitor_ids)) {\n continue;\n }\n\n bug_unmonitor($p_issue_id, $t_user_id);\n }\n}", "function monitor_taches_generales_cron($taches_generales){\n\tinclude_spip('inc/config');\n\tif (lire_config('monitor/activer_monitor') == \"oui\") {\n\t\t$taches_generales['monitor'] = 90; \n\t\t$taches_generales['monitor_univers_check'] = 90; \n\t}\n\n\treturn $taches_generales;\n}", "function checkTesterRatioAndEmailAlert() {\n $queueStatusFilename = './QueueStatus.ini';\n $queueStatus = parse_ini_file($queueStatusFilename, true);\n $configTable = Doctrine_Core::getTable('WPTMonitorConfig');\n $config = $configTable->find(1);\n $siteContactEmailAddress = $config['SiteContactEmailAddress'];\n // Check runrate to test ration and alert if necessary\n // Currently hard coded to alert if ration exceeds 40:1\n // TODO: Make configurable, or improve method of determining optimum run rate\n $locations = getLocationInformation();\n $message = \"\";\n foreach ($locations as $location) {\n $id = $location['id'];\n $queueStat = $queueStatus[\"'\" . $id . \"'\"];\n if(empty( $location ) || !array_key_exists('id', $location) || empty( $location['id'] )) {\n continue;\n }\n $runRate = $location['runRate'];\n $agentCount = $location['AgentCount'];\n if(empty( $agentCount )) {\n $agentCount = '0';\n }\n $requiredAdditionalTesters = ( $runRate/TARGET_RUN_RATE_RATIO )-$agentCount;\n if($location['runRate']) {\n if($location['AgentCount']<1 || ( $location['runRate']/$location['AgentCount']>TARGET_RUN_RATE_RATIO )) {\n // Only alert once per hour\n if(!array_key_exists('LastTesterRatioAlertTime', $queueStat) ||\n ( current_seconds()>$queueStat['LastTesterRatioAlertTime']+3600 )\n ) {\n logOutput('[INFO] [checkTesterRatioAndEmailAlert] LastTesterRatioAlertTime for: ' . $id . ' has not alerted since: ' . $queueStat['LastTesterRatioAlertTime']);\n $message = \"--------------------------------------------\\n\";\n $message .= \"Runrate ratio insufficient for location: \" . $id . \"\\n\";\n $message .= \"Runrate: \" . $runRate . \"\\n\";\n $message .= \"Testers: \" . $agentCount . \"\\n\";\n $message .= \"Timestamp: \" . timestamp() . \"\\n\";\n if($agentCount) {\n $message .= \"Ratio: \" . $runRate/$agentCount . \"\\n\";\n }else {\n $message .= \"Ratio: NO TESTERS SERVING THIS REGION\\n\";\n }\n $message .= \"--------------------------------------------\\n\";\n $message .= \"Target Ratio: \" . TARGET_RUN_RATE_RATIO . \"\\n\";\n $message .= \"Please add \" . ceil($requiredAdditionalTesters) . \" additional agents for this location.\";\n // Update time stamp\n $queueStatus[\"'\" . $id . \"'\"]['LastTesterRatioAlertTime'] = current_seconds();\n writeIniFile($queueStatus, $queueStatusFilename, true);\n }else {\n logOutput('[INFO] [checkTesterRatioAndEmailAlert] LastTesterRatioAlertTime for: ' . $id . ' alert interval has not passed. Last Alert: ' . $queueStat['LastTesterRatioAlertTime']);\n }\n }\n }\n }\n if($message) {\n sendEmailAlert($siteContactEmailAddress, $message);\n logOutput(\"[INFO] [checkTesterRatioAndEmailAlert] Alert message sent:\\n\" . $message);\n echo $message;\n }\n}", "function checkTesterRatioAndEmailAlert()\n{\n\t$queueStatusFilename = './QueueStatus.ini';\n\t$queueStatus = parse_ini_file($queueStatusFilename, true);\n\t$configTable = Doctrine_Core::getTable('WPTMonitorConfig');\n\t$config = $configTable->find(1);\n\t$siteContactEmailAddress = $config['SiteContactEmailAddress'];\n\t// Check runrate to test ration and alert if necessary\n\t// Currently hard coded to alert if ration exceeds 40:1\n\t// TODO: Make configurable, or improve method of determining optimum run rate\n\t$locations = getLocationInformation();\n\t$message = \"\";\n\tforeach ($locations as $key => $location) {\n\t\tif (stripos($key, \"_wptdriver\")) {\n\t\t\t// TODO: For now ignore the _wptdriver locations as they are the same as IE9\n\t\t\t// This may require calcs to be done differently. 2012/02/19\n\t\t\tcontinue;\n\t\t}\n\t\t$id = $location['id'];\n\t\t$queueStat = $queueStatus[\"'\" . $id . \"'\"];\n\t\tif (empty($location) || !array_key_exists('id', $location) || empty($location['id'])) {\n\t\t\tcontinue;\n\t\t}\n\t\t$runRate = $location['runRate'];\n\t\t$agentCount = $location['AgentCount'];\n\t\tif (empty($agentCount))\n\t\t\t$agentCount = '0';\n\t\t$requiredAdditionalTesters = ($runRate / TARGET_RUN_RATE_RATIO) - $agentCount;\n\t\tif ($location['runRate']) {\n\t\t\tif ($location['AgentCount'] < 1 || ($location['runRate'] / $location['AgentCount'] > TARGET_RUN_RATE_RATIO)) {\n\t\t\t\t// Only alert once per hour\n\t\t\t\tif (!array_key_exists('LastTesterRatioAlertTime', $queueStat) || (current_seconds() > $queueStat['LastTesterRatioAlertTime'] + 3600)) {\n\t\t\t\t\tlogOutput('[INFO] [checkTesterRatioAndEmailAlert] LastTesterRatioAlertTime for: ' . $id . ' has not alerted since: ' . $queueStat['LastTesterRatioAlertTime']);\n\t\t\t\t\t$message = \"--------------------------------------------\\n\";\n\t\t\t\t\t$message .= \"Runrate ratio insufficient for location: \" . $id . \"\\n\";\n\t\t\t\t\t$message .= \"Runrate: \" . $runRate . \"\\n\";\n\t\t\t\t\t$message .= \"Testers: \" . $agentCount . \"\\n\";\n\t\t\t\t\t$message .= \"Timestamp: \" . timestamp() . \"\\n\";\n\t\t\t\t\tif ($agentCount) {\n\t\t\t\t\t\t$message .= \"Ratio: \" . $runRate / $agentCount . \"\\n\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$message .= \"Ratio: NO TESTERS SERVING THIS REGION\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$message .= \"--------------------------------------------\\n\";\n\t\t\t\t\t$message .= \"Target Ratio: \" . TARGET_RUN_RATE_RATIO . \"\\n\";\n\t\t\t\t\t$message .= \"Please add \" . ceil($requiredAdditionalTesters) . \" additional agents for this location.\";\n\t\t\t\t\t// Update time stamp\n\t\t\t\t\tif (!empty($id))\n\t\t\t\t\t\t$queueStatus[\"'\" . $id . \"'\"]['LastTesterRatioAlertTime'] = current_seconds();\n\t\t\t\t\twriteIniFile($queueStatus, $queueStatusFilename, true);\n\t\t\t\t} else {\n\t\t\t\t\tlogOutput('[INFO] [checkTesterRatioAndEmailAlert] LastTesterRatioAlertTime for: ' . $id . ' alert interval has not passed. Last Alert: ' . $queueStat['LastTesterRatioAlertTime']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ($message) {\n\t\tsendEmailAlert($siteContactEmailAddress, $message);\n\t\tlogOutput('[INFO] [checkTesterRatioAndEmailAlert] Alert message sent:\\n' . $message);\n\t\techo $message;\n\t}\n}", "function Analyze_Schedule($schedule, $verify=false, $rules=NULL)\n{\n\n\t$ach_failure_map = Fetch_ACH_Return_Code_Map();\n\t$card_failure_map = Fetch_Card_Return_Code_Map();\n\t$grace_periods = Get_Grace_Periods();\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\n\t$status = new stdClass();\n\n\t// General items or totals\n\n\t// If $verify == false, this will be the position of the first scheduled event (if there is one)\n\t// If $verify == true, this will be the position of the last event in the schedule + 1\n\t$status->stopping_location = 0;\n\t$status->ach_fee_count = 0;\n\t$status->max_reattempt_count = 0;\n\t$status->principal_in_failures = FALSE;\n\t$status->has_arrangements = FALSE;\n\t$status->has_failed_arrangements = FALSE;\n\t$status->has_debt_consolidation_payments = FALSE;\n\t$status->has_manual_renewals = FALSE;\n\t$status->has_scheduled_reattempts = FALSE;\n\t$status->initial_principal = 0.0;\n\t$status->num_qc = 0;\n\t$status->num_ach_card_failures = 0;\n\t$status->num_fatal_failures = 0;\n\t$status->num_registered_events = 0;\n\t$status->num_scheduled_events = 0;\n\t$status->posted_service_charge_count = 0;\n\t$status->attempted_service_charge_count = 0;\n\t$status->num_reg_sc_assessments = 0;\n\t$status->has_failed_int_adj_payout = FALSE;\n\n\t// Client-side information\n\t$status->next_amt_due = 0.0;\n\t$status->next_due_date = \"N/A\";\n\t$status->next_action_date = \"N/A\";\n\t$status->next_principal_due_date = \"N/A\";\n\t$status->last_service_charge_date = 'N/A';\n\t$status->next_service_charge_date = 'N/A';\n\t$status->next_service_charge_id = NULL;\n\t$status->shift_date_range = NULL;\n\t$status->reversible = FALSE;\n\t$status->cancellable = TRUE;\n\t$status->can_chargeback = FALSE;\n\t$status->can_reverse_chargeback = FALSE;\n\t$status->can_renew_loan = FALSE;\n\n\t// Title Loan Fee related items\n\t$status->has_transfer_fee = FALSE;\n\t$status->has_delivery_fee = FALSE;\n\t$status->has_lien_fee = FALSE;\n\n\t// Pending items only *from sum_pending_*\n\t$status->num_pending_items = 0;\n\t$status->pending_principal = 0.0;\n\t$status->pending_fees = 0.0;\n\t$status->pending_interest = 0.0;\n\t$status->pending_total = 0.0;\n\n\t// posted stuff (i.e. only 'complete' items affect these)\n\t// *from balance_complete*\n\t$status->posted_principal = 0.0;\n\t$status->posted_fees = 0.0;\n\t$status->posted_interest = 0.0;\n\t$status->posted_total = 0.0;\n\t$status->paid_interest = 0.0;\n\t$status->paid_interest_count = 0;\n\t$status->paid_principal = 0.0;\n\t$status->paid_principal_count = 0;\n\t$status->paid_fees = 0.0;\n\t$status->paid_fee_count = 0;\n\n\t$status->Completed_SC_Credits = 0;\n\t$status->Completed_SC_Debits =0;\n\t$status->Failed_Princ_non_reatts = 0;\n\t$status->Completed_Reatts = 0;\n\n\t// Posted and pending (for use in payouts and other pending sensitive transactions)\n\t$status->posted_and_pending_principal = 0.0;\n\t$status->posted_and_pending_fees = 0.0;\n\t$status->posted_and_pending_interest = 0.0;\n\t$status->posted_and_pending_total = 0.0;\n\t$status->posted_service_charge_total = 0.0;\n\n\t// running balances (included everything analyzed)\n\t$status->running_principal = 0.0;\n\t$status->running_fees = 0.0;\n\t$status->running_interest = 0.0;\n\t$status->running_total = 0.0;\n\t$status->total_paid = 0.0;\n\n\t// Lists\n\t$status->quickchecks = array();\n\t$outstanding = array('ach' => array(), 'sc' => array());\n\t$fail_set = array();\n\t$debits = array();\n\t$posted_schedule = array();\n\t$oids = array();\n\t$status->failed_partials = array();\n\t// Internal value only\n\t$date_effective_init = $fail_date = '1970-01-01';\n\n\t// If there are no schedule items, you can't cancel - there's nothing to cancel - no items mean no balance too.\n\tif (count($schedule) == 0) $status->cancellable = false;\n\n\t// if we have only cancel type transactions, we can't cancel. This flag is for if we see any.\n\t$non_cancel_trans = false;\n\n\tforeach ($schedule as $e)\n\t{\n\t\t/* We need to make sure we get ALL origin ids to determine\n\t\tthe appropriate failset. */\n\t\tif ($e->origin_id !== null)\n\t\t{\n\t\t\t$oids[] = $e->origin_id;\n\t\t}\n\n\t\t// if we have only cancel type transactions, we can't cancel. Flag if we see any.\n\t\tif (!in_array($e->type, array('cancel','card_cancel'))) $non_cancel_trans = true;\n\n\t\t// Used to determine whether or not the schedule has any\n\t\t// scheduled events\n\t\tif($e->status === 'scheduled')\n\t\t{\n\t\t\t$status->num_scheduled_events++;\n\t\t\tif($e->type == 'assess_service_chg' && $e->service_charge != 0 && $status->next_service_charge_date == 'N/A')\n\t\t\t{\n\t\t\t\t$status->next_service_charge_id = $e->event_schedule_id;\n\t\t\t\t$status->next_service_charge_date = $e->date_event;\n\t\t\t}\n\t\t}\n\n\t\tif($e->status === 'scheduled' && $e->context === 'reattempt') $status->has_scheduled_reattempts = TRUE;\n\n\t\tif(in_array($e->type, array('repayment_principal','card_repayment_principal')) && $e->context === 'manual') $status->has_manual_renewals = TRUE;\n\n\t\tif($e->type === 'payment_debt' || $e->type === 'payment_debt_principal' || $e->type === 'payment_debt_fees')\n\t\t{\n\t\t\t$status->has_debt_consolidation_payments = TRUE;\n\t\t}\n\n\t\t// From this point on, we don't do scheduled items unless we're verifying.\n\t\tif (!($verify) && ($e->status === 'scheduled')) continue;\n\t\tif($e->status !== 'scheduled') $status->num_registered_events++;\n\n\t\t// First add it to the running balances\n\t\tif ($e->status !== 'failed')\n\t\t{\n\t\t\t$status->running_principal = bcadd($status->running_principal,$e->principal,2);\n\t\t\t$status->running_fees = bcadd($status->running_fees,$e->fee,2);\n\t\t\t$status->running_interest = bcadd($status->running_interest,$e->service_charge,2);\n\t\t}\n\n\t\tif($e->type === 'quickcheck') { $status->num_qc++; $status->quickchecks[] = $e; }\n\t\tif ($e->context === 'arrangement' || $e->context === 'partial')\n\t\t{\n\n\t\t\tif ($e->status === 'scheduled')\n\t\t\t$status->has_arrangements = true;\n\n\t\t\t// Mantis:9820 - business rule needs to apply to failed arrangements only. flagging state here.\n\t\t\tif ($e->status === 'failed')\n\t\t\t{\n\t\t\t$status->has_failed_arrangements = true;\n\t\t\t\tif($e->context == 'partial')\n\t\t\t\t{\n\t\t\t\t\t$status->failed_partials[] = $e;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\n\t\t// Determine how it affects aggregates\n\t\tswitch($e->status)\n\t\t{\n\t\t\tcase 'failed':\n\t\t\t\t{\n\t\t\t\t\tif ($e->principal > 0.0) $status->principal_in_failures = true;\n\t\t\t\t\tif (@strtotime($e->return_date) > @strtotime($fail_date))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fail_date = $e->return_date;\n\t\t\t\t\t\t$fail_set = array();\n\t\t\t\t\t}\n\t\t\t\t\t$fail_set[] = $e;\n\n\t\t\t\t\tif($e->context == 'arrangement' || $e->context == 'partial')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->made_arrangement = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t//add check if fatal ach is on current bank acct\n\t\t\t\t\tif (isset($e->ach_return_code_id) && $ach_failure_map[$e->ach_return_code_id]['is_fatal'] === 'yes' && $e->bank_aba == $e->current_bank_aba && $e->bank_account == $e->current_bank_account) $status->num_fatal_failures++;\n\t\t\t\t\t//add check if fatal card\n\t\t\t\t\tif (isset($e->return_code) && ($e->is_fatal == 1) && ($e->clearing_type == 'card')) $status->num_fatal_failures++;\n\n\t\t\t\t\tif (Is_Service_Charge_Payment($e))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($e->type == 'adjustment_internal' || $e->type == 'adjustment_internal_fees') && $e->context == 'payout')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->has_failed_int_adj_payout = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t////////////\n\t\t\t\t\tif ($e->clearing_type == 'ach' || $e->clearing_type == 'card')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e->date_effective > $date_effective_init)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status->num_ach_card_failures++;\n\t\t\t\t\t\t\t$date_effective_init = $e->date_effective;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'pending':\n\t\t\t\t{\n\t\t\t\t\t$status->num_pending_items++;\n\n\t\t\t\t\t// There was a problem with Complete Schedule not seeing the pending\n\t\t\t\t\t// service charges and would produce additional charges. This appears\n\t\t\t\t\t// to fix it and not cause harm elsewhere. [Mantis:1680]\n\t\t\t\t\tif (Is_Service_Charge_Payment($e))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t\t$status->posted_service_charge_total = bcadd($status->posted_service_charge_total,$e->service_charge,2);\n\t\t\t\t\t\t$el = array_shift($outstanding['sc']);\n\t\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\t}\n\n\t\t\t\t\t$status->pending_principal = bcadd($status->pending_principal,$e->principal,2);\n\t\t\t\t\t$status->pending_fees = bcadd($status->pending_fees,$e->fee,2);\n\t\t\t\t\t$status->pending_interest = bcadd($status->pending_interest,$e->service_charge,2);\n\t\t\t\t\tif ($e->principal > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_principal = bcadd($status->posted_principal,$e->principal,2);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($e->service_charge <> 0) $status->last_pending_service_charge_date = $e->date_event;\n\n\t\t\t\t\t$status->posted_and_pending_principal = bcadd($status->posted_and_pending_principal,$e->principal);\n\t\t\t\t\t$status->posted_and_pending_fees = bcadd($status->posted_and_pending_fees,$e->fee);\n\t\t\t\t\t$status->posted_and_pending_interest = bcadd($status->posted_and_pending_interest,$e->service_charge);\n\t\t\t\t\t$status->posted_and_pending_total = bcadd($status->posted_and_pending_total,($e->fee + $e->service_charge + $e->principal));\n\n\t\t\t\t\t}\n\t\t\tcase 'new':\n\t\t\tcase 'scheduled':\n\t\t\t\t{\n\t\t\t\t\t$gp = intval($grace_periods[$e->type]->pending_period);\n\t\t\t\t\t$gt = $grace_periods[$e->type]->period_type;\n\t\t\t\t\tswitch($gt)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"calendar\":\t$n = \"Calendar\"; break;\n\t\t\t\t\t\tcase \"business\":\n\t\t\t\t\t\tdefault:\t\t\t$n = \"Business\"; break;\n\t\t\t\t\t}\n\t\t\t\t\t$function_name = \"Get_{$n}_Days_Forward\";\n\t\t\t\t\tif ($e->type === 'quickcheck')\n\t\t\t\t\t{\n\t\t\t\t\t\t// The first condition was wrong when setting it to date_effective... don't\n\t\t\t\t\t\t// know if we need to change anything else here.\n\t\t\t\t\t\tif ($e->status === 'pending') $start_date = $e->date_event;\n\t\t\t\t\t\telse $start_date = $e->date_event;\n\t\t\t\t\t\t$end_date = $pd_calc->$function_name($start_date, $gp);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e->status === 'pending')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$end_date = $pd_calc->$function_name($e->date_effective, $gp);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$end_date = $pd_calc->$function_name($e->date_effective, $gp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$e->pending_end = $end_date;\n\t\t\t\t} break;\n\t\t\tcase 'complete':\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('/refund_3rd_party/', $e->type) != 0) continue;\n\t\t\t\t\t$status->posted_principal = bcadd($status->posted_principal,$e->principal);\n\t\t\t\t\t$status->posted_fees = bcadd($status->posted_fees,$e->fee);\n\t\t\t\t\t$status->posted_interest = bcadd($status->posted_interest,$e->service_charge);\n\t\t\t\t\t$status->posted_total = bcadd($status->posted_total,($e->principal + $e->service_charge + $e->fee));\n\n\t\t\t\t\t$status->posted_and_pending_principal = bcadd($status->posted_and_pending_principal,$e->principal);\n\t\t\t\t\t$status->posted_and_pending_fees = bcadd($status->posted_and_pending_fees,$e->fee);\n\n\t\t\t\t\t$status->posted_and_pending_interest = bcadd($status->posted_and_pending_interest,$e->service_charge) ;\n\n\t\t\t\t\t$status->posted_and_pending_total = bcadd($status->posted_and_pending_total,($e->principal + $e->service_charge + $e->fee));\n\n\t\t\t\t\tif ($e->service_charge <> 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->last_pending_service_charge_date = $e->date_event;\n\t\t\t\t\t\t$status->last_service_charge_date = $e->date_event;\n\t\t\t\t\t}\n\t\t\t\t\tif($e->type == 'assess_service_chg' && $e->service_charge != 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t//$status->next_service_charge_id = $e->event_schedule_id;\n\t\t\t\t\t\t$status->last_service_charge_date = $e->date_event;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->principal < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_principal = bcadd($status->paid_principal,$e->principal,2);\n\t\t\t\t\t\t$status->paid_principal_count ++;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->fee < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_fees = bcadd($status->paid_fees,$e->fee,2);\n\t\t\t\t\t\t$status->paid_fee_count ++;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->service_charge < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_interest = bcadd($status->paid_interest,$e->service_charge,2);\n\t\t\t\t\t\t$status->paid_interest_count ++;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($e->amounts as $a)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($a->amount < 0) $status->total_paid = bcadd($status->total_paid,$a->amount,2);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\tdefault:\n\t\t}\n\n\t\tif (($e->principal + $e->fee + $e->service_charge) < 0.0) $debits[] = $e;\n\n\t\t// Now determine how it affects event breakdown -- only completed items\n\t\t// OR non-failure items if we're verifying\n\t\tif (($e->status === 'complete') || ($verify && ($e->status != 'failed')))\n\t\t{\n\t\t\tif ($e->status === 'scheduled')\n\t\t\t{\n\t\t\t\tif (($status->next_principal_due_date === \"N/A\") &&\n\t\t\t\t$e->principal < 0)\n\t\t\t\t{\n\t\t\t\t\t$status->next_principal_due_date = $e->date_event;\n\t\t\t\t}\n\n\t\t\t\tif (($status->next_action_date === \"N/A\") &&\n\t\t\t\t(($e->principal + $e->service_charge + $e->fee) < 0))\n\t\t\t\t{\n\t\t\t\t\tif (strlen($e->date_event) == 10)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_action_date = substr($e->date_event, 5, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_event, -2, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_event, 0, 4);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_action_date = $e->date_event;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (strlen($e->date_effective) == 10)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_due_date = substr($e->date_effective, 5, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_effective, -2, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_effective, 0, 4);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_due_date = $e->date_effective;\n\t\t\t\t\t}\n\t\t\t\t\t$status->shift_date_range = array();\n\n\t\t\t\t\t// Generate the dates that can be used in the stupid dropdown\n\t\t\t\t\t$adjustment_span = isset($rules['max_sched_adjust']) ? $rules['max_sched_adjust'] : 1;\n\t\t\t\t\t$ending = $pd_calc->Get_Business_Days_Forward($e->date_effective, $adjustment_span);\n\t\t\t\t\t$i = $pd_calc->Get_Closest_Business_Day_Forward(date(\"Y-m-d\"));\n\t\t\t\t\twhile (strtotime($i) < strtotime($ending))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->shift_date_range[] = $i;\n\t\t\t\t\t\t$i = $pd_calc->Get_Next_Business_Day($i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((($e->principal + $e->fee + $e->service_charge) < 0) &&\n\t\t\t\t(date(\"m-d-Y\", strtotime($e->date_event)) === $status->next_action_date))\n\t\t\t\t{\n\t\t\t\t\t$status->next_amt_due += abs($e->principal + $e->fee + $e->service_charge);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch($e->type)\n\t\t\t{\n\t\t\t\tcase 'converted_principal_bal':\n\t\t\t\tcase 'loan_disbursement':\n\t\t\t\tcase 'card_disbursement':\n\t\t\t\tcase 'moneygram_disbursement':\n\t\t\t\tcase 'check_disbursement':\n\t\t\t\t\tif (($e->service_charge < 0.00) || ($e->fee < 0.00) || ($e->principal <> 0.00))\n\t\t\t\t\t{\n\t\t\t\t\t\t$cancelation_delay = ($rules['cancelation_delay']) ? $rules['cancelation_delay'] : 3;\n\t\t\t\t\t\t$cancel_limit = $pd_calc->Get_Business_Days_Forward($e->date_event, $cancelation_delay);\n\t\t\t\t\t\t// The rule is \"If it's been less than x days since the last payment.\"\n\t\t\t\t\t\tif (strtotime(\"now\") > (strtotime($cancel_limit) + 86399)) $status->cancellable = false;\n\t\t\t\t\t}\n\t\t\t\t\t$status->initial_principal = $e->principal;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'assess_service_chg':\n\t\t\t\tcase 'converted_service_chg_bal':\n\t\t\t\t\tif($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_SC_Credits = bcadd($status->Completed_SC_Credits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$status->num_reg_sc_assessments++;\n\t\t\t\t\t$outstanding['sc'][] = $e;\n\t\t\t\t\tbreak;\n\t\t\t\t\t// Converted sc event means a) they already accrued a sc, and 2) they already paid a sc\n\t\t\t\tcase 'converted_sc_event':\n\t\t\t\tcase 'credit_card_fees':\n\t\t\t\tcase 'manual_ach':\n\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_service_chg':\n\t\t\t\tcase 'card_payment_service_chg':\n\t\t\t\t\tif ($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t\t$status->posted_service_charge_total = bcadd($status->posted_service_charge_total,$e->service_charge,2);\n\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\t\t\t\t\t}\n\t\t\t\t\t$el = array_shift($outstanding['sc']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_ach_fail':\n\t\t\t\tcase 'assess_fee_card_fail':\n\t\t\t\t\t$status->ach_fee_count++;\n\t\t\t\t\t$outstanding['ach'][] = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_fee_ach_fail':\n\t\t\t\tcase 'payment_fee_card_fail':\n\t\t\t\t\t$el = array_shift($outstanding['ach']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'writeoff_fee_ach_fail':\n\t\t\t\tcase 'writeoff_fee_card_fail':\n\t\t\t\t\t$el = array_shift($outstanding['ach']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'chargeback':\n\t\t\t\t\t$status->can_reverse_chargeback = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_lien':\n\t\t\t\t\t$status->has_lien_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_delivery':\n\t\t\t\t\t$status->has_delivery_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_transfer':\n\t\t\t\t\t$status->has_transfer_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'credit_card':\n\t\t\t\tcase 'credit_card_princ':\n\t\t\t\tcase 'credit_card_fees':\n\t\t\t\t\tif($e->status === 'complete' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\t$status->can_chargeback = TRUE;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'payout':\n\t\t\t\tcase 'card_payout':\n\t\t\t\t\t$status->has_payout = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'repayment_principal':\n\t\t\t\tcase 'card_repayment_principal':\n\t\t\t\t\tif($e->status === 'complete' && !empty($e->origin_id) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ($e->status === 'failed' && empty($e->origin_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Failed_Princ_non_reatts = bcadd($status->Failed_Princ_non_reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\n\t\t\t\tcase 'payment_arranged':\n\t\t\t\tcase 'payment_arranged_princ':\n\t\t\t\tcase 'card_payment_arranged':\n\t\t\t\tcase 'card_payment_arranged_princ':\n\t\t\t\t\tif($e->status === 'complete' && !empty($e->origin_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ($e->status === 'failed' && empty($e->origin_id) && $e->context == 'manual')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Failed_Princ_non_reatts = bcadd($status->Failed_Princ_non_reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_arranged_fees':\n\t\t\t\tcase 'card_payment_arranged_fees':\n\t\t\t\tcase 'payment_debt':\n\t\t\t\tcase 'paydown':\n\t\t\t\tcase 'card_paydown':\n\t\t\t\tcase 'payout_principal':\n\t\t\t\tcase 'payout_fees':\n\t\t\t\tcase 'cancel_principal':\n\t\t\t\tcase 'card_payout_principal':\n\t\t\t\tcase 'card_payout_fees':\n\t\t\t\tcase 'card_cancel_principal':\n\t\t\t\tcase 'adjustment_internal':\n\t\t\t\tcase 'adjustment_internal_princ':\n\t\t\t\tcase 'adjustment_internal_fees':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_manual':\n\t\t\t\tcase 'payment_manual_princ':\n\t\t\t\tcase 'card_payment_manual':\n\t\t\t\tcase 'card_payment_manual_princ':\n\t\t\t\t\tif($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_manual_fees':\n\t\t\t\tcase 'card_payment_manual_fees':\n\t\t\t\tcase 'full_balance':\n\t\t\t\tcase 'card_full_balance':\n\t\t\t\tcase 'quickcheck':\n\t\t\t\tcase 'debt_writeoff':\n\t\t\t\tcase 'debt_writeoff_princ':\n\t\t\t\tcase 'debt_writeoff_fees':\n\t\t\t\tcase 'ext_recovery':\n\t\t\t\tcase 'ext_recovery_princ':\n\t\t\t\tcase 'ext_recovery_fees':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'money_order':\n\t\t\t\tcase 'money_order_fees':\n\t\t\t\tcase 'money_order_princ':\n\t\t\t\tcase 'moneygram':\n\t\t\t\tcase 'moneygram_fees':\n\t\t\t\tcase 'moneygram_princ':\n\t\t\t\tcase 'western_union':\n\t\t\t\tcase 'western_union_fees':\n\t\t\t\tcase 'western_union_princ':\n\t\t\t\t\tif($e->status === 'complete' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'refund':\n\t\t\t\tcase 'card_refund':\n\t\t\t\tcase 'refund_3rd_party':\n\t\t\t\tcase 'cancel':\n\t\t\t\tcase 'card_cancel':\n\n\n\t\t\t\t\tbreak; // Nothing to do for these yet\n\t\t\t}\n\t\t}\n\t\t$status->stopping_location++;\n\t\t$posted_schedule[] = $e;\n\t}\n\n\t//echo \"<pre>\".print_r($posted_schedule,true).\"</pre>SC_credit:$status->Completed_SC_Credits + SC_debits:$status->Completed_SC_Debits - Failed_princ:$status->Failed_Princ_non_reatts - completed_reatt:$status->Completed_Reatts<br>\";\n\t//$status->past_due_balance = ($status->Completed_SC_Credits + $status->Completed_SC_Debits) - ($status->Failed_Princ_non_reatts - $status->Completed_Reatts);\n\t$status->past_due_balance = bcsub(bcadd($status->Completed_SC_Credits, $status->Completed_SC_Debits), bcsub($status->Failed_Princ_non_reatts, $status->Completed_Reatts));\n\n\t$status->outstanding = $outstanding;\n\n\t// if we have only cancel type transactions, we can't cancel. If this flag is not set, they were all cancel transactions. It is not cancellable.\n\tif (!$non_cancel_trans) $status->cancellable = false;\n\n\n\tif (!$verify)\n\t{\n\t\t// We need to filter the fail set - the initial run-through\n\t\t// put in ALL the failures, but we only really want the\n\t\t// newest ones. This is determined by the fact that if\n\t\t// the transaction_register_id of any failures equals the\n\t\t// origin_id of any other transaction, the former failure is\n\t\t// old, and therefore should be removed.\n\t\t$new_fail_set = array();\n\t\tforeach ($fail_set as $f)\n\t\t{\n\t\t\tif(! in_array($f->transaction_register_id, $oids))\n\t\t\t{\n\t\t\t\t$new_fail_set[] = $f;\n\t\t\t}\n\t\t}\n\n\t\t$status->fail_set = $new_fail_set;\n\t}\n\n\t//$status->max_reattempt_count = Count_Max_Reattempts($schedule);\n\n\t$status->debits = $debits;\n\t$status->posted_schedule = $posted_schedule;\n\t$schedule_status = $status;\n\n\t$status->pending_total = $status->pending_principal + $status->pending_fees + $status->pending_interest;\n\t$status->posted_total = $status->posted_principal + $status->posted_fees + $status->posted_interest;\n\t$status->running_total = $status->running_principal + $status->running_fees + $status->running_interest;\n\n\t$status->posted_principal = round($status->posted_principal, 2); \t//mantis:4560\n\t$status->posted_fees = round($status->posted_fees, 2);\t\t\t//mantis:4560\n\t$status->posted_interest = round($status->posted_interest, 2);\t\t\t//mantis:9701\n\n\t// Check to see if we allow manual loan renewals and we're within the renewal period\n\tif(($status->next_principal_due_date !== 'N/A') && (ECash::getConfig()->LOAN_RENEWAL_PENDING_PERIOD))\n\t{\n\t\tif(\tDate_Util_1::dateDiff(date('Y-m-d'), $status->next_principal_due_date) <= ECash::getConfig()->LOAN_RENEWAL_PENDING_PERIOD)\n\t\t{\n\t\t\t$status->can_renew_loan = TRUE;\n\t\t}\n\t}\n\treturn $status;\n}", "function schedule_backup_course_configure($course,$starttime = 0) { \n\n global $CFG;\n \n $status = true;\n\n schedule_backup_log($starttime,$course->id,\" checking parameters\");\n\n //Check the required variable\n if (empty($course->id)) {\n $status = false;\n }\n //Get scheduled backup preferences\n $backup_config = backup_get_config();\n\n //Checks backup_config pairs exist\n if ($status) {\n if (!isset($backup_config->backup_sche_modules)) {\n $backup_config->backup_sche_modules = 1;\n }\n if (!isset($backup_config->backup_sche_withuserdata)) {\n $backup_config->backup_sche_withuserdata = 1;\n }\n if (!isset($backup_config->backup_sche_metacourse)) {\n $backup_config->backup_sche_metacourse = 1;\n }\n if (!isset($backup_config->backup_sche_users)) {\n $backup_config->backup_sche_users = 1;\n }\n if (!isset($backup_config->backup_sche_logs)) {\n $backup_config->backup_sche_logs = 0;\n }\n if (!isset($backup_config->backup_sche_userfiles)) {\n $backup_config->backup_sche_userfiles = 1;\n }\n if (!isset($backup_config->backup_sche_coursefiles)) {\n $backup_config->backup_sche_coursefiles = 1;\n }\n if (!isset($backup_config->backup_sche_messages)) {\n $backup_config->backup_sche_messages = 0;\n }\n if (!isset($backup_config->backup_sche_active)) {\n $backup_config->backup_sche_active = 0;\n }\n if (!isset($backup_config->backup_sche_weekdays)) {\n $backup_config->backup_sche_weekdays = \"0000000\";\n }\n if (!isset($backup_config->backup_sche_hour)) {\n $backup_config->backup_sche_hour = 00;\n }\n if (!isset($backup_config->backup_sche_minute)) {\n $backup_config->backup_sche_minute = 00;\n }\n if (!isset($backup_config->backup_sche_destination)) {\n $backup_config->backup_sche_destination = \"\";\n }\n if (!isset($backup_config->backup_sche_keep)) {\n $backup_config->backup_sche_keep = 1;\n }\n }\n\n if ($status) {\n //Checks for the required files/functions to backup every mod\n //And check if there is data about it\n $count = 0;\n if ($allmods = get_records(\"modules\") ) {\n foreach ($allmods as $mod) {\n $modname = $mod->name;\n $modfile = \"$CFG->dirroot/mod/$modname/backuplib.php\";\n $modbackup = $modname.\"_backup_mods\";\n $modcheckbackup = $modname.\"_check_backup_mods\";\n if (file_exists($modfile)) {\n include_once($modfile);\n if (function_exists($modbackup) and function_exists($modcheckbackup)) {\n $var = \"exists_\".$modname;\n $$var = true;\n $count++;\n \n // PENNY NOTES: I have moved from here to the closing brace inside \n // by two sets of ifs()\n // to avoid the backup failing on a non existant backup.\n // If the file/function/whatever doesn't exist, we don't want to set this\n // this module in backup preferences at all.\n //Check data\n //Check module info\n $var = \"backup_\".$modname;\n if (!isset($$var)) {\n $$var = $backup_config->backup_sche_modules;\n }\n //Now stores all the mods preferences into an array into preferences\n $preferences->mods[$modname]->backup = $$var;\n\n //Check include user info\n $var = \"backup_user_info_\".$modname;\n if (!isset($$var)) {\n $$var = $backup_config->backup_sche_withuserdata;\n }\n //Now stores all the mods preferences into an array into preferences\n $preferences->mods[$modname]->userinfo = $$var;\n //And the name of the mod\n $preferences->mods[$modname]->name = $modname;\n }\n }\n }\n }\n\n // now set instances\n if ($coursemods = get_course_mods($course->id)) {\n foreach ($coursemods as $mod) {\n if (array_key_exists($mod->modname,$preferences->mods)) { // we are to backup this module\n if (empty($preferences->mods[$mod->modname]->instances)) {\n $preferences->mods[$mod->modname]->instances = array(); // avoid warnings\n }\n $preferences->mods[$mod->modname]->instances[$mod->instance]->backup = $preferences->mods[$mod->modname]->backup;\n $preferences->mods[$mod->modname]->instances[$mod->instance]->userinfo = $preferences->mods[$mod->modname]->userinfo;\n // there isn't really a nice way to do this...\n $preferences->mods[$mod->modname]->instances[$mod->instance]->name = get_field($mod->modname,'name','id',$mod->instance);\n }\n }\n }\n\n // finally, clean all the $preferences->mods[] not having instances. Nothing to backup about them\n foreach ($preferences->mods as $modname => $mod) {\n if (!isset($mod->instances)) {\n unset($preferences->mods[$modname]);\n }\n }\n }\n\n //Convert other parameters\n if ($status) {\n $preferences->backup_metacourse = $backup_config->backup_sche_metacourse;\n $preferences->backup_users = $backup_config->backup_sche_users;\n $preferences->backup_logs = $backup_config->backup_sche_logs;\n $preferences->backup_user_files = $backup_config->backup_sche_userfiles;\n $preferences->backup_course_files = $backup_config->backup_sche_coursefiles;\n $preferences->backup_messages = $backup_config->backup_sche_messages;\n $preferences->backup_course = $course->id;\n $preferences->backup_destination = $backup_config->backup_sche_destination;\n $preferences->backup_keep = $backup_config->backup_sche_keep;\n }\n\n //Calculate the backup string\n if ($status) {\n schedule_backup_log($starttime,$course->id,\" calculating backup name\");\n\n //Calculate the backup word\n //Take off some characters in the filename !!\n $takeoff = array(\" \", \":\", \"/\", \"\\\\\", \"|\");\n $backup_word = str_replace($takeoff,\"_\",moodle_strtolower(get_string(\"backupfilename\")));\n //If non-translated, use \"backup\"\n if (substr($backup_word,0,1) == \"[\") {\n $backup_word= \"backup\";\n }\n\n //Calculate the date format string\n $backup_date_format = str_replace(\" \",\"_\",get_string(\"backupnameformat\"));\n //If non-translated, use \"%Y%m%d-%H%M\"\n if (substr($backup_date_format,0,1) == \"[\") {\n $backup_date_format = \"%%Y%%m%%d-%%H%%M\";\n }\n\n //Calculate the shortname\n $backup_shortname = clean_filename($course->shortname);\n if (empty($backup_shortname) or $backup_shortname == '_' ) {\n $backup_shortname = $course->id;\n }\n\n //Calculate the final backup filename\n //The backup word\n $backup_name = $backup_word.\"-\";\n //The shortname\n $backup_name .= moodle_strtolower($backup_shortname).\"-\";\n //The date format\n $backup_name .= userdate(time(),$backup_date_format,99,false);\n //The extension\n $backup_name .= \".zip\";\n //And finally, clean everything\n $backup_name = clean_filename($backup_name);\n\n //Calculate the string to match the keep preference\n $keep_name = $backup_word.\"-\";\n //The shortname\n $keep_name .= moodle_strtolower($backup_shortname).\"-\";\n //And finally, clean everything\n $keep_name = clean_filename($keep_name);\n\n $preferences->backup_name = $backup_name;\n $preferences->keep_name = $keep_name;\n }\n\n //Calculate the backup unique code to allow simultaneus backups (to define\n //the temp-directory name and records in backup temp tables\n if ($status) {\n $backup_unique_code = time();\n $preferences->backup_unique_code = $backup_unique_code;\n }\n\n //Calculate necesary info to backup modules\n if ($status) {\n schedule_backup_log($starttime,$course->id,\" calculating modules data\");\n if ($allmods = get_records(\"modules\") ) {\n foreach ($allmods as $mod) {\n $modname = $mod->name;\n $modbackup = $modname.\"_backup_mods\";\n //If exists the lib & function\n $var = \"exists_\".$modname;\n if (isset($$var) && $$var) {\n //Add hidden fields\n $var = \"backup_\".$modname;\n //Only if selected\n if ($$var == 1) {\n $var = \"backup_user_info_\".$modname;\n //Call the check function to show more info\n $modcheckbackup = $modname.\"_check_backup_mods\";\n schedule_backup_log($starttime,$course->id,\" $modname\");\n $modcheckbackup($course->id,$$var,$backup_unique_code);\n }\n }\n }\n }\n }\n\n //Now calculate the users\n if ($status) {\n schedule_backup_log($starttime,$course->id,\" calculating users\");\n //Decide about include users with messages, based on SITEID\n if ($preferences->backup_messages && $preferences->backup_course == SITEID) {\n $include_message_users = true;\n } else {\n $include_message_users = false;\n }\n user_check_backup($course->id,$backup_unique_code,$preferences->backup_users,$include_message_users); \n }\n\n //Now calculate the logs\n if ($status) {\n if ($preferences->backup_logs) {\n schedule_backup_log($starttime,$course->id,\" calculating logs\");\n log_check_backup($course->id);\n }\n }\n\n //Now calculate the userfiles\n if ($status) {\n if ($preferences->backup_user_files) {\n schedule_backup_log($starttime,$course->id,\" calculating user files\");\n user_files_check_backup($course->id,$preferences->backup_unique_code);\n }\n }\n \n //Now calculate the coursefiles\n if ($status) {\n if ($preferences->backup_course_files) {\n schedule_backup_log($starttime,$course->id,\" calculating course files\");\n course_files_check_backup($course->id,$preferences->backup_unique_code);\n }\n }\n\n //If everything is ok, return calculated preferences\n if ($status) {\n $status = $preferences;\n }\n\n return $status;\n}", "function get_lunch_schedule($schedtype,$gc_start_break,$sched_break_start,$gc_end_break,$sched_break_end,$start_break_partner,$end_break_partner,$sched_to,$actual_timeout,$employee_idno,$date_timelog){\n\t//------------------$gc_end_break - lunch start\n\t//-------------------$gc_start_break - lunch end\n\t//--baligtad\n\t$trs = get_instance();\n\t$trs->load->model('time_record/Timerecordsummary_model');\n\t\t$ded1 = 0;\n\t\t$ded2 = 0;\n\t\t$fix_lunch_break = 0;\n\t\t$lunch_deduction = 0;\n\t\t//-----------LUNCH DEDUCTION / OVERBREAK--------------------------\n\t\t//early out\n\t\tif($gc_start_break <= $sched_break_start){\n\t\t\t$x = $gc_start_break - $sched_break_start;\n\t\t\t$ded1 = $ded1 + $ded2;\n\t\t}\n\t\t//late in\n\t\tif($gc_end_break >= $sched_break_end){\n\t\t\t$y = $gc_end_break -$sched_break_end;\n\t\t\t$ded2 = $ded2 + $y;\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$lunch_deduction = 0;\n\t\t}else{\n\t\t\t//\n\t\t\t$lunch_deduction = $ded1 + $ded2;\n\t\t}\n\t\t// $lunch_deduction = $ded1 + $ded2;\n\n\t\t// $one = date('H:i', mktime(0,$gc_start_break));\n\t\t// $two = date('H:i', mktime(0,$start_break_partner));\n\t\t// $three = date('H:i', mktime(0,$gc_end_break));\n\t\t// $four = date('H:i', mktime(0,$end_break_partner));\n\t\t// print_r(array(\n\t\t// \t'start_break' => $one,\n\t\t// \t'start_partner' => $two,\n\t\t// \t'end_break' => $three,\n\t\t// \t'end_break_partner' => $four\n\t\t// ));\n\n\n\t\t// print_r(array('start' => $start_break_partner, 'sched' => $sched_break_start));\n\t\t//----FIX LUNCH BREAK------------------\n\t\tif(($gc_start_break > $sched_break_start) && ($start_break_partner < $sched_break_start)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($gc_start_break - $sched_break_start);\n\t\t}\n\t\telse{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\tif(($gc_end_break < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($sched_break_end - $gc_end_break);\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\t//checks if employee is half day\n\t\tif(($actual_timeout == $gc_start_break) && ($actual_timeout < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break\t+ ($gc_start_break - $gc_end_break);\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$fix_lunch_break = 0;\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break;\n\t\t}\n\t\t//will check if time record exist in work order. if workorder exist, it will remove the overbreak of employee\n\t\t$breakout_hhmm = date('H:i', mktime(0,$gc_start_break));\n\t\t$check_workorder = $trs->Timerecordsummary_model->check_lunch_workorder($employee_idno,$date_timelog,$breakout_hhmm)->row();\n\t\tif($check_workorder != null){\n\t\t\t$et = convert_to_minutes($check_workorder->end_time);\n\t\t\tif($et > $sched_break_end){\n\t\t\t\t$overbreak_deduct = $et - $sched_break_end;\n\t\t\t\t$fix_lunch_break = $fix_lunch_break - $lunch_deduction;\n\t\t\t\t$lunch_deduction = $lunch_deduction - $overbreak_deduct;\n\n\t\t\t}\n\t\t}\n\t\t$getbreaks = array(\n\t\t\t'fix_lunch_break' => $fix_lunch_break,\n\t\t\t'lunch_deduction' => $lunch_deduction\n\t\t);\n\t\treturn $getbreaks;\n}", "function setup_gateways_monitor() {\n\tglobal $config;\n\tglobal $g;\n\t$gateways_arr = return_gateways_array();\n\n\t/* kill apinger process */\n\tif(is_process_running(\"apinger\"))\n\t\tmwexec(\"/usr/bin/killall apinger\", true);\n\t$fd = fopen(\"{$g['varetc_path']}/apinger.conf\", \"w\");\n\t$apingerconfig = <<<EOD\n\n# pfSense apinger configuration file. Automatically Generated!\n\n## User and group the pinger should run as\nuser \"nobody\"\ngroup \"nobody\"\n\n## Mailer to use (default: \"/usr/lib/sendmail -t\")\n#mailer \"/var/qmail/bin/qmail-inject\" \n\n## Location of the pid-file (default: \"/var/run/apinger.pid\")\npid_file \"{$g['varrun_path']}/apinger.pid\"\n\n## Format of timestamp (%s macro) (default: \"%b %d %H:%M:%S\")\n#timestamp_format \"%Y%m%d%H%M%S\"\n\nstatus {\n\t## File where the status information whould be written to\n\tfile \"/tmp/apinger.status\"\n\t## Interval between file updates\n\t## when 0 or not set, file is written only when SIGUSR1 is received\n\tinterval 10s\n}\n\n########################################\n# RRDTool status gathering configuration\n# Interval between RRD updates\nrrd interval 60s;\n\n## These parameters can be overriden in a specific alarm configuration\nalarm default { \n\tcommand on \"touch /tmp/filter_dirty\"\n\tcommand off \"touch /tmp/filter_dirty\"\n\tcombine 10s\n}\n\n## \"Down\" alarm definition. \n## This alarm will be fired when target doesn't respond for 30 seconds.\nalarm down \"down\" {\n\ttime 10s\n}\n\n## \"Delay\" alarm definition. \n## This alarm will be fired when responses are delayed more than 200ms\n## it will be canceled, when the delay drops below 100ms\nalarm delay \"delay\" {\n\tdelay_low 200ms\n\tdelay_high 500ms\n}\n\n## \"Loss\" alarm definition. \n## This alarm will be fired when packet loss goes over 20%\n## it will be canceled, when the loss drops below 10%\nalarm loss \"loss\" {\n\tpercent_low 10\n\tpercent_high 20\n}\n\ntarget default {\n\t## How often the probe should be sent\t\n\tinterval 1s\n\t\n\t## How many replies should be used to compute average delay \n\t## for controlling \"delay\" alarms\n\tavg_delay_samples 10\n\t\n\t## How many probes should be used to compute average loss\n\tavg_loss_samples 50\n\n\t## The delay (in samples) after which loss is computed\n\t## without this delays larger than interval would be treated as loss\n\tavg_loss_delay_samples 20\n\n\t## Names of the alarms that may be generated for the target\n\talarms \"down\",\"delay\",\"loss\"\n\n\t## Location of the RRD\n\t#rrd file \"{$g['vardb_path']}/rrd/apinger-%t.rrd\"\n}\n\n## Targets to probe\n## Each one defined with:\n## target <address> { <parameter>... }\n## The parameters are those described above in the \"target default\" section\n## plus the \"description\" parameter.\n## the <address> should be IPv4 or IPv6 address (not hostname!)\n\nEOD;\n\n\t/* add static routes for each gateway with their monitor IP */\n\tif(is_array($gateways_arr)) {\n\t\tforeach($gateways_arr as $name => $gateway) {\n\t\t\tif($gateway['monitor'] == \"\") {\n\t\t\t\t$gateway['monitor'] = $gateway['gateway'];\n\t\t\t}\n\t\t\t$apingerconfig .= \"target \\\"{$gateway['monitor']}\\\" {\\n\";\n\t\t\t$apingerconfig .= \"\tdescription \\\"{$gateway['name']}\\\"\\n\";\n\t\t\t$apingerconfig .= \"\trrd file \\\"{$g['vardb_path']}/rrd/{$gateway['name']}-quality.rrd\\\"\\n\";\n\t\t\t$apingerconfig .= \"}\\n\";\n\t\t\t$apingerconfig .= \"\\n\";\n\t\t\tif($gateway['monitor'] == $gateway['gateway']) {\n\t\t\t\t/* if the gateway is the same as the monitor we do not add a\n\t\t\t\t * route as this will break the routing table */\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tmwexec(\"/sbin/route delete -host \" . escapeshellarg($gateway['monitor']));\n\t\t\t\tmwexec(\"/sbin/route add -host \" . escapeshellarg($gateway['monitor']) .\n\t\t\t\t\t\" \" . escapeshellarg($gateway['gateway']));\n\t\t\t}\n\t\t}\n\t}\n\tfwrite($fd, $apingerconfig);\n\tfclose($fd);\n\n\tif(!is_process_running(\"apinger\")) {\n\t\tif (is_dir(\"{$g['tmp_path']}\"))\n\t\t\tchmod(\"{$g['tmp_path']}\", 01777);\n\t\tif (is_dir(\"{$g['vardb_path']}/rrd\"))\n\t\t\tchown(\"{$g['vardb_path']}/rrd\", \"nobody\");\n\t\t/* start a new apinger process */\n\t\tmwexec_bg(\"/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf\");\n\t}\n\treturn 0;\n}", "function cron_getAlertpatientData()\n{\n global $SMS_NOTIFICATION_HOUR, $EMAIL_NOTIFICATION_HOUR;\n $where = \" AND (p.hipaa_allowsms='YES' AND p.phone_cell<>'' AND e.pc_sendalertsms != 'YES' AND e.pc_apptstatus != 'x')\";\n $check_date = date(\"Y-m-d\", mktime(date(\"h\") + $SMS_NOTIFICATION_HOUR, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\")));\n $patient_array = fetchEvents($check_date, $check_date, $where, 'u.lname,pc_startTime,p.lname');\n\n return $patient_array;\n}", "function wptc_main_cycle() {\r\n\r\n\t$config = new WPTC_Config();\r\n\t$timestamp_plus_secs = time() + ADVANCED_SECONDS_FOR_TIME_CALCULATION;\r\n\t$usertime = $config->get_wptc_user_today_date_time('Y-m-d', $timestamp_plus_secs);\r\n\r\n\t//weekly backup validate\r\n\t// if (( wptc_is_weekly_backup_eligible($config) || ($config->get_option('wptc_today_main_cycle') != $usertime) ) && ($config->get_option('wptc_main_cycle_running') != true) && $config->get_option('first_backup_started_atleast_once') ) {\r\n\tif ($config->get_option('wptc_today_main_cycle') != $usertime && ($config->get_option('wptc_main_cycle_running') != true) && $config->get_option('first_backup_started_atleast_once') ) {\r\n\t\t$config->set_option('wptc_main_cycle_running', true);\r\n\t\twptc_main_cycle_event();\r\n\t} else {\r\n\t\tif ($config->get_option('wptc_main_cycle_running') && $config->get_option('first_backup_started_atleast_once') && !is_any_ongoing_wptc_backup_process()) {\r\n\t\t\t\t$config->set_option('wptc_main_cycle_running', true);\r\n\t\t\t\t$config->get_option('wptc_main_cycle_running', false);\r\n\t\t\t\twptc_log(array(), '---------declined_by_wptc_main_cycle RARE case------------');\r\n\t\t}\r\n\t\twptc_log(array(), '---------declined_by_wptc_main_cycle------------');\r\n\t\tsend_response_wptc('declined_by_wptc_main_cycle', 'SCHEDULE');\r\n\t}\r\n}", "function wptc_main_cycle() {\r\n\t$config = new WPTC_Config();\r\n\t$usertime = $config->get_wptc_user_today_date_time('Y-m-d');\r\n\t//weekly backup validate\r\n\t// if (( is_weekly_backup_eligible($config) || ($config->get_option('wptc_today_main_cycle') != $usertime) ) && ($config->get_option('wptc_main_cycle_running') != true) && $config->get_option('first_backup_started_atleast_once') ) {\r\n\tif ($config->get_option('wptc_today_main_cycle') != $usertime && ($config->get_option('wptc_main_cycle_running') != true) && $config->get_option('first_backup_started_atleast_once') ) {\r\n\t\t$config->set_option('wptc_main_cycle_running', true);\r\n\t\twptc_main_cycle_event();\r\n\t} else {\r\n\t\tif ($config->get_option('wptc_main_cycle_running') && $config->get_option('first_backup_started_atleast_once') && !is_any_ongoing_wptc_backup_process()) {\r\n\t\t\t\t$config->set_option('wptc_main_cycle_running', true);\r\n\t\t\t\t$config->get_option('wptc_main_cycle_running', false);\r\n\t\t\t\twptc_log(array(), '---------declined_by_wptc_main_cycle RARE case------------');\r\n\t\t}\r\n\t\twptc_log(array(), '---------declined_by_wptc_main_cycle------------');\r\n\t\tsend_response_wptc('declined_by_wptc_main_cycle', 'SCHEDULE');\r\n\t}\r\n}", "public function data_cron_health_checks() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'+5 minutes',\n\t\t\t\t'good',\n\t\t\t\t__( 'Scheduled events are running' ),\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'-50 minutes',\n\t\t\t\t'recommended',\n\t\t\t\t__( 'A scheduled event is late' ),\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'-500 minutes',\n\t\t\t\t'recommended',\n\t\t\t\t__( 'A scheduled event has failed' ),\n\t\t\t\tfalse,\n\t\t\t\ttrue,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'-50 minutes',\n\t\t\t\t\t'-500 minutes',\n\t\t\t\t),\n\t\t\t\t'recommended',\n\t\t\t\t__( 'A scheduled event has failed' ),\n\t\t\t\ttrue,\n\t\t\t\ttrue,\n\t\t\t),\n\t\t);\n\t}", "public function notifyFailed()\n\t{\n\t\t// Invalidate stale backups\n\t\ttry\n\t\t{\n\t\t\tFactory::resetState([\n\t\t\t\t'global' => true,\n\t\t\t\t'log' => false,\n\t\t\t\t'maxrun' => $this->container->params->get('failure_timeout', 180),\n\t\t\t]);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// This will die if the output directory is invalid. Let it die, then.\n\t\t}\n\n\t\t// Get the last execution and search for failed backups AFTER that date\n\t\t$last = $this->getLastCheck();\n\n\t\t// Get failed backups\n\t\t$filters = [\n\t\t\t['field' => 'status', 'operand' => '=', 'value' => 'fail'],\n\t\t\t['field' => 'origin', 'operand' => '<>', 'value' => 'restorepoint'],\n\t\t\t['field' => 'backupstart', 'operand' => '>', 'value' => $last],\n\t\t];\n\n\t\t$failed = Platform::getInstance()->get_statistics_list(['filters' => $filters]);\n\n\t\t// Well, everything went ok.\n\t\tif (!$failed)\n\t\t{\n\t\t\treturn [\n\t\t\t\t'message' => [\"No need to run: no failed backups or notifications were already sent.\"],\n\t\t\t\t'result' => true,\n\t\t\t];\n\t\t}\n\n\t\t// Whops! Something went wrong, let's start notifing\n\t\t$superAdmins = [];\n\t\t$superAdminEmail = $this->container->params->get('failure_email_address', '');\n\n\t\tif (!empty($superAdminEmail))\n\t\t{\n\t\t\t$superAdmins = $this->getSuperUsers($superAdminEmail);\n\t\t}\n\n\t\tif (empty($superAdmins))\n\t\t{\n\t\t\t$superAdmins = $this->getSuperUsers();\n\t\t}\n\n\t\tif (empty($superAdmins))\n\t\t{\n\t\t\treturn [\n\t\t\t\t'message' => [\"WARNING! Failed backup(s) detected, but there are no configured Super Administrators to receive notifications\"],\n\t\t\t\t'result' => false,\n\t\t\t];\n\t\t}\n\n\t\t$failedReport = [];\n\n\t\tforeach ($failed as $fail)\n\t\t{\n\t\t\t$string = \"Description : \" . $fail['description'] . \"\\n\";\n\t\t\t$string .= \"Start time : \" . $fail['backupstart'] . \"\\n\";\n\t\t\t$string .= \"Origin : \" . $fail['origin'] . \"\\n\";\n\t\t\t$string .= \"Type : \" . $fail['type'] . \"\\n\";\n\t\t\t$string .= \"Profile ID : \" . $fail['profile_id'] . \"\\n\";\n\t\t\t$string .= \"Backup ID : \" . $fail['id'];\n\n\t\t\t$failedReport[] = $string;\n\t\t}\n\n\t\t$failedReport = implode(\"\\n#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+#\\n\", $failedReport);\n\n\t\t$email_subject = $this->container->params->get('failure_email_subject', '');\n\n\t\tif (!$email_subject)\n\t\t{\n\t\t\t$email_subject = <<<ENDSUBJECT\nTHIS EMAIL IS SENT FROM YOUR SITE \"[SITENAME]\" - Failed backup(s) detected\nENDSUBJECT;\n\t\t}\n\n\t\t$email_body = $this->container->params->get('failure_email_body', '');\n\n\t\tif (!$email_body)\n\t\t{\n\t\t\t$email_body = <<<ENDBODY\n================================================================================\nFAILED BACKUP ALERT\n================================================================================\n\nYour site has determined that there are failed backups.\n\nThe following backups are found to be failing:\n\n[FAILEDLIST]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by scritp you, or the person who built\nor manages your site, has installed and explicitly configured. This script looks\nfor failed backups and sends an email notification to all Super Users.\n\nIf you do not understand what this means, please do not contact the authors of\nthe software. They are NOT sending you this email and they cannot help you.\nInstead, please contact the person who built or manages your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]\n\nENDBODY;\n\t\t}\n\n\t\t$jconfig = $this->container->platform->getConfig();\n\n\t\t$mailfrom = $jconfig->get('mailfrom');\n\t\t$fromname = $jconfig->get('fromname');\n\n\t\t$email_subject = Factory::getFilesystemTools()->replace_archive_name_variables($email_subject);\n\t\t$email_body = Factory::getFilesystemTools()->replace_archive_name_variables($email_body);\n\t\t$email_body = str_replace('[FAILEDLIST]', $failedReport, $email_body);\n\n\t\tforeach ($superAdmins as $sa)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$mailer = JFactory::getMailer();\n\n\t\t\t\t$mailer->setSender([$mailfrom, $fromname]);\n\t\t\t\t$mailer->addRecipient($sa->email);\n\t\t\t\t$mailer->setSubject($email_subject);\n\t\t\t\t$mailer->setBody($email_body);\n\t\t\t\t$mailer->Send();\n\t\t\t}\n\t\t\tcatch (\\Exception $e)\n\t\t\t{\n\t\t\t\t// Joomla! 3.5 is written by incompetent bonobos\n\t\t\t}\n\t\t}\n\n\t\t// Let's update the last time we check, so we will avoid to send\n\t\t// the same notification several times\n\t\t$this->updateLastCheck(intval($last));\n\n\t\treturn [\n\t\t\t'message' => [\n\t\t\t\t\"WARNING! Found \" . count($failed) . \" failed backup(s)\",\n\t\t\t\t\"Sent \" . count($superAdmins) . \" notifications\",\n\t\t\t],\n\t\t\t'result' => true,\n\t\t];\n\t}", "function monitis_add_ping_monitor($vars, $ip) {\n list($ep, $ak, $sk) = monitis_extract_api_info($vars);\n $params = array();\n $params['type'] = 'ping';\n $params['name'] = 'WHMCS_' . $ip;\n $params['url'] = $ip;\n $params['interval'] = '1';\n $params['locationIds'] = '1,9,10';\n $params['tag'] = 'WHMCS';\n $params['url'] = $ip;\n \n $result = monitis_post($ep, $ak, $sk, 'addExternalMonitor', $params);\n return $result;\n}", "public function compoff_period(){\n\t\tif(!empty($this->data['HrLeave']['leave_from']) && !empty($this->data['HrLeave']['leave_to'])){\t\t\t\t\t\t\n\t\t\tif($this->data['HrLeave']['hr_leave_type_id'] == '7'){ \n\t\t\t\t$from_date = $this->format_date_save($this->data['HrLeave']['leave_from']);\t\t\t\t\n\t\t\t\t$date1 = $this->data['HrLeave']['comp_off_dates'][0];\n\t\t\t\t$date2 = $this->data['HrLeave']['comp_off_dates'][1];\t\t\t\n\t\t\t\n\t\t\t\t$diff1 = $this->diff_date($date1, $from_date);\n\t\t\t\tif(!empty($date2)){\n\t\t\t\t\t$diff2 = $this->diff_date($date2, $from_date);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// find the business unit and limit of days\n\t\t\t\t/*\n\t\t\t\t$data = $this->Home->findById(CakeSession::read('USER.Login.id'), array('fields'=> 'Home.hr_business_unit_id'));\t\t\t\t\t\n\t\t\t\tif($data['Home']['hr_business_unit_id'] == 1){\n\t\t\t\t\t$limit = 30;\n\t\t\t\t}else{\n\t\t\t\t\t$limit = 15;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$limit = 30;\n\t\t\t\t$validator = $this->validator();\n\t\t\t\tif($diff1 > $limit){\t\t\t\t\t\n\t\t\t\t\t$validator['comp_off_dates']['compoff_period']->message = \"Comp. off should be used within $limit days from the date of leave\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif($diff2 > $limit){\n\t\t\t\t\t$validator['comp_off_dates']['compoff_period']->message = \"Comp. off should be used within $limit days from the date of leave\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t\t\t\t\n\t\t\n\t}", "function get_valid_schedule_intervals($type, $validate = 0)\n{\n\t$valid = array();\n\tswitch($type){\n\t\tcase \"minutes\":\n\t\t\tfor($i = 5; $i <= 59; $i += 1)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"hours\":\n\t\t\tfor($i = 1; $i <= 23; $i ++)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"weeks\":\n\t\t\tfor($i = 1; $i <= 52; $i += 1)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"days\":\n\t\t\tfor($i = 1; $i <= 60; $i += 1)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"months\":\n\t\t\tfor($i = 1; $i <= 36; $i += 1)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"years\":\n\t\t\tfor($i = 1; $i <= 5; $i += 1)$valid[] = $i;\n\t\tbreak;\n\t\t\n\t\tcase \"hour_ranges\":\n\t\t\tfor($i = 0; $i <= 23; $i += 1)$valid[] = \"'\".sprintf('%02d', $i).\":00'\";\n\t\tbreak;\n\t}\n\t\n\tif(!empty($validate)){\n\t\tif(in_array($validate, $valid))return true;\n\t\treturn false;\t\n\t}\n\treturn $valid;\n}", "public function interview_appointment_reminder_save($params) {\n $appointment_time = $params['trigger_timestamp'];\n// $before_2hrs = strtotime('-2 hours', $appointment_time);\n// $before_24hrs = strtotime('-24 hours', $appointment_time); \n\n $before_2hrs = strtotime('-450 minutes', $appointment_time); //gmt hours -5.30 back so 7.30 hours back 7*60+30=450\n $before_24hrs = strtotime('-1770 minutes', $appointment_time); //gmt hours -5.30 back 24*60+30=1470\n $current_time = $this->get_current_time(); \n $str_appt_time = strtotime($appointment_time);\n $accept_notifycation = strtotime(date(\"Y-m-d H:i:s\", strtotime('+1 minutes', $current_time)));\n $data[] = array('sender' => $params['sender'], 'receipients' => $params['receipients'], 'navigation' => NAVIGATION_APPOINTMENT_DETAIL\n , 'trigger_timestamp' => $accept_notifycation, 'typeID' => INTERVIEW_CONF_NOTIFICATION_A, 'sendout_id' => $params['sendout_id']);\n $data[] = array('sender' => $params['receipients'], 'receipients' => $params['sender']\n , 'trigger_timestamp' => $accept_notifycation, 'typeID' => INTERVIEW_CONF_NOTIFICATION_B, 'sendout_id' => $params['sendout_id']);\n \n if (intval($before_24hrs) >= intval($current_time)) {\n $data[] = array('sender' => $params['sender'], 'receipients' => $params['receipients'], 'navigation' => NAVIGATION_APPOINTMENT_DETAIL\n , 'trigger_timestamp' => $before_24hrs, 'fixed_timestamp' => $appointment_time, 'typeID' => INTERVIEW_APP_REMINDER_1A, 'sendout_id' => $params['sendout_id']);\n $data[] = array('sender' => $params['receipients'], 'receipients' => $params['sender']\n , 'trigger_timestamp' => $before_24hrs, 'fixed_timestamp' => $appointment_time, 'typeID' => INTERVIEW_APP_REMINDER_1B, 'sendout_id' => $params['sendout_id']);\n }\n if (intval($before_2hrs) >= intval($current_time)) {\n $data[] = array('sender' => $params['sender'], 'receipients' => $params['receipients'], 'navigation' => NAVIGATION_APPOINTMENT_DETAIL\n , 'trigger_timestamp' => $before_2hrs, 'fixed_timestamp' => $appointment_time, 'typeID' => INTERVIEW_APP_REMINDER_2A, 'sendout_id' => $params['sendout_id']);\n $data[] = array('sender' => $params['receipients'], 'receipients' => $params['sender']\n , 'trigger_timestamp' => $before_2hrs, 'fixed_timestamp' => $appointment_time, 'typeID' => INTERVIEW_APP_REMINDER_2B, 'sendout_id' => $params['sendout_id']);\n }\n $this->datasave($data);\n }", "public function insertMaintenanceSchedule($params);", "function run($job)\n{\n global $errorClass;\n global $configData;\n global $queries;\n global $databaseClass;\n global $szopDbClass;\n global $StartRunTime;\n\n //echo \"Job data = \" . print_r($job) . \"\\n\";\n //die;\n // Calculate the start and end time for the reports.\n // The time differences are calculated to include the FULL number of\n // seconds. I.e. one whole day = 86400 seconds and the time difference is\n // set at that.\n switch($job[\"duration\"])\n {\n case 1: // Daily, last 24 hours of previous day\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - 1,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime),\n date(\"Y\", $StartRunTime) ));\n break;\n case 7: // Weekly, last 7 days of the previous whole week\n // Starting with a Monday to a Sunday\n $currWeekDay = date(\"w\", $StartRunTime);\n\n if ($currWeekDay == 0)\n {\n // Sunday\n $daysToRemove = 13;\n }\n else\n {\n $daysToRemove = 6 + $currWeekDay;\n }\n\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - $daysToRemove,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - $daysToRemove + 7,\n date(\"Y\", $StartRunTime) ));\n break;\n case 30: // Monthly, last month\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime) - 1,\n 1,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n 1,\n date(\"Y\", $StartRunTime) ));\n break;\n default:\n // Don't know what the duration is, do nothing instead.\n return;\n break;\n }\n\n echo \"Start Date \" . $startDate . \"\\nEnd Date \" . $endDate . \"\\n\";\n\n $headers = \"\";\n $xmlWidth = array();\n $xmlType = array();\n $coreQuery = true;\n $name = \"\";\n\n // Set the correct query for the report\n // The situation is more complex for ad-hoc reports. We have to pickup\n // the correct bind variables to ensure that the query will work.\n // For the main queries they all take customer_id, start_date and\n // end_date.\n //\n switch($job[\"type\"])\n {\n case 'R1_RetentionPeriod':\n echo \"Retention Period\\n\";\n if ($queries[\"dbRetentionPeriod\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qRetentionPeriod\"]);\n $headers = $queries[\"dRetentionPeriod\"];\n $xmlWidth = $queries[\"xmlRetentionPeriodColumnWidth\"];\n $xmlType = $queries[\"xmlRetentionPeriodColumnType\"];\n break;\n case 'R2_Delivered':\n echo \"Delivered\\n\";\n if ($queries[\"dbDelivered\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qDelivered\"]);\n $headers = $queries[\"dDelivered\"];\n $xmlWidth = $queries[\"xmlDeliveredColumnWidth\"];\n $xmlType = $queries[\"xmlDeliveredColumnType\"];\n break;\n case 'R3_Stored':\n echo \"Stored\\n\";\n if ($queries[\"dbStored\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qStored\"]);\n $headers = $queries[\"dStored\"];\n $xmlWidth = $queries[\"xmlStoredColumnWidth\"];\n $xmlType = $queries[\"xmlStoredColumnType\"];\n break;\n case 'R4_Collected':\n echo \"Collected\\n\";\n if ($queries[\"dbCollected\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qCollected\"]);\n $headers = $queries[\"dCollected\"];\n $xmlWidth = $queries[\"xmlCollectedColumnWidth\"];\n $xmlType = $queries[\"xmlCollectedColumnType\"];\n break;\n case 'R5_Expired':\n echo \"Expired\\n\";\n if ($queries[\"dbExpired\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qExpired\"]);\n $headers = $queries[\"dExpired\"];\n $xmlWidth = $queries[\"xmlExpiredColumnWidth\"];\n $xmlType = $queries[\"xmlExpiredColumnType\"];\n break;\n case 'R6_Exception':\n echo \"Excpetion\\n\";\n if ($queries[\"dbExxeption\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qException\"]);\n $headers = $queries[\"dException\"];\n $xmlWidth = $queries[\"xmlExceptionColumnWidth\"];\n $xmlType = $queries[\"xmlExceptionColumnType\"];\n break;\n case 'R7_Invoice':\n echo \"Invoice\\n\";\n if ($queries[\"dbInvoice\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $localDbClass->query($queries[\"qInvoice\"]);\n $headers = $queries[\"dInvoice\"];\n $xmlWidth = $queries[\"xmlInvoiceColumnWidth\"];\n $xmlType = $queries[\"xmlInvoiceColumnType\"];\n break;\n default:\n echo \"Ad-hoc report\\n\";\n $name = $job[\"type\"];\n\n if ($queries[\"db\" . $name] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $localDbClass->query($queries[\"q\" . $name]);\n $headers = $queries[\"d\" . $name];\n $xmlWidth = $queries[\"xml\" . $name . \"ColumnWidth\"];\n $xmlType = $queries[\"xml\" . $name . \"ColumnType\"];\n\n $coreQuery = false;\n break;\n }\n\n // Bind the variables to the query\n if ($coreQuery == true)\n {\n $localDbClass->bind(\":customer_id\", $job[\"customerId\"]);\n $localDbClass->bind(\":start_date\", $startDate);\n $localDbClass->bind(\":end_date\", $endDate);\n }\n else\n {\n foreach($queries[\"bindVar\" . $name] as $key => $field)\n {\n // We know about some fields.\n switch($field)\n {\n case \"none\":\n continue 2;\n case \"customer_id\":\n $localDbClass->bind(\":customer_id\", $job[\"customerId\"]);\n continue 2;\n case \"start_date\":\n $localDbClass->bind(\":start_date\", $startDate);\n continue 2;\n case \"end_date\":\n $localDbClass->bind(\":end_date\", $endDate);\n continue 2;\n }\n // We need to get the value from somewhere, try the query itself.\n $localDbClass->bind(\":\" . $field,\n $queries[\"dataVar\" . $name][$key]);\n }\n }\n\n $localDbClass->execute();\n \n buildInvoiceData($job['customerId']);\n\n outputData($localDbClass, $job, $headers, $xmlWidth, $xmlType);\n sendData($job);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the severity level of the notice.
public function get_severity();
[ "public function getSeverityLevel()\n {\n if (array_key_exists('severityLevel', $this->_data)) { return $this->_data['severityLevel']; }\n return NULL;\n }", "public function getSeverity()\n {\n return $this->severity;\n }", "public function getSeverity(): string\n {\n return $this->severity;\n }", "public function severity()\n {\n return $this->options['severity'];\n }", "public function getLogSeverity()\n {\n return $this->severity;\n }", "public function getSeverity() {}", "public function getNotificationSeverity();", "public function getSeverityNumber()\n {\n return $this->severity_number;\n }", "public function severity();", "public function getSeverityText()\n {\n return $this->severity_text;\n }", "public function getLevel()\n {\n return $this->app['config']->get('laravel-sentry::level', 'error');\n }", "public function getEffectiveSeverity()\n {\n return $this->effective_severity;\n }", "public function getSeverity()\n {\n if (array_key_exists(\"severity\", $this->_propDict)) {\n if (is_a($this->_propDict[\"severity\"], \"\\Beta\\Microsoft\\Graph\\Model\\AlertSeverity\") || is_null($this->_propDict[\"severity\"])) {\n return $this->_propDict[\"severity\"];\n } else {\n $this->_propDict[\"severity\"] = new AlertSeverity($this->_propDict[\"severity\"]);\n return $this->_propDict[\"severity\"];\n }\n }\n return null;\n }", "public function getLevel()\n {\n return PMA_Message::$level[$this->getNumber()];\n }", "public function getSeverityForLogLevel($level);", "public function getLevel(): int\n {\n if(!array_key_exists($this->code, self::$ERRORS))\n {\n return self::ERROR;\n }\n\n return self::$ERRORS[$this->code];\n }", "public function getSeverity()\n {\n if (array_key_exists(\"severity\", $this->_propDict)) {\n if (is_a($this->_propDict[\"severity\"], \"\\Beta\\Microsoft\\Graph\\Model\\UserExperienceAnalyticsInsightSeverity\") || is_null($this->_propDict[\"severity\"])) {\n return $this->_propDict[\"severity\"];\n } else {\n $this->_propDict[\"severity\"] = new UserExperienceAnalyticsInsightSeverity($this->_propDict[\"severity\"]);\n return $this->_propDict[\"severity\"];\n }\n }\n return null;\n }", "public function getExpectedLevel(): string\n {\n return $this->level ?: 'WARNING';\n }", "public function getSeverity()\n {\n if (array_key_exists(\"severity\", $this->_propDict)) {\n if (is_a($this->_propDict[\"severity\"], \"\\Beta\\Microsoft\\Graph\\Model\\WindowsMalwareSeverity\") || is_null($this->_propDict[\"severity\"])) {\n return $this->_propDict[\"severity\"];\n } else {\n $this->_propDict[\"severity\"] = new WindowsMalwareSeverity($this->_propDict[\"severity\"]);\n return $this->_propDict[\"severity\"];\n }\n }\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set this to true if the workflow being cancelled is a child of the workflow originating this command. The request will be rejected if it is set to true and the target workflow is not a child of the requesting workflow. Generated from protobuf field bool child_workflow_only = 6;
public function setChildWorkflowOnly($var) { GPBUtil::checkBool($var); $this->child_workflow_only = $var; return $this; }
[ "public function getChildWorkflowOnly()\n {\n return $this->child_workflow_only;\n }", "public function setOnlyParent($onlyParent)\n {\n if (boolval($this->onlyParent) !== boolval($onlyParent)) {\n $this->onlyParent = boolval($onlyParent);\n }\n }", "public function childRequest(){\n return $this->hasMany('Modules\\Workflow\\Entities\\RequestType','parent_request_id','id');\n }", "public function userform_get_parent_disabilitation_info($child_parentcontent) {\n // $this->flag->ismatchable = false\n // this method is never called\n }", "public function isChildProcess()\n {\n return $this->isChild;\n }", "public function setInheritWorkflows( bool $bool ) : Property\n {\n if( !c\\BooleanValues::isBoolean( $bool ) )\n throw new e\\UnacceptableValueException(\n S_SPAN . \"The value $bool must be a boolean.\" . E_SPAN );\n \n // already set\n if( $this->inherit_workflows == $bool )\n return $this;\n \n if( $bool )\n {\n $this->inherit_workflows = $bool;\n\n $folder_id = $this->identifier->getId();\n $folder = a\\Asset::getAsset( $this->service, a\\Folder::TYPE, $folder_id );\n $parent = $folder->getParentContainer();\n \n if( isset( $parent ) )\n {\n $parent_settings = $parent->getWorkflowSettings();\n $parent_wds = $parent_settings->getWorkflowDefinitions();\n \n if( is_array( $parent_wds ) && count( $parent_wds ) > 0 )\n {\n foreach( $parent_wds as $parent_wd )\n {\n $this->inherited_workflow_definitions[] = $parent_wd;\n }\n }\n }\n }\n else\n {\n $this->unsetInheritWorkflows();\n }\n \n return $this;\n }", "public function setExcludeClarifaiWorkflows($var)\n {\n GPBUtil::checkBool($var);\n $this->exclude_clarifai_workflows = $var;\n\n return $this;\n }", "public function isCancellationRequest()\n {\n return false;\n }", "public function cancelChildrenSubscriptions() {\n try {\n $status = FALSE;\n $message = '';\n $req_data = $this->request->data;\n if (!isset($req_data['parent_id']) || empty($req_data['parent_id'])) {\n $message = 'parent_id can not be blank';\n throw new Exception($message);\n }\n $children = $this->getChildrenDetails($req_data['parent_id'], null, TRUE);\n if (!empty($children)) {\n $payment_controller = new PaymentController();\n $user_orders_table = TableRegistry::get('UserOrders');\n foreach ($children as $child) {\n $active_billing = $user_orders_table->find()->where(['child_id' => $child['user_id'], 'billing_state' => 'ACTIVE']);\n if ($active_billing->count()) {\n foreach ($active_billing as $billing) {\n $billing_id = $billing['billing_id'];\n $response = $payment_controller->cancelBillingAgreement($billing_id);\n if (!empty($response)) {\n $billing['billing_state'] = $response;\n if (!$user_orders_table->save($billing)) {\n $status = FALSE;\n $message = 'unable to save order';\n throw new Exception($message);\n }\n $status = TRUE;\n }\n }\n } else {\n $message = 'No child found with active billing state';\n }\n }\n } else {\n $status = FALSE;\n $message = 'There is no child';\n }\n } catch(Exception $e) {\n $this->log($e->getMessage() . '(' . __METHOD__ . ')');\n }\n $this->set([\n 'status' => $status,\n 'message' => $message,\n '_serialize' => ['status', 'message']\n ]);\n }", "final public function allowsParent() {\n\t\treturn true;\n\t}", "public function setIsChild($isChild)\n {\n $this->isChild = $isChild;\n return $this;\n }", "protected function IsChild() {\n\t\tif (!$this->master_model && (!empty($this->parent)))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public static function is_parent_child_taxonomy_request() {\n\n\t\tglobal $wp;\n\n\t\t// TODO: update this for a variable length\n\n\t\t// look for parent_taxonomy/child_taxonomy request\n\t\t// look for a slash after the 6th character\n\t\t// i.e. $wp->request = 'books/biograpy/george-washington'\n\t\tif(!empty($wp->request) && strpos($wp->request, '/', 6) !== false) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isChildOnly();", "final public function allowsParent() {\n\t\treturn $this->_allowParent;\n\t}", "public function canCancel(){\n\t\treturn $this->checkWorkflow(self::STATUS_CANCELED) && !$this->isCancelRequested();\n\t}", "public function childTransformation(bool $childTransformation)\n {\n $this->childTransformation = $childTransformation;\n\n return $this;\n }", "public function processParentConfirmationAction()\n {\n $params = $this->getRequest()->getParams();\n $errors = array();\n if (!isset ($params[\"children\"])) {\n $errors[] = $this->__(\"You need to select one children\");\n }\n if (!isset ($params[\"paymentAccount\"])) {\n $errors[] = $this->__(\"You need to select one payment account\");\n }\n if ((bool)count($errors)) {\n foreach ($errors as $error) {\n Mage::getSingleton(\"core/session\")->addError($error);\n }\n $this->_redirect(\"*/*/parentConfirmation\");\n } else {\n Mage::helper(\"virtualpiggy\")->getUser()->addData(array(\n \"selected_children\" => $params[\"children\"],\n \"selected_payment_account\" => $params[\"paymentAccount\"],\n \"deliver_to_children\" => isset ($params[\"deliverToChildAddress\"]),\n \"notify_children\" => isset ($params[\"notifyChild\"]),\n ));\n Mage::getSingleton(\"customer/session\")->setParentConfirmation(true);\n $this->_redirect(\"*/*/index\");\n }\n }", "public function getRequireWorkflow() : bool\n {\n return $this->require_workflow;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Decline action url
public function getDeclineUrl() { return $this->backendUrl->getUrl('neklo_makeanoffer/request/decline'); }
[ "public function get_url()\n\t{\n\t\treturn $this->get_host().\"/\".$this->get_control().\"/\".$this->get_action();\n\t}", "public function getDeclineUrl() {\n\t\treturn Mage::getUrl('plationline/api/decline');\n\t}", "public function getExportActionUrl(): string\n {\n return $this->urlBuilder->getUrl(self::ROUTE_PATH_EXPORT);\n }", "private function get_action_url()\n\t{\n\t\treturn $this->is_test_mode() ? $this->test_url : $this->live_url;\n\t}", "public function getFormAction()\n {\n return $this->getUrl('zirconprocessing/catalogrequest');\n }", "public function getPostActionUrl()\n {\n return $this->helper('edform')->getLoginPostUrl();\n }", "public function getActionUrl()\n {\n if (array_key_exists(\"actionUrl\", $this->_propDict)) {\n return $this->_propDict[\"actionUrl\"];\n } else {\n return null;\n }\n }", "public function get_action_url() {\n return new \\moodle_url(\n '/blocks/featured_links/edit_tile_content.php',\n $this->get_parameters()\n );\n }", "public static function get_action_url($action) : string\n {\n }", "protected function getExposedFormActionUrl() {\n if ($this->displayHandler->getRoutedDisplay()) {\n return $this->displayHandler->getUrl();\n }\n\n $request = \\Drupal::request();\n $url = Url::createFromRequest($request);\n $url->setAbsolute();\n\n return $url;\n }", "public function getFormAction()\n {\n return $this->getUrl('comment/index/post', ['_secure' => true]);\n }", "public function getFormAction()\n {\n return $this->getUrl('scontact/index/post', ['_secure' => true]);\n }", "private static function get_url($action)\n {\n }", "public function getActionUrl()\n {\n return $this->_dataHelper->getUrl(\n 'loyaltyapps/checkout/status',\n ['_secure' => TRUE]\n );\n }", "public function getUndoDeleteActionUrl(): string\n {\n return $this->urlBuilder->getUrl(self::ROUTE_PATH_UNDO_DELETE);\n }", "public function getFormActionUrl()\n {\n return $this->_customerUrl->getLoginPostUrl();\n }", "public function getFormAction()\n {\n return $this->getUrl('support/customer/replyPost', ['_secure' => true, '_current' => true]);\n }", "public function getActionUrl()\n {\n return $this->getUrl('adminhtml/*/share', ['_current' => true]);\n }", "public function get_assessment_back_url();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////////////////////////////////////////// Work upload/doanload/identification ////////////////////////////////////////////////////////// Send the work to the client with its original filename
function download_work ($work) { header('Content-Disposition: attachment; filename="' . $work['filename'] . '"'); readfile(dirname(__FILE__) . '/uploads/' . $work['uuidfilename']); }
[ "abstract protected function doUpload();", "function uploadArtworkFile() {\n\t\t$monographId = Request::getUserVar('monographId');\n\t\t$this->validate($monographId);\n\n\t\timport('classes.file.MonographFileManager');\n\t\t$monographFileManager = new MonographFileManager($monographId);\n\n\t\tif ($monographFileManager->uploadedFileExists('artworkFile')) {\n\t\t\t$fileId = $monographFileManager->uploadArtworkFile('artworkFile', null);\n\t\t}\n\t\tRequest::redirect(null, null, 'submissionArt', Request::getUserVar('monographId'));\n\t}", "function submit_work($uid, $id, $file) {\n\tglobal $groupPath, $langUploadError, $langUploadSuccess,\n\t\t$langBack, $m, $currentCourseID, $tool_content, $workPath;\n\n\t$group = user_group($uid);\n\n $ext = get_file_extension($file);\n\t$local_name = greek_to_latin('Group '. $group . (empty($ext)? '': '.' . $ext));\n\n $r = mysql_fetch_row(db_query('SELECT filename FROM group_documents WHERE path = ' .\n autoquote($file)));\n $original_filename = $r[0];\n\n\t$source = $groupPath.$file;\n\t$destination = work_secret($id).\"/$local_name\";\n\n\n delete_submissions_by_uid($uid, $group, $id, $destination);\n\tif (copy($source, \"$workPath/$destination\")) {\n\t\tdb_query(\"INSERT INTO assignment_submit (uid, assignment_id, submission_date,\n\t\t\t submission_ip, file_path, file_name, comments, group_id)\n VALUES ('$uid','$id', NOW(), '$_SERVER[REMOTE_ADDR]', '$destination',\" .\n\t\t\t\tquote($original_filename) . ', ' .\n autoquote($_POST['comments']) . \", $group)\",\n $currentCourseID);\n\n\t\t$tool_content .=\"<p class=\\\"success_small\\\">$langUploadSuccess<br />$m[the_file] \\\"$original_filename\\\" $m[was_submitted]<br /><a href='work.php'>$langBack</a></p><br />\";\n\t} else {\n\t\t$tool_content .=\"<p class=\\\"caution_small\\\">$langUploadError<br /><a href='work.php'>$langBack</a></p><br />\";\n\t}\n}", "function processUpload()\r\n\t{\r\n\t}", "public function doUpload( $id , $type , $key );", "public function send(): void {\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename=' . $this->getName());\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: ' . $this->getSize());\n\t\tob_clean();\n\t\tflush();\n\t\treadfile($this->getPath());\n\t\texit();\n\t}", "public function upload();", "public function sendDispatchData()\r\n {\r\n // Send dispatch batch file to the courier\r\n }", "protected function preUpload(){}", "public function handleUploadedFileRequest()\n {\n // get the requested file by stripping the configured uploads_url prefix from the current request URI\n $file = substr(bb_current_relative_url(), strlen(config('bapubuilder.general.uploads_url')) + 1);\n // $file is in the format {file id}/{file name}.{file extension}, so get file id as the part before /\n $fileId = explode('/', $file)[0];\n if (empty($fileId)) die('File not found');\n\n $uploadRepository = new UploadRepository;\n $uploadedFile = $uploadRepository->findWhere('public_id', $fileId);\n if (! $uploadedFile) die('File not found');\n\n $uploadedFile = $uploadedFile[0];\n $serverFile = realpath(config('bapubuilder.storage.uploads_folder') . '/' . basename($uploadedFile->server_file));\n if (! $serverFile) die('File not found');\n\n header('Content-Type: ' . $uploadedFile->mime_type);\n header('Content-Disposition: inline; filename=\"' . basename($uploadedFile->original_file) . '\"');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Content-Length: ' . filesize($serverFile));\n\n readfile($serverFile);\n exit();\n }", "private function uploadWork()\n\t{\n\t\t// Get ourselves a blank Work object.\n\t\t$w = $this->wf->create();\n\t\t$type = (isset($_POST['type'])) ? $_POST['type'] : null;\n\t\t\n\t\t// Se what type of work we're dealing with.\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'website':\n\t\t\t{\n\t\t\t\t$w->type = 1;\n\t\t\t\t$w->addWebsite($_POST['website_url']);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'video':\n\t\t\t{\n\t\t\t\t$w->type = 2;\n\t\t\t\t$w->addVideo($_POST['video_url']);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'document':\n\t\t\t{\n\t\t\t\t$w->type = 3;\n\t\t\t\t// Continue...\n\t\t\t}\n\t\t\tcase 'image':\n\t\t\t{\n\t\t\t\tif(isset($_FILES['image_file']))\n\t\t\t\t\t$file = $_FILES['image_file'];\n\t\t\t\telseif(isset($_FILES['document_file']))\n\t\t\t\t\t$file = $_FILES['document_file'];\n\t\t\t\telse\n\t\t\t\t\tthrow new Exception('No file received.');\n\t\t\t\t\n\t\t\t\t$w->addFile($file);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\tthrow new Exception('Invalid upload type.');\n\t\t\t}\n\t\t}\n\t\t$w->title = Database::sanitize($_POST['title']);\n\t\t$w->description = Database::sanitize($_POST['description']);\n\t\t$w->owner = $_SESSION['user']['id'];\n\t\t$w->school = $school = $_SESSION['user']['school'];\n\t\t\n\t\tif($this->wf->add($w))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private function stream ()\n\t{\n\t\t# Prelim\n\t\t$_file_processor_object = $this->Registry->loader(\"Data_Processors__File\");\n\t\t$file_info = $_file_processor_object->file__info__do_get( $this->running_subroutine['request']['identifier'] );\n\n\t\tif ( ! isset( $this->running_subroutine['request']['f_name'] ) )\n\t\t{\n\t\t\t$this->running_subroutine['request']['f_name'] = $file_info['f_hash'] . \".\" . $file_info['f_extension'];\n\t\t}\n\n\t\t$_file_location = $file_info['_f_location'];\n\n\t\t# Images - watermarked versions, thumbnails etc\n\t\tif ( $file_info['_f_type'] == 'image' )\n\t\t{\n\t\t\tif ( isset( $this->running_subroutine['request']['file_variation'] ) )\n\t\t\t{\n\t\t\t\tswitch ( $_file_variation = $this->running_subroutine['request']['file_variation'] )\n\t\t\t\t{\n\t\t\t\t\tcase 's':\n\t\t\t\t\tcase 'm':\n\t\t\t\t\t\tif ( ! $file_info['_diagnostics']['thumbs_ok'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_file__image__do_thumbnails( $file_info );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tif ( $file_info['_f_wtrmrk'] === FALSE )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_file__image__do_watermark( $file_info );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t# @todo User authorization [ACL]\n\t\t\t\t\t\t$_file_variation = null;\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$this->Registry->http_redirect(\n\t\t\t\t\t\t\t\tSITE_URL\n\t\t\t\t\t\t\t\t\t. \"/static/download/l-\"\n\t\t\t\t\t\t\t\t\t. $this->running_subroutine['request']['identifier']\n\t\t\t\t\t\t\t\t\t. \"/\"\n\t\t\t\t\t\t\t\t\t. $this->running_subroutine['request']['f_name'],\n\t\t\t\t\t\t\t\t301\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t}\n\t\t\t$_file_location = ! empty( $_file_variation )\n\t\t\t\t?\n\t\t\t\t$this->Registry->Input->file__filename__attach_suffix( $file_info['_f_location'] , \"_\" . strtoupper( $_file_variation ) )\n\t\t\t\t:\n\t\t\t\t$file_info['_f_location']\n\t\t\t\t;\n\t\t}\n\t\t$_file_stats = stat( $_file_location );\n\t\t$_file_stats['etag'] = $file_info['f_hash'] . ( isset( $_file_variation ) ? \"-\" . $_file_variation : \"\" ) . \"-\" . $_file_stats['mtime'];\n\n\t\t# If-Modified-Since\n\t\t$_request_headers =& $this->Registry->Input->headers['request'];\n\t\tif ( isset( $_request_headers['IF-NONE-MATCH'] ) and $_request_headers['IF-NONE-MATCH'] == $_file_stats['etag'] )\n\t\t{\n\t\t\theader( \"ETag: \" . $_file_stats['etag'] );\n\t\t\theader( \"Last-modified: \" . date( \"r\" , $_file_stats['mtime'] ) );\n\t\t\theader( \"HTTP/1.1 304 Not modified\" );\n\t\t\texit;\n\t\t}\n\t\telseif ( isset( $_request_headers['IF-MODIFIED-SINCE'] ) )\n\t\t{\n\t\t\tif ( $_file_stats['mtime'] <= strtotime( $_request_headers['IF-MODIFIED-SINCE'] ) )\n\t\t\t{\n\t\t\t\theader( \"ETag: \" . $_file_stats['etag'] );\n\t\t\t\theader( \"Last-modified: \" . date( \"r\" , $_file_stats['mtime'] ) );\n\t\t\t\theader( \"HTTP/1.1 304 Not modified\" );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t# Is accessible?\n\t\tif ( ! is_readable( $_file_location ) )\n\t\t{\n\t\t\theader( \"HTTP/1.1 403 Forbidden\" ); // @todo Should be replaced with error-page-handlers\n\t\t\texit;\n\t\t}\n\n\t\t# Disable output-buffering\n\t\tif ( $this->Registry->ob_status )\n\t\t{\n\t\t\tif ( $this->Registry->ob_compression )\n\t\t\t{\n\t\t\t\tini_set( \"zlib.output_handler\" , \"0\" );\n\t\t\t}\n\t\t\tob_end_clean();\n\t\t}\n\n\t\t# Does file exist?\n\t\tif ( ! $file_info['_diagnostics']['file_exists'] )\n\t\t{\n\t\t\theader( \"HTTP/1.1 404 Resource not found\" ); // @todo Should be replaced with error-page-handlers\n\t\t\treturn null;\n\t\t}\n\n\t\t# Open file for reading\n\t\t$_fh = fopen( $_file_location , \"rb\" );\n\t\tif ( $_fh === FALSE )\n\t\t{\n\t\t\theader( \"HTTP/1.1 500 Internal server error!\" ); // @todo Should be replaced with error-page-handlers\n\t\t\treturn null;\n\t\t}\n\n\t\t$_transmission_begin = 0;\n\t\t$_transmission_end = $_file_stats['size'];\n\n\t\t# Are we resuming?\n\t\tif ( isset( $_SERVER['HTTP_RANGE'] ) )\n\t\t{\n\t\t\tif ( preg_match( '/bytes=\\h*(?P<begin>\\d+)-(?P<end>\\d*)[\\D.*]?/i' , $_SERVER['HTTP_RANGE'] , $_matches ) )\n\t\t\t{\n\t\t\t\t$_transmission_begin = intval( $_matches['begin'] );\n\t\t\t\tif ( ! empty( $_matches['end'] ) )\n\t\t\t\t{\n\t\t\t\t\t$_transmission_end = $_matches['end'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# Little insurance\n\t\tset_time_limit( 0 );\n\n\t\t# Headers - Cache-control, Pragma and Expires headers are sent from Modules class; no need to set those here again\n\t\tif ( $_transmission_begin > 0 or $_transmission_end < $file_info['f_size'] )\n\t\t{\n\t\t\theader( \"HTTP/1.1 206 Partial content\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader( \"HTTP/1.1 200 Ok\" );\n\t\t}\n\t\theader( \"Accept-ranges: bytes\" );\n\t\theader( \"Content-description: Downloads powered by Audith CMS codename Persephone\" );\n\t\theader( \"Content-type: \" . $file_info['f_mime'] );\n\t\theader( \"Content-disposition: inline; filename=\\\"\" . $this->running_subroutine['request']['f_name'] . \"\\\"\" );\n\t\theader( \"Content-length: \" . $_file_stats['size'] );\n\t\theader( \"Content-range: bytes \" . $_transmission_begin . \"-\" . $_transmission_end . \"/\" . $file_info['f_size'] );\n\t\theader( \"Content-transfer-encoding: \" . ( $file_info['_f_type'] == 'text' ? \"ascii\" : \"binary\" ) );\n\t\theader( \"Last-modified: \" . date( \"r\" , $_file_stats['mtime'] ) );\n\t\theader( \"ETag: \" . $_file_stats['etag'] );\n\t\theader( \"X-Md5-checksum: \" . $file_info['f_hash'] );\n\t\theader( \"Connection: close\" );\n\n\t\t# File-cursor\n\t\t$_file_cursor = $_transmission_begin;\n\t\t$this->Registry->Input->file__fseek_safe( $_fh , $_transmission_begin , SEEK_SET );\n\n\t\t# Send data with bandwidth management\n\t\t$_chunk_size = intval( $this->Registry->config['performance']['download_chunk_size'] ) * 1024;\n\t\t$_transfer_quota = intval( $this->Registry->config['performance']['download_speed_limit'] ) * 1024;\n\t\t$_time_quota = 1000000;\n\t\t$_timestart = intval( $this->Registry->debug__timer_start() );\n\t\twhile( ! feof( $_fh ) and $_file_cursor < $_transmission_end and ( connection_status() == 0 ) )\n\t\t{\n\t\t\t# File-send\n\t\t\tprint fread( $_fh, min( $_chunk_size, $_transmission_end - $_file_cursor ) );\n\t\t\t$_file_cursor += $_chunk_size;\n\n\t\t\t# Bandwidth quota management\n\t\t\t$_time_quota -= intval( $this->Registry->debug__timer_stop( $_timestart ) );\n\t\t\t$_transfer_quota -= $_chunk_size;\n\n\t\t\t# Out of quota? Then wait for the remainder of 1 second :) and reset counters\n\t\t\tif ( $_transfer_quota <= 0 and $_time_quota > 0 )\n\t\t\t{\n\t\t\t\tusleep( $_time_quota );\n\t\t\t\t$_time_quota = 1000000;\n\t\t\t\t$_transfer_quota = intval( $this->Registry->config['performance']['download_speed_limit'] ) * 1024;\n\t\t\t}\n\t\t}\n\n\t\t# Close file\n\t\tfclose( $_fh );\n\t\texit;\n\t\t/*\n\t\t$_params = array(\n\t\t\t\t'f_name' => $this->running_subroutine['request']['f_name'],\n\t\t\t\t'time_to_die' => null, // @todo Later to be manipulated by Zend_ACL\n\t\t\t\t'm_id' => $this->Registry->member['id'],\n\t\t\t\t'm_ip_address' => $this->Registry->Session->ip_address,\n\t\t\t\t'_enable_ip_check' => FALSE,\n\t\t\t);\n\t\t$_link_info = $_file_processor_object->file__link__do_get( $file_info, $_params );\n\t\t*/\n\t}", "public function storeOriginal()\n {\n if (!$this->checkIdentifier()) {\n return $this->send404();\n }\n\n $this->page->setBodyRendering(false);\n\n if (!$this->model->handlePhotoUpload($this->vars['identifier'], 'original', $this->page->request)) {\n $this->page->setStatus('500', 'Upload failed');\n\n } else {\n $user = $this->model->getLoggedInUser();\n $id = $this->model->getParticipantIdFromIdentifier($this->vars['identifier']);\n if($user === false) {\n $this->log(\"Deltager #$id har uploadet originalt billede\", 'Photo', null);\n } else {\n $this->log(\"$user->user uploadede originalt billede for deltager #$id\", 'Photo', $user);\n }\n }\n }", "public function doFileAction()\n\t{\n\t\t$this->request['fid'] = intval($this->request['fid']);\n\t\t\n\t\tif( $this->request['new_owner'] )\n\t\t{\n\t\t\t$member = $this->DB->buildAndFetch( array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select' => 'member_id', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from' \t => 'members',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where' => \"members_l_display_name='\".$this->DB->addSlashes( strtolower($this->request['new_owner']) ).\"'\"\n\t\t\t\t\t\t\t\t\t\t\t)\t);\n\n\t\t\tif( ! $member['member_id'] )\n\t\t\t{\n\t\t\t\t$this->registry->output->showError( $this->lang->words['stats_no_member_found'], 11741 );\n\t\t\t}\n\t\t\t\n\t\t\t$this->DB->update( 'gallery_images', array( 'member_id' => $member['member_id']), 'id=' . $this->request['fid'] );\n\t\t}\n\t\t\n\t\tif( $this->request['clear_rating'] )\n\t\t{\n\t\t \t$this->DB->delete( 'gallery_ratings', 'id=' . $this->request['fid'] );\n\t\t}\n\n\t\tif( $this->request['clear_bandwidth'] )\n\t\t{\n\t\t \t$i = $this->DB->buildAndFetch( array( 'select' => 'masked_file_name',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'gallery_images',\n\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'id=' . $this->request['fid'] \n\t\t\t\t\t\t\t\t\t\t)\t);\n\n\t\t \t$this->DB->delete( 'gallery_bandwidth', \"file_name='{$i['masked_file_name']}'\" );\n\t\t}\n\n\t\t/* Redirect */\n\t\t$this->registry->output->global_message = $this->lang->words['stats_actions_taken'];\n\t\t$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=dofilesrch&amp;viewfile='.$this->request['fid'] );\n\t}", "public function handleFileUpload()\n {\n $publicId = sha1(uniqid(rand(), true));\n $uploader = phpb_instance(Uploader::class, ['files']);\n $uploader\n ->file_name($publicId . '/' . str_replace(' ', '-', $uploader->file_src_name))\n ->upload_to(phpb_config('storage.uploads_folder') . '/')\n ->run();\n\n if (! $uploader->was_uploaded) {\n die(\"Upload error: {$uploader->error}\");\n } else {\n $originalFile = str_replace(' ', '-', $uploader->file_src_name);\n $originalMime = $uploader->file_src_mime;\n $serverFile = $uploader->final_file_name;\n\n $uploadRepository = new UploadRepository;\n $uploadedFile = $uploadRepository->create([\n 'public_id' => $publicId,\n 'original_file' => $originalFile,\n 'mime_type' => $originalMime,\n 'server_file' => $serverFile\n ]);\n\n echo json_encode([\n 'data' => [\n 'public_id' => $publicId,\n 'src' => $uploadedFile->getUrl(),\n 'type' => 'image'\n ]\n ]);\n exit();\n }\n }", "public function uploadToAns()\r\n\t{\r\n $target_dir = null;\r\n \r\n\t\tif ($this->id && $this->getValue(\"name\") && $this->ansClient != null && file_exists($this->getFullLocalPath()))\r\n\t\t{\r\n\t\t\t$wpdata = array(\r\n\t\t\t\t\"full_local_path\" => $this->getFullLocalPath(), \r\n\t\t\t\t\"local_path\" => $this->getValue(\"dat_local_path\"),\r\n\t\t\t\t\"name\" => $this->getValue(\"name\"),\r\n\t\t\t\t\"fname\" => $this->id, // temp file name used to store unique files\r\n\t\t\t\t\"fid\" => $this->id, \r\n\t\t\t\t\"revision\" => $this->revision,\r\n\t\t\t\t\"process_function\" => \"\",\r\n\t\t\t);\r\n\r\n\t\t\t$wm = new WorkerMan($this->dbh);\r\n\t\t\t$ret = $wm->runBackground(\"antfs/file_upload_ans\", serialize($wpdata));\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function ajaxUploadTask()\n\t{\n\t\t// Check if they're logged in\n\t\tif ($this->juser->get('guest'))\n\t\t{\n\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_WARNING_LOGIN')));\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure we have an ID to work with\n\t\t$listdir = JRequest::getInt('listdir', 0);\n\t\tif (!$listdir)\n\t\t{\n\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_NO_ID')));\n\t\t\treturn;\n\t\t}\n\n\t\t//allowed extensions for uplaod\n\t\t//$allowedExtensions = array(\"png\",\"jpeg\",\"jpg\",\"gif\");\n\n\t\t//max upload size\n\t\t$sizeLimit = $this->book->config('maxAllowed', 40000000);\n\n\t\t// get the file\n\t\tif (isset($_GET['qqfile']))\n\t\t{\n\t\t\t$stream = true;\n\t\t\t$file = $_GET['qqfile'];\n\t\t\t$size = (int) $_SERVER[\"CONTENT_LENGTH\"];\n\t\t}\n\t\telseif (isset($_FILES['qqfile']))\n\t\t{\n\t\t\t//$files = JRequest::getVar('qqfile', '', 'files', 'array');\n\n\t\t\t$stream = false;\n\t\t\t$file = $_FILES['qqfile']['name'];\n\t\t\t$size = (int) $_FILES['qqfile']['size'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_ERROR_NO_FILE')));\n\t\t\treturn;\n\t\t}\n\n\t\t//define upload directory and make sure its writable\n\t\t$path = JPATH_ROOT . DS . trim($this->book->config('filepath', '/site/wiki'), DS) . DS . $listdir;\n\t\tif (!is_dir($path))\n\t\t{\n\t\t\tjimport('joomla.filesystem.folder');\n\t\t\tif (!JFolder::create($path))\n\t\t\t{\n\t\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_ERROR_UNABLE_TO_CREATE_DIRECTORY')));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!is_writable($path))\n\t\t{\n\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_ERROR_DIRECTORY_NOT_WRITABLE')));\n\t\t\treturn;\n\t\t}\n\n\t\t//check to make sure we have a file and its not too big\n\t\tif ($size == 0)\n\t\t{\n\t\t\techo json_encode(array('error' => JText::_('COM_WIKI_ERROR_NO_FILE')));\n\t\t\treturn;\n\t\t}\n\t\tif ($size > $sizeLimit)\n\t\t{\n\t\t\t$max = preg_replace('/<abbr \\w+=\\\\\"\\w+\\\\\">(\\w{1,3})<\\\\/abbr>/', '$1', \\Hubzero\\Utility\\Number::formatBytes($sizeLimit));\n\t\t\techo json_encode(array('error' => JText::sprintf('COM_WIKI_ERROR_FILE_TOO_LARGE', $max)));\n\t\t\treturn;\n\t\t}\n\n\t\t// don't overwrite previous files that were uploaded\n\t\t$pathinfo = pathinfo($file);\n\t\t$filename = $pathinfo['filename'];\n\n\t\t// Make the filename safe\n\t\tjimport('joomla.filesystem.file');\n\t\t$filename = urldecode($filename);\n\t\t$filename = JFile::makeSafe($filename);\n\t\t$filename = str_replace(' ', '_', $filename);\n\n\t\t$ext = $pathinfo['extension'];\n\t\twhile (file_exists($path . DS . $filename . '.' . $ext))\n\t\t{\n\t\t\t$filename .= rand(10, 99);\n\t\t}\n\n\t\t$file = $path . DS . $filename . '.' . $ext;\n\n\t\tif ($stream)\n\t\t{\n\t\t\t//read the php input stream to upload file\n\t\t\t$input = fopen(\"php://input\", \"r\");\n\t\t\t$temp = tmpfile();\n\t\t\t$realSize = stream_copy_to_stream($input, $temp);\n\t\t\tfclose($input);\n\n\t\t\t//move from temp location to target location which is user folder\n\t\t\t$target = fopen($file , \"w\");\n\t\t\tfseek($temp, 0, SEEK_SET);\n\t\t\tstream_copy_to_stream($temp, $target);\n\t\t\tfclose($target);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmove_uploaded_file($_FILES['qqfile']['tmp_name'], $file);\n\t\t}\n\n\t\t// Create database entry\n\t\t$attachment = new WikiTableAttachment($this->database);\n\t\t$attachment->pageid = $listdir;\n\t\t$attachment->filename = $filename . '.' . $ext;\n\t\t$attachment->description = trim(JRequest::getVar('description', '', 'post'));\n\t\t$attachment->created = JFactory::getDate()->toSql();\n\t\t$attachment->created_by = $this->juser->get('id');\n\n\t\tif (!$attachment->check())\n\t\t{\n\t\t\t$this->setError($attachment->getError());\n\t\t}\n\t\tif (!$attachment->store())\n\t\t{\n\t\t\t$this->setError($attachment->getError());\n\t\t}\n\n\t\t//echo result\n\t\techo json_encode(array(\n\t\t\t'success' => true,\n\t\t\t'file' => $filename . '.' . $ext,\n\t\t\t'directory' => str_replace(JPATH_ROOT, '', $path)\n\t\t));\n\t}", "function file_uploader($control, $file_type_arr, $file_dir) {\n\t\n\tif (! empty ( $_FILES [$control] ['name'] )) {\n\t\tif ($_FILES [$control] ['error'] == 0) {\n\t\t\t$ext = strtolower ( strrchr ( $_FILES [$control] ['name'], '.' ) );\n\t\t\t\n\t\t\tif (in_array ( $ext, $file_type_arr )) {\n\t\t\t\tif ($_FILES [$control] ['size'] > 0) {\n\t\t\t\t\t$new_document= $rand_name=rand(1000,9999).\"_\".$_FILES [$control] ['name'];\n\t\t\t\t\t//$new_document = $_FILES [$control] ['name'];\n\t\t\t\t\twhile ( is_file ( $file_dir . $new_document ) ) {\n\t\t\t\t\t\t$new_document = $rand_name = rand ( 1000, 9999 ) . \"_\" . rand ( 1000, 9999 ) . \"_\" . rand ( 1000, 9999 ) . $ext;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((move_uploaded_file ( $_FILES [$control] ['tmp_name'], $file_dir . $new_document ))) {\n\t\t\t\t\t\treturn $new_document;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register providers for cleaning.
protected function registerCleanProviders($registerProviders = []) { $this->providers = $registerProviders; }
[ "public function clearProviders()\n {\n $this->providers = [];\n }", "public function removeAllProviders() {\n $this->providers = [];\n }", "protected function registerProviders()\n {\n foreach (config('app.providers') as $provider) {\n (new $provider($this))->register();\n }\n }", "protected function removeFromServiceProviders()\n {\n $this->updateProviderBinding($this->getBindPattern(), '', false);\n }", "protected function registerProviders()\n {\n foreach (Epikfy::providers() as $provider) {\n $this->app->register($provider);\n }\n }", "function registerAllProvider()\n {\n foreach($this->_providers as $name => $file )\n {\n $obj = $this->getInstance($name);\n $obj->register();\n }\n }", "public function flushProviders();", "protected function registerServiceProviders()\n {\n foreach ($this->localProviders as $provider)\n {\n $this->app->register($provider);\n }\n }", "private function serviceProviders()\n {\n // $this->app->register('...\\...\\...');\n }", "protected function registerProviders()\r\n {\r\n $res = Cms::allModuleProvider();\r\n //print_r($res);exit;\r\n\r\n foreach ($res as $key => $provider) {\r\n $this->app->register($provider);\r\n }\r\n }", "public function registerServices()\n {\n foreach ($this->serviceProviders as $serviceProvider) {\n $serviceProvider = (new $serviceProvider($this))->register();\n }\n }", "protected function replaceServiceProviders () : void\n {\n $this->populateFile(config_path(), \"app.php\", config_path(\"app.php\"), [\n AuthServiceProvider::class => AuthCompositeServiceProvider::class,\n BroadcastServiceProvider::class => BroadcastCompositeServiceProvider::class,\n EventServiceProvider::class => EventCompositeServiceProvider::class,\n RouteServiceProvider::class => RouteCompositeServiceProvider::class,\n ]);\n }", "protected function registerAdditionalProviders()\n {\n foreach ($this->providers as $provider) {\n App::register($provider);\n }\n }", "protected function registerServiceProviders()\n {\n collect($this->localProviders)->each(\n function ($provider) {\n $this->app->register($provider);\n }\n );\n }", "public function registerCoreProviders()\n {\n foreach ($this->providers as $provider) {\n $this->make($provider)->register();\n }\n }", "protected function registerAdditionalProviders()\n {\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "private function registerUserServiceProviders(): void\n {\n $type = Settings::TYPE__SERVICE_PROVIDER_CLASS;\n if (!$this->detect->resourceEnabled($type)) {\n return;\n }\n\n $this->monitor->startTimer('register ' . $type);\n\n foreach ($this->detect->getServiceProviderClasses() as $fqcn) {\n $this->app->register($fqcn);\n }\n $this->monitor->incRegCount($type, count($this->detect->getServiceProviderClasses()));\n\n $this->monitor->stopTimer('register ' . $type);\n }", "protected function registerServiceProviders()\n\t{\n\n\t\t// // Events\n\t\t// // -----------------------------------------------------------------------------\n\t\t// $this->app->register('Congraph\\Api\\Events\\EventsServiceProvider');\n\n\t\t// // Handlers\n\t\t// // -----------------------------------------------------------------------------\n\t\t// $this->app->register('Congraph\\Api\\Handlers\\HandlersServiceProvider');\n\t}", "public function registerServiceProviders()\n {\n $container = $this->router->getContainer();\n $providers = config('app.providers');\n\n array_walk($providers, function ($provider) use ($container) {\n $container->register(new $provider);\n });\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the suggested privacy policy text to the policy postbox.
public function add_suggested_privacy_content() { if(function_exists("wp_add_privacy_policy_content")){ $content = $this->get_default_privacy_content(); wp_add_privacy_policy_content( __( 'Essential Grid' ), $content ); } }
[ "public function learndash_add_privacy_policy_text() {\n\t\t\tif ( is_admin() ) {\n\t\t\t\t// Check we are on the WP Privacy Policy Guide page.\n\t\t\t\t$is_privacy_guide = current_user_can( 'manage_privacy_options' );\n\t\t\t\tif ( $is_privacy_guide ) {\n\t\t\t\t\t$pp_readme_file = LEARNDASH_LMS_PLUGIN_DIR . 'privacy_policy.txt';\n\t\t\t\t\tif ( file_exists( $pp_readme_file ) ) {\n\t\t\t\t\t\t$pp_readme_content = file_get_contents( $pp_readme_file );\n\t\t\t\t\t\tif ( ! empty( $pp_readme_content ) ) {\n\t\t\t\t\t\t\t$pp_readme_content = wpautop( stripcslashes( $pp_readme_content ) );\n\t\t\t\t\t\t\twp_add_privacy_policy_content(\n\t\t\t\t\t\t\t\t'LearnDash LMS',\n\t\t\t\t\t\t\t\twp_kses_post( wpautop( $pp_readme_content, false ) )\n\t\t\t\t\t\t \t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function learndash_add_privacy_policy_text() {\n\t\t\tif ( is_admin() ) {\n\t\t\t\t// Check we are on the WP Privacy Policy Guide page.\n\t\t\t\t$is_privacy_guide = current_user_can( 'manage_privacy_options' );\n\n\t\t\t\tif ( $is_privacy_guide ) {\n\t\t\t\t\t$pp_readme_file = LEARNDASH_LMS_PLUGIN_DIR . 'privacy_policy.txt';\n\n\t\t\t\t\tif ( file_exists( $pp_readme_file ) ) {\n\t\t\t\t\t\t$pp_readme_content = file_get_contents( $pp_readme_file ); // phpcs:ignore\n\n\t\t\t\t\t\tif ( ! empty( $pp_readme_content ) ) {\n\t\t\t\t\t\t\t$pp_readme_content = wpautop( stripcslashes( $pp_readme_content ) );\n\t\t\t\t\t\t\twp_add_privacy_policy_content(\n\t\t\t\t\t\t\t\t'LearnDash LMS',\n\t\t\t\t\t\t\t\twp_kses_post( wpautop( $pp_readme_content, false ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function fp_rac_plugin_add_suggested_privacy_content() {\n if (function_exists('wp_add_privacy_policy_content')) {\n $content = fp_rac_plugin_get_default_privacy_content() ;\n wp_add_privacy_policy_content( __( 'Recover Abandoned Cart' , 'recoverabandoncart' ) , $content ) ;\n }\n}", "public function add_privacy_message() {\n\t\tif ( function_exists( 'wp_add_privacy_policy_content' ) ) {\n\t\t\t$content = $this->get_privacy_message();\n\n\t\t\tif ( $content ) {\n\t\t\t\twp_add_privacy_policy_content( $this->name, $this->get_privacy_message() );\n\t\t\t}\n\t\t}\n\t}", "public static function add_privacy_message() {\n if ( function_exists( 'wp_add_privacy_policy_content' ) ) {\n $content = self::get_privacy_message() ;\n\n if ( $content ) {\n wp_add_privacy_policy_content( self::get_plugin_name() , $content ) ;\n }\n }\n }", "function wc_registration_privacy_policy_text()\n {\n }", "static function add_privacy_policy() {\n\t\tif ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$link_xapi = sprintf(\n\t\t\t'<a href=\"https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md\" target=\"_blank\">%s</a>',\n\t\t\t__( 'xAPI', 'H5PXAPIKATCHU' )\n\t\t);\n\n\t\t// Intentionally using the WordPress translation here.\n\t\t$content = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';\n\t\t$content .= '<h3>' . __( 'H5PxAPIkatchu', 'H5PXAPIKATCHU' ) . '</h3>';\n\t\t$content .= '<p>';\n\t\t$content .= sprintf(\n\t\t\t// translators: %s will be replaced by the name of the service\n\t\t\t__(\n\t\t\t\t'When you use interactive content, we may collect data about your interaction using %s.',\n\t\t\t\t'H5PXAPIKATCHU'\n\t\t\t),\n\t\t\t$link_xapi\n\t\t) . ' ';\n\t\t$content .= __( 'The data may e.g. contain what answer was given, how long it took to answer, what score was achieved, etc.', 'H5PXAPIKATCHU' ) . ' ';\n\t\t$content .= __( 'We use the data to learn about how well the interaction is designed and how it could be adapted to improve the usability and learning outcomes in general.', 'H5PXAPIKATCHU' );\n\t\t$content .= '</p>';\n\t\t$content .= '<p>';\n\t\t$content .= __( 'However, if and only if you are logged in, this data will be tied to your full name, your email address, and your WordPress user id.', 'H5PXAPIKATCHU' ) . ' ';\n\t\t$content .= __( 'In consequence, your interactions could be linked to you.', 'H5PXAPIKATCHU' ) . ' ';\n\t\t$content .= __( 'Therefore, all personal data can be stripped to anonymize the data.', 'H5PXAPIKATCHU' );\n\t\t$content .= '</p>';\n\n\t\twp_add_privacy_policy_content(\n\t\t\t__( 'H5PxAPIkatchu', 'H5PXAPIKATCHU' ),\n\t\t\twp_kses_post( wpautop( $content, false ) )\n\t\t);\n\t}", "function bimber_mc4wp_privacy_text_after_form( $html ) {\n\t$html .= '<p class=\"g1-meta g1-newsletter-privacy\">' . wp_kses_post( bimber_get_theme_option( 'newsletter', 'privacy' ) ) . '</p>';\n\n\treturn $html;\n}", "function snax_admin_setting_slog_gdpr_consent_text() {\n\t$text = snax_slog_gdpr_consent_text();\n\n\t?>\n\t<input size=\"120\" type=\"text\" id=\"snax_slog_gdpr_consent_text\" name=\"snax_slog_gdpr_consent_text\" value=\"<?php echo wp_kses_post( $text ); ?>\" /><br />\n\t<small>\n\t\t<?php printf( esc_html_x( 'Use the %s tag to add a link to the Privacy Policy page', 'Social Login Settings', 'snax' ), '<code>%privacy_policy%</code>' ); ?>\n\t</small>\n\t<br />\n\t<br />\n\t<p>\n\t\t<?php\n\t\t$privacy_policy_link = snax_gdpr_get_privacy_policy_link();\n\t\t$gdpr_settings_url = admin_url( 'tools.php?page=wp_gdpr_compliance&type=settings' );\n\n\t\tif ( $privacy_policy_link ) {\n\t\t\tprintf( esc_html_x( 'The Privacy Policy page is set and the %s tag will be replaced with: %s', 'Social Login Settings', 'snax' ), '<code>%privacy_policy%</code>', $privacy_policy_link );\n\t\t\techo '<br />';\n\t\t\techo wp_kses_post( sprintf( _x( 'You can change the page and the link text in the <a href=\"%s\" target=\"_blank\">GDPR plugin settings page</a>', 'Social Login Settings', 'snax' ), esc_url( $gdpr_settings_url ) ) );\n\t\t} else {\n\t\t\techo wp_kses_post( sprintf( _x( 'To use the %s tag you have to select the Privacy Policy page in the <a href=\"%s\" target=\"_blank\">GDPR plugin settings page</a>', 'Social Login Settings', 'snax' ), '<code>%privacy_policy%</code>', esc_url( $gdpr_settings_url ) ) );\n\t\t}\n\t\t?>\n\t</p>\n\t<?php\n}", "public static function add_privacy_content() {\n\t\tif ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$content = sprintf(\n\t\t\t// translators: %s: URL of jsDelivr CDN privacy page.\n\t\t\t__(\n\t\t\t\t'To improve performance of pages, some resources might be loaded from jsDelivr CDN.\n\nThe jsDelivr CDN privacy policy is <a href=\"%s\" target=\"_blank\">here</a>.',\n\t\t\t\t'commonwp'\n\t\t\t),\n\t\t\tesc_url( 'https://www.jsdelivr.com/privacy-policy-jsdelivr-net' )\n\t\t);\n\n\t\twp_add_privacy_policy_content(\n\t\t\t__( 'commonWP', 'commonwp' ),\n\t\t\twp_kses_post( wpautop( $content, false ) )\n\t\t);\n\t}", "function cs_privacy_policy_text( $type = 'checkout' ) {\n\tif ( ! cs_privacy_policy_page_id() ) {\n\t\treturn;\n\t}\n\techo wp_kses_post( wpautop( cs_replace_policy_page_link_placeholders( cs_get_privacy_policy_text( $type ) ) ) );\n}", "function cs_registration_privacy_policy_text() {\n\techo '<div class=\"communityservice-privacy-policy-text\">';\n\tcs_privacy_policy_text( 'registration' );\n\techo '</div>';\n}", "public function getPrivacyPolicyText()\n {\n return $this->_privacyPolicyText;\n }", "public static function policy_text_changed_notice() {}", "function svbk_policy_default_privacy_content($privacy_content){\n\t\n\t$provider = svbk_policy_get_provider();\n\n\tif ( $provider ) {\n\t\treturn \n\t\t'<!-- wp:heading -->' .\n\t\t'<h2> ' . __('Privacy Policy', 'svbk-wp-policy') . ' </h2>' .\n\t\t'<!-- /wp:heading -->' .\n\n\t\t'<!-- wp:svbk/privacy-policy /-->';\n\t}\n\n return $provider_content;\n}", "public static function policy_text_changed_notice()\n {\n }", "function cs_checkout_privacy_policy_text() {\n\techo '<div class=\"communityservice-privacy-policy-text\">';\n\tcs_privacy_policy_text( 'checkout' );\n\techo '</div>';\n}", "function MyMod_Handle_Add_Form_Text_Post()\n {\n if (!preg_match(\"(Coordinator|Admin)\",$this->Profile()))\n {\n return \"\";\n }\n \n return\n $this->BR().\n $this->FrameIt($this->InscriptionsObj()->DoAdd());\n }", "function replace_thickbox_text($translated_text, $text)\n {\n if ('Insert into Post' == $text) {\n $referer = strpos( wp_get_referer(), 'puawp_options' );\n if ($referer != '') {\n return ('Select For Pop Up Archive Upload');\n }\n }\n\n return $translated_text;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dona la respota per retornar llibres per titol
private function getPerTitol(){ $result = $this->llibreGateway->buscarPerTitol(); return $this->crearResposta('200 OK', $result); }
[ "function titre(){\n\t\t$bdd = connectbdd();\n\t\t$requete = $bdd -> query('SELECT nomFilm FROM film where nomFilm like \"Le Roi Lion\"');\n\n\t\twhile ($data = $requete -> fetch())\n\t\t{\n\n\t\t\techo '<h2>'.$data['nomFilm'].'</h2>';\n\t\t}\n\t}", "public function getTitulo_livro()\r\n {\r\n return $this->titulo_livro;\r\n }", "function getTitulo() {\n // mistura os arrays somente do bloco 1\n shuffle($this->bloco[1]);\n return ucfirst($this->bloco[1][0]); // deixa a primeira letra da string maiúscula\n }", "public function titulo () \r\n\t\t{\r\n\t\t\techo $this->get_detail(name);\r\n\t\t}", "function hello_nadej_get_lyric()\n {\n $lyrics = \"Kamarátka Nádej, baterky mám vypálené\n\t\t\tMoja láska má dnes jednu malú zmenu v mene\n\t\t\tVždy sa nájde niekto, kto je trochu múdrejší\n\t\t\tV pravej chvíli vie to, bez zábran a sladkých rečí\n\t\t\tKamarátka Nádej, dnes je vo mne vypredané\n\t\t\tVoľnosť v očiach nájde, tunel s názvom zabúdanie\n\t\t\tVšetko krásne stíchlo, zhasli svetlá nápadov\n\t\t\tOdišla si rýchlo, zostala len hromada slov\n\t\t\tTo je život, krásne nás trápi\n\t\t\tAle dobre je s ním\n\t\t\tNáruživo, všetko mu vrátim\n\t\t\tUž viac nenaletím\n\t\t\tKamarátka Nádej, baterky mám vypálené\n\t\t\tMoja láska má dnes jednu malú zmenu v mene\n\t\t\tTo je život, krásne nás trápi\n\t\t\tAle dobre je s ním\n\t\t\tNáruživo, všetko mu vrátim\n\t\t\tUž viac nenaletím\n\t\t\tKamarátka Nádej, dnes je vo mne vypredané\n\t\t\tVoľnosť v očiach nájde, tunel s názvom zabúdanie\n\t\t\tVšetko krásne stíchlo, zhasli svetlá nápadov\n\t\t\tOdišla si rýchlo, zostala len hromada slov\";\n\n // rozbijeme kus textu na riadky\n $lyrics = explode( \"\\n\", $lyrics );\n\n // vyberieme z neho nahodny riadok a odstranime nadbytocne medzery, taby, entery, atd...\n return wptexturize( trim( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] ) );\n }", "function traiter_raccourcis($letexte) {\n\tglobal $debut_intertitre, $fin_intertitre, $ligne_horizontale, $url_glossaire_externe;\n\tglobal $compt_note;\n\tglobal $marqueur_notes;\n\tglobal $ouvre_ref;\n\tglobal $ferme_ref;\n\tglobal $ouvre_note;\n\tglobal $ferme_note;\n\tglobal $lang_dir;\n\tstatic $notes_vues;\n\tstatic $tester_variables=0;\n\n\t// Appeler les fonctions de pre_traitement\n\t$letexte = pipeline('pre_propre', $letexte);\n\t// old style\n\tif (function_exists('avant_propre'))\n\t\t$letexte = avant_propre($letexte);\n\n\t// Verifier les variables de personnalisation\n\tif (!$tester_variables++) {\n\t\ttester_variable('debut_intertitre', \"\\n<h3 class=\\\"spip\\\">\");\n\t\ttester_variable('fin_intertitre', \"</h3>\\n\");\n\t\ttester_variable('ligne_horizontale', \"\\n<hr class=\\\"spip\\\" />\\n\");\n\t\ttester_variable('ouvre_ref', '&nbsp;[');\n\t\ttester_variable('ferme_ref', ']');\n\t\ttester_variable('ouvre_note', '[');\n\t\ttester_variable('ferme_note', '] ');\n\t\ttester_variable('url_glossaire_externe',\n\t\t\t\"http://@lang@.wikipedia.org/wiki/\");\n\t\ttester_variable('les_notes', '');\n\t\ttester_variable('compt_note', 0);\n\t\ttester_variable('toujours_paragrapher', false);\n\t}\n\n\t// Gestion de la <poesie>\n\tif (preg_match_all(\",<(poesie|poetry)>(.*)<\\/(poesie|poetry)>,UimsS\",\n\t$letexte, $regs, PREG_SET_ORDER)) {\n\t\tforeach ($regs as $reg) {\n\t\t\t$lecode = preg_replace(\",\\r\\n?,S\", \"\\n\", $reg[2]);\n\t\t\t$lecode = ereg_replace(\"\\n[[:space:]]*\\n\", \"\\n&nbsp;\\n\",$lecode);\n\t\t\t$lecode = \"<div class=\\\"spip_poesie\\\">\\n<div>\".ereg_replace(\"\\n+\", \"</div>\\n<div>\", trim($lecode)).\"</div>\\n</div>\\n\\n\";\n\t\t\t$letexte = str_replace($reg[0], $lecode, $letexte);\n\t\t}\n\t}\n\n\t// Harmoniser les retours chariot\n\t$letexte = preg_replace(\",\\r\\n?,S\", \"\\n\", $letexte);\n\n\t// Recuperer les para HTML\n\t$letexte = preg_replace(\",<p[>[:space:]],iS\", \"\\n\\n\\\\0\", $letexte);\n\t$letexte = preg_replace(\",</p[>[:space:]],iS\", \"\\\\0\\n\\n\", $letexte);\n\n\t//\n\t// Notes de bas de page\n\t//\n\t$mes_notes = '';\n\t$regexp = ', *\\[\\[(.*?)\\]\\],msS';\n\tif (preg_match_all($regexp, $letexte, $matches, PREG_SET_ORDER))\n\tforeach ($matches as $regs) {\n\t\t$note_source = $regs[0];\n\t\t$note_texte = $regs[1];\n\t\t$num_note = false;\n\n\t\t// note auto ou pas ?\n\t\tif (preg_match(\",^ *<([^>]*)>,\", $note_texte, $regs)){\n\t\t\t$num_note = $regs[1];\n\t\t\t$note_texte = str_replace($regs[0], \"\", $note_texte);\n\t\t} else {\n\t\t\t$compt_note++;\n\t\t\t$num_note = $compt_note;\n\t\t}\n\n\t\t// preparer la note\n\t\tif ($num_note) {\n\t\t\tif ($marqueur_notes) // quand il y a plusieurs series\n\t\t\t\t\t\t\t\t // de notes sur une meme page\n\t\t\t\t$mn = $marqueur_notes.'-';\n\t\t\t$ancre = $mn.rawurlencode($num_note);\n\n\t\t\t// ne mettre qu'une ancre par appel de note (XHTML)\n\t\t\tif (!$notes_vues[$ancre]++)\n\t\t\t\t$name_id = \" name=\\\"nh$ancre\\\" id=\\\"nh$ancre\\\"\";\n\t\t\telse\n\t\t\t\t$name_id = \"\";\n\n\t\t\t$lien = \"<a href=\\\"#nb$ancre\\\"$name_id class=\\\"spip_note\\\">\";\n\n\t\t\t// creer le popup 'title' sur l'appel de note\n\t\t\tif ($title = supprimer_tags(propre($note_texte))) {\n\t\t\t\t$title = $ouvre_note.$num_note.$ferme_note.$title;\n\t\t\t\t$title = couper($title,80);\n\t\t\t\t$lien = inserer_attribut($lien, 'title', $title);\n\t\t\t}\n\n\t\t\t$insert = \"$ouvre_ref$lien$num_note</a>$ferme_ref\";\n\n\t\t\t// on l'echappe\n\t\t\t$insert = code_echappement($insert);\n\n\t\t\t$appel = \"$ouvre_note<a href=\\\"#nh$ancre\\\" name=\\\"nb$ancre\\\" class=\\\"spip_note\\\" title=\\\"\" . _T('info_notes') . \" $ancre\\\">$num_note</a>$ferme_note\";\n\t\t} else {\n\t\t\t$insert = '';\n\t\t\t$appel = '';\n\t\t}\n\n\t\t// l'ajouter \"tel quel\" (echappe) dans les notes\n\t\tif ($note_texte) {\n\t\t\tif ($mes_notes)\n\t\t\t\t$mes_notes .= \"\\n\\n\";\n\t\t\t$mes_notes .= code_echappement($appel) . $note_texte;\n\t\t}\n\n\t\t// dans le texte, mettre l'appel de note a la place de la note\n\t\t$pos = strpos($letexte, $note_source);\n\t\t$letexte = substr($letexte, 0, $pos) . $insert\n\t\t\t. substr($letexte, $pos + strlen($note_source));\n\t}\n\n\t//\n\t// Raccourcis automatiques [?SPIP] vers un glossaire\n\t// (on traite ce raccourci en deux temps afin de ne pas appliquer\n\t// la typo sur les URLs, voir raccourcis liens ci-dessous)\n\t//\n\tif ($url_glossaire_externe) {\n\t\t$regexp = \"|\\[\\?+([^][<>]+)\\]|S\";\n\t\tif (preg_match_all($regexp, $letexte, $matches, PREG_SET_ORDER))\n\t\tforeach ($matches as $regs) {\n\t\t\t$terme = trim($regs[1]);\n\t\t\t$terme_underscore = preg_replace(',\\s+,', '_', $terme);\n\t\t\t// faire sauter l'eventuelle partie \"|bulle d'aide\" du lien\n\t\t\t// cf. http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Conventions_sur_les_titres\n\t\t\t$terme_underscore = preg_replace(',[|].*,', '', $terme_underscore);\n\t\t\tif (strstr($url_glossaire_externe,\"%s\"))\n\t\t\t\t$url = str_replace(\"%s\", rawurlencode($terme_underscore),\n\t\t\t\t\t$url_glossaire_externe);\n\t\t\telse\n\t\t\t\t$url = $url_glossaire_externe.$terme_underscore;\n\t\t\t$url = str_replace(\"@lang@\", $GLOBALS['spip_lang'], $url);\n\t\t\t$code = '['.$terme.'->?'.$url.']';\n\n\t\t\t// Eviter les cas particulier genre \"[?!?]\"\n\t\t\tif (preg_match(',[a-z],i', $terme))\n\t\t\t\t$letexte = str_replace($regs[0], $code, $letexte);\n\t\t}\n\t}\n\n\n\t//\n\t// Raccourcis ancre [#ancre<-]\n\t//\n\t$regexp = \"|\\[#?([^][]*)<-\\]|S\";\n\tif (preg_match_all($regexp, $letexte, $matches, PREG_SET_ORDER))\n\tforeach ($matches as $regs)\n\t\t$letexte = str_replace($regs[0],\n\t\t'<a name=\"'.entites_html($regs[1]).'\"></a>', $letexte);\n\n\t//\n\t// Raccourcis liens [xxx->url]\n\t// Note : complique car c'est ici qu'on applique typo(),\n\t// et en plus on veut pouvoir les passer en pipeline\n\t//\n\n\t$inserts = array();\n\tif (preg_match_all(_RACCOURCI_LIEN, $letexte, $matches, PREG_SET_ORDER)) {\n\t\t$i = 0;\n\t\tforeach ($matches as $regs) {\n\t\t\t$inserts[++$i] = traiter_raccourci_lien($regs);\n\t\t\t$letexte = str_replace($regs[0], \"@@SPIP_ECHAPPE_LIEN_$i@@\",\n\t\t\t\t$letexte);\n\t\t}\n\t}\n\n\t$letexte = typo($letexte, /* echap deja fait, accelerer */ false);\n\n\tforeach ($inserts as $i => $insert) {\n\t\t$letexte = str_replace(\"@@SPIP_ECHAPPE_LIEN_$i@@\", $insert, $letexte);\n\t}\n\n\n\t//\n\t// Tableaux\n\t//\n\n\t// ne pas oublier les tableaux au debut ou a la fin du texte\n\t$letexte = preg_replace(\",^\\n?[|],S\", \"\\n\\n|\", $letexte);\n\t$letexte = preg_replace(\",\\n\\n+[|],S\", \"\\n\\n\\n\\n|\", $letexte);\n\t$letexte = preg_replace(\",[|](\\n\\n+|\\n?$),S\", \"|\\n\\n\\n\\n\", $letexte);\n\n\t// traiter chaque tableau\n\tif (preg_match_all(',[^|](\\n[|].*[|]\\n)[^|],UmsS', $letexte,\n\t$regs, PREG_SET_ORDER))\n\tforeach ($regs as $tab) {\n\t\t$letexte = str_replace($tab[1], traiter_tableau($tab[1]), $letexte);\n\t}\n\n\t//\n\t// Ensemble de remplacements implementant le systeme de mise\n\t// en forme (paragraphes, raccourcis...)\n\t//\n\n\t$letexte = \"\\n\".trim($letexte);\n\n\t// les listes\n\tif (ereg(\"\\n-[*#]\", $letexte))\n\t\t$letexte = traiter_listes($letexte);\n\n\t// Puce\n\tif (strpos($letexte, \"\\n- \") !== false)\n\t\t$puce = definir_puce();\n\telse $puce = '';\n\n\t// Proteger les caracteres actifs a l'interieur des tags html\n\t$protege = \"{}_-\";\n\t$illegal = \"\\x1\\x2\\x3\\x4\";\n\tif (preg_match_all(\",</?[a-z!][^<>]*[\".preg_quote($protege).\"][^<>]*>,imsS\",\n\t$letexte, $regs, PREG_SET_ORDER)) {\n\t\tforeach ($regs as $reg) {\n\t\t\t$insert = $reg[0];\n\t\t\t// hack: on transforme les caracteres a proteger en les remplacant\n\t\t\t// par des caracteres \"illegaux\". (cf corriger_caracteres())\n\t\t\t$insert = strtr($insert, $protege, $illegal);\n\t\t\t$letexte = str_replace($reg[0], $insert, $letexte);\n\t\t}\n\t}\n\n\t// autres raccourcis\n\t$cherche1 = array(\n\t\t/* 0 */ \t\"/\\n(----+|____+)/S\",\n\t\t/* 1 */ \t\"/\\n-- */S\",\n\t\t/* 2 */ \t\"/\\n- */S\",\n\t\t/* 3 */ \t\"/\\n_ +/S\",\n\t\t/* 4 */ \"/(^|[^{])[{][{][{]/S\",\n\t\t/* 5 */ \"/[}][}][}]($|[^}])/S\",\n\t\t/* 6 */ \t\"/(( *)\\n){2,}(<br[[:space:]]*\\/?\".\">)?/S\",\n\t\t/* 7 */ \t\"/[{][{]/S\",\n\t\t/* 8 */ \t\"/[}][}]/S\",\n\t\t/* 9 */ \t\"/[{]/S\",\n\t\t/* 10 */\t\"/[}]/S\",\n\t\t/* 11 */\t\"/(?:<br\\b[^>]*?\".\">){2,}/S\",\n\t\t/* 12 */\t\"/<p>\\n*(?:<br\\b[^>]*?\".\">\\n*)*/S\",\n\t\t/* 13 */\t\"/<quote>/S\",\n\t\t/* 14 */\t\"/<\\/quote>/S\",\n\t\t/* 15 */\t\"/<\\/?intro>/S\"\n\t);\n\t$remplace1 = array(\n\t\t/* 0 */ \t\"\\n\\n$ligne_horizontale\\n\\n\",\n\t\t/* 1 */ \t\"\\n<br />&mdash;&nbsp;\",\n\t\t/* 2 */ \t\"\\n<br />$puce&nbsp;\",\n\t\t/* 3 */ \t\"\\n<br />\",\n\t\t/* 4 */ \t\"\\$1\\n\\n$debut_intertitre\",\n\t\t/* 5 */ \t\"$fin_intertitre\\n\\n\\$1\",\n\t\t/* 6 */ \t\"<p>\",\n\t\t/* 7 */ \t\"<strong class=\\\"spip\\\">\",\n\t\t/* 8 */ \t\"</strong>\",\n\t\t/* 9 */ \t\"<i class=\\\"spip\\\">\",\n\t\t/* 10 */\t\"</i>\",\n\t\t/* 11 */\t\"<p>\",\n\t\t/* 12 */\t\"<p>\",\n\t\t/* 13 */\t\"<blockquote class=\\\"spip\\\"><p>\",\n\t\t/* 14 */\t\"</blockquote><p>\",\n\t\t/* 15 */\t\"\"\n\t);\n\t$letexte = preg_replace($cherche1, $remplace1, $letexte);\n\t$letexte = preg_replace(\"@^ <br />@S\", \"\", $letexte);\n\n\t// Retablir les caracteres proteges\n\t$letexte = strtr($letexte, $illegal, $protege);\n\n\t// Fermer les paragraphes ; mais ne pas en creer si un seul\n\t$letexte = paragrapher($letexte, $GLOBALS['toujours_paragrapher']);\n\n\t// Appeler les fonctions de post-traitement\n\t$letexte = pipeline('post_propre', $letexte);\n\t// old style\n\tif (function_exists('apres_propre'))\n\t\t$letexte = apres_propre($letexte);\n\n\tif ($mes_notes) traiter_les_notes($mes_notes);\n\n\treturn $letexte;\n}", "function titre_rub($id_rubrique) {\n\tstatic $brut, $typo = array();\n\n\tif (isset($typo[$id_rubrique]))\n\t\treturn $typo[$id_rubrique];\n\n\tif (!isset($brut)) {\n\t\tinclude_spip('base/abstract_sql');\n\t\tforeach(sql_allfetsel(array('titre','id_rubrique', 'lang'), array('spip_rubriques')) as $t)\n\t\t\t$brut[$t['id_rubrique']] = array($t['titre'], $t['lang']);\n\t}\n\n\tif (!isset($typo[$id_rubrique])) {\n\t\tlang_select($brut[$id_rubrique][1]);\n\t\t$typo[$id_rubrique] = typo($brut[$id_rubrique][0]);\n\t\tlang_select();\n\t}\n\n\treturn $typo[$id_rubrique];\n}", "abstract public function get_title_detailed();", "function nieuws_item_titel(){\n\t\t$this->select_db();\n\t\t$query_rs_titel = sprintf(\"SELECT titel FROM cms_nieuws_inhoud WHERE nieuwsgroep_id=%s AND nieuws_id=%s\",\n\t\t\t\t\t\t\t\t\t$this->GetSQLValueString($this->nieuwsgroep_id,\"int\"),\n\t\t\t\t\t\t\t\t\t$this->GetSQLValueString($this->nieuws_id,\"int\"));\n\t\t$rs_titel = mysql_query($query_rs_titel,$this->conn);\n\t\t$row_rs_titel = mysql_fetch_assoc($rs_titel);\n\t\t$totalRows_rs_titel = mysql_num_rows($rs_titel);\n\t\tif($totalRows_rs_titel == 1){\n\t\t\treturn $row_rs_titel['titel'];\n\t\t} else {\n\t\t\treturn 'Het gezochte nieuwsitem is helaas niet gevonden';\n\t\t}\n\t\tmysql_fre_result($rs_titel);\n\t}", "public function esSabadoNoche();", "public function darSinopsis($titulo)\n {\n $arrayLibrosLeidos= $this->getLibrosLeidos();\n\n for ($i=0; $i<count($arrayLibrosLeidos); $i++){\n \n for ($j=0; $j<count($arrayLibrosLeidos[$i]); $j++){\n if ($arrayLibrosLeidos[$i][$j]==$titulo){\n return $arrayLibrosLeidos[$i][3];\n }else{\n return \"▓ No se encuentra el libro ▓\\n\";;\n }\n }\n }\n}", "public function getApellido_titular()\n {\n return $this->apellido_titular;\n }", "function tituloTabla(){\n $datos['identificacion']=$this->identificacion;\n $datos['cod_proyecto']=$_REQUEST['cod_proyecto'];\n $proyecto = $this->consultarProyectosCoordinador($datos);\n $titulo =\"<br><div align='center' ><b>Tabla de Homologaciones - \".$proyecto[0][0].\" \".$proyecto[0][1].\"</b></div><hr>\";\n echo $titulo;\n }", "protected function _getTitulo()\n {\n $c = new ServiciosController();\n $related=$c->getRelated($this->_properties['id']);\n if($related==null)\n return '';\n return $this->_properties['nombre'].' de '.$related->renta->nombre;\n }", "function navHalaman($halaman_aktif, $jmlhalaman){\n$link_halaman = \"\";\n// Link halaman 1,2,3, ...\nfor ($i=1; $i<=$jmlhalaman; $i++){\n if ($i == $halaman_aktif){\n $link_halaman .= \"<b>$i</b> | \";\n }\nelse{\n $link_halaman .= \"<a href=halkategori-$_GET[id]-$i.html>$i</a> | \";\n}\n$link_halaman .= \" \";\n}\nreturn $link_halaman;\n}", "function imprimir_titulo($t)\r\n\t\t{\r\n\t\t\t$titulo =\"<center>\";\r\n\t\t\t\t$titulo\t.= \"<h1>\";\r\n\t\t\t\t\t$titulo .=\"$t\";\r\n\t\t\t\t$titulo .=\"</h1>\";\r\n\t\t\t$titulo .=\"</center>\";\t\r\n\r\n\t\t\treturn $titulo.\"<p>\";\r\n\t\t}", "function generarTitulo() {\n\n\treturn \"Catalogo de restaurantes\";\n}", "function contenidos()\n\t{\n\t\tglobal $__BD, $__CAT, $__LIB;\n\t\tglobal $CLEAN_GET;\n\t\t\n\t\t$referencia = '';\n\t\tif (isset($CLEAN_GET[\"ref\"]))\n\t\t\t$referencia = $CLEAN_GET[\"ref\"];\n\t\t\n\t\t$ordenSQL = \"select * from articulos where referencia = '$referencia' and publico = true\";\n\t\t\n\t\t$result = $__BD->db_query($ordenSQL);\n\t\t\n\t\t$row = $__BD->db_fetch_array($result);\n\t\tif (!$row) {\n\t\t\techo '<div class=\"titPagina\">'._ERROR.'</div>';\n\t\t\techo '<div class=\"articulo\">';\n\t\t\techo _ARTICULO_NO_DISPONIBLE;\n\t\t\techo '</div>';\n\t\t\tinclude(\"../includes/right_bottom.php\");\n\t\t}\n\t\t\n\t\t\n\t\t$precio = $__CAT->precioArticulo($row, true);\n\t\t\n\t\t$descripcion = $__LIB->traducir(\"articulos\", \"descripcion\", $row[\"referencia\"], $row[\"descripcion\"]);\n\t\t\n\t\techo '<div class=\"titPagina\">'.$descripcion.'</div>';\n\t\t\n\t\techo '<div class=\"articulo\">';\n\t\t\n\t\techo '<div class=\"thumb\">';\n\t\techo $__CAT->codigoThumb($referencia, true);\n\t\techo '</div>';\n\t\t\n\t\techo '<p><div id=\"_precio\"><b>'.$precio.'</b></div>';\n\n\n\t\techo '<div class=\"venta\">';\n\t\t$datosStock = $__CAT->datosStock($row);\n\t\tif ($datosStock[\"venta\"])\n\t\t\techo $__LIB->crearBotonVenta($referencia);\n\t\techo '&nbsp;&nbsp;'.$__LIB->crearBotonFavoritos($referencia);\n\t\techo '</div>';\n\t\n\t\n\t\tif ($datosStock[\"stock\"])\n\t\t\techo '<p>'.$datosStock[\"stock\"].'</p>';\n\t\t\n\t\t$descPublica = $__LIB->traducir(\"articulos\", \"descpublica\", $row[\"referencia\"], $row[\"descpublica\"]);\n\t\techo '<p>'.nl2br($descPublica);\n\t\t\n\t\techo $__CAT->atributos($referencia);\n\t\t\n\t\tif ($row[\"codfabricante\"]) {\n\t\t\t$ordenSQL = \"select nombre from fabricantes where codfabricante = '\".$row[\"codfabricante\"].\"'\";\n\t\t\t$fabricante = $__BD->db_valor($ordenSQL);\n\t\t\techo '<p>'._FABRICANTE.': <a href=\"'._WEB_ROOT.'catalogo/articulos.php?fab='.$row[\"codfabricante\"].'\">'.$fabricante.'</a>';\n\t\t}\n\t\t\n\t\t\n\t\techo '<div id=\"codigoEnviarAamigo\"></div>';\n\t\t\n\t\techo $__CAT->accesoriosLista($referencia);\n\t\n\t\techo '</div>';\n\t\t\n\t\t$__LIB->controlVisitas('articulos', $referencia);\n\t}", "function navHalaman($halaman_aktif, $jmlhalaman){\n$link_halaman = \"\";\n// Link halaman 1,2,3, ...\nfor ($i=1; $i<=$jmlhalaman; $i++){\n if ($i == $halaman_aktif){\n $link_halaman .= \"<b>$i</b> | \";\n }\nelse{\n $link_halaman .= \"<a href=halgaleri-$_GET[id]-$i.html>$i</a> | \";\n}\n$link_halaman .= \" \";\n}\nreturn $link_halaman;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts book title and author information.
public function getAuthorAndTitle() { return $this->book->__toString(); }
[ "protected function _getBookTitle()\n {\n return $this->mBook['title'];\n }", "protected function parseAuthor() {\n\t\treturn $this->selectNestedText(array('wms:Service', 'wms:ContactInformation'), $this->getNamespace('wms'));\n\t}", "public function fetchMetaByTitleAndAuthor($title,$author)\n {\n $urlEncodedTitle = urlencode($title);\n $urlEncodedAuthor = urlencode($author);\n return $this->getbookData('https://www.googleapis.com/books/v1/volumes?q='.$urlEncodedTitle.\"+inauthor:\".$urlEncodedAuthor);\n }", "public function getBookAuthor()\n\t{\n\t\treturn $this->book_author;\n\t}", "public function getBookAuthor(){\n return $this->bookAuthor;\n }", "private function parseAdditionalInformation() {\n\t\t\n\t\t// retreive summary information object to work with\n\t\t$summaryInformation = $this->document->getSummaryInformation();\n\n\t\tif(java_values($summaryInformation) == null) return;\n\n\t\t// get document title\n\t\t$title = java_values($summaryInformation->getTitle());\n\n\t\t// TODO: add author and keywords\n\n\t\t$this->htmlDocument->setTitle($title);\n\t}", "public function getAuthor();", "function isbn_to_title($isbn) { \n $html = file_get_contents('http://www.isbnsearch.org/isbn/' . $_GET[\"isbn\"]);\n $a = explode('<div class=\"bookinfo\">', $html);\n $b = explode('<h2>', $a[1]);\n $c = explode('</h2>', $b[1]);\n return $c[0];\n }", "public function retrieveBookInfoByAuthor ($author) {\n $author = mysql_real_escape_string($author);\n $result = mysql_query(\"SELECT BD.BOOK_ID AS BOOK_ID,\n TITLE,\n AUTHOR,\n EDITION,\n PUBLISHER,\n PUBLISH_YR,\n ISBN_10,\n ISBN_13,\n DESCRIPTION,\n BOOK_IMAGE_DIR_PATH,\n PRICE,\n INVENTORY_COUNT,\n SCHOOL_NM\n FROM BOOK_DTL BD,\n COURSE,\n (SELECT BOOK_ID,\n GROUP_CONCAT(FULL_NM SEPARATOR ', ') AS AUTHOR\n FROM AUTHOR\n GROUP BY BOOK_ID) AUTHOR\n WHERE BD.BOOK_ID = AUTHOR.BOOK_ID\n AND (COURSE.COURSE_NM = UNGRAD_COURSE_NM OR COURSE.COURSE_NM = GRAD_COURSE_NM)\n AND (AUTHOR LIKE '%\".$author.\"%')\n GROUP BY BOOK_ID\");\n if (mysql_num_rows($result) > 0)\n return $result;\n else\n return null;\n mysql_close($con);\n }", "public function getAuthorName();", "function extract_title($metadata, $raw_content) {\n if (isset($metadata['title'])) return $metadata['title'];\n\n preg_match('/#\\\\s?([^\\\\n]+)/', $raw_content, $matches, PREG_UNMATCHED_AS_NULL);\n if (isset($matches) && $matches[1] != null) return $matches[1];\n return \"\";\n}", "public function extractAuthorsData(): void\n {\n foreach ($this->searchTree->author as $author) {\n $name = explode(' ', $author->name, 2);\n $this->resourceOutput['authors'][] = [\n 'first_name' => $name[0] ?? null,\n 'last_name' => $name[1] ?? null,\n ];\n }\n }", "public function extractAuthor(Crawler $crawler)\r\n {\r\n $ret = null;\r\n $crawler->filterXPath(\"//head/meta[@name='author']\")\r\n ->each(\r\n function(Crawler $node) use (&$ret) {\r\n $ret = $node->attr('content');\r\n }\r\n );\r\n\r\n\r\n return $ret;\r\n }", "private function grabBookInfo($fisbn, &$isbn10, &$isbn13, &$title, &$title_ext, &$author, &$publisher) {\n\t $LOOKUP_URL = \"http://isbndb.com/api/books.xml?\";\n\t\t$LOOKUP_KEY = \"58EJBTZO\";\n\t $full_url = $LOOKUP_URL . \"access_key=\" . $LOOKUP_KEY . \"&index1=isbn&value1=\" . $fisbn;\n\t $contents = file_get_contents($full_url);\n\t $parser = xml_parser_create();\n\t xml_parse_into_struct($parser, $contents, $values, $index);\n\t xml_parser_free($parser);\n\t $num_results = $values[$index['BOOKLIST'][0]]['attributes']['TOTAL_RESULTS']; \n\t if(($num_results == 0)||($num_results == '0') ) { // bad ISBN\n\t return false;\n\t }\n\t // now retrieve data from the very first result\n\t $indx = $index['BOOKDATA'][0]; // get index of very first result's data\n\t $isbn10 = $values[$indx]['attributes']['ISBN'];\n\t $isbn13 = $values[$indx]['attributes']['ISBN13'];\n\t $title = $values[$index['TITLE'][0]]['value'];\n\t $title_ext = $values[$index['TITLELONG'][0]]['value'];\n\t $author = $values[$index['AUTHORSTEXT'][0]]['value'];\n\t $publisher = $values[$index['PUBLISHERTEXT'][0]]['value'];\n\t \n\t return true;\n\t}", "function toolbook_importepub_get_title($context) {\n list($opf, $opfroot) = toolbook_importepub_get_opf($context);\n if ($opf) {\n $items = $opf->getElementsByTagName('title');\n if ($items) {\n return $items->item(0)->nodeValue;\n }\n }\n return NULL;\n}", "function wimp_get_author_title( $author ) {\n\tif ( ! empty( $author->title ) && ! empty( $author->company ) ) {\n\t\treturn $author->title . ' at ' . $author->company;\n\t} elseif ( ! empty( $author->title ) && empty( $author->company ) ) {\n\t\treturn $author->title;\n\t} elseif ( empty( $author->title ) && ! empty( $author->company ) ) {\n\t\treturn $author->company;\n\t}\n\n\treturn '';\n}", "public function get_authorDetail_authorID($author_id = \"\") {\n\n // Return false if book_id is empty\n if (empty($author_id)) {\n return FALSE;\n }\n $url = \"https://www.goodreads.com/author/show.xml\";\n\n $option = array(\n 'url' => $url,\n 'key_var_name' => \"key\",\n 'key' => $GOODREADS_KEY,\n 'query_var_name' => \"id\",\n 'query' => $author_id,\n );\n\n $arr = $this->fetch_data($option);\n\n $author_name = $arr['author']['name'];\n $image_url = $arr['author']['large_image_url'];\n $gender = $arr['author']['gender'];\n $hometown = $arr['author']['hometown'];\n\n // collecting books\n $books = array();\n # todo : to get other authors.{To reproduce it, run this api again author.show}.\n if ($this->isAssoc($arr['author']['books']['book'])) {\n $abook = array(\n 'book_id' => $arr['author']['books']['book']['id'],\n 'book_title' => $arr['author']['books']['book']['title'],\n 'image_url' => $arr['author']['books']['book']['image_url'],\n\n 'publisher' => $arr['author']['books']['book']['publisher'],\n 'publication_year' => $arr['author']['books']['book']['publication_year'],\n 'publication_month' => $arr['author']['books']['book']['publication_month'],\n 'publication_day' => $arr['author']['books']['book']['publication_day'],\n 'average_rating' => $arr['author']['books']['book']['average_rating'],\n 'description' => $arr['author']['books']['book']['description'],\n );\n array_push($books, $abook);\n } else {\n $end = count($arr['author']['books']['book']);\n for ($idx = 0; $idx < $end; $idx++) {\n $abook = array(\n 'book_id' => $arr['author']['books']['book'][$idx]['id'],\n 'book_title' => $arr['author']['books']['book'][$idx]['title'],\n 'image_url' => $arr['author']['books']['book'][$idx]['image_url'],\n\n 'publisher' => $arr['author']['books']['book'][$idx]['publisher'],\n 'publication_year' => $arr['author']['books']['book'][$idx]['publication_year'],\n 'publication_month' => $arr['author']['books']['book'][$idx]['publication_month'],\n 'publication_day' => $arr['author']['books']['book'][$idx]['publication_day'],\n 'average_rating' => $arr['author']['books']['book'][$idx]['average_rating'],\n 'description' => $arr['author']['books']['book'][$idx]['description'],\n );\n array_push($books, $abook);\n }\n }\n\n //TODO: collect user data as array();\n $author_data = array(\n 'author_name' => $author_name,\n 'image_url' => $image_url,\n 'gender' => $gender,\n 'hometown' => $hometown,\n 'books_array' => $books,\n );\n\n return array(\n 'author_data' => $author_data,\n );\n }", "public function getBook($title){\r\n\r\n\t\t\t$allBooks = $this->getBookDetails();\r\n\r\n\t\t\treturn $allBooks[$title];\r\n\t\t}", "function bib_get_title($item)\n{\n\tif (!$item) return \"\";\n\treturn ($item[\"type\"] != \"inbook\") ? $item[\"title\"] : $item[\"chapter\"];\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the encryption class used to encrypt the session data If no cipher is set, a `None` cipher will be returned and will not encrypt anything
public function getCipher() { return $this->cipher ?: $this->cipher = new None(); }
[ "public function encryptionCipher()\n {\n return $this->encryptionCipher;\n }", "public function getEncryptor() {\n if(!empty($this->encryptor)) {\n return get_class($this->encryptor);\n } else {\n return null;\n }\n }", "public function getEncryptionType()\n {\n return $this->encryption_type;\n }", "public function preferredEncryption()\n\t{\n\t\t$aes = new Encrypt();\n\t\t$adapter = $aes->getAdapter();\n\n\t\tif (!$adapter->isSupported())\n\t\t{\n\t\t\treturn 'CTR128';\n\t\t}\n\n\t\treturn 'AES128';\n\t}", "public function getCipher() {\n\t\t$cipher = $this->config->getSystemValue('cipher', self::DEFAULT_CIPHER);\n\t\tif (!isset($this->supportedCiphersAndKeySize[$cipher])) {\n\t\t\t$this->logger->warning(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t'Unsupported cipher (%s) defined in config.php supported. Falling back to %s',\n\t\t\t\t\t\t\t$cipher,\n\t\t\t\t\t\t\tself::DEFAULT_CIPHER\n\t\t\t\t\t),\n\t\t\t\t['app' => 'encryption']);\n\t\t\t$cipher = self::DEFAULT_CIPHER;\n\t\t}\n\n\t\t// Workaround for OpenSSL 0.9.8. Fallback to an old cipher that should work.\n\t\tif(OPENSSL_VERSION_NUMBER < 0x1000101f) {\n\t\t\tif($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') {\n\t\t\t\t$cipher = self::LEGACY_CIPHER;\n\t\t\t}\n\t\t}\n\n\t\treturn $cipher;\n\t}", "public function getEncryption()\n {\n return $this->encryption;\n }", "public function getCipher()\n {\n return $this->cipher;\n }", "function _get_cipher() {\n\t\tif ($this->_mcrypt_cipher == '') {\n\t\t\t$this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;\n\t\t}\n\t\t\n\t\treturn $this->_mcrypt_cipher;\n\t}", "protected function _getEncryption()\n {\n return $this->_encryption;\n }", "public function getEncryption()\n {\n return $this->encryption;\n }", "public static function _GetCipher() {\n\t\tif (self::$_MCryptCipher == '') {\n\t\t\tself::$_MCryptCipher = MCRYPT_RIJNDAEL_256;\n\t\t}\n\n\t\treturn self::$_MCryptCipher;\n\t}", "public function getEncryption()\n {\n return $this->Encryption;\n }", "public function _get_cipher()\n {\n if ($this->_mcrypt_cipher == '') {\n $this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;\n }\n\n return $this->_mcrypt_cipher;\n }", "public function getDefaultEncryption()\n {\n return $this->default_encryption;\n }", "public function getEncryptionType()\n\t{\n\t\treturn $this->_formEncryptionType;\n\t}", "public function getCipher(): string\n {\n return $this->cipher;\n }", "public function getCipher()\n {\n return $this->getKey('Cipher');\n }", "public function getEncryptionType() {\r\n\t\treturn $this->_config['passwordtype'];\r\n\t}", "public static function getEncryption() {\n return IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_NAME . IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_VERSION;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the file readable?
public function isReadable() { return is_readable( $this->file ); }
[ "public function IsReadable()\n {\n return is_readable($this->sFile);\n }", "public function isReadable() {\n\t\treturn is_readable( $this->file );\n\t}", "public function is_readable ()\n {\n return is_readable ($this->path);\n }", "public function isReadable ()\n {\n return $this->file->isReadable();\n }", "public function isReadable()\n {\n return is_readable($this->path);\n }", "public function is_readable($file)\n {\n }", "public function isReadable()\n\t{\n\t\tif (is_readable($this->directory)) return true; return;\n\t}", "function MyFile_Readable($file)\n {\n return is_readable($file);\n }", "function is_readable ($filename) {}", "public function isReadable(string $path) : bool;", "public function isReadable();", "function is_readable_file ($path) {\n\treturn is_readable($path) && is_file($path);\n}", "public function isReadable(): bool\n {\n return $this->readable;\n }", "public static function isReadable($path)\n\t{\n\t\treturn is_readable($path);\n\t}", "public function canRead($filename);", "public function isReadable() : bool\n {\n return $this->readable;\n }", "public function isReadable($path)\n {\n return is_readable($path);\n }", "function is_readable($path)\n{\n\treturn false;\n}", "abstract function canRead($filename);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGetAsync Retrieves a list of instructions for a bill stage.
public function billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGetAsync($accept, $bill_id, $stage_id, $jiwa_stateful = null) { return $this->billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful) ->then( function ($response) { return $response[0]; } ); }
[ "public function billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGet($accept, $bill_id, $stage_id, $jiwa_stateful = null)\n {\n list($response) = $this->billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGetWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful);\n return $response;\n }", "protected function billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGetRequest($accept, $bill_id, $stage_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGet'\n );\n }\n // verify the required parameter 'bill_id' is set\n if ($bill_id === null || (is_array($bill_id) && count($bill_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bill_id when calling billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGet'\n );\n }\n // verify the required parameter 'stage_id' is set\n if ($stage_id === null || (is_array($stage_id) && count($stage_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stage_id when calling billInstructionsGETManyRequestBillIDStagesStageIDInstructionsGet'\n );\n }\n\n $resourcePath = '/Bills/{BillID}/Stages/{StageID}/Instructions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($bill_id !== null) {\n $resourcePath = str_replace(\n '{' . 'BillID' . '}',\n ObjectSerializer::toPathValue($bill_id),\n $resourcePath\n );\n }\n // path params\n if ($stage_id !== null) {\n $resourcePath = str_replace(\n '{' . 'StageID' . '}',\n ObjectSerializer::toPathValue($stage_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function billInstructionPOSTRequestBillIDStagesStageIDInstructionsPost($accept, $bill_id, $stage_id, $jiwa_stateful = null, $item_no = null, $instruction_text = null, $custom_field_values = null, $body = null)\n {\n list($response) = $this->billInstructionPOSTRequestBillIDStagesStageIDInstructionsPostWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful, $item_no, $instruction_text, $custom_field_values, $body);\n return $response;\n }", "public function billStagesGETManyRequestBillIDStagesGetAsync($accept, $bill_id, $jiwa_stateful = null)\n {\n return $this->billStagesGETManyRequestBillIDStagesGetAsyncWithHttpInfo($accept, $bill_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGet($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful = null)\n {\n list($response) = $this->billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetWithHttpInfo($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful);\n return $response;\n }", "public function salesOrderPaymentsGETManyRequestInvoiceIDPaymentsGet($accept, $invoice_id, $jiwa_stateful = null)\n {\n list($response) = $this->salesOrderPaymentsGETManyRequestInvoiceIDPaymentsGetWithHttpInfo($accept, $invoice_id, $jiwa_stateful);\n return $response;\n }", "public function billNotesGETManyRequestBillIDNotesGetAsync($accept, $bill_id, $jiwa_stateful = null)\n {\n return $this->billNotesGETManyRequestBillIDNotesGetAsyncWithHttpInfo($accept, $bill_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function billInputsGETManyRequestBillIDStagesStageIDInputsGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Input[]';\n $request = $this->billInputsGETManyRequestBillIDStagesStageIDInputsGetRequest($accept, $bill_id, $stage_id, $jiwa_stateful);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetWithHttpInfo($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Instruction';\n $request = $this->billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetRequest($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Instruction',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Instruction',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Instruction',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Instruction',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function billInstructionPOSTRequestBillIDStagesStageIDInstructionsPostRequest($accept, $bill_id, $stage_id, $jiwa_stateful = null, $item_no = null, $instruction_text = null, $custom_field_values = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling billInstructionPOSTRequestBillIDStagesStageIDInstructionsPost'\n );\n }\n // verify the required parameter 'bill_id' is set\n if ($bill_id === null || (is_array($bill_id) && count($bill_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bill_id when calling billInstructionPOSTRequestBillIDStagesStageIDInstructionsPost'\n );\n }\n // verify the required parameter 'stage_id' is set\n if ($stage_id === null || (is_array($stage_id) && count($stage_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stage_id when calling billInstructionPOSTRequestBillIDStagesStageIDInstructionsPost'\n );\n }\n\n $resourcePath = '/Bills/{BillID}/Stages/{StageID}/Instructions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($item_no !== null) {\n $queryParams['ItemNo'] = ObjectSerializer::toQueryValue($item_no);\n }\n // query params\n if ($instruction_text !== null) {\n $queryParams['InstructionText'] = ObjectSerializer::toQueryValue($instruction_text);\n }\n // query params\n if ($custom_field_values !== null) {\n $queryParams['CustomFieldValues'] = ObjectSerializer::toQueryValue($custom_field_values);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($bill_id !== null) {\n $resourcePath = str_replace(\n '{' . 'BillID' . '}',\n ObjectSerializer::toPathValue($bill_id),\n $resourcePath\n );\n }\n // path params\n if ($stage_id !== null) {\n $resourcePath = str_replace(\n '{' . 'StageID' . '}',\n ObjectSerializer::toPathValue($stage_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetAsync($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful = null)\n {\n return $this->billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function billInstructionPOSTRequestBillIDStagesStageIDInstructionsPostAsync($accept, $bill_id, $stage_id, $jiwa_stateful = null, $item_no = null, $instruction_text = null, $custom_field_values = null, $body = null)\n {\n return $this->billInstructionPOSTRequestBillIDStagesStageIDInstructionsPostAsyncWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful, $item_no, $instruction_text, $custom_field_values, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function billOutputsGETManyRequestBillIDOutputsGet($accept, $bill_id, $jiwa_stateful = null)\n {\n list($response) = $this->billOutputsGETManyRequestBillIDOutputsGetWithHttpInfo($accept, $bill_id, $jiwa_stateful);\n return $response;\n }", "public function billStagesGETManyRequestBillIDStagesGetAsyncWithHttpInfo($accept, $bill_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Stage[]';\n $request = $this->billStagesGETManyRequestBillIDStagesGetRequest($accept, $bill_id, $jiwa_stateful);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function landedCostBookInLinesGETManyRequestBookInIDLinesGetAsync($accept, $book_in_id, $jiwa_stateful = null)\n {\n return $this->landedCostBookInLinesGETManyRequestBookInIDLinesGetAsyncWithHttpInfo($accept, $book_in_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function inventoryNotesGETManyRequestInventoryIDNotesGetAsync($accept, $inventory_id, $jiwa_stateful = null)\n {\n return $this->inventoryNotesGETManyRequestInventoryIDNotesGetAsyncWithHttpInfo($accept, $inventory_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGet($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful = null)\n {\n list($response) = $this->billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGetWithHttpInfo($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful);\n return $response;\n }", "protected function billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGetRequest($accept, $bill_id, $stage_id, $instruction_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGet'\n );\n }\n // verify the required parameter 'bill_id' is set\n if ($bill_id === null || (is_array($bill_id) && count($bill_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bill_id when calling billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGet'\n );\n }\n // verify the required parameter 'stage_id' is set\n if ($stage_id === null || (is_array($stage_id) && count($stage_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stage_id when calling billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGet'\n );\n }\n // verify the required parameter 'instruction_id' is set\n if ($instruction_id === null || (is_array($instruction_id) && count($instruction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $instruction_id when calling billInstructionGETRequestBillIDStagesStageIDInstructionsInstructionIDGet'\n );\n }\n\n $resourcePath = '/Bills/{BillID}/Stages/{StageID}/Instructions/{InstructionID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($bill_id !== null) {\n $resourcePath = str_replace(\n '{' . 'BillID' . '}',\n ObjectSerializer::toPathValue($bill_id),\n $resourcePath\n );\n }\n // path params\n if ($stage_id !== null) {\n $resourcePath = str_replace(\n '{' . 'StageID' . '}',\n ObjectSerializer::toPathValue($stage_id),\n $resourcePath\n );\n }\n // path params\n if ($instruction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InstructionID' . '}',\n ObjectSerializer::toPathValue($instruction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getPayInstructionsFromEmployee(string $employerId, string $employeeId): array\n {\n $response = $this->guzzleClient->get(\n \"/Employer/{$employerId}/Employee/{$employeeId}/PayInstructions\"\n );\n\n return $this->getResponseData($response);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna a URL do XML de estoque do ERP Datasul
public function getURLEstoqueXmlErpDatasul(){ return $this->DadosParametro['url_estoque_xml_erp_datasul']; }
[ "public function getXmlUrl() {\r\n return trailingslashit(get_bloginfo('url')) . $this->filename;\r\n }", "function _interia_prepare_url() {\n\t\tglobal $mdbd;\n\t\tglobal $config;\n\t\t\n\t\t$data=$mdbd->select(\"partner_id,name\",\"partners\",\"name=?\",array($this->_partner_name=>\"string\"));\t\n $partner_id=$data['partner_id'];\n\t\t$code=md5(\"partner_id.$partner_id.$config->salt\"); // wygenerowanie kodu kontrolnego\n $link=\"&partner_id=\".$partner_id.\"&code=\".$code; // budowanie linku\n\t\t$this->soap->chars_to_xml($link); \n return $link;\n\t}", "public function getXmlUrl($params = NULL) {\n return $this->feedUrl;\n }", "protected function get_xsl_url()\n {\n }", "function get_request_url() {\n $endpoint = $this->get_endpoint();\n if (is_null($endpoint) || $enpoint = '') {\n throw new EndpointNuloException(\"Falta endpoint para Consulta\", 1);\n }\n\n //PDF return $endpoint . 'numerodocumento=' . str_replace(' ', '+', $_GET['id']) . '-I.pdf';\n $urlconsulta = $endpoint . '&numero_documento=' . str_replace(' ', '+', $_GET['numerodocumento'].'-APN-'.str_replace('#', '%23',$_GET['filtroc']));\n\n return $urlconsulta;\n\n }", "public function getBaseUrl()\n {\n return 'https://www.careersingovernment.com/rss';\n }", "public function getWsdlUrl() {}", "public function getXmlResponse();", "public function getXml();", "public function getXML()\n {\n }", "private function get_XML($url)\n\t\t{\n\t\t\t$out = \"\";\n\t\t\t$ch = curl_init( $url );\n\t\t\tif ( $ch ) {\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\t\t\t/* set proxy */\n\t\t\t\tif ( ! empty( $this->appliance_options['proxy'] ) ) {\n\t\t\t\t\tcurl_setopt( $ch, CURLOPT_PROXY, $this->appliance_options['proxy'] );\n\t\t\t\t}\n\t\t\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\t\t\t$out .= curl_exec( $ch );\n\t\t\t\tcurl_close( $ch );\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public function getXmlGatewayUrl()\n {\n \treturn $this->_xmlGatewayUrl;\n }", "static function currentUrlXml($params = array())\n\t{\n\t\treturn self::currentUrl($params, \"&amp;\");\n\t}", "public function xml_urlset() {\n\t\treturn '<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" '\n\t\t\t. 'xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd '\n\t\t\t. 'http://www.google.com/schemas/sitemap-news/0.9 http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd\" '\n\t\t\t. 'xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" '\n\t\t\t. 'xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\" '\n\t\t\t. 'xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">' . \"\\n\";\n\t}", "abstract public function getWsaaUrl();", "public function xml_urlset() {\n\t\treturn '<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" '\n\t\t\t. 'xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd '\n\t\t\t. 'http://www.google.com/schemas/sitemap-video/1.1 http://www.google.com/schemas/sitemap-video/1.1/sitemap-video.xsd\" '\n\t\t\t. 'xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" '\n\t\t\t. 'xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">' . \"\\n\";\n\t}", "function shurly_integration_shurl_get_xml($long_url) {\n $url = shurly_integration_shurl_prepare_url($long_url);\n\n $result = drupal_http_request($url);\n if ($result->code == 200) {\n $data = simplexml_load_string($result->data);\n return $data;\n }\n else {\n watchdog('shurly_integration', 'Could not retrieve short url data with request !url. Error: !error.', array('!url' => $url, '!error' => print_r($result, TRUE)));\n }\n return;\n}", "public function getUrl() {\n\n\t\tglobal $url;\n\t\t\n\t\t// query string\n\t\t$fields = array(\n\t\t\t'key' => '2015201520159',\n\t\t\t'out' => 'json',\n\t\t\t'cats' => 'ACCOMM',\n\t\t\t'ar' => 'Blue Mountains Area',\n\t\t\t'size' => \"8\",\n\t\t);\n\t\t\n\t\t$url = 'http://atlas.atdw.com.au/productsearchservice.svc/products?' . http_build_query($fields);\n\t}", "public function actionGenerateXmlLinks()\n\t{\n\t\t$this->layout = false;\n\t\t$keys = Yii::$app->request->post('keys');\n\t\t$onefile = Yii::$app->request->post('onefile');\n\t\t$siteUrls = [];\n\t\t\n\t\tforeach($keys as $sourceId)\n\t\t{\n\t\t\t$db = WpSource::findOne($sourceId);\n\t\t\t$db->executeFile($db->filename);\n\t\t\t$db->copyDataToGlobalTables($sourceId);\n\t\t\t$db->dropTmpTables();\n\t\t\t\n\t\t\t$siteUrls[$sourceId] = WpSource::findOne($sourceId)->siteurl;\n\t\t}\n\t\t\n\t\t$ajaxTemplate = ($onefile == 0) ? '_xmlListing' : '_oneXmlLink';\n\t\t\n\t\treturn $this->render($ajaxTemplate, ['siteUrls' => $siteUrls]);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a unique hash for each view, used to prefix the state variables to allow us to retrieve them from the state later on. If it's not already set (with setHash) it will be set in the form com_something.myModel. If you pass a nonempty $viewName then if it's not already set it will be instead set in the form of com_something.viewName.myModel which is useful when you are reusing models in multiple views and want to avoid state bleedover among views. Also see the hash and hash_view parameters in the constructor's options.
public function getHash($viewName = null) { if (is_null($this->stateHash)) { $this->stateHash = ucfirst($this->container->componentName) . '.'; if (!empty($viewName)) { $this->stateHash .= $viewName . '.'; } $this->stateHash .= $this->getName() . '.'; } return $this->stateHash; }
[ "function elgg_get_viewhash($view, $vars)\n\t\t{\t\t\t\n\t\t\t$unchanged_vars = unserialize(serialize($vars));\n\t\t\t\n\t\t\t// This is a bit of a hack, but basically we have to remove things that change on each pageload \n\t\t\tif (isset($unchanged_vars['entity']->last_action)) $unchanged_vars['entity']->last_action = 0;\n\t\t\tif (isset($unchanged_vars['entity']->prev_last_action)) $unchanged_vars['entity']->prev_last_action = 0;\n\t\t\t\n\t\t\tif (isset($unchanged_vars['user']->last_action)) $unchanged_vars['user']->last_action = 0;\n\t\t\tif (isset($unchanged_vars['user']->prev_last_action)) $unchanged_vars['user']->prev_last_action = 0;\n\t\t\t\n\t\t\t\n\t\t\treturn md5(current_page_url() . $view . serialize($unchanged_vars)); // This should be enough to stop artefacts\n\t\t\t\n\t\t}", "public function getViewKey()\r\n {\r\n if (!$this->getData('stored_view_key')) {\r\n if (Mage::app()->getRequest()->getParam('view_key')) {\r\n $viewKey = Mage::app()->getRequest()->getParam('view_key');\r\n } else {\r\n $viewKey = $this->_helper()->getView()->getNewKey($this->getId());\r\n }\r\n $this->setData('stored_view_key', $viewKey);\r\n }\r\n return $this->getData('stored_view_key');\r\n }", "private function set_view_props() {\n $this->view_form_name = ! empty($_POST) && array_key_exists('view_form_name', $_POST)\n ? $_POST['view_form_name']\n : '';\n\n $this->view_name = $this->view_form_name\n ? substr($this->view_form_name, 0, -5)\n : '';\n }", "function getViewProps( $view = null ) {\n if( !$this->_viewProps ) {\n // attempt to retrieve from session\n $vp = $this->_session->find('view_map');\n if( is_array($vp) ) {\n $this->_zen->addDebug('ZenFieldMap->getViewProps', \"Loading from session[\".count($vp).\"]\", 3);\n $this->_viewProps = $vp;\n }\n else {\n // if not in session, load from database\n $query = \"SELECT * FROM \" . $this->_zen->table_view_map . \" ORDER BY which_view, vm_order\";\n\n $this->_viewProps = array();\n $vals = $this->_zen->db_queryIndexed($query);\n $this->_zen->addDebug('ZenFieldMap->getViewProps', \"Loading from db[\".count($vals).\"]: \".$query, 3);\n foreach($vals as $v) {\n $vw = $v['which_view'];\n $field = $v['vm_name'];\n if( !array_key_exists($vw, $this->_viewProps) ) {\n // intialize the view array\n $this->_viewProps[\"$vw\"] = array();\n }\n $this->_viewProps[\"$vw\"][\"$field\"] = $v;\n }\n $this->_session->store('view_map', $this->_viewProps);\n }\n }\n return $view? $this->_viewProps[\"$view\"] : $this->_viewProps;\n }", "public static function name($view, $name) {\n\t\tstatic::$names[$name] = $view;\n\t}", "public function getView($viewName);", "public function setViewName($viewName)\n\t{\n\t\t$this->viewName = $viewName;\n\t}", "public function accountView($viewName, $data=[]) {\n $this -> view = new AccountView($viewName, $data);\n return $this->view;\n \n }", "public static function setViewClassName($viewClassName)\n {\n self::$_viewClassName = $viewClassName;\n }", "public function setView($pStrViewName = ''){\n\t\t/* return the view path */\n\t\treturn '..'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$this->_strModuleName.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$pStrViewName;\n\t}", "public function setViewName($viewName)\n {\n $this->viewName = $viewName;\n }", "public function generateHash()\n {\n $hash = '';\n $dontHash = $this->dontHash();\n\n $vars = get_object_vars($this);\n foreach ($vars as $name => $member) {\n\n if (in_array($name, $dontHash) || in_array($name, $this->reservedHash)) {\n continue;\n }\n\n if ($member instanceof HashableModel) {\n $hash .= $member->generateHash();\n } elseif (is_scalar($member)) {\n $hash .= (string)$member;\n } elseif (is_null($member)) {\n continue;\n } else {\n $hash .= serialize($member);\n }\n }\n\n return md5($hash);\n }", "public function view($key, $view = null) {\n\t\tif (is_array($key)) {\n\t\t\tforeach ($key as $key2 => $view) {\n\t\t\t\t$this->view($key2, $view);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ($view === null) {\n\t\t\t\treturn isset($this->_views[$key]) ? $this->_views[$key] : null;\n\t\t\t}\n\t\t\t$this->_views[$key] = $view;\n\n\t\t\tif (!isset($this->_modified_views[$key])) {\n\t\t\t\t$this->_modified_views[$key] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getCacheKeyString() {\n $view_cache_key = array();\n $keys = array_keys($_GET);\n foreach ($keys as $key) {\n array_push($view_cache_key, $_GET[$key]);\n }\n if (MakerbaseSession::isLoggedIn()) {\n array_push($view_cache_key, MakerbaseSession::getLoggedInUser());\n }\n return '.ht'.$this->view_template.self::KEY_SEPARATOR.(implode($view_cache_key, self::KEY_SEPARATOR));\n }", "public function getViewKey(): string;", "public function generateView ( $viewId )\n\t{\n // Read view configuration\n\t}", "function remember_this_view ( $view = false ) {\n global $REQUEST_URI;\n if ( empty ( $REQUEST_URI ) )\n $REQUEST_URI = $_SERVER['REQUEST_URI'];\n\n // If called from init, only process script named \"view_x.php.\n if ( $view == true && ! strstr ( $REQUEST_URI, 'view_' ) )\n return;\n\n // Do not use anything with \"friendly\" in the URI.\n if ( strstr ( $REQUEST_URI, 'friendly=' ) )\n return;\n\n SetCookie ( 'webcalendar_last_view', $REQUEST_URI );\n}", "public static function getViewName() {\n return static::$VIEW;\n }", "public function mergeView(View $view = null)\n {\n if ($view === null) {\n return;\n }\n\n foreach ($view as $key => $val) {\n if (property_exists($this, $key)) {\n $this->$key = $val;\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ago test can't work on February 29th
public function testAgoTranslated() { if (JenssegersDate::now()->format('m-d') === '02-29') { JenssegersDate::setTestNow(JenssegersDate::now()->subDay()); } $date = JenssegersDate::parse('-21 hours'); $this->assertSame('πριν 21 ώρες', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('πριν 5 μέρες', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('πριν 3 εβδομάδες', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('πριν 6 μήνες', $date->ago()); $date = JenssegersDate::parse('-10 years'); $this->assertSame('πριν 10 χρόνια', $date->ago()); }
[ "public function testModifierDateHeure()\n {\n }", "public function testAgoTranslated()\n {\n if (JenssegersDate::now()->format('m-d') === '02-29') {\n JenssegersDate::setTestNow(JenssegersDate::now()->subDay());\n }\n\n $date = JenssegersDate::parse('-21 hours');\n $this->assertSame('21 годину тому', $date->ago());\n\n $date = JenssegersDate::parse('-5 days');\n $this->assertSame('5 днів тому', $date->ago());\n\n $date = JenssegersDate::parse('-3 weeks');\n $this->assertSame('3 тижні тому', $date->ago());\n\n $date = JenssegersDate::now()->subMonthsNoOverflow(6);\n $this->assertSame('6 місяців тому', $date->ago());\n\n $date = JenssegersDate::parse('-10 years');\n $this->assertSame('10 років тому', $date->ago());\n }", "public function testBadDate3()\n {\n new ApproxDate('199807123');\n }", "private function compare_with_date()\n {\n }", "public function testCheckDateOverTenAM()\n {\n // Populate data\n $promotorID = $this->_populatePromotor();\n \n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n Carbon::setTestNow(Carbon::parse('2016-12-25 12:00:00')); \n \n // Do request\n $this->_request('GET', '/api/1.5.0/date-check', ['token' => $encryptedToken])\n ->_result(['time' => true]);\n }", "public function testLookForTransactionLongDate()\n {\n $this->setUp();\n $line = '04 Sep 2011 OPENING BALANCE ';\n $this->assertFalse($this->object->lookForTransaction($line));\n $this->tearDown();\n }", "public function asAgoStringWithFutureDate()\n {\n $this->expectException(DomainException::class);\n DateTimeUtil::asAgoString(new DateTime('tomorrow'));\n }", "public function testThanksgivingDayOnAfter1879(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"second monday of october {$year}\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function testThanksgivingDayBefore1863()\n {\n $this->assertNotHoliday(self::COUNTRY, self::HOLIDAY, $this->generateRandomYear(1000, 1862));\n }", "public function testBadDay()\n {\n new ApproxDate('3/34/89');\n }", "public function testIssue95()\n {\n $timeAgo = new TimeAgo();\n $startDate = new DateTime('2022-07-01 15:00:00');\n $endDate = new DateTime('2022-09-01 14:00:00');\n $this->assertEquals('2 months ago', $timeAgo->inWords($startDate, $endDate));\n }", "public function testAgoYear()\n {\n $this->makeTest('year', true, \"a year ago|%years% years ago\", array(1 => 1, 2 => 2, 5 => 5, 10 => 10));\n }", "public function testBadYear()\n {\n new ApproxDate('3/3/899');\n }", "public function testPostWorkforcemanagementAdherenceHistorical()\n {\n }", "public function testGetDate()\n {\n }", "public function testEsterDate()\n {\n if (!function_exists('easter_date'))\n return;\n\n for($year = 1970; $year <= 2037; $year++)\n {\n static::assertSame(DateTime::createFromFormat('U', easter_date($year))->modify('+12 hours')->format('Y-m-d'),\n \\AbcAeffchen\\SepaUtilities\\easterDate($year)->format('Y-m-d'));\n }\n\n // test out of bound easter sundays\n static::assertSame('1870-04-17',\\AbcAeffchen\\SepaUtilities\\easterDate(1870)->format('Y-m-d'));\n static::assertSame('2070-03-30',\\AbcAeffchen\\SepaUtilities\\easterDate(2070)->format('Y-m-d'));\n }", "public function testRepublicDayOnAfter1946(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-6-2\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function testLabourThanksgivingDayBefore1948()\n {\n $this->assertNotHoliday(self::COUNTRY, self::HOLIDAY, $this->generateRandomYear(1000, 1947));\n }", "#[@test]\n public function pre1970() {\n $this->assertDateEquals('1969-02-01T00:00:00+00:00', Date::fromString('01.02.1969'));\n $this->assertDateEquals('1969-02-01T00:00:00+00:00', Date::fromString('1969-02-01'));\n $this->assertDateEquals('1969-02-01T00:00:00+00:00', Date::fromString('1969-02-01 00:00AM'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the namespace of the current block.
private function getBlockNamespace() { return '\\ZincPHP\\Blocks' . str_replace('/', '\\', $this->segments) . '\\' . ucfirst($this->requestType) . ucfirst($this->blockLabel); }
[ "protected function _namespaceNode()\n {\n $this->_codeNode();\n $this->_flushUses();\n $body = $this->_stream->current();\n $name = $this->_stream->next([';', '{']);\n $this->_states['body'] .= $body;\n $node = new BlockDef($body . $name, 'namespace');\n $node->hasMethods = false;\n $node->name = trim(substr($name, 0, -1));\n $this->_states['current'] = $this->_root;\n $this->_contextualize($node);\n return $this->_states['current'] = $node->namespace = $node;\n }", "public static function getNamespaceFromBlockHandle(string $blockHandle, ?string $space = null) : string\n {\n // Add a prefix namespace to the generic namespace, if passed a sub-directory space.\n $prefix = 'AlstradocsBlocksBoilerplatePlugin\\\\Block\\\\Domain';\n if ($space) {\n $prefix .= '\\\\' . ucwords($space);\n }\n\n // Modify the block handle to remove space, and dashes and make the string PascalCase.\n $blockNamespace = str_replace(' ', '', ucwords(str_replace('-', ' ', $blockHandle)));\n\n return sprintf(\n '%s\\\\%s',\n $prefix,\n $blockNamespace\n );\n }", "protected function getNamespaceGenerator()\n {\n $generator = new NamespaceGenerator();\n $generator\n ->setNamespaceTransformer(new NamespaceTransformer())\n ->setIndentation($this->indentation);\n\n return $generator;\n }", "protected function getNamespace()\n\t{\n\t\t$chunks = [Config::get('workflow::namespace'), ucfirst($this->folder), $this->name];\n\n\t\t$namespace = ltrim(implode('\\\\', $chunks), '\\\\');\n\n\t\treturn str_replace('\\\\\\\\', '\\\\', $namespace);\n\t}", "public function get_namespace( $block ) {\n\t\t$parts = explode( '/', $block, 2 );\n\t\tif ( 2 === count( $parts ) ) {\n\t\t\treturn $parts[0];\n\t\t}\n\t\treturn false;\n\t}", "protected function setNamespace()\n {\n $this->namespace =\n (has_filter('inrage/blocks/namespace')\n ? apply_filters('inrage/blocks/namespace', rtrim($this->namespace))\n : 'App\\\\' . $this->directoryClassname . 's');\n }", "protected function constructNamespace()\n {\n if ($this->namespace == 'window') {\n return '';\n }\n\n return \"window.{$this->namespace} = window.{$this->namespace} || {};\";\n }", "public function getNamespace()\n\t{\n\t\treturn 'Modules\\\\' . $this->name . '\\\\';\n\t}", "protected function realNamespace()\n {\n // Sometimes I have one class that inherits the entity and store of another\n // Like how Vfi Client is fake and simply inherits Iam Client\n // In this case $vfi->client REAL MASTER namespace should actually be Dynatron\\Iam\n // Not Dynatron\\Vfi like $this->manager->namespace will reveal.\n\n // I need the REAL MASTER namespace for cases like events\n // I want to fire true Iam\\Client events not Vfi\\Client is using $vfi->client\n // or Iam\\Client if using $iam->client...both are truely Iam and should fire only\n // Dynatron\\Iam events.\n $class = get_class($this);\n $parent = get_parent_class($this);\n\n if (preg_match(\"/Repository\\\\\\\\[A-Za-z]*Store/\", $parent)) {\n // Store is not inherited from another namespace\n $namespace = $this->manager->namespace;\n } else {\n // Store is inherited from another namespace\n $tmp = explode('\\\\', $parent);\n $namespace = implode('\\\\', array_slice($tmp, 0, count($tmp)-3));\n }\n return $namespace;\n }", "protected function buildNamespaceDeclaration() {\n return \"window.{$this->namespace} = window.{$this->namespace} || {};\";\n }", "public function getNameSpace()\n {\n return ''.$this->elem->attributes()['namespace'];\n }", "function acf_add_block_namespace( $metadata ) {\n\tif ( acf_is_acf_block_json( $metadata ) ) {\n\t\t// If the block doesn't already have a namespace, append ACF's.\n\t\tif ( strpos( $metadata['name'], '/' ) === false ) {\n\t\t\t$metadata['name'] = 'acf/' . acf_slugify( $metadata['name'] );\n\t\t}\n\t}\n\treturn $metadata;\n}", "public function getCurrentNamespaceName(): string\n {\n return $this->currentNamespace;\n }", "abstract protected function getDefaultNamespace();", "public function getLocalNamespace();", "function strip_core_block_namespace( $block_name = null ) {\n\tif ( is_string( $block_name ) && 0 === strpos( $block_name, 'core/' ) ) {\n\t\treturn substr( $block_name, 5 );\n\t}\n\n\treturn $block_name;\n}", "abstract protected function getUnitNamespace(): string;", "public function baseNamespace(): String\n {\n $base = $this->baseNamespace . $this->namespaceConfig;\n\n if ($this->isNotEmpty($this->subdirectory)) {\n return $base . '\\\\' . $this->subdirectory;\n }\n\n return $base;\n }", "protected function buildNamespaceDeclaration()\n {\n if ($this->namespace == 'window') {\n return '';\n }\n return \"window.{$this->namespace} = window.{$this->namespace} || {};\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TESTS FOR ID Valid tests for id String length equal to max allowable
public function testIdMaxLengthValid() { $value = ""; for ($i = 0; $i < $this->max_valid_strlen; $i++) { $value .= $this->first_char; } $this->airplane->id = $value; $this->assertLessThanOrEqual($this->max_valid_strlen, strlen($this->airplane->id)); }
[ "public function validateId(){\n \n return preg_match(Config::$id_format, $this->id);\n }", "public function testThatWeCanGetTheId()\n {\n $ads = new Alerts;\n \n $ads->setId('1');\n \n $this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' );\n\n\n }", "public function validate_id(string $id): bool {\n //check if not a name is given instate of an id\n if( !($this->nameisfree($id)) ) {\n if( !(ctype_xdigit($id)) or strlen($id)!==12 ) {\n return false;\n }\n return false;\n\t\t}\n return true;\n\t}", "public function testThatWeCanGetTheId()\n {\n $ads = new Categories;\n \n $ads->setId('1');\n \n \n //$this->assertEquals($ads->getId(), '1');\n $this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' );\n\n\n }", "function validate_ID($id)\r\n{\r\n $pattern = \"/^[0-9]{3}$/\";\r\n return preg_match($pattern, $id);\r\n}", "public function testValidateIDProperty()\n {\n $json = '{\"0\": [{\"id\": \"try\", \"title\": \"House\", \"level\": 0, \"children\": [], \"parent_id\": null}]}';\n $response = $this->getJson('/api/v1/json/' . $json);\n $response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY)->assertJson([\n 'success' => false,\n 'message' => 'Invalid ID value',\n ]);\n }", "function studentIDValid($id)\n{\n\t\n\t\n\tif(strlen($id)==8 && ctype_digit($id))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public static function checkId(string $id): bool\n {\n // If strlen is incorrect, then return error\n $len = \\strlen($id);\n return ($len !== 24 || $len !== 12);\n }", "public function testIsValidIdentifier()\n {\n $identifier = \"abcde/fg-hi\";\n $this->assertTrue(Validator::isValidIdentifier($identifier));\n }", "public function test_create_called_returnNewCastilloBetIdWithLength20()\n {\n $expected = 20;\n $actual = CastilloBetId::create();\n $this->assertEquals($expected,strlen($actual->id()));\n }", "public static\tfunction validarID($id){\n \t /*Chequeo si el identificador es numerico*/\n \t $permitidos = \"0123456789\"; \n for ($i=0; $i < strlen($id); $i++)\n { \n if (strpos($permitidos, substr($id,$i,1)) === false)\n { \n /*Si no es así, devuelvo que el usuario es invalido*/\n return FALSE; \n } \n }\n \t return TRUE;\n \t}", "public function testIdId_returnsFalse_ifNumberIsGreaterThanDatatypeMax()\n\t{\n\t\treturn $this->assertFalse(Num::isId(999, 'tiny'));\n\t}", "public function testSettingABadId()\n {\n // create a new PunkAPI object with default properties\n $punkApi = new PunkAPI();\n\n $this->expectException(InvalidArgumentException::class);\n\n // attempt to set the id property with a string containing bad\n // characters\n $punkApi->setIds('34r|3g|dsgsdg|45|23g|bb3|g');\n }", "public function testGoodID() {\n $sfid = new SFID('1234567890abcde');\n $this->assertTrue($sfid instanceof SFID);\n }", "function id_clean($id, $size = 10){\n return intval(substr($id,0,$size));\n }", "function validSAID($id){\n if(strlen($id) === 13){\n return true;\n }\n return false;\n}", "public function testGetId()\n {\n $id = $this->message->getId();\n\n $this->assertContains(gettype($id), ['string', 'integer']);\n }", "function validateID( $inId ) {\n\t//cannot be empty\n\t\n\tif( empty($inId) ) {\n\t\treturn false;\t//Failed validation\n\t}elseif(\t!preg_match(\"/^\\d+$/\", $inId )){\n\t\treturn false;\t//Failed validation\n\t}\telse {\n\t\treturn true;\t//Passes validation\t\n\t}\t\n}", "public function id($data){\n\t\t$valid = false;\n\t\t//8 max digits, 2 min\n\t\t$regexp = \"^[[:digit:]]{1,11}$\";\n\t\t \t\n\t\tif(is_numeric($data) && eregi($regexp, $data))\n\t\t\t$valid = true;\n\t\t \t\t\n\t\treturn $valid; \t\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value from the field product_is_free
public function setProductIsFree($productIsFree){ $this->productIsFree = $productIsFree; }
[ "public function getProduct_attribute_is_free() {\n\t\treturn $this->product_attribute_is_free;\n\t}", "public function setFree()\n {\n $this->status = self::FREE;\n }", "public function getProductIsFree(){\n return $this->productIsFree;\n}", "public function setFree($free)\n {\n $this->_free = (int)$free;\n }", "public function markAsFree()\n {\n $this->isFree = true;\n }", "public static function setFreeShippingForProduct1(): void\n {\n /** @var ObjectManager $objectManager */\n $objectManager = Bootstrap::getObjectManager();\n /** @var Registry $registry */\n $registry = $objectManager->get(Registry::class);\n $salesRule = $registry->registry('cart_rule_free_shipping');\n $data = [\n 'actions' => [\n 1 => [\n 'type' => Combine::class,\n 'attribute' => null,\n 'operator' => null,\n 'value' => '1',\n 'is_value_processed' => null,\n 'aggregator' => 'all',\n 'actions' => [\n 1 => [\n 'type' => Product::class,\n 'attribute' => 'sku',\n 'operator' => '==',\n 'value' => self::PRODUCT_1,\n 'is_value_processed' => false,\n ]\n ]\n ]\n ],\n ];\n $salesRule->loadPost($data);\n $salesRule->save();\n }", "public function getIsFree()\n {\n return $this->isFree;\n }", "public function getIs_free()\n\t {\n\t return $this->is_free;\n\t }", "public function is_free() {\r\n\t\t$is_free = ( ( 'no' == $this->payment ) || ( 0 >= $this->get_price() ) );\r\n\t\treturn apply_filters( 'learn_press_is_free_course', $is_free, $this );\r\n\t}", "public function enable_free_shipping()\n {\n }", "public function getFreeAttribute()\n {\n $free = ($this->price == 0);\n\n return $free;\n }", "public function enable_free_shipping() {\n\t\treturn $this->free_shipping == 'yes' ? true : false;\n\t}", "public function is_price_type_free(): bool {\n\t\treturn LEARNDASH_PRICE_TYPE_FREE === $this->get_pricing_type();\n\t}", "public function setFreeGift ($freeGift) {\n\t$this->freeGift = $this->getClass()->getFieldDefinition(\"freeGift\")->preSetData($this, $freeGift);\n\treturn $this;\n}", "function my_free_shipping( $is_available ) {\n\tglobal $woocommerce;\n\n\t// set the product ids that are ineligible for free shipping\n\t//Owl chair(46), peanut desk(48), stonington chair(165), standing desk(6361),\n\t//bar stools (5679), 4 Leg classic stool(32). Pro 4 legged stool (7187), Walnut Standing Desk (7469)\n // both work stations (7706 and 7707)\n\t$ineligible = array( '46', '48', '165', '6361', '5679','7187', '7469', '7706', '7707' );\n // now only want metal based stools & lumbar support accessory to have free shipping.\n $eligible = array( '5764', '5690', '508', '44', '5704','34', '47' );\n\n\t// get cart contents\n\t$cart_items = $woocommerce->cart->get_cart();\n\n\t// loop through the items looking for one in the ineligible array\n\tforeach ( $cart_items as $key => $item ) {\n\t\tif( !in_array( $item['product_id'], $eligible ) ) {\n\t\t\t $is_available = false;\n\t\t}\n\t}\n\n\t$excluded_states = array( 'AK','HI','GU','PR' );\n\tif( in_array( $woocommerce->customer->get_shipping_state(), $excluded_states ) ) {\n\t\t// Empty the $available_methods array\n\t\t$is_available = false;\n\t}\n\n\t// nothing found return the default value\n\treturn $is_available;\n}", "public function setIsAlwaysFreeShipping( $isAlwaysFreeShipping ) {\n\t\t$this->isAlwaysFreeShipping = $isAlwaysFreeShipping;\n\t}", "public function scopeIsfree($query,$isfree)\n {\n $pivot = $this->products()->getTable();\n\n if($isfree) $query->whereHas('products', function ($q) use ($pivot) {\n $q->where(\"{$pivot}.isFree\", 1);\n });\n }", "public function isFree(): bool\n {\n $price = $this->getPrice();\n\n return is_null($price) || $price === 0;\n }", "private function updateProductDataBoolean($product, $data, $field)\n {\n if ($data[$field] != 0 && $data[$field] != 1) return; // Make sure the value is 0 or 1\n $product->setData($field, $data[$field]); // Set the new data to the product model\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'autowired.App\Entity\Person' shared autowired service.
protected function getAutowired_App_Entity_PersonService() { return $this->services['autowired.App\Entity\Person'] = new \App\Entity\Person(); }
[ "protected function getSymfony_Component_DependencyInjection_PersonService()\n {\n return $this->services['Symfony\\Component\\DependencyInjection\\Person'] = new \\Symfony\\Component\\DependencyInjection\\Person(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Identity']) ? $this->services['Symfony\\Component\\DependencyInjection\\Identity'] : $this->get('Symfony\\Component\\DependencyInjection\\Identity')) && false ?: '_'});\n }", "protected function getApp_Controller_PersonControllerService()\n {\n return $this->services['App\\Controller\\PersonController'] = new \\App\\Controller\\PersonController();\n }", "protected function getPersonneRepositoryService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectRepository.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepositoryInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepository.php';\n include_once \\dirname(__DIR__, 4).'/src/Repository/PersonneRepository.php';\n\n return $this->privates['App\\\\Repository\\\\PersonneRepository'] = new \\App\\Repository\\PersonneRepository(($this->services['doctrine'] ?? $this->getDoctrineService()));\n }", "public function getIdPerson()\n \t{\n \t return $this->getBean()->getIdPerson();\n \t}", "protected function getAppBundle_DataFixtures_ORM_UserDataService()\n {\n return $this->services['AppBundle\\DataFixtures\\ORM\\UserData'] = new \\AppBundle\\DataFixtures\\ORM\\UserData();\n }", "public function getPerson()\n {\n return $this->person;\n }", "public function getPerson()\r\n {\r\n return $this->person;\r\n }", "protected function getAnnotations_ReaderService()\n {\n $this->privates['annotations.reader'] = $instance = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\n\n $instance->addGlobalIgnoredName('required', ($this->privates['annotations.dummy_registry'] ?? $this->getAnnotations_DummyRegistryService()));\n\n return $instance;\n }", "private function getUserService() {\n if (!$this->userService) {\n $this->userService = $this->get('UserService');\n }\n \n return $this->userService;\n }", "private function getUserService() {\n if (!$this->userService) {\n $this->userService = $this->get('UserService');\n }\n\n return $this->userService;\n }", "private function getUserService()\n {\n if (!$this->userService) {\n $this->userService = $this->get('UserService');\n }\n return $this->userService;\n }", "public function getUserService()\n {\n return $this->userService;\n }", "public static function getPersonActivityLogger()\n\t{\n\t\treturn self::get(self::SERVICE_PERSON_ACTIVITY_LOGGER);\n\t}", "public function getPersonActivityLogger()\n\t{\n\t\treturn $this->get(self::SERVICE_PERSON_ACTIVITY_LOGGER);\n\t}", "protected function person()\n {\n try {\n return Person::findOrFail($this->authorizationServer->getResourceOwnerId());\n } catch (ModelNotFoundException $e) {\n throw new PersonNotFoundException;\n }\n }", "protected function getOroEntity_Orm_EntityClassAccessorService()\n {\n return $this->services['oro_entity.orm.entity_class_accessor'] = new \\Oro\\Bundle\\EntityBundle\\ORM\\EntityClassAccessor();\n }", "protected function getAuthorService()\n {\n }", "protected function getAnnotations_ReaderService()\n {\n $a = new \\Doctrine\\Common\\Annotations\\AnnotationRegistry();\n $a->registerUniqueLoader('class_exists');\n\n $this->services['annotations.reader'] = $instance = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\n\n $instance->addGlobalIgnoredName('required', $a);\n\n return $instance;\n }", "protected function getAuthorService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Generators\\\\Schema\\\\Author'] = new \\Yoast\\WP\\SEO\\Generators\\Schema\\Author();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ rekam jenis tes per assesment
public function rekamJenisTes($id){ $jenistes = new TesAssesment($this->registry); $this->view->data_jenis_tes = $jenistes->get_jenis_tes($id); $jenistesasses = new JenisTesAssesment($this->registry); //var_dump($this->view->data_jenis_tes); $assesment = new Assesment($this->registry); $data = $assesment->get($id); $this->view->data_asses = $data; $peserta = new Korektor($this->registry); if(isset($_POST['submit_a'])){ $jenis = $_POST['jenis_tes']; $sub_tes = $_POST['sub_tes']; $bobot = $_POST['bobot']; $kode = strtolower($_POST['kode']); $v = 0; if($bobot==''){ $bobot = JenisTesAssesment::get_bobot($this->registry, $jenis); $x++; } if($jenis==0) $this->view->add_error('jenis_tes','kolom jenis tes harus dipilih!'); if($sub_tes=='') $this->view->add_error('sub_tes','kolom sub tes harus diisi!'); if($bobot!=''){ if(!is_numeric($bobot)) $this->view->add_error('bobot','kolom bobot harus angka!'); } if($kode=='') $this->view->add_error('kode','kolom kode harus diisi!'); if($jenistesasses->is_exist($jenis,$sub_tes)) $this->view->add_error('sub_tes','nama tes ini sudah ada!'); if(!$this->view->is_error()){ $data = array('id_tes_asses'=>$jenis, 'nama_sub_tes'=>$sub_tes, 'bobot'=>$bobot, 'kode'=>$kode); $jenistesasses->add($data); if($x>0){ //echo 'benar'; $edit = array('bobot'=>$bobot); $jenistesasses->edit_where($edit,'id_tes_asses='.$jenis); } $this->view->add_success('success','rekam data jenis tes assesment berhasil!'); //header('location:'.URL.'assesment/jenistes/'.$id); }else{ $this->view->data = array('id_jenis_tes'=>$jenis, 'sub_tes'=>$sub_tes, 'bobot'=>$bobot, 'kode'=>$kode); } } $this->view->judul = 'Rekam Jenis Tes Assesment'; $this->view->id_asses = $id; $this->view->aksi = 'add'; $this->view->render('assesment/jenistes'); }
[ "function jenis_surat(){\n\t\t$a['data']\t= $this->model_admin->tampil_jenis()->result_object();\n\t\t$a['page']\t= \"jenis_surat\";\n\t\t\n\t\t$this->load->view('admin/index', $a);\n\t}", "public function jenisTes(){\n\t\t$jnstes = new JenisTes($this->registry);\n\t\t$data = $jnstes->get();\n\t\t$this->view->count = count($data);\n\t\t$this->view->data = $data;\n\t\t$this->view->aksi ='list';\n\t\t$this->view->render('admin/jenis_tes');\n\t}", "function jenis_surat(){\n\t\t$a['data']\t= $this->model_karyawan->tampil_jenis()->result_object();\n\t\t$a['page']\t= \"jenis_surat\";\n\t\t\n\t\t$this->load->view('karyawan/index', $a);\n\t}", "public function keterangantempatusahacetakAction() {\n $id_permintaan_keterangan_tempat_usaha = $this->_getParam(\"id_permintaan_keterangan_tempat_usaha\");\n $this->view->hasil = $this->surat_serv->getketerangantempatusahacetak($id_permintaan_keterangan_tempat_usaha);\n }", "function pondokanrekap(){\n $tgl = date('Y-m-d');\n $variabel['tanggal'] = $tgl;\n $variabel['data'] = $this->m_rekap_santri_pondokan->datapelajaran();\n $this->layout->renderakd('back-end/akademik/rekap_presensi_pondokan/v_data_pondokan',$variabel,'back-end/akademik/rekap_presensi_pondokan/v_rekap_js');\n }", "public function getJenisKelamin(){\n return self::jenis_kelamin;\n }", "public function persetujuan_kegiatan_staf(){\n\t\t$id_pengguna = $this->session->userdata('id_pengguna');\n\t\t$kode_unit = $this->session->userdata('kode_unit');\n\t\t$kode_jabatan = $this->session->userdata('kode_jabatan');\n\n\t\t$data['title'] = \"Persetujuan Kegiatan Staf | Manajer Sarana dan Prasarana\";\n\t\t$this->data['data_pengajuan_kegiatan'] = $this->Man_sarprasM->get_data_pengajuan_staf($kode_unit, $kode_jabatan)->result();\n\t\t$this->data['UserM'] = $this->UserM ;\n\t\t$this->data['Man_sarprasM'] = $this->Man_sarprasM ;\t\t\n\t\t$this->data['data_diri'] = $this->UserM->get_data_diri()->result()[0]; \t//get data diri buat nampilin nama di pjok kanan\n\t\t$data['body'] = $this->load->view('man_sarpras/persetujuan_kegiatan_staf_content', $this->data, true) ;\n\t\t$this->load->view('man_sarpras/index_template', $data);\n\t}", "public function cetak_statistik()\n\t{\n\t\t$var['telah_memilih'] = $this->db->get_where('pemilih', array('status' => '2'))->num_rows();\n\t\t$var['total'] = $this->db->select('id')->get('pemilih')->num_rows();\n\t\t\n\t\t$var['jabatan'] = $this->Pemilwa_model->get_data_all('jabatan');\n\t\t$var['pemilih'] = $this->Pemilwa_model->get_data_all('pemilih');\n\t\t$var['kandidat'] = $this->Pemilwa_model->get_data_all('kandidat');\n\t\t$var['suara'] = $this->Pemilwa_model->get_data_all('suara');\n\n\t\t$jurusan = array();\n\t\tforeach ($var['jabatan'] as $jab) {\n\t\t\tif ($jab->kode_jabatan == 'HIM') {\n\t\t\tarray_push($jurusan, $jab->kode_dapil);\n\t\t\t}\n\t\t};\n\n\t\tforeach ($jurusan as $jur) {\n\t\t\t$var{$jur} = 0;\n\t\t\t$var{'total'.$jur} = 0;\n\t\t\t$query = 'SELECT status FROM pemilih WHERE dapil LIKE \\'%'.$jur.'%\\'';\n\t\t\tif ($this->db->query($query)) {\t\t\t\t\n\t\t\t\t$status_pemilih = $this->db->query($query)->result();\n\t\t\t\tforeach ($status_pemilih as $sp) {\n\t\t\t\t\t$var{'total'.$jur}++;\n\t\t\t\t\tif ($sp->status == '2') {\n\t\t\t\t\t\t$var{$jur}++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$data['header'] = 'header-print';\n\t\t$data['navbar'] = 'navbar-print';\n\t\t$data['footer'] = 'footer-print';\n\t\t$this->pemilwa_library->display('cetak-statistik', $data, $var);\n\t}", "public function selipkan()\n\t{\n\t\t$obj = $this->db->query(\"SELECT tb_album.*, tb_lemari.*, tb_rak.* FROM tb_album JOIN tb_lemari ON tb_album.no_lemari = tb_lemari.no_lemari JOIN tb_rak ON tb_album.no_rak = tb_rak.no_rak WHERE tb_album.no_album = '{$this->input->get('no_album')}'\")->row();\n\t\t$data = array(\n\t\t\t'title' => 'Tambah Buku Tanah'.DEFAULT_TITLE,\n\t\t\t'lemari' => $this->m_apps->lemari(),\n\t\t\t'hakmilik' => $this->mbpn->jenis_hak(),\n\t\t\t'data' => $obj\n\t\t);\n\t\t$this->template->view('buku/selipkan_buku', $data);\n\t}", "public function abstrak(){\n\t\t$data['title'] = 'JDIH Pemerintahan Kota Bogor';\n\t\t$data['level1'] = $this->m_home->option_peraturan_level(array('level'=>1))->result();\n\t\t$data['slide'] = $this->m_home->tampil_slide()->result();\n\t\t$data['banner'] = $this->m_home->tampil_banner()->result();\n\t\t\n\t\t//id untuk kembali\n\t\t$data['id_peraturan_cat'] = $this->uri->segment(4);\n\n\t\t$id = $this->uri->segment(5);\n\t\t$data['peraturan'] = $this->m_home->view_abstrak_katalog($id);\n\t\t\n\t\t$this->load->view('Abstrak',$data);\n\t}", "public function tampil_manajer()\n\t{\n\t\t$show = $this->M_data_produk;\n\t\t$data = [\n\t\t\t\"produk\" => $show->tampil_data(),\n\t\t\t\"invoice\" => $show->get_no_invoice(),\n\t\t];\n\t\t$this->load->view(\"Backend/data_produk_manajer\", $data);\n\t}", "public static function getJenisPegawaiWithLabel() {\n return ArrayHelper::map(Referensi::find()->andWhere(\"kategori = \".Yii::$app->db->quoteValue(Referensi::KATEGORI_HCM_JENISPEGAWAI))->active()->all(), 'nilai', 'nama');\n }", "public function getJenisKelamin()\n {\n return $this->jenis_kelamin;\n }", "function berinamabuahlain ($jeruk) {\n\t\t$this->nama_buah_lain=$jeruk;\n\t}", "public function Analisis_PeringkatTingkat()\n {\n $this->data['fakultas'] = $this->db->get('fakultas')->result();\n $this->data['active'] = 8;\n $this->data['title'] = 'Admin Sistem | Analisis Peringkat Tingkat Prestasi';\n $this->data['content'] = 'Analisis_PeringkatTingkat';\n $this->load->view('admin_sistem/template/template', $this->data);\n }", "public function tipeJurnal() {\r\n $this->hakAkses(1090);\r\n $this->load->view('dataTipeJurnal', $this->data);\r\n }", "function tambah_keranjang($id_produk, $jumlah_pembelian)\n\t{\n\t\tif(isset($_SESSION['keranjang'][$id_produk]))\n\t\t{\n\t\t\t// session keranjang dengan id_produk yang sama jumlah belinya di tambahkan dengan jumlah beli yang diinput\n\t\t\t$_SESSION['keranjang'][$id_produk]+=$jumlah_pembelian;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$_SESSION['keranjang'][$id_produk] = $jumlah_pembelian;\n\t\t}\n\t\t// mengambil data stok lama\n\t\t$produklama = $this->ambil_produk($id_produk);\n\n\t\t// mengambil stok produk\n\t\t$sisa_stok = $produklama['stok_produk']-$jumlah_pembelian;\n\n\t\t$this->koneksi->query(\"UPDATE produk SET stok_produk='$sisa_stok' WHERE id_produk='$id_produk'\");\n\n\n\t}", "function kurang_depo_stokcito($kodeBrg,$jumlah) {\r\n\t\t\tif (is_numeric($jumlah)) {\r\n\t\t\t\t$jml_sat_kcl=baca_tabel(\"fr_depo_cito\",\"jml_sat_kcl\",\"WHERE kode_brg='\".$kodeBrg.\"'\");\r\n\t\t\t\t$jml_sat_kcl_sekarang = $jml_sat_kcl - $jumlah;\r\n\r\n\t\t\t\t$fld=array();\r\n\t\t\t\t$fld[\"jml_sat_kcl\"] = $jml_sat_kcl_sekarang;\r\n\t\t\t\tupdate_tabel(\"fr_depo_cito\",$fld,\"WHERE kode_brg='\".$kodeBrg.\"'\");\r\n\t\t\t}\r\n\t\t}", "public function getJenisPtk()\n {\n return $this->jenis_ptk;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dequeue the http\Client\Request $request.
public function dequeue($request) { }
[ "public function detach(Request $request) {\n unset($this->requests[$request->getUID() ]);\n return curl_multi_remove_handle($this->mh, $request->getHandle());\n }", "public function detach(Request $request)\n {\n unset($this->requests[$request->getUID()]);\n return curl_multi_remove_handle($this->mh, $request->getHandle());\n }", "public function\n\t\t\trequest_clear() {\n\t\t\t\t$this->request = null;\n\t\t\t}", "public function removeRequest(Request $request) {\n $oid = spl_object_hash($request);\n $result = false;\n\n if(isset($this->requests[$oid])) {\n unset($this->requests[$oid]);\n $result = $request;\n curl_multi_remove_handle($this->handle, $request->getHandle());\n }\n\n return $result;\n }", "public function detach(Request $request)\n {\n unset($this->queue[$request->getUID()]);\n return $this;\n }", "public function addRequest($request)\n {\n $this->queue[] = $request;\n }", "public static function deleteQueuedTransaction($request)\n {\n return self::routeTerminalRequest('POST', '/api/queue/delete', '/api/queue/delete', $request);\n }", "public function addRequest(Request $request){\n $this->requestQueue[] = $request;\n }", "public function getRequestQueue()\n {\n return $this->requestQueue;\n }", "protected function closeRequest()\n\t{\n\t\tif( gettype($this->request) == 'resource' AND get_resource_type($this->request) == 'curl' ){\n\t\t\tcurl_close($this->request);\n\n\t\t} else {\n\t\t\t$this->request = Null;\n\t\t}\n\t}", "protected function closeRequest()\n\t{\n\t\tif( gettype($this->request) == 'resource' AND get_resource_type($this->request) == 'curl' ){\n\t\t\tcurl_close($this->request);\n\t\t} else {\n\t\t\t$this->request = Null;\n\t\t}\n\t}", "private static function removeRequestFromQueue($queue, $requestid)\n {\n self::verifyQueue($queue);\n\n self::telnetOp('jukebox_'.$queue.'.ignore '.$requestid);\n\n unset(self::$queue_cache[$queue]);\n }", "public function httpDelete($request)\n\t\t{\t\n\t\t\t$deleteRequest = $this->httpRequest('receive', 'DELETE', $request, '');\n\t\t\treturn $deleteRequest;\n\t\t}", "private function previousRequest() {\n\t\t$q = $this->request\n\t\t\t\t->ofUserWithReq($this->ids['current'], $this->ids['requested'])\n\t\t\t\t->whereNotIn('status', [9])->get();\n\t\t\n\t\tif(!$q->isEmpty()) {\n\t\t\tforeach($q as $single) {\n\t\t\t\t$single->delete();\n\t\t\t}\n\t\t}\n\t}", "public static function resetRequest()\n {\n self::$request = null;\n }", "public function removeRequest($id)\n {\n unset($this->pendingRequests[$id]);\n }", "public function dequeue () {}", "public function clearRequests()\n {\n $this->pendingRequests = [];\n }", "public function remove(RequestInterface $request)\n {\n if ($this->state == self::STATE_SENDING && $this->multiHandle) {\n curl_multi_remove_handle($this->multiHandle, $request->getCurlHandle()->getHandle());\n }\n\n $this->requests = array_values(array_filter($this->requests, function($req) use ($request) {\n return $req !== $request;\n }));\n\n $this->getEventManager()->notify(self::REMOVE_REQUEST, $request);\n\n // Remove the pool's request association\n $request->getParams()->remove('pool');\n\n return $request;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Meta::normalizeVar() for a property
public function testNormalizeVar_Proprety() { $metaBall = Meta::fromAnnotations(new \ReflectionProperty('MetaTest\FooBar', 'ball')); $this->assertInstanceOf('Jasny\Meta', $metaBall); $this->assertSame('Ball', $metaBall['var']); $metaBike = Meta::fromAnnotations(new \ReflectionProperty('MetaTest\FooBar', 'bike')); $this->assertInstanceOf('Jasny\Meta', $metaBike); $this->assertSame('MetaTest\Bike', $metaBike['var']); }
[ "public function testNormalizeVar_Method()\n {\n $meta = Meta::fromAnnotations(new \\ReflectionMethod('MetaTest\\FooBar', 'read'));\n $this->assertInstanceOf('Jasny\\Meta', $meta);\n $this->assertSame('MetaTest\\Book', $meta['return']);\n }", "public static function normalizeProperty($property)\n {\n //Remove an underscore, so you can do get_date()\n if(substr($property,0,1) == '_')\n {\n $property = substr($property, 1);\n }\n\n $property = lcfirst($property);\n\n// //Deal with famil-'ies', make it 'family'\n// if ('ies' == substr($property, -3)) {\n// $property = substr($property, 0, -3) . 'y';\n// }\n//\n// //Deal with 'friends', make it 'friend'\n// if (preg_match('/[^s]s$/', $property))\n// {\n// $property = substr($property, 0, -1);\n// }\n\n return $property;\n }", "public function testProperty()\n {\n $model = new ModelInstance();\n\n self::assertNull($model->stringProp);\n self::assertNull($model->getProperty('stringProp'));\n\n $model->stringProp = 1;\n self::assertInternalType('string', $model->stringProp);\n self::assertEquals('1', $model->stringProp);\n self::assertInternalType('string', $model->getProperty('stringProp'));\n self::assertEquals('1', $model->getProperty('stringProp'));\n\n $model->stringProp = 1.2;\n self::assertInternalType('string', $model->stringProp);\n self::assertEquals('1.2', $model->stringProp);\n self::assertInternalType('string', $model->getProperty('stringProp'));\n self::assertEquals('1.2', $model->getProperty('stringProp'));\n\n $model->stringProp = 'asdf';\n self::assertInternalType('string', $model->stringProp);\n self::assertEquals('asdf', $model->stringProp);\n self::assertInternalType('string', $model->getProperty('stringProp'));\n self::assertEquals('asdf', $model->getProperty('stringProp'));\n }", "public function propertize($property)\n {\n // Sanitize the string from all characters except alpha numeric.\n return preg_replace('/[^A-Za-z0-9_]+/i', '', $property);\n }", "public function testParseViewModelVariable()\n {\n $app = self::$system->getApplicationById(self::$app_name);\n $view = $app->getViewByName('default');\n $value = $view->getStringValue('$model.id');\n $this->assertEquals(($value instanceof Property), true);\n }", "public function testNormalizeStringReturnValidArray()\n {\n $expected = array(\n 'orange'\n );\n\n $source = 'orange';\n\n $propertiesNormalizer = new PropertiesNormalizer();\n $result = $propertiesNormalizer->normalizeProperties($source);\n\n $this->assertEquals($expected, $result);\n }", "function getRaw( $property );", "public function testInvalidPropertyName()\n {\n $vocabulary = new Vocabulary(VocabularyTest::SCHEMA_ORG_URI);\n new Property('', $vocabulary, 'value');\n }", "public function testConstructHasCorrectProperty(): void\n {\n $this->assertAttributeSame($this->propertyManipulator, 'propertyManipulator', $this->anonymizer);\n }", "public function testProperty()\n {\n $model = new ModelInstance();\n\n self::assertNull($model->floatProp);\n self::assertNull($model->getProperty('floatProp'));\n\n $model->floatProp = 1;\n self::assertInternalType('float', $model->floatProp);\n self::assertEquals(1, $model->floatProp);\n self::assertInternalType('float', $model->getProperty('floatProp'));\n self::assertEquals(1, $model->getProperty('floatProp'));\n\n $model->floatProp = 1.2;\n self::assertInternalType('float', $model->floatProp);\n self::assertEquals(1.2, $model->floatProp);\n self::assertInternalType('float', $model->getProperty('floatProp'));\n self::assertEquals(1.2, $model->getProperty('floatProp'));\n\n $model->floatProp = 'asdf';\n self::assertInternalType('float', $model->floatProp);\n self::assertEquals(0, $model->floatProp);\n self::assertInternalType('float', $model->getProperty('floatProp'));\n self::assertEquals(0, $model->getProperty('floatProp'));\n }", "function detectSpecialProperties() {\n $adsp = array(\n 'titleProp' => 'defaultTitlePropName',\n 'orderingProp' => 'defaultOrderingPropName',\n 'orderGroupProp' => false,\n 'publishedProp' => 'defaultPublishedPropName',\n );\n foreach ($adsp as $myProp => $domainDefault) {\n if ($this->$myProp === '?') {\n $this->$myProp = false;\n if ($domainDefault && isset($this->_domain->$domainDefault) && ($dd = $this->_domain->$domainDefault)) {\n if (!is_array($dd)) $dd = Ac_Util::toArray($dd);\n if ($a = array_intersect($dd, $this->listProperties())) {\n $this->$myProp = array_shift($a);\n }\n }\n }\n }\n if (!strlen($this->titleProp) && $this->_domain->autoDetectTitles) {\n $titleCol = false;\n \n // search for first char/varchar column with length > 1, \n // but prefer unique index char/varchar if found later\n \n foreach ($this->tableObject->listColumns() as $i) { $col = $this->tableObject->getColumn($i);\n if (in_array(strtolower($col->type), array('char', 'varchar')) && $col->width > 1) {\n if ($col->isUnique()) {\n $titleCol = $col->name;\n break;\n } elseif ($titleCol === false) {\n $titleCol = $col->name;\n }\n }\n }\n \n if (strlen($titleCol)) $this->titleProp = $titleCol;\n \n }\n }", "public static function validatedProperty(): string;", "public function test_papi_filter_format_value_property() {\n\t\ttests_add_filter( 'papi/format_value/string', function () {\n\t\t\treturn 'change-format';\n\t\t} );\n\n\t\t$slug = 'heading';\n\t\tadd_post_meta( $this->post_id, $slug, 'papi' );\n\n\t\t$slug_type = papi_f( papi_get_property_type_key( $slug ) );\n\t\tadd_post_meta( $this->post_id, $slug_type, 'string' );\n\n\t\t$heading = papi_field( $this->post_id, $slug );\n\t\t$this->assertEquals( 'change-format', $heading );\n\n\t\t$heading_property = get_post_meta( $this->post_id, $slug_type, true );\n\t\t$this->assertEquals( $heading_property, 'string' );\n\t}", "private function normalizeProperty($property)\n {\n if (!$this->usePrettyPropertyName) return $property;\n $tmp = explode('_', $property);\n if (count($tmp) == 1) return strtoupper($property) == $property ? lcfirst(strtolower($property)) : lcfirst($property);\n foreach ($tmp as $k => $v) \n {\n if (trim($v)) $tmp[$k] = ucfirst(strtolower(trim($v)));\n else unset($tmp[$k]);\n }\n return lcfirst(implode('', $tmp));\n }", "#[@test]\n public function valuesTrimmed() {\n $p= Properties::fromString('\n[section]\ntrim= value1 \n ');\n \n $this->assertEquals('value1', $p->readString('section', 'trim'));\n }", "public function testMainProperty() {\n // Let's enable all Drupal modules in Drupal core, so we test any field\n // type plugin.\n $this->enableAllCoreModules();\n\n /** @var \\Drupal\\Core\\Field\\FieldTypePluginManagerInterface $field_type_manager */\n $field_type_manager = \\Drupal::service('plugin.manager.field.field_type');\n foreach ($field_type_manager->getDefinitions() as $plugin_id => $definition) {\n $class = $definition['class'];\n $property = $class::mainPropertyName();\n if ($property === NULL) {\n continue;\n }\n $storage_definition = BaseFieldDefinition::create($plugin_id);\n $property_definitions = $class::propertyDefinitions($storage_definition);\n $properties = implode(', ', array_keys($property_definitions));\n if (!empty($property_definitions)) {\n $message = sprintf(\"%s property %s found in %s\", $plugin_id, $property, $properties);\n $this->assertArrayHasKey($property, $class::propertyDefinitions($storage_definition), $message);\n }\n }\n }", "function cbf2019_entity_property($variables) {\n return cbf_entity_property($variables);\n}", "public function testInvalidProperty() {\n\t\t$str = new \\Scrivo\\Str(\"test\");\n\t\t$tmp = $str->hatseFlatse;\n\t}", "public function testGetObjectPropertiesIgnoresUnderscores(): void\n {\n $entity = new EntityProxyStub();\n $entity->__initializer__ = true;\n $entity->fill([\n // Due to quirks of the Array search method, the trailing __ is omitted\n '__initializer' => false,\n ]);\n\n self::assertTrue($entity->__initializer__);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get ready to fetch all the commit_log_ports_vuxml for this port
function FetchInitialise($port_id) { # return the number of commits found $sql = " select CLPV.id, CLPV.commit_log_id, CLPV.port_id, CLPV.vuxml_id, vuxml.vid from commit_log_ports_vuxml CLPV, vuxml where CLPV.port_id = $1 and CLPV.vuxml_id = vuxml.id order by CLPV.commit_log_id "; # echo "\$sql='<pre>$sql</pre><br>\n"; $this->result = pg_query_params($this->dbh, $sql, array($port_id)); if (!$this->result) { echo pg_last_error($this->dbh) . " $sql"; } $numrows = pg_num_rows($this->result); return $numrows; }
[ "public function getPortList()\n {\n return $this->getXMLChildsAsArray(\n 'alcatel_73xx_portstatistics', 'port',\n array(\n 'id', 'adm-state', 'opr-state-tx-rate-ds', 'tx-rate-us',\n 'tx-rate-ds', 'cur-op-mode'\n )\n );\n }", "public function fetchAllChangeLogsBase3();", "private static function getCPULoadHistoryOfAllServers() {\n for($i = 1; $i <= 4; $i++) {\n self::getHostId($i);\n self::getItemId();\n self::getLatestEpochTime();\n self::calculateClockTimes();\n self::getHistory($i);\n }\n }", "public function getAffectedPorts();", "public function getAllRevisions()\n {\n // Retrieves username associated with an id. \n $this->ui_ids = array();\n\n /**\n * Retrieves list of previous versions of data dictionary.\n */\n $pid = $_GET[\"pid\"];\n $previous_versions = array();\n $sql = \"select p.pr_id, p.ts_approved, p.ui_id_requester, p.ui_id_approver,\n if(l.description = 'Approve production project modifications (automatic)',1,0) as automatic\n from redcap_metadata_prod_revisions p left join redcap_log_event l\n on p.project_id = l.project_id and p.ts_approved*1 = l.ts\n where p.project_id = $pid and p.ts_approved is not null order by p.pr_id\";\n\n if ($result = $this->query($sql))\n {\n // Cycle through results\n $rev_num = 0;\n $num_rows = $result->num_rows;\n while ($row = $result->fetch_object())\n {\n if ($rev_num == 0)\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Moved to Production\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved,\n );\n }\n else\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Production Revision #$rev_num\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved\n );\n }\n\n if ($rev_num == $num_rows - 1)\n {\n // Current revision will be mapped to timestamp and approver of last row\n $current_revision_ts_approved = $row->ts_approved;\n $current_revision_approver = $this->getUsernameFirstLast($row->ui_id_approver);\n $current_revision_requester = $this->getUsernameFirstLast($row->ui_id_requester);\n $current_revision_automatic = $row->automatic;\n }\n\n $rev_num++;\n }\n\n $result->close();\n \n // Sort by most recent version.\n $previous_versions = array_reverse($previous_versions);\n }\n\n // Shift timestamps, approvers, requesters, and automatic approval down by one,\n // as the correct info for each one is when the previous version was archived. \n $last_key = null;\n foreach($previous_versions as $key => $version)\n {\n if ($last_key !== null)\n {\n $previous_versions[$last_key][\"ts_approved\"] = $previous_versions[$key][\"ts_approved\"];\n $previous_versions[$last_key][\"requester\"] = $previous_versions[$key][\"requester\"];\n $previous_versions[$last_key][\"approver\"] = $previous_versions[$key][\"approver\"];\n $previous_versions[$last_key][\"automatic_approval\"] = $previous_versions[$key][\"automatic_approval\"];\n }\n $last_key = $key;\n }\n\n // Get correct production timestamp,\n // and the person who moved it to production\n if (!empty($previous_versions))\n {\n // Get correct production timestamp\n $sql = \"select production_time from redcap_projects where project_id = $pid\";\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $timestamp = $row->production_time;\n $previous_versions[sizeof($previous_versions)-1][\"ts_approved\"] = $timestamp;\n }\n $result->close();\n }\n\n if (!empty($timestamp))\n {\n // Retrieve person who moved to production, as it's stored separately. \n $sql = \"select u.ui_id from redcap_user_information u, redcap_log_event l\n where u.username = l.user and l.description = 'Move project to production status' and l.project_id = $pid \n and l.ts = '\" . str_replace(array(' ',':','-'), array('','',''), $timestamp) . \"' order by log_event_id desc limit 1\";\n\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $previous_versions[sizeof($previous_versions)-1][\"approver\"] = $this->getUsernameFirstLast($row->ui_id);\n }\n $result->close();\n }\n }\n }\n\n // Add current revision\n if (isset($current_revision_approver) && \n isset($current_revision_ts_approved) && \n isset($current_revision_automatic) && \n isset($current_revision_requester))\n {\n array_unshift($previous_versions, array(\n \"id\" => \"current\",\n \"label\" => \"Production Revision #$rev_num <b>(Current Revision)</b>\",\n \"requester\" => $current_revision_requester,\n \"approver\" => $current_revision_approver,\n \"automatic_approval\" => $current_revision_automatic,\n \"ts_approved\" => $current_revision_ts_approved\n ));\n }\n\n return $previous_versions;\n }", "protected function _getQueryLogs() {\n\t\tif (!class_exists('ConnectionManager', false)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sources = $this->_getSources();\n\t\t$queryLog = array();\n\t\tforeach ($sources as $source) {\n\t\t\t$db = $this->_getSource($source);\n\n\t\t\tif (!method_exists($db, 'getLog')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$queryLog[$source] = $db->getLog(false, false);\n\t\t}\n\n\t\treturn $queryLog;\n\t}", "public function lsChangelogs(): array{\n $this->checkNotConnected();\n $qr = $this->connection->query(\"SELECT * FROM tb_changelog_signatures;\");\n $results = [];\n while($row = $qr->fetch_array()) $results[] = $row;\n return $row;\n }", "public function getLogs()\n {\n $result = $this->mootalib->getLatestMutation();\n $total = 0;\n\n if ($result['status'] == 'success') {\n foreach ($result['logs'] as $log) {\n $this->mootalib->save($log);\n $total++;\n }\n }\n\n echo \"Successfully get $total records from Moota \\n\";\n }", "private function getLogbookData() {\n $strQuery = \"SELECT *\n\t\t\t\t\t FROM \"._dbprefix_.\"mediamanager_dllog\n\t\t\t\t\t WHERE downloads_log_date > ?\n\t\t\t\t\t\t\tAND downloads_log_date <= ?\n\t\t\t\t\t ORDER BY downloads_log_date DESC\";\n\n $arrReturn = $this->objDB->getPArray($strQuery, array($this->intDateStart, $this->intDateEnd), 0, (_stats_nrofrecords_ - 1));\n\n foreach($arrReturn as &$arrOneRow) {\n //Load hostname, if available. faster, then mergin per LEFT JOIN\n $arrOneRow[\"stats_hostname\"] = null;\n $strQuery = \"SELECT stats_hostname\n \t\t FROM \"._dbprefix_.\"stats_data\n \t\t WHERE stats_ip = ?\n \t\t GROUP BY stats_hostname\";\n $arrRow = $this->objDB->getPRow($strQuery, array($arrOneRow[\"downloads_log_ip\"]));\n if(isset($arrRow[\"stats_hostname\"]))\n $arrOneRow[\"stats_hostname\"] = $arrRow[\"stats_hostname\"];\n\n }\n\n return $arrReturn;\n }", "protected function getLibraryVisits() {\n $this->libraryVisits = array();\n\n $sql = \"SELECT\tlibraryID, lastVisitTime\n\t\t\tFROM \tsls\" . SLS_N . \"_library_visit\n\t\t\tWHERE \tuserID = \" . $this->userID;\n $result = WCF::getDB()->sendQuery($sql);\n while ($row = WCF::getDB()->fetchArray($result)) {\n $this->libraryVisits[$row['libraryID']] = $row['lastVisitTime'];\n }\n }", "function getVLANConfiguredPorts ($vlan_ck)\n{\n\t$result = usePreparedSelectBlade\n\t(\n\t\t'SELECT PAV.object_id, PAV.port_name ' .\n\t\t'FROM PortAllowedVLAN AS PAV ' .\n\t\t'INNER JOIN VLANSwitch AS VS ON PAV.object_id = VS.object_id ' .\n\t\t'WHERE domain_id = ? AND vlan_id = ? ' .\n\t\t'ORDER BY PAV.object_id, PAV.port_name',\n\t\tdecodeVLANCK ($vlan_ck)\n\t);\n\t$ret = array();\n\twhile ($row = $result->fetch (PDO::FETCH_ASSOC))\n\t\t$ret[$row['object_id']][] = $row['port_name'];\n\treturn $ret;\n}", "function fetch_connections ()\n\t{\n\t\t// status messages..\n\t\t$statuses = array\n\t\t(\n\t\t\t0 => 'Ok',\n\t\t\t1 => 'Bad'\n\t\t);\n\t\t\n\t\t$conns = array();\n\t\tforeach ($this->_connections as $key => $var)\n\t\t{\n\t\t\t// get connection status\n\t\t\tif (empty($var['status']))\n\t\t\t{\n\t\t\t//\tif (pg_connection_status($var['resource']) === 0)\n\t\t\t//\t{\n\t\t\t//\t\tif (pg_connection_busy($var['resource']))\n\t\t\t//\t\t\t$var['status'] = 'Busy';\n\t\t\t//\t\telse\n\t\t\t//\t\t\t$var['status'] = 'Ok';\n\t\t\t//\t} else\n\t\t\t//\t\t$var['status'] = 'Bad';\n\t\t\t}\n\n\t\t\t// add the data\n\t\t\t$conns[] = array\n\t\t\t(\n\t\t\t\t'name' => $key,\n\t\t\t\t'resource' => (string)$var['resource'],\n\t\t\t\t'status' => $var['status'],\n\t\t\t\t'times' => $var['times'],\n\t\t\t\t'connect_time' => $var['connect_time']\n\t\t\t);\n\t\t}\n\t\treturn $conns;\n\t}", "function export_muc_logs() {\n $request = HTTPRequest::instance();\n $group_id = $request->get('group_id');\n $pm = ProjectManager::instance();\n $project = $pm->getProject($group_id);\n \n $any = $GLOBALS['Language']->getText('global', 'any');\n \n if ($request->exist('log_start_date')) {\n $start_date = $request->get('log_start_date');\n if ($start_date == '') {\n $start_date = $any;\n } \n } else {\n $week_ago = mktime( 0, 0, 0, date(\"m\"), date(\"d\") - 7, date(\"Y\") );\n $start_date = date(\"Y-m-d\", $week_ago);\n }\n \n $end_date = $request->get('log_end_date');\n if ($end_date == '') {\n $end_date = $any;\n }\n \n $mclm = IMMucLogManager::getMucLogManagerInstance();\n $conversations = null;\n try {\n if ($start_date == $any && $end_date == $any) {\n $conversations = $mclm->getLogsByGroupName($project->getUnixName(true)); \n } elseif ($start_date == $any && $end_date != $any) {\n $conversations = $mclm->getLogsByGroupNameBeforeDate($project->getUnixName(true), $end_date);\n } elseif ($start_date != $any && $end_date == $any) {\n $conversations = $mclm->getLogsByGroupNameAfterDate($project->getUnixName(true), $start_date);\n } else {\n $conversations = $mclm->getLogsByGroupNameBetweenDates($project->getUnixName(true), $start_date, $end_date);\n }\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n \n $eol = \"\\n\";\n $col_list = array('date', 'nickname', 'message');\n $lbl_list = array(\n 'date' => $GLOBALS['Language']->getText('plugin_im', 'muc_logs_time'),\n 'nickname' => $GLOBALS['Language']->getText('plugin_im', 'muc_logs_user'),\n 'message' => $GLOBALS['Language']->getText('plugin_im', 'muc_logs_message')\n );\n \n $purifier = Codendi_HTMLPurifier::instance();\n $uh = new UserHelper();\n \n $file_name = 'muc_logs_'.$project->getUnixName();\n header ('Content-Type: text/csv');\n header ('Content-Disposition: filename='.$file_name.'.csv');\n \n if (! $conversations || sizeof($conversations) == 0) {\n echo $GLOBALS['Language']->getText('plugin_im', 'no_muc_logs');\n } else {\n \n // Build CSV header\n foreach($lbl_list as $k => $v) {\n $lbl_list[$k] = SimpleSanitizer::unsanitize($v);\n }\n echo build_csv_header($col_list, $lbl_list).$eol;\n \n // Build CSV content\n foreach ($conversations as $conv) {\n $time = format_date(util_get_user_preferences_export_datefmt(), $conv->getTimestamp()); \n if ($conv->getNickname() != null) {\n $nick = $conv->getNickname();\n } else {\n $nick = '';\n }\n $message = $conv->getMessage();\n \n echo build_csv_record($col_list, array('date'=>$time, 'nickname'=>$nick, 'message'=>$message)).$eol;\n \n }\n }\n\n }", "function fetchBranchVersion() {\r\n $branchId = $this->validateId($this->branchid, \"branchId\");\r\n $changeCount = $this->loadGetInt(\"changes\", FALSE) || 0;\r\n $this->validate();\r\n \r\n $userId = $this->container['user']['User_Id'];\r\n $gaUserId = $this->container['user']['Ga_User_Id'];\r\n \r\n \r\n // FIXME call into getBranchQuipChangesFromPending\r\n return array(500);\r\n }", "protected function _getCommitList()\n {\n if (null !== $this->_commitList) {\n return $this->_commitList;\n }\n\n $output = null;\n $cmd = \"svnlook changed -t '{$this->_transaction}' '{$this->_repository}'\";\n exec($cmd, $output);\n\n $list = array();\n foreach ($output as $item) {\n $pos = strpos($item, ' ');\n $status = substr($item, 0, $pos);\n $file = trim(substr($item, $pos));\n\n $list[$file] = $status;\n }\n\n $this->_commitList = $list;\n return $this->_commitList;\n }", "function misdn_groups_ports() {\n $ret = array();\n\n foreach(misdn_groups_list(1) as $group) {\n $ret[] = 'g:'.$group['name'];\n }\n \n foreach(misdn_ports_list_trunks() as $port) {\n $ret[] = $port['port'];\n }\n \n return $ret;\n}", "function fetchPorts($where='WHERE 1')\n{\n $cfg = $GLOBALS['cfg'];\n $db = $GLOBALS['db'];\n\n # query the database\n $arrPortsDaemons = $db->select(\n \"SELECT {$cfg['tblPort']}.id as pid,\n {$cfg['tblDaemon']}.id as did,\n {$cfg['tblPort']}.*,\n {$cfg['tblDaemon']}.*\n FROM {$cfg['tblPort']}\n LEFT JOIN {$cfg['tblDaemon']}\n ON {$cfg['tblPort']}.daemon_id = {$cfg['tblDaemon']}.id\n $where\n ORDER BY {$cfg['tblPort']}.number ASC\"\n );\n\n # put the person data in it's own array\n $arrPorts = array();\n foreach( $arrPortsDaemons as $entry )\n {\n if( isset($entry['pid']) )\n {\n $entry['daemon'] = $entry;\n }\n array_push($arrPorts, $entry);\n }\n\n return $arrPorts;\n}", "protected function getLogsList()\n {\n $logs = array();\n foreach ($this->getLogs() as $log)\n {\n $connection = $log['connection'];\n $database = $log['database'];\n $collection = $log['collection'];\n unset($log['connection'], $log['database'], $log['collection']);\n\n $logs[] = sprintf(<<<EOF\n<li>\n <p class=\"sfWebDebugDatabaseQuery\"><pre>%s</pre></p>\n <div class=\"sfWebDebugDatabaseLogInfo\">{ connection: %s, database: %s, collection: %s }</div>\n</li>\nEOF\n ,\n sfYaml::dump($log),\n $connection,\n $database,\n $collection\n );\n }\n\n return $logs;\n }", "function get_vlans_to_port($ip_switch, $key_switch=\"private\")\n {\n $retval = array(\"names\"=>array(), \"ports\"=>array());\n $soid = $this->vlan_oid.\".1\";\n if (false === ($walk = snmp2_real_walk($ip_switch, $key_switch, $soid))) return (false);\n foreach ($walk as $oid=>$value)\n {\n $oid = str_replace($soid.\".\", \"\", $oid);\n $retval[\"names\"][$oid] = str_replace(\"\\\"\", \"\", $value);\n }\n $soid = $this->vlan_oid.\".2\";\n if (false === ($walk = snmp2_real_walk($ip_switch, $key_switch, $soid))) return (false);\n foreach ($walk as $oid=>$value)\n {\n $oid = str_replace($soid.\".\", \"\", $oid);\n $ports = $this->hash2ports(str_replace(\" \", \"\", str_replace(\"\\\"\", \"\", $value)));\n if (count($ports) > 0) foreach ($ports as $port) $retval[\"ports\"][$oid][$port] = \"tag\";\n }\n $soid = $this->vlan_oid.\".4\";\n if (false === ($walk = snmp2_real_walk($ip_switch, $key_switch, $soid))) return (false);\n foreach ($walk as $oid=>$value)\n {\n $oid = str_replace($soid.\".\", \"\", $oid);\n $ports = $this->hash2ports(str_replace(\" \", \"\", str_replace(\"\\\"\", \"\", $value)));\n if (count($ports) > 0) foreach ($ports as $port) $retval[\"ports\"][$oid][$port] = \"untag\";\n }\n return ($retval);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is app user Uses the passed in user ID or session key to determine if the user is a user of the application.
public function isAppUser($uid = null) { $args = array(); if ($uid !== null) { $args['uid'] = $uid; } elseif (!empty($this->sessionKey)) { $args['session_key'] = $this->sessionKey; } else { throw new Services_Facebook_Exception('Users.isAppUser ' . 'requires a session key or uid, none provided'); } $result = $this->callMethod('users.isAppUser', $args); return (intval((string)$result) == 1); }
[ "function is_user($user_id) {\n\t\treturn $user_id == $this->Session->read('Auth.User.id');\n\t}", "static public function isUser()\n {\n return isset($_SESSION[self::USER_LOGIN]);\n }", "function isUser()\n{\n if(isset($_SESSION['Access']))\n {\n if($_SESSION[\"Access\"] == \"USER\")\n {\n return true;\n }\n }\n return false;\n}", "function isUserInApp()\n{\n $url_parts = explode('/', $_SERVER['PHP_SELF']);\n\n return in_array('app', $url_parts);\n}", "public function isAuth(){\n return $this->userModel->findSessionId(Session::getId(), Session::get('userId'));\n\t}", "function isUserProfile($userId)\n{\n return isUserLoggedIn() && $userId == $_SESSION['user_id'];\n}", "public function hasUserid()\n {\n return $this->get(self::USERID) !== null;\n }", "public function isUser()\n {\n if($this->getRole() == NULL) return False;\n return $this->getRole() == \"user\";\n }", "function ryzom_app_authenticate(&$user) {\n\t$sess_key = 'app.user';\n\n\t// AppZone uses GET variables 'user' and 'checksum'\n\tif (!empty($_GET['user'])) {\n\t\t$data = $_GET['user'];\n\n\t\t// verify checksum\n\t\tif (defined('RYAPI_APP_KEY') && RYAPI_APP_KEY != '') {\n\t\t\tif (empty($_GET['checksum']) ||\n\t\t\t\t$_GET['checksum'] !== hash_hmac('sha1', $data, RYAPI_APP_KEY)\n\t\t\t) {\n\t\t\t\t$user = 'checksum failed';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if checksum is not verified, then unserialize is potentially unsafe\n\t\t// https://www.owasp.org/index.php/PHP_Object_Injection\n\t\t$data = unserialize(base64_decode($data));\n\n\t\t// verify app url\n\t\tif (defined('RYAPI_APP_URL')) {\n\t\t\t$appurl = RYAPI_APP_URL;\n\t\t\tif ($appurl == '') {\n\t\t\t\t// this will hopefully reconstruct app url that's in AppZone\n\t\t\t\tparse_str($_SERVER['QUERY_STRING'], $params);\n\t\t\t\t// parameters added by ingame browser or AppZone\n\t\t\t\t$keys = array('cid', 'authkey', 'shardid', 'name', 'lang', 'datasetid', 'ig', 'checksum', 'user');\n\t\t\t\tforeach ($keys as $k) {\n\t\t\t\t\tunset($params[$k]);\n\t\t\t\t}\n\t\t\t\t$query = http_build_query($params);\n\n\t\t\t\t$appurl = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$_SERVER['HTTP_HOST'];\n\t\t\t\t$appurl .= substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI']) - strlen($_SERVER['QUERY_STRING']) - 1);\n\t\t\t\t$appurl .= !empty($query) ? '?'.$query : '';\n\t\t\t}\n\n\t\t\tif (empty($data['app_url']) || $data['app_url'] !== $appurl) {\n\t\t\t\t$user = 'app_url failed';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// verify request time\n\t\tif (defined('RYAPI_APP_MAXAGE') && RYAPI_APP_MAXAGE > 0) {\n\t\t\tif (empty($data['timestamp'])) {\n\t\t\t\t$user = 'invalid timestamp';\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$ts = $data['timestamp'];\n\t\t\tif (strstr($ts, ' ')) {\n\t\t\t\tlist($usec, $sec) = explode(' ', $ts);\n\t\t\t\t$ts = (float)$usec + (float)$sec;\n\t\t\t}\n\t\t\t$age = microtime(true) - $ts;\n\t\t\tif ($age > RYAPI_APP_MAXAGE) {\n\t\t\t\t$user = 'timestamp failed';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tunset($data['timestamp']);\n\t\tunset($data['app_url']);\n\n\t\t$_SESSION[$sess_key] = $data;\n\t}\n\n\t// try to restore user from session\n\tif (isset($_SESSION[$sess_key])) {\n\t\t$user = $_SESSION[$sess_key];\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function is_facebook_user_logged_in(){\n\t\treturn $this->session->userdata('current_fb_user_id') != FALSE;\n\t}", "public function isCurrentUser()\n\t{\n\t\treturn Auth::user()->id == $this->id;\n\t}", "public function isUser()\n\t{\n\t\treturn $this->getType() == self::TYPE_USER;\n\t}", "public function userStatus() {\n\t\tif ($this->appStatus() == true) {\n\t\t\tif ($this->_oauthToken != '' && $this->_oauthTokenSecret != '') {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isUser($id) {\n\t\treturn $this->userId === $id;\n\t}", "public static function isLogin() {\n if (Yii::app()->session['email'] && Yii::app()->session['userId']) {\n return true;\n } else {\n return false;\n }\n }", "public function isLoggedIn()\n\t{\n\t\treturn $this->session->has('userId');\n\t}", "static function validApplication($appId, $user=null) {\n\t\t\n\t\t\t$valid = false;\n\t\t\n\t\t\n\t\t\t//valid app ID\n\t\t\tif (is_numeric($appId) && $appId>=0) {\n\t\t\n\t\t\t\t//retrieve user\n\t\t\t\tif (!$user) {\n\t\t\t\t\t$user = Auth::CMSuser()->user();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//valid user\n\t\t\t\tif (isset($user) && is_numeric($user->id) && $user->id>=0) {\n\t\t\t\t\t\n\t\t\t\t\t$result = CMSSecurityPermission::select('id')\n\t\t\t\t\t\t->where('user', '=', $user->id)\n\t\t\t\t\t\t->whereHas('group', function($query) use ($appId) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//user is part of application security group\n\t\t\t\t\t\t\t$query->where('application', '=', $appId);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//at least one permission is specified\n\t\t\t\t\t\t\t$query->where(function($whereQuery) {\n\t\t\t\t\t\t\t\tforeach (CMSAccess::$PERMISSIONS as $permission) {\n\t\t\t\t\t\t\t\t \t$whereQuery->orWhere('permission', 'LIKE', '%\"' . $permission . '\"%');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t})\n\t\t\t\t\t\t->count();\n\t\n\t\t\t\t\t//check user has permission\n\t\t\t\t\t$valid = $result>0;\n\t\t\t\t\t\n\t\t\t\t} //end if (valid user)\n\t\t\n\t\t\t} //end if (valid application ID)\n\t\t\n\t\t\n\t\t\treturn $valid;\n\t\t\t\n\t\t}", "public function isSysUser($userId = false);", "public function isUser()\n {\n return ($this->getType() == 'user');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$original = owners id $catid= category id num
function fm_get_folder_shared_by_cat($original,$catid) { return get_records('fmanager_folders',"owner = $original AND category",$catid); }
[ "public function setCategoryUser()\n {\n $user = JRequest::getInt('newuser', 0);\n $cids = JRequest::getVar('cid', array(), 'post', 'array');\n\n if(!count($cids))\n {\n $this->setError(JText::_('COM_JOOMGALLERY_COMMON_MSG_NO_CATEGORIES_SELECTED'));\n\n return false;\n }\n\n JArrayHelper::toInteger($cids);\n $cid_string = implode(',', $cids);\n\n // Get selected category IDs\n $query = $this->_db->getQuery(true)\n ->select('refid')\n ->from($this->_db->qn(_JOOM_TABLE_MAINTENANCE))\n ->where('id IN ('.$cid_string.')')\n ->where('type != 0');\n $this->_db->setQuery($query);\n if(!$ids = $this->_db->loadColumn())\n {\n $this->setError($this->_db->getErrorMsg());\n\n return false;\n }\n\n // Set the new user\n $query->clear()\n ->update($this->_db->qn(_JOOM_TABLE_CATEGORIES))\n ->set('owner = '.$user)\n ->where('cid IN ('.implode(',', $ids).')');\n $this->_db->setQuery($query);\n if(!$this->_db->query())\n {\n $this->setError($this->_db->getErrorMsg());\n\n return false;\n }\n\n // Update maintenance table\n $query->clear()\n ->update($this->_db->qn(_JOOM_TABLE_MAINTENANCE))\n ->set('owner = '.$user)\n ->where('id IN ('.$cid_string.')')\n ->where('type != 0');\n $this->_db->setQuery($query);\n if(!$this->_db->query())\n {\n $this->setError($this->_db->getErrorMsg());\n\n return false;\n }\n\n return count($cids);\n }", "function remove_computed_category(&$cats, $cat)\n{\n if ( isset($cats[$cat['id_uppercat']]) )\n {\n $parent = &$cats[ $cat['id_uppercat'] ];\n $parent['nb_categories']--;\n\n do\n {\n $parent['count_images'] -= $cat['nb_images'];\n $parent['count_categories'] -= 1+$cat['count_categories'];\n\n if ( !isset($cats[$parent['id_uppercat']]) )\n {\n break;\n }\n $parent = &$cats[$parent['id_uppercat']];\n }\n while (true);\n }\n\n unset($cats[$cat['cat_id']]);\n}", "function copy_category($src_category_id, $dest_category_id, $ctype = \"link\") {\n\n\t\t\t//skip category if it is already a copied one\n\tif (!(in_array($src_category_id, $_SESSION['copied']))) {\n\n\t\t\t$src_category_id = olc_db_prepare_input($src_category_id);\n\t\t\t$dest_category_id = olc_db_prepare_input($dest_category_id);\n\n\t\t\t//get data\n\t\t\t$ccopy_query = xtDBquery(\"SELECT * FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\t\t\t$ccopy_values = olc_db_fetch_array($ccopy_query);\n\n\t\t\t//get descriptions\n\t\t\t$cdcopy_query = xtDBquery(\"SELECT * FROM \".TABLE_CATEGORIES_DESCRIPTION.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\n\t\t\t//copy data\n\t\t\t\n\t\t\t$sql_data_array = array ('parent_id'=>olc_db_input($dest_category_id),\n\t\t\t\t\t\t\t\t\t'date_added'=>'NOW()',\n\t\t\t\t\t\t\t\t\t'last_modified'=>'NOW()',\n\t\t\t\t\t\t\t\t\t'categories_image'=>$ccopy_values['categories_image'],\n\t\t\t\t\t\t\t\t\t'categories_status'=>$ccopy_values['categories_status'],\n\t\t\t\t\t\t\t\t\t'categories_template'=>$ccopy_values['categories_template'],\n\t\t\t\t\t\t\t\t\t'listing_template'=>$ccopy_values['listing_template'],\n\t\t\t\t\t\t\t\t\t'sort_order'=>$ccopy_values['sort_order'],\n\t\t\t\t\t\t\t\t\t'products_sorting'=>$ccopy_values['products_sorting'],\n\t\t\t\t\t\t\t\t\t'products_sorting2'=>$ccopy_values['products_sorting2']);\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t$customers_statuses_array = olc_get_customers_statuses();\n\n\t\tfor ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t$sql_data_array = array_merge($sql_data_array, array ('group_permission_'.$customers_statuses_array[$i]['id'] => $product['group_permission_'.$customers_statuses_array[$i]['id']]));\n\t\t}\n\t\t\t\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\n\t\t\t$new_cat_id = olc_db_insert_id();\n\n\t\t\t//store copied ids, because we don't want to go into an endless loop later\n\t\t\t$_SESSION['copied'][] = $new_cat_id;\n\n\t\t\t//copy / link products\n\t\t\t$get_prod_query = xtDBquery(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\t\t\twhile ($product = olc_db_fetch_array($get_prod_query)) {\n\t\t\t\tif ($ctype == 'link') {\n\t\t\t\t\t$this->link_product($product['products_id'], $new_cat_id);\n\t\t\t\t}\n\t\t\t\telseif ($ctype == 'duplicate') {\n\t\t\t\t\t$this->duplicate_product($product['products_id'], $new_cat_id);\n\t\t\t\t} else {\n\t\t\t\t\tdie('Undefined copy type!');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//copy+rename image\n\t\t\t$src_pic = DIR_FS_CATALOG_IMAGES.'categories/'.$ccopy_values['categories_image'];\n\t\t\tif (is_file($src_pic)) {\n\t\t\t\t$get_suffix = explode('.', $ccopy_values['categories_image']);\n\t\t\t\t$suffix = array_pop($get_suffix);\n\t\t\t\t$dest_pic = $new_cat_id.'.'.$suffix;\n\t\t\t\t@ copy($src_pic, DIR_FS_CATALOG_IMAGES.'categories/'.$dest_pic);\n\t\t\t\txtDBquery(\"SQL_UPDATE categories SET categories_image = '\".$dest_pic.\"' WHERE categories_id = '\".$new_cat_id.\"'\");\n\t\t\t}\n\n\t\t\t//copy descriptions\n\t\t\twhile ($cdcopy_values = olc_db_fetch_array($cdcopy_query)) {\n\t\t\t\txtDBquery(\"INSERT INTO \".TABLE_CATEGORIES_DESCRIPTION.\" (categories_id, language_id, categories_name, categories_heading_title, categories_description, categories_meta_title, categories_meta_description, categories_meta_keywords) VALUES ('\".$new_cat_id.\"' , '\".$cdcopy_values['language_id'].\"' , '\".addslashes($cdcopy_values['categories_name']).\"' , '\".addslashes($cdcopy_values['categories_heading_title']).\"' , '\".addslashes($cdcopy_values['categories_description']).\"' , '\".addslashes($cdcopy_values['categories_meta_title']).\"' , '\".addslashes($cdcopy_values['categories_meta_description']).\"' , '\".addslashes($cdcopy_values['categories_meta_keywords']).\"')\");\n\t\t\t}\n\n\t\t\t//get child categories of current category\n\t\t\t$crcopy_query = xtDBquery(\"SELECT categories_id FROM \".TABLE_CATEGORIES.\" WHERE parent_id = '\".$src_category_id.\"'\");\n\n\t\t\t//and go recursive\n\t\t\twhile ($crcopy_values = olc_db_fetch_array($crcopy_query)) {\n\t\t\t\t$this->copy_category($crcopy_values['categories_id'], $new_cat_id, $ctype);\n\t\t\t}\n\n\t\t}\n\t}", "public function returnUpdateCat() {\n return $this->category_id;\n }", "function copy_category($src_category_id, $dest_category_id, $ctype = \"link\") {\n //skip category if it is already a copied one\n if (!(in_array($src_category_id, $_SESSION['copied']))) {\n $src_category_id = (int)$src_category_id;\n $dest_category_id = (int)$dest_category_id;\n\n //get data\n $ccopy_query = xtc_db_query(\"SELECT * \n FROM \".TABLE_CATEGORIES.\" \n WHERE categories_id = '\".$src_category_id.\"'\");\n $ccopy_values = xtc_db_fetch_array($ccopy_query);\n\n //copy data (overrides)\n $sql_data_array = $ccopy_values;\n\n //new module support\n $sql_data_array = $this->catModules->copy_category($sql_data_array,$src_category_id,$dest_category_id,$ctype);\n \n //set new data\n unset($sql_data_array['categories_id']);\n $sql_data_array['parent_id'] = $dest_category_id;\n $sql_data_array['date_added'] = 'NOW()';\n $sql_data_array['last_modified'] = 'NOW()';\n //get customers statuses and set group_permissions\n //not needed, because group_permissions are in $sql_data_array\n\n //write data to DB\n xtc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\n //get new cat id\n $new_cat_id = xtc_db_insert_id();\n\n //store copied ids, because we don't want to go into an endless loop later\n $_SESSION['copied'][] = $new_cat_id;\n\n //copy / link products\n $get_prod_query = xtc_db_query(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".$src_category_id.\"'\");\n while ($product = xtc_db_fetch_array($get_prod_query)) {\n if ($ctype == 'link') {\n $this->link_product($product['products_id'], $new_cat_id);\n } elseif ($ctype == 'duplicate') {\n $this->duplicate_product($product['products_id'], $new_cat_id);\n } else {\n die('Undefined copy type!');\n }\n }\n\n //copy+rename image\n $src_pic = DIR_FS_CATALOG_IMAGES.'categories/'.$ccopy_values['categories_image'];\n if (is_file($src_pic)) {\n $get_suffix = explode('.', $ccopy_values['categories_image']);\n $suffix = array_pop($get_suffix);\n $dest_pic = $this->image_name($new_cat_id, '', $suffix, $get_suffix, $src_category_id, $ccopy_values);\n if ($dest_pic != '') {\n @copy($src_pic, DIR_FS_CATALOG_IMAGES.'categories/'.$dest_pic);\n @chmod(DIR_FS_CATALOG_IMAGES.'categories/'.$dest_pic, 0644);\n }\n $this->catModules->copy_category_image($src_pic,$dest_pic);\n\n //write to DB\n xtc_db_query(\"UPDATE \".TABLE_CATEGORIES.\" \n SET categories_image = '\".xtc_db_input($dest_pic).\"' \n WHERE categories_id = '\".$new_cat_id.\"'\");\n }\n\n //get descriptions\n $cdcopy_query = xtc_db_query(\"SELECT * \n FROM \".TABLE_CATEGORIES_DESCRIPTION.\" \n WHERE categories_id = '\".$src_category_id.\"'\");\n\n //copy descriptions\n while ($cdcopy_values = xtc_db_fetch_array($cdcopy_query)) {\n $sql_data_array = $cdcopy_values;\n //new module support\n $sql_data_array = $this->catModules->copy_category_desc($sql_data_array,$src_category_id,$dest_category_id,$ctype,$new_cat_id);\n //set new descriptions (overrides)\n $sql_data_array['categories_id'] = $new_cat_id;\n //write descriptions to DB\n xtc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);\n }\n\n //get child categories of current category\n $crcopy_query = xtc_db_query(\"SELECT categories_id \n FROM \".TABLE_CATEGORIES.\" \n WHERE parent_id = '\".$src_category_id.\"'\");\n\n //and go recursive\n while ($crcopy_values = xtc_db_fetch_array($crcopy_query)) {\n $this->copy_category($crcopy_values['categories_id'], $new_cat_id, $ctype);\n }\n }\n }", "function _make_cat_compat(&$category)\n{\n}", "function get_cat_id_from_old_permalink($permalink)\n{\n $query='\nSELECT c.id\n FROM '.OLD_PERMALINKS_TABLE.' op INNER JOIN '.CATEGORIES_TABLE.' c\n ON op.cat_id=c.id\n WHERE op.permalink=\\''.$permalink.'\\'\n LIMIT 1';\n $result = pwg_query($query);\n $cat_id = null;\n if ( pwg_db_num_rows($result) )\n list( $cat_id ) = pwg_db_fetch_row($result);\n return $cat_id;\n}", "function findRealCategory($category, $allCategories){\n\tforeach ($allCategories as $allCategory){\n if ($allCategory[\"id\"] == $category){\n\t $category = $allCategory[\"name\"];\n\t return $allCategory[\"name\"];\n }\n }\n}", "public function getCategoryItdsByOwner($ownerId) {\n\n $query = \"SELECT DISTINCT(`Category`) as Categories,SubCategoryID FROM `bx_points` WHERE `OwnerID`='{$ownerId}'\";\n\n// echo $query;\n\n $result = mysql_query($query);\n\n while ($data = mysql_fetch_assoc($result)) {\n\n $record[] = $data;\n }\n\n return $record;\n }", "function fix_cat_table()\r\n{\r\n global $CONFIG;\r\n\r\n $result = db_query(\"SELECT cid FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1\");\r\n if (mysql_num_rows($result) > 0) {\r\n $set = '';\r\n while ($row = mysql_fetch_array($result)) $set .= $row['cid'] . ',';\r\n $set = '(' . substr($set, 0, -1) . ')';\r\n $sql = \"UPDATE {$CONFIG['TABLE_CATEGORIES']} \" . \"SET parent = '0' \" . \"WHERE parent=cid OR parent NOT IN $set\";\r\n $result = db_query($sql);\r\n }\r\n}", "private function _prepareCategory($category) {\n\n\t\tif (isset($this->_categories[$category->getId()]))\n\t\t{\n\t\t\treturn $this->_categories[$category->getId()];\n\t\t}\n\n\t\t$arrCategory = $category->getData();\n\n\t\tif ( ! ($category->getId() > 1 && isset($arrCategory['name']) && isset($arrCategory['level'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$arrCategory['count'] = 1;\n\t\t$arrCategory['name'] = str_repeat('- ', max(0, $arrCategory['level'] - 1)) . $arrCategory['name'];\n\t\t$arrCategory['cat_ID'] = $category->getId();\n\t\t$arrCategory['term_id'] = $category->getId();\n\t\t$arrCategory['url'] = $category->getUrl($category);\n\n\t\t$this->_categories[$category->getId()] = $arrCategory;\n\n\t\treturn $arrCategory;\n\t}", "function get_category_identification(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_category\n\t\t\t\tLEFT JOIN evs_database.evs_identification\n\t\t\t\tON idf_ctg_id = ctg_id\n\t\t\t\tgroup by ctg_category_detail_en\n\t\t\t\tORDER BY ctg_category_detail_en ASC\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}", "function achieve_get_main_category(&$sqlm)\n{\n $main_cat = array();\n $result = $sqlm->query('SELECT id, name01 FROM dbc_achievement_category WHERE parentid = -1 and id != 1 ORDER BY `order` ASC');\n while ($main_cat[] = $sqlm->fetch_assoc($result));\n return $main_cat;\n}", "function getCatModerated($catid) {\n // assumes db connectino is open\n\n // Get user-moderated categories\n $query = sprintf(\"SELECT userID FROM moderatortocategory WHERE categoryID = '%u'\",\n mysql_real_escape_string($catid));\n $result = mysql_query($query);\n if (mysql_num_rows($result) != 0) {\n $modarray = array();\n $i = 0;\n while ($row = mysql_fetch_assoc($result)) {\n $modarray[$i] = $row['userID'];\n $i++;\n }\n }\n mysql_free_result ($result);\n return $modarray;\n}", "public static function fixCategoryAttributes()\n {\n $db = JFactory::getDBO();\n $query = \"SELECT MAX(rgt) FROM #__categories\";\n $db->setQuery($query);\n $rgt = $db->loadResult();\n\n $query = \"SELECT id FROM #__categories WHERE lft = 0 AND rgt = 0 AND parent_id = 1\";\n $db->setQuery($query);\n $elements = $db->loadObjectList();\n\n foreach($elements as $categoryToFix)\n { \n $tmpLFT = $rgt+1;\n $tmpRGT = $tmpLFT+1;\n $query = \"UPDATE #__categories SET lft = $tmpLFT, rgt = $tmpRGT WHERE id = \".$categoryToFix->id;\n $db->setQuery($query);\n $db->execute();\n $rgt++;\n } \n }", "function findAndReplace($c, $cl)\n{\n\tfor ($i=0; $i<count($cl); $i++)\n\t{\n\t\tif($c->id == $cl[$i]->id)\n\t\t\t$cl[$i]=$c;\n\t}\n\treturn $cl;\n}", "function getNewStockCatId(){\n\t\treturn parent::getNewId(\"stock_catagory\",\"stock_cat_id\");\n\t}", "public function duplicateCategoryRestrictions($originalCategoryId, $newCategoryId)\n {\n $stmt = $this->connection->prepare(\n 'INSERT INTO s_categories_avoid_customergroups (`categoryID`, `customergroupID`)\n SELECT :newCategoryID, `customergroupID`\n FROM s_categories_avoid_customergroups WHERE categoryID = :categoryID'\n );\n $stmt->execute(\n [\n ':newCategoryID' => $newCategoryId,\n ':categoryID' => $originalCategoryId,\n ]\n );\n }", "function alter_article_category( $to, $from ) {\n\t\t$success = FALSE;\n\n\t\tif( check_allowed( 'na_category', $_SESSION[ 'user' ] ) ) {\n\t\t\treturn $success;\n\t\t} // Just making sure we don't get a unwanted access.\n\n\t\t$get_a = \"SELECT * `GO-article` WHERE `category`='$from'\";\n\t\t$res_a = query_db( $get_a );\n\t\twhile( $art = mysql_fetch_assoc( $res_a ) ) {\n\t\t\t$id = $art[ 'id_article' ];\n\t\t\t$alt = \"UPDATE `GO-article` SET `category`='$to' WHERE `category`='$from' AND `id_article`='$id'\";\n\t\t\t$success = query_db( $alt );\n\t\t}\n\n\t\treturn $success;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
evaluate path in Current Project scope
public function currentProject($path){ if(!Runtime::currentProject())/*Project not Set Yet Who is Calling ?*/ debug_print_backtrace(); return $this->evaluate(':'.Runtime::currentProject()->name.'.'.$path); }
[ "public function resolvedPath();", "function in_project_root($path) {\n global $PROJECT_ROOT;\n return $PROJECT_ROOT . '/' . $path;\n}", "protected function setPath(){\n $this->aScope['path'] = $this->parse('path_all');\n }", "public function getLocalPath() {\n }", "public function getContextPath()\n {\n }", "public function getCurrentRelativePath()\n {\n }", "public function getCurrentPaths();", "public function getContextFor($path) : string;", "function app_path_current() {\n return app()->path->current(...func_get_args());\n }", "public function getCurrentFullPath() {}", "protected static function getPathThisScript() {}", "private function pathDefine()\n {\n $path = self::$args['path'] ?? __DIR__;\n define('BASE_PATH', $path);\n }", "public function getDynamicPath();", "public function PathAndUri(){\n\n $evald_path = $this->getPath();\n\n if( $evald_path ){\n\n $import_dirs = array();\n\n if( Less_Environment::isPathRelative($evald_path) ){\n //if the path is relative, the file should be in the current directory\n $import_dirs[ $this->currentFileInfo['currentDirectory'] ] = $this->currentFileInfo['uri_root'];\n\n }else{\n //otherwise, the file should be relative to the server root\n $import_dirs[ $this->currentFileInfo['entryPath'] ] = $this->currentFileInfo['entryUri'];\n\n //if the user supplied entryPath isn't the actual root\n $import_dirs[ $_SERVER['DOCUMENT_ROOT'] ] = '';\n\n }\n\n // always look in user supplied import directories\n $import_dirs = array_merge( $import_dirs, Less_Parser::$options['import_dirs'] );\n\n\n foreach( $import_dirs as $rootpath => $rooturi){\n if( is_callable($rooturi) ){\n list($path, $uri) = call_user_func($rooturi, $evald_path);\n if( is_string($path) ){\n $full_path = $path;\n return array( $full_path, $uri );\n }\n }else{\n $path = rtrim($rootpath,'/\\\\').'/'.ltrim($evald_path,'/\\\\');\n\n if( file_exists($path) ){\n $full_path = Less_Environment::normalizePath($path);\n $uri = Less_Environment::normalizePath(dirname($rooturi.$evald_path));\n return array( $full_path, $uri );\n }\n }\n }\n }\n }", "public function getExecutionPath ()\n {\n return self::$execution_path;\n\n }", "public function relativePagePath();", "protected function evaluatePath($compiledFile, $variables)\n {\n ob_start();\n\n // note, the variables are extracted locally inside this method,\n // they are not global variables :-3\n extract($variables);\n // We'll evaluate the contents of the view inside a try/catch block so we can\n // flush out any stray output that might get out before an error occurs or\n // an exception is thrown. This prevents any partial views from leaking.\n\n try {\n include $compiledFile;\n } catch (Exception $e) {\n $this->handleViewException($e);\n }\n return ltrim(ob_get_clean());\n }", "public function resolveLocalPath($path);", "public function environmentPath()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if "rating" has been set
public function hasRating() : bool;
[ "public function has_rating() {\n return (bool) $this->get_rating();\n }", "public function setRating($rating) {$this->rating = $rating;}", "public static function is_enable_rating()\n {\n $option = get_option('woocommerce_enable_review_rating');\n return ($option == \"yes\");\n }", "function wc_review_ratings_enabled() {\n\t\treturn wc_reviews_enabled() && 'yes' === get_option( 'woocommerce_enable_review_rating' );\n\t}", "public function setRating($rating);", "public function testHasValidRating()\n {\n $object = new Rating();\n $object->setRating(2000);\n\n $this->assertTrue(\n $object->hasValidRating(),\n sprintf(\"Expected result not found. Rating: '%s'\", $object->getRating()\n )\n );\n }", "public function showRate() {\n return $this->getRatingStatus() != AW_Vidtest_Model_System_Config_Source_Rating::STATUS_DISABLED;\n }", "public function setRating($rating)\r\n {\r\n $this->_rating = $rating;\r\n }", "private function isRated()\n\t{\n\t\t$rate = $this->rates()->find( Request()->user()->id);\n\t\treturn $rate ? $rate->pivot->rate : 0;\n\t}", "public function isPositiveRating() {\r\n\t\treturn $this->get(\"PositiveRating\") == \"t\";\r\n\t}", "public function isDriverReviewGiven() {\n //we dont care about comment because we know its not our responsibility: both comment and rating are mandatory\n if ($this->reviewDriverRating != null && $this->reviewDriverRating > 0) {\n return true;\n }\n return false;\n }", "public function isRated(){\n\t\t$ratings = new SnRatings();\n\t\t\n\t\t$ratings->ID_OWNER = $this->ID_COMPANY;\n\t\t\n\t\t$ratings->OwnerType = 'company';\n\t\t$player = User::getUser();\n\t\tif($player){\n\t\t\t$ratings->ID_FROM = $player->ID_PLAYER;\n\t\t\tif($ratings->getOne())\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function has_rating_aggregate() : bool {\n return $this->get_rating_aggregate() != RATING_AGGREGATE_NONE;\n }", "function process_rating()\n\t{\n\t\tglobal $TSFE;\n\t\t$ratingsArr = t3lib_div::_POST('rating');\n\t\t$real_rating = $this->comp_weightedRating($this->extensionKey, $this->version);\n\t\t// if ratings cache is outdated update it\n\n\n\t\tif ($real_rating != $this->extRow['rating']) {\n\t\t\t$this->db_cache_rating($this->extensionKey, $this->version);\n\t\t\t$TSFE->clearPageCacheContent();\n\n\t\t}\n\n\t\tif ($ratingsArr && $this->canBeRated()) {\n\t\t\t$res = $this->db_saveRating($ratingsArr, t3lib_div::_POST('notes'), $this->username);\n\t\t\tif ($res) {\n\t\t\t\t$TSFE->clearPageCacheContent();\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function getRating(){\n return $this->rating;\n }", "public function isRated() {\n $rating = $this->getTable()->getRating();\n return $rating->count() > 0 ? true : false;\n }", "public function issetAvRating($index)\n {\n return isset($this->avRating[$index]);\n }", "private function age_gate_required() {\n\t\tif ( isset( $this->video->age_rating ) && $this->video->age_rating >= 17 ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function setRating($rating) {\n switch($rating) {\n case \"G\":\n $this->rating = $rating;\n break;\n case \"PG\":\n $this->rating = $rating;\n break;\n case \"PG-13\":\n $this->rating = $rating;\n break;\n case \"R\":\n $this->rating = $rating;\n break;\n case \"NR\":\n $this->rating = $rating;\n break;\n default:\n $this->rating = \"NR\";\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
path : GET cables/config/eqpoteauxerdf/form
public function getFormAction(){ $norm = $this->get('normalizer'); // Définition de la liste de sélection #Nbre d'équipement $repo = $this->getDoctrine()->getRepository('PNVCablesBundle:Dico\DicoNbEquipements'); $dico1 = $repo->findAll(array()); $nbrEq = array(); foreach($dico1 as $d1){ $nbrEq[] = $norm->normalize($d1, array()); } // Définition de la liste de sélection #Type d'équipement $repo = $this->getDoctrine()->getRepository('PNVCablesBundle:Dico\DicoTypeEquipementPoteau'); $dico2 = $repo->findAll(array()); $typEq = array(); foreach($dico2 as $d2){ $typEq[] = $norm->normalize($d2, array()); } $file = file_get_contents(__DIR__ . '/../Resources/clientConf/TEquipementsPoteauxErdf/form.yml'); $out = Yaml::parse($file); // Initialisation des listes de sélection dans le formulaire de création #Voir form.yml foreach($out['groups'] as &$group){ foreach($group['fields'] as &$field){ if(!isset($field['options'])){ $field['options'] = array(); } if($field['name'] == 'id_nb_equipements'){ $field['options']['choices'] = $nbrEq; } if($field['name'] == 'id_type_equipement_poteau'){ $field['options']['choices'] = $typEq; } } } return new JsonResponse($out); }
[ "public function get_form_config();", "function onlinepdf_service_configuration_form() {\n $form = array();\n\n $form['onlinepdf_winserver'] = array (\n '#type' => 'fieldset',\n '#title' => t('Windows slave server SSH settings'),\n );\n $form['onlinepdf_winserver']['onlinepdf_winserver_ip'] = array(\n '#type' => 'textfield',\n '#title' => t('IP address remote worker'),\n '#field_suffix' => t('Ip_v4 address'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_winserver_ip'),\n '#description' => t('SSH ip_v4 address'),\n );\n $form['onlinepdf_winserver']['onlinepdf_winserver_user'] = array(\n '#type' => 'textfield',\n '#title' => t('Username SSH access'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_winserver_user'),\n '#description' => t('Credentials WinSSH remote worker'),\n );\n $form['onlinepdf_winserver']['onlinepdf_winserver_password'] = array(\n '#type' => 'password',\n '#title' => t('Password SSH access'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_winserver_password'),\n '#description' => t('Credentials WinSSH remote worker'),\n );\n $form['onlinepdf_conversion_limits'] = array (\n '#type' => 'fieldset',\n '#title' => t('Onlinepdf conversion limits'),\n );\n $form['onlinepdf_conversion_limits']['onlinepdf_max_jpg_resolution'] = array(\n '#type' => 'textfield',\n '#title' => t('Max. JPG resolution'),\n '#field_suffix' => t('Megapixels'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_max_jpg_resolution'),\n '#description' => t('Max JPG resolution created in conversion.'),\n );\n $form['onlinepdf_conversion_limits']['onlinepdf_max_age'] = array(\n '#type' => 'textfield',\n '#title' => t('Max. age'),\n '#field_suffix' => t('seconds'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_max_age', 3200),\n '#description' => t('The age in seconds before anonymous data and temp files are deleted.'),\n );\n $form['onlinepdf_conversion_limits']['onlinepdf_max_load'] = array(\n '#type' => 'textfield',\n '#title' => t('Max. system load'),\n '#field_suffix' => t('seconds'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_max_load', 8),\n '#description' => t('Maximum system load to allow system operations.'),\n );\n $form['onlinepdf_conversion_limits']['onlinepdf_max_5min_load'] = array(\n '#type' => 'textfield',\n '#title' => t('Max. system load'),\n '#field_suffix' => t('seconds'),\n '#required' => true,\n '#default_value' => variable_get('onlinepdf_max_5min_load', 16),\n '#description' => t('Maximum 5 minute avg system load to allow system operations.'),\n );\n\n return system_settings_form($form);\n}", "public function config_form();", "public function getFormAction(){\n // Select liste pour filtre #Type d'équipement \n $filter = $this->get('filterService');\n $typEq = $filter->get_typeEquipTroncons();\n\n $file = file_get_contents(__DIR__ . '/../Resources/clientConf/TEquipementsTronconsErdf/form.yml');\n $out = Yaml::parse($file);\n\n // Initialisation des listes de sélection dans le formulaire de création #Voir form.yml \n foreach($out['groups'] as &$group){\n foreach($group['fields'] as &$field){\n if(!isset($field['options'])){\n $field['options'] = array();\n }\n if($field['name'] == 'id_type_equipement_troncon'){\n $field['options']['choices'] = $typEq;\n }\n }\n }\n\n return new JsonResponse($out);\n }", "function _wget_static_path_contentform(array &$form, FormStateInterface $form_state) {\n// print '<pre>'; print_r(\"_wget_static_path_contentform\"); print '</pre>'; exit;\n // Access Query parameters.\n $query_params = UrlHelper::filterQueryParameters();\n $default = isset($query_params['url']) ? $query_params['url'] : NULL;\n $form['wget_static_content']['path'] = array(\n '#type' => 'textfield',\n '#title' => t('Enter internal path'),\n '#default_value' => $default,\n '#element_validate' => array('wget_static_path_validate'),\n '#required' => TRUE,\n );\n $form['wget_static']['#default_tab'] = 'edit-wget-static-settings';\n }", "public function getForm();", "public function getFormAction()\n {\n\t\treturn $this->getUrl('preform/information/index', ['_secure' => true]);\n }", "public function getFormAction(){\r\n return $this->getUrl(self::URL_PATH);\r\n }", "public function getFormAction()\n {\n return $this->getUrl('zirconprocessing/catalogrequest');\n }", "public function formAction() {\n\n\t\t$this->_helper->layout()->disableLayout();\n\n\t\t//Recupera os parametros\n\t\t$arDados = $this->_getAllParams();\n\n\t\t$form = $this->getForm($arDados);\n\n\t\t$this->view->form = $form;\n\t\treturn $this->render('form');\n\t}", "public function getConfigurationForm();", "public function getFormPath()\n {\n if(str_replace('Dotpay_', '', $this->id) == \"dotpay\"){\n $methodname = \"standard\";\n }else {\n $methodname = str_replace('Dotpay_', '', $this->id);\n }\n\n return WOOCOMMERCE_DOTPAY_GATEWAY_DIR . 'form/' . $methodname . '.phtml';\n }", "public function getWebform();", "static function formsBrowse($form){\n\n\t\t$modelName = kumbia::get_model_name($form['source']);\n\t\t$config = Config::read(\"environment.ini\");\n\t\t$mode = kumbia::$models[$modelName]->get_mode();\n\t\t$config = $config->$mode;\n\n\t\tGenerator::forms_print(\"&nbsp;</center><br><table cellspacing=0 align='center' cellpadding=5>\n\t<tr bgcolor='#D0D0D0' style='border-top:1px solid #FFFFFF'>\");\n\n\t\t$controller = Router::get_controller();\n\t\t$app = Router::get_active_app();\n\t\tif($app){\n\t\t\t$app_controller = $app.\"/\".$controller;\n\t\t} else {\n\t\t\t$app_controller = $controller;\n\t\t}\n\n\t\t$browseSelect = \"select \";\n\t\t$browseFrom = \" from \".$form['source'];\n\t\t$browseWhere = \" Where 1 = 1\";\n\t\t$broseLike = \"\";\n\t\t$source = $form['source'];\n\t\t$nalias = 1;\n\t\t$first = false;\n\t\tforeach($form['components'] as $name => $component){\n\t\t\tif(!isset($component['notBrowse'])){\n\t\t\t\t$component['notBrowse'] = false;\n\t\t\t}\n\t\t\tif(!isset($component['browseCaption'])){\n\t\t\t\t$component['browseCaption'] = \"\";\n\t\t\t}\n\t\t\tif(!isset($component['class'])){\n\t\t\t\t$component['class'] = \"\";\n\t\t\t}\n\t\t\tif(($component['type']!='hidden')&&(!$component['notBrowse'])){\n\t\t\t\tif($component['browseCaption']){\n\t\t\t\t\tGenerator::forms_print(\"<td align='center' valign='bottom' class='browseHead'>\n <table><tr><td align='center'><a href='\".self::doBrowseLocation($name, $form['source']).\"'>\".$component['browseCaption'].\"</a></td>\n <td>\".self::doTypeBrowseLocation($name, $form['source']).\"</td></tr></table></td>\\r\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tGenerator::forms_print(\"<td align='center' valign='bottom'>\n <table><tr><td align='center'><a href='\".self::doBrowseLocation($name, $form['source']).\"'>\".$component['caption'].\"</a></td>\n <td>\".self::doTypeBrowseLocation($name, $form['source']).\"</td></tr></table></td>\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(($component['type']=='combo')&&($component['class']=='dynamic')){\n\t\t\t\tif(!isset($component['notPrepare'])||$component['notPrepare']){\n\t\t\t\t\tif($first) {\n\t\t\t\t\t\t$browseSelect.=\",\";\n\t\t\t\t\t} else $first = true;\n\n\t\t\t\t\tif(strpos(\" \".$browseFrom, $component['foreignTable'])){\n\t\t\t\t\t\t$alias = \"t\".$nalias;\n\t\t\t\t\t\t$nalias++;\n\t\t\t\t\t\t$browseFrom.=\",\".$component['foreignTable'].\" \".$alias;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$browseFrom.=\",\".$component['foreignTable'];\n\t\t\t\t\t\t$alias = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tif(strpos($component['detailField'], \"(\")){\n\t\t\t\t\t\t$browseSelect.=$component['detailField'].\" as $name, $source.$name as pk_$name\";\n\t\t\t\t\t\t$browseLike.=\" or {$component['detailField']} like '%{$_GET['q']}%'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!$alias){\n\t\t\t\t\t\t\t$browseSelect.=$component['foreignTable'].\".\".$component['detailField'].\" as $name, $source.$name as pk_$name\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$browseSelect.=$alias.\".\".$component['detailField'].\" as $name, $source.$name as pk_$name\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($component[\"extraTables\"])&&$component[\"extraTables\"]){\n\t\t\t\t\t\t$browseFrom.=\",\".$component[\"extraTables\"];\n\t\t\t\t\t}\n\t\t\t\t\tif($component['column_relation']){\n\t\t\t\t\t\tif($alias){\n\t\t\t\t\t\t\t$browseWhere.=\" and \".$alias.\".\".$component['column_relation'].\" = \".$form['source'].\".\".$name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$browseWhere.=\" and \".$component['foreignTable'].\".\".$component['column_relation'].\" = \".$form['source'].\".\".$name;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$browseWhere.=\" and \".$component['foreignTable'].\".\".$name.\" = \".$form['source'].\".\".$name;\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($component[\"whereCondition\"])&&$component['whereCondition']){\n\t\t\t\t\t\t$browseWhere.=\" and \".$component['whereCondition'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(($component['class']=='static')&&($component['type']=='combo')){\n\t\t\t\t\tif($first) {\n\t\t\t\t\t\t$browseSelect.=\",\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$first = true;\n\t\t\t\t\t}\n\t\t\t\t\tif($config->database->type=='pgsql'){\n\t\t\t\t\t\t$browseSelect.=\"case \";\n\t\t\t\t\t}\n\t\t\t\t\tif($config->database->type=='mysql'){\n\t\t\t\t\t\tfor($i=0;$i<=count($component['items'])-2;$i++){\n\t\t\t\t\t\t\t$browseSelect.=\"if(\".$form['source'].\".\".$name.\"='\".$component['items'][$i][0].\"', '\".$component['items'][$i][1].\"', \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($config->database->type=='pgsql'){\n\t\t\t\t\t\tfor($i=0;$i<=count($component['items'])-1;$i++){\n\t\t\t\t\t\t\t$browseSelect.=\" when \".$form['source'].\".\".$name.\"='\".$component['items'][$i][0].\"' THEN '\".$component['items'][$i][1].\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($config->database->type=='mysql'){\n\t\t\t\t\t\t$browseSelect.=\"'\".$component['items'][$i][1].\"')\";\n\t\t\t\t\t\tfor($j=0;$j<=$i-2;$j++) {\n\t\t\t\t\t\t\t$browseSelect.=\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($config->database->type=='pgsql'){\n\t\t\t\t\t\t$browseSelect.=\" end \";\n\t\t\t\t\t}\n\t\t\t\t\t$browseSelect.=\" as $name\";\n\t\t\t\t} else {\n\t\t\t\t\t\tif($first) {\n\t\t\t\t\t\t\t$browseSelect.=\",\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$first = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$browseSelect.=$form['source'].\".$name\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$brw = $browseWhere;\n\t\tif(!isset($_REQUEST['typeOrd'])) {\n\t\t\t$_REQUEST['typeOrd'] = \"asc\";\n\t\t}\n\t\tif(!isset($_REQUEST['orderBy'])){\n\t\t\tActiveRecord::sql_item_sanizite($_REQUEST['typeOrd']);\n\t\t\t$browseSelect.= $browseFrom.$browseWhere.\" Order By 1 \".$_REQUEST['typeOrd'];\n\t\t} else {\n\t\t\tActiveRecord::sql_item_sanizite($_REQUEST['typeOrd']);\n\t\t\tActiveRecord::sql_sanizite($_REQUEST['orderBy']);\n\t\t\t$browseSelect.= $browseFrom.$browseWhere.\" Order By \".$_REQUEST['orderBy'].\" \".$_REQUEST['typeOrd'];\n\t\t}\n\n\t\tif(!isset($_REQUEST['limBrowse'])){\n\t\t\t$_REQUEST['limBrowse'] = 0;\n\t\t} else {\n\t\t\t$_REQUEST['limBrowse'] = intval($_REQUEST['limBrowse']);\n\t\t}\n\n\t\tif(!isset($_REQUEST['numBrowse'])){\n\t\t\t$_REQUEST['numBrowse'] = 10;\n\t\t} else {\n\t\t\t$_REQUEST['numBrowse'] = intval($_REQUEST['numBrowse']);\n\t\t}\n\n\t\tif(isset($_REQUEST['limBrowse'])&&isset($_REQUEST['numBrowse'])){\n\t\t\tif($config->database->type=='mysql'){\n\t\t\t\t$browseSelect.=\" limit {$_REQUEST['limBrowse']},{$_REQUEST['numBrowse']}\";\n\t\t\t}\n\t\t\tif($config->database->type=='pgsql'){\n\t\t\t\t$browseSelect.=\" offset {$_REQUEST['limBrowse']} limit {$_REQUEST['numBrowse']}\";\n\t\t\t}\n\t\t}\n\t\tGenerator::forms_print(\"<td align='center'colspan='2' valign='bottom'><table><tr><td align='center'>Acciones</td></tr></table></td>\");\n\n\t\tif($db = db::raw_connect(\"mode: $mode\")){\n\t\t\t$q = $db->query($browseSelect);\n\t\t\tif($q===false) {\n\t\t\t\tFlash::error($db->error());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$color1 = \"browse_primary\";\n\t\t\t$hoverColor1 = \"browse_primary_active\";\n\t\t\t$color2 = \"browse_secondary\";\n\t\t\t$hoverColor2 = \"browse_secondary_active\";\n\n\t\t\t$color = $color1;\n\t\t\t$hoverColor = $hoverColor1;\n\n\t\t\tif($db->num_rows($q)){\n\t\t\t\t$nTr = 0;\n\t\t\t\t$queryBrowse = \"select count(*) $browseFrom $brw\";\n\t\t\t\t$qq = $db->query($queryBrowse);\n\t\t\t\t$num = $db->fetch_array($qq);\n\t\t\t\t$num = $num[0];\n\t\t\t\twhile($row = $db->fetch_array($q)){\n\t\t\t\t\tGenerator::forms_print(\"</tr>\\r\\n<tr id='nTr$nTr' class='$color'>\");\n\t\t\t\t\tforeach ($form['components'] as $name => $component) {\n\t\t\t\t\t\tif(!isset($component['notBrowse'])){\n\t\t\t\t\t\t\t$component['notBrowse'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isset($component['format'])){\n\t\t\t\t\t\t\t$component['format'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(($component['type']!='hidden')&&(!$component['notBrowse'])){\n\t\t\t\t\t\t\tif($component['format']=='money'){\n\t\t\t\t\t\t\t\t$row[$name] = \"\\$&nbsp;\".number_format($row[$name], 0, '.', ',');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($component['type']!='image'){\n\t\t\t\t\t\t\t $cadena;\n\t\t\t\t\t\t\t\tGenerator::forms_print(\"<td align='center' style='border-left:1px solid #D1D1D1'\n onmouseover='$(\\\"nTr$nTr\\\").className=\\\"$hoverColor\\\"'\n onmouseout='$(\\\"nTr$nTr\\\").className=\\\"$color\\\"'>\");//.$row[$name].\"</td>\");\n if(isset($component['attributes']['sizeBrowse'])){\n $cadena = self::cut_string($row[$name], $component['attributes']['sizeBrowse']);\n } else {\n $cadena = $row[$name];\n }\n Generator::forms_print($cadena.\"</td>\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tGenerator::forms_print(\"<td align='center' style='border-left:1px solid #D1D1D1'\n onmouseover='$(\\\"nTr$nTr\\\").className=\\\"$hoverColor\\\"'\n onmouseout='$(\\\"nTr$nTr\\\").className=\\\"$color\\\"'\n ><img src='\".KUMBIA_PATH.\"img/\".urldecode($row[$name]).\"' style='border:1px solid black;width:128;height:128' alt=''></td>\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$nTr++;\n\t\t\t\t\t$pk=self::doPrimaryKey($form, $row);\n\t\t\t\t\tif(!$form['unableUpdate']){\n\t\t\t\t\t\tGenerator::forms_print(\"<td style='border-left:1px solid #D1D1D1'><img src='\".KUMBIA_PATH.\"img/edit.gif' title='Editar este Registro' style='cursor:pointer' onclick='window.location=\\\"\".KUMBIA_PATH.$app_controller.\"/query/&amp;$pk\\\"' alt=''/></td>\");\n\t\t\t\t\t}\n\t\t\t\t\tif(!$form['unableDelete']){\n\t\t\t\t\t\tGenerator::forms_print(\"<td style='border-left:1px solid #D1D1D1'><img src='\".KUMBIA_PATH.\"img/delete.gif' title='Borrar este Registro' style='cursor:pointer' onclick='if(confirm(\\\"Seguro desea borrar este Registro?\\\")) window.location=\\\"\".KUMBIA_PATH.$app_controller.\"/delete/&amp;$pk\\\"' alt=''/></td>\");\n\t\t\t\t\t}\n\t\t\t\t\tif($color==$color2) $color = $color1; else $color = $color2;\n\t\t\t\t\tif($hoverColor==$hoverColor2) $hoverColor = $hoverColor1; else $hoverColor = $hoverColor2;\n\t\t\t\t}\n\t\t\t\t$m = $_REQUEST['limBrowse'] ? $_REQUEST['limBrowse']: 1;\n\t\t\t\tif(isset($_GET['orderBy'])&&$_GET['orderBy']) {\n\t\t\t\t\t$oBy = \"&amp;orderBy=\".$_GET['orderBy'];\n\t\t\t\t} else {\n\t\t\t\t\t$oBy = \"\";\n\t\t\t\t}\n\t\t\t\tGenerator::forms_print(\"</tr><tr><td bgcolor='#D0D0D0'\n\t\t\t style='border-left:1px solid #D1D1D1;border-right:1px solid #D1D1D1' align='center'>\n\t\t\t<table>\n\t\t\t <tr>\n\t\t\t <td>\n\t\t\t $m&nbsp;de&nbsp;$num:\n\t\t\t </td>\n\t\t\t <td><a href='\".KUMBIA_PATH.$app_controller.\"/browse/&amp;limBrowse=0&amp;numBrowse=10$oBy'\n\t\t\t title='Ir al Principio'\n\t\t\t ><img border='0' width=6 height=9 src='\".KUMBIA_PATH.\"img/first.gif' alt=''/></a></td>\n\t\t\t <td><a\n\t\t\t href='\".KUMBIA_PATH.$app_controller.\"/browse/&amp;limBrowse=\".($_REQUEST['limBrowse']-10<0 ? $_REQUEST['limBrowse'] : $_REQUEST['limBrowse']-10).\"&amp;numBrowse=\".($_REQUEST['numBrowse']).\"$oBy'\n\t\t\t title='Ir al Anterior'\n\t\t\t ><img border=0 width=5 height=9 src='\".KUMBIA_PATH.\"img/prev.gif' alt=''/></a></td>\n\t\t\t <td>\n\t\t\t <a href='\".KUMBIA_PATH.$app_controller.\"/browse/&amp;limBrowse=\".($_REQUEST['limBrowse']+10>$num ? $num-10<0 ? 0 : $num-10 : $_REQUEST['limBrowse']+10).\"&amp;numBrowse=\".($_REQUEST['numBrowse']).\"$oBy'\n\t\t\t title='Ir al Siguiente $num'\n\t\t\t ><img border=0 width=5 height=9 src='\".KUMBIA_PATH.\"img/next.gif' alt=''/></a></td>\n\t\t\t <td>\n\t\t\t <a href='\".KUMBIA_PATH.$app_controller.\"/browse/&amp;limBrowse=\".($num-10<0 ? 0 : $num - 10).\"&amp;numBrowse=\".($_REQUEST['numBrowse']).\"$oBy'\n\t\t\t title='Ir al Ultimo'\n\t\t\t ><img border=0 width=6 height=9\n\t\t\t src='\".KUMBIA_PATH.\"img/last.gif' alt=''/></a></td>\n\t\t\t </tr>\n\t\t\t</table>\n\t\t\t</td></tr>\");\n\t\t\t\tGenerator::forms_print(\"</table>\");\n\t\t\t} else {\n\t\t\t\tGenerator::forms_print(\"</table>\");\n\t\t\t\tGenerator::forms_print(\"<center><br><br>No Hay Registros Para Visualizar</center>\");\n\t\t\t}\n\t\t\tGenerator::forms_print(\"</form>\");\n\t\t\tGenerator::forms_print(\"\\r\\n<br><center><input type='button' class='controlButton'\n\t\tvalue='Volver' onclick='window.location = \\\"\".self::writeLocation().\"back\".\"\\\"'></center>\");\n\t\t}\n\t}", "public function getFormAction()\n {\n return $this->getUrl('scontact/index/post', ['_secure' => true]);\n }", "public function getFormEditCajaApertura(){\r\n Obj::run()->View->render(\"formEditCajaApertura\");\r\n }", "public abstract function getForm();", "public function showForm()\n {\n \t//file list\n \t$fileList = DB::table(\"cm_file\")\n \t\t->pluck(\"file_no\", \"id AS file_id\");\n\n \t$supplierList= Supplier::pluck('sup_name', 'sup_id');\n \t$buyerList = Buyer::getBuyerList();\n\n\n \treturn view(\"commercial.import.pi.pi_master_fabric\", compact(\n \t\t\"fileList\",\n \t\t\"supplierList\",\n \t\t\"buyerList\"\n \t));\n }", "public function getAcroForm() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the property headerRows
public function testPropertyHeaderRows($value) { $object = new TableStyle(); $object->setHeaderRows($value); $this->assertEquals($value, $object->getHeaderRows()); }
[ "function is_header_row() {\n\t\treturn TRUE;\n\t}", "public function getHeaderRows()\n {\n return $this->header_rows;\n }", "protected function shouldHaveHeaderRow()\n {\n return ! (bool) array_get($this->exportInfo->options(), 'no_header_row', false);\n }", "public function isFirstRowHeaders()\n\t{\n\t\treturn true;\n\t}", "public function setHeaderRows($var)\n {\n GPBUtil::checkInt32($var);\n $this->header_rows = $var;\n\n return $this;\n }", "public static function is_one_row_header() {\n\t\t$headers = array( 'header--default', 'header--transparency' );\n\t\tif ( in_array( Habakiri::get( 'header' ), $headers ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isFirstRowHeaders()\n {\n return $this->firstRowIsHeaders;\n }", "public function setFirstRowIsHeaders($firstRowIsHeaders = true);", "public function test_getRows_called_returnCorrectValue()\r\n\t{\r\n\t\t$responseHeader = $this->getResponseHeader();\r\n\t\t$this->service->set($responseHeader);\r\n\t\t$actual = $this->service->getRows();\r\n\t\t$this->assertEquals($responseHeader->params->rows, $actual);\r\n\t}", "public function testRowsAttribute_Existence() {\n\t\t$this->assertObjectHasAttribute('rows', $this->csv);\n\t}", "public function hasHeadingRow(): bool\n {\n return !empty($this->getHeadingRow());\n }", "public function isFirstRowHeaders()\n\t{\n\t\treturn $this->firstRowHeaders;\n\t}", "public function testFormattingTableWithMoreRowColumnsThanHeaders()\n {\n $headers = ['foo', 'bar'];\n $rows = [\n ['a'],\n ['aa', 'bb'],\n ['aaa', 'bbb', 'ccc']\n ];\n $expected =\n '+-----+-----+-----+' . PHP_EOL .\n '| foo | bar | |' . PHP_EOL .\n '+-----+-----+-----+' . PHP_EOL .\n '| a | | |' . PHP_EOL .\n '| aa | bb | |' . PHP_EOL .\n '| aaa | bbb | ccc |' . PHP_EOL .\n '+-----+-----+-----+';\n $this->assertEquals($expected, $this->formatter->format($rows, $headers));\n }", "public function validateHeaders(){\n // typecheck\n if( empty($this->headers) ){\n throw new Exception('No headers have been loaded yet');\n }\n\n // get the table's header row\n $headerRow = $this->getHeader();\n\n // validate the headers against the header row\n $headerRow->setReturnType(Vci_Dom_Table_Row::RETURN_TEXT);\n foreach( $this->headers as $column ){\n if( !empty($column['regex']) ){\n if( !preg_match($column['regex'], $headerRow[$column['offset']]) ){\n throw new Exception('Header regex \"'.$column['regex'].'\" does not match \"'.$headerRow[$column['offset']].'\".');\n }\n }else if( !empty($column['value']) ){\n if( $headerRow[$column['offset']] != $column['value'] ){\n throw new Exception('Header value \"'.$column['value'].'\" does not match \"'.$headerRow[$column['offset']].'\".');\n }\n }\n }\n\n // return\n return;\n }", "public function testPropertyRows($value)\n {\n $object = new TableStyle();\n $object->setRows($value);\n\n $this->assertEquals($value, $object->getRows());\n }", "private function areAllExpectedFieldsPresentInRow( $headerRow )\n {\n foreach ( $this->fields as $field ) {\n if ( ! in_array( $field, $headerRow ) ) {\n return false;\n }\n }\n\n return true;\n }", "public function testGetRowCount() {\r\n $this->assertEquals(2, $this->tableModel->getRowCount());\r\n }", "public function testFormatTableHeader() {\n drush_set_context('DRUSH_COLUMNS', 16);\n $rows = $this->numbers;\n array_unshift($rows, array('A', 'B', 'C'));\n $output = drush_format_table($rows, TRUE);\n $expected = ' A B C ' . PHP_EOL . ' 1 12 123 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 4 45 56 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 456 456 5678 ' . PHP_EOL . ' 7 78 9 ' . PHP_EOL;\n $this->assertEquals($expected, $output);\n }", "public function testHeaderPrependedWhenOptionSetToTrue()\n {\n $file = tempnam(sys_get_temp_dir(), null);\n\n $writer = new SpreadsheetWriter(new \\SplFileObject($file, 'w'), null, 'Xlsx', true);\n $writer->prepare();\n $writer->writeItem(array(\n 'col 1 name' => 'col 1 value',\n 'col 2 name' => 'col 2 value',\n 'col 3 name' => 'col 3 value',\n ));\n $writer->finish();\n\n $excel = IOFactory::load($file);\n $sheet = $excel->getActiveSheet()->toArray();\n\n // Check column names at first line\n $this->assertEquals(array('col 1 name', 'col 2 name', 'col 3 name'), $sheet[0]);\n\n // Check values at second line\n $this->assertEquals(array('col 1 value', 'col 2 value', 'col 3 value'), $sheet[1]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert class names to folder names I.E. CamelCaseClassPart > camelcaseclasspart
public function classToFolderName($class) { preg_match_all('/[A-Z][a-z-]+/', $class, $matches); if (count($matches) && count($matches[0])) { $folderName = implode('-', $matches[0]); } else { $folderName = $class; } return strtolower($folderName); }
[ "function friendly_classname($class): string\n {\n $str = object_to_class($class);\n return explode_camel_case(class_basename($str));\n }", "public static function normalizeClassName(string $className): string\n {\n preg_match_all('#([A-Z\\\\\\][A-Z0-9\\\\\\]*(?=$|[A-Z\\\\\\][a-z0-9\\\\\\])|[A-Za-z\\\\\\][a-z0-9\\\\\\]+)#', $className, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match === mb_strtoupper($match) ? mb_strtolower($match) : lcfirst($match);\n }\n\n return preg_replace('#\\\\\\_#', '.', implode('_', $ret));\n }", "private function reworkClassName() {\n $className = $this->className;\n\n if ( (is_array($className) && (count($className) == 0)) || (is_string($className) && (strlen($className) == 0)) ) {\n $this->className = array();\n return;\n }\n\n $arr = self::goodSplit($className, '::');\n // If this array > 2 elements: it's a subclass [example: OmsEvent::Account::Account]\n $this->className = $arr;\n if ( count($this->className) > 1 ) {\n $this->functionName = array_pop($this->className);\n }\n }", "public function testClassName() {\n $this->assertEquals('CamelCase', Inflector::className('camel Cases'));\n $this->assertEquals('StudlyCase', Inflector::className('StuDly CaSes'));\n $this->assertEquals('TitleCase', Inflector::className('Title Cases'));\n $this->assertEquals('NormalCase', Inflector::className('Normal cases'));\n $this->assertEquals('Lowercase', Inflector::className('lowercases'));\n $this->assertEquals('Uppercase', Inflector::className('UPPERCASEs'));\n $this->assertEquals('UnderScore', Inflector::className('under_scores'));\n $this->assertEquals('DashE', Inflector::className('dash-es'));\n $this->assertEquals('123Number', Inflector::className('123 numbers'));\n $this->assertEquals('WithExtxml', Inflector::className('with EXT.xml'));\n $this->assertEquals('LotsOfWhiteSpace', Inflector::className('lots of white space'));\n }", "function zing_class_path($class) {\n if (is_object($class)) $class = get_class($class);\n return strtolower(preg_replace('|([^^/])([A-Z])|', '$1_$2', str_replace('\\\\', '/', $class)));\n}", "private function class2name($name,$ucwords=true)\n {\n\t\t$result=trim(strtolower(str_replace('_',' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $name))));\n\t\treturn $ucwords ? ucwords($result) : $result;\n }", "public static function className()\n {\n $className = get_called_class();\n // For namespaces: DaftSearch\\Query etc.\n if ($postfixName = strrchr($className, '\\\\')) {\n $className = substr($postfixName, 1);\n }\n // convert Camel case to underscore lowercase: SearchSale -> search_sale\n $name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $className));\n return $name;\n }", "static function nameFrom($class) {\n if (\\ends_with($class, $suffix = '_Controller')) {\n $class = substr($class, 0, -1 * strlen($suffix));\n }\n\n return strtolower(str_replace('_', '.', \\class_basename($class)));\n }", "static public function uncamelizeClassName($className) {\n\t\tif ($className[0] === '\\\\') {\n\t\t\t$className = substr($className, 1);\n\t\t}\n\t\t$className = preg_replace_callback('/\\\\\\\\([a-z0-9]{1})/i', function ($matches) {\n\t\t\treturn '_' . lcfirst($matches[1]);\n\t\t}, $className);\n\n\t\t\t// Prevent malformed vendor namespace\n\t\t$classParts = explode('_', $className, 2);\n\t\tif (strtoupper($classParts[0]) === $classParts[0]) {\n\t\t\treturn $className;\n\t\t}\n\n\t\treturn lcfirst($className);\n\t}", "private function class_from()\n\t\t{\n\t\t$args = func_get_args();\n\t\t$end = implode(\"\\\\\", array_map('_to_camel', $args));\n\t\treturn ($this->parent ? $this->parent->class : '')\n\t\t. ($this->name ? '\\\\' : '')\n\t\t. $end;\n\t\t}", "private function set_class_name(){\n\n $pieces = explode('\\\\',get_called_class());\n\n $this->class_name = ucfirst( $pieces[ (count( $pieces )-1) ]);\n\n }", "public static function classNameToTitle(string $className): string\n {\n if (strpos($className, Environment::NAMESPACE_SEPARATOR) === false) {\n return ucwords(str_replace(['_', '-'], ' ', \\Safe\\preg_replace('|([a-z])([A-Z])|', '\\1 \\2', $className)));\n }\n $className = str_replace(['Advantage\\Repository', 'Advantage\\Form'], '', $className);\n return trim(\n \\Safe\\preg_replace(\n '|([a-z])([A-Z])|',\n '\\1 \\2',\n str_replace(\n ['Repository', 'Query', 'Form', 'Edit'],\n '',\n str_replace(Environment::NAMESPACE_SEPARATOR, ' ', $className)\n )\n )\n );\n }", "function class_basename($class)\r\n {\r\n $class = is_object($class) ? get_class($class) : $class;\r\n\r\n return basename(str_replace('\\\\', '/', $class));\r\n }", "public function convertClassNameToFilename($className)\n {\n $filename = '';\n\n foreach ($this->_namespaces as $namespace => $location) {\n if (0 === strpos($className, $namespace)) {\n $filename .= $location;\n }\n }\n\n $filename .= './' . str_replace(array('_', '\\\\'), '/', $className) . '.php';\n\n return $filename;\n }", "protected function getClassName() {\n $splitedName = explode(\"\\\\\", get_class($this));\n return strtolower($splitedName[count($splitedName) - 1]);\n }", "public function class2name($name,$ucwords=true)\n\t{\n\t\t$result=trim(strtolower(str_replace('_',' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $name))));\n\t\treturn $ucwords ? ucwords($result) : $result;\n\t}", "protected function guessSubfolder($strClassName)\n\t{\n\t\tif (strncmp($strClassName, 'DC_', 3) === 0)\n\t\t{\n\t\t\treturn 'drivers';\n\t\t}\n\t\telseif (strncmp($strClassName, 'Content', 7) === 0)\n\t\t{\n\t\t\treturn 'elements';\n\t\t}\n\t\telseif (strncmp($strClassName, 'Form', 4) === 0)\n\t\t{\n\t\t\treturn 'forms';\n\t\t}\n\t\telseif (strncmp($strClassName, 'Module', 6) === 0)\n\t\t{\n\t\t\treturn 'modules';\n\t\t}\n\t\telseif (strncmp($strClassName, 'Page', 4) === 0)\n\t\t{\n\t\t\treturn 'pages';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'classes';\n\t\t}\n\t}", "protected function guessSubfolder($strClassName)\n {\n if (strncmp($strClassName, 'DC_', 3) === 0)\n {\n return 'drivers';\n }\n elseif (strncmp($strClassName, 'Content', 7) === 0)\n {\n return 'elements';\n }\n elseif (strncmp($strClassName, 'Form', 4) === 0)\n {\n return 'forms';\n }\n elseif (strncmp($strClassName, 'Module', 6) === 0)\n {\n return 'modules';\n }\n elseif (strncmp($strClassName, 'Page', 4) === 0)\n {\n return 'pages';\n }\n else\n {\n return 'classes';\n }\n }", "function class_basename($class)\n {\n $class = is_object($class) ? get_class($class) : $class;\n return basename(str_replace('\\\\', '/', $class));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Xoa id nhanh duoi trong Lowergrade
function deIdGiaPhainLowergrade($id, $xoa_id) { $sql = "SELECT * from caygiapha where id = '{$id}'"; $lowergrade = mysqli_fetch_assoc($this->query($sql))['lowergrade']; $array = explode("-", $lowergrade); foreach (array_keys($array, $xoa_id) as $key) { unset($array[$key]); } $string = ''; foreach ($array as $key) { $string = $string . $key . '-'; } $lowergrade = substr($string, 0, strlen($string) - 1); if ($this->updateLowergrade($id, $lowergrade)) { return TRUE; } return FALSE; }
[ "private function letterGrade($value) {\t\n\t\tswitch(true) {\n\t\t\tcase ($value > 93):\n\t\t\t\treturn 'A';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 92.9) && ($value > 90)):\n\t\t\t\treturn 'A-';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 89.9) && ($value > 87)):\n\t\t\t\treturn 'B+';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 86.9) && ($value > 83)):\n\t\t\t\treturn 'B';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 82.9) && ($value > 80)):\n\t\t\t\treturn 'B-';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 79.9) && ($value > 77)):\n\t\t\t\treturn 'C+';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 76.9) && ($value > 73)):\n\t\t\t\treturn 'C';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 72.9) && ($value > 70)):\n\t\t\t\treturn 'C-';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 69.9) && ($value > 65)):\n\t\t\t\treturn 'D';\n\t\t\t\tbreak;\n\t\t\tcase ($value < 65):\n\t\t\t\treturn 'E';\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "function calculateGradeForRaudha($grade){\n\n if($grade >= 96){\n return \"Excellent\";\n }elseif ($grade >= 86 && $grade <= 95) {\n return \"Very Good\";\n }elseif ($grade >= 70 && $grade <= 85) {\n return \"Good\";\n }elseif ($grade >= 50 && $grade <= 69) {\n return \"Pass\";\n }else {\n return \"Fail\";\n }\n }", "public function mobileGrade(): string;", "function getGrade($letter){\n if($letter == \"A\"){\n return 5;\n } elseif($letter == \"B\"){\n return 4;\n } elseif($letter == \"C\"){\n return 3;\n } elseif($letter == \"D\"){\n return 2;\n } elseif($letter == \"E\"){\n return 1;\n } else {\n return 0;\n }\n }", "public function getLettersLower() : int\n {\n\n return $this->_lettersLower;\n\n }", "private function get_alpha_lower() { \r\n\t\treturn $this->alpha_lower;\t \r\n\t}", "function intToGrade($num)\n {\n if ($num != null)\n {\n $num = (int)$num;\n switch($num)\n {\n case 0:\n $grade = \"F\";\n break;\n case 1:\n $grade = \"D-\";\n break;\n case 2:\n $grade = \"D\";\n break;\n case 3:\n $grade = \"D+\";\n break;\n case 4:\n $grade = \"C-\";\n break;\n case 5:\n $grade = \"C\";\n break;\n case 6:\n $grade = \"C+\";\n break;\n case 7:\n $grade = \"B-\";\n break;\n case 8:\n $grade = \"B\";\n break;\n case 9:\n $grade = \"B+\";\n break;\n case 10:\n $grade = \"A-\";\n break;\n case 11:\n $grade = \"A\";\n break;\n case 12:\n $grade = \"A+\";\n break;\n default:\n $grade = \"N/A\";\n break;\n \n } \n }\n else\n $grade = \"N/A\";\n \n return $grade;\n }", "function toLower($a) {\n\tif (strlen($a)>1) {\t//input strings should only be 1 character long\n\t\treturn -1;\n\t}\n\telse if(ord($a[0])>=65 && ord($a[0])<=90) {\t//65-90 are capital ACSII values\n\t\treturn chr(ord($a[0])+32);\n\t}\n\telse if(ord($a[0])>=97 && ord($a[0])<=122) {\t//97-122 are lowercase ASCII values\n\t\treturn $a[0];\n\t}\n\telse {\t//error\n\t\treturn 0;\n\t}\n}", "public function testFleschKincaidGradeLevel()\n {\n $this->assertEquals(26.5, $this->TextStatistics->flesch_kincaid_grade_level($this->strText));\n }", "public function testFleschKincaidGradeLevel()\n {\n $this->assertEquals(12.1, $this->TextStatistics->flesch_kincaid_grade_level($this->strText));\n }", "public function getHighGrade();", "function gradePoint($grade) {\n\t\n\tif ($grade == \"A+\") {\n\t\t$gradePoint = 4.0;\n\t}\n\t\n\tif ($grade == \"A\") {\n\t\t$gradePoint = 4.0;\n\t} \n\t\n\tif ($grade == \"B\") {\n\t\t$gradePoint = 3.0;\n\t} \n\t\n\tif ($grade == \"C\") {\n\t\t$gradePoint = 2.0;\n\t} \n\t\n\tif ($grade == \"D\") {\n\t\t$gradePoint = 0;\n\t}\n\t\n\tif ($grade == \"F\") {\n\t\t$gradePoint = 1;\n\t} \n\t\n\treturn $gradePoint;\n}", "function get_grade_level($grade_level) {\n\tif ($grade_level == 1) return \"Freshman\";\n\tif ($grade_level == 2) return \"Sophomore\";\n\tif ($grade_level == 3) return \"Junior\";\n\tif ($grade_level == 4) return \"Senior\";\n\treturn \"None\";\n}", "function grading($total_number){\n\t\tif($total_number >= 80){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'A+',\n\t\t\t\t'grade_point' => '4.00'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 75 && $total_number < 80){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'A',\n\t\t\t\t'grade_point' => '3.75'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 70 && $total_number < 75){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'A-',\n\t\t\t\t'grade_point' => '3.50'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 65 && $total_number < 70){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'B+',\n\t\t\t\t'grade_point' => '3.25'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 60 && $total_number < 65){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'B',\n\t\t\t\t'grade_point' => '3.00'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 55 && $total_number < 60){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'B-',\n\t\t\t\t'grade_point' => '2.75'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 50 && $total_number < 55){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'C+',\n\t\t\t\t'grade_point' => '2.50'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 45 && $total_number < 50){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'C',\n\t\t\t\t'grade_point' => '2.25'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number >= 40 && $total_number < 45){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'D',\n\t\t\t\t'grade_point' => '2.00'\n\t\t\t);\n\t\t}\n\t\telseif( $total_number < 40 ){\n\t\t\t$grade = array(\n\t\t\t\t'letter_grade' => 'F',\n\t\t\t\t'grade_point' => '0.00'\n\t\t\t);\n\t\t}\n\t\telse{\n\t\t\techo \"No Number\";\n\t\t}\n\t\t\n\t\treturn $grade;\n\t}", "static function toLowerCase($cp)\n{\n\t// From UnicodeData.txt, maps fields 0 => 12 for \"Ll\" entries,\n\t// see http://www.unicode.org/reports/tr21/tr21-5.html\n\tstatic $uppercase = array(\n\t0x0041 => 0x0061, 0x0042 => 0x0062, 0x0043 => 0x0063, 0x0044 => 0x0064,\n\t0x0045 => 0x0065, 0x0046 => 0x0066, 0x0047 => 0x0067, 0x0048 => 0x0068,\n\t0x0049 => 0x0069, 0x004a => 0x006a, 0x004b => 0x006b, 0x004c => 0x006c,\n\t0x004d => 0x006d, 0x004e => 0x006e, 0x004f => 0x006f, 0x0050 => 0x0070,\n\t0x0051 => 0x0071, 0x0052 => 0x0072, 0x0053 => 0x0073, 0x0054 => 0x0074,\n\t0x0055 => 0x0075, 0x0056 => 0x0076, 0x0057 => 0x0077, 0x0058 => 0x0078,\n\t0x0059 => 0x0079, 0x005a => 0x007a, 0x00c0 => 0x00e0, 0x00c1 => 0x00e1,\n\t0x00c2 => 0x00e2, 0x00c3 => 0x00e3, 0x00c4 => 0x00e4, 0x00c5 => 0x00e5,\n\t0x00c6 => 0x00e6, 0x00c7 => 0x00e7, 0x00c8 => 0x00e8, 0x00c9 => 0x00e9,\n\t0x00ca => 0x00ea, 0x00cb => 0x00eb, 0x00cc => 0x00ec, 0x00cd => 0x00ed,\n\t0x00ce => 0x00ee, 0x00cf => 0x00ef, 0x00d0 => 0x00f0, 0x00d1 => 0x00f1,\n\t0x00d2 => 0x00f2, 0x00d3 => 0x00f3, 0x00d4 => 0x00f4, 0x00d5 => 0x00f5,\n\t0x00d6 => 0x00f6, 0x00d8 => 0x00f8, 0x00d9 => 0x00f9, 0x00da => 0x00fa,\n\t0x00db => 0x00fb, 0x00dc => 0x00fc, 0x00dd => 0x00fd, 0x00de => 0x00fe,\n\t0x0100 => 0x0101, 0x0102 => 0x0103, 0x0104 => 0x0105, 0x0106 => 0x0107,\n\t0x0108 => 0x0109, 0x010a => 0x010b, 0x010c => 0x010d, 0x010e => 0x010f,\n\t0x0110 => 0x0111, 0x0112 => 0x0113, 0x0114 => 0x0115, 0x0116 => 0x0117,\n\t0x0118 => 0x0119, 0x011a => 0x011b, 0x011c => 0x011d, 0x011e => 0x011f,\n\t0x0120 => 0x0121, 0x0122 => 0x0123, 0x0124 => 0x0125, 0x0126 => 0x0127,\n\t0x0128 => 0x0129, 0x012a => 0x012b, 0x012c => 0x012d, 0x012e => 0x012f,\n\t0x0130 => 0x0069, 0x0132 => 0x0133, 0x0134 => 0x0135, 0x0136 => 0x0137,\n\t0x0139 => 0x013a, 0x013b => 0x013c, 0x013d => 0x013e, 0x013f => 0x0140,\n\t0x0141 => 0x0142, 0x0143 => 0x0144, 0x0145 => 0x0146, 0x0147 => 0x0148,\n\t0x014a => 0x014b, 0x014c => 0x014d, 0x014e => 0x014f, 0x0150 => 0x0151,\n\t0x0152 => 0x0153, 0x0154 => 0x0155, 0x0156 => 0x0157, 0x0158 => 0x0159,\n\t0x015a => 0x015b, 0x015c => 0x015d, 0x015e => 0x015f, 0x0160 => 0x0161,\n\t0x0162 => 0x0163, 0x0164 => 0x0165, 0x0166 => 0x0167, 0x0168 => 0x0169,\n\t0x016a => 0x016b, 0x016c => 0x016d, 0x016e => 0x016f, 0x0170 => 0x0171,\n\t0x0172 => 0x0173, 0x0174 => 0x0175, 0x0176 => 0x0177, 0x0178 => 0x00ff,\n\t0x0179 => 0x017a, 0x017b => 0x017c, 0x017d => 0x017e, 0x0181 => 0x0253,\n\t0x0182 => 0x0183, 0x0184 => 0x0185, 0x0186 => 0x0254, 0x0187 => 0x0188,\n\t0x0189 => 0x0256, 0x018a => 0x0257, 0x018b => 0x018c, 0x018e => 0x01dd,\n\t0x018f => 0x0259, 0x0190 => 0x025b, 0x0191 => 0x0192, 0x0193 => 0x0260,\n\t0x0194 => 0x0263, 0x0196 => 0x0269, 0x0197 => 0x0268, 0x0198 => 0x0199,\n\t0x019c => 0x026f, 0x019d => 0x0272, 0x019f => 0x0275, 0x01a0 => 0x01a1,\n\t0x01a2 => 0x01a3, 0x01a4 => 0x01a5, 0x01a6 => 0x0280, 0x01a7 => 0x01a8,\n\t0x01a9 => 0x0283, 0x01ac => 0x01ad, 0x01ae => 0x0288, 0x01af => 0x01b0,\n\t0x01b1 => 0x028a, 0x01b2 => 0x028b, 0x01b3 => 0x01b4, 0x01b5 => 0x01b6,\n\t0x01b7 => 0x0292, 0x01b8 => 0x01b9, 0x01bc => 0x01bd, 0x01c4 => 0x01c6,\n\t0x01c7 => 0x01c9, 0x01ca => 0x01cc, 0x01cd => 0x01ce, 0x01cf => 0x01d0,\n\t0x01d1 => 0x01d2, 0x01d3 => 0x01d4, 0x01d5 => 0x01d6, 0x01d7 => 0x01d8,\n\t0x01d9 => 0x01da, 0x01db => 0x01dc, 0x01de => 0x01df, 0x01e0 => 0x01e1,\n\t0x01e2 => 0x01e3, 0x01e4 => 0x01e5, 0x01e6 => 0x01e7, 0x01e8 => 0x01e9,\n\t0x01ea => 0x01eb, 0x01ec => 0x01ed, 0x01ee => 0x01ef, 0x01f1 => 0x01f3,\n\t0x01f4 => 0x01f5, 0x01f6 => 0x0195, 0x01f7 => 0x01bf, 0x01f8 => 0x01f9,\n\t0x01fa => 0x01fb, 0x01fc => 0x01fd, 0x01fe => 0x01ff, 0x0200 => 0x0201,\n\t0x0202 => 0x0203, 0x0204 => 0x0205, 0x0206 => 0x0207, 0x0208 => 0x0209,\n\t0x020a => 0x020b, 0x020c => 0x020d, 0x020e => 0x020f, 0x0210 => 0x0211,\n\t0x0212 => 0x0213, 0x0214 => 0x0215, 0x0216 => 0x0217, 0x0218 => 0x0219,\n\t0x021a => 0x021b, 0x021c => 0x021d, 0x021e => 0x021f, 0x0220 => 0x019e,\n\t0x0222 => 0x0223, 0x0224 => 0x0225, 0x0226 => 0x0227, 0x0228 => 0x0229,\n\t0x022a => 0x022b, 0x022c => 0x022d, 0x022e => 0x022f, 0x0230 => 0x0231,\n\t0x0232 => 0x0233, 0x023a => 0x2c65, 0x023b => 0x023c, 0x023d => 0x019a,\n\t0x023e => 0x2c66, 0x0241 => 0x0242, 0x0243 => 0x0180, 0x0244 => 0x0289,\n\t0x0245 => 0x028c, 0x0246 => 0x0247, 0x0248 => 0x0249, 0x024a => 0x024b,\n\t0x024c => 0x024d, 0x024e => 0x024f, 0x0370 => 0x0371, 0x0372 => 0x0373,\n\t0x0376 => 0x0377, 0x0386 => 0x03ac, 0x0388 => 0x03ad, 0x0389 => 0x03ae,\n\t0x038a => 0x03af, 0x038c => 0x03cc, 0x038e => 0x03cd, 0x038f => 0x03ce,\n\t0x0391 => 0x03b1, 0x0392 => 0x03b2, 0x0393 => 0x03b3, 0x0394 => 0x03b4,\n\t0x0395 => 0x03b5, 0x0396 => 0x03b6, 0x0397 => 0x03b7, 0x0398 => 0x03b8,\n\t0x0399 => 0x03b9, 0x039a => 0x03ba, 0x039b => 0x03bb, 0x039c => 0x03bc,\n\t0x039d => 0x03bd, 0x039e => 0x03be, 0x039f => 0x03bf, 0x03a0 => 0x03c0,\n\t0x03a1 => 0x03c1, 0x03a3 => 0x03c3, 0x03a4 => 0x03c4, 0x03a5 => 0x03c5,\n\t0x03a6 => 0x03c6, 0x03a7 => 0x03c7, 0x03a8 => 0x03c8, 0x03a9 => 0x03c9,\n\t0x03aa => 0x03ca, 0x03ab => 0x03cb, 0x03cf => 0x03d7, 0x03d8 => 0x03d9,\n\t0x03da => 0x03db, 0x03dc => 0x03dd, 0x03de => 0x03df, 0x03e0 => 0x03e1,\n\t0x03e2 => 0x03e3, 0x03e4 => 0x03e5, 0x03e6 => 0x03e7, 0x03e8 => 0x03e9,\n\t0x03ea => 0x03eb, 0x03ec => 0x03ed, 0x03ee => 0x03ef, 0x03f4 => 0x03b8,\n\t0x03f7 => 0x03f8, 0x03f9 => 0x03f2, 0x03fa => 0x03fb, 0x03fd => 0x037b,\n\t0x03fe => 0x037c, 0x03ff => 0x037d, 0x0400 => 0x0450, 0x0401 => 0x0451,\n\t0x0402 => 0x0452, 0x0403 => 0x0453, 0x0404 => 0x0454, 0x0405 => 0x0455,\n\t0x0406 => 0x0456, 0x0407 => 0x0457, 0x0408 => 0x0458, 0x0409 => 0x0459,\n\t0x040a => 0x045a, 0x040b => 0x045b, 0x040c => 0x045c, 0x040d => 0x045d,\n\t0x040e => 0x045e, 0x040f => 0x045f, 0x0410 => 0x0430, 0x0411 => 0x0431,\n\t0x0412 => 0x0432, 0x0413 => 0x0433, 0x0414 => 0x0434, 0x0415 => 0x0435,\n\t0x0416 => 0x0436, 0x0417 => 0x0437, 0x0418 => 0x0438, 0x0419 => 0x0439,\n\t0x041a => 0x043a, 0x041b => 0x043b, 0x041c => 0x043c, 0x041d => 0x043d,\n\t0x041e => 0x043e, 0x041f => 0x043f, 0x0420 => 0x0440, 0x0421 => 0x0441,\n\t0x0422 => 0x0442, 0x0423 => 0x0443, 0x0424 => 0x0444, 0x0425 => 0x0445,\n\t0x0426 => 0x0446, 0x0427 => 0x0447, 0x0428 => 0x0448, 0x0429 => 0x0449,\n\t0x042a => 0x044a, 0x042b => 0x044b, 0x042c => 0x044c, 0x042d => 0x044d,\n\t0x042e => 0x044e, 0x042f => 0x044f, 0x0460 => 0x0461, 0x0462 => 0x0463,\n\t0x0464 => 0x0465, 0x0466 => 0x0467, 0x0468 => 0x0469, 0x046a => 0x046b,\n\t0x046c => 0x046d, 0x046e => 0x046f, 0x0470 => 0x0471, 0x0472 => 0x0473,\n\t0x0474 => 0x0475, 0x0476 => 0x0477, 0x0478 => 0x0479, 0x047a => 0x047b,\n\t0x047c => 0x047d, 0x047e => 0x047f, 0x0480 => 0x0481, 0x048a => 0x048b,\n\t0x048c => 0x048d, 0x048e => 0x048f, 0x0490 => 0x0491, 0x0492 => 0x0493,\n\t0x0494 => 0x0495, 0x0496 => 0x0497, 0x0498 => 0x0499, 0x049a => 0x049b,\n\t0x049c => 0x049d, 0x049e => 0x049f, 0x04a0 => 0x04a1, 0x04a2 => 0x04a3,\n\t0x04a4 => 0x04a5, 0x04a6 => 0x04a7, 0x04a8 => 0x04a9, 0x04aa => 0x04ab,\n\t0x04ac => 0x04ad, 0x04ae => 0x04af, 0x04b0 => 0x04b1, 0x04b2 => 0x04b3,\n\t0x04b4 => 0x04b5, 0x04b6 => 0x04b7, 0x04b8 => 0x04b9, 0x04ba => 0x04bb,\n\t0x04bc => 0x04bd, 0x04be => 0x04bf, 0x04c0 => 0x04cf, 0x04c1 => 0x04c2,\n\t0x04c3 => 0x04c4, 0x04c5 => 0x04c6, 0x04c7 => 0x04c8, 0x04c9 => 0x04ca,\n\t0x04cb => 0x04cc, 0x04cd => 0x04ce, 0x04d0 => 0x04d1, 0x04d2 => 0x04d3,\n\t0x04d4 => 0x04d5, 0x04d6 => 0x04d7, 0x04d8 => 0x04d9, 0x04da => 0x04db,\n\t0x04dc => 0x04dd, 0x04de => 0x04df, 0x04e0 => 0x04e1, 0x04e2 => 0x04e3,\n\t0x04e4 => 0x04e5, 0x04e6 => 0x04e7, 0x04e8 => 0x04e9, 0x04ea => 0x04eb,\n\t0x04ec => 0x04ed, 0x04ee => 0x04ef, 0x04f0 => 0x04f1, 0x04f2 => 0x04f3,\n\t0x04f4 => 0x04f5, 0x04f6 => 0x04f7, 0x04f8 => 0x04f9, 0x04fa => 0x04fb,\n\t0x04fc => 0x04fd, 0x04fe => 0x04ff, 0x0500 => 0x0501, 0x0502 => 0x0503,\n\t0x0504 => 0x0505, 0x0506 => 0x0507, 0x0508 => 0x0509, 0x050a => 0x050b,\n\t0x050c => 0x050d, 0x050e => 0x050f, 0x0510 => 0x0511, 0x0512 => 0x0513,\n\t0x0514 => 0x0515, 0x0516 => 0x0517, 0x0518 => 0x0519, 0x051a => 0x051b,\n\t0x051c => 0x051d, 0x051e => 0x051f, 0x0520 => 0x0521, 0x0522 => 0x0523,\n\t0x0524 => 0x0525, 0x0526 => 0x0527, 0x0531 => 0x0561, 0x0532 => 0x0562,\n\t0x0533 => 0x0563, 0x0534 => 0x0564, 0x0535 => 0x0565, 0x0536 => 0x0566,\n\t0x0537 => 0x0567, 0x0538 => 0x0568, 0x0539 => 0x0569, 0x053a => 0x056a,\n\t0x053b => 0x056b, 0x053c => 0x056c, 0x053d => 0x056d, 0x053e => 0x056e,\n\t0x053f => 0x056f, 0x0540 => 0x0570, 0x0541 => 0x0571, 0x0542 => 0x0572,\n\t0x0543 => 0x0573, 0x0544 => 0x0574, 0x0545 => 0x0575, 0x0546 => 0x0576,\n\t0x0547 => 0x0577, 0x0548 => 0x0578, 0x0549 => 0x0579, 0x054a => 0x057a,\n\t0x054b => 0x057b, 0x054c => 0x057c, 0x054d => 0x057d, 0x054e => 0x057e,\n\t0x054f => 0x057f, 0x0550 => 0x0580, 0x0551 => 0x0581, 0x0552 => 0x0582,\n\t0x0553 => 0x0583, 0x0554 => 0x0584, 0x0555 => 0x0585, 0x0556 => 0x0586,\n\t0x10a0 => 0x2d00, 0x10a1 => 0x2d01, 0x10a2 => 0x2d02, 0x10a3 => 0x2d03,\n\t0x10a4 => 0x2d04, 0x10a5 => 0x2d05, 0x10a6 => 0x2d06, 0x10a7 => 0x2d07,\n\t0x10a8 => 0x2d08, 0x10a9 => 0x2d09, 0x10aa => 0x2d0a, 0x10ab => 0x2d0b,\n\t0x10ac => 0x2d0c, 0x10ad => 0x2d0d, 0x10ae => 0x2d0e, 0x10af => 0x2d0f,\n\t0x10b0 => 0x2d10, 0x10b1 => 0x2d11, 0x10b2 => 0x2d12, 0x10b3 => 0x2d13,\n\t0x10b4 => 0x2d14, 0x10b5 => 0x2d15, 0x10b6 => 0x2d16, 0x10b7 => 0x2d17,\n\t0x10b8 => 0x2d18, 0x10b9 => 0x2d19, 0x10ba => 0x2d1a, 0x10bb => 0x2d1b,\n\t0x10bc => 0x2d1c, 0x10bd => 0x2d1d, 0x10be => 0x2d1e, 0x10bf => 0x2d1f,\n\t0x10c0 => 0x2d20, 0x10c1 => 0x2d21, 0x10c2 => 0x2d22, 0x10c3 => 0x2d23,\n\t0x10c4 => 0x2d24, 0x10c5 => 0x2d25, 0x10c7 => 0x2d27, 0x10cd => 0x2d2d,\n\t0x1e00 => 0x1e01, 0x1e02 => 0x1e03, 0x1e04 => 0x1e05, 0x1e06 => 0x1e07,\n\t0x1e08 => 0x1e09, 0x1e0a => 0x1e0b, 0x1e0c => 0x1e0d, 0x1e0e => 0x1e0f,\n\t0x1e10 => 0x1e11, 0x1e12 => 0x1e13, 0x1e14 => 0x1e15, 0x1e16 => 0x1e17,\n\t0x1e18 => 0x1e19, 0x1e1a => 0x1e1b, 0x1e1c => 0x1e1d, 0x1e1e => 0x1e1f,\n\t0x1e20 => 0x1e21, 0x1e22 => 0x1e23, 0x1e24 => 0x1e25, 0x1e26 => 0x1e27,\n\t0x1e28 => 0x1e29, 0x1e2a => 0x1e2b, 0x1e2c => 0x1e2d, 0x1e2e => 0x1e2f,\n\t0x1e30 => 0x1e31, 0x1e32 => 0x1e33, 0x1e34 => 0x1e35, 0x1e36 => 0x1e37,\n\t0x1e38 => 0x1e39, 0x1e3a => 0x1e3b, 0x1e3c => 0x1e3d, 0x1e3e => 0x1e3f,\n\t0x1e40 => 0x1e41, 0x1e42 => 0x1e43, 0x1e44 => 0x1e45, 0x1e46 => 0x1e47,\n\t0x1e48 => 0x1e49, 0x1e4a => 0x1e4b, 0x1e4c => 0x1e4d, 0x1e4e => 0x1e4f,\n\t0x1e50 => 0x1e51, 0x1e52 => 0x1e53, 0x1e54 => 0x1e55, 0x1e56 => 0x1e57,\n\t0x1e58 => 0x1e59, 0x1e5a => 0x1e5b, 0x1e5c => 0x1e5d, 0x1e5e => 0x1e5f,\n\t0x1e60 => 0x1e61, 0x1e62 => 0x1e63, 0x1e64 => 0x1e65, 0x1e66 => 0x1e67,\n\t0x1e68 => 0x1e69, 0x1e6a => 0x1e6b, 0x1e6c => 0x1e6d, 0x1e6e => 0x1e6f,\n\t0x1e70 => 0x1e71, 0x1e72 => 0x1e73, 0x1e74 => 0x1e75, 0x1e76 => 0x1e77,\n\t0x1e78 => 0x1e79, 0x1e7a => 0x1e7b, 0x1e7c => 0x1e7d, 0x1e7e => 0x1e7f,\n\t0x1e80 => 0x1e81, 0x1e82 => 0x1e83, 0x1e84 => 0x1e85, 0x1e86 => 0x1e87,\n\t0x1e88 => 0x1e89, 0x1e8a => 0x1e8b, 0x1e8c => 0x1e8d, 0x1e8e => 0x1e8f,\n\t0x1e90 => 0x1e91, 0x1e92 => 0x1e93, 0x1e94 => 0x1e95, 0x1e9e => 0x00df,\n\t0x1ea0 => 0x1ea1, 0x1ea2 => 0x1ea3, 0x1ea4 => 0x1ea5, 0x1ea6 => 0x1ea7,\n\t0x1ea8 => 0x1ea9, 0x1eaa => 0x1eab, 0x1eac => 0x1ead, 0x1eae => 0x1eaf,\n\t0x1eb0 => 0x1eb1, 0x1eb2 => 0x1eb3, 0x1eb4 => 0x1eb5, 0x1eb6 => 0x1eb7,\n\t0x1eb8 => 0x1eb9, 0x1eba => 0x1ebb, 0x1ebc => 0x1ebd, 0x1ebe => 0x1ebf,\n\t0x1ec0 => 0x1ec1, 0x1ec2 => 0x1ec3, 0x1ec4 => 0x1ec5, 0x1ec6 => 0x1ec7,\n\t0x1ec8 => 0x1ec9, 0x1eca => 0x1ecb, 0x1ecc => 0x1ecd, 0x1ece => 0x1ecf,\n\t0x1ed0 => 0x1ed1, 0x1ed2 => 0x1ed3, 0x1ed4 => 0x1ed5, 0x1ed6 => 0x1ed7,\n\t0x1ed8 => 0x1ed9, 0x1eda => 0x1edb, 0x1edc => 0x1edd, 0x1ede => 0x1edf,\n\t0x1ee0 => 0x1ee1, 0x1ee2 => 0x1ee3, 0x1ee4 => 0x1ee5, 0x1ee6 => 0x1ee7,\n\t0x1ee8 => 0x1ee9, 0x1eea => 0x1eeb, 0x1eec => 0x1eed, 0x1eee => 0x1eef,\n\t0x1ef0 => 0x1ef1, 0x1ef2 => 0x1ef3, 0x1ef4 => 0x1ef5, 0x1ef6 => 0x1ef7,\n\t0x1ef8 => 0x1ef9, 0x1efa => 0x1efb, 0x1efc => 0x1efd, 0x1efe => 0x1eff,\n\t0x1f08 => 0x1f00, 0x1f09 => 0x1f01, 0x1f0a => 0x1f02, 0x1f0b => 0x1f03,\n\t0x1f0c => 0x1f04, 0x1f0d => 0x1f05, 0x1f0e => 0x1f06, 0x1f0f => 0x1f07,\n\t0x1f18 => 0x1f10, 0x1f19 => 0x1f11, 0x1f1a => 0x1f12, 0x1f1b => 0x1f13,\n\t0x1f1c => 0x1f14, 0x1f1d => 0x1f15, 0x1f28 => 0x1f20, 0x1f29 => 0x1f21,\n\t0x1f2a => 0x1f22, 0x1f2b => 0x1f23, 0x1f2c => 0x1f24, 0x1f2d => 0x1f25,\n\t0x1f2e => 0x1f26, 0x1f2f => 0x1f27, 0x1f38 => 0x1f30, 0x1f39 => 0x1f31,\n\t0x1f3a => 0x1f32, 0x1f3b => 0x1f33, 0x1f3c => 0x1f34, 0x1f3d => 0x1f35,\n\t0x1f3e => 0x1f36, 0x1f3f => 0x1f37, 0x1f48 => 0x1f40, 0x1f49 => 0x1f41,\n\t0x1f4a => 0x1f42, 0x1f4b => 0x1f43, 0x1f4c => 0x1f44, 0x1f4d => 0x1f45,\n\t0x1f59 => 0x1f51, 0x1f5b => 0x1f53, 0x1f5d => 0x1f55, 0x1f5f => 0x1f57,\n\t0x1f68 => 0x1f60, 0x1f69 => 0x1f61, 0x1f6a => 0x1f62, 0x1f6b => 0x1f63,\n\t0x1f6c => 0x1f64, 0x1f6d => 0x1f65, 0x1f6e => 0x1f66, 0x1f6f => 0x1f67,\n\t0x1fb8 => 0x1fb0, 0x1fb9 => 0x1fb1, 0x1fba => 0x1f70, 0x1fbb => 0x1f71,\n\t0x1fc8 => 0x1f72, 0x1fc9 => 0x1f73, 0x1fca => 0x1f74, 0x1fcb => 0x1f75,\n\t0x1fd8 => 0x1fd0, 0x1fd9 => 0x1fd1, 0x1fda => 0x1f76, 0x1fdb => 0x1f77,\n\t0x1fe8 => 0x1fe0, 0x1fe9 => 0x1fe1, 0x1fea => 0x1f7a, 0x1feb => 0x1f7b,\n\t0x1fec => 0x1fe5, 0x1ff8 => 0x1f78, 0x1ff9 => 0x1f79, 0x1ffa => 0x1f7c,\n\t0x1ffb => 0x1f7d, 0x2126 => 0x03c9, 0x212a => 0x006b, 0x212b => 0x00e5,\n\t0x2132 => 0x214e, 0x2183 => 0x2184, 0x2c00 => 0x2c30, 0x2c01 => 0x2c31,\n\t0x2c02 => 0x2c32, 0x2c03 => 0x2c33, 0x2c04 => 0x2c34, 0x2c05 => 0x2c35,\n\t0x2c06 => 0x2c36, 0x2c07 => 0x2c37, 0x2c08 => 0x2c38, 0x2c09 => 0x2c39,\n\t0x2c0a => 0x2c3a, 0x2c0b => 0x2c3b, 0x2c0c => 0x2c3c, 0x2c0d => 0x2c3d,\n\t0x2c0e => 0x2c3e, 0x2c0f => 0x2c3f, 0x2c10 => 0x2c40, 0x2c11 => 0x2c41,\n\t0x2c12 => 0x2c42, 0x2c13 => 0x2c43, 0x2c14 => 0x2c44, 0x2c15 => 0x2c45,\n\t0x2c16 => 0x2c46, 0x2c17 => 0x2c47, 0x2c18 => 0x2c48, 0x2c19 => 0x2c49,\n\t0x2c1a => 0x2c4a, 0x2c1b => 0x2c4b, 0x2c1c => 0x2c4c, 0x2c1d => 0x2c4d,\n\t0x2c1e => 0x2c4e, 0x2c1f => 0x2c4f, 0x2c20 => 0x2c50, 0x2c21 => 0x2c51,\n\t0x2c22 => 0x2c52, 0x2c23 => 0x2c53, 0x2c24 => 0x2c54, 0x2c25 => 0x2c55,\n\t0x2c26 => 0x2c56, 0x2c27 => 0x2c57, 0x2c28 => 0x2c58, 0x2c29 => 0x2c59,\n\t0x2c2a => 0x2c5a, 0x2c2b => 0x2c5b, 0x2c2c => 0x2c5c, 0x2c2d => 0x2c5d,\n\t0x2c2e => 0x2c5e, 0x2c60 => 0x2c61, 0x2c62 => 0x026b, 0x2c63 => 0x1d7d,\n\t0x2c64 => 0x027d, 0x2c67 => 0x2c68, 0x2c69 => 0x2c6a, 0x2c6b => 0x2c6c,\n\t0x2c6d => 0x0251, 0x2c6e => 0x0271, 0x2c6f => 0x0250, 0x2c70 => 0x0252,\n\t0x2c72 => 0x2c73, 0x2c75 => 0x2c76, 0x2c7e => 0x023f, 0x2c7f => 0x0240,\n\t0x2c80 => 0x2c81, 0x2c82 => 0x2c83, 0x2c84 => 0x2c85, 0x2c86 => 0x2c87,\n\t0x2c88 => 0x2c89, 0x2c8a => 0x2c8b, 0x2c8c => 0x2c8d, 0x2c8e => 0x2c8f,\n\t0x2c90 => 0x2c91, 0x2c92 => 0x2c93, 0x2c94 => 0x2c95, 0x2c96 => 0x2c97,\n\t0x2c98 => 0x2c99, 0x2c9a => 0x2c9b, 0x2c9c => 0x2c9d, 0x2c9e => 0x2c9f,\n\t0x2ca0 => 0x2ca1, 0x2ca2 => 0x2ca3, 0x2ca4 => 0x2ca5, 0x2ca6 => 0x2ca7,\n\t0x2ca8 => 0x2ca9, 0x2caa => 0x2cab, 0x2cac => 0x2cad, 0x2cae => 0x2caf,\n\t0x2cb0 => 0x2cb1, 0x2cb2 => 0x2cb3, 0x2cb4 => 0x2cb5, 0x2cb6 => 0x2cb7,\n\t0x2cb8 => 0x2cb9, 0x2cba => 0x2cbb, 0x2cbc => 0x2cbd, 0x2cbe => 0x2cbf,\n\t0x2cc0 => 0x2cc1, 0x2cc2 => 0x2cc3, 0x2cc4 => 0x2cc5, 0x2cc6 => 0x2cc7,\n\t0x2cc8 => 0x2cc9, 0x2cca => 0x2ccb, 0x2ccc => 0x2ccd, 0x2cce => 0x2ccf,\n\t0x2cd0 => 0x2cd1, 0x2cd2 => 0x2cd3, 0x2cd4 => 0x2cd5, 0x2cd6 => 0x2cd7,\n\t0x2cd8 => 0x2cd9, 0x2cda => 0x2cdb, 0x2cdc => 0x2cdd, 0x2cde => 0x2cdf,\n\t0x2ce0 => 0x2ce1, 0x2ce2 => 0x2ce3, 0x2ceb => 0x2cec, 0x2ced => 0x2cee,\n\t0x2cf2 => 0x2cf3, 0xa640 => 0xa641, 0xa642 => 0xa643, 0xa644 => 0xa645,\n\t0xa646 => 0xa647, 0xa648 => 0xa649, 0xa64a => 0xa64b, 0xa64c => 0xa64d,\n\t0xa64e => 0xa64f, 0xa650 => 0xa651, 0xa652 => 0xa653, 0xa654 => 0xa655,\n\t0xa656 => 0xa657, 0xa658 => 0xa659, 0xa65a => 0xa65b, 0xa65c => 0xa65d,\n\t0xa65e => 0xa65f, 0xa660 => 0xa661, 0xa662 => 0xa663, 0xa664 => 0xa665,\n\t0xa666 => 0xa667, 0xa668 => 0xa669, 0xa66a => 0xa66b, 0xa66c => 0xa66d,\n\t0xa680 => 0xa681, 0xa682 => 0xa683, 0xa684 => 0xa685, 0xa686 => 0xa687,\n\t0xa688 => 0xa689, 0xa68a => 0xa68b, 0xa68c => 0xa68d, 0xa68e => 0xa68f,\n\t0xa690 => 0xa691, 0xa692 => 0xa693, 0xa694 => 0xa695, 0xa696 => 0xa697,\n\t0xa722 => 0xa723, 0xa724 => 0xa725, 0xa726 => 0xa727, 0xa728 => 0xa729,\n\t0xa72a => 0xa72b, 0xa72c => 0xa72d, 0xa72e => 0xa72f, 0xa732 => 0xa733,\n\t0xa734 => 0xa735, 0xa736 => 0xa737, 0xa738 => 0xa739, 0xa73a => 0xa73b,\n\t0xa73c => 0xa73d, 0xa73e => 0xa73f, 0xa740 => 0xa741, 0xa742 => 0xa743,\n\t0xa744 => 0xa745, 0xa746 => 0xa747, 0xa748 => 0xa749, 0xa74a => 0xa74b,\n\t0xa74c => 0xa74d, 0xa74e => 0xa74f, 0xa750 => 0xa751, 0xa752 => 0xa753,\n\t0xa754 => 0xa755, 0xa756 => 0xa757, 0xa758 => 0xa759, 0xa75a => 0xa75b,\n\t0xa75c => 0xa75d, 0xa75e => 0xa75f, 0xa760 => 0xa761, 0xa762 => 0xa763,\n\t0xa764 => 0xa765, 0xa766 => 0xa767, 0xa768 => 0xa769, 0xa76a => 0xa76b,\n\t0xa76c => 0xa76d, 0xa76e => 0xa76f, 0xa779 => 0xa77a, 0xa77b => 0xa77c,\n\t0xa77d => 0x1d79, 0xa77e => 0xa77f, 0xa780 => 0xa781, 0xa782 => 0xa783,\n\t0xa784 => 0xa785, 0xa786 => 0xa787, 0xa78b => 0xa78c, 0xa78d => 0x0265,\n\t0xa790 => 0xa791, 0xa792 => 0xa793, 0xa7a0 => 0xa7a1, 0xa7a2 => 0xa7a3,\n\t0xa7a4 => 0xa7a5, 0xa7a6 => 0xa7a7, 0xa7a8 => 0xa7a9, 0xa7aa => 0x0266,\n\t0xff21 => 0xff41, 0xff22 => 0xff42, 0xff23 => 0xff43, 0xff24 => 0xff44,\n\t0xff25 => 0xff45, 0xff26 => 0xff46, 0xff27 => 0xff47, 0xff28 => 0xff48,\n\t0xff29 => 0xff49, 0xff2a => 0xff4a, 0xff2b => 0xff4b, 0xff2c => 0xff4c,\n\t0xff2d => 0xff4d, 0xff2e => 0xff4e, 0xff2f => 0xff4f, 0xff30 => 0xff50,\n\t0xff31 => 0xff51, 0xff32 => 0xff52, 0xff33 => 0xff53, 0xff34 => 0xff54,\n\t0xff35 => 0xff55, 0xff36 => 0xff56, 0xff37 => 0xff57, 0xff38 => 0xff58,\n\t0xff39 => 0xff59, 0xff3a => 0xff5a);\n\n\tif( array_key_exists($cp, $uppercase) )\n\t\treturn $uppercase[$cp];\n\telse\n\t\treturn $cp;\n}", "function num2alpha($n)\n {\n for($r = \"\"; $n >= 0; $n = intval($n / 26) - 1)\n $r = chr($n%26 + 0x41) . $r;\n return $r;\n }", "function _G($key,$locale=LITCAL_LOCALE){\r\n $locale = strtolower($locale);\r\n $key = (int)$key;\r\n $grade = __(\"FERIA\",$locale);\r\n switch($key){\r\n case 0: \r\n $grade = __(\"FERIA\",$locale);\r\n break;\r\n case 1: \r\n $grade = __(\"COMMEMORATION\",$locale);\r\n break;\r\n case 2: \r\n $grade = __(\"OPTIONAL MEMORIAL\",$locale);\r\n break;\r\n case 3: \r\n $grade = __(\"MEMORIAL\",$locale);\r\n break;\r\n case 4: \r\n $grade = __(\"FEAST\",$locale);\r\n break;\r\n case 5: \r\n $grade = __(\"FEAST OF THE LORD\",$locale);\r\n break;\r\n case 6: \r\n $grade = __(\"SOLEMNITY\",$locale);\r\n break;\r\n case 7: \r\n $grade = __(\"HIGHER RANKING SOLEMNITY\",$locale);\r\n break;\r\n }\r\n return $grade;\r\n}", "function grade($grade){\r\n\t\t$points;\r\n\t\tif($grade === \"A+\" || $grade === \"A\" || $grade === \"a\" || $grade === \"a+\"){\r\n\t\t\t$points = 4.00;\r\n\t\t}else if($grade === \"A-\" || $grade === \"a-\"){\r\n\t\t\t$points = 3.70;\r\n\t\t}else if($grade === \"B+\" || $grade === \"b+\"){\r\n\t\t\t$points = 3.30;\r\n\t\t}else if($grade === \"B\" || $grade === \"b\"){\r\n\t\t\t$points = 3.00;\r\n\t\t}else if($grade === \"B-\" || $grade === \"b-\"){\r\n\t\t\t$points = 2.70;\r\n\t\t}else if($grade === \"C+\" || $grade === \"c+\"){\r\n\t\t\t$points = 2.30;\r\n\t\t}else if($grade === \"C\" || $grade === \"c\"){\r\n\t\t\t$points = 2.00;\r\n\t\t}else if($grade === \"C-\" || $grade === \"c-\"){\r\n\t\t\t$points = 1.70;\r\n\t\t}else if($grade === \"D+\" || $grade === \"d+\"){\r\n\t\t\t$points = 1.30;\r\n\t\t}else if($grade === \"D\" || $grade === \"d\"){\r\n\t\t\t$points = 1.00;\r\n\t\t}else if($grade === \"E\" || $grade === \"e\" || $grade === \"D-\" || $grade === \"d-\" || $grade === \"E+\" || $grade === \"E-\" || $grade === \"e+\" || $grade === \"e-\"){\r\n\t\t\t$points = 0.00;\r\n\t\t}else{\r\n\t\t\t$points = 0.00;\r\n\t\t}\r\n\r\n\t\treturn $points;\r\n\t}", "function toigian_ps()\n {\n $uscln = $this->USCLN($this->tuso, $this->mauso);\n $this->tuso = $this->tuso/$uscln;\n $this->mauso = $this->mauso/$uscln;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asserts that `stdout` is empty
public function assertOutputEmpty($message = 'stdout was not empty') { $output = implode(PHP_EOL, $this->_out->messages()); $this->assertSame('', $output, $message); }
[ "public function testExecuteWithNoOutput()\n {\n $this->loadDataFixtures();\n\n $output = $this->executeCommand(\n $this->command,\n $this->commandName,\n array(\n '--no-output' => true\n )\n );\n $this->assertEquals('', $output);\n $output = $this->executeCommand($this->command, $this->commandName);\n $this->assertRegExp('/Nothing to do/', $output);\n }", "public function assertOutputEmpty(string $message = ''): void\n {\n $this->assertThat(null, new ContentsEmpty($this->_out->messages(), 'output'), $message);\n }", "public function testSubCommandsNoArguments() {\n\t\t$this->Shell->runCommand('subCommands', array());\n\t\t$output = $this->Shell->stdout->output;\n\n\t\t$expected = '';\n\t\t$this->assertEquals($expected, $output);\n\t}", "public function testExecuteWithNoCommands()\n {\n // call monitor\n $output = $this->callCommand();\n\n $this->assertEquals($this->noErrors, $output);\n }", "public function thereShouldBeNoOutput()\n {\n if ($this->getOutput() != \"\") {\n throw new \\Exception('Output has been detected: '.$this->getOutput());\n }\n }", "public function outputIsEmpty(): bool\n {\n return $this->output === '';\n }", "public function testAssertOutputContains(): void\n {\n $CommandTester = new CommandTester(new ExampleCommand());\n $CommandTester->execute([]);\n $CommandTester->assertOutputContains('hello!');\n\n $this->expectAssertionFailed('The output does not contain the string `hi!`');\n $CommandTester->assertOutputContains('hi!');\n }", "public function outputIsEmpty(): bool;", "#[@test]\n public function stdout() {\n $this->assertEquals('php://stdout', create(new File('php://stdout'))->getURI());\n }", "public function testExecuteWithoutCommands()\n {\n $output = $this->executeCommand($this->command, $this->commandName);\n\n $this->assertRegExp('/Nothing to do/', $output);\n }", "public function testOutputWithHeaderAndNoData(): void\n {\n $data = [\n ['Header 1', 'Header', 'Long Header'],\n ];\n $this->helper->output($data);\n $expected = [\n '+----------+--------+-------------+',\n '| <info>Header 1</info> | <info>Header</info> | <info>Long Header</info> |',\n '+----------+--------+-------------+',\n ];\n $this->assertEquals($expected, $this->stub->messages());\n }", "public function testQuietOutput() {\n\t\t$this->Shell->stdout->expects($this->once())->method('write')\n\t\t\t->with('Quiet', 1);\n\n\t\t$this->Shell->params['verbose'] = false;\n\t\t$this->Shell->params['quiet'] = true;\n\n\t\t$this->Shell->out('Verbose', 1, Shell::VERBOSE);\n\t\t$this->Shell->out('Normal', 1, Shell::NORMAL);\n\t\t$this->Shell->out('Quiet', 1, Shell::QUIET);\n\t}", "public function testNoContent() {\n $this->outputter->output(IApiOutputter::HTTP_OK, []);\n $this->assertEquals(IApiOutputter::HTTP_NO_CONTENT, http_response_code());\n }", "public function testQuietOutput() {\n\t\t$this->Shell->stdout->expects ( $this->once () )->method ( 'write' )->with ( 'Quiet', 1 );\n\t\t\n\t\t$this->Shell->params ['verbose'] = false;\n\t\t$this->Shell->params ['quiet'] = true;\n\t\t\n\t\t$this->Shell->out ( 'Verbose', 1, Shell::VERBOSE );\n\t\t$this->Shell->out ( 'Normal', 1, Shell::NORMAL );\n\t\t$this->Shell->out ( 'Quiet', 1, Shell::QUIET );\n\t}", "public function hasStdoutData(): bool\n\t{\n\t\treturn $this->_hasPipeData(1);\n\t}", "protected function assertResultIsEmpty()\n {\n $this->assertFalse($this->finisherState->getResult()->hasMessages());\n }", "public function test_podcast_produces_no_warning(): void\n {\n $this->assertSame(\n 'Writing RSS to: out.xml',\n implode('\\n', self::$output)\n );\n $this->assertSame(0, self::$returncode);\n }", "public function testIsEmptyResult()\n {\n $this->assertFalse($this->fixture->isEmptyResult());\n }", "public function dontSeeInShellOutput(string $text): void\n {\n $this->debug($this->output);\n TestCase::assertStringNotContainsString($text, $this->output);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'argument_metadata_factory' shared service.
protected function getArgumentMetadataFactoryService() { return $this->services['argument_metadata_factory'] = new \Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory(); }
[ "protected function getArgumentMetadataFactoryService()\n {\n return $this->privates['argument_metadata_factory'] = new \\Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory();\n }", "public function getArgumentsFactory()\n {\n return $this->argumentsFactory;\n }", "protected function argFactory()\n {\n return app(ArgumentFactory::class);\n }", "protected function getAccessArgumentsResolverService()\n {\n return $this->services['access_arguments_resolver'] = new \\Drupal\\Core\\Access\\AccessArgumentsResolver();\n }", "protected function getFrameworkExtraBundle_ArgumentNameConvertorService()\n {\n return $this->privates['framework_extra_bundle.argument_name_convertor'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ArgumentNameConverter(($this->privates['argument_metadata_factory'] ?? ($this->privates['argument_metadata_factory'] = new \\Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory())));\n }", "public function getMetadataFactory()\n {\n return $this->metadataFactory;\n }", "protected function getFrameworkExtraBundle_ArgumentNameConvertorService()\n {\n return $this->services['framework_extra_bundle.argument_name_convertor'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ArgumentNameConverter(${($_ = isset($this->services['argument_metadata_factory']) ? $this->services['argument_metadata_factory'] : $this->services['argument_metadata_factory'] = new \\Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory()) && false ?: '_'});\n }", "public function getMetadataArguments()\n {\n return $this->getCallableArguments()->sort(function (Argument $a, Argument $b) {\n if ($a->getName() === $this->getBindingParameterName()) {\n return -1;\n }\n\n if ($b->getName() === $this->getBindingParameterName()) {\n return 1;\n }\n\n return 0;\n })->filter(function ($argument) {\n if ($argument instanceof PrimitiveArgument || $argument instanceof ValueArgument || $argument instanceof CollectionArgument) {\n return true;\n }\n\n if (($argument instanceof EntitySetArgument || $argument instanceof EntityArgument) && $this->getBindingParameterName() === $argument->getName()) {\n return true;\n }\n\n return false;\n });\n }", "protected function getSecurity_Extra_MetadataFactoryService()\n {\n $this->services['security.extra.metadata_factory'] = $instance = new \\Metadata\\MetadataFactory(new \\Metadata\\Driver\\LazyLoadingDriver($this, 'security.extra.metadata_driver'), new \\Metadata\\Cache\\FileCache('/home/jenkins/jobs/Release/workspace/app/cache/dev/jms_security', true));\n\n $instance->setIncludeInterfaces(true);\n\n return $instance;\n }", "protected function getArgumentResolver_ServiceService()\n {\n return $this->services['argument_resolver.service'] = new \\Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\ServiceValueResolver(new \\Symfony\\Component\\DependencyInjection\\ServiceLocator(array('AppBundle\\\\Controller\\\\Api\\\\SecurityApiController:setViewHandler' => function () {\n return ${($_ = isset($this->services['service_locator.182f5c5b079727c046caf1a16a7b23a8']) ? $this->services['service_locator.182f5c5b079727c046caf1a16a7b23a8'] : $this->getServiceLocator_182f5c5b079727c046caf1a16a7b23a8Service()) && false ?: '_'};\n }, 'AppBundle\\\\Controller\\\\Api\\\\SecurityApiController::setViewHandler' => function () {\n return ${($_ = isset($this->services['service_locator.182f5c5b079727c046caf1a16a7b23a8']) ? $this->services['service_locator.182f5c5b079727c046caf1a16a7b23a8'] : $this->getServiceLocator_182f5c5b079727c046caf1a16a7b23a8Service()) && false ?: '_'};\n })));\n }", "protected function getPlugin_Manager_Views_ArgumentService()\n {\n return $this->services['plugin.manager.views.argument'] = new \\Drupal\\views\\Plugin\\ViewsHandlerManager('argument', $this->get('container.namespaces'), $this->get('views.views_data'), $this->get('cache.discovery'), $this->get('module_handler'));\n }", "protected function getSecurity_Extra_MetadataFactoryService()\n {\n $this->services['security.extra.metadata_factory'] = $instance = new \\Metadata\\MetadataFactory(new \\Metadata\\Driver\\LazyLoadingDriver($this, 'security.extra.metadata_driver'));\n\n $instance->setCache(new \\Metadata\\Cache\\FileCache((__DIR__.'/jms_security'), true));\n $instance->setIncludeInterfaces(true);\n\n return $instance;\n }", "protected function getJmsDiExtra_Metadata_MetadataFactoryService()\n {\n $this->services['jms_di_extra.metadata.metadata_factory'] = $instance = new \\Metadata\\MetadataFactory(new \\Metadata\\Driver\\LazyLoadingDriver($this, 'jms_di_extra.metadata_driver'), 'Metadata\\\\ClassHierarchyMetadata', true);\n\n $instance->setCache(new \\Metadata\\Cache\\FileCache('/home/jenkins/jobs/Release/workspace/app/cache/dev/jms_diextra/metadata'));\n\n return $instance;\n }", "private function getMetadataFactory()\n {\n return new LazyMetadataFactory(new AnnotationLoader(new AnnotationReader()));\n }", "public function classMetadataFactory()\n {\n return $this->metadataFactory;\n }", "protected function createArgumentDescriptorMock()\n {\n $tag = m::mock('phpDocumentor\\\\Descriptor\\\\ArgumentDescriptor');\n $tag->shouldReceive('getLine')->andReturn(100);\n $tag->shouldReceive('getName')->andReturn('name');\n $tag->shouldIgnoreMissing();\n\n return $tag;\n }", "public function getContextDefinition() {\n return $this->getPlugin('argument_validator')->getContextDefinition();\n }", "private function getCookieMetadataFactory()\n {\n if (!$this->cookieMetadataFactory) {\n $this->cookieMetadataFactory = ObjectManager::getInstance()->get(CookieMetadataFactory::class);\n }\n return $this->cookieMetadataFactory;\n }", "public function getMetadataFactory() : ClassMetadataFactory\n {\n return $this->metadataFactory;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility methods Adds all the Agave environment variables used by the SDK into the environment with fake values.
private function setFakeAgaveEnvironmentVariables() { /** @var Client $client */ $client = $this->getFakeClient(); $token = $this->getFakeToken(); putenv('AGAVE_CACHE_DIR=' . sys_get_temp_dir() . '/' . uniqid().'/'); putenv('AGAVE_BASE_URL='. AuthCacheUtilTest::DEFAULT_BASE_URL_VALUE); putenv('AGAVE_DEV_URL=' . AuthCacheUtilTest::DEFAULT_DEV_URL_VALUE); putenv('AGAVE_USERNAME=' . AuthCacheUtilTest::DEFAULT_USERNAME_VALUE); putenv('AGAVE_CLIENT_NAME=' . $client->getName()); putenv('AGAVE_CLIENT_KEY=' . $client->getKey()); putenv('AGAVE_CLIENT_SECRET=' . $client->getSecret()); putenv('AGAVE_TENANT=' . AuthCacheUtilTest::DEFAULT_TENANT_ID_VALUE); putenv('AGAVE_ACCESS_TOKEN=' . $token->getAccessToken()); putenv('AGAVE_REFRESH_TOKEN=' . $token->getRefreshToken()); }
[ "public function setInitialEnvironmentVariables()\n {\n $vars = new EnvVars();\n\n if ($this->project->isLaravel()) {\n $appKey = 'base64:' . base64_encode(Encrypter::generateKey(config('app.cipher')));\n\n $vars->inject([\n 'APP_NAME' => $this->project->name,\n 'APP_ENV' => $this->name,\n 'APP_KEY' => $appKey,\n ]);\n }\n\n $this->environmental_variables = $vars->toString();\n $this->save();\n }", "public function setEnvVariables();", "static function reifyEnvironment() {\n\t\tforeach (static::$exports as $ekey => $eval) { // Environment variables\n\t\t\tputenv(\"$ekey=$eval\");\n\t\t}\n\t\tforeach (static::$ini_settings as $key => $val) { // PHP .ini settings\n\t\t\tini_set($key, $val);\n\t\t}\n\t}", "public function testCreateEnvironmentVariables()\n {\n }", "function SetEnvVariables()\n {\n }", "protected function saveEnvironmentVariables()\n {\n $environManipulator = $this->environManipulatorFactory->getSystemManipulator();\n $environmentDeclaration = $this->dockerMachineCli->getEnvironmentDeclaration();\n\n if (!$environManipulator->has($environmentDeclaration)) {\n $environManipulator->save($environmentDeclaration);\n }\n }", "public function environmentVariable();", "public static function enablePutenv(): void\n {\n static::$putenv = true;\n static::$factory = null;\n static::$variables = null;\n }", "protected static function addEnvironmentSettings() {\n File::replaceContent(self::$config_silverstripe_environment, '[database_server]', self::$project_database_server);\n File::replaceContent(self::$config_silverstripe_environment, '[database_name]', self::$project_database_name);\n File::replaceContent(self::$config_silverstripe_environment, '[database_username]', self::$project_database_username);\n File::replaceContent(self::$config_silverstripe_environment, '[database_password]', self::$project_database_password);\n File::replaceContent(self::$config_silverstripe_environment, '[environment_type]', self::$project_environment_type);\n File::replaceContent(self::$config_silverstripe_environment, '[default_admin_username]', self::$default_admin_username);\n File::replaceContent(self::$config_silverstripe_environment, '[default_admin_password]', self::$default_admin_password);\n File::replaceContent(self::$config_silverstripe_environment, '[domain]', self::$domain);\n File::replaceContent(self::$config_silverstripe_environment, '[root_dir_web]', '\"'.self::$root_dir_web.self::$froxlor_username.'/'.self::$domain.'\"');\n }", "public function testUpdateEnvironmentVariables()\n {\n }", "protected static function initializeEnvironment() {\n\t\t$env = array(\n\t\t\t\t'CIAPI_ENDPOINT' => self::$endpoint, 'CIAPI_USERNAME' => self::$userName,\n\t\t\t\t'CIAPI_PASSWORD' => self::$password\n\t\t);\n\t\tarray_walk($env,\n\t\t\t\tfunction (&$value, $key) {\n\t\t\t\t\t$envValue = getenv($key);\n\t\t\t\t\tif ($envValue) {\n\t\t\t\t\t\t$value = $envValue;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tself::$endpoint = $env['CIAPI_ENDPOINT'];\n\t\tself::$userName = $env['CIAPI_USERNAME'];\n\t\tself::$password = $env['CIAPI_PASSWORD'];\n\t}", "private function setEnvDefaults()\n {\n $class = \"Druidfi\\Omen\\EnvDefaults\\\\\". ucfirst($this->app_env) .\"Defaults\";\n $env_defaults = (new $class())->getDefaults();\n\n foreach ($env_defaults as $set => $values) {\n if (!is_array($this->{$set})) {\n $this->{$set} = [];\n }\n\n $this->{$set} = array_merge($this->{$set}, $values);\n }\n }", "private function mainEnv(): void\n {\n foreach (Config::STRUCTURE as $configKey) {\n if ($val = $this->config->get($configKey)) {\n $key = strtoupper(str_replace('-', '_', $configKey));\n $val = is_array($val) ? implode(' ', array_flatten($val)) : $val;\n $envData[$key] = $val;\n }\n }\n\n $envData['HOST_HOSTNAME'] = 'host.docker.internal';\n $envData['WEB_SERVER_VHOST'] = SwitchWebServerCommand::getConf($envData['WEB_SERVER']);\n $envData['PHP_VERSION_X10'] = $envData['PHP_VERSION'] == '7.0' ? '7' : $envData['PHP_VERSION'] * 10;\n\n $dockerRoot = '/app';\n $dockerRoot .= array_key_exists('PUBLIC_PATH', $envData) ? add_slash($envData['PUBLIC_PATH']) : '/app/public';\n $envData['PUBLIC_PATH'] = $dockerRoot;\n\n $this->dotenv->populate($envData, true);\n }", "protected function overrideEnvironmentVariables()\n {\n if (!isset($this->options->filtered['configuration'])) {\n return;\n }\n\n $variables = $this->options->filtered['configuration']->getEnvironmentVariables();\n\n foreach ($variables as $key => $value) {\n \\putenv(\\sprintf('%s=%s', $key, getenv($key, true) ?: $value));\n\n $_ENV[$key] = getenv($key, true) ?: $value;\n }\n }", "public function loadIntoENV(): void;", "public static function updateEnv(): void {\n self::$env = [];\n self::loadEnv();\n }", "protected function setUp()\n {\n foreach (self::$names as $name) {\n putenv($name);\n }\n\n $_SERVER['argv'] = self::$argv;\n }", "function init_env() {\n $envs_filename = base_path().DIRECTORY_SEPARATOR.'.env';\n $envs = $envs_array = [];\n \n if ($ressources = fopen($envs_filename, 'r')) {\n while (!feof($ressources)) {\n $element = fgets($ressources);\n\n if (!empty(trim($element))) {\n $element_array = explode('=', $element);\n $envs_array[$element_array[0]] = $element_array[1];\n }\n\n $envs[] = $element;\n }\n\n fclose($ressources);\n }\n\n $_ENV = array_merge($envs_array, $_ENV);\n }", "protected function appendToEnvFile(): void\n {\n\n (new Filesystem())->append('.env',PHP_EOL);\n\n (new Filesystem())->append('.env',PHP_EOL);\n (new Filesystem())->append('.env','LARASCORD_CLIENT_ID='.$this->clientId);\n\n (new Filesystem())->append('.env',PHP_EOL);\n (new Filesystem())->append('.env','LARASCORD_CLIENT_SECRET='.$this->clientSecret);\n\n (new Filesystem())->append('.env',PHP_EOL);\n (new Filesystem())->append('.env','LARASCORD_GRANT_TYPE=authorization_code');\n\n (new Filesystem())->append('.env',PHP_EOL);\n (new Filesystem())->append('.env','LARASCORD_PREFIX='.$this->prefix);\n\n (new Filesystem())->append('.env',PHP_EOL);\n (new Filesystem())->append('.env','LARASCORD_SCOPE=identify&email');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If this property can be lazy loaded if the dependency injection mechanism offers that.
public function isLazyLoading() { return $this->lazyLoading; }
[ "public function getPropertyLazyLoaded()\n {\n return $this->propertyLazyLoaded;\n }", "public function isLazyLoadableObject()\n {\n return $this->lazyLoadable;\n }", "public function getLazy(): bool\n {\n return $this->lazy;\n }", "public function isLazy()\n {\n return $this->_Lazy;\n }", "public function isLazy();", "abstract protected function load_lazy_property( $property );", "public function isLazy()\n {\n $this->procedure = 'http_lazy';\n }", "abstract public function lazyLoad();", "abstract protected function get_lazy_properties();", "public function getLazyLoading()\n {\n return $this->lazyLoading;\n }", "protected function lazyLoadInitiated(): bool\n {\n return $this->lazyLoadInitiated === true;\n }", "public function __getLazyProperties()\n {\n // TODO: Implement __getLazyProperties() method.\n }", "function isLoaded() \n {\n return $this->isLoaded;\n }", "public function isLazyLoadable($objectKey);", "public function isLazy() {\n $this->getSchema();\n return isset($this->schema['L']);\n }", "public function isEagerLoaded()\n {\n return $this->_eagerLoaded;\n }", "public function testLazyLoad ()\n {\n $this->assertFalse($this->model->loaded);\n $this->assertTrue(isset($this->model->key));\n }", "public function __hasPropertyGetter($property);", "protected function loadProperties()\n\t{\n\t\tif ($this->hasId() && $this->lazyLoad && !$this->loaded) {\n\t\t\t$this->loaded = true;\n\t\t\t$this->load();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current login user type web or manager
public function getLoginUserType() { if (isset ($_SESSION['mgrValidated'])) { return 'manager'; } return ''; }
[ "function getUserType() {\n\tif($_SESSION['login'] == \"admin\")\n\t\treturn \"admin\";\n\telseif(isset($_SESSION['doctor']))\n\t\treturn \"doctor\";\n\telseif(isset($_SESSION['login']))\n\t\treturn \"receptionist\";\n\n\t//Not a valid user type\n\treturn null;\n\n}", "public function get_login_type() {\n\tif ( !is_numeric($this->id) || (int)$this->id <= 0) return;\n\t$sql = \"SELECT `login_type` FROM `users` WHERE `id`={$this->id} AND `active`=1 LIMIT 1\";\n\t$res = $this->db->query($sql)->result();\n\t\n\tif (empty($res) || empty($res[0]) || !isset($res[0]->login_type) || $res[0]->login_type == null) return;\n\t\n\treturn $res[0]->login_type;\n }", "public function getUserType();", "function check_user_type(){\n $type=auth()->user()->user_type;\n return $type;\n }", "function user_type() {\n\tif(isset($_SESSION['type']))\n\t\treturn $_SESSION['type'];\n\telse\n\t\treturn null;\n}", "public function getUserType()\n {\n return $this->user_type;\n }", "public static function getUserType() {\n return self::$_user_type_id;\n }", "function getUsertype(){\n $user = $this->loadUser(Yii::app()->user->id);\n \n if(Yii::app()->user->id == 0)\n { \n \n return \"guest\"; \n }\n else \n return \"user\";\n}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public function getUserType()\n {\n return $this->_userType;\n }", "public function getUserLogin()\n {\n return $this->{$this->getUserLoginName()};\n }", "function get_current_or_network_user() {\n return ( $this->_user instanceof FS_User ) ?\n $this->_user :\n $this->get_network_user();\n }", "function get_user_type() {\n $user_level = get_session( 'user_level' );\n if( $user_level == '' ) $user_type = 'visitor' ;\n else if( $user_level >= 5 ) $user_type = 'admin' ;\n else if( $user_level >= 2 ) $user_type = 'member' ;\n else if( $user_level >= 0 ) $user_type = 'guest' ;\n else $user_type = 'visitor' ;\n\n if( $user_type == 'member' and user_has_tag( 'core' ))\n return 'core';\n\n return $user_type;\n}", "function is_user_type($type) \n {\n $ci =& get_instance();\n $user = $ci->users->get_user();\n return ($user['auth_type'] == 'admin' || $user['auth_type'] == $type);\n }", "public function get_login_user_id()\n\t{\n\t\n\t\treturn 1;\n\t}", "private function getSessUserType()\n\t{\n\t\t// Create the Session Variable Name\n\t\t$session_variable_name = $this->construct_session_variable_name('user_type');\n\t\treturn isset($_SESSION[$session_variable_name]) ? $_SESSION[$session_variable_name] : null;\n\t}", "function getUserTypeString($type){\n switch ($type) {\n case 0:\n return 'admin';\n case 1:\n return 'instractor';\n case 2:\n return 'qa_member';\n case 3:\n return 'department_manager';\n case 4:\n return 'waiting user';\n default:\n return 'non-registered user';\n }\n }", "public function getUserType() : string;", "public function _fetchLoginType()\n\t{\n\t\t$loginType = 'username';\n\n\t\t$this->DB->build( array( 'select' => '*', 'from' => 'conf_settings', 'where' => \"conf_key IN('ipbli_usertype','converge_login_method')\", 'order' => 'conf_key ASC' ) );\n\t\t$this->DB->execute();\n\n\t\twhile( $r = $this->DB->fetch() )\n\t\t{\n\t\t\t$r['conf_value'] = $r['conf_value'] ? $r['conf_value'] : $r['conf_default'];\n\n\t\t\tif ( $r['conf_value'] )\n\t\t\t{\n\t\t\t\t$loginType = $r['conf_value'];\n\t\t\t}\n\t\t}\n\n\t\treturn $loginType;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field type_sort
public function getTypeSort() { return $this->type_sort; }
[ "protected function _getSortType() {}", "abstract protected function _getSortType();", "function _media_get_sort_type() {\n return _media_get_display_param('sort', array('default' => 'name', 'date'));\n}", "private function getSortType()\n {\n $sortType = request()->get('sort_type', $this->sortType);\n\n return in_array($sortType, ['asc', 'desc'])\n ? $sortType\n : $this->sortType;\n }", "public function getSortValue() {}", "public function field()\n {\n return 'sort';\n }", "public function sortKeyType()\n {\n return 'string';\n }", "protected function getAttributeSortFieldType(Mage_Eav_Model_Entity_Attribute $attribute)\n {\n $columns = $attribute->getFlatColumns();\n if (!isset($columns[$attribute->getSortColumnField()])) {\n return 'sort-string';\n }\n $sqltype = $columns[$attribute->getSortColumnField()]['type'];\n switch (true) {\n case strpos($sqltype, 'smallint') === 0:\n case strpos($sqltype, 'tinyint') === 0:\n case strpos($sqltype, 'int') === 0:\n case strpos($sqltype, 'decimal') === 0:\n {\n return SmartDevs_ElastiCommerce_IndexDocument::SORT_NUMBER;\n }\n case strpos($sqltype, 'datetime') === 0:\n case strpos($sqltype, 'timestamp') === 0:\n {\n return SmartDevs_ElastiCommerce_IndexDocument::SORT_DATE;\n }\n default:\n {\n return SmartDevs_ElastiCommerce_IndexDocument::SORT_STRING;\n }\n }\n }", "public function getSortField()\n {\n return $this->field;\n }", "public function _get_sort_field() {\r\n return $this->__sort_field_name;\r\n }", "public function orderType();", "function getSortField() {\n \treturn $this->sSortField;\n }", "public function getSort()\n {\n $value = $this->get(self::sort);\n return $value === null ? (integer)$value : $value;\n }", "public function getDisputeSortType()\n {\n return $this->disputeSortType;\n }", "public function getSortField()\n {\n return $this->sortField;\n }", "function sortByType();", "function getSort() {\n $sort = 'name';\n if (isset($this->data['sort'])) {\n switch ($this->data['sort']) {\n case 0:\n case 1:\n $sort = 'title';\n break;\n case 2 :\n case 3 :\n $sort = 'date';\n break;\n case 4 :\n case 5 :\n $sort = 'sort';\n break;\n }\n }\n return $sort;\n }", "public function getSortingField()\n {\n $result = null;\n /**\n * Just prior to getting the configured sorting field.\n *\n * @delegate SectionGetSortingField\n * @since Symphony 3.0.0\n * @param string $context\n * '/publish/'\n * @param string $section-handle\n * The handle of the current section\n * @param string &$field\n * The field as set by extensions\n */\n Symphony::ExtensionManager()->notifyMembers('SectionGetSortingField', '/publish/', array(\n 'section-handle' => $this->get('handle'),\n 'field' => &$result,\n ));\n\n if (!$result) {\n $result = Symphony::Configuration()->get('section_' . $this->get('handle') . '_sortby', 'sorting');\n }\n\n return (!$result ? $this->getDefaultSortingField() : (string)$result);\n }", "public function getSortFields() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of filterByFields.
public function getFilterByFields() { return $this->filterByFields; }
[ "protected function getFilterFields()\n {\n return $this->transform->getField(\n $this->scopeIdentifier\n );\n }", "public function getFilterValue();", "public function getValueFilter ()\n {\n return $this->valueFilter;\n }", "public function filterFields()\n {\n return property_exists($this, 'filterable') ? $this->filterable : [];\n }", "public function getFldFilter ()\n {\n return $this->fld_filter;\n }", "public function getFieldFilter()\n {\n return $this->readOneof(2);\n }", "public function filterableFields() {\n\t\treturn static::FILTERABLE_FIELDS;\n\t}", "public function get_filter_value() {\r\n\t\treturn $this->filter_object->get_value();\r\n\t}", "public function getFilterValue(): string;", "public function get_filtering()\r\n\t{\r\n\t\treturn $this->filtering->get_value();\r\n\t}", "public static function getFilterableFields(): array;", "public function getFilterValue ()\n {\n return $this->filterValue;\n }", "abstract protected function filterFieldvalue();", "public function getFilterValue( $fieldName ){\n\t\t$value = null;\n\t\tforeach ($this->filters as $key => $field_op_value) {\n\t\t\t$field = $field_op_value['field'];\n\t\t\tif($fieldName==$field)\n\t\t\t\t$value = $field_op_value['value'];\n\t\t}\n\t\treturn $value;\n\t}", "public function getAvailableFilterFields(): array;", "private function getFilterFormValue() {\n if(App::request()->getHeaders('X-List-Filter-' . $this->id)) {\n App::session()->getUser()->setOption('main.list-filter-' . $this->id, App::request()->getHeaders('X-List-Filter-' . $this->id));\n\n $result = json_decode(App::request()->getHeaders('X-List-Filter-' . $this->id), true);\n }\n elseif(App::session()->getUser()->getOptions('main.list-filter-' . $this->id)) {\n $result = json_decode(App::session()->getUser()->getOptions('main.list-filter-' . $this->id), true);\n }\n else {\n $result = array();\n }\n\n return $result;\n }", "function getFilterData() {\n $vars = array();\n foreach ($this->getFields() as $f) {\n $tag = 'field.'.$f->get('id');\n if ($d = $f->getFilterData()) {\n if (is_array($d)) {\n foreach ($d as $k=>$v) {\n if (is_string($k))\n $vars[\"$tag$k\"] = $v;\n else\n $vars[$tag] = $v;\n }\n }\n else {\n $vars[$tag] = $d;\n }\n }\n }\n return $vars;\n }", "public function getFilterValueName(): string;", "private function get_current_filter_values_from_post() {\n $request = \\Config\\Services::request();\n if ($request->getPost('qf_rel_sel')) {\n $filter_values = array();\n foreach ($this->qf_field_names as $name) {\n $xar = $request->getPost($name);\n for ($i = 0; $i < count($xar); $i++) {\n $filter_values[$i][$name] = trim($xar[$i]);\n }\n }\n return $filter_values;\n } else {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests linkTo with named array as a parameter
public function testLinkToNamedArrayParameter() { $this->specify( "linkTo with named array parameter returns invalid HTML", function () { Tag::resetInput(); $options = [ 'action' => 'x_url', 'text' => 'x_name', 'class' => 'x_class', ]; $expected = '<a href="/x_url" class="x_class">x_name</a>'; $actual = Tag::linkTo($options); expect($actual)->equals($expected); } ); }
[ "public function testLinkToWithComplexRemoteUrl()\n {\n $this->specify(\n \"linkTo with complex remote URL string parameter returns invalid HTML\",\n function () {\n Tag::resetInput();\n $url = \"http://phalconphp.com/en/\";\n $name = 'x_name';\n $actual = Tag::linkTo($url, $name, false);\n $expected = '<a href=\"http://phalconphp.com/en/\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"linkTo with complex remote URL array parameter returns invalid HTML\",\n function () {\n Tag::resetInput();\n $options = [\n \"http://phalconphp.com/en/\",\n 'x_name',\n false,\n ];\n $actual = Tag::linkTo($options);\n $expected = '<a href=\"http://phalconphp.com/en/\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"linkTo with complex remote URL array named parameter returns invalid HTML\",\n function () {\n Tag::resetInput();\n $options = [\n \"http://phalconphp.com/en/\",\n 'text' => 'x_name',\n 'local' => false,\n ];\n $actual = Tag::linkTo($options);\n $expected = '<a href=\"http://phalconphp.com/en/\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"linkTo with mailto URL string parameter returns invalid HTML\",\n function () {\n Tag::resetInput();\n $url = \"mailto:someone@phalconphp.com\";\n $name = 'someone@phalconphp.com';\n $actual = Tag::linkTo($url, $name, false);\n $expected = '<a href=\"mailto:someone@phalconphp.com\">someone@phalconphp.com</a>';\n\n expect($actual)->equals($expected);\n }\n );\n }", "public function testLinkToWithComplexLocalUrl()\n {\n $this->specify(\n \"linkTo with complex local URL string parameter returns invalid HTML\",\n function () {\n\n PhTTag::resetInput();\n $url = \"x_action/x_param\";\n $name = 'x_name';\n $actual = PhTTag::linkTo($url, $name);\n $expected = '<a href=\"/x_action/x_param\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"linkTo with complex local URL array parameter returns invalid HTML\",\n function () {\n\n PhTTag::resetInput();\n $options = [\n \"x_action/x_param\",\n 'x_name',\n ];\n $actual = PhTTag::linkTo($options);\n $expected = '<a href=\"/x_action/x_param\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"linkTo with complex local URL array named parameter returns invalid HTML\",\n function () {\n\n PhTTag::resetInput();\n $options = [\n \"x_action/x_param\",\n 'x_name',\n 'class' => 'x_class'\n ];\n $actual = PhTTag::linkTo($options);\n $expected = '<a href=\"/x_action/x_param\" class=\"x_class\">x_name</a>';\n\n expect($actual)->equals($expected);\n }\n );\n }", "public function fakeLinks($links = [Members::LINK_SELF => ['url']]);", "public function testLinkRenderArrayText() {\n /** @var \\Drupal\\Core\\Render\\RendererInterface $renderer */\n $renderer = $this->container->get('renderer');\n\n // Build a link with the link generator for reference.\n $l = Link::fromTextAndUrl('foo', Url::fromUri('https://www.drupal.org'))->toString();\n\n // Test a renderable array passed to the link generator.\n $renderer->executeInRenderContext(new RenderContext(), function () use ($renderer, $l) {\n $renderable_text = ['#markup' => 'foo'];\n $l_renderable_text = \\Drupal::service('link_generator')->generate($renderable_text, Url::fromUri('https://www.drupal.org'));\n $this->assertEquals($l, $l_renderable_text);\n });\n\n // Test a themed link with plain text 'text'.\n $type_link_plain_array = [\n '#type' => 'link',\n '#title' => 'foo',\n '#url' => Url::fromUri('https://www.drupal.org'),\n ];\n $type_link_plain = $renderer->renderRoot($type_link_plain_array);\n $this->assertEquals($l, $type_link_plain);\n\n // Build a themed link with renderable 'text'.\n $type_link_nested_array = [\n '#type' => 'link',\n '#title' => ['#markup' => 'foo'],\n '#url' => Url::fromUri('https://www.drupal.org'),\n ];\n $type_link_nested = $renderer->renderRoot($type_link_nested_array);\n $this->assertEquals($l, $type_link_nested);\n }", "public function testLink()\n {\n $attribs = array('foo' => 'bar');\n $actual = $this->_view->link($attribs);\n $expect = '<link foo=\"bar\" />';\n $this->assertSame($actual, $expect);\n }", "public function testLinkToWithStringAsURLAndName()\n {\n $this->specify(\n \"linkTo with string as URL and name returns invalid HTML\",\n function () {\n\n PhTTag::resetInput();\n $url = 'x_url';\n $name = 'x_name';\n\n $expected = '<a href=\"/x_url\">x_name</a>';\n $actual = PhTTag::linkTo($url, $name);\n\n expect($actual)->equals($expected);\n }\n );\n }", "public function testCustomTargetBindingKeyLink(): void\n {\n $this->getTableLocator()->get('ArticlesTags')\n ->belongsTo('SpecialTags', [\n 'bindingKey' => 'tag_id',\n 'foreignKey' => 'tag_id',\n ]);\n\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('SpecialTags', [\n 'through' => 'ArticlesTags',\n 'targetForeignKey' => 'tag_id',\n ]);\n\n $specialTag = $table->SpecialTags->newEntity([\n 'article_id' => 2,\n 'tag_id' => 2,\n ]);\n $table->SpecialTags->save($specialTag);\n\n $article = $table->get(2);\n $this->assertTrue($table->SpecialTags->link($article, [$specialTag]));\n\n $results = $table->find()\n ->contain('SpecialTags')\n ->where(['id' => 2])\n ->toArray();\n\n $this->assertCount(1, $results);\n $this->assertCount(3, $results[0]->special_tags);\n }", "public function testLinkWithAribtraryAttributes() {\n\t\t$this->_useMock();\n\n\t\t$options = array('id' => 'something', 'htmlAttributes' => array('arbitrary' => 'value', 'batman' => 'robin'));\n\t\t$result = $this->Js->link('test link', '/posts/view/1', $options);\n\t\t$expected = array(\n\t\t\t'a' => array('id' => $options['id'], 'href' => '/posts/view/1', 'arbitrary' => 'value',\n\t\t\t\t'batman' => 'robin'),\n\t\t\t'test link',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testSetParametersMultipleCalls()\n {\n $link = new Link('http://a.idio.co/r?a=1');\n $link->setParameters(\n array(\n 'b' => 2\n )\n );\n $link->setParameters(\n array(\n 'c' => 3\n )\n );\n $this->assertEquals(\n 'http://a.idio.co/r?a=1&b=2&c=3',\n $link->get(),\n \"Expecting the array parameter to be overwritten\"\n );\n }", "abstract public function clickLink($locator);", "public function testListSharedLinks()\n {\n }", "public function testLinkCompanyIndustries()\n {\n }", "public function tagStylesheetLinkArrayParameterRemote(UnitTester $I)\n {\n $I->wantToTest('Tag - stylesheetLink() - array parameter for a remote link');\n\n Tag::resetInput();\n\n $options = ['http://phalcon.io/css/phalcon.css'];\n $expected = '<link rel=\"stylesheet\" type=\"text/css\" href=\"http://phalcon.io/css/phalcon.css\" />' . PHP_EOL;\n\n Tag::setDocType(\n Tag::XHTML10_STRICT\n );\n\n $actual = Tag::stylesheetLink($options, false);\n\n $I->assertEquals($expected, $actual);\n\n Tag::resetInput();\n\n $options = ['http://phalcon.io/css/phalcon.css'];\n $expected = '<link rel=\"stylesheet\" type=\"text/css\" href=\"http://phalcon.io/css/phalcon.css\">' . PHP_EOL;\n\n Tag::setDocType(\n Tag::HTML5\n );\n\n $actual = Tag::stylesheetLink($options, false);\n\n $I->assertEquals($expected, $actual);\n }", "public function testClickLinksSort()\n { \n $sortNames = ['name', 'email'];\n $this->browse(function (Browser $browser) use ($sortNames) {\n $browser->loginAs($this->user)\n ->visit('/admin/users');\n foreach ($sortNames as $name) {\n $browser->click(\"#link-sort-$name a\")\n ->assertQueryStringHas('sort', $name)\n ->assertQueryStringHas('order', 'asc')\n ->click(\"#link-sort-$name a\")\n ->assertQueryStringHas('sort', $name)\n ->assertQueryStringHas('order', 'desc');\n }\n });\n }", "public function testUrlArray(): void\n {\n $expected = [\n 'controller' => 'Bookmarks',\n 'action' => 'view',\n 'plugin' => false,\n 'prefix' => false,\n ];\n $this->assertSame($expected, urlArray('Bookmarks::view'));\n\n $expected = [\n 'controller' => 'Bookmarks',\n 'action' => 'view',\n 'prefix' => 'Admin',\n 'plugin' => false,\n ];\n $this->assertSame($expected, urlArray('Admin/Bookmarks::view'));\n\n $expected = [\n 'controller' => 'Articles',\n 'action' => 'view',\n 'plugin' => 'Vendor/Cms',\n 'prefix' => 'Management/Admin',\n 3,\n '?' => ['query' => 'string'],\n ];\n $params = [3, '?' => ['query' => 'string']];\n $this->assertSame($expected, urlArray('Vendor/Cms.Management/Admin/Articles::view', $params));\n }", "public function testListTargetAssociations()\n {\n }", "function testTextLinkCreation() {\r\n $SUT = new Grid_Link;\r\n $SUT->action('controller/method')->text('someText');\r\n $link = $SUT->render();\r\n $expected = html::anchor('controller/method', 'someText');\r\n $this->assertEquals($expected, $link);\r\n }", "public function testGetIdentityLinksForFamily()\n {\n }", "#[@test]\n public function bindArrayKey() {\n $this->fixture->bind('test', array('first' => 1, 'second' => 2));\n \n $this->assertEquals(1, $this->fixture->getBinding('test[first]'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Returns the FLV url for this Dalealplay video
public function getFLV() { //"http://videos.dalealplay.com/contenidos3/#{CGI::parse(URI::parse(embed_url).query)['file']}" if (!isset($this->FLV)) { $this->FLV = ''; } return $this->FLV; }
[ "public function getVideoUrl()\n {\n $systemConfig = $this->_site->getSystemConfig();\n $videoDomainURL = $systemConfig->getSetting( 'AWS_VIDEO_CLOUD_FRONT_URI' );\n $url = $videoDomainURL . $this->getFilename();\n\n return $url;\n }", "public function getVideoUrlAttribute(): string\n {\n return Storage::url($this->video);\n }", "public function get_video_url()\n {\n if(!$this->_verifyValidID()) { return FALSE; }\n\n $id = $this->get_video_id();\n\n if($this->_video_type == 'youtube') {\n return 'https://www.youtube.com/watch?v=' . $id;\n } else if($this->_video_type == 'vimeo') {\n return 'https://vimeo.com/' . $id;\n }\n }", "public function getVideoUrl() {\n return $this->video_url;\n }", "public function getVideoUri()\n {\n return $this->video_uri;\n }", "public function getVideoUrl()\n {\n return $this->videoUrl;\n }", "public function get_mp4_url() {\n\n // let's check that the video object has been loaded already. This function\n // is useless without it.\n if (!isset($this->video_url) && $this->video_url==\"\") {\n $this->tattle(\"coreapi object must be populated before calling get_mp4_url\");\n return false;\n }\n\n // replace video_url RTMP location with HTTP location.\n $mp4_url = str_replace('rtmp://fms', 'http://wpc', $this->video_url);\n\n return $mp4_url;\n\n }", "public function getVideoHlsFileUrl(Video $video): ?string {\n if (!$video->m3u8) return null;\n\n $token = $this->generateToken('playback');\n $query = [\n 'clientId' => $this->clientId,\n 'timestamp' => $token['timestamp'],\n 'token' => $token['token']\n ];\n return $video->m3u8 . '?' . http_build_query($query);\n }", "public function getHLSPlaylistUrl()\n {\n $systemConfig = $this->_site->getSystemConfig();\n $videoDomainURL = $systemConfig->getSetting( 'AWS_VIDEO_CLOUD_FRONT_URI' );\n\n $isHLS = $this->_daVideo->getHLSFormat( $this->getId() );\n if( $isHLS ) {\n $pathInfo = pathinfo( $this->getFilename() );\n $output_prefix = $pathInfo['filename'];\n $url = $videoDomainURL . $output_prefix . \"/\" . $this->getHLSPlaylistname();\n }else {\n return null;\n }\n return $url;\n }", "public function getStartVideoUri()\n {\n $oFieldVideo = AM_Model_Db_Table_Abstract::factory('field')\n ->findOneBy(array('name' => AM_Model_Db_FieldType::TYPE_VIDEO,\n 'template' => AM_Model_Db_Template::TPL_COVER_PAGE));\n\n $oElementVideo = AM_Model_Db_Table_Abstract::factory('element')\n ->findOneBy(array('page' => $this->id,\n 'field' => $oFieldVideo->id));\n /* @var $oElementVideo AM_Model_Db_Element */\n\n if (is_null($oElementVideo)) {\n return null;\n }\n\n $sResource = $oElementVideo->getResources()->getDataValue(AM_Model_Db_Element_Data_Resource::DATA_KEY_RESOURCE);\n\n if (empty($sResource)) {\n return null;\n }\n\n $sFileExtension = pathinfo($sResource, PATHINFO_EXTENSION);\n $sFileName = 'resource.' . $sFileExtension;\n\n $sUri = AM_Tools::getImageUrl('none', AM_Model_Db_Element_Data_Abstract::TYPE, $oElementVideo->id, $sFileName);\n\n return $sUri;\n }", "function the_header_video_url() {}", "public function getVideoLink() {\r\n return $this->videoLink;\r\n }", "function get_header_video_url()\n {\n }", "function getFeedUrl()\r\n\t{\r\n\t\treturn 'http://www.dailymotion.com/video/'.$this->getId();\r\n\t}", "function video_url_from_cdn($video_id){\n\nreturn $GLOBALS['cdn']['videos_standard'].\"/\".$video_id.\".\".$GLOBALS['format_convert_videos'];\n\n}", "function videoToURL($vinfo) {\n\n $url = remove_accents($vinfo['title']);\n //$url = strtolower( $url );\n $url = str_replace(' ', '-', $url);\n $url = preg_replace('/[^a-z0-9A-Z\\-]/', '', $url);\n $url = str_replace('--', '-', $url);\n\n $url = substr($url, 0, 80);\n\n if ($url[strlen($url) - 1] != '-')\n $url = $url . '-';\n\n $url = $url . $vinfo['id'];\n\n return $url;\n}", "protected function getVideoThumbnailUrl(): ?string {\n $first_media_json = reset($this->data['media_json']);\n\n $languages = [\n 'INT',\n mb_strtoupper(\\Drupal::languageManager()->getDefaultLanguage()->getId()),\n 'EN',\n ];\n $languages = array_merge($languages, $this->data['languages'] ?? []);\n $languages = array_unique(array_filter($languages));\n\n foreach ($languages as $langcode) {\n if (isset($first_media_json[$langcode]['THUMB'])) {\n return UrlHelper::parse($first_media_json[$langcode]['THUMB'])['path'] ?? NULL;\n }\n }\n\n return NULL;\n }", "public function getFeedUrl()\n\t{\n\t\treturn 'http://www.mtv.com/videos/' .$this->videoId;\n\t}", "public function get_video_embed_url()\n {\n if(!SELF::verifyValidID()) { return FALSE; }\n $id = SELF::get_video_id();\n if($this->_video_type == 'youtube') {\n return 'http://www.youtube.com/embed/' . $id . '/';\n } else if($this->_video_type == 'vimeo') {\n return 'http://player.vimeo.com/video/' . $id . '?color=ffffff';\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }