query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Show the job post creation form.
public function create() { return view('jobposts.create'); }
[ "public function createAction()\n {\n $entity = new Job();\n $request = $this->getRequest();\n $form = $this->createForm(new JobType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_preview', array(\n 'company' => $entity->getCompanySlug(),\n 'location' => $entity->getLocationSlug(),\n 'token' => $entity->getToken(),\n 'position' => $entity->getPositionSlug()\n )));\n }\n\n return $this->render('ComoJobeetBundle:Job:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function actionCreate()\n {\n $model = new JobPosting();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->job_posting_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return $this->render(\n '@GabiUJobeet/Job/form.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Job();\n $entity->setParams(array(new Param()));\n $entity->setArgs(array(new Arg()));\n $entity->setTags(array(new Tag()));\n $form = $this->createForm(new JobType(), $entity, $this->container->getParameter('jobqueue.adapter.options'));\n\n return $this->render('NineThousandJobqueueBundle:Job:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'action' => $this->generateUrl('jobqueue_job_create'),\n ));\n }", "public function create()\n {\n \n \n return view('detailed_jobs.create');\n }", "public function create()\n {\n return view('myjobs.create');\n }", "public function actionCreate()\n {\n $model = new Job();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('add_post_form');\n\t}", "public function actionCreate()\n {\n $model = new Job();\n $model->company_id = Yii::$app->user->identity->getId();\n\n if ($model->load(Yii::$app->request->post())) {\n// return $this->redirect(['view', 'id' => $model->id]);\n $model->company_id = Yii::$app->user->identity->getId();\n if($model->save()) {\n return $this->redirect('index');\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function showPostCreationForm() {\n $post = null;\n return view('posts.create-edit', compact('post'));\n }", "public function create()\n {\n return view('group_jobs.create');\n }", "public function createAction()\n {\n $entity = new Job();\n $request = $this->getRequest();\n $form = $this->createForm(new JobType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create() {\n\n return view( 'admin.submissions.create' );\n\n }", "private function _getForm() \n {\n $form = new Admin_Form_Job(array(\n 'method' => 'post'\n ));\n\n // assign view variables\n $this->view->form = $form;\n return $form;\n }", "public function showCreateThreadForm()\n {\n return view( 'share.create_thread' );\n }", "public function create()\n {\n return view('job_workflow_processes.create');\n }", "public function create()\n {\n return view('submission.create', [\n 'title' => 'Give it a go',\n ]);\n }", "public function createTaskForm() {\n\n return $this->hrefGenerator() . '\n \n\t\t\t<form method=\"post\" > \n <br>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>Create new task</legend>\n <p>' . $this->message . '</p>\n\n\t\t\t\t\t<label for=\"' . self::$taskBody . '\">Task description :<br><small>Max 500 characters.</small></label><br>\n\t\t\t\t\t<textarea id = \"taskBody\" name=\"' . self::$taskBody . '\" ROWS=4 COLS=30 >' . $this->getTaskBoby() . '</textarea>\n \n <br> \n\t\t\t\t\t<label for=\"' . self::$taskDueDate . '\">To be completed :</label>\n\t\t\t\t\t<input type=\"date\" id=\"' . self::$taskDueDate . '\" name=\"' . self::$taskDueDate . '\" value = ' . $this->getDueDate() . ' />\n <br>\n <label for=\"' . self::$checkbox . '\">Remind by sending email :</label>\n <input type=\"checkbox\" id=\"' . self::$checkbox . '\" name=\"' . self::$checkbox . '\" checked/>\n <br>\n <label for =\"' . self::$hours . '\">Set hour :</label>'\n . $this->showHours() .\n '<label for =\"' . self::$minutes . '\"> Set minutes :</label>'\n . $this->showMinutes() . '\n <br>\n\t\t\t\t\t<input type=\"submit\" name=\"' . self::$createTask . '\" value=\"Create\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t';\n }", "public function create()\n {\n return view('hr.job_titles.create')->with($this->getOptionItems());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the object property _Phone to $inPhone
function setPhone($inPhone) { if ( $inPhone !== $this->_Phone ) { $this->_Phone = $inPhone; $this->setModified(); } return $this; }
[ "public function setPhone(){\r\n\t\t$CPhone = ClientPhone::model() -> findByAttributes(array('mangoTalker' => $this -> mangoTalker), array('with' => 'phone'));\r\n\t\tif ($CPhone) {\r\n\t\t\t$this -> phone = $CPhone -> phone;\r\n\t\t\t$this -> i = $this -> phone -> i;\r\n\t\t}\r\n\t}", "function setPhone($p){\r\n $this->phone = $p; \r\n }", "function setPhone($phone)\n {\n if (validPhone($phone)) {\n $this->phone = $phone;\n } else {\n $this->phone = \"123-456-7890\";\n\n }\n }", "public function setContactPhone($phone);", "public function setPhoneAttribute($phone){\n\t\t$this->meta()->forceFill(['phone' => $phone])->save();\n\t}", "function setPhone($phone)\r\n {\r\n //phone must be numeric\r\n if(is_numeric($phone))\r\n {\r\n $this->phone = $phone;\r\n }\r\n //if not, default number is set\r\n $this->phone = \"1234567890\";\r\n }", "public function setPhone($phone){\n $this->phone = $phone;\n if($this->id != 0){\n $sql = \"UPDATE `tbl_sinhvien` SET `phone` = '$phone' WHERE id = '$this->$id'\";\n $this->db->executeQuery($sql);\n }\n\t}", "public function setPhone($value)\n {\n Yii::trace('setPhone()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__phone', $value);\n }", "function setPhone($newPhone){\n //check if the phone number is numeric\n if(is_numeric($newPhone)) {\n $this->phone = $newPhone;\n }\n //if not set to default, 0000000000\n $this->phone = \"0000000000\";\n }", "function setPhoneNumber($newPhoneNumber)\n {\n $this->phoneNumber = $newPhoneNumber;\n }", "function setPhone($new_phone)\n {\n $this->schoolPhone = $new_phone;\n }", "public function setIdPhone($idPhone)\n {\n $this->idPhone = (int) $idPhone;\n }", "public function setPhoneAttribute($phone)\n {\n $this->attributes['phone'] = format_phone('au', $phone);\n }", "public function setPhone($value)\n {\n $this->_billPhone = $this->_deliveryPhone = $value;\n return $this;\n }", "public function setPhone($var)\n {\n GPBUtil::checkString($var, True);\n $this->phone = $var;\n\n return $this;\n }", "public function setPhone($newPhone) {\n\t\tif(mb_strlen($newPhone, \"UTF-8\") > 0) {\n\t\t\t$this->phone = Filter::filterString($newPhone, \"Restaurant phone number\", 32);\n\t\t} else {\n\t\t\t$this->phone = null;\n\t\t}\n\t}", "public function setMainPhone($entity);", "function setPhoneNumberCustomer($arg) {\n\t\t$this->multipay->setPhoneNumberCustomer($arg);\n\t}", "public function setCustomerPhone($val)\n {\n $this->_propDict[\"customerPhone\"] = $val;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: Wicket CAS Role Sync Description: wicket.io plugin that provides a custom action that listens for CAS login thus allowing role syncing capability on fire of that CAS login event Requires WPCASSIFY AND the "Base Wicket Plugin" Author: Industrial Perform operations when the user is authed via CAS, but not yet in Wordpress For testing purposes since $cas_user_data contains data straight from CAS NOTE: Do not put person UUID here or anything else in $_SESSION for any reason. PHP Sessions can be unreliable and collisions can happen.
function custom_action_before_auth_user_wordpress($cas_user_data) { // perhaps log CAS payload, etc }
[ "function users_roles_examples_modify_roles_on_plugin_activation() {\n\n\t// myplugin_add_role();\n\t// myplugin_remove_role()\n\n}", "public function loginpage_hook() {\n global $frm, $SESSION;\n\n $username = optional_param('username', '', PARAM_RAW);\n $courseid = optional_param('courseid', 0, PARAM_INT);\n\n if (!empty($username)) {\n if (isset($SESSION->wantsurl) && (strstr($SESSION->wantsurl, 'ticket') ||\n strstr($SESSION->wantsurl, 'NOCAS'))) {\n unset($SESSION->wantsurl);\n }\n return;\n }\n\n // Return if CAS enabled and settings not specified yet.\n if (empty($this->config->hostname)) {\n return;\n }\n\n // If the multi-authentication setting is used, check for the param before connecting to CAS.\n if ($this->config->multiauth) {\n\n // If there is an authentication error, stay on the default authentication page.\n if (!empty($SESSION->loginerrormsg)) {\n return;\n }\n\n $authcas = optional_param('authCAS', '', PARAM_RAW);\n if ($authcas != 'CAS') {\n return;\n }\n\n }\n\n // Connection to CAS server.\n $this->connect_cas();\n\n if (phpCAS::checkAuthentication()) {\n $frm = new stdClass();\n $frm->username = phpCAS::getUser();\n $frm->password = 'passwdCas';\n $frm->logintoken = \\core\\session\\manager::get_login_token();\n\n // Redirect to a course if multi-auth is activated, authCAS is set to CAS and the courseid is specified.\n if ($this->config->multiauth && !empty($courseid)) {\n redirect(new moodle_url('/course/view.php', array('id' => $courseid)));\n }\n\n return;\n }\n\n if (isset($_GET['loginguest']) && ($_GET['loginguest'] == true)) {\n $frm = new stdClass();\n $frm->username = 'guest';\n $frm->password = 'guest';\n $frm->logintoken = \\core\\session\\manager::get_login_token();\n return;\n }\n\n // Force CAS authentication (if needed).\n if (!phpCAS::isAuthenticated()) {\n phpCAS::setLang($this->config->language);\n phpCAS::forceAuthentication();\n }\n }", "function crypton_blog_trx_addons_action_login($args=array()) {\n\t\tdo_action( 'trx_addons_action_login', $args );\n\t}", "function plugin_user_login_mailchimp($uid)\r\n{\r\n global $_CONF_MLCH;\r\n\r\n if ($_CONF_MLCH['sync_at_login']) {\r\n MLCH_syncWithMC($uid);\r\n }\r\n}", "function chocorocco_trx_addons_action_user_meta() {\n\t\tdo_action( 'trx_addons_action_user_meta' );\n\t}", "function activate_plugin()\n{\n createNotesRole();\n}", "public function hookActionBeforeAuthentication()\n {\n\n }", "function sh_user_role_is_callback($args, $content, $tag){\n //check\n if(is_user_logged_in()) {\n //check\n $args = is_array($args) ? array_shift($args) : NULL;\n $arguments = str_replace('#', '', $args);\n $user_roles = explode('|', $arguments);\n //get details\n $roles = sh_logged_users_details_callback()->roles;\n //check\n if(array_intersect($user_roles,$roles)){\n //return\n return $content;\n }else{\n //return\n return apply_filters( \"msg_user_role_is_login_filter\",\"<p> You don't have access content for your role...!\");\n }\n }else{\n //return\n return apply_filters( \"msg_user_role_is_login_out_filter\",\"<p> You don't have access content, please login to access the content ...!\");\n }\n}", "public function postLogin() {\n $level = $this->nitro->getLevel();\n global $user;\n if (in_array($level, $this->options['roles']['whitelist'])) {\n // add role to user\n if ($role = user_role_load_by_name($level)) {\n $user->roles[$role->rid] = $role->name;\n user_save($user);\n \n }\n }\n }", "public function casAction()\n {\n $auth = Zend_Auth::getInstance();\n $casAdapter = $this->_getCasAdapter();\n $casAdapter->setTicket($this->_getParam('ticket'));\n \n if ($this->_getParam('logoutRequest')) {\n $casAdapter->handleLogoutRequest($this->_getParam('logoutRequest'));\n }\n \n try {\n $result = $auth->authenticate(new Unl_Auth_Adapter_Cas($casAdapter));\n } catch (Exception $e) {\n //\n }\n \n if ($result && $result->isValid()) {\n $this->_setupUser(Zend_Auth::getInstance()->getIdentity());\n } else {\n Zend_Auth::getInstance()->clearIdentity();\n if (isset($_COOKIE['unl_sso'])) {\n setcookie('unl_sso', 'fake', time() - 60*60*24, '/', '.unl.edu');\n }\n }\n \n $session = new Zend_Session_Namespace(__CLASS__);\n $this->_redirect($session->referer);\n }", "function enrollSync($args) {\n\t\t$this->validate();\n\n\t\t$journal =& Request::getJournal();\n\t\t$rolePath = Request::getUserVar('rolePath');\n\t\t$syncJournal = Request::getUserVar('syncJournal');\n\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t$roleId = $roleDao->getRoleIdFromPath($rolePath);\n\n\t\tif ((!empty($roleId) || $rolePath == 'all') && !empty($syncJournal)) {\n\t\t\t$roles =& $roleDao->getRolesByJournalId($syncJournal == 'all' ? null : $syncJournal, $roleId);\n\t\t\twhile (!$roles->eof()) {\n\t\t\t\t$role =& $roles->next();\n\t\t\t\t$role->setJournalId($journal->getId());\n\t\t\t\tif ($role->getRolePath() != 'admin' && !$roleDao->roleExists($role->getJournalId(), $role->getUserId(), $role->getRoleId())) {\n\t\t\t\t\t$roleDao->insertRole($role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tRequest::redirect(null, null, 'people', $roleDao->getRolePath($roleId));\n\t}", "public function classifieds_upgrade_subscriber_role($data) {\n \t \n \tglobal $wpdb;\n \t$table_prefix= $wpdb->prefix;\n \t \n \n \tif (isset($data['user_id'])) {\n \t\t$user_id = $data['user_id'];\n \n \t\t/** Get current role */\n \t\t$user_cap_key = $table_prefix.'capabilities';\n \t\t$current_role= get_user_meta($user_id, $user_cap_key, TRUE);\n \n \t\t/** Get current user level */\n \t\t$user_level_key = $table_prefix.'user_level';\n \t\t$current_userlevel= get_user_meta($user_id, $user_level_key, TRUE);\n \n \t\t/** Verify subscriber roles*/\n \t\tif (isset($current_role['subscriber'])) {\n \t\t\t \n \t\t\t/** Client is originally a subscriber */\n \t\t\tunset($current_role['subscriber']);\n \n \t\t\t/** Assign a customer role */\n \t\t\t$current_role['customer'] =true;\n \t\t\t \n \t\t\tupdate_user_meta( $user_id, $user_cap_key, $current_role);\n \t\t}\n \n \t\t/** Verify user levels*/\n \t\tif (!(empty($user_level_key))) {\n \t\t\t/** Not an empty string, has value */\n \t\t\t/** Client is originally a subscriber */\n \t\t\t \n \t\t\t$current_userlevel = intval($current_userlevel);\n \t\t\t \n \t\t\tif ($current_userlevel < 1) {\n \t\t\t\t/** Less than 0, subscriber user level\n \t\t\t\t /** Assign a new user level */\n \t\t\t\t$current_userlevel = 1;\n \t\t\t\tupdate_user_meta( $user_id, $user_level_key, $current_userlevel);\n \t\t\t}\n \t\t}\n \t}\n \t \n }", "public function checkRoleAssignment($a_plugin_id,$a_user_data)\n\t{\n\t\tglobal $ilLog;\n\t\n\t\t$GLOBALS['ilLog']->write(__METHOD__.': Starting plugin assignments');\n\t\t//$GLOBALS['ilLog']->write(__METHOD__.': Received user data: '.print_r($a_user_data,true));\n\n\t\t/*\n\t\t\t3 - IuE\n\t\t\t4 - InfiniteIterator\n\t\t\t5 - Maschinenbau\n\t\t\t8 - Soz\n\t\t\t9 - Wirt\n\t\t\t*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t// Mapping Plugin-ID -> Keys aus LDAP\n\t\t$mapping = array(\n\t\t\t\t\t\t\t10 => array('Student'),\n\t\t\t\t\t\t\t20 => array('Mitarbeiter'),\n\t\t\t\t\t\t\t30 => array('Affiliate'),\n\t\t\t\t\t\t\t31 => array('AF.THK'),\n\t\t\t\t\t\t\t40 => array('verbundstudent-wi'),\n\t\t\t\t\t\t\t100 => array('FB1'),\n\t\t\t\t\t\t\t200 => array('FB2'),\n\t\t\t\t\t\t\t300 => array('FB3'),\n\t\t\t\t\t\t\t400 => array('FB4'),\n\t\t\t\t\t\t\t401 => array('84.000.278.FB4','84.000.VWI.THK','AF.THK'),\n 402 => array('90.000.278.FB4','90.000.VWI.THK','AF.THK'),\n\t\t\t\t\t\t\t500 => array('FB5'),\n\t\t\t\t\t\t\t600 => array('FB6','V6'),\n\t\t\t\t\t\t\t800 => array('FB8'),\n\t\t\t\t\t\t\t900 => array('FB9'),\n\t\t\t\t\t\t\t950 => array('FB10')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\n\t\t\t\t\t\t\n\t\t\n\t\t\n\t\t// DEBUG\n\t\t//$a_user_data['edupersonscopedaffiliation'] = array('Mitarbeiter@FB10.fh-dortmund.de');\n\n\t\t\n\t\t/****************************\n\t\t * fake the description field for certain FB\n\t\t */\n\t\t \n\t\t \n\t\t//$GLOBALS['ilLog']->write(__METHOD__.': DUMP-ORIG :'. var_dump($a_user_data['edupersonscopedaffiliation']));\n\t\t \n\t\tif(!is_array($a_user_data['edupersonscopedaffiliation'])) {\n\t\t\t$studiengang = $this->_sortUser($a_user_data['edupersonscopedaffiliation'],false);\n\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': NO-ARRAY:'.$studiengang['status']);\n\t\t\t\n\t\t\t// add the fake fields\n\t\t\t$a_user_data['edupersonscopedaffiliation'] = $this->_addDescFields($studiengang);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach($a_user_data['edupersonscopedaffiliation'] as $key2 => $value2) {\n\t\t\t\t$studiengang = $this->_sortUser($value2,$a_user_data['edupersonscopedaffiliation']);\n\t\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': ARRAY:'.$studiengang['status']);\n\t\t\t\n\t\t\t\t// add the fake fields\n\t\t\t\t$a_user_data['edupersonscopedaffiliation'] = $this->_addDescFields($studiengang);\t\n\t\t\t} // end: foreach($a_user_data['description'] as $key => $value) \n\t\t\t\n\t\t\t//$GLOBALS['ilLog']->write(__METHOD__.': ARRAY-COMPLETE:'.var_dump($a_user_data['edupersonscopedaffiliation']));\n\t\t} // end: !is_array($a_user_data['description'])\n\t\t\t\n\n\n\t\t/****************************\n\t\t * do the assignment\n\t\t */\n\t\t \n\t\tif(!is_array($a_user_data['edupersonscopedaffiliation'])) {\n\t \t$studiengang = $this->_sortUser($a_user_data['edupersonscopedaffiliation'],false);\n\t \t\n\t \t$GLOBALS['ilLog']->write(__METHOD__.': AFFFOUND-OBEN:'.$studiengang['status']);\n\t\t\t\t//print_r($studiengang,true);\n\t\t\t\t//echo var_dump($studiengang);\n\t \t\n\t \t// Wenn kein Studiengang dann nichts zuweisen\n\t\t\tif($studiengang == false)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(is_array($mapping[$a_plugin_id])) {\n\t\t\t\tif(in_array($studiengang['fb'],$mapping[$a_plugin_id]))\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tif(in_array($studiengang['qualification'].'.'.$studiengang['focus'].'.'.$studiengang['course'].'.'.$studiengang['fb'],$mapping[$a_plugin_id]))\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tif($studiengang['status'] == 'Affiliate')\n\t\t\t\t{\n\t\t\t\t\tif(in_array('AF.'.$studiengang['fb'],$mapping[$a_plugin_id]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': Assigning Affiliate:'.$studiengang['fb']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Set Mitarbeiter / Student / Affiliate Rolle\n\t\t\t\tif(in_array($studiengang['status'],$mapping[$a_plugin_id]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//print_r($studiengang,true);\n\t\t\t\t\t\n\t\t} else {\n\t\t\t\t\t\t\t\n\t\t\tforeach($a_user_data['edupersonscopedaffiliation'] as $key => $value) {\n\t\t\t\t$studiengang = $this->_sortUser($value,$a_user_data['edupersonscopedaffiliation']);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': AFFFOUND:'.$studiengang['status']);\n\t\t\t\t//print_r($studiengang,true);\n\t\t\t\t//echo var_dump($studiengang);\n\t\t\t\t\n\t\t\t\t// Wenn kein Studiengang dann nichts zuweisen\n\t\t\t\tif($studiengang == false)\n\t\t\t\t\treturn false;\n\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\tif(is_array($mapping[$a_plugin_id])) {\n\t\t\t\t\tif(in_array($studiengang['fb'],$mapping[$a_plugin_id]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t\tif(in_array($studiengang['qualification'].'.'.$studiengang['focus'].'.'.$studiengang['course'].'.'.$studiengang['fb'],$mapping[$a_plugin_id]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif($studiengang['status'] == 'Affiliate')\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array('AF.'.$studiengang['fb'],$mapping[$a_plugin_id])) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': Assigning Affiliate:'.$studiengang['fb']);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Set Mitarbeiter / Student / Affiliate Rolle\n\t\t\t\t\tif(in_array($studiengang['status'],$mapping[$a_plugin_id]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$GLOBALS['ilLog']->write(__METHOD__.': New User FB:'.$studiengang['fb']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\n\t\treturn false;\n\t}", "function embed()\r\n\t\t{\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders config', array($this, 'showConfigurationPage'), 'components/authproviders/config');\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders config check', array($this, 'showConfigCheck'), 'components/authproviders/configcheck');\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Local usermanagement is blocked', array($this, 'showUsermanagementBlockage'), 'components/authproviders/usermanagement');\r\n\t\t\t/*\r\n\t\t\t * Single signon by javascript:\r\n\t\t\t */\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders Javascript SSO', array($this, 'ssoByJavascriptCall'), 'components/authproviders/ssobyjs');\r\n\t\t\t/*\r\n\t\t\t * Delete user:\r\n\t\t\t */\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders SSO delete user', array($this, 'ssoDeleteUser'), 'components/authproviders/ssodeleteuser');\r\n\r\n\t\t\tif ($this->isEnabled()) {\r\n\t\t\t\tSERIA_Hooks::listen('SeriaPlatformBootComplete', array($this, 'platformBootComplete'));\r\n\t\t\t\tSERIA_Hooks::listen('login', array($this, 'handleLogin'));\r\n\t\t\t\tSERIA_Hooks::listen('guestLogin', array($this, 'handleGuestLogin'));\r\n\t\t\t\tSERIA_Hooks::listen('SERIA_User::__construct', array('SERIA_Authproviders', 'userObjectHook'));\r\n\t\t\t}\r\n\t\t\tSERIA_Hooks::listen('seria_maintain', array('SERIA_UserLoginXml', 'cleanupSids'));\r\n\t\t\tSERIA_Hooks::listen('seria_maintain', array('SERIA_AsyncUserMetaSync', 'updateAllUsers'));\r\n\t\t\tSERIA_Hooks::listen('loggedIn', array($this, 'successfulLogin'));\r\n\t\t\tSERIA_Hooks::listen(SERIA_Base::LOGOUT_HOOK, array($this, 'beforeLogout'));\r\n\t\t\t/*\r\n\t\t\t * There is a chance for redirects, so attach a heavy hook.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_Base::AFTER_LOGOUT_HOOK, array($this, 'logout'), 1000);\r\n\t\t\tSERIA_Hooks::listen(SERIA_GuiHooks::EMBED, array($this, 'guiEmbed'));\r\n\t\t\t/*\r\n\t\t\t * ExternalReq2 can show a user-consent-request for sending data to\r\n\t\t\t * an external server.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_ExternalReq2ReturnPost::HOST_ACCESS_CONSENT_HOOK, array($this, 'hostAccessConsentRequest'), 1000);\r\n\t\t\t/*\r\n\t\t\t * Clean up login-provider info at delete:\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_User::DELETE_HOOK, array('SERIA_UserAuthenticationProvider', 'deletingUser'));\r\n\t\t\t/*\r\n\t\t\t * Clean up user-xml at user delete.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_User::AFTER_DELETE_HOOK, array('SERIA_UserLoginXml', 'cleanupSids'));\r\n\t\t}", "function authUser() {\n\t global $sugar_config;\n phpCAS::setDebug();\n phpCAS::client(CAS_VERSION_2_0, $sugar_config['cas']['hostname'], $sugar_config['cas']['port'], $sugar_config['cas']['uri'], $sugar_config['cas']['changeSessionID']);\n if ((!empty($sugar_config['cas']['proxies'])) && (is_array($sugar_config['cas']['proxies']))) {\n phpCAS::allowProxyChain(new CAS_ProxyChain($sugar_config['cas']['proxies']));\n }\n phpCAS::setNoCasServerValidation();\n phpCAS::forceAuthentication();\n $authenticated = phpCAS::isAuthenticated();\n if ($authenticated)\n {\n $user_name = phpCAS::getUser();\n\n\t $dbresult = $GLOBALS['db']->query(\"SELECT id, status FROM users WHERE user_name='\" . $user_name . \"' AND deleted = 0\");\t\t\t\n // User already exists use this one\n if ($row = $GLOBALS['db']->fetchByAssoc($dbresult)) {\n if ($row['status'] != 'Inactive')\n return $this->loadUserOnSession($row['id']);\n else\n return '';\n }\n \t echo 'Not authorized user. You may need to ask an administrator to give you access to SugarCRM. You may try logging in again <a href=\"https://' . $sugar_config['cas']['hostname'] . ':443/cas/logout?service=http://' . $_SERVER['SERVER_NAME'] . '\">here</a>';\n\t die();\n return \"\"; // SSO authentication was successful\n }\n else // not authenticated in CAS.\n {\n return;\n }\n }", "function add_role_and_user_for_Zabbio_on_plugin_activate() {\n add_role(\n 'ZabbioApp',\n __( 'ZabbioApp' ),\n array(\n 'create_posts' => true,\n 'edit_others_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'publish_posts' => true,\n 'read' => true\n )\n );\n\n $user_name = 'ZabbioApp';\n $user_email = '';\n if ( !username_exists($user_name) ) {\n $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );\n $user_id = wp_insert_user( \n array(\n 'user_pass' => $random_password,\n 'user_login' => $user_name,\n 'role' => 'ZabbioApp',\n 'user_email' => ''\n )\n );\n } else {\n $random_password = __('User already exists. Password inherited.');\n }\n}", "public function do_login(){\n\t\t$this->components['gamecentral_security']->do_login();\n\t}", "function hosting_platform_roles_post_hosting_install_task($task, $data) {\n $role = db_result(db_query('SELECT {role} FROM {hosting_platform_roles_roles} WHERE pl_nid=%d AND pr_nid=%d', $task->ref->platform, $task->ref->profile));\n $uid1 = db_result(db_query('SELECT {uid} FROM {hosting_platform_roles_uid1} WHERE pl_nid=%d AND pr_nid=%d', $task->ref->platform, $task->ref->profile));\n\n $client_name = $task->ref->name;\n $target = $task->context_options['uri'];\n if ($uid1 != FALSE) {\n\n // if http://drupal.org/node/1116414 gets committed, we can remove the \"notify\" command code\n $results['user-create'] = provision_backend_invoke($target, 'user-create ' . $client_name . ' --mail=' . user_load(array('name' => $client_name))->mail);\n drush_log(dt('User created:') . $results['user-create']['output']);\n \n $results['notify'] = provision_backend_invoke($target, 'notify ' . $client_name);\n drush_log($results['notify']);\n \n $results['user-login'] = provision_backend_invoke($target, 'user-login ' . $client_name);\n drush_log(dt('Client user login link: ') . $results['user-login']['output']);\n \n // Set the site login link to the one we just created; ref.: hosting_site_post_hosting_login_reset_task()\n $cache = array(\n 'expire' => strtotime(\"+24 hours\"), \n 'link' => $results['user-login']['output'],\n );\n cache_set('hosting:site:' . $task->ref->nid . ':login_link', $cache, 'cache', $cache['expire'] );\n }\n else {\n // we may want to do this for block-placement, etc.\n $result = provision_backend_invoke($target, 'eval \"print(user_load(1)->name)\"');\n $client_name = $result['output'];\n }\n \n if ($role != FALSE) {\n // TODO: support adding multiple roles\n // we can finally check that the role actually exists on this site\n $result = provision_backend_invoke($target, 'eval \"print(serialize(user_roles()))\"');\n $site_roles = unserialize($result['output']);\n if (in_array($role, $site_roles)) {\n // we need to avoid a role name like \";rm -rf /\", which is a valid role name in D6, btw\n drush_escapeshellarg(&$role);\n provision_backend_invoke($target, 'user-add-role ' . $role . ' --name=' . $client_name);\n }\n else {\n drush_set_error(DRUSH_APPLICATION_ERROR, dt('No role of <em>' . $role . '</em> is available on this platform'));\n }\n }\n}", "function wpcas_provision_user( $user_name ){\n\t// Generate a random password and create the user\n\t$password = wp_generate_password( 12, false );\n\t$user_id = wp_create_user( $user_name, $password, $user_name . \"@wpcas\" );\n\n\t// Set the role\n\t$user = new WP_User( $user_id );\n\t$user->set_role( 'subscriber' );\n\t\n\t// the CAS user now has a WP account!\n\twp_set_auth_cookie( $user->ID );\n\t\n\t// First sync\n\twpcas_syncuser( $user_name, phpCAS::getAttributes() );\n\n\tif( isset( $_GET['redirect_to'] )){\n\t\twp_redirect( preg_match( '/^http/', $_GET['redirect_to'] ) ? $_GET['redirect_to'] : site_url( $_GET['redirect_to'] ));\n\t\tdie();\n\t}\n\n\twp_redirect( site_url( '/wp-admin/' ));\n\tdie();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for acceptDispute AcceptDispute
public function test_acceptDispute() { }
[ "public function testAcceptPaymentDispute()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function test_submitEvidence() {\r\n\r\n }", "public function testAcceptAnswer(): void {\n $user = factory(User::class)->create();\n\n $q = factory(Question::class)->create(['author_id' => $user->id]);\n $a = factory(Answer::class)->create(['author_id' => $user->id, 'question_id' => $q->id]);\n\n //Test Selected Answer\n $this->get(url(\"/api/answers/$a->id/\"))\n ->assertStatus(200)\n ->assertJsonFragment(['body' => $a->body, 'selected' => false]);\n $this->get(url(\"/api/answers/$a->id/accept?api_token=$user->api_token\"))\n ->assertStatus(200)\n ->assertJsonFragment(['body' => $a->body, 'selected' => true]);\n $this->get(url(\"/api/questions/$q->id/answers\"))\n ->assertStatus(200)\n ->assertJsonFragment(['body' => $a->body, 'selected' => true]);\n $this->get(url(\"/api/questions/$q->id\"))\n ->assertStatus(200)\n ->assertJsonFragment(['status' => 'closed']);\n }", "public function testRequestSepaDirectDebit()\r\n {\r\n }", "public function testRejectOrder()\n {\n }", "public function test_retrieveDispute() {\r\n\r\n }", "public function test_listDisputeEvidence() {\r\n\r\n }", "public function testContestPaymentDispute()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testRejectKpok()\n {\n }", "public function testDeliverPresentationDPass()\n {\n $communityId = 4;\n $this->assertAlertable($communityId, 'deliverPresentationD');\n }", "public function test_removeDisputeEvidence() {\r\n\r\n }", "public function testGetReplenishmentProcessByFilter()\n {\n }", "public function testProcAcceptAction()\n {\n /** @var Magedevgroup_TradeIn_Model_Cron $model */\n $model = Mage::getModel('magedevgroup_tradein/cron');\n\n $model->procAcceptProposal();\n }", "public function testPostReplenishment()\n {\n }", "public function testDetectappliancePost()\n {\n }", "public function testRuleIsAccepted(): void {\r\n\r\n //Should pass\r\n foreach(['yes', 'on', '1', 'true'] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }\r\n\r\n //Should fail\r\n foreach(['', null, [], (object) [], 2552, true] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertFalse($validator -> passes());\r\n }", "public function testPostConsignment()\n {\n }", "public function test_createDisputeEvidenceText() {\r\n\r\n }", "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a user type is valid
public static function isValidType(String $type){ return array_key_exists(strtoupper($type), self::userTypes()); }
[ "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 }", "function _validateUserType($id = 0) {\n if($id) {\n $result = $this->Database->mysqlSelect(array('id'),'usertypes', \"usertype = '\".trim($this->Request->request).\"' and id != '\".$id.\"'\");\n $row = $this->Database->mysqlfetchobject($result);\n if($this->Database->mysqlnumrows($row) > 0) {\n return false;\n }\n }else {\n $result = $this->Database->mysqlSelect(array('id'),'usertypes', \"usertype = '\".trim($this->Request->request).\"'\");\n $row = $this->Database->mysqlfetchobject($result);\n if($this->Database->mysqlnumrows($row) > 0) {\n return false;\n }\n }\n return true;\n }", "function check_user_type(){\n $type=auth()->user()->user_type;\n return $type;\n }", "abstract public function validateUser();", "function is_valid_type($type){\n\t\treturn in_array($type, $this->valid_types);\n\t}", "public function testUserType() {\n $this->assertEquals(User::TYPE_USER, $this->user->type);\n }", "public function validateType(Type $type): bool;", "public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }", "function isValidStudentByUser($user) {\n if($user['type'] == UserType::STUDENT)\n return true;\n else\n return false;\n}", "function isValidType($data);", "public function ValidType()\n {\n return ($this->type == \"parent\" || $this->type == \"teacher\");\n }", "protected function _checkUser($user, $pass, $type)\n {\n //check if the username or password or usertype is empty\n if((!$user)||(!$pass)||(!$type))\n {\n echo \"<a href='/'>Back</a></br>\";\n die(\"Please input the username and password!\");\n }\n //check if the username and the password are corresponded:\n if($this->getUserTable()->getUserByName($user)->password != $pass)\n {\n echo \"<a href='/'>Back</a></br>\";\n die(\"The username and password are NOT corresponded! Please login again!\");\n }\n //check if the username and the usertype are corresponded:\n if($this->getUserTable()->getUserByName($user)->fk_user_type != $type)\n {\n echo \"<a href='/'>Back</a></br>\";\n die(\"User information error! Please login again!\");\n }\n return true;\n }", "public function basic_user_validation()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = false;\n\n $user_obj = $this->server->GetCurrentUserObj();\n // First, make sure the use is of the correct general type.\n if (isset($user_obj) && ($user_obj instanceof c_comdef_user) && ($user_obj->GetUserLevel() != _USER_LEVEL_DEACTIVATED) && ($user_obj->GetUserLevel() != _USER_LEVEL_SERVER_ADMIN) && ($user_obj->GetID() > 1)) {\n $ret = true;\n }\n\n return $ret;\n }", "public function validateType()\n {\n $validTalkTypes = array(\n 'half-day-tutorial',\n 'full-day-tutorial',\n 'regular',\n 'lightning'\n );\n\n if (empty($this->_cleanData['type']) || !isset($this->_cleanData['type'])) {\n $this->_addErrorMessage(\"You must choose what type of talk you are submitting\");\n return false;\n }\n\n if (!in_array($this->_cleanData['type'], $validTalkTypes)) {\n $this->_addErrorMessage(\"You did not choose a valid talk type\");\n return false;\n }\n\n return true;\n }", "protected function validateType()\n {\n $types = [null, 'proportion', 'portion_num', 'portion_str'];\n\n return in_array($this->input['type'], $types, true);\n }", "public function validateType( $type ) {\n\t\t$validated = parent::validateType( $type );\n\n\t\t// Any pro notification should pass here.\n\t\tif ( 'all-pro' === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting unlicensed users.\n\t\tif ( 'unlicensed' === $type && ! aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting licensed users.\n\t\tif ( 'licensed' === $type && aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting a specific user level.\n\t\tif ( aioseo()->internalOptions->internal->license->level === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\treturn $validated;\n\t}", "public function testUserTypeCreation()\n {\n //Create a user type without a name (exception expected)\n $this->exception('', UserTypeException::class);\n\n //create two user types\n $admin = $this->createUserType('admin');\n $this->assertNotEmpty($admin);\n\n $user = $this->createUserType('user');\n $this->assertNotEmpty($user);\n\n //create another user type with the same name (exception expected)\n $this->exception('user', UserTypeException::class);\n\n //fetch all user types\n $userTypes = (new UserType())->getUserTypes();\n $this->assertNotEmpty($userTypes);\n $this->assertEquals(2, count($userTypes->toArray()));\n\n $requiredProperties = ['id', 'name', 'created_at', 'updated_at'];\n\n foreach ($userTypes as $type) {\n $response = Utils::validateObjectHasAllProperties($requiredProperties, $type);\n $this->assertTrue($response);\n }\n }", "private function validate()\n {\n switch ($this->type) {\n case 'custom':\n return $this->validatecustom();\n case 'int':\n return $this->validateint();\n case 'string':\n default:\n return $this->validatestring();\n }\n }", "public function validateField( $value, $type ) {\n if ( 'text' === $type ) {\n // Allow everything in text, it will be sanitized.\n return true;\n }\n if ( 'email' === $type ) {\n return false !== is_email( $value );\n }\n if ( 'number' === $type ) {\n return 1 === preg_match( '/^[0-9]+$/', $value );\n }\n if ( 'tel' === $type ) {\n return 1 === preg_match( '/^[\\d+\\(\\)]+$/', $value );\n }\n if ( 'date' === $type ) {\n return false !== strtotime( $value );\n }\n if ( 'time' === $type ) {\n return 1 === preg_match( '/^\\d+:\\d+(:\\d+)?$/', $value );\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import data corresponding to fieldsname into events table
private function import($tablename, $fieldsname, & $data, $replace = true) { $ignore = array (); if (!$replace) { $ignore[] = 'id'; } $rec = array ('added' => 0, 'updated' => 0); // parse each row foreach ($data AS $row) { $values = array (); // parse each specified field and retrieve corresponding value for the record foreach ($fieldsname AS $k => $field) { $values[$field] = $row[$k]; } $object = JTable::getInstance($tablename, ''); $object->bind($values, $ignore); // Make sure the data is valid if (!$object->check()) { $this->setError($object->getError()); echo JText::_('Error check: ').$object->getError()."\n"; continue ; } // Store it in the db if ($replace) { // We want to keep id from database so first we try to insert into database. if it fails, // it means the record already exists, we can use store(). if (!$object->insertIgnore()) { if (!$object->store()) { echo JText::_('Error store: ').$this->_db->getErrorMsg()."\n"; continue ; } else { $rec['updated']++; } } else { $rec['added']++; } } else { if (!$object->store()) { echo JText::_('Error store: ').$this->_db->getErrorMsg()."\n"; continue ; } else { $rec['added']++; } } if($tablename == "jem_events") { // we need to update the categories-events table too // store cat relation $query = 'DELETE FROM #__jem_cats_event_relations WHERE itemid = '.$object->id; $this->_db->setQuery($query); $this->_db->query(); if ( isset ($values['categories'])) { $cats = explode(',', $values['categories']); if (count($cats)) { foreach ($cats as $cat) { $query = 'INSERT INTO #__jem_cats_event_relations (`catid`, `itemid`) VALUES('.$cat.','.$object->id.')'; $this->_db->setQuery($query); $this->_db->query(); } } } } } if($tablename == "jem_events") { // force the cleanup to update the imported events status $settings = JTable::getInstance('jem_settings', ''); $settings->load(1); $settings->lastupdate = 0; $settings->store(); } return $rec; }
[ "private function prepareImport()\n {\n // Create user extra field: extra_external_user_id\n UserManager::create_extra_field(\n $this->extraFieldIdNameList['user'],\n 1,\n 'External user id',\n null\n );\n\n // Create course extra field: extra_external_course_id\n CourseManager::create_course_extra_field(\n $this->extraFieldIdNameList['course'],\n 1,\n 'External course id',\n ''\n );\n\n // Create session extra field extra_external_session_id\n SessionManager::create_session_extra_field(\n $this->extraFieldIdNameList['session'],\n 1,\n 'External session id'\n );\n\n // Create calendar_event extra field extra_external_session_id\n $extraField = new ExtraField('calendar_event');\n $extraField->save(\n array(\n 'field_type' => ExtraField::FIELD_TYPE_TEXT,\n 'variable' => $this->extraFieldIdNameList['calendar_event'],\n 'display_text' => 'External calendar event id',\n )\n );\n }", "public function createEvents() {\n $eventsFilePointer = fopen(dirname(__FILE__).'/../../data/events.csv', 'r');\n if (!$eventsFilePointer) {\n throw new Exception(_('Could not open the events file'));\n }\n while (($data = fgetcsv($eventsFilePointer, 0, \";\")) !== FALSE) {\n $this->events[(int)$data[0]] = array( 'name' => $data[1] , 'increased_name' => $data[2] , 'description' => $data[3] , 'increased_description' => $data[4] , 'max_level' => $data[5] , 'level' => 0);\n }\n fclose($eventsFilePointer);\n $eventTableFilePointer = fopen(dirname(__FILE__).'/../../data/eventTable.csv', 'r');\n if (!$eventTableFilePointer) {\n throw new Exception(_('Could not open the event table file'));\n }\n $i=3;\n while (($data = fgetcsv($eventTableFilePointer, 0, \";\")) !== FALSE) {\n $this->eventTable[$i]['EarlyRepublic'] = $data[0] ;\n $this->eventTable[$i]['MiddleRepublic'] = $data[1] ;\n $this->eventTable[$i]['LateRepublic'] = $data[2] ;\n $i++;\n }\n fclose($eventTableFilePointer);\n }", "public function importEvents_MyEventOn_Step1() {\n\t\t$this->logFunctionStart(__FUNCTION__);\n\t\t$arrayOfWpData = $this->_db->getPosts('ajde_events');\n\t\tif (!$arrayOfWpData) {\n\t\t\t$this->logFunctionEnd(__FUNCTION__);\n\t\t\treturn;\n\t\t}\n\n\t\t// Import 'adje_events' loosely\n\t\t$this->importPostsAsPages($arrayOfWpData);\n\n\t\t$this->logFunctionEnd(__FUNCTION__);\n\t}", "private function getDataFields()\n {\n $fields = Schema::getFromYamlSummaryFile($this->tableName);\n if ($fields === null) {\n $fields = $this->generateYamlSummaryFile();\n }\n\n foreach ($fields as $key => $value) {\n $this->fields[$key] = $this->getFieldClass($value['type']);\n $this->fields[$key]->assignData($value);\n }\n }", "public static function import() {\n $count = 0;\n $records = array();\n foreach (self::getSources() as $source) {\n $items = self::readFile($source['path']);\n\n foreach ($items as $item) {\n $item['active'] = true;\n $item['id'] = ++$count;\n $item['name'] = $source['name'];\n $item['type'] = $source['type'];\n $records[$count] = $item;\n }\n }\n self::saveRecords($records);\n }", "public function import()\n {\n foreach (Venue::getAllForDomain('eventbrite.com') as $venue) {\n $this->importFromVenue($venue);\n }\n }", "public function onImportField(Event $event)\n {\n $this->raiseEvent('onImportField', $event);\n }", "public function events()\n {\n try {\n\n $sql = \"CREATE TABLE IF NOT EXISTS events (\n {$this->schema->primaryKey()},\n name VARCHAR(255) NOT NULL,\n event_description VARCHAR(255) NOT NULL,\n image VARCHAR(255) NULL,\n date VARCHAR(20) NOT NULL,\n user_id BIGINT NOT NULL,\n reg_date TIMESTAMP\n )\";\n\n $this->db->exec($sql);\n\n echo \"events table created successfully <br/>\";\n\n } catch (PDOException $exception) {\n die($sql . \"<br>\" . $exception->getMessage());\n }\n\n }", "protected function load_field_names_from_db()\n\t{\n\t\t$rows =\n\t\t\tajax::asset_get_rows(\n\t\t\t\t$this->folder_id,\n\t\t\t\t$this->view_name,\n\t\t\t\t$fields = '*', \n\t\t\t\t$order = '',\n\t\t\t\t$limit = 1\n\t\t\t);\n\t\tif (count($rows)==1)\n\t\t{\n\t\t\t$asset = new csgAssetData(current($rows));\n\t\t\t$this->field_names = $asset -> field_names;\n\t\t}\n\t}", "private function insertEvents()\n {\n $pdo = new DB();\n $pdo = $pdo->getInstance();\n\n $pdo->beginTransaction();\n $req = $pdo->prepare('INSERT INTO events (place, name, address, heading, type, lat, lon, description, level, reward) VALUES (:place, :name, :address, :heading, :type, :lat, :lon, :description, :level, :reward)');\n\n foreach ($this->events as $event)\n {\n $req->bindValue(':place', $event['place']->id);\n $req->bindValue(':name', $event['script']->name . ' ' . $event['place']->name);\n $req->bindValue(':address', $event['place']->address);\n $req->bindValue(':heading', $event['place']->heading);\n $req->bindValue(':type', $event['place']->type);\n $req->bindValue(':lat', $event['place']->lat);\n $req->bindValue(':lon', $event['place']->lon);\n $req->bindValue(':description', $event['script']->description);\n $req->bindValue(':level', $event['script']->level);\n $req->bindValue(':reward', $event['script']->reward);\n $req->execute();\n }\n $this->status = $pdo->commit();\n }", "function post_eventos()\n\t{\n\t\tif ($this->disparar_importacion_efs ) {\n\t\t\tif (isset($this->s__importacion_efs['datos_tabla'])) {\n\t\t\t\t$clave = array('proyecto' => toba_editor::get_proyecto_cargado(),\n\t\t\t\t\t\t\t\t\t\t\t'componente' => $this->s__importacion_efs['datos_tabla']);\n\t\t\t\t$dt = toba_constructor::get_info($clave, 'toba_datos_tabla');\n\t\t\t\t$this->s__importacion_efs = $dt->exportar_datos_efs($this->s__importacion_efs['pk']);\n\t\t\t\tforeach ($this->s__importacion_efs as $ef) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (! $this->get_tabla()->existe_fila_condicion(array($this->campo_clave => $ef[$this->campo_clave]))) {\n\t\t\t\t\t\t\t$this->get_tabla()->nueva_fila($ef);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(toba_error $e) {\n\t\t\t\t\t\ttoba::notificacion()->agregar(\"Error agregando el EF '{$ef[$this->campo_clave]}'. \" . $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->disparar_importacion_efs = false;\n\t\t}\n\t}", "public function importFrom(array $data);", "function acf_prepare_fields_for_import( $fields = array() ) {\n}", "public function build_tables ( ) {\n\n // Pull the event names\n $sql = \"SELECT name FROM tracked_events WHERE active = 1\";\n\n $tracked_events = $this->query( $sql );\n\n // Iterate over the tracked events\n foreach ($tracked_events as $event) {\n\n // Create a new table for each event\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $event['name'] . \"` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `date` datetime NOT NULL,\n `value` int(11) NOT NULL,\n `active` int(11) NOT NULL,\n UNIQUE KEY `id` (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8\";\n\n $this->query( $sql );\n\n }\n\n }", "function AddEventQuestDatas()\n {\n $event=$this->Event();\n \n if (empty($event[ \"ID\" ])) { return; }\n if (!method_exists($this,\"DatasObj\")) { return; }\n\n $this->DatasObj()->Sql_Table_Structure_Update();\n $this->ReadDBData\n (\n $this->DatasObj()->Sql_Select_Hashes\n (\n array\n (\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => 1,\n ),\n array(),\n array(\"SortOrder\",\"ID\")\n )\n );\n }", "function loadEventsFromDatabase() {\n\n\t\t$timeRange = $this->params->get('timeRange', 'upcoming');\n\t\tswitch($timeRange) {\n\t\t\tcase 'past': \t\t$where = ' WHERE datetime < \"'.date(\"Y-m-d H:i:s\", time()).'\" '; $order = ' ORDER BY datetime DESC '; break;\n\t\t\tcase 'upcoming' :\t$where = ' WHERE datetime > \"'.date(\"Y-m-d H:i:s\", time()).'\" '; $order = ' ORDER BY datetime ASC '; break;\n\t\t\tcase 'all' :\t\t$where = ''; $order = ' ORDER BY datetime DESC '; break;\n\t\t}\n\n\t\tif(!$this->isAdmin) $where .= ' AND visible=1';\n\n\t\t$db = JFactory::GetDbo();\n\t\t$query = 'SELECT * FROM `#__wi_bandsintown_events` '.$where.$order;\n\t\t$db->setQuery($query);\n\t\t$storedEvents = $db->loadObjectList();\n\n\t\treturn $storedEvents;\n\n\t}", "function importData($hqe) {\n\t\t// iterate through unzipped files and import\n\t\tforeach ($arr_csv_file as $csv_pathname) \n\t\t{\n\t\t\t// compare column structure of file with the file in the database\n\n\t\t\t// import\n\t\t\t$sql = 'load data infile...';\n\t\t}\n\t}", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function importEvent(array $values) {\n $fields = $this->getFields('event');\n $data = array_combine($fields, $values);\n $entity = Event::create($data);\n if ($entity->save()) {\n return $entity;\n }\n else {\n return FALSE;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any wordlevel information. Generated from protobuf field bool enable_word_info = 13;
public function setEnableWordInfo($var) { GPBUtil::checkBool($var); $this->enable_word_info = $var; return $this; }
[ "public function setSpeechWordInfo($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Dialogflow\\V2\\SpeechWordInfo::class);\n $this->speech_word_info = $arr;\n\n return $this;\n }", "public function getEnableWordConfidence()\n {\n return $this->enable_word_confidence;\n }", "public function isWord(): bool\n {\n return ($this->token_type == self::WORD);\n }", "public function setEnableWordConfidence($var)\n {\n GPBUtil::checkBool($var);\n $this->enable_word_confidence = $var;\n\n return $this;\n }", "public function getEnableWordTimeOffsets()\n {\n return $this->enable_word_time_offsets;\n }", "public function isSuggestionInfo()\n {\n return $this->selectedOneofFieldName === 'suggestion_info';\n }", "public function getEnableSpellCorrection()\n {\n return $this->enable_spell_correction;\n }", "public function isInfoEnabled(): bool;", "public function extractWordInfo() {\n\t\t$text = $this->json['parse']['wikitext']['*'];\n\t\t$start = strpos($text, 'Морфологические и синтаксические свойства');\t\n\t\tif ($start !== false) {\n\t\t\t$text = explode('{{', substr($text, $start));\n\t\t\t$text = explode('}}', $text[1]);\n\t\t\t$text = explode('|', $text[0]);\n\t\t\t\n\t\t\t//echo('[[<pre>' . print_r($text, 1) . '</pre>]]');\n\t\t\t$this->baseForms = array();\n\n\t\t\tforeach ($text as $str) {\n\t\t\t\t$res = preg_match_all('/основа(.?)=(.*)/si', $str, $matches);\n\t\t\t\tif ($res) {\n\t\t\t\t\t$this->baseForms[] = $matches[2][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$text = explode(' ', $text[0]);\n\t\t\t\n\t\t\t$this->declensionType = $text[count($text) - 1];\n\t\t\t\n\t\t\tif ($text[0] == 'сущ') {\n\t\t\t\t$this->gender = $text[2];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->gender = false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$this->baseForms = false;\n\t\t\t$this->declensionType = false;\n\t\t\t$this->gender = false;\n\t\t}\n\t}", "public function setSupportsInformation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\BoolValue::class);\n $this->supports_information = $var;\n\n return $this;\n }", "public function hasSpellcheck(): bool\n {\n return $this->spellcheck;\n }", "public function setEnableSpokenPunctuation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\BoolValue::class);\n $this->enable_spoken_punctuation = $var;\n\n return $this;\n }", "public function setSupportsInformation($var)\n {\n GPBUtil::checkBool($var);\n $this->supports_information = $var;\n\n return $this;\n }", "public function getSpeechAdaptationInfo()\n {\n return $this->speech_adaptation_info;\n }", "public function hasSword() {\n\t\treturn $this->has('L1Sword')\n\t\t\t|| $this->has('L1SwordAndShield')\n\t\t\t|| $this->hasUpgradedSword();\n\t}", "public function getWordList()\n {\n return $this->readOneof(1);\n }", "public function getEnableSpokenPunctuation()\n {\n return $this->enable_spoken_punctuation;\n }", "public function isAssistant()\n {\n return (boolean) $this['is_assistant']; \n }", "public function setSpeechAdaptationInfo($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Speech\\V1\\SpeechAdaptationInfo::class);\n $this->speech_adaptation_info = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display the specified Ap3aulac3m1.
public function show($id) { $ap3aulac3m1 = $this->ap3aulac3m1Repository->find($id); if (empty($ap3aulac3m1)) { Flash::error('Ap3Aulac3M1 not found'); return redirect(route('ap3aulac3m1s.index')); } return view('ap3aulac3m1s.show')->with('ap3aulac3m1', $ap3aulac3m1); }
[ "public function show($id)\n {\n $ap2aulac3m1 = $this->ap2aulac3m1Repository->find($id);\n\n if (empty($ap2aulac3m1)) {\n Flash::error('Ap2Aulac3M1 not found');\n\n return redirect(route('ap2aulac3m1s.index'));\n }\n\n return view('ap2aulac3m1s.show')->with('ap2aulac3m1', $ap2aulac3m1);\n }", "public function show($id)\n {\n $p1aulac3m1 = $this->p1aulac3m1Repository->find($id);\n\n if (empty($p1aulac3m1)) {\n Flash::error('P1Aulac3M1 not found');\n\n return redirect(route('p1aulac3m1s.index'));\n }\n\n return view('p1aulac3m1s.show')->with('p1aulac3m1', $p1aulac3m1);\n }", "public function show($id)\n {\n $ap2aulac1m1 = $this->ap2aulac1m1Repository->find($id);\n\n if (empty($ap2aulac1m1)) {\n Flash::error('Ap2Aulac1M1 not found');\n\n return redirect(route('ap2aulac1m1s.index'));\n }\n\n return view('ap2aulac1m1s.show')->with('ap2aulac1m1', $ap2aulac1m1);\n }", "public function show($id)\n {\n $ap1aulac2m1 = $this->ap1aulac2m1Repository->find($id);\n\n if (empty($ap1aulac2m1)) {\n Flash::error('Ap1Aulac2M1 not found');\n\n return redirect(route('ap1aulac2m1s.index'));\n }\n\n return view('ap1aulac2m1s.show')->with('ap1aulac2m1', $ap1aulac2m1);\n }", "public function show($id)\n {\n $ap3exercicioc3m1 = $this->ap3exercicioc3m1Repository->find($id);\n\n if (empty($ap3exercicioc3m1)) {\n Flash::error('Ap3Exercicioc3M1 not found');\n\n return redirect(route('ap3exercicioc3m1s.index'));\n }\n\n return view('ap3exercicioc3m1s.show')->with('ap3exercicioc3m1', $ap3exercicioc3m1);\n }", "public function displayPage3() {\r\n\t\t$this->txtIntro->Visible = false;\r\n\t\t$this->dtgPAssessment->Visible = false;\r\n\t\t$this->txtPAssessmentIntro->Visible = false;\r\n\t\t$this->txtFAssessmentIntro->Visible = true;\r\n\t\t$this->updateFChart();\r\n\t\t$this->dtgFAssessment->Visible = true;\r\n\t\t$this->txtSummary->Visible = false;\r\n\t\t$this->imgSummary->Visible = false;\r\n\t\t$this->btnPage1Next->Visible = false;\r\n\t\t$this->btnPage2Next->Visible = false;\r\n\t\t$this->btnPage2Prev->Visible = false;\r\n\t\t$this->btnPage3Next->Visible = true;\r\n\t\t$this->btnPage3Prev->Visible = true;\r\n\t\t$this->btnPage4Prev->Visible = false;\r\n\t\t$this->page1->ImageUrl = __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__.'/page1.png';\r\n\t\t$this->page2->ImageUrl = __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__.'/page2.png';\r\n\t\t$this->page3->ImageUrl = __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__.'/page3Selected.png';\r\n\t\t$this->page4->ImageUrl = __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__.'/page4.png';\r\n\t\t$this->imgInfo->Visible = false;\r\n\t\t$this->txtPDefinitions->Visible = false;\r\n\t\t$this->txtFDefinitions->Visible = true;\r\n\t\t$this->imgFrame->Visible = false;\r\n\t}", "public function show($id)\n {\n $ap2exercicioc3m1 = $this->ap2exercicioc3m1Repository->find($id);\n\n if (empty($ap2exercicioc3m1)) {\n Flash::error('Ap2Exercicioc3M1 not found');\n\n return redirect(route('ap2exercicioc3m1s.index'));\n }\n\n return view('ap2exercicioc3m1s.show')->with('ap2exercicioc3m1', $ap2exercicioc3m1);\n }", "public function Show_overlay_abuso(){\n\t\techo ' \n\t\t <div class=\"apple_overlay\" id=\"abuso\">\n\t\t\t\t<div class=\"overlay_vertical\">\n\t\t\t\t\t<div class=\"clear\"></div>';\n\t\t\t\t\t \t$this->Show_abuso();\n\t\techo '\n\t\t\t\t</div>\n\t\t </div>';\n\t}", "public function verCamara3EnPlasma( ) {\n AccesoControladoresDispositivos::$ctrlPlasma->verCamara3EnPlasma();\n AccesoGui::$guiPlasma->verPCamaraEnPlasma(3);\n }", "public function Show_col3(){\n\t\t\n\t\techo '<img src=\"../image/card/col3_line.png\" class=\"col3_line\">';\t\n\t\t$this->Show_social_buttons();\n\t\techo '<div class=\"card_optionsbutton_container\">';\n\t\t\tif($this->address_on==1){\n\t\t\t\t$this->Show_dove_siamo();\n\t\t\t}\n\t\t\techo '<div class=\"contattami_container\">';\n\t\t\t\techo '<div class=\"triggers_overlay\">';\n\t\t\t\t\techo '<a rel=\"#friend\"><img src=\"../image/card/btn/btn_contattami.png\" style=\"z-index:9000;\"></a>';\t\t\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\techo '</div>';\n\t}", "function display($parameters){\n\t\tif ($this->module_debug){\n\t\t\t$this->call_command(\"UTILS_DEBUG_ENTRY\",array($this->module_name,\"polls_form\",__LINE__,print_r($parameters,true)));\n\t\t}\n\t\tif ($this->parent->server[LICENCE_TYPE]==ECMS){\n\t\t\t$url_parts \t\t= $this->call_command(\"MEMOINFO_GET_SQL_COMPONENTS\", Array(\n\t\t\t\t\t\"table_as\"\t\t\t=> \"akey1\",\n\t\t\t\t\t\"field_as\"\t\t\t=> \"accesskey_url\",\n\t\t\t\t\t\"identifier_field\"\t=> \"accesskey_data.accesskey_identifier\",\n\t\t\t\t\t\"module_command\"\t=> \"ACCESSKEYADMIN_\",\n\t\t\t\t\t\"client_field\"\t\t=> \"accesskey_client\",\n\t\t\t\t\t\"mi_field\"\t\t\t=> \"accesskey_url\"\n\t\t\t\t)\n\t\t\t);\n\t\n\t\t\t$sql = \"select distinct *, \".$url_parts[\"return_field\"].\" from accesskey_data \".$url_parts[\"join\"].\" where accesskey_client = $this->client_identifier \".$url_parts[\"where\"].\" order by accesskey_key desc\";\n\t\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t// find the length of the defined list as we will check these only additional one can be ignored.\n\t\t\t$max = count($this->defined_list);\n\t while($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t\t$found=0;\n\t \tfor ($index=0; $index<$max;$index++){\n\t\t\t\t\tif ($this->defined_list[$index][0] == $r[\"accesskey_key\"]){\n\t\t\t\t\t\t$title = $r[\"accesskey_title\"];\n\t\t\t\t\t\t$url = $r[\"accesskey_url\"];\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"0\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"1\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"3\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"4\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"m\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"s\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"-\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($r[\"accesskey_key\"]==\"=\" && $url==\"\"){\n\t\t\t\t\t\t\t$url = \"DEFINED\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->defined_list[$index][3] = $url;\n\t\t\t\t\t\t$this->defined_list[$index][4] = $title;\n\t\t\t\t\t\t$found=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found==0){\n\t\t\t\t\t// add on to the end of the defined_list\n\t\t\t\t\t$this->defined_list[count($this->defined_list)] = Array($r[\"accesskey_key\"],$r[\"accesskey_label\"],2,$r[\"accesskey_url\"],$r[\"accesskey_title\"]);\n\t\t\t\t}\n\t }\n\t $this->call_command(\"DB_FREE\",Array($result));\n\t\t\t$out =\"<module name=\\\"\".$this->module_name.\"\\\" display=\\\"accesskey\\\">\";\n\t\t\t\n\t\t\t$out .= \"<text clear='1'><![CDATA[\".LOCALE_ACCESSKEY_DEFINTION.\"]]></text>\";\n\t\t\t$out .= \"<access_list>\";\n\t\t\t$max = count($this->defined_list);\n\t\t\tfor ($i=0; $i<$max; $i++){\n\t\t\t\t$out .= \"<accesskey letter='\" . $this->defined_list[$i][0] . \"' type='\".$this->defined_list[$i][2] . \"'>\\n\";\n\t\t\t\t$out .= \"\t<label><![CDATA[\".$this->defined_list[$i][1] . \"]]></label>\\n\";\n\t\t\t\t$out .= \"\t<title><![CDATA[\".$this->check_parameters($this->defined_list[$i],4) . \"]]></title>\\n\";\n\t\t\t\t$out .= \"\t<url><![CDATA[\".$this->check_parameters($this->defined_list[$i],3) . \"]]></url>\\n\";\n\t\t\t\t$out .= \"</accesskey>\\n\";\n\t\t\t}\n\t\t\t\t$out .= \"<accesskey letter='-' type='0'>\\n\";\n\t\t\t\t$out .= \"\t<label><![CDATA[Reduce Font Size]]></label>\\n\";\n\t\t\t\t$out .= \"\t<title><![CDATA[Reduce Font Size]]></title>\\n\";\n\t\t\t\t$out .= \"\t<url><![CDATA[-/-reduce-font.php]]></url>\\n\";\n\t\t\t\t$out .= \"</accesskey>\\n\";\n\t\t\t\t$out .= \"<accesskey letter='=' type='0'>\\n\";\n\t\t\t\t$out .= \"\t<label><![CDATA[Increase Font Size]]></label>\\n\";\n\t\t\t\t$out .= \"\t<title><![CDATA[Increase Font Size]]></title>\\n\";\n\t\t\t\t$out .= \"\t<url><![CDATA[-/-increase-font.php]]></url>\\n\";\n\t\t\t\t$out .= \"</accesskey>\\n\";\n\t\t\t$out .= \"</access_list>\";\n\t\t\t$out .= \"<text clear='1'><![CDATA[\".LOCALE_ACCESSKEY_DEFINTION_BROWSERS.\"]]></text>\";\n\t\t\t$out .=\"</module>\";\n\t\t\treturn $out;\n\t\t} else {\n\t\t\treturn $this->parent->accesskeys($parameters);\n\t\t}\n\t}", "public function verCamara1EnPlasma( ) {\n\tAccesoControladoresDispositivos::$ctrlPlasma->verCamara1EnPlasma();\n\tAccesoGui::$guiPlasma->verCamaraEnPlasma(1);\n }", "public function display() {\n\n\t\t\n\n\t}", "public function show($id)\n {\n $f1aulac1m1 = $this->f1aulac1m1Repository->find($id);\n\n if (empty($f1aulac1m1)) {\n Flash::error('F1Aulac1M1 not found');\n\n return redirect(route('f1aulac1m1s.index'));\n }\n\n return view('f1aulac1m1s.show')->with('f1aulac1m1', $f1aulac1m1);\n }", "function show(){\n $model = $this->getModel('ResearchArea', 'JResearchModel');\n $view = $this->getView('ResearchArea', 'html', 'JResearchView');\n $view->setModel($model, true);\n $view->display();\n\t}", "public function show($id)\n {\n $p1aulac2m1 = $this->p1aulac2m1Repository->find($id);\n\n if (empty($p1aulac2m1)) {\n Flash::error('P1Aulac2M1 not found');\n\n return redirect(route('p1aulac2m1s.index'));\n }\n\n return view('p1aulac2m1s.show')->with('p1aulac2m1', $p1aulac2m1);\n }", "public function getCombat3()\n {\n $this->bc(['calculators' => trans('calculator.title'), 'calculators/combat' => trans('calculator.combat.title')]);\n $this->nav('navbar.runescape.title');\n $this->title('calculator.combat.title');\n\n return $this->view('calculators.combat.3');\n }", "function display ($name1, $name2, $name3=\"GeekyShows\")\n\t{\n echo \"$name1 to $name2 $name3 <br />\";\n\t}", "function about_us()\n\t{\n\t\t$data['show_data'] = $this->CMSPage->getData('1');\n\t\t$this->loadViews('aboutus', $this->global, $data, NULL);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle a Role on or off
public function toggleRole($role, $turnOn, $extra = null) { if ($turnOn) { $this->setRole($role, $extra); } else { $this->removeRole($role, $extra); } }
[ "public function toggleRole($request);", "public function toggleRole($userId, $sanghaId);", "abstract public function disableRoles();", "public function changeRole()\n {\n //prevent CSRF\n if (!isset($_POST['token']) || !Token::check($_POST['token'], false))\n {\n echo json_encode([\"displayError\" => self::$language->invokeOutput('frequent/badRequest')]);\n }else{\n unset($_POST['token']);\n $change = usersAPI::getInstance()->changeRole($_POST);\n if (is_string($change) )\n echo json_encode([\"done\" => $change, 'reload' => true]);\n else\n {\n if (is_array($change))\n echo json_encode([\"displayError\" => $change[0]]);\n else\n echo json_encode([\"displayError\" => Controller::$language->invokeOutput('frequent/wrong')]);\n }\n }\n }", "function setRole($role);", "public function toggle()\n {\n global $mysqli, $message, $user;\n\n $id = $_GET['id'];\n if ($this->id!=$_SESSION['user'] && $user->get_rank()<=1 && ($user->get_rank()<$this->rank))\n {\n $stmt = $mysqli->prepare(\"UPDATE users SET active = !active WHERE id=?\");\n $stmt->bind_param(\"i\", $this->id);\n $stmt->execute();\n $stmt->close();\n header(\"Location: \".WEB_URL.\"/admin/?do=user&id=\".$id);\n }else{\n $message = _(\"You don't have the permission to do that!\");\n }\n }", "public function toggleTurn()\n {\n $this->playerTurn = $this->playerTurn == 1 ? 2 : 1;\n $this->redis->setRedis($this->redisKeyTurn, $this->playerTurn);\n }", "public function changeUserRole()\n {\n $data = $this->validate(['role_id' => ['bail', 'required', 'numeric']]);\n\n /** @var User */\n $user = User::find($this->userId);\n\n if ($user) {\n\n $user->update($data);\n\n $this->emit('hideChangeRoleModal');\n \n }\n \n }", "public function hasRole();", "function ihc_switch_role_for_user($uid=0){\n\t$do_switch = get_option('ihc_automatically_switch_role');\n\tif ($do_switch && $uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0])){\n\t\t\t$role = get_option('ihc_automatically_new_role');\n\t\t\tif (empty($role)){\n\t\t\t\t$role = 'subscriber';\n\t\t\t}\n\t\t\t$arr['role'] = $role;\n\t\t\t$arr['ID'] = $uid;\n\t\t\twp_update_user($arr);\n\t\t}\n\t}\n}", "public function toggleMute() {\n $this->isMuted = ($this->isMuted=='n') ? \"y\" : \"n\";\n\t}", "function role_switch($roleid, $context) {\n global $USER, $CFG;\n\n/// If we can't use this or are already using it or no role was specified then bail completely and reset\n if (empty($roleid) || !has_capability('moodle/role:switchroles', $context)\n || !empty($USER->switchrole[$context->id]) || !confirm_sesskey()) {\n\n unset($USER->switchrole[$context->id]); // Delete old capabilities\n unset($USER->courseeditallowed); // drop cache for course edit button\n load_all_capabilities(); //reload user caps\n has_capability('clearcache'); // make sure we the cache is clear\n return true;\n }\n\n/// We're allowed to switch but can we switch to the specified role? Use assignable roles to check.\n if (!$roles = get_assignable_roles($context)) {\n return false;\n }\n\n/// unset default user role - it would not work anyway\n unset($roles[$CFG->defaultuserroleid]);\n\n if (empty($roles[$roleid])) { /// We can't switch to this particular role\n return false;\n }\n\n/// We have a valid roleid that this user can switch to, so let's set up the session\n\n $USER->switchrole[$context->id] = $roleid; // So we know later what state we are in\n unset($USER->courseeditallowed); // drop cache for course edit button\n\n load_all_capabilities(); //reload switched role caps\n has_capability('clearcache'); // make sure we the cache is clear\n\n/// Add some permissions we are really going to always need, even if the role doesn't have them!\n\n $USER->capabilities[$context->id]['moodle/course:view'] = CAP_ALLOW;\n\n return true;\n\n}", "function revokeRole($role);", "public function toggleStatus() {\n\t\tif ($this->status == null)\n\t\t\treturn $this->allow();\n\t\treturn $this->disallow();\n\t}", "public function statusAction()\n {\n $roleRow = new Admin_Model_DbRow_Role($this->dbRole->find($this->checkRoleIdParam()));\n\n IF($roleRow->get('id')) {\n $roleRow->set('enabled', $roleRow->get('enabled', 0) == 1 ? 0 : 1);\n $this->dbRole->update($roleRow->toDbArray(array('enabled')), $roleRow->get('id'));\n }\n \n $this->_redirect('admin/role/index');\n }", "private function toggle(Context $context)\n {\n $fdt = $context->formdata();\n $type = $fdt->mustpost('bean');\n $field = $fdt->mustpost('field');\n\n $bn = $context->load($type, $fdt->mustpost('id'), Context::R400);\n if ($type === 'user' && ctype_upper($field[0]))\n { # not simple toggling...\n if (is_object($bn->hasrole('Site', $field)))\n {\n $bn->delrole('Site', $field);\n }\n else\n {\n $bn->addrole('Site', $field, '', $context->utcnow());\n }\n }\n else\n {\n $bn->$field = $bn->$field == 1 ? 0 : 1;\n R::store($bn);\n }\n }", "function role_switch($roleid, $context) {\n global $USER;\n\n global $db;\n\n/// If we can't use this or are already using it or no role was specified then bail completely and reset\n if (empty($roleid) || !has_capability('moodle/role:switchroles', $context)\n || !empty($USER->switchrole[$context->id]) || !confirm_sesskey()) {\n load_user_capability('', $context); // Reset all permissions for this context to normal\n unset($USER->switchrole[$context->id]); // Delete old capabilities\n return true;\n }\n\n/// We're allowed to switch but can we switch to the specified role? Use assignable roles to check.\n if (!$roles = get_assignable_roles($context)) {\n return false;\n }\n\n if (empty($roles[$roleid])) { /// We can't switch to this particular role\n return false;\n }\n\n if (!$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID)) {\n return false;\n }\n\n/// We have a valid roleid that this user can switch to, so let's set up the session\n\n $USER->switchrole[$context->id] = $roleid; // So we know later what state we are in\n\n unset($USER->capabilities[$context->id]); // Delete old capabilities\n\n if ($capabilities = get_records_select('role_capabilities', \"roleid = $roleid AND contextid = $sitecontext->id\")) {\n foreach ($capabilities as $capability) {\n $USER->capabilities[$context->id][$capability->capability] = $capability->permission;\n }\n }\n\n/// Add some permissions we are really going to always need, even if the role doesn't have them!\n\n $USER->capabilities[$context->id]['moodle/course:view'] = CAP_ALLOW;\n\n return true;\n\n}", "public function setIsAssignableToRole(?bool $value): void {\n $this->getBackingStore()->set('isAssignableToRole', $value);\n }", "function assignRole($role);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the Betaout Javascript text to place at the page footer Generates based on Betaout URLs and settings Includes code for setEcommerceView, depending on whether this option is set
public function getFooterText() { $this->init(); $customer_fname = ""; $email = ""; $phone = ""; $cid = ""; $newLettere = ""; $newLettern = ""; if ($this->customer->getNewsletter()) { $newLettere = $this->customer->getEmail(); $newLettern = $this->customer->getFirstName(); } if ($this->customer->isLogged()) { $customer_fname = $this->customer->getFirstName(); $email = $this->customer->getEmail(); $phone = $this->customer->getTelePhone(); $cid = $this->session->data['customer_id']; } if (isset($this->request->get['product_id'])) { $this->setEcommerceView(); } $betaout_footer = '<script type="text/javascript"> var _bout = _bout || []; var _boutAKEY = "' . $this->betaout_api_key . '"; var _boutPID = "' . $this->betaout_site_id . '"; function _boutS(u) { var d = document, f = d.getElementsByTagName("script")[0], _sc = d.createElement("script"); _sc.type = "text/javascript"; _sc.async = true; _sc.src = u; f.parentNode.insertBefore(_sc, f); } _boutS("//js.betaout.com/jal-v2.min.js"); _bout.push(["identify", { "customer_id": "' . $cid . '", "email": "' . $email . '", "phone": "' . $phone . '"},' . '{"productId": "' . $this->productId . '", "categoryId": "' . $this->catId . '", "brandName": "' . $this->brandName . '"} ]); </script>'; return $betaout_footer; }
[ "static function action_inject_custom_admin_js_footer() {\n\n\t\t// Skip if this tool is site-disabled (when network-disabled, it should load with network defaults)\n\t\tif ( ! Clientside_Options::get_saved_option( 'enable-custom-cssjs-tool' ) && ! Clientside_Options::get_saved_network_option( 'disable-custom-cssjs-tool' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine this area's value\n\t\t// If this tool is network disabled, use the network defaults\n\t\tif ( Clientside_Options::get_saved_network_option( 'disable-custom-cssjs-tool' ) ) {\n\t\t\t$value = Clientside_Options::get_saved_network_default_option( 'custom-admin-js-footer' );\n\t\t}\n\t\t// Use the regular site options\n\t\telse {\n\t\t\t$value = Clientside_Options::get_saved_option( 'custom-admin-js-footer' );\n\t\t}\n\n\t\t// Only if custom JS is supplied\n\t\tif ( ! $value ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Output JS\n\t\techo '<script class=\"clientside-custom-js\">';\n\t\techo $value;\n\t\techo '</script>';\n\n\t}", "function putScriptInFooter(){\r\n\t\techo stripslashes(get_option( 'aw_footer' ));\r\n\t}", "function cbb_footer() {\n global $cbb_gwt_needs_load;\n if ($cbb_gwt_needs_load) {\n\t// Initialize default values if necessary\n\tif (get_option('cbb_leftranklabel') == '') {\n\t cbb_options_init();\n\t}\n\techo '<script type=\"text/javascript\" src=\"' . CBB_URL . '/chessbyblog.nocache.js\"></script>';\n }\n}", "public function footer_block()\n\t{\n\t\t$content = Kohana::config(\"globalcode.foot\").\n\t\t\t\t$this->google_analytics().\"\\n\".\n\t\t\t\t$this->ushahidi_stats_js().\"\\n\".\n\t\t\t\t$this->cdn_gradual_upgrade().\"\\n\".\n\t\t\t\t$this->scheduler_js();\n\n\t\t// Filter::footer_block - Modify Footer Block\n\t\tEvent::run('ushahidi_filter.footer_block', $content);\n\n\t\treturn $content;\n\t}", "static function display_footer_text() {\n\n\t\t// Get Theme Options from Database.\n\t\t$theme_options = zeeDynamic_Pro_Customizer::get_theme_options();\n\n\t\t// Display Footer Text.\n\t\tif ( '' !== $theme_options['footer_text'] ) :\n\n\t\t\techo do_shortcode( wp_kses_post( $theme_options['footer_text'] ) );\n\n\t\tendif;\n\n\t\t// Call Credit Link function of theme if credit link is activated.\n\t\tif ( true === $theme_options['credit_link'] ) :\n\n\t\t\tif ( function_exists( 'zeedynamic_footer_text' ) ) :\n\n\t\t\t\tzeedynamic_footer_text();\n\n\t\t\tendif;\n\n\t\tendif;\n\n\t}", "function tlc_small_business_vat_notice_footer() {\n\t$shipping_page_slug = 'lieferung';\n\t$shipping_page = tlc_get_page_by_slug( $shipping_page_slug );\n\t\n\t?>\n\t<div id=\"tlc_small_business_vat_notice_footer\" class=\"tlc_small_business_vat_notice_footer\">\n\t <div class=\"col-full\">\n\t\t\t<em>\n\t\t\t\t<?php\n\t\t\t\tif ( !is_null( $shipping_page ) )\n\t\t\t\t\tprintf( __( '* All stated prices are final prices excl. <a href=\"%s\">Shipping</a>, exempt from VAT according to Art. 19 of the German VAT law (UStG).', 'thelittlecraft' ), esc_url( get_page_link( $shipping_page ) ) );\n\t\t\t\telse \n\t\t\t\t\techo( __( '* All stated prices are final prices excl. Shipping, exempt from VAT according to Art. 19 of the German VAT law (UStG).', 'thelittlecraft' ) );\n\t\t\t\t?>\n\t\t\t</em>\n\t </div>\n\t</div>\n\t<!-- #small_business_vat_notice_footer -->\n\t<?php\n}", "function bimber_add_tracking_code_in_footer() {\n\tif ( ! is_admin() ) {\n\t\techo bimber_get_theme_option( 'tracking_code', 'footer' );\n\t}\n}", "function dotdigital_action_footer_scripts()\t{\n\t\tif (function_exists('fw_get_db_customizer_option')) {\n\t\t\t$tracking_scripts = fw_get_db_customizer_option('tracking_scripts_bottom', '');\n\t\t\tif (!empty($tracking_scripts)) {\n\t\t\t\tforeach ($tracking_scripts as $script) {\n\t\t\t\t\tif (isset($script['script']) && !empty($script['script'])) {\n\t\t\t\t\t\techo '<!-- wp_footer TS -->'. $script['script'] .'<!-- End wp_footer TS -->';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "static public function get_allow_seopressor_footer() {\r\n\t\t\t$options = self::get_options();\r\n\t\t \treturn $options['allow_seopressor_footer'];\r\n\t\t}", "function admin_footer_text() {\n\t echo $this->admin_footer_text ? $this->admin_footer_text : '';\n\t}", "public function buildSDKDebugFooter() {\n $staging = !empty($this->base->config['staging']) ? 'true' : 'false';\n $testing = !empty($this->base->config['testing']) ? 'true' : 'false';\n $sdk_enabled = !empty($this->base->config['seo_sdk_enabled']) ? 'true' : 'false';\n $ssl_enabled = !empty($this->base->config['ssl_enabled']) ? 'true' : 'false';\n $proxy_host = !empty($this->base->config['proxy_host']) ? $this->base->config['proxy_host'] : 'none';\n $proxy_port = !empty($this->base->config['proxy_port']) ? $this->base->config['proxy_port'] : '0';\n $local_seo_file_root = (!empty($this->base->config['load_seo_files_locally'])) ? $this->base->config['local_seo_file_root'] : 'false';\n $content_type = mb_strtoupper($this->base->config['content_type']);\n $subject_type = mb_strtoupper($this->base->config['subject_type']);\n\n if (!empty($this->base->config['page_params']['subject_id'])\n && !empty($this->base->config['page_params']['content_type'])\n && $this->base->config['page_params']['content_type'] == $this->base->config['content_type']\n ) {\n $subject_id = $this->base->config['page_params']['subject_id'];\n } else {\n $subject_id = $this->base->config['subject_id'];\n }\n\n $footer = \"\\n\" . '<ul id=\"BVSEOSDK_DEBUG\" style=\"display:none;\">';\n\n $footer .= \"\\n\" . ' <li data-bvseo=\"staging\">' . $staging . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"testing\">' . $testing . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"seo.sdk.enabled\">' . $sdk_enabled . '</li>';\n if (!isset($this->base->config['subject_type']) || $this->base->config['subject_type'] != 'seller') {\n $footer .= \"\\n\" . ' <li data-bvseo=\"stagingS3Hostname\">' . $this->base->bv_config['seo-domain']['staging'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"productionS3Hostname\">' . $this->base->bv_config['seo-domain']['production'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"testingStagingS3Hostname\">' . $this->base->bv_config['seo-domain']['testing_staging'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"testingProductionS3Hostname\">' . $this->base->bv_config['seo-domain']['testing_production'] . '</li>';\n }\n $footer .= \"\\n\" . ' <li data-bvseo=\"proxyHost\">' . $proxy_host . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"proxyPort\">' . $proxy_port . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"seo.sdk.execution.timeout.bot\">' . $this->base->config['execution_timeout_bot'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"seo.sdk.execution.timeout\">' . $this->base->config['execution_timeout'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"localSEOFileRoot\">' . $local_seo_file_root . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"cloudKey\">' . $this->base->config['cloud_key'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"bv.root.folder\">' . $this->base->config['bv_root_folder'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"seo.sdk.charset\">' . $this->base->config['charset'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"seo.sdk.ssl.enabled\">' . $ssl_enabled . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"crawlerAgentPattern\">' . $this->base->config['crawler_agent_pattern'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"subjectID\">' . urlencode($subject_id) . '</li>';\n\n\n $footer .= \"\\n\" . ' <li data-bvseo=\"en\">' . $sdk_enabled . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"pn\">bvseo-' . $this->base->config['page'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"userAgent\">' . $_SERVER['HTTP_USER_AGENT'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"pageURI\">' . $this->base->config['page_url'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"baseURI\">' . $this->base->config['base_url'] . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"contentType\">' . $content_type . '</li>';\n $footer .= \"\\n\" . ' <li data-bvseo=\"subjectType\">' . $subject_type . '</li>';\n if (!empty($this->base->seo_url)) {\n $footer .= \"\\n\" . ' <li data-bvseo=\"contentURL\">' . $this->base->seo_url . '</li>';\n }\n\n $footer .= \"\\n\" . '</ul>';\n\n return $footer;\n }", "function serviceGetGiftBarFooter(){\r\n $giftbar = new FeeligoGiftbarApp(FeeligoDolApi::_());\r\n ?>\r\n <!-- Feeligo GiftBar -->\r\n <?php\r\n if ($giftbar->is_enabled()) {\r\n echo \"<script type='text/javascript'>\".$giftbar->initialization_js().\"</script>\";\r\n echo \"<script type='text/javascript' src='\".$giftbar->loader_js_url().\"'></script>\";\r\n\r\n echo \"<div id='flg_giftbar_container'></div>\";\r\n }\r\n \r\n \r\n }", "public function action_wp_footer() {\r\n\r\n\t\t$add_tracking = true;\r\n\r\n\t\t/**\r\n\t\t * Allows the tracking script to be removed.\r\n\t\t *\r\n\t\t * @since 1.0\r\n\t\t *\r\n\t\t * @param true $add_tracking Whether to output the tracking script.\r\n\t\t */\r\n\t\t$add_tracking = apply_filters( 'gform_hubspot_output_tracking_script', $add_tracking );\r\n\r\n\t\tif ( ! $add_tracking ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$feeds = $this->get_feeds();\r\n\t\tif ( empty( $feeds ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$portal_id = rgars( $feeds, '0/meta/_hs_portal_id' );\r\n\r\n\t\tif ( $portal_id && strlen( $portal_id ) > 0 ) {\r\n\t\t\tif ( ! is_admin() ) {\r\n\t\t\t\t?>\r\n<!-- Start of Async HubSpot Analytics Code -->\r\n<script type=\"text/javascript\">\r\n(function(d,s,i,r) {\r\nif (d.getElementById(i)){return;}\r\nvar n=d.createElement(s),e=d.getElementsByTagName(s)[0];\r\nn.id=i;n.src='//js.hs-analytics.net/analytics/'+(Math.ceil(new Date()/r)*r)+'/<?php echo $portal_id; ?>.js';\r\ne.parentNode.insertBefore(n, e);\r\n})(document,\"script\",\"hs-analytics\",300000);\r\n</script>\r\n<!-- End of Async HubSpot Analytics Code -->\r\n<?php\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getRenderFooter(): string\n {\n if (constant('DEBUG')) {\n return $this->jsRender->render();\n }\n return '';\n }", "public function cloudfooterpage() {\n\n User::$dbObj = new Db();\n\n PageContext::$response->cmsData = User::getActiveMenus();\n\n\n PageContext::addJsVar('bannerUrl', BASE_URL . \"index/ajaxBannerCount/\");\n\n $enableFB = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='enable_fb'\");\n $enableTW = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='enable_twitter'\");\n $enableLN = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='enable_ln'\");\n\n $FBLink = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='facebookUrl'\");\n $TWLink = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='twitterUrl'\");\n $LNLink = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='linkedInUrl'\");\n\n\n\n\n\n PageContext::$response->enableFB = $enableFB;\n PageContext::$response->enableTW = $enableTW;\n PageContext::$response->enableLN = $enableLN;\n\n PageContext::$response->FBLink = $FBLink;\n PageContext::$response->TWLink = $TWLink;\n PageContext::$response->LNLink = $LNLink;\n\n // Banner Display in footer\n $FooterBanner = User::loadBanners();\n PageContext::$response->BannerImage = $FooterBanner;\n\n // End\n //Google Analytics Code\n\n $googleSettings = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='enableGoogleAdsense'\");\n\n $googleCode = User::$dbObj->selectRow(\"Settings\", \"value\", \"settingfield='googleAdsense'\");\n\n\n PageContext::$response->googleSettings = $googleSettings;\n\n PageContext::$response->googleCode = $googleCode;\n\n // End\n }", "function bones_custom_admin_footer() {\n\t_e( '<span id=\"footer-thankyou\">Developed by <a href=\"http://yoursite.com\" target=\"_blank\">Your Site Name</a></span>. Built using <a href=\"http://themble.com/bones\" target=\"_blank\">Bones</a>.', 'bonestheme' );\n}", "function siteBasicFooter(){\n $html = \"<script src='\".BASE_URL.\"/js/main.js'></script>\"\n . \"</body>\"\n . \"</html>\";\n return $html;\n}", "function add_ga_link_footer() {\n $code = get_option('ga_tracking_code');\n if ($code) {\n echo \"<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n ga('create', '$code', 'auto');\n ga('send', 'pageview'); \n </script>\";\n }\n }", "function PAYPAL_siteFooter()\n{\n global $_PAY_CONF;\n\n $retval = '';\n\n switch( $_PAY_CONF['display_blocks'] ) {\n case 0 : // none\n case 1 : // left only\n $retval .= COM_siteFooter();\n break;\n case 2 : // right only\n case 3 : // left and right\n default :\n $retval .= COM_siteFooter(true);\n break;\n }\n return $retval;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the Profile model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Profile::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.')); }
[ "public function findById($profileId)\n {\n $profile = $this->profileMapper->findById($profileId);\n if ($profile) {\n return $profile;\n }\n throw new Application_Repository_Exception_NotFound('Not found profile', 404);\n }", "protected function findModel($id) {\r\n if (($model = Profile::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\r\n {\r\n if (($model = Profile::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findProfile($id)\n {\n if (($model = DonorProfile::findOne(['user_id' => $id])) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Profile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find_profile() {\n\n\t\t# if not logged in -> redirect to the login page\n\t\tif (!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# Set up the View\n\t\t$this->template->content = View::instance(\"v_profiles_find_profile\");\n\t\t$this->template->title = \"Find a Profile\";\n\n\t\t# Query for all User Profiles\n\t\t$q = \"\tSELECT\n\t\t\t\t\tuser_profiles.profile_id,\n\t\t\t\t\tusers.user_id,\n\t\t\t\t\tusers.first_name,\n\t\t\t\t\tusers.last_name\n\t\t\t\tFROM user_profiles\n\t\t\t\tINNER JOIN users \n\t\t\t\tON users.user_id = user_profiles.user_id\";\n\n\t\t# Execute search abd store the result array in the variable $users\n\t\t$user_profiles = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# Pass data to the view\n\t\t$this->template->content->user_profiles = $user_profiles;\n\n\t\t# Render the view\n\t\techo $this->template;\n\t}", "protected function findModel($id)\n {\n if (($model = ProfileUser::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = TravellersProfile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }", "protected function findModel($id=null)\n\t{\n\t\tif ($id == null) {\n\t\t\t$id = Yii::$app->user->id;\n }\n\t\tif (($model = Users::findOne($id)) !== null) {\n\t\t\treturn $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = CustomerProfiles::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = Tblprofile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = ApplicantProfile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Profiles::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Page::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = ProfileFields::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = UserProfile::findOne($id)) !== null) {\n return $model;\n } else {\n return null;\n //throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Certificate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = User::findOne(['auth_key' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Funcion para copiar el playlist completo de un usuario origen a un usuario destino Ejemplo de uso: CopyAllPlaylistsUsers('Usuario1','Usuario2');
public function CopyAllPlaylistsUsers($usuario_origen, $usuario_destino) { $this->CheckToken(); $PlayLists_origen = $this->GetPlayLists($usuario_origen); $arreglo_tracks = array(); foreach ($PlayLists_origen as $plo) { if ((count($plo) > 0) && ((is_array($plo) || is_object($plo)))) { if (is_array($plo) || is_object($plo)) { $i = 0; foreach ($plo as $plo2) { $name_playlist = $plo2->name; $id_playlist = $plo2->id; $tracks = $this->GetTracks($usuario_origen, $id_playlist); foreach ($tracks as $trk) { if (is_array($trk) || is_object($trk)) { $i = 0; foreach ($trk as $trk2) { $prtrk = $trk2->track; $arreglo_tracks[$id_playlist][$name_playlist][$i] = $prtrk->id; $i++; } } } $i++; } } } } foreach ($arreglo_tracks as $a1) { $name_playlist = key($a1); $playlists_destino = $this->api->getUserPlaylists($usuario_destino); $existe = false; $id_playluist_destino = NULL; foreach ($playlists_destino as $pld) { if (is_array($pld) || is_object($pld)) { foreach ($pld as $pld2) { if ($pld2->name == $name_playlist) { $existe = true; $id_playluist_destino = $pld2->id; } } } if (!$existe) { $test_response = $this->api->createUserPlaylist($usuario_destino, array( 'name' => $name_playlist )); $playlists_destino2 = $this->api->getUserPlaylists($usuario_destino); foreach ($playlists_destino2 as $pld2) { if (is_array($pld2) || is_object($pld2)) { foreach ($pld2 as $pld3) { if ($pld3->name == $name_playlist) { $existe = true; $id_playluist_destino = $pld3->id; } } } } } } $para_eliminar = array(); $xxtracks = $this->api->getUserPlaylistTracks($usuario_destino, $id_playluist_destino); foreach ($xxtracks as $xts) { if (is_array($xts) || is_object($xts)) { foreach ($xts as $xts2) { if (is_array($xts2) || is_object($xts2)) { foreach ($xts2 as $xts3) { $id_track_destio = $xts3->id; array_push($para_eliminar, $id_track_destio); } } } } } foreach ($a1 as $a2) { foreach ($a2 as $a21) { if (in_array($para_eliminar, $a21)) { $pos = array_search($a21, $a2); unset($a2[$pos]); //Lo elimino si se repite } } $this->api->addUserPlaylistTracks( $usuario_destino, $id_playluist_destino, $a2 //Canciones de un playlist ); } } }
[ "function copy_list($from, $to) {\n\tfor($i = 0; $i < count($from); $i++)\n\t\tcopy2($from[$i], $to[$i]);\n\techo \"\\nCopied \".count($from).\" files\\n\";\n}", "public function move(UserInterface $user, SubscriptionListInterface $from, SubscriptionListInterface $to);", "function favorites_merge()\n{\n\tglobal $db, $mybb, $source_user, $destination_user;\n\t$uid = array(\n\t\t\"uid\" => $destination_user['uid']\n\t);\t\n\t$db->update_query(\"favorites\", $uid, \"uid='{$source_user['uid']}'\");\n}", "public function chargerPlaylists()\n\t{\n\t\tif(!isset($this->user_id))\n\t\t\treturn;\n\t\t\t\n\t\t$this->playlists = Playlist::findByUser($this->user_id);\n\t}", "public function copyFilesTo()\r\n {\r\n // check 'FROM' permission\r\n $from_gid = $this->input->get_post('gid') ?: '-1';\r\n if ( ! $this->_is_group_viewer($from_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n // check 'TO' permission\r\n $to_gid = $this->input->get_post('to_gid') ?: '-1';\r\n if ( ! $this->_is_group_editor($to_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n\r\n // check crumb\r\n $this->_check_path_crumb();\r\n\r\n // insert userlog\r\n $to_access_full_path = $this->_get_access_full_path($to_gid, $this->_get_path('to_path'));\r\n $details = lang('miiicloud-files-userlog_copy_to', NULL, array('path' => $to_access_full_path));\r\n $this->_insert_userlog(Userlog_model::FILE_COPY, $details);\r\n\r\n $from_access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $rtn = $this->files_model->copy_files_to($from_access_full_path, $to_access_full_path, $filenames_arr);\r\n $format = $this->input->get_post('format');\r\n if ($format == 'json' || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'))\r\n {\r\n $this->_outputJSON($rtn);\r\n }\r\n\r\n // return to folder\r\n $folder_url = '/files?' . $this->files_model->build_query_string();\r\n header('Location: ' . $folder_url);\r\n }", "private function CopyList($param)\n\t{\n\t\tif ($param['user']->CanCreateList() !== true) {\n\t\t\tFlashMessage(GetLang('TooManyLists'), SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));\n\t\t}\n\n\t\t$id = (isset($_GET['id'])) ? (int)$_GET['id'] : 0;\n\t\t$api = $this->GetApi();\n\t\tlist($result, $newid) = $api->Copy($id);\n\n\t\tif (!$result) {\n\t\t\tFlashMessage(GetLang('ListCopyFail'), SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));\n\t\t} else {\n\t\t\t$param['user']->LoadPermissions($param['user']->userid);\n\t\t\t$param['user']->GrantListAccess($newid);\n\t\t\t$param['user']->SavePermissions();\n\t\t\tIEM::sessionRemove('UserLists');\n\t\t\tFlashMessage(GetLang('ListCopySuccess'), SS_FLASH_MSG_SUCCESS, IEM::urlFor('Lists', array('Action' => 'Edit', 'id' => $newid)));\n\t\t}\n\t}", "function copy($_to){\n\t\t$_to->groupSet( array_keys($this->groupGet()) );\n\n\t\t//merge user accounts, target preferred\n\t\tforeach ($this->account() as $aId=>$aVal) {\n\t\t\tif ($_to->account($aId, False)===False)\n\t\t\t\t$_to->accountSet([$aId=>$aVal]);\n\t\t}\n\t}", "function sync($f3) {\n\t\t$plid = $f3->get('POST.plid');\n\t\t$db = $this->db;\n\t\t$user = new DB\\SQL\\Mapper($db, 'users');\n\t\t$user->load(array('id=?', $f3->get('SESSION.uid')));\n\t\t\n\t\tif (!$user->dry() && !is_null($user->playlists)) {\n\t\t\t//check user has playlist in his collection\n\t\t\t$userPlaylists = $db->exec(\"SELECT * FROM playlists WHERE id IN ($user->playlists)\");\n\t\t\t$doNothing = true;\n\t\t\tforeach($userPlaylists as $userPlaylist) {\n\t\t\t\tif ($userPlaylist['id'] == $plid) {\n\t\t\t\t\t$doNothing = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!$doNothing) {\n\t\t\t\t//get db playlist and videos collection\n\t\t\t\t$playlistsMapper = new DB\\SQL\\Mapper($db, 'playlists');\n\t\t\t\t$playlistsMapper->load(array('id=?', $plid));\n\t\t\t\t\n\t\t\t\tif (!$playlistsMapper->dry()) {\n\t\t\t\t\t$lastSync = $playlistsMapper->lastSync !== null ? \n\t\t\t\t\t\tDateTime::createFromFormat('Y-m-d H:i:s', $playlistsMapper->lastSync) :\n\t\t\t\t\t\tnull;\n\n\t\t\t\t\t//check if last sync was more than 5mins ago\n\t\t\t\t\tif ($lastSync && (new DateTime())->getTimeStamp() - $lastSync->getTimeStamp() > 5 * 60) {\n\t\t\t\t\t\t$dbVideos = is_null($playlistsMapper->videos) ?\n\t\t\t\t\t\t\t\t\tarray() : $db->exec(\"SELECT * FROM videos WHERE id IN ($playlistsMapper->videos)\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//get youtube playlist items\n\t\t\t\t\t\trequire_once dirname(__FILE__) . '/ext/youtubeapi.php';\n\t\t\t\t\t\t$ytapi = new Youtubeapi($f3);\n\t\t\t\t\t\t$ytVideos = $ytapi->getPlaylistItems($playlistsMapper->ytid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!is_null($ytVideos) && $dbVideos !== false) {\n\t\t\t\t\t\t\t//if playlist contains more than maxResults items, get next pages videos\n\t\t\t\t\t\t\t$nextPageToken = isset($ytVideos['nextPageToken']) ? $ytVideos['nextPageToken'] : false;\n\t\t\t\t\t\t\twhile($nextPageToken) {\n\t\t\t\t\t\t\t\t$nextVideos = $ytapi->getPlaylistItems($playlistsMapper->ytid, $nextPageToken);\n\t\t\t\t\t\t\t\tif (!is_null($nextVideos)) {\n\t\t\t\t\t\t\t\t\t$ytVideos['items'] = array_merge($ytVideos['items'], $nextVideos['items']);\n\t\t\t\t\t\t\t\t\t$nextPageToken = isset($nextVideos['nextPageToken']) ? $nextVideos['nextPageToken'] : false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t\t\t\t\t\t'lvl'\t=>\t'warning',\n\t\t\t\t\t\t\t\t\t\t'msg'\t=>\t'Error(s) occurred while synchronizing some of your playlist\\'s items'));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//compare both playlists collections\n\t\t\t\t\t\t\t$videosMapper = new DB\\SQL\\Mapper($db, 'videos');\n\t\t\t\t\t\t\tforeach($ytVideos['items'] as $ytVideo) {\n\t\t\t\t\t\t\t\t//find corresponding video in the database\n\t\t\t\t\t\t\t\t$dbVideoKey = array_search($ytVideo['snippet']['resourceId']['videoId'], array_column($dbVideos, 'ytid'));\n\t\t\t\t\t\t\t\tif ($dbVideoKey !== false) {\n\t\t\t\t\t\t\t\t\t$dbVideo = $dbVideos[$dbVideoKey];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$videosMapper->reset();\n\t\t\t\t\t\t\t\t\t$videosMapper->load(array('id=?', $dbVideo['id']));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (!$videosMapper->dry()) {\n\t\t\t\t\t\t\t\t\t\t//compare titles\n\t\t\t\t\t\t\t\t\t\tif ($dbVideo['currentTitle'] != $ytVideo['snippet']['title']) {\n\t\t\t\t\t\t\t\t\t\t\t//if they are different, add the name to the video's name history\n\t\t\t\t\t\t\t\t\t\t\t$videosMapper->titleHistory = $this->addToCsvUnique($ytVideo['snippet']['title'], $videosMapper->titleHistory);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ($videosMapper->forceTitleOverwrite == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\t$videosMapper->currentTitle = $ytVideo['snippet']['title'];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$videosMapper->status = $ytVideo['status']['privacyStatus'];\n\t\t\t\t\t\t\t\t\t\tif (isset($ytVideo['snippet']['thumbnails'])) {\n\t\t\t\t\t\t\t\t\t\t\t$videosMapper->thumbnails = $ytVideo['snippet']['thumbnails']['high']['url'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$videosMapper->save();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t//add the video to the database and to the user's playlist\n\t\t\t\t\t\t\t\t\t$videosMapper->reset();\n\t\t\t\t\t\t\t\t\t$videosMapper->ytid = $ytVideo['snippet']['resourceId']['videoId'];\n\t\t\t\t\t\t\t\t\t$videosMapper->currentTitle = str_replace(\";\", \",\", $ytVideo['snippet']['title']);\n\t\t\t\t\t\t\t\t\t$videosMapper->titleHistory = $videosMapper->currentTitle;\n\t\t\t\t\t\t\t\t\t$videosMapper->thumbnails = isset($ytVideo['snippet']['thumbnails']) ? \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ytVideo['snippet']['thumbnails']['high']['url'] : null;\n\t\t\t\t\t\t\t\t\t$videosMapper->publishedAt = $ytVideo['snippet']['publishedAt'];\n\t\t\t\t\t\t\t\t\t$videosMapper->status = $ytVideo['status']['privacyStatus'];\n\t\t\t\t\t\t\t\t\t$videosMapper->save();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (is_null($playlistsMapper->videos)) {\n\t\t\t\t\t\t\t\t\t\t$playlistsMapper->videos = $videosMapper->id;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t$playlistsMapper->videos .= \",\" . $videosMapper->id;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$playlistsMapper->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$playlistsMapper->load(array('id=?', $plid));\n\t\t\t\t\t\t\t$playlistsMapper->lastSync = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t$playlistsMapper->save();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t\t\t\t'lvl'\t=>\t'success',\n\t\t\t\t\t\t\t\t'msg'\t=>\t'Sync complete'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t\t\t\t'lvl'\t=>\t'danger',\n\t\t\t\t\t\t\t\t'msg'\t=>\t'An error occurred while synchronizing your playlist (make sure it\\'s public)'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t\t\t'lvl'\t=>\t'danger',\n\t\t\t\t\t\t\t'msg'\t=>\t'In order to void excessive bandwidth usage, please wait at least 5 minutes before syncing again'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t\t'lvl'\t=>\t'danger',\n\t\t\t\t\t\t'msg'\t=>\t'An error occurred while synchronizing your playlist'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$f3->push('flash', (object)array(\n\t\t\t\t\t'lvl'\t=>\t'danger',\n\t\t\t\t\t'msg'\t=>\t'An error occurred while synchronizing your playlist'));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->show($f3, array('plid' => $plid));\n\t}", "function syncPlaylists()\n{\n global $settings, $fppHome, $fppMode;\n $dir = \"playlists\";\n\n //if the fpp mode is master\n if (strtolower($fppMode) == \"master\") {\n if (isset($settings['MultiSyncRemotes']) && !empty($settings['MultiSyncRemotes'])) {\n $remotes = explode(',', $settings['MultiSyncRemotes']);\n //if we have remotes\n if (!empty($remotes)) {\n foreach ($remotes as $remote_id => $remote_ip) {\n $command = \"rsync -av --stats $fppHome/media/$dir/ $remote_ip::media/$dir/ 2>&1\";\n $command_result = exec($command);\n logEntry(\"syncPlaylists: Attempt Sync Playlists to (\" . $remote_ip . \") -- Result: \" . $command_result);\n }\n }\n }\n }\n}", "function playlist($playlist){\n\t\tglobal $include_path, $jbArr,$jzSERVICES;\n\t\t\n\t\tif (isset($jbArr[$_SESSION['jb_id']]['prefix']) && $jbArr[$_SESSION['jb_id']]['prefix'] == \"http\") {\n\t\t $content = \"\";\n\t\t foreach ($playlist->getList() as $track) {\n\t\t $content .= $track->getFileName(\"user\").\"\\n\";\n\t\t }\n\t\t $playlist = $content;\n\t\t} else {\n\t\t $playlist = $jzSERVICES->createPlaylist($playlist,\"jukebox\");\n\t\t $arr = explode(\"\\n\",$playlist);\n\t\t $arr2 = array();\n\t\t foreach ($arr as $a) {\n\t\t if (false === stristr($a, \"://\")) {\n\t\t $arr2[] = str_replace(\"/\",\"\\\\\",$a);\n\t\t } else {\n\t\t $arr2[] = $a;\n\t\t }\n\t\t }\n\t\t $playlist = implode(\"\\n\",$arr2);\n\t\t}\n\t\twriteLogData(\"messages\",\"Winamp3: Creating a playlist\");\n\n\t\t// First we need to get the current playlist so we can figure out where to add\n\t\t$clist = explode(\";;;\",@file_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \":\". $jbArr[$_SESSION['jb_id']]['port']. \"/getplaylisttitle?p=\". $jbArr[$_SESSION['jb_id']]['password']. \"&delim=;;;\"));\n\t\tforeach($clist as $item){\n\t\t\tif ($item <> \"\"){\n\t\t\t\t$curList[] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Let's get where we are in the current list\n\t\twriteLogData(\"messages\",\"Winamp3: Getting the current playing track number\");\n\t\t$curTrack = getCurPlayingTrack();\n\n\t\tswitch ($_SESSION['jb-addtype']) {\n\t\tcase \"end\":\n\t\tcase \"current\":\n\t\t $restart_playback = false;\n\t\t break;\n\t\tdefault:\n\t\t $restart_playback = true;\n\t\t}\n\n\t\t// Ok, now we need to figure out where to add the stuff\n\t\tif ($_SESSION['jb-addtype'] == \"current\"){\n\t\t\t// Ok, let's split our first playlist in 2 so we can add in the middle\n\t\t\t//$begArr = array_slice($curList,0,$curTrack+1);\n\t\t if (is_array($curList)) {\n\t\t $begArr = array();\n\t\t $endArr = array_slice($curList,$curTrack+1);\n\t\t } else {\n\t\t $begArr = array();\n\t\t $endArr = array();\n\t\t }\n\t\t} else if ($_SESSION['jb-addtype'] == \"begin\"){\n\t\t\t$begArr = array();\n\t\t\t$endArr = $curList;\n\t\t} else if ($_SESSION['jb-addtype'] == \"end\"){\n\t\t\t$begArr = array();\n\t\t\t$endArr = array();\n\t\t} else if ($_SESSION['jb-addtype'] == \"replace\") {\n\t\t $begArr = array();\n\t\t $endArr = array();\n\t\t}\n\t\t\n\t\t\n\t\tif ($restart_playback === true){\n\t\t writeLogData(\"messages\",\"Winamp3: Clearing the current playlist\");\n\t\t control(\"clear\",false);\n\t\t} else if ($_SESSION['jb-addtype'] == \"current\") {\n\t\t // Remove everything at the end of the playlist, since we are going to readd it all.\n\t\t for ($i = sizeof($curList); $i > $curTrack; $i--) {\n\t\t $arr = array();\n\t\t $arr['index'] = $i;\n\t\t httpqRequest(\"deletepos\",$arr);\n\t\t }\n\t\t}\n\t\t\n\t\twriteLogData(\"messages\",\"Winamp3: Sending the new playlist to the player\");\n\n\n\n\n\n\t\t// Now let's send the new playlist to the player\n\t\tfor ($i=0; $i < count($begArr); $i++){\n\t\t\t// Now let's add this\n\t\t\tif ($begArr[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $begArr[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\t\t\n\t\t// Ok, Now let's add the new stuff\n\t\t$pArray = explode(\"\\n\",$playlist);\n\t\tfor ($i=0; $i < count($pArray); $i++){\n\t\t\tif ($pArray[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $pArray[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\n\t\t// Now let's finish this out\n\t\tfor ($i=0; $i < count($endArr); $i++){\n\t\t\t// Now let's add this\n\t\t\tif ($endArr[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $endArr[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\n\n\t\t// Now let's jump to where we need to play\n\t\tswitch ($_SESSION['jb-addtype']){\n\t\t\tcase \"current\":\n\t\t\t\tif ($curTrack == 0){$curTrack = -1;}\n\t\t\t\t$_POST['jbjumpto'] = $curTrack + 1;\n\t\t\tbreak;\n\t\t\tcase \"end\":\n\t\t\t\t$_POST['jbjumpto'] = $curTrack;\n\t\t\tbreak;\n\t\tcase \"replace\":\n\t\tcase \"begin\":\n\t\t\t\t$_POST['jbjumpto'] = 0;\n\t\t\tbreak;\n\t\t}\n\t\tif ($restart_playback) {\n\t\t control(\"jumpto\");\n\t\t control(\"play\");\n\t\t}\n\n\t\tif (defined('NO_AJAX_JUKEBOX')) {\n\t\t?>\n\t\t<script>\n\t\t\thistory.back();\n\t\t</script>\n\t\t<?php \n\t\t }\n\t\texit();\n\t}", "function copyAvatar($file,$user){\n\t//Todo: Seite dynamisch Übergeben?\n\tglobal $avt_path;\n\tsystem(\"cp $file \".$avt_path.\"$user.png\");\n\theader('Location: http://' . $_SERVER['HTTP_HOST'] . '/internal/cosee/index.php?page=konto');\n}", "static function copyUsersUploadDir() {\n $config = Zend_Registry::get('config');\n $patchSource = $config['paths']['backup']['dir'] . '/upload';\n $patchSource = Default_Plugin_PathBox::normalize($patchSource);\n $patchDest = APPLICATION_PUBLIC . '/upload';\n $patchDest = Default_Plugin_PathBox::normalize($patchDest);\n //-------------------------\n if (!is_dir($patchDest)) {\n if(!mkdir($patchDest)){\n throw new Exception(\"Failed to create folders...'{$patchDest}'.\");\n }\n if (is_dir($patchSource)) {\n // Get the FileTree object\n $ft = new Default_Plugin_FileTree($patchSource);\n // Create tree of files\n $ft->readTree();\n // Copy the current fileset to another location\n if($ft->writeTo($patchDest) === FALSE){\n throw new Exception(\"Could not be copied '{$patchSource}' to '{$patchDest}'.\");\n } else {\n $ft->delFiles();// Delete this source\n }\n } else {\n throw new Exception(\"There is no this dir '{$patchSource}'.\");\n }\n }\n }", "public function CreatePlaylist($usuario, $nombre_playlist)\r\n\t{\r\n\t\t$this->CheckToken();\r\n\r\n\t\t$respuesta = $this->api->createUserPlaylist($usuario, array(\r\n\t\t\t'name' => $nombre_playlist\r\n\t\t));\r\n\t\treturn $respuesta;\r\n\t}", "function get_playlists($account, $playlist_list) {\n $result = array();\n foreach ($playlist_list as $id=>$playlist) {\n if ($playlist['user'] == $account) {\n $result[$id] = $playlist;\n }\n }\n return $result;\n}", "function transferOwnership($oldUserId, $newUserId) {\n\t\t$submissionFiles =& $this->_getInternally(null, null, null, null, null, null, null, $oldUserId, null, null);\n\t\tforeach ($submissionFiles as $file) {\n\t\t\t$daoDelegate =& $this->_getDaoDelegateForObject($file);\n\t\t\t$file->setUploaderUserId($newUserId);\n\t\t\t$daoDelegate->updateObject($file, $file); // nothing else changes\n\t\t}\n\t}", "public function copy($ids);", "function CopyFilesToNewId($id_prop_from, $id_prop_to)\n {\n\n $q = \"SELECT `\".TblModCatalogPropFiles.\"`.*, `\".TblModCatalogPropFilesTxt.\"`.`lang_id`, `\".TblModCatalogPropFilesTxt.\"`.`name`, `\".TblModCatalogPropFilesTxt.\"`.`text`\n FROM `\".TblModCatalogPropFiles.\"` LEFT JOIN `\".TblModCatalogPropFilesTxt.\"` ON (`\".TblModCatalogPropFiles.\"`.`id`=`\".TblModCatalogPropFilesTxt.\"`.`cod`)\n WHERE `\".TblModCatalogPropFiles.\"`.`id_prop`='\".$id_prop_from.\"'\n \";\n $res = $this->Right->Query($q, $this->user_id, $this->module);\n $rows = $this->Right->db_GetNumRows();\n //echo '<br />$q='.$q.' $res='.$res.' $rows='.$rows;\n for($i=0;$i<$rows;$i++){\n $row_arr[$i] = $this->Right->db_FetchAssoc();\n }\n $path_old='';\n for($i=0;$i<$rows;$i++){\n $row = $row_arr[$i];\n //echo '<br />$row[path]='.$row['path'].' $path_old='.$path_old;\n if( !empty($row['path']) AND $row['path']!=$path_old ){\n $source = SITE_PATH.$this->settings['files_path'].'/'.$id_prop_from.'/'.$row['path'];\n //$ext = substr($row['path'],1 + strrpos($row['path'], \".\"));\n $uploaddir = SITE_PATH.$this->settings['files_path'].'/'.$id_prop_to;\n $uploaddir_0 = $uploaddir;\n if ( !file_exists ($uploaddir) ) mkdir($uploaddir,0777);\n else @chmod($uploaddir,0777);\n $uploaddir2 = $row['path'];\n $uploaddir = $uploaddir.\"/\".$uploaddir2;\n //echo '<br />$source='.$source.' <br />$uploaddir='.$uploaddir;\n $res = copy($source, $uploaddir);\n @chmod($uploaddir_0,0755);\n if(!$res) return false;\n $q = \"INSERT INTO `\".TblModCatalogPropFiles.\"` values (NULL, '\".$id_prop_to.\"', '\".$uploaddir2.\"', '\".$row['show'].\"', '\".$row['move'].\"')\";\n $res = $this->Right->Query($q, $this->user_id, $this->module);\n //echo '<br />$q='.$q.' $res='.$res;\n if(!$res OR !$this->Right->result) return false;\n $id_new = $this->Right->db_GetInsertID();\n $path_old = $row['path'];\n }\n if( !empty($row['lang_id']) OR !empty($row['name']) OR !empty($row['text']) ){\n $q = \"INSERT INTO `\".TblModCatalogPropFilesTxt.\"` values (NULL, '\".$id_new.\"', '\".$row['lang_id'].\"', '\".$row['name'].\"', '\".$row['text'].\"')\";\n $res = $this->Right->Query($q, $this->user_id, $this->module);\n //echo '<br />$q='.$q.' $res='.$res;\n if(!$res OR !$this->Right->result) return false;\n }\n }\n return true;\n }", "public function copy($copy_from = null, $copy_to = null) {\n\t\tif ($copy_to == null || $copy_from == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->_delete_copies($copy_to, $copy_from)) {\n\t\t\t$insert_data = $this->find('all', array('conditions' => array('role' => $copy_from), 'fields' => array('name')));\n\t\t\t$permission_count = count($insert_data);\n\t\t\tfor ($loop = 0; $loop < $permission_count; $loop++) {\n\t\t\t\t$insert_data[$loop]['Permission']['role'] = $copy_to;\n\t\t\t\t$insert_data[$loop]['Permission']['copied_from'] = $copy_from;\n\t\t\t}\n\t\t\tif ($this->saveAll($insert_data)) {\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}", "function playlist($playlist){\n\t\tglobal $include_path, $jbArr, $media_dirs,$jzSERVICES;\n\t\t\n\t\t$addtype = $_SESSION['jb-addtype'];\n\t\t$box = Quickbox::load();\n\t\t// todo: current, begin\n\t\tif ($addtype == 'end') {\n\t\t $list = $box['playlist'];\n\t\t} else {\n\t\t $list = array();\n\t\t}\n\n\t\tif ($addtype == 'replace') {\n\t\t $box['pos'] = 0;\n\t\t}\n\n\t\tforeach ($playlist->getList() as $track) {\n\t\t $list[] = $track->getFileName(\"user\").\"\\n\";\n\t\t}\n\n\t\t\n\t\t$box['command']='playlist';\n\t\t$box['command_time']=time();\n\t\t$box['playlist']=$list;\n\t\t$box['addtype']=$addtype;\n\t\t\n\t\tQuickbox::store($box);\n\t\t\n\t\texit();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return's the raw entity loader instance.
public function getRawEntityLoader();
[ "public function getRawEntityLoader()\n {\n return $this->rawEntityLoader;\n }", "public function getObjectLoader()\n {\n return new \\gihp\\Object\\Loader($this->io);\n }", "public function Loader() {\n if (self::$instance == null)\n self::$instance = new self();\n return self::$instance;\n }", "public function getLoader(): Loader\n {\n return $this->loader;\n }", "protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n $cacheDir = $this->getCacheDir();\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('VuFind\\ContentCoversPluginManager'),\n $this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n \\VuFind\\ServiceManager\\Initializer::initInstance(\n $this->loader, $this->getServiceLocator()\n );\n }\n return $this->loader;\n }", "protected function getLoader()\n {\n return $this->loader;\n }", "public static function getEntity( )\n {\n if (!static::$entity) {\n\n $tmp = \\Bitrix\\Highloadblock\\HighloadBlockTable::compileEntity(array(\n 'ID' => static::ENTITY_ID,\n 'NAME' => static::ENTITY_NAME,\n 'TABLE_NAME' => static::ENTITY_TABLE_NAME\n ));\n\n static::$entity = $tmp->getDataClass();\n\n }\n\n return static::$entity;\n }", "public function getLoader()\n {\n return $this->loader;\n }", "public function getLoader()\n {\n return $this->_loader;\n }", "protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n //wie gehen wir mit dem cache Manager um??\n $cacheDir = $this->getServiceLocator()->get('Resources\\CacheManager')\n ->getCache('cover')->getOptions()->getCacheDir();\n\n //I think we don't need the ThemeInfo Type for our purposes\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('Resources\\ContentCoversPluginManager'),\n //$this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n //Initializers are not necessary - an assumption\n //\\VuFind\\ServiceManager\\Initializer::initInstance(\n // $this->loader, $this->getServiceLocator()\n //);\n }\n return $this->loader;\n }", "public function getLoader() {\n return $this->loader;\n }", "public function getEntityHandler()\n {\n return $this->entityHandler;\n }", "protected function getEntityFromStorage() {\n $entity_type = $this->store->get('entity_type');\n $entity_id = $this->store->get('entity_id');\n\n /** @var \\Drupal\\Core\\Entity\\EntityInterface $entity */\n $entity = $this->entityTypeManager()->getStorage($entity_type)\n ->load($entity_id);\n\n return $entity;\n }", "function libxml_get_external_entity_loader(): ?callable {}", "private function getLoader($entity)\n {\n $entityClass = get_class($entity);\n\n if ($this->unsupportedClasses->containsKey($entityClass)) {\n return;\n }\n if ($this->loaders->containsKey($entityClass)) {\n return $this->loaders->get($entityClass);\n }\n foreach ($this->loaders as $handledClass => $loader) {\n if (is_a($entity, $handledClass)) {\n $this->loaders->set($entityClass, $loader);\n\n return $loader;\n }\n }\n\n $this->unsupportedClasses->set($entityClass, false);\n }", "public function getEntity() {\n $name = $this->_getEntityName();\n return new $name(null, $this->getConnection());\n }", "public static function getLoader()\n {\n /** @var \\Illuminate\\Translation\\Translator $instance */\n return $instance->getLoader();\n }", "protected function getLoader()\n {\n if (null === $this->loader) {\n $this->loader = include __DIR__.'/../../../../../src/Teknoo/States/bootstrap.php';\n }\n\n return $this->loader;\n }", "private function getEntityStorageHandler() {\n return \\Drupal::entityTypeManager()\n ->getStorage($this->entityTypeMachineName);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the setCodeTva() method.
public function testSetCodeTva() { $obj = new CdeClientLigne(); $obj->setCodeTva("codeTva"); $this->assertEquals("codeTva", $obj->getCodeTva()); }
[ "public function testSetCodeTva() {\n\n $obj = new LocationsFi();\n\n $obj->setCodeTva(\"codeTva\");\n $this->assertEquals(\"codeTva\", $obj->getCodeTva());\n }", "public function testSetCodeTva() {\n\n $obj = new CreditsBails();\n\n $obj->setCodeTva(\"codeTva\");\n $this->assertEquals(\"codeTva\", $obj->getCodeTva());\n }", "public function testSetCodeTva() {\n\n $obj = new CdeFournisseurLigne();\n\n $obj->setCodeTva(\"codeTva\");\n $this->assertEquals(\"codeTva\", $obj->getCodeTva());\n }", "public function testSetCodeTva() {\n\n $obj = new Clients();\n\n $obj->setCodeTva(\"codeTva\");\n $this->assertEquals(\"codeTva\", $obj->getCodeTva());\n }", "public function testSetCode()\n\t{\n\t\t$this->object->setCode('abcdefghijklmnopqrstuvwxyz');\n\t\t$code = $this->object->getOption('code');\n\t\t$this->assertEquals($code, 'abcdefghijklmnopqrstuvwxyz');\n\t}", "public function testSetCodeContratTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeContratTrav(\"codeContratTrav\");\n $this->assertEquals(\"codeContratTrav\", $obj->getCodeContratTrav());\n }", "public function testSetCodeIntitContratTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeIntitContratTrav(\"codeIntitContratTrav\");\n $this->assertEquals(\"codeIntitContratTrav\", $obj->getCodeIntitContratTrav());\n }", "public function testSetCode() {\n\n $obj = new ClientsSelAvance();\n\n $obj->setCode(\"code\");\n $this->assertEquals(\"code\", $obj->getCode());\n }", "public function testCode(): void\n {\n $actual = $expected = 'code';\n\n self::assertSame($this->settings, $this->settings->setCode($actual));\n self::assertSame($expected, $this->settings->getCode());\n self::assertSame('settings.code', $this->settings->getLabel());\n }", "public function testSetCodeTacheType() {\n\n $obj = new PointBonTrav();\n\n $obj->setCodeTacheType(\"codeTacheType\");\n $this->assertEquals(\"codeTacheType\", $obj->getCodeTacheType());\n }", "public function testSetCodeCalc() {\n\n $obj = new ControleTva();\n\n $obj->setCodeCalc(\"codeCalc\");\n $this->assertEquals(\"codeCalc\", $obj->getCodeCalc());\n }", "public function testSetCodeContratTrav() {\n\n $obj = new EmpDadsuParam();\n\n $obj->setCodeContratTrav(\"codeContratTrav\");\n $this->assertEquals(\"codeContratTrav\", $obj->getCodeContratTrav());\n }", "public function testSetCodeEquipe() {\n\n $obj = new PointBonTrav();\n\n $obj->setCodeEquipe(\"codeEquipe\");\n $this->assertEquals(\"codeEquipe\", $obj->getCodeEquipe());\n }", "public function testSetDetCodeTa() {\n\n $obj = new DecTva3514();\n\n $obj->setDetCodeTa(\"detCodeTa\");\n $this->assertEquals(\"detCodeTa\", $obj->getDetCodeTa());\n }", "public function testSetTvaCodeIntEmetteur() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCodeIntEmetteur(\"tvaCodeIntEmetteur\");\n $this->assertEquals(\"tvaCodeIntEmetteur\", $obj->getTvaCodeIntEmetteur());\n }", "public function testSetCodeExoTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeExoTrav(\"codeExoTrav\");\n $this->assertEquals(\"codeExoTrav\", $obj->getCodeExoTrav());\n }", "public function testSetCodeVariante() {\n\n $obj = new ArtVarDepot();\n\n $obj->setCodeVariante(\"codeVariante\");\n $this->assertEquals(\"codeVariante\", $obj->getCodeVariante());\n }", "public function testSetCodeEtablissement() {\n\n $obj = new HistoTransfertCpta();\n\n $obj->setCodeEtablissement(10);\n $this->assertEquals(10, $obj->getCodeEtablissement());\n }", "public function testSetTvaCodeIntRecepteur() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCodeIntRecepteur(\"tvaCodeIntRecepteur\");\n $this->assertEquals(\"tvaCodeIntRecepteur\", $obj->getTvaCodeIntRecepteur());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtiene las distintas fases.
public function getFasesDistintas() { $aDat = $this->getDistintos($this->getFases()); asort($aDat); return $aDat; }
[ "function loadFases(){\r\n\t\t//seleciona ID das fases\r\n\t\t$fasesID = Fase::getFasesPorEtapa($this->tipo['id']);\r\n\t\t//se houver fases retornadas\r\n\t\tif(count($fasesID)) {\r\n\t\t\t$this->fases = array();\r\n\t\t\t//para cada fase, carrega os attributos\r\n\t\t\tforeach ($fasesID as $f) {\r\n\t\t\t\t$fase = new Fase();\r\n\t\t\t\t$fase->load($this->id, $f['id']);\r\n\t\t\t\t//var_dump(\"ID -------------------- \".$this->id);\r\n\t\t\t\t$this->fases[] = $fase;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getCDFaltantes()\n {\n return $this->CDFaltantes;\n }", "public function getPortalesDistintos() {\n return $this->getDistintos($this->getPortales());\n }", "public function Fases()\n {\n return $this->hasMany(Fase::class, 'campeonato_id', 'id');\n }", "function balise_EDITEUR_DESTINATIONS_dist ($p) {\n\treturn calculer_balise_dynamique($p, 'EDITEUR_DESTINATIONS', array('id_dest', 'montant_dest', 'defaut_dest') );\n}", "private function initMap()\n\t{\n\t\t$points = array(); // Un point est un tableau entre la case de départ, la case de fin et la distance entre les deux\n\t\tfor ($i = 0; $i <= $this->nbCasesLargeur * $this->nbCasesLargeur - 1; $i++) {\n\t\t\tif ($this->tabPalissadesEauxTunnels[$i] == 1) { // Ce n'est pas une palissade, on initialise les distances avec les cases autour\n\t\t\t\t// La case qui est à gauche\n\t\t\t\tif ($i % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case en cours est sur un bord gauche\n\t\t\t\t\t$points[] = array($i, $i - 1, $this->tabPalissadesEauxTunnels[$i - 1]);\n\t\t\t\t}\n\n\t\t\t\t// La case qui est à droite\n\t\t\t\tif (($i + 1) % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case est sur un bord droit\n\t\t\t\t\t$points[] = array($i, $i + 1, $this->tabPalissadesEauxTunnels[$i + 1]);\n\t\t\t\t}\n\n\t\t\t\t// Initialisation des distances avec les cases du dessus\n\t\t\t\tif ($i >= $this->nbCasesLargeur) { // Si on n'est pas sur la première ligne (car il n'y a rien au dessus)\n\n\t\t\t\t\t// La case directement au dessus\n\t\t\t\t\t$points[] = array($i, $i - $this->nbCasesLargeur, $this->tabPalissadesEauxTunnels[$i - $this->nbCasesLargeur]);\n\n\t\t\t\t\t// La case au dessus, à gauche\n\t\t\t\t\tif ($i % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case est sur un bord gauche\n\t\t\t\t\t\t$points[] = array($i, $i - $this->nbCasesLargeur - 1, $this->tabPalissadesEauxTunnels[$i - $this->nbCasesLargeur - 1]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// La case au dessus à droite\n\t\t\t\t\tif (($i + 1) % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case est sur un bord droit\n\t\t\t\t\t\t$points[] = array($i, $i - $this->nbCasesLargeur + 1, $this->tabPalissadesEauxTunnels[$i - $this->nbCasesLargeur + 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Initialisation des distances avec les cases au dessous\n\t\t\t\tif ($i <= $this->nbCasesLargeur * ($this->nbCasesLargeur - 1) - 1) { // Si on n'est pas sur la dernière ligne\n\n\t\t\t\t\t// La case juste en dessous\n\t\t\t\t\t$points[] = array($i, $i + $this->nbCasesLargeur, $this->tabPalissadesEauxTunnels[$i + $this->nbCasesLargeur]);\n\n\t\t\t\t\t// La case en dessous à gauche\n\t\t\t\t\tif ($i % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case est sur un bord gauche\n\t\t\t\t\t\t$points[] = array($i, $i + $this->nbCasesLargeur - 1, $this->tabPalissadesEauxTunnels[$i + $this->nbCasesLargeur - 1]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// La case en dessous à droite\n\t\t\t\t\tif (($i + 1) % $this->nbCasesLargeur > 0) { // Pas d'initialisation si la case est sur un bord droit\n\t\t\t\t\t\t$points[] = array($i, $i + $this->nbCasesLargeur + 1, $this->tabPalissadesEauxTunnels[$i + $this->nbCasesLargeur + 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else { // Cas d'une palissade\n\t\t\t\t$points[] = array($i, $i, $this->infiniteDistance); // Soit une distance infinie, soit pas de distance, au choix ;-)\n\t\t\t}\n\t\t}\n\n\t\t$ourMap = array();\n\t\tfor ($i = 0, $m = count($points); $i < $m; $i++) {\n\t\t\t$x = $points[$i][0];\n\t\t\t$y = $points[$i][1];\n\t\t\t$c = $points[$i][2];\n\t\t\t$ourMap[$x][$y] = $c;\n\t\t\t$ourMap[$y][$x] = $c;\n\t\t}\n\n\t\t// ensure that the distance from a node to itself is always zero\n\t\t// Purists may want to edit this bit out.\n\t\t$matrixWidth = $this->nbCasesLargeur * $this->nbCasesLargeur;\n\t\tfor ($i = 0; $i < $matrixWidth; $i++) {\n\t\t\tfor ($k = 0; $k < $matrixWidth; $k++) {\n\t\t\t\tif ($i == $k) $ourMap[$i][$k] = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $ourMap;\n\t}", "public function getDistanceMap()\n {\n $edges = $this->getEdges();\n $ret = array();\n foreach ($this->vertex->getGraph()->getVertices()->getMap() as $vid => $vertex) {\n try {\n $ret[$vid] = $this->sumEdges($this->getEdgesToInternal($vertex, $edges));\n } catch (OutOfBoundsException $ignore) {\n } // ignore vertices that can not be reached\n }\n\n return $ret;\n }", "public function getDistances()\n {\n return $this->Distances;\n }", "function ventasFORT(){\n return ($this->game_fort->getPrecio() * $this->cant_vent_fort);\n }", "protected function buildVectors() : array\n {\n $vectors = [];\n\n foreach ($this->fees as $amount => $fee) {\n $vectors[] = [$amount, $fee];\n }\n\n return $vectors;\n }", "private function resolveEachDistanceToMainPoint()\n {\n // store the all points in the points key in the storage\n $this->setInStorage('points', $this->getPoints());\n\n // empty all points after we store them in the storage.\n $this->clearPoints();\n // get the first unit inserted from a config or from the default config\n // the dose not matter what is the unit we use to sort the result.\n $this->setInStorage('unit', collect($this->getUnits())->keys()->first());\n\n $this->through($this->getFromStorage('points'), function ($index, $point) {\n\n // calculate distance for each point in the points\n // and append this distance to closestDistance storage key.\n $this->appendToStorage(\n 'distancesEachPointToMainPoint',\n $this->setPoints([$this->getMainPoint(), $point])\n ->getDistance(function (Collection $result) {\n return $result->first()[$this->getFromStorage('unit')];\n })\n );\n\n // re remove the points to calculate a new distance.\n $this->clearPoints();\n });\n }", "public static function getAbsoluteAll() {\n self::initialize();\n \n $sortert = [];\n foreach( self::$fylker as $fylke ) {\n $sortert[$fylke->getNavn()] = $fylke;\n }\n ksort($sortert);\n\n return $sortert;\n }", "public function getDistanceMap(): array\n {\n return array_map(static function ($edges) {\n return count($edges);\n }, $this->getEdgesMap());\n }", "public function getFechasturnosFinsolicitud()\n {\n return $this->fechasTurnos_finSolicitud;\n }", "public function getFranchDommages(): ?float {\n return $this->franchDommages;\n }", "private static function findeAdjazenteTreffer($x, $y, $feld) {\n $adjazenzen = array();\n $i = 0;\n if (isset($feld[$x + 1][$y]) && $feld[$x + 1][$y] == \"TREFFER\") {\n $adjazenzen[$i][1] = $x + 1;\n $adjazenzen[$i][2] = $y;\n $i++;\n }\n if (isset($feld[$x - 1][$y]) && $feld[$x - 1][$y] == \"TREFFER\") {\n $adjazenzen[$i][1] = $x - 1;\n $adjazenzen[$i][2] = $y;\n $i++;\n }\n if (isset($feld[$x][$y + 1]) && $feld[$x][$y + 1] == \"TREFFER\") {\n $adjazenzen[$i][1] = $x;\n $adjazenzen[$i][2] = $y + 1;\n $i++;\n }\n if (isset($feld[$x][$y - 1]) && $feld[$x][$y - 1] == \"TREFFER\") {\n $adjazenzen[$i][1] = $x;\n $adjazenzen[$i][2] = $y - 1;\n $i++;\n }\n return $adjazenzen;\n }", "public function getDces(): array;", "function calculateDeads($unitesDefenderesses, $degatsAttaque){\n\t\tinclude_once(\"arbre.php\");\n\t\tglobal $reslist, $grilleRessources, $grilleSpecs ;\n\t\t$tableauMorts = array();\n\t\t$vulnerabiliteDefendant = getVunerabiliteArmee($unitesDefenderesses);\n\t\tforeach($unitesDefenderesses as $sigleUnite => $nbUnite){\n\t\t\tif ($nbUnite > 0){\n\t\t\t\t$idUnite = getIdElement($sigleUnite);\n\t\t\t\t$degatsRecus = ((($grilleSpecs[$idUnite]['vulnerabilite']*$nbUnite)/$vulnerabiliteDefendant)*$degatsAttaque);\n\t\t\t\t$morts = round($degatsRecus / $grilleSpecs[$idUnite]['pv']);\n\t\t\t\t$tableauDegatsRecu[$sigleUnite] = $degatsRecus ;\n\t\t\t\tif ($morts > $nbUnite){\n\t\t\t\t\t$morts = $nbUnite ;\n\t\t\t\t}\n\t\t\t\t$tableauMorts[$sigleUnite] = $morts;\n\t\t\t}else{\n\t\t\t\t$tableauMorts[$sigleUnite] = 0;\n\t\t\t}\n\t\t}\n\t\treturn($tableauMorts);\n\t}", "public function calculateDensities()\n\t\t{\n\t\t\tif ($this->numWordsInWrappedLines == 0)\n\t\t\t{\n\t\t\t\t$this->numWordsInWrappedLines = $this->numWords;\n\t\t\t\t$this->numWrappedLines = 1;\n\t\t\t}\n\t\t\t$this->textDensity = $this->numWordsInWrappedLines / $this->numWrappedLines;\n\t\t\t$this->linkDensity = $this->numWords == 0 ? 0 : $this->numWordsInAnchorText / $this->numWords;\n\t\t\t\n\t\t\t// Set full text words only if this block is past the threshold\n\t\t\tif($this->textDensity >= self::TEXT_DENSITY_THRESHOLD)\n\t\t\t{\n\t\t\t\t$this->numFullTextWords = $this->numWords;\n\t\t\t}\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform periodic cleanup tasks. This is used to occasionally remove expired temporary files.
function _performPeriodicCleanup() { if (time() % 100 == 0) { $temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO'); $expiredFiles = $temporaryFileDao->getExpiredFiles(); foreach ($expiredFiles as $expiredFile) { $this->deleteFile($expiredFile->getId(), $expiredFile->getUserId()); } } }
[ "public function deleteExpiredFiles()\n {\n $this->_garbageCollector->clean();\n }", "protected static function cleanupTempFiles()\n {\n // cleanup any open resources on temp files\n gc_collect_cycles();\n foreach (self::$tempFiles as $tempFile) {\n unlink($tempFile);\n }\n\n self::$tempFiles = array();\n }", "private function cleanup()\n {\n // Remove old temp files\n if (file_exists($this->conf['target_dir']))\n {\n foreach (glob($this->conf['target_dir'] . '/*.part') as $tmpFile)\n {\n if (time() - filemtime($tmpFile) < $this->conf['max_file_age'])\n {\n continue;\n }\n\n if (is_dir($tmpFile))\n {\n self::rrmdir($tmpFile);\n }\n else\n {\n @unlink($tmpFile);\n }\n }\n }\n }", "function cleanup_temp() {\n // execution timeout or any other problem appeared before ->release() call.\n\n // Walk over all files contained in WRITER_TEMPDIR\n $dh = @opendir(WRITER_TEMPDIR);\n while (false !== ($file = @readdir($dh))) {\n // Check the modification time of each file; if more than a 10 minutes passed since the file\n // have been created - try to unlink it.\n // NOTE: ignore .htaccess file\n if ($file{0} != '.') {\n if (time() - @filemtime(WRITER_TEMPDIR.$file) > 10*60) {\n @unlink(WRITER_TEMPDIR.$file);\n };\n };\n };\n @closedir($dh);\n }", "function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }", "public function file_watcher_delete_temp_files() {\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\tWP_Filesystem();\n\t\tglobal $wp_filesystem;\n\n\t\tset_transient( 'wpcd_file_watcher_delete_temp_files_is_active', 1, 15 * MINUTE_IN_SECONDS );\n\n\t\t// Set transient to check WordPress logs delete cron scheduled and loaded.\n\t\tset_transient( 'wpcd_wordpress_file_watcher_delete_temp_files_is_active', 1, 15 * MINUTE_IN_SECONDS );\n\n\t\t$dir = $this->get_script_temp_path();\n\n\t\tif ( ! $wp_filesystem->is_dir( $dir ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$files = $wp_filesystem->dirlist( $dir );\n\t\tif ( ! $files ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $files as $name => $atts ) {\n\t\t\tif ( time() - $atts['lastmodunix'] > 10 * MINUTE_IN_SECONDS ) {\n\t\t\t\t$wp_filesystem->delete( trailingslashit( $dir ) . $atts['name'] );\n\t\t\t}\n\t\t}\n\t}", "public function cleanTempFiles()\n {\n foreach ($this->_temp_filenames as $tempFile)\n @unlink($tempFile);\n\n $this->_temp_filenames = [];\n }", "public function cleanup ()\n\t{\n\t\ttry {\n\t\t\t$ts = time() - 60 * 60 * 24 * 14;\n\t\t\t$iterator = new DirectoryIterator(Mage::getBaseDir('var') . DS . 'productfeed');\n\t\t\tforeach ($iterator as $file) {\n\t\t\t\tif ($file->isFile() && $file->getMTime() < $ts) {\n\t\t\t\t\tunlink($file->getPathname());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tMage::helper('productfeed')->log($e);\n\t\t}\n\t}", "public static function cleanup() {\n\t\tMysqlDb::getInstance()->query(\n\t\t\t// Delete old sessions\n\t\t\t\"DELETE FROM sessions WHERE t<'\".date('Y-m-d H:i:s', strtotime('-'.Config::get('session','lifetime_days').' days')).\"'\",\n\t\t\t// Delete abandoned sessionstore values\n\t\t\t'DELETE FROM sessionstore WHERE sid NOT IN (SELECT sid FROM sessions);',\n\t\t\t// Delete expired trace links\n\t\t\t'DELETE FROM links WHERE expires<=NOW()'\n\t\t);\n\t\t// Delete old temp files\n\t\tforeach(glob(self::getTempDir().'*') as $file) {\n\t\t\tif(time()>filectime($file)+86400) {\n\t\t\t\tunlink($file);\n\t\t\t}\n\t\t}\n\t}", "public function cleanup(): void\n {\n $expired = $this->instances()->all()->filterBy('hasExpired', '==', true);\n\n foreach ($expired as $instance) {\n $instance->delete();\n }\n\n $this->runHook($this->config()->templateRoot(), 'cleanup', $this);\n }", "public function cleanupTemp() {\n $files = scandir(TEMP_FOLDER);\n foreach($files as $file) {\n $file = TEMP_FOLDER.$file;\n if(is_file($file)) {\n unlink($file);\n }\n }\n }", "public function cleanupTempFiles()\n {\n foreach ($this->tempFiles as $tmpFile) {\n @unlink($tmpFile);\n }\n $this->tempFiles = [];\n\n foreach ($this->tempDirs as $tmpDir) {\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($tmpDir, \\RecursiveDirectoryIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::CHILD_FIRST\n );\n\n foreach ($files as $fileinfo) {\n $todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');\n $todo($fileinfo->getRealPath());\n }\n @rmdir($tmpDir);\n }\n $this->tempDirs = [];\n }", "public function cleanupExpired(): void;", "private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }", "protected function cleanup()\n {\n try {\n $this->files->delete($this->created);\n }\n catch (\\Exception $e) {\n $this->info(\"Sorry, could not delete the created files... :(\");\n }\n }", "private function clearTempFiles()\n {\n if(file_exists($this->tmpArchive)) {\n unlink($this->tmpArchive);\n }\n if(file_exists($this->tmpBouquets) && is_dir($this->tmpBouquets)) {\n $this->unlinkDirectory($this->tmpBouquets);\n }\n }", "public function cleanup() {\n $this->basedir = $this->directoryList->getRoot();\n $this->checkCronFolderExistence();\n $this->initialize();\n /* gets a list of all schedule ids in the cron table */\n $scheduleids = $this->resource->cleanSchedule($this->history);\n /* gets a list of all cron schedule output files */\n $fileids = $this->getScheduleOutputIds();\n /* get a list of all schedule output files that are no longer in the cron schedule file */\n $diff = array_diff($fileids,$scheduleids);\n foreach ($diff as $id) {\n /* remove the old cron schedule output files */\n $this->unsetPid('schedule.'.$id);\n }\n }", "private function cleanUp() {\n if ($this->clean_up === true && is_dir($this->temp_dir)) {\n $this->log('Cleaning up temporary files ...' . self::NL);\n $this->command(sprintf('rm -rf %s',\n $this->temp_dir));\n }\n }", "protected function cleanUp()\n {\n $prefixTempFile = strtolower($this->mainClassName . '-' . $this->environment);\n // this is the part of the path that is fixed for all the feeds downloaded for this project.\n // After this fixed part, we append a random string\n // THIS IS NOT only the directory where to download the feeds\n $temporaryFeedFileFixedPath = '/tmp/feedaggregator-' . $prefixTempFile . '-';\n // cleaning up: let's make sure the previous feed gets deleted\n if ($temporaryFeedFileFixedPath && (realpath($temporaryFeedFileFixedPath) != '/'))\n {\n exec(\"rm $temporaryFeedFileFixedPath*\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'updateNetworkApplianceFirewallL3FirewallRules'
protected function updateNetworkApplianceFirewallL3FirewallRulesRequest($network_id, $update_network_appliance_firewall_l3_firewall_rules = null) { // verify the required parameter 'network_id' is set if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $network_id when calling updateNetworkApplianceFirewallL3FirewallRules' ); } $resourcePath = '/networks/{networkId}/appliance/firewall/l3FirewallRules'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($network_id !== null) { $resourcePath = str_replace( '{' . 'networkId' . '}', ObjectSerializer::toPathValue($network_id), $resourcePath ); } // body params $_tempBody = null; if (isset($update_network_appliance_firewall_l3_firewall_rules)) { $_tempBody = $update_network_appliance_firewall_l3_firewall_rules; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key'); if ($apiKey !== null) { $headers['X-Cisco-Meraki-API-Key'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function testUpdateNetworkApplianceFirewallL7FirewallRules()\n {\n }", "protected function updateNetworkApplianceFirewallL7FirewallRulesRequest($network_id, $update_network_appliance_firewall_l7_firewall_rules = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkApplianceFirewallL7FirewallRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/appliance/firewall/l7FirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_appliance_firewall_l7_firewall_rules)) {\n $_tempBody = $update_network_appliance_firewall_l7_firewall_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function updateNetworkWirelessSsidFirewallL3FirewallRulesRequest($network_id, $number, $update_network_wireless_ssid_firewall_l3_firewall_rules = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkWirelessSsidFirewallL3FirewallRules'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling updateNetworkWirelessSsidFirewallL3FirewallRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/wireless/ssids/{number}/firewall/l3FirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_wireless_ssid_firewall_l3_firewall_rules)) {\n $_tempBody = $update_network_wireless_ssid_firewall_l3_firewall_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testUpdateOrganizationApplianceVpnVpnFirewallRules()\n {\n }", "public function testUpdateNetworkApplianceFirewallOneToManyNatRules()\n {\n }", "protected function updateNetworkWirelessSsidFirewallL7FirewallRulesRequest($network_id, $number, $update_network_wireless_ssid_firewall_l7_firewall_rules = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkWirelessSsidFirewallL7FirewallRules'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling updateNetworkWirelessSsidFirewallL7FirewallRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/wireless/ssids/{number}/firewall/l7FirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_wireless_ssid_firewall_l7_firewall_rules)) {\n $_tempBody = $update_network_wireless_ssid_firewall_l7_firewall_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function updateNetworkApplianceFirewallInboundFirewallRulesRequest($network_id, $update_network_appliance_firewall_inbound_firewall_rules = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkApplianceFirewallInboundFirewallRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/appliance/firewall/inboundFirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_appliance_firewall_inbound_firewall_rules)) {\n $_tempBody = $update_network_appliance_firewall_inbound_firewall_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function updateOrganizationApplianceVpnVpnFirewallRulesRequest($organization_id, $update_organization_appliance_vpn_vpn_firewall_rules = null)\n {\n // verify the required parameter 'organization_id' is set\n if ($organization_id === null || (is_array($organization_id) && count($organization_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $organization_id when calling updateOrganizationApplianceVpnVpnFirewallRules'\n );\n }\n\n $resourcePath = '/organizations/{organizationId}/appliance/vpn/vpnFirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($organization_id !== null) {\n $resourcePath = str_replace(\n '{' . 'organizationId' . '}',\n ObjectSerializer::toPathValue($organization_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_organization_appliance_vpn_vpn_firewall_rules)) {\n $_tempBody = $update_organization_appliance_vpn_vpn_firewall_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function updateNetworkApplianceFirewallPortForwardingRulesRequest($network_id, $update_network_appliance_firewall_port_forwarding_rules)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkApplianceFirewallPortForwardingRules'\n );\n }\n // verify the required parameter 'update_network_appliance_firewall_port_forwarding_rules' is set\n if ($update_network_appliance_firewall_port_forwarding_rules === null || (is_array($update_network_appliance_firewall_port_forwarding_rules) && count($update_network_appliance_firewall_port_forwarding_rules) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_network_appliance_firewall_port_forwarding_rules when calling updateNetworkApplianceFirewallPortForwardingRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/appliance/firewall/portForwardingRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_appliance_firewall_port_forwarding_rules)) {\n $_tempBody = $update_network_appliance_firewall_port_forwarding_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function firewallrules() {\n\tglobal $_ONAPPVARS, $_LANG;\n\n\t$user = get_onapp_client( $_ONAPPVARS[ 'id' ] );\n\t$onapp_config = get_onapp_config( $_ONAPPVARS[ 'service' ][ 'serverid' ] );\n\n\t$onapp = new OnApp_Factory( $onapp_config[ \"adress\" ], $user[ \"email\" ], $user[ \"password\" ] );\n\t$firewallrule = $onapp->factory( 'VirtualMachine_FirewallRule', true );\n\n\t$fr = isset( $_POST[ 'fr' ] ) ? $_POST[ 'fr' ] : null;\n\n\t$action = $_ONAPPVARS[ 'action' ];\n\n\t$network_interfaces = isset( $_POST[ 'network_interfaces' ] ) ? $_POST[ 'network_interfaces' ] : null;\n\t$ruleid = get_value( 'ruleid' );\n\t$position = get_value( 'position' );\n\n\tif( ! is_null( $action ) && $action != \"\" ) {\n\t\tswitch( $action ) {\n\t\t\tcase 'save':\n\t\t\t\t$return = _firewallrule_save( $_ONAPPVARS[ 'service' ][ 'vmid' ], $fr, $firewallrule );\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\tif( ! $ruleid ) {\n\t\t\t\t\t$_ONAPPVARS[ 'error' ] = sprintf( $_LANG[ \"onappnotenoughparams\" ], $action );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$return = _firewallrule_delete( $_ONAPPVARS[ 'service' ][ 'vmid' ], $ruleid, $firewallrule );\n\t\t\t\tbreak;\n\t\t\tcase 'move':\n\t\t\t\tif( ! $ruleid || ! $position ) {\n\t\t\t\t\t$_ONAPPVARS[ 'error' ] = sprintf( $_LANG[ \"onappnotenoughparams\" ], $action );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$return = _firewallrule_move( $_ONAPPVARS[ 'service' ][ 'vmid' ], $ruleid, $position, $firewallrule );\n\t\t\t\tbreak;\n\t\t\tcase 'set_defaults':\n\t\t\t\tif( ! $network_interfaces ) {\n\t\t\t\t\t$_ONAPPVARS[ 'error' ] = sprintf( $_LANG[ \"onappnotenoughparams\" ], $action );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$return = _firewallrule_set_default( $_ONAPPVARS[ 'service' ][ 'vmid' ], $network_interfaces, $firewallrule );\n\t\t\t\tbreak;\n\t\t\tcase 'apply':\n\n\t\t\t\t$return = _firewallrule_apply( $_ONAPPVARS[ 'service' ][ 'vmid' ], $firewallrule );\n\n\t\t\tdefault:\n\t\t\t\t$_ONAPPVARS[ 'error' ] = sprintf( $_LANG[ \"onappactionnotfound\" ], $action );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t$networkinterface = $onapp->factory( 'VirtualMachine_NetworkInterface', true );\n\n\t$firewallrules = $firewallrule->getList( $_ONAPPVARS[ 'service' ][ 'vmid' ] );\n\t$networkinterfaces = $networkinterface->getList( $_ONAPPVARS[ 'service' ][ 'vmid' ] );\n\n\t$error = isset( $_ONAPPVARS[ 'error' ] ) ? $_ONAPPVARS[ 'error' ] : getFlashError();\n\n\t$_networkinterfaces = array();\n\n\tforeach( $networkinterfaces as $interface ) {\n\t\t$_networkinterfaces[ $interface->_id ] = $interface;\n\t}\n\n\tif( ! is_null( $firewallrules ) ) {\n\t\tforeach( $firewallrules as $firewall ) {\n\t\t\t$firewall_by_network[ $firewall->_network_interface_id ][ ] = $firewall;\n\t\t}\n\t}\n\telse {\n\t\t$firewall_by_network = null;\n\t}\n\n\tshow_template(\n\t\t\"onapp/clientareafirewallrules\",\n\t\tarray(\n\t\t\t'commands' => array( 'ACCEPT', 'DROP' ),\n\t\t\t'networkinterfaces' => $_networkinterfaces,\n\t\t\t'firewall_by_network' => $firewall_by_network,\n\t\t\t'id' => $_ONAPPVARS[ 'id' ],\n\t\t\t'configoptionsupgrade' => $_ONAPPVARS[ 'service' ][ 'configoptionsupgrade' ],\n\t\t\t'error' => $error,\n\t\t)\n\t);\n}", "public function addDNSRules()\n {\n $this->checkServer();\n\n $rules = $this->callApi('get', '/server/'.$this->server.'/firewall_rule')['data']->firewall_rules->firewall_rule;\n\n $toDelete = [];\n\n foreach ($rules as $rule) {\n if ($rule->source_address_start == '94.237.127.9' || $rule->source_address_start == '94.237.40.9'\n || $rule->source_address_start == '2a04:3540:53::1' || $rule->source_address_start == '2a04:3544:53::1') {\n $toDelete[] = $rule->position;\n }\n }\n\n rsort($toDelete);\n foreach ($toDelete as $pos) {\n $response = $this->callApi('delete', '/server/'.$this->server.'/firewall_rule/'.$pos);\n }\n\n $protocols = ['tcp', 'udp'];\n foreach ($protocols as $protocol) {\n $body = [\n 'firewall_rule' => [\n 'protocol' => $protocol,\n 'direction' => 'in',\n 'action' => 'accept',\n 'family' => 'IPv4',\n 'source_port_start' => 53,\n 'source_port_end' => 53,\n 'source_address_start' => '94.237.127.9',\n 'source_address_end' => '94.237.127.9',\n 'comment' => 'Automatic rule',\n ],\n ];\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '94.237.40.9';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['family'] = 'IPv6';\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3540:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3544:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n }\n\n return $response;\n }", "public function updateNetworkWirelessSsidFirewallL3FirewallRulesAsync($network_id, $number, $update_network_wireless_ssid_firewall_l3_firewall_rules = null)\n {\n return $this->updateNetworkWirelessSsidFirewallL3FirewallRulesAsyncWithHttpInfo($network_id, $number, $update_network_wireless_ssid_firewall_l3_firewall_rules)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testUpdateNetworkApplianceTrafficShapingRules()\n {\n }", "protected function updateNetworkApplianceFirewallOneToManyNatRulesRequest($network_id, $update_network_appliance_firewall_one_to_many_nat_rules)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkApplianceFirewallOneToManyNatRules'\n );\n }\n // verify the required parameter 'update_network_appliance_firewall_one_to_many_nat_rules' is set\n if ($update_network_appliance_firewall_one_to_many_nat_rules === null || (is_array($update_network_appliance_firewall_one_to_many_nat_rules) && count($update_network_appliance_firewall_one_to_many_nat_rules) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_network_appliance_firewall_one_to_many_nat_rules when calling updateNetworkApplianceFirewallOneToManyNatRules'\n );\n }\n\n $resourcePath = '/networks/{networkId}/appliance/firewall/oneToManyNatRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_appliance_firewall_one_to_many_nat_rules)) {\n $_tempBody = $update_network_appliance_firewall_one_to_many_nat_rules;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addRules($firewall, array $rules = []);", "public function testUpdateNetworkApplianceFirewallOneToOneNatRules()\n {\n }", "public function updateNetworkApplianceFirewallL3FirewallRulesAsyncWithHttpInfo($network_id, $update_network_appliance_firewall_l3_firewall_rules = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkApplianceFirewallL3FirewallRulesRequest($network_id, $update_network_appliance_firewall_l3_firewall_rules);\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 }", "function set_rules()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n header('Cache-Control: no-cache, must-revalidate');\n header('Content-type: application/json');\n\n // Load libraries\n //---------------\n\n $this->load->library('firewall_custom/Firewall_Custom');\n try {\n $this->firewall_custom->set_rules($_POST['type'], json_decode($_POST['rules']));\n echo json_encode(array('code' => 0));\n } catch (Exception $e) {\n echo json_encode(Array('code' => clearos_exception_code($e), 'errmsg' => clearos_exception_message($e)));\n }\n }", "protected function getOrganizationApplianceVpnVpnFirewallRulesRequest($organization_id)\n {\n // verify the required parameter 'organization_id' is set\n if ($organization_id === null || (is_array($organization_id) && count($organization_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $organization_id when calling getOrganizationApplianceVpnVpnFirewallRules'\n );\n }\n\n $resourcePath = '/organizations/{organizationId}/appliance/vpn/vpnFirewallRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($organization_id !== null) {\n $resourcePath = str_replace(\n '{' . 'organizationId' . '}',\n ObjectSerializer::toPathValue($organization_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the parent ID of a given folder id.
function wp_rml_get_parent_id($id) { $folder = wp_rml_get_object_by_id($id); return is_rml_folder($folder) ? $folder->getParent() : null; }
[ "public function getParentFolderId()\n {\n return $this->getProperty(\"ParentFolderId\");\n }", "function getParent($node_id)\n {\n $mpath = $this->_db->fetch_first_value('SELECT `mpath` FROM ?f WHERE'\n . ' `content` = ?', $this->_tbl_name, $node_id);\n if ($mpath) {\n return $this->parentIdFromMpath($mpath);\n } else {\n return 0;\n }\n }", "public function getParentFolder() {\n $explodedKey = explode(\"/\", $this->getKey());\n array_pop($explodedKey);\n return join(\"/\", $explodedKey);\n }", "function getFolderParent($ID) {\n if ($ID == 0) {\n return 0;\n }\n try {\n $rs = NULL;\n $rs = $this->DBH->prepare(\"SELECT folderid FROM CS_Folders WHERE id = :id;\");\n $rs->execute(array(':id' => $ID));\n $array = $rs->fetchAll();\n return $array[0][0];\n } catch (PDOException $e) {\n //$this->DBO->showErrorPage($sql,$e );\n return \"Error getting file path \" . $e . \" please contact brad.baago@linux.com.\";\n }\n }", "public function getParentFolder()\n {\n return $this->getStorage()->getFolder($this->getStorage()->getFolderIdentifierFromFileIdentifier($this->getIdentifier()));\n }", "public function getParent()\n\t{\n\t\treturn $this->getFolderRelatedBySubfolderId();\n\t}", "public function getParentObjectID($p_id)\n {\n $l_sql = 'SELECT isys_container__isys_obj__id__parent AS id\n\t\t\tFROM isys_container\n\t\t\tWHERE isys_container__isys_obj__id = ' . $this->convert_sql_id($p_id) . ';';\n\n $l_row = $this->retrieve($l_sql)\n ->get_row();\n\n return $l_row[\"id\"];\n }", "public function get_parent_id()\n {\n if ( ! isset($this->_properties['parent_id']))\n {\n $parent = $this->mapper()->find_parent($this, array('columns' => array('id')));\n $this->_properties['parent_id'] = $parent->id;\n }\n return $this->_properties['parent_id'];\n }", "function getParentId($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getParentId(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT parent FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->parent;\n\t}", "public function parentFolder()\n {\n if( isset($this->_parent_directory) )\n {\n return $this->_parent_directory;\n }\n \n $fs_delimiter = Config::get('f-sgallery::config.file_tree_delimiter');\n \n $path_steps = explode($fs_delimiter, $this->baseDir());\n\n $this->_parent_directory = implode($fs_delimiter, array_slice($path_steps, 0, count($path_steps) - 1));\n \n return $this->_parent_directory;\n }", "public function get_parent_id() {\n return wp_get_post_parent_id( $this->get_id() );\n }", "protected function get_post_parent_id_from_attachment_id( $id ) {\n\t\t$post = get_post( $id );\n\t\tif ( $post ) {\n\t\t\treturn $post->post_parent;\n\t\t}\n\t\treturn false;\n\t}", "public function getParentFolder()\n {\n return $this->getPath();\n }", "function getParentId() {\n return $this->getFieldValue('parent_id');\n }", "public function getId() {\n\t\treturn $this->get('folderid');\n\t}", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParentId()\n {\n return $this->getWrappedObject()->parent_id;\n }", "public function getFolderId()\n {\n return $this->folderId;\n }", "public function getFolderId()\n {\n return $this->folder_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the cell's value explicitely as string value Ensures Excel won't force the cell to a strange datatype changing its value
public function setCellValueForceString($cell, $value) { $this->phpExcel->getActiveSheet()->setCellValueExplicit($cell, $value, PHPExcel_Cell_DataType::TYPE_STRING); }
[ "public function setValueTypeToString(): void\n {\n $this->valueType = OptionData::VAL_TYPE_STRING;\n }", "public function setValue($pValue) {\n\t\t// sanitize UTF-8 strings\n\t\tif (is_string($pValue)) {\n\t\t\ttry {\n\t\t\t\t$pValue = SharedString::SanitizeUTF8($pValue);\n\t\t\t}\n\t\t\tcatch(\\ErrorException $e){\n\t\t\t\tthrow new PHPExcelException($e->getMessage());\n\t\t\t}\n//\t\t} elseif (is_object($pValue)) {\n//\t\t\t// Handle any objects that might be injected\n//\t\t\tif ($pValue instanceof \\DateTime) {\n//\t\t\t\t$pValue = cast(\"DateTime\", $pValue)->format('Y-m-d H:i:s');\n//\t\t\t} elseif (!($pValue instanceof RichText)) {\n//\t\t\t\t$pValue = (string) $pValue;\n//\t\t\t}\n\t\t}\n\t\t\n\t\t$type = Cell::dataTypeForValue($pValue, $valueCast);\n\t\t$this->setValueExplicit($valueCast, $type);\n\t}", "public function bindValue(FKExcel_Cell $cell, $value = null)\n {\n // sanitize UTF-8 strings\n if (is_string($value)) {\n $value = FKExcel_Shared_String::SanitizeUTF8($value);\n }\n\t\t\n\t\t// Implement your own override logic \n /* if (is_string($value) && $value[0] == '0') { \n $cell->setValueExplicit($value, FKExcel_Cell_DataType::TYPE_STRING);\n return true; \n }*/ \n\n // Find out data type\n $dataType = parent::dataTypeForValue($value);\n\n // Style logic - strings\n if ($dataType === FKExcel_Cell_DataType::TYPE_STRING && !$value instanceof FKExcel_RichText) {\n // Test for booleans using locale-setting\n if ($value == FKExcel_Calculation::getTRUE()) {\n $cell->setValueExplicit( TRUE, FKExcel_Cell_DataType::TYPE_BOOL);\n return true;\n } elseif($value == FKExcel_Calculation::getFALSE()) {\n $cell->setValueExplicit( FALSE, FKExcel_Cell_DataType::TYPE_BOOL);\n return true;\n }\n\n // Check for number in scientific format\n if (preg_match('/^'.FKExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {\n $cell->setValueExplicit( (float) $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n return true;\n }\n\n // Check for fraction\n if (preg_match('/^([+-]?) *([0-9]*)\\s?\\/\\s*([0-9]*)$/', $value, $matches)) {\n // Convert value to number\n $value = $matches[2] / $matches[3];\n if ($matches[1] == '-') $value = 0 - $value;\n $cell->setValueExplicit( (float) $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( '??/??' );\n return true;\n } elseif (preg_match('/^([+-]?)([0-9]*) +([0-9]*)\\s?\\/\\s*([0-9]*)$/', $value, $matches)) {\n // Convert value to number\n $value = $matches[2] + ($matches[3] / $matches[4]);\n if ($matches[1] == '-') $value = 0 - $value;\n $cell->setValueExplicit( (float) $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( '# ??/??' );\n return true;\n }\n\n // Check for percentage\n if (preg_match('/^\\-?[0-9]*\\.?[0-9]*\\s?\\%$/', $value)) {\n // Convert value to number\n $value = (float) str_replace('%', '', $value) / 100;\n $cell->setValueExplicit( $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( FKExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00 );\n return true;\n }\n\n // Check for currency\n $currencyCode = FKExcel_Shared_String::getCurrencyCode();\n $decimalSeparator = FKExcel_Shared_String::getDecimalSeparator();\n $thousandsSeparator = FKExcel_Shared_String::getThousandsSeparator();\n if (preg_match('/^'.preg_quote($currencyCode).' *(\\d{1,3}('.preg_quote($thousandsSeparator).'\\d{3})*|(\\d+))('.preg_quote($decimalSeparator).'\\d{2})?$/', $value)) {\n // Convert value to number\n $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));\n $cell->setValueExplicit( $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode(\n str_replace('$', $currencyCode, FKExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE )\n );\n return true;\n } elseif (preg_match('/^\\$ *(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d{2})?$/', $value)) {\n // Convert value to number\n $value = (float) trim(str_replace(array('$',','), '', $value));\n $cell->setValueExplicit( $value, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( FKExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE );\n return true;\n }\n\n // Check for time without seconds e.g. '9:45', '09:45'\n if (preg_match('/^(\\d|[0-1]\\d|2[0-3]):[0-5]\\d$/', $value)) {\n // Convert value to number\n list($h, $m) = explode(':', $value);\n $days = $h / 24 + $m / 1440;\n $cell->setValueExplicit($days, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( FKExcel_Style_NumberFormat::FORMAT_DATE_TIME3 );\n return true;\n }\n\n // Check for time with seconds '9:45:59', '09:45:59'\n if (preg_match('/^(\\d|[0-1]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$/', $value)) {\n // Convert value to number\n list($h, $m, $s) = explode(':', $value);\n $days = $h / 24 + $m / 1440 + $s / 86400;\n // Convert value to number\n $cell->setValueExplicit($days, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode( FKExcel_Style_NumberFormat::FORMAT_DATE_TIME4 );\n return true;\n }\n\n // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'\n if (($d = FKExcel_Shared_Date::stringToExcel($value)) !== false) {\n // Convert value to number\n $cell->setValueExplicit($d, FKExcel_Cell_DataType::TYPE_NUMERIC);\n // Determine style. Either there is a time part or not. Look for ':'\n if (strpos($value, ':') !== false) {\n $formatCode = 'yyyy-mm-dd h:mm';\n } else {\n $formatCode = 'yyyy-mm-dd';\n }\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getNumberFormat()->setFormatCode($formatCode);\n return true;\n }\n\n // Check for newline character \"\\n\"\n if (strpos($value, \"\\n\") !== FALSE) {\n $value = FKExcel_Shared_String::SanitizeUTF8($value);\n $cell->setValueExplicit($value, FKExcel_Cell_DataType::TYPE_STRING);\n // Set style\n $cell->getWorksheet()->getStyle( $cell->getCoordinate() )\n ->getAlignment()->setWrapText(TRUE);\n return true;\n }\n }\n\n // Not bound yet? Use parent...\n return parent::bindValue($cell, $value);\n }", "function setValue($cell, $value)\n\t{\n\t \t$this->beginUpdate();\n\t \ttry\n\t \t{\n\t\t \t$cell->setValue($value);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->endUpdate();\n\t\t\tthrow($e);\n\t\t}\n\t\t$this->endUpdate();\n\t \t\n\t \treturn $value;\n\t}", "public function uncast() {\n\t\tif ($this->value === false) { // force boolean false to 0 instead of ''\n\t\t\t$this->value = '0';\n\t\t}\n\t\telse {\n\t\t\tsettype($this->value, 'string');\n\t\t}\n\t}", "private function setCellValue( int $cell, string $value ): void {\n\t\t\t$this->sheet->setCellValue( \"A{$cell}\", $value );\n\t\t}", "public function setStringValue(string $data): void\n {\n $this->data = $data;\n }", "protected function _setCellValue($sheet, $cell, $fieldType, $fieldValue, $options) {\n\t\tswitch ($fieldType) {\n\n\t\tcase 'timestamp':\n\t\tcase 'date':\n\t\t\t$value = $this->Time->format($options['format']['date'], $fieldValue);\n\t\t\t$value = $value == '0000-00-00 00:00:00' ? '' : $value;\n\n\t\t\tif (strlen($value) == 19 && !preg_match('/00:00:00$/', $value)) {\n\t\t\t\t$format = 'dd/mm/yy hh:mm:ss';\n\t\t\t} else {\n\t\t\t\t$format = PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY;\n\t\t\t}\n\t\t\t$sheet->getStyle($cell)->getNumberFormat()->setFormatCode($format);\n\t\t\t$sheet->setCellValue($cell, $value);\n\t\t\tbreak;\n\n\t\tcase 'float':\n\t\t\t$sheet->getStyle($cell)->getNumberFormat()->setFormatCode(\n\t\t\t\tPHPExcel_Style_NumberFormat::FORMAT_NUMBER_00\n\t\t\t\t);\n\t\t\t$sheet->setCellValue($cell, sprintf($options['format']['float'], $fieldValue));\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tif(is_numeric($fieldValue) && $fieldValue[0]=='0')\n\t\t\t\t$sheet->setCellValueExplicit($cell, $fieldValue, PHPExcel_Cell_DataType::TYPE_STRING);\n\t\t\telse\n\t\t\t\t$sheet->setCellValue($cell, $fieldValue);\n\t\t}\n\t}", "function OpenDoc_ChangeCellType(&$Txt, &$Loc, $Ope, $IsMerging, &$Value) {\n\n\t\t$Loc->PrmLst['odsok'] = true; // avoid the field to be processed twice\n\n\t\tif ($Ope==='odsStr') return true;\n\n\t\tstatic $OpeLst = array('odsNum'=>'float', 'odsPercent'=>'percentage', 'odsCurr'=>'currency', 'odsBool'=>'boolean', 'odsDate'=>'date', 'odsTime'=>'time');\n\t\t$AttStr = 'office:value-type=\"string\"';\n\t\t$AttStr_len = strlen($AttStr);\n\n\t\tif (!isset($OpeLst[$Ope])) return false;\n\n\t\t$t0 = clsTinyButStrong::f_Xml_FindTagStart($Txt, 'table:table-cell', true, $Loc->PosBeg, false, true);\n\t\tif ($t0===false) return false; // error in the XML structure\n\n\t\t$te = strpos($Txt, '>', $t0);\n\t\tif ( ($te===false) || ($te>$Loc->PosBeg) ) return false; // error in the XML structure\n\n\t\t$len = $te - $t0 + 1;\n\t\t$tag = substr($Txt, $t0, $len);\n\n\t\t$p = strpos($tag, $AttStr);\n\t\tif ($p===false) return false; // error: the cell was expected to have a string contents since it contains a TBS tag.\n\n\t\t// replace the current string with blanck chars\n\t\t$len = $Loc->PosEnd - $Loc->PosBeg + 1;\n\t\t$Txt = substr_replace($Txt, str_repeat(' ',$len), $Loc->PosBeg, $len);\n\n\t\t// prepare special formating for the value\n\t\t$type = $OpeLst[$Ope];\n\t\t$att_new = 'office:value-type=\"'.$type.'\"';\n\t\t$newfrm = false;\n\t\tswitch ($type) {\n\t\tcase 'float': $att_new .= ' office:value=\"[]\"'; break;\n\t\tcase 'percentage': $att_new .= ' office:value=\"[]\"'; break;\n\t\tcase 'currency': $att_new .= ' office:value=\"[]\"'; if (isset($Loc->PrmLst['currency'])) $att_new .= ' office:currency=\"'.$Loc->PrmLst['currency'].'\"'; break;\n\t\tcase 'boolean': $att_new .= ' office:boolean-value=\"[]\"'; break;\n\t\tcase 'date': $att_new .= ' office:date-value=\"[]\"'; $newfrm = 'yyyy-mm-ddThh:nn:ss'; break;\n\t\tcase 'time'; $att_new .= ' office:time-value=\"[]\"'; $newfrm = '\"PT\"hh\"H\"nn\"M\"ss\"S\"'; break;\n\t\t}\n\n\t\t// replace the sring attribute with the new attribute\n\t\t//$diff = strlen($att_new) - $AttStr_len;\n\t\t$p_att = $t0 + $p;\n\t\t$p_fld = $p_att + strpos($att_new, '['); // new position of the fields in $Txt\n\t\t$Txt = substr_replace($Txt, $att_new, $p_att, $AttStr_len);\n\n\t\t// move the TBS field\n\t\t$Loc->PosBeg = $p_fld;\n\t\t$Loc->PosEnd = $p_fld +1;\n\n\t\tif ($IsMerging) {\n\t\t\t// the field is currently beeing merged\n\t\t\tif ($type==='boolean') {\n\t\t\t\tif ($Value) {\n\t\t\t\t\t$Value = 'true';\n\t\t\t\t} else {\n\t\t\t\t\t$Value = 'false';\n\t\t\t\t}\n\t\t\t} elseif ($newfrm!==false) {\n\t\t\t\t$prm = array('frm'=>$newfrm);\n\t\t\t\t$Value = $this->TBS->meth_Misc_Format($Value,$prm);\n\t\t\t}\n\t\t\t$Loc->ConvStr = false;\n\t\t\t$Loc->ConvProtect = false;\n\t\t} else {\n\t\t\tif ($newfrm!==false) $Loc->PrmLst['frm'] = $newfrm;\n\t\t}\n\n\t}", "function OpenDoc_ChangeCellType(&$Txt, &$Loc, $Ope, $IsMerging, &$Value)\n\t{\n\t\t$Loc->PrmLst['odsok'] = true; // avoid the field to be processed twice\n\t\tif ($Ope === 'odsStr') {\n\t\t\treturn true;\n\t\t}\n\t\tstatic $OpeLst = [\n\t\t\t\t'odsNum' => 'float',\n\t\t\t\t'odsPercent' => 'percentage',\n\t\t\t\t'odsCurr' => 'currency',\n\t\t\t\t'odsBool' => 'boolean',\n\t\t\t\t'odsDate' => 'date',\n\t\t\t\t'odsTime' => 'time'\n\t\t];\n\t\t$AttStr = 'office:value-type=\"string\"';\n\t\t$AttStr_len = strlen($AttStr);\n\t\tif (!isset($OpeLst[$Ope])) {\n\t\t\treturn false;\n\t\t}\n\t\t$t0 = clsTinyButStrong370::f_Xml_FindTagStart($Txt, 'table:table-cell', true, $Loc->PosBeg, false, true);\n\t\tif ($t0 === false) {\n\t\t\treturn false;\n\t\t} // error in the XML structure\n\t\t$te = strpos($Txt, '>', $t0);\n\t\tif (($te === false) || ($te > $Loc->PosBeg)) {\n\t\t\treturn false;\n\t\t} // error in the XML structure\n\t\t$len = $te - $t0 + 1;\n\t\t$tag = substr($Txt, $t0, $len);\n\t\t$p = strpos($tag, $AttStr);\n\t\tif ($p === false) {\n\t\t\treturn false;\n\t\t} // error: the cell was expected to have a string contents since it contains a TBS tag.\n\t\t// replace the current string with blanck chars\n\t\t$len = $Loc->PosEnd - $Loc->PosBeg + 1;\n\t\t$Txt = substr_replace($Txt, str_repeat(' ', $len), $Loc->PosBeg, $len);\n\t\t// prepare special formating for the value\n\t\t$type = $OpeLst[$Ope];\n\t\t$att_new = 'office:value-type=\"' . $type . '\"';\n\t\t$newfrm = false;\n\t\tswitch ($type) {\n\t\t\tcase 'float':\n\t\t\t\t$att_new .= ' office:value=\"[]\"';\n\t\t\t\tbreak;\n\t\t\tcase 'percentage':\n\t\t\t\t$att_new .= ' office:value=\"[]\"';\n\t\t\t\tbreak;\n\t\t\tcase 'currency':\n\t\t\t\t$att_new .= ' office:value=\"[]\"';\n\t\t\t\tif (isset($Loc->PrmLst['currency'])) {\n\t\t\t\t\t$att_new .= ' office:currency=\"' . $Loc->PrmLst['currency'] . '\"';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'boolean':\n\t\t\t\t$att_new .= ' office:boolean-value=\"[]\"';\n\t\t\t\tbreak;\n\t\t\tcase 'date':\n\t\t\t\t$att_new .= ' office:date-value=\"[]\"';\n\t\t\t\t$newfrm = 'yyyy-mm-ddThh:nn:ss';\n\t\t\t\tbreak;\n\t\t\tcase 'time';\n\t\t\t\t$att_new .= ' office:time-value=\"[]\"';\n\t\t\t\t$newfrm = '\"PT\"hh\"H\"nn\"M\"ss\"S\"';\n\t\t\t\tbreak;\n\t\t}\n\t\t// replace the sring attribute with the new attribute\n\t\t//$diff = strlen($att_new) - $AttStr_len;\n\t\t$p_att = $t0 + $p;\n\t\t$p_fld = $p_att + strpos($att_new, '['); // new position of the fields in $Txt\n\t\t$Txt = substr_replace($Txt, $att_new, $p_att, $AttStr_len);\n\t\t// move the TBS field\n\t\t$Loc->PosBeg = $p_fld;\n\t\t$Loc->PosEnd = $p_fld + 1;\n\t\tif ($IsMerging) {\n\t\t\t// the field is currently beeing merged\n\t\t\tif ($type === 'boolean') {\n\t\t\t\tif ($Value) {\n\t\t\t\t\t$Value = 'true';\n\t\t\t\t} else {\n\t\t\t\t\t$Value = 'false';\n\t\t\t\t}\n\t\t\t} elseif ($newfrm !== false) {\n\t\t\t\t$prm = ['frm' => $newfrm];\n\t\t\t\t$Value = $this->TBS->meth_Misc_Format($Value, $prm);\n\t\t\t}\n\t\t\t$Loc->ConvStr = false;\n\t\t\t$Loc->ConvProtect = false;\n\t\t} else {\n\t\t\tif ($newfrm !== false) {\n\t\t\t\t$Loc->PrmLst['frm'] = $newfrm;\n\t\t\t}\n\t\t}\n\t}", "public function bindValue($cell, $value = null);", "function SetCellValue($row, $col, $s, wxGridCellCoords $coords, $s){}", "public function coerce( $sheet, $col, $row, $value ) {\n\t\tif( !is_numeric($col) ) {\n\t\t\t$col = self::base_xls_rev($col);\n\t\t}\n\t\tif( is_array($value) ) {\n\t\t\t$this->sheet_data[$sheet][$row][$col] = $value;\n\t\t} else {\n\t\t\t$this->sheet_data[$sheet][$row][$col] = array( 'value' => $value, 'formula' => '' );\n\t\t}\n\t}", "public function testFieldValueStringConversionValueIsRepresented()\n {\n $this->fieldValue->setField($this->field);\n $this->assertInternalType('string', (string) $this->fieldValue);\n $this->assertEquals('', (string) $this->fieldValue);\n }", "protected function fixSheetData(){\n $this->phpExcel->getActiveSheet()\n ->getStyle('V9')\n ->getNumberFormat()\n ->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT);\n }", "public function setAsString($key, $value) {\n\t\tparent::setAsString($key, $value);\n\t}", "protected function fillInValue( $value )\n\t{\n\t\tif ( is_null( $value ) ) $value = 'NULL';\n\n\t\t$value = strval( $value );\n\t\tif ( strlen( $value ) > ( $this->strLen ) ) {\n\t\t\t$value = substr( $value, 0, ( $this->strLen ) ).'... ';\n\t\t}\n\n\t\tif ( !is_numeric( $value ) && $value !== 'NULL') {\n\t\t\t$value = '\\''.$value.'\\'';\n\t\t}\n\n\t\treturn $value;\n\t}", "public function testCastValueToString()\n {\n TypeCastingImpl::setType('string');\n \n $obj = new TypeCastingImpl();\n \n $obj->prop = null;\n $obj->cast();\n $this->assertNull($obj->prop);\n \n $obj->prop = '100';\n $obj->cast();\n $this->assertSame('100', $obj->prop);\n \n $obj->prop = '';\n $obj->cast();\n $this->assertSame('', $obj->prop);\n \n $obj->prop = 1;\n $obj->cast();\n $this->assertSame('1', $obj->prop);\n \n $obj->prop = true;\n $obj->cast();\n $this->assertSame('1', $obj->prop);\n \n $obj->prop = false;\n $obj->cast();\n $this->assertSame('', $obj->prop);\n }", "public function testSetCellType() {\n\n $obj = new DataTablesColumn();\n\n $obj->setCellType(\"td\");\n $this->assertEquals(\"td\", $obj->getCellType());\n\n $obj->setCellType(\"th\");\n $this->assertEquals(\"th\", $obj->getCellType());\n\n $obj->setCellType(\"exception\");\n $this->assertEquals(\"td\", $obj->getCellType());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get trackingId field of the payment
public function getTrackingId() { return $this->trackingId; }
[ "public function getTrackingId()\n {\n return $this->_fields['TrackingId']['FieldValue'];\n }", "public function getTrackingId()\n {\n return $this->tracking_id;\n }", "public function getTrackingId()\n {\n return $this->TrackingId;\n }", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "public function getTrackingID() {\r\n\t\treturn $this->trackingID;\r\n\t}", "public function getPaymentId();", "public function getTrackingId()\n {\n return $this->directQuery->customQuery(\n 'bayonet_antifraud_orders',\n 'bayonet_tracking_id',\n ['entity_id' => $this->getOrderId()]\n );\n }", "public function getPaymentReferenceId() \n {\n return $this->getIdentification()->getUniqueId(); \n }", "private function getPaymentId()\n {\n return Session::get('mall.payment.id');\n }", "public function getPaymentId()\n {\n return $this->paymentId;\n }", "public function getOrderPaymentId();", "public function getPaymentId()\n {\n return $this->getParameter('paymentId');\n }", "public function getTrackingNumber()\n {\n return $this->trackingNumber;\n }", "public function getPaymentId()\n {\n return $this->getParameter('paymentid');\n }", "public function getTrackingNumber() {\n\t\treturn $this->tracking_number;\n\t}", "public function get_tracking_number(){\n\t\treturn $this->v_tracking_number;\n\t}", "public function getIdFieldName()\n {\n return Mage::getStoreConfig('factfinder/config/tracking_identifier');\n }", "public function getTrackingNumber(): string\n {\n return $this->trackingNumber;\n }", "public function getInternalPaymentId () {\n\t$data = $this->internalPaymentId;\n\t return $data;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the Brvr_Db_Query_WhereCondition object instance representing the contents of the WHERE clause
public function getWhere() { return $this->_getWhereCondition(self::WHERE); }
[ "public function get_where_clause() {\n\t\treturn $this->inner_condition->get_where_clause();\n\t}", "public function getWhereClause()\n {\n return $this->where_clause;\n }", "function getWhere() {\n\t\treturn $this->_clause;\n\t}", "protected function _build_where() {\n\t\treturn $this->_build_conditions( 'where' );\n\t}", "public function buildWhere()\n {\n return $this->expressionBuilder->buildExpression();\n }", "public function where()\n {\n $this->setExplictSelect(true);\n return $this->_query->where();\n }", "public function getWhere()\n {\n return $this->whereExpr;\n }", "public function getWhereClauseCondition() {\n\n if (isset($this->whereClauseCondition)) {\n $setCondition = $this->whereClauseCondition;\n return $setCondition;\n } else {\n $defaultCondition = \"=\";\n return $defaultCondition;\n }\n }", "public function getCondition() {\n $condition = array();\n $this->getQueryString(\"keyword\", $condition);\n return $condition;\n }", "private function getWhereQuery() {\n\t\t$where = \"relatedTo='\" . $this->relatedTo . \"' and relatedID='\" . $this->relatedID . \"'\";\n\t\treturn($where);\n\t}", "protected function getGeneralWhereClause() {}", "public function get_where_clause() {\n\t\treturn ' 1 = 0 ';\n\t}", "protected function generateWhere()\n {\n if(!$this->where->empty())\n {\n $sql = new Builder();\n $startwith = false;\n \n foreach($this->where->get() as $where)\n {\n if(Str::startWith($where, 'AND') && !$startwith)\n {\n $startwith = true;\n $sql->append(Str::move($where, 4) . ' ');\n }\n else if(Str::startWith($where, 'OR') && !$startwith)\n {\n $startwith = true;\n $sql->append(Str::move($where, 3) . ' ');\n }\n else\n {\n $sql->append($where . ' ');\n }\n }\n\n return $sql->get();\n }\n }", "private function _getWhereClause( )\n\t{\n\t\tif ( $this->_whereClause == null )\n\t\t{\n\t\t\tif ( $this->_contentid != 0 )\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('contentid') . ' = ' . $this->_contentid;\n\t\t\t}\n\t\t\telse if ( $this->_galleryimageid != 0 )\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('galleryimageid') . ' = ' . $this->_galleryimageid;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('contentid') . ' = 0 ' .\n\t\t\t\t\t'AND ' . $this->_database->nameQuote('galleryimageid') . ' = 0'; // should not occur!\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_whereClause;\n\t}", "public function getWhereClause(): string\n {\n return $this->whereClause;\n }", "protected function getWhereSql()\n {\n if (empty($this->conditions)) {\n return '';\n }\n $parts = [];\n foreach ($this->conditions as $condition) {\n $parts[] = $condition->toString();\n $this->parameters = array_merge($this->parameters, $condition->getParameters());\n }\n return ' WHERE ' . implode(' AND ', $parts);\n }", "public function getWhereSQL()\n {\n return $this->where_sql;\n }", "public function getWhereClauseString() {\n\t\t$this->query->count();\n\t\t$con = Propel::getWriteConnection($this->query->getDbName());\n\t\t$sql = $con->getLastExecutedQuery();\n\n\t\tif (strpos($sql, 'WHERE') !== false) {\n\t\t\t$parts = explode(' WHERE ', $sql);\n\t\t\treturn $parts[1];\n\t\t}\n\t\treturn '';\n\t}", "public function generateWhereClause()\n {\n $where_clause = '';\n $i = 1;\n foreach ($this->attributes as $key => $value) {\n $where_clause .= $key . ' = ? ';\n if ($i<count($this->attributes)) {\n $where_clause .= 'and ';\n }\n $i++;\n }\n\n return $where_clause;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of C5.
public function setC5($C5) { $this->C5 = $C5; return $this; }
[ "public function getC5()\r\n {\r\n return $this->C5;\r\n }", "public function setCustom5($value)\n {\n return $this->set(self::CUSTOM5, $value);\n }", "public function setData5($data5)\n {\n $this->data5 = $data5;\n\n return $this;\n }", "public function setCustomParameter5($value)\n {\n return $this->setParameter('customParameter5', $value);\n }", "public function setEstado_5($estado_5){\n $this->estado_5 = $estado_5;\n }", "public function setMagia5Attribute($value) {\n $this->attributes['magia5'] = $this->verificaAtributo($value, true);\n }", "public function setDate5(string $date5)\n {\n $this->date5 = $date5;\n\n return $this;\n }", "public function setX5U($var)\n {\n GPBUtil::checkString($var, True);\n $this->x5u = $var;\n\n return $this;\n }", "public function setFive($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->five !== $v) {\n\t\t\t$this->five = $v;\n\t\t\t$this->modifiedColumns[] = CashcountPeer::FIVE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setLibCritereNum5(?string $libCritereNum5): Constantes {\n $this->libCritereNum5 = $libCritereNum5;\n return $this;\n }", "public function testSetCompteCharge5() {\n\n $obj = new Etablissements();\n\n $obj->setCompteCharge5(\"compteCharge5\");\n $this->assertEquals(\"compteCharge5\", $obj->getCompteCharge5());\n }", "public function getColesterol5()\r\n\t{\r\n\t\treturn($this->colesterol5);\r\n\t}", "public function getContract5()\n {\n return $this->contract_5;\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function testSetPrix5() {\n\n $obj = new BudgetT();\n\n $obj->setPrix5(10.092018);\n $this->assertEquals(10.092018, $obj->getPrix5());\n }", "public function setUserDefinedField5($userDefinedField5 = null)\n {\n // validation for constraint: string\n if (!is_null($userDefinedField5) && !is_string($userDefinedField5)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($userDefinedField5)), __LINE__);\n }\n if (is_null($userDefinedField5) || (is_array($userDefinedField5) && empty($userDefinedField5))) {\n unset($this->UserDefinedField5);\n } else {\n $this->UserDefinedField5 = $userDefinedField5;\n }\n return $this;\n }", "public function setFanormall5(Fatherson $value) {\n return $this->set(self::FANORMALL5, $value);\n }", "public function setMd5($value)\n {\n return $this->set(self::MD5, $value);\n }", "public function setH5(\\TKusy\\FhirXhtml\\H5 $h5)\n {\n $this->h5 = $h5;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a long integer, returns the number converted to a binary string. This function accepts long integer values of arbitrary magnitude and uses the local largenumber math library when available.
function longToBinary($long) { $cmp = $this->cmp($long, 0); if ($cmp < 0) { $msg = __FUNCTION__ . " takes only positive integers."; trigger_error($msg, E_USER_ERROR); return null; } if ($cmp == 0) { return "\x00"; } $bytes = array(); while ($this->cmp($long, 0) > 0) { array_unshift($bytes, $this->mod($long, 256)); $long = $this->div($long, pow(2, 8)); } if ($bytes && ($bytes[0] > 127)) { array_unshift($bytes, 0); } $string = ''; foreach ($bytes as $byte) { $string .= pack('C', $byte); } return $string; }
[ "static function longToBinary($long)\n\t{\n\t\t$cmp = self::cmp($long, 0);\n\t\tif ($cmp < 0) {\n\t\t\t$msg = __FUNCTION__ . \" takes only positive integers.\";\n\t\t\taddlog($msg, CLogger::LEVEL_ERROR);\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($cmp == 0) {\n\t\t\treturn \"\\x00\";\n\t\t}\n\n\t\t$bytes = array();\n\n\t\twhile (self::cmp($long, 0) > 0) {\n\t\t\tarray_unshift($bytes, self::mod($long, 256));\n\t\t\t$long = self::div($long, pow(2, 8));\n\t\t}\n\n\t\tif ($bytes && ($bytes[0] > 127)) {\n\t\t\tarray_unshift($bytes, 0);\n\t\t}\n\n\t\t$string = '';\n\t\tforeach ($bytes as $byte) {\n\t\t\t$string .= pack('C', $byte);\n\t\t}\n\n\t\treturn $string;\n\t}", "function long_to_binary($long)\n{\n return pack('N', (int)$long);\n}", "function _long2str($l){\r\n return pack('N', $l);\r\n }", "protected function _long2str($l)\n {\n return pack('N', $l);\n }", "function BTC_int2str($val) {\n $a = bcmul($val, \"1.0\", 1);\n return bcdiv($a, \"100000000\", 8);\n}", "function lz($num) {\n return (strlen($num) < 2) ? \"0{$num}\" : $num;\n}", "private static function lz($num)\n{\n return (strlen($num) < 2) ? \"0{$num}\" : $num;\n}", "function lz($num)\r\n{\r\n return (strlen($num) < 2) ? \"0{$num}\" : $num;\r\n}", "function lz($num)\n{\n return (strlen($num) < 2) ? \"0{$num}\" : $num;\n}", "public static function uLongToString($value) {\r\n\t\t$string = '';\r\n\r\n\t\t$string .= chr( ($value >> 24) & 0xFF );\r\n\t\t$string .= chr( ($value >> 16) & 0xFF );\r\n\t\t$string .= chr( ($value >> 8) & 0xFF );\r\n\t\t$string .= chr( ($value ) & 0xFF );\r\n\r\n\t\treturn $string;\r\n\t}", "protected static function encodeLongInt($int, $length)\n\t{\n\t\t// convert int to float to avoid wring \n\t\t// encoding of negative values (see at / operation)\n\t\t$int = $int * 1.0;\n\t\t$str = '';\n\t\tfor ($i = 0; $i < $length; $i++)\n\t\t{\n\t\t\t$str = chr($int & 255).$str;\n\t\t\t$int = $int > 255 ? $int / 256 : 0;\n\t\t}\n\t\treturn $str;\n\t}", "function gmp_strval ($gmpnumber, $base = null) {}", "function lz($num)\n\t{\n\t\treturn str_pad($num, 2, 0, STR_PAD_LEFT);\n\t //return (strlen($num) < 2) ? \"0{$num}\" : $num;\n\t}", "function getBinary($n) {\n return $n ? getBinary(intval($n / 2)) . $n % 2 : '0';\n}", "function to_long_xml($longVal)\r\n{\r\n return '<long>' . $longVal . '</long>';\r\n}", "function completarLongitud($numero = 0, $logitudNumero = 4){\n\t\t$numero = (int)$numero;\n\t\t$longitudNro = (int)strlen($numero);\n\t\twhile(($logitudNumero-$longitudNro) > 0){\n\t\t\t$numero = '0'.$numero;\n\t\t\t++$longitudNro;\n\t\t}\n\t\treturn $numero;\t\n\t}", "public function to_binary() { # :: Int -> String\n return new Str(decbin($this->value));\n }", "function lz($num)\n{\n return substr((\"000\".$num),-2);\n}", "function binaryToString($value) {\n if ($value >= 1 || $value <= 0) {\n return \"ERROR\";\n }\n $temp = $value;\n $str = \"\";\n $counter = 0;\n while ($temp != 0 && $counter <= 20) {\n $temp *= 2;\n if ($temp > 1) {\n $temp--;\n $str .= \"1\";\n } else {\n $str .= \"0\";\n }\n $counter++;\n }\n return $str;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize column with delete buttons
function init_delete($field) { // set special CSS class for delete buttons to add some styling $this->columns[$field]['button_class'] = 'atk-effect-danger atk-delete-button'; $this->columns[$field]['icon'] = 'trash'; // if this was clicked, then delete record if ($id = @$_GET[$this->name.'_'.$field]) { // delete record $this->_performDelete($id); if($this->app->db->inTransaction()) $this->app->db->commit(); // show message $this->js()->univ() ->successMessage('Deleted Successfully') ->reload() ->execute(); } // move button column at the end (to the right) $self = $this; $this->app->addHook('post-init', function() use($self, $field) { if ($self->hasColumn($field)) { $self->addOrder()->move($field, 'last')->now(); } }); // ask for confirmation $this->init_confirm($field); }
[ "public function _addDeleteColumn()\n {\n $this->_grid->setColumn(\n 'delete',\n array(\n 'name' => 'Delete',\n 'formatter' => array($this, 'deleteLinkFormatter'),\n 'attribs' => array('width' => '60px')\n )\n );\n return $this;\n }", "protected function configureDel()\n {\n $this->grid->addColumn('delete', 'delete', array('icon' => 'trash', 'descr' => 'Delete'));\n }", "public function initDelete()\n {\n $this->addAction(['icon' => 'red trash'], function ($jschain, $id) {\n $this->model->load($id)->delete();\n\n return $jschain->closest('tr')->transition('fade left');\n }, 'Are you sure?');\n }", "protected function initColumns()\r\n {\r\n foreach ($this->columns as $i => $column) {\r\n $definition = array_merge([\r\n 'class' => $this->columnClass,\r\n 'renderer' => $this,\r\n 'context' => $this->context,\r\n ], $column);\r\n\r\n $this->addButtonOptions = (array)$this->addButtonOptions;\r\n\r\n if (!isset($definition['attributeOptions'])) {\r\n $definition['attributeOptions'] = $this->attributeOptions;\r\n }\r\n\r\n if (!isset($definition['enableError'])) {\r\n $definition['enableError'] = $this->enableError;\r\n }\r\n\r\n $this->columns[$i] = Az::createObject($definition);\r\n }\r\n }", "function showDelete($path)\n\t{\n\t\t$this->table->deleteColumn = true;\n\t\t$this->table->deletelink = $path;\n\t}", "protected function column_default_add_action( $item, $column_name, &$actions ) {\n\t\t\t$form_id = '_' . self::$list_number ++;\n\t\t\t$wp_nonce_keys = '';\n\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t$wp_nonce_keys .= '-' . esc_attr( $item[ $key ] );\n\t\t\t}\n\n\t\t\t// Prepare argument schema name.\n\t\t\tif ( '' === $this->schema_name ) {\n\t\t\t\t$schema_name = '';\n\t\t\t} else {\n\t\t\t\t$schema_name = \"&schema_name={$this->schema_name}\";\n\t\t\t}\n\n\t\t\t// Prepare argument page.\n\t\t\t$page = esc_attr( $this->page );\n\n\t\t\t// Prepare argument table name.\n\t\t\t$table_name = esc_attr( $this->table_name );\n\n\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}$wp_nonce_keys\";\n\t\t\t$wp_nonce = wp_create_nonce( $wp_nonce_action );\n\n\t\t\t$delete_form =\n\t\t\t\t\"<form\" .\n\t\t\t\t\" id='delete_form$form_id'\" .\n\t\t\t\t\" action='?page=$page$schema_name&table_name=$table_name'\" .\n\t\t\t\t\" method='post'>\" .\n\t\t\t\t$this->get_key_input_fields( $item ) .\n\t\t\t\t$this->add_parent_args_as_string( $item ) .\n\t\t\t\t\"<input type='hidden' name='action' value='delete' />\" .\n\t\t\t\t\"<input type='hidden' name='_wpnonce' value='$wp_nonce'>\" .\n\t\t\t\t$this->page_number_item .\n\t\t\t\t\"</form>\";\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(\"#wpda_invisible_container\").append(\"<?php echo $delete_form; ?>\");\n\t\t\t</script>\n\t\t\t<?php\n\t\t\tif ( isset( $this->child['relation_nm'] ) ) {\n\t\t\t\t$link_label = __( 'Delete Relationship', 'wp-data-access' );\n\t\t\t} else {\n\t\t\t\t$link_label = __( 'Delete', 'wp-data-access' );\n\t\t\t}\n\t\t\t$warning = __(\"You are about to permanently delete these items from your site.\\\\nThis action cannot be undone.\\\\n\\\\'Cancel\\\\' to stop, \\\\'OK\\\\' to delete.\",'wp-data-access');\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"javascript:void(0)\" \n class=\"delete\" \n onclick=\"if (confirm(\\'%s\\')) jQuery(\\'#%s\\').submit()\">\n %s\n </a>\n ',\n\t\t\t\t$warning,\n\t\t\t\t\"delete_form$form_id\",\n\t\t\t\t$link_label\n\t\t\t);\n\t\t}", "public function getButtonsColumn()\n {\n $allowedActions = explode(',', $this->allowedActions);\n $allowDelete = in_array('delete', $allowedActions);\n $allowView = in_array('view', $allowedActions);\n $allowEdit = in_array('edit', $allowedActions);\n\n $template = '';\n if (!$allowEdit && $allowView) {\n $template = '{view}';\n } elseif ($allowEdit) {\n $template = '{update}';\n }\n if ($allowDelete) {\n if (!empty($template)) {\n $template .= '&nbsp;&nbsp;&nbsp;{delete}';\n } else {\n $template = '{delete}';\n }\n }\n\n return array(\n 'class' => 'ext.mAdmin.widgets.AdminButtonColumnWidget',\n 'template' => $template,\n 'viewButtonOptions' => array('class'=>'view blue'),\n 'updateButtonOptions' => array('class'=>'update green'),\n 'deleteButtonOptions' => array('class'=>'delete red'),\n 'updateButtonUrl' => 'Yii::app()->controller->createUrl(\"edit\",array(\"id\"=>( isset($data->primaryKey) ? $data->primaryKey : (is_array($data)&&isset($data[\"id\"])?$data[\"id\"]:\"\") )))',\n 'deleteButtonUrl' => 'Yii::app()->controller->createUrl(\"delete\",array(\"id\"=>( isset($data->primaryKey) ? $data->primaryKey : (is_array($data)&&isset($data[\"id\"])?$data[\"id\"]:\"\") )))',\n 'htmlOptions' => array(\n 'width' => '64',\n ),\n 'headerHtmlOptions' => array(\n 'width' => '64',\n ),\n );\n }", "public function deleteTaskColumn()\n\t{\n\t\treturn CHtml::linkButton(Yii::t('AuthModule.core', 'Delete'), array(\n\t\t\t'submit'=>array('authItem/delete', 'name'=>$this->name, 'redirect'=>urlencode('default/tasks')),\n\t\t\t'confirm'=>Yii::t('AuthModule.core', 'Are you sure you want to delete this task?'),\n\t\t\t'class'=>'deleteLink',\n\t\t));\n\t}", "public function getButtonsColumn()\n {\n $allowedActions = explode(',', $this->allowedActions);\n $allowDelete = in_array('delete', $allowedActions);\n $allowView = in_array('view', $allowedActions);\n $allowEdit = in_array('edit', $allowedActions);\n\n $template = '';\n if (!$allowEdit && $allowView) {\n $template = '{view}';\n } elseif ($allowEdit) {\n $template = '{update}';\n }\n if ($allowDelete) {\n if (!empty($template)) {\n $template .= '&nbsp;&nbsp;&nbsp;{delete}';\n } else {\n $template = '{delete}';\n }\n }\n\n return array(\n 'class' => 'ext.mAdmin.widgets.ExtTbButtonColumn',\n 'template' => $template,\n 'updateButtonUrl' => 'Yii::app()->controller->createUrl(\"edit\",array(\"id\"=>( isset($data->primaryKey) ? $data->primaryKey : (is_array($data)&&isset($data[\"id\"])?$data[\"id\"]:\"\") )))',\n 'deleteButtonUrl' => 'Yii::app()->controller->createUrl(\"delete\",array(\"id\"=>( isset($data->primaryKey) ? $data->primaryKey : (is_array($data)&&isset($data[\"id\"])?$data[\"id\"]:\"\") )))'\n );\n }", "function admin_delete($id = null) {\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash(__('Invalid column id', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n $formula_obj = ClassRegistry::init('Formula');\n $formula_data = $formula_obj->find('all');\n $formula_affected = array();\n foreach($formula_data as $formula){\n\n $findme = \"C\".$id;\n $pos = strpos($formula['Formula']['formula'], $findme);\n if ($pos === false) {\n\n } else {\n $formula_affected []=$formula;\n }\n }\n foreach($formula_affected as $frmla){\n $ret = $formula_obj->delete($frmla['Formula']['id']);\n\n }\n\t\tif ($this->Column->softDelete($id)) {\n\n\t\t\t$this->Session->setFlash(__('Column deleted', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t\t$this->Session->setFlash(__('Column was not deleted', true));\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "public function getDeleteButton()\r\n {\r\n return $this->deleteButton;\r\n }", "public function deleteRoleColumn()\n\t{\n if ($this->name == FAuthManager::ROLE_ADMINISTRATORS) return '';\n \n\t\treturn CHtml::linkButton(Yii::t('AuthModule.core', 'Delete'), array(\n\t\t\t'submit'=>array('authItem/delete', 'name'=>$this->name, 'redirect'=>urlencode('default/roles')),\n\t\t\t'confirm'=>Yii::t('AuthModule.core', 'Are you sure you want to delete this role?'),\n\t\t\t'class'=>'deleteLink',\n\t\t));\n\t}", "public function deleteColumn($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('deleteColumn', $value);\n }", "function column_cb($item) {\n return sprintf(\n '<input type=\"checkbox\" name=\"bulk-delete[]\" value=\"%s\" />', $item['id']\n );\n }", "protected function _prepareActionColumn()\n {\n return $this->addColumn(\n 'action',\n array(\n 'header' => $this->__('Actions'),\n 'index' => 'id',\n 'renderer' => 'customgrid/widget_grid_column_renderer_grid_action',\n 'filter' => false,\n 'sortable' => false,\n 'getter' => 'getId',\n 'width' => '120px',\n 'actions' => array(\n array(\n 'caption' => $this->__('Edit'),\n 'field' => 'grid_id',\n 'url' => array(\n 'base' => '*/*/edit',\n ),\n 'permissions' => array(\n BL_CustomGrid_Model_Grid_Sentry::ACTION_CUSTOMIZE_COLUMNS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_FORCED_TYPE,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_CUSTOMIZATION_PARAMS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_DEFAULT_PARAMS_BEHAVIOURS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_ROLES_PERMISSIONS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_ASSIGN_PROFILES,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_PROFILES,\n ),\n ),\n array(\n 'caption' => $this->__('Enable'),\n 'url' => array('base' => '*/*/enable'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE),\n ),\n array(\n 'caption' => $this->__('Disable'),\n 'url' => array('base' => '*/*/disable'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE),\n ),\n array(\n 'caption' => $this->__('Delete'),\n 'confirm' => $this->__('Are you sure?'),\n 'url' => array('base' => '*/*/delete'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_DELETE),\n )\n ),\n )\n );\n }", "protected function initColumns()\n\t{\n\t\tif (empty($this->columns)) {\n\t\t\t$this->guessColumns();\n\t\t}\n\t\t$id = $this->getId();\n\t\tforeach ($this->columns as $i => $column) {\n\t\t\tif (is_string($column)) {\n\t\t\t\t$column = $this->createDataColumn($column);\n\t\t\t} else {\n\t\t\t\t$column = Yii::createObject(array_merge(array(\n\t\t\t\t\t'class' => $this->dataColumnClass,\n\t\t\t\t\t'grid' => $this,\n\t\t\t\t), $column));\n\t\t\t}\n\t\t\tif (!$column->visible) {\n\t\t\t\tunset($this->columns[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($column->id === null) {\n\t\t\t\t$column->id = $id . '_c' . $i;\n\t\t\t}\n\t\t\t$this->columns[$i] = $column;\n\t\t}\n\t}", "public function addActionColumns(){\n $this->addColumnType('actions', 'object');\n AMI_Event::addHandler('on_list_body_{actions}', array($this, 'handleActionCell'), $this->getModId());\n }", "function column_cb($item)\n\t{\n\t\treturn sprintf('<input type=\"checkbox\" name=\"bulk-delete[]\" value=\"%s\" />', $item['id']);\n\t}", "function display_delete_dropdown()\n {\n $this->display_dropdowns();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateCampaign Update some or all of the settings for a specific campaign.
public function updateCampaign($campaign_id, $settings) { try { $response = $this->mailchimp->campaigns->update( $campaign_id, [ "settings" => $settings, ]); return $response; } catch (\Exception $e) { Log::error('Unable to locate Campaign, campaign updated.'); } }
[ "public function testUpdateCampaign()\n {\n }", "public function UpdateCampaign(ApiCampaign $apiCampaign);", "public function Update($campaign) {\n return ApiClient::Request('campaign/update', array(\n 'campaign' => $campaign\n ));\n }", "public function testUpdateCampaignSet()\n {\n }", "public function Update($campaign)\r\n {\r\n return $this->request('campaign/update', array(\r\n 'campaign' => $campaign\r\n ));\r\n }", "public function testUpdateCampaign() {\n $campaign_id = '3e06f4ec92';\n $type = 'regular';\n $recipients = (object) [\n 'list_id' => '3c307a9f3f',\n ];\n $settings = (object) [\n 'subject_line' => 'This is an updated subject line',\n 'from_name' => 'Customer Service',\n ];\n\n $mc = new MailchimpCampaigns();\n $mc->updateCampaign($campaign_id, $type, $recipients, $settings);\n\n $this->assertEquals('PATCH', $mc->getClient()->method);\n $this->assertEquals($mc->getEndpoint() . '/campaigns/' . $campaign_id, $mc->getClient()->uri);\n\n $this->assertNotEmpty($mc->getClient()->options['json']);\n\n $request_body = $mc->getClient()->options['json'];\n\n $this->assertEquals($type, $request_body->type);\n\n $this->assertEquals($recipients->list_id, $request_body->recipients->list_id);\n $this->assertEquals($settings->subject_line, $request_body->settings->subject_line);\n $this->assertEquals($settings->from_name, $request_body->settings->from_name);\n }", "public function updateCampaignStatus($campaign_id);", "public function campaignUpdate(array $options) {\n\t\t$defaults = [\n\t\t\t'cid' => $this->settings['defaultCampaignId']\n\t\t];\n\t\t$options += $defaults;\n\t\treturn $this->call('campaigns/update', $options);\n\t}", "public function update($profileId, Campaign $postBody, $optParams = [])\n {\n $params = ['profileId' => $profileId, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('update', [$params], Campaign::class);\n }", "function updateCampaign($id, $fields){\n\t\t\n\t\t$mcapi = $this->mcapi;\n\t\n\t\tforeach($fields as $key => $f){\n\t\t\t\n\t\t\tif($key == 'groups'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$groupings = $mcapi->listInterestGroupings($fields['list_id']);\n\t\t\t\t$groupingId = $groupings[0]['id'];\n\t\t\t\t\n\t\t\t\t$segment_opts = array();\n\t\t\t\t\n\t\t\t\t$segment_opts['match'] = 'any';\n\t\t\t\t$segment_opts['conditions'] = array();\n\t\t\t\t$segment_opts['conditions'][0]['op'] = array();\n\t\t\t\t$segment_opts['conditions'][0]['op'] = 'one';\n\t\t\t\t$segment_opts['conditions'][0]['value'] = $f;\n\t\t\t\t$segment_opts['conditions'][0]['field'] = 'interests-'.$groupingId;\n\n\t\t\t\t$result = $mcapi->campaignUpdate($id, 'segment_opts', $segment_opts);\n\t\t\t\n\t\t\t\tif($mcapi->errorCode){\n\t\t\t\t\t\n\t\t\t\t\t$this->errorMessage = $mcapi->errorMessage;\n\t\t\t\t\t$this->errorCode = $mcapi->errorCode;\n\t\t\t\t\t//exit if error detected\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$result = $mcapi->campaignUpdate($id, $key, $f);\n\t\t\t\n\t\t\t\tif($mcapi->errorCode){\n\t\t\t\t\t\n\t\t\t\t\t$this->errorMessage = $mcapi->errorMessage;\n\t\t\t\t\t$this->errorCode = $mcapi->errorCode;\n\t\t\t\t\t//exit if error detected\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\t\n\t}", "public function setCampaign($id)\n {\n }", "public function updated( $campaign )\n {\n // We will only fire the event as long as\n // there is existing facebook data.\n //\n if( ! empty( $campaign->getFacebookIdFields() ) )\n {\n event( new CampaignWasUpdated( $campaign ) );\n }\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n $model->updated_at = date('Y-m-d H:i:s');\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'Campaign successfully updated');\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "function apsa_ajax_update_campaign_options() {\n if (!current_user_can('manage_options')) {\n die();\n }\n\n global $apsa_admin_labels;\n $success = 1;\n\n $campaign_name = $_POST['campaign_name'];\n $campaign_id = $_POST['campaign_id'];\n $campaign_options = $_POST['campaign_options'];\n $options = array();\n\n foreach ($campaign_options as $key => $campaign_option) {\n\n $options[$campaign_option['name']] = $campaign_option['value'];\n }\n\n /** Update campaign basic data */\n // Check if compaign name set, else set default name\n if (empty($campaign_name)) {\n $campaign_type = apsa_get_campaign_data($campaign_id, \"type\");\n\n switch ($campaign_type) {\n case 'background':\n $campaign_name = $apsa_admin_labels[\"camp_name_background\"];\n break;\n case 'popup':\n $campaign_name = $apsa_admin_labels[\"camp_name_popup\"];\n break;\n case 'embed':\n $campaign_name = $apsa_admin_labels[\"camp_name_embed\"];\n break;\n case 'sticky':\n $campaign_name = $apsa_admin_labels[\"camp_name_sticky\"];\n break;\n default:\n $campaign_name = '';\n break;\n }\n\n $campaign_date = apsa_get_campaign_data($campaign_id, \"creation_date\");\n $campaign_date = date_i18n(get_option('date_format'), strtotime($campaign_date));\n $campaign_name .= \" - (\" . $campaign_date . \")\";\n }\n\n $update_camp = apsa_update_campaign($campaign_id, $campaign_name);\n $update_camp_opt = apsa_update_campaign_options($campaign_id, $options);\n\n if ($update_camp === FALSE || $update_camp_opt === FALSE) {\n $success = 0;\n } else {\n if (isset($_POST['campaign_elements'])) {\n\n $elements = $_POST['campaign_elements'];\n\n $apsa_child_update = apsa_update_child_element_options($elements);\n if (!$apsa_child_update)\n $success = 0;\n }\n }\n\n $response = array('success' => $success);\n echo json_encode($response);\n\n wp_die();\n}", "public function setCampaign(string $campaign);", "public static function updateSettingsAgent()\n {\n if (Loader::includeModule('seo') && Loader::includeModule('socialservices')) {\n $engine = new YandexDirect();\n if (!Service::isRegistered()) {\n return;\n }\n\n $authInfo = Service::getAuth($engine->getCode());\n if (!is_array($authInfo) || empty($authInfo) || $authInfo['expires_in'] <= time()) {\n return;\n }\n\n try {\n self::clearData();\n $engine->updateCampaignManual();\n } catch (YandexDirectException $e) {\n }\n }\n }", "public function update() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $type = $ad->type;\n\n $ad->update([\n 'city' => $this->params['city'],\n 'description' => $this->params['description'],\n 'price' => $this->params['price'],\n 'type' => $type,\n 'author_id' => $this->current_user->id,\n 'console_id' => $this->params['console_id'],\n \"{$type}_id\" => $this->params[$type . '_id'],\n 'published' => $this->params['published']\n ]);\n\n $this->notify_subscribed_users($ad);\n\n redirect(\n '/ads/edit',\n ['notice' => 'Ad updated successfully'],\n ['id' => $ad->id]\n );\n }", "function apsa_ajax_update_all_camps() {\n if (!current_user_can('manage_options')) {\n die();\n }\n\n global $apsa_admin_labels;\n $all_camps = $_POST[\"all_camps\"];\n\n $success = 1;\n\n foreach ($all_camps as $campaign_id => $camp) {\n\n /** Update campaign */\n $campaign_options = $camp['campaign_options'];\n $options = array();\n\n foreach ($campaign_options as $key => $campaign_option) {\n if ($campaign_option['name'] == \"campaign_name\") {\n $campaign_name = $campaign_option['value'];\n continue;\n }\n $options[$campaign_option['name']] = $campaign_option['value'];\n }\n\n /** Update campaign basic data */\n // Check if compaign name set, else set default name\n if (empty($campaign_name)) {\n $campaign_type = apsa_get_campaign_data($campaign_id, \"type\");\n\n switch ($campaign_type) {\n case 'background':\n $campaign_name = $apsa_admin_labels[\"camp_name_background\"];\n break;\n case 'popup':\n $campaign_name = $apsa_admin_labels[\"camp_name_popup\"];\n break;\n case 'embed':\n $campaign_name = $apsa_admin_labels[\"camp_name_embed\"];\n break;\n case 'sticky':\n $campaign_name = $apsa_admin_labels[\"camp_name_sticky\"];\n break;\n default:\n $campaign_name = '';\n break;\n }\n\n $campaign_date = apsa_get_campaign_data($campaign_id, \"creation_date\");\n $campaign_date = date_i18n(get_option('date_format'), strtotime($campaign_date));\n $campaign_name .= \" - (\" . $campaign_date . \")\";\n }\n\n $update_camp = apsa_update_campaign($campaign_id, $campaign_name);\n $update_camp_opt = apsa_update_campaign_options($campaign_id, $options);\n\n if ($update_camp === FALSE || $update_camp_opt === FALSE) {\n $success = 0;\n break;\n }\n\n /** Update campaign elements */\n if (isset($camp['campaign_elements'])) {\n $elements = $camp['campaign_elements'];\n $apsa_child_update = apsa_update_child_element_options($elements);\n if (!$apsa_child_update) {\n $success = 0;\n break;\n }\n }\n }\n\n $response = array('success' => $success);\n echo json_encode($response);\n\n wp_die();\n}", "protected function Update_Campaign_Info($application_id)\n\t{\n\t\tif ($_SESSION['promo_override'])\n\t\t{\n\t\t\t$app_campaign_manager = new App_Campaign_Manager($this->sql, $this->database, $this->applog);\n\t\t\t$app_campaign_manager->Update_Campaign($application_id, $this->config);\n\n\t\t\tif (!$_SESSION['promo_update'])\n\t\t\t{\n\t\t\t\t$target = (isset($_SESSION['blackbox']['winner']) ? $_SESSION['blackbox']['winner'] : $this->property_short);\n\n\t\t\t\tif ($target && !$this->config->use_new_process)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$olp_db = $this->Setup_OLP_DB($target);\n\t\t\t\t\t\t$olp_db->Insert_Campaign_Info($application_id, $this->config);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->Applog_Write('Could not update campaign_info record in eCash.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$_SESSION['promo_update'] = TRUE;\n\t\t\t}\n\n\t\t\t$_SESSION['promo_override'] = FALSE;\n\n\t\t}\n\n\t\treturn;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Abstract Method for all Quack objects
public function quack();
[ "public function performQuack()\n\t{\n\t\tif ($this->quackBehavior) {\n\t\t\t$this->quackBehavior->quack($this->duckType);\n\t\t}\n\t\telse{\n\n\t\t\t$this->quackBehavior = new CantQuack();\n\t\t\t$this->quackBehavior->quack($this->duckType);\n\t\t}\n\t}", "public function performQuack()\n {\n $this->quack_behavior->quacks();\n }", "public function performQuack()\n {\n $this->quackBehavior->quack();\n }", "public function __construct(string $q = NULL) {}", "abstract protected function _execute();", "public function doQuake() {\n return $this->QuackBehaviour->quack();\n }", "public function copy() : Quat {}", "abstract protected function __construct();", "abstract protected function getResqueFactory();", "public abstract function get_query();", "public function quoter(): QuoterInterface;", "public function quack()\n {\n $this->turkey->gobble();\n\n }", "public function getQomFactory() {}", "abstract public function perform();", "abstract protected function getPaymentQueue();", "abstract protected function qomf(): QueryObjectModelFactoryInterface;", "public function setBoostQuery($q){}", "abstract public function aire();", "public function testUserWantsToLikeQuack()\n {\n $successfulLikeQuack = new DataObjects;\n $failureLikeQuack = new DataObjects;\n\n //Successful Input\n $successfulLikeQuack->likeQuack(10, 1, '2019-03-18 22:28:05');\n $this->assertEquals($successfulLikeQuack, 'true');\n\n //Failure Input: liking a Quack with an invalid date\n $failureLikeQuack->likeQuack(10, 1, '2019-44-18 22:28:05');\n $this->assertEquals($failureLikeQuack, 'false');\n\n //Failure Input: liking a Quack with user ID and tweet ID as strings\n $failureLikeQuack->likeQuack('10', '1', '2019-03-18 22:28:05');\n $this->assertEquals($failureLikeQuack, 'false');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
mostrar todas los Rutina en un select
public function vistaRutinaSelectController(){ $respuesta = Datos::vistaRutinaModel("rutina"); $a=""; foreach($respuesta as $row => $item){ $id=$item["id_rutina"]; $e=$item["recorrido"]; echo'<option value='.$id.'>'.$e.'</option>'; } }
[ "public function muestra_tipos()\n {\n $rpta='<option value=\"\"></option>';\n //hago una consulta a la base de datos para obtener las instancias del material seleccionado\n $tipos = $this->db->get_where('tipos_dispositivos');\n\n foreach ($tipos->result() as $fila)\n {\n $rpta.= '<option value=\"' . $fila->id .'\">' . $fila->nombre_tipo_dispositivo . '</option>';\n }\n echo $rpta;\n }", "static public function \tctrListarRubros(){\n\n\t\t$respuesta = ModeloProductos::mdlListarRubros(\"Rubro\");\n\n\t\tforeach ($respuesta as $row => $item){\n\n\t\t\techo '<option value=\"'.$item[\"RubroID\"].'\">'.$item[\"Nombre\"].'</option>';\n\t\t}\n\n\t}", "function selectMedicos(){\n\n\t\t\t$sql = \"SELECT id_usuario,CONCAT(usuarios.nombre,' ',usuarios.apellido) AS nombre_usuario FROM usuarios WHERE privilegio='3' ORDER BY id_usuario DESC\";\n\t\t\t@$statement = Conexion::Conectar();\n\t\t\t$consulta = $statement->query($sql)->fetchAll();\n\t\t\techo \"\n\t\t\t<select name='medico' id='medico' class='form-control medico'>\n\t\t\t\";\n\t\t\t\n\t\t\tforeach ($consulta as $value) {\n\t\t\t echo \n\t\t\t ' \n <option value=\"'.$value['id_usuario'].'\">'.$value['nombre_usuario'].'</option> \n \t\n\t\t\t ';\n\t\t\t}\n\t\t\techo \"\n\t\t\t</select>\n\t\t\t\";\n\t\t}", "public function llenaTipoPresupuesto()\n {\n\n $db = new Conexion();\n $sql = $db->query(\"SELECT * FROM tipo_presupuesto\");\n while ($registros = $db->recorrer($sql)) {\n ?>\n\t\t\t<option <?php echo 'value=\"' . $registros[\"idtipo_presupuesto\"] . '\"';\n if ($registros[\"idtipo_presupuesto\"] == $this->tipo_presupuesto_fijo) {echo ' selected';}\n ?>>\n\t\t\t\t<?=$registros[\"denominacion\"]?>\n\t\t\t</option>\n\t\t\t<?\n }\n\n }", "public function combo() {\n $comando = $this->db->prepare(\"select idveiculo, placa from veiculo \");\n $comando->execute();\n if ($comando->rowCount() > 0) {\n while ($row = $comando->fetch(PDO::FETCH_ASSOC)) {\n ?>\n\n <option value=\"<?php print($row['placa']); ?>\">\n <?php print($row['placa']); ?></option>\n\n <?php\n }\n }\n }", "private function ExibirTamanhos(){\r\n $oDadosCamiseta;\r\n $sSql = \"SELECT * FROM tamanho_camiseta\";\r\n $oDadosCamiseta = $this->Fbd->PesquisarSQL($sSql);\r\n \r\n foreach($oDadosCamiseta as $oRegistro){\r\n echo \"<option value='\".$oRegistro->sigla.\"' class='sctOptTamanho'>\".$oRegistro->nome.\"</option>\";\r\n }\r\n }", "public function ComboCiudades(){\n $conect = new conexion(\"localhost\",\"root\",\"\",\"agendatelefonica\");\n $SqlCiudades = \"Select * From ciudades\";\n $DatosCiudades = $conect->consultar($SqlCiudades);\n if($DatosCiudades->num_rows>0){\n while($fila=$DatosCiudades->fetch_assoc()){\n echo'<option value = \"'.$fila['idciudades'].'\">'.$fila['nomciudad'].'</option>';\n }\n }\n }", "public function vistaPlanEntreSelectController(){\n\t\t\t$respuesta = Datos::vistaPlanEntreModel(\"plan_entrenamiento\");\n\t\t\t$a=\"\";\n\n\t\t\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\t\t$id=$item[\"id_planEntrenamiento\"];\n\t\t\t\t$e=$item[\"codigo\"];\n\n\t\t\t\n\t\t\techo'<option value='.$id.'>'.$e.'</option>';\n\t\t\n\n\t\t\t}\n\t\t}", "public function vistaTecnicoSelectController(){\n\t\t\t$respuesta = Datos::vistaTecnicoModel(\"usuario\");\n\t\t\t$a=\"\";\n\n\t\t\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\t\t$id=$item[\"id_usuario\"];\n\t\t\t\t$e=$item[\"nombre\"];\n\n\t\t\t\n\t\t\techo'<option value='.$id.'>'.$e.'</option>';\n\t\t\n\n\t\t\t}\n\t\t}", "public function combobox_grado()\n {\n $query = $this->conn->prepare(\"SELECT id_grado,descripcion_grado FROM Grado\");\n $query->execute();\n \n while($row=$query->fetch(PDO::FETCH_ASSOC))\n {\n echo '<option value=\"'.$row['id_grado'].'\">'.$row['descripcion_grado'].'</option>'; \n }\n\n }", "public function select(){\n $cursos = Curs::all();\n Log::Info($cursos);\n $html=\"\";\n foreach ($cursos as $curs){ \n $html.= \"<option value=\".$curs->id.\" >\".$curs->curs.\"<option>\";\n }\n return new HtmlString($html);\n }", "function genreopties(){\r\n\t\tglobal $pdo;\r\n\t\t\t//maken sql query\r\n\t\t$sql = \"SELECT DISTINCT genre_name FROM Genre\";\r\n\t\t\t//afschieten query\r\n\t\t$result = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\r\n\t\tforeach($result as $row){\r\n\t\t\tforeach($row as $genre){\r\n\t\t\t\techo '<option value='.$genre.'>'.$genre.'</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function select($cuentavivienda);", "public static function htmlShowRestaurantSelect(){\r\n\t\t$currentRes = $_SESSION[\"restaurant\"];\r\n\t\t\r\n\t\t$dao = new RestaurantDAO();\r\n\t\t$restaurants = $dao->getAllRestaurant();\r\n\t\t\r\n\t\t$html = '\r\n\t\t<select id=\"selectRestaurant\">\r\n\t\t\t<option value=\"'. $currentRes .'\" selected>Nội bộ</option>\r\n\t\t\t<option value=\"-1\">Tất cả</option>';\r\n\t\t\r\n\t\tforeach ($restaurants as $rest){\r\n\t\t\t$html .= '<option value=\"'. $rest[\"MaNH\"] . '\">' . $rest[\"TenNH\"] . '</option>';\r\n\t\t}\r\n\t\t\r\n\t\t$html .= '</select>';\r\n\t\t\r\n\t\treturn $html;\r\n\t}", "public function vistaClausulasSelectController(){\n\t$respuesta = Datos::vistaClausulaModel(\"clausula\");\n\t$a=\"\";\n\n\n\tforeach($respuesta as $row => $item){\n\t\t$id=$item[\"id_clausula\"];\n\t\t$e=$item[\"acuerdo\"];\n\n\t\n\techo'<option value='.$id.'>'.$e.'</option>';\n\n\n\t}\n}", "public function listaTipoMovimiento(){\n\t\t\t$sql = self::conectardb()->prepare(\"SELECT * FROM tipomovimiento\");\n\t\t\t$sql->execute();\n\t\t\techo \"<option id='e' value='0'>Seleccionar movimiento</option>\";\n\t\t\tforeach ($sql as $val) \n\t\t\t\techo \"<option value='$val[0]'>$val[1]</option>\";\n\t\t}", "public function listar_cuentas_a_transferir(){\n\n\t\t\t$cuentas = array( \"Caja Fuerte\", \"Cuenta Corriente\", \"Caja Chica\", \"Tarjeta Disponible\", \"Tarjeta Deuda\" );\n\n\t\t\t// Creo la variable que va a contener el select a ser devuelto\n\t\t\t$select = \"\";\n\t\t\t$select .= \t\"\n\t\t\t\t\t\t<select name='cuentas_a_transferir' id='cuentas_a_transferir'>\n\t\t\t\t\t\t\t<option value='0'>-Elegir Cuenta-</option>\n\t\t\t\t\t\t\";\n\n\t\t\t// Cuento la cantidad de registros traidos\n\t\t\t$cantidad = count($cuentas);\n\n\t\t\t// Relleno las opciones del select con los valores en el array\n\t\t\tfor($i = 0; $i < $cantidad; $i++){\n\t\t\t\t$aux = $i + 1;\n\t\t\t\t$select .= \"<option value='\".$aux.\"'>\".$cuentas[$i].\"</option>\";\n\t\t\t}\n\n\t\t\t$select .= \t\"</select>\";\n\n\t\t\treturn $select;\n\t\t}", "public function mostrarAlumnosController(){\n $alumnos = Datos::vista(\"alumno\");\n foreach($alumnos as $row => $item){\n echo'<option value ='.$item['matricula'].'>'.$item['nombres'].' '.$item['apellidos'].'</option>';\n }\n }", "public function selectCliente() {\n $this->consulta2= $this->con->query(\"SELECT * FROM usuarios WHERE privilegio = 4 ORDER BY apellido,nombre ASC\");\n while ($this->datos2= $this->consulta2->fetch_array()) {\n ?>\n <option value=\"<?php echo $this->datos2['idUsuario']; ?>\"><?php echo $this->datos2['apellido'].\", \".$this->datos2['nombre']; ?></option>\n <?php\n }\n $this->con->close();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retuns the User Service.
private function getUserService() { if (!$this->userService) { $this->userService = $this->get('UserService'); } return $this->userService; }
[ "public function getUserService()\n {\n return $this->getService('user');\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 }", "public function getUserService()\n {\n if (null === $this->userService) {\n $this->userService = new UserService(\n $this->client,\n $this->inputDispatcher,\n $this->outputVisitor,\n $this->requestParser\n );\n }\n\n return $this->userService;\n }", "public function getUserService()\n {\n return $this->userService;\n }", "private function getServiceUser()\n {\n return $this->container->get('app_service_user');\n }", "protected function getUserService()\n {\n return $this->services['user'] = new \\phpbb\\user(${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, '\\\\phpbb\\\\datetime');\n }", "protected function getCurrentuserService()\n {\n return $this->services['currentuser'] = new \\SRC\\CurrentUser($this->get('usersstorage'));\n }", "public function getUserService();", "public function getUserService()\n {\n if (! $this->userService) {\n $this->userService = $this->getServiceLocator()->get('playgrounduser_user_service');\n }\n \n return $this->userService;\n }", "protected function getService_UsersService()\n {\n return $this->services['service.users'] = new \\SRC\\Service\\Users($this->get('usersstorage'), $this->get('rolesstorage'), $this->get('currentuser'));\n }", "protected function getSessionUserService()\n {\n return $this->services['App\\\\Service\\\\SessionUser'] = new \\App\\Service\\SessionUser();\n }", "function getServiceUser() \n {\n return $this->serviceUser;\n }", "public static function getInstance()\n {\n // check for current object for requested class object\n if (!isset(self::$_instance) || null === self::$_instance)\n {\n // set singleton instance\n self::$_instance = new User_Service_User;\n }\n \n // return service instance\n return self::$_instance;\n }", "private function getServiceItemUser()\n {\n return $this->container->get('app_service_item_user');\n }", "protected function _getSearchService()\n\t{\n\t\t$userIdParam = $this->_getParam('user');\n\t\treturn $this->getServiceLocator()->get('user_search_service')->singular(!empty($userIdParam));\n\t}", "protected function getAction_UsersService()\n {\n return $this->services['action.users'] = new \\SRC\\Action\\Users($this->get('service.users'), $this->get('auth0'), $this->get('currentuser'));\n }", "protected function getSecurity_UserCheckerService()\n {\n return $this->services['security.user_checker'] = new \\Symfony\\Component\\Security\\Core\\User\\UserChecker();\n }", "protected function getFosUser_UserCheckerService()\n {\n return $this->services['fos_user.user_checker'] = new \\Symfony\\Component\\Security\\Core\\User\\UserChecker();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register the "pluggables:migrate" console command.
protected function registerMigrateCommand() { $this->app->singleton('pluggables.migrate', function ($app) { return new Console\PluggableMigrateCommand($app['migrator'], $app['pluggables']); }); }
[ "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.extention.migrate', function ($app) {\n return new \\Deadlyviruz\\Extentions\\Console\\Commands\\ExtentionMigrateCommand($app['migrator'], $app['extentions']);\n });\n\n $this->commands('command.extention.migrate');\n }", "protected function registerMigrateCommand(): void\n {\n $this->app->singleton('orchestra.commands.tenanti.migrate', static function () {\n return new MigrateCommand();\n });\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.jlourenco:migrate', function() {\n return new MigrateCommand();\n });\n $this->commands('command.jlourenco:migrate');\n }", "protected function registerMigrateCommand() {\n\n $this->app->bindShared('zipcode.migrate', function ($app) {\n\n return new MigrateCommand(\n $app['config'],\n $app['zipcode.migration-builder'],\n $app['zipcode.migration-publisher']\n );\n\n });\n\n $this->commands('zipcode.migrate');\n\n }", "protected function registerMigrationsCommand()\n {\n $this->app['dbe::migrations'] = $this->app->share(function()\n {\n return new Commands\\MigrationsGeneratorCommand($this->handler);\n });\n }", "private function registerMigrations()\n {\n if ($this->app->runningInConsole() && $this->shouldMigrate()) {\n $this->loadMigrationsFrom(__DIR__.'/Storage/migrations');\n }\n }", "protected function registerMigrations(): void\n {\n if (! $this->app->runningInConsole()) {\n return;\n }\n\n if (! class_exists('AddLdapColumnsToUsersTable')) {\n $this->publishes([\n __DIR__.'/../database/migrations/add_ldap_columns_to_users_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_add_ldap_columns_to_users_table.php'),\n ], 'migrations');\n }\n }", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "protected function registerMigrateResetCommand()\n {\n $this->registerCommand('migrate-reset', function($app) {\n return new MigrateResetCommand($app['arcanedev.moduly'], $app['files'], $app['migrator']);\n });\n }", "private function registerCommands()\n {\n $this->app->singleton('laravel-broadway::event-store::migrate', function () {\n return new CreateEventStoreCommand();\n });\n\n $this->commands('laravel-broadway::event-store::migrate');\n }", "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "protected function registerInstallCommand() {\n\t\t$this->app->singleton('command.baum.install', function ($app) {\n\t\t\t$migrator = new MigrationGenerator($app['files']);\n\t\t\t$modeler = new ModelGenerator($app['files']);\n\n\t\t\treturn new InstallCommand($migrator, $modeler);\n\t\t});\n\t}", "private function registerInstallCommand()\n {\n $this->app->singleton('command.hesto.bulma.install', function ($app) {\n return $app['Hesto\\LaravelBulma\\Commands\\BulmaInstallCommand'];\n });\n\n $this->commands('command.hesto.bulma.install');\n }", "private function registerInstallCommand()\n {\n $this->app->singleton('command.hesto.adminlte.install', function ($app) {\n return $app['Hesto\\Adminlte\\Commands\\AdminlteInstallCommand'];\n });\n\n $this->commands('command.hesto.adminlte.install');\n }", "protected function registerListCommand()\n {\n $this->app->singleton('pluggables.list', function ($app) {\n return new Console\\PluggableListCommand($app['pluggables']);\n });\n }", "function my_plugin_register_migrations() {\n\n var_dump(defined('WP_CLI') && WP_CLI);\n // Boot the CLI interface\n if(!class_exists('\\IgniteKit\\WP\\Migrations\\CLI\\Boot')) {\n return;\n }\n \\IgniteKit\\WP\\Migrations\\CLI\\Boot::start();\n\n // Register the migrations table migration\n \\SBC\\Database\\CreateMigrationsTable::register();\n\n // Register the other migrations\n // NOTE: The squence is important!\n \\SBC\\Database\\Migrations\\CreateFruitsTable::register();\n // ... other\n\n}", "protected function registerMigrations()\n {\n if (TaivasAPM::$runsMigrations && $this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the webmaster for the feed.
public function setWebmaster($webmaster) { $this->webmaster = (string) $webmaster; }
[ "protected function setWebMasterTags()\n {\n if(!isset($this->config['webmaster_tags'])) {\n return;\n }\n foreach ($this->config['webmaster_tags'] as $name => $value):\n if (!empty($value)):\n $meta = array_get($this->webmasterTags, $name, $name);\n $this->addProperty($meta, $value);\n endif;\n endforeach;\n }", "public function setSiteUrl()\n {\n }", "public function setBlogFeed()\n\t{\n\t\t$this->ensureAuthed();\n\t\t$input = Input::getInstance();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$feedurl = $input->getInput('feedurl');\n\n\t\t$userfeed = $feeds->findFeed('user', $this->username);\n\n\t\tif ($userfeed == null)\n\t\t{\n\t\t\t$userfeed = new StdClass();\n\t\t}\n\n\t\t$userfeed->url = $feedurl;\n\t\t$userfeed->user = $this->username;\n\t\t$userfeed->valid = false;\n\t\t$userfeed->checked = false;\n\n\t\t$newfeeds[] = $userfeed;\n\t\t$feedsList = $feeds->getFeeds();\n\t\tforeach ($feedsList as $feed)\n\t\t{\n\t\t\tif ($feed->user != $this->username)\n\t\t\t{\n\t\t\t\t$newfeeds[] = $feed;\n\t\t\t}\n\t\t}\n\n\t\t$feeds->putFeeds($newfeeds);\n\t\t$output->setOutput('feedurl', $feedurl);\n\t\treturn true;\n\t}", "public function setBrowser($browser) { return $this->_browser_name = $browser; }", "protected function setSiteName() {\r\n\t\t$this->siteName = trim($this->settings['site']['siteName']);\r\n\t}", "public function setMasterUrl($value)\n {\n $this->setProperty(\"MasterUrl\", $value, true);\n }", "public function setWeb(string $web = null) : CNabuDataObject\n {\n $this->setValue('nb_user_web', $web);\n \n return $this;\n }", "public function setBrowser($browser)\n {\n $this->_browser_name = $browser;\n }", "public function setURL($url) {\n\t\t\t$this->feedURL = $url;\n\t\t}", "public function yandex_webmaster_code() {\n\n\t\t\tif ( mb_strlen($this->yandex_webmaster_id) > 0 ) {\n\t\t\t\tprintf( '<meta name=\"yandex-verification\" content=\"%s\" />',\n\t\t\t\t\t$this->yandex_webmaster_id );\n\t\t\t}\n\n\t\t\t// yandex_webmaster_code\n\t\t}", "public function setWebmasters($webmasters)\n {\n $this->webmasters = [];\n\n if (is_array($webmasters)) {\n foreach ($webmasters as $email) {\n $this->addWebmaster($email);\n }\n\n return;\n }\n\n $this->addWebmaster($webmasters);\n }", "public static function setSiteName() {\n define('SB_SITE_NAME', Config::get('site_name'));\n }", "function setBrowser($browser) {\n $this->_browser = $browser;\n }", "public function site_owner() {\n\t\t$app_id = Helper::get_settings( 'titles.facebook_app_id' );\n\t\tif ( 0 !== absint( $app_id ) ) {\n\t\t\t$this->tag( 'fb:app_id', $app_id );\n\t\t\treturn;\n\t\t}\n\n\t\t$admins = Helper::get_settings( 'titles.facebook_admin_id' );\n\t\tif ( '' !== trim( $admins ) ) {\n\t\t\t$this->tag( 'fb:admins', $admins );\n\t\t\treturn;\n\t\t}\n\t}", "function setBrowser($browser)\n {\n $this->_browser = $browser;\n }", "public function setWebsiteName(string $name) {\n if (strlen($name) != 0) {\n $this->websiteName = $name;\n $this->setTitle($this->getTitle());\n }\n }", "protected function setWebsite($website) {\r\n $this->website = $website;\r\n }", "public function google_webmaster_code() {\n\n\t\t\tif ( mb_strlen($this->google_webmaster_id) > 0 ) {\n\t\t\t\tprintf( '<meta name=\"google-site-verification\" content=\"%s\" />',\n\t\t\t\t\t$this->google_webmaster_id );\n\t\t\t}\n\n\t\t\t// google_webmaster_code\n\t\t}", "public function setOwner($args, $assoc_args) {\n $site = $this->sites->get(\n Input::siteName(array('args' => $assoc_args))\n );\n $workflow = $site->setOwner($assoc_args['set']);\n $workflow->wait();\n $this->workflowOutput($workflow);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
input $numArr output $sortedArr use merge sort using recursion to devide to small similar problem complexity: time nlog(n), use more memory
function mergesort ($numArr) { if (count($numArr) <=1 ) { return $numArr; } else { $midIndex = floor(count($numArr) / 2); $left = array_slice($numArr, 0, $midIndex); $right = array_slice($numArr, $midIndex); $sortedLeft = mergesort($left); $sortedRight = mergesort($right); return merge($sortedLeft, $sortedRight); } }
[ "function mergeSort(&$array)\n{\n $elementsNumber = count($array);\n // base condition to break the recursion\n if ($elementsNumber < 2) {\n return;\n }\n\n // calculate the middle index to split the array into two halves.\n $middleIndex = floor($elementsNumber/2);\n\n // create the left sub-array\n for ($i = 0; $i < $middleIndex; $i++) {\n $leftSubArray[] = $array[$i];\n }\n // create the right sub-array\n for ($i = $middleIndex; $i < $elementsNumber; $i++) {\n $rightSubArray[] = $array[$i];\n }\n mergeSort($leftSubArray);\n mergeSort($rightSubArray);\n merge($leftSubArray, $rightSubArray, $array);\n}", "function mergesort(&$array, $cmp_function) \n{\n //base case, end\n if ( count( $array ) <= 1 ) \n {\n \treturn;\n }\n else\n {\n \n\t\t//find middle, get two arrays, recursive call\n\t\t$middle = count( $array ) / 2;\n\t\t$array1 = array_slice($array, 0, $middle);\n\t\t$array2 = array_slice($array, $middle);\n\t\n\t\tmergesort($array1, $cmp_function);\n\t\tmergesort($array2, $cmp_function);\n\t\t\n\t\t//if the arrays are sorted\n\t\tif ( call_user_func( $cmp_function, end( $array1 ), $array2[0] ) < 1 ) \n\t\t{\n\t\t\t$array = array_merge($array1, $array2);\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t//populate the array\n\t\t\t$array = array();\n\t\t\t$currIndex1 = 0;\n\t\t\t$currIndex2 = 0;\n\t\t\t\n\t\t\t//while both arrays still have values\n\t\t\twhile ($currIndex1 < count( $array1 ) && $currIndex2 < count($array2) ) \n\t\t\t{\n\t\t\t\n\t\t\t\t// call my comparison function to sort them\n\t\t\t\tif (call_user_func( $cmp_function, $array1[$currIndex1], $array2[$currIndex2] ) < 1) \n\t\t\t\t{\n\t\t\t\t\t$array[] = $array1[$currIndex1++];\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$array[] = $array2[$currIndex2++];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// find out which array still has values, and fill the rest in\n\t\t\tif ( $currIndex1 < count( $array1 ) )\n\t\t\t{\n\t\t\t\n\t\t\t\twhile ( $currIndex1 < count($array1) ) \n\t\t\t\t{\n\t\t\t\t\t$array[] = $array1[$currIndex1++];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\twhile ( $currIndex2 < count($array2) ) \n\t\t\t\t{\n\t\t\t\t\t$array[] = $array2[$currIndex2++];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n}", "function merge_sort($array){\r\n if(count($array) == 1){\r\n return $array;\r\n }\r\n \r\n $mid = floor(count($array) / 2);\r\n $left = array_slice($array, 0, $mid);\r\n $right = array_slice($array, $mid);\r\n $left = merge_sort($left);\r\n $right = merge_sort($right);\r\n \r\n return merge($left, $right);\r\n}", "function merge_sort(&$array, $start, $end) {\n if ( $start < $end ) {\n $mid = floor(($start + $end) / 2);\n\n merge_sort($array, $start, $mid);\n merge_sort($array, ($mid + 1), $end);\n\n merge($array, $start, $mid, $end);\n }\n }", "public function mergeSort ()\n\t{\n\t\t$this->__mergeSort( 0, sizeof( $this->array ) - 1 );\n\t}", "function merge_sort($my_array) {\r\n\t\tif (count ( $my_array ) == 1)\r\n\t\t\treturn $my_array;\r\n\t\t\r\n\t\t$mid = count ( $my_array ) / 2;\r\n\t\t$left = array_slice ( $my_array, 0, $mid );\r\n\t\t$right = array_slice ( $my_array, $mid );\r\n\t\t\r\n\t\t$left = $this->merge_sort ( $left );\r\n\t\t$right = $this->merge_sort ( $right );\r\n\t\t\r\n\t\treturn $this->merge ( $left, $right );\r\n\t}", "function bubbleSort($arr, $idxArr){\r\n $sorted = [];\r\n $arrCount = count($arr);\r\n for( $i=0; $i < $arrCount; $i++ ){\r\n for ($j=0; $j < $arrCount-1-$i; $j++) {\r\n if( $arr[$j+1] < $arr[$j] ){\r\n swapNum($arr, $j, $j+1);\r\n swapNum($idxArr, $j, $j+1);\r\n }\r\n }\r\n }\r\n $sorted[\"numArray\"] = $arr;\r\n $sorted[\"idxArray\"] = $idxArr;\r\n return $sorted;\r\n }", "function shakerSort(array $array)\n{\n $myCount = 0;\n $size = count($array) - 1;\n\n do{\n $swapped = false;\n for ($i = 0; $i < $size - 1; $i++){\n if ($array[$i + 1] < $array[$i]){\n $tmp = $array[$i];\n $array[$i] = $array[$i + 1];\n $array[$i + 1] = $tmp;\n $swapped = true;\n }\n $myCount++;\n }\n\n if ($swapped == false) break;\n\n $swapped = false;\n for ($j = $size; $j > 0; $j--){\n if ($array[$j] < $array[$j - 1]){\n $tmp = $array[$j];\n $array[$j] = $array[$j - 1];\n $array[$j - 1] = $tmp;\n $swapped = true;\n }\n $myCount++;\n }\n } while ($swapped);\n\n echo $myCount;\n return $array;\n}", "function countingSort(array $arr)\n{\n $n = sizeof($arr);\n $p = array();\n $sorted = array();\n\n for ($i = 0; $i < $n; $i++) {\n $p[$i] = 0;\n }\n\n for ($i = 0; $i < $n; $i++) {\n for ($j = $i + 1; $j < $n; $j++) {\n if ($arr[$i] > $arr[$j]) {\n $p[$i]++;\n } else {\n $p[$j]++;\n }\n }\n } \n\n for ($i = 0; $i < $n; $i++) {\n $sorted[$p[$i]] = $arr[$i];\n }\n\n return $sorted;\n}", "function sorting_by_insertion_sort_algo($amount_of_number){\n\t\n\t//=========================\n\t\n\t//get a collection of unsorted numbers\n\t$unsorted_number_arr = unsorted_num_generator($amount_of_number);\n\n\t//print those unsorted number\n\techo \"Unsorted state <br/>\";\n\techo \"<pre>\";\n\tprint_r($unsorted_number_arr);\n\n\n\tfor($i=1; $i<$amount_of_number; $i++){\n\t\t$counter = $i;\n\t\t\n\t\t//sorting will take place here\n\t\twhile($counter > 0 && $unsorted_number_arr[$counter] < $unsorted_number_arr[$counter-1]){\n\t\t\t$smallest_num = $unsorted_number_arr[$counter];\n\t\t\t\n\t\t\t$unsorted_number_arr[$counter] = $unsorted_number_arr[$counter-1];\n\t\t\t\n\t\t\t$unsorted_number_arr[$counter-1] = $smallest_num;\n\t\t\t\n\t\t\t\n\t\t\t$counter--;\n\t\t\t\n\t\t}\n\t}\n\n\techo \"Sorted state <br/>\";\n\techo \"<pre>\";\n\tprint_r($unsorted_number_arr);\n\n\n\t\n\t//=========================\n\t\n\t\n}", "public static function bubble_sort_for_num($arr, $num)\n {\n\n for($i =1 ;$i < $num ;$i++)\n {\n for($j = 1 ;$j < ($num) ;$j++)\n {\n if($arr[$j-1] > $arr[$j])\n {\n $temp = $arr[$j -1];\n $arr[$j-1] = $arr[$j];\n $arr[$j] = $temp;\n }\n \n }\n\n }\n echo \"printing the sorted array : [ \";\n for($k =0; $k < sizeof($arr) ;$k++)\n {\n echo $arr[$k].\" \";\n }\n echo \"]\\n\";\n }", "function combSort(array $array)\n{\n $myCount = 0;\n $size = count($array);\n $gap = count($array);\n $swap = true;\n\n while ($gap > 1 || $swap){\n if ($gap > 1){\n $gap /= 1.25;\n }\n $swap = false;\n $i = 0;\n\n while (($i + $gap) < $size){\n if ($array[$i] > $array[$i + $gap]){\n $tmp = $array[$i];\n $array[$i] = $array[$i + $gap];\n $array[$i + $gap] = $tmp;\n }\n $i++;\n $myCount++;\n }\n }\n\n echo $myCount;\n return $array;\n}", "function timsort(&$array, callable $compare = null, $lo = null, $hi = null)\n{\n if ($compare === null) {\n $compare = __NAMESPACE__.'\\\\_sortDirectCompare';\n }\n if ($lo === null) {\n $lo = 0;\n }\n if ($hi === null) {\n $hi = \\count($array);\n }\n $remaining = $hi - $lo;\n // The array is already sorted\n if ($remaining < 2) {\n return;\n }\n $runLength = 0;\n\n // On small arrays binary sort can be used directly\n if ($remaining < DEFAULT_MIN_MERGE) {\n $runLength = makeAscendingRun($array, $lo, $hi, $compare);\n binaryInsertionSort($array, $lo, $hi, $lo + $runLength, $compare);\n\n return;\n }\n\n $ts = new TimSortMergeState($array, $compare);\n $minRun = minRunLength($remaining);\n do {\n $runLength = makeAscendingRun($ts->array, $lo, $hi, $compare);\n if ($runLength < $minRun) {\n $force = $remaining;\n if ($force > $minRun) {\n $force = $minRun;\n }\n\n binaryInsertionSort($ts->array, $lo, $lo + $force, $lo + $runLength, $compare);\n $runLength = $force;\n }\n\n // Push new run and merge if necessary\n $ts->pushRun($lo, $runLength);\n $ts->mergeRuns();\n\n // Go find next run\n\n $remaining -= $runLength;\n $lo += $runLength;\n } while ($remaining !== 0);\n\n $ts->forceMergeRuns();\n $array = $ts->array;\n}", "function natsort (array &$array) {}", "function quicksort($arr) {\n // We return if the array is less than or equal to one, cause you cant sort\n // an array this small!\n if (count($arr) <= 1) {\n return $arr;\n } \n\n // Let's split our results into left and right partitions. \n $leftPartion = [];\n $rightPartition = [];\n $pivot = $arr[0];\n\n // Start $i at 1 so we dont have to repeat our pivot\n\n for ($i=1; $i<count($arr); $i++) {\n if ($arr[$i] < $pivot) {\n $leftPartion[] = $arr[$i];\n }\n else {\n $rightPartition[] = $arr[$i];\n }\n }\n\n var_dump(\"iteration: \" . $i);\n var_dump($leftPartion);\n\n // Merges the left partition, pivot, and right partition into one array\n $merged = array_merge(quicksort($leftPartion), [$pivot], quicksort($rightPartition));\n return $merged;\n}", "function shellSort(array $arr) {\n $len = count($arr);\n\n // calculate the first 25 pratt numbers\n $gaps = array(1);\n $last2 = $last3 = 0;\n\n for ($i = 1; $i < 25; $i++) {\n $tmp2 = floor($gaps[$last2] * 2);\n $tmp3 = floor($gaps[$last3] * 3);\n\n if ($tmp2 < $tmp3) {\n $gaps[] = $tmp2;\n $last2++;\n } else if ($tmp2 > $tmp3) {\n $gaps[] = $tmp3;\n $last3++;\n } else {\n $gaps[] = $tmp2;\n $last2++;\n $last3++;\n }\n }\n \n $gap = array_pop($gaps);\n\n while ($gap > 0) {\n for ($i = $gap; $i < $len; $i++) {\n $tmp = $arr[$i];\n $j = $i;\n\n while ($j >= $gap && ( $arr[$j-$gap] > $tmp )) {\n $arr[$j] = $arr[$j-$gap];\n $j -= $gap;\n }\n\n $arr[$j] = $tmp;\n }\n\n $gap = array_pop($gaps);\n }\n\n return $arr;\n}", "function selectionSort(){\n $j=0;\n $k=0;\n $elapsedTime = '';\n $startTime = '';\n $endTime = '';\n $min = 0;\n $max = 0;\n $ifElseCount = 0;\n\n\n set_time_limit(0);\n\n $startTime= microtime(true);\n \n // $arrayForSort=[10,1,5,7,6,8,4,3,2,9];\n\n for ($j=0; $j<10000; $j++){\n $arrayForSort[$j] = rand(0,10000);\n }\n\n //Set min / max to values in the array, in case none of them are 0!\n $min = $arrayForSort[0];\n $max = $arrayForSort[0];\n $arraySize = 0;\n \n $arraySize = count($arrayForSort)-1;\n\n \n //Find the minimum & maximum\n\n do{\n for($j=0; $j<($arraySize); $j++){\n if ($arrayForSort[$j]>$arrayForSort[$k]){\n $temp = $arrayForSort[$k];\n $arrayForSort[$k] = $arrayForSort[$j];\n $arrayForSort[$j]=$temp;\n $ifElseCount ++;\n }else if($arrayForSort[$j] < $min){\n $min = $arrayForSort[$j];\n $temp = array_shift($arrayForSort); //array_shift puts the value in [0] to $temp\n array_push($arrayForSort, $temp); //add the item formerly in [0]\n $ifElseCount ++; \n }else if($arrayForSort[$j] > $max){\n $max = $arrayForSort[$j];\n array_splice($arrayForSort, $j,1); //remove max\n array_push($arrayForSort, $max); //you removed max, now add it at the end\n $ifElseCount ++;\n }else{\n $ifElseCount++;\n }\n }\n \n \n $k++; \n } while ($k<count($arrayForSort));\n\n \n $endTime=microtime(true);\n $elapsedTime = $endTime - $startTime;\n\n echo (\"Sort completed in \" . $elapsedTime . \" seconds. Using \" .$ifElseCount . \" if / else evaluations\");\n \n var_dump($arrayForSort);\n \n }", "static function insertionsort_int($arr,$n){\n for($i=1;$i<$n;$i++) \n { \n $key=$arr[$i]; \n $j=$i-1; \n // Move elements of arr[0..i-1], \n // that are greater than key, to \n // one position ahead of their \n // current position \n while($j>=0 && $arr[$j]>$key) \n { \n $arr[$j+1]=$arr[$j]; \n $j=$j-1; \n } \n $arr[$j+1]=$key; \n } \n //print sorted integers\n echo \"Sorted Integers are:\\n\";\n for($i=0;$i<$n;$i++){\n echo $arr[$i].\" \\n\";\n }\n }", "function sortArray(array $arr) : array {\n $oddNumsArr = [];\n $positionsArr = [];\n for($i = 0; $i < count($arr); $i++) { \n if($arr[$i] % 2 !== 0) { \n array_push($oddNumsArr, $arr[$i]);\n array_push($positionsArr, $i);\n }\n }\n\n \n sort($oddNumsArr);\n $newArrAnswer = array_combine($positionsArr, $oddNumsArr);\n $result = array_replace($arr, $newArrAnswer);\n return $result;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a video reference The first video is given priority by the Open Graph protocol spec. Implementors may choose a different video based on size requirements or preferences.
public function addVideo( OpenGraphProtocolVideo $video ) { $video_url = $video->getURL(); if ( empty($video_url) ) return; $video->removeURL(); $value = array( $video_url, array($video) ); if ( ! isset( $this->video ) ) $this->video = array( $value ); else $this->video[] = $value; return $this; }
[ "public function addVideo(VideoMedia $video);", "function addVideo($name='video') {\n\n $field = (new Fields\\Video($name));\n return $this->addField($field);\n\n }", "function mrss_add_video( $media ) {\n\t\tglobal $post;\n\n\t\t$video = wpseo_get_value( 'video_meta', $post->ID );\n\n\t\tif ( !$video || $video == 'none' )\n\t\t\treturn $media;\n\n\t\t$video_duration = wpseo_get_value( 'videositemap-duration', $post->ID );\n\t\tif ( !$video_duration && isset( $video['duration'] ) ) {\n\t\t\t$video_duration = $video['duration'];\n\t\t}\n\n\t\t$item['content']['attr']['url'] = $video['player_loc'];\n\t\t$item['content']['attr']['duration'] = $video_duration;\n\t\t$item['content']['children']['player']['attr']['url'] = $video['player_loc'];\n\t\t$item['content']['children']['title']['attr']['type'] = 'html';\n\t\t$item['content']['children']['title']['children'][] = esc_html( $video['title'] );\n\t\t$item['content']['children']['description']['attr']['type'] = 'html';\n\t\t$item['content']['children']['description']['children'][] = esc_html( $video['description'] );\n\t\t$item['content']['children']['thumbnail']['attr']['url'] = $video['thumbnail_loc'];\n\t\t$item['content']['children']['keywords']['children'][] = implode( ',', $video['tag'] );\n\t\tarray_unshift( $media, $item );\n\n\t\treturn $media;\n\t}", "public function addVideo(\\Inouire\\MininetBundle\\Entity\\Video $video){\n $this->videos[] = $video;\n $video->setPost($this);\n }", "public function add_video($link)\n {\n echo 'to aqui';\n if(!preg_match(\"/vimeo/\", $link)) {\n $vendor = 'youtube';\n } else {\n $vendor = 'vimeo';\n echo $vendor ;\n echo $link;\n }\n if($vendor == 'youtube') {\n if($id = SELF::get_youtube_id($link)) {\n $this->_video_id = $id;\n $this->_video_type = 'youtube';\n return $this->_video_id;\n } else {\n return FALSE;\n }\n } else if($vendor == 'vimeo') {\n \n $id = SELF::get_vimeo_id($link);\n \n echo 'Valor dor Id=';\n echo $id;\n //echo $id;\n \n echo '____entrei =';\n $this->_video_id = $id;\n $this->_video_type = 'vimeo';\n echo $this->_video_id;\n return $this->_video_id;\n \n \n \n } else {\n return FALSE;\n }\n }", "public function addVideo($vodeosource,$width,$height) {\n\t\t\n\t\t$videocode = PHP_EOL.<<<EOT\n\t\t<video width=\"$width\" height=\"$height\" controls=\"controls\" id=\"myvid\">\n\t\t<source src=\"$vodeosource\" type=\"video/mp4;\" >\n\t\t</video>\nEOT;\n\t\t$this->bodycode.=PHP_EOL. $videocode;\n\t\t\n\t}", "function addVideo($vidId,$crsId)\r\n{\r\n\t$yt = new Zend_Gdata_YouTube();\r\n $entry = $yt->getVideoEntry($vidId);\r\n $videoTitle = addslashes($entry->mediaGroup->title);\r\n $videoUrl = $entry->mediaGroup->player[0]->url;\r\n\t//$videoUrl = findFlashUrl($entry);\r\n\t$description = addslashes($entry->mediaGroup->description);\r\n $authorUsername = $entry->author[0]->name;\r\n\t//list($vburl, $rest) = split('[?]', $videoUrl);\r\n\t$upDate = date_create($entry->getUpdated());\r\n\t$lastUpdate = date_format($upDate,'Y-m-d H:i:s');\r\n\t$pubDate = date_create($entry->getPublished());\r\n\t$videoUploaded = date_format($pubDate,'Y-m-d H:i:s');\r\n\t$duration = $entry->mediaGroup->duration->seconds;\r\n\tdb_connect();\r\n\t$foundAuthor = mysqli_num_rows(mysqli_query($db,\"SELECT * FROM `vb_videos` WHERE `crsid_fk` = $crsId AND `author` LIKE '$authorUsername'\"));\r\n\tif($foundAuthor != 0){\r\n\t\t$lastOrder = mysqli_fetch_row(mysqli_query($db,\"SELECT MAX(`vidorder`) FROM `vb_videos` WHERE `crsid_fk` = $crsId AND `author` LIKE '$authorUsername' AND `pubdate` < '$videoUploaded'\"));\r\n\t\t$vidOrder = $lastOrder[0]+1;\r\n\t}\r\n\telse {\r\n\t$lastOrder = mysqli_fetch_row(mysqli_query($db,\"SELECT MAX(`vidorder`) FROM `vb_videos` WHERE `crsid_fk` = $crsId\"));\r\n\t$vidOrder = $lastOrder[0]+1;\r\n\t}\r\n\t\r\n\t// filtering url from un-wanted characters\r\n\t\tif(strpos($videoUrl,\"&\") !== false) $length = strpos($videoUrl,\"&\");\r\n\t\telse $length = strlen($videoUrl);\r\n\t\t$vidUrl = trim(str_replace(\"watch?v=\",\"v/\",substr($videoUrl,0,$length)));\r\n\t\t$insBefore = mysqli_num_rows(mysqli_query($db,\"SELECT `vidid` FROM `vb_videos` WHERE `crsid_fk` = $crsId AND `vidurl` LIKE '$vidUrl'\"));\r\n\t\tif($insBefore == 0){\r\n\t\t\tif($foundAuthor != 0){mysqli_query($db,\"UPDATE `vb_videos` SET `vidorder` = `vidorder`+1 WHERE `crsid_fk` = $crsId AND `vidorder` >= '$vidOrder';\");}\r\n\t\t\t$insertNewLine = mysqli_query($db,\"INSERT INTO `vb_videos` (`crsid_fk`, `vidtitle`, `vidurl`, `vidorder`, `modify_date`, `author`, `desc`, `lastupdate`, `duration`, `pubdate`) VALUES ('$crsId', '$videoTitle', '$vidUrl', '$vidOrder', '\".date(\"Y-m-d H:i:s\").\"', '$authorUsername', '$description', '$lastUpdate', '$duration', '$videoUploaded');\");\r\n\t\t\tif($insertNewLine) echo'<div id=\"popDiv\" class=\"addSucc\"><div style=\"text-align:right\"><a href=\"javascript:closeAd(\\'popDiv\\')\"><img src=\"../../images/close.gif\" border=0 /></a></div><br /><!-- Message Start -->Adding choosed video to course is done successfully!.<!-- Message End --></div>';\r\n\t\t}\r\n\t\telse {echo'<div id=\"popDiv\" class=\"addFail\"><div style=\"text-align:right\"><a href=\"javascript:closeAd(\\'popDiv\\')\"><img src=\"../../images/close.gif\" border=0 /></a></div><br /><!-- Message Start -->Adding choosed video to course is Failed!, it was added before.<!-- Message End --></div>';}\r\n\tdb_disconnect();\r\n}", "public function addVideoToChannel($videoManagerId, $videoId, $channelId);", "public function setVideo($video) {\r\n\t$this->video = $video;\r\n }", "public function add_video($tag, $name=null) {\n\t\treturn $this->add_section($tag, $name, StepSection::VIDEO);\n\t}", "public function addVideoMetaBox()\n\t{\n\t\tadd_meta_box('featured-video', 'Uitgelichte video', [$this, 'renderVideoMetaBox'], 'post', 'advanced', 'high');\n\t}", "function pp_add_series_video() {\n $user_id = get_current_user_id();\n\n $is_series = get_post_meta( get_the_ID(), 'series_id', true );\n $video = get_post_meta( get_the_ID(), 'pp_mp4', true );\n \n /**\n * Premium video\n */\n if ( has_post_format( 'video' ) ) : ?>\n <div id=\"post-video\">\n <?php\n if( strpos( $video, home_url() ) === false ) {\n echo wp_oembed_get( $video, array( 'width' => 720 ) ); \n } else {\n echo do_shortcode( '[video width=\"720\" src=\"' . $video . '\"]' ); \n }\n ?>\n </div>\n\n <?php endif; \n}", "public function addVideo($title, $vID, $sID=\"vimSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $type=\"Generic\", $thumb=\"tn\", $frame=\"fr-img\", $ro_dir=\"Director\", $ro_dp=\"DP\", $ro_cam=\"Camera\", $ro_ed=\"Editor\", $desc=\"Long description\"){\n $this->videoList[] = new cShowcaseVideo($title, $vID, $sID, $hdID, $sdID, $mobileID, $type, $thumb, $frame, $ro_dir, $ro_dp, $ro_cam, $ro_ed, $desc);\n }", "function add_video_metaboxes() {\n add_meta_box(\n\t\t'video_url',\n\t\t'Video URL',\n\t\t'video_url_function',\n\t\t'easyvideo',\n\t\t'normal',\n\t\t'default'\n\t);\n}", "public function storeVideo(StoreVideoRequest $request)\n {\n $course = Course::findByHashidOrFail($request->course_id);\n\n $data = [\n 'en' => ['title' => $request->title_en,'body_focus' => $request->body_focus_en],\n 'ar' => ['title' => $request->title_ar,'body_focus' => $request->body_focus_ar]\n ];\n $video = $course->videos()->create($data);\n $video->addMedia($request->video)->toMediaCollection('video');\n // return $video->getFirstMediaUrl('video');\n return $this->dataResponse(null,trans('all.submitted'),200);\n }", "function royal_add_video_post_meta_box() {\n\t\tadd_meta_box(\n\t\t\t'royal_video_post_meta_box',\n\t\t\tesc_html__( 'Post Format: Video', 'hyperx' ),\n\t\t\t'royal_display_video_post_meta_box',\n\t\t\t'post',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'royal_video_post_meta_box',\n\t\t\tesc_html__( 'Post Format: Video', 'hyperx' ),\n\t\t\t'royal_display_video_post_meta_box',\n\t\t\t'royal_portfolio',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}", "function cl_video_tag($source, $options = array())\n {\n $source = preg_replace('/\\.(' . implode('|', default_source_types()) . ')$/', '', $source);\n\n $source_types = Cloudinary::option_consume($options, 'source_types', array());\n $source_transformation = Cloudinary::option_consume($options, 'source_transformation', array());\n $fallback = Cloudinary::option_consume($options, 'fallback_content', '');\n\n if (empty($source_types)) {\n $source_types = default_source_types();\n }\n $video_options = $options;\n\n if (array_key_exists('poster', $video_options)) {\n if (is_array($video_options['poster'])) {\n if (array_key_exists('public_id', $video_options['poster'])) {\n $video_options['poster'] = cloudinary_url_internal(\n $video_options['poster']['public_id'],\n $video_options['poster']\n );\n } else {\n $video_options['poster'] = cl_video_thumbnail_path($source, $video_options['poster']);\n }\n }\n } else {\n $video_options['poster'] = cl_video_thumbnail_path($source, $options);\n }\n\n if (empty($video_options['poster'])) {\n unset($video_options['poster']);\n }\n\n\n $html = '<video ';\n\n if (!array_key_exists('resource_type', $video_options)) {\n $video_options['resource_type'] = 'video';\n }\n $multi_source = is_array($source_types);\n if (!$multi_source) {\n $source .= '.' . $source_types;\n }\n $src = cloudinary_url_internal($source, $video_options);\n if (!$multi_source) {\n $video_options['src'] = $src;\n }\n if (isset($video_options[\"html_width\"])) {\n $video_options['width'] = Cloudinary::option_consume($video_options, 'html_width');\n }\n if (isset($video_options['html_height'])) {\n $video_options['height'] = Cloudinary::option_consume($video_options, 'html_height');\n }\n $html .= Cloudinary::html_attrs($video_options) . '>';\n\n if ($multi_source) {\n foreach ($source_types as $source_type) {\n $transformation = Cloudinary::option_consume($source_transformation, $source_type, array());\n $transformation = array_merge($options, $transformation);\n $src = cl_video_path($source . '.' . $source_type, $transformation);\n $video_type = (($source_type == 'ogv') ? 'ogg' : $source_type);\n $mime_type = \"video/$video_type\";\n $html .= '<source ' . Cloudinary::html_attrs(array('src' => $src, 'type' => $mime_type)) . '>';\n }\n }\n\n $html .= $fallback;\n $html .= '</video>';\n\n return $html;\n }", "function addVideoObject()\n\t{\n\t\t//global $tpl;\n\n\t\t$this->checkPermission(\"write\");\n\t\t\n\t\t$this->initAddVideoForm();\n\t\t$this->tpl->setContent($this->form_gui->getHTML());\n\t}", "private function add_video_definition($mform) {\n $addinstance = empty($this->current->entry_id) ? true : false;\n\n $thumbnail = $this->get_thumbnail_markup(!$addinstance);\n\n $videopreview = $this->get_iframe_video_preview_markup($addinstance);\n\n $mform->addElement('static', 'add_video_thumb', '&nbsp;', $thumbnail);\n $mform->addElement('html', $videopreview);\n\n $videogroup = array();\n if ($addinstance) {\n $videogroup[] =& $mform->createElement('button', $this->addvideobutton, get_string('add_video', 'kalvidres'));\n } else {\n $videogroup[] =& $mform->createElement('button', $this->addvideobutton, get_string('replace_video', 'kalvidres'));\n }\n\n $mform->addGroup($videogroup, 'video_group', '&nbsp;', '&nbsp;', false);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints the script with the calendar settings. NOTE: This script is equivalent to use the wp_localize_script(), but adding an id attribute to the script tag. This id is necessary to identify the script to refresh on the update_order_review_fragments action.
public function print_calendar_settings() { $settings = ( $this->needs_date() ? $this->get_calendar_settings() : array() ); ?> <script id="wc_od_checkout_l10n" type="text/javascript"> /* <![CDATA[ */ var wc_od_checkout_l10n = <?php echo wp_json_encode( $settings ); ?>; /* ]]> */ </script> <?php }
[ "protected function renderScript()\n {\n if (!$this->params['options']['datepicker']) {\n $this->getJS()->ready(\"\n $('#{$this->id}_day, #{$this->id}_month, #{$this->id}_year').change(function(){\n var day = $('#{$this->id}_day').val() || '1';\n var month = $('#{$this->id}_month').val() || '1';\n var year = $('#{$this->id}_year').val() || new Date().getFullYear();\n\n $('#{$this->id}').val(day + '/' + month + '/' + year);\n });\n\n $('#{$this->id}').change(function(){\n var cal = $(this).val().split('/');\n\n $('#{$this->id}_day').val(cal[0]);\n $('#{$this->id}_month').val(cal[1]);\n $('#{$this->id}_year').val(cal[2]);\n });\n \");\n\n return;\n }\n\n $this->getJS()->ready('$( \"#' . $this->id . '\").pickadate(' . json_encode($this->params['options']) . ');');\n }", "public function printScripts()\n {\n $ts = current_time('timestamp');\n $config = array(\n 'isActive' => true,\n 'showFrom' => $ts - 864000,\n 'showUntil' => $ts + 864000,\n 'cookieId' => 'lbwpInfoBanner_v' . $this->config['infoBannerVersion']\n );\n\n echo '\n <script type=\"text/javascript\">\n lbwpInfoBannerConfig = ' . json_encode($config) . ';\n </script>\n <div class=\"lbwp-info-banner\" style=\"display:none;\">\n <div class=\"info-banner-content\">\n ' . wpautop($this->config['infoBannerContent']) . '\n </div>\n <a href=\"#\" class=\"lbwp-close-info-banner\">\n <span>' . $this->config['infoBannerButton'] . '</span>\n </a>\n </div>\n ';\n }", "function calendar() {\n\t\tglobal $root;\n\t\t\n\t\treturn \"<script src=\\\"\" . $root . \"system/javascripts/common/datePicker.js\\\" type=\\\"text/javascript\\\"></script>\n<link rel=\\\"stylesheet\\\" href=\\\"\" . $root . \"system/styles/common/datePicker.css\\\" type=\\\"text/css\\\">\";\n\t}", "public function renderScriptElements()\n\t{\n\t\tglobal $ff_context;\n\n\t\t?>\n\t\t<script src=\"<?= ff_esc($this->clientAPI) ?>?hl=<?= ff_esc($ff_context->getLanguage()->languageCode()) ?>\" async defer></script>\n\t\t<?php\n\t}", "public static function analytics_script() {\n\t\t$id = get_theme_mod( 'FCN_analytics_account' );\n\n\t\t$script = \"<script type=\\\"text/javascript\\\">\n\t\t\tvar _gaq = _gaq || [];\n\t\t\tvar pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';\n\t\t\t_gaq.push(['_require', 'inpage_linkid', pluginUrl]);\n\t\t\t_gaq.push(['_setAccount', '$id']);\n\t\t\t_gaq.push(['_trackPageview']);\n\t\t\t(function() {\n \t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n \t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n \t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n \t\t\t})(); </script>\";\n\t\n\t\tif (get_theme_mod( 'FCN_analytics_account' ) != '' ) \n\t\t{\n\t\t\techo $script;\n\t\t}\n\t}", "function print_script() {\n\t\t$settings = $this->get_settings();\n\t\tforeach ( $settings as $key => $setting ){\n\t\t\tif ( ! empty( $setting['customstylescript'] ) ) \n\t\t\t\techo $setting['customstylescript'];\n\t\t}\n\t}", "function displayScript() {\n $ss = new Sugar_Smarty();\n $ss->assign('saving', $this->dashletStrings['LBL_SAVING']);\n $ss->assign('saved', $this->dashletStrings['LBL_SAVED']);\n $ss->assign('id', $this->id);\n $ss->assign('height', $this->height);\n $ss->assign('clearLbl', $this->dashletStrings['LBL_CLEAR']);\n $ss->assign('clearToolTipLbl', $this->dashletStrings['LBL_CLEAR_TOOLTIP']);\n $ss->assign('runLbl', $this->dashletStrings['LBL_FILTER']);\n $ss->assign('runToolTipLbl', $this->dashletStrings['LBL_FILTER_TOOLTIP']);\n $ss->assign('sinceLbl', $this->dashletStrings['LBL_SINCE']);\n $ss->assign('selectQueryLbl', $this->dashletStrings['LBL_SELECT_QUERY']);\n $ss->assign('chooseDateTooltip', $this->dashletStrings['LBL_CHOOSE_DATE_TOOLTIP']);\n $comboData = $this->tReporter->getComboData();\n $dateDependentQueries = $this->tReporter->getDateDependentQueries();\n $json = getJSONobj();\n $ss->assign('comboData', $json->encode($comboData));\n $ss->assign('dateDependentQueries', $json->encode($dateDependentQueries));\n $str = $ss->fetch('modules/Trackers/Dashlets/TrackerDashlet/TrackerDashletScript.tpl');\n return $str; // return parent::display for title and such\n }", "function callie_britt_options_add_scripts() {\n\t\t$screen = function_exists('get_current_screen') ? get_current_screen() : false;\n\t\tif (is_object($screen) && $screen->id == 'appearance_page_theme_options') {\n\t\t\twp_enqueue_style( 'callie-britt-icons', callie_britt_get_file_url('css/font-icons/css/fontello-embedded.css'), array(), null );\n\t\t\twp_enqueue_style( 'wp-color-picker', false, array(), null);\n\t\t\twp_enqueue_script('wp-color-picker', false, array('jquery'), null, true);\n\t\t\twp_enqueue_script( 'jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true );\n\t\t\twp_enqueue_script( 'jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true );\n\t\t\twp_enqueue_script( 'callie-britt-options', callie_britt_get_file_url('theme-options/theme-options.js'), array('jquery'), null, true );\n\t\t\twp_enqueue_script( 'callie-britt-colorpicker.colors', callie_britt_get_file_url('js/colorpicker/colors.js'), array('jquery'), null, true );\n\t\t\twp_enqueue_script( 'callie-britt-colorpicker', callie_britt_get_file_url('js/colorpicker/jqColorPicker.js'), array('jquery'), null, true );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_dependencies', callie_britt_get_theme_dependencies() );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_color_schemes', callie_britt_storage_get('schemes') );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_simple_schemes', callie_britt_storage_get('schemes_simple') );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_sorted_schemes', callie_britt_storage_get('schemes_sorted') );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_theme_fonts', callie_britt_storage_get('theme_fonts') );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_theme_vars', callie_britt_get_theme_vars() );\n\t\t\twp_localize_script( 'callie-britt-options', 'callie_britt_options_vars', apply_filters('callie_britt_filter_options_vars', array(\n\t\t\t\t'max_load_fonts' => callie_britt_get_theme_setting('max_load_fonts'),\n\t\t\t\t) ) );\n\t\t}\n\t}", "protected function renderInitScript() {\n\t\t$id = $this->attr('id');\n\t\t$script = 'script';\n\t\t$js = \"InputfieldTinyMCE.init('#$id', 'module.render'); \";\n\t\treturn \"<$script>$js</$script>\";\n\t}", "function analytics_script() {\n\t\t\t$ga = get_template_part( 'templates/global/analytics' );\n\n\t\t\t// Theme mod set? Filterable identifier\n\t\t\t$analytics = apply_filters( 'ipress_analytics', get_theme_mod( 'ipress_analytics', $ga ) );\n\n\t\t\t// Test valid identifier\n\t\t\tif ( empty( $analytics ) || !preg_match( '/^UA-/', $analytics ) ) { return; }\n\n\t\t\t// OK, output analytics code\n\t\t\techo sprintf( $ga, $analytics );\n\t\t}", "function get_calendar_snippet($training_start_date)/* v. 1.00 */{\n ?>\n <script type=\"text/javascript\">(function () {\n if (window.addtocalendar)if(typeof window.addtocalendar.start == \"function\")return;\n if (window.ifaddtocalendar == undefined) { window.ifaddtocalendar = 1;\n var d = document, s = d.createElement('script'), g = 'getElementsByTagName';\n s.type = 'text/javascript';s.charset = 'UTF-8';s.async = true;\n s.src = ('https:' == window.location.protocol ? 'https' : 'http')+'://addtocalendar.com/atc/1.5/atc.min.js';\n var h = d[g]('body')[0];h.appendChild(s); }})();\n </script>\n <?php\n $endtime; \n $training_provider = \"LockoutSafety.com\";\n $contact_email = \"sales@lockoutsafety.com\";\n $training_description = 'Lockout Tagout Safety Awareness Training - Portlaoise';\n $time = $training_start_date;\n $endtime = date('d-m-Y', strtotime($time . ' + 1 day')); ?>\n <div class=\"g_addtocalendar\">\n\n <span class=\"addtocalendar atc-style-blue g_addtocal\">\n <var class=\"atc_event\">\n <var class=\"atc_date_start\"><?php echo $training_start_date.' 09:30:00';?></var>\n <var class=\"atc_date_end\"><?php echo $endtime.' 16:30:00';?></var>\n <var class=\"atc_timezone\">Europe/London</var>\n <var class=\"atc_title\"><?php echo 'Lockout Tagout Safety Awareness Training';?></var>\n <var class=\"atc_description\"><?php echo $training_description;?></var>\n <var class=\"atc_location\"><?php echo 'Maldron Hotel, Portlaoise, Co. Laois';?></var>\n <var class=\"atc_organizer\"><?php echo $training_provider;?></var>\n <var class=\"atc_organizer_email\"><?php echo $contact_email;?></var>\n </var>\n </span>\n\n </div>\n\n <?php\n}", "function loadCalendar() {\n\t\tglobal $mosConfig_live_site;\n\t\tglobal $_LANG;\n\t\t?>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar-mos.css\" title=\"<?php echo $_LANG->_( 'green' ); ?>\" />\n\t\t<!-- import the calendar script -->\n\t\t<script type=\"text/javascript\" src=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar_mini.js\"></script>\n\t\t<!-- import the language module -->\n\t\t<script type=\"text/javascript\" src=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/lang/calendar-en.js\"></script>\n\t\t<?php\n\t}", "function loadCalendar() {\r\n\t\tglobal $mosConfig_live_site;\r\n\t\t?>\r\n\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar-mos.css\" title=\"green\" />\r\n\t\t<!-- import the calendar script -->\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar_mini.js\"></script>\r\n\t\t<!-- import the language module -->\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo $mosConfig_live_site;?>/includes/js/calendar/lang/calendar-en.js\"></script>\r\n\t\t<?php\r\n\t}", "public static function print_footer_script() {\n\t\t?>\n\t\t<script>\n\t\t\t(function( $ ) {\n\t\t\t\t$( function() {\n\t\t\t\t\tvar rating_wrapper = $( '#rank-math-footer-ask-review' );\n\n\t\t\t\t\t$( 'a', rating_wrapper ).on( 'mousedown', function() {\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taction: 'rank_math_already_reviewed',\n\t\t\t\t\t\t\t\tsecurity: rankMath.security,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t\trating_wrapper.animate({\n\t\t\t\t\t\t\topacity: 0.01\n\t\t\t\t\t\t}, 1500, function() {\n\t\t\t\t\t\t\trating_wrapper.html( rating_wrapper.data('original-text') ).css( 'opacity', '1' );\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})(jQuery);\n\t\t</script>\n\t\t<?php\n\t}", "function calendar()\n\t{\n\t\t// Load the behavior and stylesheet files into the document head.\n\t\tJHTML::stylesheet('calendar-jos.css', 'media/system/css/', array(' title' => JText::_('green') ,' media' => 'all'));\n\t\tJHTML::script('calendar.js');\n\t\tJHTML::script('calendar-setup.js');\n\n\t\t// Get and load the calendar translation string into the document head.\n\t\tif ($translation = JHTMLBehavior::_calendartranslation()) {\n\t\t\tJFactory::getDocument()->addScriptDeclaration($translation);\n\t\t}\n\t}", "public function printScript() {\n\t\t// Create a nonce.\n\t\t$nonce = wp_create_nonce( 'aioseo-dismiss-deprecated-wordpress' );\n\t\t?>\n\t\t<script>\n\t\t\twindow.addEventListener('load', function () {\n\t\t\t\tvar dismissBtn\n\n\t\t\t\t// Add an event listener to the dismiss button.\n\t\t\t\tdismissBtn = document.querySelector('.aioseo-deprecated-wordpress-notice .notice-dismiss')\n\t\t\t\tdismissBtn.addEventListener('click', function (event) {\n\t\t\t\t\tvar httpRequest = new XMLHttpRequest(),\n\t\t\t\t\t\tpostData = ''\n\n\t\t\t\t\t// Build the data to send in our request.\n\t\t\t\t\tpostData += '&action=aioseo-dismiss-deprecated-wordpress-notice'\n\t\t\t\t\tpostData += '&nonce=<?php echo esc_html( $nonce ); ?>'\n\n\t\t\t\t\thttpRequest.open('POST', '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>')\n\t\t\t\t\thttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')\n\t\t\t\t\thttpRequest.send(postData)\n\t\t\t\t})\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "function output_script() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar googletag = googletag || {};\n\t\t\tgoogletag.cmd = googletag.cmd || [];\n\t\t\t(function() {\n\t\t\t\tvar gads = document.createElement('script');\n\t\t\t\tgads.async = true;\n\t\t\t\tgads.type = 'text/javascript';\n\t\t\t\tvar useSSL = 'https:' == document.location.protocol;\n\t\t\t\tgads.src = (useSSL ? 'https:' : 'http:') +\n\t\t\t\t\t'//www.googletagservices.com/tag/js/gpt.js';\n\t\t\t\tvar node = document.getElementsByTagName('script')[0];\n\t\t\t\tnode.parentNode.insertBefore(gads, node);\n\t\t\t})();\n\t\t</script>\n\t\t<?php\n\t}", "public function collectJs() {\n $str = implode(\"\\r\\n\", $this->_js);\n if (!$this->_readOnly) {\n\n if (count($this->_formHelpers) > 0) {\n //process the formhelpers\n $str .= <<<EOT\n<script type=\"text/javascript\">\n/* <![CDATA[ */\n\tjQuery(document).ready(function() {\nEOT;\n\n\n\n foreach ($this->_formHelpers as $field_name => $formHelper) {\n\n $tipText = addslashes($formHelper['text']);\n $position = $formHelper['position'];\n if ($position == 'left' || $position == 'right') {\n $position = 'center ' . $position;\n } else {\n $position = $position . ' center';\n }\n\n\n $str .= <<<EOT\n\t\t\t\t\tjQuery('body').append('<div id=\"ipenelo-calendar-tip-{$field_name}\" style=\"display:none;\" class=\"ipenelo-calendar-tip\">{$tipText}</div>');\n\t\t\t\t\tjQuery('#{$field_name}').tooltip({\n\t\t\t\t\t\ttip: '#ipenelo-calendar-tip-{$field_name}',\n\t\t\t\t\t\ttipClass: 'ipenelo-calendar-tip',\n\t\t\t\t\t\tposition: '{$position}',\n\t\t\t\t\t\tdelay: 100,\n\t\t\t\t\t\tevents: {\n\t\t\t\t\t\t\tdef: 'focus,blur'\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\nEOT;\n }\n $str .= <<<EOT\n\n\t});\t\t\t\n/* ]]> */\n</script>\nEOT;\n } //end of process the formhelpers\n //process the validation JS rules\n if (count($this->_validatorJsRules) > 0) {\n\n $str .= <<<EOT\n<script type=\"text/javascript\">\n/* <![CDATA[ */\nvar eabi_ipenelo_calendar_validator = false;\njQuery(document).ready(function() {\n\n\tjQuery(\"#{$this->_formName}\").validator();\n\teabi_ipenelo_calendar_validator = jQuery(\"#{$this->_formName}\").data('validator');\nEOT;\n\n //parse the required field\n foreach ($this->_requiredFields as $field_name) {\n $str .= <<<EOT\n\n\tjQuery(\"label[for=\\\"{$field_name}\\\"]\").append('<sup class=\"em\">*</sup>');\n\t\t\t\t\nEOT;\n }\n\n\n $str .= <<<EOT\n});\nEOT;\n\n foreach ($this->_validatorJsRules as $field => $rules) {\n//\t\t\t\t$script = $rule['script'];\n $str .= <<<EOT\njQuery.tools.validator.fn(\"#{$field}\", function(el, v) {\n\tvar result = true;\n\t\n\t//start chain\n\t\nEOT;\n\n foreach ($rules as $script) {\n $str .= <<<EOT\n\t//start of item\n\tresult = (function(el, v) { {$script} })(el, v);\n\tif (typeof(result) == 'string') {\n\t\treturn result;\n\t}\n\t//end of item\n\n\nEOT;\n }\n\n $str .= <<<EOT\n\t//end of chain\n//\tconsole.log(jQuery('#{$field}'));\n \teabi_ipenelo_calendar_validator.reset(jQuery('#{$field}'));\n\treturn result;\n});\n\t//add the onblur command\n\tjQuery('#{$field}').blur(function(e) {\n\t \teabi_ipenelo_calendar_validator.checkValidity(jQuery('#{$field}'), e);\n\t});\n\nEOT;\n }\n\n\n\n\n $str .= <<<EOT\n\t\t\t\n/* ]]> */\n</script>\nEOT;\n } //end of process the validation JS rules\n }\n return $str;\n }", "function print_timesheet_settings( $arraySettings ) {\n\n // Print the JS object - Maintains correct indenting\n echo 'var TS = {\n multiDaySelectDisabled: ' . ( $arraySettings->multiDaySelectDisabled ? \"true\" : \"false\" ) . ',\n timeFormat: \"' . $arraySettings->timeFormat . '\",\n businessHoursStart: \"' . $arraySettings->businessHoursStart . '\",\n businessHoursEnd: \"' . $arraySettings->businessHoursEnd . '\",\n businessDaysOfWeek: [ ' . $arraySettings->businessDaysOfWeek . ' ],\n slotDuration: \"' . $arraySettings->slotDuration . '\",\n slotLabelInterval: \"' . $arraySettings->slotLabelInterval . '\",\n defaultView: \"' . $arraySettings->defaultView . '\",\n scrollTime: \"' . $arraySettings->scrollTime . '\",\n dayViewColumnFormat: \"' . $arraySettings->dayViewColumnFormat . '\",\n weekViewColumnFormat: \"' . $arraySettings->weekViewColumnFormat . '\",\n rootRelativePath: \"' . ROOT_RELATIVE_PATH . '\",\n notifEntryFor: \"' . lang('timesheet_notif_entry_for') . '\",\n notifAddSuccess: \"' . lang('timesheet_notif_add_success') . '\",\n notifAddError: \"' . lang('timesheet_notif_add_error') . '\",\n notifEditSuccess: \"' . lang('timesheet_notif_edit_success') . '\",\n notifEditError: \"' . lang('timesheet_notif_edit_error') . '\",\n notifDeleteSuccess: \"' . lang('timesheet_notif_delete_success') . '\",\n notifDeleteError: \"' . lang('timesheet_notif_delete_error') . '\",\n notifCloneSuccess: \"' . lang('timesheet_notif_clone_success') . '\",\n notifCloneError: \"' . lang('timesheet_notif_clone_error') . '\",\n notifUpdateTimeSuccess: \"' . lang('timesheet_notif_update_time_success') . '\",\n notifUpdateTimeError: \"' . lang('timesheet_notif_update_time_error') . '\",\n notifNoMultiDay: \"' . lang('timesheet_notif_no_multi_day') . '\",\n notifEndTimeInvalid: \"' . lang('timesheet_notif_invalid_end_time') . '\",\n notifSuccessTitle: \"' . lang('system_notif_success') . '\",\n notifErrorTitle: \"' . lang('system_notif_error') . '\",\n notifNotAllowedTitle: \"' . lang('system_notif_not_allowed') . '\"\n }';\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor method for GetInstallmentsNumberCorrectionRequest
public function __construct($installmentsNumber = null) { $this ->setInstallmentsNumber($installmentsNumber); }
[ "public function getInstallmentsNumber()\n {\n return $this->installmentsNumber;\n }", "public function getInstallmentsNumber()\n {\n return isset($this->InstallmentsNumber) ? $this->InstallmentsNumber : null;\n }", "public function setInstallmentsNumber($installmentsNumber = null)\n {\n // validation for constraint: enumeration\n if (!\\Mu4ddi3\\Compensa\\Webservice\\EnumType\\InstallmentsNumber::valueIsValid($installmentsNumber)) {\n throw new \\InvalidArgumentException(sprintf('Value \"%s\" is invalid, please use one of: %s', $installmentsNumber, implode(', ', \\Mu4ddi3\\Compensa\\Webservice\\EnumType\\InstallmentsNumber::getValidValues())), __LINE__);\n }\n if (is_null($installmentsNumber) || (is_array($installmentsNumber) && empty($installmentsNumber))) {\n unset($this->InstallmentsNumber);\n } else {\n $this->InstallmentsNumber = $installmentsNumber;\n }\n return $this;\n }", "public function getInvoiceCorrectionNumber()\n {\n $value = $this->get(self::INVOICECORRECTIONNUMBER);\n return $value === null ? (string)$value : $value;\n }", "public function getNumberInstallments()\n {\n return $this->numberInstallments;\n }", "public function __construct($requiredSolutionCount = 10) {\n $this->requiredSolutionCount = $requiredSolutionCount;\n }", "function &setConflictsNum($value) {\n $this->setAdditionalProperty('conflict_num', $value);\n\n return $this;\n }", "public function __construct()\n\t{\n\t\t$this->phonenumber = new NumberVerification();\n\t}", "public function initializeNumberPersons()\n {\n if(empty($this->numberPersons))\n {\n $this->numberPersons = $this->fixedNumberPersons;\n }\n }", "function __construct($numbers_from)\n {\n $this -> numbrers_from = $numbers_from;\n // $this -> numbers_to = $numbers;\n }", "public function __construct($_getIncentiveEvaluationRequest = NULL)\r\n\t{\r\n\t\tparent::__construct(array('GetIncentiveEvaluationRequest'=>$_getIncentiveEvaluationRequest));\r\n\t}", "public function setNrContacts($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->nr_contacts !== $v) {\n $this->nr_contacts = $v;\n $this->modifiedColumns[] = LicenseVersionPeer::NR_CONTACTS;\n }\n\n\n return $this;\n }", "public function setInstallmentsNubmer(\\Mu4ddi3\\Compensa\\Webservice\\ArrayType\\ArrayOfInstallmentsNumber $installmentsNubmer = null)\n {\n if (is_null($installmentsNubmer) || (is_array($installmentsNubmer) && empty($installmentsNubmer))) {\n unset($this->InstallmentsNubmer);\n } else {\n $this->InstallmentsNubmer = $installmentsNubmer;\n }\n return $this;\n }", "function init_woocommerce_sequential_order_numbers_pro() {\nclass WC_Seq_Order_Number_Pro extends SV_WC_Plugin {\n\n\n\t/** version number */\n\tconst VERSION = '1.6.2';\n\n\t/** The plugins id, used for various slugs and such */\n\tconst PLUGIN_ID = 'sequential_order_numbers_pro';\n\n\t/** Plugin text domain */\n\tconst TEXT_DOMAIN = 'woocommerce-sequential-order-numbers-pro';\n\n\n\t/**\n\t * @var string\n\t */\n\tprivate $errors = null;\n\n\t/**\n\t * @var string\n\t */\n\tprivate $order_number_prefix;\n\n\t/**\n\t * @var string\n\t */\n\tprivate $order_number_suffix;\n\n\t/**\n\t * @var int\n\t */\n\tprivate $order_number_length;\n\n\t/** @var int maximum order number */\n\tprivate $max_order_number;\n\n\n\t/**\n\t * Plugin constructor\n\t *\n\t * @see SV_WC_Plugin::__construct()\n\t */\n\tpublic function __construct() {\n\n\t\tparent::__construct(\n\t\t\tself::PLUGIN_ID,\n\t\t\tself::VERSION,\n\t\t\tself::TEXT_DOMAIN\n\t\t);\n\n\t\t// set the custom order number on the new order. we hook into woocommerce_checkout_update_order_meta for orders which are created\n\t\t// from the frontend, and we hook into woocommerce_process_shop_order_meta for admin-created orders.\n\t\t// Note we use these actions rather than the more generic wp_insert_post action because we want to\n\t\t// run after the order meta (including totals) are set so we can detect whether this is a free order\n\t\tadd_action( 'woocommerce_checkout_update_order_meta', array( $this, 'set_sequential_order_number' ), 10, 2 );\n\t\tadd_action( 'woocommerce_process_shop_order_meta', array( $this, 'set_sequential_order_number' ), 35, 2 );\n\t\tadd_action( 'woocommerce_before_resend_order_emails', array( $this, 'set_sequential_order_number' ), 10, 1 );\n\n\t\t// return our custom order number for display\n\t\tadd_filter( 'woocommerce_order_number', array( $this, 'get_order_number' ), 10, 2);\n\n\t\t// order tracking page search by order number\n\t\tadd_filter( 'woocommerce_shortcode_order_tracking_order_id', array( $this, 'find_order_by_order_number' ) );\n\n\t\t// WC Subscriptions support: prevent unnecessary order meta from polluting parent renewal orders, and set order number for subscription orders\n\t\tadd_filter( 'woocommerce_subscriptions_renewal_order_meta_query', array( $this, 'subscriptions_remove_renewal_order_meta' ), 10, 4 );\n\t\tadd_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'subscriptions_set_sequential_order_number' ), 9, 4 );\n\n\t\tif ( is_admin() ) {\n\t\t\t// keep the admin order search/order working properly\n\t\t\tadd_filter( 'request', array( $this, 'woocommerce_custom_shop_order_orderby' ), 20 );\n\t\t\tadd_filter( 'woocommerce_shop_order_search_fields', array( $this, 'custom_search_fields' ) );\n\n\t\t\t// sort by underlying _order_number on the Pre-Orders table\n\t\t\tadd_filter( 'wc_pre_orders_edit_pre_orders_request', array( $this, 'custom_orderby' ) );\n\t\t\tadd_filter( 'wc_pre_orders_search_fields', array( $this, 'custom_search_fields' ) );\n\n\t\t\t// inject our admin options\n\t\t\tadd_filter( 'woocommerce_general_settings', array( $this, 'admin_settings' ) );\n\t\t\tadd_action( 'woocommerce_settings_start', array( $this, 'admin_settings_js' ) );\n\n\t\t\t// roll my own Settings field error check, which isn't beautiful, but is important\n\t\t\tadd_filter( 'pre_update_option_woocommerce_order_number_start', array( $this, 'validate_order_number_start_setting' ), 10, 2 );\n\n\t\t\t// pre WC 2.1\n\t\t\tadd_filter( 'wp_redirect', array( $this, 'add_settings_error_msg' ), 10, 2 );\n\n\t\t\t// add support for the CSV export plugin\n\t\t\tadd_filter( 'woocommerce_export_csv_extra_columns', array( $this, 'export_csv_extra_columns' ) );\n\n\t\t\tadd_action( 'woocommerce_settings_start', array( $this, 'add_settings_errors' ) );\n\n\t\t}\n\t}\n\n\n\t/**\n\t * Load plugin text domain.\n\t *\n\t * @see SV_WC_Plugin::load_translation()\n\t */\n\tpublic function load_translation() {\n\t\tload_plugin_textdomain( 'woocommerce-sequential-order-numbers-pro', false, dirname( plugin_basename( $this->get_file() ) ) . '/i18n/languages' );\n\t}\n\n\n\t/**\n\t * Search for an order with order_number $order_number. This method can be\n\t * useful for 3rd party plugins that want to rely on the Sequential Order\n\t * Numbers plugin and perform lookups by custom order number.\n\t *\n\t * @param string $order_number order number to search for\n\t * @return int post_id for the order identified by $order_number, or 0\n\t */\n\tpublic function find_order_by_order_number( $order_number ) {\n\n\t\t// search for the order by custom order number\n\t\t$query_args = array(\n\t\t\t'numberposts' => 1,\n\t\t\t'meta_key' => '_order_number_formatted',\n\t\t\t'meta_value' => $order_number,\n\t\t\t'post_type' => 'shop_order',\n\t\t\t'post_status' => 'publish',\n\t\t\t'fields' => 'ids',\n\t\t);\n\n\t\tlist( $order_id ) = get_posts( $query_args );\n\n\t\t// order was found\n\t\tif ( null !== $order_id ) {\n\t\t\treturn $order_id;\n\t\t}\n\n\t\t// if we didn't find the order, then it may be that this plugin was disabled and an order was placed in the interim\n\t\t$order = new WC_Order( $order_number );\n\t\tif ( '' !== SV_WC_Plugin_Compatibility::get_order_custom_field( $order, 'order_number_formatted' ) ) {\n\t\t\t// _order_number was set, so this is not an old order, it's a new one that just happened to have post_id that matched the searched-for order_number\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $order->id;\n\t}\n\n\n\t/**\n\t * Set the _order_number/_order_number_formatted field for the newly created order\n\t *\n\t * @param int|WC_Order $post_id order identifier or order object\n\t * @param mixed $post this is going to be an array of the POST values when\n\t * the order is created from the checkout page in the frontend, null\n\t * when the checkout method is PayPal Expres, and a post object when\n\t * the order is created in the admin. Defaults to an array so that\n\t * other actions can be hooked in\n\t */\n\tpublic function set_sequential_order_number( $post_id, $post = array() ) {\n\n\t\t// when creating an order from the admin don't create order numbers for auto-draft\n\t\t// orders, because these are not linked to from the admin and so difficult to delete\n\t\tif ( is_array( $post ) || is_null( $post ) || ( 'shop_order' == $post->post_type && 'auto-draft' != $post->post_status ) ) {\n\n\t\t\t$post_id = is_a( $post_id, 'WC_Order' ) ? $post_id->id : $post_id;\n\t\t\t$order_number = get_post_meta( $post_id, '_order_number' );\n\n\t\t\t// if no order number has been assigned, this will be an empty array\n\t\t\tif ( empty( $order_number ) ) {\n\n\t\t\t\tif ( $this->skip_free_orders() && $this->is_free_order( $post_id ) ) {\n\t\t\t\t\t// assign sequential free order number\n\t\t\t\t\tif ( $this->generate_sequential_order_number( $post_id, '_order_number_free', $this->get_free_order_number_start(), $this->get_free_order_number_prefix() ) ) {\n\t\t\t\t\t\t// so that sorting still works in the admin\n\t\t\t\t\t\tupdate_post_meta( $post_id, '_order_number', -1 );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// normal operation\n\t\t\t\t\t$this->generate_sequential_order_number( $post_id, '_order_number', get_option( 'woocommerce_order_number_start' ), $this->get_order_number_prefix(), $this->get_order_number_suffix(), $this->get_order_number_length() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Safely generate and assign a sequential order number\n\t *\n\t * @since 1.3\n\t *\n\t * @param int $post_id order identifier\n\t * @param string $order_number_meta_name order number meta name,\n\t * ie _order_number or _order_number_free\n\t * @param int $order_number_start order number starting point\n\t * @param string $order_number_prefix optional order number prefix\n\t * @param string $order_number_suffix optional order number suffix\n\t * @param int $order_number_length optional order number length\n\t *\n\t * @return boolean true if a sequential order number was successfully\n\t * generated and assigned to $post_id\n\t */\n\tprivate function generate_sequential_order_number( $post_id, $order_number_meta_name, $order_number_start, $order_number_prefix = '', $order_number_suffix = '', $order_number_length = 1 ) {\n\t\tglobal $wpdb;\n\n\t\t$success = false;\n\n\t\tfor ( $i = 0; $i < 3 && ! $success; $i++ ) {\n\t\t\t// add $order_number_meta_name equal to $order_number_start if there are no existing orders with an $order_number_meta_name meta\n\t\t\t// or $order_number_start is larger than the max existing $order_number_meta_name meta. Otherwise, $order_number_meta_name\n\t\t\t// will be set to the max $order_number_meta_name + 1\n\t\t\t$query = $wpdb->prepare( \"\n\t\t\t\tINSERT INTO {$wpdb->postmeta} (post_id,meta_key,meta_value)\n\t\t\t\tSELECT %d,'{$order_number_meta_name}',IF(MAX(CAST(meta_value AS SIGNED)) IS NULL OR MAX(CAST(meta_value AS SIGNED)) < %d, %d, MAX(CAST(meta_value AS SIGNED))+1)\n\t\t\t\t\tFROM {$wpdb->postmeta}\n\t\t\t\t\tWHERE meta_key='{$order_number_meta_name}'\",\n\t\t\t\t$post_id, $order_number_start, $order_number_start );\n\t\t\t$success = $wpdb->query( $query );\n\n\t\t\tif ( $success ) {\n\t\t\t\t// on success, set the formatted order number\n\t\t\t\t$order_number = $wpdb->get_var( $wpdb->prepare( \"SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_id = %d\", $wpdb->insert_id ) );\n\n\t\t\t\tupdate_post_meta( $post_id, '_order_number_formatted', $this->format_order_number( $order_number, $order_number_prefix, $order_number_suffix, $order_number_length ) );\n\n\t\t\t\t// save the order number configuration at the time of creation, so the integer part can be renumbered at a later date if needed\n\t\t\t\t$order_number_meta = array(\n\t\t\t\t\t'prefix' => $order_number_prefix,\n\t\t\t\t\t'suffix' => $order_number_suffix,\n\t\t\t\t\t'length' => $order_number_length,\n\t\t\t\t);\n\t\t\t\tupdate_post_meta( $post_id, '_order_number_meta', $order_number_meta );\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}\n\n\n\t/**\n\t * Filter to return our _order_number_formatted field rather than the post ID,\n\t * for display.\n\t *\n\t * @param string $order_number the order id with a leading hash\n\t * @param WC_Order $order the order object\n\t *\n\t * @return string custom order number, with leading hash\n\t */\n\tpublic function get_order_number( $order_number, $order ) {\n\n\t\t// maintain the hash?\n\t\t$maybe_hash = $this->get_has_hash_before_order_number() ? _x( '#', 'hash before order number', self::TEXT_DOMAIN ) : '';\n\n\t\t// can't trust $order->order_custom_fields object\n\t\t$order_number_formatted = get_post_meta( $order->id, '_order_number_formatted', true );\n\t\tif ( $order_number_formatted ) {\n\t\t\treturn $maybe_hash . $order_number_formatted;\n\t\t}\n\n\t\t// return a 'draft' order number that will not be saved to the db (this\n\t\t// means that when adding an order from the admin, the order number you\n\t\t// first see may not be the one you end up with, but it's better than the\n\t\t// alternative of showing the underlying post id)\n\t\t$post_status = isset( $order->post_status ) ? $order->post_status : get_post_status( $order->id );\n\t\tif ( 'auto-draft' == $post_status ) {\n\t\t\tglobal $wpdb;\n\t\t\t$order_number_start = get_option( 'woocommerce_order_number_start' );\n\t\t\t$order_number = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\t\tSELECT IF(MAX(CAST(meta_value AS SIGNED)) IS NULL OR MAX(CAST(meta_value AS SIGNED)) < %d, %d, MAX(CAST(meta_value AS SIGNED))+1)\n\t\t\t\tFROM {$wpdb->postmeta}\n\t\t\t\tWHERE meta_key='_order_number'\",\n\t\t\t\t$order_number_start, $order_number_start ) );\n\t\t\treturn $maybe_hash . $this->format_order_number( $order_number, $this->get_order_number_prefix(), $this->get_order_number_suffix(), $this->get_order_number_length() ) . ' (' . __( 'Draft', self::TEXT_DOMAIN ) . ')';\n\t\t}\n\t\treturn $order_number;\n\t}\n\n\n\t/** Admin filters ******************************************************/\n\n\n\t/**\n\t * Admin order table orderby ID operates on our meta integral _order_number\n\t *\n\t * @param array $vars associative array of orderby parameteres\n\t *\n\t * @return array associative array of orderby parameteres\n\t */\n\tpublic function woocommerce_custom_shop_order_orderby( $vars ) {\n\t\tglobal $typenow, $wp_query;\n\t\tif ( 'shop_order' != $typenow ) return $vars;\n\n\t\treturn $this->custom_orderby( $vars );\n\t}\n\n\n\t/**\n\t * Mofifies the given $args argument to sort on our meta integral _order_number\n\t *\n\t * @since 1.5\n\t * @param array $vars associative array of orderby parameteres\n\t * @return array associative array of orderby parameteres\n\t */\n\tpublic function custom_orderby( $args ) {\n\t\t// Sorting\n\t\tif ( isset( $args['orderby'] ) && 'ID' == $args['orderby'] ) {\n\t\t\t$args = array_merge( $args, array(\n\t\t\t\t'meta_key' => '_order_number', // sort on numerical portion for better results\n\t\t\t\t'orderby' => 'meta_value_num',\n\t\t\t) );\n\t\t}\n\n\t\treturn $args;\n\t}\n\n\n\t/**\n\t * Add our custom _order_number_formatted to the set of search fields so that\n\t * the admin search functionality is maintained\n\t *\n\t * @param array $search_fields array of post meta fields to search by\n\t *\n\t * @return array of post meta fields to search by\n\t */\n\tpublic function custom_search_fields( $search_fields ) {\n\n\t\tarray_push( $search_fields, '_order_number_formatted' );\n\n\t\treturn $search_fields;\n\t}\n\n\n\t/**\n\t * Validate the order number start setting, by verifying that\n\t * $newvalue is an integer and bigger than the greatest existing order\n\t * number\n\t *\n\t * @param string $newvalue the new value to set\n\t * @param string $oldvalue the previous value\n\t * @return string $newvalue if it is a positive integer, $oldvalue otherwise\n\t */\n\tpublic function validate_order_number_start_setting( $newvalue, $oldvalue ) {\n\n\t\tglobal $wpdb;\n\n\t\t// no change to starting order number\n\t\tif ( (int) $newvalue === (int) $oldvalue ) {\n\n\t\t\t// $newvalue can include left hand zero padding to set a number length, update the value if that is all that's changed\n\t\t\tupdate_option( 'woocommerce_order_number_length', strlen( $newvalue ) );\n\n\t\t\treturn $newvalue;\n\t\t}\n\n\t\tif ( $this->is_order_number_start_invalid( $newvalue ) || $this->is_order_number_start_in_use( $newvalue ) ) {\n\n\t\t\t// bad value\n\t\t\treturn $oldvalue;\n\t\t}\n\n\t\t// $newvalue can include left hand zero padding to set a number length, update this value first in case nothing else changed\n\t\tupdate_option( 'woocommerce_order_number_length', strlen( $newvalue ) );\n\n\t\t// good value, and remove any padding zeroes\n\t\treturn $newvalue;\n\t}\n\n\n\t/**\n\t * Filter to add the settings error message, if needed, and remove\n\t * it from the $location url otherwise\n\t *\n\t * pre WC 2.1 only\n\t *\n\t * @param string $location url\n\t * @param int $status\n\t *\n\t * @return string the location to redirect to\n\t */\n\tpublic function add_settings_error_msg( $location, $status) {\n\n\t\t// pre WC 2.1 method only\n\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_2_1() ) {\n\t\t\treturn $location;\n\t\t}\n\n\t\tif ( $this->errors ) {\n\t\t\t$location = add_query_arg( array( 'wc_error' => urlencode( $this->errors ) ), $location );\n\t\t} elseif( strpos( $location, urlencode( __( 'Order Number Start must be a number greater than or equal to 0', self::TEXT_DOMAIN ) ) ) !== false ||\n\t\t\t strpos( $location, urlencode( __( 'There is an existing order', self::TEXT_DOMAIN ) ) ) !== false ) {\n\t\t\t// otherwise if my error is currently in the url, remove it. This must be done because it will be kept in the url by the settings form wp_nonce_field() call\n\t\t\t$location = remove_query_arg( 'wc_error', $location );\n\t\t}\n\n\t\treturn $location;\n\t}\n\n\n\t/**\n\t * Add any settings error\n\t *\n\t * @since 1.6\n\t */\n\tpublic function add_settings_errors() {\n\n\t\tglobal $wpdb;\n\n\t\t// nothing doing\n\t\tif ( ! isset( $_POST['woocommerce_order_number_start'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$newvalue = $_POST['woocommerce_order_number_start'];\n\t\t$oldvalue = get_option( 'woocommerce_order_number_start' );\n\n\t\t// no change to starting order number\n\t\tif ( (int) $newvalue === (int) $oldvalue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->is_order_number_start_invalid( $newvalue ) ) {\n\n\t\t\t// bad value\n\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_2_1() ) {\n\t\t\t\tWC_Admin_Settings::add_error( __( 'Order Number Start must be a number greater than or equal to 0.', self::TEXT_DOMAIN ) );\n\t\t\t} else {\n\t\t\t\t$this->errors = __( 'Order Number Start must be a number greater than or equal to 0.', self::TEXT_DOMAIN );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->is_order_number_start_in_use( $newvalue ) ) {\n\n\t\t\t// existing order number with a greater incrementing value\n\t\t\t$post_id = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_order_number' AND meta_value = %d\", $this->get_max_order_number() ) );\n\n\t\t\tif ( class_exists( 'WC_Order' ) ) {\n\t\t\t\t$order = new WC_Order( $post_id );\n\t\t\t\t$highest_order_number = $order->get_order_number();\n\t\t\t} else {\n\t\t\t\t$highest_order_number = $post_id;\n\t\t\t}\n\n\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_2_1() ) {\n\t\t\t\tWC_Admin_Settings::add_error( sprintf( __( 'There is an existing order (%s) with a number greater than or equal to %s. To set a new order number start please choose a higher number or permanently delete the relevant order(s).', self::TEXT_DOMAIN ), $highest_order_number, (int) $newvalue ) );\n\t\t\t} else {\n\t\t\t\t$this->errors = sprintf( __( 'There is an existing order (%s) with a number greater than or equal to %s. To set a new order number start please choose a higher number or permanently delete the relevant order(s).', self::TEXT_DOMAIN ), $highest_order_number, (int) $newvalue );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t}\n\n\n\t/**\n\t * Inject our admin settings into the Settings > General page\n\t *\n\t * @param array $settings associative-array of WooCommerce settings\n\t * @return array associative-array of WooCommerce settings\n\t */\n\tpublic function admin_settings( $settings ) {\n\n\t\t$updated_settings = array();\n\n\t\tforeach ( $settings as $section ) {\n\n\t\t\t$updated_settings[] = $section;\n\n\t\t\t// New section after the \"General Options\" section\n\t\t\tif ( isset( $section['id'] ) && 'general_options' == $section['id'] &&\n\t\t\t\t isset( $section['type'] ) && 'sectionend' == $section['type'] ) {\n\n\t\t\t\t$updated_settings[] = array( 'name' => __( 'Order Numbers', self::TEXT_DOMAIN ), 'type' => 'title', 'desc' => '', 'id' => 'order_number_options' );\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Order Number Start', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc_tip' => sprintf( __( 'The starting number for the incrementing portion of the order numbers, unless there is an existing order with a higher number. Use leading zeroes to pad your order numbers to a desired minimum length. Any newly placed orders will be numbered like: %s', self::TEXT_DOMAIN ), $this->format_order_number( get_option( 'woocommerce_order_number_start' ), $this->get_order_number_prefix(), $this->get_order_number_suffix(), $this->get_order_number_length() ) ),\n\t\t\t\t\t'id' => 'woocommerce_order_number_start',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'desc' => sprintf( __( 'Sample order number: %s', self::TEXT_DOMAIN ), '<span id=\"sample_order_number\">' . $this->format_order_number( get_option( 'woocommerce_order_number_start' ), $this->get_order_number_prefix(), $this->get_order_number_suffix(), $this->get_order_number_length() ) . '</span>' ),\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Hash Before Order number ', self::TEXT_DOMAIN ),\n\t\t\t\t\t'id' => 'woocommerce_hash_before_order_number',\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t'desc' => __( 'Display a hash (#) before order numbers on frontend and admin.', self::TEXT_DOMAIN ),\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Order Number Prefix', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc_tip' => __( 'Set your custom order number prefix. You may use {DD}, {MM}, {YYYY} for the current day, month and year respectively.', self::TEXT_DOMAIN ),\n\t\t\t\t\t'id' => 'woocommerce_order_number_prefix',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'desc' => sprintf( __( 'See the %splugin documentation%s for the full set of available patterns.', self::TEXT_DOMAIN ), '<a target=\"_blank\" href=\"http://wcdocs.woothemes.com/user-guide/extensions/functionality/sequential-order-numbers/\">', '</a>' ),\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Order Number Suffix', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc_tip' => __( 'Set your custom order number suffix. You may use {DD}, {MM}, {YYYY} for the current day, month and year respectively.', self::TEXT_DOMAIN ),\n\t\t\t\t\t'id' => 'woocommerce_order_number_suffix',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => '',\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Skip Free Orders', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc' => __( 'Skip order numbers for free orders', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc_tip' => __( 'With this enabled an order number will not be assigned to an order consisting solely of free products.', self::TEXT_DOMAIN ),\n\t\t\t\t\t'id' => 'woocommerce_order_number_skip_free_orders',\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => 'no',\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array(\n\t\t\t\t\t'name' => __( 'Free Order Identifer', self::TEXT_DOMAIN ),\n\t\t\t\t\t'desc' => sprintf( __( 'Example free order identifier: %s', self::TEXT_DOMAIN ), '<span id=\"sample_free_order_number\">' . $this->format_order_number( $this->get_free_order_number_start(), $this->get_free_order_number_prefix() ) . '</span>' ),\n\t\t\t\t\t'desc_tip' => __( 'The text to display in place of the order number for free orders. This will be displayed anywhere an order number would otherwise be shown: to the customer, in emails, and in the admin.', self::TEXT_DOMAIN ),\n\t\t\t\t\t'id' => 'woocommerce_free_order_number_prefix',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'css' => 'min-width:300px;',\n\t\t\t\t\t'default' => __( 'FREE-', self::TEXT_DOMAIN ),\n\t\t\t\t);\n\n\t\t\t\t$updated_settings[] = array( 'type' => 'sectionend', 'id' => 'order_number_options' );\n\t\t\t}\n\t\t}\n\t\treturn $updated_settings;\n\t}\n\n\n\t/**\n\t * Render the admin settings javascript which will live-update the sample\n\t * order number for improved feedback when configuring\n\t *\n\t * @since 1.3\n\t */\n\tpublic function admin_settings_js() {\n\n\t\t// our options are on the general tab\n\t\tif ( isset( $_REQUEST['tab'] ) && $_REQUEST['tab'] != 'general' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tob_start(); ?>\n\t\tvar free_order_number_start = <?php echo $this->get_free_order_number_start(); ?>;\n\t\t$('#woocommerce_order_number_skip_free_orders').change(function() {\n\t\t\tif ( ! $( this ).is( ':checked' ) ) {\n\t\t\t\t$( '#woocommerce_free_order_number_prefix' ).closest( 'tr' ).hide();\n\t\t\t} else {\n\t\t\t\t$( '#woocommerce_free_order_number_prefix' ).closest( 'tr' ).show();\n\t\t\t}\n\t\t}).change();\n\n\t\t$( '#woocommerce_free_order_number_prefix' ).on( 'keyup change input', function() {\n\t\t\t$( '#sample_free_order_number' ).text( formatOrderNumber( free_order_number_start, $( this ).val() ) );\n\t\t} );\n\n\t\t$('#woocommerce_order_number_start, #woocommerce_order_number_prefix, #woocommerce_order_number_suffix').on('keyup change input',\n\t\t\tfunction() {\n\t\t\t\t$( '#sample_order_number' ).text( formatOrderNumber( $( '#woocommerce_order_number_start' ).val(), $( '#woocommerce_order_number_prefix' ).val(), $( '#woocommerce_order_number_suffix' ).val() ) );\n\t\t\t}\n\t\t);\n\t\tfunction formatOrderNumber( orderNumber, orderNumberPrefix, orderNumberSuffix ) {\n\n\t\t\torderNumberPrefix = ( typeof orderNumberPrefix === \"undefined\" ) ? \"\" : orderNumberPrefix;\n\t\t\torderNumberSuffix = ( typeof orderNumberSuffix === \"undefined\" ) ? \"\" : orderNumberSuffix;\n\n\t\t\tvar formatted = orderNumberPrefix + orderNumber + orderNumberSuffix;\n\n\t\t\tvar d = new Date();\n\t\t\tif ( formatted.indexOf( '{D}' ) > -1) formatted = formatted.replace( '{D}', d.getDate() );\n\t\t\tif ( formatted.indexOf( '{DD}' ) > -1) formatted = formatted.replace( '{DD}', leftPad( d.getDate().toString(), 2, '0' ) );\n\t\t\tif ( formatted.indexOf( '{M}' ) > -1) formatted = formatted.replace( '{M}', d.getMonth() + 1 );\n\t\t\tif ( formatted.indexOf( '{MM}' ) > -1) formatted = formatted.replace( '{MM}', leftPad( ( d.getMonth() + 1 ).toString(), 2, '0' ) );\n\t\t\tif ( formatted.indexOf( '{YY}' ) > -1) formatted = formatted.replace( '{YY}', ( d.getFullYear() ).toString().substr( 2 ) );\n\t\t\tif ( formatted.indexOf( '{YYYY}' ) > -1) formatted = formatted.replace( '{YYYY}', d.getFullYear() );\n\t\t\tif ( formatted.indexOf( '{H}' ) > -1) formatted = formatted.replace( '{H}', d.getHours() );\n\t\t\tif ( formatted.indexOf( '{HH}' ) > -1) formatted = formatted.replace( '{HH}', leftPad( d.getHours().toString(), 2, '0' ) );\n\t\t\tif ( formatted.indexOf( '{N}' ) > -1) formatted = formatted.replace( '{N}', d.getMinutes() );\n\t\t\tif ( formatted.indexOf( '{S}' ) > -1) formatted = formatted.replace( '{S}', d.getSeconds() );\n\n\t\t\treturn formatted;\n\t\t}\n\t\tfunction leftPad( value, count, char ) {\n\t\t\twhile ( value.length < count ) {\n\t\t\t\tvalue = char + value;\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t\t<?php\n\t\t$javascript = ob_get_clean();\n\t\tSV_WC_Plugin_Compatibility::wc_enqueue_js( $javascript );\n\t}\n\n\n\t/**\n\t * CSV Customer/Order Export Plugin filter to add additional columns of data\n\t *\n\t * @since 1.5\n\t * @param array $ret array of columns and data values\n\t */\n\tpublic function export_csv_extra_columns( $ret ) {\n\n\t\t// the \"formatted\" order number is already exported by the CSV plugin as the \"Order ID\"\n\t\t// TODO: support the free orders\n\t\t$ret['columns'][] = 'Order Number';\n\t\t$ret['data'][] = '_order_number';\n\n\t\treturn $ret;\n\t}\n\n\n\t/**\n\t * Sets an order number on a subscriptions-created order\n\t *\n\t * @since 1.5\n\t *\n\t * @param WC_Order $renewal_order the new renewal order object\n\t * @param WC_Order $original_order the original order object\n\t * @param int $product_id the product post identifier\n\t * @param string $new_order_role the role the renewal order is taking, one of 'parent' or 'child'\n\t */\n\tpublic function subscriptions_set_sequential_order_number( $renewal_order, $original_order, $product_id, $new_order_role ) {\n\t\t$order_post = get_post( $renewal_order->id );\n\t\t$this->set_sequential_order_number( $order_post->ID, $order_post );\n\t}\n\n\n\t/**\n\t * Don't copy over order number meta when creating a parent or child renewal order\n\t *\n\t * @since 1.5\n\t *\n\t * @param array $order_meta_query query for pulling the metadata\n\t * @param int $original_order_id Post ID of the order being used to purchased the subscription being renewed\n\t * @param int $renewal_order_id Post ID of the order created for renewing the subscription\n\t * @param string $new_order_role The role the renewal order is taking, one of 'parent' or 'child'\n\t * @return string\n\t */\n\tpublic function subscriptions_remove_renewal_order_meta( $order_meta_query, $original_order_id, $renewal_order_id, $new_order_role ) {\n\n\t\t$order_meta_query .= \" AND meta_key NOT IN ( '_order_number', '_order_number_formatted', '_order_number_free', '_order_number_meta' )\";\n\n\t\treturn $order_meta_query;\n\t}\n\n\n\t/** Helper methods ******************************************************/\n\n\n\t/**\n\t * Returns the max order number currently in use\n\t *\n\t * @since 1.6\n\t * @return int maximum order number\n\t */\n\tprivate function get_max_order_number() {\n\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $this->max_order_number ) ) {\n\t\t\treturn $this->max_order_number;\n\t\t}\n\n\t\treturn $this->max_order_number = $wpdb->get_var( \"SELECT MAX( CAST( meta_value AS SIGNED ) ) FROM $wpdb->postmeta WHERE meta_key='_order_number'\" );\n\t}\n\n\n\t/**\n\t * Returns true if the given order number start value is already in use,\n\t * false otherwise\n\t *\n\t * @since 1.6\n\t * @param string $value order number start\n\t * @return boolean true if the given order number start value is already in use\n\t */\n\tprivate function is_order_number_start_in_use( $value ) {\n\n\t\t// check for an existing order number with a greater incrementing value\n\t\t$order_number = $this->get_max_order_number();\n\n\t\treturn ! is_null( $order_number ) && (int) $order_number >= $value;\n\t}\n\n\n\t/**\n\t * Returns false if the given order number start value is invalid, true otherwise\n\t *\n\t * @since 1.6\n\t * @param string $value order number start value\n\t * @return boolean true if the given order number start value is invalid\n\t */\n\tprivate function is_order_number_start_invalid( $value ) {\n\t\treturn ! ctype_digit( $value ) || (int) $value != $value;\n\t}\n\n\n\t/**\n\t * Returns $order_number formatted with the order number prefix/\n\t * postfix, if set\n\t *\n\t * @param int $order_number incrementing portion of the order number\n\t * @param string $order_number_prefix optional order number prefix string\n\t * @param string $order_number_suffix optional order number suffix string\n\t * @param int $order_number_length optional order number length\n\t *\n\t * @return string formatted order number\n\t */\n\tprivate function format_order_number( $order_number, $order_number_prefix = '', $order_number_suffix = '', $order_number_length = 1 ) {\n\n\t\t$order_number = (int) $order_number;\n\n\t\t// any order number padding?\n\t\tif ( $order_number_length && ctype_digit( $order_number_length ) ) {\n\t\t\t$order_number = sprintf( \"%0{$order_number_length}d\", $order_number );\n\t\t}\n\n\t\t$formatted = $order_number_prefix . $order_number . $order_number_suffix;\n\n\t\t// pattern substitution\n\t\t$replacements = array(\n\t\t\t'{D}' => date_i18n( 'j' ),\n\t\t\t'{DD}' => date_i18n( 'd' ),\n\t\t\t'{M}' => date_i18n( 'n' ),\n\t\t\t'{MM}' => date_i18n( 'm' ),\n\t\t\t'{YY}' => date_i18n( 'y' ),\n\t\t\t'{YYYY}' => date_i18n( 'Y' ),\n\t\t\t'{H}' => date_i18n( 'G' ),\n\t\t\t'{HH}' => date_i18n( 'H' ),\n\t\t\t'{N}' => date_i18n( 'i' ),\n\t\t\t'{S}' => date_i18n( 's' ),\n\t\t);\n\n\t\treturn str_replace( array_keys( $replacements ), $replacements, $formatted );\n\t}\n\n\n\t/**\n\t * Returns true if the order number should be displayed with a leading hash (#)\n\t * Defaults to true\n\t *\n\t * @return boolean true if the order number should be displayed with a leading hash\n\t */\n\tprivate function get_has_hash_before_order_number() {\n\t\treturn 'yes' == get_option( 'woocommerce_hash_before_order_number', 'yes' );\n\t}\n\n\n\t/**\n\t * Returns the order number prefix, if set\n\t *\n\t * @return string order number prefix\n\t */\n\tprivate function get_order_number_prefix() {\n\n\t\tif ( ! isset( $this->order_number_prefix ) ) {\n\t\t\t$this->order_number_prefix = get_option( 'woocommerce_order_number_prefix', \"\" );\n\t\t}\n\n\t\treturn $this->order_number_prefix;\n\t}\n\n\n\t/**\n\t * Returns the order number suffix, if set\n\t *\n\t * @return string order number suffix\n\t */\n\tprivate function get_order_number_suffix() {\n\n\t\tif ( ! isset( $this->order_number_suffix ) ) {\n\t\t\t$this->order_number_suffix = get_option( 'woocommerce_order_number_suffix', \"\" );\n\t\t}\n\n\t\treturn $this->order_number_suffix;\n\t}\n\n\n\t/**\n\t * Returns the order number length, defaulting to 1 if not set\n\t *\n\t * @since 1.3\n\t *\n\t * @return string order number length\n\t */\n\tprivate function get_order_number_length() {\n\n\t\tif ( ! isset( $this->order_number_length ) ) {\n\t\t\t$this->order_number_length = get_option( 'woocommerce_order_number_length', 1 );\n\t\t}\n\n\t\treturn $this->order_number_length;\n\t}\n\n\n\t/**\n\t * Returns true if order numbers should be skipped for orders consisting\n\t * solely of free products\n\t *\n\t * @since 1.3\n\t *\n\t * @return boolean true if order numbers should be skipped for free orders\n\t */\n\tprivate function skip_free_orders() {\n\t\treturn 'yes' == get_option( 'woocommerce_order_number_skip_free_orders', 'no' );\n\t}\n\n\n\t/**\n\t * Returns the value to use in place of the order number for free orders\n\t * when 'skip free orders' is enabled\n\t *\n\t * @since 1.3\n\t *\n\t * @return string text to use in place of the order number for free orders\n\t */\n\tprivate function get_free_order_number_prefix() {\n\t\treturn get_option( 'woocommerce_free_order_number_prefix', __( 'FREE-', self::TEXT_DOMAIN ) );\n\t}\n\n\n\t/**\n\t * Gets the free order number incrementing piece\n\t *\n\t * @since 1.3\n\t *\n\t * @return int free order number incrementing portion\n\t */\n\tprivate function get_free_order_number_start() {\n\t\treturn get_option( 'woocommerce_free_order_number_start' );\n\t}\n\n\n\t/**\n\t * Returns true if this order consists entirely of free products AND\n\t * has a total of 0 (so no shipping charges or other fees)\n\t *\n\t * @since 1.3\n\t *\n\t * @param int $order_id order identifier\n\t * @return boolean true if the order consists solely of free products\n\t */\n\tprivate function is_free_order( $order_id ) {\n\n\t\t$is_free = true;\n\t\t$order = new WC_Order( $order_id );\n\n\t\t// easy check: order total\n\t\tif ( $order->get_total() > 0 ) {\n\t\t\t$is_free = false;\n\t\t}\n\n\t\t// free order\n\t\treturn apply_filters( 'wc_sequential_order_numbers_is_free_order', $is_free, $order_id );\n\t}\n\n\n\t/**\n\t * Returns the plugin name, localized\n\t *\n\t * @since 1.6\n\t * @see SV_WC_Plugin::get_plugin_name()\n\t * @return string the plugin name\n\t */\n\tpublic function get_plugin_name() {\n\t\treturn __( 'WooCommerce Sequential Order Numbers Pro', self::TEXT_DOMAIN );\n\t}\n\n\n\t/**\n\t * Returns __FILE__\n\t *\n\t * @since 1.6\n\t * @see\n\t * @return string the full path and filename of the plugin file\n\t */\n\tprotected function get_file() {\n\t\treturn __FILE__;\n\t}\n\n\n\t/**\n\t * Gets the plugin documentation url, which defaults to:\n\t * http://docs.woothemes.com/document/woocommerce-{dasherized plugin id}/\n\t *\n\t * @since 1.6\n\t * @see SV_WC_Plugin::get_documentation_url()\n\t * @return string documentation URL\n\t */\n\tpublic function get_documentation_url() {\n\t\treturn 'http://docs.woothemes.com/document/sequential-order-numbers/';\n\t}\n\n\n\t/**\n\t * Gets the plugin configuration URL\n\t *\n\t * @since 1.6\n\t * @see SV_WC_Plugin::get_settings_url()()\n\t * @see SV_WC_Plugin::get_settings_link()\n\t * @param string $plugin_id optional plugin identifier. Note that this can be a\n\t * sub-identifier for plugins with multiple parallel settings pages\n\t * (ie a gateway that supports both credit cards and echecks)\n\t * @return string plugin settings URL\n\t */\n\tpublic function get_settings_url( $plugin_id = null ) {\n\t\treturn SV_WC_Plugin_Compatibility::get_general_configuration_url();\n\t}\n\n\n\t/**\n\t * Returns true if on the admin tab configuration page\n\t *\n\t * @since 1.6\n\t * @see SV_WC_Plugin::is_plugin_settings()\n\t * @return boolean true if on the admin plugin settings page\n\t */\n\tpublic function is_plugin_settings() {\n\t\treturn SV_WC_Plugin_Compatibility::is_general_configuration_page();\n\t}\n\n\n\t/** Lifecycle methods ******************************************************/\n\n\n\t/**\n\t * Run every time. Used since the activation hook is not executed when updating a plugin\n\t *\n\t * @see SV_WC_Plugin::install()\n\t */\n\tprotected function install() {\n\n\t\tif ( false === get_option( 'woocommerce_order_number_start' ) ) {\n\t\t\t// initial installation (can't use woocommerce_sequential_order_numbers_pro_version unfortunately as older versions of the plugins didn't use this option)\n\n\t\t\t// if the free sequential order numbers plugin is installed and active, deactivate it\n\t\t\tif ( $this->is_plugin_active( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php' ) ) {\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t\t\tdeactivate_plugins( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php' );\n\t\t\t}\n\n\t\t\t// initial install, set the order number for all existing orders to the post id:\n\t\t\t// page through the \"publish\" orders in blocks to avoid out of memory errors\n\t\t\t$offset = (int) get_option( 'wc_sequential_order_numbers_pro_install_offset', 0 );\n\t\t\t$posts_per_page = 500;\n\t\t\tdo {\n\t\t\t\t// grab a set of order ids\n\t\t\t\t$order_ids = get_posts( array( 'post_type' => 'shop_order', 'fields' => 'ids', 'offset' => $offset, 'posts_per_page' => $posts_per_page ) );\n\n\t\t\t\t// some sort of bad database error: deactivate the plugin and display an error\n\t\t\t\tif ( is_wp_error( $order_ids ) ) {\n\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t\t\t\tdeactivate_plugins( 'woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php' ); // hardcode the plugin path so that we can use symlinks in development\n\n\t\t\t\t\twp_die( sprintf( __( 'Error activating and installing <strong>WooCommerce Sequential Order Numbers Pro</strong>: %s', self::TEXT_DOMAIN ), '<ul><li>' . implode( '</li><li>', $order_ids->get_error_messages() ) . '</li></ul>' ) .\n\t\t\t\t\t '<a href=\"' . admin_url( 'plugins.php' ) . '\">' . __( '&laquo; Go Back', self::TEXT_DOMAIN ) . '</a>' );\n\t\t\t\t}\n\n\t\t\t\t// otherwise go through the results and set the order numbers\n\t\t\t\tif ( is_array( $order_ids ) ) {\n\t\t\t\t\tforeach( $order_ids as $order_id ) {\n\n\t\t\t\t\t\t$order_number = get_post_meta( $order_id, '_order_number', true );\n\t\t\t\t\t\t$order_number_formatted = get_post_meta( $order_id, '_order_number_formatted', true );\n\n\t\t\t\t\t\tif ( '' === $order_number && '' === $order_number_formatted ) {\n\t\t\t\t\t\t\t// pre-existing order, set _order_number/_order_number_formatted\n\t\t\t\t\t\t\tadd_post_meta( $order_id, '_order_number', $order_id );\n\t\t\t\t\t\t\tadd_post_meta( $order_id, '_order_number_formatted', $order_id );\n\t\t\t\t\t\t} elseif ( '' === $order_number_formatted ) {\n\t\t\t\t\t\t\t// an order from the free sequential order number plugin, add the _order_number_formatted field\n\t\t\t\t\t\t\tadd_post_meta( $order_id, '_order_number_formatted', $order_number );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// increment offset\n\t\t\t\t$offset += $posts_per_page;\n\t\t\t\t// and keep track of how far we made it in case we hit a script timeout\n\t\t\t\tupdate_option( 'wc_sequential_order_numbers_pro_install_offset', $offset );\n\t\t\t} while( count( $order_ids ) == $posts_per_page ); // while full set of results returned (meaning there may be more results still to retrieve)\n\n\t\t\t// set the best order number start value that we can\n\t\t\tglobal $wpdb;\n\t\t\t$order_number = (int) $wpdb->get_var( \"SELECT MAX(CAST(meta_value AS SIGNED)) FROM {$wpdb->postmeta} WHERE meta_key='_order_number'\" );\n\t\t\tadd_option( 'woocommerce_order_number_start', $order_number ? $order_number + 1 : 1 );\n\t\t}\n\n\t\t// free order number index\n\t\tif ( false === get_option( 'woocommerce_free_order_number_start' ) ) {\n\t\t\tadd_option( 'woocommerce_free_order_number_start', 1 );\n\t\t}\n\t}\n\n\n\t/**\n\t * Handles upgrades\n\t *\n\t * @since 1.5\n\t * @see SV_WC_Plugin::upgrade()\n\t * @param string $installed_version the currently installed version\n\t */\n\tprotected function upgrade( $installed_version ) {\n\n\t\t// hash before order number option was added in 1.5\n\t\tif ( version_compare( $installed_version, '1.5', '<' ) ) {\n\t\t\tadd_option( 'woocommerce_hash_before_order_number', 'yes' );\n\t\t}\n\n\t\t// in this version we dropped the order_number_length frontend setting in favor of accepting zero padding right in the order number start value\n\t\tif ( version_compare( $installed_version, '1.5.5', '<' ) ) {\n\n\t\t\t$order_number_start = get_option( 'woocommerce_order_number_start' );\n\t\t\t$order_number_length = get_option( 'woocommerce_order_number_length' );\n\n\t\t\tif ( $order_number_length > strlen( $order_number_start ) ) {\n\n\t\t\t\t// option 1: an order number length is configured which is longer than the size of the current order number,\n\t\t\t\t// update the order number start value to include the padding so it renders correctly on the frontend\n\t\t\t\tupdate_option( 'woocommerce_order_number_start', $this->format_order_number( $order_number_start, '', '', $order_number_length ) );\n\n\t\t\t} elseif ( strlen( $order_number_start ) > $order_number_length ) {\n\n\t\t\t\t// option 2: starting order number is longer than the configured order number length, so update the length setting\n\t\t\t\tupdate_option( 'woocommerce_order_number_length', strlen( $order_number_start ) );\n\t\t\t}\n\n\t\t}\n\t}\n\n} // end WC_Seq_Order_Number_Pro class\n\n\n/**\n * The WC_Seq_Order_Number_Pro global object\n * @name $wc_seq_order_number_pro\n * @global WC_Seq_Order_Number_Pro $GLOBALS['wc_seq_order_number_pro']\n */\n$GLOBALS['wc_seq_order_number_pro'] = new WC_Seq_Order_Number_Pro();\n\n}", "public function __construct(array $getAdjustmentsV3Return = array())\n {\n $this\n ->setGetAdjustmentsV3Return($getAdjustmentsV3Return);\n }", "public function __construct($request) {\n\t\tif($request instanceof PENSRequest) {\n\t\t\t$this->_id = 0;\n\t\t\t$this->_pens_version = $request->getPensVersion();\n\t\t\t$this->_package_type = $request->getPackageType();\n\t\t\t$this->_package_type_version = $request->getPackageTypeVersion();\n\t\t\t$this->_package_format = $request->getPackageFormat();\n\t\t\t$this->_package_id = $request->getPackageId();\n\t\t\t$this->_client = $request->getClient();\n\t\t\t$this->_vendor_data = $request->getVendorData();\n\t\t\t$this->_package_name = $request->getFilename();\n\t\t} else if(is_array($request)) {\n\t\t\t$this->_id = $request['id'];\n\t\t\t$this->_pens_version = $request['pens_version'];\n\t\t\t$this->_package_type = $request['package_type'];\n\t\t\t$this->_package_type_version = $request['package_type_version'];\n\t\t\t$this->_package_format = $request['package_format'];\n\t\t\t$this->_package_id = $request['package_id'];\n\t\t\t$this->_client = $request['client'];\n\t\t\t$this->_vendor_data = $request['vendor_data'];\n\t\t\t$this->_package_name = $request['package_name'];\n\t\t\t$this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC'));\n\t\t\tif(!empty($request['updated_at'])) {\n\t\t\t\t$this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC'));\n\t\t\t}\n\t\t}\n\t}", "public function getCorrectionAmount()\n {\n return $this->correctionAmount;\n }", "public function __construct($number)\n {\n $this->number = $number;\n $this->validate();\n }", "public function getInvoiceCorrectionRevisionNumber()\n {\n $value = $this->get(self::INVOICECORRECTIONREVISIONNUMBER);\n return $value === null ? (string)$value : $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the startDateTime property value. UTC time when the segment started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
public function setStartDateTime(?DateTime $value): void { $this->getBackingStore()->set('startDateTime', $value); }
[ "Public Function setStarttime(DateTime $start) { $this->starttime = $start; }", "public function setDateTimeStart($value) { // sets the dateTimeStart\r\n\t\t$this->dateTimeStart = $value;\r\n\t\t\r\n\t\t$this->dateTimeStartConvert = date(\"Y/m/d 00:00:00\", strtotime($this->dateTimeStart)); \r\n\t}", "public function setStart(DateTime $start)\n {\n $this->start = $start;\n }", "public function setStartDateTime($var)\n {\n GPBUtil::checkString($var, True);\n $this->start_date_time = $var;\n\n return $this;\n }", "public function SetStartTime($start)\n\t{\n\t\t$this->startTime = $start;\n\t}", "public function setStartDateTime($startDateTime = null)\n {\n // validation for constraint: string\n if (!is_null($startDateTime) && !is_string($startDateTime)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startDateTime, true), gettype($startDateTime)), __LINE__);\n }\n if (is_null($startDateTime) || (is_array($startDateTime) && empty($startDateTime))) {\n unset($this->StartDateTime);\n } else {\n $this->StartDateTime = $startDateTime;\n }\n return $this;\n }", "public function setStartedDateTime($val)\n {\n $this->_propDict[\"startedDateTime\"] = $val;\n return $this;\n }", "public function setDateTimeStart(\\DateTime $dateTime)\n {\n $this->dateTimeStart = $dateTime;\n }", "protected function setStartTime()\n {\n $date_is_valid = $this->setDate();\n $time_is_valid = $this->setTime();\n \n if ( ! $date_is_valid || ! $time_is_valid ) {\n return;\n }\n \n // Convert the separate date and time strings to a single UNIX datetime value\n $timestamp = ( strtotime( $this->date->getFormatted() ) + $this->time->getSeconds() );\n $this->data['start_time'] = date( 'Y-m-d H:i:s', $timestamp );\n $this->record->set('start_time', $this->data['start_time']);\n }", "public function setOfferStartDateTimeInUTC($val)\n {\n $this->_propDict[\"offerStartDateTimeInUTC\"] = $val;\n return $this;\n }", "public function setStartAt(?string $startAt): void\n {\n $this->startAt = $startAt;\n }", "public function setTimeBegan(?DateTime $value): void {\n $this->getBackingStore()->set('timeBegan', $value);\n }", "public function setStartTime(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->start_time = $var;\n }", "function setStartTime() {\n\t\t$this->start_time = XMLGlobal::_getMicroTime();\n\t}", "public function starttimeCanBeSet()\n {\n $value = new \\DateTime('2014-03-30');\n $this->instance->setStarttime($value);\n $this->assertEquals($value, $this->instance->getStarttime());\n }", "public function set_start_time($start_time) {\n\t\t$this->start_time = $start_time;\n\t}", "public function setStartTimeOffset($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->start_time_offset = $var;\n\n return $this;\n }", "public function setAvailabilityStartDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('availabilityStartDateTime', $value);\n }", "function set_start_time($new_start_time){\n\t\t$this->start_time=$new_start_time;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get course users based on the specified constraints, but include unassigned users as well. Assigned users have the flag 'has_course' set to 1
public function getCourseUsersIncludingUnassigned($constraints = array()) { !empty($constraints) OR $constraints = array('archive' => false, 'active' => true); list($where, $limit, $orderby) = EfrontUser :: convertUserConstraintsToSqlParameters($constraints); $where[] = "user_type != 'administrator'"; $select = "u.*, r.courses_ID is not null as has_course, r.completed,r.score, r.from_timestamp as active_in_course, r.to_timestamp as timestamp_completed, r.role"; $from = "users u left outer join (select completed,score,courses_ID,from_timestamp, to_timestamp,users_LOGIN,user_type as role from users_to_courses where courses_ID='".$this -> course['id']."' and archive=0) r on u.login=r.users_LOGIN"; $result = eF_getTableData($from, $select, implode(" and ", $where), $orderby, false, $limit); if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) { return EfrontUser :: convertDatabaseResultToUserObjects($result); } else { return EfrontUser :: convertDatabaseResultToUserArray($result); } }
[ "public function getCourseUsersAggregatingResultsIncludingUnassigned($constraints = array()) {\n !empty($constraints) OR $constraints = array('archive' => false, 'active' => true);\n list($where, $limit, $orderby) = EfrontUser :: convertUserConstraintsToSqlParameters($constraints);\n $from = \"users u left outer join\n (select users_LOGIN,max(score) as score, max(completed) as completed, 1 as has_course from\n (select uc.user_type as role, uc.score,uc.completed,uc.users_LOGIN from courses c left outer join users_to_courses uc on uc.courses_ID=c.id where (c.id=\".$this -> course['id'].\" or c.instance_source=\".$this -> course['id'].\") and uc.archive=0) foo\n group by users_LOGIN) r on u.login=r.users_login\";\n $result = eF_getTableData($from, \"u.*, r.*\",\n implode(\" and \", $where), $orderby, $groupby, $limit);\n if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {\n return EfrontUser :: convertDatabaseResultToUserObjects($result);\n } else {\n return EfrontUser :: convertDatabaseResultToUserArray($result);\n }\n }", "public function getCourseLessonsIncludingUnassigned($constraints = array()) {\n !empty($constraints) OR $constraints = array('archive' => false, 'active' => true);\n list($where, $limit, $orderby) = EfrontCourse :: convertLessonConstraintsToSqlParameters($constraints);\n\n $from = \"lessons l left outer join (select lessons_ID from lessons_to_courses where courses_ID='\".$this -> course['id'].\"') r on l.id=r.lessons_ID \";\n $select = \"l.*, r.lessons_ID is not null as has_lesson\";\n $where[] = \"l.course_only=1\";\n $result = eF_getTableData($from, $select, implode(\" and \", $where), $orderby, false, $limit);\n\n if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {\n return EfrontCourse :: convertDatabaseResultToLessonObjects($result);\n } else {\n return EfrontCourse :: convertDatabaseResultToLessonArray($result);\n }\n\n }", "private function get_assigned_users()\n {\n global $DB;\n $picturefields = \\user_picture::fields('u');\n $query = \"\n\t\t\tSELECT \n\t\t\t\tDISTINCT \n\t\t\t\t\".$picturefields.\",\n\t\t\t\t\".$DB->sql_fullname('u.firstname', 'u.lastname').\" as fullname,\n\t\t\t\tcua.assignmentid,\n\t\t\t\tcua.timecreated as assignmenttime,\n\t\t\t\tcua.duedate as duedate\n\t\t\tFROM {certif_user_assignments} cua \n\t\t\tJOIN {user} u ON u.id = cua.userid\n\t\t\tWHERE cua.certifid = :certifid\n\t\t\";\n\n $params['certifid'] = $this->id;\n $users = $DB->get_records_sql($query, $params);\n return $users;\n }", "public function countCourseUsers($constraints = array()) {\n !empty($constraints) OR $constraints = array('archive' => false, 'active' => true);\n list($where, $limit, $orderby) = EfrontUser :: convertUserConstraintsToSqlParameters($constraints);\n //$select = \"u.*, uc.courses_ID,uc.completed,uc.score,uc.user_type,uc.from_timestamp as active_in_course, 1 as has_course\";\n $where[] = \"u.login=uc.users_LOGIN and uc.courses_ID='\".$this -> course['id'].\"' and uc.archive=0\";\n $result = eF_countTableData(\"users u, users_to_courses uc\", \"u.login\", implode(\" and \", $where));\n return $result[0]['count'];\n }", "function getCourseUsers($course_id)\n {\n }", "function get_course_users() {\n\t\t$user_list = CourseManager::get_user_list_from_course_code ( api_get_course_id () );\n\t\treturn $user_list;\n\t}", "protected function _getRelevantUsers()\n {\n $users = new ArrayCollection();\n\n foreach ($this->_getPhpEnabledDomainsAndSubdomains() as $obj) {\n if (!$users->contains($obj->getUser())) {\n $users->add($obj->getUser());\n }\n }\n\n return $users;\n }", "function fetch_course_users($courseid){\n\tglobal $CFG,$DB;\n\n\t\t\n\t\t//get course and require requester is logged in\n\t\tif (! $course = $DB->get_record('course', array('id' => $courseid))) {\n\t\t\tprint_error('invalidcourseid');\n\t\t}\n\t\trequire_course_login($course);\n\n\n\t\t//fetch course context\n\t\t$coursecontext = \\context_course::instance($courseid);\n\n //fetch user objects for all users in course\n\t\t//'u.id, u.username, u.firstname, u.lastname, u.picture'\n\t\t$users = get_users_by_capability($coursecontext, 'moodle/user:viewdetails');\n\n\t\t//usersummary variable\n\t\t$usersummary =\"\";\n\t\t\n\t\t//set up xml to return\n\t\t$xml_output = \"<pairsets>\\n\";\n\t\t$pairstreamname = rand(1000000, 9999999);\n\t\t$xml_output .= \"\\t<pair name='$pairstreamname' dirty='false'>\\n\";\n\n\t\t//fill with user \"pairelements\"\n\t\tforeach ($users as $user) {\n\t\t\t\t\t $xml_output .= \"\\t\\t<pairelement username='\" . $user->username. \n\t\t\t\t\t\t\t\t\t\t\"' showname='\" . fullname($user) .\n\t\t\t\t\t\t\t\t\t\t\"' pictureurl='\" . fetch_user_picture($user,120) . \n\t\t\t\t\t\t\t\t\t\t\"' />\\n\";\n\t\t\t\t\tif ($usersummary == \"\"){\n\t\t\t\t\t\t\t$usersummary .= $user->username;\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$usersummary .= \";\" . $user->username;\t\t\t\t\t\n\t\t\t\t\t}\n\t\t}\n\t\t//close our list of users in the pairset\n\t\t$xml_output .= \"\\t</pair>\\n\";\n\n\t\t//We also provide a summary of all the users in this course\n\t\t//so that the laszlo client doesn't need to xml divine it\n\t\t$xml_output .= \"\\t<usersummary>\\n\";\n\t\t$xml_output .= $usersummary;\n\t\t$xml_output .= \"\\t</usersummary>\\n\";\n\t\t$xml_output .= \"</pairsets>\";\n\n\t\t//Return the data\n\t\treturn $xml_output;\n\t}", "function cma_get_users() {\n global $PAGE, $DB;\n $courseid = $PAGE->course->id;\n $role = $DB->get_record('role', array('shortname' => 'student'));\n $context = context_course::instance($courseid);\n $users = get_role_users($role->id, $context, false, '', '', false);\n return $users;\n}", "function get_course_users($courseid)\n{\n global $CFG, $DB;\n\n $contextid = get_context_instance(CONTEXT_COURSE, $courseid);\n\n $sql = \"SELECT u.id\n FROM mdl_user u, mdl_role_assignments r\n WHERE u.id=r.userid AND r.contextid = {$contextid->id};\";\n\n $results = $DB->get_records_sql($sql, array());\n $return = array();\n foreach($results as $result)\n {\n $return[] = $result->id;\n }\n return $return;\n}", "function getUserListbyCourse($course_id) {\n $users = $this->find('first', array(\n 'conditions' => array('Course.id' => $course_id),\n 'contain' => array('Enrol')\n ));\n return Set::extract($users, '/Enrol/id');\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "function retrieve_course_user_relations($condition = null, $offset = null, $count = null, $order_property = null);", "private function getUsersSubscriptions()\n {\n $em = Database::getManager();\n $course = $em->find('ChamiloCoreBundle:Course', $this->courseId);\n\n if ($this->sessionId) {\n $criteria = Criteria::create()->where(Criteria::expr()->eq('course', $course));\n\n return $em\n ->find('ChamiloCoreBundle:Session', $this->sessionId)\n ->getUserCourseSubscriptions()\n ->matching($criteria);\n }\n\n return $em\n ->find('ChamiloCoreBundle:Course', $course)\n ->getUsers();\n }", "public function availableUsers()\n {\n return User::query()->whereNotIn('id', function ($query) {\n /** @var Builder $query */\n return $query->select('cp.user_id')\n ->from('card_participants AS cp')\n ->where('cp.card_id', '=', $this->id);\n })->get();\n }", "function mysupport_get_assign_users()\r\n{\r\n\tglobal $db, $cache;\r\n\t\r\n\t// who can be assigned threads??\r\n\t$groups = $cache->read(\"usergroups\");\r\n\tforeach($groups as $group)\r\n\t{\r\n\t\tif($group['canbeassigned'] == 1)\r\n\t\t{\r\n\t\t\t$assign_groups[] = intval($group['gid']);\r\n\t\t}\r\n\t}\r\n\t\r\n\t$assign_users = array();\r\n\t// only continue if there's one or more groups that can be assigned threads\r\n\tif(!empty($assign_groups))\r\n\t{\r\n\t\t$assigngroups = \"\";\r\n\t\t$assigngroups = implode(\",\", array_map(\"intval\", $assign_groups));\r\n\t\t$assign_concat_sql = \"\";\r\n\t\tforeach($assign_groups as $assign_group)\r\n\t\t{\r\n\t\t\tif(!empty($assign_concat_sql))\r\n\t\t\t{\r\n\t\t\t\t$assign_concat_sql .= \" OR \";\r\n\t\t\t}\r\n\t\t\t$assign_concat_sql .= \"CONCAT(',',additionalgroups,',') LIKE '%,{$assign_group},%'\";\r\n\t\t}\r\n\t\t\r\n\t\t$query = $db->simple_select(\"users\", \"uid, username\", \"usergroup IN (\" . $db->escape_string($assigngroups) . \") OR displaygroup IN (\" . $db->escape_string($assigngroups) . \") OR {$assign_concat_sql}\");\r\n\t\twhile($assigned = $db->fetch_array($query))\r\n\t\t{\r\n\t\t\t$assign_users[$assigned['uid']] = $assigned['username'];\r\n\t\t}\r\n\t}\r\n\treturn $assign_users;\r\n}", "public function get_users_with_active_tasks() {\r\n\r\n global $DB;\r\n if ($usersid = get_enrolled_users(\r\n context_module::instance($this->cm->id),\r\n 'mod/poasassignment:havetask',\r\n groups_get_activity_group($this->cm, true),\r\n 'u.id')) {\r\n\r\n $usersid = array_keys($usersid);\r\n }\r\n $enrolledusers = $this->get_course_users();\r\n // Add users that haven't capability but have task\r\n $assignees = $DB->get_records('poasassignment_assignee', array('poasassignmentid'=>$this->poasassignment->id, 'cancelled' => 0), 'id', 'id, userid, taskid');\r\n foreach ($assignees as $assignee) {\r\n if ($assignee->taskid > 0 && array_search($assignee->userid, $usersid) === false && in_array($assignee->userid, $enrolledusers)) {\r\n if (!has_capability('mod/poasassignment:havetask', $this->get_context(), $assignee->userid))\r\n array_push($usersid, $assignee->userid);\r\n }\r\n }\r\n return $usersid;\r\n }", "public function getUsersWithNoAssignedDepartment()\n {\n return $this->model->whereDoesntHave('departments')->orderBy('surname')->orderBy('first_name')->get();\n }", "public function getCoursess($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collCoursess === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collCoursess = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(CoursesPeer::USER_ID, $this->id);\n\n\t\t\t\tCoursesPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collCoursess = CoursesPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(CoursesPeer::USER_ID, $this->id);\n\n\t\t\t\tCoursesPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastCoursesCriteria) || !$this->lastCoursesCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collCoursess = CoursesPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastCoursesCriteria = $criteria;\n\t\treturn $this->collCoursess;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a Grid from a SQL Query (or Zend_Db_Select), if you don't submit a Db Adapter it will try to create from Gecko_DB(Singleton), or it will look for a 'db' entry in Zend_Registry
public static function createFromSQL($name, $sql, $db = null) { if( $db === null ) { // Try to create try { $db = Gecko_DB::getInstance(); } catch( Zend_Db_Exception $zde ) { if(Zend_Registry::isRegistered('db')) { $db = Zend_Registry::get('db'); } } if( $db === null ) { // DB still not set Throw a error throw new Gecko_DataGrid_Exception('$db it\'s not set, check the documentation'); } } /** Check if it's a select object **/ if($sql instanceof Zend_Db_Select) { $sql = $sql->__toString(); } require_once('Gecko/DataSource/Table/SQL.php'); $model = new Gecko_DataSource_Table_SQL($sql, $db); $grid = new self($name, $model); return $grid; }
[ "private function createQuery() {\n $this->query = new Query($this->sql, $this->attributesArray);\n }", "protected function createQueryObject()\n {\n $this->query = Zig_Model_Query::create();\n }", "abstract public function newQuery();", "public function createDatagrid($name);", "function sql_grid($controller, $params=array()){\n return DSQLGrid::render($controller, $params); \n }", "public function createQuery() {\n $queryArr = array();\n\n $this->addSelect($queryArr);\n $this->addFrom($queryArr);\n $this->addWhere($queryArr);\n $this->addGroupBy($queryArr);\n $this->addSortBy($queryArr);\n $this->addHaving($queryArr);\n\n $this->query = implode(' ', $queryArr) . ';';\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n $selectClause = $this->_query->getAST()->selectClause;\n if (count($selectClause->selectExpressions) == 0) {\n throw new Pike_Exception('The grid query should contain at least one column, none found.');\n }\n\n /* @var $selExpr Doctrine\\ORM\\Query\\AST\\SelectExpression */\n foreach ($selectClause->selectExpressions as $selExpr) {\n\n /**\n * Some magic needs to happen here. If $selExpr isn't a instanceof\n * Doctrine\\ORM\\Query\\AST\\PathExpression then it might be a custom\n * expression like a vendor specific function. We could use the\n * $selExpr->fieldIdentificationVariable member which is the alias\n * given to the special expression but sorting at this field\n * could cause strange effects.\n *\n * For instance: SELECT DATE_FORMAT(datefield,\"%Y\") AS alias FROM sometable\n *\n * When you say: ORDER BY alias DESC\n *\n * You could get other results when you do:\n *\n * ORDER BY sometable.datefield DESC\n *\n * My idea is to rely on the alias field by default because it would\n * suite for most queries. If someone would like to retrieve this expression\n * specific info they can add a field filter. $ds->addFieldFilter(new DateFormat_Field_Filter(), 'expression classname');\n *\n * And info of the field would be extracted from this class, something like that.\n */\n\n $expr = $selExpr->expression;\n\n /* @var $expr Doctrine\\ORM\\Query\\AST\\PathExpression */\n if ($expr instanceof Doctrine\\ORM\\Query\\AST\\PathExpression) {\n // Check if field alias is available\n if (null !== $selExpr->fieldIdentificationVariable) {\n // Set field alias as column name\n $name = $selExpr->fieldIdentificationVariable;\n\n // Set field alias as label\n $label = $selExpr->fieldIdentificationVariable;\n } else {\n // Set field name as column name\n $name = $expr->field;\n\n // Set field name as label\n $label = $expr->field;\n }\n\n $sidx = $name;\n } else {\n $name = $selExpr->fieldIdentificationVariable;\n $label = $name;\n $sidx = null;\n }\n\n $this->columns->add($name, $label, $sidx);\n }\n }", "public function prepareGrid();", "public function createQuery() {}", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "public function grid()\n\t{\n\t\t$query = \"\n\t\tSELECT \n\t\t\tcli.cliente Clave, cli.razonSocial 'Razon Social', cli.rfc RFC, cli.direccionFiscal 'Direccion Fiscal', cli.activo Activo\n\t\tFROM\n\t\t\templeados cli;\";\n\t\treturn $this->db->query($query);\n\t}", "private function createGrid()\r\n {\r\n $builder = $this->getService('grid')->create($this->getRequest());\r\n $builder->setFormatter(new BasicGridFormatter('location',$this->isAllow(4)));//prefix\r\n $builder->setDataManager(new BasicDataManager(\r\n $this->getDoctrine()->getEntityManager()\r\n , 'Entity\\Location'\r\n ));\r\n\r\n $builder->setLimit(10);\r\n\r\n $builder->addColumn(new Column('id','#'));\r\n $builder->addColumn(new Column('name','Name'));\r\n $builder->addColumn(new Column('city','City'));\r\n $builder->addColumn(new Column('street','Street'));\r\n $builder->addColumn(new Column('number','Number'));\r\n\r\n $builder->addColumn(new Column('id','Action', new LocationIndexColumnFormatter('location', array('edit'), $this->getUser()),array()));\r\n return $builder;\r\n }", "function createPaginatorAdapter($query);", "public function init()\n {\n $this->select = $this->adapter->select()\n ->from($this->table->info('name'));\n }", "abstract protected function initQuery();", "public function __construct($sql, $sql_key=array(), $sql_table='', $db_connection= array()){\r\n\r\n if(!is_array($sql_key)) $sql_key = array($sql_key); // convert $sql_key to array if it's not an array\r\n\r\n $this->jq_gridName = ($sql_table == '')?'list1':$sql_table;\r\n\r\n if(!is_array($sql)){\r\n //set the default database from conf if no new connection\r\n if(empty($db_connection)) {\r\n $this->db = new C_DataBase(PHPGRID_DB_HOSTNAME, PHPGRID_DB_USERNAME, PHPGRID_DB_PASSWORD, PHPGRID_DB_NAME, PHPGRID_DB_TYPE,PHPGRID_DB_CHARSET);\r\n }\r\n // else establish new connection and store the connection\r\n else {\r\n $this->db = new C_DataBase($db_connection[\"hostname\"],\r\n $db_connection[\"username\"],\r\n $db_connection[\"password\"],\r\n $db_connection[\"dbname\"],\r\n $db_connection[\"dbtype\"],\r\n $db_connection[\"dbcharset\"]);\r\n $this->db_connection = $db_connection;\r\n }\r\n $this->jq_datatype = 'json';\r\n $this->jq_url = '\"'. ABS_PATH .'/data.php?dt='. $this->jq_datatype .'&gn='. $this->jq_gridName .'\"'; // Notice double quote\r\n $this->jq_mtype = 'GET';\r\n }else{\r\n $this->db = new C_DataArray($sql);\r\n $this->jq_datatype = 'local';\r\n $this->data_local = $sql;\r\n }\r\n\r\n $this->sql = $sql;\r\n $this->sql_key = $sql_key;\r\n $this->sql_fkey = null;\r\n $this->sql_table = $sql_table;\r\n\r\n // $this->_num_rows = 0;//$this->db->num_rows($this->db->db_query($sql));\r\n // $results = $this->db->select_limit($sql,1, 1);\r\n // $this->_num_fields = $this->db->num_fields($results);\r\n\r\n // grid columns properties\r\n $this->col_hiddens = array();\r\n $this->col_titles = array();\r\n $this->col_readonly = array();\r\n $this->col_required = array();\r\n $this->col_links = array();\r\n $this->col_dynalinks = array();\r\n $this->col_dbnames = array();\r\n $this->col_edittypes = array();\r\n $this->col_formats = array();\r\n $this->col_widths = array();\r\n $this->col_aligns = array();\r\n $this->col_wysiwyg\t\t\t= array();\r\n $this->col_default\t\t\t= array();\r\n $this->col_frozen\t\t\t= array();\r\n $this->col_edit_dimension\t= array();\r\n $this->col_fileupload\t\t= array();\r\n $this->col_virtual\t\t\t= array();\r\n $this->col_customrule\t\t= array();\r\n $this->col_autocomplete = array();\r\n $this->col_nested_dd = array();\r\n\r\n $this->jq_summary_col_name=array();\r\n $this->col_imgs = array();\r\n\r\n // jqgrid\r\n $this->jq_colNames = array();\r\n $this->jq_colModel = array();\r\n $this->jq_pagerName = '\"#'. $this->jq_gridName .'_pager1\"'; // Notice the double quote\r\n $this->jq_rowNum = 20;\r\n $this->jq_rowList = array(10, 20, 30, 50, 100);\r\n $this->jq_sortname = 1;\t// sort by the 1st column\r\n $this->jq_sortorder = 'asc';\r\n $this->jq_viewrecords = true;\r\n $this->jq_multiselect = false;\r\n $this->jq_autowidth = false;\r\n $this->jq_width = 1000;\r\n $this->jq_height = '100%';\r\n $this->jq_caption = $sql_table .'&nbsp;';\r\n $this->jq_altRows = true;\r\n $this->jq_scrollOffset = 22;\r\n $this->jq_cellEdit = false;\r\n $this->jq_editurl = '';\r\n $this->jq_rownumbers = false;\r\n $this->jq_shrinkToFit = true;\r\n $this->jq_scroll = false;\r\n $this->jq_hiddengrid= false;\r\n $this->jq_loadtext = 'Loading phpGrid ...';\r\n $this->jq_gridview = true;\r\n $this->jq_grouping = false;\r\n $this->jq_group_summary_show=false;\r\n $this->jq_direction='ltr';\r\n $this->jq_groupcollapse='false';\r\n $this->jq_summary_type ='';\r\n $this->jq_showSummaryOnHide=false;\r\n $this->jq_is_group_summary=false;\r\n\r\n // jquery ui (currently in beta in jqgrid 3.6.4)\r\n $this->jqu_resize = array('is_resizable'=>false,'min_width'=>500,'min_height'=>100);\r\n\r\n $this->_num_rows = 0; // values are updated in display()\r\n $this->_num_fields = 0; // values are updated in display()\r\n $this->_ver_num = 'phpGrid(v6.5b2) {jqGrid:v4.6, jQuery:v1.11.0, jQuery UI:1.10.0}';\r\n $this->sys_msg = null;\r\n $this->form_width\t\t\t= 1000;\r\n $this->form_height\t\t\t= '100%';\t\t// invalide height, jqgrid will resize the height to best fit the dialog.\r\n $this->alt_colors = array('hover'=>'#eeeeee', 'highlight'=>'#ffffff', 'altrow'=>'#eeeeee');\r\n $this->theme_name = (defined('THEME'))?THEME:'cobalt';\r\n $this->locale = 'es';\r\n $this->auto_resize\t\t\t= false;\r\n $this->kb_nav\t\t\t\t= false;\r\n $this->export_type\t\t\t= null;\r\n $this->export_url\t\t\t= ABS_PATH .'/export.php?dt='. $this->jq_datatype .'&gn='.$this->jq_gridName;\r\n $this->edit_mode\t\t\t= 'NONE';\r\n $this->edit_options\t\t\t= null;\r\n $this->has_tbarsearch\t\t= false;\r\n $this->advanced_search\t\t= false;\r\n $this->debug = C_Utility::is_debug();\r\n $this->cust_prop_jsonstr\t= '';\r\n $this->obj_subgrid\t\t\t= null;\r\n $this->obj_md\t\t\t\t= null;\r\n\r\n $this->jq_rowConditions\t\t= array();\r\n $this->jq_cellConditions\t= array();\r\n\r\n $this->script_includeonce\t= '';\r\n $this->script_body\t\t\t= '';\r\n $this->script_editEvtHandler= '';\r\n // $this->script_addEvtHandler\t= '';\r\n $this->script_ude_handler\t= '';\r\n\r\n $this->cust_col_properties\t= array();\r\n $this->cust_grid_properties = array();\r\n $this->grid_methods = array();\r\n\r\n $this->edit_file = 'edit.php';\r\n\r\n $this->before_script_end = '';\r\n }", "public function getGridBuilder($name);", "protected function grid()\n {\n $grid = new Grid(new Paper());\n\n $grid->column('id', 'Id');\n $grid->column('author', '作者');\n $grid->column('total', '数量');\n $grid->column('description', '详情')->hide();\n $grid->column('title', '标题');\n $grid->column('type', '试卷类型')->using(Paper::$paperType);\n $grid->column('created_at', '创建时间');\n $grid->column('updated_at', '更新时间')->hide();\n\n $grid->tools(function ($tools) {\n $tools->append(new Import());\n });\n\n $grid->disableCreateButton();\n\n return $grid;\n }", "protected function _createSelectQuery() {\n return SelectQuery::create($this->_connection);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Not Support Action System will trigger this action when Google API Client Library cant run on this servicer software
public function notSupportAction($messages = array()) { if(empty($messages)) { $messages = array( langBup::_('Your server is not support Google API Client Library.'), langBup::_(sprintf('Your PHP version: %s (5.2.1 or higher required)', PHP_VERSION)), langBup::_('PHP JSON extension required'), ); } elseif(!is_array($messages)) { $messages = array($messages); } return $this->getView()->getContent('gdrive.notSupport', array( 'messages' => nl2br(implode(PHP_EOL, $messages)), )); }
[ "public function unable();", "public function forbidOperation();", "public function unsupported()\n {\n Mage::app()->getResponse()\n ->setHeader('HTTP/1.1', '403 Forbidden')\n ->sendResponse();\n echo 'This request type is currently unsupported';\n exit;\n }", "public function invalidTask()\n\t{\n\t\tthrow new RuntimeException(JText::_('JERROR_ALERTNOAUTHOR'), 403);\n\t}", "public function sendServiceUnavailableStatus() {\n $Config = GiroCheckout_SDK_Config::getInstance();\n\n if($Config->getConfig('DEBUG_MODE')) GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationOutput('sendServiceUnavailableStatus');\n header('HTTP/1.1 503 Service Unavailable');\n }", "function tve_dash_is_google_fonts_blocked() {\n\treturn (bool) get_option( 'tve_google_fonts_disable_api_call', '' );\n}", "private function _setWarning() {\n\n $reflector = new \\ReflectionClass('Google_Client');\n $pluginBasename = wp_normalize_path( plugin_basename( $reflector->getFileName() ) );\n\n // Check if get_plugins() function exists. This is required on the front end of the\n // site, since it is in a file that is normally only loaded in the admin.\n if ( ! function_exists( 'get_plugins' ) ) {\n require_once ABSPATH . 'wp-admin/includes/plugin.php';\n }\n\n $pluginBasenameParts = explode( '/', $pluginBasename );\n $pluginName = __( \"UNDEFINED\", ud_get_stateless_media()->domain );\n\n foreach( get_plugins() as $path => $meta ) {\n if( strpos( $path, trailingslashit( $pluginBasenameParts[0] ) ) === 0 ) {\n $pluginName = $meta['Name'];\n }\n };\n\n $error = sprintf( __( \"%s plugin may have potential Google SDK version conflicts with %s plugin. %s is using Google SDK %s, when %s loads old Google SDK version %s.\", ud_get_stateless_media()->domain ),\n \"<b>\" . 'WP-Stateless' . \"</b>\",\n \"<b>\" . $pluginName . \"</b>\",\n 'WP-Stateless',\n \"<b>v2.0</b>\",\n $pluginName,\n \"<b>v\" . \\wpCloud\\StatelessMedia\\Google_Client\\Google_Client::LIBVER . \"</b>\"\n );\n\n set_transient( \"wp_stateless_google_sdk_conflict\", $error );\n }", "public function search_engines_discouraged_notice()\n {\n }", "public function permissionDenied() {\n\t\tthrow new Sit_Exception_Api('Insufficient permission', Sit_Errors::PERMISSION_DENIED);\n\t}", "public static function google_maps_api_key_notice() {\n\t\tif ( '' != get_theme_mod( 'map-behavior-api-key', '' ) || get_option( 'jobify-google-maps-api-notice', false ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_enqueue_script( 'wp-util' );\n?>\n\n<div class=\"jobify-google-maps-api-notice notice notice-error is-dismissible\">\n\t<p><?php printf( \n\t\t__( '<strong>You have not entered a Google Maps API key!</strong> You will not have access to certain features of Jobify. %s', 'jobify' ), \n\t\t'<a href=\"' . esc_url_raw( admin_url( 'customize.php?autofocus[control]=map-behavior-api-key' ) ) . '\">' . __( 'Add an API key &rarr;', 'jobify' ) . '</a>' \n\t); ?></p>\n</div>\n\n<script>\njQuery(function($) {\n\t$( '.jobify-google-maps-api-notice' ).on( 'click', '.notice-dismiss', function(e) {\n\t\te.preventDefault();\n\n\t\twp.ajax.send( 'jobify_google_maps_api_notice_dismiss', {\n\t\t\tdata: {\n\t\t\t\tsecurity: '<?php echo wp_create_nonce( 'jobify-google-maps-api-notice' ); ?>'\n\t\t\t}\n\t\t} );\n\t});\n});\n</script>\n\n<?php\n\t}", "static function service_unavailable()\n {\n header($_SERVER['SERVER_PROTOCOL'] . ' 503 SERVICE UNAVAILABLE',\n true,\n 503);\n exit();\n }", "function actionsImpossibles()\n {\n }", "public function testBadRecommendationMode()\n {\n $this->client->recommendations('bad');\n }", "function hook_salesforce_push_fail() {}", "private static function blockFakeGoogleBots() {\n\t\t$user_agent = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '');\n\t\tif (preg_match('/googlebot/i', $user_agent, $matches)) {\n\t\t\t$ip = self::clientIP();\n\t\t\t$name = gethostbyaddr($ip);\n\t\t\t$host_ip = gethostbyname($name);\n\t\t\tif (preg_match('/googlebot/i', $name, $matches)) {\n\t\t\t\tif ($host_ip != $ip)\n\t\t\t\t\tself::permission_denied();\n\t\t\t} else self::permission_denied();\n\t\t}\n\t}", "public function action403()\n {\n\n }", "function actionNotAllowed() {\r\n\t\t\t$err = 'You are not allow to access the action \"' . $this->getActionName() . '\"';\r\n\t\t\tif ( ! $this->isXmlRpcRequest() ) {\r\n\t\t\t\treturn new IXR_Error( -100002, $err );\r\n\t\t\t} else {\r\n\t\t\t\ttrigger_error( $err, YD_ERROR );\r\n\t\t\t}\r\n\t\t}", "public function testGetNotOk() : void {\n $client = $this->newClient();\n $this->stageResponseAndRequestExpectations(\n null,\n Response::fromName(\"not found\")\n );\n\n $this->expectUncaught(SalesforceException::create(SalesforceException::GET_FAILED));\n $client->get(\"Example\", \"000000000000000000\");\n }", "public function builderGetKeysDeliverFail() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for the default namespace URI
protected function __get_default_ns() { return $this->document->documentElement->namespaceURI; }
[ "protected function getDefaultNamespace() {\n return $this->defaultNamespace;\n }", "public function GetDefaultURI()\n {\n return $this->GetURI( null );\n }", "public function getNamespaceURI();", "public function getDefaultNamespace()\n {\n return $this->defaultNamespace;\n }", "protected function getDefaultNamespace()\n {\n return $this->getRootNamespace();\n }", "public function getDefaultNamespace() {}", "public function getUri()\n {\n return static::TNS;\n }", "public function getDefaultNamespace();", "function getNamespaceURI() {\r\n\r\n\t\treturn $this->namespaceURI;\r\n\r\n\t}", "public function defaultNamespace() {\n\t\t\tif (!$this->_defaultNamespace) {\n\t\t\t\t$this->_defaultNamespace = new MApplicationNamespace(S(\"\"));\n\t\t\t}\n\t\t\treturn $this->_defaultNamespace;\n\t\t}", "public function getBaseUri()\n\t{\n\t\treturn $this->_baseUri ? $this->_baseUri : self::$_defaultBaseUri;\n\t}", "public function getRootURI()\n\t\t{\n\t\t\treturn $this->rootURI;\n\t\t}", "abstract protected function getDefaultNamespace();", "public static function getRootURI() {\n\t\t$inst = self::_ensureInit();\n\t\tif (NULL === $inst->_rootURI)\n\t\t{\n\t\t\t$inst->_rootURI = Config::get('base_href', false);\n\t\t\tif (false === $inst->_rootURI) {\n\t\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n\t\t\t\t\t$protocol = $_SERVER['HTTP_X_FORWARDED_PROTO'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$protocol = (empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') ? 'http' : 'https';\n\t\t\t\t}\n\t\t\t\t$inst->_rootURI = \"{$protocol}://{$_SERVER['HTTP_HOST']}\".preg_replace('#/mfx$#', '/', dirname($_SERVER['PHP_SELF']));\n\t\t\t\tif (!preg_match('#/$#', $inst->_rootURI))\n\t\t\t\t\t$inst->_rootURI .= '/';\n\t\t\t}\n\t\t}\n\t\treturn $inst->_rootURI;\n\t}", "public function setDefaultNamespace($URI);", "public static function getUrlNamespace()\n {\n if ('' === self::$url_namespace && rex_addon::get('url')->isAvailable() && rex_version::compare(\\rex_addon::get('url')->getVersion(), '2.0', '>=')) {\n // URL Addon 2.x\n $manager = \\Url\\Url::resolveCurrent();\n if ($manager instanceof \\Url\\UrlManager && $manager->getProfile() instanceof \\Url\\Profile) {\n self::$url_namespace = $manager->getProfile()->getNamespace();\n }\n }\n return self::$url_namespace;\n }", "public function defaultUri() {\n return array(\n 'path' => eventsign_get_string('base path') . '/' . $this->id,\n );\n }", "public function getBaseUri()\n\t{\n\t\treturn $this->baseUri;\n\t}", "public function getBaseUri() {\n\t\treturn $this->baseUri;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a new swimclub
function addSwimClub() { $success = null ; // Make sure the swimclub doesn't exist yet if (!$this->getSwimclubExists()) { // Construct the insert query $query = sprintf('INSERT INTO %s SET teamname="%s", cluborpoolname="%s", poollength="%s", poolmeasurementunits="%s", poollanes="%s", street1="%s", street2="%s", street3="%s", city="%s", stateorprovince="%s", postalcode="%s", country="%s", primaryphone="%s", secondaryphone="%s", contactname="%s", contactemail="%s", website="%s", googlemapsurl="%s", mapquesturl="%s", notes="%s"', WPST_SWIMCLUBS_TABLE, $this->getTeamName(), $this->getClubOrPoolName(), $this->getPoolLength(), $this->getPoolMeasurementUnits(), $this->getPoolLanes(), $this->getStreet1(), $this->getStreet2(), $this->getStreet3(), $this->getCity(), $this->getStateOrProvince(), $this->getPostalCode(), $this->getCountry(), $this->getPrimaryPhone(), $this->getSecondaryPhone(), $this->getContactName(), $this->getEmailAddress(), $this->getWebSite(), $this->getGoogleMapsURL(), $this->getMapQuestURL(), $this->getNotes()) ; $this->setQuery($query) ; $this->runInsertQuery() ; $success = $this->getInsertId() ; } return $success ; }
[ "function updateSwimClub()\n {\n $success = null ;\n\n // Make sure the swimclub doesn't exist yet\n\n if ($this->getSwimClubExistsById())\n {\n // Construct the insert query\n \n $query = sprintf('UPDATE %s SET\n teamname=\"%s\",\n cluborpoolname=\"%s\",\n poollength=\"%s\",\n poolmeasurementunits=\"%s\",\n poollanes=\"%s\",\n street1=\"%s\",\n street2=\"%s\",\n street3=\"%s\",\n city=\"%s\",\n stateorprovince=\"%s\",\n postalcode=\"%s\",\n country=\"%s\",\n primaryphone=\"%s\",\n secondaryphone=\"%s\",\n contactname=\"%s\",\n contactemail=\"%s\",\n website=\"%s\",\n googlemapsurl=\"%s\",\n mapquesturl=\"%s\",\n notes=\"%s\"\n WHERE swimclubid=\"%s\"',\n WPST_SWIMCLUBS_TABLE,\n $this->getTeamName(),\n $this->getClubOrPoolName(),\n $this->getPoolLength(),\n $this->getPoolMeasurementUnits(),\n $this->getPoolLanes(),\n $this->getStreet1(),\n $this->getStreet2(),\n $this->getStreet3(),\n $this->getCity(),\n $this->getStateOrProvince(),\n $this->getPostalCode(),\n $this->getCountry(),\n $this->getPrimaryPhone(),\n $this->getSecondaryPhone(),\n $this->getContactName(),\n $this->getEmailAddress(),\n $this->getWebSite(),\n $this->getGoogleMapsURL(),\n $this->getMapQuestURL(),\n $this->getNotes(),\n $this->getSwimClubId()\n ) ;\n\n $this->setQuery($query) ;\n $this->runUpdateQuery() ;\n }\n else\n {\n wp_die('Serious database update error encountered.') ;\n }\n\n return true ;\n }", "public function add(Club $club, Request $request)\n\t{\n\t\t$club->sports()->attach($request->input('sport_id'));\n\n\t\t$club->save();\n\n\t\t$request->session()->flash('status', __('Sport ajouté'));\n\t\t$request->session()->flash('status-type', 'success');\n\t\treturn redirect(route('club.edit', ['club' => $club]).'#club-sports-add');\n\t}", "function insertClub($club){\n if (!$club->getId()){ \n $data = array(\n 'club_name' => $club->getName(), \n 'club_string' => $club->getString(), \n 'club_address' => $club->getAddress(), \n 'club_img' => $club->getImg(), \n 'club_season' => $club->getSeason()\n );\n $this->wpdb->insert(\"{$this->t1}\", $data);\n }\n return $this->wpdb->insert_id;\n }", "public function create_club()\n {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'slug' => 'required|string|max:255|unique:club',\n 'rel_club_package_id' => 'required|int|min:1|exists:rel_club_package,id',\n 'vat_rate' => 'int|min:0|max:99',\n 'threshold' => 'int|min:0',\n 'threshold_date' => 'date_format:Y-m-d',\n 'fc_company' => 'string|max:255',\n 'ss_company' => 'string|max:255',\n 'users' => 'array|min:1',\n 'users.*.first_name' => 'string|max:100',\n 'users.*.last_name' => 'string|max:100',\n 'users.*.email' => 'email',\n 'users.*.password' => 'string'\n ],[\n 'title.required' => 'Club name is required.',\n 'slug.required' => 'This URL has been taken.'\n ]);\n\n if (in_array($this->request['slug'], gr_reserved_slugs())) {\n return response()->json('Reserved slug', 403);\n }\n\n $club = new Club;\n $club->franchise_id = $this->franchise_id;\n $club->title = $this->request['title'];\n $club->slug = $this->request['slug'];\n $club->vat_rate = isset($this->request['vat_rate']) ? $this->request['vat_rate'] : 20;\n $club->threshold = isset($this->request['threshold']) ? $this->request['threshold'] : 0;\n $club->threshold_date = isset($this->request['threshold_date']) ? $this->request['threshold_date'] : NULL;\n $club->fc_company = isset($this->request['fc_company']) ? $this->request['fc_company'] : NULL;\n $club->ss_company = isset($this->request['ss_company']) ? $this->request['ss_company'] : NULL;\n\n $this->request->has('address') ? $club->address = $this->request->address : '';\n $this->request->has('address2') ? $club->address2 = $this->request->address2 : '';\n $this->request->has('town') ? $club->town = $this->request->town : '';\n $this->request->has('city') ? $club->city = $this->request->city : '';\n $this->request->has('company_number') ? $club->company_number = $this->request->company_number : '';\n $this->request->has('email') ? $club->email = $this->request->email : '';\n $this->request->has('fa_affiliation') ? $club->fa_affiliation = $this->request->fa_affiliation : '';\n $this->request->has('postcode') ? $club->postcode = $this->request->postcode : '';\n $this->request->has('telephone') ? $club->telephone = $this->request->telephone : '';\n $this->request->has('type') ? $club->type = $this->request->type : '';\n $this->request->has('vat_number') ? $club->vat_number = $this->request->vat_number : '';\n $this->request->has('website') ? $club->website = $this->request->website : '';\n\n $club->save();\n\n //manage image upload\n if (isset($this->request['logo_url']) && !empty($this->request['logo_url']) && $this->request->hasFile('logo_url')) {\n //delete the old image\n if (!empty($club->logo_url)) {\n gr_delete_file($club->logo_url);\n }\n $image = $this->request->file('logo_url');\n $image_url = gr_save_file($image, 'clubs', $club->club_id);\n $club->logo_url = $image_url;\n }\n\n $club->save();\n\n $rel_club_package = RelClubPackage::find($this->request['rel_club_package_id']);\n $rel_club_package->club_id = $club->club_id;\n $rel_club_package->save();\n\n $ageGroups = AgeGroup::all();\n\n // Making relation with age group\n $ageGroups->each(function($ageGroup) use($club){\n $relAgeGroupCLub = new RelAgegroupClub();\n $relAgeGroupCLub->club_id = $club->club_id;\n $relAgeGroupCLub->agegroup_id = $ageGroup->agegroup_id;\n $relAgeGroupCLub->created_by = $this->user_id;\n $relAgeGroupCLub->updated_by = $this->user_id;\n\n $relAgeGroupCLub->save();\n });\n\n //save into subscription history\n $subscription = new SubscriptionHistory;\n $subscription->package_id = $rel_club_package->package_id;\n $subscription->club_id = $club->club_id;\n $subscription->start = $rel_club_package->start_date;\n $subscription->end = $rel_club_package->expire_date;\n $subscription->amount = $rel_club_package->amount;\n $subscription->save();\n\n if (\n isset($this->request['users']) &&\n !empty($this->request['users'])\n ) {\n foreach ($this->request['users'] as $user) {\n if (!empty($user)) {\n $this->create_user($user, $club->club_id);\n }\n }\n }\n\n //make group admin a club admin\n $this->create_user(Auth::user(), $club->club_id);\n\n return response()->json($club, 200);\n }", "function addSLS(){\n\n $sports = $this->getSports();\n $season = $this->getSeason();\n $league = $this->getLeague();\n\n $league_id = $this->db->getInstance(\"server_league\",$league);\n $sport_id = $this->db->getInstance(\"server_sport\",$sports);\n $season_id = $this->db->getInstance(\"server_season\",$season,\"description\");\n\n $sql = \"INSERT INTO server_slseason (league, season, sport)\n VALUES (?,?,?)\";\n\n $this->db->Add_insert_delete_Query($sql,\n array($league_id, $season_id ,$sport_id),\n array(PDO::PARAM_INT, PDO::PARAM_INT,PDO::PARAM_INT));\n\n }", "function createClub($data)\n {\n $clubTb = new ClubData();\n $data['createdate'] = date(FORMAT_DATE);\n $clubTb->insert($data);\n }", "public function addClubMembersAction(){\n $user = $this->getUser();\n \n $club = $user->getSponsorForClubs()[0];\n \n return $this->render(\"MaclayServiceBundle:Club:addMembers.html.twig\", array(\"error\" => \"\", \"clubId\" => $club->getId()));\n }", "public function addNewLub_post(){\n $name = $this->post('name');\n $quantity = $this->post('quantity');\n $selling = $this->post('selling');\n $cost = $this->post('cost');\n $item_type = 'lub';\n\n $result = $this->stock_model->add(array(\"name\" => $name, \"selling_price\" => $selling,\n \"item_type\" => $item_type,\"quantity\"=>$quantity,'cost'=>$cost));\n if ($result === 0) {\n $this->response(\"Item information could not be saved. Try again.\", 404);\n } else {\n $this->response(\"success\", 200);\n }\n }", "public function actionCreate()\n {\n $model = new MotoClubs();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function add_new_team()\r\n\t{\t\r\n\t\t$data = array(\r\n\t 'country_id' => $this->get_country_id(),\r\n\t 'court_id' => $this->get_court_id()\r\n\t\t);\r\n\t\t$this->db->insert('tbl_team', $data);\r\n\t}", "public function addSport() \n\t{\t\n\t\t$this->User->addSport($this->UserRequest->id, $this->dataPost->sport_id);\n\n\t\t$this->setData('Sports add');\n\t}", "function addSports(){\n\n $name = $this->getName();\n\n $sql = \"INSERT INTO server_sport (name)\n VALUES (?)\";\n\n $this->db->Add_insert_delete_Query($sql,\n array($name),\n array(PDO::PARAM_STR));\n\n\n }", "public function addMember($clubID, $personID) {\n\t\t// SQL to add member(id=2) to club(id=1)\n\t\t// INSERT INTO CLUB_PERSON (CLUB_ID, PERSON_ID)\n\t\t// VALUES (1, 2)\n\n\t\t// TODO\n }", "function addRoleForClubAdmin()\n {\n\n\n // Check required Club has Admin\n if (is_null($this->pars->user_used_role_id)) {\n\n $requested_club_admin = $this->checkAdminForClub();\n\n if (count($requested_club_admin)) {\n\n if ($requested_club_admin[\"user_id\"] === REPOSITORY::read(REPOSITORY::CURRENT_USER)[\"id\"]) {\n\n return array(\n \"messageTitle\" => \"Anfrage nicht möglich\",\n \"messageBody\" => \"Sie sind schon Admin für diese Verein!\",\n \"showAlert\" => false\n );\n\n } else {\n\n return array(\n \"messageTitle\" => \"Anfrage nicht möglich\",\n \"messageBody\" => \"Diese verwein verwaltet von anderen user!\",\n \"showAlert\" => false\n );\n\n }\n }\n }\n\n // Fetch All Roles from Repository\n $this->pars->clubs = array(\n array(\n \"status\" => $this->pars->status,\n \"club\" => $this->pars->club,\n \"activity_from\" => NULL,\n \"activity_to\" => NULL,\n \"season\" => NULL,\n \"role\" => intval($this->pars->role),\n \"team\" => array(),\n \"team_group\" => array(),\n \"team_dfb_name\" => array(),\n \"team_dfb_link\" => array(),\n \"user_used_role_id\" => $this->pars->user_used_role_id\n )\n );\n\n\n $this->model->pars = $this->pars;\n $roleData = $this->model->{__FUNCTION__}();\n\n\n // INSERT OR UPDATE\n $clubData = $this->addLocalClub();\n\n\n #print_r($clubData);\n\n\n $report = array();\n\n if (!$roleData->resulta) {\n\n array_push($report, \"Fehler aufgetreten beim Rolle Prozess?\");\n\n\n } else {\n\n if (!$clubData->resulta) {\n array_push($report, \"Fehler aufgetreten beim Club Prozess?\");\n } else {\n\n // Need Data for Club Admin\n\n $new_pars = array();\n\n\n if (is_null($this->pars->user_used_role_id) && empty(is_null($this->pars->user_used_role_id))) {\n\n $new_pars[\"club_id\"] = $clubData->getLastInsert();\n\n $new_pars[\"admin_name\"] = REPOSITORY::read(REPOSITORY::CURRENT_USER)[\"vorname\"];\n $new_pars[\"admin_surname\"] = REPOSITORY::read(REPOSITORY::CURRENT_USER)[\"nachname\"];\n $new_pars[\"status\"] = true;\n $new_pars[\"status_message\"] = NULL;\n $new_pars[\"can_login_from_web\"] = true;\n $new_pars[\"from_at\"] = NULL;\n $new_pars[\"until_to\"] = NULL;\n\n }\n\n $new_pars[\"manager_role\"] = CLUB_MANAGER_ROLE::ADMIN;\n $new_pars[\"register_id\"] = REPOSITORY::read(REPOSITORY::CURRENT_USER)[\"id\"];\n $new_pars[\"dfb_club_id\"] = !is_null($this->pars->club_id) ? $this->pars->club_id : $this->pars->club;\n $new_pars[\"username\"] = $this->pars->username;\n if (!empty($this->pars->password)) {\n\n $helper = new Helper();\n\n $new_pars[\"password\"] = $helper->idEncoder($this->pars->password);\n }\n\n\n #print_r($new_pars );\n $this->model->pars = (object)$new_pars;\n $clubAdmin = $this->model->manageClubAdmin();\n\n\n if (!$clubAdmin->resulta) {\n array_push($report, \"Fehler aufgetreten beim Club Admin Prozess?\");\n }\n\n }\n\n\n }\n\n $user_used_roles_rows = $this->fetchUserUsedRolesRows();\n\n return array(\n \"showAlert\" => false,\n \"fetchUserUsedRolesRows\" => $user_used_roles_rows[\"content\"],\n \"total_role\" => $user_used_roles_rows[\"total_role\"],\n \"messageTitle\" => \"Fehler\",\n \"messageBody\" => implode(\",\", $report),\n \"roles_table_should_reload\" => $roleData->resulta && $roleData->process,\n // \"clubAdminQuery\" => $clubAdmin->getQueryString()\n \"clubAddQuery\" => $clubData->getQueryString()\n );\n\n\n }", "public function create()\n {\n \n \n return view('clubs.create');\n }", "function add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Channel->create();\n\t\t\tif ($this->Channel->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('The Channel has been saved', true));\n\t\t\t\t$this->redirect(array('action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The Channel could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function addUserToClubAction($userId, $clubId){\n try{\n $em = $this->getDoctrine()->getManager();\n \n $user = $em->getRepository(\"MaclayServiceBundle:User\")->findOneById($userId);\n $club = $em->getRepository(\"MaclayServiceBundle:Club\")->findOneById($clubId);\n\n $user->addClub($club);\n $club->addMember($user);\n\n $em->flush();\n \n $response = new Response(json_encode(array(\"added\" => true)));\n $response->headers->set(\"Content-Type\", \"application/json\");\n return $response;\n }\n catch (\\Exception $ee){\n $response = new Response(json_encode(array(\"added\" => $ee->getMessage())));\n $response->headers->set(\"Content-Type\", \"application/json\");\n return $response;\n }\n }", "function addClubToDatabase($ClubName, $ClubCountry, $ClubLeague, $HomeStadium)\r\n{\r\n $result = ['result' => false, 'message' => ''];\r\n if (!$ClubName || !$ClubCountry || !$ClubLeague || !$HomeStadium) {\r\n $result['message'] = \"Please enter all the necessary information\";\r\n } else {\r\n $values = '';\r\n if (ctype_digit($ClubName)) {\r\n $result['message'] = \"Please enter a valid string value for club name!\";\r\n } else {\r\n $tempQuery = \"select max(club_id)+1 as ID from club\";\r\n $tuple = getRecords($tempQuery, true);\r\n $ClubID = $tuple['ID'];\r\n $values = \"$ClubID,'$ClubName'\";\r\n }\r\n\r\n if (ctype_digit($HomeStadium)) {\r\n $result['message'] = \"Please enter a valid string value for club home stadium!\";\r\n } else {\r\n $values .= \",'$HomeStadium'\";\r\n }\r\n if (ctype_digit($ClubLeague)) {\r\n $result['message'] = \"Please enter a valid string value for club's league!\";\r\n } else {\r\n $values .= \",'$ClubLeague'\";\r\n }\r\n if (ctype_digit($ClubCountry)) {\r\n $result['message'] = \"Please enter a valid string value for club country!\";\r\n } else {\r\n $values .= \",'$ClubCountry'\";\r\n }\r\n $clubDataIsInvalid = ctype_digit($ClubName) || ctype_digit($ClubCountry);\r\n if ($clubDataIsInvalid) {\r\n $result['message'] = \"Please enter valid Club Data !\";\r\n } else {\r\n $query = \"INSERT into club (club_id, club_name, home_stadium, league, country) \r\n VALUES (\" . $values . \")\";\r\n if (saveRecord($query)) {\r\n $result['message'] = \"New club record created successfully!\";\r\n $result['result'] = true;\r\n } else {\r\n $result['message'] = 'Saving Club Failed';\r\n }\r\n }\r\n }\r\n return $result;\r\n}", "public function add() {\n\n\t\tif (!isset($this->currentUser)) {\n\n\t\t\tthrow new Exception(\"Not in session. Adding championships requires login\");\n\t\t}\n\n\t\t$championship = new Championship();\n\n\t\t// Get the categories of the championship\n\t\t$categories = $this->categoryMapper->findAll();\n\n\t\t// Get the administrator entities from the database\n $administrators = $this->championshipMapper->findAdministrators();\n\n // Check if the currentUser (in Session) is an administrator\n $cont = 0;\n foreach($administrators as $administrator){\n \n if($administrator->getDni() == $this->currentUser->getDni()) {\n \n $cont = 1;\n }\n\t\t}\n\t\t\n\t\tif($cont == 1){\n\n\t\t\tif (isset($_POST[\"submit\"])) { // reaching via HTTP Post...\n\t\t\t\t\n\t\t\t\t$temp = $_FILES['normative']['tmp_name'];\n\t\t\t\t$location = \"__DIR__/../normatives\";\n\t\t\t\t$normativeName = $_FILES['normative']['name']; \n $url = $location . \"/\" . $normativeName;\n\n\t\t\t\t// populate the Championship object with data form the form\n\t\t\t\t$championship->setName($_POST[\"name\"]);\n\t\t\t\t$championship->setMaxParticipants($_POST[\"maxParticipants\"]);\n\t\t\t\t$championship->setNormative($url);\n\t\t\t\t$championship->setDeadLine($_POST[\"deadLine\"]);\n\n\t\t\t\t$categoryId = $_POST[\"checkbox\"];\n\n\t\t\t\ttry {\n\t\t\t\t\t// validate Championship object\n\t\t\t\t\t$championship->checkIsValidForCreate(); // if it fails, ValidationException\n\n\t\t\t\t\t// save the Championship object into the database\n\t\t\t\t\tif (move_uploaded_file($temp,$url)){\n\t\t\t\t\t\t$this->championshipMapper->save($championship);\n\t\t\t\t\t}\n\n\t\t\t\t\t$championshipid = $this->championshipMapper->findIdByName($_POST[\"name\"]);\n\n\t\t\t\t\tif($_POST['checkbox'] != \"\"){\n\n\t\t\t\t\t\tif(is_array($_POST['checkbox'])){\n\t\t\n\t\t\t\t\t\t\twhile(list($key,$value) = each($_POST['checkbox'])){\n\t\t\n\t\t\t\t\t\t\t\t$this->championshipMapper->saveCategoryIntoChampionship($championshipid, $value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// POST-REDIRECT-GET\n\t\t\t\t\t// Everything OK, we will redirect the user to the list of championships\n\t\t\t\t\t// We want to see a message after redirection, so we establish\n\t\t\t\t\t// a \"flash\" message (which is simply a Session variable) to be\n\t\t\t\t\t// get in the view after redirection.\n\t\t\t\t\t$this->view->setFlash(sprintf(i18n(\"Championship \\\"%s\\\" successfully added.\"),$championship ->getName()));\n\n\t\t\t\t\t// perform the redirection. More or less:\n\t\t\t\t\t// header(\"Location: index.php?controller=championships&action=index\")\n\t\t\t\t\t// die();\n\t\t\t\t\t$this->view->redirect(\"championships\", \"index\");\n\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException $ex) {\n\n\t\t\t\t\t// Get the errors array inside the exepction...\n\t\t\t\t\t$errors = $ex->getErrors();\n\t\t\t\t\t// And put it to the view as \"errors\" variable\n\t\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Put the Championship object visible to the view\n\t\t\t$this->view->setVariable(\"championship\", $championship);\n\t\t\t$this->view->setVariable(\"categories\", $categories);\n\n\t\t\t// render the view (/view/championship/add.php)\n\t\t\t$this->view->render(\"championships\", \"add\");\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"The logged user is not an Administrator\");\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get's the class name in use for the default session provider. Used mainly by unit tests.
public static function getDefaultSessionProviderClassName() { return self::$defaultSessionProviderClassName; }
[ "public function getSessionName()\r\n {\r\n return str_replace(\"\\\\\",\"_\",get_class($this));\r\n }", "public function getClass()\n\t{\n\t\t$driver = $this->config()->driver;\n\t\treturn \"Http\\\\Session\\\\Driver\\\\$driver\".\"Driver\";\n\t}", "public function getSessionClass()\n {\n return $this->_sessionClass;\n }", "public function GetSessionClass () {\n\t\treturn $this->sessionClass;\n\t}", "protected function getDefaultSessionDriver(): string\n {\n return $this->getDefaultSettings($this->app()->getSessions());\n }", "protected function getClassName () : string\n {\n return \"AuthServiceProvider\";\n }", "protected function getClassName(): string\n {\n return \"AuthServiceProvider\";\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public static function getDefaultStrategyClass(): string\n {\n return static::$defaultStrategyClass;\n }", "protected function getProviderName()\n {\n return ClassNameHelper::getNameWithoutNamespace($this->getProvider());\n }", "public function getSessionName() : string\n {\n return session_name();\n }", "protected static function getSessionNamespace()\n {\n return rex::getProperty('instname') . '_backend';\n }", "private function getSessionName(): string\n {\n $cookie = new Cookie();\n\n return $cookie->get('sessionName', $this->name);\n }", "public function getDefaultUserClass()\n {\n return $this->_get('gor_user_class');\n }", "public static function getInstanceClass() {\n\t\tif (isset ( self::$sessionInstance )) {\n\t\t\treturn \\get_class ( self::$sessionInstance );\n\t\t}\n\t}", "protected function getSessionName(): string\n {\n // Get owner object\n $owner = $this->getOwner();\n\n // Session name for current owner\n return static::formatSessionName($owner);\n }", "function getSessionName(){\r\n\t\t\treturn session_name();\r\n\t\t}", "public static function name(){\n\t\treturn session_name();\n\t}", "public static function getPROClass() : string {\n return self::$_defaultPROFQCN;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load up MODX for our tests.
public static function setUpBeforeClass() { self::$modx = new \modX(); self::$modx->initialize('mgr'); $core_path = self::$modx->getOption('assman.core_path','',MODX_CORE_PATH.'components/assetmanager/'); self::$modx->addExtensionPackage('assman',"{$core_path}model/orm/", array('tablePrefix'=>'ass_')); self::$modx->addPackage('assman',"{$core_path}model/",'ass_'); // Create Page if (!self::$Page = self::$modx->getObject('modResource', array('alias'=>'test-test-test'))) { self::$Page = self::$modx->newObject('modResource'); self::$Page->fromArray(array( 'alias' => 'test-test-test', 'pagetitle' => 'Test Asset 101', )); self::$Page->save(); } }
[ "public static function setUpBeforeClass() { \n self::$modx = new \\modX();\n self::$modx->initialize('mgr');\n $core_path = self::$modx->getOption('moxycart.core_path','',MODX_CORE_PATH.'components/moxycart/');\n self::$modx->addExtensionPackage('moxycart',\"{$core_path}model/orm/\", array('tablePrefix'=>'moxy_'));\n self::$modx->addPackage('moxycart',\"{$core_path}model/orm/\",'moxy_');\n self::$modx->addPackage('foxycart',\"{$core_path}model/orm/\",'foxy_');\n }", "public static function setUpBeforeClass() { \n self::$modx = new \\modX();\n self::$modx->initialize('mgr');\n $core_path = self::$modx->getOption('moxycart.core_path','',MODX_CORE_PATH.'components/moxycart/');\n self::$modx->addExtensionPackage('moxycart',\"{$core_path}model/orm/\", array('tablePrefix'=>'moxy_'));\n self::$modx->addPackage('moxycart',\"{$core_path}model/orm/\",'moxy_');\n self::$modx->addPackage('foxycart',\"{$core_path}model/orm/\",'foxy_');\n \n }", "private function _initialize_modx(){\n\t\trequire_once MODX_CORE_PATH . 'model/modx/modx.class.php';\n\t\t$this->modx= new modX();\n\t\t$this->modx->initialize('mgr');\n\t\t$this->modx->setLogLevel(modX::LOG_LEVEL_ERROR);\n\t\t$this->modx->setLogTarget('ECHO');\n\t\t \n\t\t$this->modx->loadClass('transport.modPackageBuilder','',false, true);\n\t\t$this->builder = new modPackageBuilder($this->modx);\n\t\t$this->builder->createPackage(PKG_NAME_LOWER,PKG_VERSION,PKG_RELEASE);\n\t}", "public function loadMODX()\n {\n if (static::$modx) {\n return static::$modx;\n }\n\n if (isset(static::$config['MODX_CONFIG_PATH']) && file_exists(static::$config['MODX_CONFIG_PATH']) ) {\n require_once static::$config['MODX_CONFIG_PATH'];\n\n } elseif (defined('MODX_CONFIG_PATH') && file_exists(MODX_CONFIG_PATH)) {\n require_once(MODX_CONFIG_PATH);\n\n } else {\n $this->findMODX();\n if (defined('MODX_CONFIG_PATH') && file_exists(MODX_CONFIG_PATH) && !defined('MODX_CORE_PATH')) {\n require_once(MODX_CONFIG_PATH);\n }\n\n if (!defined('MODX_CORE_PATH')) {\n throw new \\RuntimeException('There does not seem to be a MODX installation here. ');\n }\n\n }\n\n require_once(MODX_CORE_PATH . 'model/modx/modx.class.php');\n\n /** @var \\modX $modx */\n $modx = new \\modX();\n $modx->initialize('mgr');\n $modx->getService('error', 'error.modError', '', '');\n $modx->setLogTarget('ECHO');\n\n static::$modx = $modx;\n\n return $modx;\n }", "public function setUp()\n {\n $this->modx = CrosslinksTestHarness::_getConnection();\n\n $corePath = $this->modx->getOption('crosslinks.core_path', null, $this->modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/crosslinks/');\n require_once $corePath . 'model/crosslinks/crosslinks.class.php';\n\n $this->crosslinks = new Crosslinks($this->modx);\n $this->crosslinks->options['debug'] = true;\n\n $this->modx->placeholders = array();\n $this->modx->crosslinks = &$this->crosslinks;\n\n error_reporting(E_ALL);\n }", "static function load_test_manifest() {\n\t\t// Build the complete manifest\n\t\t$manifestInfo = self::get_manifest_info(BASE_PATH);\n\t\t// Load it into the current session.\n\t\tself::process_manifest($manifestInfo);\n\t}", "function mint_ab_testing_loader() {\n\tif ( ! isset($GLOBALS['mint_ab_testing']) ) {\n\t\t$GLOBALS['mint_ab_testing'] = new Mint_AB_Testing();\n\t}\n}", "public function testLoadModule() {\n\t\t$neptune = Config::create('neptune');\n\t\t//any file named config.php will be loaded in the config\n\t\t//directory. Let's pretend the test config file is for a\n\t\t//module.\n\t\t$this->temp->create('test_module/config.php',\n\t\t\t\t\t\t\t$this->temp->getContents(self::file));\n\t\t$neptune->set('dir.root', $this->temp->getDirectory());\n\t\t$neptune->set('modules', array('test_module' => 'test_module/'));\n\t\t$module = Config::loadModule('test_module');\n\t\t$this->assertEquals('two-one', $module->get('two.one'));\n\t}", "function bbmodsuite_init() {\n\tglobal $bbmod_plugins, $active_bbmod_plugins;\n\t$bbmod_plugins = array(\n\t\t'report' => array(\n\t\t\t'name' => 'Report',\n\t\t\t'description' => '<p>Allows users to report posts for consideration by the moderation team.</p>',\n\t\t\t'filename' => 'report.php'\n\t\t)\n\t);\n\t$active_bbmod_plugins = (array) bb_get_option('bbpress_moderation_suite_helpers');\n\tforeach ($active_bbmod_plugins as $plugin) {\n\t\trequire_once $bbmod_plugins[$plugin]['filename'];\n\t}\n}", "function setup_xfm() {\n // Requires xfm custom xPHPUnit_Framework_TestCase\n $xfm_path = $this->xfm_path();\n require_once \"{$xfm_path}/unittests/lib/PHPUnit_Framework_TestCase.php\";\n }", "public function load_tests() {\r\n\t\t\trequire_once( KFN_DIR_INC_PATH . '/api/include.php' );\r\n\r\n\t\t\tforeach ( glob( KFN_DIR_INC_PATH . '/tests/*.php' ) as $file ) {\r\n\t\t\t\tkfn_include( $file, true );\r\n\t\t\t}\r\n\t\t}", "function bpmp_load() {\n\tinclude( dirname( __FILE__ ) . '/bp-mega-populate.php' );\n}", "function superfood_elated_load_modules() {\n foreach(glob(ELATED_FRAMEWORK_ROOT_DIR.'/modules/*/load.php') as $module_load) {\n include_once $module_load;\n }\n }", "public static function loadStockFixtures(): void\n {\n include __DIR__ . '/../../../_files/stockFixtures.php';\n }", "public static function loadStockFixtures(): void\n {\n include __DIR__ . '/../../../../_files/stockFixtures.php';\n }", "function mixtape_qodef_load_modules() {\n foreach(glob(QODE_FRAMEWORK_ROOT_DIR.'/modules/*/load.php') as $module_load) {\n include_once $module_load;\n }\n }", "public static function loadSimpleProductFixtures()\n {\n include __DIR__ . '/_files/multi_store_per_website/productFixtures.php';\n }", "public static function loadSimpleProductFixtures()\n {\n include __DIR__ . '/../../../../../../_files/productFixtures.php';\n }", "private function loadModuleXml() \n\t{\n\n\t\t// load in config.xml to simplexml parser\n\t\tparent::$base_xml = simplexml_load_file(parent::$app_etc_module_path);\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks a remove operation as stopped
public function stopRemove() { $this->stopOperation('remove'); }
[ "public function markAsStopped()\n {\n $this->owner->pools->executing->remove($this->id);\n }", "public function do_remove() {\n\n\t\t// Import instance\n\t\t$import_instance = $this->get_content_pack()->get_import_instance();\n\n\t\t// Clear task args values\n\t\t$import_instance->clear_task_args();\n\n\t\t// Mark as removed\n\t\t$import_instance->set_task_arg_value( 'remove', 'success', true );\n\n\t\t// Mark as not completed\n\t\t$import_instance->set_successful( false );\n\t}", "public function removed() {\n\t}", "public function flagAsDeleted () {\n // xxx finish\n }", "public function stop()\n {\n $this->started = false;\n }", "public function stop(){}", "protected function markRemoved()\n {\n $this->unitOfWork->registerRemoved($this);\n }", "public function onRemove();", "protected function beforeRemoving()\n {\n }", "public function mark_pending()\n\t{\n\t\tparent::remove();\n\t}", "public function stop(){\n if($this->_id) $this->times[$this->_id] += microtime(true) - $this->_start;\n $this->_id = null;\n }", "public function cleanRemoved();", "protected function before_remove() {\n\n\t}", "public function remove()\n {\n }", "protected function _cancelOperation(){ }", "public function stopService() {\n\t\t$this->execTasks(\"delete\");\n\t}", "public function stop();", "public function stop() {\n $this->actionProtocol[] = array('stop', microtime(true));\n }", "public function onStop() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate Var type 0: table, database type 1: columns
private function validateVar($value,$type) { $method = 'TableCreator->validateVar()'; // Quick clean $value = isset($value) ? trim(addslashes($value)) : ''; $type = isset($type) ? (int) $type : 0; if ($type < 0 || $type > 1) { SBC::devError('invalid $type',$method); } // Not empty if (empty($value)) { SBC::devError('$value is not set',$method); } // Length check if (isset($value{255})) { SBC::devError('value ('.$value.') is too long',$method); } // Check for valid characters only // Type 0: tables, databases if ($type == 0) { // Database and Table Name Only if (preg_match('/[^A-Za-z0-9_]/',$value)) { SBC::devError('invalid value('.$value.')',$method); } } else if ($type == 1) { // Columns if (preg_match('/[^A-Za-z0-9_-]\s\(\)/',$value)) { SBC::devError('invalid value('.$value.')',$method); } } // Return value return $value; }
[ "function enforce_special_type ($var, $type) {\n global $enforceable_data_types, $recognised_SQL_types;\n switch ($type) {\n case 'type':\n if (!in_array ($var, $enforceable_data_types)) {\n if (substr ($var, 0, 4) != 'eval') {\n $var = false;\n }\n }\n break;\n \n case 'sqltype':\n $found = false;\n foreach ($recognised_SQL_types as $group => $sql_types) {\n foreach ($sql_types as $sql_type) {\n if ($sql_type == $var) {\n $found = true;\n break 2;\n }\n }\n }\n if (!$found) {\n $var = false;\n }\n break;\n \n default:\n $var = false;\n }\n //echo \"Result: $var<br>\\n\";\n return $var;\n}", "function qa_db_user_column_type_verify()\n{\n\t$coltype = strtoupper(qa_get_mysql_user_column_type());\n\n\tswitch ($coltype) {\n\t\tcase 'SMALLINT':\n\t\tcase 'MEDIUMINT':\n\t\tcase 'INT':\n\t\tcase 'BIGINT':\n\t\tcase 'SMALLINT UNSIGNED':\n\t\tcase 'MEDIUMINT UNSIGNED':\n\t\tcase 'INT UNSIGNED':\n\t\tcase 'BIGINT UNSIGNED':\n\t\t\t// these are all OK\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tif (!preg_match('/VARCHAR\\([0-9]+\\)/', $coltype))\n\t\t\t\tqa_fatal_error('Specified user column type is not one of allowed values - please read documentation');\n\t\t\tbreak;\n\t}\n\n\treturn $coltype;\n}", "public function testInputTypesAreValid(): void\n {\n $this->expectPassesRule(\n new VariablesAreInputTypes(),\n '\n query Foo($a: String, $b: [Boolean!]!, $c: ComplexInput) {\n field(a: $a, b: $b, c: $c)\n }\n '\n );\n }", "function DBTypeValidityCheck($Data, $Type, $Size = 0){\n switch($Type){\n case \"str\":\n if(is_string($Data) AND strlen($Data) < $Size){\n return TRUE; \n }\n else{\n return FALSE;\n }\n break;\n case \"int\":\n if (is_int($Data)){\n return TRUE;\n }\n else{\n return FALSE;\n }\n break;\n case \"float\":\n if(is_float($Data)){\n return TRUE;\n }\n else{\n return FALSE;\n }\n break;\n default:\n echo \"No proper datatype argument has been entered!\";\n return FALSE;\n }\n }", "function handleColumns(){\n\t\t$columns = self::columns($this->PageTool->model['table']);\n\t\t$usedColumns = $this->PageTool->model['columns'] ? $this->PageTool->model['columns'] : array_keys($columns);\n\t\t\n\t\t//create validation and deal with special columns\n\t\tforeach($usedColumns as $column){\n\t\t\t//special columns\n\t\t\tif($column == 'time_created'){\n\t\t\t\tPage::$in[$column] = i()->Time('now',Config::$x['timezone'])->datetime();\n\t\t\t}elseif($column == 'time_updated'){\n\t\t\t\tPage::$in[$column] = i()->Time('now',Config::$x['timezone'])->datetime();\n\t\t\t}elseif($column == 'id'){\n\t\t\t\t$validaters[$column][] = 'f:toString';\n\t\t\t\t$validaters[$column][] = '?!v:filled';\n\t\t\t\t$validaters[$column][] = '!v:existsInTable|'.$this->PageTool->model['table'];\n\t\t\t}else{\n\t\t\t\t$validaters[$column][] = 'f:toString';\n\t\t\t\tif(!$columns[$column]['nullable']){\n\t\t\t\t\t//column must be present\n\t\t\t\t\t$validaters[$column][] = '!v:exists';\n\t\t\t\t}else{\n\t\t\t\t\t//column may not be present. Only validate if present\n\t\t\t\t\t$validaters[$column][] = '?!v:filled';\n\t\t\t\t}\n\t\t\t\tswitch($columns[$column]['type']){\n\t\t\t\t\tcase 'datetime':\n\t\t\t\t\t\t$validaters[$column][] = '!v:date';\n\t\t\t\t\t\t$validaters[$column][] = 'f:toDatetime';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t$validaters[$column][] = '!v:date';\n\t\t\t\t\t\t$validaters[$column][] = 'f:toDatetime';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\tif($columns[$column]['limit']){\n\t\t\t\t\t\t\t$validaters[$column][] = '!v:lengthRange|0,'.$columns[$column]['limit'][0];\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$validaters[$column][] = 'f:trim';\n\t\t\t\t\t\t$validaters[$column][] = '!v:isInteger';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'decimal':\n\t\t\t\t\tcase 'float':\n\t\t\t\t\t\t$validaters[$column][] = 'f:trim';\n\t\t\t\t\t\t$validaters[$column][] = '!v:isFloat';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->usedColumns = $usedColumns;\n\t\t$this->validaters = $validaters;\n\t}", "function isValidType($data);", "protected function validateType()\r\n {\r\n $ok = TRUE;\r\n $type = $this->column->getType();\r\n\r\n if ($type == \\Db\\Column\\Column::TYPE_INTEGER)\r\n {\r\n if (!self::isInteger($this->value))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n else if ($type == \\Db\\Column\\Column::TYPE_DECIMAL)\r\n {\r\n if (!is_numeric(str_replace(',', '', $this->value)))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n\r\n return $ok;\r\n }", "public function testValidatorForLegnthRequiredIfDataTypeIsVarchar()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => 1,\n 'table_id' => 1,\n 'column_name' => \"columnName\",\n 'column_name_alias' => \"columnNameAlias\",\n 'data_type' => \"varchar\",\n 'length' => null, //required\n 'maximum_number' => null,\n 'decimal_part' => null,\n 'validation' => 'required',\n ];\n\n $response = $this->post('api/v1/update/table-columns', $updatePostData);\n\n // Checking -----------------------------\n // Check no table data of 'm_table_columns' table\n $tableColumnsDataCount = TableColumns::count();\n $this->assertEquals(5, $tableColumnsDataCount);\n\n //Check response\n $response\n ->assertStatus(422)\n ->assertJsonFragment([\n \"length\" => [\"型がvarcharの場合、長さも指定してください。\"],\n ]);\n }", "protected function validateType() {\n $testVal = NULL;\n $value = $this->_value;\n switch( $this->_varType ) {\n case 'number':\n // Must be an array, must be numeric\n if ( !is_array($this->_value) || \n !isset($this->_value['number']) ||\n !is_numeric($this->_value['number']) ) {\n $this->_valid = false;\n $this->_error = 'You must enter a number here.';\n } else {\n // Check if a unit is set otherwise, make it 1\n if ( isset( $this->_value['unit'] ) &&\n is_numeric( $this->_value['unit'] )) {\n $this->_unit = $this->_value['unit'];\n } else {\n $this->_unit = 1;\n }\n // Generate the test value by multiplying by the unit\n $testVal = $this->_value['number'] * $this->_unit;\n }\n break;\n case 'date':\n // Must be a valid date, the array much have all parts and be numeric\n // This is to ensure no errors from checkdate\n $testDate = false;\n $dateVals = array( 'day', 'month', 'year' );\n\t\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t\t$testDate = true;\n\t\t\t\t\tforeach( $dateVals as $dV ) {\n\t\t\t\t\t\tif ( !isset( $value[ $dV ] ) ) {\n\t\t\t\t\t\t\t$testDate = false;\n\t\t\t\t\t\t} else if ( !is_numeric( $value[ $dV ] ) ) {\n\t\t\t\t\t\t\t$testDate = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $testDate && checkdate( $value['month'], $value['day'], $value['year'] ) ) {\n // If testdate and checkdate are true\n // Date in ISO format\n $testVal = \"{$value['year']}-{$value['month']}-{$value['day']}\";\n } else { \n $this->_valid = false;\n $this->_error = 'Please enter a valid date.';\n }\n break;\n case 'time':\n // Must be a valid time with all parts and be numeric\n $testTime = false;\n $timeVals = array( 'hour', 'minute' );\n\t\t\t\tif ( is_array( $value ) ) { // Ensure input set properly\n\t\t\t\t\t$testTime = true;\n\t\t\t\t\tforeach ( $timeVals as $tV ) {\n\t\t\t\t\t\tif ( !isset( $value[ $tV ] ) ) {\n\t\t\t\t\t\t\t$testTime = false;\n\t\t\t\t\t\t} else if ( !is_numeric( $value[ $tV ] ) ) {\n\t\t\t\t\t\t\t$testTime = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $testTime && 0 <= $value['hour'] && $value['hour'] < 24 && 0 <= $value['minute'] && $value['minute'] < 60 ) {\n $testVal = \"{$value['hour']}:{$value['minute']}:00\";\n } else { \n $this->_valid = false;\n $this->_error = 'Please enter a valid time.';\n }\n break;\n case 'duration':\n $testTime = false;\n\t\t\t\t$timeVals = array( 'hours', 'minutes' );\n\t\t\t\tif ( is_array( $value ) ) { // Ensure input set properly\n\t\t\t\t\t$testTime = true;\n $partTime = '';\n\t\t\t\t\tforeach ( $timeVals as $tV ) {\n\t\t\t\t\t\tif ( !isset( $value[ $tV ]['number'] ) || $value[ $tV ]['number'] === \"\" ) {\n\t\t\t\t\t\t\t$partTime .= $tV;\n\t\t\t\t\t\t} else if ( !is_numeric( $value[ $tV ][ 'number' ] ) ) {\n\t\t\t\t\t\t\t$testTime = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n if ( $partTime == 'hoursminutes')\n $testTime = false;\n else if ( $partTime != '' )\n $value[$partTime]['number'] = 0;\n\t\t\t\t}\n\t\t\t\tif ( $testTime )\n // Convert into minutes\n\t\t\t\t\t$testVal = $value['minutes']['number'] + $value['hours']['number'] * 60;\n else {\n $this->_valid = false;\n $this->_error = 'Please enter a valid duration.';\n }\n break;\n case 'yesno':\n // Can be completely validated at this point\n if ( $value == '1' || $value == '0' ) {\n $testVal = $value;\n $this->_valid = true;\n } else {\n $this->_valid = false;\n $this->_error = 'Please select Yes or No.';\n }\n break;\n case 'checkbox':\n // Must be an array of integers, if not the someone has changed the input value\n if (is_array($value)) {\n foreach( $value as $number ) {\n if ( !is_numeric( $number ) ) {\n $this->_valid = false;\n $this->_error = 'An error has occurred please try again.';\n break 2;\n }\n }\n $testVal = $value;\n } else {\n $this->_valid = false;\n $this->_error = 'An error has occurred please try again.'; \n }\n break;\n case 'select':\n case 'text':\n case 'textarea':\n case 'radio':\n case 'email':\n // No type checking available for these\n $testVal = $value;\n break; \n case 'password':\n $pattern = '/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/';\n $checkValue = (array)$value;\n foreach( $checkValue as $pwd ) {\n if (preg_match($pattern, $pwd)) { \n if(strpos($pwd,$this->_data->username) !== false){\n $this->_valid = false;\n $this->_error = 'Your password cannot contain your username.';\n break 2;\n }\n $length = strlen($pwd);\n for( $i = 0; $i < $length - 2; $i++ ) {\n if ( ord(substr($pwd,$i,1)) == ord(substr($pwd,$i+1,1)) && ord(substr($pwd,$i+1,1)) == ord(substr($pwd,$i+2,1))) {\n $this->_valid = false;\n $this->_error = 'You cannot have three consecutive characters in your password.';\n break 3;\n } elseif ( ord(substr($pwd,$i,1)) + 1 == ord(substr($pwd,$i+1,1)) && ord(substr($pwd,$i+1,1)) + 1 == ord(substr($pwd,$i+2,1)) ) {\n $this->_valid = false;\n $this->_error = 'You cannot have three sequential characters in your password.';\n break 3;\n }\n }\n } else if ( $pwd !== '' ) {\n $this->_valid = false;\n $this->_error = 'The password must be at least 8 characters and contain upper case, lower case and numbers.';\n break 2;\n }\n }\n $testVal = $value;\n break; \n }\n return $testVal;\n }", "public function testColumnTypes()\n {\n $query = new Query(\"select sysdate one, 2 two from dual\");\n $query->execute();\n $this->assertEquals(array('ONE' => 'DATE', 'TWO' => 'NUMBER'), $query->getColumnType());\n }", "function oci_field_type($statement, $field) {}", "public static function Validate($values, $tablename)\n {\n if (!is_array($values)) {\n return false;\n }\n\n $tableinfo = \\TAS\\Core\\DB::GetTableInformation($tablename);\n foreach ($values as $i => $v) {\n try {\n if (isset($tableinfo[$i])) {\n switch ($tableinfo[$i]['type']) {\n case 'int':\n if ('yes' == strtolower($tableinfo[$i]['Null'])) {\n if ('' != $v && !is_numeric($v)) {\n self::SetError(\"For {$i}, {$v} is not numeric\", 10);\n\n return false;\n }\n } elseif (!is_numeric($v)) {\n self::SetError(\"For {$i}, {$v} is not numeric\", 10);\n\n return false;\n }\n\n break;\n\n case 'float':\n if ('yes' == strtolower($tableinfo[$i]['Null'])) {\n if ('' != $v && !is_numeric($v)) {\n self::SetError(\"For {$i}, {$v} is not numeric\", 10);\n\n return false;\n }\n } elseif (!is_numeric($v)) {\n self::SetError(\"For {$i}, {$v} is not numeric\", 10);\n\n return false;\n } else {\n $v1 = floatval($v);\n if ($v1 != $v) {\n self::SetError(\"For {$i}, {$v} is not numeric\", 10);\n\n return false;\n }\n }\n\n break;\n\n case 'date':\n if ('yes' == strtolower($tableinfo[$i]['Null'])) {\n if ('' != $v && !\\TAS\\Core\\DataValidate::IsDate($v)) {\n self::SetError(\"For {$i}, {$v} is not a date\", 10);\n\n return false;\n }\n } else {\n if ('' == $v || !\\TAS\\Core\\DataValidate::IsDate($v)) {\n self::SetError(\"For {$i}, {$v} is not a date\", 10);\n\n return false;\n }\n }\n\n break;\n\n case 'string':\n if (isset($tableinfo[$i]['size']) && $tableinfo[$i]['size'] > 0 && null != $v && strlen($v) > $tableinfo[$i]['size']) {\n self::SetError(\"For {$i}, {$v} exceed size limit\", 10);\n\n return false;\n }\n\n break;\n\n default: break;\n }\n }\n } catch (\\Exception $ex) {\n self::SetError(\"For {$i}, {$v} generate Exception. \".$ex->getMessage(), 10);\n\n return false;\n }\n }\n\n return true;\n }", "protected function validate_data_structure() {\n\n // Validate the data type.\n $data_type = key( $this->data );\n if ( $data_type !== $this->data_type ) {\n\n // Error message.\n $message = 'Data type: \"@data_type\" is incorrect the allowed data type is: \"@allowed_data_type\"';\n\n // Message placeholders.\n $variables = array(\n '@data_type' => $data_type,\n '@allowed_data_type' => $this->data_type,\n );\n\n \\WP_CLI::error( strtr( $message, $variables ) );\n }\n }", "private function check_cType() {\n $column = $this->ci->input->post('columns');\n if (is_numeric($column[0]['data']))\n return FALSE;\n else\n return TRUE;\n }", "public function validateTable($table){\r\n return true;\r\n }", "function check_column($table_name, $col_name, $col_type, $is_null = \\null, $key = \\null, $default = \\null, $extra = \\null)\n{\n}", "function isSelectType($sql)\n {\n if ( ! preg_match('/^\\s*\"?(SELECT)\\s+/i', $sql)) {\n return false;\n }\n\n return true;\n\t }", "private function validate_schema_fields()\n {\n $input = $this->fields;\n $schema = $this->schema();\n $fields = $values = array(); \n\n #Util::quit(417, \"validate_schema_fields: \".json_encode(array($input, $schema))); \n\n foreach($input as $field => $value) {\n $fields[] = $field;\n $values[] = $schema[$field][0] == \"TEXT\" ? \"'$value'\" : $value;\n };\n return array('fields'=>$fields, 'values'=>$values);\n }", "private function checkTable($table = null){\n\tif ($table == null) {\n\t\tthrow new Exception(\"Error no table to query : table\");\n\t}\telseif (!is_string($table)) {\n\t\tif (is_array($table)) {\n\t\t\tif (!(count($table) == 1 && count($table) == count($table, COUNT_RECURSIVE))) {\n\t\t\t\tthrow new Exception(\"Error table name except array size 1 and none multidimention array : table\");\t\n\t\t\t}\n\t\t}\telse{\n\t\t\tthrow new Exception(\"Error unsupport String or array table name : table\");\n\t\t}\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Sets default config for models
public function setDefaultModelConfig($config) { if(is_array($config)) { $this->_defaultModelConfig = array_merge($this->_defaultModelConfig, $config); } }
[ "protected function setupDefaultConfiguration()\n {\n $this->container['config']['database.fetch'] = PDO::FETCH_OBJ;\n\n $this->container['config']['database.default'] = 'default';\n }", "public function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->name,\r\n 'required' => false,\r\n 'requiredError' => 'The field can not be empty',\r\n 'disableFilters' => false,\r\n 'allowTags' => null,\r\n 'allowStyleProperty' => true,\r\n 'replaceUrl' => false,\r\n 'replaceUrlPath' => null,\r\n );\r\n }", "protected function setupDefaultConfiguration()\n {\n $this->container ['config'] ['database.fetch'] = PDO::FETCH_ASSOC;\n $this->container ['config'] ['database.default'] = 'default';\n }", "public function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->name,\r\n 'required' => false,\r\n 'requiredError' => 'The field can not be empty',\r\n 'mapEnabled' => false,\r\n 'mappingCoordinatesProperty' => null,\r\n );\r\n }", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "private function setDefaultModel() {\n $modelClass = self::MODEL_DIRECTORY_NAMESPACE . self::NAMESPACE_SEPARATOR .\n ucfirst(str_replace(self::POST_CONTROLLER_NAME, '', $this->className)) .\n self::POST_MODEL_NAME;\n if (class_exists($modelClass)) {\n $this->model = new $modelClass();\n }\n }", "private function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->name,\r\n 'whereType' => TableListQuery::WT_OR,\r\n 'countEnabled' => false,\r\n );\r\n }", "private function _setDefaultConfig()\n {\n $this->_config[\"mysql_server\"] = 'localhost';\n $this->_config[\"mysql_user\"] = 'user';\n $this->_config[\"mysql_pass\"] = 'pass';\n $this->_config[\"mysql_db\"] = 'database';\n $this->_config[\"mysql_table\"] = 'table';\n $this->_config[\"mysql_name_column\"] = 'column';\n $this->_config[\"aws_key\"] = '';\n $this->_config[\"aws_pass\"] = '';\n $this->_config[\"aws_s3bucket\"] = '';\n }", "protected function set_defaults() {\n }", "private function defaultConfig(): void\n {\n if (config('query-builder') === null) {\n config(['query-builder.parameters.include' => 'include']);\n config(['query-builder.parameters.filter' => 'filter']);\n config(['query-builder.parameters.sort' => 'sort']);\n config(['query-builder.parameters.fields' => 'fields']);\n config(['query-builder.parameters.append' => 'append']);\n config(['query-builder.count_suffix' => 'Count']);\n config(['query-builder.disable_invalid_filter_query_exception' => false]);\n config(['query-builder.request_data_source' => 'query_string']);\n }\n }", "private function __initializeModels() {\n\t\tif (isset($this->params['models']) && $this->params['models'] !== true) {\n\t\t\t$modelSetups = explode(',', $this->params['models']);\n\n\t\t\t$models = App::objects('model', CakePlugin::path($this->__plugin) . 'Model' . DS, false);\n\n\t\t\t$defaultSetup = array(\n\t\t\t\t'where' => '1=1',\n\t\t\t\t'limit' => '0'\n\t\t\t);\n\n\t\t\tforeach ($modelSetups as $modelSetup) {\n\t\t\t\t$modelSetup = explode('-', $modelSetup);\n\t\t\t\t$model = Inflector::classify($modelSetup[0]);\n\n\t\t\t\tif ($model == 'All') {\n\t\t\t\t\tforeach ($models as $model) {\n\t\t\t\t\t\tif (in_array('core', $modelSetup)) {\n\t\t\t\t\t\t\t$this->__models[$model]['core'] = $defaultSetup;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (in_array('sample', $modelSetup)) {\n\t\t\t\t\t\t\t$this->__models[$model]['sample'] = $defaultSetup;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (in_array($model, $models)) {\n\t\t\t\t\tif (in_array('core', $modelSetup)) {\n\t\t\t\t\t\t$this->__models[$model]['core'] = $defaultSetup;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (in_array('sample', $modelSetup)) {\n\t\t\t\t\t\t$this->__models[$model]['sample'] = $defaultSetup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function pullConfigurationFromModel()\n {\n $this->config = $this->getDefaultConfiguration();\n\n foreach ($this->obj->sequence() as $key => $value) {\n $this->config[$key] = $value;\n }\n }", "private function init_config() {\n set_config('siteadmins', '');\n set_config('siteguest', '');\n set_config('defaultuserroleid', '');\n set_config('defaultfrontpageroleid', '');\n }", "public function init() {\n //TODO override and put config intialization code here\n }", "public function requireDefaultRecords()\n {\n parent::requireDefaultRecords();\n\n $config = DataObject::get_one(SiteConfig::class);\n\n if (!$config) {\n self::make_site_config();\n\n DB::alteration_message(\"Added default site config\", \"created\");\n }\n }", "protected function setDefaults()\n {\n $this->properties['source'] = \"default\";\n $this->properties['category'] = \"default\";\n }", "private function setDefaultData() : void {\n $this->_defaultData = [\n 'template_dir' => $this->_model->getTemplateDir(),\n 'image_url' => self::$config->get('url') . '/public/views/' . self::$config->get('theme') . '/images',\n 'stylesheet_url' => self::$config->get('url') . '/public/views/' . self::$config->get('theme') . '/css',\n 'base_url' => self::$config->get('url'),\n 'script_url' => self::$config->get('url') . '/public/scripts',\n 'node_url' => self::$config->get('url') . '/node_modules',\n 'page_title' => $this->_model->getPageTitle(),\n 'is_logged_in' => self::$auth->isLoggedIn(),\n 'on_login_page' => Registry::retrieve('route')->getRouteInfo()['module_name'] == 'login'\n ];\n }", "public function setup(&$model, $config = null) {\n\n // Set up the default settings for this model. Default counterCache field is\n // post_count for Post model, no counterScope.\n $defaults = array(\n 'counterCache' => Inflector::underscore($model->alias) . '_count',\n 'counterScope' => null,\n );\n \n // check if it is universal settings\n $universalSettings = $this->_checkForUniversalSettings($config);\n \n if ($universalSettings) {\n // then we need to loop through all habtms. right now kiv.\n } else {\n // then we loop thru each individual relation\n foreach($config as $relationName => $relationAssocData) {\n $this->settings[$model->alias][$relationName] = $relationAssocData;\n }\n }\n \n \n \n \n\n }", "protected static function setup_default($config)\n\t{\n\t\tif (!isset(static::$_defaultDSN) && array_key_exists('dsn', $config)) {\n\t\t\tstatic::$_defaultDSN = $config['dsn'];\n\t\t}\n\n\t\tif (!isset(static::$_defaultOptions) && array_key_exists('options', $config)) {\n\t\t\tstatic::$_defaultOptions = $config['options'];\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the 'last_changed' cache incrementor when posts are updated. Big hammer, small nail.
function bp_docs_folders_invalidate_last_changed_incrementor() { wp_cache_delete( 'last_changed', 'bp_docs_folders' ); }
[ "function wp_cache_set_comments_last_changed()\n {\n }", "function wp_cache_set_comments_last_changed()\n{\n}", "function wp_cache_set_users_last_changed()\n {\n }", "protected function reset_last_change()\n\t{\n\t\t$this->last_change = null;\n\t}", "function wp_cache_set_last_changed($group)\n {\n }", "function update_post_cache(&$posts)\n {\n }", "public function update_cache() {\n\n\t\t$site_id = absint( filter_input( INPUT_POST, 'id' ) );\n\t\tif ( ! $site_id ) {\n\t\t\t$site_id = get_current_blog_id();\n\t\t}\n\t\tif ( ! $site_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$titles = wp_cache_get( $this->cache_key, $this->cache_group );\n\t\tif ( ! isset( $titles[ $site_id ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunset( $titles[ $site_id ] );\n\n\t\twp_cache_set( $this->cache_key, $titles, $this->cache_group );\n\t}", "public function refreshLastContentChangedAt() : void\n {\n $this->lastContentChangeAt = new \\DateTime();\n }", "function wp_cache_set_terms_last_changed()\n {\n }", "function wp_cache_set_terms_last_changed()\n{\n}", "protected function setSysLastChanged() {}", "protected function _recache()\n\t{\n\t\t$this->registry->class_localization->loadLanguageFile( array( 'public_blog' ), 'blog' );\n\t\t\t\t\n\t\tif ( $this->blog_id )\n\t\t{\n\t\t\t$channel_id = $this->class_rss->createNewChannel( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t\t\t=> $this->blog['blog_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'link'\t\t\t=> $this->registry->output->buildSEOUrl( \"app=blog&amp;blogid=\" . $this->blog_id, 'publicNoSession', $this->blog['blog_seo_name'], 'showblog' ),\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'description'\t=> $this->blog['blog_name'] . \" Syndication\",\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'pubDate'\t\t=> $this->class_rss->formatDate( time() ),\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'webMaster'\t\t=> $this->settings['email_in'] . \" ({$this->settings['board_name']})\",\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'generator'\t\t=> 'IP.Blog'\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t)\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$channel_id = $this->class_rss->createNewChannel( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t\t\t=> \"{$this->settings['board_name']} {$this->lang->words['blog_list']}\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'link'\t\t\t=> $this->registry->output->buildSEOUrl( \"app=blog\", 'public', true, 'app=blog' ),\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'description'\t=> \"{$this->lang->words['blog_list']} Syndication\",\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'pubDate'\t\t=> $this->class_rss->formatDate( time() ),\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'webMaster'\t\t=> $this->settings['email_in'] . \" ({$this->settings['board_name']})\",\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t'generator'\t\t=> 'IP.Blog'\n\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t)\t\t);\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get the last 10 (published) entries\n\t\t//-----------------------------------------\n\n\t\t$limit\t= intval($this->settings['blog_rss_count']);\n\t\t$limit\t= $limit > 100 ? 100 : ( $limit < 1 ? 1 : $limit );\n\t\t\n\t\tif ( $this->blog_id )\n\t\t{\n\t\t\t$this->DB->build( array(\n\t\t\t\t\t\t\t\t\t\t'select'\t=> 'e.*',\n\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array('blog_entries' => 'e'),\n\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select' => 'b.blog_name, b.blog_seo_name, b.member_id, b.blog_settings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'from' => array( 'blog_blogs' => 'b' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'where' => \"e.blog_id=b.blog_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'type' => 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'where'\t\t=> \"e.entry_status='published' and e.blog_id={$this->blog_id}\",\n\t\t\t\t\t\t\t\t\t\t'order'\t\t=> 'e.entry_date DESC',\n\t\t\t\t\t\t\t\t\t\t'limit'\t\t=> array( 0, $limit )\n\t\t\t\t\t\t\t)\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->DB->build( array(\n\t\t\t\t\t\t\t\t\t\t'select'\t=> \"e.*\",\n\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array('blog_entries' => 'e'),\n\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select' => 'b.blog_name, b.blog_seo_name, b.member_id, b.blog_settings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'from' => array( 'blog_blogs' => 'b' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'where' => \"e.blog_id=b.blog_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t'type' => 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'where'\t\t=> \"b.blog_id IS NOT NULL AND e.entry_status='published' AND b.blog_allowguests=1 AND b.blog_disabled=0 AND ( b.blog_owner_only=0 AND b.blog_authorized_users IS NULL ) AND (b.blog_settings LIKE '%s:8:\\\"allowrss\\\";i:1%' OR b.blog_settings LIKE '%s:8:\\\"allowrss\\\";s:1:\\\"1\\\"%')\",\n\t\t\t\t\t\t\t\t\t\t'order'\t\t=> 'e.entry_date DESC',\n\t\t\t\t\t\t\t\t\t\t'limit'\t\t=> array( 0, $limit )\n\t\t\t\t\t\t\t)\t);\n\t\t}\n\n\t\t$qid = $this->DB->execute();\n\n\t\t//-----------------------------------------\n\t\t// Build the items\n\t\t//-----------------------------------------\n\n\t\twhile ( $entry = $this->DB->fetch( $qid ) )\n\t\t{\n\t\t\t/* Make sure that syndication is enabled */\n\t\t\t$entry['blog_settings'] = unserialize( $entry['blog_settings'] );\n\t\t\t\n\t\t\tIPSText::getTextClass('bbcode')->parse_html\t\t= $entry['entry_html_state'] ? 1 : 0;\n\t\t\tIPSText::getTextClass('bbcode')->parse_bbcode\t= 1;\n\t\t\tIPSText::getTextClass('bbcode')->parse_smilies\t= $entry['entry_use_emo'] ? 1: 0;\n\t\t\tIPSText::getTextClass('bbcode')->parse_nl2br\t= $entry['entry_html_state'] == 2 ? 1 : 0;\n\n\t\t\t$this->settings['__noTruncateUrl'] = 1;\n\t\t\t$entry['entry'] = $this->registry->blogFunctions->getEntryExcerpt( $entry );\n\n\t\t\tif ( $this->blog_id )\n\t\t\t{\n\t\t\t\t$title = $entry['entry_name'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$title = $entry['blog_name'] . \" - \" . $entry['entry_name'];\n\t\t\t}\n\n\t\t\tif( $entry['entry_has_attach'] )\n\t\t\t{\n\t\t\t\t$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php', 'class_attach' );\n\t\t\t\t$this->class_attach = new $classToLoad( $this->registry );\n\t\t\t\t$this->class_attach->type = 'blogentry';\n\t\t\t\t$this->class_attach->init();\n\n\t\t\t\t$_output = $this->class_attach->renderAttachments( $entry['entry'], array( $entry['entry_id'] ), 'blog_show' );\n\t\t\t\t$entry['entry'] = $_output[0]['html'];\n\n\t\t\t\tif( $_output[$entry['entry_id']]['attachmentHtml'] )\n\t\t\t\t{\n\t\t\t\t\t$entry['entry'] = str_replace( '<!--IBF.ATTACHMENT_' . $entry['entry_id'] . '-->', $_output[$entry['entry_id']]['attachmentHtml'], $entry['entry'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$url = $this->registry->output->buildSEOUrl( \"app=blog&blogid={$entry['blog_id']}&showentry={$entry['entry_id']}\", 'publicNoSession', $entry['entry_name_seo'], 'showentry' );\n\n\t\t\t$this->class_rss->addItemToChannel( $channel_id, array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t\t\t=> $title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'link'\t\t\t=> $url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'\t=> $entry['entry'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'pubDate'\t\t=> $this->class_rss->formatDate( $entry['entry_date'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'guid'\t\t\t=> $url ) );\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Do the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->class_rss->createRssDocument();\n\n\t\t$this->class_rss->rss_document = $this->registry->output->replaceMacros( $this->class_rss->rss_document );\n\t\t$this->rss_document = $this->class_rss->rss_document;\n\t}", "function GeneralStatsSavePostForceCacheRefresh($id=-1, $post=false) {\r\n\t$autosave=false;\r\n\tif (function_exists('wp_is_post_autosave'))\r\n\t\tif ($post && is_object($post) && wp_is_post_autosave($post)>0)\r\n\t\t\t$autosave=true;\r\n\r\n\t$post_status='publish';\r\n\tif ($post && is_object($post) )\r\n\t\t$post_status=$post->post_status;\r\n\r\n\tif ($autosave===false && $post_status=='publish')\r\n\t\tGeneralStatsForceCacheRefresh();\r\n}", "public function uncache_munged_posts() {\n\t\t// $this context gets lost in testing sometimes. Weird.\n\t\tforeach( WPCom_Markdown::get_instance()->posts_to_uncache as $post_id ) {\n\t\t\twp_cache_delete( $post_id, 'posts' );\n\t\t}\n\t}", "function cache_key() {\n\treturn wp_cache_get_last_changed( 'posts' ) . 'wp_count_posts';\n}", "protected function setLastUpdated()\n {\n $this->setFieldValue(self::FIELD_LAST_UPDATED, time);\n }", "function wp_cache_get_last_changed($group)\n {\n }", "function wp_clean_update_cache()\n {\n }", "public function reset_changes_counter() {\n\t\tupdate_option( $this->counter_option, 0 );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function builds consonant clusters
function clusterator ($cluster_values, $consonant_values) { //declaring arrays that are used later on $replace_array = []; $ready_array = []; $clusters_exceptions = []; $no_ex_exceptions = []; $no_exclamation_clusters = []; $real_clusters = []; $final_clusters = []; $final_clusters_2 = []; $final_clusters_front_single = []; $temp_final = []; $final_clus_temp = []; //if the user submitted any clusters to be used if (count($cluster_values) > 0) { foreach ($cluster_values as $value) { //if there is an * in the cluster (which represents all consonants) the cluster is placed into the replace array if (strpos($value, '*')) { $replace_array[] = $value; } else { //this double checks for an * at the beginning of the string, strpos misses these for some reason if ($value[0] != '*') { //if there is no * the cluster is sent to the ready array $ready_array[] = str_replace('+', '', $value); } //if there is an * in the cluster (which represents all consonants) the cluster is placed into the replace array else { $replace_array[] = $value; } } } //the cluster is exploded at + creating a sub array of individual characters (with the exception of items containing an !) $exploded_cluster = explode("+", $value); //for the clusters that do contain a * foreach ($replace_array as $value) { //if the cluster string does not contain a ! (! marks exceptions to the all consonant rule) if (!strpos($value, '!')) { //for each consonant that the user selected foreach ($consonant_values as $value2) { //the * in the cluster string is replaced by a user selected consonant $final_clus_temp[] = str_replace('*', $value2, $value); //$semi_final_clusters[] = str_replace('+', '', $final_clus_temp); } foreach ($final_clus_temp as $value2) { $exploded_clus_temp = explode('+', $value2); //removes duplicate phonemes from clusters $final_clus_temp_2 = implode("", array_unique($exploded_clus_temp)); //only strings containing two or more phonemes if (strlen($final_clus_temp_2) > 1) { $final_clusters[] = $final_clus_temp_2; } } } else { //the cluster is exploded at + creating a sub array of individual characters (with the exception of items containing an !) $exploded_cluster = explode("+", $value); //for each user selected consonant foreach ($consonant_values as $value2) { //for each ipa character or ! and ipa character in a cluster string foreach ($exploded_cluster as $key3 => $value3) { //if there is an ! in the string if (substr_count($value3, '!') > 0) { //cluster characters with ! $clus[] = $value3; //cluster characters with ! removed $no_ex_clus[] = str_replace('!', '', $value3); //exceptions to the all consonant rule are added to an array with the full raw cluster as key. Array unique is used to insure no repeat values $clusters_exceptions[$value] = array_unique($clus); //exceptions - ! are added to and array with the full raw cluster data as key. $no_ex_exceptions[$value] = array_unique($no_ex_clus); //the above creates a sub array for each key, so that all exceptions to the all consonant rule created by using an * for each specific cluster are stored } } //cluster exceptions is a multi dimensional array where the value for each key is a sub array containing exceptions to the all consonant rule created by using an * foreach ($clusters_exceptions as $key3 => $value3) { //* are replaced in the cluster string by a consonant that the user has selected after the exceptions have been removed from the string //str_replace here is using an imploded array_diff of the exploded cluster array compared against arrays of exeptions to the all consonants rule. //This means that only characters that are in the $exploded cluster array and NOT in the array of exceptions are imploded into the string which then has its * replaced. $no_asterix = str_replace('*', $value2, implode("+", array_diff($exploded_cluster, $value3))); //the value of $no_asterix (a string with a * replaced by a user selected consonant and all excepted characters removed) is pushed into the real clusters array. $real_clusters[] = $no_asterix; } } } } //for each cluster foreach ($real_clusters as $key => $value) { //clusters are exploded into arrays at + $exploded_real_clusters = explode('+', $value); //for each excemted character - its ! foreach ($no_ex_exceptions as $value2) { //only characters that are not characters from the no_ex_exceptions array (using aray diff) are imploded into the temp final array as strings // (any character that is a forbidden character is disregarded and only relavent ones are pushed into $temp_final[] in clusters) //doubles of the same consonant are also removed $temp_final_2[] = implode("", array_diff(array_unique($exploded_real_clusters), $value2)); } foreach ($temp_final_2 as $value) { //checks to see that there is more than one character in the "cluster". this removes any leftover 2 consonant clusters //that had an excemted character removed, leacving them as a single consonant. if (strlen($value) > 1) { //all processed clusters are added to this array $final_clusters_2[] = $value; } } } //the array of clusters that contained an * (all consonant rule) and the array of clusters that contained dedicated consonants are merged $full_final_clusters = array_merge(array_unique($final_clusters), array_unique($final_clusters_2), array_unique($ready_array)); //the merged array of all clusters is returned return $full_final_clusters; } }
[ "public abstract function calculateClusters();", "private function selectInitialClusterCentroids()\n\t{\n\t\t$total_no_of_documents=count($this->document_set);\n\t\t$random_max=floor($total_no_of_documents/$this->k);\n\t\t \n\t\t$counter=0;\n\t\t$counter_next=rand(1, $random_max);\n\t\t$k=0;\n\t\tforeach($this->term_document_matrix as $doc_id=>$document)\n\t\t{\n\t\t\t$counter++;\n\n\t\t\tif($counter==$counter_next)\n\t\t\t{\n\t\t\t $k++;\n\t\t\t $this->cluster_centroids[$k]=$document;\n\t\t\t \n\t\t\t $counter_next+=rand(1, $random_max);\n\t\t\t}\n\n\t\t\tif($k==$this->k)\n\t\t\t{\n\t\t\t break;\n\t\t\t}\n\t\t}\n\t}", "private function cluster() { }", "function newCentroid($data, $cluster, $centroid){\r\n \r\n \r\n \r\n\r\n // setiap data yang memiliki cluster yang sama akan di masukkan ke dalam $multi_cluster -\r\n // sesuai index nya masing masing, index disini menggantikan nilai cluster yang di tuju -\r\n // oleh setiap data.\r\n $multi_cluster=array();\r\n foreach($cluster as $row_m_cluster=>$m_cluster){\r\n $multi_cluster[$m_cluster][] = $row_m_cluster;\r\n }\r\n // CONTOH\r\n // siswa 1 dan 4 termasuk cluster 2\r\n // siswa 2, 3 dan 5 termasuk cluster 1\r\n // maka akan di simpan \r\n // [1][] = 1, [1][] = 4\r\n // [0][] = 2, [0][] = 3, [0][] = 5\r\n \r\n // pada pemrosesan sebelumnya dapat terlihat bahwa data yang di simpan akan berurutkan -\r\n // cluster berapa yag di miliki oleh data pertama, maka dari itu data tersebut harus -\r\n // di urutkan terlebih dahulu menggunakan fungsi ksort(),\r\n // ksort() = mengurutkan secara ascending berdasarkan nilai key yang dimiliki.\r\n ksort($multi_cluster);\r\n \r\n \r\n // echo \"<br><br>\";\r\n // echo\"Multi Cluster<br>\";\r\n // print_r(json_encode($multi_cluster));\r\n // echo \"<br><br>\";\r\n \r\n \r\n // proses code dibawah berfungsi untuk menghitung centroid baru sesuai dengan -\r\n // metode k-means, lalu nilai dari centroid baru disimpan kedalam var $centroid_baru\r\n // di kembalikan kedalam variable yang memanggil fungsi new_centroid()\r\n $centroid_baru = array();\r\n foreach($multi_cluster as $row_m_multi_cluster=>$m_multi_cluster){\r\n foreach($centroid[0] as $row_m_centroid=>$_m_centroid){ // hanya agar looping sebanyak jumlah mapel :D\r\n $temp_centroid = 0;\r\n // echo \"<br>start||\";\r\n foreach($m_multi_cluster as $n_multi_cluster){\r\n $temp_centroid += $data[$n_multi_cluster][$row_m_centroid];\r\n // $original = $data[$n_multi_cluster][$row_m_centroid];\r\n // echo \"[$n_multi_cluster][$row_m_centroid]=$original + \";\r\n }\r\n $temp_centroid = round($temp_centroid/count($m_multi_cluster), 2);\r\n $centroid_baru[$row_m_multi_cluster][] = $temp_centroid;\r\n // echo \" / \". count($m_multi_cluster) . \"= \". $temp_centroid ;\r\n }\r\n }\r\n \r\n // echo \"<br>\";\r\n return $centroid_baru;\r\n}", "function cluster_centroid($length,$size1,$kmean, &$merge_array, $centroid){\n\t//calculate the centroids of a cluster\n\t//inialis ethe cluster arrays\n\t$centroid =array();\n\tfor($k = 0;$k<$kmean;$k++){\n\t\tfor($i = 0;$i<$size1;$i++){\n\t\t\t$centroid[$k][$i] = 0;\n\t\t}\n\t}\n\t//declare the variable\n\t$cluster_no = 0;\n\n\t//depending on their existing cluster us ethe coordinates of the documents to calculate the new centoid\n\n\tfor($i = 0;$i<$size1;$i++){//loop for each coordinate\n\n\t\tfor($j = 0;$j<$length;$j++){//loop for each document in thecluster\n\t\t\t\t\n\t\t\tfor($k = 0;$k<$kmean;$k++){//loop for each cluster\n\t\t\t\t$cluster_no = $k + 1;\n\t\t\t\tif($merge_array[$j][7] == $cluster_no){// it has alreay been assigned to cluster\n\t\t\t\t\t$centroid[$k][$i] = $centroid[$k][$i] + $merge_array[$j][1][$i];// add each individual coordinate\n\t\t\t\t}\n\t\t\t\t$centroid[$k][$i] = $centroid[$k][$i]/$size1;//divide by the number of coordinates to gte the centroid coordinate\n\n\t\t\t}}\n\t}\n\n\treturn $centroid;\n\n}", "function clustering($data, $centroid){ \r\n\r\n // echo \"<br><br>\";\r\n // echo\"Centroid<br>\";\r\n // print_r(json_encode($centroid));\r\n // echo \"<br><br>\";\r\n\r\n\r\n // Menghutung jarak setiap data mapel siswa dengan centroid yang telah ditentukan -\r\n // lalu jarak tersebut di simpan kedalan variable $jarak_centroid.\r\n foreach($data as $row_m_data => $m_data){ \r\n foreach($centroid as $row_m_centroid => $m_centroid){\r\n // mendefinisikan jarak awal seelum perhitungan setiap data = 0\r\n // agar tidak terjadi salah perhitungan pada looping berikutnya.\r\n $jarak_centroid[$row_m_data][$row_m_centroid] = 0.0;\r\n $jarak = 0.0;\r\n // echo \"sqrt(\";\r\n foreach($m_centroid as $row_single_centroid => $single_centroid){\r\n $single_data = $m_data[$row_single_centroid];\r\n $jarak += pow(($single_data - $single_centroid), 2);\r\n // echo\"(($single_data - $single_centroid)^ 2) [$jarak] + \";\r\n }\r\n // echo \")\";\r\n $hasil = round(sqrt($jarak),2);\r\n $jarak_centroid[$row_m_data][$row_m_centroid] = $hasil;\r\n // echo \"= \" . $hasil. \"<br>\";\r\n }\r\n // echo\"<br><br>\";\r\n }\r\n\r\n // Setelah melakukan perhitungan jarak, maka ditentukan lah jarak terdekat dari - \r\n // setiap data dengan setiap centroid.\r\n // jarak rata rata data dari setiap nilai siswa yang paling dekat dengan centroid -\r\n // yang ada akan di simpan ke dalam var new_centroid lalu di kembalikan kedalam\r\n // variable yang memanggil fungsi clustering().\r\n foreach($jarak_centroid as $m_jarak){ // Menghitung jarak terdekat\r\n $nearest_cluster[] = array_search(min($m_jarak), $m_jarak);\r\n }\r\n\r\n // echo \"<br><br>\";\r\n // echo\"new centroid<br>\";\r\n // print_r(json_encode($new_centroid));\r\n // echo \"<br><br>\";\r\n\r\n return $nearest_cluster;\r\n}", "public function testBuildCluster()\n {\n $nodes = (new Builder)\n ->onPort(10018)\n ->buildCluster(['riak1.company.com', 'riak2.company.com', 'riak3.company.com',]);\n\n $this->assertTrue(count($nodes) == 3);\n $this->assertTrue($nodes[1]->getHost() == 'riak2.company.com');\n $this->assertTrue($nodes[0]->getPort() == 10018);\n $this->assertTrue($nodes[1]->getPort() == 10018);\n }", "protected function _assignClusters() {\n foreach ($this->_points as $point) {\n $centroids = $this->centroids;\n usort(\n $centroids,\n function ($a, $b) use ($point) {\n return $point->distance($a) - $point->distance($b);\n }\n );\n $closest = $centroids[0];\n $idx = array_search($closest, $this->centroids);\n $cluster = $this->_clusters[$idx];\n $cluster->points[] = $point;\n }\n }", "public function cluster()\n {\n $pairs = $this->generatePairs($this->inputData);\n $this->clusters = $this->doCluster($pairs);\n return $this->clusters;\n }", "function cluster_print($kmean, $length,&$merge_array){\n\t//var_dump($merge_array);\n\t//print you your clusters\n\t//set so that it starts count at 1 rather than 0\n\t$kmean = $kmean + 1;\n\tfor($k = 1;$k<$kmean;$k++){\n\n\t\techo \"CLUSTER \".$k.'<br/>';\n\n\t\tfor($j = 0;$j<$length;$j++){\n\t\t\t//echo $merge_array[$j][7].\" is the cluster <br/>\";\n\t\t\tif($merge_array[$j][7] == $k){\n\t\t\t\techo '<a href=\"'.$merge_array[$j][0].'\">'.$merge_array[$j][4].'</a>'.\"<br/>\";\n\t\t\t\techo \"<br/>\";\n\t\t\t\techo $merge_array[$j][3].'<br/>';\n\t\t\t\techo \"<br/>\";\n\t\t\t\techo $merge_array[$j][0].\"<br/>\";\n\t\t\t\techo \"<br/>\";\n\t\t\t}\n\t\t}\n\t}\n\n}", "function agglomerate($labels, $grid)\n{\n\t$clusters = $labels;\n\twhile (count($clusters) > 1)\n\t{\n\t\t$distances = array(array(1, 0, $grid[1][0]));\n\t\tfor ($i = 2; $i < count($grid); $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < $i; $j++)\n\t\t\t{\n\t\t\t\t$distances[] = array($i, $j, $grid[$i][$j]);\n\t\t\t}\n\t\t}\n\t\tusort($distances,\n\t\t\tfunction ($a, $b) { return $b[2] < $a[2]; });\n\t\tlist($j, $i, $d) = $distances[0];\n\t\t# merge i⇐j\n\t\t$c = new Cluster($d);\n\t\tlist($clusters, $grid) = $c->add($clusters, $grid, $i, $j);\n\t\t$clusters[$i] = $c;\n\t}\n\treturn $clusters[min(0, count($clusters)-1)];\n}", "public function isCoherence() {\r\n\t\t$nodes = $this->getAllNodes();\r\n\t\t$clusters = array();\r\n\t\t\r\n\t\t// Cluster fuer jeden Knoten erstellen\r\n\t\tforeach ( $nodes as $nodeID => $label ) {\r\n\t\t\t$cluster = new SimpleNodeCluster();\r\n\t\t\t$cluster->addNode($nodeID);\r\n\t\t\tarray_push($clusters, $cluster);\r\n\t\t}\r\n\t\t\r\n\t\t// Cluster anhand der Kanten verbinden\r\n\t\tforeach ( $this->edges as $edge ) {\r\n\t\t\tforeach ( $edge as $sourceID => $targetID ) {\r\n\t\t\t\t$clusterID1 = null;\r\n\t\t\t\t$clusterID2 = null;\r\n\t\t\t\tforeach ( $clusters as $index => $cluster ) {\r\n\t\t\t\t\tif ( $cluster->contains($sourceID) ) $clusterID1 = $index;\r\n\t\t\t\t\tif ( $cluster->contains($targetID) ) $clusterID2 = $index;\r\n\t\t\t\t\tif ( !is_null($clusterID1) && !is_null($clusterID2) ) break;\r\n\t\t\t\t}\r\n\t\t\t\t// Cluster verbinden und eins entfernen\r\n\t\t\t\tif ( $clusterID1 != $clusterID2 ) {\r\n\t\t\t\t\t$clusters[$clusterID1]->combine($clusters[$clusterID2]);\r\n\t\t\t\t\tunset($clusters[$clusterID2]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->nodeClusters = $clusters;\r\n\t\t\r\n\t\t// Wenn genau ein Cluster resultiert, dann ist die EPK zusammenhaengend, andernfalls nicht\r\n\t\tif ( count($clusters) == 1 ) return true;\r\n\t\treturn false;\r\n\t}", "public function getConsonants() {\n\t\treturn $this->consonants();\n\t}", "public function initRandom()\n {\n $min = $this->computeMinPoint($this->points);\n $max = $this->computeMaxPoint($this->points);\n for ($i = 0; $i < $this->k; ++$i) {\n // initialize clusters centers randomly\n $center = array();\n for ($d = 0; $d < $this->dim; ++$d) {\n $center[$d] = rand($min[$d], $max[$d]);\n }\n $this->centroids[$i] = $center;\n }\n }", "public function requiresClusterizing()\n {\n return true;\n }", "function vueCluster($groupes){\n\t$num=0;\n\tfor($i=0;$i<sizeof($groupes);$i++){\n\t\t$num++;$trs='';$th='';$trs2='';$ths='';\n\t\t$listDist=calculDatas($groupes[$i]);\n\t\techo \"<div class='cluster'>\";\n\t\techo \"<h4>CLUSTER \".$num.\"</h4>\";\n\t\techo \"<p><strong>Liste des clubs:</strong><br>\";\n\t\tfor($x=0;$x<sizeof($groupes[$i]);$x++){\n\n\t\t\tif(($x%4) == 0 && $x>3){\n\t\t\t\techo \"</p><p><br>\" ;\n\t\t\t}\n\t\t\t// on affiche le nom des clubs pour chaque groupes\n\t\t\techo \"<span draggable='true' ondragstart='drag(event)''>\".htmlesc($groupes[$i][$x]->getNom()).\"</span>\";\n\t\t\tif($x==sizeof($groupes[$i])-1){\n\t\t\t\techo '.';\n\t\t\t}else{\n\t\t\t\techo ' <br> ';\n\t\t\t}\n\t\t\t// on affiche le tableau des distances\n\t\t\t$trs=$trs.'<th>'.htmlesc($groupes[$i][$x]->getNom()).'</th>';\n\t\t\t$trs2=$trs2.'<th>'.htmlesc($groupes[$i][$x]->getNom()).'</th>';\n\t\t\t$ths=$ths.'<th>'.htmlesc($groupes[$i][$x]->getNom()).'</th>';\n\t\t\tfor($j=0;$j<sizeof($groupes[$i]);$j++){\n\t\t\t\t$valdist = mTokm($listDist[0][$x][$j]);\n\t\t\t\t$valtps=secToHeures($listDist[1][$x][$j]);\n\n\t\t\t \t$trs =$trs.'<td>'.$valdist.'</td>';\n\t\t\t \t$trs2 =$trs2.'<td>'.$valtps.'</td>';\n\t\t\t}\n\t\t\t$trs= '<tr>'.$trs.'</tr>';\n\t\t\t$trs2= '<tr>'.$trs2.'</tr>';\n\t\t}\n\t\t$listVal=calculData($groupes[$i]);\n\t\t$stat=calculStat($listVal[0]);\n\t\t$stat2=calculStat($listVal[1]);\n\t\t$total = \"distance total: \".mTokm($stat[0]).\" km<br> \";\n\t\t$moy = \"distance moyenne: \".mTokm($stat[1]).\" km<br> \";\n\t\t$max = \"distance maximal: \".mTokm($stat[2]).\" km <br> \";\n\t\t$min = \"distance minimale: \".mTokm($stat[3]).\" km <br>\";\n\t\t$ecart = \"ecart-type distance: \".mTokm($stat[4]).\" km <br>\";\n\n\t\t$total2 = \"total des tenps de trajet: \".secToHeures($stat2[0]).\" <br> \";\n\t\t$moy2 = \"moyenne temps de trajet: \".secToHeures($stat2[1]).\" <br> \";\n\t\t$max2 = \"temps du trajet maximal: \".secToHeures($stat2[2]).\" <br> \";\n\t\t$min2 = \"temps du trajet minimale: \".secToHeures($stat2[3]).\" <br>\";\n\t\t$ecart2 = \"ecart-type temps du trajet: \".secToHeures($stat2[4]).\" <br>\";\n\n\t\techo \"</p>\n\t\t\t<p class='statdist'\n\t\t\t style='float:right;text-align:left;margin-right:0px;color:rgba(0,0,0,0.7);display:block;'>\n\t\t\t \t<strong>Statistique:</strong><br>\".$total.$moy.$max.$min.$ecart.\"\n\t\t\t</p>\n\t\t\t<p class='stattps'\n\t\t\t style='float:right;text-align:left;margin-right:0px;color:rgba(0,0,0,0.7);display:none;'>\n\t\t <strong>Statistique:</strong><br>\".$total2.$moy2.$max2.$min2.$ecart2.\"\n\t\t\t</p>\n\t\t\t<div class='content-table' >\n\t\t\t\t<table class='tabdist'>\n\t\t\t\t\t<tr><td style='color:#3DC2C4;text-align:left;font-weight:bold;background-color: rgba(250,250,250,0.8)'> DISTANCES_(km)</td>\".$ths.\"</tr>\".$trs.\"\n\t\t\t\t</table>\n\t\t\t\t<table class='tabtps'>\n\t\t\t\t\t<tr><td style='color:#3DC2C4;text-align:left;font-weight:bold;background-color: rgba(250,250,250,0.8)'> TEMPS </td>\".$ths.\"</tr>\".$trs2.\"\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<nav>\n\t\t\t\t<div class='tabBack' onclick='backTab()'><span class='glyphicon glyphicon-arrow-left'></span></div>\n\t\t\t\t<aside>\n\t\t\t\t\t\t<div class='tabdistB'></div> <div class='tabtpsB'></div>\n\t\t\t\t</aside>\n\t\t\t\t<div class='tabNext' onclick='nextTab()'><span class='glyphicon glyphicon-arrow-right'></span></div>\n\t\t\t</nav>\n\t\t</div>\";\n\t}\n}", "public function getConsonants()\n {\n return $this->_config['consonants'];\n }", "function h_cluster($rows,$distance='pearson') {\r\n\t$distances = array();\r\n\t$current_clust_id = -1;\r\n\t//Holds the cluster numbers and the distance. Assoc array with numbers $distances[''.$zero.','.$one.''] = 0.1298;\r\n\t$distances = array();\r\n\t\r\n\t//Clusters are initially just the rows\r\n\tforeach ($rows as $index => $i) {\r\n\t\t$clust[] = new Bicluster($i,null,null,0,$index);\r\n\t}\r\n\t\r\n\t//Repeat until one large cluster remains consisting of the smaller clusters\r\n\twhile (count($clust) > 1) {\t\t\r\n\t\t//Reset each time\r\n\t\t$lowestpair = array(0,1);\r\n\t\t$closest = call_user_func($distance,$clust[0]->vec,$clust[1]->vec);\r\n\t\t\r\n\t\t//echo count($clust).'<br />';\r\n\t\t\r\n\t\t//Loop through every pair looking for the smallest distance\r\n\t\tfor ($i = 0; $i < count($clust)-1; $i++) {\r\n\t\t\tfor ($j = $i + 1; $j < count($clust); $j++) {\r\n\t\t\t\t//set_time_limit(0);\r\n\t\t\t\t\r\n\t\t\t\t//Distances is the cache of distance calculations\r\n\t\t\t\tif (!array_key_exists(''.$clust[$i]->id.','.$clust[$j]->id.'',$distances)) {\r\n\t\t\t\t\t$distances[''.$clust[$i]->id.','.$clust[$j]->id.''] = call_user_func($distance,$clust[$i]->vec,$clust[$j]->vec);\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$d = $distances[''.$clust[$i]->id.','.$clust[$j]->id.''];\r\n\t\t\t\t\r\n\t\t\t\tif ($d < $closest) {\r\n\t\t\t\t\t$closest = $d;\r\n\t\t\t\t\t$lowestpair = array($i,$j);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Calculate the average of the new cluster\r\n\t\t$mergevec = array();\r\n\t\tforeach ($clust[0]->vec as $index => $item) {\r\n\t\t\t$mergevec[] = ($clust[$lowestpair[0]]->vec[$index] + $clust[$lowestpair[1]]->vec[$index]) / 2;\r\n\t\t}\r\n\t\t\r\n\t\t//Create the new cluster\r\n\t\t$newcluster = new Bicluster(\r\n\t\t\t\t\t\t\t\t$mergevec,\r\n\t\t\t\t\t\t\t\t$clust[$lowestpair[0]],\r\n\t\t\t\t\t\t\t\t$clust[$lowestpair[1]],\r\n\t\t\t\t\t\t\t\t$closest,\r\n\t\t\t\t\t\t\t\t$current_clust_id\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\r\n\t\t//Cluster ids that weren't in the original set are negative\r\n\t\t$current_clust_id -= 1;\r\n\t\tunset($clust[$lowestpair[0]]);\r\n\t\tunset($clust[$lowestpair[1]]);\r\n\t\tarray_push($clust, $newcluster);\r\n\t\t\r\n\t\t//Repair the index, unset removes the value and the index\r\n\t\t$clust = array_values($clust);\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $clust[0];\r\n\t\r\n}", "public function setClustersCenter($value);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets query for [[Dusun]].
public function getDusun() { return $this->hasOne(Dusun::className(), ['id' => 'dusun_id']); }
[ "public function getQuery(){\n\t\t\n\t\t$isin = $this->isin ;\n\t\t\n\t\t$query = '\nPREFIX wikibase: <http://wikiba.se/ontology#>\nPREFIX wd: <http://www.wikidata.org/entity/>\nPREFIX wdt: <http://www.wikidata.org/prop/direct/>\n\nSELECT ?item ?itemLabel WHERE {\n ?item wdt:P946 \"' . $isin . '\".\n \n SERVICE wikibase:label { bd:serviceParam wikibase:language \"es, en, [AUTO_LANGUAGE]\". }\n}';\n\n\t\t\n\n\t\treturn $query;\n\t}", "public function getQuery();", "public function get_query() {\n return $this->query;\n }", "public abstract function get_query();", "function _buildQuery()\n\t{\n\t\treturn $this->_dataset->getQuery();\n\t}", "protected function getQuery() {\n return $this->container\n ->get('entity_type.manager')\n ->getStorage('sparql_test')\n ->getQuery();\n }", "function getDjsFromSearch($query) {\n // sql statement\n $stmt = '\n SELECT id,\n username,\n (SELECT COUNT(Setlists.id)\n FROM Setlists\n WHERE Setlists.dj_id = Djs.id) AS count_setlists\n FROM Djs\n WHERE username LIKE :username\n ORDER BY username ASC\n LIMIT 5';\n\n $sql = dbConnect()->prepare($stmt);\n\n // filter and bind the username query\n $username = \"%$query%\";\n $username = filter_var($username, FILTER_SANITIZE_STRING);\n $sql->bindParam(':username', $username, PDO::PARAM_STR);\n\n // return result\n $sql->execute();\n return $sql;\n}", "public function buildQuery();", "protected function getQuery() {\n\n\t \t\t return $this->sql;\n\t }", "public function getDql()\n {\n $q = '';\n if ($this->_type == self::SELECT) {\n $q .= ( ! empty($this->_dqlParts['select'])) ? 'SELECT ' . implode(', ', $this->_dqlParts['select']) : '';\n $q .= ( ! empty($this->_dqlParts['from'])) ? ' FROM ' . implode(' ', $this->_dqlParts['from']) : '';\n } else if ($this->_type == self::DELETE) {\n $q .= 'DELETE';\n $q .= ( ! empty($this->_dqlParts['from'])) ? ' FROM ' . implode(' ', $this->_dqlParts['from']) : '';\n } else if ($this->_type == self::UPDATE) {\n $q .= 'UPDATE ';\n $q .= ( ! empty($this->_dqlParts['from'])) ? implode(' ', $this->_dqlParts['from']) : '';\n $q .= ( ! empty($this->_dqlParts['set'])) ? ' SET ' . implode(' ', $this->_dqlParts['set']) : '';\n }\n $q .= ( ! empty($this->_dqlParts['where'])) ? ' WHERE ' . implode(' ', $this->_dqlParts['where']) : '';\n $q .= ( ! empty($this->_dqlParts['groupby'])) ? ' GROUP BY ' . implode(', ', $this->_dqlParts['groupby']) : '';\n $q .= ( ! empty($this->_dqlParts['having'])) ? ' HAVING ' . implode(' AND ', $this->_dqlParts['having']) : '';\n $q .= ( ! empty($this->_dqlParts['orderby'])) ? ' ORDER BY ' . implode(', ', $this->_dqlParts['orderby']) : '';\n $q .= ( ! empty($this->_dqlParts['limit'])) ? ' LIMIT ' . implode(' ', $this->_dqlParts['limit']) : '';\n $q .= ( ! empty($this->_dqlParts['offset'])) ? ' OFFSET ' . implode(' ', $this->_dqlParts['offset']) : '';\n\n return $q;\n }", "function getQuery()\n {\n return $this->sql;\n }", "function getQuery(): string {\n return $this->statement->getQuery();\n }", "function get_query()\n {\n return (isset($this->query)) ? $this->query : false;\n }", "protected function getUserQuery()\n {\n $query = <<<'GRAPHQL'\n {\n Me{\n Person{\n __typename\n ...on Employee {\n id\n title\n surname\n forename\n School {\n id\n name\n establishment_number\n la_code\n urn\n address_line_1\n address_line_2\n address_town\n address_postcode\n country\n }\n ContactDetails {\n email\n telephone_mobile\n }\n },\n ...on Student {\n id\n surname\n forename\n School {\n id\n name\n establishment_number\n la_code\n urn\n address_line_1\n address_line_2\n address_town\n address_postcode\n country\n }\n }\n ...on Contact {\n id\n surname\n forename\n }\n }\n }\n }\n GRAPHQL;\n\n return urlencode($query);\n }", "function _dsql(){\n if(!$this->dsql)$this->initQuery();\n return $this->dsql;\n }", "public function getQueryName();", "protected function getAuthorNsidQuery()\n {\n return $this->authorNsidQuery;\n }", "public function getAdmin(): Query\n {\n return $this->admin;\n }", "public function getQuery() {\n $jql= $this->what.' '.$this->op->forValue($this->value);\n \n foreach ($this->next as $query) $jql .= sprintf(\n ' %s %s',\n $query[0],\n $query[1]->size() ? '('.$query[1]->getQuery().')' : $query[1]->getQuery()\n );\n \n if (sizeof($this->order)) {\n $jql.= ' order by';\n \n foreach ($this->order as $i => $order) {\n $jql.= ' '.$order[0].' '.$order[1].($i+1 < sizeof($this->order) ? ', ' : '');\n }\n }\n \n return $jql;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Proportion of pregnant women with 4 ANC checkup
public function get_proportion_of_pregnant_woman_with_four_anc_checkup() { $query = "select count(*) as total from (SELECT count(v.AncVisitID) as total FROM tblancvisit v inner join tblpregnant_woman pw on v.PWGUID = pw.PWGUID inner join tblhhfamilymember fm on pw.HHFamilyMemberGUID = fm.HHFamilyMemberGUID inner join tblhhsurvey h on fm.HHSurveyGUID = h.HHSurveyGUID where v.CheckupVisitDate is not null and pw.IsDeleted = 0 and fm.IsDeleted = 0 and h.IsDeleted = 0 "; if ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL) { $query .= " and v.CheckupVisitDate > '" . $this->filter_data['date_from'] . "' and v.CheckupVisitDate < '" . $this->filter_data['date_to'] . "'"; } if ($this->filter_data['ANM'] != NULL) { $query .= " and pw.ANMID = " . $this->filter_data['ANM']; } if ($this->filter_data['Asha'] != NULL) { $query .= " and pw.AshaID = " . $this->filter_data['Asha']; } $query .= " and pw.CreatedBy in (select user_id from tblusers where is_deleted=0 "; if ($this->loginData->user_role == 6 || $this->loginData->user_role == 10) { $state_code = $this->loginData->state_code; $query .= " and state_code = '$state_code'"; } else if ($this->loginData->user_role == 7 || $this->loginData->user_role == 11) { $state_code = $this->loginData->state_code; $district_code = $this->loginData->district_code; $query .= " and state_code = '$state_code' and district_code='$district_code'"; } else if ($this->loginData->user_role == 8 || $this->loginData->user_role == 12) { $state_code = $this->loginData->state_code; $district_code = $this->loginData->district_code; $block_code = $this->loginData->block_code; $query .= " and state_code = '$state_code' and district_code='$district_code' and block_code='$block_code'"; } $query .= " and user_mode=1)"; $query .= " group by pw.PWGUID having count(*) = 4)a UNION ALL SELECT count(pw.PWGUID) as total FROM tblpregnant_woman pw where 1=1 and pw.IsDeleted = 0"; if ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL) { $query .= " and pw.LMPDate > '" . $this->filter_data['date_from'] . "' and pw.LMPDate < '" . $this->filter_data['date_to'] . "'"; } if ($this->filter_data['ANM'] != NULL) { $query .= " and pw.ANMID = " . $this->filter_data['ANM']; } if ($this->filter_data['Asha'] != NULL) { $query .= " and pw.AshaID = " . $this->filter_data['Asha']; } $query .= " and pw.CreatedBy in (select user_id from tblusers where is_deleted=0 "; if ($this->loginData->user_role == 6 || $this->loginData->user_role == 10) { $state_code = $this->loginData->state_code; $query .= " and state_code = '$state_code'"; } else if ($this->loginData->user_role == 7 || $this->loginData->user_role == 11) { $state_code = $this->loginData->state_code; $district_code = $this->loginData->district_code; $query .= " and state_code = '$state_code' and district_code='$district_code'"; } else if ($this->loginData->user_role == 8 || $this->loginData->user_role == 12) { $state_code = $this->loginData->state_code; $district_code = $this->loginData->district_code; $block_code = $this->loginData->block_code; $query .= " and state_code = '$state_code' and district_code='$district_code' and block_code='$block_code'"; } $query .= " and user_mode= 1)"; return $this->get_proportion($query); }
[ "function GetProportion(){}", "public function paragraphDensity()\n\t\t{\n\t\t\t$pwd = $this->result->data->analysis->pwd;\n\n\t\t\t// states: passed (green) - warning (yellow) - error (red)\n\t\t\t$ms = 100 - $pwd->measured->percentageParagraphsIdealWordCountMetadata;\n\t\t\t//$pwdMin = $pwd->recommended->paragraphWordDensityMin;\n\t\t\t$pwdMax = $pwd->recommended->paragraphWordDensityMax;\n\t\t\t// $state = arnanlyzer_rsl_state($ms, $rs);\n\t\t\t$state = strtolower($pwd->state);\n\n\t\t\t$out = '<div class=\"' . $this->DOMsort($state) . '\">' . PHP_EOL;\n\t\t\t$out .= '<input id=\"pwd\" name=\"pwd\" type=\"checkbox\" />' . PHP_EOL;\n\t\t\t$out .= '<label for=\"pwd\" id=\"ar-' . $state . '\">Paragraph Density</label>' . PHP_EOL;\n\t\t\t$out .= '<article class=\"ac-small\">' . PHP_EOL;\n\t\t\t$out .= '<p class=\"ar-analysis-' . $state . '\">';\n\t\t\tif ($state == 'green') {\n\t\t\t\t$out .= '<div>Your paragraphs are an ideal length for your target audience.</div>';\n\t\t\t} else {\n\t\t\t\t$out .= '<div>' . $ms . '% of your paragraphs are too long for your target audience. Write paragraphs with no greater than ' . $pwdMax . ' words.</div>';\n\t\t\t}\n\t\t\t$out .= '</p>' . PHP_EOL;\n\t\t\t$out .= '</article>' . PHP_EOL;\n\t\t\t$out .= '</div>' . PHP_EOL;\n\n\t\t\treturn $out;\n\t\t}", "public function getPopulationPeasantPercentage(Dominion $dominion);", "function calc_family_income_increase($pov){\n $count = array('single' => 0, 'couple' => 0);\n $total_increase = array('single' => 0, 'couple' => 0);\n // error_log('calc_family_income_increase = '. print_r($pov, true));\n\n // calc singles\n $p = $pov['single'];\n for ($i=0; $i < count($p['f0']); $i++){\n if ($p['f2'][$i]['work-only'] > $p['f0'][$i]['work-only']){\n $count['single'] += 1;\n $total_increase['single'] += $p['f2'][$i]['work-only'] - $p['f0'][$i]['work-only'];\n }\n }\n $p = $pov['couple'];\n for ($i=0; $i < count($p['f0']); $i++){\n if ($p['f2'][$i]['work-only'] > $p['f0'][$i]['work-only']){\n $count['couple'] += 1;\n $total_increase['couple'] += $p['f2'][$i]['work-only'] - $p['f0'][$i]['work-only'];\n }\n }\n if ($count['single']>0)\n $s1 = \"<h2>\". \"singles increase salary: number =\". $count['single']. \n \" (\". round($count['single']/count($pov['single']['f0'])*100) . \"%) \".\n \" avg increase= \" . round($total_increase['single']/$count['single']).\"</h2>\";\n else\n $s1 = \"<h2>\". \"singles increase salary: 0</h2>\";\n \n if ($count['couple']>0)\n $s2 = \"<h2>\". \"couples increase salary: number =\". $count['couple']. \n \" (\". round($count['couple']/count($pov['couple']['f0'])*100) . \"%) \".\n \" avg increase= \" . round($total_increase['couple']/$count['couple']).\"</h2>\";\n else\n $s2 = \"<h2>\". \"couples increase salary: 0</h2>\";\n\n return $s1 . $s2;\n}", "function updateProbabilities() {\n\t\t// first update the word count of each category\n\t\t$rs = sql_query(\"SELECT catcode, SUM(wordcount) AS total FROM \".$this->table_wf.\" WHERE 1 GROUP BY catcode\");\n\t\t$total_words = 0;\n\t\twhile ($obj = mysql_fetch_object($rs)) {\n\t\t\t$total_words += $obj->total;\n\t\t}\n\n\t\tif ($total_words == 0) {\n\t\t\tsql_query(\"UPDATE \".$this->table_cat.\" SET wordcount = 0, probability = 0 WHERE 1\");\n\t\t} else {\n\t\t\t$rs = sql_query(\"SELECT catcode, SUM(wordcount) AS total FROM \".$this->table_wf.\" WHERE 1 GROUP BY catcode\");\n\t\t\twhile ($obj = mysql_fetch_object($rs)) {\n\t\t\t\t$proba = $obj->total / $total_words;\n\t\t\t\tsql_query(\"UPDATE \".$this->table_cat.\" SET wordcount=\".(int)$obj->total.\", probability=\".$proba.\" WHERE catcode = '\".$obj->catcode.\"'\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function success_average_proportion() {\n $sap = 0;\n if ($this->questionscount > 0) {\n if (!is_numeric($this->successavgproportion)) {\n // If we do not known the score average\n // then calculate it\n if (!is_numeric($this->successavg)) {\n $this->successavg = $this->success_average();\n }\n $sap = $this->successavg / $this->questionscount;\n $this->successavgproportion = $sap;\n } else {\n $sap = $this->successavgproportion;\n }\n }\n return $sap;\n }", "public function participacionProductos()\r\n {\r\n $qry = (1/$this->db->count_all('articulos'))*100;\r\n return $qry;\r\n }", "public function exposure() {\r\n $exposureCount = 0;\r\n foreach($this->groups as $group){\r\n// echo \"hey\".$group->exposureCount().\"<br />\";\r\n $exposureCount += $group->exposureCount();\r\n }\r\n return $exposureCount / $this->getPopulation() / ( $this->getPopulation() - 1 );\r\n }", "public function get_proportion_received_bcg_birth()\n\t{\n\n\t\t$query = \"SELECT\n\t\tCOUNT(pw.PWGUID) AS total\n\t\tFROM\n\t\ttblchild c\n\t\tINNER JOIN tblpregnant_woman pw ON\n\t\tc.pw_GUID = pw.PWGUID\n\t\tINNER JOIN tblhhfamilymember fm ON\n\t\tc.HHFamilyMemberGUID = fm.HHFamilyMemberGUID\n\t\tINNER JOIN tblhhsurvey h ON\n\t\tfm.HHSurveyGUID = h.HHSurveyGUID\n\t\tWHERE\n\t\tc.bcg >= c.child_dob AND(\n\t\tc.bcg <= c.child_dob + INTERVAL 1 YEAR\n\t) AND pw.IsDeleted = 0 AND c.IsDeleted = 0 AND fm.IsDeleted = 0 AND h.IsDeleted = 0\";\n\n\tif ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL)\n\t{\n\t\t$query .= \" and c.child_dob > '\" . $this->filter_data['date_from'] . \"' and c.child_dob < '\" . $this->filter_data['date_to'] . \"'\";\n\t}\n\n\tif ($this->filter_data['ANM'] != NULL) \n\t{\n\t\t$query .= \" and pw.ANMID = \" . $this->filter_data['ANM'];\n\t}\n\n\tif ($this->filter_data['Asha'] != NULL) \n\t{\n\t\t$query .= \" and pw.AshaID = \" . $this->filter_data['Asha'];\n\t}\n\n\t$query .= \" UNION ALL\n\tSELECT count(pw.PWGUID) from tblchild c \n\tinner join tblpregnant_woman pw\n\ton c.pw_GUID = pw.PWGUID\n\tinner join tblhhfamilymember fm on c.HHFamilyMemberGUID = fm.HHFamilyMemberGUID \n\tinner join tblhhsurvey h on fm.HHSurveyGUID = h.HHSurveyGUID\n\twhere 1=1 and pw.IsDeleted = 0 and c.IsDeleted = 0 and fm.IsDeleted = 0 and h.IsDeleted = 0\";\n\n\tif ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL)\n\t{\n\t\t$query .= \" and c.child_dob > '\" . $this->filter_data['date_from'] . \"' and c.child_dob < '\" . $this->filter_data['date_to'] . \"'\";\n\t}\n\n\tif ($this->filter_data['ANM'] != NULL) \n\t{\n\t\t$query .= \" and pw.ANMID = \" . $this->filter_data['ANM'];\n\t}\n\n\tif ($this->filter_data['Asha'] != NULL) \n\t{\n\t\t$query .= \" and pw.AshaID = \" . $this->filter_data['Asha'];\n\t}\n\n\t$query .= \" and pw.CreatedBy in (select user_id from tblusers where is_deleted=0 \";\n\tif ($this->loginData->user_role == 6 || $this->loginData->user_role == 10) \n\t{\n\t\t$state_code = $this->loginData->state_code;\n\t\t$query .= \" and state_code = '$state_code'\";\t\n\t}\n\telse if ($this->loginData->user_role == 7 || $this->loginData->user_role == 11) \n\t{\n\t\t$state_code = $this->loginData->state_code;\n\t\t$district_code = $this->loginData->district_code;\n\t\t$query .= \" and state_code = '$state_code' and district_code='$district_code'\";\t\n\t}\n\telse if ($this->loginData->user_role == 8 || $this->loginData->user_role == 12) \n\t{\n\t\t$state_code = $this->loginData->state_code;\n\t\t$district_code = $this->loginData->district_code;\n\t\t$block_code = $this->loginData->block_code;\n\t\t$query .= \" and state_code = '$state_code' and district_code='$district_code' and block_code='$block_code'\";\t\n\t}\n\t$query .= \" and user_mode= 1)\";\n\n\treturn $this->get_proportion($query);\n\n}", "function calcAlcPercentage($recipe) {\n $alcoholPercentage = 0.0;\n \n foreach($recipe as $ingredient)\n {\n $alcoholPercentage += $ingredient->alcohol * $ingredient->amount;\n }\n echo $alcoholPercentage;\n }", "function percentatges($partits)\n{\n\t$puntsRep = $partits[1];\n\t$puntsDem = $partits[0] - $partits[1];\n\t$totalpunts = $partits[0];\n\n\t$pcntRep = (int)(($puntsRep * 100) / $totalpunts);\n\t$pcntDem = (int)(100 - $pcntRep);\n\t$percentatges = array($pcntDem,$pcntRep);\n\treturn $percentatges;\n}", "function renal_tract_cancer_female(Request $request)\n\n {\n\n\n /* The conditional arrays */\n\n $Ismoke[5] = array(\n \"0\",\n \"0.2752175727739372700000000\",\n \"0.5498656631475861100000000\",\n \"0.6536242182136680100000000\",\n \"0.9053763661785879700000000\");\n\n /* Applying the fractional polynomial transforms */\n /* (which includes scaling) */\n\n $dage = $this->retrieveage($request);\n $dage = $dage / 10;\n $age_1 = pow($dage, -2);\n $age_2 = pow($dage, -2) * log($dage);\n $bmi = $this->calculatebmi($request);\n $dbmi = $bmi;\n $dbmi = $dbmi / 10;\n $bmi_1 = pow($dbmi, -2);\n $bmi_2 = pow($dbmi, -2) * log($dbmi);\n\n /* Centring the continuous variables */\n\n $age_1 = $age_1 - 0.039541322737932;\n $age_2 = $age_2 - 0.063867323100567;\n $bmi_1 = $bmi_1 - 0.151021569967270;\n $bmi_2 = $bmi_2 - 0.142740502953529;\n\n /* Start of Sum */\n $a = 0;\n $b = 0;\n /* The conditional sums */\n\n $Ismoke[$request->get('smoke_cat')] = $b;\n $a += $b;\n\n /* Sum from continuous values */\n\n $a += $age_1 * -0.0323226569626617470000000;\n $a += $age_2 * -56.3551410786635780000000000;\n $a += $bmi_1 * 1.2103910535779330000000000;\n $a += $bmi_2 * -4.7221299079939785000000000;\n\n /* get from browser */\n// $b_chronicpan= $request->get('b_chronicpan');\n// $b_type2= $request->get('b_type2');\n//\t$b_copd = $request->get('b_copd');\n $c_hb = $request->get('c_hb');\n// $fh_ovariancancer=$request->get('fh_ovariancancer');\n// $new_abdodist= $request->get('new_abdodist');\n $new_abdopain = $request->get('new_abdopain');\n $new_appetiteloss = $request->get('new_appetiteloss');\n// $new_breastlump=$request->get('new_breastlump');\n// $new_dysphagia=$request->get('new_dysphagia');\n// $new_gibleed=$request->get('new_gibleed');\n $new_haematuria = $request->get('new_haematuria');\n $new_indigestion = $request->get('new_indigestion');\n $new_pmb = $request->get('new_pmb');\n// $new_necklump = $request->get('new_necklump');\n// $new_pmb = $request->get('new_pmb');\n// $new_vte = $request->get('$new_vte');\n $new_weightloss = $request->get('$new_weightloss');\n// $s1_constipation = $request->get('s1_constipation');\n// $s1_bowelchange = $request->get('s1_bowelchange');\n// $s1_bruising = $request->get('s1_bruising');\n\n\n /* Sum from boolean values */\n\n\n $a += $c_hb * 1.2666531852544143000000000;\n $a += $new_abdopain * 0.6155954984707594500000000;\n $a += $new_appetiteloss * 0.6842184594676019600000000;\n $a += $new_haematuria * 4.1791444537241542000000000;\n $a += $new_indigestion * 0.5694329224821874600000000;\n $a += $new_pmb * 1.2541097882792864000000000;\n $a += $new_weightloss * 0.7711610560290518300000000;\n\n /* Sum from interaction terms */\n\n\n /* Calculate the $score itself */\n $score = $a + -8.9440775553776248000000000;\n return $score;\n }", "function clasificationProfesor($datosUsuario){ \n\n $probabilityBeginnerClass= getProbabilitiesClass($datosUsuario, \"Beginner\");\n $probabilityIntermediateClass= getProbabilitiesClass($datosUsuario, \"Intermediate\");\n $probabilityAdvancedClass= getProbabilitiesClass($datosUsuario,\"Advanced\");\n\n $quantityBeginer= getQuantity(\"class\", \"Beginner\",\"profesores\");\n $quantityIntermediate= getQuantity(\"class\", \"Intermediate\",\"profesores\");\n $quantityAdvanced= getQuantity(\"class\", \"Advanced\", \"profesores\");\n \n $totalQuantity = $quantityIntermediate+$quantityBeginer+$quantityAdvanced;\n\n $probabilities=array();\n\n $probabilityBeginnerArray=getProbabilityArray($probabilityBeginnerClass, $totalQuantity, $quantityBeginer);\n $probabilityIntermediateArray=getProbabilityArray($probabilityIntermediateClass, $totalQuantity, $quantityIntermediate);\n $probabilityAdvancedArray=getProbabilityArray($probabilityAdvancedClass, $totalQuantity, $quantityAdvanced);\n \n array_push($probabilities,$probabilityBeginnerArray);\n array_push($probabilities,$probabilityIntermediateArray);\n array_push($probabilities,$probabilityAdvancedArray);\n\n /*Obtiene el mayor*/\n $top=0;$clasificationNumber=0;\n for ($i = 0; $i < count($probabilities); $i++) {\n if($probabilities[$i] > $top){\n $top=$probabilities[$i];\n $clasificationNumber=$i;\n }\n }\n switch ($clasificationNumber) {\n case 0: return \"Beginner\"; break;\n case 1: return \"Intermediate\"; break;\n default: return \"Advanced\"; break;\n }\n}", "function proteindb_count_with_property($protein, $property) {\n global $proteindb_proteins;\n $amount = 0;\n for ($i=0; $i<strlen($protein); $i++)\n if (proteindb_is_amino_acid($protein[$i]))\n if (proteindb_is($protein[$i], $property)) $amount++;\n return $amount;\n }", "function getCombinedProbability(&$probabilities) {\n asort(&$probabilities);\n $positive_probability = 1;\n $negative_probability = 1;\n foreach ($probabilities as $probability) {\n // ose only words that are probable spam\n if ($probability > 0.5) {\n \t$positive_probability = $positive_probability * $probability;\n \t$negative_probability = $negative_probability * (1 -$probability);\n } // if\n } // if\n $total_probability = ($positive_probability) / (($positive_probability) + ($negative_probability));\n return $total_probability;\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 }", "public function get_proportion_children_less_45_days_hepb1()\n\t{\n\n\t\t$query = \"SELECT count(pw.PWGUID) as total from tblchild c \n\t\tinner join tblpregnant_woman pw\n\t\ton c.pw_GUID = pw.PWGUID\n\t\tinner join tblhhfamilymember fm \n\t\ton c.HHFamilyMemberGUID = fm.HHFamilyMemberGUID \n\t\tinner join tblhhsurvey h \n\t\ton fm.HHSurveyGUID = h.HHSurveyGUID\n\t\twhere (c.hepb2 <= c.child_dob + interval 45 day) and pw.IsDeleted = 0 and c.IsDeleted = 0 and fm.IsDeleted = 0 and h.IsDeleted = 0\";\n\n\t\tif ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL)\n\t\t{\n\t\t\t$query .= \" and c.child_dob > '\" . $this->filter_data['date_from'] . \"' and c.child_dob < '\" . $this->filter_data['date_to'] . \"'\";\n\t\t}\n\n\t\tif ($this->filter_data['ANM'] != NULL) \n\t\t{\n\t\t\t$query .= \" and pw.ANMID = \" . $this->filter_data['ANM'];\n\t\t}\n\n\t\tif ($this->filter_data['Asha'] != NULL) \n\t\t{\n\t\t\t$query .= \" and pw.AshaID = \" . $this->filter_data['Asha'];\n\t\t}\n\n\t\t$query .= \"\tUNION ALL\n\t\tSELECT count(pw.PWGUID) as total from tblchild c \n\t\tinner join tblpregnant_woman pw\n\t\ton c.pw_GUID = pw.PWGUID\n\t\tinner join tblhhfamilymember fm\n\t\ton c.HHFamilyMemberGUID = fm.HHFamilyMemberGUID \n\t\tinner join tblhhsurvey h\n\t\ton fm.HHSurveyGUID = h.HHSurveyGUID\n\t\twhere 1=1 and pw.IsDeleted = 0 and c.IsDeleted = 0 and fm.IsDeleted = 0 and h.IsDeleted = 0\";\n\n\t\tif ($this->filter_data['date_from'] != NULL && $this->filter_data['date_to'] != NULL)\n\t\t{\n\t\t\t$query .= \" and c.child_dob > '\" . $this->filter_data['date_from'] . \"' and c.child_dob < '\" . $this->filter_data['date_to'] . \"'\";\n\t\t}\n\n\t\tif ($this->filter_data['ANM'] != NULL) \n\t\t{\n\t\t\t$query .= \" and pw.ANMID = \" . $this->filter_data['ANM'];\n\t\t}\n\n\t\tif ($this->filter_data['Asha'] != NULL) \n\t\t{\n\t\t\t$query .= \" and pw.AshaID = \" . $this->filter_data['Asha'];\n\t\t}\n\n\t\t$query .= \" and pw.CreatedBy in (select user_id from tblusers where is_deleted=0 \";\n\t\tif ($this->loginData->user_role == 6 || $this->loginData->user_role == 10) \n\t\t{\n\t\t\t$state_code = $this->loginData->state_code;\n\t\t\t$query .= \" and state_code = '$state_code'\";\t\n\t\t}\n\t\telse if ($this->loginData->user_role == 7 || $this->loginData->user_role == 11) \n\t\t{\n\t\t\t$state_code = $this->loginData->state_code;\n\t\t\t$district_code = $this->loginData->district_code;\n\t\t\t$query .= \" and state_code = '$state_code' and district_code='$district_code'\";\t\n\t\t}\n\t\telse if ($this->loginData->user_role == 8 || $this->loginData->user_role == 12) \n\t\t{\n\t\t\t$state_code = $this->loginData->state_code;\n\t\t\t$district_code = $this->loginData->district_code;\n\t\t\t$block_code = $this->loginData->block_code;\n\t\t\t$query .= \" and state_code = '$state_code' and district_code='$district_code' and block_code='$block_code'\";\t\n\t\t}\n\t\t$query .= \" and user_mode= 1)\";\n\n\t\treturn $this->get_proportion($query);\n\n\t}", "public function calculate_predicted_grade()\n {\n //CETAS\n }", "private function countDev(): int\n {\n return $this->countSpeciality();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds a user by its confirmationToken.
public function findUserByConfirmationToken($token);
[ "public function findUserByConfirmationToken($token)\n {\n // TODO: Implement findUserByConfirmationToken() method.\n }", "public function findUserByConfirmationToken($token)\n {\n return $this->findUserBy(['confirmationToken' => $token]);\n }", "public function findUserByConfirmationToken(string $token): ?UserInterface;", "public function findUserByToken($token);", "function findByToken($token) {\n return Users::find(array(\n 'conditions' => 'token = ' . db_escape($token),\n 'one' => true,\n ));\n }", "public static function findByVerificationToken($token)\n {\n $query = new Query();\n $query->select('user_id')->from('token')->where(['token' => $token]);\n return $user = $query->createCommand()->query()->read()['user_id'];\n }", "public function findByConfirmationToken($token)\n {\n return $this->model->where('confirmation_token', $token)->first();\n }", "public function findUserBySessionToken($token)\n {\n $response = null;\n\n foreach ($this->repository as $uid => $item) {\n if (hash('sha256', $item['email']) === $token) {\n $response = $this->createUser($uid, $item);\n break;\n }\n }\n\n return $response;\n }", "private function findUserByToken()\n {\n if(class_exists($this->token_location)) {\n // Got class\n $token_class = $this->token_location::where('token', $this->getToken())\n ->where('expiration', '>=', Carbon::now()->toDateTimeString())\n ->where('type', 'api')\n ->first();\n\n if(is_object($token_class)) {\n return $this->user_class::find($token_class->user_id);\n }\n\n return false;\n }\n\n // Got field\n try {\n return $this->user_class::where($this->token_location, $this->token)->first();\n } catch(QueryException $e) {\n return false;\n }\n }", "public function findByVerifyEmailHashToken($token)\n {\n return $this->em->createQueryBuilder()\n ->from(User::class, 'u')\n ->select('u')\n ->andWhere('u.verifyEmailHash = :token')\n ->setParameter('token', $token)\n ->getQuery()\n ->getOneOrNullResult();\n }", "final public static function findUserWithToken (string $token)\n\t{\n\t\tif (!static::hasValue($token)) {\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\t// self::isOtpTokenRecent();\n\t\t\t// $user = find_one_in_fake_db('users', 'reset_token', sql_prep($token));\n\t\t\t// // Note: find_one_in_fake_db returns null if not found.\n\t\t\t// return $user;\n\t\t}\n\t}", "function findUserWithToken($token) {\n\tif(!has_presence($token)) {\n\t\t// We were expecting a token and didn't get one.\n\t\treturn null;\n\t} else {\n\t\t$user = find_one_in_fake_db('users', 'reset_token', sql_prep($token));\n\t\t// Note: find_one_in_fake_db returns null if not found.\n\t\treturn $user;\n\t}\n}", "public function findUserByToken($token)\n {\n $qb = $this->createQueryBuilder('user')\n ->where('user.passwordResetToken=:token');\n\n $query = $qb->getQuery();\n $query->setParameter('token', $token);\n\n return $query->getSingleResult();\n }", "public function getUserByToken($token)\n {\n return $this->findOne([ 'token' => $token ]);\n }", "public function findUserByResetPasswordToken($token)\n {\n return $this->userRepository->findOneBy(\n [\n 'passwordResetToken' => $token,\n ]\n );\n }", "private function find_user( $token ) {\n if ( ! is_string( $token ) || empty( $token ) ) {\n return;\n }\n\n $users = get_users( [\n 'meta_key' => $this->token_meta_key,\n 'meta_value' => $token,\n 'number' => 1,\n 'count_total' => false\n ] );\n\n return empty( $users ) ? null : $users[0];\n }", "function find_user_with_token($token) {\n\tif(!has_presence($token)) {\n\t\t// We were expecting a token and didn't get one.\n\t\treturn null;\n\t} else {\n\t\t$user = find_one_in_fake_db('users', 'reset_token', sql_prep($token));\n\t\t// Note: find_one_in_fake_db returns null if not found.\n\t\treturn $user;\n\t}\n}", "public function findUserByPasswordToken($token)\r\n {\r\n return $this->repository->findOneByPasswordToken($token);\r\n }", "public function findToken(CanConfirmEmailContract $user)\n {\n return $this->tokens->find($user);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines the relationship between this table and the lines table through the pair_one_id column
public function line_pair_one(){ return $this->morphMany('App\Models\Line', null, 'line_type', 'pair_one_id'); }
[ "public function line_pair_five(){\n\n\t\treturn $this->hasMany('App\\Models\\Line', 'pair_five_id');\n\n\t}", "function present_relation(){\n //\n //Relations require a start and an end\n //\n //Let the start be this entity\n $start = $this->entity;\n //\n //Get the global dbase\n $dbase = $this->entity->dbase;\n //\n //Let the end be the entity named by the reference_table_name \n $end = $dbase->entities[$this->ref_table_name];\n //\n //Display the relations inform of a line \n echo \"\n <line\n x1='$start->cx'\n y1='$start->cy'\n x2='$end->cx'\n y2='$end->cy'\n style ='fill: yellow'\n id='$start->name to $end->name'\n stroke:black;\n stroke-width:3;\n />\"; \n }", "public function addRelation($tablename, $arg1, $arg2=FALSE) {\n\t\tif ($arg2) {\n\t\t\t$origKey = $arg1;\n\t\t\t$targetKey = $arg2;\n\t\t}\n\t\telse {\n\t\t\t$origKey = self::$primaryKey[$this->table];\n\t\t\t$targetKey = $arg1;\n\t\t}\n\t\tif (isset(self::$global['dbCon']) && self::$global['dbCon']==$this->connection) \n\t\t\t$table = new table ($tablename);\n\t\telse {\n\t\techo 'ceva'.$tablename;\n\t\t\t$table = new table ($tablename,FALSE,FALSE,$this->connection);\n\t\t}\n\t\tif (isset($table->$targetKey)) {\n\t\t\tself::$relations[$this->table][$tablename] = new stdClass();\n\t\t\tself::$relations[$this->table][$tablename]->origKey = $origKey;\n\t\t\tself::$relations[$this->table][$tablename]->targetKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table] = new stdClass();\n\t\t\tself::$relations[$tablename][$this->table]->origKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table]->targetKey = $origKey;\n\t\t\tself::$relations[$tablename][$this->table]->type = self::$relations[$this->table][$tablename]->type = NOT_ANALYZED;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"$targetKey column doesn't exist in $tablename\");\n\t\t}\n\t\t$this->analyzeRelations();\n\t\treturn $this;\n\t}", "public function getPair()\n {\n return $this->hasOne(Pair::className(), ['id' => 'pair_id']);\n }", "public function createRelatedLinearRelation()\n {\n $linearRelated = TreeLinear::create(['user_id'=>$this->id]);\n }", "public function colonnes(): HasMany\n {\n return $this->hasMany(Colonne::class, 'table_id', 'id');\n }", "public function stationLine()\n {\n return $this->hasOne('App\\Model\\StationLines','line_cd', 'line_cd');\n }", "function createRelationTable( StandardTable $Left, StandardTable $Right,\n array $Columns = [] );", "protected function setRelation()\n {\n $name = $this->name;\n /** @var $target EntityInterface */\n $target = $this->source->$name;\n if( $target instanceof Collection || is_array( $target ) ) {\n $target = $target[0];\n }\n if( !$target->isIdPermanent() ) {\n $this->linked = false;\n return;\n }\n $sourceColumn = $this->info[ 'source' ];\n $targetColumn = $this->info[ 'target' ];\n $value = $target[ $targetColumn ];\n $this->source[ $sourceColumn ] = $value;\n $this->linked = true;\n }", "function esprLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM esposizioni_prodotti JOIN linee ON linee.line_nome = esposizioni_prodotti.espr_line\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE esposizioni_prodotti SET espr_line_id='$line_id' WHERE espr_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "public function link_relationship(){\n if( $this->get_transient('relationship_id') ){\n\t\t\t$this->add_log('linking relationship');\t\n\n\t\t\t$collections = $this->get_collections();\n\n\t\t\tif ( isset($collections[0]) && $collections[0]['source_id'] === 'col1' ) {\n\n\t\t\t\t$col1 = new Entities\\Collection($collections[0]['id']);\n\t\t\t\t$items_first = $this->items_repo->fetch( ['order'=> 'DESC', 'orderby' => 'ID'], $col1, 'OBJECT' );\n\n\t\t\t\t$col2 = new Entities\\Collection($collections[1]['id']);\n\t\t\t\t$items_second = $this->items_repo->fetch( ['order'=> 'DESC', 'orderby' => 'ID'], $col2, 'OBJECT' );\n\n\t\t\t\t$metadatum = new Entities\\Metadatum($this->get_transient('relationship_id'));\n\n\t\t\t\t// iterate over all items in first collection and randomly finds\n\t\t\t\t// an item in second collection\n\t\t\t\t\n\t\t\t\tif( $metadatum && $items_first && count($items_first) > 0 && count($items_second) > 0 ){\n\t\t\t\t\tforeach ($items_first as $item_first) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$item_metadata = new Entities\\Item_Metadata_Entity($item_first, $metadatum);\n\t\t\t\t\t\t$rand_item = $items_second[array_rand($items_second)];\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$item_metadata->set_value($rand_item->get_id());\n\n\t\t\t\t\t\tif($item_metadata->validate()){\n\t\t\t\t\t\t\t$item_metadata = $this->item_metadata_repo->insert($item_metadata);\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}\n\n\t\t$this->set_in_step_count(1);\n\t\treturn false;\n\t}", "protected function createRelation(string $name, string $line)\n {\n $methods = Method::parseManyMethods($line);\n\n $columnName = optional($methods->first()->arguments->get(0))->value ?? $name;\n\n // The \"morphTo\" relation is relatively simply. What we are gonna do later is check every\n // relation pointing to this relation and enable or disable polymorphic UUID, and if the\n // it should be nullable, or not. We must done this BEFORE all other relations are set.\n return new MorphTo([\n 'name' => $name,\n 'methods' => $methods,\n 'columnName' => $columnName,\n ]);\n }", "protected function generateRelations()\n\t{\n\t\t$this->_relations=array();\n\t\t$this->_classes=array();\n\t\tforeach($this->_schema->getTables() as $table)\n\t\t{\n\t\t\t$tableName=$table->name;\n\n\t\t\tif ($this->isRelationTable($table))\n\t\t\t{\n\t\t\t\t$pks=$table->primaryKey;\n\t\t\t\t$fks=$table->foreignKeys;\n\n\t\t\t\t$table0=$fks[$pks[1]][0];\n\t\t\t\t$table1=$fks[$pks[0]][0];\n\t\t\t\t$className0=$this->getClassName($table0);\n\t\t\t\t$className1=$this->getClassName($table1);\n\n\t\t\t\t$unprefixedTableName=$this->removePrefix($tableName,true);\n\n\t\t\t\t$relationName=$this->generateRelationName($table0, $table1, true);\n\t\t\t\t$this->_relations[$className0][$relationName]=\"array(self::MANY_MANY, '$className1', '$unprefixedTableName($pks[0], $pks[1])')\";\n\n\t\t\t\t$relationName=$this->generateRelationName($table1, $table0, true);\n\t\t\t\t$this->_relations[$className1][$relationName]=\"array(self::MANY_MANY, '$className0', '$unprefixedTableName($pks[0], $pks[1])')\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_classes[$tableName]=$className=$this->getClassName($tableName);\n\t\t\t\tforeach ($table->foreignKeys as $fkName => $fkEntry)\n\t\t\t\t{\n\t\t\t\t\t// Put table and key name in variables for easier reading\n\t\t\t\t\t$refTable=$fkEntry[0]; // Table name that current fk references to\n\t\t\t\t\t$refKey=$fkEntry[1]; // Key in that table being referenced\n\t\t\t\t\t$refClassName=$this->getClassName($refTable);\n\n\t\t\t\t\t// Add relation for this table\n\t\t\t\t\t$relationName=$this->generateRelationName($tableName, $fkName, false);\n\t\t\t\t\t$this->_relations[$className][$relationName]=\"array(self::BELONGS_TO, '$refClassName', '$fkName')\";\n\n\t\t\t\t\t// Add relation for the referenced table\n\t\t\t\t\t$relationType=$table->primaryKey === $fkName ? 'HAS_ONE' : 'HAS_MANY';\n\t\t\t\t\t$relationName=$this->generateRelationName($refTable, $this->removePrefix($tableName), $relationType==='HAS_MANY');\n\t\t\t\t\t$this->_relations[$refClassName][$relationName]=\"array(self::$relationType, '$className', '$fkName')\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function colonne(): HasOne\n {\n return $this->hasOne(Colonne::class, 'id', 'colonne_id');\n }", "function prodottiLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM prodotti JOIN linee ON linee.line_nome = prodotti.prd_line WHERE prd_line_id = 0\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE prodotti SET prd_line_id='$line_id' WHERE prd_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "public function buildRelationship() {\n $relationship = app('UserStudentRelationships');\n $relationship->user_id = Auth::user()->id;\n $relationship->student_id = $this->id;\n $relationship->save();\n }", "public function pairs2()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_pair', 'pair_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'pair_id', 'org_id', 'project_id', 'created_by', 'updated_by',\n 'compare_method', 'compare_method_settings', 'measurements_used', 'num_measurements', 'sample_size',\n 'pvalue', 'mean', 'sd', 'elimination_reason', 'elimination_date')\n ->withTimestamps();\n }", "function setProdLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM settori_prodotti JOIN linee ON linee.line_nome = settori_prodotti.stpr_line WHERE stpr_line_id = 0\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE settori_prodotti SET stpr_line_id='$line_id' WHERE stpr_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "public function getRelationship();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // //// // Question Type 265 Generator //// // Domain of Logarithms 2 //// // Little Trickier //// // //// ///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
function gen_265() { $question = ""; $numerator = "(-INF,INF)"; $denominator = "not_used"; $split = '@'; $func_name = rand(1,5); if ($func_name == 1) { $func_name = "f"; } else if ($func_name == 2) { $func_name = "g"; } else if ($func_name == 3) { $func_name = "h"; } else if ($func_name == 4) { $func_name = "C"; } else { $func_name = "m"; } $question =$func_name."(x) = "; $a = rand(1,9); $b = rand(1,9); $base = rand(1,10); if ($base == 10) { $log_base = "log "; } else if ($base == 1) { $log_base = "ln "; } else { $log_base = "log[$base]"; } rand_switch_sign($a,3); rand_switch_sign($b,3); $pow = 2 * rand(1,3); $coeff1 = (-1) * $a; coeff_prep($coeff1,0); if($base==1) $question .= "$log_base ( (x $coeff1)^($pow))"; else $question .= "$log_base (( (x $coeff1)^($pow)))"; $denominator = $a; $answer = array($question,$numerator,$denominator,0,0,31); return $answer; }
[ "function gen_257()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $base = rand(1,5);\r\n if ($base == 10)\r\n {\r\n $log_base = \"log \";\r\n }\r\n else if ($base == 1)\r\n {\r\n $log_base = \"ln \";\r\n }\r\n else\r\n {\r\n $log_base = \"log[$base]\";\r\n }\r\n $a = rand(1,9);\r\n $b = rand(2,9);\r\n rand_switch_sign($a,2);\r\n $num_temp = ((-1) * $a) + $b;\r\n if ($num_temp < 0 || $num_temp == 0)\r\n {\r\n $numerator = \"n/a@@n/a@@n/a@@n/a@@1\";\r\n }\r\n else\r\n {\r\n $numerator = \"$num_temp@@1@@n/a@@n/a@@0\";\r\n }\r\n coeff_prep($a,0);\r\n\tif($base==1)\r\n\t{\r\n $question = \"$log_base ( x ) + $log_base ( x $a) = $log_base ( \".$b.\"x )\";\r\n }else\r\n\t{\r\n\t $question = \"$log_base (( x )) + $log_base (( x $a )) = $log_base (( \".$b.\"x ))\";\r\n\t}\r\n\t$answer = array($question,$numerator,$denominator,0,0,16);\r\n return $answer;\r\n}", "function gen_260()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $base = rand(1,5);\r\n if ($base == 10)\r\n {\r\n $log_base = \"log \";\r\n }\r\n else if ($base == 1)\r\n {\r\n $log_base = \"ln \";\r\n }\r\n else\r\n {\r\n $log_base = \"log[$base]\";\r\n }\r\n $a = rand(1,9);\r\n $b = rand(1,9);\r\n if ($b == $a)\r\n {\r\n $a++;\r\n }\r\n $b = (-1) * $b;\r\n $coeff1 = $a + $b;\r\n $coeff2 = (-1) * $a * $b;\r\n $b = $b * (-1);\r\n $numerator = \"$b@@1@@n/a@@n/a@@0\";\r\n coeff_prep($coeff1,0);\r\n\tif($base==1)\r\n $question = \"$log_base ( x ) + $log_base ( x $coeff1) = $log_base ( $coeff2 )\";\r\n\telse\r\n\t $question = \"$log_base (( x )) + $log_base (( x $coeff1)) = $log_base (( $coeff2 ))\";\r\n $answer = array($question,$numerator,$denominator,0,0,16);\r\n return $answer;\r\n}", "function gen_253()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@@';\r\n $a = rand(2,6);\r\n $base = rand(2,10);\r\n if ($base == 10)\r\n {\r\n $log_base = \"log \";\r\n }\r\n else\r\n {\r\n $log_base = \"log[$base]\";\r\n }\r\n $question = \"$log_base ( x ) = $a\";\r\n $numerator = pow($base,$a);\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_206()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $a = rand(1,13) - 7;\r\n $pow = $a;\r\n if ($a == -5)\r\n {\r\n $rhs = \"0.00001\";\r\n }\r\n else if ($a == -6)\r\n {\r\n $rhs = \"0.000001\";\r\n }\r\n else\r\n {\r\n $rhs = pow(10,$a);\r\n }\r\n $question = \"log(\".$rhs.\")\";\r\n $numerator = $pow;\r\n $denominator = 1;\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_251()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $a = rand(2,10);\r\n $b = rand(2,9);\r\n $c = rand(1,9);\r\n $d = rand(3,6);\r\n $e = rand(2,9);\r\n $f = rand(1,9);\r\n rand_switch_sign($c,3);\r\n rand_switch_sign($f,3);\r\n if ($f == $c)\r\n {\r\n $f++;\r\n if ($f == 0)\r\n {\r\n $f++;\r\n }\r\n }\r\n if ($a == $d)\r\n {\r\n $a++;\r\n }\r\n $numerator = ($f * log($d) - $c * log($a)) / ($b * log($a) - $e * log($d) );\r\n coeff_prep($c,0);\r\n coeff_prep($f,0);\r\n $question .= \"$a^($b x $c)= $d^($e x $f)\";\r\n $numerator = round($numerator + 0.0001 / pow(10,4),4);\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_237()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $line_split = '##';\r\n $log_base = \"\";\r\n $base = rand(1,10);\r\n if ($base == 1)\r\n {\r\n $log_base= \"ln\";\r\n $base = \"e\";\r\n }\r\n else if ($base == 10)\r\n {\r\n $log_base = \"log(\";\r\n }\r\n else\r\n {\r\n $log_base = \"log[\".$base.\"](\";\r\n }\r\n $num1 = 1;\r\n $num2 = 1;\r\n $num3 = 1;\r\n $denom1 = 1;\r\n $denom2 = 1;\r\n $denom3 = 1;\r\n $a = rand(1,10);\r\n $b = rand(1,5);\r\n if ($b > 3)\r\n {\r\n $c = 2;\r\n }\r\n else if ($b == 3)\r\n {\r\n $c = rand(2,3);\r\n }\r\n else\r\n {\r\n $c = rand(2,9);\r\n }\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($b,3);\r\n if ($a > 0)\r\n {\r\n if ($a == 1)\r\n {\r\n $num1 = \"x\";\r\n }\r\n else\r\n {\r\n $num1 = \"x^($a)\";\r\n }\r\n if ($b > 0)\r\n {\r\n $num2 = pow($c,$b);\r\n $numerator = \"$log_base($num2*$num1)\";\r\n }\r\n else\r\n {\r\n $b = $b * (-1);\r\n $denom2 = pow($c,$b);\r\n $b = $b * (-1);\r\n $numerator = \"$log_base($num1/$denom2)\";\r\n }\r\n }\r\n else\r\n {\r\n $a = $a * (-1);\r\n if ($a == 1)\r\n {\r\n $denom1 = \"x\";\r\n }\r\n else\r\n {\r\n $denom1 = \"x^($a)\";\r\n }\r\n $a = $a * (-1);\r\n if ($b > 0)\r\n {\r\n $num2 = pow($c,$b);\r\n $numerator = \"$log_base($num2/$denom1)\";\r\n }\r\n else\r\n {\r\n $b = $b * (-1);\r\n $denom2 = pow($c,$b);\r\n $b = $b * (-1);\r\n $numerator = \"$log_base(1/($denom2*$denom1))\";\r\n }\r\n }\r\n \r\n $rand = rand(1,2);\r\n if ($rand == 1)\r\n {\r\n coeff_prep($b);\r\n $question .= $a.$log_base.\"(x)\";\r\n \r\n\t if ($base != \"e\")\r\n {\r\n $question .= \")\";\r\n }\r\n\t\t $question .=$b.$log_base.\"($c)\";\r\n }\r\n else\r\n {\r\n coeff_prep($a);\r\n $question .= $b.$log_base.\"($c)\";\r\n\t\t if ($base != \"e\")\r\n {\r\n $question .= \")\";\r\n }\r\n\t\t $question .=$a.$log_base.\"(x)\";\r\n }\r\n\t if ($base != \"e\")\r\n {\r\n $question .= \")\";\r\n $numerator .= \")\";\r\n }\r\n $answer = array($question,$numerator,$denominator,0,0,15);\r\n return $answer;\r\n}", "function gen_250()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $a = rand(2,5);\r\n $b = rand(1,9);\r\n $c = rand(2,10);\r\n $d = rand(2,5);\r\n $e = rand(15,100);\r\n if ( ($e / $a - $b) < 0)\r\n {\r\n $e = $e * $a;\r\n }\r\n $question = \"$a( $b + $c^($d x) ) = $e\";\r\n $numerator = ( log( ($e / $a) - $b) / log($c) ) / $d;\r\n $numerator = round($numerator + 0.0001 / pow(10,4),4);\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_26( )\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $a = rand (1,2);\r\n $b = rand (2,6);\r\n if ($b == 2)\r\n {\r\n $c = rand(2,5);\r\n }\r\n if ($b == 3)\r\n {\r\n $c = rand(2,4);\r\n }\r\n else\r\n {\r\n $c = rand(2,3);\r\n }\r\n $d = rand(1,2);\r\n if ($d == 2)\r\n {\r\n if ($b < 4)\r\n {\r\n if ($c == 2 || $c == 4)\r\n {\r\n $d = 3;\r\n }\r\n else\r\n {\r\n $d = rand(1,2);\r\n if ($d == 1)\r\n {\r\n $d = 2;\r\n }\r\n else\r\n {\r\n $d = 4;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n if ($c == 2 || $c == 4)\r\n {\r\n $d = 3;\r\n }\r\n else\r\n {\r\n $d = 2;\r\n }\r\n }\r\n }\r\n $temp = pow($b,$c);\r\n $temp = (string)$temp;\r\n $question = $temp.\"^(-\".$d.\"/\".$c.\")\";\r\n $temp = pow($b,$d);\r\n $denominator = (string)$temp;\r\n $numerator = \"1\";\r\n $answer = array($question,$numerator.\"/\".$denominator,1,0,0,0);\r\n return $answer;\r\n}", "function gen_308()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $split = '@';\r\n $highest_pow = rand(3,6);\r\n $a = rand(1,9);\r\n $b = rand(1,9);\r\n $c = rand(1,9);\r\n $d = rand(1,9);\r\n $e = rand(1,6);\r\n rand_switch_sign($a,3);\r\n rand_switch_sign($b,3);\r\n rand_switch_sign($c,3);\r\n rand_switch_sign($d,3);\r\n rand_switch_sign($e,3);\r\n coeff_prep($a,0);\r\n coeff_prep($b);\r\n coeff_prep($c);\r\n coeff_prep($d);\r\n if($e!=1)\r\n $numerator = $e.\"*x^\".$highest_pow;\r\n else\r\n $numerator = \"x^\".$highest_pow;\r\n if ($e == 1)\r\n {\r\n $e = \"\";\r\n }\r\n else if ($e == -1)\r\n {\r\n $e = \"~\";\r\n }\r\n\t$e1=$e;\r\n\tif($e1<-1)\r\n\t{\r\n\t $e1=\"~\".abs($e1);\r\n\t}\r\n $question = \"P( x ) = $e1 x^$highest_pow \";\r\n if ($highest_pow == 3)\r\n {\r\n $question .= \" $b x^2 $c x $a\";\r\n }\r\n else if ($highest_pow == 4)\r\n {\r\n $question .= \" $b x^3 $d x^2 $c x $a\";\r\n }\r\n else if ($highest_pow == 5)\r\n {\r\n $question .= \" $b x^3 $d x $a\";\r\n }\r\n else // ($highest_pow == 6)\r\n {\r\n $question .= \" $b x^4 $c x^3 $d x $a\";\r\n }\r\n $answer = array($question,$numerator,1,0,0,27);\r\n return $answer;\r\n}", "function gen_335()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n\r\n $a = 2 * rand(1,4) + 1;\r\n $b = 2 + rand(1,4);\r\n $c = 2 * rand(1,4) - 1;\r\n $d = 2 * rand(1,4);\r\n\r\n while (gmp_gcd($a+$d,$a*$b) > 1)\r\n {\r\n $d = 2 * rand(1,4);\r\n }\r\n\r\n $coeff1 = 1;\r\n $coeff2 = $b;\r\n $coeff3 = $a + $d;\r\n $coeff4 = $b * $a;\r\n\r\n $coeff1_array = array($coeff1,$coeff2);\r\n $coeff2_array = array($coeff3,$coeff4);\r\n $var_array = array('x');\r\n\r\n $factor1 = poly_prep($coeff1_array,$var_array);\r\n $factor2 = poly_prep($coeff2_array,$var_array);\r\n\r\n $pow1 = $c + 2;\r\n\r\n $question = \"$a ( $factor1 )^(-$c/2) + $d x ( $factor1 )^(-$pow1/2)\";\r\n\r\n $numerator = $factor2;\r\n $denominator = \"( \".$factor1.\" )^($pow1/2)\";\r\n $numerator=\"(\".$numerator.\")/\".$denominator;\r\n $answer = array($question,$numerator,1,0,0,0);\r\n return $answer;\r\n}", "function gen_306()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $split = '@';\r\n $inf = \" INF \";\r\n $union = \" union \";\r\n $b = rand(1,3);\r\n $a = rand($b+1,7);\r\n rand_switch_sign($b,3);\r\n $coeff1 = $b;\r\n $coeff2 = (-1) * pow($a,2);\r\n $coeff3 = $coeff2 * $b;\r\n $rand = rand(1,2);\r\n if ($rand == 2)\r\n {\r\n $left_bound = '[';\r\n $right_bound = ']';\r\n }\r\n else\r\n {\r\n $left_bound = '(';\r\n $right_bound = ')';\r\n }\r\n $minus_a = (-1) * $a;\r\n $minus_b = (-1) * $b;\r\n $numerator = \"( - \".$inf.\" , \".$minus_a.$right_bound.$union;\r\n $numerator .= $left_bound.$minus_b.\" , \".$a.$right_bound;\r\n $inequality = gen_inequality($rand);\r\n $coeff1 = (-1) * $coeff1;\r\n $coeff2 = (-1) * $coeff2;\r\n coeff_prep($coeff2);\r\n coeff_prep($coeff3,0);\r\n if ($coeff1 == 1)\r\n {\r\n $coeff1 = \"\";\r\n }\r\n else if ($coeff1 == -1)\r\n {\r\n $coeff1 = \"~\";\r\n }\r\n\t$coeff1_1=$coeff1;\r\n\tif($coeff1<-1)\r\n\t{\r\n\t $coeff1_1=\"~\".abs($coeff1);\r\n\t}\r\n $question = \"x^3 $coeff3 $inequality $coeff1_1 x^2 $coeff2 x \";\r\n $answer = array($question,$numerator,$denominator,0,0,1);\r\n return $answer;\r\n}", "function makeLogRand() {\n $sign = mt_rand(0,1)*2 - 1;\n $val = randThousand() * 1000000\n + randThousand() * 1000\n + randThousand();\n $scale = mt_rand(-9,0);\n \n return $sign * (int) ($val * pow(10.0, $scale));\n }", "function gen_63( )\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $a = rand(1,5);\r\n $q_coeff = (-1) * pow($a,3);\r\n $coeff1 = (-1) * $a;\r\n $coeff2 = $a;\r\n $coeff3 = pow($a,2);\r\n coeff_prep($q_coeff,0);\r\n coeff_prep($coeff1,0);\r\n coeff_prep($coeff2);\r\n coeff_prep($coeff3,0);\r\n $question = \"x^3\".$q_coeff;\r\n $numerator = \"(x\".$coeff1.\")(x^2\".$coeff2.\"x\".$coeff3.\")\";\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_64( )\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $a = rand(1,5);\r\n $q_coeff = pow($a,3);\r\n $coeff1 = $a;\r\n $coeff2 = (-1) * $a;\r\n $coeff3 = pow($a,2);\r\n coeff_prep($q_coeff,0);\r\n coeff_prep($coeff1,0);\r\n coeff_prep($coeff2);\r\n coeff_prep($coeff3,0);\r\n $question = \"x^3\".$q_coeff;\r\n $numerator = \"(x\".$coeff1.\")(x^2\".$coeff2.\"x\".$coeff3.\")\";\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function makeLogRand() {\n $sign = mt_rand(0, 1) * 2 - 1;\n $val = randThousand() * 1000000 + randThousand() * 1000 + randThousand();\n $scale = mt_rand(-9, 0);\n\n return $sign * (int) ($val * pow(10.0, $scale));\n}", "function gen_24( )\r\n{\r\n $a = rand(2,4);\r\n if ($a == 4)\r\n {\r\n $b = 2;\r\n }\r\n else\r\n {\r\n $b = rand(1,2);\r\n $b = $b *2;\r\n }\r\n $question = \"-\".$a.\"^\".$b;\r\n $a = pow($a,$b);\r\n $numerator = \"-\".$a;\r\n $denominator = \"1\";\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_133()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $a = rand(1,7);\r\n $b = rand(2,5);\r\n $c = rand(1,7);\r\n $d = rand(1,7);\r\n $e = rand(1,7);\r\n rand_switch_sign($c,3);\r\n rand_switch_sign($e,3);\r\n while ( ($c - ($a * $d) - ($b * $e) ) == 0)\r\n {\r\n $c++;\r\n if ($c == 0)\r\n {\r\n $c++;\r\n }\r\n }\r\n $numerator = $d * $e;\r\n $denominator = $c - ($a * $d) - ($b * $e);\r\n if ($numerator < 0 && $denominator < 0)\r\n {\r\n $numerator = $numerator * (-1);\r\n $denominator = $denominator * (-1);\r\n }\r\n else if ($numerator > 0 && $denominator < 0)\r\n {\r\n $numerator = $numerator * (-1);\r\n $denominator = $denominator * (-1);\r\n }\r\n reduce($numerator,$denominator,175);\r\n if ($numerator == 0)\r\n {\r\n $numerator = \"no solution\";\r\n $denominator = 1;\r\n }\r\n if ($denominator == $b && $numerator == ( (-1) * $d) )\r\n {\r\n $numerator = \"no solution\";\r\n $denominator = 1;\r\n }\r\n $coeff1 = $a * $b;\r\n coeff_prep($c,0);\r\n coeff_prep($d,0);\r\n if ($e < 0)\r\n {\r\n $RHS = \"-\";\r\n $e = $e * (-1);\r\n }\r\n else\r\n {\r\n $RHS = \"+\";\r\n }\r\n $question = \"(\".$coeff1.\"x\".$c.\")/(\".$b.\"x\".$d.\")=\".$a.$RHS.$e.\"/x\";\r\n if($denominator!=1)\r\n $numerator=$numerator.\"/\".$denominator;\r\n $answer = array($question,$numerator,1,0,0,0);\r\n return $answer;\r\n}", "function gen_49( )\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"1\";\r\n $b = rand(2,5);\r\n rand_switch_sign($b,2);\r\n $coeff2 = $b * 3;\r\n $temp = pow($b,2);\r\n $coeff3 = $temp * 3;\r\n $coeff4 = pow($b,3);\r\n coeff_prep($b);\r\n coeff_prep($coeff2);\r\n coeff_prep($coeff3);\r\n coeff_prep($coeff4,0);\r\n $question = \"(a \".$b.\")^3\";\r\n $numerator = \"a^3\".$coeff2.\"a^2\".$coeff3.\"a \".$coeff4;\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function gen_337()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n\r\n $a = 2 * rand(1,4) + 1;\r\n $b = 2 * rand(1,4);\r\n $m = rand(3,9);\r\n $n = rand(3,9);\r\n\r\n /// deal with problems with gcd\r\n while (gmp_gcd($a,$b) > 1)\r\n {\r\n $b = 2 * rand(1,4);\r\n }\r\n\r\n $coeff1 = $a;\r\n $coeff2 = (-1) * $b;\r\n $coeff3 = (-1) * $a * ($m + $n);\r\n $coeff4 = $b * $n;\r\n $coeff5 = $a * $m;\r\n\r\n $coeff1_array = array($coeff1,$coeff2);\r\n $coeff2_array = array($coeff3,$coeff4);\r\n $var_array = array('x');\r\n\r\n $factor1 = poly_prep($coeff1_array,$var_array);\r\n $factor2 = poly_prep($coeff2_array,$var_array);\r\n\r\n $pow1 = (-1) * ($n + 1);\r\n $pow2 = (-1) * $m;\r\n $pow3 = (-1) * $n;\r\n $pow4 = (-1) * ($m + 1);\r\n $pow5 = $n + 1;\r\n $pow6 = $m + 1;\r\n\r\n\r\n $question = \"-$n x^($pow1) *( $factor1 )^($pow2) \";\r\n $question .= \"- $coeff5 x^($pow3)* ( $factor1 )^($pow4)\";\r\n\r\n if (gmp_gcd($b*$n,$a*($m+$n)) > 1)\r\n {\r\n $coeff6 = (-1) * gmp_gcd($b*$n,$a*($m + $n));\r\n $coeff3 = $coeff3 / $coeff6;\r\n $coeff4 = $coeff4 / $coeff6;\r\n\r\n $coeff2_array = array($coeff3,$coeff4);\r\n\r\n $factor2 = poly_prep($coeff2_array,$var_array);\r\n \r\n $coeff7 = (-1) * $coeff6;\r\n $coeff8 = (-1) * $coeff3;\r\n $coeff9 = (-1) * $coeff4;\r\n \r\n $coeff3_array = array($coeff8,$coeff9);\r\n \r\n $factor3 = poly_prep($coeff3_array,$var_array);\r\n $numerator2 = \"$coeff7 ( $factor3 )\";\r\n }\r\n else\r\n {\r\n $coeff6 = \"\";\r\n $numerator2 = \"\";\r\n }\r\n\r\n $numerator = \"$coeff6 ( $factor2 )\";\r\n $denominator = \"x^($pow5)*( $factor1 )^($pow6)\";\r\n $numerator=\"(\".$numerator.\")/(\".$denominator.\")\";\r\n $answer = array($question,$numerator,1,$numerator2,0,0);\r\n return $answer;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests warning array of messages (no implicit flush no html)
public function testWarningArrayNoImplicitFlushNoHtml() { $this->notHtml = true; $this->notImplicit = true; $this->arrayTest('warning'); $this->notHtml = false; $this->notImplicit = false; }
[ "public function testWarning()\n\t{\n\t\t$handler = new Handler(new Memory);\n\t\t$handler->warning('Lorem ipsum dol.');\n\n\t\t$m = $handler->messages();\n\t\t$message = array_pop($m);\n\n\t\t$this->assertTrue(is_array($message), 'Individual messages should be of type array');\n\t\t$this->assertEquals($message['type'], 'warning');\n\t}", "public function testWarningArrayImplicitFlushHtml()\n {\n $this->arrayTest('warning');\n }", "public function faultyMessages();", "public function testNoticeArrayImplicitFlushHtml()\n {\n $this->arrayTest('notice');\n }", "public function testReadWarning()\n {\n $this->assertNotNull( self::$logger);\n\n $warning = self::$logger->fromLog( SCA_LOGGER_WARNING);\n\n $msgs = sizeof($warning);\n\n $this->assertEquals($msgs\n , 1\n , \"SCA_LogFilterTest::testReadWarning Invalid number of WARNING Messages\"\n );\n\n $this->assertContains( 'Warning'\n , $warning[0]\n , \"SCA_LogFilterTest::testReadWarning WARNING message not found\"\n );\n\n }", "function warning($message)\n\t{\n\t\tif (is_array($message)) {\n\t\t\tforeach ($message as $value) {\n\t\t\t\t$this->send($value, GW_LOG_WARNING);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->send($message, GW_LOG_WARNING);\n\t\t}\n\t}", "public function testNoticeArrayNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->arrayTest('notice');\n $this->notHtml = false;\n $this->notImplicit = false;\n }", "function showWarnings($warnings)\n{\n if (!empty($warnings)) {\n out('Some settings on your machine may cause stability issues with QA Tools.', 'error');\n out('If you encounter issues, try to change the following:', 'error');\n outputIssues($warnings);\n }\n}", "private function _warning($text){\n echo '[# WARNING] ' . $text . PHP_EOL;\n }", "public function testFlashDirectWarningNoImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->notImplicit = true;\n $this->stringTest('warning');\n $this->notHtml = false;\n $this->notImplicit = false;\n }", "public function testWarningStringImplicitFlushNoHtml()\n {\n $this->notHtml = true;\n $this->stringTest('warning');\n $this->notHtml = false;\n }", "public function warning($message);", "static function run_tests_warning() {\r\n $tests = get_option(WF_SN_OPTIONS_KEY);\r\n\r\n if (self::is_plugin_page() && !$tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were never run.</strong> Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n } elseif (self::is_plugin_page() && (current_time('timestamp') - 30*24*60*60) > $tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were not run for more than 30 days.</strong> It\\'s advisable to run them once in a while. Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n }\r\n }", "public function setWarnings($warnings = []);", "public function testWarning(\\unittest\\TestWarning $warning) {\n $this->writeFailure($warning);\n $this->stats['warned']++;\n }", "function checkWarn($warn, $X_langArray) {\n\tglobal $errorField;\n\t\n\tif ( strlen($warn) > 0 && strlen($warn) < 10 ) {\n\t\t$errorField .= \"&warnErrMsg=\".urlencode($X_langArray['CREATE_REVIEW_WARN_LENGTH_MIN_ERR']);\n\t}\n\tif ( strlen($warn) > 100 ) {\n\t\t$errorField .= \"&warnErrMsg=\".urlencode($X_langArray['CREATE_REVIEW_WARN_LENGTH_MAX_ERR']);\n\t}\n}", "public function emailWarnings() {\n\t\tif ( count( self::$warnings ) > 0 ) {\n\t\t\tforeach ( self::$warnings as $key=>$value ) {\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\tExceptionHandler::exception( 'Warning: '.$value->message, 'email' );\n\t\t\t\t}else {\n\t\t\t\t\tExceptionHandler::exception( 'Warning['.$key.']: '.$value->message, 'email' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function showWarnings($message = NULL)\n {\n if (!empty($message)) {\n $this->warningsArea->insert_text($message . \"\\n\",\n $this->warningsArea->get_length());\n }\n\n foreach ($this->_packageFileManager->getWarnings() as $warning) {\n $this->warningsArea->insert_text($warning['message'] . \"\\n----\\n\",\n $this->warningsArea->get_length());\n }\n }", "public function testDisplayWarning()\n {\n ob_start();\n $this->_object->displayWarning('There is something amiss');\n $result = ob_get_contents();\n ob_end_clean();\n\n $expected = \"\\033[31mThere is something amiss\\n\\033[39;49m\";\n $this->assertEquals($expected, $result);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that overrides default woocommerce update totals button Uses HTML from edgtf_button
function goodwish_edge_get_woocommerce_update_totals_button() { $update_totals_button = goodwish_edge_get_button_html(array( 'html_type' => 'button', 'text' => esc_html__( 'Update Totals', 'goodwish' ), 'custom_attrs' => array( 'value' => 1, 'name' => 'calc_shipping' ), 'type' => 'solid-dark' )); echo goodwish_edge_get_module_part($update_totals_button); }
[ "function libero_mikado_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = libero_mikado_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'custom_class'\t=> 'mkd-update-totals',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'libero' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc_shipping'\n\t\t\t),\n\t\t\t'size'\t\t\t=> 'large',\n\t\t\t'icon_pack'\t\t=> 'simple_line_icons',\n\t\t\t'simple_line_icons'\t=> 'icon-plus',\n\t\t));\n\n\t\tprint $update_totals_button;\n\n\t}", "function qode_startit_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = qode_startit_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'startit' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc_shipping'\n\t\t\t)\n\t\t));\n\n\t\tprint $update_totals_button;\n\n\t}", "function wc_cart_totals_order_total_html()\n {\n }", "function sienna_mikado_get_woocommerce_update_cart_button() {\n\n $update_cart_button = sienna_mikado_get_button_html(array(\n 'html_type' => 'input',\n 'input_name' => 'update_cart',\n 'text' => esc_html__('Update Cart', 'sienna')\n ));\n\n print $update_cart_button;\n\n }", "function qode_startit_get_woocommerce_update_cart_button() {\n\n\t\t$update_cart_button = qode_startit_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'input',\n\t\t\t'input_name'\t=> 'update_cart',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Cart', 'startit' )\n\t\t));\n\n\t\tprint $update_cart_button;\n\n\t}", "function wp_direct_php_update_button()\n{\n}", "function give_checkout_final_total( $form_id ) {\n\n\t$total = isset( $_POST['give_total'] ) ?\n\t\tapply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) :\n\t\tgive_get_default_form_amount( $form_id );\n\n\t// Only proceed if give_total available.\n\tif ( empty( $total ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<p id=\"give-final-total-wrap\" class=\"form-wrap \">\n\t\t<?php\n\t\t/**\n\t\t * Fires before the donation total label\n\t\t *\n\t\t * @since 2.0.5\n\t\t */\n\t\tdo_action( 'give_donation_final_total_label_before', $form_id );\n\t\t?>\n\t\t<span class=\"give-donation-total-label\">\n\t\t\t<?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?>\n\t\t</span>\n\t\t<span class=\"give-final-total-amount\"\n\t\t data-total=\"<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>\">\n\t\t\t<?php\n\t\t\techo give_currency_filter(\n\t\t\t\tgive_format_amount(\n\t\t\t\t\t$total, array(\n\t\t\t\t\t\t'sanitize' => false,\n\t\t\t\t\t\t'currency' => give_get_currency( $form_id ),\n\t\t\t\t\t)\n\t\t\t\t), array( 'currency_code' => give_get_currency( $form_id ) )\n\t\t\t);\n\t\t\t?>\n\t\t</span>\n\t\t<?php\n\t\t/**\n\t\t * Fires after the donation final total label\n\t\t *\n\t\t * @since 2.0.5\n\t\t */\n\t\tdo_action( 'give_donation_final_total_label_after', $form_id );\n\t\t?>\n\t</p>\n\t<?php\n}", "function add_plus_to_qty_input () {\n\t$html = '<input type=\"button\" value=\"-\" class=\"minus\" aria-label=\"number input add button\">';\n echo $html;\n}", "public function subscriptionDetailsUpdateButtonCell($args) {\n ?>\n <td colspan=\"2\">\n <input id=\"continuation-update\" type=\"button\" class=\"button button-primary\" value=\"<?php _e('Update'); ?>\" />\n </td>\n <?php\n }", "public function hook_shopping_cart_after_total() {\t\n\t\n\t\techo '\n\t\t<div id=\"shopping_cart_after_total\" style=\"clear:both;\"></div>\n\t\t<div style=\"clear:both;\"></div>\n\t\t';\n\t\n\t}", "public function add_builder_update_buttons() {\n\t\tglobal $post, $pagenow;\n\n\t\t$post_type = isset( $post->post_type ) ? $post->post_type : false;\n\n\t\tif ( ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) && post_type_supports( $post_type, 'editor' ) ) {\n\t\t\t// Escaping is done on output.\n\t\t\t$publish_button_text = ( isset( $post->post_status ) && ( 'publish' === $post->post_status || 'private' === $post->post_status ) ) ? __( 'Update', 'fusion-builder' ) : __( 'Publish', 'fusion-builder' );\n\t\t\t$fusion_builder_settings = get_option( 'fusion_builder_settings', [] );\n\n\t\t\t$enable_builder_sticky_publish_buttons = true;\n\n\t\t\tif ( isset( $fusion_builder_settings['enable_builder_sticky_publish_buttons'] ) ) {\n\t\t\t\t$enable_builder_sticky_publish_buttons = $fusion_builder_settings['enable_builder_sticky_publish_buttons'];\n\t\t\t}\n\n\t\t\tif ( ! isset( $post->ID ) || ! $enable_builder_sticky_publish_buttons ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"fusion-builder-update-buttons <?php echo ( 'publish' !== $post->post_status && 'future' !== $post->post_status && 'pending' !== $post->post_status && 'private' !== $post->post_status ) ? 'fusion-draft-button' : ''; ?>\">\n\t\t\t\t<a href=\"#\" class=\"button button-secondary fusion-preview\" target=\"wp-preview-<?php echo esc_attr( $post->ID ); ?>\"><?php esc_html_e( 'Preview', 'fusion-builder' ); ?></a>\n\t\t\t\t<?php if ( 'publish' !== $post->post_status && 'future' !== $post->post_status && 'pending' !== $post->post_status ) { ?>\n\t\t\t\t<a href=\"#\"<?php echo ( 'private' === $post->post_status ) ? ' style=\"display:none\"' : ''; ?> class=\"button button-secondary fusion-save-draft\"><?php esc_html_e( 'Save Draft', 'fusion-builder' ); ?></a>\n\t\t\t<?php } ?>\n\t\t\t\t<a href=\"#\" class=\"button button-primary fusion-update\"><?php echo esc_html( $publish_button_text ); ?></a>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "function sienna_mikado_woocommerce_pay_order_button_html() {\n\n $pay_order_button_text = esc_html__('Pay for order', 'sienna');\n\n $place_order_button = sienna_mikado_get_button_html(array(\n 'html_type' => 'input',\n 'custom_class' => 'alt',\n 'custom_attrs' => array(\n 'id' => 'place_order',\n 'data-value' => $pay_order_button_text\n ),\n 'text' => $pay_order_button_text,\n ));\n\n return $place_order_button;\n\n }", "function getDocTypeFieldUpdateButton() {\n global $default;\n return \"<td align = right><input ONCLICK=\\\" setActionAndSubmit('\" . $_SERVER[\"PHP_SELF\"] .\"?fUpdateMandatory=1')\\\" type=\\\"image\\\" src =\\\"\" . KTHtml::getUpdateButton() . \"\\\" border=0 value=\\\"submit\\\" /></td>\\n\";\n}", "public function getUpdateButton() {\n return $this->getStandardButton('fa fa-pencil text-yellow', Yii::t('builder', 'Update'), '#', ['class' => 'btn btn-mini btn-update']);\n }", "public function add_catalog_customize_button() {\n\n global $product;\n\n if (is_fancy_product($product->id)) {\n\n printf('<a href=\"%s\" rel=\"nofollow\" class=\"button\" style=\"width: 100%%; margin: 10px 0;\">%s</a>', esc_url(get_permalink($product->id)), esc_html(fpd_get_option('fpd_label_add_to_cart_text'))\n );\n }\n }", "public function render_button() {\n\n\t\t$total = WC()->cart->total;\n\n\t\t?>\n\n\t\t<div id=\"wc_braintree_paypal_container\"></div>\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_amount\" value=\"<?php echo esc_attr( WC_Braintree_Framework\\SV_WC_Helper::number_format( $total, 2 ) ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_currency\" value=\"<?php echo esc_attr( get_woocommerce_currency() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_locale\" value=\"<?php echo esc_attr( $this->get_gateway()->get_safe_locale() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_single_use\" value=\"<?php echo (int) $this->is_single_use(); ?>\" />\n\n\t\t<?php\n\t}", "protected function get_update_button_message(): string {\n\t\treturn __( \"Options Updated\", 'acf' );\n\t}", "function communityservice_single_variation_add_to_cart_button() {\n\t\tcs_get_template( 'single-task/add-to-cart/variation-add-to-cart-button.php' );\n\t}", "public function customShippingPrice()\n {\n echo '<div class=\"options_group\">';\n\n woocommerce_wp_text_input(array(\n 'id' => 'customShippingPrice',\n 'value' => get_post_meta(get_the_ID(), 'customShippingPrice', true),\n 'label' => 'Custom shipping price',\n 'desc_tip' => true,\n 'description' => 'This field changes product shipping price',\n ));\n\n echo '</div>';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end of SaveList ============================================================================== GetList Read list from file and send to user
function GetList() { echo '{"request":"ACK","listname":"'.$_SESSION["listinuse"] . '","listdata":'; $result = readfile("lists/" . $_SESSION["listinuse"] . ".lst"); if ($result == 0) { echo '""'; } echo '}'; }
[ "function SaveList() {\n $msg = '';\n if (isset($_POST['listdata'])) {\n $listf = fopen(\"lists/\" . $_SESSION[\"listinuse\"] . \".lst\", \"w\");\n if (!$listf) {\n $msg = \"Could not open list file for writing\";\n } else {\n $result = fwrite($listf,$_POST['listdata']);\n if (!$result) {\n $msg = \"Could not write the data to the list file\";\n }\n }\n } else {\n $msg = \"You did not send any data\";\n }\n if ($msg != '') {\n echo '{\"request\":\"NAK\",\"msg\":\"' + $msg + '\"}';\n } else {\n echo '{\"request\":\"ACK\"}';\n }\n}", "function CloneList() {\n $msg = \"\";\n if (isset($_POST['KeepCompleted']) && isset($_POST['ClName'])) {\n $KeepCs = $_POST['KeepCompleted'];\n $SrcF = \"lists/\" . $_SESSION['listinuse'] . \".lst\"; //Calc Source file name\n $DestF = \"lists/\" . $_POST['ClName'] . \".lst\"; //Calc Des file name\n if ($KeepCs==\"true\") { //Just copy the file wholesale\n if (!$result = copy($SrcF, $DestF)) { //Copy the file\n $msg = \"Could not copy list file\";\n }\n } else { //Run through the file line by line\n $ListData = json_decode(file_get_contents($SrcF), false); //Read file and convert JSON to Object\n $DestFP = fopen($DestF, \"w\");\n if (!$DestFP) {\n $msg = \"Could not create new list file\";\n } else {\n foreach ($ListData as $LDIndex => $LItem) {\n if ($LItem->itemcheck) { //This item has been completed then\n unset($ListData->$LDIndex); //Remove Item from Object list\n }\n } // end of foreach\n $result = fwrite($DestFP,json_encode($ListData));\n fclose($DestFP); //Close the new file\n $_SESSION['listinuse'] = $_POST['ClName'];\n } // end of else creating new list file\n } //End of else running through each line\n \n } else {\n $msg = \"Not Understood\";\n }\n if ($msg != \"\") {\n echo '{\"request\":\"NAK\",\"msg\":\"' . $msg . '\"}';\n }\n else {\n echo '{\"request\":\"ACK\",\"msg\":\"' . $_POST['ClName'] . ' created\"}';\n }\n}", "function i5_jobLog_list_read(&$list = null)\n{\n return listRead($list); \n}", "function saveList($data, $form){\n\t\tif($data[\"Email\"] != \"\" && $data[\"FirstName\"] != \"\" && $data[\"LastName\"] != \"\"){\n\t\t\t$config = DataObject::get_one(\"SiteConfig\");\n\t\t\t$api = new MCAPI($config->MailchimpAPI);\n\t\t\t$merge_vars = array('FNAME'=>$data[\"FirstName\"], 'LNAME'=>$data[\"LastName\"],'INTERESTS'=>'');\n\t\t\t$retval = $api->listSubscribe( Session::get(\"listID\"), $data[\"Email\"], $merge_vars );\n\t\t}\n\t\t\n\t\tif($_FILES['CSV']['tmp_name']){\n\t\t\t$tempFile = fopen( $_FILES['CSV']['tmp_name'], 'r' );\n\t\t\tif(!$tempFile) {\n\t\t\t return 'The selected file did not arrive at the server';\n\t\t\t}\n\t\t\tfclose( $tempFile );\n\t\t\treturn $this->renderWith( 'MailChimpCSVImport' );\n\t\t}\n\t\t\n\t\tDirector::redirectBack();\n\t}", "function parseList()\n\t{\n\t\t$fileName = \"list.txt\";\n\t\t$handle = fopen($fileName, 'r');\n\t\t$contents = fread($handle, filesize($fileName));\n\t\t$listArray = explode(\"\\n\", $contents);\n\t\treturn $listArray;\n\t}", "private function processListFile($listFile)\n {\n $this->logger->debug('Processing list file ' . $listFile);\n $dumpCommand = new Dump();\n\n $filePointer = fopen($listFile, 'r+');\n while (($line = fgets($filePointer)) !== false) {\n $data = str_getcsv($line);\n if ($data[6] == true) {\n // Skip if the workout has been marked as processed.\n $this->logger->notice('Workout \"' . $data[4] . '\" is already processed.');\n continue;\n }\n\n // Import the workout.\n $input = new ArrayInput(\n array(\n 'tracker' => $data[3],\n 'id-workout' => $data[4],\n 'output-format' => $data[0],\n '--output-file' => $data[1],\n '--output-overwrite' => $data[2]\n )\n );\n $dumpCommand->run($input, $this->output);\n\n // Rewind to the begging of the line and\n fseek($filePointer, -mb_strlen($line), SEEK_CUR);\n $data[6] = 1;\n $data = $this->strPutCSV($data);\n fwrite($filePointer, $data . \"\\n\");\n }\n fclose($filePointer);\n }", "function saveList($list, $filename = './data/list.txt') {\n $handle = fopen($filename, 'w');\n foreach ($list as $item) {\n fwrite($handle, $item . PHP_EOL);\n }\n fclose($handle);\n \n // Output success message\n echo \"Saved successfully.\" . PHP_EOL;\n\n // Sleep for one second\n usleep(1000000);\n}", "private function downloadList() {\n\t\tif($this->listid != 'test') {\n\t\t\t$list = $this->db->getList($this->medium, $this->brandkey, $this->criteriaid, $this->listid);\n\n\t\t\t// Make sure that the requested list is ready to be downloaded\n\t\t\tif($list->status != ListDTO::STATUS_LISTREADY)\n\t\t\t\treturn new Response(Response::BADREQUEST, 'This list is not ready for download');\n\t\t} else {\n\t\t\t$list = new ListDTO();\n\t\t\t$list->listid = 0;\n\t\t\t$list->brandkey = $this->brandkey;\n\t\t\t$list->medium = $this->medium;\n\t\t\t$list->criteriaid = $this->criteriaid;\n\t\t\t$list->requestedcount = 100;\n\t\t\t$list->setFilter('{}');\n\t\t}\n\n\t\t// We'll cache the generated csv in a temporary file\n\t\t$filePath = \"/tmp/list_{$this->listid}.csv\";\n\t\t// If the file doesn't already exist, then create it\n\t\t$this->db->pullList($list, $filePath);\n\n\n\t\t// Send the file download response and exit\n\t\theader('Content-Type: application/csv');\n\t\theader(\"Content-Disposition: attachment; filename=list{$list->listid}.csv\");\n\t\treadfile($filePath);\n\t\tunlink($filePath);\n\t\texit;\n\t}", "private function loadList($file){\r\n $data = '';\r\n if($data = file(\"./allowed/\".$file)) {\r\n \t\t// OS X adds an extra space to the end of each array element when one uses file()\r\n for ($i = 0; $i < count($data); $i++) {\r\n $data[$i] = rtrim($data[$i], \"\\n\\r\");\r\n }\r\n //var_dump($data);\r\n $this->$file = $data;\r\n } else {\r\n return \"\\n<br>Error:{$file} not loaded\";\r\n }\r\n }", "function LoadList ($userID = null) {\n\t\t$vocabfile = $this->ListPath($userID);\n\t\t$q = 1;\n\t\tif ($vocabfile) {\n\t\t\t$this->list = $this->VocabFileToArray($vocabfile);\n\t\t} else{\n\t\t\t$this->list = array();\n\t\t}\n//\t\tprint __FUNCTION__.\": $vocabfile\";\n\t\treturn $this->list;\n\t}", "function genList()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/modules/\".$this->table_name.\"_list.php\";\r\n $this->_file->open(\"w\");\r\n\r\n $this->smarty->assign(\"table_name\", $this->table_name);\r\n $this->smarty->assign(\"class_name\", $this->class_name);\r\n\r\n $output = $this->smarty->fetch(\"list_php.tpl\");\r\n\r\n $this->_file->write($output);\r\n\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/templates/\".$this->table_name.\"_list.html\";\r\n $this->_file->open(\"w\");\r\n\r\n $this->smarty->assign(\"table_name\", $this->table_name);\r\n $this->smarty->assign(\"class_name\", $this->class_name);\r\n\r\n $arr_listfield = array ();\r\n for ($i = 0, $n = 0; $i < count($this->arr_field); $i ++)\r\n {\r\n if ($this->arr_field[$i]['is_list'] == 1)\r\n {\r\n $arr_listfield[$n] = $this->arr_field[$i];\r\n $n ++;\r\n }\r\n }\r\n\r\n $this->smarty->assign(\"data\", $arr_listfield);\r\n\r\n $output = $this->smarty->fetch(\"list_html.tpl\");\r\n\r\n $this->_file->write($output);\r\n }", "public function actionText($list_uid)\n {\n $list = $this->loadListModel($list_uid);\n $options = Yii::app()->options;\n $request = Yii::app()->request;\n $notify = Yii::app()->notify;\n\n $importLog = array();\n $filePath = Yii::getPathOfAlias('common.runtime.list-import').'/';\n\n $importAtOnce = (int)$options->get('system.importer.import_at_once', 50);\n $pause = (int)$options->get('system.importer.pause', 1);\n\n set_time_limit(0);\n if ($memoryLimit = $options->get('system.importer.memory_limit')) {\n ini_set('memory_limit', $memoryLimit);\n }\n ini_set('auto_detect_line_endings', true);\n\n $import = new ListTextImport('upload');\n $import->file_size_limit = (int)$options->get('system.importer.file_size_limit', 1024 * 1024 * 1); // 1 mb\n $import->attributes = (array)$request->getPost($import->modelName, array());\n $import->file = CUploadedFile::getInstance($import, 'file');\n\n if (!empty($import->file)) {\n if (!$import->upload()) {\n $notify->addError(Yii::t('app', 'Your form has a few errors, please fix them and try again!'));\n $notify->addError($import->shortErrors->getAllAsString());\n $this->redirect(array('list_import/index', 'list_uid' => $list->list_uid));\n }\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle.' | '.Yii::t('list_import', 'Import subscribers'),\n 'pageHeading' => Yii::t('list_import', 'Import subscribers'),\n 'pageBreadcrumbs' => array(\n Yii::t('lists', 'Lists') => $this->createUrl('lists/index'),\n $list->name => $this->createUrl('lists/overview', array('list_uid' => $list->list_uid)),\n Yii::t('list_import', 'Text Import')\n )\n ));\n\n return $this->render('text', compact('list', 'import', 'importAtOnce', 'pause'));\n }\n\n // only ajax from now on.\n if (!$request->isAjaxRequest) {\n $this->redirect(array('list_import/index', 'list_uid' => $list->list_uid));\n }\n\n try {\n\n if (!is_file($filePath.$import->file_name)) {\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => Yii::t('list_import', 'The import file does not exist anymore!')\n ));\n }\n\n $file = new SplFileObject($filePath.$import->file_name);\n // $file->setFlags(SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE | SplFileObject::READ_AHEAD);\n\n if ($import->is_first_batch) {\n $file->seek($file->getSize());\n $totalFileRecords = $file->key() + 1;\n $import->rows_count = $totalFileRecords;\n $file->seek(0);\n } else {\n $totalFileRecords = $import->rows_count;\n }\n\n $customer = $list->customer;\n $totalSubscribersCount = 0;\n $listSubscribersCount = 0;\n $maxSubscribersPerList = (int)$customer->getGroupOption('lists.max_subscribers_per_list', -1);\n $maxSubscribers = (int)$customer->getGroupOption('lists.max_subscribers', -1);\n\n if ($maxSubscribers > -1 || $maxSubscribersPerList > -1) {\n $criteria = new CDbCriteria();\n $criteria->select = 'COUNT(DISTINCT(t.email)) as counter';\n\n if ($maxSubscribers > -1 && ($listsIds = $customer->getAllListsIdsNotMerged())) {\n $criteria->addInCondition('t.list_id', $listsIds);\n $totalSubscribersCount = ListSubscriber::model()->count($criteria);\n if ($totalSubscribersCount >= $maxSubscribers) {\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => Yii::t('lists', 'You have reached the maximum number of allowed subscribers.'),\n ));\n }\n }\n\n if ($maxSubscribersPerList > -1) {\n $criteria->compare('t.list_id', (int)$list->list_id);\n $listSubscribersCount = ListSubscriber::model()->count($criteria);\n if ($listSubscribersCount >= $maxSubscribersPerList) {\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => Yii::t('lists', 'You have reached the maximum number of allowed subscribers into this list.'),\n ));\n }\n }\n }\n\n $offset = $importAtOnce * ($import->current_page - 1);\n if ($offset >= $totalFileRecords) {\n return $this->renderJson(array(\n 'result' => 'success',\n 'message' => Yii::t('list_import', 'The import process has finished!')\n ));\n }\n\n // $file->seek($offset);\n $file->seek($offset > 0 ? $offset - 1 : 0);\n\n $ioFilter = Yii::app()->ioFilter;\n $emails = array();\n $i = 0;\n\n while (!$file->eof()) {\n $emails[] = $ioFilter->stripPurify(trim($file->fgets()));\n ++$i;\n if ($i >= $importAtOnce) {\n break;\n }\n }\n unset($file);\n\n if (empty($emails)) {\n @unlink($filePath.$import->file_name);\n if ($logAction = Yii::app()->customer->getModel()->asa('logAction')) {\n $logAction->listImportEnd($list, $import);\n }\n if ($import->is_first_batch) {\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => Yii::t('list_import', 'Your file does not contain enough data to be imported!')\n ));\n } else {\n return $this->renderJson(array(\n 'result' => 'success',\n 'message' => Yii::t('list_import', 'The import process has finished!')\n ));\n }\n }\n\n // trim them\n $emails = array_map('trim', $emails);\n\n // since 1.3.5.9\n $bulkEmails = array();\n foreach ($emails as $email) {\n if (!EmailBlacklist::getFromStore($email)) {\n $bulkEmails[$email] = false;\n }\n }\n $failures = (array)Yii::app()->hooks->applyFilters('customer_list_import_data_bulk_check_failures', array(), (array)$bulkEmails);\n foreach ($failures as $email => $message) {\n EmailBlacklist::addToBlacklist($email, $message);\n }\n // end 1.3.5.9\n\n $fieldModel = ListField::model()->findByAttributes(array(\n 'list_id' => $list->list_id,\n 'tag' => 'EMAIL',\n ));\n\n $finished = false;\n $importCount = 0;\n\n // since 1.3.5.9\n Yii::app()->hooks->doAction('list_import_before_processing_data', $collection = new CAttributeCollection(array(\n 'data' => $emails,\n 'list' => $list,\n 'importLog' => $importLog,\n 'finished' => $finished,\n 'importCount' => $importCount,\n 'failures' => $failures,\n 'importType' => 'text'\n )));\n\n $emails = $collection->data;\n $importLog = $collection->importLog;\n $importCount = $collection->importCount;\n $finished = $collection->finished;\n $failures = $collection->failures;\n //\n\n $transaction = Yii::app()->getDb()->beginTransaction();\n $mustCommitTransaction = true;\n\n try {\n\n foreach ($emails as $email) {\n\n $importLog[] = array(\n 'type' => 'info',\n 'message' => Yii::t('list_import', 'Checking the list for the email: \"{email}\"', array(\n '{email}' => CHtml::encode($email),\n )),\n 'counter' => false,\n );\n\n if (!empty($failures[$email])) {\n $importLog[] = array(\n 'type' => 'error',\n 'message' => Yii::t('list_import', 'Failed to save the email \"{email}\", reason: {reason}', array(\n '{email}' => CHtml::encode($email),\n '{reason}' => '<br />'.$failures[$email],\n )),\n 'counter' => true,\n );\n continue;\n }\n\n $subscriber = null;\n if (!empty($email)) {\n $subscriber = ListSubscriber::model()->findByAttributes(array(\n 'list_id' => $list->list_id,\n 'email' => $email,\n ));\n }\n\n if (empty($subscriber)) {\n\n $importLog[] = array(\n 'type' => 'info',\n 'message' => Yii::t('list_import', 'The email \"{email}\" was not found, we will try to create it...', array(\n '{email}' => CHtml::encode($email),\n )),\n 'counter' => false,\n );\n\n $subscriber = new ListSubscriber();\n $subscriber->list_id = $list->list_id;\n $subscriber->email = $email;\n $subscriber->source = ListSubscriber::SOURCE_IMPORT;\n $subscriber->status = ListSubscriber::STATUS_CONFIRMED;\n\n $validator = new CEmailValidator();\n $validator->allowEmpty = false;\n $validator->validateIDN = true;\n if (Yii::app()->options->get('system.common.dns_email_check', false)) {\n $validator->checkMX = CommonHelper::functionExists('checkdnsrr');\n $validator->checkPort = CommonHelper::functionExists('dns_get_record') && CommonHelper::functionExists('fsockopen');\n }\n $validEmail = !empty($email) && $validator->validateValue($email);\n\n if (!$validEmail) {\n $subscriber->addError('email', Yii::t('list_import', 'Invalid email address!'));\n } else {\n $blacklisted = $subscriber->getIsBlacklisted(array('checkZone' => EmailBlacklist::CHECK_ZONE_LIST_IMPORT));\n if (!empty($blacklisted)) {\n $subscriber->addError('email', Yii::t('list_import', 'This email address is blacklisted!'));\n }\n }\n\n if (!$validEmail || $subscriber->hasErrors() || !$subscriber->save()) {\n $importLog[] = array(\n 'type' => 'error',\n 'message' => Yii::t('list_import', 'Failed to save the email \"{email}\", reason: {reason}', array(\n '{email}' => CHtml::encode($email),\n '{reason}' => '<br />'.$subscriber->shortErrors->getAllAsString()\n )),\n 'counter' => true,\n );\n continue;\n }\n\n $listSubscribersCount++;\n $totalSubscribersCount++;\n\n if ($maxSubscribersPerList > -1 && $listSubscribersCount >= $maxSubscribersPerList) {\n $finished = Yii::t('lists', 'You have reached the maximum number of allowed subscribers into this list.');\n break;\n }\n\n if ($maxSubscribers > -1 && $totalSubscribersCount >= $maxSubscribers) {\n $finished = Yii::t('lists', 'You have reached the maximum number of allowed subscribers.');\n break;\n }\n\n $importLog[] = array(\n 'type' => 'success',\n 'message' => Yii::t('list_import', 'The email \"{email}\" has been successfully saved.', array(\n '{email}' => CHtml::encode($email),\n )),\n 'counter' => true,\n );\n\n } else {\n\n $importLog[] = array(\n 'type' => 'info',\n 'message' => Yii::t('list_import', 'The email \"{email}\" has been found, we will update it.', array(\n '{email}' => CHtml::encode($email),\n )),\n 'counter' => true,\n );\n }\n\n $valueModel = ListFieldValue::model()->findByAttributes(array(\n 'field_id' => $fieldModel->field_id,\n 'subscriber_id' => $subscriber->subscriber_id,\n ));\n if (empty($valueModel)) {\n $valueModel = new ListFieldValue();\n $valueModel->field_id = $fieldModel->field_id;\n $valueModel->subscriber_id = $subscriber->subscriber_id;\n }\n $valueModel->value = $email;\n $valueModel->save();\n\n ++$importCount;\n\n if ($finished) {\n break;\n }\n }\n\n $transaction->commit();\n $mustCommitTransaction = false;\n\n } catch(Exception $e) {\n\n if (isset($file)) {\n unset($file);\n }\n\n if (is_file($filePath.$import->file_name)) {\n @unlink($filePath.$import->file_name);\n }\n\n $transaction->rollback();\n $mustCommitTransaction = false;\n\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => $e->getMessage(),\n ));\n }\n\n if ($mustCommitTransaction) {\n $transaction->commit();\n }\n\n if ($finished) {\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => $finished,\n ));\n }\n\n $import->is_first_batch = 0;\n $import->current_page++;\n\n return $this->renderJson(array(\n 'result' => 'success',\n 'message' => Yii::t('list_import', 'Imported {count} subscribers starting from row {rowStart} and ending with row {rowEnd}! Going further, please wait...', array(\n '{count}' => $importCount,\n '{rowStart}' => $offset,\n '{rowEnd}' => $offset + $importAtOnce,\n )),\n 'attributes' => $import->attributes,\n 'import_log' => $importLog,\n 'recordsCount' => $totalFileRecords,\n ));\n\n } catch(Exception $e) {\n\n if (isset($file)) {\n unset($file);\n }\n\n if (is_file($filePath.$import->file_name)) {\n @unlink($filePath.$import->file_name);\n }\n\n return $this->renderJson(array(\n 'result' => 'error',\n 'message' => Yii::t('list_import', 'Your file cannot be imported, a general error has been encountered: {message}!', array(\n '{message}' => $e->getMessage()\n ))\n ));\n\n }\n }", "public function testGetList()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Lists\";\n $localFile = \"DocumentElements/Lists/ListsGet.doc\";\n $remoteFileName = \"TestGetList.doc\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $localFile,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $request = new GetListRequest(\n $remoteFileName,\n 1,\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n $result = $this->words->getList($request);\n Assert::assertTrue(json_decode($result, true) !== NULL);\n Assert::assertNotNull($result->getList());\n Assert::assertEquals(1, $result->getList()->getListId());\n }", "function generateList()\n{\n $files = Array();\n if(is_file(FILELIST))\n {\n foreach(file(FILELIST) as $line)\n {\n $value = explode(DELIM, $line); \n $escapedName = escapeName($value[0]);\n $files[$escapedName] = Array(\n \"name\" => $value[0], \n \"title\" => $value[1], \n \"thumbnail\" => (isset($value[2]) ? $value[2] : \"\")\n );\n $files[$escapedName]['escapedName'] = $escapedName;\n }\n }\n if(is_dir(FILEDIR))\n {\n foreach( scandir(FILEDIR) as $key)\n {\n $key = escapeName($key);\n if( !isset($files[$key]) )\n {\n unset($files[$key]);\n }\n }\n }\n\n return $files;\n}", "function updateProbesList($userid, $fileid)\n{\n#echo $userid;\n#echo $fileid;\n#update eval/model list \n$listfile = \"/home/dingz/bob.spear-1.1.8/eggs/xbob.db.voxforge-0.1.0-py2.7.egg/xbob/db/voxforge/lists/eval/for_models.lst\";\n$content = file_get_contents($listfile);\n#echo \"bp2\";\n$content .= ($userid . \"/\" . $fileid . \" \" . $userid . \" \" . $userid . \"\\n\");\nfile_put_contents($listfile,$content);\n#update eval/probes list\n$listfile = \"/home/dingz/bob.spear-1.1.8/eggs/xbob.db.voxforge-0.1.0-py2.7.egg/xbob/db/voxforge/lists/eval/for_probes.lst\";\n$content = file_get_contents($listfile);\n#echo \"bp2\";\n$content .= ($userid . \"/\" . $fileid . \" \" . $userid . \"\\n\");\nfile_put_contents($listfile,$content);\necho \"Models and probes file list updated!\\n\";\n#echo \"bp3\";\n#error_log(\"file list updated\", 1, \"dingz@andrew.cmu.edu\");\n}", "private function loadCompleted()\n {\n $this->io->text('Loading the complete list');\n $saved = file_get_contents(self::SAVED_LIST_FILENAME);\n $saved = json_decode($saved);\n \n foreach ($saved as $itemId => $info) {\n $this->completed[] = $itemId;\n }\n \n $this->complete();\n unset($saved);\n }", "public function Admin_Action_CustomFieldUsedByList() {\n $listIDs = $this->_getPOSTRequest ( 'listid', null );\n if (is_array ( $listIDs )) {\n $output = GetJSON ( $this->_getCustomFieldUsedByList ( $listIDs ) );\n echo $output;\n }\n }", "private function getFieldList() {\n\t\t$this->objData = $this->objManageContent->getFieldList($this->intSecID);\n\t}", "function filelist($result, $script_name, $group=\"\") {\n global $db, $cfg, $defaults, $pathvars, $environment, $dataloop, $hidedata;\n\n // Suchstring wird mitgegeben - wird (vermutlich nicht mehr benoetigt)\n $getvalues = \"\";\n\n if ( !isset($environment[\"parameter\"][1]) ) $environment[\"parameter\"][1] = null;\n if ( !isset($environment[\"parameter\"][3]) ) $environment[\"parameter\"][3] = null;\n\n $dataloop[\"list\"] = array();\n $i = 0;\n while ( $data = $db -> fetch_array($result,1) ) {\n\n if ( isset($_SESSION[\"file_memo\"]) && $environment[\"parameter\"][0] == \"list\" ) {\n if (in_array($data[\"fid\"],$_SESSION[\"file_memo\"])) {\n $link = $cfg[$script_name][\"basis\"].\"/list,\".$environment[\"parameter\"][1].\",\".$data[\"fid\"].\",\".$environment[\"parameter\"][3].\".html\".$getvalues;\n $icon = $cfg[$script_name][\"iconpath\"].\"cms-cb1.png\";\n $checked = \" checked=\\\"checked\\\"\";\n } else {\n $link = $cfg[$script_name][\"basis\"].\"/list,\".$environment[\"parameter\"][1].\",\".$data[\"fid\"].\",\".$environment[\"parameter\"][3].\".html\".$getvalues;\n $icon = $cfg[$script_name][\"iconpath\"].\"cms-cb0.png\";\n $checked = \"\";\n }\n } elseif ( isset($_SESSION[\"compilation_memo\"][$environment[\"parameter\"][1]]) && $environment[\"parameter\"][0] == \"compilation\") {\n if (in_array($data[\"fid\"],$_SESSION[\"compilation_memo\"][$environment[\"parameter\"][1]])) {\n $link = $cfg[$script_name][\"basis\"].\"/compilation,\".$environment[\"parameter\"][1].\",\".$data[\"fid\"].\",\".$environment[\"parameter\"][3].\".html\".$getvalues;\n $icon = $cfg[$script_name][\"iconpath\"].\"cms-cb1.png\";\n $checked = \" checked=\\\"checked\\\"\";\n } else {\n $link = $cfg[$script_name][\"basis\"].\"/compilation,\".$environment[\"parameter\"][1].\",\".$data[\"fid\"].\",\".$environment[\"parameter\"][3].\".html\".$getvalues;\n $icon = $cfg[$script_name][\"iconpath\"].\"cms-cb0.png\";\n $checked = \"\";\n }\n } else {\n $link = $cfg[$script_name][\"basis\"].\"/\".$environment[\"parameter\"][0].\",\".$environment[\"parameter\"][1].\",\".$data[\"fid\"].\",\".$environment[\"parameter\"][3].\".html\".$getvalues;\n $icon = $cfg[$script_name][\"iconpath\"].\"cms-cb0.png\";\n $checked = \"\";\n }\n $cb = \"<a href=\".$link.\"><img width=\\\"13\\\" height\\\"13\\\" border=\\\"0\\\" src=\\\"\".$icon.\"\\\"></a>\";\n\n // table color change\n if ( !isset($cfg[$script_name][\"color\"][\"set\"]) ) $cfg[$script_name][\"color\"][\"set\"] = null;\n if ( isset( $cfg[$script_name][\"color\"][\"a\"]) && isset($cfg[$script_name][\"color\"][\"b\"]) ) {\n if ( $cfg[$script_name][\"color\"][\"set\"] == $cfg[$script_name][\"color\"][\"a\"]) {\n $cfg[$script_name][\"color\"][\"set\"] = $cfg[$script_name][\"color\"][\"b\"];\n } else {\n $cfg[$script_name][\"color\"][\"set\"] = $cfg[$script_name][\"color\"][\"a\"];\n }\n }\n // file art\n $type = $cfg[\"file\"][\"filetyp\"][$data[\"ffart\"]];\n\n // link target\n if ( $data[\"ffart\"] == \"pdf\" ) {\n $target = \"_blank\";\n } else {\n $target = \"\";\n }\n\n // new line?\n $newline = \"\";\n if ( !empty($cfg[$script_name][\"db\"][\"file\"][\"line\"]) ) {\n $i++;\n $even = $i / $cfg[$script_name][\"db\"][\"file\"][\"line\"];\n if ( is_int($even) ) $newline = $cfg[$script_name][\"db\"][\"file\"][\"newline\"];\n }\n\n // onclick link start / end\n if ( !isset($cfg[$script_name][\"image_tag\"]) ) $cfg[$script_name][\"image_tag\"] = \"img\"; # kompatibilitaet\n\n if ( !isset($cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][3]) ){\n $cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][3] = \"\";\n }\n if ( !isset($cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][4]) ){\n $cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][4] = \"\";\n }\n $la = $cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][3]\n .$cfg[\"file\"][\"base\"][\"webdir\"]\n .$data[\"ffart\"].\"/\"\n .$data[\"fid\"].\"/\";\n // \"o/\"\n $lb = $data[\"ffname\"]\n .$cfg[$script_name][\"tags\"][$cfg[$script_name][\"image_tag\"]][4];\n\n // keine weiteren parameter fuer others\n if ( $cfg[\"file\"][\"filetyp\"][$data[\"ffart\"]] != \"img\" ) {\n $lb = $data[\"ffname\"];\n }\n\n // csv-datei?\n if ( $data[\"ffart\"] == \"csv\" ) {\n $cvs_click = \"ebInsertCVS(ebCanvas, '', '\".$la.$lb.\"', '\".$data[\"funder\"].\"', '');\";\n $cvs_title = \"[Datei als Tabelle einf&uuml;gen]\";\n } else {\n $cvs_click = \"\";\n $cvs_title = \"\";\n }\n\n\n // src-pfad fuer das thumbnail\n $src = $cfg[\"file\"][\"base\"][\"webdir\"].\n $cfg[\"file\"][\"base\"][\"pic\"][\"root\"].\n $cfg[\"file\"][\"base\"][\"pic\"][\"tn\"].\"tn_\".\n $data[\"fid\"].\".\".$data[\"ffart\"];\n $src_realname = $cfg[\"file\"][\"base\"][\"webdir\"].\n $data[\"ffart\"].\"/\".\n $data[\"fid\"].\"/\".\n \"tn/\".\n $data[\"ffname\"];\n\n // download-link\n if ( $cfg[\"file\"][\"base\"][\"realname\"] == True ) {\n $download = $cfg[\"file\"][\"base\"][\"webdir\"].\n $data[\"ffart\"].\"/\".\n $data[\"fid\"].\"/\".\n $data[\"ffname\"];\n } else {\n $download = $cfg[\"file\"][\"base\"][\"webdir\"].\n $cfg[\"file\"][\"base\"][$cfg[\"file\"][\"fileopt\"][$type][\"name\"]].\n $cfg[\"file\"][\"fileopt\"][$type][\"name\"].\"_\".\n $data[\"fid\"].\".\".$data[\"ffart\"];\n }\n\n // sortierkritierium fuer die compilations\n if ( $group != \"\" ) {\n preg_match(\"/#p\".$group.\"[,]*([0-9]*)#/i\",$data[\"fhit\"],$match);\n $sort = @$match[1];\n } else {\n $sort = \"\";\n }\n\n $name = \"list\";\n if ( $cfg[\"file\"][\"filetyp\"][$data[\"ffart\"]] == \"img\" ){\n $name = \"list_images\";\n } else {\n $name = \"list_other\";\n }\n if ( !isset($cfg[$script_name][\"color\"][\"set\"]) ){\n $cfg[$script_name][\"color\"][\"set\"] = \"\";\n }\n if ( !isset($cfg[$script_name][\"tags\"][\"img\"][5]) ){\n $cfg[$script_name][\"tags\"][\"img\"][5] = \"\";\n }\n $dataloop[$name][$data[\"fid\"]] = array (\n \"id\" => $data[\"fid\"],\n \"art\" => $data[\"ffart\"],\n \"color\" => $cfg[$script_name][\"color\"][\"set\"],\n \"checked\" => $checked,\n \"ehref\" => \"edit,\".$data[\"fid\"].\".html\",\n \"dhref\" => $download,\n \"vhref\" => $environment[\"allparameter\"].\"/view,o,\".$data[\"fid\"].\",\".$group.\".html\",\n \"src\" => $src,\n \"dtarget\" => $target,\n \"alt\" => htmlspecialchars($data[\"ffname\"]),\n \"title\" => htmlspecialchars($data[\"ffname\"]),\n \"under\" => htmlspecialchars($data[\"funder\"]),\n \"desc\" => htmlspecialchars($data[\"fdesc\"]),\n \"cb\" => $cb,\n \"ohref\" => \"list/view,o,\".$data[\"fid\"].\".html\",\n \"bhref\" => \"list/view,b,\".$data[\"fid\"].\".html\",\n \"mhref\" => \"list/view,m,\".$data[\"fid\"].\".html\",\n \"shref\" => \"list/view,s,\".$data[\"fid\"].\".html\",\n \"ohref_lb\" => str_replace(\"/tn/\",\"/o/\",$src_realname),\n \"bhref_lb\" => str_replace(\"/tn/\",\"/b/\",$src_realname),\n \"mhref_lb\" => str_replace(\"/tn/\",\"/m/\",$src_realname),\n \"shref_lb\" => str_replace(\"/tn/\",\"/s/\",$src_realname),\n // new: ebInsertImage(ebCanvas);\n \"oclick\" => \"ebInsertImage(ebCanvas, '\".strtoupper($cfg[$script_name][\"image_tag\"]).\"', '\".$la.\"o/\".$lb.\"', '\".htmlspecialchars($data[\"funder\"]).\"', '\".$cfg[$script_name][\"tags\"][\"img\"][5].\"');\",\n \"bclick\" => \"ebInsertImage(ebCanvas, '\".strtoupper($cfg[$script_name][\"image_tag\"]).\"', '\".$la.\"b/\".$lb.\"', '\".htmlspecialchars($data[\"funder\"]).\"', '\".$cfg[$script_name][\"tags\"][\"img\"][5].\"');\",\n \"mclick\" => \"ebInsertImage(ebCanvas, '\".strtoupper($cfg[$script_name][\"image_tag\"]).\"', '\".$la.\"m/\".$lb.\"', '\".htmlspecialchars($data[\"funder\"]).\"', '\".$cfg[$script_name][\"tags\"][\"img\"][5].\"');\",\n \"sclick\" => \"ebInsertImage(ebCanvas, '\".strtoupper($cfg[$script_name][\"image_tag\"]).\"', '\".$la.\"s/\".$lb.\"', '\".htmlspecialchars($data[\"funder\"]).\"', '\".$cfg[$script_name][\"tags\"][\"img\"][5].\"');\",\n \"fclick\" => \"ebInsertother(ebCanvas, '\".strtoupper($cfg[$script_name][\"image_tag\"]).\"', '\".$la.$lb.\"', '\".htmlspecialchars($data[\"funder\"]).\"', '');\",\n \"cvs_click\" => $cvs_click,\n \"cvs_title\" => $cvs_title,\n \"newline\" => $newline,\n \"sort\" => $sort,\n );\n $dataloop[\"list_files\"][$data[\"fid\"]] = $dataloop[$name][$data[\"fid\"]];\n }\n if ( isset($dataloop[\"list_images\"]) ) {\n if ( count($dataloop[\"list_images\"]) > 0 ) $hidedata[\"list_images\"] = array();\n }\n if ( isset($dataloop[\"list_other\"]) ) {\n if ( count($dataloop[\"list_other\"]) > 0 ) $hidedata[\"list_other\"] = array();\n }\n if ( isset($dataloop[\"list_files\"]) ) {\n if ( count($dataloop[\"list_files\"]) > 0 ) $hidedata[\"list_files\"] = array();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new annotation.
function create_annotation($entity_guid, $name, $value, $value_type, $owner_guid, $access_id = ACCESS_PRIVATE) { global $CONFIG; $result = false; $entity_guid = (int)$entity_guid; //$name = sanitise_string(trim($name)); //$value = sanitise_string(trim($value)); $value_type = detect_extender_valuetype($value, sanitise_string(trim($value_type))); $owner_guid = (int)$owner_guid; if ($owner_guid==0) $owner_guid = get_loggedin_userid(); $access_id = (int)$access_id; $time = time(); // Add the metastring $value = add_metastring($value); if (!$value) return false; $name = add_metastring($name); if (!$name) return false; $entity = get_entity($entity_guid); if (trigger_elgg_event('annotate',$entity->type,$entity)) { system_log($entity, 'annotate'); // If ok then add it $result = insert_data("INSERT into {$CONFIG->dbprefix}annotations (entity_guid, name_id, value_id, value_type, owner_guid, time_created, access_id) VALUES ($entity_guid,'$name',$value,'$value_type', $owner_guid, $time, $access_id)"); if ($result!==false) { $obj = get_annotation($result); if (trigger_elgg_event('create', 'annotation', $obj)) { return true; } else { delete_annotation($result); } } } return $result; }
[ "public function create(Google_Service_Genomics_Annotation $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('create', array($params), \"Google_Service_Genomics_Annotation\");\n }", "function annotation_add_instance(stdClass $annotation, mod_annotation_mod_form $mform = null) {\n global $CFG, $DB, $USER;\n require_once(\"$CFG->dirroot/mod/annotation/locallib.php\");\n $annotation->timecreated = time();\n $annotation->id = $DB->insert_record('annotation', $annotation);\n\n annotation_grade_item_update($annotation); // Permanently store the file and add record to DB.\n store_annotation_document($annotation);\n return $annotation->id;\n}", "public function insert(Google_Service_Books_Annotation $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_Books_Annotation\");\n }", "public function addAnnotation()\n {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $this->checkTokenInUrl();\n\n // the date used is for the annotation manager HTML that gets echo'd. we\n // use this date for the new annotation, unless it is a date range, in\n // which case we use the first date of the range.\n $date = Common::getRequestVar('date');\n if (strpos($date, ',') !== false) {\n $date = reset(explode(',', $date));\n }\n\n // add the annotation. NOTE: permissions checked in API method\n Request::processRequest(\"Annotations.add\", array('date' => $date));\n\n $managerDate = Common::getRequestVar('managerDate', false);\n $managerPeriod = Common::getRequestVar('managerPeriod', false);\n return $this->getAnnotationManager($fetch = true, $managerDate, $managerPeriod);\n }\n }", "public function insert(Books_Annotation $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Books_Annotation\");\n }", "public function insert(Google_Annotation $postBody, $optParams = array()) {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Annotation($data);\n } else {\n return $data;\n }\n }", "public function insert(Annotation $postBody, $optParams = [])\n {\n $params = ['postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('insert', [$params], Annotation::class);\n }", "static function runCreateWithAnnotation(string $scanPath, string $namespace, ...$params);", "public static function fromArray(array $data): Annotation {\n\t\t$annotation = new Annotation($data['distance'], $data['duration'], $data['datasources'], $data['nodes'], $data['weight']);\n\t\tif (isset($data['speed'])) {\n\t\t\t$annotation->speed = $data['speed'];\n\t\t}\n\t\tif (isset($data['metadata'])) {\n\t\t\t$annotation->metadata = $data['metadata'];\n\t\t}\n\t\treturn $annotation;\n\t}", "public function createAnnotation(array $parameters)\n\t{\n\t\t$annotation = new MatchUrlExactAnnotation();\n\t\t$annotation->initAnnotation($parameters);\n\n\t\treturn $annotation;\n\t}", "function AddAnnotation($str) {\r\n $this->RenderAnnotation($str);\r\n $this->Ln(7); // a little padding between lines\r\n }", "public function newAnnotationInstance(AnnotationInterface $annotation)\n {\n return $annotation->newInstance($annotation->getAnnotationName(), $annotation->getValues());\n }", "public function setAnnotationCreationFunction(Closure $func)\n {\n $this->parser->setAnnotationCreationFunction($func);\n }", "public function isAnnotation();", "function insert_annotations(\n\t$dom, \n\t&$node, \t\t\t\t\t// root node \n\t$spans_outside_tags, \t\t// array of strings that will be outside the tags\n\t$spans_inside_tags, \t\t// text that will be enclosed by the tags\n\t$tag_name, \t\t\t\t\t// name of the tag to use\n\t$tag_attributes = array() \t// array of attributes to be attached to the tags\n\t)\n{\n\t//print_r($tag_attributes );exit();\n\n // add a new text node with the first part\n $node->parentNode->insertBefore(\n $dom->createTextNode(\n // fetch and remove the first part from the list\n array_shift($spans_outside_tags)\n ),\n $node\n );\n \n // Remaining parts of the text\n $n = count($spans_outside_tags);\n for ($i = 0; $i < $n; $i++)\n {\n // add a tag before\n \n $annotation_tag = $dom->createElement($tag_name);\n \n if (isset($tag_attributes[$i]))\n {\n \tforeach ($tag_attributes[$i] as $k => $v)\n \t{\n\t\t\t$annotation_tag->setAttribute($k, $v);\n\t\t}\n\t}\n $node->parentNode->insertBefore($annotation_tag, $node);\n \n // text within tags\n $annotation_tag->appendChild($dom->createTextNode($spans_inside_tags[$i]));\n \n // add the part from the list as new text node\n $node->parentNode->insertBefore(\n $dom->createTextNode($spans_outside_tags[$i]), \n $node\n );\n }\n \n \n // remove the old text node\n $node->parentNode->removeChild($node);\n\n}", "function el_notification_annotation($callback, $type, $params) {\n\t\t$notification = new elNotifications;\n\t\t$notification->add($params['type'], $params['owner_guid'], $params['subject_guid'], $params['annotation_guid']);\n}", "abstract public function getAnnotationAdapter();", "public static function createAnnotationDictionary($rect) {}", "public static function postAnnotation($path, $matches, $params, $format){\n global $user;\n global $validMethods;\n global $validProcessors;\n global $PERMISSIONS;\n\n\n if(count($matches) < 3){\n error(\"Must include the ids of the text and annotation in URI.\");\n }\n\n confirmUserLoggedIn();\n\n $textId = $matches[1];\n $parentAnnotationId = $matches[2];\n\n // Lookup text data.\n $textData = lookupAnnotation($parentAnnotationId);\n\n // Confirm that the user has permissions to fork this annotation. Either\n // the annotation must be public or the user must have at least read\n // permissions for it.\n if(!canViewText($matches[1])){\n error(\"You do not have permission to fork this annotation.\");\n }\n\n $label = htmlentities($params[\"label\"] ?? \"\");\n $method = htmlentities($params[\"method\"] ?? \"manual\");\n\n // Stop if the specified method is invalid.\n if(!array_key_exists($method, $validMethods)){\n\n $error = \"The annotation method '$method' is not supported.\";\n if($format == \"html\"){\n // Reroute to the new annotation.\n Controllers::redirectTo(\n \"/texts/$textId/annotations/$parentAnnotationId\",\n $error, null);\n } else {\n return [\n \"success\" => false,\n \"message\" => $error\n ];\n }\n }\n\n // Stop if this ia a root-only annotation and it's being forked from a \n // non-root annotation.\n if($validMethods[$method][\"root_only\"] && \n !($textData[\"parent_annotation_id\"] == \"\" || \n $textData[\"parent_annotation_id\"] == null)){\n\n $error = \"This fork method ($method) can only be forked from the \". \n \"original annotation.\";\n if($format == \"html\"){\n // Reroute to the new annotation.\n Controllers::redirectTo(\n \"/texts/$textId/annotations/$parentAnnotationId\",\n $error, null);\n } else {\n return [\n \"success\" => false,\n \"message\" => $error\n ];\n }\n }\n\n // Create a manual annotation.\n if($method == \"manual\"){\n // Create the new annotation.\n $newAnnotationId = addAnnotation($user[\"id\"], $textId, \n $parentAnnotationId, $textData[\"annotation\"], $method,\n generateAnnotationMethodMetadata($method, []), $label);\n // Give the current user ownership.\n addAnnotationPermission($user[\"id\"], $newAnnotationId, \n $PERMISSIONS[\"OWNER\"]);\n\n if($format == \"html\"){\n // Reroute to the new annotation.\n Controllers::redirectTo(\n \"/texts/$textId/annotations/$newAnnotationId\",\n null, \"Annotation successfully forked!\");\n } else {\n return [\n \"success\" => true,\n \"id\" => $newAnnotationId\n ];\n }\n\n // Create an automatic annotation.\n } else if($validMethods[$method][\"automatic\"]) {\n $args = [];\n\n if($method == \"booknlp+tie-window\" || $method == \"tie-window\")\n $args[\"n\"] = htmlentities($params[\"n\"]);\n\n // Copy over the annotation of the parent as long as this isn't a root-\n // only annotation.\n $annotation = null;\n if(!$validMethods[$method][\"root_only\"]){\n $annotation = $textData[\"annotation\"];\n }\n\n // Create the new annotation.\n $newAnnotationId = addAnnotation($user[\"id\"], $textId, \n $parentAnnotationId, $annotation, $method, \n generateAnnotationMethodMetadata($method, $args),\n generateAnnotationLabel($method, $args), 1);\n // Give the current user ownership.\n addAnnotationPermission($user[\"id\"], $newAnnotationId, \n $PERMISSIONS[\"OWNER\"]);\n\n $result = Controllers::runAutomaticAnnotation($method, $args, $textId, \n $textData[\"text_md5sum\"], $newAnnotationId);\n\n if($result[\"success\"] === true){\n $successMessages = [\n \"The file has been uploaded and is being processed.\"\n ];\n $errorMessages = [];\n } else {\n $successMessages = [];\n $errorMessages = [\n \"File stored, but not processed.\", \n $result[\"error\"]\n ];\n }\n \n if($format == \"html\"){\n\n // Go to the new annotation page if processing is underway.\n if($result[\"success\"] === true){\n Controllers::redirectTo(\"/texts/$textId/annotations/$newAnnotationId\");\n\n // If there was an error uploading, report that.\n } else {\n Controllers::redirectTo(\"/texts/$textId/annotations\",\n join(\"<br/>\", $errorMessages), join(\"<br/>\", $successMessages));\n }\n } else {\n if($result[\"success\"] === true){\n success($successMessages[0], $successMessages[1]);\n } else {\n error($errorMessages[0], $errorMessages[1]);\n }\n }\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the sans contrat.
public function getSansContrat(): ?int { return $this->sansContrat; }
[ "public function getContrat()\n {\n return $this->contrat;\n }", "public function getNegocio();", "public function getCne()\n {\n return $this->cne;\n }", "public function getContratoEct()\n {\n return $this->contratoEct;\n }", "public function getNonConcerneTp() {\n return $this->nonConcerneTp;\n }", "public function getNegate()\n {\n return $this->negate;\n }", "public function getNoDossFactCab() {\n return $this->noDossFactCab;\n }", "public function getTributary(): string {\r\n return $this->tributary;\r\n }", "public function getNoiteterca()\r\n {\r\n return $this->noiteterca;\r\n }", "public function getTributary()\n {\n return $this->tributary;\n }", "public function getConsommation()\n {\n return $this->consommation;\n }", "public function getCoNegocio()\n\t{\n\t\treturn $this->co_negocio;\n\t}", "public function getCoutDepassement()\n {\n return $this->coutDepassement;\n }", "public function getCdUnidadeNegocio()\n {\n return $this->cd_unidade_negocio;\n }", "public function getAdDotationExcept() {\n return $this->adDotationExcept;\n }", "public function getModeleCertif() {\n return $this->modeleCertif;\n }", "public function getCne():string\n {\n return $this->cne;\n }", "public function couleur()\n {\n return $this->couleur;\n }", "public function getCumBrutNonAbattu() {\n return $this->cumBrutNonAbattu;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get project Forum data..
function projectforumdata($renderobj,$forumid) { global $DB,$USER; $content = ''; $post_array = array(); $condition = ' WHERE d.forum='.$forumid; $sql = projectforumsql($condition); $record = $DB->get_records_sql($sql); if(count($record)>0) { foreach($record as $key=>$values){ $courseid = $values->course; $forumid = $values->forum; $post_array[$values->discussion][] = (object) frmgenratedata($values,$values->course,$values->forum); } } if(count($post_array)>0){ $tmp_discussionid = 0; $hasparent = false; foreach($post_array as $key=>$values) { $replydata = ''; foreach($values as $k1=>$val){ if($val->type=='parent'){ $renderobj->values = $val->values; $renderobj->userlink = $val->userlink; $renderobj->profileurl = $val->profileurl; $renderobj->post_image = $val->post_image; $renderobj->uname = $val->uname; } else{ $renderobj->replyvalues = $val->values; $renderobj->replyuserlink = $val->userlink; $renderobj->replyprofileurl = $val->profileurl; $renderobj->replypost_image = $val->post_image; $renderobj->replyuname = $val->uname; $replydata = $replydata.$renderobj->render_forumreply(); } } $renderobj->replydata = $replydata; $content = $content.$renderobj->project_collaboration(); } } return $content; }
[ "function bbp_get_forum_content($forum_id = 0)\n{\n}", "public function listForum()\n {\n $forum = QueryBuilder::for(Forum::class)\n ->allowedIncludes(['dataComment','dataUser','likers'])\n ->allowedSorts(['nama_kategori','judul','isi','image','user_id','views','status','created_at','id'])\n ->allowedFilters(['nama_kategori','judul','isi','image','user_id','views','status'])\n ->jsonPaginate()->appends(Request()->input());\n\n return new ForumCollection($forum);\n }", "function bbp_get_form_topic_forum()\n{\n}", "function get_forum_information($forum_id)\n{\n\tglobal $table_forums;\n\tglobal $table_item_property;\n\n\t$sql=\"SELECT * FROM \".$table_forums.\" forums, \".$table_item_property.\" item_properties\n\t\t\tWHERE item_properties.tool='\".TOOL_FORUM.\"'\n\t\t\tAND item_properties.ref='\".Database::escape_string($forum_id).\"'\n\t\t\tAND forums.forum_id='\".Database::escape_string($forum_id).\"'\";\n\t$result=api_sql_query($sql, __FILE__, __LINE__);\n\t$row=Database::fetch_array($result);\n\t$row['approval_direct_post'] = 0; // we can't anymore change this option, so it should always be activated\n\treturn $row;\n}", "function pnForum_userapi_readforum($args)\n{\n extract($args);\n unset($args);\n\n $forum = pnModAPIFunc('pnForum', 'admin', 'readforums',\n array('forum_id' => $forum_id,\n 'permcheck' => 'nocheck' ));\n if($forum==false) {\n return showforumerror(_PNFORUM_FORUM_NOEXIST, __FILE__, __LINE__);\n }\n\n if(!allowedtoseecategoryandforum($forum['cat_id'], $forum['forum_id'])) {\n return showforumerror(getforumerror('auth_overview',$forum['forum_id'], 'forum', _PNFORUM_NOAUTH_TOSEE), __FILE__, __LINE__);\n }\n\n list($dbconn, $pntable) = pnfOpenDB();\n\n $posts_per_page = pnModGetVar('pnForum', 'posts_per_page');\n if(!isset($topics_per_page)) {\n $topics_per_page = pnModGetVar('pnForum', 'topics_per_page');\n }\n $hot_threshold = pnModGetVar('pnForum', 'hot_threshold');\n $posticon = pnModGetVar('pnForum', 'posticon');\n $firstnew_image = pnModGetVar('pnForum', 'firstnew_image');\n $post_sort_order = pnModAPIFunc('pnForum','user','get_user_post_order');\n\n // read moderators\n $forum['forum_mods'] = pnForum_userapi_get_moderators(array('forum_id' => $forum['forum_id']));\n $forum['last_visit'] = $last_visit;\n\n $forum['topic_start'] = (!empty ($start)) ? $start : 0;\n\n // if user can moderate Forum, set a flag\n $forum['access_moderate'] = allowedtomoderatecategoryandforum($forum['cat_id'], $forum['forum_id']);\n\n // forum_pager is obsolete, inform the user about this\n $forum['forum_pager'] = 'deprecated data field $forum.forum_pager used, please update your template using the forumpager plugin';\n\n $sql = \"SELECT t.topic_id,\n t.topic_title,\n t.topic_views,\n t.topic_replies,\n t.sticky,\n t.topic_status,\n t.topic_last_post_id,\n u.pn_uname,\n u2.pn_uname as last_poster,\n p.post_time\n FROM \".$pntable['pnforum_topics'].\" AS t\n LEFT JOIN \".$pntable['users'].\" AS u ON t.topic_poster = u.pn_uid\n LEFT JOIN \".$pntable['pnforum_posts'].\" AS p ON t.topic_last_post_id = p.post_id\n LEFT JOIN \".$pntable['users'].\" AS u2 ON p.poster_id = u2.pn_uid\n WHERE t.forum_id = '\".(int)pnVarPrepForStore($forum_id).\"'\n ORDER BY t.sticky DESC, p.post_time DESC\";\n\n $result = pnfSelectLimit($dbconn, $sql, $topics_per_page, $start, __FILE__, __LINE__);\n\n $forum['forum_id'] = $forum_id;\n $forum['topics'] = array();\n while(!$result->EOF) {\n $topic = array();\n $topic = $result->GetRowAssoc(false);\n //$topic = $row;\n\n if ($topic['last_poster'] == 'Anonymous') {$topic['last_poster'] = pnConfigGetVar('anonymous'); }\n if ($topic['pn_uname'] == 'Anonymous') {$topic['pn_uname'] = pnConfigGetVar('anonymous'); }\n $topic['total_posts'] = $topic['topic_replies'] + 1;\n\n $topic['post_time_unix'] = strtotime ($topic['post_time']);\n $posted_ml = ml_ftime(_DATETIMEBRIEF, GetUserTime($topic['post_time_unix']));\n $topic['last_post'] = sprintf(_PNFORUM_LASTPOSTSTRING, pnVarPrepForDisplay($posted_ml), pnVarPrepForDisplay($topic['last_poster']));\n\n // does this topic have enough postings to be hot?\n $topic['hot_topic'] = ($topic['topic_replies'] >= $hot_threshold) ? true : false;\n // does this posting have new postings?\n $topic['new_posts'] = ($topic['post_time'] < $last_visit) ? false : true;\n\n // pagination\n $pagination = '';\n $lastpage=0;\n if($topic['topic_replies']+1 > $posts_per_page) {\n\n if ($post_sort_order == 'ASC') {\n $hc_dlink_times = 0;\n if (($topic['topic_replies']+1-$posts_per_page)>= 0) {\n $hc_dlink_times = 0;\n for ($x = 0; $x < $topic['topic_replies']+1-$posts_per_page; $x+= $posts_per_page) {\n $hc_dlink_times++;\n }\n }\n $topic['last_page_start'] = $hc_dlink_times*$posts_per_page;\n } else {\n // latest topic is on top anyway...\n $topic['last_page_start'] = 0;\n }\n\n $pagination .= '&nbsp;&nbsp;&nbsp;<span class=\"pn-sub\">(' . pnVarPrepForDisplay(_PNFORUM_GOTOPAGE) . '&nbsp;';\n $pagenr = 1;\n $skippages = 0;\n for($x = 0; $x < $topic['topic_replies'] + 1; $x += $posts_per_page) {\n $lastpage = (($x + $posts_per_page) >= $topic['topic_replies'] + 1);\n\n if($lastpage) {\n $start = $x;\n } else {\n if ($x != 0) {\n $start = $x;\n }\n }\n\n if($pagenr > 3 && $skippages != 1 && !$lastpage) {\n $pagination .= ', ... ';\n $skippages = 1;\n }\n\n if ($skippages != 1 || $lastpage) {\n if ($x!=0) $pagination .= ', ';\n $pagination .= '<a href=\"' . pnModURL('pnForum', 'user', 'viewtopic', array('topic' => $topic['topic_id'], 'start' => $start)) . '\" title=\"' . $topic['topic_title'] . ' ' . pnVarPrepForDisplay(_PNFORUM_PAGE) . ' ' . $pagenr . '\">' . $pagenr . '</a>';\n }\n\n $pagenr++;\n }\n $pagination .= ')</span>';\n }\n $topic['pagination'] = $pagination;\n // we now create the url to the last post in the thread. This might\n // on site 1, 2 or what ever in the thread, depending on topic_replies\n // count and the posts_per_page setting\n\n // we keep this for backwardscompatibility\n $topic['last_post_url'] = pnModURL('pnForum', 'user', 'viewtopic',\n array('topic' => $topic['topic_id'],\n 'start' => (ceil(($topic['topic_replies'] + 1) / $posts_per_page) - 1) * $posts_per_page));\n $topic['last_post_url_anchor'] = $topic['last_post_url'] . '#pid' . $topic['topic_last_post_id'];\n\n array_push( $forum['topics'], $topic );\n $result->MoveNext();\n }\n pnfCloseDB($result);\n\n $topics_start = $start;\n\n\n return $forum;\n}", "public function getForumList()\n\t{\t\t\t\n\t\t$this->DB->build( array( 'select' => 'f.*',\n\t\t\t\t\t\t\t\t 'from' => array( 'forums' => 'f' ),\n\t\t\t\t\t\t\t\t 'add_join' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'select' => 'm.member_group_id as last_poster_group_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"m.member_id = f.last_poster_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t \t\t\t\t\tarray( 'select' => 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'permission_index' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"p.perm_type='forum' AND p.app='forums' AND p.perm_type_id=f.id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->registry->classItemMarking->getSqlJoin( array( 'item_app_key_1' => 'f.id' ) ) ) ) );\n\t\t\t\t\t\t\n\t\t$q = $this->DB->execute();\n\t\t\n\t\t/* Loop through and build an array of forums */\n\t\t$forums_list\t= array();\n\t\t$update_seo\t\t= array();\n\t\t$tempForums = array();\n\t\t\n\t\twhile( $f = $this->DB->fetch( $q ) )\n\t\t{\n\t\t\t$tempForums[ $f['parent_id'] . '.' . $f['position'] . '.' . $f['id'] ] = $f;\n\t\t}\n\n\t\t/* Sort in PHP */\n\t\t$tempForums = IPSLib::knatsort( $tempForums );\n\t\t\n\t\tforeach( $tempForums as $posData => $f )\n\t\t{\n\t\t\t$fr = array();\n\t\t\t\n\t\t\t/* Add back into topic markers */\n\t\t\t$f = $this->registry->classItemMarking->setFromSqlJoin( $f, 'forums' );\n\t\t\t\n\t\t\t/**\n\t\t\t * This is here in case the SEO name isn't stored for some reason.\n\t\t\t * We'll parse it and then update the forums table - should only happen once\n\t\t\t */\n\t\t\tif ( ! $f['name_seo'] )\n\t\t\t{\n\t\t\t\t/* SEO name */\n\t\t\t\t$f['name_seo'] = IPSText::makeSeoTitle( $f['name'] );\n\t\t\t\t\n\t\t\t\t$update_seo[ $f['id'] ]\t= $f['name_seo'];\n\t\t\t}\n\n\t\t\t/* Last Post Info (author stuff!) */\n\t\t\t$f['last_poster_name'] = IPSMember::makeNameFormatted( $f['last_poster_name'], $f['last_poster_group_id'] );\n\t\t\n\t\t\t/* Reformat the array for a category */\n\t\t\tif ( $f['parent_id'] == -1 )\n\t\t\t{\n\t\t\t\t$fr['id']\t\t\t\t = $f['id'];\n\t\t\t\t$fr['sub_can_post'] = $f['sub_can_post'];\n\t\t\t\t$fr['name'] \t\t = $f['name'];\n\t\t\t\t$fr['name_seo'] \t\t\t= $f['name_seo'];\n\t\t\t\t$fr['parent_id']\t = $f['parent_id'];\n\t\t\t\t$fr['skin_id']\t\t = $f['skin_id'];\n\t\t\t\t$fr['permission_showtopic'] = $f['permission_showtopic'];\n\t\t\t\t$fr['forums_bitoptions'] = $f['forums_bitoptions'];\n\t\t\t\t$fr['hide_last_info']\t\t= 0;\n\t\t\t\t$fr['can_view_others']\t\t= 0;\n\t\t\t\t$fr['password']\t\t\t\t= $f['password'];\n\t\t\t\t\n\t\t\t\t/* Permission index columns */\n\t\t\t\t$fr['app']\t\t\t\t\t= $f['app'];\n\t\t\t\t$fr['perm_id']\t\t\t\t= $f['perm_id'];\n\t\t\t\t$fr['perm_type']\t\t\t= $f['perm_type'];\n\t\t\t\t$fr['perm_type_id']\t\t\t= $f['perm_type_id'];\n\t\t\t\t$fr['perm_view']\t\t\t= $f['perm_view'];\n\t\t\t\t$fr['perm_2']\t\t\t\t= $f['perm_2'];\n\t\t\t\t$fr['perm_3']\t\t\t\t= $f['perm_3'];\n\t\t\t\t$fr['perm_4']\t\t\t\t= $f['perm_4'];\n\t\t\t\t$fr['perm_5']\t\t\t\t= $f['perm_5'];\n\t\t\t\t$fr['perm_6']\t\t\t\t= $f['perm_6'];\n\t\t\t\t$fr['perm_7']\t\t\t\t= $f['perm_7'];\n\t\t\t\t$fr['owner_only']\t\t\t= $f['owner_only'];\n\t\t\t\t$fr['friend_only']\t\t\t= $f['friend_only'];\n\t\t\t\t$fr['authorized_users']\t\t= $f['authorized_users'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fr = $f;\n\n\t\t\t\t$fr['description'] = isset( $f['description'] ) ? $f['description'] : '';\n\t\t\t}\n\t\t\t\n\t\t\t$fr = array_merge( $fr, $this->registry->permissions->parse( $f ) );\n\n\t\t\t/* Unpack bitwise fields */\n\t\t\t$_tmp = IPSBWOptions::thaw( $fr['forums_bitoptions'], 'forums', 'forums' );\n\n\t\t\tif ( count( $_tmp ) )\n\t\t\t{\n\t\t\t\tforeach( $_tmp as $k => $v )\n\t\t\t\t{\n\t\t\t\t\t/* Trigger notice if we have DB field */\n\t\t\t\t\tif ( isset( $fr[ $k ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\ttrigger_error( \"Thawing bitwise options for FORUMS: Bitwise field '$k' has overwritten DB field '$k'\", E_USER_WARNING );\n\t\t\t\t\t}\n\n\t\t\t\t\t$fr[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Add... */\n\t\t\t$forums_list[ $fr['id'] ] = $fr;\n\t\t}\n\n\t\t$this->allForums\t= $forums_list;\n\t\t\n\t\t/**\n\t\t * Update forums table if SEO name wasn't cached yet\n\t\t */\n\t\tif( count($update_seo) )\n\t\t{\n\t\t\tforeach( $update_seo as $k => $v )\n\t\t\t{\n\t\t\t\t$this->DB->update( 'forums', array( 'name_seo' => $v ), 'id=' . $k );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $forums_list;\n\t}", "function getproject_forumcatgeoryid(){\n\t$atalvariable = get_atalvariables();\n\treturn $atalvariable['ongoingproject_postcatgeoryid'];\n}", "function getForums(){\n\t\tglobal $investDb, $hostname;\n\n\t\t$query = $investDb->query(\"SELECT * FROM forums WHERE archive = 'NO' \") or trigger_error($investDb->error);\n\t\t$forums = array();\n\t\twhile ($data = $query->fetch_assoc()) {\n\t\t\t$data['logo'] = $hostname;\n\t\t\t$forums[] = $data;\n\t\t}\n\t\treturn $forums;\n\t}", "public function groupforum_get_forum_topics() {\n $this->init('forums');\n\n $oReturn = new stdClass();\n\n $mForumExists = $this->groupforum_check_forum_existence();\n\n if ($mForumExists === false)\n return $this->error('base', 0);\n else if (is_int($mForumExists) && $mForumExists !== true)\n return $this->error('forums', $mForumExists);\n\n $aConfig = array();\n $aConfig['type'] = $this->type;\n $aConfig['filter'] = $this->type == 'tag' ? $this->tagname : false;\n $aConfig['forum_id'] = $this->forumid;\n $aConfig['page'] = $this->page;\n $aConfig['per_page'] = $this->per_page;\n\n $aTopics = bp_forums_get_forum_topics($aConfig);\n if (is_null($aTopics))\n $this->error('forums', 7);\n foreach ($aTopics as $aTopic) {\n $oReturn->topics[(int) $aTopic->topic_id]->title = $aTopic->topic_title;\n $oReturn->topics[(int) $aTopic->topic_id]->slug = $aTopic->topic_slug;\n $oUser = get_user_by('id', $aTopic->topic_poster);\n $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->username = $oUser->data->user_login;\n $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->mail = $oUser->data->user_email;\n $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->display_name = $oUser->data->display_name;\n $oReturn->topics[(int) $aTopic->topic_id]->post_count = (int) $aTopic->topic_posts;\n if ($this->detailed === true) {\n $oTopic = bp_forums_get_topic_details($aTopic->topic_id);\n\n $oUser = get_user_by('id', $oTopic->topic_last_poster);\n $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->username = $oUser->data->user_login;\n $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->mail = $oUser->data->user_email;\n $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->display_name = $oUser->data->display_name;\n $oReturn->topics[(int) $aTopic->topic_id]->start_time = $oTopic->topic_start_time;\n $oReturn->topics[(int) $aTopic->topic_id]->forum_id = (int) $oTopic->forum_id;\n $oReturn->topics[(int) $aTopic->topic_id]->topic_status = $oTopic->topic_status;\n $oReturn->topics[(int) $aTopic->topic_id]->is_open = (int) $oTopic->topic_open === 1 ? true : false;\n $oReturn->topics[(int) $aTopic->topic_id]->is_sticky = (int) $oTopic->topic_sticky === 1 ? true : false;\n }\n }\n $oReturn->count = count($aTopics);\n return $oReturn;\n }", "public function groupforum_get_forum() {\n $this->init('forums');\n\n $oReturn = new stdClass();\n\n $mForumExists = $this->groupforum_check_forum_existence();\n\n if ($mForumExists === false)\n return $this->error('base', 0);\n else if (is_int($mForumExists) && $mForumExists !== true)\n return $this->error('forums', $mForumExists);\n\n $oForum = bp_forums_get_forum((int) $this->forumid);\n\n $oReturn->forums[(int) $oForum->forum_id]->name = $oForum->forum_name;\n $oReturn->forums[(int) $oForum->forum_id]->slug = $oForum->forum_slug;\n $oReturn->forums[(int) $oForum->forum_id]->description = $oForum->forum_desc;\n $oReturn->forums[(int) $oForum->forum_id]->topics_count = (int) $oForum->topics;\n $oReturn->forums[(int) $oForum->forum_id]->post_count = (int) $oForum->posts;\n return $oReturn;\n }", "public function get_forum($forum_id) { return $this->get_forums(array('id' => $forum_id)); }", "public function _show_forum_posts()\n {\n $OBJ_FORUM = module('forum');\n return $OBJ_FORUM->_for_user_profile($this->_user_info['id'], $this->MAX_SHOW_FORUM_POSTS);\n }", "public function readForum($name);", "public function forumPosts()\n {\n return $this->hasMany('\\App\\Model\\Post', 'idproject')->orderBy('lasteditdate', 'DESC');\n }", "function getForums() {\n\n $stmt = $this->conn->prepare(\"SELECT * FROM n2u_forum_category\");\n $stmt->execute();\n $result = $stmt->get_result();\n $forums = array();\n if ($result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n array_push($forums, $row);\n }\n }\n $stmt->close();\n return $forums;\n }", "function _load_forum_data()\n\t{\n\t\tif ($this->forum_data === false) {\n\t\t\t$this->forum_data = array();\n\t\t\t\n\t\t\t$q = $this->db->query(\"SELECT forum_id, forum_parent, forum_tree, forum_name, forum_position\n\t\t\t\tFROM %pforums ORDER BY forum_position\");\n\n\t\t\twhile ($f = $this->db->nqfetch($q))\n\t\t\t{\n\t\t\t\t$this->forum_data[] = $f;\n\t\t\t}\n\t\t}\n\t}", "function forums()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->array_query( $forum_array, \"SELECT ForumID FROM\r\n eZForum_ForumCategoryLink\r\n WHERE CategoryID='$this->ID'\" );\r\n\r\n $ret = array();\r\n\r\n foreach ( $forum_array as $forum )\r\n {\r\n $ret[] = new eZForum( $forum[$db->fieldName( \"ForumID\" )] );\r\n }\r\n\r\n return $ret;\r\n }", "public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }", "private function showChatContent(){\n $chat_content = Forum::get();\n return $chat_content;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Controls the Table add action, presenting a new page in which to add a new entry to the table.
public function addAction() { $setTable = $this->_tblViewingSeq->getSetTableForAdding(); // Let the view renderer know the table, buttons, and data form to use. $this->_initViewTableInfo($setTable); $this->view->buttonList = array(self::SAVE, self::RESET_BUTTON, self::CANCEL, self::SEARCH); $this->view->form = $form = new Application_Form_TableRecordEntry($setTable, 0, self::ADD); // Is this the initial display or the callback with fields provided? if ( $this->_thisIsInitialDisplay() ) { // If "starter" fields have been provided, fill them in. if ( ! empty($this->_fieldsToMatch) ) { $form->populate($this->_fieldsToMatch); } } elseif ( $this->_buttonAction == self::SAVE ) { // Process the filled-out form that has been posted: // if the changes are valid, update the database. $formData = $this->getRequest()->getPost(); if ($form->isValid($formData)) { // If some fields should be initialized from existing values, // fill them in. Remove null fields. $addValues = $this->_fillInitValues($setTable, $form->getValues()); $nonNullData = $this->_filledFields($addValues); // Update the database and redisplay the record. $setTable->addTableEntry($nonNullData); $this->_executeSearch($setTable, $nonNullData, self::DISPLAY_ALL); } else { // Invalid entries: show them for editing. $this->view->errMsgs[] = "Invalid data values. Please correct."; $form->populate($formData); } } elseif ( $this->_buttonAction == self::CANCEL ) { $this->_goTo('index'); } else { $this->_goTo($this->_getUsualAction($this->_buttonAction)); } }
[ "public function actionAddTable() {\n return $this->render('add-table');\n }", "function lb_show_add_record_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'add',\n\t\t)\n\t);\n}", "public function add() {\r\n if (!isset($this->currentUser)) {\r\n throw new Exception(\"Not in session. This action requires login\");\r\n }\r\n\r\n $tables = new Table();\r\n\r\n if (isset($_POST[\"submit\"])) { // reaching via HTTP Table...\r\n\r\n // populate the Table object with data form the form\r\n $tables->setTableNombre($_POST[\"tableNombre\"]);\r\n $tables->setTableTipo($_POST[\"tableTipo\"]);\r\n $tables->setTableDescripcion($_POST[\"tableDescripcion\"]);\r\n $exers = $_POST['exers'];\r\n\r\n try {\r\n // validate Table object\r\n $tables->checkIsValidForRegister(); // if it fails, ValidationException\r\n\r\n // save the Table object into the database\r\n $this->tableMapper->save($tables, $exers);\r\n\r\n // POST-REDIRECT-GET\r\n // Everything OK, we will redirect the user to the list of tables\r\n // We want to see a message after redirection, so we establish\r\n // a \"flash\" message (which is simply a Session variable) to be\r\n // get in the view after redirection.\r\n $this->view->setFlash(sprintf(i18n(\"Table \\\"%s\\\" successfully added.\"),$tables ->getTableNombre()));\r\n\r\n $this->view->redirect(\"tables\", \"tablesMenu\");\r\n\r\n }catch(ValidationException $ex) {\r\n // Get the errors array inside the exepction...\r\n $errors = $ex->getErrors();\r\n // And put it to the view as \"errors\" variable\r\n $this->view->setVariable(\"errors\", $errors);\r\n }\r\n }\r\n\r\n // Put the Table object visible to the view\r\n $this->view->setVariable(\"tables\", $tables);\r\n\r\n $this->exerciseMapper = new ExerciseMapper();\r\n $exercises = $this->exerciseMapper->findAll();\r\n $this->view->setVariable(\"exercises\", $exercises);\r\n\r\n // render the view (/view/tables/add.php)\r\n $this->view->setLayout(\"welcome\");\r\n $this->view->render(\"tables\", \"add\");\r\n\r\n }", "public function doAddPage() {\n $filterTemplate = array(\n \"entity\" => FILTER_SANITIZE_STRING,\n );\n $filteredData = filter_input_array(INPUT_GET, $filterTemplate);\n\n if($filteredData['entity']) {\n $this->view->show($filteredData['entity'].'s/edit'.ucfirst($filteredData['entity']).'.php');\n }\n\n }", "public function actionAdd()\n {\n $this->adminOnly();\n\n $model = new AddPageForm(['class' => $this->getPageClassName()]);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n return $this->redirect($this->contentContainer->createUrl('edit', ['type' => $model->type]));\n }\n\n return $this->render('@custom_pages/views/common/add', [\n 'model' => $model,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }", "public function add() {\n\n $this->page->assign('action', $this->request->createURL(\"Blog\",\"insert\"));\n $this->page->getPage('add_blog.tpl');\n }", "public function add() {\n\t\t\tif (!empty($this->params['form']['add'])) {\n\t\t\t\t/* Set page name and data array */\n\t\t\t\t$this->pageName = Sanitize::escape($this->params['form']['add']);\n\t\t\t\t$this->pageData = array('MyPage' => array('name' => $this->pageName));\n\t\t\t\t\n\t\t\t\t/* Save new page */\n\t\t\t\tif ($this->MyPage->save($this->pageData)) {\n\t\t\t\t\t/* Get id of new page */\n\t\t\t\t\t$this->pageId = $this->MyPage->getInsertID();\n\t\t\t\t\t\n\t\t\t\t\t/* Redirect to edit */\n\t\t\t\t\tif (!empty($this->pageId)) {\n\t\t\t\t\t\t$this->redirect('/simples/my_pages/edit/'.$this->pageId);\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->redirect('/simples/my_pages');\n\t\t\texit;\n\t\t}", "public function pageAdd()\n {\n // check permission.\n if (!current_user_can('upload_files')) {\n wp_die(__('You do not have permission to access this page.'), '', ['response' => 403]);\n }\n\n global $rd_downloads_options;\n\n $output = [];\n $output['page_heading1'] = __('Add new download', 'rd-downloads');\n $output['rd_downloads_options'] = $rd_downloads_options;\n\n $Loader = new \\RdDownloads\\App\\Libraries\\Loader();\n $Loader->loadView('admin/Downloads/Editing/pageEdit_v', $output);\n unset($Loader);\n }", "public function addAction()\n {\n /* Displaying view template */\n View::renderTemplate('Admin/Topics/add.twig', [\n 'admin_tab' => 'topics', \n 'is_admin_panel' => 1,\n 'topics_number' => Topic::count(),\n 'new_reports' => Report::count(),\n ]); \n }", "public function actionCreate()\n {\n $model = new Tablemain();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function addTable()\n {\n return $this->addContent(new Table());\n }", "public function render_row_adding_form()\n {\n $table = $this->get_element();\n \n $fields = $table->get_fields();\n \n echo \"<table>\\n\";\n \n # The header row\n echo \"<tr>\\n\";\n \n foreach ($fields as $field) {\n if ($field->get_name() != 'id') {\n $field_renderer = $field->get_renderer();\n $field_renderer->render_th();\n }\n }\n \n echo \"<th colspan=\\\"2\\\">Actions</th>\\n\";\n echo \"</tr>\\n\";\n?>\n<form\n name=\"row_adding\"\n <?php echo 'action=\"/admin/index.php?module=database&page=table&table=' . $table->get_name() . \"&add_new_row=1\\\"\\n\"; ?>\n method=\"POST\"\n>\n <tr>\n<?php \n foreach ($fields as $field) {\n if ($field->get_name() != 'id') {\n #print_r($field);\n \n $field_renderer = $field->get_renderer();\n $field_renderer->render_admin_row_adding_form_td();\n }\n }\n \n # The add button\n?>\n <td>\n <input type=\"submit\" class=\"submit\" value=\"Add\" />\n </td>\n\n <td>\n <input\n type=\"button\"\n class=\"submit\"\n value=\"Cancel\"\n onclick=\"document.location.href='/admin/index.php?module=database&page=table&table=<?php echo $table->get_name(); ?>'\"\n />\n </td>\n </tr>\n</form>\n<?php\n echo \"</table>\\n\";\n }", "public function addAction()\r\n {\r\n $this->_model = Sohan::getModel('vn-news', array('table_name' => 'news'));\r\n $this->_model->insertRowInTable(array('title', 'content'), array(Sohan_Core_Request::getPost('title'), Sohan_Core_Request::getPost('content')));\r\n header('Location: http://test-mvc.local/voidwalker/news/news/get');\r\n }", "public function add()\n\t{\n\t\tif ($this->model->addRecord()) {\n\t\t\treturn header('Location: /panel/works?page=1');\n\t\t}\n\t}", "function TableAddPage($header = true){\n $this->Draw_Table_Border();//draw the table border\n\n $this->End_Page_Border();//if there is a special handling for end page??? this is specific for me\n\n $this->AddPage($this->CurOrientation);//add a new page\n\n $this->Data_On_Current_Page = false;\n\n $this->table_startx = $this->GetX();\n $this->table_starty = $this->GetY();\n if ($header) $this ->Draw_Header();//if we have to draw the header!!! \n}", "public function indexAdd()\n\t{\n\t\t$this->commons->isAdmin();\n\t\t/*Get User name and role*/\n\t\t$data = $this->commons->getUser();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/settings.php';\n\t\t$data['lang']['settings'] = $settings;\n\n\t\t/**\n\t\t* Get all User data from DB using User model \n\t\t**/\n\n\t\t/* Set confirmation message if page submitted before */\n\t\tif (isset($this->session->data['message'])) {\n\t\t\t$data['message'] = $this->session->data['message'];\n\t\t\tunset($this->session->data['message']);\n\t\t}\n\t\t$data['result'] = NULL;\n\t\t$data['currency'] = $this->itemsModel->getCurrency();\n\t\t\n\t\t/* Set page title */\n\t\t$data['page_title'] = $data['lang']['settings']['text_new_item'];\n\t\t$data['action'] = URL.DIR_ROUTE.'item/action';\n\t\t$data['token'] = hash('sha512', TOKEN . TOKEN_SALT);\n\n\t\t/*Render User list view*/\n\t\t$this->view->render('items/items_form.tpl', $data);\n\t}", "public function add() {\n $data['tabel_pembelian'] = $this->tabel_pembelians->add();\n $data['action'] = 'save';\n $data['no_urut'] = $this->tabel_pembelians->no_urut();\n\n $this->template->display('tabel_pembelian/form', $data);\n }", "public function addAction()\n {\n $page = $this->di->get(\"page\");\n $title = \"Add question\";\n\n $page->add(\"cat/q/addQuestion\");\n\n return $page->render([\n \"title\" => $title,\n ]);\n }", "public function add()\n {\n $table = $this->loadModel();\n $tableAlias = $table->getAlias();\n $entity = $table->newEntity();\n $this->set($tableAlias, $entity);\n $this->set('tableAlias', $tableAlias);\n $this->set('_serialize', [$tableAlias, 'tableAlias']);\n $this->viewBuilder()->setLayout('admin');\n if (!$this->request->is('post')) {\n return;\n }\n $entity = $table->patchEntity($entity, $this->request->getData());\n // add the next line to allow role to be edited\n // see https://stackoverflow.com/questions/44912295/cakedc-users-new-role\n // and https://github.com/CakeDC/users/issues/513\n $entity->role = $this->request->getData('role');\n $singular = Inflector::singularize(Inflector::humanize($tableAlias));\n if ($table->save($entity)) {\n $this->Flash->success(__d('CakeDC/Users', 'The {0} has been saved', $singular));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__d('CakeDC/Users', 'The {0} could not be saved', $singular));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'updateArtistTemplate'
protected function updateArtistTemplateRequest($id, $artist_template_resource = null) { // verify the required parameter 'id' is set if ($id === null) { throw new \InvalidArgumentException('Missing the required parameter $id when calling updateArtistTemplate'); } $resourcePath = '/media/artists/templates/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath); } // body params $_tempBody = null; if (isset($artist_template_resource)) { $_tempBody = $artist_template_resource; } if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $query = \GuzzleHttp\Psr7\build_query($queryParams); $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); return new Request( 'PUT', $url, $headers, $httpBody ); }
[ "protected function getArtistTemplateRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getArtistTemplate');\n }\n\n $resourcePath = '/media/artists/templates/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "protected function getArtistTemplatesRequest($size = '25', $page = '1', $order = 'id:ASC')\n {\n\n $resourcePath = '/media/artists/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($size !== null) {\n $queryParams['size'] = ObjectSerializer::toQueryValue($size);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = ObjectSerializer::toQueryValue($page);\n }\n // query params\n if ($order !== null) {\n $queryParams['order'] = ObjectSerializer::toQueryValue($order);\n }\n\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "protected function updateArtistRequest($id, $artist_resource = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling updateArtist');\n }\n\n $resourcePath = '/media/artists/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\n\n // body params\n $_tempBody = null;\n if (isset($artist_resource)) {\n $_tempBody = $artist_resource;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'PUT',\n $url,\n $headers,\n $httpBody\n );\n }", "public function testUpdateTemplate()\n {\n }", "public function testCreateArtistTemplate()\n {\n }", "public function testUpdateArtist()\n {\n }", "public function testInventoryAttributeGroupTemplatePATCHRequestAttributeGroupTemplatesAttributeGroupTemplateIDUpdate()\n {\n }", "protected function songStationsPutRequest()\n {\n\n $resourcePath = '/Song/Station';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Api-Key');\n if ($apiKey !== null) {\n $headers['X-Api-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testUpdateObjectTemplate()\n {\n }", "public function resourceTemplateUpdate(Event $event){\n $em = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $entity = $event->getParam('entity');\n $request = $event->getParam('request');\n $operation = $request->getOperation();\n $error_store = $event->getParam('errorStore');\n\n if ($operation == 'update') {\n $resource_template_id = $request->getId();\n $resource_template = $em->getRepository('Omeka\\Entity\\ResourceTemplate')\n ->findOneBy(['id' => $resource_template_id]);\n\n $pre_teams = $em->getRepository('Teams\\Entity\\TeamResourceTemplate')\n ->findBy(['resource_template' => $resource_template_id]);\n\n foreach ($pre_teams as $pre_team):\n $em->remove($pre_team);\n endforeach;\n $em->flush();\n\n $teams = $em->getRepository('Teams\\Entity\\Team');\n foreach ($request->getContent()['o-module-teams:Team'] as $team_id):\n $team = $teams->findOneBy(['id'=>$team_id]);\n $trt = new TeamResourceTemplate($team,$resource_template);\n $em->persist($trt);\n endforeach;\n $em->flush();\n }\n }", "public function updateNewAction(\\PfarreNg\\Calmedia\\Domain\\Model\\Template $template){\n\t\t$this->update($template);\n\t\t \n\t\t$this->redirect('edit', null, null, array('template' => null));\n\t}", "public function createAction()\n {\n $entity = new Artist();\n $request = $this->getRequest();\n $form = $this->createForm(new ArtistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('artist_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('CoreTicketsBundle:Artist:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function updateSelectedContentSandwichArtist(array &$form, FormStateInterface $form_state) {\n $response = new AjaxResponse();\n\n $response->addCommand(new ReplaceCommand(\n '#content-sandwich-artist',\n $form['content_sandwich_artist_settings']\n ));\n\n return $response;\n }", "public function testUpdateTemplate0()\n {\n }", "public function testUpdateItemTemplate()\n {\n }", "public function testUpdateEntitlementTemplate()\n {\n }", "public function actionCreate() {\n $model = new Artist();\n\n// print_r(Yii::$app->request->post());\n// exit();\n if ($model->load(Yii::$app->request->post())) {\n\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->created_at = time();\n $model->updated_at = time();\n if ($model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "protected function updateObjectTemplateRequest($id, $template = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling updateObjectTemplate');\n }\n\n $resourcePath = '/objects/templates/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\n\n // body params\n $_tempBody = null;\n if (isset($template)) {\n $_tempBody = $template;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'PUT',\n $url,\n $headers,\n $httpBody\n );\n }", "protected function createAchievementTemplateRequest($template = null)\n {\n\n $resourcePath = '/achievements/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($template)) {\n $_tempBody = $template;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'POST',\n $url,\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get packageAddress value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getPackageAddress() { return isset($this->packageAddress) ? $this->packageAddress : null; }
[ "public function getAddress()\n {\n return isset($this->address) ? $this->address : null;\n }", "public function getStreetAddress()\n {\n if (array_key_exists(\"streetAddress\", $this->_propDict)) {\n return $this->_propDict[\"streetAddress\"];\n } else {\n return null;\n }\n }", "public function getIsAddress()\n {\n return isset($this->is_address) ? $this->is_address : false;\n }", "public function getPublicAddress()\n {\n if (array_key_exists(\"publicAddress\", $this->_propDict)) {\n return $this->_propDict[\"publicAddress\"];\n } else {\n return null;\n }\n }", "public function getIsDefaultAddress()\n {\n return $this->_fields['IsDefaultAddress']['FieldValue'];\n }", "function getAddress() {\n\t\treturn $this->getData('address');\n\t}", "public function getAddress() {\n /**\n * check address is equal to null\n */\n if (is_null ( $this->_address )) {\n /**\n * checking customer is logged in\n */\n if ($this->isCustomerLoggedIn ()) {\n $this->_address = $this->getQuote ()->getBillingAddress ();\n } else {\n $this->_address = Mage::getModel ( 'sales/quote_address' );\n }\n }\n \n return $this->_address;\n }", "public function hasAddress() {\n return !empty($this->has_address);\n }", "public function getAddressObject()\n\t{\n\n\t\treturn $this->address;\n\t}", "public function getPropertyAddress3()\n {\n return $this->propertyAddress3;\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "public function GetOrderAddressTest()\n {\n $data = $this->getOrderAddress();\n vd($data);\n }", "public function getDefaultDeliveryAddress() : ?string;", "public function getImAddress()\n {\n if (array_key_exists(\"imAddress\", $this->_propDict)) {\n return $this->_propDict[\"imAddress\"];\n } else {\n return null;\n }\n }", "public function getPropertyAddress1()\n {\n return $this->propertyAddress1;\n }", "public function getCompanyAddress(): AddressPT\n {\n \\Logger::getLogger(\\get_class($this))->info(__METHOD__);\n if (isset($this->companyAddress) === false) {\n $this->companyAddress = new AddressPT($this->getErrorRegistor());\n }\n return $this->companyAddress;\n }", "public function getAddressObject();", "public function getPropAddress5()\n {\n return $this->propAddress5;\n }", "public function getOrganisationAddress()\r\n {\r\n return $this->organisation_address;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Raid Volume Ports Properties
public function getStatisticsRaidVolumePortProperties($unit,$volume,$port){ return json_decode(self::getClient()->getStatisticsRaidVolumePortProperties($this->getDomain(),$unit,$volume,$port)); }
[ "public function getPorts()\r\r\n {\r\r\n return $this->data['port'];\r\r\n }", "function getVolumeSettings() {\n\t\t$volumes = array();\n\n\t\tif ( isset( $this->projectInfo[0]['info'] ) ) {\n\t\t\t$infos = $this->projectInfo[0]['info'];\n\n\t\t\t// first member is a count.\n\t\t\tarray_shift( $infos );\n\t\t\tforeach ( $infos as $info ) {\n\t\t\t\t$substrings=explode( '=', $info );\n\t\t\t\tif ( ( count( $substrings ) == 2 ) and ( $substrings[0] == 'use_volume' ) ) {\n\t\t\t\t\t$volumes[] = $substrings[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $volumes;\n\t}", "public function getPorts();", "public function getItemVolumes(): array\n {\n return $this->item_volumes;\n }", "public function remotePortDescription()\n {\n return $this->getSNMP()->subOidWalk(self::OID_LLDP_REM_PORT_DESC, 13);\n }", "public function getPorts()\n {\n if (array_key_exists(\"ports\", $this->_propDict)) {\n return $this->_propDict[\"ports\"];\n } else {\n return null;\n }\n }", "public function getChannelProperties() {\n return $this->channelProperties;\n}", "public function getPortProfile()\n {\n return $this->getXMLAsArray(\n 'alcatel_73xx_portprofile',\n array('spectrumprofile', 'serviceprofile', 'status', 'mode')\n );\n }", "function GetVolume() {\n\t\tif ( $this->debugging ) echo \"mpd->GetVolume()\\n\";\n\t\t$volLine = $this->SendCommand(MPD_CMD_STATUS);\n\t\tif ( ! $volLine ) {\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\tlist ($vol) = sscanf($volLine,\"volume: %d\");\n\t\t}\n\t\tif ( $this->debugging ) echo \"mpd->GetVolume() / return: $vol\\n\";\n\t\treturn $vol;\n\t}", "function getChannelProperties() {\n\t\t$this->checkChannel ();\n\t\t$basedir = $this->cfg ['root'] . \"/\" . $this->CHANNEL_PREFIX . $this->channel . \"/\";\n\t\t$dir = new FS_DirObject ( $basedir );\n\t\t$props = $dir->getProperties ();\n\t\t$dir = new FS_DirObject ( $basedir . 'image/' );\n\t\t$props ['image'] = $dir->getProperties ();\n\t\treturn $props;\n\t}", "public function getVolumes()\n {\n return $this->volumes;\n }", "public function GetUseAutoplayVolume(){\n $args=\"\";\n $filter=\"UseVolume\";\n return $this->BASE->Upnp($this->SERVICEURL,$this->SERVICE,'GetUseAutoplayVolume',$args,$filter);\n }", "public function _getDirectVol24(){\n return $this->_getMultiFullData('VOLUME24HOURTO');\n }", "public function getPortDescriptions()\n {\n return $this->getXMLChildsAsArray(\n 'alcatel_73xx_portlist', 'port',\n array('slot', 'port', 'admin-status', 'description')\n );\n }", "public function getVolume()\n {\n return $this->volume;\n }", "function readPcpInfo()\n{\n $params = readConfigParams(array('pcp_port'));\n return $params;\n}", "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 getPortList()\n {\n $value = $this->get(self::PORTLIST);\n return $value === null ? (string)$value : $value;\n }", "function zfs_volume_properties($uuid) {\n\tglobal $config;\n\t// get volume\n\tif (!(isset($config['zfs']) && isset($config['zfs']['volumes']) && isset($config['zfs']['volumes']['volume']) && is_array($config['zfs']['volumes']['volume']))) { return 1; }\n\tif (false === ($index = array_search_ex($uuid, $config['zfs']['volumes']['volume'], 'uuid'))) { return 1; }\n\t$volume = $config['zfs']['volumes']['volume'][$index];\n\tif (!is_array($volume)) { return 1; }\n\t// get pool name\n\tif (!(isset($volume['pool']) && is_array($volume['pool']) && (0 < count($volume['pool'])) && preg_match('/\\S/', $volume['pool'][0]))) { return 1; }\n\t$poolname = ltrim($volume['pool'][0]);\n\t// get volume name\n\tif (!(isset($volume['name']) && preg_match('/\\S/', $volume['name']))) { return 1; }\n\t$volumename = ltrim($volume['name']);\n\t$relpath = sprintf('%1$s/%2$s', $poolname, $volumename);\n\tif (isset($volume['volsize']) && !empty($volume['volsize'])) {\n\t\tif (false === ($reservation = zfs_get_volume_reservation($volume['volsize']))) { return 1; }\n\t}\n\t$result = 0;\n\tforeach (explode(' ', 'volsize sparse compression dedup sync atime volmode') as $attr) {\n\t\t$param = '';\n\t\tswitch ($attr) {\n\t\t\tcase 'volsize':\n\t\t\t\tif (isset($volume['volsize']) && !empty($volume['volsize']))\n\t\t\t\t\t$param = sprintf('volsize=%1$s', trim($volume['volsize']));\n\t\t\t\tbreak;\n\t\t\tcase 'sparse':\n\t\t\t\tif (isset($volume['sparse'])) {\n\t\t\t\t\t$param = 'refreservation=none';\n\t\t\t\t} elseif (isset($volume['volsize']) && !empty($volume['volsize'])) {\n\t\t\t\t\t$param = sprintf('refreservation=%1$s', trim($volume['volsize']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'compression':\n\t\t\t\tif (isset($volume['compression']) && preg_match('/\\S/', $volume['compression'])) {\n\t\t\t\t\t$param = sprintf('compression=%1$s', trim($volume['compression']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'dedup':\n\t\t\t\tif (isset($volume['dedup']) && preg_match('/\\S/', $volume['dedup'])) {\n\t\t\t\t\t$param = sprintf('dedup=%1$s', trim($volume['dedup']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'sync':\n\t\t\t\tif (isset($volume['sync']) && preg_match('/\\S/', $volume['sync'])) {\n\t\t\t\t\t$param = sprintf('sync=%1$s', trim($volume['sync']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'atime':\n\t\t\t\tif (isset($volume['atime']) && preg_match('/\\S/', $volume['atime'])) {\n\t\t\t\t\t$param = sprintf('atime=%1$s', trim($volume['atime']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'volmode':\n\t\t\t\tif (isset($volume['volmode']) && preg_match('/\\S/', $volume['volmode'])) {\n\t\t\t\t\t$param = sprintf('volmode=%1$s', trim($volume['volmode']));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\t\t\n\t\t// Update volume properties\n\t\tif (!empty($param)) {\n\t\t\t$cmd = sprintf('zfs set %1$s %2$s', $param, escapeshellarg($relpath));\n\t\t\twrite_log($cmd);\n\t\t\t$result |= mwexec($cmd, true);\n\t\t}\n\t}\n\treturn $result;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the model schemas of the polymorphic type.
public function getModelSchemas(): Collection { Utils::invariant( ! empty($this->modelSchemas), 'No model schemas defined on "'.get_class($this).'"' ); return collect($this->modelSchemas)->map(function (string $class) { return $this->registry->getModelSchema($class); }); }
[ "protected function makeModelSchemas()\n {\n $modelSchemas = new ModelSchemas();\n\n $this->modelReflections()->each(function(MezzoModelReflection $modelReflection) use ($modelSchemas){\n $modelSchemas->addSchema($modelReflection->schema());\n });\n\n\n return $modelSchemas;\n }", "public static function getSchemas()\n {\n return self::$schemas;\n }", "public function schemas(): HasMany\n {\n return $this->hasMany(Schema::class)->orderBy('id');\n }", "protected function allSchemas(): array\n {\n return [\n Comments\\CommentSchema::class,\n Images\\ImageSchema::class,\n Posts\\PostSchema::class,\n Tags\\TagSchema::class,\n Users\\UserSchema::class,\n Videos\\VideoSchema::class,\n ];\n }", "public function getSchemaByType($type);", "public function getSchemas(): array\n {\n return $this->schemas;\n }", "public function getSchemas()\n {\n if (!$this->schemas) {\n $schemas = $this->getAttachedSchemas();\n\n if ($this->owner->hasExtension('Hierarchy')) {\n $schemas->merge($this->getInheritedSchemas());\n $schemas->removeDuplicates();\n $schemas->sort('Title');\n }\n\n $this->schemas = $schemas;\n }\n\n return $this->schemas;\n }", "public function getPropelSchema()\n {\n if (is_null($this->propelSchemaArray)) {\n $this->loadSchemas();\n }\n \n return $this->propelSchemaArray;\n }", "function getSchemas(): array {\n return $this->schemas;\n }", "public function getSchemaTypes(): array;", "public function all(): array {\n $this->loadSchema('');\n\n return $this->schemas;\n }", "final public function relationSchemas()\n {\n if(!$this->relationSchemas)\n $this->relationSchemas = $this->makeRelationSchemas();\n\n return $this->relationSchemas;\n }", "function getSchemas() {\n\t\tglobal $conf;\n\n\t\tif (!$conf['show_system']) {\n\t\t\t$where = \"WHERE nspname NOT LIKE 'pg@_%' ESCAPE '@' AND nspname != 'information_schema'\";\n\t\t}\n\t\telse $where = \"WHERE nspname !~ '^pg_t(emp_[0-9]+|oast)$'\";\n\t\t$sql = \"\n\t\t\tSELECT pn.nspname, pu.usename AS nspowner,\n\t\t\t\tpg_catalog.obj_description(pn.oid, 'pg_namespace') AS nspcomment\n\t\t\tFROM pg_catalog.pg_namespace pn\n\t\t\t\tLEFT JOIN pg_catalog.pg_user pu ON (pn.nspowner = pu.usesysid)\n\t\t\t{$where}\n\t\t\tORDER BY nspname\";\n\n\t\treturn $this->selectSet($sql);\n\t}", "protected function makeRelationSchemas()\n {\n $modelSchemas = $this->makeModelSchemas();\n\n }", "public static function schema($model) {\n\t\t$self = get_called_class();\n\t\t$settings = static::settings($model);\n\t\t$schema = clone $model::schema();\n\t\tforeach ($settings['parents'] as $parent => $config) {\n\t\t\t$parentSchema = clone $parent::schema();\n\t\t\t$parentSchema->merge($schema);\n\t\t\t$schema = $parentSchema;\n\t\t}\n\t\treturn $schema;\n\t}", "public function getSchemaList()\n {\n $sql = \"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ '^pg_'\";\n $result_handler = pg_query($this->connection->getHandler(), $sql);\n $schemas = array();\n\n while ($schema = pg_fetch_assoc($result_handler))\n {\n $schemas[] = $schema['nspname'];\n }\n\n return $schemas;\n }", "public function getModelSchema(): ModelSchema\n {\n return $this->modelSchema;\n }", "private function getPropelSchema()\n {\n if (is_null($this->propel_schema)) $this->loadSchemas();\n \n return $this->propel_schema;\n }", "public function getSchemasCollection(): array\n {\n return $this->marketingCloud->request('GET', '/contacts/v1/schema');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a template with the given name exists in the 'pages' subdirectory of the templates directory.
private function templateExists($templateName) { if (substr($templateName, -1) === '/') { $templateName .= "index"; } $templateName = str_replace('..', '', $templateName); $templateNormalisedName = 'pages'.$templateName; $templatePathname = $this->jigConfig->getTemplatePath($templateNormalisedName); // Does the path match the file name of a template? if (file_exists($templatePathname) === true) { return $templateNormalisedName; } // Does the path with '/index' added match the file name of a template? $indexName = $templateNormalisedName."/index"; $templatePathname = $this->jigConfig->getTemplatePath($indexName); if (file_exists($templatePathname) === true) { return $indexName; } return false; }
[ "public function exists($name)\n {\n try\n {\n $this->findTemplate($name);\n\n return true;\n }\n catch (\\Exception $ex)\n {\n return false;\n }\n }", "public function exists($name)\n {\n try {\n $this->findTemplate($name);\n } catch (LoaderError $exception) {\n return false;\n }\n\n return true;\n }", "public function templateExists();", "public function exists()\n {\n try {\n ($this->engine->getResolveTemplatePath())($this->name);\n return true;\n } catch (TemplateNotFound $e) {\n return false;\n }\n }", "function tpl_exists($tpl){\n return file_exists(\"templates/\".$tpl);\n}", "public function existsTemplate()\n\t{\n\t\t$ext = NameManager::getTemplateExtension();\n\t\t$templateDir = PathManager::getViewTemplateDirectory();\n\t\t$template = $this->_template . '.' . $ext;\n\t\t$templatePath = $templateDir . '/' . $template;\n\t\t$exists = file_exists($templatePath);\n\t\treturn $exists;\n\t}", "public function templateExists(): bool;", "function checkIfTemplateExists() {\n\tif (!file_exists(TEMPLATE_FILE)) {\n\t\texit(COLOR_RED . \"[-] \" . COLOR_END . \"Unabled to find template file: \" . TEMPLATE_FILE . \"\\n\");\n\t}\n}", "public function templateExists($template);", "function template_exists($template) {\r\n\r\n\t\t\t$file = um_path . 'templates/' . $template . '.php';\r\n\t\t\t$theme_file = get_stylesheet_directory() . '/ultimate-member/templates/' . $template . '.php';\r\n\r\n\t\t\tif (file_exists($theme_file) || file_exists($file)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}", "public function template_exists($check)\n {\n foreach ($this->plugin_templates as $name => $path) {\n if ($name === $check) {\n return true;\n }\n }\n return false;\n }", "function has_custom_template($slug)\n{\n $customTemplate = trailingslashit(config('custom_page_template_path', 'pages')) . $slug . '.php';\n\n if (has_template($customTemplate)) {\n return $customTemplate;\n }\n\n return false;\n}", "function is_template($salles) {\n\tif(is_dir(\"/home/templates/\".$salles)) return true;\n}", "public function isTemplate($name)\n {\n return $this->template === $name;\n }", "function view_exists($view, $template='default') {\n\t\treturn is_file(APPPATH.'views/'.$template.'/pages/'.$view.EXT);\n\t}", "public function exists(string $name)\n {\n return isset($this->templateClasses[$name]);\n }", "function templateExists($resource_name)\n { \n // create template object\n $save = $this->template_objects;\n $tpl = new $this->template_class($resource_name, $this); \n // check if it does exists\n $result = $tpl->isExisting();\n $this->template_objects = $save;\n return $result;\n }", "function templateTypeExists($templateType) {\n\t\t\t\t\t$templateType = preg_replace('/^_[A-Z0-9\\/]+/i','',$templateType);\n\t\t\t\t\tif (!empty($templateType)) {\n\t\t\t\t\t\t$paths = \\Bonita\\Main::getPaths();\n\t\t\t\t\t\tforeach($paths as $basepath) {\n\t\t\t\t\t\t\t$path = $basepath . '/templates/'.$templateType.'/';\n\t\t\t\t\t\t\tif (file_exists($path)) return true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}", "function template_exists($template, $format=null)\n {\n if ($format === null) $format = $this->view_format;\n return file_exists(ROOT.\"/app/views/$template.$format.tpl\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation privateGetOrderHistoryByInstrumentGetAsync Retrieves history of orders that have been partially or fully filled.
public function privateGetOrderHistoryByInstrumentGetAsync($instrument_name, $count = null, $offset = null, $include_old = null, $include_unfilled = null) { return $this->privateGetOrderHistoryByInstrumentGetAsyncWithHttpInfo($instrument_name, $count, $offset, $include_old, $include_unfilled) ->then( function ($response) { return $response[0]; } ); }
[ "public function getOrderHistory()\n {\n $data = $this->request->getJSON(true);\n\n $orch_key = $data[\"orch_key\"] ?? null;\n\n if (is_null($orch_key)) {\n return $this->fail(\"The orchestrator key is needed.\", 404);\n }\n\n $orderHistoryModel = new OrderHistoryModel();\n\n $result = $orderHistoryModel->where('orch_key', $orch_key)\n ->orderBy('created_at', 'DESC')\n ->find();\n\n if ($result) {\n return $this->respond([\n \"status\" => true,\n \"data\" => $result,\n \"msg\" => \"Get order history method successful.\"\n ]);\n } else {\n return $this->respond([\n \"status\" => true,\n \"data\" => null,\n \"msg\" => \"Null if you wanna add a condition.\"\n ]);\n }\n }", "public function privateGetOrderHistoryByInstrumentGet($instrument_name, $count = null, $offset = null, $include_old = null, $include_unfilled = null)\n {\n list($response) = $this->privateGetOrderHistoryByInstrumentGetWithHttpInfo($instrument_name, $count, $offset, $include_old, $include_unfilled);\n return $response;\n }", "public function getHistory($orderId)\n {\n $sql = \"SELECT * FROM `rpay_ratepay_order_history`\"\n . \" WHERE `orderId`=? \"\n . \"ORDER BY `id` DESC\";\n $history = Shopware()->Db()->fetchAll($sql, array($orderId));\n\n return $history;\n }", "function getPaymentHistoryAll() {\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/payment/history\";\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $cartResponseObj = new CartResponseBuilder();\n $cartObj = $cartResponseObj->buildArrayResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $cartObj;\n }", "function get_order_history($order_id) {\r\n $command = \"account/getorderhistory\";\r\n $params = \"?orderid=\" . $order_id;\r\n $query = $command . $params;\r\n $result = make_private_api_call($query);\r\n \r\n return $result;\r\n}", "public function order_history() {\n\n\t\t$request = request();\n\t\t$store = Store::authUser()->first();\n\n\t\t$cancelled_completed_orders = Order::where('store_id', $store->id)->history(['cancelled', 'completed'])->orderBy('id', 'Desc')->get();\n\n\t\t$cancelled_completed_orders = $cancelled_completed_orders->map(\n\n\t\t\tfunction ($order, $key) {\n\n\t\t\t\tif ($order->status_text == \"completed\") {\n\t\t\t\t\t$order_time = $order->completed_at->format('Y-m-d h:i').trans('api_messages.monthandtime.'.$order->completed_at->format('a'));\n\n\t\t\t\t} else {\n\t\t\t\t\t$order_time = $order->updated_at->format('Y-m-d h:i').trans('api_messages.monthandtime.'.$order->updated_at->format('a'));\n\t\t\t\t}\n\n\t\t\t\treturn [\n\n\t\t\t\t\t'id' => $order->id,\n\t\t\t\t\t'order_item_count' => $order->order_item->count(),\n\t\t\t\t\t'user_name' => $order->user->name,\n\t\t\t\t\t'user_image' => $order->user->user_image_url,\n\t\t\t\t\t'status_text' => $order->status_text,\n\t\t\t\t\t'order_item_name' => count($order->order_item) > 0 ? $order->order_item->first()->menu_item->name : '',\n\t\t\t\t\t'order_time' => $order_time,\n\t\t\t\t\t'order_price' => $order->subtotal,\n\n\t\t\t\t];\n\t\t\t}\n\t\t) /*->groupBy('status_text')*/;\n\n\t\treturn response()->json(\n\t\t\t[\n\t\t\t\t'status_message' => \"Order history listed successfully\",\n\t\t\t\t'status_code' => '1',\n\t\t\t\t'order_history' => $cancelled_completed_orders,\n\t\t\t\t/*'cancelled_orders' => isset($cancelled_completed_orders['cancelled']) ? $cancelled_completed_orders['cancelled'] : [],\n 'completed_orders' => isset($cancelled_completed_orders['completed']) ? $cancelled_completed_orders['completed'] : [],*/\n\t\t\t]\n\t\t);\n\t}", "public function get_history()\n {\n $this->token_checker();\n\n $call = \"history\";\n $key = ($call.$this->_hash);\n $result = $this->_get_cache($key);\n\n if(!$result)\n {\n $this->_api_headers();\n $url = $this->_apiUrl .$call;\n $this->_call_api($url, 'GET');\n $result = $this->result;\n\n $this->_set_cache($key,$result);\n }\n return $result;\n }", "function order_history_get()\n {\n \t$data = array();\n \t$data[ getSysConfig( \"rest_response_field_name\" ) ] = cmn_vw_order_history( $this->cTable, $this->cAutoId, $this->customerId );\n \n \t$data[ getSysConfig( \"rest_status_field_name\" ) ] = \"success\";\n \t$data[ getSysConfig( \"rest_message_field_name\" ) ] = \"\";\n \t$this->response( $data, 200 );\n }", "public function getHistory () {}", "public function mc_issue_get_history($username, $password, integer $issue_id)\n {\n return $this->__soapCall(\n 'mc_issue_get_history',\n array($username, $password, $issue_id)\n );\n }", "public function getHistory()\n {\n \treturn $this->issueService->getIssueHistory($this->me());\n }", "function apptivo_orderHistory()\n{\n\t$account_id = is_apptivo_user_logged_in();\n\t$params = array( \"arg0\"=>APPTIVO_ECOMMERCE_API_KEY,\"arg1\"=>APPTIVO_ECOMMERCE_ACCESSKEY,\"arg2\"=>$account_id);\n\t$response = ecommerce_soap_call(CART_WSDL,'getAllOrderByFirmIdUserId',$params);\n\treturn $response;\n}", "public function getHistory();", "function GetHistory()\n\t{\n\t\treturn $this->_GetHistory($this->_arrServiceRecords);\n\t}", "public function getHistory()\n\t{\n\t\t$result = $this->getHistoryForYear(date('Y'));\n\t\t$orders = $result['orders'];\n\t\t\n\t\tforeach ($result['years'] as $year)\n\t\t{\n\t\t\t// Skip the year we already covered\n\t\t\tif ($year == date('Y'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$results = $this->getHistoryForYear($year);\n\t\t\t$orders = array_merge($orders, $results['orders']);\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function orderHistory()\n {\n $this->cors();\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n\n $token = $this->getRequestToken();\n $user = User::model()->findByToken($token);\n\n if($user) {\n $orders = Order::model()->findAll([\"user\" => $user->id]);\n foreach ($orders as $k => $v){\n $user = User::model()->find($v[\"user\"]);\n $orders[$k][\"userName\"] = $user->login;\n $auto = Auto::findById($v[\"auto\"]);\n $orders[$k][\"autoModel\"] = $auto[\"modelName\"];\n $orders[$k][\"autoBrand\"] = $auto[\"brands\"];\n }\n $this->sendResponse([\"success\" => 1, \"data\" => $orders]);\n }else{\n $this->sendResponse([\"success\" => 0, \"message\" => \"user not found\"]);\n }\n }", "public function getHistoryByPublicKey() {\n\t\t$timestamp = time() * 1000;\n\t\t$signature = $this->sign(self::from58($this->publicKey) . pack('J', $timestamp));\n\n\t\treturn $this->get(\"{$this->uri}/orderbook/{$this->publicKey}\", [\n\t\t\t'Timestamp' => (string)$timestamp,\n\t\t\t'Signature' => $signature\n\t\t]);\n\t}", "public function get_all_history()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/history/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No History\";\n }\n }", "public function getRealTimeHistory()\n {\n // Get Acquisitions Data\n if (!$this->hasILS()) {\n return [];\n }\n try {\n return $this->ils->getPurchaseHistory($this->getUniqueID());\n } catch (ILSException $e) {\n return [];\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Child classes should override this if attribute names diverge from keys used in array representations. Return a mapping of arrayKey => attributeName
protected static function keyToAttributeMapping() { return array(); }
[ "public function dotAttributeNames() : array\n {\n return array_merge(\n array_values(parent::fields()),\n array_keys(static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes))\n );\n }", "public function dotAttributeNames()\n {\n return array_merge(\n array_values(parent::fields()),\n array_keys(static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes))\n );\n }", "abstract public function attributeNames();", "public function changedAttributesName(): array\n {\n $changedAttributes = [];\n $attributes = $this->toArray();\n foreach ($attributes as $key => $value) {\n if (isset($this->originals[$key]) && $value !== $this->originals[$key] && ! ((is_array($this->originals[$key]) || is_object($this->originals[$key])))) {\n $changedAttributes[] = $key;\n }\n }\n return $changedAttributes;\n }", "public function arrayAttributesProvider() : array\n {\n return [\n [\n [\n 'title' => 'title_value',\n 'subject' => 'subject_value',\n 'number' => 16,\n 'class' => new \\stdClass(),\n 'float' => 14.40\n ]\n ]\n ];\n }", "public function getAttributesName()\n {\n return array_keys($this->attributes);\n }", "private function attrNames()\n {\n $dimAttr = [\n 'length' => 'length',\n 'width' => 'width',\n 'height' => 'height',\n ];\n $dsAttr = [\n 'dropship' => 'dropship',\n 'dropship_location' => 'dropship_location'\n ];\n\n $this->attrNames = ($this->mageVersion >= '2.2.5') ? $dsAttr : array_merge($dsAttr, $dimAttr);\n }", "public function attributeNames()\n\t{\n\t\t$className = get_class($this);\n\t\tif (isset(self::$_attributes[$className])) {\n\t\t\treturn self::$_attributes[$className];\n\t\t}\n\n\t\t$class = new \\ReflectionClass($this);\n\t\t$names = array();\n\t\tforeach ($class->getProperties(\\ReflectionProperty::IS_PUBLIC) as $property) {\n\t\t\t$name = $property->getName();\n\t\t\tif (!$property->isStatic()) {\n\t\t\t\t$names[] = $name;\n\t\t\t}\n\t\t}\n\t\treturn self::$_attributes[$className] = $names;\n\t}", "public function attributeNames()\n {\n $className = get_class($this);\n if (!isset(self::$_names[$className])) {\n $class = new ReflectionClass(get_class($this));\n $names = array();\n foreach ($class->getProperties() as $property) {\n $name = $property->getName();\n if ($property->isPublic() && !$property->isStatic())\n $names[] = $name;\n }\n return self::$_names[$className] = $names;\n } else\n return self::$_names[$className];\n }", "private function processArrayAttributes(&$attributes)\n {\n foreach ($this->rules() as $fieldName => $rule) {\n\n // Only process field names with array-dividers.\n if (strpos($fieldName, '.') > 0) {\n\n // Explode the field-name via the array-divider character '.'.\n $explodedFieldName = explode('.', $fieldName);\n\n // Find out attribute to use.\n // Array fields might come in 2 possible variants:\n // - The wanted attribute is the last element (e.g. [...]domainList.*.domainName)\n // - The wanted attribute is the last but one element (e.g. [...]domainName.*)\n // (In either case of the examples, the attribute should be 'domainName'.\n\n // In case of [...]domainList.*.domainName, the last element of $explodedFieldName is the attribute we want.\n $attribute = array_pop($explodedFieldName);\n\n // In case of [...]domainName.*, the one before the last is the attribute we want.\n if (is_numeric($attribute)) {\n $attribute = array_pop($explodedFieldName);\n }\n\n // Finally, if a translation for $attribute exits, we add the array-field-name with that translation.\n if (isset($attributes[$attribute])) {\n $attributes[$fieldName] = $attributes[$attribute];\n }\n }\n }\n }", "public function dotAttributes() : array\n {\n return array_merge(\n $this->attributes,\n static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes)\n );\n }", "public function attributeNames()\n\t{\n\t\t$className=get_class($this);\n\t\tif(!isset(self::$_names[$className]))\n\t\t{\n\t\t\t$class=new ReflectionClass(get_class($this));\n\t\t\t$names=array();\n\t\t\tforeach($class->getProperties() as $property)\n\t\t\t{\n\t\t\t\t$name=$property->getName();\n\t\t\t\tif($property->isPublic() && !$property->isStatic())\n\t\t\t\t\t$names[]=$name;\n\t\t\t}\n\t\t\treturn self::$_names[$className]=$names;\n\t\t}\n\t\telse\n\t\t\treturn self::$_names[$className];\n\t}", "public function attributeNames()\n\t{\n\t\t$className=get_class($this);\n\t\tif(!isset(self::$_names[$className]))\n\t\t{\n\t\t\t$class=new ReflectionClass(get_class($this));\n\t\t\t$names=array();\n\t\t\tforeach($class->getProperties() as $property)\n\t\t\t{\n\t\t\t\t$name=$property->getName();\n\t\t\t\tif($property->isPublic() && !$property->isStatic())\n\t\t\t\t$names[]=$name;\n\t\t\t}\n\t\t\treturn self::$_names[$className]=$names;\n\t\t}\n\t\telse\n\t\treturn self::$_names[$className];\n\t}", "public function compile_attributes_array(){\n\n $ret = [];\n\n foreach ( $this->atts as $name => $value ) {\n $ret[$name] = $this->attr_get( $name );\n }\n\n return $ret;\n }", "public function arrayAttributes()\n {\n return [];\n }", "public function keys() : array\n\t{\n\t\treturn $this->attribute->keys()->all();\n\t}", "public function toArrayWithAliases()\n {\n $r = $this->toArray();\n\n foreach ($this->getAliases() as $a => $k) {\n $r[$a] = $this->getAttribute($k);\n }\n\n return $r;\n }", "public function getLookupAttributeArray()\n {\n return $this->lookupAttributeArray;\n }", "public static function getNamesToArraySameKeyValue(){ \t\n \treturn array_combine(static::getNamesToArray(), static::getNamesToArray()); \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Okay I realize that Percentagize isn't really a word but this is so that the values we have will work with google charts.
function percentagizeArray($data,$max_value) { $new_data = array(); foreach($data as $point) { if( $max_value > 0 ) { $new_data[] = $point / $max_value * 100; } else { $new_data[] = 0; } } return $new_data; }
[ "public function getPercentMetricsToFormat()\n {\n return array(\n 'bounce_rate',\n 'conversion_rate',\n 'abandoned_rate',\n 'interaction_rate',\n 'exit_rate',\n 'bounce_rate_returning',\n 'nb_visits_percentage',\n '/.*_evolution/',\n '/goal_.*_conversion_rate/',\n '/form_.*_rate/',\n '/field_.*_rate/',\n );\n }", "public function getPercentage();", "private function percentOfTwoNumbers()\n {\n $val1 = $this->cleanupNumber($this->parsed[1]);\n $val2 = $this->cleanupNumber($this->parsed[3]);\n $percentage = ($val1 / $val2) * 100;\n $percentage = $this->formatNumber($percentage);\n\n $pincrease = ($val2 - $val1) / $val1 * 100;\n $pincrease = $this->formatNumber($pincrease);\n\n $pdecrease = ($val2 - $val1) / $val2 * 100;\n $pdecrease = $this->formatNumber($pdecrease);\n $lang = $this->lang;\n\n $values = [];\n $values[\"{$percentage}%\"] = sprintf($lang['result'], $val1, \"{$percentage}%\", $val2);\n $values[\"{$pincrease}%\"] = sprintf($lang['increase'], $val1, $val2, \"{$pincrease}%\");\n $values[\"{$pdecrease}%\"] = sprintf($lang['decrease'], $val2, $val1, \"{$pdecrease}%\");\n\n return $values;\n }", "public function changeToPercentage() {\n $dataArray = $this->reference->getReferenceArray('data', $this->referenceId);\n \n // Computes the sum\n foreach($dataArray as $data) {\n if (is_array($data)) {\n $dataToProcess = $data[0];\n } else {\n $dataToProcess = $data;\n }\n foreach($dataToProcess as $key => $value) {\n if (!isset($sum[$key])) {\n $sum[$key] = $value;\n } else {\n $sum[$key] += $value;\n }\n }\n }\n\n foreach($dataArray as $dataKey => $data) {\n if (is_array($data)) {\n $dataToProcess = $data[0];\n } else {\n $dataToProcess = $data;\n }\n foreach($dataToProcess as $key => $value) {\n $dataArray[$dataKey][0][$key] = $dataArray[$dataKey][0][$key] * 100 / $sum[$key];\n }\n }\n \n $this->reference->setReferenceArray(\n 'data',\n $this->referenceId,\n $dataArray\n );\n }", "public function getFillingPercentage();", "public function formatNumericValues()\n {\n $metricIsPercent = [];\n $resultsFields = ['results_districts', 'results_schools'];\n /** @var MetricsTable $metricsTable */\n $metricsTable = TableRegistry::getTableLocator()->get('Metrics');\n foreach ($resultsFields as $results) {\n foreach ($this->$results as &$subject) {\n foreach ($subject['statistics'] as &$statistic) {\n // Should this statistic be formatted as a percentage?\n $metricId = $statistic['metric_id'];\n if (!isset($metricIsPercent[$metricId])) {\n $metricIsPercent[$metricId] = $metricsTable->isPercentMetric($metricId);\n }\n\n // Percent values\n if ($metricIsPercent[$metricId]) {\n if (!Statistic::isPercentValue($statistic['value'])) {\n $statistic['value'] = Statistic::convertValueToPercent($statistic['value']);\n }\n continue;\n }\n\n // Non-percent numeric values\n if (is_numeric($statistic['value'])) {\n $statistic['value'] = number_format($statistic['value']);\n }\n }\n }\n }\n }", "function getDiscountPercent() ;", "public function getPercentages()\n {\n return $this->percentages;\n }", "private function calculate_percentage($data){\n $tot= $comp = 0;\n foreach($data as $row){\n $tot += $row['stot']; \n $comp += $row['ty'] + $row['tn']; \n }\n return round($comp / $tot * 100);\n }", "public function getTaxPercent();", "public function testGetPercent()\n {\n $this->assertSame(1000, (new Decimal(100))->getPercent(10)->getCents());\n $this->assertSame(3000, (new Decimal(100))->getPercent(30)->getCents());\n $this->assertSame(1875, (new Decimal(75))->getPercent(25)->getCents());\n $this->assertSame(263, (new Decimal(10.50))->getPercent(25)->getCents());\n $this->assertSame(0, (new Decimal(75))->getPercent(0)->getCents());\n }", "function percentatges($partits)\n{\n\t$puntsRep = $partits[1];\n\t$puntsDem = $partits[0] - $partits[1];\n\t$totalpunts = $partits[0];\n\n\t$pcntRep = (int)(($puntsRep * 100) / $totalpunts);\n\t$pcntDem = (int)(100 - $pcntRep);\n\t$percentatges = array($pcntDem,$pcntRep);\n\treturn $percentatges;\n}", "public function getIptPercent();", "public function normalizeValue()\n {\n if ($this->lowest === $this->highest && $this->value >= $this->highest) {\n return 100;\n }\n\n if ($this->lowest === $this->highest && $this->value < $this->highest) {\n return 0;\n }\n\n $percent = ($this->value - $this->lowest) / ($this->highest - $this->lowest);\n\n return number_format($percent * 100, 2);\n }", "private function calcPercents(): void\n {\n $index = $this->currentPhase . ($this->currentStep !== null ? \"_$this->currentStep\" : null) . ($this->currentSubStep !== null ? \"_$this->currentSubStep\" : null);\n\n $data = require 'progress.php';\n\n $percents = $data[$index];\n\n $this->percents = floor($percents);\n }", "protected function set_percentages($grouptinyvals = true) {\n $keystounset = Array();\n $other = Array();\n foreach ($this->datasets as $datasetkey=>$dataset) {\n $max = 0;\n foreach ($dataset as $data) {\n $max += (int)$data['value'];\n }\n foreach ($dataset as $key=>$data) {\n $percentage = round(($data['value']/$max)*100,2);\n if ($percentage<0.5 && strpos($data['label'],'2.0')===false) {\n $keystounset[] = Array('dataset'=>$datasetkey, 'key'=>$key);\n if (array_key_exists($datasetkey, $other)) {\n $other[$datasetkey]['value'] += $percentage;\n } else {\n $other[$datasetkey] = Array(\n 'value'=>$percentage,\n 'label'=>($data['label']=='')?'':'Other',\n 'datasetkey'=>$datasetkey);\n }\n\n }\n if ($percentage<0.5) {\n $percentage=0.5;\n }\n $this->datasets[$datasetkey][$key]['value'] = $percentage;\n }\n }\n if ($grouptinyvals===true && count($keystounset)>2) {\n foreach ($keystounset as $keys) {\n unset($this->datasets[$keys['dataset']][$keys['key']]);\n }\n foreach ($other as $otherset) {\n if ($otherset['value']<1.0) {\n $otherset['value'] = 1;\n }\n $key = $otherset['datasetkey'];\n $data['value'] = $otherset['value'];\n $data['label'] = $otherset['label'];\n $data['colour'] = null;\n array_unshift($this->datasets[$key],$data);\n }\n }\n return true;\n }", "public function getValuePercent()\n {\n return is_null($this->valuePercent) ? null : (float) $this->valuePercent;\n }", "public function getPercent()\n\t{\n\t\t$column = self::COL_PERCENT;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function setAnalyticsPercentage() {\n if ($this->isRow()) {\n foreach($this['columns'] as $column) {\n $column->responseAnalytics->calculatePercentage();\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Class destructor. Closes the cURL session and frees all resources.
public function __destruct() { curl_close($this->curl); }
[ "public function __destruct ()\n {\n curl_close($this->cURL);\n }", "public function __destruct()\n {\n if (isset($this->_curl)) {\n curl_close($this->_curl);\n unset($this->_curl);\n }\n }", "public function __destruct() {\n if ($this->Curl) curl_close($this->Curl);\n }", "public function __destruct() {\n if ($this->curl) {\n curl_close($this->curl);\n }\n }", "public function __destruct()\n {\n curl_close($this->curl);\n }", "public function __destruct()\n {\n curl_close($this->connection);\n }", "public function __destruct()\n {\n curl_close($this->ch);\n @unlink('/tmp/cluewikibot.cookies.' . $this->uid . '.dat');\n }", "function __destruct () {\n\t\t\tcurl_close( $this->ch );\n\t\t\t@unlink( '/tmp/cluewikibot.cookies.' . $this->uid . '.dat' );\n\t\t}", "function close()\n\t{\n\t\t//close curl session and free up resources\n\t\tcurl_close($this->ch);\n\t}", "public function __destruct()\r\n {\r\n curl_close($this->ch);\r\n }", "public function __destruct() {\n\t\tcurl_close($this->curlHandle);\n\t\t$this->log('Deleting cookie file (' . $this->cookieFilepath . ')', PEAR_LOG_DEBUG);\n\t\tunlink($this->cookieFilepath);\n\t}", "public function close()\n {\n if ($this->curl_connection)\n {\n curl_close($this->curl_connection);\n }\n // delete the temporary cookie file cURL used to stay logged in\n unlink (gcr::moodledataDir . 'sess_cookies.txt');\n }", "function __destruct() {\n if (is_resource($this->s)) {\n curl_close($this->s);\n }\n if (!$this->_cookiekeep && is_file($this->_cookieFileLocation)) {\n unlink($this->_cookieFileLocation);\n }\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "public function close() {\n\t\tcurl_close($this->curl);\n\t}", "private function close()\r\n {\r\n curl_close($this->curl);\r\n }", "public function closeCurl() {\r\n curl_close($this->curl);\r\n }", "public function closeCurl(){\n curl_close($this->curl);\n }", "private function close()\n {\n if (is_resource($this->curl)) {\n curl_close($this->curl);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setPanjInstListrikM() Set the value of [jml_inst_listrik] column.
public function setJmlInstListrik($v) { if ($v !== null && is_numeric($v)) { $v = (string) $v; } if ($this->jml_inst_listrik !== $v) { $this->jml_inst_listrik = $v; $this->modifiedColumns[] = RuangPeer::JML_INST_LISTRIK; } return $this; }
[ "public function getJmlInstListrik()\n {\n return $this->jml_inst_listrik;\n }", "public function getKetInstListrik()\n {\n return $this->ket_inst_listrik;\n }", "public function setSumberListrikId($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->sumber_listrik_id !== $v) {\n $this->sumber_listrik_id = $v;\n $this->modifiedColumns[] = SekolahLongitudinalPeer::SUMBER_LISTRIK_ID;\n }\n\n if ($this->aSumberListrik !== null && $this->aSumberListrik->getSumberListrikId() !== $v) {\n $this->aSumberListrik = null;\n }\n\n\n return $this;\n }", "public function filterByKetInstListrik($ketInstListrik = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ketInstListrik)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $ketInstListrik)) {\n $ketInstListrik = str_replace('*', '%', $ketInstListrik);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(RuangLongitudinalPeer::KET_INST_LISTRIK, $ketInstListrik, $comparison);\n }", "public function setImmat($immat)\r\n {\r\n $immat = substr_replace($immat,'-',2,0);\r\n $immat = substr_replace($immat,'-',6,0);\r\n $this->immat = $immat;\r\n }", "public function setJmlJambanLG($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->jml_jamban_l_g !== $v) {\n $this->jml_jamban_l_g = $v;\n $this->modifiedColumns[] = SanitasiPeer::JML_JAMBAN_L_G;\n }\n\n\n return $this;\n }", "public function setImei($val)\n {\n $this->_propDict[\"imei\"] = $val;\n return $this;\n }", "function setId_nom($iid_nom)\n {\n $this->iid_nom = $iid_nom;\n }", "public function setImmat($immat)\n {\n $immat = substr_replace($immat,'-',2,0);\n $immat = substr_replace($immat,'-',6,0);\n $this->immat = $immat;\n\n return $this;\n }", "public function setLuasTanahBukanMilik($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->luas_tanah_bukan_milik !== $v) {\n $this->luas_tanah_bukan_milik = $v;\n $this->modifiedColumns[SekolahTableMap::COL_LUAS_TANAH_BUKAN_MILIK] = true;\n }\n\n return $this;\n }", "public function lampiran_konflik(): HasMany\n {\n return $this->hasMany(LampiranKonflik::class);\n }", "function use_mml_icon($icon)\r\n {\r\n if (!is_string($icon) || (strlen($icon) != 2))\r\n die(\"invalid argument in use_mml_icon()\");\r\n\r\n $this->mml_icon = $icon;\r\n }", "public function setFieldMilage($fieldMilage)\n {\n $this->fieldMilage = (string) $fieldMilage;\n }", "public function setIhmIcon($icon);", "public function setPanjInstAirM($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->panj_inst_air_m !== $v) {\n $this->panj_inst_air_m = $v;\n $this->modifiedColumns[] = RuangPeer::PANJ_INST_AIR_M;\n }\n\n\n return $this;\n }", "public function setMpistSoil2($mpistSoil2) {\n\t\t$this->cMpistSoil2 = $mpistSoil2;\n\t}", "function setId_nom($iid_nom = '')\n {\n $this->iid_nom = $iid_nom;\n }", "public function setDayaListrik($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->daya_listrik !== $v) {\n $this->daya_listrik = $v;\n $this->modifiedColumns[] = SekolahLongitudinalPeer::DAYA_LISTRIK;\n }\n\n\n return $this;\n }", "function setISKLoss($isk)\n {\n $this->iskloss = $isk;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a form to edit an existing SwAmbiente entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('AmbientesCidmBundle:SwAmbiente')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find SwAmbiente entity.'); } $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return $this->render('AmbientesCidmBundle:SwAmbiente:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
[ "public function editAction()\n {\n $filtro = $this->getDoctrine()->getRepository('BackendBundle:FeastStage')->setFiltroByUser(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $artistas = $this->getDoctrine()->getRepository('BackendBundle:Artist')->getArtistasIds(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n $entity = $em->getRepository('BackendBundle:FeastStageArtist')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feaststageartist entity.');\n }\n $editForm = $this->createForm(new FeastStageArtistType($filtro, 'editar', $artistas, $entity->getDate()), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n );\n }", "public function editAction() {\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n\n $entity = $em->getRepository('BackendBundle:Feast')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feast entity.');\n }\n $editForm = $this->createForm(new \\CoolwayFestivales\\BackendBundle\\Form\\FeastType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n );\n }", "public function editAction() {\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n\n $entity = $em->getRepository('BackendBundle:Stage')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find stage entity.');\n }\n\n $editForm = $this->createForm(new StageType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n );\n }", "public function editAction($id) {\n $this->securityControle();\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('GestionBundle:Absence')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Absence entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('GestionBundle:Absence:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('CatMSAdminBundle:Seo')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Seo entity.');\r\n }\r\n\r\n $editForm = $this->createForm(new SeoType(), $entity);\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render(\r\n 'CatMSAdminBundle:Seo:edit.html.twig',\r\n array(\r\n 'entity' => $entity,\r\n 'edit_form' => $editForm->createView(),\r\n 'delete_form' => $deleteForm->createView(),\r\n )\r\n );\r\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DistribucionBundle:Satelite')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Satelite entity.');\n }\n\n $editForm = $this->createForm(new SateliteType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('DistribucionBundle:Satelite:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SheikhuLibraryBundle:MaisonEdition')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find MaisonEdition entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SheikhuLibraryBundle:MaisonEdition:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CineminoSiteBundle:TypeEvenement')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TypeEvenement entity.');\n }\n\n $editForm = $this->createForm(new TypeEvenementType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CineminoSiteBundle:TypeEvenement:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $manager = $this->container->get('zimzim_construction_site_actionitemmanager');\n $entity = $manager->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find AcmeAI entity.');\n }\n\n $editForm = $this->createEditForm($entity, $manager);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render(\n self::DIR.':edit.html.twig',\n array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n )\n );\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SiteNedraBundle:Programme')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Programme entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiteNedraBundle:Programme:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "function showEditForm()\n{\n global $app;\n\n $tpl = new acmsTemplate($this->templatePath . \"edit_form.tpl\");\n $tpl->assign(\"Action\", \"edit\");\n $tpl->assign(\"ChunkID\", $this->ChunkID);\n $tpl->assign(\"ChunkName\", $this->ChunkName);\n $tpl->assign(\"Chunk\", $this->Chunk);\n $tpl->assign(\"Title\", $this->Title);\n $tpl->assign(\"Perms\", $this->Perms);\n\n $app->addBlock(10, CONTENT_ZONE, \"Edit Menu\", $tpl->get());\n}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('keltanasTrackingBundle:Form')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Form entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('keltanasTrackingBundle:Form:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function actionEdit()\n\t{\n\t \t// render the template, pass model on render template\n \t$this->renderTemplate('weatheroots/_edit');\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EmisionesBundle:Aerolinea')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Aerolinea entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EmisionesBundle:Aerolinea:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FormationFrontBundle:Formation')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Formation entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FormationAdminBundle:Formation:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EmpleadoBundle:Empleado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Empleado entity.');\n }\n\n $editForm = $this->createForm(new EmpleadoType(), $entity);\n \n\n return $this->render('PanelBundle:Empleado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CumtsMainBundle:Show')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Show entity.');\n }\n\n $editForm = $this->createForm(new ShowType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CumtsAdminBundle:Show:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('PredDemandeBundle:Etablissement')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Etablissement entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('PredDemandeBundle:Etablissement:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:ModuleStage')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find ModuleStage entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BackendBundle:ModuleStage:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation journalEntriesPutJournalEntryAsyncWithHttpInfo Extended (Journal Entries) Edit a Journal Entry item
public function journalEntriesPutJournalEntryAsyncWithHttpInfo($org_code, $year, $period, $source, $entry_number, $data) { $returnType = '\FomF\Ungerboeck\Client\Model\JournalEntriesModel'; $request = $this->journalEntriesPutJournalEntryRequest($org_code, $year, $period, $source, $entry_number, $data); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $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(), $response->getBody() ); } ); }
[ "public function journalEntriesPostJournalEntryAsyncWithHttpInfo($data)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel';\n $request = $this->journalEntriesPostJournalEntryRequest($data);\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 journalEntriesPostJournalEntryWithHttpInfo($data)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel';\n $request = $this->journalEntriesPostJournalEntryRequest($data);\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 '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function journalEntriesAddAsyncWithHttpInfo($journal_entry, $raw = false, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null)\n {\n $returnType = '\\Apideck\\Client\\Model\\CreateJournalEntryResponse';\n $request = $this->journalEntriesAddRequest($journal_entry, $raw, $x_apideck_consumer_id, $x_apideck_app_id, $x_apideck_service_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }", "public function createGLJournalEntryAsyncWithHttpInfo($body = null, $command = null)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\PostJournalEntriesResponse';\n $request = $this->createGLJournalEntryRequest($body, $command);\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 journalEntriesPutJournalEntryWithHttpInfo($org_code, $year, $period, $source, $entry_number, $data)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel';\n $request = $this->journalEntriesPutJournalEntryRequest($org_code, $year, $period, $source, $entry_number, $data);\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 '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public static function addEditJournal(Journal $journal, AddEditJournalRequest $request)\n {\n \tDB::beginTransaction();\n \t\n \ttry {\n \t\t$journal->date = $request->get('date');\n \t\t$journal->journal_type_id = $request->get('type');\n \t\t$journal->entry = $request->get('entry');\n \t\t$journal->user_id = Auth::user()->id;\n\n \t\t$return['success'] = $journal->touch();\n\n \t\tif($return['success']) {\n \t\t\tDB::commit();\n \t\t} else {\n \t\t\tDB::rollback();\n \t\t}\n \t} catch(Excepton $e) {\n \t\tDB::rollback();\n \t\t$return['success'] = false;\t\n \t}\n\n \treturn $return;\n }", "public function journalEntriesPostJournalEntryAsync($data)\n {\n return $this->journalEntriesPostJournalEntryAsyncWithHttpInfo($data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function journalEntriesPostJournalEntry($data)\n {\n list($response) = $this->journalEntriesPostJournalEntryWithHttpInfo($data);\n return $response;\n }", "public function update(Entry $entry);", "public function setJournalEntryId($id)\n {\n return $this->setId('JournalEntry', $id);\n }", "public function journalEntriesUpdateRequest($id, $journal_entry, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $raw = false)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling journalEntriesUpdate'\n );\n }\n // verify the required parameter 'journal_entry' is set\n if ($journal_entry === null || (is_array($journal_entry) && count($journal_entry) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $journal_entry when calling journalEntriesUpdate'\n );\n }\n\n $resourcePath = '/accounting/journal-entries/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($raw !== null) {\n if('form' === 'form' && is_array($raw)) {\n foreach($raw as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['raw'] = $raw;\n }\n }\n\n // header params\n if ($x_apideck_consumer_id !== null) {\n $headerParams['x-apideck-consumer-id'] = ObjectSerializer::toHeaderValue($x_apideck_consumer_id);\n }\n // header params\n if ($x_apideck_app_id !== null) {\n $headerParams['x-apideck-app-id'] = ObjectSerializer::toHeaderValue($x_apideck_app_id);\n }\n // header params\n if ($x_apideck_service_id !== null) {\n $headerParams['x-apideck-service-id'] = ObjectSerializer::toHeaderValue($x_apideck_service_id);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($journal_entry)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($journal_entry));\n } else {\n $httpBody = $journal_entry;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = $this->config->getDefaultHeaders();\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 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function entryByRequestWithHttpInfo($context, $chain_id, $entry, $current_anchor_time = null)\n {\n // verify the required parameter 'context' is set\n if ($context === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $context when calling entryByRequest');\n }\n // verify the required parameter 'chain_id' is set\n if ($chain_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $chain_id when calling entryByRequest');\n }\n // verify the required parameter 'entry' is set\n if ($entry === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $entry when calling entryByRequest');\n }\n // parse inputs\n $resourcePath = \"/{context}/chains/{chainId}/entries/entry\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json;charset=UTF-8']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // query params\n if ($current_anchor_time !== null) {\n $queryParams['currentAnchorTime'] = $this->apiClient->getSerializer()->toQueryValue($current_anchor_time);\n }\n // path params\n if ($context !== null) {\n $resourcePath = str_replace(\n \"{\" . \"context\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($context),\n $resourcePath\n );\n }\n // path params\n if ($chain_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"chainId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($chain_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($entry)) {\n $_tempBody = $entry;\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 OAuth (access token)\n if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Sphereon\\SDK\\Blockchain\\Easy\\Model\\AnchoredEntryResponse',\n '/{context}/chains/{chainId}/entries/entry'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Sphereon\\SDK\\Blockchain\\Easy\\Model\\AnchoredEntryResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Sphereon\\SDK\\Blockchain\\Easy\\Model\\AnchoredEntryResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Sphereon\\SDK\\Blockchain\\Easy\\Model\\ErrorResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 404:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Sphereon\\SDK\\Blockchain\\Easy\\Model\\AnchoredEntryResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function UpdateEntry(\\Google\\Cloud\\DataCatalog\\V1\\UpdateEntryRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.datacatalog.v1.DataCatalog/UpdateEntry',\n $argument,\n ['\\Google\\Cloud\\DataCatalog\\V1\\Entry', 'decode'],\n $metadata, $options);\n }", "public function restNewslettersEntryIdPutAsyncWithHttpInfo($entry_id, $folder_id, $subject = null, $body = null, $kind = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Entry';\n $request = $this->restNewslettersEntryIdPutRequest($entry_id, $folder_id, $subject, $body, $kind);\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 = (string) $responseBody;\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 static function updateArticleJournal($event, $type, $object) {\n\t\t\n\t\t$options = [\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => \\Publication::SUBTYPE,\n\t\t\t'limit' => false,\n\t\t\t'metadata_name_value_pairs' => [\n\t\t\t\t'name' => 'pubtype',\n\t\t\t\t'value' => 'article_journal'\n\t\t\t],\n\t\t];\n\t\t$entities = new \\ElggBatch('elgg_get_entities_from_metadata', $options);\n\t\t$entities->setIncrementOffset(false);\n\t\tforeach ($entities as $entity) {\n\t\t\t// convert article_journal to article\n\t\t\t$entity->pubtype = 'article';\n\t\t\t$entity->save();\n\t\t}\n\t\t\n\t}", "public function test_edit_entry() {\n $this->resetAfterTest(true);\n $entryid = $this->create_entry();\n $entrydata = tool_sumitnegi\\api::get($entryid);\n $entrydata->completed = 1;\n $entrydata->name = \"Test Entry 001 V.1\";\n $entrydata->description = 'Dummy Description V.1';\n $entrydata->timemodified = time();\n tool_sumitnegi\\api::update($entrydata);\n $updatedentry = tool_sumitnegi\\api::get($entrydata->id);\n $this->assertEquals('Test Entry 001 V.1', $updatedentry->name, 'Name is not updated');\n $this->assertEquals(1, $updatedentry->completed, 'Completion is not updated');\n $this->assertEquals($entrydata->timemodified, $updatedentry->timemodified, 'Entry modification time is not updated');\n $this->assertEquals('Dummy Description V.1', $updatedentry->description);\n }", "public function journalEntriesGetJournalEntryListWithHttpInfo($org_code, $search)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel';\n $request = $this->journalEntriesGetJournalEntryListRequest($org_code, $search);\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 '\\FomF\\Ungerboeck\\Client\\Model\\JournalEntriesModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function journalEntriesGetJournalEntryAsync($org_code, $year, $period, $source, $entry_number)\n {\n return $this->journalEntriesGetJournalEntryAsyncWithHttpInfo($org_code, $year, $period, $source, $entry_number)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function ModifyEntryOverview(\\Google\\Cloud\\DataCatalog\\V1\\ModifyEntryOverviewRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.datacatalog.v1.DataCatalog/ModifyEntryOverview',\n $argument,\n ['\\Google\\Cloud\\DataCatalog\\V1\\EntryOverview', 'decode'],\n $metadata, $options);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Operation getListsOnlineWithHttpInfo Reads lists from the document.
private function getListsOnlineWithHttpInfo(Requests\getListsOnlineRequest $request) { $returnType = '\Aspose\Words\Model\ListsResponse'; $this->_checkAuthToken(); $req = $request->createRequest($this->config); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($req, $options); } catch (RequestException $e) { if ($e->getCode() == 401) { $this->_requestToken(); throw new RepeatRequestException("Request must be retried", 401, null, null); } else if ($e->getCode() < 200 || $e->getCode() > 299) { throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null); } } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); } $responseBody = $response->getBody(); if ($returnType === '\SplFileObject' || $returnType === 'FILES_COLLECTION') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } if ($this->config->getDebug()) { $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders())); } return [ ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\Words\Model\ListsResponse', $e->getResponseHeaders()); $e->setResponseObject($data); break; } throw $e; } }
[ "private function getListOnlineWithHttpInfo(Requests\\getListOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\ListResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\ListResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getListOnline(Requests\\getListOnlineRequest $request)\n {\n try {\n list($response) = $this->getListOnlineWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n \t\ttry {\n \tlist($response) = $this->getListOnlineWithHttpInfo($request);\n \treturn $response;\n \t}\n \tcatch(RepeatRequestException $e) {\n \tthrow new ApiException('Authorization failed', $e->getCode(), null, null);\n \t} \n } \n }", "public function getListsOnlineAsync(Requests\\getListsOnlineRequest $request) \n {\n return $this->getListsOnlineAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function updateListOnline(Requests\\updateListOnlineRequest $request)\n {\n try {\n list($response) = $this->updateListOnlineWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n \t\ttry {\n \tlist($response) = $this->updateListOnlineWithHttpInfo($request);\n \treturn $response;\n \t}\n \tcatch(RepeatRequestException $e) {\n \tthrow new ApiException('Authorization failed', $e->getCode(), null, null);\n \t} \n } \n }", "private function compareDocumentOnlineWithHttpInfo(Requests\\compareDocumentOnlineRequest $request)\n {\n $returnType = 'CompareDocumentOnlineResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $resp = $request->deserializeResponse($response);\n return [\n $resp,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), 'CompareDocumentOnlineResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function keywordListsGetWithHttpInfo($limit, $offset)\n {\n $request = $this->keywordListsGetRequest($limit, $offset);\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 $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\KeywordLists' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\KeywordLists', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\KeywordLists';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 '\\OpenAPI\\Client\\Model\\KeywordLists',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getDocumentPropertyOnlineWithHttpInfo(Requests\\getDocumentPropertyOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\DocumentPropertyResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\DocumentPropertyResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getStylesOnlineWithHttpInfo(Requests\\getStylesOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\StylesResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\StylesResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getStyleOnlineWithHttpInfo(Requests\\getStyleOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\StyleResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\StyleResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getBookmarksOnlineWithHttpInfo(Requests\\getBookmarksOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\BookmarksResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\BookmarksResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function updateFieldsOnlineWithHttpInfo(Requests\\updateFieldsOnlineRequest $request)\n {\n $returnType = 'UpdateFieldsOnlineResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $resp = $request->deserializeResponse($response);\n return [\n $resp,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), 'UpdateFieldsOnlineResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getDocumentStatisticsOnlineWithHttpInfo(Requests\\getDocumentStatisticsOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\StatDataResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\StatDataResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getParagraphsOnline(Requests\\getParagraphsOnlineRequest $request)\n {\n try {\n list($response) = $this->getParagraphsOnlineWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n \t\ttry {\n \tlist($response) = $this->getParagraphsOnlineWithHttpInfo($request);\n \treturn $response;\n \t}\n \tcatch(RepeatRequestException $e) {\n \tthrow new ApiException('Authorization failed', $e->getCode(), null, null);\n \t} \n } \n }", "private function insertListOnlineAsyncWithHttpInfo(Requests\\insertListOnlineRequest $request) \n {\n $returnType = 'InsertListOnlineResponse';\n $request = $request->createRequest($this->config);\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' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "public function insertListOnline(Requests\\insertListOnlineRequest $request)\n {\n try {\n list($response) = $this->insertListOnlineWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n \t\ttry {\n \tlist($response) = $this->insertListOnlineWithHttpInfo($request);\n \treturn $response;\n \t}\n \tcatch(RepeatRequestException $e) {\n \tthrow new ApiException('Authorization failed', $e->getCode(), null, null);\n \t} \n } \n }", "public function getStylesOnline(Requests\\getStylesOnlineRequest $request)\n {\n try {\n list($response) = $this->getStylesOnlineWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n \t\ttry {\n \tlist($response) = $this->getStylesOnlineWithHttpInfo($request);\n \treturn $response;\n \t}\n \tcatch(RepeatRequestException $e) {\n \tthrow new ApiException('Authorization failed', $e->getCode(), null, null);\n \t} \n } \n }", "private function getCommentsOnlineWithHttpInfo(Requests\\getCommentsOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\CommentsResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\CommentsResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private function getDocumentPropertiesOnlineAsyncWithHttpInfo(Requests\\getDocumentPropertiesOnlineRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\DocumentPropertiesResponse';\n $request = $request->createRequest($this->config);\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' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "private function getDocumentDrawingObjectByIndexOnlineWithHttpInfo(Requests\\getDocumentDrawingObjectByIndexOnlineRequest $request)\n {\n $returnType = '\\Aspose\\Words\\Model\\DrawingObjectResponse';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\Aspose\\Words\\Model\\DrawingObjectResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OneToMany (owning side) Get fkPpaAcaoNormas
public function getFkPpaAcaoNormas() { return $this->fkPpaAcaoNormas; }
[ "public function getFkNormasNorma()\n {\n return $this->fkNormasNorma;\n }", "public function getFkNormasNormaDetalheAl()\n {\n return $this->fkNormasNormaDetalheAl;\n }", "public function getFkNormasNorma1()\n {\n return $this->fkNormasNorma1;\n }", "public function getDirectoresPorPeliculas()\n {\n return $this->hasMany(DirectoresPorPelicula::className(), ['idpelicula' => 'id']);\n }", "public function getFkNormasLei()\n {\n return $this->fkNormasLei;\n }", "public function getFkNormasNormaCopiaDigital()\n {\n return $this->fkNormasNormaCopiaDigital;\n }", "public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }", "public function getFkTcernObraAcompanhamentos()\n {\n return $this->fkTcernObraAcompanhamentos;\n }", "public function getFkArrecadacaoParcelaDocumentos()\n {\n return $this->fkArrecadacaoParcelaDocumentos;\n }", "public function getIdpratos()\n {\n return $this->hasMany(Prato::className(), ['idprato' => 'idprato'])->viaTable('pratospedido', ['idpedido' => 'idpedido']);\n }", "public function getFkNormasTipoNorma()\n {\n return $this->fkNormasTipoNorma;\n }", "public function getFkOrganogramaOrgaoNiveis()\n {\n return $this->fkOrganogramaOrgaoNiveis;\n }", "public function getFkPessoalAssentamentoGeradoNormas()\n {\n return $this->fkPessoalAssentamentoGeradoNormas;\n }", "public function getFkPessoalAtributoContratoPensionistas()\n {\n return $this->fkPessoalAtributoContratoPensionistas;\n }", "public function getPrecios()\n {\n return $this->hasMany(Precios::className(), ['plataforma_id' => 'id'])->inverseOf('plataforma');\n }", "public function getFkPatrimonioBens()\n {\n return $this->fkPatrimonioBens;\n }", "public function getFkArrecadacaoParcelaProrrogacoes()\n {\n return $this->fkArrecadacaoParcelaProrrogacoes;\n }", "public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }", "public function getFkOrganogramaDeParaLocais()\n {\n return $this->fkOrganogramaDeParaLocais;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field comentario
public function getComentario() { return $this->comentario; }
[ "public function getComentario()\n {\n return $this->comentario;\n }", "public function getComentario() : string\n {\n return $this->comentario;\n }", "abstract public function getValor($campo);", "public function getValorStr()\r\n {\r\n if($this->valor !== null){\r\n return $this->valor->getModalidad();\r\n }\r\n return null;\r\n }", "public function getComunaOrigen()\n {\n return $this->comunaOrigen;\n }", "public function getComentari() { \n return $this->comentari; \n }", "function getFieldValue($field);", "public function getValor($filtro){\n\t\t\tswitch ($filtro) {\n\t\t\t\tcase 'idPersona':\n\t\t\t\t\treturn $this->idPersona;\n\t\t\t\t\tbreak;\t\t\n\t\t\t\tcase 'nombre':\n\t\t\t\t\treturn $this->nombre;\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'apellido':\n\t\t\t\t\treturn $this->apellido;\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t\tcase 'edad':\n\t\t\t\t\treturn $this->edad;\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'genero':\n\t\t\t\t\treturn $this->genero;\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'fechaNac':\n\t\t\t\t\treturn $this->fechaNac;\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'imagen':\n\t\t\t\t\treturn $this->imagen;\n\t\t\t\t\tbreak;\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn \"\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function getRecepcionComentario()\r\n {\r\n return $this->recepcion_comentario;\r\n }", "public function getDataCriado()\n {\n return $this->data_criado;\n }", "public function getCodigoComentario()\n {\n return $this->codigoComentario;\n }", "abstract public function tieneValor($campo);", "public function getCriado()\n {\n return $this->criado;\n }", "public function getData_cadastro()\n {\n return $this->data_cadastro;\n }", "function field($table, $condition, $nombre_field)\n {\n $field = NULL; //Valor por defecto\n $query = $this->db->query(\"SELECT {$nombre_field} FROM {$table} WHERE {$condition} LIMIT 1\");\n \n if ( $query->num_rows() > 0 ){ $field = $query->row()->$nombre_field; }\n \n return $field;\n }", "public function getValoracion()\r\n {\r\n return $this->valoracion;\r\n }", "function getComentario($id_comentario) {\n $sentencia = $this->db->prepare(\"SELECT comentario.* FROM comentario WHERE comentario.id_comentario = ?\");\n $sentencia->execute(array($id_comentario));\n $comentario = $sentencia->fetch(PDO::FETCH_ASSOC);\n return $comentario;\n }", "function getValue() {\n $value = parent::getValue();\n return $value == null ? \"\" : $value;\n }", "public function getValorDoacao()\n {\n return $this->valorDoacao;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a shortcode tag to format Paywall links within content and append tracking variable. Example Use: url = required url to link to title = required text to be hyperlinked [paywall url=" title="Article Title"]
function WBC3_paywall_shortcode( $atts ) { global $post; $defaults = array( 'title' => null, 'url' => null, ); extract( shortcode_atts( $defaults, $atts ) ); // check to make sure we have a valid company.com url and a title if( isset( $title ) && isset( $url ) && WBC3_is_valid_domain( $url ) ) { // remove existing query vars from url string $url_parts = explode( '?', $url ); $url = $url_parts[0]; // check for promo type $pcd = get_post_meta( $post->ID, 'WBC3_promo_type', true ); // append promo type tracking code if( isset( $pcd ) && ( $pcd !== 'default' ) ) { $url = add_query_arg( 'pcd', $pcd, $url ); } // output return '<a href="'. esc_url( $url ).'">'. esc_html( $title ).'</a>'; } }
[ "function add_url_shortcode( $atts, $content = null ){\n return '<a href=\"' . $atts['url'] . '\" >' . $content . '</a>';\n}", "function dsgvo_links_shortcode_2($atts, $content = null) {\r\r\n \r\r\n // Attribute aus dem Shortcode lesen und Platzhalter bereit stellen wenn nicht gesetzt\r\r\n extract(shortcode_atts( \r\r\n array(\r\r\n 'url' => '#',\r\r\n ), \r\r\n $atts ));\r\r\n \r\r\n // http und https entfernen\r\r\n $url = preg_replace('/http[s]*:\\/\\//i', '', esc_attr($url));\r\r\n \r\r\n // Einfuegen\r\r\n $returner = \"<span class='lnk_info' data-trgt='$url'>\".$content.\"</span>\";\r\r\n \r\r\n // Shortcode mit Inhalt zurueck geben\r\r\n return $returner;\r\r\n \r\r\n}", "function vimm_link_shortcode( $atts ){\n $defaults = array(\n 'by' => 'Developed By',\n 'url' => 'http://www.vimm.com',\n 'link' => 'Vivid Image'\n \n );\n $atts = shortcode_atts( $defaults, $atts );\n \n \n $output = $atts['by'] . ' <a href=\"' . $atts['url'].'\" target=\"blank\" />'. $atts['link'] . '</a>';\n return apply_filters( 'vimm_shortcode_link', $output, $atts );\n }", "function get_custom_field_wc_talk_url( $atts) { \n\tglobal $post; \n\n\t extract( shortcode_atts( array(\n\t 'meta' => '_wc_talks_url_meta_value_key'\n\t ), $atts ) );\n\n\t $custom_field_value1 = get_post_meta($post->ID, $meta, true); \n\n\t \n\t return '<a href=\"' . $custom_field_value1 . '\">' . $custom_field_value1 . '</a>'; \n\t}", "function power_footer_wordpress_link_shortcode( $atts ) {\n\n\t$defaults = [\n\t\t'after' => '',\n\t\t'before' => '',\n\t];\n\t$atts = shortcode_atts( $defaults, $atts, 'footer_wordpress_link' );\n\n\t$output = sprintf( '%s<a href=\"%s\">%s</a>%s', $atts['before'], 'https://wordpress.org/', 'WordPress', $atts['after'] );\n\n\treturn apply_filters( 'power_footer_wordpress_link_shortcode', $output, $atts );\n\n}", "function link_to_team_signup_form_fn( $atts ) {\r\n extract( shortcode_atts( array(\r\n\r\n 'text' => 'Start Conquering Javascript',\r\n 'url' => get_bloginfo('url') . '/teams/',\r\n ), $atts ) );\r\n\r\n\r\n return \"<a class='button' href='${url}'>${text}</a>\"; \r\n}", "function sj_facebook_shortcode( $atts, $content = 'Like us on Facebook' ){\n $sj_theme_opts = get_option('sj_opts');\n $atts = shortcode_atts( array(\n 'page' => $sj_theme_opts['facebook']\n ), $atts );\n\n return '<a href=\"http://facebook.com/'.$atts['page'].'\" class=\"btn bg-facebook btn-primary btn-sm\">\n ' . do_shortcode($content) . '\n </a>';\n}", "function slider_button($atts, $content = null) {\n extract(shortcode_atts(array('url' => '#'), $atts));\n return '<a class=\"btn\" href=\"'.$url.'\"><span>' . do_shortcode($content) . '</span></a>';\n}", "function gt_autologin_link($atts, $content = null) {\r\n \textract(shortcode_atts(array('link' => plugins_url('/gt-custom.php?gtlo' , __FILE__ )), $atts));\r\n \treturn '<a class=\"button\" href=\"'.$link.'\"><span>' . do_shortcode($content) . '</span></a>';\r\n }", "function schoollink($atts){\n\t\textract(shortcode_atts(\n\t\t\tarray(\n\t\t\t\t'linktitle' => 'Course Taken At', \t\t/* This is the default link title */\n\t\t\t\t'schoollink' => 'http://google.com'\t\t/* This is the link to the school website, by default it will go to google.com */\n\t\t\t),$atts\n\t\t));\n\t\treturn '<p class=\"the-link\"><a href=\"' . $schoollink . '\">' . $linktitle . '</a></p>'; /* This will display the link title and link to the school website */\n}", "function bubble( $atts, $content = ''){\n $values = shortcode_atts( array(\n 'title' => false,\n\t 'url' => false,\n\t 'image' => false\n ), $atts );\n\n\t$title = '';\n\tif($values['title']){\n\t\t$title = '<h3>' . $values['title'] . '</h3>';\n\t}\n\n\t$image = '';\n\tif($values['image']){\n\t\t$image = '<td class=\"bubble-image\">';\n\n\t\tif($values['url']){\n\t\t\t$image .= '<a href=\"' . $values['url'] . '\" target=\"_blank\">';\n\t\t}\n\n\t\t$image .= '<img src=\"' . $values['image'] . '\"/>';\n\n\t\tif($values['url']){\n\t\t\t$image .= '</a>';\n\t\t}\n\n\t\t$image .= '</td>';\n\t}\n\n return '<table class=\"bubble\"><tr>' . $image . '<td class=\"bubble-wrapper\"><div class=\"bubble-content\">' . $title . '<div class=\"bubble-text\">' . $content . '</div></div></td></tr></table>';\n}", "public function facebookpost_shortcode( $atts ){\r\n\t\t$url = $atts[0];\r\n\t\t$string = $this->embed_code( $url );\r\n\t\treturn $string;\r\n\t}", "private function addCampaignLinkTrack(&$activity_params) {\n try {\n //get Location and other information\n $other_data = BrowserInformationComponent::getClientInformation();\n\n //save_data to activity\n $insert_data = [\n \"account_id\" => $activity_params[\"account_id\"],\n \"user_id\" => $activity_params[\"user_id\"],\n \"record_id\" => $activity_params[\"record_id\"],\n \"sub_record_id\" => $activity_params[\"sub_record_id\"],\n \"account_contact_id\" => $activity_params[\"account_contact_id\"],\n \"action_id\" => SHAppComponent::getValue(\"actions/CAMPAIGNS/CLICKED\"),\n \"action_group_id\" => SHAPPComponent::getValue(\"actions/CAMPAIGNS/ACTION_GROUP_ID\"),\n \"created\" => DateTimeComponent::getDateTime(),\n \"other_data\" => json_encode($other_data)\n ];\n\n $this->insertActivity($insert_data);\n\n //Prepare text for display push notification\n $data = [\n \"action_id\" => $activity_params[\"action\"],\n \"stage\" => $activity_params[\"stage\"],\n \"entity\" => $activity_params[\"campaign_title\"],\n \"cname\" => $activity_params[\"cname\"],\n \"link\" => $activity_params[\"url\"]\n ];\n\n $notification_data = [\n \"title\" => self::NOTIFICATION_TITLE,\n \"message\" => $this->prepareDisplayText($data),\n \"enc_user_id\" => StringComponent::encodeRowId($activity_params[\"user_id\"])\n ];\n \n PushNotificationComponent::sendPushNotification($notification_data);\n\n } catch (\\Exception $e) {\n $this->prepareLog(\"Campaign email link tracking activity\", $activity_params, $e->getMessage()); \n }\n }", "function ag_lightbox( $atts, $content = null ) {\r\n extract(shortcode_atts(array(\r\n 'link'\t=> '#',\r\n ), $atts));\r\n\r\n\t$out = '<a rel=\"prettyPhoto\" href=\"' .$link. '\" class=\"lightboxhover\">' .do_shortcode($content). '</a>';\r\n\r\n return $out;\r\n}", "function hybrid_wp_link_shortcode() {\n\treturn '<a class=\"wp-link\" href=\"http://wordpress.org\" title=\"' . esc_attr__( 'State-of-the-art semantic personal publishing platform', 'hybrid-core' ) . '\"><span>' . __( 'WordPress', 'hybrid-core' ) . '</span></a>';\n}", "function track_shortcode($atts, $content=null){\n\textract(shortcode_atts(array(\n\t\t'kind' => '',\n\t\t'src' => '',\n\t\t'srclang' => '',\n\t\t'label' => '',\n\t\t'default' => ''\n\t), $atts));\n\t\n\tif($kind)\n\t\t$kind = \" kind='\" . $kind . \"'\";\n\t\n\tif($src)\n\t\t$src = \" src='\" . $src . \"'\";\n\t\n\tif($srclang)\n\t\t$srclang = \" srclang='\" . $srclang . \"'\";\n\t\n\tif($label)\n\t\t$label = \" label='\" . $label . \"'\";\n\t\n\tif($default == \"true\" || $default == \"default\")\n\t\t$default = \" default\";\n\telse\n\t\t$default = \"\";\n\t\n\t$track = \"\n\t\t<track\" . $kind . $src . $srclang . $label . $default . \" />\n\t\";\n\t\n\treturn $track;\n}", "function epfl_study_plan_process_shortcode( $atts, $content = null ) {\n\n $atts = shortcode_atts( array(\n 'plan' => ''\n ), $atts );\n $plan = sanitize_text_field($atts['plan']);\n\n $url = \"https://isa.epfl.ch/pe/\".$plan;\n ob_start();\n\n?>\n\n<div class=\"container my-3\">[remote_content url=\"<?PHP echo $url; ?>\" find=\"~content~\" replace=\"study-plan table-like\"]</div>\n\n<?php\n\n return do_shortcode(ob_get_clean());\n}", "public function polldaddy_shortcode( $atts ) {\n\t\t\tif ( ! is_array( $atts ) ) {\n\t\t\t\treturn '<!-- Polldaddy shortcode passed invalid attributes -->';\n\t\t\t}\n\n\t\t\t$atts['site'] = 'polldaddy.com';\n\t\t\treturn $this->crowdsignal_shortcode( $atts );\n\t\t}", "function ThinglinkShortCode($params = array()) {\n // default parameters\n\t$scene = $params[0];\n\t$parameters\t= shortcode_atts( array(\n\t\t'w' => isset( $content_width ) ? $content_width : 640\n\t\t), $params );\n\t$w = $parameters['w'];\n\n\t// Check if param is scene id\n\tif ( !preg_match( \"/^\\d+$/\" , $scene ) ) {\n\t\t// Check if param is of type http://www.thinglink.com/scene/<sceneid>\n\t\t$matches = array();\n\t\tif ( preg_match(\"/\\/scene\\/(\\d+)(?:\\D.*)?$/\", $scene, $matches ) && count( $matches ) == 2 )\n\t\t\t$scene = $matches[1] ;\n\t\telse\n\t\t\treturn \"<p> unknown thinglink object \" . esc_html($scene) . \"</p>\";\n\t}\n\treturn '<img src=\"' . esc_url( '//cdn.thinglink.me/api/image/' . $scene . '/230/230/none#tl-' . $scene . ';' ) . '\" width=\"' . esc_attr( $w ) . '\" class=\"alwaysThinglink\" />\n<script async charset=\"utf-8\" src=\"//cdn.thinglink.me/jse/embed.js\"></script>';\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function tests the replaceWikiLinks function in the Util class. It uses the testData in testUtilStrings_wikiLinks.txt and compares the output from the replaceWikiLinks function with the expected results in the testUtilStrings_wikiLinks_expectedResults.txt
function testReplaceWikiLinks() { $rows = count(file('test/pageSources/stringsWithWikiLinks.txt')); for ($x=0;$x<$rows;$x++) { $input = $this->getFileLine('test/pageSources/stringsWithWikiLinks.txt', $x); $input = Util::replaceWikiLinks($input); $expectedResult = $this->getFileLine('test/expectedResults/Util/stringsWithWikiLinks_expRes.txt', $x); $this->assertEqual($expectedResult, $input); } }
[ "public function substituteLinks ($text) {\n\t\tforeach ($this->links as $link) {\n\t\t\tif ($link[1] == '') {\n\t\t\t\t//TODO: offer an interwiki template\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$text = str_replace('[[' . $link[0] . '|', '[[' . $link[1] . '|', $text);\n\t\t\t\t$text = str_replace('[[' . $link[0] . ']]', '[[' . $link[1] . ']]', $text);\n\t\t\t\t$text = str_replace('[[' . $link[0] . '#', '[[' . $link[1] . '#', $text);\n\t\t\t\t$text = str_replace('[[' . lcfirst($link[0]) . '|', '[[' . lcfirst($link[1]) . '|', $text);\n\t\t\t\t$text = str_replace('[[' . lcfirst($link[0]) . ']]', '[[' . lcfirst($link[1]) . ']]', $text);\n\t\t\t\t$text = str_replace('[[' . lcfirst($link[0]) . '#', '[[' . lcfirst($link[1]) . '#', $text);\n\t\t\t}\n\t\t}\n\t\treturn $text;\n\t}", "public function DataForTestReplaceUrlsProvider() {\n $tests = array();\n\n $tests[] = array(\n 'to re and then so that we.',\n 'to re http://www.phpliveregex.com/ and then https://oscarotero.com/embed3/demo/index.php?url=https%3A%2F%2Ftwitter.com%2Fgoproject%2Fstatus%2F941051874282754048 so that we.',\n );\n\n $tests[] = array(\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance:',\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance: HTTP://t.co/RPwUa7fpks”',\n );\n $tests[] = array(\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance:',\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance: http://t.co/RPwUa7fpks”',\n );\n $tests[] = array(\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance:',\n '“Educational initiatives that include time in nature are shown to serve children\\'s physical and mental health as well as boost academic performance: https://t.co/RPwUa7fpks”',\n );\n\n return $tests;\n }", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "function processWikitext($wikilang, $text, $makelinks) {\r\n $result = $text;\r\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\r\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\r\n $wikiUrl = 'http://' . $wikilang . '.wikipedia.org/wiki/';\r\n $differentLinkReplace = \"'<a href=\\\"\" . $wikiUrl .\"' . rawurlencode('$1') . '\\\">$2</a>'\";\r\n $simpleLinkReplace = \"'<a href=\\\"\". $wikiUrl .\"' . rawurlencode('$1') . '\\\">$1</a>'\";\r\n if ( $makelinks ) {\r\n $result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\r\n $result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\r\n $result = $result;\r\n } else {\r\n $result = preg_replace($differentLinkRegex, \"$2\", $result);\r\n $result = preg_replace($simpleLinkRegex, \"$1\", $result);\r\n }\r\n return $result;\r\n}", "public function testSafeHtmlToNormalHtml(): void\n {\n $testData = $this->getHtmlMarkupTestData();\n /** @var LoggerInterface $logger */\n $logger = $this->createMock(LoggerInterface::class);\n $sut = new WikiParserProvider($logger);\n\n foreach ($testData as $entry) {\n $output = $sut->safeHtmlToNormalHtml($entry['safeHtml']);\n self::assertSame($entry['normalHtml'], $output);\n }\n }", "public static function replaceWikiLinks($text) {\r\n $text = preg_replace_callback(\"/\\[\\[([^|]*?)(\\|.*?)?\\]\\]/\",'Util::getLabelForLink', $text);\r\n return $text;\r\n }", "function replace_wiki_links( $p_string, $p_include_anchor = true ) {\n\t\t$t_default_url = plugin_config_get( 'wikiUrl' );\n\n\t\t// look for interwiki links [[key:value]]\n\t\t$t_interwiki = $this->interwikiConfig();\n\n\t\t// now replace wiki links [[...]] by the URL\n\t\t$t_result = preg_replace_callback(\n\t\t\t'/\\[\\[([^\\]]+)\\]\\]/i',\n\t\t\tfunction ($match) use ($t_default_url, $t_interwiki, $p_include_anchor) {\n\t\t\t\t$t_text = $match[1];\n\t\t\t\t$t_id = $match[1];\n\t\t\t\t$t_url = $t_default_url;\n\t\t\t\t\n\t\t\t\t// check if text was given separately by \"|\"\n\t\t\t\t$t_kv = explode('|', $t_text, 2);\n\t\t\t\tif( count($t_kv) > 1 ) {\n\t\t\t\t\t$t_id = $t_kv[0];\n\t\t\t\t\t$t_text = $t_kv[1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check interwiki prefix\n\t\t\t\t$t_kv = explode(':', $t_id, 2);\n\t\t\t\tif( count($t_kv) > 1 && $t_interwiki[$t_kv[0]] ) {\n\t\t\t\t\t// it has a \"interwiki:\" prefix -> use replacement from interwiki table\n\t\t\t\t\t$t_url = $t_interwiki[$t_kv[0]];\n\t\t\t\t\t$t_id = $t_kv[1];\n\t\t\t\t\t// keep the prefix in the text?\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// format url\n\t\t\t\t$t_urlplaceholder = explode('*', $t_url, 2);\n\t\t\t\tif( count($t_urlplaceholder) > 1 ) {\n\t\t\t\t\t$t_url = $t_urlplaceholder[0] . $t_id . $t_urlplaceholder[1];\n\t\t\t\t} else {\n\t\t\t\t\t$t_url .= $t_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $p_include_anchor ) {\n\t\t\t\t\treturn '<a href=\"' . $t_url . '\" target=\"_new\">' . $t_text. '</a>';\n\t\t\t\t} else {\n\t\t\t\t\treturn $t_url;\n\t\t\t\t}\n\t\t\t}, $p_string );\n\n\t\treturn $t_result;\n\t}", "public function testHtmlToSafeHtml(): void\n {\n $testData = $this->getHtmlMarkupTestData();\n /** @var LoggerInterface $logger */\n $logger = $this->createMock(LoggerInterface::class);\n $sut = new WikiParserProvider($logger);\n\n foreach ($testData as $entry) {\n $output = $sut->htmlToSafeHtml($entry['input']);\n self::assertSame($entry['safeHtml'], $output);\n }\n }", "function processWikitext($wikilang, $text, $makelinks, $wikiproject = \"wikipedia\") {\n\n\t/**\n\t * Mapping of multilingual sites not following the lang.project.org pattern\n\t */\n\tstatic $multilingualSiteMap = [\n\t\t'commons' => 'commons.wikimedia.org',\n\t\t'wikidata' => 'www.wikidata.org',\n\t];\n\n\t$result = $text;\n\t$differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\n\t$simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\n\tif ( array_key_exists( $wikiproject, $multilingualSiteMap ) ) {\n\t\t$wikiUrl = '//' . $multilingualSiteMap[ $wikiproject ] . '/wiki/';\n\t} else {\n\t\t$wikiUrl = '//' . $wikilang . '.' . $wikiproject . '.org/wiki/';\n\t}\n\t$differentLinkReplace = function($m) use($wikiUrl) {\n\t\treturn '<a href=\"' . $wikiUrl . rawurlencode( $m[1] ) . '\">'. $m[2] .'</a>';\n\t};\n\t$simpleLinkReplace = function($m) use($wikiUrl) {\n\t\treturn '<a href=\"' . $wikiUrl . rawurlencode( $m[1] ) . '\">'. $m[1] .'</a>';\n\t};\n\tif ( $makelinks ) {\n\t\t$result = preg_replace_callback(\n\t\t\t$differentLinkRegex,\n\t\t\t$differentLinkReplace,\n\t\t\t$result);\n\t\t$result = preg_replace_callback(\n\t\t\t$simpleLinkRegex,\n\t\t\t$simpleLinkReplace,\n\t\t\t$result);\n\t\t$result = $result;\n\t} else {\n\t\t$result = preg_replace($differentLinkRegex, \"$2\", $result);\n\t\t$result = preg_replace($simpleLinkRegex, \"$1\", $result);\n\t}\n\treturn $result;\n}", "function substitueURLs($myText,$substitute=\"Link...\",$urlPrefix=\"http\")\r\n{\r\n $retVal = $myText;\r\n $amEnde = false;\r\n $tempMarker = \"|+++++|\";\r\n $durchlauf = 1;\r\n\r\n // echo_pre(string_char_codes($myText));\r\n\r\n while ((!$amEnde)&&($durchlauf<9999))\r\n {\r\n // URLS UMSETZEN IN WEB LINK ICONS\r\n $urlFound = getURL($retVal,$urlPrefix);\r\n\r\n if ($urlFound)\r\n {\r\n // IN RUECKGABE DEN LINKSUBSTITUTE EINBAUEN UND SUBSTITUTE UNKENNTLICH MACHEN IN DIESEM TEIL\r\n // DAMIT DIESER NICHT MEHR REPLACED WIRD, GILT AUCH FUER SUBSTITUTE DER EIN BILD MIT HTTP TAG SEIN KANN\r\n $retVal = str_replace($urlFound,\"<a href='\".\r\n str_replace($urlPrefix,$tempMarker,$urlFound).\"' target=_blank>\".\r\n str_replace($urlPrefix,$tempMarker,$substitute).\"</a>\",$retVal);\r\n }\r\n else\r\n $amEnde = true;\r\n\r\n $durchlauf++;\r\n }\r\n\r\n return str_replace($tempMarker,$urlPrefix,$retVal);\r\n}", "public static function replace_links($text){\n\t\t//TODO: accept urls without www as well.\n\t\t$urlRegex = \"\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))\";\n\t\t$urlMarkdownRegex = \"\\[.+\\]\\<\".$urlRegex.\"\\>\";\n\n\t\t$urlMarkdownMatches = array();\n\t\tpreg_match_all(\"#\".$urlMarkdownRegex.\"#\",\n\t\t\t$text, $urlMarkdownMatches, PREG_PATTERN_ORDER);\n\n\t\t// //make sure there are the same number of urls as matches\n\t\t// $urls = array();\n\t\t// preg_match_all(\"#\".$urlRegex.\"#\",\n\t\t// \t$input, $urls, PREG_PATTERN_ORDER);\t\t\n\n\t\t// if(count($urlMarkdownMatches[0]) != count($urls[0])){\n\t\t// \tthrow new Exception(\"I found \".(count($urls[0]) - count($urlMarkdownMatches[0])).\" URLs with improper syntax.<br/>To include a link, use &#91;name&#93;&#60;url&#62;<br/>Example: &#91;search&#93;&#60;www.google.com&#62;\");\n\t\t// }\n\n\t\tforeach($urlMarkdownMatches[0] as $urlMarkdownMatch){\n\t\t\t$divider = strpos($urlMarkdownMatch, \"]<\");\n\t\t\t//get the name\n\t\t\t$name = substr($urlMarkdownMatch, 1, $divider - 1);\n\t\t\t//get the url\n\t\t\t$url = substr($urlMarkdownMatch, $divider + 2, strlen($urlMarkdownMatch) - $divider - 3);\n\t\t\t$urlPrefix = substr($url,0,7);\n\t\t\tif(strcmp($urlPrefix,\"http://\")){\n\t\t\t\tif(strcmp($urlPrefix,\"https://\")){\n\t\t\t\t\t$url = \"http://\".$url;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//find where $urlMarkdownMatch starts\n\t\t\t$text = str_replace($urlMarkdownMatch,'<a href=\"'.$url.'\">'.$name.'</a>', $text);\n\t\t}\n\n\t\treturn $text;\n\t}", "function wikiLinks($page) {\r\n\tif(preg_match_all('/\\[([^\\]]+?)\\]/', $page, $matches, PREG_SET_ORDER)) {\r\n\t\tforeach($matches as $match) {\r\n\t\t\t$page = str_replace($match[0], '<a href=\"' . $_SERVER['SCRIPT_NAME'] . '?page=' . urlencode($match[1]) . '\">' . htmlentities($match[1]) . '</a>', $page);\r\n\t\t}\r\n\t}\r\n}", "public static function alterLinks()\n {\n //--------------------------------------------\n // BELOW IS A SNIPPET I USED TO ALTER THE UNIVERSE STRUCTURE...,\n // I KEEP IT AS A MEMO JUST IN CASE...\n //--------------------------------------------\n ini_set('max_execution_time', 0);\n $lingDir = \"/myphp/universe/Ling\";\n $files = YorgDirScannerTool::getFiles($lingDir, true);\n foreach ($files as $file) {\n $content = file_get_contents($file);\n if (preg_match('!https://github\\.com/karayabin/universe-snapshot/(tree|blob)/master/universe/([a-zA-Z0-9_]*)!', $content, $match)) {\n $newContent = preg_replace('!https://github\\.com/karayabin/universe-snapshot/(tree|blob)/master/universe/([a-zA-Z0-9_]*)!',\n 'https://github.com/karayabin/universe-snapshot/$1/master/universe/Ling/$2', $content);\n FileSystemTool::mkfile($file, $newContent);\n }\n }\n }", "function replace($repl) {\n\tglobal $content;\n\tglobal $webproxy;\n\tglobal $baseurl;\n\t$content = str_replace($repl . '//', $repl . $webproxy . 'https://', $content);\n\t$content = str_replace($repl . '/', $repl . $webproxy . $baseurl . '/', $content);\n}", "public function replaceAnchorsWithText($data){\n\t\t/*$matches = array ();\n\t\t$regex = '/href=[\\'\"]+?\\s*(?P<link>\\S+)\\s*[\\'\"]+?/i';\n\t\t$count = preg_match_all ( $regex, $data, $matches );\n\n\t\tif ($count and isset ( $matches ['link'] )) {\n\t\t\tforeach ( $matches ['link'] as $i => $v ) {\n\t\t\t\t$v = str_replace ( '_', '-', strtolower ( $v ) );\n\t\t\t\t$param = array ('action' => $v, 'module' => DEFAULT_MODULE, 'controller' => 'index' );\n\t\t\t\t$find [] = '/' . $matches [0] [$i] . '/';\n\t\t\t\t$replace [] = 'href=\"' . $this->_view->url ( $param, FRONT_MENU_ROUTE ) . '\"';\n\t\t\t}\n\n\t\t\t$res = preg_replace ( $find, $replace, $data );\n\t\t} else {\n\t\t\t$res = $data;\n\t\t}\n\n\t\treturn $res;\n\t\t*/\n\t\treturn $data;\n\t}", "public function testGuiLink() {\n\t\t$url = new URL('http://example.com/www/html/7-home-page.asp');\n\t\t$link = $url->translate(\"http://example.com/www/default.asp?guiValue=22B33E10-E6E9-44A4-9910-4DD5DC2B5544\");\n\t\t$this->assertSame('http://example.com/www/default.asp?guiValue=22B33E10-E6E9-44A4-9910-4DD5DC2B5544', $link);\n\t}", "public function test_encode_content_links_encodes_mod_vocabcards_index_url() {\n global $CFG;\n $link = $CFG->wwwroot . '/mod/vocabcards/index.php?id=123';\n $content = '<p>hello</p><a href=\"' . $link . '\">click here</a><p>world</p>';\n $result = backup_vocabcards_activity_task::encode_content_links($content);\n $encoded_link = '$@VOCABCARDSINDEX*123@$';\n $this->assertSame('<p>hello</p><a href=\"' . $encoded_link . '\">click here</a><p>world</p>', $result);\n }", "function replaceExistingPlaceHolders(\n $currEnreg, /* source array where real value are stored*/\n $stitleclean, /* title prepared for url query*/\n $url, /*stringvalue with placeholders*/\n $urlencoded = FALSE /*encode url*/) {\n\n $urlWithRealVal = $url;\n\n $illinkidUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['illinkid']))) : stripslashes($currEnreg['illinkid']);\n $urlWithRealVal = str_replace(\"XPIDX\", $illinkidUrl, $urlWithRealVal);\n\n $doiUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['doi']))) : stripslashes($currEnreg['doi']);\n $urlWithRealVal = str_replace(\"XDOIX\", $doiUrl, $urlWithRealVal);\n\n $pmidUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['PMID']))) : stripslashes($currEnreg['PMID']);\n $urlWithRealVal = str_replace(\"XPMIDX\", $pmidUrl,$urlWithRealVal);\n\n $genreUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['type_doc']))) : stripslashes($currEnreg['type_doc']);\n $urlWithRealVal = str_replace(\"XGENREX\", $genreUrl, $urlWithRealVal);\n\n $auteursUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['auteurs']))) : stripslashes($currEnreg['auteurs']);\n $urlWithRealVal = str_replace(\"XAULASTX\", $auteursUrl, $urlWithRealVal);\n\n $issnUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['issn']))) : stripslashes($currEnreg['issn']);\n $urlWithRealVal = str_replace(\"XISSNX\", $issnUrl, $urlWithRealVal);\n\n $eissnUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['eissn']))) : stripslashes($currEnreg['eissn']);\n $urlWithRealVal = str_replace(\"XEISSNX\", $eissnUrl, $urlWithRealVal);\n\n $isbnUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['isbn']))) : stripslashes($currEnreg['isbn']);\n $urlWithRealVal = str_replace(\"XISBNX\", $isbnUrl, $urlWithRealVal);\n\n $titleUrl = $urlencoded? urlencode(stripslashes(utf8_decode($stitleclean))): stripslashes($stitleclean);\n $urlWithRealVal = str_replace(\"XTITLEX\", $titleUrl, $urlWithRealVal);\n\n $atitleUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['titre_article']))) : stripslashes($currEnreg['titre_article']);\n $urlWithRealVal = str_replace(\"XATITLEX\", $atitleUrl, $urlWithRealVal);\n\n $volumeUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['volume']))) : stripslashes($currEnreg['volume']);\n $urlWithRealVal = str_replace(\"XVOLUMEX\", $volumeUrl, $urlWithRealVal);\n\n $numeroUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['numero']))) : stripslashes($currEnreg['numero']);\n $urlWithRealVal = str_replace(\"XISSUEX\", $numeroUrl, $urlWithRealVal);\n\n $pagesUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['pages']))) : stripslashes($currEnreg['pages']);\n $urlWithRealVal = str_replace(\"XPAGESX\", $pagesUrl, $urlWithRealVal);\n\n $anneeUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['annee']))) : stripslashes($currEnreg['annee']);\n $urlWithRealVal = str_replace(\"XDATEX\", $anneeUrl, $urlWithRealVal);\n\n $fullnameUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['nom'] . \", \" . $currEnreg['prenom']))) : stripslashes(($currEnreg['nom'] . \", \" . $currEnreg['prenom']));\n $urlWithRealVal = str_replace(\"XNAMEX\", $fullnameUrl, $urlWithRealVal);\n //TODO nouveau placeholder à valider avec Pablo\n\n $nomUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['nom']))) : stripslashes($currEnreg['nom']);\n $urlWithRealVal = str_replace(\"XNOMX\", $nomUrl, $urlWithRealVal);\n //TODO nouveau placeholder à valider avec Pablo\n\n\n $prenomUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['prenom']))) : stripslashes($currEnreg['prenom']);\n $urlWithRealVal = str_replace(\"XPRENOMX\", $prenomUrl, $urlWithRealVal);\n //TODO nouveau placeholder à valider avec Pablo\n\n $uidUrl = $urlencoded? urlencode(stripslashes(utf8_decode($currEnreg['uid']))) : stripslashes($currEnreg['uid']);\n $urlWithRealVal = str_replace(\"XUIDX\", $uidUrl, $urlWithRealVal);\n /*\n if ($urlencoded){\n $urlWithRealVal = urlencode(htmlentities($urlWithRealVal));\n }\n */\n \n return $urlWithRealVal;\n}", "function replaceLinks($text)\n{\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n preg_match_all($reg_exUrl, $text, $matches);\n $usedPatterns = array();\n foreach ($matches[0] as $pattern) {\n if (!array_key_exists($pattern, $usedPatterns)) {\n $usedPatterns[$pattern] = true;\n $text = str_replace($pattern, \"<a href=\\\"$pattern\\\" rel=\\\"nofollow\\\">$pattern</a>\", $text);\n }\n }\n return $text;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Describes the parameters for new_page.
public static function new_page_parameters() { return new external_function_parameters ( array( 'title' => new external_value(PARAM_TEXT, 'New page title.'), 'content' => new external_value(PARAM_RAW, 'Page contents.'), 'contentformat' => new external_value(PARAM_TEXT, 'Page contents format. If an invalid format is provided, default wiki format is used.', VALUE_DEFAULT, null), 'subwikiid' => new external_value(PARAM_INT, 'Page\'s subwiki ID.', VALUE_DEFAULT, null), 'wikiid' => new external_value(PARAM_INT, 'Page\'s wiki ID. Used if subwiki does not exists.', VALUE_DEFAULT, null), 'userid' => new external_value(PARAM_INT, 'Subwiki\'s user ID. Used if subwiki does not exists.', VALUE_DEFAULT, null), 'groupid' => new external_value(PARAM_INT, 'Subwiki\'s group ID. Used if subwiki does not exists.', VALUE_DEFAULT, null) ) ); }
[ "public static function view_page_parameters() {\n return new external_function_parameters (\n array(\n 'pageid' => new external_value(PARAM_INT, 'Wiki page ID.'),\n )\n );\n }", "public function buildPageInfo()\n {\n $this->page[0] = [\n $url = \"users/browse/$this->request_role\",\n $this->role_model->plural_title,\n $url,\n ];\n\n $this->page[1] = [\n $this->request_tab,\n trans(\"users::criteria.\" . $this->role_model->statusRule($this->request_tab)),\n \"users/browse/$this->request_role\",\n \"$url/$this->request_tab\",\n ];\n }", "protected function setCreateNewBtnParams()\n {\n $get = Yii::$app->request->get();\n $buttonLabel = AmosSondaggi::t('amossondaggi', 'Aggiungi pagina');\n\n $urlCreateNew = ['create'];\n if (isset($get['idSondaggio'])) {\n $urlCreateNew['idSondaggio'] = filter_input(INPUT_GET, 'idSondaggio');\n }\n if (isset($get['idPagina'])) {\n $urlCreateNew['idPagina'] = filter_input(INPUT_GET, 'idPagina');\n }\n if (isset($get['url'])) {\n $urlCreateNew['url'] = $get['url'];\n }\n Yii::$app->view->params['createNewBtnParams'] = [\n 'urlCreateNew' => $urlCreateNew,\n 'createNewBtnLabel' => $buttonLabel\n\n ];\n }", "function CreatePage()\r\n\t{\r\n\t //Ajout des controls au formulaire\r\n\t $this->Form->AddNew($this->GridElements);\r\n\t $this->Form->AddNew($this->LinkBlock,\"2\",ALIGNRIGHT);\r\n\t $this->Form->AddNew($this->BtnSave,\"2\",ALIGNRIGHT);\r\n\r\n\t //Ajout des controls � la page\r\n\t $this->Core->Page->Insert(CENTER,$this->Form);\r\n\t }", "private function setParamsForView()\n {\n $parts = new PartsWizardDocumentiCreation(['model' => $this->model]);\n Yii::$app->view->title = $parts->active['index'] . '. ' . $parts->active['label'];\n Yii::$app->view->params['breadcrumbs'] = [\n ['label' => Yii::$app->view->title]\n ];\n Yii::$app->view->params['model'] = $this->model;\n Yii::$app->view->params['partsQuestionario'] = $parts;\n Yii::$app->view->params['hideBreadcrumb'] = true; // This param hide the wizard Breadcrumb.\n Yii::$app->view->params['hidePartsUrl'] = true; // This param disable the progress wizard menu links.\n Yii::$app->view->params['textHelp'] = [\n 'filename' => 'documents-description'\n ];\n }", "public function addPage()\n {\n }", "function new_page_link() {\n\tif($_REQUEST['new']!='1') {\n\t\t$newpagelink = '<h2><a href=\"./cmseditpage?locale='.$_REQUEST['locale'].'&article='.$_REQUEST['article'].'&new=1\">Add Page +</a></h2>';\n\t\techo $newpagelink;\n\t}\n}", "function new_parameters() {\r\n\r\n }", "function addPage(){}", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public static function data_for_wizard_navigation_page_parameters() {\n $id = new external_value(\n PARAM_INT,\n 'The course module id',\n VALUE_REQUIRED\n );\n $currentstep = new external_value(\n PARAM_RAW,\n 'The current step name',\n VALUE_REQUIRED\n );\n $assessmenttype = new external_value(\n PARAM_INT,\n 'The assessment type',\n VALUE_REQUIRED\n );\n $params = array(\n 'id' => $id,\n 'currentstep' => $currentstep,\n 'assessmenttype' => $assessmenttype\n );\n return new external_function_parameters($params);\n }", "protected function setPageInfo() : void {}", "public function addPage() {\n $this->_documentXMLFINAL .= $this->_documentXML;\n $this->_documentXML = $this->_documentXMLSEQ;\n }", "public function newPage(array $pagedata) {\n\t\tif ($this->db->tableInsert(TBL_PAGES, $pagedata)) {\t//Call the database\n\t\t\t$this->pagedata['id'] = intval($this->db->insertedId());\n\t\t}\n\t}", "function createPages() { }", "function print_new_page()\n\t{\n $this->do_print(PF);\n $this->do_print(PH);\n\t \t$this->dark = false;\n\t}", "static function new_basicpage() {\r\n $out = '';\r\n $out .= sq_admin_layout_writer::above('New Basic Page');\r\n $out .= '<h2>New Basic Page</h2>'.\"\\n\\n\";\r\n $out .= sq_admin_form_writer::new_basicpage();\r\n $out .= sq_admin_layout_writer::below();\r\n return $out;\r\n}", "public function newAction() {\n\t\t$this->view->assign('new' . $this->domainObjectName, $this->arguments['new' . $this->domainObjectName]->getValue());\n\t}", "private function get_new_page_form() {\n $form = new Forge(\"admin/pages/savepage\", \"\", \"post\",\n array(\"id\" => \"g-pages-admin-form\"));\n\n $pages_group = $form->group(\"new_page\");\n $pages_group->input(\"page_name\")\n ->label(t(\"Name\"));\n $pages_group->input(\"page_title\")\n ->label(t(\"Title\"));\n $pages_group->textarea(\"page_code\")\n ->label(t(\"HTML Code\"));\n $pages_group->checkbox(\"display_menu\")\n ->label(t(\"Display in menu?\"))\n ->checked(false);\n $pages_group->submit(\"save_page\")\n ->value(t(\"Save\"));\n\n return $form;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////////////////////////////////////////////////////////// Download All button pressed typically called in o1 code. $SelectedRow must be passed in or $_SESSION['Selected'] must be set for this function to work. See contractor_qual_io03.php for a typical implementation.
public function download_all_files_1e($htmlFormArray, $GoBackFileName = 'contents0.php', $GoBackInputName = '', $SelectedRow = FALSE) { if (!ZIP_DOWNLOAD_WORKS_ZFPF) // Implies hacker modified HTML form to try to download more than one file at once, when not allowed. $this->eject_1c(@$this->error_prefix_1c().__FILE__.':'.__LINE__.' download_all_files_1e() Eject Case 1. User tried to download all files when not allowed.'); if (!$SelectedRow) { if (!isset($_SESSION['Selected'])) $this->eject_1c(@$this->error_prefix_1c().__FILE__.':'.__LINE__.' download_all_files_1e() Eject Case 2.'); $SelectedRow = $_SESSION['Selected']; } $Directory = $this->user_files_directory_1e($SelectedRow); $c6bfn_array = FALSE; foreach ($htmlFormArray as $K => $V) if (isset($V[3]) and $V[3] == 'upload_files') { if (!$c6bfn_array) $c6bfn_array = $this->c6bfn_decrypt_decode_1e($SelectedRow[$K]); else { $Temp = $this->c6bfn_decrypt_decode_1e($SelectedRow[$K]); if ($Temp) $c6bfn_array = array_merge($c6bfn_array, $Temp); } } if ($c6bfn_array) { $this->download_c6bfn_files_1e($Directory, $c6bfn_array, $GoBackFileName, $GoBackInputName); } }
[ "public function download_buttons() {\n global $OUTPUT;\n\n if ($this->is_downloadable() && !$this->is_downloading()) {\n $html = html_writer::start_div(\"export\");\n $html .= $OUTPUT->download_dataformat_selector(\n get_string('downloadas', 'table'),\n $this->baseurl->out_omit_querystring(), 'download', $this->baseurl->params()\n );\n $html .= html_writer::end_div();\n return $html;\n } else {\n return '';\n }\n }", "public function download_buttons() {\n global $OUTPUT;\n\n if ($this->is_downloadable() && !$this->is_downloading()) {\n return $OUTPUT->download_dataformat_selector(get_string('downloadas', 'table'),\n $this->baseurl->out_omit_querystring(), $this->downloadparamname, $this->baseurl->params());\n } else {\n return '';\n }\n }", "function showAllButton($basepage,$sort,$reverse,$all)\n{\n $retVal = \"<tr class=\\\"botline\\\"><td colspan=13 align=\\\"right\\\">\\n\";\n $retVal .= \"<a href=\\\"$basepage&sort=$sort\";\n\n if($reverse) {\n\t $retVal .= \"&reverse\";\n }\n\n if(!$all) {\n\t $retVal .= \"&all\";\n }\n\n $retVal .= \"\\\"><em>Click here to \";\n if($all) {\n\t $retVal .= \"exclude\";\n } else {\n\t $retVal .= \"include\";\n }\n\n $retVal .= \" shipped and canceled orders.</em></a></td></tr>\";\n\n return($retVal);\n}", "public function exportPrintBatchHelper()\r\n {\r\n $html = '';\r\n if (isset($this->request->post['selected'])) {\r\n foreach ($this->request->post['selected'] as $order_id) {\r\n $html .= '<input name=\"selected[]\" style=\"display:none;\" checked=\"checked\" value=\"' . $order_id . '\" type=\"checkbox\">';\r\n }\r\n }\r\n echo json_encode(\r\n array(\r\n 'status' => 'success',\r\n 'html' => $html\r\n )\r\n );\r\n die;\r\n }", "function fileDownload()\n{\n\tglobal $ajax;\n\tglobal $files;\n\tglobal $moduleFilename;\n\n\t$basePath = getBasePath();\n\t$currentPath = getCurrentPath();\n\t$selectedItem = getSelectedItem();\n\t$url = $files->fileDownloadUrl($basePath, $currentPath,\n\t\t$selectedItem, html::getBaseUrl(), '/application/' .\n\t\t$moduleFilename);\n\t$ajax->sendCommand(46, $url);\n}", "public function action_download() {\n $rawData = Model_Base_trunkroom::getCsvData();\n $header = array(\"サイト名\", \"店舗名\", \"住所(アクセス含む)\", \"電話番号\", \"説明文\", \"料金表の下の説明文\", \"画像URL\", \"タイプ\", \"広さ(約畳)\", \"広さ(幅x奥行x高さ)\", \"月額料金\", \"キャンペーン料金\", \"空き状況\");\n \\Common\\Common::outputCSV(array(\n 'title' => $header,\n 'data' => $this->_formatCsvData($rawData),\n 'delimiter' => ','\n ));\n }", "public function downloadProductCSV();", "function print_SelUnselAllBtns($name)\n{\n\techo \"<input type='button' name='CheckAll' value='Выделить все' onClick=\\\"setAll('{$name}', true)\\\" class='PARAMS' >\\n\";\n\techo \"<input type='button' name='UnCheckAll' value='Отменить все' onClick=\\\"setAll('{$name}', false)\\\" class='PARAMS'>\\n\";\n}", "public function export()\n {\n $mainListing = TRUE;\n\n $ids = $this->input->post('ids');\n $fileType = $this->input->post('type');\n $offset = $this->input->post('offset');\n\n if ($fileType == 'pdf') {\n $showAllRecords = FALSE;\n } else {\n $showAllRecords = TRUE;\n }\n if(!empty($ids)){\n //rest the offset\n $offset = 0;\n //make id array from string\n $selectedIds = explode(\"-\", $ids);\n //push ids to member array\n $this->_selectedIds = $selectedIds;\n }\n \n // get listing data\n $data = $this->getListingData($showAllRecords, $mainListing, '', $offset, $fileType);\n $tableName = $data['table_name'];\n $totalItems = $data['list'];\n $xmlData = $data['xmlData'];\n $xmlObjectArray = $data['all_field'];\n $listingFields = $data['listing_field'];\n $primaryKey = $data['primary_key'];\n \n $totalItems = $this->update_cell_value($tableName, $xmlObjectArray, $listingFields, $totalItems);\n $tableName = dashboard_lang(\"_\" . strtoupper($tableName));\n \n $this->exprot_table($tableName, $primaryKey, $xmlObjectArray, $totalItems, $fileType);\n }", "public function showFileList()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\tif(!count($files = $this->fss_export->getMemberExportFiles()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t \t$a_tpl = new ilTemplate('tpl.table.html',true,true);\n\t\t$a_tpl->addBlockfile(\"TBL_CONTENT\", \"tbl_content\", \"tpl.member_export_file_row.html\", \"Modules/Course\");\n\t\t$a_tpl->setVariable('FORMACTION',$this->ctrl->getFormaction($this));\n\n\t\tinclude_once(\"./Services/Table/classes/class.ilTableGUI.php\");\n\t\t$tbl = new ilTableGUI();\n\n\t\t// load template for table content data\n\n\t\t$tbl->setTitle($this->lng->txt(\"ps_export_files\"));\n\n\t\t$tbl->setHeaderNames(array(\"\", $this->lng->txt(\"type\"),\n\t\t\t\t$this->lng->txt(\"ps_size\"),\n\t\t\t\t$this->lng->txt(\"date\") ));\n\n\t\t$cols = array(\"\", \"type\",\"size\", \"date\");\n\n\t\t$header_params = $this->ctrl->getParameterArray($this,'show');\n\t\t$tbl->setHeaderVars($cols, $header_params);\n\t\t$tbl->setColumnWidth(array(\"1%\", \"9%\", \"45%\", \"45%\"));\n\t\t\n\t\t// control\n\t\t$tbl->setOrderColumn($_GET[\"sort_by\"]);\n\t\t$tbl->setOrderDirection($_GET[\"sort_order\"]);\n\t\t$tbl->setLimit($ilUser->getPref('hits_per_page',9999));\n\t\t$tbl->setOffset($_GET[\"offset\"]);\n\t\t$tbl->setMaxCount(count($files));\n\t\t$tbl->disable(\"sort\");\n\t\t$a_tpl->setVariable(\"COLUMN_COUNTS\",4);\n\t\t\n\t \t$files = array_reverse($files);\n\t\t$files = array_slice($files, $_GET[\"offset\"], $_GET[\"limit\"]);\n\t\t$num = 0;\n\t\t$i=0;\n\t\tforeach($files as $exp_file)\n\t\t{\n\t\t\t$a_tpl->setCurrentBlock(\"tbl_content\");\n\t\t\t$a_tpl->setVariable(\"TXT_FILENAME\", $exp_file[\"file\"]);\n\n\t\t\t$css_row = ilUtil::switchColor($i++, \"tblrow1\", \"tblrow2\");\n\t\t\t$a_tpl->setVariable(\"CSS_ROW\", $css_row);\n\n\t\t\t$a_tpl->setVariable(\"TXT_SIZE\",$exp_file['size']);\n\t\t\t$a_tpl->setVariable(\"TXT_TYPE\", strtoupper($exp_file[\"type\"]));\n\t\t\t$a_tpl->setVariable(\"CHECKBOX_ID\",$exp_file[\"timest\"]);\n\t\t\t$a_tpl->setVariable(\"TXT_DATE\", date(\"Y-m-d H:i\",$exp_file['timest']));\n\t\t\t$a_tpl->parseCurrentBlock();\n\t\t}\n\t\t\n\n\t\t// delete button\n\t\t$a_tpl->setVariable(\"IMG_ARROW\", ilUtil::getImagePath(\"arrow_downright.svg\"));\n\t\t$a_tpl->setCurrentBlock(\"tbl_action_btn\");\n\t\t$a_tpl->setVariable(\"BTN_NAME\", \"confirmDeleteExportFile\");\n\t\t$a_tpl->setVariable(\"BTN_VALUE\", $this->lng->txt(\"delete\"));\n\t\t$a_tpl->parseCurrentBlock();\n\n\t\t$a_tpl->setCurrentBlock(\"tbl_action_btn\");\n\t\t$a_tpl->setVariable(\"BTN_NAME\", \"downloadExportFile\");\n\t\t$a_tpl->setVariable(\"BTN_VALUE\", $this->lng->txt(\"download\"));\n\t\t$a_tpl->parseCurrentBlock();\n\n\t\t// footer\n\t\t$tbl->setFooter(\"tblfooter\",$this->lng->txt(\"previous\"),$this->lng->txt(\"next\"));\n\t\t//$tbl->disable(\"footer\");\n\n\t\t$tbl->setTemplate($a_tpl);\n\t\t$tbl->render();\n\t\t\n\t\t#$this->tpl->setCurrentBlock('file_list');\n\t\t$this->tpl->setVariable('FILE_LIST_TABLE',$a_tpl->get());\n\t\t#$this->tpl->parseCurrentBlock();\n\t\t\n\t}", "function MyMod_Handle_Import_Items_Table_AllRow()\n {\n return\n array\n (\n \"\",\n \"\",\n \"\",\n $this->B(\"Select All:\"),\n $this->Html_Input_CheckBox_Field(\"Register_All\",1,FALSE),\n $this->Html_Input_CheckBox_Field(\"Inscribe_All\",1,FALSE),\n $this->Html_Input_CheckBox_Field(\"Certificate_All\",1,FALSE),\n \"\"\n );\n }", "public function selectExport()\n\t{\n\t\tswitch ($_POST['select_export'])\n\t\t{\n\t\t\tcase \"exportScorm12\":\n\t\t\tcase \"exportScorm2004_3rd\":\n\t\t\tcase \"exportScorm2004_4th\":\n\t\t\tcase \"exportPDF\":\n\t\t\tcase \"exportHTML\":\n\t\t\t\t$this->ctrl->redirect($this, $_POST['select_export']);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->ctrl->redirect($this, 'showExportList');\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function exportall()\n\t{\n\t\t// Set memory limit to unlimited to allow heavy usage\n\t\tini_set('memory_limit', '-1');\n\n\t\t$this->load->model('adif_data');\n\n\t\t$data['qsos'] = $this->adif_data->export_all();\n\n\n\t\t$this->load->view('adif/data/exportall', $data);\n\t}", "public function downloadAllUsers() {\n extract($_GET);\n $result = $this->Allusers_model->downloadAllUsers();\n //print_r(json_encode($result));\n $filename = 'All_User_list_' . date('Y-m-d') . '.csv';\n header(\"Content-Type: application/csv; \");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Disposition: attachment; filename=$filename\");\n// get data \n $usersData = $result;\n// file creation \n $file = fopen('php://output', 'w');\n $header = array(\"Profile ID\",\"Full Name\", \"Gender\", \"Registration Date\", \"City\", \"Marital Status\");\n fputcsv($file, $header);\n if ($result) {\n foreach ($usersData as $key => $line) {\n fputcsv($file, $line);\n }\n } else {\n fputcsv($file, array('------------No data available-----------'));\n }\n fclose($file);\n //force_download($file);\n exit;\n }", "public function export_listen() {\n\t\t// Bail if we aren't in the admin\n\t\tif ( ! is_admin() )\n\t\t\treturn false;\n\n\t\tif ( ! isset ( $_REQUEST['form_id'] ) || empty ( $_REQUEST['form_id'] ) )\n\t\t\treturn false;\n\n\t\tif ( isset ( $_REQUEST['export_single'] ) && ! empty( $_REQUEST['export_single'] ) )\n\t\t\tNinja_Forms()->sub( esc_html( $_REQUEST['export_single'] ) )->export();\n\n\t\tif ( ( isset ( $_REQUEST['action'] ) && $_REQUEST['action'] == 'export' ) || ( isset ( $_REQUEST['action2'] ) && $_REQUEST['action2'] == 'export' ) ) {\n\t\t\tNinja_Forms()->subs()->export( ninja_forms_esc_html_deep( $_REQUEST['post'] ) );\n\t\t}\n\n\t\tif ( isset ( $_REQUEST['download_file'] ) && ! empty( $_REQUEST['download_file'] ) ) {\n\t\t\t// Open our download all file\n\t\t\t$filename = esc_html( $_REQUEST['download_file'] );\n\n\t\t\t$upload_dir = wp_upload_dir();\n\n\t\t\t$file_path = trailingslashit( $upload_dir['path'] ) . $filename . '.csv';\n\n\t\t\tif ( file_exists( $file_path ) ) {\n\t\t\t\t$myfile = file_get_contents ( $file_path );\n\t\t\t} else {\n\t\t\t\t$redirect = esc_url_raw( remove_query_arg( array( 'download_file', 'download_all' ) ) );\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\tunlink( $file_path );\n\n\t\t\t$form_name = Ninja_Forms()->form( absint( $_REQUEST['form_id'] ) )->get_setting( 'form_title' );\n\t\t\t$form_name = sanitize_title( $form_name );\n\n\t\t\t$today = date( 'Y-m-d', current_time( 'timestamp' ) );\n\n\t\t\t$filename = apply_filters( 'nf_download_all_filename', $form_name . '-all-subs-' . $today );\n\n\t\t\theader( 'Content-type: application/csv');\n\t\t\theader( 'Content-Disposition: attachment; filename=\"'.$filename .'.csv\"' );\n\t\t\theader( 'Pragma: no-cache');\n\t\t\theader( 'Expires: 0' );\n\n\t\t\techo $myfile;\n\n\t\t\tdie();\n\t\t}\n\t}", "function download_table($table, $file, $where=\"\") {\n $download_result = false;\n $csv_output = \"\";\n\n $db = new database();\n $db->dblink();\n\n $result = $db->get_recs($table, \"*\", $where);\n $recs = $db->fetch_objects($result);\n\n if(is_array($recs)) {\n $n = count($recs);\n sort($recs);\n \n // output the headers\n foreach($recs[0] as $key => $value) {\n $csv_output .= $key.\",\";\n } // end foreach\n\n $csv_output .= \"\\n\";\n \n for($i = 0; $i < $n; $i++) {\n foreach($recs[$i] as $key => $value) {\n $csv_output .= $value.\",\";\n } // end foreach\n\n $csv_output .= \"\\n\";\n } // end for\n\n $download_result = true;\n\n header(\"Content-type: application/vnd.ms-excel\");\n header(\"Content-disposition: csv\".date(\"Y-m-d\").\".csv\");\n header(\"Content-disposition: filename=\".$file.\".csv\");\n\n echo $csv_output;\n } // end if\n\n return $download_result;\n}", "public function get_export_button() {\n $current_range = ! empty( $_GET['range'] ) ? $_GET['range'] : '7day';\n ?>\n <a\n href=\"#\"\n download=\"report-<?php echo $current_range; ?>-<?php echo date_i18n( 'Y-m-d', current_time('timestamp') ); ?>.csv\"\n class=\"export_csv\"\n data-export=\"chart\"\n data-xaxes=\"<?php _e( 'Date', 'wc_coupon_campaigns' ); ?>\"\n data-groupby=\"<?php echo $this->chart_groupby; ?>\"\n >\n <?php _e( 'Export CSV', 'wc_coupon_campaigns' ); ?>\n </a>\n <?php\n }", "function downloadReferralList()\n {\n \t$this->layout = \"ajax\";\n \t$this->autoRender = false; \t\n \t$filepath = WWW_ROOT . 'files' . DS . 'Referral_exported_' . date('d-m-Y-H:i:s') . '.csv';\n \t// fields to be show in exported csv\n \t$fields = array('ReceivedReferral.first_name','ReceivedReferral.last_name','ReceivedReferral.company','ReceivedReferral.job_title','ReceivedReferral.address','ReceivedReferral.city','ReceivedReferral.zip','ReceivedReferral.office_phone','ReceivedReferral.mobile','ReceivedReferral.email','ReceivedReferral.website', 'ReceivedReferral.referral_status', 'ReceivedReferral.monetary_value', 'ReceivedReferral.created','BusinessOwners.fname', 'BusinessOwners.lname','Country.country_name','State.state_subdivision_name');\n \t\n \t// condition array\n \t$userId = $this->Encryption->decode($this->Session->read('Auth.Front.id'));\n \t$condition = array('ReceivedReferral.to_user_id' => $userId , 'ReceivedReferral.is_archive' => 0 );\n \t\n \t// fetch result array\n \t$data = $this->ReceivedReferral->find('all', array('fields' => $fields, 'conditions' => $condition, 'order'=>'created DESC'));\n \t\n \tif (count($data) > 0) {\n \t\t$data = $this->formatCsvData($data); \t\t\n \t\t$result = $this->Csv->export($filepath, $data);\n \t\t$fsize = filesize($filepath);\n \t\theader(\"Pragma: public\");\n \t\theader(\"Expires: 0\");\n \t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n \t\theader(\"Cache-Control: private\", false);\n \t\theader(\"Content-type: application/octet-stream\");\n \t\theader(\"Content-Description: File Transfer\");\n \t\theader(\"Content-Disposition: attachment; filename=\" . basename($filepath) . \";\");\n \t\theader(\"Content-Length: \" . $fsize);\n \t\treadfile($filepath) or die(\"Errors\");\n \t\tunlink($filepath);\n \t\texit(0);\n \t} else {\n \t\t$this->Session->setFlash(__('No referral(s) to download.'), 'Front/flash_bad');\n \t\t$this->redirect(array('controller' => 'referrals', 'action' => 'received'));\n \t}\n }", "function action_download_attachment ($list_title, $attachment_id)\r\n{\r\n global $logging;\r\n global $user;\r\n global $user_start_time_array;\r\n\r\n $logging->info(\"USER_ACTION \".__METHOD__.\" (user=\".$user->get_name().\", attachment_id=$attachment_id)\");\r\n\r\n # store start time\r\n $user_start_time_array[__METHOD__] = microtime(TRUE);\r\n\r\n # create necessary objects\r\n $response = new xajaxResponse();\r\n\r\n # get the file name and the attachment\r\n $list_table_attachment = new ListTableAttachment($list_title);\r\n $attachment_array = $list_table_attachment->select_record($attachment_id);\r\n $file_name = str_replace(\" \", \" \", $attachment_array[4]);\r\n $attachment = $attachment_array[5];\r\n \r\n # create a temp file with attachment\r\n $tmp_file_name = \"download_\".$user->get_name().strftime(\"_%d%m%Y_%H%M%S\");\r\n $file_handler = fopen(\"uploads/\".$tmp_file_name, \"w\");\r\n \r\n fwrite($file_handler, $attachment);\r\n fclose($file_handler);\r\n \r\n # call the export handler\r\n $response->script(\"document.location.href = 'php/Html.Export.php?tmp_file=$tmp_file_name&file_name=$file_name'\");\r\n\r\n # log total time for this function\r\n $logging->info(get_function_time_str(__METHOD__));\r\n\r\n return $response;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve (training) sessions (possibly filtered by project ID), return a dictionary of session IDs and titles
public static function getTrainingSessionTitlesAssoc($pmacontrolURL, $pmacontrolProjectID, $pmacoreSessionID) { $dct = array(); $all = self::_pma_get_training_sessions($pmacontrolURL, $pmacoreSessionID); foreach ($all as $sess) { if ($pmacontrolProjectID == null) { $dct[$sess["Id"]] = $sess["Title"]; } elseif ($pmacontrolProjectID == $sess["ProjectId"]) { $dct[$sess["Id"]] = $sess["Title"]; } } return $dct; }
[ "public function sessions()\n {\n $params = request()->validate([\n 'training_id' => 'required|integer',\n 'year' => 'required|integer',\n ]);\n\n $training = Training::findOrFail($params['training_id']);\n $this->authorize('show', $training);\n\n $sessions = TrainingSession::findAllForTrainingYear($params['training_id'], $params['year']);\n\n\n $info = $sessions->map(\n function ($session) {\n return [\n 'slot' => $session,\n 'trainers' => $session->retrieveTrainers(),\n ];\n }\n );\n\n return response()->json(['sessions' => $info]);\n }", "public function get_trial_sessions()\n {\n $this->validate($this->request, [\n 'team_id' => 'required|integer|min:1'\n ]);\n\n $team = Team::find($this->request['team_id']);\n\n $programmes = Programme::select([\n 'programme.programme_id',\n 'programme.programme_id as id',\n 'programme.title',\n 'programme_type.title as type_title'\n ])\n ->with('existingSessions')\n ->leftJoin('programme_type', 'programme_type.type_id', '=', 'programme.type_id')\n ->leftJoin('rel_programme_team', 'rel_programme_team.programme_id', '=', 'programme.programme_id')\n ->where('rel_programme_team.team_id', $this->request['team_id'])\n ->where(function ($query) use ($team) {\n if ($team->type === 'skill-group') {\n $query->where('programme_type.type', 'academy');\n $query->where('programme_type.title', 'Soccer School');\n } else {\n $query->where('programme_type.type', 'fc');\n $query->where('programme_type.title', 'Team Training');\n }\n })->get();\n\n return response()->json($programmes, 200);\n }", "public function getAllSessions() {\n $sql = 'SELECT * FROM Sessions\n INNER JOIN Places ON Places.placeID = Sessions.placeID\n WHERE sectionID = :id';\n $args = array(':id' => $this->id);\n $rows = Database::executeGetAllRows($sql, $args);\n return array_map(function ($row) { return new SectionSession($row); }, $rows);\n }", "public function getSessions()\n {\n return $this->sessions;\n }", "function getSessions(): array\n {\n return $this->sessions;\n }", "public function getAllSessions();", "private static function _pma_format_training_session_properly($sess) {\n\t\t$sess_data = array(\n\t\t\t\"Id\" => $sess[\"Id\"],\n\t\t\t\"Title\" => $sess[\"Title\"],\n\t\t\t\"LogoPath\" => $sess[\"LogoPath\"],\n\t\t\t\"StartsOn\" => $sess[\"StartsOn\"],\n\t\t\t\"EndsOn\" => $sess[\"EndsOn\"],\n\t\t\t\"ProjectId\" => $sess[\"ProjectId\"],\n\t\t\t\"State\" => $sess[\"State\"],\n\t\t\t\"CaseCollections\" => array(),\n\t\t\t\"NumberOfParticipants\" => count($sess[\"Participants\"])\n\t\t);\n\t\tforeach ($sess[\"CaseCollections\"] as $coll) {\n\t\t\t$sess_data[\"CaseCollections\"][$coll[\"Id\"]] = $coll[\"Title\"];\n\t\t}\n\t\treturn $sess_data;\n\t}", "public function getSessions()\n {\n return $this->sessionRepository->findAll();\n }", "public static function getSessionTasks()\n {\n $res = [];\n $tasks = CacheManager::get('tasks');\n $session_states = CacheManager::get('session_states');\n $inputs = CacheManager::get('inputs');\n $counter = 0;\n\n foreach($session_states as $key => $val) {\n $res[$counter] = $val;\n $res[$counter]['id'] = $key;\n $res[$counter]['task_name'] = $tasks[$val['auth_task']]['name'];\n if($val['auth_input'] != \"\") $res[$counter]['input_name'] = $inputs[$val['auth_input']]['name'];\n foreach($res[$counter] as &$cell) if($cell == null) $cell = \"\";\n $counter++;\n }\n\n Status::message(Status::SUCCESS, $res);\n }", "function getSessions($extra = null) {\n\t\treturn $this->getSessionsRelatedByClassroomId($extra);\n\t}", "private function get_sessions_list($path, $search = '') {\n $list = array();\n\n // Build the GetFoldersList request and perform the call.\n $pagination = new \\Panopto\\RemoteRecorderManagement\\Pagination();\n $pagination->setPageNumber(0);\n $pagination->setMaxNumberResults(1000);\n\n $request = new \\Panopto\\SessionManagement\\ListSessionsRequest();\n $request->setPagination($pagination);\n $request->setSortBy('Name');\n $request->setSortIncreasing(true);\n $request->setStates(array('Complete'));\n\n // If we are not searching, set parent folder if required.\n $orphanedlistingcheck = get_config('panopto', 'showorphanedsessions') ? ($path !== self::ROOT_FOLDER_ID) : true;\n if (empty($search) && $orphanedlistingcheck) {\n $patharray = explode('/', $path);\n $currentfolderid = end($patharray);\n $request->setFolderId($currentfolderid);\n // Pre-define array for the current parent folder.\n $list[$currentfolderid] = array();\n }\n\n $param = new \\Panopto\\SessionManagement\\GetSessionsList($this->auth, $request, $search);\n $sessions = $this->smclient->GetSessionsList($param)->getGetSessionsListResult();\n $totalsessions = $sessions->getTotalNumberResults();\n\n // Processing GetFoldersList result.\n if ($totalsessions) {\n foreach ($sessions->getResults() as $session) {\n // Define parent folder array.\n $parentfolderid = $session->getFolderId();\n if (empty($parentfolderid) || !empty($search)) {\n $parentfolderid = self::ROOT_FOLDER_ID;\n }\n if (!isset($list[$parentfolderid])) {\n $list[$parentfolderid] = array();\n }\n // Add session data.\n $title = $session->getName();\n $url = new moodle_url($session->getViewerUrl());\n $thumburl = new moodle_url('https://' . get_config('panopto', 'serverhostname') . $session->getThumbUrl());\n $list[$parentfolderid][] = array(\n 'shorttitle' => $title,\n 'title' => $title,\n 'source' => $session->getId(),\n 'url' => $url->out(false),\n 'thumbnail' => $thumburl->out(false),\n 'thumbnail_title' => $session->getDescription(),\n 'date' => $session->getStartTime()->format('U'),\n );\n }\n }\n return $list;\n }", "public function userSessionData()\r\n {\r\n $data = (new \\Dsc\\Mongo\\Collections\\Sessions)->load(array('session_id'=>$this->session_id_user));\r\n \r\n return $data;\r\n }", "protected function getSampleSessions() {\n // Select a maximum of 20 random sessions that are on or have passed this unit\n $results = [];\n $rs = [];\n $rows = $this->db->select('session, id, position')\n ->from('survey_run_sessions')\n ->order('position', 'desc')->order('RAND')\n ->where(array('run_id' => $this->run->id, 'position >=' => $this->position))\n ->limit(20)->fetchAll();\n \n foreach ($rows as $row) {\n if (!isset($rs[$row['id']])) {\n $rs[$row['id']] = new RunSession($row['session'], $this->run, ['id' => $row['id']]);\n }\n\n $unitSession = (new UnitSession($rs[$row['id']], $this))->load();\n if ($unitSession->id) {\n $results[] = $unitSession;\n }\n }\n\n return $results;\n }", "public function getSessions()\n {\n if (array_key_exists(\"sessions\", $this->_propDict)) {\n return $this->_propDict[\"sessions\"];\n } else {\n return null;\n }\n }", "public function getSessions()\r\n {\r\n return $this->config->getSessions();\r\n }", "public function getSessionData();", "public function getActiveSessions();", "private function getSessionFromURL()\n {\n $sessionInfo = new SessionData();\n $urlParms = $this->CI->uri->segment_array();\n for($i = 0; $i < count($urlParms); $i++)\n {\n if($urlParms[$i] === 'session')\n $urlSession = explode('/', base64_decode(urldecode($urlParms[$i + 1])));\n if($urlParms[$i] === 'a_id')\n $sessionInfo->answersViewed = 1;\n if($urlParms[$i] === 'qid')\n $sessionInfo->questionsViewed = 1;\n if($urlParms[$i] === 'sno')\n $sessionInfo->numberOfSearches = $urlParms[$i + 1];\n }\n\n for($i = 0; $i < count($urlSession); $i++)\n {\n if($urlSession[$i] === 'sid')\n $sessionInfo->sessionID = $this->extractSessionID($urlSession[$i + 1]);\n if($urlSession[$i] === 'pta')\n $sessionInfo->ptaUsed = $urlSession[$i + 1];\n if($urlSession[$i] === 'av')\n $sessionInfo->answersViewed += $urlSession[$i + 1];\n if($urlSession[$i] === 'qv') {\n $sessionInfo->questionsViewed += $urlSession[$i + 1];\n }\n if($urlSession[$i] === 'sno' && !$sessionInfo->numberOfSearches)\n $sessionInfo->numberOfSearches = $urlSession[$i + 1];\n if($urlSession[$i] === 'time')\n $sessionInfo->lastActivity = $urlSession[$i + 1];\n if($urlSession[$i] === 'gen')\n $sessionInfo->sessionGeneratedTime = $urlSession[$i + 1];\n }\n\n $this->sessionData = $sessionInfo;\n $this->flashData = new FlashData();\n }", "public function session_list()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get matching quantity range keys with allocated cart item quantities
public function get_quantity_ranges_with_allocated_quantities($rule, $quantity_group) { $matched = array(); // Get total quantity $total_quantity = array_sum($quantity_group); // Iterate over quantity ranges foreach ($rule['quantity_ranges'] as $quantity_range_key => $quantity_range) { // Include range if quantity falls into it if ($quantity_range['from'] === null || $quantity_range['from'] <= $total_quantity) { // Find out overlapping ranges $count_from_incl = ($quantity_range['from'] === null ? 1 : $quantity_range['from']); $count_to_incl = (($quantity_range['to'] === null || $total_quantity <= $quantity_range['to']) ? $total_quantity : $quantity_range['to']); // Track progress $working_quantity = 0; // Iterate over cart items in a quantity group foreach ($quantity_group as $cart_item_key => $cart_item_quantity) { // Find out overlapping ranges $current_count_from_incl = $working_quantity + 1; $current_count_to_incl = $working_quantity + $cart_item_quantity; // Update working quantity $working_quantity = $current_count_to_incl; // Skip this cart item as it does not fall into current range if ($working_quantity < $count_from_incl) { continue; } // Update current overlapping ranges $current_count_from_incl = ($current_count_from_incl > $count_from_incl ? $current_count_from_incl : $count_from_incl); $current_count_to_incl = ($current_count_to_incl < $count_to_incl ? $current_count_to_incl : $count_to_incl); // Add cart item to matched array $matched[$quantity_range_key][$cart_item_key] = ($current_count_to_incl - $current_count_from_incl + 1); // Nothing else fits into this range if ($working_quantity >= $count_to_incl) { break; } } } // Stop iterating if this was the last range that quantity falls into if ($quantity_range['to'] === null || $quantity_range['to'] >= $total_quantity) { break; } } return $matched; }
[ "public function getItemQuantities()\n {\n $data = array();\n $items = $this->getObject('com://site/rewardlabs.model.cartitems')\n ->cart_id($this->id)\n ->fetch()\n ;\n\n foreach ($items as $item)\n {\n if ($item->_item_type == self::TYPE_GROUP)\n {\n // Query grouped items\n $groupedItems = $this->getObject('com://admin/qbsync.model.itemgroups')->parent_id($item->_item_ref)->fetch();\n\n foreach ($groupedItems as $groupItem)\n {\n if ($groupItem->_item_type == self::TYPE_INVENTORY_ITEM)\n {\n @$data[$groupItem->_item_ref] += (int) $item->quantity * (int) $groupItem->quantity;\n }\n }\n }\n else @$data[$item->_item_ref] += (int) $item->quantity;\n }\n\n return $data;\n }", "public function quantityFilterProvider(): array\n {\n return [\n 'from' => [\n 'filter' => [\n 'qty' => [\n 'from' => 100,\n ],\n ],\n 'expected_products' => [\n 'simple1',\n 'simple3',\n ],\n ],\n 'to' => [\n 'filter' => [\n 'qty' => [\n 'to' => 100,\n ],\n ],\n 'expected_products' => [\n 'simple1',\n 'simple2',\n ],\n ],\n 'both' => [\n 'filter' => [\n 'qty' => [\n 'from' => 60,\n 'to' => 130,\n ],\n ],\n 'expected_products' => [\n 'simple1',\n ],\n ],\n ];\n }", "public function getProductSKUQuantityMap() {\n $output = array();\n $line_items = $this->getFieldItems('commerce_line_items');\n foreach ($line_items as $line_item) {\n $lineItemEntity = new CommerceLineItem($line_item['line_item_id']);\n $map = $lineItemEntity->getProductSKUQuantityMap();\n foreach ($map as $sku => $quantity) {\n if (array_key_exists($sku, $output)) {\n $output[$sku] += $quantity;\n }\n else {\n $output[$sku] = $quantity;\n }\n }\n }\n\n return $output;\n }", "function ppom_extract_matrix_by_quantity($quantities_field, $product, $quantity) {\n\t\n\t$matrix = '';\n\tif( !isset($quantities_field['options']) ) return $matrix; \n\t\n\t$options\t= $quantities_field['options'];\n\t$ranges\t = ppom_convert_options_to_key_val($options, $quantities_field, $product);\n\t\n\tif( empty($ranges) ) return $matrix;\n\t\n\tforeach ($ranges as $range => $data) {\n\t\t\n\t\t$range_array\t= explode('-', $range);\n\t\t$range_start\t= $range_array[0];\n\t\t$range_end\t\t= $range_array[1];\n\t\t\n\t\t$quantity = intval($quantity);\n\t\tif( $quantity >= $range_start && $quantity <= $range_end ) {\n\t\t\t$matrix = $data;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $matrix;\n}", "protected function sliceQuantities(array &$quantities, $total_quantity) {\n $remaining_quantity = $total_quantity;\n $slice = [];\n foreach ($quantities as $order_item_id => $quantity) {\n if ($quantity <= $remaining_quantity) {\n $remaining_quantity = Calculator::subtract($remaining_quantity, $quantity);\n $slice[$order_item_id] = $quantity;\n unset($quantities[$order_item_id]);\n if ($remaining_quantity === '0') {\n break;\n }\n }\n else {\n $slice[$order_item_id] = $remaining_quantity;\n $quantities[$order_item_id] = Calculator::subtract($quantity, $remaining_quantity);\n break;\n }\n }\n\n return $slice;\n }", "public function getQtyIncrements();", "protected function _getItemQtys()\n {\n $data = $this->getRequest()->getParam('invoice');\n if (isset($data['items'])) {\n $qtys = $data['items'];\n } else {\n $qtys = array();\n }\n return $qtys;\n }", "function calculate_quantities($lks, $from, $to) {\n $sum = 0;\n for ($i = $from; $i <= $to; $i++) {\n $sum += $lks[$i]->demand;\n }\n // set summary demands to $from month\n $lks[$from]->quantity = $sum;\n // set 0 after $from month to $to month\n for ($i = $from+1; $i <= $to; $i++) {\n $lks[$i]->quantity = 0;\n }\n return $lks;\n}", "public function getQtyTo();", "public function ItemsNeeded() {\n\t// get the quantities requested\n\t$arQtyOrd = $this->QtysOrdered();\n\tif (is_array($arQtyOrd)) {\n\t // subtract items handled by packages\n\t $objPkgs = $this->PackageRecords(FALSE);\t// don't include inactive records\n\t $arPkgSums = $objPkgs->FigureTotals();\n\t foreach ($arQtyOrd as $idItem => $qtyOrd) {\n\t\t$arPkgSum = clsArray::Nz($arPkgSums,$idItem);\n\t\t$qtySum = $qtyOrd;\n\t\tif (is_array($arPkgSum)) {\n\t\t $qtySum += clsArray::Nz($arPkgSum,'qty-ord',0);\n\t\t}\n\t\t$arPkgSums[$idItem]['qty-ord'] = $qtySum;\n\t\tself::ItemStats_update_line($arPkgSums[$idItem]);\n\t }\n\t return $arPkgSums;\n\t} else {\n\t return NULL;\n\t}\n }", "public function getCartRange($quote)\n {\n $itemPoints = [];\n $rules = $this->getRules($quote);\n $customer = $quote->getCustomer();\n $balancePoints = $this->rewardsBalance->getBalancePoints($quote->getCustomerId());\n\n $minPoints = 0;\n $quoteSubTotal = $this->getQuoteSubtotal($quote);\n $totalPoints = 0;\n /** @var \\Mirasvit\\Rewards\\Model\\Spending\\Rule $rule */\n foreach ($rules as $rule) {\n $rule->afterLoad();\n if ($quote->getItemVirtualQty() > 0) {\n $address = $quote->getBillingAddress();\n } else {\n $address = $quote->getShippingAddress();\n }\n if (/*$quoteSubTotal > 0 && */$rule->validate($address)) {\n $ruleSubTotal = $this->getLimitedSubtotal($quote, $rule);\n if ($ruleSubTotal > $quoteSubTotal) {\n $ruleSubTotal = $quoteSubTotal;\n }\n\n $monetaryStep = $rule->getMonetaryStep($customer, $ruleSubTotal);\n if (!$monetaryStep) {\n unset($this->validItems[$rule->getId()]);\n continue;\n }\n\n $ruleMinPoints = $rule->getSpendMinAmount($customer, $ruleSubTotal);\n $ruleMaxPoints = $rule->getSpendMaxAmount($customer, $ruleSubTotal);\n $ruleSpendPoints = $rule->getSpendPoints($customer);\n if (($ruleMinPoints && ($quoteSubTotal / $monetaryStep) < 1) || $ruleMinPoints > $ruleMaxPoints\n || $ruleMinPoints > $balancePoints) {\n unset($this->validItems[$rule->getId()]);\n continue;\n }\n\n $ruleMinPoints = $ruleMinPoints ? max($ruleMinPoints, $ruleSpendPoints) : $ruleSpendPoints;\n\n $minPoints = $minPoints ? min($minPoints, $ruleMinPoints) : $ruleMinPoints;\n\n if ($ruleMinPoints <= $ruleMaxPoints) {\n $quoteSubTotal -= $ruleMaxPoints / $ruleSpendPoints * $monetaryStep;\n $totalPoints += $ruleMaxPoints;\n }\n\n if ($rule->getSpendingStyle($customer) == SpendingStyleInterface::STYLE_FULL) {\n $roundedTotalPoints = floor($totalPoints / $ruleSpendPoints) * $ruleSpendPoints;\n if ($roundedTotalPoints < $totalPoints) {\n $totalPoints = $roundedTotalPoints + $ruleSpendPoints;\n } else {\n $totalPoints = $roundedTotalPoints;\n }\n if ($totalPoints > $balancePoints) {\n $totalPoints = floor($balancePoints / $ruleSpendPoints) * $ruleSpendPoints;\n }\n }\n\n if ($rule->getIsStopProcessing()) {\n break;\n }\n }\n }\n foreach ($this->validItems as $ruleId => $items) {\n $itemPoints = array_merge($itemPoints, $items);\n }\n if ($minPoints > $totalPoints) {\n $minPoints = $totalPoints = 0;\n }\n\n return new \\Magento\\Framework\\DataObject([\n 'min_points' => $minPoints,\n 'max_points' => $totalPoints,\n 'item_points' => $itemPoints,\n ]);\n }", "function GetItemTypeQuantityItems($itemid)\n {\n $dbh=$this->getdbh();\n $sql = \"SELECT it.Id as 'itemid', itp.ID as 'itemtypeid', it.Name as 'itemname', itp.type, itp.itemtypegroup as 'group', iitq.quantity, iitq.availablequantity FROM \".$this->enquote(\"Item\").\" as it \"\n .'inner join malikah.itemitemtype as iit on iit.ItemID = it.Id '\n .'inner join malikah.itemtype as itp on itp.ID = iit.ItemTypeID '\n .'inner join malikah.itemitemtypequantity as iitq '\n .'on iitq.ItemID = iit.ItemID and iitq.ItemTypeID = itp.ID '\n .'WHERE it.Id =?';\n $stmt = $dbh->prepare($sql);\n $stmt->bindValue(1,(int)$itemid);\n $stmt->execute();\n $arr=array();\n while ($Items = $stmt->fetch(PDO::FETCH_ASSOC))\n {\n if(!isset($arr[$Items[\"group\"]]))\n {\n $arr[$Items[\"group\"]] = array();\n array_push($arr[$Items[\"group\"]], $Items);\n }\n else\n {\n array_push($arr[$Items[\"group\"]], $Items);\n }\n }\n\n return $arr;\n }", "public function getPhysicalQuantities();", "public function getMinimumQuantity();", "public function sumItemsQuantity();", "public function GetLowQuantityProduct() : array\n {\n return $this->SearchQuery(\"SELECT product.*, product_catalog.catalogName as 'catalogName' FROM `product` INNER JOIN product_catalog ON product.catalogID = product_catalog.catalogID WHERE product.productQuantity < 10;\");\n }", "public function getMinQuantity();", "public function getSpecifiedDiscountItemKeys()\n {\n $keys = array();\n if (count($this->getDiscounts()) > 0) {\n foreach($this->getDiscounts() as $key => $discount) {\n\n if ($discount->getTo() != Discount::$toSpecified) {\n continue;\n }\n\n $shipments = $discount->getItems();\n if (count($discount->getItems()) > 0) {\n foreach($discount->getItems() as $itemKey => $qty) {\n $keys[$itemKey] = $itemKey;\n }\n }\n }\n }\n return $keys;\n }", "public function group_quantities($cart_items, $rule)\n {\n $quantities = array();\n\n // Iterate over group products\n foreach ($rule['group_products'] as $group_product_key => $group_product) {\n\n $match_found = false;\n\n // Iterate over cart items\n foreach ($cart_items as $cart_item_key => $cart_item) {\n\n // Check condition against current cart item\n if (RP_WCDPD_Conditions::conditions_are_matched(array($group_product), array('cart_item' => $cart_item))) {\n\n // Add to main array\n $quantities[$group_product_key][$cart_item_key] = $cart_item['quantity'];\n $match_found = true;\n }\n }\n\n // Match not found\n if (!$match_found) {\n $quantities[$group_product_key] = null;\n }\n }\n\n // Return quantities\n return $quantities;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a relation from a table to another table using a custom column Tip: The action field can be one of these 3 actions: cascade, restrict, set null
public function addRelation(string $fromTable, string $toTable, string $relationColumn = 'id', string $action = 'cascade');
[ "protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }", "protected function _addRelationFieldInLocalModel() {\n if (!$this->isSingular()) {\n return;\n }\n\n //$column = Garp_Spawn_Relation_Set::getRelationColumn($this->name);\n $column = $this->column;\n $fieldParams = array(\n 'model' => $this->model,\n 'type' => 'numeric',\n 'editable' => true,\n 'visible' => true,\n 'primary' => $this->primary,\n 'required' => $this->required,\n 'relationAlias' => $this->name,\n 'relationType' => $this->type\n );\n if ($this->multilingual && $this->_localModel->isMultilingual()) {\n // The relation is added to the i18n model by Garp_Spawn_Config_Model_I18n\n return;\n }\n $this->_localModel->fields->add('relation', $column, $fieldParams);\n }", "function intoto_crm_add_relation_to_contact($form, &$form_state)\r\n{\r\n\t$reverse = $form_state['crm_core_contact']->relationship['reverse'];\r\n\t\r\n\t$new_contact = [];\r\n\t$new_contact['entity_type'] = 'crm_core_contact';\r\n\t$new_contact['entity_id'] = $form_state['crm_core_contact']->contact_id;\r\n\t$new_contact['entity_bundle'] = $form_state['crm_core_contact']->type;\r\n\t$new_contact['r_index'] = 1 - $reverse;\r\n\t$new_contact['entity_key'] = $new_contact['entity_type'] . ':' . $new_contact['entity_id'];\r\n\r\n\t$old_contact_entity_obj = $form_state['crm_core_contact']->relationship['source'];\r\n\t$old_contact['entity_type'] = 'crm_core_contact';\r\n\t$old_contact['entity_id'] = $old_contact_entity_obj->contact_id;\r\n\t$old_contact['entity_bundle'] = $old_contact_entity_obj->type;\r\n\t$old_contact['r_index'] = $reverse;\r\n\t$old_contact['entity_key'] = $old_contact['entity_type'] . ':' . $old_contact['entity_id'];\r\n\t\t\t\r\n\r\n\t$relationship_type = $form_state['crm_core_contact']->relationship['relation_type'];\r\n\r\n\t\r\n\t$endpoints = array(\r\n\t\t$reverse\t\t=> $old_contact,\r\n\t\t(1 - $reverse)\t=> $new_contact,\r\n\t);\r\n\r\n\t$relation = relation_create($relationship_type, $endpoints);\r\n\t$rid = relation_save($relation);\r\n\t//$form_state['relation'] = $relation;\t\r\n}", "public function addForeignKey(ForeignKey $foreignKey);", "public function add_relation($source_id, $destination_id, $type_id, $author_id) {\r\n \r\n $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */';\r\n $time = $this->db->db_now();\r\n $sql = \" $debugMsg INSERT INTO \".$this->db->get_table('req_relations').\" \" . \r\n \" (source_id, destination_id, relation_type, author_id, creation_ts) \" .\r\n \" values ($source_id, $destination_id, $type_id, $author_id, $time)\";\r\n $this->db->exec_query($sql);\r\n }", "protected function setRelation()\n {\n $name = $this->name;\n /** @var $target EntityInterface */\n $target = $this->source->$name;\n if( $target instanceof Collection || is_array( $target ) ) {\n $target = $target[0];\n }\n if( !$target->isIdPermanent() ) {\n $this->linked = false;\n return;\n }\n $sourceColumn = $this->info[ 'source' ];\n $targetColumn = $this->info[ 'target' ];\n $value = $target[ $targetColumn ];\n $this->source[ $sourceColumn ] = $value;\n $this->linked = true;\n }", "public function addRelationship(string $name, $relationship);", "public function addRelation($tablename, $arg1, $arg2=FALSE) {\n\t\tif ($arg2) {\n\t\t\t$origKey = $arg1;\n\t\t\t$targetKey = $arg2;\n\t\t}\n\t\telse {\n\t\t\t$origKey = self::$primaryKey[$this->table];\n\t\t\t$targetKey = $arg1;\n\t\t}\n\t\tif (isset(self::$global['dbCon']) && self::$global['dbCon']==$this->connection) \n\t\t\t$table = new table ($tablename);\n\t\telse {\n\t\techo 'ceva'.$tablename;\n\t\t\t$table = new table ($tablename,FALSE,FALSE,$this->connection);\n\t\t}\n\t\tif (isset($table->$targetKey)) {\n\t\t\tself::$relations[$this->table][$tablename] = new stdClass();\n\t\t\tself::$relations[$this->table][$tablename]->origKey = $origKey;\n\t\t\tself::$relations[$this->table][$tablename]->targetKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table] = new stdClass();\n\t\t\tself::$relations[$tablename][$this->table]->origKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table]->targetKey = $origKey;\n\t\t\tself::$relations[$tablename][$this->table]->type = self::$relations[$this->table][$tablename]->type = NOT_ANALYZED;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"$targetKey column doesn't exist in $tablename\");\n\t\t}\n\t\t$this->analyzeRelations();\n\t\treturn $this;\n\t}", "public function addForeignKeys()\n {\n }", "function add_entity_relationship($guid_one, $relationship, $guid_two) {\n\treturn _elgg_services()->relationshipsTable->add($guid_one, $relationship, $guid_two);\n}", "public function addFK( $type, $targetType, $field, $targetField);", "function create_relationship( $post_type, $taxonomy ) {\n\tadd_action( 'wp_insert_post', create_shadow_term( $post_type, $taxonomy ) );\n\tadd_action( 'before_delete_post', delete_shadow_term( $taxonomy ) );\n}", "public function addRelation(RelationInterface $relation): void;", "public function addPartyRelation() {\r\n $this->addRelation('party');\r\n }", "public function newForeignKeyColumn($columnName, $referenceColumnName);", "public function associateRelation(Model $model, $relation, Model $value);", "public function addFK( $type, $targetType, $property, $targetProperty, $isDep = false );", "public function addForeignKey($tableName, $schemaName, $reference);", "public function addRelation(ModelRelationInterface $relation);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation updateDeviceCameraVideoSettingsAsyncWithHttpInfo Update video settings for the given camera
public function updateDeviceCameraVideoSettingsAsyncWithHttpInfo($serial, $update_device_camera_video_settings = null) { $returnType = 'object'; $request = $this->updateDeviceCameraVideoSettingsRequest($serial, $update_device_camera_video_settings); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $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(), $response->getBody() ); } ); }
[ "protected function updateDeviceCameraVideoSettingsRequest($serial, $update_device_camera_video_settings = null)\n {\n // verify the required parameter 'serial' is set\n if ($serial === null || (is_array($serial) && count($serial) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $serial when calling updateDeviceCameraVideoSettings'\n );\n }\n\n $resourcePath = '/devices/{serial}/camera/video/settings';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($serial !== null) {\n $resourcePath = str_replace(\n '{' . 'serial' . '}',\n ObjectSerializer::toPathValue($serial),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_device_camera_video_settings)) {\n $_tempBody = $update_device_camera_video_settings;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getDeviceCameraVideoSettingsAsyncWithHttpInfo($serial)\n {\n $returnType = 'object';\n $request = $this->getDeviceCameraVideoSettingsRequest($serial);\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 testUpdateDeviceCameraVideoSettings()\n {\n }", "public function updateCSPMPolicySettingsAsyncWithHttpInfo($body)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\RegistrationPolicySettingsResponseV1';\n $request = $this->updateCSPMPolicySettingsRequest($body);\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 = (string) $responseBody;\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 updateDeviceCameraVideoSettings($serial, $update_device_camera_video_settings = null)\n {\n list($response) = $this->updateDeviceCameraVideoSettingsWithHttpInfo($serial, $update_device_camera_video_settings);\n return $response;\n }", "public function updateMfaSettingsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\AccountMfaSettings';\n $request = $this->updateMfaSettingsRequest($body);\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 updateDeviceWirelessBluetoothSettingsAsyncWithHttpInfo($serial, $update_device_wireless_bluetooth_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateDeviceWirelessBluetoothSettingsRequest($serial, $update_device_wireless_bluetooth_settings);\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 updateOrganizationAdaptivePolicySettingsAsyncWithHttpInfo($organization_id, $update_organization_adaptive_policy_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateOrganizationAdaptivePolicySettingsRequest($organization_id, $update_organization_adaptive_policy_settings);\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 putWebchatSettingsAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\WebChatSettings';\n $request = $this->putWebchatSettingsRequest($body);\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 updateDeviceWirelessRadioSettingsAsyncWithHttpInfo($serial, $update_device_wireless_radio_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateDeviceWirelessRadioSettingsRequest($serial, $update_device_wireless_radio_settings);\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 postMediaCacheConfigAdvAsyncWithHttpInfo($server_name, $body)\n {\n $returnType = '';\n $request = $this->postMediaCacheConfigAdvRequest($server_name, $body);\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 updateDeviceCameraQualityAndRetentionAsyncWithHttpInfo($serial, $update_device_camera_quality_and_retention = null)\n {\n $returnType = 'object';\n $request = $this->updateDeviceCameraQualityAndRetentionRequest($serial, $update_device_camera_quality_and_retention);\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 patchOutboundSettingsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->patchOutboundSettingsRequest($body);\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 colorProfilesUpdateAsyncWithHttpInfo($id, $tenant_id = null, $metadata_description = null, $metadata_model = null, $metadata_copyright = null, $metadata_manufacturer = null, $metadata_color_space = null, $metadata_device_class = null, $file = null, $path = null, $name = null, $custom_fields = null)\n {\n $returnType = '\\Aurigma\\AssetStorage\\Model\\ColorProfileDto';\n $request = $this->colorProfilesUpdateRequest($id, $tenant_id, $metadata_description, $metadata_model, $metadata_copyright, $metadata_manufacturer, $metadata_color_space, $metadata_device_class, $file, $path, $name, $custom_fields);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }", "public function putWebchatSettingsAsync($body)\n {\n return $this->putWebchatSettingsAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function updateNetworkWirelessBluetoothSettingsAsyncWithHttpInfo($network_id, $update_network_wireless_bluetooth_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkWirelessBluetoothSettingsRequest($network_id, $update_network_wireless_bluetooth_settings);\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 clientSettingsGetSystemSettingsAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->clientSettingsGetSystemSettingsRequest();\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 updateNetworkSwitchSettingsAsyncWithHttpInfo($network_id, $update_network_switch_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkSwitchSettingsRequest($network_id, $update_network_switch_settings);\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 updateNetworkApplianceVlansSettingsAsyncWithHttpInfo($network_id, $update_network_appliance_vlans_settings = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkApplianceVlansSettingsRequest($network_id, $update_network_appliance_vlans_settings);\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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Overhead Output filter links for overheads for a specific admin repair tool
function bbp_admin_repair_tool_overhead_filters($args = array()) { }
[ "function bbp_get_admin_repair_tool_overhead_filters($args = array())\n{\n}", "function bbp_get_admin_repair_tool_page()\n{\n}", "function filter_link() {\n return '???';\n }", "function smarty_outputfilter_shorturls($source, &$smarty)\n{\n // Credits to / Crediti a:\n // ColdRolledSteel: for creating this file and the rewrite rules / per aver creato questo file e le regole di riscrittura\n // msandersen: for tweaking this file and the rewrite rules / per aver aggiornato questo file e le regole di riscrittura\n // CHTEKK: adaptation for eNvolution, writing/rewriting of many rules, italian translation and on/off variable / adattazione ad eNvolution, scrittura/riscrittura di diverse regole, traduzione italiana e variabile on/off\n //\n // ENG\n // If you control the server, it is preferable for better performance to put rewrite rules\n // from the .htaccess file into main configuration file, httpd.conf.\n //\n // Rule Legend (the order doesn't match the one in .htaccess)\n //\n // 1-5: Modules with url's like index.php?name=MODULE and PNphpBB2 v1.1, v1.1a\n // 6: Outbox in Private Messages: Messages-outbox.html\n // 7: Inbox in Private Messages: Messages-inbox.html\n // 8: Search by author: Search-author-[user].html\n // 9: Search by topic: Search-topics-[topicID].html\n // 10: Print function for subjects module: Printsubjects-[subjectID]-[pagesmode].html\n // 11: General function for subjects module: Subjectsfuncs-[function].html\n // 12: Daily Archive functions: daily_archive-[function].html\n // 13: Daily Archive with year and month: daily_archive-[year]-[month].html\n // 14: Daily Archive with year, month and day: daily_archive-[year]-[month]-[day].html\n // 15: eNvolution News Extension in index.php: News-hometopicmore-[startrow].html\n // 16: eNvolution News Extension: News-topicmore-[topicID]-[startrow].html\n // 17: NS-User_Points module index: User_Points.html\n // 18: PostCalendar events: PostCalendar-event-[eventID]-[day]-[month]-[year].html\n // 19: PostCalendar monthly calendar view: PostCalendar-[day]-[month]-[year].html\n // 20: PostCalendar calendar view with template: PostCalendar-[day]-[month]-[year]-['day'|'week'|'month'|'year']-[template].html\n // 21: PostCalendar calendar view: PostCalendar-[day]-[month]-[year]-['day'|'week'|'month'|'year'].html\n // 22: PostCalendar general function, like 'search' or 'submit'\n // 23: Poll-[pollID].html\n // 24: Module (old style call) with a single req parameter: [module]+[parameter].html eg Downloads+MostPopular.html\n // 25: Module (old style call) default action: [module].html, eg News.html\n // 26: Module (new style call) default action: [module]-main.html\n // 27: Article Full Story: displayarticle[StoryID].html\n // 24: Article Full Story, comment mode specified: displayarticle[StoryID]-[mode].html\n // 29: Send an email about an article: sendarticle[storyID].html\n // 30: Section-X.html\n // 31: Sections-articleX-p[page].html\n // 32: Print an article: printarticle[StoryID].html\n // 33: List category: Category[CatID].html\n // 34: List stories for a topic: Category[CatID]-All.html\n // 35: List all sories on a topic: Topic[Topic]allstories.html\n // 36: FAQ-CategoryX-[Category]-ParentX-myfaq-[yes].html\n // 37: Content Express menu-only links\n // 38: Content Express content links\n // 39-41: Renders generic links for old-style modules\n // 42: New-style module calls with one parameter\n // 43: User informations: UserInfo-[user].html\n // 44: User registration: UserReg.html\n // 45: User registration with age check: UserReg-CheckAge.html\n // 46: User login: UserLogin.html\n // 47: User \"find lost password\": User-LostPassword.html\n // 48: Module (new style call eNvolution, based on rule 21) default action: [module]-main.html\n //\n // For PostCalendar 3, use this format in the $in array:\n // $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view(?:&(?:amp;)?tplview=)?&(?:amp;)?viewtype=([^&]\\w+)&(?:amp;)?Date=(\\d{2})/(\\d{2})/(\\d{4})\"|',\n // and the following in the corresponding position in the $out array:\n // '\"PostCalendar3-$3-$2-$4-$1.html\"|',\n // and add this to the .htaccess file:\n // RewriteRule ^PostCalendar3-([0-9]{2})-([0-9]{2})-([0-9]{4})-([a-zA-Z_]+)\\.html$ index.php?module=PostCalendar&func=view&viewtype=$4&Date=$2/$1/$3 [L,NC]\n //\n // ITA\n // Se controlli tu il server, è preferibile inserire le regole di riscrittura dal file\n // .htaccess nel file di configurazione principale, httpd.conf, per aumentare la velocità.\n //\n // Legenda regole (l'ordine non corrisponde a quello in .htaccess)\n //\n // 1-5: Moduli con url del tipo index.php?name=MODULO e PNphpBB2 v1.1, v1.1a\n // 6: Posta Inviata dei Messaggi Privati: Messages-outbox.html\n // 7: Posta In Arrivo dei Messaggi Privati: Messages-inbox.html\n // 8: Ricerca per autore: Search-author-[utente].html\n // 9: Ricerca per argomento: Search-topics-[IDargomento].html\n // 10: Stampa pagine per il modulo subjects: Printsubjects-[IDcontenuto]-[modalitàpagine].html\n // 11: Funzione generale per il modulo subjects: Subjectsfuncs-[funzione].html\n // 12: Funzioni Diario News: daily_archive-[funzione].html\n // 13: Diario News con anno e mese: daily_archive-[anno]-[mese].html\n // 14: Diario News con anno, mese e giorno: daily_archive-[anno]-[mese]-[giorno].html\n // 15: Estensione News di eNvolution nell'index.php: News-hometopicmore-[filadipartenza].html\n // 16: Estensione News di eNvolution: News-topicmore-[IDargomento]-[filadipartenza].html\n // 17: Pagina principale modulo NS-User_Points: User_Points.html\n // 18: Eventi PostCalendar: PostCalendar-event-[IDevento]-[giorno]-[mese]-[anno].html\n // 19: Vista mensile calendario PostCalendar: PostCalendar-[giorno]-[mese]-[anno].html\n // 20: Vista calendario con template PostCalendar: PostCalendar-[giorno]-[mese]-[anno]-['giorno'|'settimana'|'mese'|'anno']-[template].html\n // 21: Vista calendario PostCalendar: PostCalendar-[giorno]-[mese]-[anno]-['giorno'|'settimana'|'mese'|'anno'].html\n // 22: Funzione generale di PostCalendar, come 'cerca' o 'invia'\n // 23: Polls-[IDsondaggio].html\n // 24: Modulo (chiamata vecchio stile) con un singolo parametro: [modulo]+[parametro].html es Downloads+MostPopular.html\n // 25: Azione predefinita Modulo (chiamata vecchio stile): [modulo].html, eg News.html\n // 26: Azione predefinita Modulo (chiamata nuovo stile): [modulo]-main.html\n // 27: Articolo leggi tutto: displayarticle[IDarticolo].html\n // 28: Articolo leggi tutto, modalità commento specificata: displayarticle[IDarticolo]-[modalità].html\n // 29: Invia un'E-Mail riguardo ad un'articolo: sendarticle[IDarticolo].html\n // 30: Section-X.html\n // 31: Sections-articleX-p[pagina].html\n // 32: Stampa un'articolo: printarticle[IDarticolo].html\n // 33: Lista categoria: Category[IDcategoria].html\n // 34: Lista articolo per un'argomento: Category[IDcategoria]-All.html\n // 35: Lista tutte le storie su un dato argomento: Topic[argomento]allstories.html\n // 36: FAQ-CategoryX-[categoria]-ParentX-myfaq-[si].html\n // 37: Link solo-menu di Content Express\n // 38: Link contenuti di Content Express\n // 39-41: Creano i link generali per i moduli vecchio stile\n // 42: Chiamata modulo nuovo stile con un singolo parametro\n // 43: Informazioni utente: UserInfo-[utente].html\n // 44: Registrazione utenti: UserReg.html\n // 45: Registrazione utenti con controllo età: UserReg-CheckAge.html\n // 46: Login utenti: UserLogin.html\n // 47: Utenti \"ritrova password dimenticata\": User-LostPassword.html\n // 48: Azione predefinita Modulo (chiamata nuovo stile eNvolution, si basa sulla 9): [modulo]-main.html\n //\n // Per PostCalendar 3, usa questo formato nell'array $in:\n // $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view(?:&(?:amp;)?tplview=)?&(?:amp;)?viewtype=([^&]\\w+)&(?:amp;)?Date=(\\d{2})/(\\d{2})/(\\d{4})\"|',\n // ed il seguente nella posizione corrispondente dell'array $out:\n // '\"PostCalendar3-$3-$2-$4-$1.html\"|',\n // ed aggiungi questo al file .htaccess:\n // RewriteRule ^PostCalendar3-([0-9]{2})-([0-9]{2})-([0-9]{4})-([a-zA-Z_]+)\\.html$ index.php?module=PostCalendar&func=view&viewtype=$4&Date=$2/$1/$3 [L,NC]\n //\n\n // get the sites base url\n $base_url = pnGetBaseURL();\n $prefix = '|\"(?:'.$base_url.')?';\n\n // determine the extension the site admin wants for site urls\n $extension = pnModGetVar('Xanthia', 'shorturlsextension');\n\n // ENG\n // (?i) means case insensitive; \\w='word' character; \\d=digit; (amp;)? means optional; (?:catid=)? means optional and won't capture string for backreferences\n // ITA\n // (?i) significa insensibile al caso; \\w='parola' carattere; \\d=numero; (amp;)? significa opzionale; (?:catid=)? significa opzionale e non catturerà la stringa per referenze precedenti\n\n $in = array(\n $prefix . 'index.php\\?newlang=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?theme=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\"|',\n $prefix . 'user.php\"|',\n $prefix . 'index.php\\?module=ppnews&(?:amp;)?choix=index\"|',\n $prefix . 'index.php\\?module=ppnews&(?:amp;)?choix=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=My_eGallery&(?:amp;)?do=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=My_eGallery&(?:amp;)?do=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=My_eGallery&(?:amp;)?do=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=My_eGallery&(?:amp;)?do=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=NS-User_Points&(?:amp;)?file=index\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=NS-Link_To_Us&(?:amp;)?file=index\"|',\n $prefix . 'index.php\\?name=Polls(?:&(?:amp;)?req=(\\w*))?&(?:amp;)?pollID=(\\d{1,2})?\"|',\n $prefix . 'index.php\\?name=Messages&(?:amp;)?file=outbox\"|',\n $prefix . 'index.php\\?name=Messages&(?:amp;)?file=index\"|',\n $prefix . 'index.php\\?name=Search&(?:amp;)?action=search&(?:amp;)?overview=1&(?:amp;)?active_stories=1&(?:amp;)?stories_author=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=Search&(?:amp;)?action=search&(?:amp;)?overview=1&(?:amp;)?active_stories=1&(?:amp;)?stories_topics\\[0\\]=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=Search&(?:amp;)?action=search&(?:amp;)?active_stories=1&(?:amp;)?stories_author=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=Search&(?:amp;)?action=search&(?:amp;)?active_stories=1&(?:amp;)?stories_topics\\[0\\]=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=daily_archive&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=daily_archive&(?:amp;)?func=display&(?:amp;)?req=get&(?:amp;)?year=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?month=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=daily_archive&(?:amp;)?func=display&(?:amp;)?req=get&(?:amp;)?year=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?month=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?day=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=daily_archive&(?:amp;)?func=display&(?:amp;)?req=get&(?:amp;)?year=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?month=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?day=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?page=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=News&(?:amp;)?startrow=(\\d{1,2})\"|',\n $prefix . 'index.php\\?name=News&(?:amp;)?topic=(\\d{1,2})&(?:amp;)?startrow=(\\d{1,2})\"|',\n $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view&(?:amp;)?Date=(\\d{4})(\\d{2})(\\d{2})(?:&(?:amp;)?tplview=)?&(?:amp;)?viewtype=details&(?:amp;)?eid=(\\d+)&(?:amp;)?print=\"|',\n $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view&(?:amp;)?tplview=default&(?:amp;)?viewtype=month&(?:amp;)?Date=(\\d{4})(\\d{2})(\\d{2})\"|',\n $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view&(?:amp;)?tplview=(\\w+)&(?:amp;)?viewtype=(\\w+)&(?:amp;)?Date=(\\d{4})(\\d{2})(\\d{2})(?:&(?:amp;)?pc_username=)?(?:&(?:amp;)?pc_category=)?(?:&(?:amp;)?pc_topic=)?(?:&(?:amp;)?print=)?\"|',\n $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=view(?:&(?:amp;)?tplview=)?&(?:amp;)?viewtype=(\\w+)&(?:amp;)?Date=(\\d{4})(\\d{2})(\\d{2})(?:&(?:amp;)?pc_username=)?(?:&(?:amp;)?pc_category=)?(?:&(?:amp;)?pc_topic=)?(?:&(?:amp;)?print=)?\"|',\n $prefix . 'index.php\\?module=PostCalendar&(?:amp;)?func=(\\w+[^&])\"|',\n $prefix . 'index.php\\?name=News&(?:amp;)?file=article&(?:amp;)?sid=(\\d+)\"|',\n $prefix . 'index.php\\?name=Recommend_Us&(?:amp;)?req=FriendSend&(?:amp;)?sid=(\\d+)\"|',\n $prefix . 'index.php\\?name=Sections&(?:amp;)?req=listarticles&(?:amp;)?secid=(\\d+)\"|',\n $prefix . 'index.php\\?name=Sections&(?:amp;)?req=viewarticle&(?:amp;)?artid=(\\d+)(?:&(?:amp;)?page=(\\d*))?\"|',\n $prefix . 'print.php\\?sid=(\\d+)\"|',\n $prefix . 'index.php\\?(?:&(?:amp;)?)?catid=(\\d+)\"|',\n $prefix . 'index.php\\?name=News&(?:amp;)?catid=(\\d{1,2})(?:&(?:amp;)?topic=(\\d{0,3}))?(?:&(?:amp;)?allstories=1)?\"|',\n $prefix . 'index.php\\?name=News&(?:amp;)?catid=?&(?:amp;)?topic=(\\d{1,3})(?:&(?:amp;)?(all)stories=1)?\"|',\n $prefix . 'index.php\\?name=FAQ&(?:amp;)?myfaq=(\\w+)&(?:amp;)?id_cat=(\\d+)&(?:amp;)?categories=([^&-]+)&(?:amp;)?parent_id=(\\d+)\"|',\n $prefix . 'index.php\\?name=PNphpBB2\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=index\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=PNphpBB2&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'user.php\\?op=userinfo&(?:amp;)?uname=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'user.php\\?op=register&(?:amp;)?module=NewUser\"|',\n $prefix . 'user.php\\?op=check_age&(?:amp;)?module=NewUser\"|',\n $prefix . 'user.php\\?op=loginscreen&(?:amp;)?module=User\"|',\n $prefix . 'user.php\\?op=lostpassscreen&(?:amp;)?module=LostPassword\"|',\n $prefix . 'user.php\\?module=User&(?:amp;)?op=logout\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=index\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=main\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=main[#]([\\w\\d]*)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'index.php\\?module=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?func=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"[#]([\\w\\d]*)|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=index&(?:amp;)?req=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=index\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)\"|',\n $prefix . 'modules.php\\?op=modload&(?:amp;)?name=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?file=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)&(?:amp;)?([\\w\\d\\.\\:\\_\\/]+)=([\\w\\d\\.\\:\\_\\/]+)[#]([\\w\\d]*)\"|'\n );\n\n //$base_url = '';\n $out = array(\n '\"'.$base_url.'changelang-$1.'.$extension.'\"',\n '\"'.$base_url.'changetheme-$1.'.$extension.'\"',\n '\"'.$base_url.'index.'.$extension.'\"',\n '\"'.$base_url.'user.'.$extension.'\"',\n '\"'.$base_url.'ppnews-index.'.$extension.'\"',\n '\"'.$base_url.'ppnews-$1.'.$extension.'\"',\n '\"'.$base_url.'MeG-$1.'.$extension.'\"',\n '\"'.$base_url.'MeG-$1-$2-$3.'.$extension.'\"',\n '\"'.$base_url.'MeG-$1-$2-$3-$4-$5.'.$extension.'\"',\n '\"'.$base_url.'MeG-$1-$2-$3-$4-$5-$6-$7.'.$extension.'\"',\n '\"'.$base_url.'User_Points.'.$extension.'\"',\n '\"'.$base_url.'Link_To_Us.'.$extension.'\"',\n '\"'.$base_url.'Poll-$2$1.'.$extension.'\"',\n '\"'.$base_url.'Messages-outbox.'.$extension.'\"',\n '\"'.$base_url.'Messages-inbox.'.$extension.'\"',\n '\"'.$base_url.'Search-author-$1.'.$extension.'\"',\n '\"'.$base_url.'Search-topics-$1.'.$extension.'\"',\n '\"'.$base_url.'Search-author-$1-no.'.$extension.'\"',\n '\"'.$base_url.'Search-topics-$1-no.'.$extension.'\"',\n '\"'.$base_url.'daily_archive-$1.'.$extension.'\"',\n '\"'.$base_url.'daily_archive-$1-$2.'.$extension.'\"',\n '\"'.$base_url.'daily_archive-$1-$2-$3.'.$extension.'\"',\n '\"'.$base_url.'daily_archive-$1-$2-$3-$4.'.$extension.'\"',\n '\"'.$base_url.'News-hometopicmore-$1.'.$extension.'\"',\n '\"'.$base_url.'News-topicmore-$1-$2.'.$extension.'\"',\n '\"'.$base_url.'PostCalendar-$3-$2-$1-event-$4.'.$extension.'\"',\n '\"'.$base_url.'PostCalendar-$3-$2-$1.'.$extension.'\"',\n '\"'.$base_url.'PostCalendar-$5-$4-$3-$2-$1.'.$extension.'\"',\n '\"'.$base_url.'PostCalendar-$4-$3-$2-$1.'.$extension.'\"',\n '\"'.$base_url.'PostCalendar-$1.'.$extension.'\"',\n '\"'.$base_url.'Article$1.'.$extension.'\"',\n '\"'.$base_url.'SendArticle$1.'.$extension.'\"',\n '\"'.$base_url.'Section-$1.'.$extension.'\"',\n '\"'.$base_url.'Sections-article$1-p$2.'.$extension.'\"',\n '\"'.$base_url.'PrintArticle$1.'.$extension.'\"',\n '\"'.$base_url.'Category$1.'.$extension.'\"',\n '\"'.$base_url.'Category$1-All.'.$extension.'\"',\n '\"'.$base_url.'Topic$1$2.'.$extension.'\"',\n '\"'.$base_url.'FAQ-Category$2-$3-Parent$4-myfaq-$1.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2-$1.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2-$1-$2-$3.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5-$6-$7.'.$extension.'\"',\n '\"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'\"',\n '\"'.$base_url.'UserInfo-$1.'.$extension.'\"',\n '\"'.$base_url.'UserReg.'.$extension.'\"',\n '\"'.$base_url.'UserReg-CheckAge.'.$extension.'\"',\n '\"'.$base_url.'User-Login.'.$extension.'\"',\n '\"'.$base_url.'User-LostPassword.'.$extension.'\"',\n '\"'.$base_url.'User-Logout.'.$extension.'\"',\n '\"'.$base_url.'$1.'.$extension.'\"',\n '\"'.$base_url.'$1.'.$extension.'\"',\n '\"'.$base_url.'$1-$2.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'\"',\n '\"'.$base_url.'$1.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6-$7.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'\"',\n '\"'.$base_url.'module-$1.'.$extension.'\"',\n '\"'.$base_url.'module-$1.'.$extension.'#$2\"',\n '\"'.$base_url.'module-$1.'.$extension.'\"',\n '\"'.$base_url.'module-$1.'.$extension.'#$2\"',\n '\"'.$base_url.'module-$1-$2.'.$extension.'\"',\n '\"'.$base_url.'module-$1-$2.'.$extension.'#$3\"',\n '\"'.$base_url.'module-$1-$2-$3-$4.'.$extension.'\"',\n '\"'.$base_url.'module-$1-$2-$3-$4.'.$extension.'#$5\"',\n '\"'.$base_url.'module-$1-$2-$3-$4-$5-$6.'.$extension.'\"',\n '\"'.$base_url.'module-$1-$2-$3-$4-$5-$6.'.$extension.'#$7\"',\n '\"'.$base_url.'module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'\"',\n '\"'.$base_url.'module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9\"',\n '\"'.$base_url.'$1+$2.'.$extension.'\"',\n '\"'.$base_url.'$1.'.$extension.'\"',\n '\"'.$base_url.'$1-$2.'.$extension.'\"',\n '\"'.$base_url.'$1-$2.'.$extension.'#$3\"',\n '\"'.$base_url.'$1-$2-$3-$4.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4.'.$extension.'#$5\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'#$7\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'\"',\n '\"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9\"'\n );\n\n $source = preg_replace($in, $out, $source);\n\n // Debugging / Ricerca errori\n // echo\"<div align=\\\"left\\\"><pre>\"; print_r($in); echo \"</pre></div>\";\n // echo\"<div align=\\\"left\\\"><pre>\"; print_r($out); echo \"</pre></div>\";\n // ENG\n // Debugging code to save what is generated, in case the output is mangled\n // so horribly that the browser won't display it.\n // Make sure that the path and file specified in the fopen() exist and is writeable.\n // ITA\n // Codice ricerca errori per salvare ciò che viene generato, nel caso il risultato fosse\n // così orribilmente sbagliato che il browser non lo visualizzi.\n // Assicurati che il percorso specificato in fopen() esista e sia scrivibile.\n //\n // $fp=fopen(\"/var/www/html/themes/$GLOBALS[thename]/debug.log\", \"a\");\n // fwrite($fp, $s);\n // fclose($fp);\n // $s .= \"<!-- simplify_urls -->\";\n\n return $source;\n}", "function createAdminSuggestion() {\n\t\t$output = \"\";\n\t\t$this->parent->loadAllModules();\n\t\tforeach ($this->parent->modules as $name => $module) {\n\t\t\tif (!$module->linker) {\n\t\t\t\t$pluginOptions = 0;\n\t\t\t\tforeach ($module->plugins as $pname) {\n\t\t\t\t\tif (count($this->parent->loadedPlugins[$pname]->admOptions) != 0)\n\t\t\t\t\t$pluginOptions++;\n\t\t\t\t}\n\t\t\t\tif ($pluginOptions==0 && $module->options[CONS_MODULE_SYSTEM]) continue;\n\n\t\t\t\t$listing = isset($module->options[CONS_MODULE_LISTING])?implode(\",\",$module->options[CONS_MODULE_LISTING]):\"\";\n\t\t\t\t$listingTotal = 0;\n\t\t\t\tif ($listing == \"\") {\n\t\t\t\t\tforeach ($module->fields as $fname => $field) {\n\t\t\t\t\t\tif ($field[CONS_XML_TIPO] == CONS_TIPO_TEXT && isset($field[CONS_XML_HTML])) continue; // don't want textearea\n\t\t\t\t\t\tif (!in_array($fname,$module->keys) && $field[CONS_XML_TIPO] != CONS_TIPO_UPLOAD && (!isset($field[CONS_XML_META]) || $field[CONS_XML_META] != \"password\")) {\n\t\t\t\t\t\t\tif ($field[CONS_XML_TIPO] == CONS_TIPO_LINK) {\n\t\t\t\t\t\t\t\t$rmodule = substr($fname,3); // removes the mandatory id_ in front of links\n\t\t\t\t\t\t\t\tif (in_array($rmodule,array(\"group\",\"from\",\"to\",\"as\",\"having\",\"order\",\"by\",\"join\",\"left\",\"right\"))) // reserved words that could cause issues on the SQL\n\t\t\t\t\t\t\t\t$rmodule .= \"s\"; # keyword, add a \"s\" to prevent it from causing SQL problems\n\t\t\t\t\t\t\t\t$listing .= $rmodule.\"_\".$this->parent->modules[$field[CONS_XML_MODULE]]->title.\",\";\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t$listing .= $fname.\",\";\n\t\t\t\t\t\t\t$listingTotal++;\n\t\t\t\t\t\t\tif ($listingTotal >= 8) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ao = $this->getAdminOptions($module);\n\t\t\t\tif ($listing != \"\" && count($ao)>0) {\n\t\t\t\t\tif ($listing[strlen($listing)-1] == ',')\n\t\t\t\t\t\t$listing = substr($listing,0,strlen($listing)-1);\n\t\t\t\t\t$output .= \"<\".strtoupper($name).\" icon=\\\"list\\\" listing=\\\"\".$listing.\"\\\">\\n\";\n\t\t\t\t\tforeach ($ao as $aoname => $action) {\n\t\t\t\t\t\t$output .= \"\\t<\".$aoname.\">\".$action.(strpos($action,\".\")===false?\".html\":\"\").\"</\".$aoname.\">\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$output .= \"</\".strtoupper($name).\">\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// some scripts might add administrative options without being in a module\n\t\tforeach ($this->parent->loadedPlugins as $pname => $pl) {\n\t\t\tif (count($pl->admOptions) != 0 && $pl->moduleRelation == '') {\n\t\t\t\t$output .= \"<\".strtoupper($pname).\" icon=\\\"list\\\">\\n\";\n\t\t\t\tforeach ($pl->admOptions as $aoname => $action) {\n\t\t\t\t\t$output .= \"\\t<\".$aoname.\">\".$action.(strpos($action,\".\")===false?\".html\":\"\").\"</\".$aoname.\">\\n\";\n\t\t\t\t}\n\t\t\t\t$output .= \"</\".strtoupper($pname).\">\\n\";\n\t\t\t}\n\t\t}\n\t\tif (!CONS_ONSERVER) cWriteFile(CONS_PATH_PAGES.$_SESSION['CODE'].\"/_config/admin_suggestion.xml\",$output);\n\t\tif (!is_file(CONS_PATH_PAGES.$_SESSION['CODE'].\"/_config/admin.xml\")) // no actual admin, use this suggestion to avoid errors\n\t\t\tcWriteFile(CONS_PATH_PAGES.$_SESSION['CODE'].\"/_config/admin.xml\",$output);\n\t}", "function rtSuppFilesOutputFilter($output, &$templateMgr) {\n\t\t$article =& $templateMgr->get_template_vars('article');\n\t\t$currentJournal =& $templateMgr->get_template_vars('currentJournal');\t\t\n\t\t$dvStudyDao =& DAORegistry::getDAO('DataverseStudyDAO');\t\t\t\t\n\t\t$study =& $dvStudyDao->getStudyBySubmissionId($article->getId());\n\t\tif (isset($study)) {\n\t\t\t$dvFileDao =& DAORegistry::getDAO('DataverseFileDAO');\n\t\t\tforeach ($article->getSuppFiles() as $suppFile) {\n\t\t\t\t$dvFile = $dvFileDao->getDataverseFileBySuppFileId($suppFile->getId(), $article->getId());\n\t\t\t\tif (isset($dvFile)) {\n\t\t\t\t\t// Find and replace local download link w/ dataset URI \n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\t'page' => 'article',\n\t\t\t\t\t\t\t'op' => 'downloadSuppFile',\n\t\t\t\t\t\t\t'path' => array($article->getBestArticleId(), $suppFile->getBestSuppFileId($currentJournal))\n\t\t\t\t\t);\n\t\t\t\t\t$suppFileUrl = $templateMgr->smartyUrl($params, $templateMgr);\n\t\t\t\t\t$pattern = '/<a href=\"'. preg_quote($suppFileUrl, '/') .'\" class=\"action\">.+?<\\/a>/';\n\t\t\t\t\t$replace = '<a href=\"'. $study->getPersistentUri() .'\" class=\"action\">'. __('plugins.generic.dataverse.suppFiles.view') .'</a>';\n\t\t\t\t\t$output = preg_replace($pattern, $replace, $output);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$templateMgr->unregister_outputfilter('rtSuppFilesOutputFilter');\n\t\treturn $output;\n\t}", "public function add_filter_links()\n {\n }", "protected function link_manager() {\n\t\tadd_filter( 'pre_option_link_manager_enabled', '__return_true' );\n\t}", "function bbp_get_tools_admin_pages()\n{\n}", "private function action_filters() {\n\t\t\tadd_action( 'current_screen', array( $this, 'conditional_hooks' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\t\tadd_action( 'tve_after_db_migration', array( $this, 'insert_default_data' ), 10, 1 );\n\t\t\tadd_action( 'rest_api_init', array( $this, 'create_initial_rest_routes' ) );\n\n\t\t\tadd_filter( 'tve_dash_filter_features', array( $this, 'smart_site_feature' ) );\n\t\t\tadd_filter( 'tcb_inline_shortcodes', array( $this, 'smart_site_tcb_shortcodes' ), 10, 1 );\n\t\t\tadd_filter( 'tcb_dynamiclink_data', array( $this, 'smart_site_links_shortcodes' ) );\n\t\t\tadd_filter( 'tcb_content_allowed_shortcodes', array( $this, 'allowed_shotcodes' ) );\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue_scripts' ), 11 );\n\t\t}", "function prepare_display_materials() {\n\tglobal $autolink;\n\tif ($autolink) {\n\t\t// Make sure 'cache/autolink.dat'\n\t\t$file = CACHE_DIR . PKWK_AUTOLINK_REGEX_CACHE;\n\t\tif (!file_exists($file)) {\n\t\t\t// Re-create autolink.dat\n\t\t\tput_lastmodified();\n\t\t}\n\t}\n}", "function home_filter()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif($data['t'] == 'best_evaluated_bidders') $data['listtype'] = 'best_bidders';\n\t\t\n\t\t$this->load->view($this->get_section_folder($data['t']).'/list_filter', $data);\n\t}", "public function actualizeLinks() {\n $sql1 = \"SELECT module FROM vtiger_pdfmaker GROUP BY module\";\n $result1 = $this->db->query($sql1);\n\n while ($row = $this->db->fetchByAssoc($result1)) {\n $this->AddLinks($row[\"module\"]);\n }\n\n $this->AddHeaderLinks();\n //actualize links part ends\n }", "function bpsPro_firewall_autopilot_mode() {\n$PFWAP_options = get_option('bulletproof_security_options_pfw_autopilot');\n$bpsProLogARQ = WP_CONTENT_DIR . '/bps-backup/logs/http_error_log.txt';\n\n\tif ( $PFWAP_options['bps_pfw_autopilot_cron'] == 'Off' || !get_option('bulletproof_security_options_pfw_autopilot') ) {\n\t\texit();\n\t}\n\t\n\tif ( time() < $PFWAP_options['bps_pfw_autopilot_cron_end'] ) {\n\t\texit();\n\t\n\t} else {\n\t\n\t\tif ( file_exists($bpsProLogARQ) ) {\n\t\n\t\t\t$bpsProLogARQ_contents = file_get_contents($bpsProLogARQ);\n\t\t\t$filterPattern1 = '/\\/bulletproof-security\\/admin\\/php\\/bps-phpinfo\\.php/';\n\t\t\t$filterPattern2 = '/\\/bulletproof-security\\/403\\.php/';\n\t\t\t$filterPattern3 = '/\\/bulletproof-security\\/admin\\/js\\/(.*)\\.js/';\n\t\t\n\t\t\tpreg_match_all( '/HTTP_REFERER:\\shttps?:\\/\\/' . bpsGetDomainRootPrefix() . '(.*)\\s*REQUEST_URI:(.*)\\/plugins\\/(.*)(\\.js|\\.php|\\.swf)/', $bpsProLogARQ_contents, $matches );\n\t\n\t\t\t$pathValue = array();\n\t\t\n\t\t\tforeach ( $matches[0] as $Key => $Value ) {\n\t\t\t\t// Filters\n\t\t\t\tif ( ! preg_match( $filterPattern1, $Value ) && ! preg_match( $filterPattern2, $Value ) && ! preg_match( $filterPattern3, $Value ) ) {\n\t\t\t\t\n\t\t\t\t\t$dir_check = preg_replace( '/HTTP_REFERER:\\shttps?:\\/\\/' . bpsGetDomainRootPrefix() . '(.*)\\s*REQUEST_URI:(.*)\\/plugins/', '', $Value );\n\n\t\t\t\t\tif ( is_dir( WP_PLUGIN_DIR . dirname($dir_check) ) ) {\t\n\n\t\t\t\t\t\t$pathValue[] = $dir_check;\n\t\t\t\t\t\t$comma_separated = implode( ', ', $pathValue );\t\n\t\t\t\t\t\t$NoDupes = implode( ', ', array_unique( explode( ', ', $comma_separated ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$PFW_options = get_option('bulletproof_security_options_pfirewall');\n\n\t\t\t$string1 = $PFW_options['bps_pfw_whitelist'];\n\t\t\t$string2 = $NoDupes;\n\t\t\t$stringMerge = $string1 . ', ' . $string2;\n\t\t\t$stringMergeUnique = implode( ', ', array_unique( explode( ', ', trim( $stringMerge, \", \\t\\n\\r\" ) ) ) );\n\t\n\t\t\t$NoDupes_array = explode( ', ', $NoDupes );\n\t\t\t$pfw_whitelist_array = explode( ', ', $PFW_options['bps_pfw_whitelist'] );\n\t\t\t$result = array_diff($NoDupes_array, $pfw_whitelist_array);\n\n\t\t\t$timeNow = time();\n\t\t\t$gmt_offset = get_option( 'gmt_offset' ) * 3600;\n\t\t\t$timestamp = date_i18n(get_option('date_format'), strtotime(\"11/15-1976\")) . ' - ' . date_i18n(get_option('time_format'), $timeNow + $gmt_offset);\n\t\t\t$bpsSecLog = WP_CONTENT_DIR . '/bps-backup/logs/http_error_log.txt';\n\t\t\t$log_title = \"\\r\\n\" . '[Plugin Firewall AutoPilot Mode New Whitelist Rule(s) Created: ' . $timestamp . ']' . \"\\r\\n\";\n\n\t\t\tif ( ! empty($result) && $result[0] != '' ) {\n\t\t\n\t\t\t\tif ( is_writable( $bpsSecLog ) ) {\n\t\t\t\tif ( ! $handle = fopen( $bpsSecLog, 'a' ) ) {\n \t\t\texit;\n \t\t\t}\n \t\t\tif ( fwrite( $handle, $log_title ) === FALSE ) {\n \t\t\texit;\n \t\t\t}\n \t\t\tfclose($handle);\n\t\t\t\t}\n\n\n\t\t\t\tforeach ( $result as $key => $value ) {\n\t\t\n\t\t\t\t\t$log_contents = 'Whitelist Rule: ' . $value . \"\\r\\n\";\n\t\t\t\t\t\n\t\t\t\t\tif ( is_writable( $bpsSecLog ) ) {\n\t\t\t\t\tif ( ! $handle = fopen( $bpsSecLog, 'a' ) ) {\n \t\t\t\texit;\n \t\t\t\t}\n \t\t\t\tif ( fwrite( $handle, $log_contents ) === FALSE ) {\n \t\t\t\texit;\n \t\t\t\t}\n \t\t\t\tfclose($handle);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t$bps_pfw_whitelist = $stringMergeUnique;\n\n\t\t\t$BPS_PFW_Options = array(\n\t\t\t'bps_pfw_paypal' \t\t=> $PFW_options['bps_pfw_paypal'], \n\t\t\t'bps_pfw_google' \t\t=> $PFW_options['bps_pfw_google'], \n\t\t\t'bps_pfw_amazon' \t\t=> $PFW_options['bps_pfw_amazon'], \n\t\t\t'bps_pfw_authorizenet' \t=> $PFW_options['bps_pfw_authorizenet'], \n\t\t\t'bps_pfw_whitelist' \t=> $bps_pfw_whitelist\n\t\t\t);\n\n\t\t\t\tforeach( $BPS_PFW_Options as $key => $value ) {\n\t\t\t\t\tupdate_option('bulletproof_security_options_pfirewall', $BPS_PFW_Options);\n\t\t\t\t}\n\t\t\t\n\t\t\t/* for testing: print_r($stringMergeUnique); */\n\t\t\t$PluginsHtaccessMaster = WP_PLUGIN_DIR . '/bulletproof-security/admin/htaccess/plugins.htaccess';\n\t\t\t$PluginsHtaccess = WP_PLUGIN_DIR . '/.htaccess';\n\t\t\t$PluginsHtaccessARQ = WP_CONTENT_DIR . '/bps-backup/autorestore/wp-content/plugins/bulletproof-security/admin/htaccess/plugins.htaccess';\n\t\t\t$PluginsHtaccessARQplugins = WP_CONTENT_DIR . '/bps-backup/autorestore/wp-content/plugins/.htaccess';\n\t\t\t$pluginsHtaccessMasterTXT = WP_PLUGIN_DIR . '/bulletproof-security/admin/htaccess/plugins-htaccess-master.txt';\n\t\t\t$pluginsHtaccessMasterTXTARQ = WP_CONTENT_DIR . '/bps-backup/autorestore/wp-content/plugins/bulletproof-security/admin/htaccess/plugins-htaccess-master.txt';\n\n\t\t\tif ( file_exists($PluginsHtaccessMaster) ) {\n\t\t\n\t\t\t\t// IMPORTANT! Get the new PFW DB Option values again here\n\t\t\t\t$PFW_options_new = get_option('bulletproof_security_options_pfirewall');\n\t\t\t\t$bps_pfw_whitelist_filter = array_filter( explode(', ', trim( $PFW_options_new['bps_pfw_whitelist'], \", \\t\\n\\r\") ) );\t\t\t\t\n\t\t\t\t\n\t\t\t\t$whiteList = array();\n\t\t\t\t$whiteListMasterU = @file_get_contents($pluginsHtaccessMasterTXT);\t\t\n\t\t\n\t\t\t\tforeach ( $bps_pfw_whitelist_filter as $Key => $Value ) {\n\t\t\t\t\n\t\t\t\t\t$whiteList[] = 'SetEnvIf Request_URI \"'.$Value.'$\" whitelist'.\"\\n\";\n\t\t\t\t\t$uniqueRules = array_unique($whiteList);\n\t\t\t\t\t\t\n\t\t\t\t\tforeach ( $uniqueRules as $uniqueRule ) {\n\n\t\t\t\t\t\tif ( $uniqueRule != '' ) {\n\t\t\t\t\t\t\tfile_put_contents($pluginsHtaccessMasterTXT, $uniqueRules);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t\t\t\t// IMPORTANT! do not combine or use the same variable for $whiteListMaster & $whiteListMasterU - they MUST be separate/unique\n\t\t\t\t$whiteListMaster = @file_get_contents($pluginsHtaccessMasterTXT);\n\t\t\t\t$PluginsHtaccessMaster_contents = @file_get_contents($PluginsHtaccessMaster);\n\t\t\t\t$stringReplace = preg_replace('/BEGIN WHITELIST(.*)END WHITELIST/s', \"BEGIN WHITELIST: Frontend Loading Website Plugin scripts/files\\nSetEnvIf Request_URI \\\"/bulletproof-security/400.php\\$\\\" whitelist\\nSetEnvIf Request_URI \\\"/bulletproof-security/403.php\\$\\\" whitelist\\n\".$whiteListMaster.\"# END WHITELIST\", $PluginsHtaccessMaster_contents);\n\n\t\t\t\tif ( file_put_contents($PluginsHtaccessMaster, $stringReplace) ) {\n\t\t\t\t\t@copy($PluginsHtaccessMaster, $PluginsHtaccessARQ);\n\t\t\t\t\t@copy($pluginsHtaccessMasterTXT, $pluginsHtaccessMasterTXTARQ);\n\t\t\t\t}\t\n\t\t\n\t\t\t\tif ( file_put_contents($PluginsHtaccess, $stringReplace) ) {\n\t\t\t\t\t@copy($PluginsHtaccess, $PluginsHtaccessARQplugins);\n\t\t\t\t}\n\t\t\t}\n\t\t\t} // end if ( ! empty($result) && $result[0] != '' ) {\n\t\t}\n\t}\n}", "function actions_filters()\n\t\t{\n\t\t\tif(is_admin()){\n\t\t\t\tadd_action('admin_menu', array(&$this,'admin_menu_link'));\n\t\t\t\tadd_action('admin_head', array(&$this, 'admin_head'));\n\t\t\t}\n\t\t\telse\n\t\t\t\tadd_action('wp_head', array(&$this,'wp_head'));\n\t\t}", "function getAdminLinks()\n {\n }", "function autolinks_admin_view()\n{\n // Security check\n if (!pnSecAuthAction(0, 'Autolinks::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Get parameters from whatever input we need\n $startnum = pnVarCleanFromInput('startnum');\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Autolinks');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // The user API function is called\n $links = pnModAPIFunc('Autolinks',\n 'user',\n 'getall',\n array('startnum' => $startnum,\n 'numitems' => pnModGetVar('Autolinks',\n 'itemsperpage')));\n\n $autolinks = array();\n foreach ($links as $link) {\n\n if (pnSecAuthAction(0, 'Autolinks::', \"$link[keyword]::$link[lid]\", ACCESS_READ)) {\n \n // Options for the link\n $options = array();\n if (pnSecAuthAction(0, 'Autolinks::', \"$link[keyword]::$link[lid]\", ACCESS_EDIT)) {\n $options[] = array('url' => pnModURL('Autolinks', 'admin', 'modify', array('lid' => $link['lid'])),\n 'title' => _EDIT);\n if (pnSecAuthAction(0, 'Autolinks::', \"$link[keyword]::$link[lid]\", ACCESS_DELETE)) {\n $options[] = array('url'=> pnModURL('Autolinks', 'admin', 'delete', array('lid' => $link['lid'])),\n 'title' => _DELETE);\n }\n }\n\n\t\t\t$link['options'] = $options;\n $autolinks[] = $link;\n }\n }\n $pnRender->assign('autolinks', $autolinks);\n\n // Display pager\n\t$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Autolinks', 'user', 'countitems'),\n\t 'itemsperpage' => pnModGetVar('Autolinks', 'itemsperpage')));\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('autolinks_admin_view.htm');\n}", "function get_status_view_filters_html($show, $urlargs, $hostattr, $serviceattr, $hoststatustypes, $servicestatustypes, $url = \"\")\n{\n if (empty($url)) {\n $theurl = get_current_page();\n } else {\n $theurl = $url;\n }\n\n $output = '';\n\n // No filter is being used...\n if ($hostattr == 0 && ($hoststatustypes == 0 || $hoststatustypes == HOSTSTATE_ANY) && $serviceattr == 0 && ($servicestatustypes == 0 || $servicestatustypes == SERVICESTATE_ANY)) {\n return '';\n }\n\n if ($show == \"openproblems\" || $show == \"serviceproblems\") {\n $show = \"services\";\n } else if ($show == \"hostproblems\") {\n $show = \"hosts\";\n }\n\n $theurl .= \"?show=\" . $show;\n foreach ($urlargs as $var => $val) {\n if ($var == \"show\" || $var == \"hostattr\" || $var == \"serviceattr\" || $var == \"hoststatustypes\" || $var == \"servicestatustypes\") {\n continue;\n }\n $theurl .= \"&\" . $var . \"=\" . $val;\n }\n\n $output .= '<img src=\"' . theme_image(\"filter.png\") . '\"> ' . _('Filters') . ':';\n $filters = \"\";\n\n if ($hostattr != 0 || ($hoststatustypes != 0 && $hoststatustypes != HOSTSTATE_ANY)) {\n $filters .= \" <b>\" . _('Host') . \"</b>=\";\n $filterstrs = array();\n\n if (($hoststatustypes & HOSTSTATE_UP))\n $filterstrs[] = _(\"Up\");\n if (($hoststatustypes & HOSTSTATE_DOWN))\n $filterstrs[] = _(\"Down\");\n if (($hoststatustypes & HOSTSTATE_UNREACHABLE))\n $filterstrs[] = _(\"Unreachable\");\n if (($hostattr & HOSTSTATUSATTR_ACKNOWLEDGED))\n $filterstrs[] = _(\"Acknowledged\");\n if (($hostattr & HOSTSTATUSATTR_NOTACKNOWLEDGED))\n $filterstrs[] = _(\"Not Acknowledged\");\n if (($hostattr & HOSTSTATUSATTR_INDOWNTIME))\n $filterstrs[] = _(\"In Downtime\");\n if (($hostattr & HOSTSTATUSATTR_NOTINDOWNTIME))\n $filterstrs[] = _(\"Not In Downtime\");\n if (($hostattr & HOSTSTATUSATTR_ISFLAPPING))\n $filterstrs[] = _(\"Flapping\");\n if (($hostattr & HOSTSTATUSATTR_ISNOTFLAPPING))\n $filterstrs[] = _(\"Not Flapping\");\n if (($hostattr & HOSTSTATUSATTR_CHECKSENABLED))\n $filterstrs[] = _(\"Checks Enabled\");\n if (($hostattr & HOSTSTATUSATTR_CHECKSDISABLED))\n $filterstrs[] = _(\"Checks Disabled\");\n if (($hostattr & HOSTSTATUSATTR_NOTIFICATIONSENABLED))\n $filterstrs[] = _(\"Notifications Enabled\");\n if (($hostattr & HOSTSTATUSATTR_NOTIFICATIONSDISABLED))\n $filterstrs[] = _(\"Notifications Disabled\");\n if (($hostattr & HOSTSTATUSATTR_HARDSTATE))\n $filterstrs[] = _(\"Hard State\");\n if (($hostattr & HOSTSTATUSATTR_SOFTSTATE))\n $filterstrs[] = _(\"Soft State\");\n\n if (($hostattr & HOSTSTATUSATTR_EVENTHANDLERDISABLED))\n $filterstrs[] = _(\"Event Handler Disabled\");\n if (($hostattr & HOSTSTATUSATTR_EVENTHANDLERENABLED))\n $filterstrs[] = _(\"Event Handler Enabled\");\n if (($hostattr & HOSTSTATUSATTR_FLAPDETECTIONDISABLED))\n $filterstrs[] = _(\"Flap Detection Disabled\");\n if (($hostattr & HOSTSTATUSATTR_FLAPDETECTIONENABLED))\n $filterstrs[] = _(\"Flap Detection Enabled\");\n if (($hostattr & HOSTSTATUSATTR_PASSIVECHECKSDISABLED))\n $filterstrs[] = _(\"Passive Checks Disabled\");\n if (($hostattr & HOSTSTATUSATTR_PASSIVECHECKSENABLED))\n $filterstrs[] = _(\"Passive Checks Enabled\");\n if (($hostattr & HOSTSTATUSATTR_PASSIVECHECK))\n $filterstrs[] = _(\"Passive Check\");\n if (($hostattr & HOSTSTATUSATTR_ACTIVECHECK))\n $filterstrs[] = _(\"Active Check\");\n if (($hostattr & HOSTSTATUSATTR_HARDSTATE))\n $filterstrs[] = _(\"Hard State\");\n if (($hostattr & HOSTSTATUSATTR_SOFTSTATE))\n $filterstrs[] = _(\"Soft State\");\n\n $x = 0;\n foreach ($filterstrs as $f) {\n if ($x > 0)\n $filters .= \",\";\n $filters .= $f;\n $x++;\n }\n }\n\n if ($serviceattr != 0 || ($servicestatustypes != 0 && $servicestatustypes != SERVICESTATE_ANY)) {\n $filters .= \" <b>\" . _('Service') . \"</b>=\";\n $filterstrs = array();\n\n if (($servicestatustypes & SERVICESTATE_OK))\n $filterstrs[] = _(\"Ok\");\n if (($servicestatustypes & SERVICESTATE_WARNING))\n $filterstrs[] = _(\"Warning\");\n if (($servicestatustypes & SERVICESTATE_UNKNOWN))\n $filterstrs[] = _(\"Unknown\");\n if (($servicestatustypes & SERVICESTATE_CRITICAL))\n $filterstrs[] = _(\"Critical\");\n if (($serviceattr & SERVICESTATUSATTR_ACKNOWLEDGED))\n $filterstrs[] = _(\"Acknowledged\");\n if (($serviceattr & SERVICESTATUSATTR_NOTACKNOWLEDGED))\n $filterstrs[] = _(\"Not Acknowledged\");\n if (($serviceattr & SERVICESTATUSATTR_INDOWNTIME))\n $filterstrs[] = _(\"In Downtime\");\n if (($serviceattr & SERVICESTATUSATTR_NOTINDOWNTIME))\n $filterstrs[] = _(\"Not In Downtime\");\n if (($serviceattr & SERVICESTATUSATTR_ISFLAPPING))\n $filterstrs[] = _(\"Flapping\");\n if (($serviceattr & SERVICESTATUSATTR_ISNOTFLAPPING))\n $filterstrs[] = _(\"Not Flapping\");\n if (($serviceattr & SERVICESTATUSATTR_CHECKSENABLED))\n $filterstrs[] = _(\"Checks Enabled\");\n if (($serviceattr & SERVICESTATUSATTR_CHECKSDISABLED))\n $filterstrs[] = _(\"Checks Disabled\");\n if (($serviceattr & SERVICESTATUSATTR_NOTIFICATIONSENABLED))\n $filterstrs[] = _(\"Notifications Enabled\");\n if (($serviceattr & SERVICESTATUSATTR_NOTIFICATIONSDISABLED))\n $filterstrs[] = _(\"Notifications Disabled\");\n if (($serviceattr & SERVICESTATUSATTR_HARDSTATE))\n $filterstrs[] = _(\"Hard State\");\n if (($serviceattr & SERVICESTATUSATTR_SOFTSTATE))\n $filterstrs[] = _(\"Soft State\");\n\n if (($serviceattr & SERVICESTATUSATTR_EVENTHANDLERDISABLED))\n $filterstrs[] = _(\"Event Handler Disabled\");\n if (($serviceattr & SERVICESTATUSATTR_EVENTHANDLERENABLED))\n $filterstrs[] = _(\"Event Handler Enabled\");\n if (($serviceattr & SERVICESTATUSATTR_FLAPDETECTIONDISABLED))\n $filterstrs[] = _(\"Flap Detection Disabled\");\n if (($serviceattr & SERVICESTATUSATTR_FLAPDETECTIONENABLED))\n $filterstrs[] = _(\"Flap Detection Enabled\");\n if (($serviceattr & SERVICESTATUSATTR_PASSIVECHECKSDISABLED))\n $filterstrs[] = _(\"Passive Checks Disabled\");\n if (($serviceattr & SERVICESTATUSATTR_PASSIVECHECKSENABLED))\n $filterstrs[] = _(\"Passive Checks Enabled\");\n if (($serviceattr & SERVICESTATUSATTR_PASSIVECHECK))\n $filterstrs[] = _(\"Passive Check\");\n if (($serviceattr & SERVICESTATUSATTR_ACTIVECHECK))\n $filterstrs[] = _(\"Active Check\");\n if (($serviceattr & SERVICESTATUSATTR_HARDSTATE))\n $filterstrs[] = _(\"Hard State\");\n if (($serviceattr & SERVICESTATUSATTR_SOFTSTATE))\n $filterstrs[] = _(\"Soft State\");\n\n $x = 0;\n foreach ($filterstrs as $f) {\n if ($x > 0)\n $filters .= \",\";\n $filters .= $f;\n $x++;\n }\n }\n\n $output .= $filters;\n $output .= \" <a href='\" . $theurl . \"'><img src='\" . theme_image(\"clearfilter.png\") . \"' class='tt-bind' data-placement='right' alt='\" . _(\"Clear Filter\") . \"' title='\" . _(\"Clear Filter\") . \"'></a>\";\n\n return $output;\n}", "function acf_get_admin_tool_url($tool = '') {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets all of a SalesProfile's Transactor accounts
public function getAccounts();
[ "public function transactions()\n\t{\n\t\t$response = $this->client->get( 'account/transactions' );\n\t\treturn $response->getBody();\n\t}", "public function getAccounts()\n {\n return $this->accounts;\n }", "public function getAccountsWithUsers();", "public function get_accounts() {\n $post_arr = array();\n return $this->doWebRequest('accounts', $post_arr);\n }", "public function getAccounts()\n {\n return $this->_accounts;\n }", "public function getAllAccounts()\n {\n $this->params['tableName'] = 'account';\n $excludeDeleted = $this->getOrDefault('GET.excludeDeleted', '');\n $query = \"\";\n if (!empty($excludeDeleted)) {\n $query = \"deleteAt eq ''\";\n }\n\n return $this->execQuery($query, 1000, null, null, '_config');\n }", "public function account_manager_get_accounts() {\n \n // Get accounts by social networks\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Account_manager)->get_accounts();\n \n }", "public function get_accounts() {\n\n\t\t/**\n\t\t * TODO: pull out object instantiation into independent functioni wherever this is being used.\n\t\t */\n\t\t$accounts_obj = phpQuery::newDocumentFileXML( $this->api_base_url.'accounts/list/?key='.$this->api_key() );\n\t\t$this->node_loop_assign( $accounts_obj, 'account', 'account_id', 'email_address' );\n\t\treturn $this->data['accounts'];\n\n\t}", "public function getAllAccounts()\n { \n\n $accounts = fetch_all(\"SELECT `id`, `label`, `user`,\n `api_key`, `logo_path`, `is_live`, `has_cc`, `type`\n FROM `pmt_account`\n WHERE 1\n ORDER BY `is_live` DESC\");\n\n $this->hasAccounts = !empty($accounts);\n\n return $accounts;\n }", "public function getAccounts()\n {\n return $this->client->request('GET', '/accounts');\n }", "public function list_radius_accounts()\n {\n return $this->fetch_results('/api/s/' . $this->site . '/rest/account');\n }", "public function get_fiat_accounts()\n {\n return $this->apiClient->get_request(\"/v1/fiat_accounts\");\n }", "public function getAccountList() {\n return parent::_requestData('get','accounts');\n }", "public function getAccountSummaries()\n {\n return $this->account_summaries;\n }", "public function getAccounts()\n {\n $analyticsAccounts = $this->statisticsRepository->findAll();\n return $analyticsAccounts;\n }", "public function getTransactionsForAccount(int $account): array;", "public function getInstagramAccounts(){\n $accounts = Model::find()->andWhere(['parent_id' => null, 'type' => self::ACCOUNT])->joinWith('authclient')->andWhere(['authclient.source' => 'instagram'])->all();\n return $accounts;\n }", "public function getFromTransactions()\n {\n return $this->hasMany(Transaction::className(), ['from_account_id' => 'id']);\n }", "public static function get_user_accounts()\n {\n $userid=Auth::user()->id;\n $accounts=DB::select(\"select * from accounts where fk_user_id='$userid'\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end getOpenIDs() Get refund IDS.
public static function getRefundIDs() { $ret = [ ]; $om = \Magento\Framework\App\ObjectManager::getInstance(); foreach ($om->get('\Magento\Store\Model\StoreManagerInterface')->getWebsites() as $website) { foreach ($website->getGroups() as $group) { $stores = $group->getStores(); foreach ($stores as $store) { $store_id = $store->getId(); $store_id_order = [ ]; $store_id_order ['store_id'] = $store_id; if (!KomfortkasseConfig::getConfig(KomfortkasseConfig::activate_export, $store_id_order)) { continue; } $paymentMethods = explode(',', KomfortkasseConfig::getConfig(KomfortkasseConfig::payment_methods, $store_id_order)); $paymentMethods = array_merge($paymentMethods, explode(',', KomfortkasseConfig::getConfig(KomfortkasseConfig::payment_methods_cod, $store_id_order))); $paymentMethods = array_merge($paymentMethods, explode(',', KomfortkasseConfig::getConfig(KomfortkasseConfig::payment_methods_invoice, $store_id_order))); $cmModel = $om->create('\Magento\Sales\Model\Order\Creditmemo'); $cmCollection = $cmModel->getCollection()->addFieldToFilter('store_id', $store_id); foreach ($cmCollection as $creditMemo) { if ($creditMemo->getTransactionId() == null) { $order = $creditMemo->getOrder(); $method = $order->getPayment()->getMethodInstance()->getCode(); if (in_array($method, $paymentMethods, true) === true) { $cmId = $creditMemo->getIncrementId(); $ret [] = $cmId; } } } } } } return $ret; }
[ "public function getRefundItems();", "public function testGETCaptureIdRefunds()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getRefundIds(): ?array\n {\n return $this->refundIds;\n }", "public function testGETOrderIdRefunds()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public static function getRefundIDs()\n {\n $ret = array ();\n\n $minDate = date('Y-m-d', time() - 31536000); // 1 Jahr\n\n foreach (Mage::app()->getWebsites() as $website) {\n foreach ($website->getGroups() as $group) {\n $stores = $group->getStores();\n foreach ($stores as $store) {\n\n $store_id = $store->getId();\n $store_id_order = array ();\n $store_id_order ['store_id'] = $store_id;\n\n if (!Komfortkasse_Config::getConfig(Komfortkasse_Config::activate_export, $store_id_order)) {\n continue;\n }\n\n $paymentMethods = explode(',', Komfortkasse_Config::getConfig(Komfortkasse_Config::payment_methods, $store_id_order));\n $paymentMethodsInvoice = explode(',', Komfortkasse_Config::getConfig(Komfortkasse_Config::payment_methods_invoice, $store_id_order));\n\n $cmModel = Mage::getModel(\"sales/order_creditmemo\");\n $cmCollection = $cmModel->getCollection()->addFieldToFilter('store_id', $store_id)->addAttributeToFilter('created_at', array ('gt' => $minDate\n ));\n\n foreach ($cmCollection as $creditMemo) {\n if ($creditMemo->getTransactionId() == null) {\n $order = $creditMemo->getOrder();\n try {\n $method = $order->getPayment()->getMethodInstance()->getCode();\n } catch (Exception $e) {\n // payment method has been deleted\n $method = null;\n }\n if ($method && (in_array($method, $paymentMethods, true) === true || in_array($method, $paymentMethodsInvoice, true) === true)) {\n $cmId = $creditMemo->getIncrementId();\n $ret [] = $cmId;\n }\n }\n }\n }\n }\n }\n\n return $ret;\n\n }", "public function getRefundId();", "public function getRefunds() {\n\t\treturn $this->refunds;\n\t}", "public function getRefunds()\n {\n return $this->refunds;\n }", "function getRefunds($tid)\r\n {\r\n $url_path = \"transactions/$tid/refunds\";\r\n\r\n try {\r\n \t$request = new Request($this->security);\r\n \t$response = $request->get($url_path);\r\n }\r\n catch (\\Exception $e){\r\n \t$response = new RefundListResponse();\r\n \t$response->setReturnCode(ReturnCode::UNSUCCESSFUL);\r\n \t$response->setReturnMessage($e->getMessage());\r\n return $response;\r\n }\r\n \r\n $refundListResponse = RefundListResponse::mapFromJson($response);\r\n\r\n return $refundListResponse;\r\n }", "public function get_refund_orders()\n {\n $type = $this->util->post('type');\n switch ($type)\n {\n case 1:\n $this->util->authentication('6AB593A4-B54A-4122-92D6-F92777661160');\n break;\n case 2:\n $this->util->authentication('D4FDAC81-5269-4EA0-94AC-6C5538124E94');\n break;\n case 3:\n $this->util->authentication('FEF918F3-9C21-401A-B8E0-8FE9F33234EF');\n break;\n case 4:\n $this->util->authentication('9F8F72B1-69C3-41C6-93B8-EF28D207A28F');\n break;\n case 5:\n $this->util->authentication('A70CF186-0935-449E-9C43-598B6DCE75AA');\n break;\n default:\n $res['status'] = 400;\n $res['msg'] = \"type is $type\";\n $this->util->send_json($res);\n }\n\n\n $st = $this->util->post('start_time');\n $et = $this->util->post('end_time');\n $sn = $this->util->post('sn');\n $order_sn = $this->util->post('order_sn');\n $mobile = $this->util->post('mobile');\n $refund_status = $this->util->post('refund_status');\n $page = $this->util->post('page');\n $size = $this->util->post('size');\n if (NULL === $page OR NULL === $size) {\n $res['status'] = 400;\n $res['msg'] = \"page and size can't be null\";\n $this->util->send_json($res);\n }\n if ($page < 1 or $size < 1) {\n $res['status'] = 400;\n $res['msg'] = \"page and size can't little than 1\";\n $this->util->send_json($res);\n }\n\n if (NULL === $st && NULL === $et && NULL === $sn && NULL === $order_sn && NULL === $mobile && NULL === $refund_status) {\n $res['status'] = 400;\n $res['msg'] = \"start_time,end_time,sn,order_sn,mobile,refund_status must have one\";\n $this->util->send_json($res);\n }\n\n $from = ($page - 1) * $size;\n $user = $this->util->get_user();\n\n $data = $this->refund_model->get_refund_orders($from, $size, $st, $et, $sn, $order_sn, $mobile, $refund_status, $user['id']);\n $res['status'] = 200;\n $res['msg'] = 'sucess';\n $res['data'] = $data;\n $this->util->send_json($res);\n\n }", "public function getRefunds ()\n {\n return $this->getShopRefunds();\n }", "public function getId()\n {\n return $this->getRefundId();\n }", "public function getRefundableItems() {\n\t\t$items = $this->getCaptureItems();\n\t\tforeach ($this->getRefunds() as $refund) {\n\t\t\t$items = Customweb_Util_Invoice::substractLineItems($items, $refund->getRefundItems());\n\t\t}\n\t\n\t\treturn $items;\n\t}", "public function getRefundArray()\n {\n return $this->refundArray;\n }", "public function retrieveRefundsAction()\n {\n $chargesId = $this->container->get('request')->get('chargesid');\n $refundsId = $this->container->get('request')->get('refundsId'); \n $baseUrl = $this->setGetContract->subUrlsCharges.\"/$chargesId\";\n $this->url = (isset($refundsId)) ? $baseUrl.\"/$refundsId\" : $baseUrl;\n $this->currentSubUrl = 'subUrlsCharges';\n $this->datas = array();\n $this->method = 'get'; \n \n return $this->prepareRequest(); \n }", "public function getRefundLines()\n {\n return $this->refundLines;\n }", "function getUnpaidInvoiceIds() {\n\n // Initialize the return array\n $arInvoices = array();\n\t\t// Generate the query\n $strQuery = \"\n \tSELECT\n \t\tid\n \tFROM\n \t\tinvoice\n \t\tWHERE\n \t\tbilling_account_id = '{$this->id}'\n \tAND\n \t\tamount_due > 0\n AND\n\t\t\t\tdeleted = 0\n \";\n // Execute the query\n if ($hResult = $this->db->query($strQuery, true)) {\n \t// Loop through the results\n \twhile ($arRow = $this->db->fetchByAssoc($hResult)) {\n \t// Append this id to the return array\n \t$arInvoices[] = $arRow['id'];\n\t\t\t}\n\t\t}\n\t\t// Return the generated array\n return (count($arInvoices) > 0) ? $arInvoices : false;\n\t}", "public function subaccountGetIds();", "public function getRefundId()\n {\n return $this->getParameter('refundId');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
| | store the fields of the table, with dataType 'datetime' create and update |
public function timestamps() { $this->dataFields["createdAt"] = "\"createdAt\" timestamp without time zone"; $this->dataFields["updatedAt"] = "\"updatedAt\" timestamp without time zone"; }
[ "function dbFieldType()\n { return \"datetime\";\n }", "function timestamps() {\n $this->array['created_at'] = \" VARCHAR(128) NOT NULL\";\n $this->array['updated_at'] = \" VARCHAR(128) NOT NULL\";\n }", "public function setDateFields()\n {\n if(isset($this->columnList['DateAdded'])) {\n if(!empty($this->DateAdded)) {\n $this->DateAdded = $this->DateAdded;\n } else {\n\n /**\n * @todo swap this out into the connection to let the connected server determine timezone settings\n **/\n $Date = new \\DateTime(\"now\",new \\DateTimeZone(self::DB_TIMEZONE));\n $this->DateAdded = $Date->format(self::SHORTDATE);\n }\n }\n if(isset($this->columnList['DateTimeAdded'])) {\n if(!empty($this->DateTimeAdded)) {\n $this->DateTimeAdded = $this->DateTimeAdded;\n } else {\n $Date = new \\DateTime(\"now\",new \\DateTimeZone(self::DB_TIMEZONE));\n $this->DateTimeAdded = $Date->format(self::ISO_DATETIME);\n }\n }\n\n $this->updateLastUpdated();\n }", "function add_timestamps($type='datetime')\n {\n switch($type)\n {\n case 'date':\n $this->add_column('created_on', $type);\n $this->add_column('updated_on', $type);\n break;\n \n case 'time':\n case 'datetime':\n default:\n $this->add_column('created_at', $type);\n $this->add_column('updated_at', $type);\n }\n }", "private function update_timestamps(){\n if(in_array('created_at', $this->_column_names)) $this->created_at = $this->db_datetime($this->time_stamp($this->created_at));\n if(in_array('updated_at', $this->_column_names)) $this->updated_at = $this->db_datetime();\n }", "public function standarizetimefields() {\n\t\tif (!empty($this->column_fields['date_start']) && !empty($this->column_fields['time_start'])) {\n\t\t\t$time_start = DateTimeField::convertToUserTimeZone($this->column_fields['date_start'].' '.DateTimeField::sanitizeTime($this->column_fields['time_start']));\n\t\t\t$this->column_fields['date_start'] = $time_start->format('Y-m-d');\n\t\t\t$ts = $time_start->format('H:i:s');\n\t\t\t$this->column_fields['time_start'] = $ts;\n\t\t}\n\t\tif (!empty($this->column_fields['date_end']) && !empty($this->column_fields['time_end'])) {\n\t\t\t$time_end = DateTimeField::convertToUserTimeZone($this->column_fields['date_end'].' '.DateTimeField::sanitizeTime($this->column_fields['time_end']));\n\t\t\t$this->column_fields['date_end'] = $time_end->format('Y-m-d');\n\t\t\t$te = $time_end->format('H:i:s');\n\t\t\t$this->column_fields['time_end'] = $te;\n\t\t}\n\t}", "protected function defineAuditFields() {\r\n // as they play important role in system logics\r\n if(!isset($this->fields['created_dts']))\r\n $this->addField('created_dts')\r\n ->type('datetime')\r\n ->caption('Created')\r\n ->readonly(true)\r\n ->visible(false)\r\n ->editable(false)\r\n ->system(true)\r\n ;\r\n if(!isset($this->fields['upadted_dts']))\r\n $this->addField('updated_dts')\r\n ->type('datetime')\r\n ->caption('Updated')\r\n ->readonly(true)\r\n ->visible(false)\r\n ->editable(false)\r\n ;\r\n if(!isset($this->fields['deleted']))\r\n $this->addField('deleted')\r\n ->type('boolean')\r\n ->caption('Deleted')\r\n ->readonly(true)\r\n ->visible(false)\r\n ->editable(false)\r\n ;\r\n\r\n if(!isset($this->fields['deleted_dts']))\r\n $this->addField('deleted_dts')\r\n ->type('datetime')\r\n ->caption('Deleted')\r\n ->readonly(true)\r\n ->visible(false)\r\n ->editable(false)\r\n ;\r\n }", "function getTimestampFields() {\n\t\t$options = $this->table->getTemplate('Doctrine_Template_Timestampable')->getOptions();\n\t\treturn array($options['created']['name'], $options['updated']['name']);\n\t}", "public function ss_datetime($values){\n //For reference, this is what typically gets passed to this function:\n //$parts=Array('datatype'=>'datetime');\n //DB::requireField($this->tableName, $this->name, $values);\n return \"datetime(\".self::MicrosecondsPrecision.\")\";\n }", "function testTimeDataType() {\n $data = array(\n 'id' => 1,\n 'timefield' => date('H:i:s'),\n );\n $this->insertValues($data);\n $this->selectAndCheck($data);\n }", "public function timestamps()\n\t{\n\t\t$this->date('created_at');\n\n\t\t$this->date('updated_at');\n\t}", "private function _set_timestamps()\n {\n if($this->timestamps === TRUE || is_array($this->timestamps))\n {\n $this->_created_at_field = (is_array($this->timestamps) && isset($this->timestamps[0])) ? $this->timestamps[0] : 'created_at';\n $this->_updated_at_field = (is_array($this->timestamps) && isset($this->timestamps[1])) ? $this->timestamps[1] : 'updated_at';\n $this->_deleted_at_field = (is_array($this->timestamps) && isset($this->timestamps[2])) ? $this->timestamps[2] : 'deleted_at';\n }\n return TRUE;\n }", "final protected function timestamps($table)\n {\n $table->addColumn(\"created_at\", \"datetime\");\n $table->addColumn(\"updated_at\", \"datetime\", ['notnull' => false]);\n }", "function testDateDataType() {\n $data = array(\n 'id' => 1,\n 'datefield' => date('Y-m-d'),\n );\n $this->insertValues($data);\n $this->selectAndCheck($data);\n }", "private function _prepareData(){\r\n\r\n\t\t$EE =& get_instance();\r\n\t\t$EE->load->helper('date');\r\n\t\t$EE->load->library('javascript');\r\n\r\n\t\t$data = array();\r\n\t\tforeach (self::$table_fields as $key => $definition) {\r\n\t\t\t$new_value = \"\";\r\n\t\t\tswitch ($key) {\r\n\t\t\t\tcase 'created_at' :\r\n\t\t\t\t\tif($this->created_at < 1){\r\n\t\t\t\t\t\t$new_value = now();\r\n\t\t\t\t\t\t$this->created_at = $new_value;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$new_value = $this->{$key};\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'config' :\r\n\t\t\t\t\t$new_value = (is_array($this->{$key}))\r\n\t\t\t\t\t\t\t\t\t? $EE->javascript->generate_json($this->{$key}, true)\r\n\t\t\t\t\t\t\t\t\t: $this->{$key};\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(property_exists($this, $key)) {\r\n\t\t\t\t\t\t$new_value = $this->{$key};\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif($key !== 'id'){\r\n\t\t\t\t$data[$key] = $new_value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "private function generate_list_of_datettime_columns()\n\t{\n\t\t$className = get_class($this);\n\t\t$dtColumns = array();\n\t\t\n\t\tforeach ($this->getMetaData()->columns as $column)\n\t\t{\n\t\t\tif('timestamp' === $column->dbType || 'datetime' === $column->dbType)\n\t\t\t{\n\t\t\t\tarray_push($dtColumns, $column->name);\n\t\t\t}\n\t\t}\n\t\treturn SplFixedArray::fromArray($dtColumns);\n\t}", "function _store_field_datetime($key, $field, $is_metadata_wrapper, &$fields) {\n if ($is_metadata_wrapper) {\n $fields[$key] = isset($field) ? date('Y-m-d H:i:s', $field) : '';\n }\n else {\n $fields[$key] = isset($field['value']) ? $field['value'] : '';\n }\n}", "protected function getDateTimeColumns()\n\t{\n\t\treturn array_merge(parent::getDateTimeColumns(), [$this->getCreatedAtColumn(), $this->getUpdatedAtColumn()]);\n\t}", "public function insert() {\n $this->updateCoordinates();\n $this->data['creation_datetime'] = date('Y-m-d H:i:s');\n $this->data['change_datetime'] = date('Y-m-d H:i:s');\n parent::insert();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert $_GET into an array with exploded facets.
public static function parseFacets() { $facets = array(); if (array_key_exists('facet', $_GET)) { // Extract the field/value facet pairs. preg_match_all('/(?P<field>[\w]+):"(?P<value>[^"]+)"/', $_GET['facet'], $matches ); // Collapse into an array of pairs. foreach ($matches['field'] as $i => $field) { $facets[] = array($field, $matches['value'][$i]); } } return $facets; }
[ "public function parseUrlIntoArray() {\r\n\t\t$url_params = rtrim(ltrim($this -> getUrlParams(), '/'), '/') . '/';\r\n\t\treturn explode('/', $url_params);\r\n\t}", "public static function parseFacets()\n {\n return array_merge(\n self::parseRawFacets(@$_GET['facet']),\n self::parseExternalFacets(@$_GET['f'])\n );\n }", "private function _searchParamsFromString()\n\t{\n\t\t$this->_search_params = array();\n\n\t\tif (isset($this->_req->query->params) || isset($this->_req->post->params))\n\t\t{\n\t\t\t// Feed it\n\t\t\t$temp_params = $this->_req->query->params ?? $this->_req->post->params;\n\n\t\t\t// Decode and replace the uri safe characters we added\n\t\t\t$temp_params = base64_decode(str_replace(array('-', '_', '.'), array('+', '/', '='), $temp_params));\n\n\t\t\t$temp_params = explode('|\"|', $temp_params);\n\t\t\tforeach ($temp_params as $i => $data)\n\t\t\t{\n\t\t\t\tlist ($k, $v) = array_pad(explode('|\\'|', $data), 2, '');\n\t\t\t\t$this->_search_params[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_search_params;\n\t}", "public static function getTagsFromQuery(){\n return explode(' ', urldecode($_GET['s']));\n }", "static function get_all()\n\t{\n\t\tif (!isset($_GET)|| empty($_GET)) return array();\n\t\t\n\t\t$res = array();\n\t\tforeach($_GET as $key=>$value)\n\t\t{\n\t\t\t$res[Security::xss_clean(Security::encode_php_tags($key))] = Security::xss_clean(Security::encode_php_tags($value));\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "protected function parseUrlPath()\n {\n return isset($_GET['path']) ?\n explode('/', filter_var(rtrim($_GET['path'], '/'), FILTER_SANITIZE_URL)) :\n [];\n }", "public function getUrlParams(){\n // Check if the url exists\n if(isset($_GET['url'])){\n $url = rtrim($_GET['url'], \"/\");\n $url = filter_var($url, FILTER_SANITIZE_URL);\n return explode(\"/\", $url); \n }\n }", "protected function splitParams($path) {\n $query= array();\n \n if (FALSE !== ($p= strpos($path, '?'))) {\n parse_str(substr($path, $p+1), $query);\n $path= substr($path, 0, $p);\n }\n \n return array($path, $query);\n }", "public static function getEncodedParamsArray()\n {\n $val = self::getParameterValue('p', 'GET');\n\n if ($val != '') {\n $val = base64_decode(UtilsConversion::base64Deobfuscate($val));\n if (is_string($val)) {\n $val = json_decode($val, true);\n return is_array($val) ? $val : [];\n }\n }\n return [];\n }", "private function urlParseArray()\n {\n $url = isset($_GET['url']) ? explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL)) : null;\n\n if (!is_null($url)) {\n foreach ($url as $key => $value) {\n if (in_array(strpos($value, $this->pagingPrefix), $url)) {\n $pgNumber = ltrim($value, $this->pagingPrefix);\n unset($url[$key]);\n break;\n }\n }\n }\n $this->currentPage = isset($pgNumber) && is_numeric($pgNumber) ? $pgNumber : 1;\n return $url ? array_values($url) : [];\n }", "public function parseUrl()\n { #Explode para transformar em array, seprando por /, rtrim para retirar os espaços vazios, filter_ sanitize_url fucao do php para retirar caractres ilegais \n return explode(\"/\",rtrim($_GET['url']),FILTER_SANITIZE_URL);\n }", "function _parseQueryString()\r\n{\r\n\t$get = array();\r\n\tforeach ($_GET as $k=>$v)\r\n\t{\r\n\t\t$k = _unescape($k);\r\n\t\t$v = _unescape($v);\r\n\t\t$get[$k] = $v;\r\n\t}\r\n\t$_GET = $get;\r\n}", "private function getFacetParameters()\n {\n // Retrieve all the query parameters for facets.\n $facetQueryParams = $this->request->query->get('facets');\n\n // Get parameters for current facet if there are any.\n if (isset($facetQueryParams[$this->index])) {\n return $facetQueryParams[$this->index];\n }\n\n return [];\n }", "private function getParamsFromRequest() {\n\t\t$result = array();\n\t\tforeach ($this->aPostbackParams as $value) {\n\t\t\tif(isset($_GET[$value])) {\n\t\t\t\t$result[$value] = $_GET[$value];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public static function parseExternalFacets($params)\n {\n $facets = array();\n if (is_array($params)) {\n foreach ($params as $param) {\n preg_match('/(?P<field>[^:]+):(?P<value>.+)/',\n $param, $matches\n );\n\n // Collapse into an array of pairs.\n if ($matches) {\n $key = self::labelToKey($matches['field']);\n if ($key) {\n $facets[] = array($key, $matches['value']);\n }\n }\n }\n }\n\n return $facets;\n }", "static function filterQueryString() {\n\t\t$clean = array();\n\t\tforeach ($_GET as $key => $val) {\n\t\t\t$clean[$key] = htmlspecialchars_decode(filter_var($val, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW));\n\t\t}\n\t\treturn $clean;\n\t}", "public static function getUrlAsArray() {\n // $uri = substr($_SERVER[\"REQUEST_URI\"],1) ;\n return explode(\"/\",substr($_SERVER[\"REQUEST_URI\"],1) ) ;\n }", "private function _getQueryParams(): array {\n $params = [];\n foreach($_SERVER as $key => $value) {\n $params[strtolower($key)] = $value;\n }\n \n // Parcourir $_GET et $_POST\n foreach($_GET as $key => $value) {\n $params[$key] = $value;\n }\n \n foreach($_POST as $key => $value) {\n $params[$key] = $value;\n }\n return $params;\n }", "static function getArrayFromCurrentQueryString()\n\t{\n\t\t$queryString = self::getCurrentQueryString();\n\t\t$urlValues = Piwik_Common::getArrayFromQueryString($queryString);\n\t\treturn $urlValues;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if 'was_converted_deprecated_msg' has a value
public function hasWasConvertedDeprecatedMsg() { return $this->was_converted_deprecated_msg !== null; }
[ "public function hasWarnings() : bool {}", "public function hasWarnings() {\n\n\t}", "public function getConvertWarningsToExceptions(): bool {}", "public function isOutdatedServerMessageCustom() : bool {\r\n \treturn $this->cfg[\"OutdatedServer\"][\"custom\"];\r\n }", "public function hasDEPRECATEDTicket()\n {\n return $this->DEPRECATED_ticket !== null;\n }", "public function hasDeprecated()\n {\n return $this->get(self::DEPRECATED) !== null;\n }", "public function getConvertWarningsToExceptions(): bool\n {\n return $this->convertWarningsToExceptions;\n }", "public function hasWarnings()\r\n {\r\n return !empty($this->warnings);\r\n }", "public function getConvertNoticesToExceptions(): bool {}", "protected function getDeprecationLogStatus() {}", "public function hasWarnings(): bool\n {\n return $this->warningsExist;\n }", "public function hasWarnings()\n {\n return $this->hasMessages('warning');\n }", "public function checkWarnings() { }", "public function check_upgrade_admin_notice() {\n\t\t\t$show_admin_notice = false;\n\n\t\t\tif ( ( isset( $this->data_settings['user-meta-courses']['version'] ) ) && ( $this->data_settings['user-meta-courses']['version'] < LEARNDASH_SETTINGS_TRIGGER_UPGRADE_VERSION ) ) {\n\t\t\t\t$show_admin_notice = true;\n\t\t\t}\n\n\t\t\tif ( ( isset( $this->data_settings['user-meta-quizzes']['version'] ) ) && ( $this->data_settings['user-meta-quizzes']['version'] < LEARNDASH_SETTINGS_TRIGGER_UPGRADE_VERSION ) ) {\n\t\t\t\t$show_admin_notice = true;\n\t\t\t}\n\n\t\t\treturn $show_admin_notice;\n\t\t}", "public function hasWarning() {\n return $this->type === 'warning';\n }", "function warningsExist()\n {\n return (empty($this->_warnings)) ? FALSE : TRUE;\n }", "public function get_warnings () {}", "public function getConvertDeprecationsToExceptions(): bool\n {\n return $this->convertDeprecationsToExceptions;\n }", "public function hasWarnings()\n {\n return !empty($this->messages[self::WARNING_NAMESPACE]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the display name for Child to be used in cart items in the following format "Firstname L. in Classname"
public function getChildShortDisplayName() { if ($this->firstName != NULL && $this->lastName != NULL) { $name = $this->firstName . " " . substr($this->lastName, 0, 1) . "."; } elseif ($this->firstName != NULL) { $name = $this->firstName; } elseif ($this->lastName != NULL) { $name = $this->lastName; } if ($this->className != NULL) { $name = $name . " in " . $this->className; } return $name; }
[ "public function getDisplayName() {\n\t\treturn \"{$this->first_name} {$this->last_name}\";\n\t}", "public function get_display_name() {\n\t\treturn $this->display_name;\n\t}", "public function getNameWithCategoryName()\n {\n return ''.$this->getCategoryName().' > '.$this->name;\n }", "public function getChildName()\n {\n return $this->child;\n }", "public function getChildName();", "public function getDisplayName()\n {\n return $this->displayname;\n }", "public function get_display_name() {\n\t\treturn h( $this->steam_object->get_name() );\n\t}", "public function getDisplayName()\n {\n return $this->getFirstName() . ' ' . $this->getLastName();\n }", "public function getDisplayname()\n\t{\n\t\treturn $this->displayname;\n\t}", "function getChildName($parent_id)\t{\n\t\t\n\t\t\tApp::import('model','Kid');\n\t\t\t\t\t\n\t\t $this->Kid = new Kid();\n\t\t\t\t\t\n\t\t\t$Child = $this->Kid->find('first', array('fields' => array('child_name'),'conditions' => array('Kid.front_user_id' => $parent_id)));\t\n\t\t\t\t\t\n\t\t\treturn $Child['Kid']['child_name'];\n\t \n\t\t}", "public function getProductName()\n {\n $items = $this->getProductNameParts();\n\n $name = '';\n\n if ( Admin::isAdmin() && $this->order_item_id ){\n $name .= '<i class=\"fa fa-level-up-alt\" style=\"transform: scaleX(-1); margin-left: 10px; margin-right: 10px\"></i>';\n }\n\n $name .= e($this->joinMultiple($items));\n\n return $name;\n }", "public function getMyDisplayname() {\n\t\treturn $this->getTrimmedText($this->findUserDisplayNameElement());\n\t}", "function getDisplayName()\n\t{\n\t\treturn $this->obj->getTitle();\n\t}", "function get_name(): string {\n return $this->name . (($this->allow_child) ? ' (or child theme)' : '');\n }", "public function displayName()\n {\n return $this->countryName().' '.$this->cardtypeName();\n }", "function getDisplayName() {\n\t\treturn $this->_DisplayName;\n\t}", "public function get_formatted_billing_full_name()\n {\n\n\n $parent = wc_get_order($this->get_parent_id());\n if($parent) return $parent->get_formatted_billing_full_name();\n\n\n /* translators: 1: first name 2: last name */\n return sprintf(_x('%1$s %2$s', 'full name', 'woocommerce'), $this->get_billing_first_name(), $this->get_billing_last_name());\n }", "function getName() \r\n {\r\n return $this->item_name;\r\n }", "public function getName()\n {\n return ucfirst(parent::getName());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates a randomized verify String.
public function generateVerifyString() { $letters = "abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@"; $verifyString = ""; $base = str_shuffle($letters); for ($i = 0; $i < $this->getLength(); $i++) { $index = mt_rand(0, strlen($base)-1); $verifyString .= $base[$index]; } return $verifyString; }
[ "private function _generateRandomString() {\n $this->_verificationCode = substr(str_shuffle('0123456789'), 0, $this->_verificationCodeLength);\n }", "private static function generateVerifyCode(): string\n {\n $code = '';\n\n for ($i = 0; $i < 4; $i++) {\n $code .= mt_rand(0, 9);\n }\n\n return $code;\n }", "function generateVerifyString($type)\r\n{\r\n\tif($type==1)\r\n\t\t$string=join('',range(0,9));\r\n\telse if($type==2)\r\n\t\t$string=join('',array_merge(range(0,9),range('a','z')));\r\n\telse if($type==3)\r\n\t\t$string=join('',array_merge(range(0,9),range('a','z'),range('A','Z')));\r\n\treturn substr(str_shuffle($string),0,5);\r\n}", "private function generateVerificationCode(){\n return rand(1000,9999); \n }", "private function generateRandomString()\n {\n return substr(md5(rand()), 0, 20);\n }", "private function generateRandomString()\n {\n return md5(microtime().rand());\n }", "public function generateVerifyToken()\n {\n $this->verify_token = Str::random(UserConstants::VERIFY_EMAIL_TOKEN_LENGTH);\n }", "private function getRandomString(): string\n {\n return md5(uniqid(mt_rand(), true));\n }", "private function generate_random_string() {\n\t\t$x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\treturn substr( str_shuffle( str_repeat( $x, ceil( 32 / strlen( $x ) ) ) ), 1, 32 );\n\t}", "protected function getRandomString(): string\n {\n return md5(uniqid(mt_rand(), true));\n }", "function randomString()\n{\n return hash('sha256', uniqid('mt_rand', true), false);\n}", "private function createRandomString()\n {\n $characters = $this->getCharacters();\n\n return substr(str_shuffle(str_repeat($characters, self::TOKENIZR_COMPLEXITY)), 0, $this->getTokenLength());\n }", "private function randomString() {\r\n\t\t\t$rand=md5(microtime(true));\r\n\t\t\treturn $rand;\r\n\t\t}", "public static function getRandomString()\n {\n return str_random(64);\n }", "public function generate_random_string(){\n\t$alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t$random = openssl_random_pseudo_bytes(40);\n\t$alphabet_length = strlen($alphabet);\n\t$password = '';\n\tfor ($i = 0; $i < 40; ++$i) {\n\t\t$password .= $alphabet[ord($random[$i]) % $alphabet_length];\n\t}\n\treturn $password;\n}", "public function genSimplePassword() {\n $base = $this->loremIpsum(1, true);\n $password = $base . \"!\" . rand(100, 999);\n\n return $password;\n }", "protected function generate() {\n $characters = '123456789abcdefghijklmnpqrstuvwxyz';\n $string = '';\n $max = strlen($characters) - 1;\n for ($p = 0; $p < $this->codeLength; $p++) {\n $string .= $characters[mt_rand(0, $max)];\n }\n return $string;\n }", "public function generateRandomString()\n {\n return base_convert(rand(10000, 99999), 10, 36);\n }", "function generateValidationCode()\n{\n\tglobal $modSettings;\n\t\n\t$request = db_query('\n\t\tSELECT RAND()', __FILE__, __LINE__);\n\t\n\tlist ($dbRand) = mysql_fetch_row($request);\n\tmysql_free_result($request);\n\t\n\treturn substr(preg_replace('/\\W/', '', sha1(microtime() . mt_rand() . $dbRand . $modSettings['rand_seed'])), 0, 10);\t\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stores gadget specs on session in serialized form stores reserved item (gadget) on database for non globe users
function reserveitem() { $d = (object) $this->input->post(); $this->load->model('model_reservation'); // store gadget data on session in serialized form // if user is not yet going through the form if (!isset($d->from_reserve_form)) { // temporarily save on session // item data $item_data = array( 'item_type' => $d->product_type, 'product_capacity' => $d->gadget_capacity, 'product_id' => $d->product_id, 'product_name' => $d->product_name, 'product_price' => $d->product_price ); if ($this->session->userdata('reserved_item_specs')) { $this->session->unset_userdata('reserved_item_specs'); } $this->session->set_userdata('reserved_item_specs', json_encode($item_data)); $data['status'] = 'success'; } else { // get serialized spec from session $item_data = $this->session->userdata('reserved_item_specs'); $error_msg = ''; if ($d->first_name) { // check format of name if( !(preg_match("/^[a-zA-Z'-]/", $d->first_name)) ) { $error_msg .= 'First name is invalid.<br/>'; } } else { $error_msg .= 'First name is required.<br/>'; } if ($d->last_name) { // check format of name if( !(preg_match("/^[a-zA-Z'-]/", $d->last_name)) ) { $error_msg .= 'Last name is invalid.<br/>'; } } else { $error_msg .= 'Last name is required.<br/>'; } if ($d->middle_name) { // check format of name if( !(preg_match("/^[a-zA-Z'-]/", $d->middle_name)) ) { $error_msg .= 'Middle name is invalid.<br/>'; } } else { $error_msg .= 'Middle name is required.<br/>'; } if (!$d->sn_uid) { $error_msg .= 'Social network ID is required.<br/>'; } if ($d->phone) { if( !(preg_match("/^[0-9]{11}$/", $d->phone))) { $error_msg .= 'Phone number is invalid.<br/>'; } } if (!$d->phone && !$this->session->userdata('current_subscriber_mobileno')) { $error_msg .= 'Phone number is required.<br/>'; } if (!$item_data) { $error_msg .= 'Item not found on session. Please try again later.<br/>'; } if (!$error_msg) { // get user data from reserve form $reserve_data = array ( 'account_id' => '', 'first_name' => $d->first_name, 'last_name' => $d->last_name, 'middle_name' => $d->middle_name, 'email' => $d->email ? $d->email : $this->session->userdata('current_subscriber_email'), 'msisdn' => $d->phone ? trim($d->phone) : $this->session->userdata('current_subscriber_mobileno'), // 'network_carrier' => $d->network_carrier, 'social_network_sitename' => $d->sns_id, 'social_network_user_id' => $d->sn_uid, 'reserved_item_specs' => $item_data, 'reserved_datetime' => date("Y-m-d H:i:s") // datetime now ); // add to estate_reservation table $insert_id = $this->model_reservation->addReservation($reserve_data); if ($insert_id) { $data['status'] = 'success'; $data['nxt_page'] = 'home'; } else { $data['status'] = 'error'; $data['msg'] = 'An error occurred. Please try again later.'; } } else { $data['status'] = 'error'; $data['msg'] = $error_msg; } } echo json_encode($data); exit; // TODO : get account details from reserve from for non globe and store on estate accounts }
[ "private function storeSessionData()\r\n {\r\n $_SESSION['user'] = serialize($this);\r\n }", "public function save() {\n\t\tglobal $SESSION;\n\n\t\t$SESSION->rack_data = $this->serialize();\n\t}", "private function storeGame()\n {\n $_SESSION['game'] = array(\n 'remaining_ships' => $this->remainingShips,\n 'player_turns' => $this->playerTurns,\n 'ships' => $this->ships,\n 'board' => $this->board\n );\n }", "public function fillInAddedSessionData() {\n if ($this->canStartSession()) {\n $_SESSION['type'] = $this->userType;\n $_SESSION['contact_id'] = $this->contactBean->id;\n $_SESSION['portal_user_id'] = $this->userBean->id;\n // This is to make sure the licensing is handled correctly for portal logins\n $sessionManager = new SessionManager();\n $sessionManager->session_type = 'contact';\n $sessionManager->last_request_time = TimeDate::getInstance()->nowDb();\n $sessionManager->session_id = session_id();\n $sessionManager->save();\n }\n }", "function loadTagsSessionData($dbHandle, $allProgrammingTypes){\n global $log, $tagsSessionIndex;\n\n if (!session_id()) {\n session_start();\n }\n\n if(!isset($_SESSION[$tagsSessionIndex])){\n $tagFindKey = \"Version List\";\n $tagCodeField = \"Version_List_t\";\n $tagDescriptionField = \"Version_Description_t\";\n $tagDivisionField = \"Version_ProgrammingType_t\";\n $tagsArray = buildSpotVersionsSessionArray($tagFindKey, $tagCodeField, $tagDescriptionField, $tagDivisionField, $allProgrammingTypes,\n \"Tags\", $dbHandle, $tagDescriptionField);\n\n $_SESSION[$tagsSessionIndex] = $tagsArray;\n }else{\n $log->debug(\"Using Sessiopn to load Tags\");\n $tagsArray = $_SESSION[$tagsSessionIndex];\n }\n\n return $tagsArray;\n}", "function getSessionData() {\n\t\tif (isset($_SESSION[\"HA::STORE\"])) {\n\t\t\treturn serialize($_SESSION[\"HA::STORE\"]);\n\t\t}\n\t\treturn null;\n\t}", "function save() {\r\n\t\t\tif (is_array($this->variableNames)) {\r\n\t\t\t\treset($this->variableNames);\r\n\t\t\t\twhile(list($key, $value) = each($this->variableNames)) {\r\n\t\t\t\t\tif ($value == 'registered') {\r\n\t\t\t\t\t\tglobal $$key;\r\n\t\t\t\t\t\t$sessionData[$key] = $$key;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->appsession('sessiondata','',$sessionData);\r\n\t\t\t}\r\n\t\t}", "function loadSpotTypesSessionData($dbHandle, $allProgrammingTypes){\n global $log, $spotTypesSessionIndex;\n\n if (!session_id()) {\n session_start();\n }\n\n $spotTypeCodeDescriptionField = \"Spot_Type_t\";\n $spotTypeDivision = \"Spot_Type_Programming_t\";\n $spotListFilter = \"Spot Type List\";\n\n if (!isset($_SESSION[$spotTypesSessionIndex])) {\n $spotTypeArray = buildSpotVersionsSessionArray($spotListFilter, $spotTypeCodeDescriptionField, $spotTypeCodeDescriptionField,\n $spotTypeDivision, $allProgrammingTypes, \"Spot Types\", $dbHandle, $spotTypeCodeDescriptionField);\n\n $_SESSION[$spotTypesSessionIndex] = $spotTypeArray;\n } else {\n $log->debug('Using Session to load Spot Types');\n $spotTypeArray = $_SESSION[$spotTypesSessionIndex];\n }\n return $spotTypeArray;\n}", "function AJserverProfileStoreData() {\n\t$profiles = getServerProfiles();\n\t$data = array();\n\t$resources = getUserResources(array(\"serverCheckOut\"), array(\"available\"));\n\tforeach($resources['serverprofile'] as $id => $name)\n\t\t$data[$id] = array('id' => $id,\n\t\t 'name' => $name,\n\t\t 'access' => 'checkout',\n\t\t 'desc' => preg_replace(\"/\\n/\", \"<br>\", $profiles[$id]['description']));\n\t$resources = getUserResources(array(\"serverProfileAdmin\"), array(\"administer\"));\n\tforeach($resources['serverprofile'] as $id => $name)\n\t\t$data[$id] = array('id' => $id,\n\t\t 'name' => $name,\n\t\t 'access' => 'admin',\n\t\t 'desc' => preg_replace(\"/\\n/\", \"<br>\", $profiles[$id]['description']));\n\t$data = array_values($data);\n\t$data[] = array('id' => 70000,\n\t 'name' => '(New Profile)',\n\t 'access' => 'admin',\n\t 'desc' => '');\n\tsendJSON($data);\n}", "public function storeSelectionsInSession() {\n\t\t$selections = $this->getSelections(false);\n\t\tKSession::set('selections_'.$this->getPositionId(), json_encode($selections));\n\t}", "protected function sessionReader() {\r\n if($this->session) {\r\n //set here things wich wouldnt be save in the session\r\n if(isset( $_SESSION['registry'] )) {\r\n $unserialize = unserialize($_SESSION['registry']);\r\n $this->values = $unserialize;\r\n } \r\n }\r\n }", "private function sauver(){\n $this->session->set(\"panier\", serialize($this->panier));\n $this->session->set(\"panierTraite\", serialize($this->traite));\n }", "function getFakeSessionData()\n {\n return array(\n 'user' => false\n );\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "function serialize(){\n\t\t// Eine Variable für beide Klassen\n\t\t// Nicht $_SESSION[$this->className] = serialize($this);\n\t\t$_SESSION['CunddGalerie'] = serialize($this);\n\t\t\n\t}", "function addRecipeBasket($recipe)\n{\n if(isConnected())\n {\n $userDataFileName = $_SESSION[\"userDataFileName\"];\n $userDataFilePath = $userDataFileName;\n $userDataFile = fopen($userDataFilePath, \"r+\");\n $userData = unserialize(fgets($userDataFile));\n $userData[\"basket\"][] = $recipe;\n fclose($userDataFile);\n $userDataFile = fopen($userDataFilePath, \"w+\");\n fwrite($userDataFile, serialize($userData));\n fclose($userDataFile);\n }\n else\n {\n $_SESSION[\"notConnectedBasket\"][] = $recipe;\n }\n}", "public function saveParms() {\n $parms = Frx::Data()->getContext('parm');\n $_SESSION['forena_data_block_parms'][$this->block_name] = $parms;\n }", "protected function fetchSessionDataIntoSessionAttribute()\n {\n $feUser = $this->getFrontendUser();\n $this->sessionData['billing'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('billing'))\n );\n $this->sessionData['delivery'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('delivery'))\n );\n $this->sessionData['payment'] = \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::removeXSSStripTagsArray(\n $feUser->getKey('ses', \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('payment'))\n );\n $this->sessionData['mails'] = $feUser->getKey(\n 'ses',\n \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('mails')\n );\n\n if ($this->piVars['check'] == 'billing' && $this->piVars['step'] == 'payment') {\n // Remove reference to delivery address\n $this->sessionData['delivery'] = false;\n $feUser->setKey(\n 'ses',\n \\CommerceTeam\\Commerce\\Utility\\GeneralUtility::generateSessionKey('delivery'),\n false\n );\n }\n }", "public function saveState()\n {\n $encodedData = json_encode($this, JSON_OBJECT_AS_ARRAY);\n $sessionHashKey = $this->getSessionHash($this->hash);\n\n $this->session->set($sessionHashKey, $encodedData);\n $this->appendKeyToActiveSessions($sessionHashKey);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that checks the business rule loan_type_model to determine whether the loan is a CSO loan or not.
function using_cso_model($parameters) { return ($this->rules['loan_type_model'] === 'CSO') ? 1 : 0; }
[ "protected function Get_Loan_Type()\n\t\t{\n\t\t\tif($this->data['loan_type'] == 'card')\n\t\t\t{\n\t\t\t\t$this->loan_type = 'card';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->loan_type = 'standard';\n\t\t\t}\n\t\t}", "public static function isCSO($property_short, $loan_type_short)\n\t{\n\t\treturn self::getProcess($property_short, $loan_type_short, NULL) == self::PROCESS_CSO;\n\t}", "public function getLoanType()\n\t\t{\n\t\t\t$loan_type_id = $this->getLoanTypeId();\n\t\t\t$ref_list = ECash::getFactory()->getReferenceList('LoanType');\n\t\t\treturn $ref_list[$loan_type_id];\n\t\t}", "function check_category_type_match() {\n\t\t$allow = TRUE;\n\t\t$parent = clean( $_SESSION[ 'wanted_parent' ] );\n\t\t$type = clean( $_SESSION[ 'wanted_type' ] );\n\t\t\n\t\tif( $parent != 'none' && $type == 'top' ) {\n\t\t\t$allow = FALSE;\n\t\t\t$_SESSION[ 'error_mess' ] = 'Can only be a TOP level category if you have no parents.';\n\t\t}\n\t\telse if( $parent == 'none' && $type != 'top' ) {\n\t\t\t$allow = FALSE;\n\t\t\t$_SESSION[ 'error_mess' ] = 'Can only be a TOP level category when you have no parents.';\n\t\t}\n\n\t\treturn $allow;\n\t}", "public function getLoanType() {\n $post = file_get_contents('php://input');\n $val = json_decode($post);\n $headers = $this->input->request_headers();\n\t\tif ((array_key_exists('Authoriz', $headers) && !empty($headers['Authoriz'])) || (array_key_exists('authoriz', $headers) && !empty($headers['authoriz']))) { \n\t\t if(isset($headers['Authoriz'])){\n\t\t $token=$headers['Authoriz'];\n\t\t }else{\n\t\t $token=$headers['authoriz'];\n\t\t }\n\t\t $decodedToken = $this->decode_token($token);\n\t\t if ($decodedToken != false) {\t\n\t\t\t\t$result = $this->Model->select('Loan_type');\n\t\t if ($result) {\n\t\t $data_result['result'] = 'true';\n\t\t $data_result['data'] = $result;\n\t\t $data_result['msg'] = 'List of loan type';\n\t\t }else{\n\t\t $data_result['result'] = 'false';\n\t\t $data_result['msg'] = \"data not found\";\n\t\t }\n\t\t }else{\n\t\t $data_result['result'] = 'false';\n\t\t $data_result['result'] = 'Invalid Token';\n\t\t }\n\t\t}else{\n\t\t $data_result['result'] = 'false';\n\t\t $data_result['msg'] = 'Invalid Token';\n\t\t}\n \n echo json_encode($data_result);\n }", "abstract function is_business();", "public function validateType( $type ) {\n\t\t$validated = parent::validateType( $type );\n\n\t\t// Any pro notification should pass here.\n\t\tif ( 'all-pro' === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting unlicensed users.\n\t\tif ( 'unlicensed' === $type && ! aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting licensed users.\n\t\tif ( 'licensed' === $type && aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting a specific user level.\n\t\tif ( aioseo()->internalOptions->internal->license->level === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\treturn $validated;\n\t}", "public function isCompany()\n {\n return 2 == $this->account_type;\n }", "public function getLoanTypeId()\n\t{\n\t\treturn $this->loanTypeId;\n\t}", "public function is_allowed_in_objecttype($p_obj_type)\n {\n if (!$this->is_auth_active())\n {\n return true;\n } // if\n\n if (!is_numeric($p_obj_type))\n {\n if (defined($p_obj_type))\n {\n $p_obj_type = constant($p_obj_type);\n }\n else\n {\n throw new isys_exception_general('Object type constant does not exist.');\n } // if\n } // if\n\n $l_objtypes = $this->get_allowed_objecttypes();\n\n if (is_array($l_objtypes))\n {\n if (count($l_objtypes) > 0)\n {\n return isset($l_objtypes[$p_obj_type]);\n }\n else\n {\n // WILDCARD\n return true;\n } // if\n }\n else\n {\n if ($l_objtypes === true)\n {\n return true;\n } // if\n } // if\n\n return false;\n }", "function _checkChamberOfCommerce($name, $type)\n\t{\n\t\t$data = array('status' => 'success', 'message' => '\"Chamber of Commerce\" is allowed only for association (Section 34)');\n\t\t//to be change\t\n\t\t$pos = strpos($name, strtoupper('Chamber of Commerce'));\n\t\tif ($pos !== false && !empty($this->settings($type, 'id')->key) && $this->settings($type, 'id')->key != 'COMPANY_TYPE_GUARANTEE_34') {\n\t\t\t$data = array('status' => 'fail', 'message' => '\"Chamber of Commerce\" is allowed only for association (Section 34)');\n\t\t}\n\t\treturn $data;\n\t}", "public function copyLoanType($loan_type_id,$loan_name,$company_id)\n\t{\n\t\t$current_time = date('Y-m-d H:i:s');\n\t\t$loan_name_short = str_replace(\"'\",'',str_replace(' ','_',strtolower($loan_name)));\n\t\t//get Loan_type to copy\n\t\t$original_loan_type = ECash::getFactory()->getModel('LoanType');\n\t\t$original_loan_type->loadBy(array('loan_type_id' => $loan_type_id));\n\n\t\t//Copy loan type\n\t\t$new_loan_type = ECash::getFactory()->getModel('LoanType');\n\t\t$new_loan_type->name = $loan_name;\n\t\t$new_loan_type->active_status = $original_loan_type->active_status;\n\t\t$new_loan_type->name_short = $loan_name_short;\n\t\t$new_loan_type->date_modified = $current_time;\n\t\t$new_loan_type->date_created = $current_time;\n\t\t$new_loan_type->company_id = $company_id;\n\t\t$new_loan_type->insert();\n\t\t$new_loan_type_id = $new_loan_type->loan_type_id;\n\n\t\t//get CFE ruleset to copy\n\t\t\n\t\t$original_cfe_ruleset = ECash::getFactory()->getModel('CfeRuleSet');\n\t\t$original_cfe_ruleset->getActiveByLoanType($loan_type_id);\n\t\t$original_cfe_ruleset_id = $original_cfe_ruleset->cfe_rule_set_id;\n\t\t\n\t\t//get eCash Business rule to copy\n\t\t$original_ecash_ruleset = ECash::getFactory()->getModel('RuleSet');\n\t\t$original_ecash_ruleset->getActiveByLoanType($loan_type_id);\n\t\t$original_ecash_ruleset_id = $original_ecash_ruleset->rule_set_id;\n\t\t\n\t\t//Copy CFE ruleset\n\t\t$new_cfe_ruleset = ECash::getFactory()->getModel('CfeRuleSet');\n\t\t$new_cfe_ruleset->date_created = $current_time;\n\t\t$new_cfe_ruleset->date_modified = $current_time;\n\t\t$new_cfe_ruleset->loan_type_id = $new_loan_type_id;\n\t\t$new_cfe_ruleset->date_effective = $current_time;\n\t\t$new_cfe_ruleset->name = $loan_name.\" Rule Set\";\n\t\t$new_cfe_ruleset->insert();\n\t\t\n\t\t$new_cfe_ruleset_id = $new_cfe_ruleset->cfe_rule_set_id;\t\t\n\t\t\n\t\t//Copy eCash Business rule\n\t\t$new_ecash_ruleset = ECash::getFactory()->getModel('RuleSet');\n\t\t$new_ecash_ruleset->date_modified = $current_time;\n\t\t$new_ecash_ruleset->date_created = $current_time;\n\t\t$new_ecash_ruleset->name = $loan_name.\" Rule Set\";\n\t\t$new_ecash_ruleset->loan_type_id = $new_loan_type_id;\n\t\t$new_ecash_ruleset->date_effective = $current_time;\n\t\t$new_ecash_ruleset->insert();\n\t\t$new_ecash_ruleset_id = $new_ecash_ruleset->rule_set_id;\n\t\t\n\t\t//get eCash Business Ruleset Components to copy\n\t\t$original_rule_set_component_list = ECash::getFactory()->getModel('RuleSetComponentList');\n\t\t$original_rule_set_component_list->loadBy(array('rule_set_id' => $original_ecash_ruleset_id));\n\t\t\n\t\t//Copy Ruleset Components\n\t\tforeach ($original_rule_set_component_list as $original_rule_set_component) \n\t\t{\n\t\t\t$new_rule_set_component = ECash::getFactory()->getModel('RuleSetComponent');\n\t\t\t$new_rule_set_component->rule_set_id = $new_ecash_ruleset_id;\n\t\t\t$new_rule_set_component->rule_component_id = $original_rule_set_component->rule_component_id;\n\t\t\t$new_rule_set_component->sequence_no = $original_rule_set_component->sequence_no;\n\t\t\t$new_rule_set_component->date_modified = $current_time;\n\t\t\t$new_rule_set_component->date_created = $current_time;\n\t\t\t$new_rule_set_component->insert();\n\t\t\t\n\t\t\t$new_rule_set_component_id = $new_rule_set_component->rule_component_id;\n\t\t}\t\t\n\t\t//get eCash Ruleset Component Parm Values to copy\n\t\t$original_rscpv_list = ECash::getFactory()->getModel('RuleSetComponentParmValueList');\n\t\t$original_rscpv_list->loadBy(array('rule_set_id' => $original_ecash_ruleset_id));\n\t\t\n\t\t//Copy eCash Ruleset Component Parm Values\n\t\tforeach ($original_rscpv_list as $original_rscpv) \n\t\t{\n\t\t\t$new_rscpv = ECash::getFactory()->getModel('RuleSetComponentParmValue');\n\t\t\t$new_rscpv->date_modified = $current_time;\n\t\t\t$new_rscpv->date_created = $current_time;\n\t\t\t$new_rscpv->rule_component_id = $original_rscpv->rule_component_id;\n\t\t\t$new_rscpv->rule_component_parm_id = $original_rscpv->rule_component_parm_id;\n\t\t\t$new_rscpv->parm_value\t=\t$original_rscpv->parm_value;\n\t\t\t$new_rscpv->rule_set_id = $new_ecash_ruleset_id;\n\t\t\t$new_rscpv->insert();\n\t\t\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\t\n\t\t//get CFE rules to copy\n\t\t$original_cfe_rule_list = ECash::getFactory()->getModel('CfeRuleList');\n\t\t$original_cfe_rule_list->loadBy(array(\"cfe_rule_set_id\" => $original_cfe_ruleset_id));\n\t\t//Copy CFE rules\n\t\tforeach ($original_cfe_rule_list as $original_cfe_rule) \n\t\t{\n\t\t\t$original_cfe_rule_id = $original_cfe_rule->cfe_rule_id;\n\t\t\t$new_cfe_rule = ECash::getFactory()->getModel('CfeRule');\n\t\t\t$new_cfe_rule->date_modified = $current_time;\n\t\t\t$new_cfe_rule->date_created = $current_time;\n\t\t\t$new_cfe_rule->name = $original_cfe_rule->name;\n\t\t\t$new_cfe_rule->cfe_event_id = $original_cfe_rule->cfe_event_id;\n\t\t\t$new_cfe_rule->salience = $original_cfe_rule->salience;\n\t\t\t$new_cfe_rule->cfe_rule_set_id = $new_cfe_ruleset_id;\n\t\t\t$new_cfe_rule->insert();\n\t\t\t$new_cfe_rule_id = $new_cfe_rule->cfe_rule_id;\n\t\t\t\n\t\t\t//get CFE rule actions to copy\n\t\t\t$original_cfe_rule_action_list = ECash::getFactory()->getModel('CfeRuleActionList');\n\t\t\t$original_cfe_rule_action_list->loadBy(array(\"cfe_rule_id\" => $original_cfe_rule_id));\n\t\t\t//Copy CFE rule actions\n\t\t\tforeach ($original_cfe_rule_action_list as $original_cfe_rule_action) \n\t\t\t{\n\t\t\t\t$original_cfe_rule_action_id = $original_cfe_rule_action->cfe_rule_action_id;\n\t\t\t\t$new_cfe_rule_action = ECash::getFactory()->getModel('CfeRuleAction');\t\n\t\t\t\t$new_cfe_rule_action->date_modified = $current_time;\n\t\t\t\t$new_cfe_rule_action->date_created = $current_time;\n\t\t\t\t$new_cfe_rule_action->cfe_action_id = $original_cfe_rule_action->cfe_action_id;\n\t\t\t\t$new_cfe_rule_action->params = $original_cfe_rule_action->params;\n\t\t\t\t$new_cfe_rule_action->sequence_no = $original_cfe_rule_action->sequence_no;\n\t\t\t\t$new_cfe_rule_action->rule_action_type = $original_cfe_rule_action->rule_action_type;\n\t\t\t\t$new_cfe_rule_action->cfe_rule_id = $new_cfe_rule_id;\n\t\t\t\t$new_cfe_rule_action->insert();\n\t\t\t}\n\t\t\t\n\t\t\t//get CFE rule conditions to copy\n\t\t\t$original_cfe_rule_condition_list = ECash::getFactory()->getModel('CfeRuleConditionList');\n\t\t\t$original_cfe_rule_condition_list->loadBy(array('cfe_rule_id' => $original_cfe_rule_id));\n\t\t\t//Copy CFE rule conditions\n\t\t\tforeach ($original_cfe_rule_condition_list as $original_cfe_rule_condition) \n\t\t\t{\n\t\t\t\t$new_cfe_rule_condition = ECash::getFactory()->getModel('CfeRuleCondition');\n\t\t\t\t$new_cfe_rule_condition->date_modified = $current_time;\n\t\t\t\t$new_cfe_rule_condition->date_created = $current_time;\n\t\t\t\t$new_cfe_rule_condition->cfe_rule_id = $new_cfe_rule_id;\n\t\t\t\t$new_cfe_rule_condition->operator = $original_cfe_rule_condition->operator;\n\t\t\t\t$new_cfe_rule_condition->operand1 = $original_cfe_rule_condition->operand1;\n\t\t\t\t$new_cfe_rule_condition->operand1_type = $original_cfe_rule_condition->operand1_type;\n\t\t\t\t$new_cfe_rule_condition->operand2 = $original_cfe_rule_condition->operand2;\n\t\t\t\t$new_cfe_rule_condition->operand2_type = $original_cfe_rule_condition->operand2_type;\n\t\t\t\t$new_cfe_rule_condition->sequence_no = $original_cfe_rule_condition->sequence_no;\n\t\t\t\t$new_cfe_rule_condition->insert();\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function getCtype() {}", "public function getCompanyType();", "private function check_cType() {\n $column = $this->ci->input->post('columns');\n if (is_numeric($column[0]['data']))\n return FALSE;\n else\n return TRUE;\n }", "public function has_cat($p_obj_type, $p_constants = [])\n {\n if (count($p_constants) == 0)\n {\n return false;\n } // if\n\n // Add quotation marks around the constants for the IN condition.\n $l_conditioner = [];\n $l_is_array = false;\n if (is_array($p_constants))\n {\n $l_is_array = true;\n foreach ($p_constants as $l_cats_constant)\n {\n $l_conditioner[] = $this->convert_sql_text($l_cats_constant);\n } // foreach\n $l_where_condition_category = \"AND igc.isysgui_catg__const IN(\" . implode(\",\", $l_conditioner) . \");\";\n }\n else\n {\n $l_where_condition_category = \"AND igc.isysgui_catg__const = \" . $this->convert_sql_text($p_constants) . \";\";\n } // if\n\n // CATG-Query.\n $l_sql = \"SELECT *\n\t\t\tFROM isys_obj_type_2_isysgui_catg\n\t\t\tINNER JOIN isysgui_catg igc ON isys_obj_type_2_isysgui_catg__isysgui_catg__id = igc.isysgui_catg__id\n\t\t\tWHERE isys_obj_type_2_isysgui_catg__isys_obj_type__id = \" . $this->convert_sql_id($p_obj_type) . \" \" . $l_where_condition_category;\n\n if (count($this->retrieve($l_sql)) > 0)\n {\n return true;\n } // if\n\n $l_res = $this->get_specific_category($p_obj_type, C__RECORD_STATUS__NORMAL, null, true);\n\n if (count($l_res) > 0)\n {\n while ($l_row = $l_res->get_row())\n {\n if ($l_is_array)\n {\n if (in_array($l_row[\"isysgui_cats__const\"], $p_constants))\n {\n return true;\n } // if\n }\n else\n {\n if ($l_row[\"isysgui_cats__const\"] == $p_constants)\n {\n return true;\n } // if\n } // if\n } // while\n } // if\n\n return false;\n }", "public function validateTypeAbo()\n {\n $this->addError('fk_type_abonnement', 'Abonnement non disponible.');\n if (date('Y', strtotime($this->date_naissance)) < '1981') {\n $this->addError('fk_type_abonnement', 'Abonnement non disponible.');\n }\n }", "function isTypeLeague() {\r\n\t\treturn $this->record['type'] == 1;\r\n\t}", "public function isBusiness(): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the default callback function for displaing the media tag items. You can override this by creating your own function under your theme and passing the name of that function as parameter 'display_item_callback'. Your function needs to support the one argument $post_item which is the attachment item itself. In the example (default) function below I use an optional second argument to control the size of the image displayed. The size argument is passed into get_attachments_by_media_tags() to control which image is output. As you can define your own callback function you can obviously control which version of the image you are going to display.
function default_item_callback($post_item, $size='medium') { // echo "post_item<pre>"; print_r($post_item); echo "</pre>"; $image_src = wp_get_attachment_image_src($post_item->ID, $size); return '<li class="media-tag-list" id="media-tag-item-'.$post_item->ID.'"><img src="'.$image_src[0].'" width="'.$image_src[1].'" height="'.$image_src[2].'" title="'.$post_item->post_title.'" /></li>'; }
[ "function print_blog_thumbnail( $post_id, $item_size ){\n\t\t$thumbnail_types = get_post_meta( $post_id, 'post-option-thumbnail-types', true);\n\t\t\n\t\tif( $thumbnail_types == \"Image\" || empty($thumbnail_types) ){\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t\t$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );\n\t\t\t$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);\n\t\t\tif( !empty($thumbnail) ){\n\t\t\t\techo '<div class=\"blog-media-wrapper gdl-image\">';\n\t\t\t\techo '<a href=\"' . get_permalink() . '\"><img src=\"' . $thumbnail[0] .'\" alt=\"'. $alt_text .'\"/></a>';\n\t\t\t\techo '</div>';\t// blog-media-wrapper\n\t\t\t}\n\t\t}else if( $thumbnail_types == \"Video\" ){\n\t\t\t$video_link = get_post_meta( $post_id, 'post-option-thumbnail-video', true); \n\t\t\techo '<div class=\"blog-media-wrapper gdl-video\">';\n\t\t\techo get_video($video_link, gdl_get_width($item_size), gdl_get_height($item_size));\n\t\t\techo '</div>';\t// blog-media-wrapper\n\t\t}else if ( $thumbnail_types == \"Slider\" ){\n\t\t\t$slider_xml = get_post_meta( $post_id, 'post-option-thumbnail-xml', true); \n\t\t\t$slider_xml_dom = new DOMDocument();\n\t\t\t$slider_xml_dom->loadXML($slider_xml);\n\t\t\techo '<div class=\"blog-media-wrapper gdl-slider\">';\n\t\t\techo print_flex_slider($slider_xml_dom->documentElement, $item_size);\n\t\t\techo '</div>';\t// blog-media-wrapper\n\t\t}else if ( $thumbnail_types == \"HTML5 Video\" ){\n\t\t\t$video = get_post_meta( $post_id, 'post-option-thumbnail-html5-video', true); \n\t\t\techo '<div class=\"blog-media-wrapper gdl-html5-video\">';\n\t\t\tget_html5_video($video);\n\t\t\techo '</div>';\t// blog-media-wrapper\t\t\n\t\t}\t\n\t}", "function print_blog_thumbnail( $post_id, $item_size ){\n\t\n\t\t$thumbnail_types = get_post_meta( $post_id, 'post-option-inside-thumbnail-types', true);\n\t\t\n\t\tif( $thumbnail_types == \"Image\" || empty($thumbnail_types) ){\n\t\t\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t\t$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );\n\t\t\t$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);\n\t\t\tif( !empty($thumbnail) ){\n\t\t\t\techo '<div class=\"blog-thumbnail-image\">';\n\t\t\t\techo '<a href=\"' . get_permalink() . '\"><img src=\"' . $thumbnail[0] .'\" alt=\"'. $alt_text .'\"/></a>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t\n\t\t}else if( $thumbnail_types == \"Video\" ){\n\t\t\t\n\t\t\t$video_link = get_post_meta( $post_id, 'post-option-inside-thumbnail-video', true); \n\t\t\techo '<div class=\"blog-thumbnail-video\">';\n\t\t\techo get_video($video_link, cp_get_width($item_size), cp_get_height($item_size));\n\t\t\techo '</div>';\n\t\t\t\n\t\t}else if ( $thumbnail_types == \"Slider\" ){\n\n\t\t\t$slider_xml = get_post_meta( $post_id, 'post-option-inside-thumbnail-xml', true); \n\t\t\t$slider_xml_dom = new DOMDocument();\n\t\t\t$slider_xml_dom->loadXML($slider_xml);\n\t\t\t\n\t\t\techo '<div class=\"blog-thumbnail-slider\">';\n\t\t\techo print_flex_slider($slider_xml_dom->documentElement, $item_size);\n\t\t\techo '</div>';\t\t\t\n\t\t\n\t\t}\t\n\t\t\n\t}", "function print_blog_thumbnail( $post_id, $item_size, $style = '' ){\n\t\n\t\t$thumbnail_types = get_post_meta( $post_id, 'post-option-thumbnail-types', true);\n\t\t\n\t\tif( $thumbnail_types == \"Image\" || empty($thumbnail_types) ){\n\t\t\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t\t$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );\n\t\t\t$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);\n\t\t\tif( !empty($thumbnail) ){\n\t\t\t\techo '<div class=\"blog-thumbnail-wrapper\">';\n\t\t\t\techo '<div class=\"blog-thumbnail-image\">';\n\t\t\t\techo '<a href=\"' . get_permalink() . '\"><img src=\"' . $thumbnail[0] .'\" alt=\"'. $alt_text .'\"/></a></div>';\n\t\t\t\t\n\t\t\t\tif( $style == 'full-style' ){\n\t\t\t\t\techo '<div class=\"blog-thumbnail-inner-info\">';\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-date\">' . get_the_time( GDL_DATE_FORMAT ) . '</div>';\n\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-author\"> ' . __('by','gdl_front_end') . ' ' . get_the_author_link() . '</div>';\n\t\t\t\t\t\n\t\t\t\t\tthe_tags('<div class=\"blog-thumbnail-tag\">', ', ', '</div>');\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-comment\">';\n\t\t\t\t\tcomments_popup_link( __('0','gdl_front_end'),\n\t\t\t\t\t\t__('1','gdl_front_end'),\n\t\t\t\t\t\t__('%','gdl_front_end'), '',\n\t\t\t\t\t\t__('Comments are off','gdl_front_end') );\n\t\t\t\t\techo '</div>';\n\t\t\t\t\t\n\t\t\t\t\techo '</div>';//blog-thumbnail-inner-info\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo '</div>'; // blog-thumbnail-wrapper\n\t\t\t}\n\t\t\n\t\t}else if( $thumbnail_types == \"Video\" ){\n\t\t\t\n\t\t\t$video_link = get_post_meta( $post_id, 'post-option-thumbnail-video', true); \n\t\t\techo '<div class=\"blog-thumbnail-video\">';\n\t\t\techo get_video($video_link, gdl_get_width($item_size), gdl_get_height($item_size));\n\t\t\techo '</div>';\n\t\t\n\t\t}else if ( $thumbnail_types == \"Slider\" ){\n\n\t\t\t$slider_xml = get_post_meta( $post_id, 'post-option-thumbnail-xml', true); \n\t\t\t$slider_xml_dom = new DOMDocument();\n\t\t\t$slider_xml_dom->loadXML($slider_xml);\n\t\t\t\n\t\t\techo '<div class=\"blog-thumbnail-slider\">';\n\t\t\techo print_flex_slider($slider_xml_dom->documentElement, $item_size);\n\t\t\techo '</div>';\t\t\t\n\t\t\n\t\t}\t\n\t\t\n\t}", "function wpex_get_blog_post_thumbnail( $args = '' ) {\n\n\t$supports_thumbnail = ( 'audio' == get_post_format() ) ? false : true;\n\n\tif ( ! apply_filters( 'wpex_blog_post_supports_thumbnail', $supports_thumbnail ) ) {\n\t\treturn;\n\t}\n\n\t// If args isn't array then it's the attachment\n\tif ( ! is_array( $args ) && ! empty( $args ) ) {\n\t\t$args = array(\n\t\t\t'attachment' => $args,\n\t\t\t'alt' => wpex_get_esc_title(),\n\t\t\t'width' => '',\n\t\t\t'height' => '',\n\t\t\t'class' => '',\n\t\t\t'schema_markup' => false,\n\t\t);\n\t}\n\n\t// Defaults\n\t$defaults = array(\n\t\t'size' => 'blog_post',\n\t\t'schema_markup' => true,\n\t\t'alt' => wpex_get_esc_title(),\n\t\t'apply_filters' => 'wpex_blog_post_thumbnail_args',\n\t);\n\n\t// Parse arguments\n\t$args = wp_parse_args( $args, $defaults );\n\n\t// Change size for above media\n\tif ( 'above' == get_post_meta( get_the_ID(), 'wpex_post_media_position', true ) ) {\n\t\t$args['size'] = 'blog_post_full';\n\t}\n\n\t// Generate thumbnail\n\t$thumbnail = wpex_get_post_thumbnail( $args );\n\n\t// Apply filters for child theming\n\treturn apply_filters( 'wpex_blog_post_thumbnail', $thumbnail );\n\n}", "function wptu_add_post_image(){\n global $post;\n\n /* Allow plugins/themes to filter the arguments. */\n $args = apply_filters( 'wptu_add_post_image_args', $args );\n \n /* Merge the input arguments and the defaults. */\n $args = wp_parse_args( $args, $defaults );\n \n /*set attributes*/\n $title = $args['title'] ? $args['title'] : $post->post_title;\n $before = $args['before'] ? $args['before'] : '';\n $after = $args['after'] ? $args['after'] : '';\n\n if( function_exists( 'wptu_get_attachment' ) ){\n\n $output ='';\n if( is_page() || is_single() ){\n \n $size = $args['size'] ? $args['size'] : 'medium';\n $class = $args['class'] ? $args['class']: \"alignleft\";\n $alt = $args['alt'] ? $args['alt'] : $post->post_title;\n $fancybox = $args['fancybox'] ? true : false;\n \n $image = wptu_get_attachment(\"before={$before}&after={$after}&size={$size}&class={$class}&link={$link}&fancybox={$fancybox}\");\n \n $output .= $image['image_tag'];\n echo $output;\n return true;\n }\n else {\n $size = $args['size'] ? $args['size'] : 'thumbnail';\n $class = $args['class'] ? $args['class'] : \"alignleft\";\n \n $link = $args['link'] ? urldecode( $args['link'] ) : get_permalink( $args['post_id']);\n\n $fancybox = $args['fancybox'] ? $args['fancybox'] : false;\n\n $image = wptu_get_attachment(\"before={$before}&after={$after}&size={$size}&class={$class}&link={$link}&fancybox={$fancybox}\");\n\n $output .= $image['image_tag'];\n\n echo $output;\n return true;\n }\n }\n}", "public function get_object_attachments( $item_id, $args = array() );", "function The_Post_Custom_thumbnail( $post_id, $size = 'featured-thumbnail', $addtional_attributes = [] )\n{\n echo Get_The_Post_Custom_thumbnail($post_id, $size, $addtional_attributes);\n}", "function media_printimgdetail($item, $fullscreen=false){\n // prepare thumbnail\n $size = $fullscreen ? 90 : 120;\n\n $w = (int) $item['meta']->getField('File.Width');\n $h = (int) $item['meta']->getField('File.Height');\n if($w>$size || $h>$size){\n if (!$fullscreen) {\n $ratio = $item['meta']->getResizeRatio($size);\n } else {\n $ratio = $item['meta']->getResizeRatio($size,$size);\n }\n $w = floor($w * $ratio);\n $h = floor($h * $ratio);\n }\n $src = ml($item['id'],array('w'=>$w,'h'=>$h,'t'=>$item['mtime']));\n $p = array();\n if (!$fullscreen) {\n // In fullscreen mediamanager view, image resizing is done via CSS.\n $p['width'] = $w;\n $p['height'] = $h;\n }\n $p['alt'] = $item['id'];\n $att = buildAttributes($p);\n\n // output\n if ($fullscreen) {\n echo '<a id=\"l_:'.$item['id'].'\" class=\"image thumb\" href=\"'.\n media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')).'\">';\n echo '<img src=\"'.$src.'\" '.$att.' />';\n echo '</a>';\n }\n\n if ($fullscreen) return;\n\n echo '<div class=\"detail\">';\n echo '<div class=\"thumb\">';\n echo '<a id=\"d_:'.$item['id'].'\" class=\"select\">';\n echo '<img src=\"'.$src.'\" '.$att.' />';\n echo '</a>';\n echo '</div>';\n\n // read EXIF/IPTC data\n $t = $item['meta']->getField(array('IPTC.Headline','xmp.dc:title'));\n $d = $item['meta']->getField(array('IPTC.Caption','EXIF.UserComment',\n 'EXIF.TIFFImageDescription',\n 'EXIF.TIFFUserComment'));\n if(utf8_strlen($d) > 250) $d = utf8_substr($d,0,250).'...';\n $k = $item['meta']->getField(array('IPTC.Keywords','IPTC.Category','xmp.dc:subject'));\n\n // print EXIF/IPTC data\n if($t || $d || $k ){\n echo '<p>';\n if($t) echo '<strong>'.htmlspecialchars($t).'</strong><br />';\n if($d) echo htmlspecialchars($d).'<br />';\n if($t) echo '<em>'.htmlspecialchars($k).'</em>';\n echo '</p>';\n }\n echo '</div>';\n}", "function get_item_thumbnail_default($object_id) {\n $type = get_post_meta($object_id, 'socialdb_object_dc_type', true);\n $icon = ( in_array($type, ['audio', 'video', 'pdf', 'text']) ) ? $type : \"image\";\n if(get_post($object_id)->post_type=='socialdb_collection'){\n if(has_filter('alter_thumbnail_collections')){\n return apply_filters( 'alter_thumbnail_collections', $icon) ;\n }else{\n return get_template_directory_uri() . \"/libraries/images/${icon}.png\"; \n } \n }else if(has_filter('alter_thumbnail_items')){\n return apply_filters( 'alter_thumbnail_items', $icon) ;\n }else{\n return get_template_directory_uri() . \"/libraries/images/${icon}.png\"; \n } \n \n}", "public function get_gallery_item( $id, $item, $post_id = 0 ) {\n\n // Get thumbnail\n $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' ); \n\n // Add id to $item for Backbone model\n $item['id'] = $id;\n\n // Allow addons to populate the item's data - for example, tags which are stored against the attachment\n $item = apply_filters( 'envira_gallery_get_gallery_item', $item, $id, $post_id );\n $item['alt'] = str_replace( \"&quot;\", '\\\"', $item['alt'] );\n $item['_thumbnail'] = $thumbnail[0]; // Never saved against the gallery item, just used for the thumbnail output in the Edit Gallery screen.\n \n // Buffer the output\n ob_start(); \n ?>\n <li id=\"<?php echo $id; ?>\" class=\"envira-gallery-image envira-gallery-status-<?php echo $item['status']; ?>\" data-envira-gallery-image=\"<?php echo $id; ?>\" data-envira-gallery-image-model='<?php echo json_encode( $item, JSON_HEX_APOS ); ?>'>\n <img src=\"<?php echo esc_url( $item['_thumbnail'] ); ?>\" alt=\"<?php esc_attr_e( $item['alt'] ); ?>\" />\n <div class=\"meta\">\n <div class=\"title\">\n <span>\n <?php \n // Output Title.\n echo ( isset( $item['title'] ) ? $item['title'] : '' ); \n\n // If the title exceeds 20 characters, the grid view will deliberately only show the first line of the title.\n // Therefore we need to make it clear to the user that the full title is there by way of a hint.\n ?>\n </span>\n <a class=\"hint <?php echo ( ( strlen( $item['title'] ) > 20 ) ? '' : ' hidden' ); ?>\" title=\"<?php echo ( isset( $item['title'] ) ? $item['title'] : '' ); ?>\">...</a>\n </div>\n <div class=\"additional\">\n <?php \n // Addons can add content to this meta section, which is displayed when in the List View.\n echo apply_filters( 'envira_gallery_metabox_output_gallery_item_meta', '', $item, $id, $post_id ); \n ?>\n </div>\n </div>\n\n <a href=\"#\" class=\"check\"><div class=\"media-modal-icon\"></div></a>\n <a href=\"#\" class=\"dashicons dashicons-trash envira-gallery-remove-image\" title=\"<?php _e( 'Remove Image from Gallery?', 'envira-gallery' ); ?>\"></a>\n <a href=\"#\" class=\"dashicons dashicons-edit envira-gallery-modify-image\" title=\"<?php _e( 'Modify Image', 'envira-gallery' ); ?>\"></a>\n </li>\n <?php\n return ob_get_clean();\n\n }", "function get_attached_images( $args = null )\n{\n\t\n\t/**\n\t * Define the array of defaults\n\t */\n\t\n\t$defaults = array(\n\t\t'pageID' => false,\n\t\t'size' => 'thumbnail',\n\t\t'single' => false,\n\t\t'prepend' => '<figure>',\n\t\t'append' => '</figure>',\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'echo' => true\n\t);\n\t\n\t$args = wp_parse_args( $args, $defaults );\n\t\n\textract( $args, EXTR_SKIP );\n\t\n\t$output = \"\";\n\n\t// first check if we've passed in a specific page ID\n\tif ($pageID != FALSE) {\n\t\t$id = $pageID;\n\t} else {\n\t\tglobal $post;\n\t\t$id = $post->ID;\n\t}\n\t\n\t// now, retrieve all the images\n\t$images = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ));\n\n\t// set the counter to prevent undefined variable warning\n\t$i = 0;\n\t\n\tif ($images) {\n\t\tif ($echo) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t$i++;\n\n\t\t\t\tif ($image->post_excerpt) {\n\t\t\t\t\t$caption = '<figcaption>' . $image->post_excerpt . '</figcaption>'; \n\t\t\t\t} else {\n\t\t\t\t\t$caption = '';\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$output .= $prepend . wp_get_attachment_image($image->ID, $size) . $caption . $append;\n\t\t\t\n\t\t\t\tif ($single == TRUE && $i == 1) break;\n\t\t\t}\n\n\t\t\treturn $output;\n\t\t} else {\n\t\t\treturn $images;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}", "function get_attached_images( $args=null )\n{\n\t\n\t/**\n\t * Define the array of defaults\n\t */\n\t\n\t$defaults = array(\n\t\t'pageID' => false,\n\t\t'size' => 'thumbnail',\n\t\t'single' => false,\n\t\t'prepend' => '<figure>',\n\t\t'append' => '</figure>',\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'echo' => true\n\t);\n\t\n\t$args = wp_parse_args( $args, $defaults );\n\t\n\textract( $args, EXTR_SKIP );\n\t\n\t$output = \"\";\n\n\t// first check if we've passed in a specific page ID\n\tif ($pageID != FALSE) {\n\t\t$id = $pageID;\n\t} else {\n\t\tglobal $post;\n\t\t$id = $post->ID;\n\t}\n\t\n\t// now, retrieve all the images\n\t$images = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ));\n\n\t// set the counter to prevent undefined variable warning\n\t$i = 0;\n\t\n\tif ($images) {\n\t\tif ($echo) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t$i++;\n\n\t\t\t\tif ($image->post_excerpt) {\n\t\t\t\t\t$caption = '<figcaption>' . $image->post_excerpt . '</figcaption>'; \n\t\t\t\t} else {\n\t\t\t\t\t$caption = '';\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$output .= $prepend . wp_get_attachment_image($image->ID, $size) . $caption . $append;\n\t\t\t\n\t\t\t\tif ($single == TRUE && $i == 1) break;\n\t\t\t}\n\n\t\t\treturn $output;\n\t\t} else {\n\t\t\treturn $images;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}", "function mbudm_get_post_image_tag_and_caption($pid,$image_size){\n\t$p_img_id = null;\n\tif ( has_post_thumbnail($pid) ){\n\t\t$p_img_id = get_post_thumbnail_id($pid);\n\t}else{\n\t\t//attachments are stored in a custom way so as not to disturb native attachments\n\t\t$atts = get_post_meta( $pid, '_attachments', false );\n\t\t// decode and unserialize the data of the first attachment\n\t\tif($atts){\n\t\t\t$data = unserialize( base64_decode( $atts[0] ) );\n\t\t\t$p_img_id = $data['id'];\n\t\t}\n\t}\n\n\treturn mbudm_get_image_tag_and_caption($pid, $p_img_id,$image_size);\n}", "function cmb2_output_file_list( $file_list_meta_key, $img_size = 'small' ) {\n\n // Get the list of files\n $files = get_post_meta( get_the_ID(), $file_list_meta_key, 1 );\n\n $default_attr = array(\n 'class' => \"img_full_responsive\",\n );\n\n echo ' ';\n // Loop through them and output an image\n foreach ( (array) $files as $attachment_id => $attachment_url ) {\n echo '<div class=\"col-md-4\">';\n echo wp_get_attachment_image( $attachment_id, $img_size, '', $default_attr );\n echo '</div>';\n }\n echo ' ';\n}", "public static function attached_image() {\n\t\t$post = get_post();\n\t\t$attachment_size = apply_filters( 'appp_attachment_size', array( 1200, 1200 ) );\n\t\t$next_attachment_url = wp_get_attachment_url();\n\n\t\t/**\n\t\t * Grab the IDs of all the image attachments in a gallery so we can get the URL\n\t\t * of the next adjacent image in a gallery, or the first image (if we're\n\t\t * looking at the last image in a gallery), or, in a gallery of one, just the\n\t\t * link to that image file.\n\t\t */\n\t\t$attachments = array_values( get_children( array(\n\t\t\t'post_parent' => $post->post_parent,\n\t\t\t'post_status' => 'inherit',\n\t\t\t'post_type' => 'attachment',\n\t\t\t'post_mime_type' => 'image',\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'menu_order ID'\n\t\t) ) );\n\n\t\t// If there is more than 1 attachment in a gallery...\n\t\tif ( count( $attachments ) > 1 ) {\n\t\t\tforeach ( $attachments as $k => $attachment ) {\n\t\t\t\tif ( $attachment->ID == $post->ID )\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$k++;\n\n\t\t\t// get the URL of the next image attachment...\n\t\t\tif ( isset( $attachments[ $k ] ) )\n\t\t\t\t$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );\n\n\t\t\t// or get the URL of the first image attachment.\n\t\t\telse\n\t\t\t\t$next_attachment_url = get_attachment_link( $attachments[0]->ID );\n\t\t}\n\n\t\tprintf( '<a href=\"%1$s\" title=\"%2$s\" rel=\"attachment\">%3$s</a>',\n\t\t\tesc_url( $next_attachment_url ),\n\t\t\tthe_title_attribute( array( 'echo' => false ) ),\n\t\t\twp_get_attachment_image( $post->ID, $attachment_size )\n\t\t);\n\t}", "function Show_attachments_img_thumb($data=array()) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<a class='resized_img' rel='lightbox[{$data['attach_rel_id']}]' id='ipb-attach-url-{$data['_attach_id']}' href=\"{parse url=\"app=core&amp;module=attach&amp;section=attach&amp;attach_rel_module={$data['type']}&amp;attach_id={$data['attach_id']}\" base=\"public\"}\" title=\"{$data['location']} - {$this->lang->words['attach_size']} {$data['file_size']}, {$this->lang->words['attach_ahits']} {$data['attach_hits']}\"><img itemprop=\"image\" src=\"{$this->settings['upload_url']}/{$data['t_location']}\" id='ipb-attach-img-{$data['_attach_id']}' style='width:{$data['t_width']};height:{$data['t_height']}' class='attach' width=\"{$data['t_width']}\" height=\"{$data['t_height']}\" alt=\"{$data['location']}\" /></a>\n{parse expression=\"$this->registry->output->addMetaTag( 'og:image', \"{$this->settings['upload_url']}/{$data['t_location']}\", false )\"}\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function auxin_get_post_type_media_args( $post, $settings = array() ){\n\n global $aux_content_width;\n\n $defaults = array(\n 'post_type' => 'post',\n 'request_from' => 'archive',\n 'no_gallery' => false,\n 'ignore_media' => false, // whether to ignore generating the media for post or not\n 'crop' => true,\n 'mask_image' => true, // add max height for the image frame\n 'content_width' => '',\n 'upscale_image' => false,\n 'media_size' => '', // large, medium, thumbnail\n 'aspect_ratio' => 9/16,\n 'image_from_content' => true, // whether to try to get image from content or not\n 'preloadable' => true, // whether to lazyload the images or not\n 'preload_preview' => true,\n 'preload_bgcolor' => '',\n 'add_image_hw' => true, // whether to add with and height attrs to image\n 'image_sizes' => 'auto',\n 'srcset_sizes' => 'auto',\n 'ignore_formats' => array() // ignore specific post formats or all by adding *\n );\n\n $settings = wp_parse_args( $settings, $defaults );\n extract( $settings );\n\n // call post format media function if post type is post\n if( $post && 'post' == $post_type ) {\n return auxin_get_post_format_media( $post, $settings );\n }\n\n if ( empty( $media_width ) ) {\n $media_width = $aux_content_width;\n }\n\n // the array format that will be returned by this function\n $args = array(\n 'post_format' => '',\n 'has_attach' => false,\n 'the_attach' => '',\n 'the_media' => '',\n 'the_name' => '',\n 'the_link' => '',\n 'show_title' => true,\n 'page_layout' => '',\n 'excerpt' => ''\n );\n\n if( empty( $post ) ){\n return $args;\n }\n\n $args['has_attach'] = has_post_thumbnail();\n\n\n if( $image_from_content && ! $args['has_attach'] ) {\n $args['the_attach'] = auxin_get_first_image_from_string( get_the_content() );\n $args['has_attach'] = ! empty( $args['the_attach'] );\n } else {\n $args['the_attach'] = auxin_get_the_post_responsive_thumbnail(\n $post->ID,\n array(\n 'size' => $media_size,\n 'crop' => $crop,\n 'add_hw' => $add_image_hw,\n 'preloadable' => $preloadable,\n 'preload_preview' => $preload_preview,\n 'preload_bgcolor' => $preload_bgcolor,\n 'image_sizes' => $image_sizes,\n 'srcset_sizes' => $srcset_sizes,\n 'upscale' => $upscale_image\n )\n );\n }\n\n if( ! $args['has_attach'] )\n return $args;\n\n // get the extra classes for image frame\n $image_frame_extra_class = $mask_image ? 'aux-image-mask' : '';\n\n $args['the_media'] = '<div class=\"aux-media-frame aux-media-image '. esc_attr( $image_frame_extra_class ) .'\">'.\n '<a href=\"'.get_permalink().'\">'.\n $args['the_attach'].\n '</a>'.\n '</div>';\n\n return $args;\n}", "function format_media_post( $media_post ) {\n\t$media_item = array(\n\t\t'id' => $media_post->ID,\n\t\t'title' => $media_post->post_title,\n\t);\n\n\t$media_item['featured'] = false;\n\n\tif ( (int) get_post_thumbnail_id( $media_post->post_parent ) === $media_post->ID ) {\n\t\t$media_item['featured'] = true;\n\t}\n\n\t$media_item['description'] = array(\n\t\t'raw' => $media_post->post_content,\n\t\t'rendered' => get_processed_content( $media_post->post_content ),\n\t);\n\n\t$media_item['caption'] = array(\n\t\t'raw' => $media_post->post_excerpt,\n\t);\n\n\t$media_item['alt_text'] = get_post_meta( $media_post->ID, '_wp_attachment_image_alt', true );\n\t$media_item['media_type'] = wp_attachment_is_image( $media_post->ID ) ? 'image' : 'file';\n\t$media_item['mime_type'] = $media_post->post_mime_type;\n\t$media_item['media_details'] = apply_filters( 'dt_get_media_details', wp_get_attachment_metadata( $media_post->ID ), $media_post->ID );\n\t$media_item['post'] = $media_post->post_parent;\n\t$media_item['source_url'] = wp_get_attachment_url( $media_post->ID );\n\t$media_item['meta'] = \\Distributor\\Utils\\prepare_meta( $media_post->ID );\n\n\treturn apply_filters( 'dt_media_item_formatted', $media_item, $media_post->ID );\n}", "function woo_image($args) {\n\n\t//Defaults\n\t$key = 'image';\n\t$width = null;\n\t$height = null;\n\t$class = '';\n\t$quality = 90;\n\t$id = null;\n\t$link = 'src';\n\t$repeat = 1;\n\t$offset = 0;\n\t$before = '';\n\t$after = '';\n\t$single = false;\n\t$force = false;\n\t$return = false;\n\t\n\tif ( !is_array($args) ) \n\t\tparse_str( $args, $args );\n\t\n\textract($args);\n\t\n if ( empty($id) ) {\n\t\tglobal $post;\n\t\t$id = $post->ID;\n } \n\t\n $custom_field = get_post_meta($id, $key, true); \n\n\tif ( empty($custom_field) && get_option('woo_auto_img') == 'true' ) { // Get the image from post attachments\n \n if( $offset >= 1 ) \n\t\t\t$repeat = $repeat + $offset;\n \n $attachments = get_children( array(\t'post_parent' => $id,\n\t\t\t\t\t\t\t\t\t\t\t'numberposts' => $repeat,\n\t\t\t\t\t\t\t\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t\t\t\t\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t\t\t\t\t\t\t\t'order' => 'DESC', \n\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'menu_order date')\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\tif ( !empty($attachments) ) { // Search for and get the post attachment\n \n\t\t\t$counter = -1;\n\t\t\t$size = 'large';\n\t\t\tforeach ( $attachments as $att_id => $attachment ) { \n\t\t\t\t$counter++;\n\t\t\t\tif ( $counter < $offset ) \n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\t$src = wp_get_attachment_image_src($att_id, $size, true);\n\t\t\t\t$custom_field = $src[0];\n\t\t\t}\n\n\t\t} else { // Get the first img tag from content\n\n\t\t\t$first_img = '';\n\t\t\t$post = get_post($id); \n\t\t\tob_start();\n\t\t\tob_end_clean();\n\t\t\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\t\t\t$first_img = $matches [1] [0];\n\t\t\tif ( !empty($first_img) )\n\t\t\t\t$custom_field = $first_img;\t\t\n\n\t\t}\n\t\t\n\t} \n\t\n\t// Return if there is no attachment or custom field set\n\tif ( empty($custom_field) ) \n return;\n\n $output = '';\n\n\t// Get standard sizes\n\tif ( !$width && !$height ) {\n\t\t$width = get_option('woo_thumb_width');\n\t\t$height = get_option('woo_thumb_height');\n\t}\n\t\n $set_width = ' width=\"' . $width .'\" ';\n $set_height = ' height=\"' . $height .'\" '; \n \n if($height == null OR $height == '')\n $set_height = '';\n\t\t\n\t// Set standard class\n\tif ( $class )\n\t\t$class .= ' woo-image';\n\telse \n\t\t$class = 'woo-image';\n\n\t// Do check to verify if images are smaller then specified.\n\t$force_all = get_option('woo_force_all');\n\t$force_single = get_option('woo_force_single');\n\tif($force == true OR $force_all == true OR ($force_single == true AND is_single())){ \n\t\t$set_width = '';\n\t\t$set_height = '';\n\t}\n\n\tif ( get_option('woo_resize') == 'true' ) { \n\t\n\t\t// Clean the image URL\n\t\t$href = $custom_field; \t\t\n\t\t$custom_field = cleanSource( $custom_field );\n\t\n\t\t// Check if WPMU and set correct path\n\t\tglobal $blog_id;\n\t\tif ( isset($blog_id) && $blog_id > 0 ) {\n\t\t\t$imageParts = explode( '/files/', $custom_field );\n\t\t\tif ( isset($imageParts[1]) ) \n\t\t\t\t$custom_field = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];\n\t\t}\t\t\n\t\n\t\t$img_link = '<img src=\"'. get_bloginfo('template_url'). '/thumb.php?src='. $custom_field .'&amp;w='. $width .'&amp;h='. $height .'&amp;zc=1&amp;q='. $quality .'\" alt=\"'. get_the_title($id) .'\" class=\"'. $class .'\" '. $set_width . $set_height . ' />';\n\t\t\n\t\tif( $link == 'img' ) { // Just output the image\n\t\t\t$output .= $before; \n\t\t\t$output .= $img_link;\n\t\t\t$output .= $after; \n\t\t\t\n\t\t} else { // Default - output with link\n\n\t\t\tif ( ( is_single() OR is_page() ) AND $single == false ) {\n\t\t\t\t$rel = 'rel=\"lightbox\"';\n\t\t\t} else { \n\t\t\t\t$href = get_permalink($id);\n\t\t\t\t$rel = '';\n\t\t\t}\n\t\t\t\n\t\t\t$output .= $before; \n\t\t\t$output .= '<a title=\"'. get_the_title($id) .'\" href=\"' . $href .'\" '.$rel.'>' . $img_link . '</a>';\n\t\t\t$output .= $after; \n\t\t}\n\t\t\n\t} else { // Not Resize\n\t\t\n\t\t$img_link = '<img src=\"'. $custom_field .'\" alt=\"'. get_the_title($id) .'\" '. $set_width . $set_height . ' class=\"'. $class .'\" />';\n\t\t\n\t\tif ( $link == 'img' ) { // Just output the image \n\t\t\t$output .= $before; \n\t\t\t$output .= $img_link; \n\t\t\t$output .= $after; \n\t\t\t\n\t\t} else { // Default - output with link\n\t\t\n\t\t\tif ( ( is_single() OR is_page() ) AND $single == false ) { \n\t\t\t\t$href = $custom_field;\n\t\t\t\t$rel = 'rel=\"lightbox\"';\n\t\t\t} else { \n\t\t\t\t$href = get_permalink($id);\n\t\t\t\t$rel = '';\n\t\t\t}\n\t\t\t \n\t\t\t$output .= $before; \n\t\t\t$output .= '<a title=\"'. get_the_title($id) .'\" href=\"' . $href .'\" '. $rel .'>' . $img_link . '</a>';\n\t\t\t$output .= $after; \n\t\t}\n\t}\n\t\n\t// Return or echo the output\n\tif ( $return == TRUE )\n\t\treturn $output;\n\telse \n\t\techo $output; // Done \n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets value of 'bottle' property
public function setBottle($value) { return $this->set(self::BOTTLE, $value); }
[ "protected function setRobot($value=true) { $this->_is_robot = $value; }", "public function setBot($val)\n {\n $this->_propDict[\"bot\"] = $val;\n return $this;\n }", "public function testSettle()\n {\n }", "protected function setRobot($value = true)\n {\n $this->_is_robot = $value;\n }", "public function setRobot($value)\r\n {\r\n return $this->set(self::_ROBOT, $value);\r\n }", "public function setThing($value = '')\n {\n $this->thing = $value;\n }", "protected function setRobot(bool $value = true)\n {\n $this->_is_robot = $value;\n }", "function BuildWing()\n {\n $this->_bird->_wing=\"Blue\";\n }", "public function setBing($val)\n {\n $this->_propDict[\"bing\"] = $val;\n return $this;\n }", "public function setIsRobot($value)\n {\n return $this->set(self::_IS_ROBOT, $value);\n }", "function set_property(){\n }", "public function setIsBot(bool $isBot) {\n\t\t$this->isBot = $isBot;\n\t}", "public function setSelfRobot($value)\r\n {\r\n return $this->set(self::_SELF_ROBOT, $value);\r\n }", "public function setBold(?bool $value): void {\n $this->getBackingStore()->set('bold', $value);\n }", "public function setOppoRobot($value)\r\n {\r\n return $this->set(self::_OPPO_ROBOT, $value);\r\n }", "public function setIsRobot($value)\n {\n return $this->set(self::is_robot, $value);\n }", "public function setSelfRobot($value)\n {\n return $this->set(self::_SELF_ROBOT, $value);\n }", "function setShuttleEnabled($value) {\n\t\treturn $this->setColumnValue('shuttle_enabled', $value, Model::COLUMN_TYPE_TINYINT);\n\t}", "public function setB($b)\n {\n $this->b = $b;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets an array of all table row types.
protected abstract function getTableRowTypes();
[ "public function getFieldtypesFromTable()\n {\n $used_fieldtypes = ee()->db->select('name')->order_by('name')->get('fieldtypes');\n\n return array_column($used_fieldtypes->result_array(), 'name');\n }", "public static function getAllAsArray()\n {\n $savedTableTypes = ipGetOption(self::OPTION);\n $array = array();\n\n foreach ($savedTableTypes as $savedTableType) {\n array_push($array, $savedTableType);\n }\n\n return $array;\n }", "public static function getTypes() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runtype\"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }", "public function getResource_types(){\n\t\t$sql = \"SELECT * FROM resource_type ORDER BY name ASC\";\n\t\t\n\t\t$result = $this->db->query($sql);\n\t\t\n\t\treturn $result->rows;\n\t}", "public function getEventTypes() {\n\t $sql = \"SELECT EventTypeID, Name\n\t\t FROM EventType\";\n\t $result = $this->conn->query($sql);\n\t \n\t $rows = array();\n\t \n\t for ($r = 0; $r < $result->num_rows; $r++) {\n\t $row = $result->fetch_array(MYSQLI_ASSOC);\n\t $rows[] = $row;\n\t }\n\t return $rows;\n }", "public function getNotificationRowsByType()\n {\n return $this->findDependentRowset('Application_Model_Notification_DbTable', 'type');\n }", "public function getTypesArray() {\n $rowset = $this->tableGateway->select(function (Select $select) {\n $select->order('currency_order ASC');\n });\n if ($rowset) {\n $selectData = array();\n foreach ($rowset as $res) {\n $selectData[$res->id] = $res->name;\n }\n return $selectData;\n } else {\n return array();\n }\n }", "public function allUserTypes() {\r\n $this->database->query(\"SELECT * FROM `user-type`\");\r\n return $this->database->resultset();\r\n }", "public function getUserTypes(){\n $this->db->query(\"SELECT * FROM user_type WHERE disabled = 0 ORDER BY name ASC\");\n\n //get row\n $results = $this->db->resultSet();\n\n return $results;\n }", "public function getAllEncounterTileTypes() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\n\t\t\t$table\t\t\t= 'tb_encounter_tiletype';\n\t\t\t$select_what\t= '*';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_name\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public static function getTypes()\n {\n $typesList = [];\n foreach (Yii::$app->db->getTableSchema(static::tableName())->columns['type']->enumValues as $type) {\n $typesList[$type] = MeasureHelper::t($type);\n }\n return $typesList;\n }", "public function getAllTextureTypes() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\n\t\t\t$table\t\t\t= 'tb_texturetype';\n\t\t\t$select_what\t= '*';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_name\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getAllTypes()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTypes()\n );\n }", "public function getAllTileTypes() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\n\t\t\t$table\t\t\t= 'tb_tiletype';\n\t\t\t$select_what\t= '*';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_name\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getAll() : array\n {\n return $this->types;\n }", "function field_types_as_array()\n\t{\t\n\t\treturn $this->_db->get_table_column_types($this->get_table_name());\n\t}", "public function getAllType()\n {\n $q=\"SELECT type_id FROM `status`\";\n $result = $this->fetchAll($q);\n return $result;\n }", "public function getAllTypes(): array\n {\n return $this->types;\n }", "public function get_all_types() {\n $result = $this->query(\"SELECT DISTINCT type from products\");\n $types = array();\n while ($row = mysqli_fetch_array($result)) {\n array_push($types, $row[\"type\"]);\n }\n mysqli_free_result($result);\n return $types;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add urn: to allowed protocols. The GUID gets passed through `esc_url_raw`, so we need to allow urn.
function add_urn_protocol( array $protocols ) : array { $protocols[] = 'urn'; return $protocols; }
[ "function esc_url_raw( $url, $protocols = null ) {\n\treturn esc_url( $url, $protocols, 'db' );\n}", "function test_url_with_protocols() {\n\t\t$this->assertEquals( 'http://example.com', yourls_sanitize_url( 'http://example.com' ) );\n\t\t$this->assertEquals( 'example.php', yourls_sanitize_url( 'example.php' ) );\n\t\t$this->assertEquals( '', yourls_sanitize_url( 'htttp://example.com' ) );\n\t\t$this->assertEquals( 'mailto:ozh@ozh.org', yourls_sanitize_url( 'mailto:ozh@ozh.org' ) );\n // play with allowed protocols\n\t\t$this->assertEquals( '', yourls_sanitize_url( 'nasty://example.com/' ) );\n\t\t$this->assertEquals( 'nasty://example.com/', yourls_sanitize_url( 'nasty://example.com/', array('nasty://') ) );\n global $yourls_allowedprotocols;\n $yourls_allowedprotocols[] = 'evil://';\n $this->assertEquals( 'evil://example.com', yourls_sanitize_url( 'evil://example.com' ) );\n $yourls_allowedprotocols = yourls_kses_allowed_protocols();\n\t}", "static function add_iss_issuu_url(): void {\r\n self::add_acf_inner_field(self::issues, self::iss_issuu_url, [\r\n 'label' => 'Issuu URL',\r\n 'type' => 'url',\r\n 'instructions' => 'The PDF of the issue from Issuu.',\r\n 'required' => 0,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::external),\r\n 'operator' => '==',\r\n 'value' => 'issuu',\r\n ]\r\n ],\r\n [\r\n [\r\n 'field' => self::qualify_field(self::external),\r\n 'operator' => '==',\r\n 'value' => 'both',\r\n ]\r\n ]\r\n ],\r\n 'wrapper' => [\r\n 'width' => '34',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n 'default_value' => '',\r\n 'placeholder' => '',\r\n ]);\r\n }", "function dm_idn_warning() {\n\treturn sprintf( __( 'International Domain Names should be in <a href=\"%s\">punycode</a> format.', 'wordpress-mu-domain-mapping' ), \"http://api.webnic.cc/idnconversion.html\" );\n}", "public function getPublicUrlReturnsValidUrlContainingSpecialCharacters_dataProvider() {}", "function _uri($data) {\n # we should encode all-non chars\n return preg_replace(\"/[^-\\w\\d\\$.+!*'(),{}\\|\\\\~\\^\\[\\]\\`<>#%\\\";\\/?:@&=]+/u\", \"\", $data); // same as SANITIZE_URL\n }", "function lm_encode_uri_component($str) {\n $revert = array('%21'=>'!', '%2A'=>'*', '%27'=>\"'\", '%28'=>'(', '%29'=>')');\n return strtr(rawurlencode($str), $revert);\n}", "function addhttp($url) {\n if (!preg_match(\"~^(?:f|ht)tps?://~i\", $url)) {\n $url = \"http://\" . $url;\n }\n return $url;\n }", "function addhttp($url) {\r\n if (!preg_match(\"~^(?:f|ht)tps?://~i\", $url)) {\r\n $url = \"http://\" . $url;\r\n }\r\n return $url;\r\n}", "public function testEncodedUrls()\n {\n $this->assertTrue(\n $this->_surbl->isListed(\n 'http://%73urbl-org-permanent'.\n '-test-point.com/justatest'\n )\n );\n }", "function get_ascii_url() {\n\t\t\treturn blcUtility::idn_to_ascii( $this->url );\n\t\t}", "function yourls_set_url_scheme( $url, $scheme = '' ) {\n if ( in_array( $scheme, [ 'http', 'https' ] ) ) {\n $url = preg_replace( '!^[a-zA-Z0-9+.-]+://!', $scheme.'://', $url );\n }\n return $url;\n}", "function BuildUnescapedURI(){}", "function validate_special_link() {}", "function append_sid($url, $non_html_amp = false)\n{\n\tglobal $SID;\n\n\tif ( !empty($SID) && !preg_match('#sid=#', $url) )\n\t{\n\t\t//$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&amp;' ) : '?' ) . $SID;\n\t\t$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&amp;' ) : '?' ) . $SID;\n\t}\n\n\treturn $url;\n}", "public static function create_url($url)\n\t{\n\t\treturn 'http://' . self::cleanup_openid($url);\n\t}", "function override_urlencode($url)\n{\n // Prevent double encoding\n return urlencode(urldecode($url));\n}", "abstract protected function urn(): string;", "function urlencode_1738_plus($url) {\n\t$uri = '';\n\n\t# nom de domaine accentué ?\n\tif (preg_match(',^https?://[^/]*,u', $url, $r)) {\n\t\t\n\t}\n\n\t$l = strlen($url);\n\tfor ($i=0; $i < $l; $i++) {\n\t\t$u = ord($a = $url[$i]);\n\t\tif ($u <= 0x20 OR $u >= 0x7F OR in_array($a, array(\"'\",'\"')))\n\t\t\t$a = rawurlencode($a);\n\t\t// le % depend : s'il est suivi d'un code hex, ou pas\n\t\tif ($a == '%'\n\t\tAND !preg_match('/^[0-9a-f][0-9a-f]$/i', $url[$i+1].$url[$i+2]))\n\t\t\t$a = rawurlencode($a);\n\t\t$uri .= $a;\n\t}\n\treturn quote_amp($uri);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a scope URI into a ScopeURI object
public static function parse($uri) { if (strpos($uri, 'scope:') !== 0) { throw new UnexpectedValueException( 'Not a scope URI according to scheme'); } $parts = explode('?', $uri, 1); $params = null; if (count($parts) > 1) { parse_str($parts[1], $params); } $parts = explode(':', $parts[0], 2); if (count($parts) != 3) { throw new UnexpectedValueException( 'Not enough parts for scope URI'); } list($scheme, $service, $privilege) = $parts; return new ScopeURI($service, $privilege, $params); }
[ "public function parseUri($uri);", "public function parseUri();", "protected function parseScope($scope)\n {\n return array_filter(explode(' ',str_replace(',',' ',$scope)));\n }", "public function parse($uri);", "protected function parseUri($uri)\n {\n $this->bindingFields = [];\n\n return tap(RouteUri::parse($uri), function ($uri) {\n $this->bindingFields = $uri->bindingFields;\n })->uri;\n }", "function resolve_uri($id, $parentScope)\n{\n // If there is no parent scope, there is nothing to resolve against.\n if ($parentScope === '') {\n return $id;\n }\n\n return Uri\\resolve($parentScope, $id);\n}", "public static function parse($uri)\n {\n if (stripos($uri, 'unix') === 0) {\n // Hack to support URIs for UNIX sockets with minimal effort.\n $uri = str_ireplace('unix:///', 'unix://localhost/', $uri);\n }\n\n if (!($parsed = parse_url($uri)) || !isset($parsed['host'])) {\n throw new InvalidArgumentException(\"Invalid parameters URI: $uri\");\n }\n\n if (isset($parsed['query'])) {\n parse_str($parsed['query'], $queryarray);\n unset($parsed['query']);\n\n $parsed = array_merge($parsed, $queryarray);\n }\n\n return $parsed;\n }", "function parseFromURI($uri)\n {\n $this->parseFromFile($uri);\n }", "private function parseUri($uri) {\n $parts = parse_url($uri);\n\n if (false === $parts) {\n throw new \\InvalidArgumentException(\n 'The source URI string appears to be malformed'\n );\n }\n\n $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';\n $this->userInfo = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : '';\n $this->host = isset($parts['host']) ? strtolower($parts['host']) : '';\n $this->port = isset($parts['port']) ? $parts['port'] : null;\n $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '';\n $this->query = isset($parts['query']) ? $this->filterQuery($parts['query']) : '';\n $this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : '';\n\n if (isset($parts['pass'])) {\n $this->userInfo .= ':' . $parts['pass'];\n }\n\t\t\n }", "function decodeRequestUri($uri) {\n return rawurldecode(htmlspecialchars($uri, ENT_QUOTES, 'UTF-8'));\n}", "function parse($uri) {\n\n // Normally a URI must be ASCII, however. However, often it's not and\n // parse_url might corrupt these strings.\n //\n // For that reason we take any non-ascii characters from the uri and\n // uriencode them first.\n $uri = preg_replace_callback(\n '/[^[:ascii:]]/u',\n function($matches) {\n return rawurlencode($matches[0]);\n },\n $uri\n );\n\n $result = parse_url($uri);\n if (!$result) {\n $result = _parse_fallback($uri);\n }\n\n return\n $result + [\n 'scheme' => null,\n 'host' => null,\n 'path' => null,\n 'port' => null,\n 'user' => null,\n 'query' => null,\n 'fragment' => null,\n ];\n\n}", "static function decode(string $uri): Decoded {\n // decode b64\n $decUri = base64_decode($uri);\n if(!$decUri)\n throw new BadURI('base64');\n\n // split by ':'\n $splUri = explode(\":\", $decUri);\n if(count($splUri) < 2)\n throw new BadURI('splUri');\n\n // handle based on version\n switch($splUri[0]) {\n case \"0\": return self::decodeV0($splUri);\n default: throw new UnsupportedURI;\n }\n }", "function parseUri($uri) { \n $a = parse_url($uri);\n $a['path'] = explode('/',$a['path']);\n array_shift($a['path']); // chuck initial NIL\n\n $aqs = explode('&',$a['query']);\n $kvs = array();\n foreach ($aqs as $q) {\n $x = explode('=', $q, 2); // only first =\n $kvs[$x[0]] = $x[1];\n }\n unset($kvs['']); // chuck any empties\n $a['query'] = $kvs;\n\n return $a;\n}", "public function parseUri($uri)\n {\n if (empty($uri)) {\n return [];\n }\n if ($uri[0] == ':') {\n // ':port/path' shorthand, insert a placeholder hostname to allow parsing.\n $uri = 'placeholder-hostname' . $uri;\n }\n // FILTER_VALIDATE_IP expects '[' and ']' to be removed from IPv6 addresses.\n // We check for colon from the right, since IPv6 addresses contain colons.\n $to_path = trim(substr($uri, 0, strpos($uri, '/')), '[]');\n $to_port = trim(substr($uri, 0, strrpos($uri, ':')), '[]');\n if (filter_var(trim($uri, '[]'), FILTER_VALIDATE_IP) || filter_var($to_path, FILTER_VALIDATE_IP) || filter_var($to_port, FILTER_VALIDATE_IP)) {\n // 'IP', 'IP/path' or 'IP:port' shorthand, insert a schema to allow parsing.\n $uri = 'http://' . $uri;\n }\n $uri = parse_url($uri);\n if (empty($uri)) {\n throw new \\Exception(dt('Invalid argument - should be in the \"host:port/path\" format, numeric (port only) or non-numeric (path only).'));\n }\n if (count($uri) == 1 && isset($uri['path'])) {\n if (is_numeric($uri['path'])) {\n // Port only shorthand.\n $uri['port'] = $uri['path'];\n unset($uri['path']);\n }\n }\n if (isset($uri['host']) && $uri['host'] == 'placeholder-hostname') {\n unset($uri['host']);\n }\n return $uri;\n }", "public function constructorParsesAFullBlownUriStringCorrectly() {\n\t\t$uriString = 'http://username:password@subdomain.domain.com:8080/path1/path2/index.php?argument1=value1&argument2=value2&argument3[subargument1]=subvalue1#anchor';\n\t\t$uri = new \\TYPO3\\FLOW3\\Property\\DataType\\Uri($uriString);\n\n\t\t$check = (\n\t\t\t$uri->getScheme() == 'http' &&\n\t\t\t$uri->getUsername() == 'username' &&\n\t\t\t$uri->getPassword() == 'password' &&\n\t\t\t$uri->getHost() == 'subdomain.domain.com' &&\n\t\t\t$uri->getPort() === 8080 &&\n\t\t\t$uri->getPath() == '/path1/path2/index.php' &&\n\t\t\t$uri->getQuery() == 'argument1=value1&argument2=value2&argument3[subargument1]=subvalue1' &&\n\t\t\t$uri->getArguments() == array('argument1' => 'value1', 'argument2' => 'value2', 'argument3' => array('subargument1' => 'subvalue1')) &&\n\t\t\t$uri->getFragment() == 'anchor'\n\t\t);\n\t\t$this->assertTrue($check, 'The valid and complete URI has not been correctly transformed to an URI object');\n\t}", "public function getURIResolver();", "public function getScope($scope);", "public static function unquerifyUri( $uri ){\n \treturn current(explode('&',$uri));\n }", "public static function normalize($uri) {\n $parsed_uri = self::parse($uri);\n // if (is_array($uri)) {\n // \t$parsed_uri = $uri + self::$default_components;\n // \t$return_parsed = true;\n // } else {\n // \t$parsed_uri = self::parse($uri);\n // \t$return_parsed = false;\n // }\n\n $parsed_uri['scheme'] = strtolower($parsed_uri['scheme']);\n $parsed_uri['host'] = strtolower($parsed_uri['host']);\n $parsed_uri['authority'] = self::authority($parsed_uri);\n $parsed_uri['path'] = self::normalizePath($parsed_uri['path']);\n\n // if ($return_parsed) {\n // \treturn $parsed_uri;\n // }\n return self::unparse($parsed_uri);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns HTML code for the progress bars of languages being translated
function get_translated_languages( ) { global $_TABLES; $query = "SELECT DISTINCT `language_full_name` as language FROM {$_TABLES['translations']} WHERE 1"; $result = DB_query( $query ); $display = ''; while ( $row = DB_fetchArray( $result ) ) { $translated = get_translation_percent( $row[ 'language' ] ); $translated = round( $translated, 2 ); $not_translated = 100 - $translated; $query = "SELECT COUNT(`id`) as count FROM {$_TABLES['translations']} WHERE `language_full_name`='{$row['language']}'"; $result2 = DB_query( $query ); $count = DB_fetchArray( $result2 ); $count = $count[ 'count' ]; $display .= "<div class='index_language_graph'> <h2> {$row['language']} <a href='javascript:void(0)'' onclick='pack_translation(\"{$row['language']}\")'>(pack this)</a></h2> <div class='progress_bar'> <span class='translated' style='width: {$translated}%'> {$translated}% </span> " . "<span class='not_translated' style='width: {$not_translated}%'> {$not_translated}% </span> </div> </div> <span> Translated: {$count} </span>"; } //$row = DB_fetchArray( $result ) return $display; }
[ "function l10n_community_language_progress_for_project($project, $languages, $title, $description) {\n $block = array(\n 'title' => $title,\n 'description' => $description,\n );\n $num_source = l10n_community_get_string_count('project', $project->pid);\n $string_counts = l10n_community_get_string_count('languages', $project->pid);\n\n $table = array();\n foreach ($languages as $langcode => $language) {\n if (empty($language->plurals)) {\n $table[] = array(\n array(\n 'data' => t($language->name) . ' (' . $langcode . ')',\n 'class' => 'rowhead',\n ),\n array(\n 'data' => t('Uninitialized plural formula. Please set up the plural formula in <a href=\"@language-config\">the langauge configuration</a> or alternatively <a href=\"@import-url\">import a valid interface translation</a> for Drupal in this language.', array('@import-url' => url('admin/build/translate/import'), '@language-config' => url('admin/settings/language'))),\n 'colspan' => '3',\n 'class' => 'error',\n ),\n );\n }\n else {\n $table[] = array_merge(\n array(\n array('data' => l(t($language->name) . ' (' . $langcode . ')', 'translate/languages/' . $langcode . '/translate', array('query' => 'project=' . $project->uri)), 'class' => 'rowhead'),\n ),\n theme(\n 'l10n_community_progress_columns',\n $num_source,\n @$string_counts[$langcode]['translations'],\n @$string_counts[$langcode]['suggestions']\n )\n );\n }\n }\n $block['content'] = theme(\n 'table',\n theme('l10n_community_progress_headers', t('Language')),\n $table,\n array('class' => 'l10n-community-overview')\n ) . '<div class=\"clear-block\"></div>';\n\n return $block;\n}", "function get_translated_languages()\n{\n\tglobal $_TABLES;\n\n\n\t$query = \"SELECT DISTINCT `language_full_name` as language FROM {$_TABLES['translations']} WHERE 1\";\n\t$result = DB_query($query);\n\n\t$display = '';\n\n\twhile ($row = DB_fetchArray($result))\n\t{\n\t\t$translated = get_translation_percent($row['language']);\n\t\t$translated = round($translated, 2);\n\t\t$not_translated = 100 - $translated;\n\n\t\t$query = \"SELECT COUNT(`id`) as count FROM {$_TABLES['translations']} WHERE `language_full_name`='{$row['language']}'\";\n\t\t$result2 = DB_query($query);\n\t\t$count = DB_fetchArray($result2)['count'];\n\n\t\t$display .= \"<div class='index_language_graph'> <h3> {$row['language']} </h3>\n\t\t<div class='progress_bar'> <span class='translated' style='width: {$translated}%'> {$translated}% </span> \"\n\t\t. \"<span class='not_translated' style='width: {$not_translated}%'> {$not_translated}% </span> </div> </div>\n\t\t<span> Translated: {$count} </span>\";\n\t}\n\n\treturn $display;\n}", "private function progress_bar_html():string{\n return '<progress value='.$this->score.' max=\"'.self::MAX.'\">'.$this->score.'/'.self::MAX.'</progress>';\n }", "private function render_languages() {\n $languages = ProblemStatementsStorage::languages();\n foreach ($languages as $language => $language_name_to_display) {\n echo '<div class=\"category\">\n <a href=\"' . $language . '?category=warm_up\">\n <img src=\"../codeup_res/views/img/' . $language . '.png\" alt=\"' . $language_name_to_display . ' icon\">\n </a>\n <h5>' . $language_name_to_display . '</h5>\n </div>';\n }\n }", "function to_html():string{\n return $this->name.$this->progress_bar_html();\n }", "private function generateLanguageBar()\n {\n $languages = $this->translator->getLanguage()->getLanguageList();\n $langmap = null;\n if (count($languages) > 1) {\n $parameterName = $this->getTranslator()->getLanguage()->getLanguageParameterName();\n $langmap = array();\n foreach ($languages as $lang => $current) {\n $lang = strtolower($lang);\n $langname = $this->translator->getLanguage()->getLanguageLocalizedName($lang);\n $url = false;\n if (!$current) {\n $url = htmlspecialchars(\\SimpleSAML\\Utils\\HTTP::addURLParameters(\n '',\n array($parameterName => $lang)\n ));\n }\n $langmap[$lang] = array(\n 'name' => $langname,\n 'url' => $url,\n );\n }\n }\n return $langmap;\n }", "protected function progressLang($langId, $progress, $total)\n\t{\n\t\treturn strtr(qa_lang($langId), array(\n\t\t\t'^1' => qa_format_number((int)$progress),\n\t\t\t'^2' => qa_format_number((int)$total),\n\t\t));\n\t}", "private static function formatLanguages() {\n\t\t$langs = self::getSupportedLanguages();\n\t\t$list = array();\n\t\tif( count( $langs ) > 0 ) {\n\t\t\tforeach( $langs as $lang ) {\n\t\t\t\t$list[] = '<samp>' . htmlspecialchars( $lang ) . '</samp>';\n\t\t\t}\n\t\t\treturn '<p class=\"mw-collapsible mw-collapsed\" style=\"padding: 0em 1em;\">' . implode( ', ', $list ) . '</p><br style=\"clear: all\"/>';\n\t\t} else {\n\t\t\treturn '<p>' . wfMessage( 'syntaxhighlight-err-loading' )->inContentLanguage()->escaped() . '</p>';\n\t\t}\n\t}", "function get_locale_translation_status( int $percent_translated ): string {\n\tif ( $percent_translated == 100 ) {\n\t\treturn 'translated-100';\n\t} elseif ( $percent_translated >= 95 ) {\n\t\treturn 'translated-95';\n\t} elseif ( $percent_translated >= 90 ) {\n\t\treturn 'translated-90';\n\t} elseif ( $percent_translated >= 50 ) {\n\t\treturn 'translated-50';\n\t} else {\n\t\treturn 'translated-50-less';\n\t}\n}", "public function langsAction() {\n $this->_breadcrumbs->addStep($this->Translate('Языки интерфейса'));\n $this->view->message = $this->Translate('Раздел сайта находится в разработке').'!';\n $this->view->class_message = 'caution';\n }", "function theme_l10n_community_progress_columns($sum, $translated, $has_suggestion) {\n if ($sum == 0) {\n // We handle a project without any source strings available for translation.\n return array(\n array('data' => t('No data available yet.'), 'colspan' => 3),\n );\n }\n\n // Compute numbers, percentages and provide alternate text titles.\n $done_percent = round($translated / $sum * 100, 2);\n $status = array(\n 'translated' => array((int) $translated, $done_percent, t('!percent translated')),\n 'untranslated' => array($sum - $translated, 100 - $done_percent, t('!percent untranslated')),\n // suggestions are not in the bar as they overlap with both translated and\n // untranslated strings, so we cannot display them here.\n );\n\n // Visual summary with a progress bar.\n $bar = '<div class=\"l10n-community-progress\">';\n foreach ($status as $key => $values) {\n if ($values[1] > 0) {\n $bar .= '<div class=\"l10n-community-progress-' . $key . '\" style=\"width:' . $values[1] . '%;\" title=\"' . strtr($values[2], array('!percent' => $values[1] . '%')) . '\"></div>';\n }\n }\n $bar .= '</div>';\n\n return array(\n $bar,\n ($sum - $translated),\n (int) $has_suggestion\n //t('@num untranslated', array('@num' => ($sum - $translated))),\n //($has_suggestion ? format_plural($has_suggestion, '@count has suggestions', '@count have suggestions') : t('no suggestions')),\n );\n}", "private function ui_translations(): array {\n\t\treturn [\n\t\t\t'step1_txt' => __( 'Collected resource files from {count} of {total} key pages.', 'rocket' ),\n\t\t\t'step2_txt' => __( 'Processed {count} of {total} resource files found on key pages.', 'rocket' ),\n\t\t\t'rucss_working' => __( 'Remove Unused CSS is complete!', 'rocket' ),\n\t\t\t'warmed_list' => __( 'These files could not be processed:', 'rocket' ),\n\t\t\t'rucss_info_txt' => __( 'We are processing the CSS on your site. This may take several minutes to complete.', 'rocket' ),\n\t\t];\n\t}", "function HTML_showStatusBarHTML($id)\n{\n\t$lang = $_GET['m23_language'];\n\tCHECK_FW(CC_language, $lang);\n\tinclude(\"/m23/inc/i18n/$lang/m23base.php\");\n\n\t$percentL = '';\n\n\t//Get some basic informations about the status bar\n\t$res = DB_query(\"SELECT `type` , `cmd` , `refreshtime`, `statustext`, `percent` , `ts` FROM `statusbar` WHERE `id` =$id\");\n\t$info = mysqli_fetch_array($res);\n\n\t//Calculate the percentage by the status bar type\n\tswitch ($info['type'])\n\t{\n\t\tcase STATUSBAR_TYPE_bash:\n\t\t\t\t$percent = exec($info['cmd'], $useless, $exitCode);\n\n\t\t\t\t//Check if the BASH code is executable and update the timestamp if yes\n\t\t\t\tif ($exitCode == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$time = time();\n\t\t\t\t\t\tDB_query(\"UPDATE `statusbar` SET ts = $time WHERE `id` =$id\");\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$time = $info['ts'];\n\n\t\t\t\t$timeHTML = strftime($I18N_timeFormat,$time);\n\t\t\tbreak;\n\n\t\tcase STATUSBAR_TYPE_db:\n\t\t\t\t$percent = (float)$info['percent'];\n\t\t\t\t$timeHTML = strftime($I18N_timeFormat,$info['ts']);\n\t\t\tbreak;\n\t}\n\n\t//Checks if there is a status text and generates HTML status code if yes\n\tif (isset($info['statustext']{1}))\n\t\t$statusHTML=\"$info[statustext]\";\n\telse\n\t\t$statusHTML=\"\";\n\n\t//Make sure the percent value for the row width is a number\n\t$percentI = (int)$percent;\n\n\t//Calculate the percent value to show with one digit after the dot\n\t$percentS = sprintf(\"%.1f%%\",$percent);\n\n\t//Check if the percent number should be shown in the finished (left) or unfinished (right) part\n\t//So the font width of the procent number will not hinder showing the correct finished length\n\tif ($percent > 15)\n\t{\n\t\t$percentL = $percentS;\n\t\t$percentR = \"\";\n\t}\n\telse\n\t{\n\t\t$percentL = \"\";\n\t\t$percentR = $percentS;\n\t}\n\necho(\"\n\t<html>\n\t\t<head>\n\t\t\t<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"../css/index.css\\\">\n\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"$info[refreshtime]; URL=/m23admin/misc/statusBar.php?id=$id&m23_language=$lang\\\">\n\t\t\t<script type=\\\"text/javascript\\\">\n\t\t\t\t<!--\n\t\t\t\t\tsleep($info[refreshtime]000);\n\t\t\t\t\tself.location.href='/m23admin/misc/statusBar.php?id=$id&m23_language=$lang'\n\t\t\t\t//-->\n\t\t\t</script>\n\t\t</head>\n\t\t<body>\n\t\t\t<table width=\\\"100%\\\" border=0 style=\\\"border-collapse: collapse;\\\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\\\"$percentI%\\\" style=\\\"color: #FFFFFF; background-image:url(../../gfx/statusBarGradientGreen.png); background-position : center; background-repeat: repeat-x; text-shadow: #000000 2px 2px 3px;\\\" align=\\\"right\\\" >$percentL</td>\n\t\t\t\t\t<td width=\\\"\".(100 - $percentI).\"%\\\" style=\\\"background-image:url(../../gfx/statusBarGradientGray.png); background-position : center; background-repeat: repeat-x; color: #202020; text-shadow: #000000 1px 1px 2px;\\\" align=\\\"left\\\">$percentR</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<center><nobr><span class=\\\"highlight\\\">$timeHTML:</span> $statusHTML</nobr></center>\n\t\t</body>\n\t<html>\n\");\n}", "function lingotek_grid_create_progress_bar($progress) {\n $style = \"width:\" . round($progress) . \"%;\";\n $html = '<div class=\"lingotek-progress\"><div class=\"bar\" style=\"' . $style . '\"></div><div class=\"percent\">' . $progress . '%' . '</div></div>';\n return $html;\n}", "function renderProgress($tot_complete, $tot_failed, $total, $show_title = false) {\n\t\n\tif($total == 0) return '';\n\t$perc_complete \t= round(($tot_complete / $total) * 100, 2);\n\t$perc_failed \t= round(($tot_failed / $total) * 100, 2);\n\t\n\t$title = str_replace('[total]', $total, Lang::t('_PROGRESS_TITLE', 'course'));\n\t$title = str_replace('[complete]', $tot_complete, $title);\n\t$title = str_replace('[failed]', $tot_failed, $title);\n\t\n\t$html = '';\n\tif($show_title === true) $html .= '<span class=\"progress_title\">'.$title.'</span><br />';\n\tif($perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_complete\" title=\"'.$title.'\">'\n\t\t\t.'<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} elseif($perc_failed + $perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_failed\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} else {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_bar\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\tif($perc_failed != 0) $html .= '<div class=\"bar_failed\" style=\"width: '.$perc_failed.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t}\n\t\n\treturn $html;\n}", "function HTML_showStatusBarHTML($id)\n{\n\t$lang = $_GET['m23_language'];\n\tCHECK_FW(CC_language, $lang);\n\tinclude(\"/m23/inc/i18n/$lang/m23base.php\");\n\n\t//Get some basic informations about the status bar\n\t$res = DB_query(\"SELECT `type` , `cmd` , `refreshtime`, `statustext`, `percent` , `ts` FROM `statusbar` WHERE `id` =$id\");\n\t$info = mysql_fetch_array($res);\n\n\t//Calculate the percentage by the status bar type\n\tswitch ($info['type'])\n\t{\n\t\tcase STATUSBAR_TYPE_bash:\n\t\t\t\t$percent = exec($info['cmd'], $useless, $exitCode);\n\n\t\t\t\t//Check if the BASH code is executable and update the timestamp if yes\n\t\t\t\tif ($exitCode == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$time = time();\n\t\t\t\t\t\tDB_query(\"UPDATE `statusbar` SET ts = $time WHERE `id` =$id\");\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$time = $info['ts'];\n\n\t\t\t\t$timeHTML = strftime($I18N_timeFormat,$time);\n\t\t\tbreak;\n\n\t\tcase STATUSBAR_TYPE_db:\n\t\t\t\t$percent = (float)$info['percent'];\n\t\t\t\t$timeHTML = strftime($I18N_timeFormat,$info['ts']);\n\t\t\tbreak;\n\t}\n\n\t//Checks if there is a status text and generates HTML status code if yes\n\tif (isset($info['statustext']{1}))\n\t\t$statusHTML=\"$info[statustext]\";\n\telse\n\t\t$statusHTML=\"\";\n\n\t//Make sure the percent value for the row width is a number\n\t$percentI = (int)$percent;\n\n\t//Calculate the percent value to show with one digit after the dot\n\t$percentS = sprintf(\"%.1f%%\",$percent);\n\n\t//Check if the percent number should be shown in the finished (left) or unfinished (right) part\n\t//So the font width of the procent number will not hinder showing the correct finished length\n\tif ($percent > 15)\n\t\t$percentL = $percentS;\n\telse\n\t\t$percentR = $percentS;\n\necho(\"\n\t<html>\n\t\t<head>\n\t\t\t<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"../css/index.css\\\">\n\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"$info[refreshtime]; URL=/m23admin/misc/statusBar.php?id=$id&m23_language=$lang\\\">\n\t\t\t<script type=\\\"text/javascript\\\">\n\t\t\t\t<!--\n\t\t\t\t\tsleep($info[refreshtime]000);\n\t\t\t\t\tself.location.href='/m23admin/misc/statusBar.php?id=$id&m23_language=$lang'\n\t\t\t\t//-->\n\t\t\t</script>\n\t\t</head>\n\t\t<body>\n\t\t\t<table width=\\\"100%\\\" border=0 style=\\\"border-collapse: collapse;\\\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\\\"$percentI%\\\" style=\\\"color: #FFFFFF; background-image:url(../../gfx/statusBarGradientGreen.png); background-position : center; background-repeat: repeat-x; text-shadow: #000000 2px 2px 3px;\\\" align=\\\"right\\\" >$percentL</td>\n\t\t\t\t\t<td width=\\\"\".(100 - $percentI).\"%\\\" style=\\\"background-image:url(../../gfx/statusBarGradientGray.png); background-position : center; background-repeat: repeat-x; color: #202020; text-shadow: #000000 1px 1px 2px;\\\" align=\\\"left\\\">$percentR</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<center><nobr><span class=\\\"highlight\\\">$timeHTML:</span> $statusHTML</nobr></center>\n\t\t</body>\n\t<html>\n\");\n}", "public function langJs() {\n\t\t\t//= dummy translation to load po files\n\t\t\t__d('nondynamic', 'foo');\n\t\t\t__d('default', 'foo');\n\t\t\t$domains = I18n::domains();\n\t\t\t$translations = $domains['nondynamic'][Configure::read('Config.language')]['LC_MESSAGES'];\n\t\t\t$translations += $domains['default'][Configure::read('Config.language')]['LC_MESSAGES'];\n\t\t\tunset($translations['%po-header']);\n\t\t\t$this->response->type('json');\n\t\t\t$this->response->cache('-1 minute', '+1 hour');\n\t\t\t$this->response->compress();\n\t\t\treturn json_encode($translations);\n\t\t}", "public function getPageTexts($language);", "protected function lang()\n\t{\n\t\t$lang = JFactory::getLanguage()->getTag();\n\t\t\n\t\t$translate = create_function('$text', 'return ucfirst(JText::_($text));');\n\t\t$months = json_encode(array_map($translate, array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')));\n\t\t$days = json_encode(array_map($translate, array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')));\n\t\t\n\t\t$dateParts = explode('-', str_replace(array('%Y','%M','%D'), array('year', 'month', 'date'), JText::_('%Y-%M-%D')));\n\t\t$dateOrder = json_encode($dateParts);\n\t\t$shortDate = JText::_('COM_NINJABOARD_DATE_FORMAT_LC4');\n\t\t\n\t\t$translate = create_function('$text', 'return JText::_($text);');\n\t\t$parts = array_map($translate, array(\n\t\t\t'lessThanMinuteAgo' => 'less than a minute ago',\n\t\t\t'minuteAgo' => 'about a minute ago',\n\t\t\t'minutesAgo' => '{delta} minutes ago',\n\t\t\t'hourAgo' => 'about an hour ago',\n\t\t\t'hoursAgo' => 'about {delta} hours ago',\n\t\t\t'dayAgo' => '1 day ago',\n\t\t\t'daysAgo' => '{delta} days ago',\n\t\t\t'weekAgo' => '1 week ago',\n\t\t\t'weeksAgo' => '{delta} weeks ago',\n\t\t\t'monthAgo' => '1 month ago',\n\t\t\t'monthsAgo' => '{delta} months ago',\n\t\t\t'yearAgo' => '1 year ago',\n\t\t\t'yearsAgo' => '{delta} years ago',\n\t\t\t'lessThanMinuteUntil' => 'less than a minute from now',\n\t\t\t'minuteUntil' => 'about a minute from now',\n\t\t\t'minutesUntil' => '{delta} minutes from now',\n\t\t\t'hourUntil' => 'about an hour from now',\n\t\t\t'hoursUntil' => 'about {delta} hours from now',\n\t\t\t'dayUntil' => '1 day from now',\n\t\t\t'daysUntil' => '{delta} days from now',\n\t\t\t'weekUntil' => '1 week from now',\n\t\t\t'weeksUntil' => '{delta} weeks from now',\n\t\t\t'monthUntil' => '1 month from now',\n\t\t\t'monthsUntil' => '{delta} months from now',\n\t\t\t'yearUntil' => '1 year from now',\n\t\t\t'yearsUntil' => '{delta} years from now'\n\t\t));\n\t\techo KHelperArray::toString($parts, ':', ',\"');\n\t\tdie('<pre>'.var_export($parts, true).'</pre>');\n\t\t\n\t\t$this->_document->addScriptDeclaration(\"\n\t\t\tMooTools.lang.set('$lang', 'Date', {\n\t\t\t\n\t\t\t\tmonths: $months,\n\t\t\t\tdays: $days,\n\t\t\t\t//culture's date order: MM/DD/YYYY\n\t\t\t\tdateOrder: $dateOrder,\n\t\t\t\tshortDate: '$shortDate',\t\t\t\n\t\t\t\t$parts\n\t\t\t});\n\t\t\t\n\t\t\tMooTools.lang.set('$lang', 'Form.Validator', {\n\t\t\t\n\t\t\t\trequired:'This field is required.',\n\t\t\t\tminLength:'Please enter at least {minLength} characters (you entered {length} characters).',\n\t\t\t\tmaxLength:'Please enter no more than {maxLength} characters (you entered {length} characters).',\n\t\t\t\tinteger:'Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.',\n\t\t\t\tnumeric:'Please enter only numeric values in this field (i.e. \\\"1\\\" or \\\"1.1\\\" or \\\"-1\\\" or \\\"-1.1\\\").',\n\t\t\t\tdigits:'Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).',\n\t\t\t\talpha:'Please use letters only (a-z) with in this field. No spaces or other characters are allowed.',\n\t\t\t\talphanum:'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.',\n\t\t\t\tdateSuchAs:'Please enter a valid date such as {date}',\n\t\t\t\tdateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. \\\"12/31/1999\\\")',\n\t\t\t\temail:'Please enter a valid email address. For example \\\"fred@domain.com\\\".',\n\t\t\t\turl:'Please enter a valid URL such as http://www.google.com.',\n\t\t\t\tcurrencyDollar:'Please enter a valid $ amount. For example $100.00 .',\n\t\t\t\toneRequired:'Please enter something for at least one of these inputs.',\n\t\t\t\terrorPrefix: 'Error: ',\n\t\t\t\twarningPrefix: 'Warning: ',\n\t\t\t\n\t\t\t\t//Form.Validator.Extras\n\t\t\t\n\t\t\t\tnoSpace: 'There can be no spaces in this input.',\n\t\t\t\treqChkByNode: 'No items are selected.',\n\t\t\t\trequiredChk: 'This field is required.',\n\t\t\t\treqChkByName: 'Please select a {label}.',\n\t\t\t\tmatch: 'This field needs to match the {matchName} field',\n\t\t\t\tstartDate: 'the start date',\n\t\t\t\tendDate: 'the end date',\n\t\t\t\tcurrendDate: 'the current date',\n\t\t\t\tafterDate: 'The date should be the same or after {label}.',\n\t\t\t\tbeforeDate: 'The date should be the same or before {label}.',\n\t\t\t\tstartMonth: 'Please select a start month',\n\t\t\t\tsameMonth: 'These two dates must be in the same month - you must change one or the other.',\n\t\t\t\tcreditcard: 'The credit card number entered is invalid. Please check the number and try again. {length} digits entered.'\n\t\t\t\n\t\t\t});\n\t\t\tMooTools.lang.setLanguage('$lang');\n\t\t\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation customersIdTeamsNkPortalsPost Creates a new instance in portals of this model.
public function customersIdTeamsNkPortalsPost($id, $nk, $data = null) { list($response) = $this->customersIdTeamsNkPortalsPostWithHttpInfo($id, $nk, $data); return $response; }
[ "public function teamMembersIdPortalsPost($id, $data = null)\n {\n list($response) = $this->teamMembersIdPortalsPostWithHttpInfo($id, $data);\n return $response;\n }", "public function teamMembersIdTeamPortalsPost($id, $data = null)\n {\n list($response) = $this->teamMembersIdTeamPortalsPostWithHttpInfo($id, $data);\n return $response;\n }", "public function teamBuilderConfigsIdPortalsPost($id, $data = null)\n {\n list($response) = $this->teamBuilderConfigsIdPortalsPostWithHttpInfo($id, $data);\n return $response;\n }", "public function templatesIdPortalsPost($id, $data = null)\n {\n list($response) = $this->templatesIdPortalsPostWithHttpInfo($id, $data);\n return $response;\n }", "public function customersIdTeamsNkDataSourceSoapsPost($id, $nk, $data = null)\n {\n list($response) = $this->customersIdTeamsNkDataSourceSoapsPostWithHttpInfo($id, $nk, $data);\n return $response;\n }", "public function setPortals($portals)\n {\n $this->portals = $portals;\n }", "public function planner_add_planification_posts() {\n \n // Save a post\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Posts)->planner_add_planification_posts();\n \n }", "public function portalsIdDesignsNkMembersPost($id, $nk, $data = null)\n {\n list($response) = $this->portalsIdDesignsNkMembersPostWithHttpInfo($id, $nk, $data);\n return $response;\n }", "public function apiCustomersPost($body)\n {\n list($response) = $this->apiCustomersPostWithHttpInfo($body);\n\n return $response;\n }", "public function portalsIdDesignsNkPermissionPost($id, $nk, $data = null)\n {\n list($response) = $this->portalsIdDesignsNkPermissionPostWithHttpInfo($id, $nk, $data);\n return $response;\n }", "public function testTeamsIdPortalsNkPortalMembersPost()\n {\n\n }", "public function customersPost($data = null)\n {\n list($response) = $this->customersPostWithHttpInfo($data);\n return $response;\n }", "public function testTeamsIdTemplatesNkPortalsPost()\n {\n\n }", "public function customersIdTeamsNkMembersPost($id, $nk, $data = null)\n {\n list($response) = $this->customersIdTeamsNkMembersPostWithHttpInfo($id, $nk, $data);\n return $response;\n }", "public function apiV11PortfoliosByIdPassportPost($id, $create_passport_request = null, $accept_language = 'en')\n {\n list($response) = $this->apiV11PortfoliosByIdPassportPostWithHttpInfo($id, $create_passport_request, $accept_language);\n return $response;\n }", "public function postMeals(PostMealsRequest $request)\n {\n $meal = $this->meal->create($request->only([\n 'meal_type_id',\n 'duration',\n 'calories'\n ]));\n\n $meal->translations()->create($request->only([\n 'name',\n 'preparation',\n 'description',\n 'locale'\n ]));\n\n $meal->nutrition()->create($request->only([\n 'fat_amount',\n 'protein_amount',\n 'sugar_amount'\n ]));\n\n $meal->diet_type()->attach($request->input('diet_type_ids'));\n\n $meal->load('diet_type', 'translations', 'nutrition', 'meal_type');\n\n return $this->respondWithSuccessCreation($meal);\n }", "public function create_plan($post)\n {\n $month = '+' . $post['month'] . ' months';\n $expire_month = date('Y-m-d', strtotime($month, strtotime(current_time())));\n $param = array(\n 'client_id' => $post['client_id'],\n 'plan_group_id' => $post['plan_group_id'],\n 'discount' => '0',\n 'auto_extend_flg' => $post['auto_extend_flg'],\n 'expire_month' => $expire_month,\n 'created' => current_time(),\n );\n return $this->Logic_plan->create_client_plan($param);\n }", "public function planner_save_post() {\n \n // Save a post\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Posts)->planner_save_post();\n \n }", "public function customersIdTeamsNkPortalsFkDelete($id, $nk, $fk)\n {\n list($response) = $this->customersIdTeamsNkPortalsFkDeleteWithHttpInfo($id, $nk, $fk);\n return $response;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function name: closedOn This is the getter for closedTime.
public function closedOn(){ return $this->closedTime; }
[ "public function getClosedOn() {\n\t\treturn $this->closedOn;\n\t}", "public function getCloseTime()\r\n {\r\n return $this->close_time;\r\n }", "public function getClosingTime();", "public function getCloseTime()\n {\n return $this->close_time;\n }", "public function getClosingTime()\n {\n return $this->closingTime;\n }", "public function getOpeningTime();", "public function getClosed()\r\n {\r\n return $this->closed;\r\n }", "public function getClosed()\n {\n return $this->closed;\n }", "public function getClosedOnTuesday()\n {\n return $this->closedOnTuesday;\n }", "public function getClosedAt(): ?\\DateTime;", "public function getOpeningTime()\n {\n return $this->openingTime;\n }", "public function getClosedDateTime()\n {\n if (array_key_exists(\"closedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"closedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"closedDateTime\"])) {\n return $this->_propDict[\"closedDateTime\"];\n } else {\n $this->_propDict[\"closedDateTime\"] = new \\DateTime($this->_propDict[\"closedDateTime\"]);\n return $this->_propDict[\"closedDateTime\"];\n }\n }\n return null;\n }", "public function getClosed()\n\t{\n\t\treturn $this->closed;\n\t}", "public function getDateClosing(): string\n {\n return $this->dateClosing;\n }", "public function getCurrentOpenTimeRangeEnd()\n {\n /**\n * Get current open time range end as Carbon instance or false if closed.\n * /!\\ Important: it returns true if the current day is an holiday unless you set a closure handler for it in\n * the exceptions setting.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface|bool\n */\n return $this->getCalleeAsMethod(static::CURRENT_OPEN_RANGE_END_METHOD);\n }", "public function isClosedOn()\n {\n /**\n * Returns true if the business is closed on a given day according to current opening hours.\n *\n * @return bool\n */\n return $this->isOpenOn(__METHOD__);\n }", "public function getAfterHoursClosingTime()\n {\n return $this->afterHoursClosingTime;\n }", "public function getIsClosed()\n {\n return $this->is_closed;\n }", "public function getCloseDateTime()\n {\n if (array_key_exists(\"closeDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"closeDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"closeDateTime\"])) {\n return $this->_propDict[\"closeDateTime\"];\n } else {\n $this->_propDict[\"closeDateTime\"] = new \\DateTime($this->_propDict[\"closeDateTime\"]);\n return $this->_propDict[\"closeDateTime\"];\n }\n }\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }