query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Hide fields for add/edit
protected function hideFieldsForAddEdit() { }
[ "protected function hideFieldsForAddEdit()\n {\n }", "protected function hideFieldsForAddEdit()\n\t{\n\t\tif ($this->isAdd() || $this->isCopy() || $this->isGridAdd())\n\t\t\t$this->id->Visible = FALSE;\n\t}", "protected function hideFieldsForAddEdit()\n {\n if ($this->isAdd() || $this->isCopy() || $this->isGridAdd()) {\n $this->id->Visible = false;\n }\n }", "public function hideFieldsForDebug() {\n\t\t\n\t\t$sHideFields = $this->getValue( 'General.Debug_hide', null );\n\t\tif ( ! is_null( $sHideFields ) ) {\n\t\t\t$sHideFields = explode( ',', $sHideFields );\n\t\t\tforeach ( $sHideFields as $sField ) {\n\t\t\t\t$this->setValue( $sField, '' );\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function setAsHidden();", "public function hide_columns() {\n // Grab our current user.\n $user = wp_get_current_user();\n // Grab our form id.\n $form_id = absint( $_REQUEST['form_id'] );\n $hidden = isset( $_POST['hidden'] ) ? explode( ',', esc_html( $_POST['hidden'] ) ) : array();\n $hidden = array_filter( $hidden );\n update_user_option( $user->ID, 'manageedit-nf_subcolumnshidden-form-' . $form_id, $hidden, true );\n die();\n }", "function hideField($fieldName){\n\n\t\t$this->hidden[$fieldName] = \"hide\";\n\n\t}", "public function hideForm()\n {\n $this->show_form = false;\n }", "abstract public function getHiddenFields();", "function adjust_field_visibility($mode) {\n foreach ($this->form_field_specs as $field_name => $f_spec) {\n // hide is defined in the form_field_options table in the config DB\n if (array_key_exists('hide', $f_spec)) {\n if ($mode === $f_spec[\"hide\"]) {\n $this->form_field_specs[$field_name][\"type\"] = \"hidden\";\n }\n }\n }\n }", "function bs_bi_hide_step3_fields($field) {\n\treturn;\n}", "function xprofile_hide_fields( $retval ) {\t\n\t\n\tif( bp_is_profile_edit() ) {\t\n\t\t$retval['exclude_fields'] = '99';\t// field id's example: \"15,16,17\"\t\n\t} \n\treturn $retval;\n\t\n}", "private function show_hidden() {\n\n if (!empty($this->_hiddenfields)) {\n\n foreach ($this->_hiddenfields as $name => $value) {\n ?>\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\">\n <?php\n }\n\n // Clear the array\n $this->_hiddenfields = array();\n\n }\n }", "protected function render_hidden_fields()\n {\n }", "function hideField($fieldName)\n\t{\n\t\tif(!is_null($this->xt))\n\t\t\t$this->xt->hideField($fieldName);\n\t}", "public function setFieldsAsHidden(array $fieldIdList);", "function block_editor_meta_box_hidden_fields()\n {\n }", "protected function show_readonly_hidden() {\n\t\treturn false;\n\t}", "public function genericSearchHiddenFields();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback for the Program settings page
function vals_soc_admin_program_settings_page() { ob_start(); vals_soc_content_start(); module_load_include('inc', 'vals_soc', 'includes/ui/administer/program_settings'); vals_soc_content_end(); return ob_get_clean(); }
[ "function settings_callback() {}", "public static function settings_page() {\r\n\r\n\t\tif ( self::maybe_display_wizard() ) {\r\n\t\t\treturn;\r\n\t\t};\r\n\r\n\t\trequire_once( GFCommon::get_base_path() . '/settings.php' );\r\n\t\tGFSettings::settings_page();\r\n\t}", "public function settings_page() {\n\t\techo 'From Settings';\n\t}", "public function settings()\n {\n ee()->functions->redirect($this->mcp_url('settings'));\n }", "public function pageSettings()\n\t\t{\n\t\t\trequire_once($this->settingsPage);\n\t\t}", "function program_settings_text() {\n\t\t\t\techo '<p>Use this section to make changes to the functionality of our programs pages and archive page. These settings may or may not effect all programs depending on which setting is changed. Settings found here will be propagated throughout the website in multiple places, so make changes wisely, and sparingly.</p>';\n\t\t\t}", "public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }", "public function initialize_settings_page()\n {\n }", "function show_settings() {\n\t\tinclude PM_CORE.\"/settings.php\";\n\t\t$this->settings = $settings;\n\t}", "function settings(){\n\n\t\t//$this->assets()->enqueue_assets( false );\n\t\t$this->settings_page->output();\n\n\t}", "public function settings()\n {\n $this->Gui->set_title( store_title( __( 'Transfert Settings', 'stock-manager' ) ) );\n $this->load->module_view( 'stock-manager', 'settings.gui' );\n }", "public function admin_settings_page() {\n include( 'views/settings/html-wf-settings.php' );\n }", "function ss_ls_addon_settings() {\n\tadd_options_page('Literacy Source U-Design Addon Settings', 'U-Design Addon Settings', 'manage_options', 'udesign_options', 'ls_addon_options_page');\n}", "public function showSettingsPage() {\r\n\r\n $this->fillOptions();\r\n include 'admin/settings-page.php';\r\n }", "public function RenderSettingsPage()\n {\n if(isset($_GET['settings-updated']) && $_GET['settings-updated'])\n {\n \n // do stuff on save\n \n }\n \n include self::$AdminPath . 'tpl/settings.php';\n }", "function update_settings()\n {\n }", "public function page_settings() {\n\t\t\tNetPay_Page_Settings::render();\n\t\t}", "public function display_settings_section() {}", "public function on_page_settings_load(){\n\t\t\n\t\tif( isset( $_POST['fa_nonce'] ) && check_admin_referer('fapro_save_settings', 'fa_nonce') ){\n\t\t\tif( !current_user_can('manage_options') ){\n\t\t\t\twp_die( __('Sorry, you are not allowed to do this.', 'fapro'), __('Access denied', 'fapro') );\n\t\t\t}\n\t\t\t\n\t\t\t// update general settings\n\t\t\t$result = fa_update_options('settings', $_POST);\n\t\t\tif( is_wp_error( $result ) ){\n\t\t\t\t$this->errors = $result;\n\t\t\t}\t\t\t\n\t\t\t// register license key\n\t\t\t$result = fa_update_options('license', array( 'license_key' => $_POST['license_key'] ));\n\t\t\tif( is_wp_error( $result ) ){\n\t\t\t\t$this->errors = $result;\n\t\t\t}\t\t\t\t\n\t\t\t// save API keys\n\t\t\t$result = fa_update_options('apis' , $_POST);\n\t\t\tif( is_wp_error( $result ) ){\n\t\t\t\t$this->errors = $result;\n\t\t\t}\n\t\t\t\n\t\t\t$this->save_caps();\n\t\t\tif( !$this->errors && !is_wp_error( $this->errors ) ){\n\t\t\t\t$url = add_query_arg( array('message' => 801) , html_entity_decode( menu_page_url( 'fapro_settings', false ) ) );\n\t\t\t\twp_redirect( $url );\n\t\t\t\tdie();\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tfa_load_template_style( 'settings' );\n\t\tfa_load_admin_script( 'tabs', array('jquery', 'jquery-ui-tabs') );\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the length of the initial segment not matching mask. This is a UTF8aware version of [strcspn]( $found = UTF8::strcspn($str, $mask);
public static function strcspn($str, $mask, $offset = NULL, $length = NULL) { if ( $str == '' or $mask == '' ) return 0; if ( UTF8::is_ascii($str) and UTF8::is_ascii($mask) ) return ($offset === NULL) ? strcspn($str, $mask) : (($length === NULL) ? strcspn($str, $mask, $offset) : strcspn($str, $mask, $offset, $length)); if ( $offset !== NULL or $length !== NULL ) { $str = UTF8::substr($str, $offset, $length); } // Escape these characters: - [ ] . : \ ^ / // The . and : are escaped to prevent possible warnings about POSIX regex elements $mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask); preg_match('/^[^' . $mask . ']+/u', $str, $matches); return isset($matches[0]) ? UTF8::strlen($matches[0]) : 0; }
[ "function strcspn($str, $mask, $start = null, $len = null) {}", "public function strcspn($str, $mask, $offset = null, $length = null)\n {\n $this->load(__FUNCTION__);\n \n return utf8_strcspn($this, $str, $mask, $offset, $length);\n }", "public static function process($str, $mask, $offset = NULL, $length = NULL)\n\t{\n\t\tif ($str == '' OR $mask == '')\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (UTF8::is_ascii($str) AND UTF8::is_ascii($mask))\n\t\t{\n\t\t\treturn ($offset === NULL) ? strcspn($str, $mask) : (($length === NULL) ? strcspn($str, $mask, $offset) : strcspn($str, $mask, $offset, $length));\n\t\t}\n\n\t\tif ($offset !== NULL OR $length !== NULL)\n\t\t{\n\t\t\t$str = UTF8::substr($str, $offset, $length);\n\t\t}\n\n\t\t// 对这些字符进行转义:- [ ] . : \\ ^ /\n\t\t// The . and : are escaped to prevent possible warnings about POSIX regex elements\n\t\t$mask = preg_replace(UTF8_Function_StrCspn::PREVENT_MATCH, UTF8_Function_StrCspn::PREVENT_REPLACE, $mask);\n\t\tpreg_match('/^[^'.$mask.']+/u', $str, $matches);\n\n\t\treturn isset($matches[0]) ? UTF8::strlen($matches[0]) : 0;\n\t}", "public static function strspn($str, $mask, $offset = NULL, $length = NULL)\n {\n if ( $str == '' or $mask == '' ) return 0;\n\n if ( UTF8::is_ascii($str) and UTF8::is_ascii($mask) ) return ($offset === NULL) ? strspn($str, $mask) : (($length === NULL) ? strspn($str, $mask, $offset) : strspn($str, $mask, $offset, $length));\n\n if ( $offset !== NULL or $length !== NULL )\n {\n $str = UTF8::substr($str, $offset, $length);\n }\n\n // Escape these characters: - [ ] . : \\ ^ /\n // The . and : are escaped to prevent possible warnings about POSIX regex elements\n $mask = preg_replace('#[-[\\].:\\\\\\\\^/]#', '\\\\\\\\$0', $mask);\n preg_match('/^[^' . $mask . ']+/u', $str, $matches);\n\n return isset($matches[0]) ? UTF8::strlen($matches[0]) : 0;\n }", "public function getMaskingStringLength(): PositiveInteger;", "public function strspn($str, $mask, $offset = null, $length = null);", "function _strcspn($str1, $str2, $start=null, $length=null) {\r\n $numargs = func_num_args();\r\n\r\n if (PHP_VER_LOWER43 == 1) {\r\n if (isset($length)) {\r\n $str1 = substr($str1, $start, $length);\r\n } else {\r\n $str1 = substr($str1, $start);\r\n }\r\n }\r\n\r\n if ($numargs == 2 || PHP_VER_LOWER43 == 1) {\r\n return strcspn($str1, $str2);\r\n } else if ($numargs == 3) {\r\n return strcspn($str1, $str2, $start);\r\n } else {\r\n return strcspn($str1, $str2, $start, $length);\r\n }\r\n}", "public function withMaskingStringLength(PositiveInteger $maskingStringLength): static;", "public function nonSpaceCharCount($str) {\n\t\t$str = preg_replace('/\\s/u', '', $str);\n\t\treturn $this->len($str);\n\t}", "public function maskString(string $str): string;", "public static function findEndMask($content,$offset,$mask)\r\n\t{\r\n\t\twhile(strpos($mask,$content[$offset])!==false){$offset++;}\r\n\t\treturn $offset;\r\n\t}", "function utf8_strrpos($str, $search, $offset = false)\r\n{\r\n\t$str = utf8_bad_clean($str);\r\n\r\n\tif (!$offset)\r\n\t{\r\n\t\t// Emulate behaviour of strrpos rather than raising warning\r\n\t\tif(empty($str))\r\n\t\t\treturn false;\r\n\r\n\t\treturn mb_strrpos($str, $search);\r\n\t}\r\n\r\n\tif (!is_int($offset))\r\n\t{\r\n\t\ttrigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);\r\n\t\treturn false;\r\n\t}\r\n\r\n\t$str = mb_substr($str, $offset);\r\n\r\n\tif (($pos = mb_strrpos($str, $search)) !== false)\r\n\t\treturn $pos + $offset;\r\n\r\n\treturn false;\r\n}", "function scanUntilCharacters($string) {\r\n $startpos = $this->position;\r\n $length = strcspn($this->rawtext, $string, $startpos);\r\n $this->position += $length;\r\n return substr($this->rawtext, $startpos, $length);\r\n }", "function scanUntilCharacters($string): string\n\t{\n\t\t$startpos = $this->position;\n\t\t$length = strcspn($this->rawtext, $string, $startpos);\n\t\t$this->position += $length;\n\n\t\treturn substr($this->rawtext, $startpos, $length);\n\t}", "public function intersect(mlang_component $mask) {\n $removed = 0;\n $masked = array_flip($mask->get_string_keys());\n foreach (array_keys($this->strings) as $key) {\n if (! isset($masked[$key])) {\n $this->unlink_string($key);\n $removed++;\n }\n }\n return $removed;\n }", "function substr_count ($haystack, $needle, $offset = 0, $length = null) {}", "function strNonAlphaPos(string $str, int $start) {\n $len = strlen($str);\n for ($i = $start; $i < $len; ++$i) {\n if (!ctype_alpha($str[$i])) {\n return $i;\n }\n }\n return $len;\n}", "private function str_mask_2(string $string, $mask): string\n {\n $masked_string = '';\n\n if (strlen($string) >= 5) {\n for ($i = 0; $i <= (strlen($string) - 3); $i++) {\n $masked_string .= $mask;\n }\n\n $masked_string .= substr($string, -3);\n } else {\n for ($i = 0; $i <= strlen($string); $i++) {\n $masked_string .= $mask;\n }\n }\n\n return $masked_string;\n }", "function str_utf8_mix_word_count($str = \"\"){\n\t$utf8_chinese_pattern=\"/[\\x{4e00}-\\x{9fff}\\x{f900}-\\x{faff}]/u\";\n\t$utf8_symbol_pattern=\"/[\\x{ff00}-\\x{ffef}\\x{2000}-\\x{206F}]/u\";\n $str = preg_replace($utf8_symbol_pattern, \"\", $str);\n return str_utf8_chinese_word_count($str) + strlen(preg_replace($utf8_chinese_pattern, \"\", $str));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funzione che dato l'ID di un avatar, permette di visualizzarne i dettagli
static function details($id = 0) { $vAvatar = new VAvatar(); $user = CSession::getUserFromSession(); if (get_class($user) != EOspite::class) // se l'utente non e' ospite { if(! $SelectedAvatar=FPersistantManager::getInstance()->exists("Avatar","IdAvatar","$id")) $vAvatar->showErrorPage($user, 'Non smanettare con le url'); else { $SelectedAvatar=FPersistantManager::getInstance()->search("Avatar","IdAvatar","$id"); $vAvatar->showdetails($user, $SelectedAvatar[0]); } } else // se l'utente e' ospite, viene reindirizzato ad una pagina di errore $vAvatar->showErrorPage($user, 'Devi essere loggato per entrare in questa area'); }
[ "public function getIdavatar()\n {\n return $this->idavatar;\n }", "function PrikaziAvatarIndex($id)\r\n{\r\n\tglobal $db_prefix;\r\n //Provjerava dali korisnik postoji\r\n\t$member_postoji = mysql_query(\"SELECT * FROM `\" . $db_prefix . \"members` WHERE `id_member`='$id'\");\r\n\r\n if(mysql_num_rows($member_postoji) > 0)\r\n\t{\r\n\t //ako postoji\r\n \r\n \r\n //citanje avatara koji je dodan putem uploada na profil\r\n $memberavatar = mysql_query(\"SELECT * FROM `\" . $db_prefix . \"attachments` WHERE `id_member`='$id' AND `attachment_type`='0'\");\r\n\r\n //ispisivanje\r\n if(mysql_num_rows($memberavatar) > 0)\r\n {\r\n while($row = mysql_fetch_array($memberavatar))\r\n {\r\n $avatar_upload\t= $row['id_attach'];\t\t\t//ID Slike\r\n }\r\n }\r\n else\r\n {\r\n $avatar_upload = '';\r\n }\r\n\r\n\r\n //citanje ukoliko je avatar dostavljen putem linka\r\n $member = mysql_query(\"SELECT * FROM `\" . $db_prefix . \"members` WHERE `id_member`='$id'\");\r\n\r\n //ispisivanje\r\n while($row = mysql_fetch_array($member))\r\n {\r\n $member_avatar\t= $row['avatar'];\t\t\t\t//Link avatara\r\n }\r\n\r\n //ako je avatar dostavljen putem uploada\r\n if(!empty($avatar_upload))\r\n {\r\n $kon_avatar = '<img src=\"?action=dlattach;attach=' . $avatar_upload . ';type=avatar\">';\r\n }\r\n else//ako je avatar dostavljen putem linka\r\n {\r\n if (strpos($member_avatar,'http://') !== false) {\r\n $kon_avatar = '<img src=\"' . $member_avatar . '\">';\r\n } else { //ako je avatar odabran putem SMF avatara\r\n $kon_avatar = '<img src=\"avatars/' . $member_avatar . '\">';\r\n }\t\r\n if(empty($member_avatar))//ako avatar nije dostavljen linkom, postavlja se provjera dali je dodan uploadom\r\n {\r\n $kon_avatar = '<img src=\"http://i.imgur.com/KVEwCUy.png\">';\r\n }\r\n }\r\n }\r\n else//ako ne postoji\r\n {\r\n $kon_avatar = '<img src=\"http://i.imgur.com/KVEwCUy.png\">';\r\n }\r\n\treturn $kon_avatar;\r\n}", "function avatar3DFromID($id, $size)\n{\n global $dfPDO;\n\n $sth = $dfPDO->query('SELECT uuid FROM accounts WHERE user_id = ' . $id);\n\n return '//crafatar.com/renders/body/' . $sth->fetch(PDO::FETCH_COLUMN) . '?overlay=true&size=' . $size;\n}", "function avatar_user($iduser){\n\t\t\n\t\tglobal $database_conexion, $conexion;\n\t\tmysql_select_db($database_conexion, $conexion);\n\t\t$query_ObtenerNombre = sprintf (\"SELECT z_users.avatar FROM z_users WHERE z_users.id = %s\",$iduser,\"int\");\n\t\t$ObtenerNombre = mysql_query($query_ObtenerNombre, $conexion) or die(mysql_error());\n\t\t$row_ObtenerNombre = mysql_fetch_assoc($ObtenerNombre);\n\t\t$totalRows_ObtenerNombre = mysql_num_rows($ObtenerNombre);\n\t\t\n\t\treturn $row_ObtenerNombre['avatar'];\n\t\tmysql_free_result($ObtenerNombre);\n\t}", "public function create_avatar() {\n\t\t$sql = \"SELECT member_id FROM members WHERE username IS NOT NULL ORDER BY member_id ASC\";\n\t\t$members = $this->db->prepare($sql);\n\t\t$members->execute();\n\n\t\tforeach ($members as $member) {\n\t\t\t$id = $member['member_id'];\n\t\t\t$img = $member['member_id'] . '_0.jpg';\n\t\t\t$sql = \"UPDATE members SET main_img = ? WHERE member_id = ?\";\n\t\t\t$query = $this->db->prepare($sql);\n\t\t\t$query->execute([\"$img\", $id]);\n\t\t}\n\t}", "public function getAvatar();", "function spipbb_afficher_avatar($id, $classe='')\n{\n\tif(!$id) { return; }\n\t#recup de statut et extra/avatar\n\t$infos = spipbb_donnees_auteur($id);\n\n\t$insert = '';\n\t$retour = '';\n\n\tif ($classe!='') { $insert=\" class=\\\"$classe\\\"\"; }\n\n\tif ($infos['statut']==\"0minirezo\" OR $infos['statut']==\"1comite\") {\n\t\t$chercher_logo = charger_fonction('chercher_logo', 'inc');\n\t\tif($logo = $chercher_logo($id, 'id_auteur', 'on')) {\n\t\t\t$retour=\"<img\".$insert.\" src=\\\"$logo[0]\\\" alt=\\\"logo\\\" />\";\n\t\t}\n\t}\n\telseif($infos['statut']==\"6forum\" AND $infos['avatar']!='') {\n\t\t\t$retour=\"<img\".$insert.\" src=\\\"\".$infos['avatar'].\"\\\" alt=\\\"avatar\\\" />\";\n\t}\n\treturn $retour;\n}", "function acereview_get_user_picture_by_id($id) {\n global $base_url;\n $picture_url = \"\";\n\n $query = \"SELECT picture FROM {users} WHERE uid = '%d' LIMIT 1\";\n $result = db_query($query, $id);\n\n if(db_affected_rows($result) > 0) {\n $result = db_fetch_object($result);\n $picture_url = $result->picture;\n if($picture_url) {\n $picture_url = $base_url . \"/\" . $picture_url;\n }\n }\n\n return $picture_url;\n}", "public function getIdPicture()\n{\nreturn $this->idPicture;\n}", "public static function deleteAvatar(): void\n {\n // On vérifie que l'utilisateur soit bien administrateur.\n if (!User::getUserSession()->role)\n self::logout();\n $directory = Cfg::get('rootDir') . '/assets/img/avatars/';\n $obj = new stdClass();\n $obj->value = false;\n //On récupère les données du formulaire et on les affecte.\n $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ?: 0;\n if (!$id)\n Router::json(JSON_encode($obj));\n if (!unlink($directory . 'avatar' . $id . '.png'))\n Router::json(JSON_encode($obj));\n $obj->id = $id;\n $obj->message = 'Avatar supprimé';\n $obj->value = true;\n Router::json(JSON_encode($obj));\n }", "function get_avatar() {}", "function print_avatar( $p_user_id, $p_size = 80 ) {\n\t$t_avatar = Avatar::get( $p_user_id, $p_size );\n\tif( $t_avatar === null ) {\n\t\treturn;\n\t}\n\n\t$t_image = htmlspecialchars( $t_avatar->image );\n\t$t_link = htmlspecialchars( $t_avatar->link );\n\t$t_text = htmlspecialchars( $t_avatar->text );\n\n\techo '<a rel=\"nofollow\" href=\"' . $t_link . '\">' .\n\t\t'<img class=\"avatar\" src=\"' . $t_image . '\" alt=\"' .\n\t\t$t_text . '\" width=\"' . $p_size . '\" height=\"' .\n\t\t$p_size . '\" /></a>';\n}", "function toImageId($id) {\n return \"pendeltileid$id\";\n}", "public function Dot_GetAvatarID($uid, $image) {\n\t\tif ($image) {\n\t\t\t//If image is not empty\n\t\t\t//The query to select for image path\n\t\t\t$query = mysqli_query($this->db, \"SELECT id,image_path,image_type FROM dot_avatars WHERE image_path='$image' AND image_type = 'avatar'\") or die(mysqli_error($this->db));\n\t\t} else {\n\t\t\t//The query to select for image id\n\t\t\t$query = mysqli_query($this->db, \"SELECT id,image_path,image_type FROM dot_avatars WHERE uid_fk='$uid' AND image_type='avatar' ORDER BY id DESC \") or die(mysqli_error($this->db));\n\t\t}\n\t\t$result = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn $result;\n\t}", "function felapplyidenticon( $felID )\n{\n\t$config = new avatarupload_config();\n\t$user = bb_get_user( $felID );\n\n\t$ifilename = strtolower($user->user_login) . \".\" . 'png';\n\t$ifilepath = BBPATH . $config->avatar_dir . $ifilename;\n\n\t// include the Identicon class.\n\trequire_once(\"identicon.php\");\n\n\tif (class_exists(\"identicon\")) { $identicon = new identicon; }\n\n\tif( $identicon )\n\t{\n\t\t$felidenticon = $identicon->identicon_build( $user->user_login, '', false, '', false );\n\n\t\tif( imagepng( $felidenticon, $ifilepath ) )\n\t\t{\n\t\t\t$meta_avatar = $ifilename.\"?\".time().'|'.$config->identicon_size.'|'.$config->identicon_size.'|identicon';\n\t\t\tbb_update_usermeta( $felID, 'avatar_file', $meta_avatar );\n\t\t\t$success_message = \"Your identicon has been made.\";\n\t\t}\n\t}\n}", "function affichComOeuvreFromId($id_artiste){ \n$req = \"SELECT * FROM commentaire WHERE id_membre = $id_artiste ORDER by date_updated DESC\";\n$res = mysql_query($req);\n$titre = \"\";\n\twhile($ligne = mysql_fetch_assoc($res))\n\t{\n\t$req_o = \"SELECT titre FROM oeuvre WHERE id_oeuvre = \".$ligne['id_oeuvre'].\" ORDER by date_updated DESC\";\n\t$res_o = mysql_query($req_o);\n\t$ligne_o = mysql_fetch_assoc($res_o);\n\t$heure = conversionToHourFacebook(new DateTime($ligne['date_updated']));\n\t$type = getTypeId($ligne['id_membre']);\n\t$src = getSrcAvatar($ligne['id_membre'],$type);\n\t$id_commentaire = $ligne['id_commentaire'];\n\t$titre = ($titre == $ligne_o['titre'])? \" \" : $ligne_o['titre'];\n\techo \"<div>$titre</div>\";\n\t\techo \"<div class='pane post' id='$id_commentaire'>\n\t\t\t<img src='$src'\t\talt='avatar' id='img_mini' width='50px' height='50px'>\n\t\t\t<div id='post_text'>\n\t\t\t\t<div>\".$ligne['txt_com'].\"</div>\n\t\t\t\t<span><a href='#'>\".getPseudo($ligne['id_membre'],$type).\"</a></span>\n\t\t\t\t<span>$heure</span>\n\t\t\t</div>\";\n\t\techo \"</div>\";\n\t}\n}", "function affichComOeuvreById_M($id_membre){\necho \"<h2>//AFFICHAGE DES COMMENTAIRES D'OEUVRES</h2>\";\n$req = \"SELECT * FROM commentaire WHERE id_membre = $id_membre ORDER by date_updated DESC\";\n$res = mysql_query($req);\n\n\necho \"<table>\";\nwhile($ligne = mysql_fetch_assoc($res))\n{\n$type = getTypeId($ligne['id_membre']);\n$src = getSrcAvatar($ligne['id_membre'],$type);\n$com = html_entity_decode($ligne['txt_com']);\n\techo \"<tr>\n\t\t<td><img src=$src alt='avatar' width='80px' height='80px'/></td>\n\t\t<td><strong>\".getPseudo($ligne['id_membre'],$type).\"</strong></td>\n\t\t<td>\".$com.\"</td>\n\t\t<td>\".$ligne['date_updated'].\"</td>\n\t\t</tr>\";\n}\necho \"</table>\";\n}", "function display_avatar($avatar, $params) {\n\t$avatar = bp_get_member_profile_data(array('field' => 'Avatar', 'user_id' => $params['item_id']));\n\treturn $avatar;\n}", "function get_img_usrbyID($id){\n\t$result = select(\"select fotografia from usuario where id=\".$id.\"\")[0];\n\tif (!empty($result)) {\n\t\treturn array_values($result)[0];\t\t\t\n\t}else{\n\t\treturn \"usr_img\\0.png\";\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the cum plafond ss2.
public function getCumPlafondSs2(): ?float { return $this->cumPlafondSs2; }
[ "public function getCumPlafondSs2() {\n return $this->cumPlafondSs2;\n }", "public function getCumPlafondSs1() {\n return $this->cumPlafondSs1;\n }", "public function getSp2()\n {\n return $this->sp2;\n }", "public function getCumPlaf1Caisse2() {\n return $this->cumPlaf1Caisse2;\n }", "public function getplafondSs2() {\n return $this->plafondSs2;\n }", "public function getCumPlaf2Caisse1() {\n return $this->cumPlaf2Caisse1;\n }", "public function setCumPlafondSs2($cumPlafondSs2) {\n $this->cumPlafondSs2 = $cumPlafondSs2;\n return $this;\n }", "public function getCumTranche2() {\n return $this->cumTranche2;\n }", "public function getEntre_calle_2()\r\n\t{\r\n\t\treturn($this->entre_calle_2);\r\n\t}", "public function getCumTrCCaisse2() {\n return $this->cumTrCCaisse2;\n }", "public function getPlafondSs1() {\n return $this->plafondSs1;\n }", "public function setCumPss2($cumPss2) {\n $this->cumPss2 = $cumPss2;\n return $this;\n }", "public function getSpCode2()\n {\n return $this->sp_code2;\n }", "public function getPlafond1Caisse2() {\n return $this->plafond1Caisse2;\n }", "public function getSp2disp()\n {\n return $this->sp2disp;\n }", "public function getPanell2c2() {\n return $this->get(self::PANELL2C2);\n }", "public function getCumBrutCaisse2() {\n return $this->cumBrutCaisse2;\n }", "public function getCvssV2()\n {\n return $this->cvss_v2;\n }", "public function getSoumisPort2() {\n return $this->soumisPort2;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns app key dictionary
public function getApplicationKeyInfo() { return array('application_key' => $this->sugarConfig['unique_key']); }
[ "public function getAppKey();", "public function getAppKey()\n {\n return $this->config->getAppKey();\n }", "public function getAppKey()\n\t{\n\t\treturn $this->_appKey;\n\t}", "public function getAppKey()\n {\n return $this->appKey;\n }", "public function getAppKey()\n {\n return $this->appKey = $this->appKey ?: getKeyFromEnv(\"APP_KEY\");\n }", "public function getAppkey()\n {\n return $this->appkey;\n }", "public function getAppKey(): string\n\t{\n\t\treturn $this->appKey;\n\t}", "private function getApplicationKey()\n\t{\n\t\treturn $this->applicationKey;\n\t}", "public function get_app_key() {\n\n\t\t// Get plugin settings.\n\t\t$settings = $this->get_plugin_settings();\n\n\t\treturn rgar( $settings, 'customAppKey' ) ? rgar( $settings, 'customAppKey' ) : null;\n\n\t}", "public function getAppKeys(): array ;", "public function getCurrent_APP_KEY()\n {\n return config('app.key');\n }", "public function getApplicationKey(){\n\n $store = Mage::app()->getStore();\n\n $accessKey = $this->getStoreAccessKey($store->getId());\n return $accessKey;\n }", "public function getAppKeys($appName);", "protected static function key()\n\t{\n\t\treturn Config::get('application.key');\n\t}", "public function getAuthenticationAppKey()\n {\n return config(\"devpilot.authentication.app_key\");\n }", "public static function getCurrentIntegrationTypeAppKey()\n {\n return self::$appKeys[self::$integrationType];\n }", "protected function generateAppKey()\n {\n return 'base64:'.base64_encode(\n Encrypter::generateKey('AES-256-CBC')\n );\n }", "function getPackageKey() ;", "private function createAppKey()\n {\n return 'base64:'.base64_encode(random_bytes(config('app.cipher') == 'AES-128-CBC' ? 16 : 32));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Locks an uri The WebDAV lock request can be operated to either create a new lock on a file, or to refresh an existing lock If a new lock is created, a full XML body should be supplied, containing information about the lock such as the type of lock (shared or exclusive) and the owner of the lock If a lock is to be refreshed, no body should be supplied and there should be a valid If header containing the lock Additionally, a lock can be requested for a nonexistent file. In these case we're obligated to create an empty file as per RFC4918:S7.3
protected function httpLock($uri) { $lastLock = null; if (!$this->validateLock($uri,$lastLock)) { // If the existing lock was an exclusive lock, we need to fail if (!$lastLock || $lastLock->scope == LockInfo::EXCLUSIVE) { //var_dump($lastLock); throw new DAV\Exception\ConflictingLock($lastLock); } } if ($body = $this->server->httpRequest->getBody(true)) { // This is a new lock request $lockInfo = $this->parseLockRequest($body); $lockInfo->depth = $this->server->getHTTPDepth(); $lockInfo->uri = $uri; if($lastLock && $lockInfo->scope != LockInfo::SHARED) throw new DAV\Exception\ConflictingLock($lastLock); } elseif ($lastLock) { // This must have been a lock refresh $lockInfo = $lastLock; // The resource could have been locked through another uri. if ($uri!=$lockInfo->uri) $uri = $lockInfo->uri; } else { // There was neither a lock refresh nor a new lock request throw new DAV\Exception\BadRequest('An xml body is required for lock requests'); } if ($timeout = $this->getTimeoutHeader()) $lockInfo->timeout = $timeout; $newFile = false; // If we got this far.. we should go check if this node actually exists. If this is not the case, we need to create it first try { $this->server->tree->getNodeForPath($uri); // We need to call the beforeWriteContent event for RFC3744 // Edit: looks like this is not used, and causing problems now. // // See Issue 222 // $this->server->broadcastEvent('beforeWriteContent',array($uri)); } catch (DAV\Exception\NotFound $e) { // It didn't, lets create it $this->server->createFile($uri,fopen('php://memory','r')); $newFile = true; } $this->lockNode($uri,$lockInfo); $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); $this->server->httpResponse->setHeader('Lock-Token','<opaquelocktoken:' . $lockInfo->token . '>'); $this->server->httpResponse->sendStatus($newFile?201:200); $this->server->httpResponse->sendBody($this->generateLockResponse($lockInfo)); }
[ "protected function httpLock($uri) {\n \n \t$lastLock = null;\n \tif (!$this->validateLock($uri,$lastLock)) {\n \n \t\t// If the existing lock was an exclusive lock, we need to fail\n \t\tif (!$lastLock || $lastLock->scope == LockInfo::EXCLUSIVE) {\n \t\t\t//var_dump($lastLock);\n \t\t\tthrow new DAV\\Exception\\ConflictingLock($lastLock);\n \t\t}\n \n \t}\n \n \tif ($body = $this->body) {\n \t\t// This is a new lock request\n \t\t$lockInfo = $this->parseLockRequest($body);\n \t\t$lockInfo->depth = $this->server->getHTTPDepth();\n \t\t$lockInfo->uri = $uri;\n \t\tif($lastLock && $lockInfo->scope != LockInfo::SHARED) throw new DAV\\Exception\\ConflictingLock($lastLock);\n \n \t} elseif ($lastLock) {\n \n \t\t// This must have been a lock refresh\n \t\t$lockInfo = $lastLock;\n \n \t\t// The resource could have been locked through another uri.\n \t\tif ($uri!=$lockInfo->uri) $uri = $lockInfo->uri;\n \n \t} else {\n \n \t\t// There was neither a lock refresh nor a new lock request\n \t\tthrow new DAV\\Exception\\BadRequest('An xml body is required for lock requests');\n \n \t}\n \n \tif ($timeout = $this->getTimeoutHeader()) $lockInfo->timeout = $timeout;\n \n \t$newFile = false;\n \n \t// If we got this far.. we should go check if this node actually exists. If this is not the case, we need to create it first\n \ttry {\n \t\t$this->server->tree->getNodeForPath($uri);\n \n \t\t// We need to call the beforeWriteContent event for RFC3744\n \t\t// Edit: looks like this is not used, and causing problems now.\n \t\t//\n \t\t// See Issue 222\n \t\t// $this->server->broadcastEvent('beforeWriteContent',array($uri));\n \n \t} catch (DAV\\Exception\\NotFound $e) {\n \n \t\t// It didn't, lets create it\n \t\t$this->server->createFile($uri,fopen('php://memory','r'));\n \t\t$newFile = true;\n \n \t\t}\n \n \t\t$this->lockNode($uri,$lockInfo);\n \n \t\t$this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8');\n \t\t$this->server->httpResponse->setHeader('Lock-Token','<opaquelocktoken:' . $lockInfo->token . '>');\n \t\t$this->server->httpResponse->sendStatus($newFile?201:200);\n \t\t\t\t$this->server->httpResponse->sendBody($this->generateLockResponse($lockInfo));\n \n }", "public function lockNode($uri,LockInfo $lockInfo) {\n\n if (!$this->server->broadcastEvent('beforeLock',array($uri,$lockInfo))) return;\n\n if ($this->locksBackend) return $this->locksBackend->lock($uri,$lockInfo);\n throw new DAV\\Exception\\MethodNotAllowed('Locking support is not enabled for this resource. No Locking backend was found so if you didn\\'t expect this error, please check your configuration.');\n\n }", "abstract function unlock($uri,Sabre_DAV_Locks_LockInfo $lockInfo);", "public function lock($path)\n\t{\n\t\t// Required\n\t\tif(!($token = $this->header('X-WOPI-Lock')))\n\t\t{\n\t\t\thttp_response_code(400);\n\t\t\treturn;\n\t\t}\n\t\t// Optional old lock code\n\t\t$old_lock = $this->header('X-WOPI-OldLock');\n\n\t\t$timeout = static::LOCK_DURATION;\n\t\t$owner = $GLOBALS['egw_info']['user']['account_id'];\n\t\t$scope = 'exclusive';\n\t\t$type = 'write';\n\t\t$lock = Vfs::checkLock($path);\n\n\t\t// Unlock and relock if old lock is provided\n\t\tif($old_lock && $old_lock !== $lock['token'])\n\t\t{\n\t\t\t// Conflict\n\t\t\tif(Wopi::DEBUG)\n\t\t\t{\n\t\t\t\terror_log(__METHOD__ . \"($path) unable to lock, already locked with \" . array2string($old_lock));\n\t\t\t}\n\t\t\theader('X-WOPI-Lock: ' . $lock['token']);\n\t\t\thttp_response_code(409);\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($old_lock && $old_lock == $lock['token'])\n\t\t\t{\n\t\t\t\tVfs::unlock($path, $old_lock);\n\t\t\t}\n\t\t}\n\n\t\t// Lock the file, refresh if the tokens match\n\t\t$result = Vfs::lock($path, $token, $timeout, $owner, $scope, $type, $lock['token'] == $token);\n\n\t\tif(Wopi::DEBUG)\n\t\t{\n\t\t\terror_log(__METHOD__ . \"($path) \" . ($result ? \"successfully\" : \"failed! Not\") . \" locked\");\n\t\t}\n\n\t\theader('X-WOPI-Lock: ' . $token);\n\t\thttp_response_code($result ? 200 : 409);\n\t}", "static function lock($path, $handler)\r\n {\r\n Route::route(\"LOCK\", $path, $handler);\r\n }", "public function removeLock($uri);", "public function unlockNode($uri,Sabre_DAV_Lock $lockInfo) {\n\n try {\n $node = $this->getNodeForPath($uri);\n if ($node instanceof Sabre_DAV_ILockable) return $node->unlock($lockInfo);\n } catch (Sabre_DAV_FileNotFoundException $e) {\n // In case the node didn't exist, this could be a lock-null request\n }\n\n if ($this->lockManager) return $this->lockManager->unlock($uri,$lockInfo);\n\n }", "public function unlock($uri,LockInfo $lockInfo) \n {\n\n $opt = null;\n $opt[\"token\"] = $lockInfo->token;\n $opt[\"path\"] = \"/\".$uri;\n\n $d = new \\EDAV_OBJECT($opt);\n $d->unlock();\n\n }", "public function test_flock() {\n $uri = $this->sample_file;\n\n $fp1 = fopen($uri, 'r+');\n $this->assertTrue(flock($fp1, LOCK_EX | LOCK_NB), \"Couldn't acquire file lock.\");\n fwrite($fp1, $this->sample_content);\n\n $fp2 = fopen($uri, 'r+');\n $this->assertFalse(flock($fp2, LOCK_EX | LOCK_NB), \"We should not be able to acquire a lock here.\");\n\n $this->assertTrue(flock($fp1, LOCK_UN), \"Couldn't release file lock.\");\n $this->assertTrue(flock($fp2, LOCK_EX | LOCK_NB), \"We should be able to acquire a lock here.\");\n $this->assertTrue(flock($fp2, LOCK_UN), \"Couldn't release file lock.\");\n\n fclose($fp1);\n fclose($fp2);\n\n unlink($uri);\n $this->assertFileNotExists($uri, \"The lock_test.txt file should have been removed.\");\n }", "protected function httpPut() {\n\n // First we'll do a check to see if the resource already exists\n try {\n $info = $this->tree->getNodeInfo($this->getRequestUri(),0); \n \n // Checking potential locks\n if (!$this->validateLock()) throw new Sabre_DAV_LockedException('The resource you tried to edit is locked');\n\n // We got this far, this means the node already exists.\n // This also means we should check for the If-None-Match header\n if ($this->httpRequest->getHeader('If-None-Match')) {\n\n throw new Sabre_DAV_PreconditionFailedException('The resource already exists, and an If-None-Match header was supplied');\n\n }\n \n // If the node is a collection, we'll deny it\n if ($info[0]['type'] == self::NODE_DIRECTORY) throw new Sabre_DAV_ConflictException('PUTs on directories are not allowed'); \n\n $this->tree->put($this->getRequestUri(),$this->httpRequest->getBody());\n $this->httpResponse->sendStatus(200);\n\n } catch (Sabre_DAV_FileNotFoundException $e) {\n\n // If we got here, the resource didn't exist yet.\n\n // Validating the lock on the parent collection\n $parent = dirname($this->getRequestUri());\n if (!$this->validateLock($parent)) throw new Sabre_DAV_LockedException('You\\'re creating a new file, but the parent collection is currently locked');\n\n // This means the resource doesn't exist yet, and we're creating a new one\n $this->tree->createFile($this->getRequestUri(),$this->httpRequest->getBody());\n $this->httpResponse->sendStatus(201);\n\n }\n\n }", "public function fileLock($resource, $lockMode = LOCK_EX);", "protected function lockLockFile ( $filename ) {\n\t\t$lockFile = $this->getLockFile($filename);\n\t\t\\OC_Log::write('lock', sprintf('INFO: Locking lock file %s for %s', $lockFile, $filename), \\OC_Log::DEBUG);\n\n\t\t// If we already manage the lock file, success\n\t\tif(!empty($this->lockFile)) {\n\t\t\t\\OC_Log::write('lock', sprintf('PASS: Lock file %s was locked by this request for %s', $lockFile, $filename), \\OC_Log::DEBUG);\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check if the lock file exists, and if not, try to create it\n\t\t\\OC_Log::write('lock', sprintf('INFO: Does lock file %s already exist? %s', $lockFile, file_exists($lockFile) ? 'yes' : 'no'), \\OC_Log::DEBUG);\n\t\t$handle = fopen($lockFile, 'c');\n\t\tif(!$handle) {\n\t\t\t\\OC_Log::write('lock', sprintf('FAIL: Could not create lock file %s', $lockFile), \\OC_Log::DEBUG);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Attempt to acquire lock on lock file\n\t\t$wouldBlock = false;\n\t\t$timeout = self::$retries;\n\t\t// Wait for lock over timeout\n\t\twhile((!$lockReturn = flock($handle, LOCK_EX | LOCK_NB, $wouldBlock)) && $timeout > 0) {\n\t\t\t\\OC_Log::write('lock', sprintf('FAIL: Could not acquire lock on lock file %s, %s timeout increments remain.', $lockFile, $timeout), \\OC_Log::DEBUG);\n\t\t\tusleep(self::$retryInterval);\n\t\t\t$timeout--;\n\t\t}\n\t\tif ($wouldBlock == true || $lockReturn == false) {\n\t\t\t\\OC_Log::write('lock', sprintf('FAIL: Could not acquire lock on lock file %s', $lockFile), \\OC_Log::DEBUG);\n\t\t\treturn false;\n\t\t}\n\t\tfwrite($handle, $filename);\n\t\t\\OC_Log::write('lock', sprintf('PASS: Wrote filename to lock lock file %s', $lockFile), \\OC_Log::DEBUG);\n\n\t\t$this->lockFile = $lockFile;\n\t\t$this->lockFileHandle = $handle;\n\n\t\treturn true;\n\t}", "public function unlock($uri, LockInfo $lock) \n {\n $this->db->delete(\"$this->path/$lock->token.xml\");\n return true;\n }", "private function lockSomeUri($uri) {\n if (!isUserAuthenticated()) { // [a]\n $freeUriList = ['', '/', '/auth/signin', '/auth/signup', '/auth/signin/access', '/auth/signup/store', '/auth/signup/verify']; // [b]\n if (!in_array($uri, $freeUriList, true)) { // [c]\n redirect('/auth/signin'); // [d]\n }\n } else {\n $hideUriList = ['/auth/signin', '/auth/signup', '/auth/signin/access', '/auth/signup/store', '/auth/signup/verify']; // [b]\n if (in_array($uri, $hideUriList, true)) { // [c]\n redirect('/'); // [d]\n }\n }\n }", "public function lock(Horde_Lock $locks, $uid = null)\n {\n $shareid = $this->_share->getId();\n\n // Default parameters.\n $locktype = Horde_Lock::TYPE_EXCLUSIVE;\n $timeout = 600;\n $itemscope = $this->_share->getShareOb()->getApp() . ':' . $shareid;\n\n if (!empty($uid)) {\n // Check if the share is locked. Share locks are placed at app scope\n try {\n $result = $locks->getLocks($this->_share->getShareOb()->getApp(), $shareid, $locktype);\n } catch (Horde_Lock_Exception $e) {\n throw new Horde_Exception_Wrapped($e);\n }\n if (!empty($result)) {\n // Lock found.\n return false;\n }\n\n // Try to place the item lock at app:shareid scope.\n return $locks->setLock($GLOBALS['registry']->getAuth(),\n $itemscope,\n $uid,\n $timeout,\n $locktype);\n } else {\n // Share lock requested. Check for locked items.\n try {\n $result = $locks->getLocks($itemscope, null, $locktype);\n } catch (Horde_Lock_Exception $e) {\n throw new Horde_Exception_Wrapped($e);\n }\n if (!empty($result)) {\n // Lock found.\n return false;\n }\n\n // Try to place the share lock\n return $locks->setLock($GLOBALS['registry']->getAuth(),\n $this->_share->getShareOb()->getApp(),\n $shareid,\n $timeout,\n $locktype);\n }\n }", "function lock() {\n if (!$this->active_object->can_have_comments) {\n $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());\n } // if\n \n if (!$this->active_object->canChangeLockedState($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $this->executeOnActiveObject('lock', array($this->logged_user), \n lang(':type \":name\" has been locked', array('type' => $this->active_object->getVerboseType(), 'name' => $this->active_object->getName())), \n lang('Failed to lock :type \":name\"', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n }", "function _acquireLock ()\n {\n $this->_enterSection('_acquireLock');\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n if ($proto == 'file') {\n $f = sprintf($path, $this->_indexName);\n $this->_indexFileRes = fopen ($f,'w');\n flock ($this->_indexFileRes, LOCK_EX);\n }\n \n $this->_leaveSection('_acquireLock');\n }", "function ft_edit_lock_set($file, $dir, $user) {\n global $ft;\n // if (ft_plugin_exists('db')) {\n // // Clear any locks.\n // ft_edit_lock_clear($file, $dir);\n // // Set new lock.\n // $sql = \"INSERT INTO edit (dir, file, user, timestamp) VALUES ('\" . sqlite_escape_string($dir) . \"','\" . sqlite_escape_string($file) . \"','\" . sqlite_escape_string($user) . \"',\" . time() . \")\";\n // sqlite_query($ft['db']['link'], $sql); \n // }\n}", "public function lock(Request $request)\n {\n\n $this->_client->createConnection();\n\n $result = $this->_client->hSetNx(\n $this->_lockKey,\n $this->getMetadataKey($request),\n 1\n );\n\n $this->_client->close();\n\n return $result == 1;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method getSystem_user_programs Return the System_user' System_user_program's
public function getSystemUserPrograms() { $system_user_programs = array(); return $system_user_programs; }
[ "public function getPrograms()\n {\n $programs = array();\n \n \n foreach( $this->getSystemUserGroups() as $group )\n {\n foreach( $group->getSystemPrograms() as $prog )\n {\n $programs[$prog->controller] = true;\n }\n }\n \n foreach( $this->getSystemUserPrograms() as $prog )\n {\n $programs[$prog->controller] = true;\n }\n \n return $programs;\n }", "protected function getAdminPrograms() {\n $etd_db = Zend_Registry::get(\"etd-db\"); //etd util DB\n $programs = array();\n\n $results = $etd_db->select()\n ->from(array(\"etd_admins\"), array('programid'))\n ->where(\"netid= UPPER(?)\", $this->current_user->netid)->where(\"schoolid = UPPER(?)\", $this->school->db_id);\n $results = $etd_db->fetchAssoc($results);\n\n foreach($results as $row){\n if($row['programid'] !=''){\n $programs[] = strtolower($row['programid']);\n }\n }\n return $programs;\n }", "public function list_programs()\r\n\t\t{\r\n\t\t\treturn json_decode( $this->make_request( self::ENDPOINT . \"programs/\" ) );\r\n\t\t}", "public function getProgram()\n {\n $result = $this->db->query(\n \"SELECT\n program.id,\n program.name\n FROM students\n INNER JOIN users\n ON students.user_id = users.id\n INNER JOIN program\n ON students.program_id = program.id\n WHERE users.id = '$this->user_id'\");\n return $result->row();\n }", "public static function getSystemUser(){\n return static::getCPUser();\n }", "public static function getSystemUsernames()\n {\n return [self::SYSTEM_USER_CRON, self::SYSTEM_USER_CALENDARSCHEDULING, self::SYSTEM_USER_SETUP,\n self::SYSTEM_USER_REPLICATION, self::SYSTEM_USER_ANONYMOUS];\n }", "public function systemUsers(): array;", "public function getProgram()\n {\n if ($this->current_user_context) {\n return $this->current_user_context->program;\n } else {\n return false;\n }\n }", "public function program() {\n\n\t\treturn [\"program\" => $this->program];\n\t}", "public static function getUserApps()\n {\n $sql = 'SELECT P_NUM\n FROM APPLICATION A, POSITIONS P\n WHERE A.APC_POSKEY = P.P_NUM\n AND APC_USER_ID = :user';\n\n $db = static::getDB();\n\n $stmt = $db->prepare($sql);\n\n $stmt->bindValue(':user', $_SESSION['user_id'], PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetchAll();\n }", "private function doProgramServiceGetActivePrograms() {\n $yearInSeconds = 365 * 24 * 60 * 60;\n \n // Create the soap client for the program service\n $soapClient = new SoapClient($this->soapUrl.$this->programUri);\n \n // Create arguments to set a start and end date\n $soapArgs = new SoapArguments();\n // Set the start date to the current time using ISO 8601 format\n //$soapArgs->addDateArgument('startDate', date('c'));\n // Set the end date to the current time + 1 year in ISO 8601 format\n //$soapArgs->addDateArgument('endDate', date('c', time() + $yearInSeconds));\n \n // Query the server and capture the result\n //$soapResult = $soapClient->GetActivePrograms($soapArgs)->GetActiveProgramsResult;\n \n $request = \"http://72.54.98.142/sql.php?view=programs&format=json&startDate=\" . date('Y-m-d',time()) . \"&endDate=\" . date('Y-m-d',time() + $yearInSeconds); \n $response = file_get_contents($request);\n \n $programs = json_decode($response);\n \n // Process the results into an array of Program objects\n //$programs = array();\n //foreach($soapResult->ProgramModel as $program) {\n //foreach($decodedResponse as $program) {\n // $programs[] = $this->convertProgramModel($program);\n //}\n \n return $programs;\n }", "public function getUserSpecifiedSystem()\n {\n return $this->readOneof(9);\n }", "public function actionGetAllowedPrograms()\n {\n $allPrograms = $this->_em->getRepository('\\Jazzee\\Entity\\Program')->findBy(array('isExpired' => false), array('name' => 'ASC'));\n $userPrograms = $this->_user->getPrograms();\n $programList = array();\n foreach ($allPrograms as $program) {\n if ($this->checkIsAllowed($this->controllerName, 'anyProgram') or in_array($program->getId(), $userPrograms)) {\n $programList[] = array('id' => $program->getId(), 'name' => $program->getName());\n }\n }\n $this->layout = 'json';\n $this->setVar('result', $programList);\n $this->loadView($this->controllerName . '/result');\n }", "private function get_program_options() {\n\n $output = [];\n\n // get all programs\n $program_nids = $this->node_storage\n ->getQuery()\n ->condition('type', 'program' )\n ->condition('status', 1 )\n ->sort( 'title', 'ASC' )\n ->execute();\n\n $programs = $this->node_storage->loadMultiple( $program_nids );\n\n // process programs\n foreach( $programs as $program_key => $program ) {\n\n $promote_degrees = $program->field_promote_degrees->value ?? '0';\n $program_code = $program->program_code->value ?? $program->interest_code->value ?? '';\n\n if( empty( $program_code ) ) { continue; }\n\n if( $promote_degrees ) {\n\n // get program degrees\n $program_degree_nids = $this->node_storage\n ->getQuery()\n ->condition('type', 'program_degree' )\n ->condition( 'status', 1 )\n ->condition( 'parent_program', $program_key )\n ->sort( 'title', 'ASC' )\n ->execute();\n\n $program_degrees = $this->node_storage->loadMultiple( $program_degree_nids );\n\n // add program degrees to program output\n foreach( $program_degrees as $program_degree ) {\n\n $program_code = $program_degree->program_code->value ?? $program_degree->interest_code->value ?? '';\n\n $output[ $program_code ] = $program_degree->label();\n\n }\n\n }\n else {\n $output[ $program_code ] = $program->label();\n }\n\n }\n\n asort( $output );\n\n $output += ['UNDECIDE' => 'Undecided'];\n\n return $output;\n\n }", "public static function getProgramsList()\n {\n $res = '<option selected disabled>' . trans('general.nothing_selected') . '</option>';\n $section_code = Auth::user()->sections_section_code;\n $programs = self::where(trans('database/table.sections_section_code'), $section_code)->get();\n foreach ($programs as $program) {\n $res .= '<option value=\"' . $program->program_code . '\">' . $program->program_name . '</option>';\n }\n\n return $res;\n }", "function get_program($userid) {\n global $adldap;\n global $ad_authenticated;\n global $missing_data;\n\n $user_login = get_user_by('id',$userid)->user_login;\n $user_email = get_user_by('id',$userid)->user_email;\n $user_meta_division = get_user_meta($userid, 'adi_division', true);\n \n if (isset($user_meta_division) && \"\" != $user_meta_division) {\n return $user_meta_division;\n } else if (isset($missing_data[$user_email]) && isset($missing_data[$user_email]['program']) ) {\n \n $program = $missing_data[$user_email]['program'];\n # record the student number\n update_user_meta($userid, 'adi_division', $program);\n \n return $program;\n \n } else {\n if (!$ad_authenticated) {\n return NULL;\n } else {\n $ad_user_info = $adldap->user_info(\n strtolower($user_login),\n array('division')\n );\n if (\n is_array($ad_user_info)\n && isset($ad_user_info[0])\n && isset($ad_user_info[0]['division'])\n && is_array($ad_user_info[0]['division'])\n && isset($ad_user_info[0]['division'][0])\n ) {\n \n $program = $ad_user_info[0]['division'][0];\n \n # record the student number\n update_user_meta($userid, 'adi_division', $program);\n \n return $program;\n \n } else {\n return NULL;\n }\n }\n }\n \n }", "public function getProgramPreuser()\n\t{\n\t\treturn $this->program_preuser;\n\t}", "private function readPrograms()\n {\n\n $options = $this->application->getOptions();\n\n $daemons = Util::getAllDaemons($options);\n\n foreach ($daemons as $daemon) {\n $this->addProgram($daemon['object']);\n }\n\n if (isset($options['system']['programs'])) {\n // We have real programs in our application\n foreach ($options['system']['programs'] as $programLocation) {\n // Read the files in the directory\n $files = glob(realpath($programLocation['directory']) . \"/*.php\");\n\n foreach ($files as $filename) {\n include_once $filename; // include the file\n\n $className = pathinfo($filename, PATHINFO_FILENAME);\n if (isset($programLocation['namespace'])) {\n $className = $programLocation['namespace'] . \"\\\\\" . $className;\n }\n\n if (!class_exists($className)) {\n continue;\n }\n\n $reflectionClass = new \\ReflectionClass($className);\n if ($reflectionClass->isAbstract()) {\n continue;\n }\n\n $class = new $className();\n\n // We only want real programs\n if ($class instanceof Program) {\n $this->addProgram($class);\n }\n }\n }\n }\n\n }", "private function get_core_program_data() {\n $data = array(\n 'action' => 'create',\n 'context' => 'curriculum',\n 'idnumber' => 'testprogramid',\n 'name' => 'testprogram'\n );\n return $data;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a Joomla! install xml file.
public static function parseXMLInstallFile($path) { if( ! JFile::exists($path)) { JFactory::getApplication()->enqueueMessage(sprintf(jgettext('File not found %s'), $path), 'error'); return false; } //-- Read the file to see if it's a valid component XML file $manifest = self::getXML($path); if( ! $manifest instanceof SimpleXMLElement) { JFactory::getApplication()->enqueueMessage(sprintf(jgettext('Invalid manifest file %s'), $path), 'error'); unset($manifest); return false; } /* * Check for a valid XML root tag. */ if($manifest->getName() != 'extension') { EcrHtml::message(sprintf('Invalid install manifest at %s', $path), 'error'); unset($manifest); return false; } return $manifest; }
[ "private function installXml()\n {\n $this->installContentFile('install.xml');\n }", "protected function parseXmlFile() {}", "public static function fetch_plugins_package() {\r\n include_once (HW_HOANGWEB_PLUGINS . '/hw-importer/includes/parsers.php');\r\n $xml = HW_WXR_Parser_SimpleXML::read_simplexml_object(HW_HOANGWEB_PLUGINS. '/plugins-package.xml' );\r\n return $xml;\r\n }", "function parse_plugin_xml($plugName, $where = null)\n\t{\n\n\t\t$tp = e107::getParser();\n\t\t//\tloadLanFiles($plugName, 'admin');\t\t\t\t\t// Look for LAN files on default paths\n\t\t$xml = e107::getXml();\n\t\t$mes = e107::getMessage();\n\t\t\n\t\t//\t$xml->setOptArrayTags('extendedField,userclass,menuLink,commentID'); // always arrays for these tags.\n\t\t//\t$xml->setOptStringTags('install,uninstall,upgrade');\n\t\tif(null === $where) $where = 'plugin.xml';\n\n\t\t$this->plug_vars = $xml->loadXMLfile(e_PLUGIN.$plugName.'/'.$where, 'advanced');\n\t\t\n\t\tif ($this->plug_vars === FALSE)\n\t\t{\n\t\t\t$mes->add(\"Error reading {$plugName}/plugin.xml\", E_MESSAGE_ERROR);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$this->plug_vars['category'] = (isset($this->plug_vars['category'])) ? $this->manage_category($this->plug_vars['category']) : \"misc\";\n\t\t$this->plug_vars['folder'] = $plugName; // remove the need for <folder> tag in plugin.xml.\n\n\t\tif(!is_array($this->plug_vars['description']))\n\t\t{\n\t\t\t$diz = $this->plug_vars['description'];\n\t\t\tunset($this->plug_vars['description']);\n\t\t\t\n\t\t\t$this->plug_vars['description']['@value'] = $diz;\t\t\n\t\t}\n\t\t\n\t\t // Very useful debug code.to compare plugin.php vs plugin.xml\n\t\t/*\n\t\t $testplug = 'forum';\n\t\t if($plugName == $testplug)\n\t\t {\n\t\t $plug_vars1 = $this->plug_vars;\n\t\t $this->parse_plugin_php($testplug);\n\t\t $plug_vars2 = $this->plug_vars;\n\t\t ksort($plug_vars2);\n\t\t ksort($plug_vars1);\n\t\t echo \"<table>\n\t\t <tr><td><h1>PHP</h1></td><td><h1>XML</h1></td></tr>\n\t\t <tr><td style='border-right:1px solid black'>\";\n\t\t print_a($plug_vars2);\n\t\t echo \"</td><td>\";\n\t\t print_a($plug_vars1);\n\t\t echo \"</table>\";\n\t\t }\n\t\t*/\n\t\t\n\n\t\t// TODO search for $this->plug_vars['adminLinks']['link'][0]['@attributes']['primary']==true.\n\t\t$this->plug_vars['administration']['icon'] = varset($this->plug_vars['adminLinks']['link'][0]['@attributes']['icon']);\n\t\t$this->plug_vars['administration']['caption'] = varset($this->plug_vars['adminLinks']['link'][0]['@attributes']['description']);\n\t\t$this->plug_vars['administration']['iconSmall'] = varset($this->plug_vars['adminLinks']['link'][0]['@attributes']['iconSmall']);\n\t\t$this->plug_vars['administration']['configFile'] = varset($this->plug_vars['adminLinks']['link'][0]['@attributes']['url']);\n\n\t\treturn TRUE;\n\t}", "public function import_xml(){\n\n\t\t$this->load->language('extension/module/xml_module');\n\n\t\t$this->load->model('extension/module/xml_module');\n\n\t\t$this->load->model('catalog/attribute_group');\n\n\t\t$this->load->model('catalog/attribute');\n\n\t\t$this->load->model('catalog/manufacturer');\n\n\t\t$this->load->model('catalog/product');\n\n\t\t$json = array();\n\t\t$xml_url = \"\";\n\n\t\t// Check user has permission\n\t\tif (!$this->user->hasPermission('modify', 'extension/module/xml_module')) {\n\t\t\t$json['error'] = $this->language->get('error_permission');\n\t\t}\n\n\t\tif ($_POST[\"xml_url\"]){\n\t\t\t$xml_url = $_POST[\"xml_url\"];\n\t\t\t$xml = simplexml_load_file($xml_url) or die(\"feed not loading\");\n\t\t\t$this->parseCategories($xml);\n\t\t\t$this->parseProducts($xml);\n\t\t}\n\n\t\tif (!$json) {\n\t\t\t$json['success'] = $this->language->get('text_import_success');\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\n\t\t$this->session->data['success'] = $this->language->get('text_success');\n\t}", "function run_update_package_xml( $task=null, $args=array(), $cliopts=array() )\n{\n /// @todo replace hostname, build time\n\n $opts = eZExtBuilder::getOpts( @$args[0] );\n $destdir = $opts['build']['dir'];\n $files = pakeFinder::type( 'file' )->name( 'package.xml' )->maxdepth( 0 )->in( $destdir );\n if ( count( $files ) == 1 )\n {\n // original format\n pake_replace_regexp( $files, $destdir, array(\n // <name>xxx</name>\n '#^( *\\074name\\076)(.*)(\\074/name\\076\\r?\\n?)$#m' => '${1}' . $opts['extension']['name'] . '_extension' . '$3',\n // <version>xxx</version>\n '#^( *\\074version\\076)(.*)(\\074/version\\076\\r?\\n?)$#m' => '${1}' . $opts['ezp']['version']['major'] . '.' . $opts['ezp']['version']['minor'] . '.' . $opts['ezp']['version']['release'] . '$3',\n // <named-version>xxx</named-version>\n '#^( *\\074named-version\\076)(.*)(\\074/named-version\\076\\r?\\n?)$#m' => '${1}' . $opts['ezp']['version']['major'] . '.' . $opts['ezp']['version']['minor'] . '$3',\n // <package version=\"zzzz\"\n //'#^( *\\074package +version=\")(.*)(\"\\r?\\n?)$#m' => '${1}' . $opts['version']['major'] . '.' . $opts['version']['minor'] . $opts['releasenr']['separator'] . $opts['version']['release'] . '$3',\n // <number>xxxx</number>\n '#^( *\\074number\\076)(.*)(\\074/number\\076\\r?\\n?)$#m' => '${1}' . $opts['version']['alias'] . '$3',\n // <release>yyy</release>\n '#^( *\\074release\\076)(.*)(\\074/release\\076\\r?\\n?)$#m' => '${1}' . $opts['version']['release'] . '$3',\n\n '#^( *\\074timestamp\\076)(.*)(\\074/timestamp\\076\\r?\\n?)$#m' => '${1}' . time() . '$3',\n '#^( *\\074host\\076)(.*)(\\074/host\\076\\r?\\n?)$#m' => '${1}' . gethostname() . '$3',\n '#^( *\\074licence\\076)(.*)(\\074/licence\\076\\r?\\n?)$#m' => '${1}' . $opts['version']['license'] . '$3',\n ) );\n // replacing a token based on its value instead of its location (text immediately before and after,\n // as done above) has a disadvantage: we cannot execute the substitution many\n // times on the same text, as the 1st substitution will remove the token's\n // value. This means we have to reinit the build to get a 100% updated\n // package file. Unfortunately hunting for xml attributes not based on\n // token values needs a real xml parser, simplistic regexps are not enough...\n pake_replace_tokens( $files, $destdir, '{', '}', array(\n '$name' => $opts['extension']['name'],\n '$version' => $opts['version']['alias'],\n '$ezp_version' => $opts['ezp']['version']['major'] . '.' . $opts['ezp']['version']['minor'] . '.' . $opts['ezp']['version']['release']\n ) );\n }\n}", "function process_addon_xml($a = array(), $e)\n\t{\n $filestructure = $installcode = $uninstallcode = $upgradecode = $developer = $product = $modulearray = $modulegroup = $setting = $configgroup = $phrasegroup = $taskgroup = $taskarray = $emailgroup = $cssgroup = array();\n $emailname = $emailsubject = $emailbody = $emailtype = $emailvarname = $emailbuyer = $emailseller = $emailadmin = $csselement = $elementdescription = $csstype = $cssstatus = $cssauthor = $styleids = $csscontent = $csssort = $version = $minbuild = $maxbuild = '';\n $current_module_group = 0;\n $count = count($a);\n for ($i = 0; $i < $count; $i++)\n {\n if ($a[$i]['tag'] == 'VERSION')\n {\n $version = $a[$i]['value'];\t\n }\n else if ($a[$i]['tag'] == 'VERSIONCHECKURL')\n {\n $versioncheckurl = $a[$i]['value'];\t\n }\n else if ($a[$i]['tag'] == 'URL')\n {\n $url = $a[$i]['value'];\t\n }\n else if ($a[$i]['tag'] == 'MINVERSION')\n {\n $minversion = $a[$i]['value'];\t\n }\n else if ($a[$i]['tag'] == 'MAXVERSION')\n {\n $maxversion = !empty($a[$i]['value']) ? $a[$i]['value'] : '';\t\n }\n\t\t\telse if ($a[$i]['tag'] == 'MINBUILD')\n {\n $minbuild = !empty($a[$i]['value']) ? $a[$i]['value'] : '';\t\n }\n else if ($a[$i]['tag'] == 'MAXBUILD')\n {\n $maxbuild = !empty($a[$i]['value']) ? $a[$i]['value'] : '';\t\n }\n else if ($a[$i]['tag'] == 'DEVELOPER')\n {\n $developer = $a[$i]['value'];\t\n }\n // #### SETTINGS #######################################\n else if ($a[$i]['tag'] == 'CONFIGGROUP')\n {\n if ($a[$i]['type'] == 'open' OR $a[$i]['type'] == 'complete')\n {\n $current_config_group = $a[$i]['attributes']['GROUPNAME'];\n $current_config_table = $a[$i]['attributes']['TABLE'];\n $configgroup[] = array(\n $a[$i]['attributes']['GROUPNAME'], \n $a[$i]['attributes']['PARENTGROUPNAME'],\n $a[$i]['attributes']['DESCRIPTION'],\n $a[$i]['attributes']['TABLE']\n );\n }\n }\n else if ($a[$i]['tag'] == 'SETTING')\n {\n if ($a[$i]['type'] == 'open' OR $a[$i]['type'] == 'complete')\n {\n $setting[] = array(\n $current_config_group = isset($current_config_group) ? $current_config_group : '',\n $current_config_table = isset($current_config_table) ? $current_config_table : '',\n $a[$i]['attributes']['NAME'], \n $a[$i]['attributes']['DESCRIPTION'],\n $a[$i]['attributes']['VALUE'],\n $a[$i]['attributes']['INPUTTYPE'],\n $a[$i]['attributes']['SORT'],\n htmlspecialchars(trim($a[$i]['value']), ENT_COMPAT, $e)\n );\n }\n }\n // #### PRODUCT DATA ###################################\n else if ($a[$i]['tag'] == 'MODULEGROUP')\n {\n if ($a[$i]['type'] == 'open' OR $a[$i]['type'] == 'complete')\n {\n $current_module_group = $a[$i]['attributes']['NAME'];\n $modulegroup[] = array(\n $a[$i]['attributes']['NAME'], \n $a[$i]['attributes']['MODULENAME'],\n $a[$i]['attributes']['FOLDER'], \n $current_config_table = isset($current_config_table) ? $current_config_table : '',\n );\n }\n }\n else if ($a[$i]['tag'] == 'MODULE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $modulearray[] = array(\n $current_module_group,\n trim($a[$i]['attributes']['TAB']),\n trim($a[$i]['attributes']['SUBCMD']),\n trim($a[$i]['attributes']['PARENTID']),\n trim($a[$i]['attributes']['SORT']),\n trim($a[$i]['attributes']['KEY']),\n trim($a[$i]['value'])\n );\n }\n }\n // #### PHRASES ########################################\n else if ($a[$i]['tag'] == 'PHRASEGROUP')\n {\n if ($a[$i]['type'] == 'open' || $a[$i]['type'] == 'complete')\n {\n $productname = !empty($a[$i]['attributes']['PRODUCT']) ? $a[$i]['attributes']['PRODUCT'] : mb_strtolower($a[$i]['attributes']['NAME']);\n $current_phrase_group = !empty($a[$i]['attributes']['NAME']) ? $a[$i]['attributes']['NAME'] : '';\n $phrasegroup[] = array(\n $a[$i]['attributes']['NAME'], \n $a[$i]['attributes']['DESCRIPTION'],\n $productname\n );\n }\n }\n else if ($a[$i]['tag'] == 'PHRASE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $phrasearray[] = array(\n $current_phrase_group, \n trim($a[$i]['attributes']['VARNAME']), \n htmlspecialchars(trim($a[$i]['value']), ENT_COMPAT, $e)\n );\n }\n }\n // #### FILE STRUCTURE #################################\n else if ($a[$i]['tag'] == 'FILE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $filestructure[] = array(\n ((!empty($a[$i]['attributes']['MD5']) AND mb_strlen($a[$i]['attributes']['MD5']) == 32) ? $a[$i]['attributes']['MD5'] : ''),\n (!empty($a[$i]['value']) ? htmlspecialchars(trim($a[$i]['value']), ENT_COMPAT, $e) : '')\n );\n }\n }\n // #### SCHEDULED TASKS ################################\n else if ($a[$i]['tag'] == 'TASK')\n {\n if ($a[$i]['type'] == 'open' || $a[$i]['type'] == 'complete')\n {\n $current_task_group = !empty($a[$i]['attributes']['VARNAME']) ? $a[$i]['attributes']['VARNAME'] : '';\n $taskgroup[] = array(\n $a[$i]['attributes']['VARNAME'], \n $a[$i]['attributes']['FILENAME'],\n $a[$i]['attributes']['ACTIVE'],\n $a[$i]['attributes']['LOGLEVEL'],\n $a[$i]['attributes']['PRODUCT']\n );\n }\n }\n else if ($a[$i]['tag'] == 'SCHEDULE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $taskarray[] = array(\n $current_task_group, \n trim($a[$i]['attributes']['WEEKDAY']),\n trim($a[$i]['attributes']['DAY']),\n trim($a[$i]['attributes']['HOUR']),\n trim($a[$i]['attributes']['MINUTE'])\n );\n }\n }\n // #### EMAIL TEMPLATES ################################ \n else if ($a[$i]['tag'] == 'NAME')\n {\n $emailname = $a[$i]['value'];\n }\n else if ($a[$i]['tag'] == 'SUBJECT')\n {\n $emailsubject = $a[$i]['value']; \n }\n else if ($a[$i]['tag'] == 'MESSAGE')\n {\n $emailbody = $a[$i]['value']; \n }\n else if ($a[$i]['tag'] == 'TYPE')\n {\n $emailtype = $a[$i]['value'];\n }\n else if ($a[$i]['tag'] == 'VARNAME')\n {\n $emailvarname = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'BUYER')\n {\n $emailbuyer = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'SELLER')\n {\n $emailseller = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'ADMIN')\n {\n $emailadmin = $a[$i]['value']; \n }\n if (!empty($emailvarname) AND !empty($emailname) AND !empty($emailsubject) AND !empty($emailtype) AND !empty($emailbody))\n {\n $emailgroup[] = array(\n $emailvarname,\n $emailname, \n $emailsubject, \n $emailtype,\n $emailbody,\n\t\t\t\t\t$emailbuyer,\n\t\t\t\t\t$emailseller,\n\t\t\t\t\t$emailadmin\n );\n // reset for next email\n $emailname = $emailsubject = $emailbody = $emailtype = $emailvarname = $emailbuyer = $emailseller = $emailadmin = '';\n }\n\t\t\t// #### CSS TEMPLATES ##################################\n else if ($a[$i]['tag'] == 'CSSELEMENT')\n {\n $csselement = $a[$i]['value'];\n }\n else if ($a[$i]['tag'] == 'ELEMENTDESCRIPTION')\n {\n $elementdescription = isset($a[$i]['value']) ? $a[$i]['value'] : ''; \n }\n else if ($a[$i]['tag'] == 'CSSTYPE')\n {\n $csstype = $a[$i]['value']; \n }\n else if ($a[$i]['tag'] == 'CSSSTATUS')\n {\n $cssstatus = $a[$i]['value'];\n }\n else if ($a[$i]['tag'] == 'CSSAUTHOR')\n {\n $cssauthor = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'STYLEIDS')\n {\n $styleids = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'CSSCONTENT')\n {\n $csscontent = $a[$i]['value']; \n }\n\t\t\telse if ($a[$i]['tag'] == 'CSSSORT')\n\t\t\t{\n\t\t\t\t$csssort = $a[$i]['value'];\n\t\t\t}\n if (!empty($csselement) AND !empty($csstype) AND !empty($cssstatus) AND !empty($styleids) AND !empty($csscontent))\n {\n $cssgroup[] = array(\n $csselement,\n\t\t\t\t\t$elementdescription,\n $csstype, \n $cssstatus, \n $cssauthor,\n $styleids,\n\t\t\t\t\t$csscontent,\n\t\t\t\t\t$csssort\n );\n // reset for next css template\n $csselement = $elementdescription = $csstype = $cssstatus = $cssauthor = $styleids = $csscontent = $csssort = '';\n }\n // #### INSTALLATION CODE ##############################\n else if ($a[$i]['tag'] == 'INSTALLCODE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $installcode = !empty($a[$i]['value']) ? trim($a[$i]['value']) : '';\n }\n }\n // #### UNINSTALLATION CODE ############################\n else if ($a[$i]['tag'] == 'UNINSTALLCODE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $uninstallcode = !empty($a[$i]['value']) ? trim($a[$i]['value']) : '';\n }\n }\n // #### UPGRADE CODE ###################################\n else if ($a[$i]['tag'] == 'UPGRADECODE')\n {\n if ($a[$i]['type'] == 'complete')\n {\n $upgradecode = !empty($a[$i]['value']) ? trim($a[$i]['value']) : '';\n }\n }\n }\n $product[] = array($version, $versioncheckurl, $url, $minversion, $maxversion, $minbuild, $maxbuild);\n $result = array(\n 'product' \t=> $product,\n 'configgroup' \t=> isset($configgroup) \t ? $configgroup : '',\n 'setting' \t=> isset($setting) \t ? $setting : '',\n 'modulearray' \t=> $modulearray,\n 'modulegroup' \t=> $modulegroup,\n 'phrasearray' \t=> isset($phrasearray) \t ? $phrasearray : '',\n 'phrasegroup' \t=> isset($phrasegroup) \t ? $phrasegroup : '', \n 'taskarray' \t=> isset($taskarray) \t ? $taskarray : '',\n 'taskgroup' \t=> isset($taskgroup) \t ? $taskgroup : '',\n 'emailgroup' \t=> isset($emailgroup) \t ? $emailgroup : '',\n 'installcode' \t=> isset($installcode) \t ? $installcode : '',\n 'uninstallcode' => isset($uninstallcode) ? $uninstallcode : '',\n 'upgradecode' \t=> isset($upgradecode) \t ? $upgradecode : '',\n 'developer' \t=> isset($developer) \t ? $developer : '',\n 'filestructure' => isset($filestructure) ? $filestructure : '',\n\t\t\t'cssgroup' \t=> isset($cssgroup) ? $cssgroup : ''\n );\n return $result;\n }", "public static function manifest()\r\n\t{\r\n\t\t$manifestUrl = JPATH_ADMINISTRATOR.\"/components/com_componentbuilder/componentbuilder.xml\";\r\n\t\treturn simplexml_load_file($manifestUrl);\r\n\t}", "public function parse($component) {\r\n\t\t$fullpath = $this->getConfigurationPath($component);\r\n\t\t\r\n\t\tif(!($xml = @simplexml_load_file($fullpath))) {\r\n\t\t\tthrow new tx_auxo_ComponentException(sprintf('XML File %s is not valid', $fullpath));\r\n\t\t}\r\n\r\n\t\t$componentXML = $xml->xpath('component[@id=\"' . $component . '\"]');\r\n\t\tif (! count($componentXML)) {\r\n\t\t\tthrow new tx_auxo_ComponentException(sprintf('Component %s not found in file %s', $component, $fullpath));\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\treturn $this->parseComponent($componentXML[0], $component);\r\n\t}", "protected function readPackageInfo() {\n\t\t// search package.xml in package archive\n\t\t// throw error message if not found\n\t\tif ($this->tar->getIndexByFilename(self::INFO_FILE) === false) {\n\t\t\tthrow new SystemException(\"package information file '\".(self::INFO_FILE).\"' not found in '\".$this->archive.\"'\", 13000);\n\t\t}\n\t\t\n\t\t// extract package.xml, parse with SimpleXML\n\t\t// and compile an array with XML::getElementTree()\n\t\t$xml = new XML();\n\t\ttry {\n\t\t\t$xml->loadString($this->tar->extractToString(self::INFO_FILE));\n\t\t}\n\t\tcatch (Exception $e) { // bugfix to avoid file caching problems\n\t\t\t$xml->loadString($this->tar->extractToString(self::INFO_FILE));\n\t\t}\n\t\t$xmlContent = $xml->getElementTree('package');\n\t\t\n\t\t// name attribute is missing, thus this package is not valid\n\t\tif (!isset($xmlContent['attrs']['name']) || !$xmlContent['attrs']['name']) {\n\t\t\tthrow new SystemException(\"required 'name' attribute for 'package' tag is missing in \".self::INFO_FILE, 13001);\n\t\t}\n\n\t\t// package name is not a valid package identifier\n\t\tif (!Package::isValidPackageName($xmlContent['attrs']['name'])) {\n\t\t\tthrow new SystemException(\"'\".$xmlContent['attrs']['name'].\"' is not a valid package name.\", 13002);\n\t\t}\n\n\t\t// assign name attribute and loop through child tags\n\t\t$this->packageInfo['name'] = $xmlContent['attrs']['name'];\n\t\tforeach ($xmlContent['children'] as $child) {\n\t\t\tswitch (StringUtil::toLowerCase($child['name'])) {\n\t\t\t\t// read in package information\n\t\t\t\tcase 'packageinformation':\n\t\t\t\t\tforeach ($child['children'] as $packageInformation) {\n\t\t\t\t\t\tswitch (StringUtil::toLowerCase($packageInformation['name'])) {\n\t\t\t\t\t\t\tcase 'packagename':\n\t\t\t\t\t\t\t\tif (!isset($this->packageInfo['packageName'])) $this->packageInfo['packageName'] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (isset($packageInformation['attrs']['language'])) {\n\t\t\t\t\t\t\t\t\t$languageCode = $packageInformation['attrs']['language'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (isset($packageInformation['attrs']['languagecode'])) {\n\t\t\t\t\t\t\t\t\t$languageCode = $packageInformation['attrs']['languagecode'];\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$languageCode = 'default';\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\t$this->packageInfo['packageName'][$languageCode] = $packageInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'packagedescription':\n\t\t\t\t\t\t\t\tif (!isset($this->packageInfo['packageDescription'])) $this->packageInfo['packageDescription'] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (isset($packageInformation['attrs']['language'])) {\n\t\t\t\t\t\t\t\t\t$languageCode = $packageInformation['attrs']['language'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (isset($packageInformation['attrs']['languagecode'])) {\n\t\t\t\t\t\t\t\t\t$languageCode = $packageInformation['attrs']['languagecode'];\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$languageCode = 'default';\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\t$this->packageInfo['packageDescription'][$languageCode] = $packageInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'isunique':\n\t\t\t\t\t\t\t\t$this->packageInfo['isUnique'] = intval($packageInformation['cdata']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'standalone':\n\t\t\t\t\t\t\t\t$this->packageInfo['standalone'] = intval($packageInformation['cdata']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'promptparent':\n\t\t\t\t\t\t\tcase 'plugin':\n\t\t\t\t\t\t\t\tif ($packageInformation['cdata'] != 0 && !Package::isValidPackageName($packageInformation['cdata'])) {\n\t\t\t\t\t\t\t\t\tthrow new SystemException(\"'\".$packageInformation['cdata'].\"' is not a valid package name.\", 13002);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$this->packageInfo['plugin'] = $packageInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'version':\n\t\t\t\t\t\t\t\t$this->packageInfo['version'] = $packageInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t\t\t$this->packageInfo['date'] = @strtotime($packageInformation['cdata']);\n\t\t\t\t\t\t\t\tif ($this->packageInfo['date'] === -1 || $this->packageInfo['date'] === false) {\n\t\t\t\t\t\t\t\t\tthrow new SystemException(\"invalid dateformat '\".$packageInformation['cdata'].\"' in package.xml\", 13003);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->packageInfo['date'] += 43201;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'packageurl':\n\t\t\t\t\t\t\t\t$this->packageInfo['packageURL'] = $packageInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// read in author information\n\t\t\t\tcase 'authorinformation':\n\t\t\t\t\tforeach ($child['children'] as $authorInformation) {\n\t\t\t\t\t\tswitch (StringUtil::toLowerCase($authorInformation['name'])) {\n\t\t\t\t\t\t\tcase 'author':\n\t\t\t\t\t\t\t\t$this->authorInfo['author'] = $authorInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'authorurl':\n\t\t\t\t\t\t\t\t$this->authorInfo['authorURL'] = $authorInformation['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// read in requirements\n\t\t\t\tcase 'requiredpackages':\n\t\t\t\t\tforeach ($child['children'] as $requiredPackage) {\n\t\t\t\t\t\t// reference to required package is not a valid package identifier\n\t\t\t\t\t\tif (!Package::isValidPackageName($requiredPackage['cdata'])) {\n\t\t\t\t\t\t\tthrow new SystemException(\"'\".$requiredPackage['cdata'].\"' is not a valid package name.\", 13002);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->requirements[$requiredPackage['cdata']] = (array('name' => $requiredPackage['cdata']) + $requiredPackage['attrs']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// read in optionals\n\t\t\t\tcase 'optionalpackages':\n\t\t\t\t\tforeach ($child['children'] as $optionalPackage) {\n\t\t\t\t\t\t// reference to optional package is not a valid package identifier\n\t\t\t\t\t\tif (!Package::isValidPackageName($optionalPackage['cdata'])) {\n\t\t\t\t\t\t\tthrow new SystemException(\"'\".$optionalPackage['cdata'].\"' is not a valid package name.\", 13002);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($optionalPackage['attrs']['file']) || !$optionalPackage['attrs']['file']) {\n\t\t\t\t\t\t\tthrow new SystemException(\"required 'file' attribute for 'optionalPackage' tag is missing in \".self::INFO_FILE, 13001);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->optionals[] = (array('name' => $optionalPackage['cdata']) + $optionalPackage['attrs']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// read in excluded packages\n\t\t\t\tcase 'excludedpackages':\n\t\t\t\t\tforeach ($child['children'] as $excludedPackage) {\n\t\t\t\t\t\t// reference to excluded package is not a valid package identifier\n\t\t\t\t\t\tif (!Package::isValidPackageName($excludedPackage['cdata'])) {\n\t\t\t\t\t\t\tthrow new SystemException(\"'\".$excludedPackage['cdata'].\"' is not a valid package name.\", 13002);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->excludedPackages[$excludedPackage['cdata']] = (array('name' => $excludedPackage['cdata']) + $excludedPackage['attrs']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t// get installation and update instructions\n\t\t\t\tcase 'instructions':\n\t\t\t\t\tif ($child['attrs']['type'] == 'update') {\n\t\t\t\t\t\tif (!isset($child['attrs']['fromversion']) || !$child['attrs']['fromversion']) {\n\t\t\t\t\t\t\tthrow new SystemException(\"required 'fromversion' attribute for 'instructions type=update' tag is missing in \".self::INFO_FILE, 13001);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->update[$child['attrs']['fromversion']] = array();\n\t\t\t\t\t\t$processData =& $this->update[$child['attrs']['fromversion']];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->install = array();\n\t\t\t\t\t\t$processData =& $this->install;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tforeach ($child['children'] as $instruction) {\n\t\t\t\t\t\tswitch ($instruction['name']) {\n\t\t\t\t\t\t\t// get links to sql file\n\t\t\t\t\t\t\tcase 'sql':\n\t\t\t\t\t\t\t\t$processData['sql'] = $instruction['cdata'];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// get links to language files\n\t\t\t\t\t\t\tcase 'languages':\n\t\t\t\t\t\t\t\tif (!isset($processData['languages'])) {\n\t\t\t\t\t\t\t\t\t$processData['languages'] = array();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$processData['languages'][] = array('cdata' => $instruction['cdata']) + $instruction['attrs'];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// get links to other (any but not sql) files\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (!isset($processData[$instruction['name']])) {\n\t\t\t\t\t\t\t\t\t$processData[$instruction['name']] = array();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$processData[$instruction['name']][] = array('cdata' => $instruction['cdata']) + $instruction['attrs'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tforeach ($processData as $key => $val) {\n\t\t\t\t\t\tif ($key != 'languages' && is_array($val) && count($val) == 1) {\n\t\t\t\t\t\t\t$processData[$key] = array_shift($val);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add com.woltlab.wcf to package requirements\n\t\tif (!isset($this->requirements['com.woltlab.wcf']) && $this->packageInfo['name'] != 'com.woltlab.wcf') {\n\t\t\t$this->requirements['com.woltlab.wcf'] = array('name' => 'com.woltlab.wcf');\n\t\t}\n\t\t\n\t\t// examine the right update instruction block\n\t\tif ($this->package !== null && $this->update !== null) {\n\t\t\t$validUpdate = null;\n\t\t\tforeach ($this->update as $fromVersion => $update) {\n\t\t\t\tif (Package::checkFromversion($this->package->getVersion(), $fromVersion)) {\n\t\t\t\t\t$validUpdate = $update;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->update = $validUpdate;\n\t\t}\n\t\t\n\t\t// check required tags\n\t\tif (!isset($this->packageInfo['packageName'])) {\n\t\t\tthrow new SystemException(\"required tag 'packageName' is missing in \".self::INFO_FILE, 13001);\n\t\t}\n\t\tif (!isset($this->packageInfo['version'])) {\n\t\t\tthrow new SystemException(\"required tag 'version' is missing in \".self::INFO_FILE, 13001);\n\t\t}\n\t\t\n\t\t// set default values\n\t\tif (!isset($this->packageInfo['isUnique'])) $this->packageInfo['isUnique'] = 0;\n\t\tif (!isset($this->packageInfo['standalone'])) $this->packageInfo['standalone'] = 0;\n\t\tif (!isset($this->packageInfo['plugin'])) $this->packageInfo['plugin'] = '';\n\t\tif (!isset($this->packageInfo['packageURL'])) $this->packageInfo['packageURL'] = '';\n\t\t\n\t\t// get package name in selected language\n\t\t$this->getLocalizedInformation('packageName');\n\t\t\n\t\t// get package description in selected language\n\t\tif (isset($this->packageInfo['packageDescription'])) {\n\t\t\t$this->getLocalizedInformation('packageDescription');\n\t\t}\n\t\t\n\t\tif (CHARSET != 'UTF-8') {\n\t\t\tif (isset($this->authorInfo['author'])) {\n\t\t\t\t$this->authorInfo['author'] = StringUtil::convertEncoding('UTF-8', CHARSET, $this->authorInfo['author']);\n\t\t\t}\n\t\t\tif (isset($this->authorInfo['authorURL'])) {\n\t\t\t\t$this->authorInfo['authorURL'] = StringUtil::convertEncoding('UTF-8', CHARSET, $this->authorInfo['authorURL']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add plugin to requirements\n\t\tif ($this->packageInfo['plugin'] && !isset($this->requirements[$this->packageInfo['plugin']])) {\n\t\t\t$this->requirements[$this->packageInfo['plugin']] = array('name' => $this->packageInfo['plugin']);\n\t\t}\n\t}", "public function parseXml()\n\t{\n\t\t$config = Butterfly_Config_Ini::load(CONFIG_FILE, APPLICATION_ENV);\n\t\tif (empty($this->_xml)) {\n\t\t\tif (is_file($config->themes_path . '/' . $this->theme_name . '/' . $this->theme_name . '.xml')) {\n\t\t\t\t$this->_xml = new Butterfly_Xml($config->themes_path . '/' . $this->theme_name . '/' . $this->theme_name . '.xml');\n\t\t\t\t$this->_css = $this->getcss();\n\t\t\t\t$this->_js = $this->getjs();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Butterfly_Theme_Exception('Xml theme description not found');\n\t\t\t}\n\t\t}\n\t}", "abstract public function parseXml($file);", "function parseInstallNodes(&$installTree) {\n\t\tforeach ($installTree->getChildren() as $node) {\n\t\t\tswitch ($node->getName()) {\n\t\t\t\tcase 'schema':\n\t\t\t\tcase 'data':\n\t\t\t\tcase 'code':\n\t\t\t\tcase 'note':\n\t\t\t\t\t$this->addInstallAction($node);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'upgrade':\n\t\t\t\t\t$minVersion = $node->getAttribute('minversion');\n\t\t\t\t\t$maxVersion = $node->getAttribute('maxversion');\n\t\t\t\t\tif ((!isset($minVersion) || $this->currentVersion->compare($minVersion) >= 0) && (!isset($maxVersion) || $this->currentVersion->compare($maxVersion) <= 0)) {\n\t\t\t\t\t\t$this->parseInstallNodes($node);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected function readPackageInfo() {\n\t\t// search package.xml in package archive\n\t\t// throw error message if not found\n\t\tif ($this->tar->getIndexByFilename(self::INFO_FILE) === false) {\n\t\t\tthrow new SystemException(\"package information file '\".(self::INFO_FILE).\"' not found in '\".$this->archive.\"'\", 13000);\n\t\t}\n\t\t\n\t\t// extract package.xml, parse with SimpleXML\n\t\t// and compile an array with XML::getElementTree()\n\t\t$xml = new XML();\n\t\ttry {\n\t\t\t$xml->loadXML(self::INFO_FILE, $this->tar->extractToString(self::INFO_FILE));\n\t\t}\n\t\tcatch (Exception $e) { // bugfix to avoid file caching problems\n\t\t\t$xml->loadXML(self::INFO_FILE, $this->tar->extractToString(self::INFO_FILE));\n\t\t}\n\t\t\n\t\t// parse xml\n\t\t$xpath = $xml->xpath();\n\t\t$package = $xpath->query('/ns:package')->item(0);\n\t\t\n\t\t// package name\n\t\t$packageName = $package->getAttribute('name');\n\t\tif (!Package::isValidPackageName($packageName)) {\n\t\t\t// package name is not a valid package identifier\n\t\t\tthrow new SystemException(\"'\".$packageName.\"' is not a valid package name.\", 13002);\n\t\t}\n\t\t\n\t\t$this->packageInfo['name'] = $packageName;\n\t\t\n\t\t// get package information\n\t\t$packageInformation = $xpath->query('./ns:packageinformation', $package)->item(0);\n\t\t$elements = $xpath->query('child::*', $packageInformation);\n\t\tforeach ($elements as $element) {\n\t\t\tswitch ($element->tagName) {\n\t\t\t\tcase 'packagename':\n\t\t\t\tcase 'packagedescription':\n\t\t\t\tcase 'readme':\n\t\t\t\tcase 'license':\n\t\t\t\t\tif (!isset($this->packageInfo[$element->tagName])) $this->packageInfo[$element->tagName] = array();\n\t\t\t\t\t\n\t\t\t\t\t$languageCode = 'default';\n\t\t\t\t\tif ($element->hasAttribute('language')) {\n\t\t\t\t\t\t$languageCode = $element->getAttribute('language');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// fix case-sensitive names\n\t\t\t\t\t$name = $element->tagName;\n\t\t\t\t\tif ($name == 'packagename') $name = 'packageName';\n\t\t\t\t\telse if ($name == 'packagedescription') $name = 'packageDescription';\n\t\t\t\t\t\n\t\t\t\t\t$this->packageInfo[$name][$languageCode] = $element->nodeValue;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'standalone':\n\t\t\t\t\t$this->packageInfo['standalone'] = intval($element->nodeValue);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'plugin':\n\t\t\t\t\tif ($element->nodeValue && !Package::isValidPackageName($element->nodeValue)) {\n\t\t\t\t\t\tthrow new SystemException(\"'\".$element->nodeValue.\"' is not a valid package name.\", 13002);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->packageInfo['plugin'] = $element->nodeValue;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'packageurl':\n\t\t\t\t\t$this->packageInfo['packageURL'] = $element->nodeValue;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'version':\n\t\t\t\t\tif (!preg_match('~^([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\ (a|alpha|b|beta|d|dev|rc|pl)\\ ([0-9]+))?$~is', $element->nodeValue)) {\n\t\t\t\t\t\tthrow new SystemException(\"package version '\".$element->nodeValue.\"' is invalid\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->packageInfo['version'] = $element->nodeValue;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'date':\n\t\t\t\t\t// matches almost any valid date between year 2000 and 2038\n\t\t\t\t\tif (!preg_match('~^(20[0-2][0-9]|203[0-8])\\-(0[1-9]|1[0-2])\\-(0[1-9]|[1-2][0-9]|3[0-1])$~', $element->nodeValue)) {\n\t\t\t\t\t\tthrow new SystemException(\"package date '\".$element->nodeValue.\"' is invalid, violating ISO-8601 date format.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->packageInfo['date'] = strtotime($element->nodeValue) + 43201; // TODO: Is this even neccessary?\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get author information\n\t\t$authorInformation = $xpath->query('./ns:authorinformation', $package)->item(0);\n\t\t$elements = $xpath->query('child::*', $authorInformation);\n\t\tforeach ($elements as $element) {\n\t\t\t$tagName = ($element->tagName == 'authorurl') ? 'authorURL' : $element->tagName;\n\t\t\t$this->authorInfo[$tagName] = $element->nodeValue;\n\t\t}\n\t\t\n\t\t// get required packages\n\t\t$elements = $xpath->query('child::ns:requiredpackages/ns:requiredpackage', $package);\n\t\tforeach ($elements as $element) {\n\t\t\tif (!Package::isValidPackageName($element->nodeValue)) {\n\t\t\t\tthrow new SystemException(\"'\".$element->nodeValue.\"' is not a valid package name.\", 13002);\n\t\t\t}\n\t\t\t\n\t\t\t// read attributes\n\t\t\t$data = array('name' => $element->nodeValue);\n\t\t\t$attributes = $xpath->query('attribute::*', $element);\n\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t$data[$attribute->name] = $attribute->value;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$this->requirements[$element->nodeValue] = $data;\n\t\t}\n \n // get optional packages\n\t\t$elements = $xpath->query('child::ns:optionalpackages/ns:optionalpackage', $package);\n\t\tforeach ($elements as $element) {\n\t\t\tif (!Package::isValidPackageName($element->nodeValue)) {\n\t\t\t\tthrow new SystemException(\"'\".$element->nodeValue.\"' is not a valid package name.\", 13002);\n\t\t\t}\n\t\t\t\n\t\t\t// read attributes\n\t\t\t$data = array('name' => $element->nodeValue);\n\t\t\t$attributes = $xpath->query('attribute::*', $element);\n\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t$data[$attribute->name] = $attribute->value;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$this->optionals[] = $data;\n\t\t}\n\t\t\n\t\t// get excluded packages\n\t\t$elements = $xpath->query('child::ns:excludedpackages/ns:excludedpackage', $package);\n\t\tforeach ($elements as $element) {\n\t\t\tif (!Package::isValidPackageName($element->nodeValue)) {\n\t\t\t\tthrow new SystemException(\"'\".$element->nodeValue.\"' is not a valid package name.\", 13002);\n\t\t\t}\n\t\t\t\n\t\t\t// read attributes\n\t\t\t$data = array('name' => $element->nodeValue);\n\t\t\t$attributes = $xpath->query('attribute::*', $element);\n\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t$data[$attribute->name] = $attribute->value;\n\t\t\t}\n\t\t\t\n\t\t\t$this->excludedPackages[] = $data;\n\t\t}\n\t\t\n\t\t// get instructions\n\t\t$elements = $xpath->query('./ns:instructions', $package);\n\t\tforeach ($elements as $element) {\n\t\t\t$instructionData = array();\n\t\t\t$instructions = $xpath->query('./ns:instruction', $element);\n\t\t\tforeach ($instructions as $instruction) {\n\t\t\t\t$data = array();\n\t\t\t\t$attributes = $xpath->query('attribute::*', $instruction);\n\t\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t\t$data[$attribute->name] = $attribute->value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$instructionData[] = array(\n\t\t\t\t\t'attributes' => $data,\n\t\t\t\t\t'pip' => $instruction->getAttribute('type'),\n\t\t\t\t\t'value' => $instruction->nodeValue\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$fromVersion = $element->getAttribute('fromversion');\n\t\t\t$type = $element->getAttribute('type');\n\t\t\t\n\t\t\tif ($type == 'install') {\n\t\t\t\t$this->instructions['install'] = $instructionData;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->instructions['update'][$fromVersion][] = $instructionData;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get php requirements\n\t\t$requirements = $xpath->query('./ns:phprequirements', $package);\n\t\tforeach ($requirements as $requirement) {\n\t\t\t$elements = $xpath->query('child::*', $requirement);\n\t\t\tforeach ($elements as $element) {\n\t\t\t\tswitch ($element->tagName) {\n\t\t\t\t\tcase 'version':\n\t\t\t\t\t\t$this->phpRequirements['version'] = $element->nodeValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'setting':\n\t\t\t\t\t\t$this->phpRequirements['settings'][$element->getAttribute('name')] = $element->nodeValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'extension':\n\t\t\t\t\t\t$this->phpRequirements['extensions'][] = $element->nodeValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'function':\n\t\t\t\t\t\t$this->phpRequirements['functions'][] = $element->nodeValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'class':\n\t\t\t\t\t\t$this->phpRequirements['classes'][] = $element->nodeValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add com.woltlab.wcf to package requirements\n\t\tif (!isset($this->requirements['com.woltlab.wcf']) && $this->packageInfo['name'] != 'com.woltlab.wcf') {\n\t\t\t$this->requirements['com.woltlab.wcf'] = array('name' => 'com.woltlab.wcf');\n\t\t}\n\t\t\n\t\tif ($this->package != null) {\n\t\t\t$validFromVersion = null;\n\t\t\tforeach ($this->update as $fromVersion => $update) {\n\t\t\t\tif (Package::checkFromversion($this->package->packageVersion, $fromVersion)) {\n\t\t\t\t\t$validFromVersion = $fromVersion;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validFromVersion === null) {\n\t\t\t\t$this->instructions['update'] = array();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->instructions['update'] = $this->instructions['update'][$validFromVersion];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set default values\n\t\tif (!isset($this->packageInfo['standalone'])) $this->packageInfo['standalone'] = 0;\n\t\tif (!isset($this->packageInfo['plugin'])) $this->packageInfo['plugin'] = '';\n\t\tif (!isset($this->packageInfo['packageURL'])) $this->packageInfo['packageURL'] = '';\n\t\t\n\t\t// get package name in selected language\n\t\t$this->getLocalizedInformation('packageName');\n\t\t\n\t\t// get package description in selected language\n\t\tif (isset($this->packageInfo['packageDescription'])) {\n\t\t\t$this->getLocalizedInformation('packageDescription');\n\t\t}\n\t\t\n\t\t// get package license in selected language\n\t\tif (isset($this->packageInfo['license'])) {\n\t\t\t$this->getLocalizedInformation('license');\n\t\t}\n\t\t\n\t\t// get package information in selected language\n\t\tif (isset($this->packageInfo['readme'])) {\n\t\t\t$this->getLocalizedInformation('readme');\n\t\t}\n\t\t\n\t\t// add plugin to requirements\n\t\tif ($this->packageInfo['plugin'] && !isset($this->requirements[$this->packageInfo['plugin']])) {\n\t\t\t$this->requirements[$this->packageInfo['plugin']] = array('name' => $this->packageInfo['plugin']);\n\t\t}\n\t}", "private function getComponentData($extensionName, $xmlName)\r\n\t{\r\n\t\t$extensionName = strtolower($extensionName);\r\n\t\t$path = JPATH_ADMINISTRATOR . DS . 'components' . DS . $extensionName;\r\n\t\t$altExtensionName = substr($extensionName,4);\r\n\t\t\r\n\t\tjimport('joomla.filesystem.file');\r\n\t\tif( JFile::exists( \"$path/$xmlName\" ) ) {\r\n\t\t\t$filename = \"$path/$xmlName\";\r\n\t\t} elseif( JFile::exists( \"$path/$extensionName.xml\" ) ) {\r\n\t\t\t$filename = \"$path/$extensionName.xml\";\r\n\t\t} elseif( JFile::exists( \"$path/$altExtensionName.xml\" ) ) {\r\n\t\t\t$filename = \"$path/$altExtensionName.xml\";\r\n\t\t} elseif( JFile::exists( \"$path/manifest.xml\" ) ) {\r\n\t\t\t$filename = \"$path/manifest.xml\";\r\n\t\t} else {\r\n\t\t\t$filename = $this->searchForManifest($path);\r\n\t\t\t\r\n\t\t\tif( $filename === false )\r\n\t\t\t\t$filename = null;\r\n\t\t}\r\n\t\t\r\n\t\tif( empty( $filename ) ) {\r\n\t\t\treturn array('version' => '', 'date' => '', 'xmlfile' => '');\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->xmlparser( $filename );\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$xml = new SimpleXMLElement($filename, LIBXML_NONET, true);\r\n\t\t} catch(Exception $e) {\r\n\t\t\treturn array('version' => '', 'date' => '', 'xmlfile' => '');\r\n\t\t}\r\n\t\t\r\n\t\tif ($xml->getName() != 'extension' && $xml->getName() != 'install') {\r\n\t\t\tunset($xml);\r\n\t\t\treturn array('version' => '', 'date' => '', 'xmlfile' => '');\r\n\t\t}\r\n\t\t\r\n\t\t$data\t\t\t\t= array();\r\n\t\t$data['version']\t= $xml->version ? (string) $xml->version : '';\r\n\t\t$data['date']\t\t= $xml->creationDate ? (string) $xml->creationDate : '';\r\n\t\t$data['xmlfile']\t= $filename;\r\n\t\t\r\n// \t\t$xml = & JFactory::getXMLParser('Simple');\r\n// \t\tif (! $xml->loadFile( $filename ) ) {\r\n// \t\t\tunset( $xml );\r\n// \t\t\treturn array('version' => '', 'date' => '', 'xmlfile' => '');\r\n// \t\t}\r\n\t\t\r\n// \t\tif ( ( $xml->document->name() != 'install' ) && ( $xml->document->name() != 'extension' ) ) {\r\n// \t\t\tunset($xml);\r\n// \t\t\treturn array('version' => '', 'date' => '', 'xmlfile' => '');\r\n// \t\t}\r\n\t\t\r\n// \t\t$element = & $xml->document->version[0];\r\n// \t\t$data['version'] = $element ? $element->data() : '';\r\n// \t\t$element = & $xml->document->creationDate[0];\r\n// \t\t$data['date'] = $element ? $element->data() : '';\r\n\t\r\n// \t\t$data['xmlfile'] = $filename;\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "protected function parse_xml() {\n\t\t\n\t\t$response = wp_remote_get( self::$powerreviews_url . 'pwr/dgw9fped/rawdata/review_data_summary.xml' );\n\t\tif( is_array($response) ) {\n\t\t\t// $header = $response['headers']; // array of http header lines\n\t\t\t$body = $response['body']; // use the content\n\t\t\tself::$_xml = simplexml_load_string( $body );\n\t\t}\n\n\n\t\t// if( WP_DEBUG ){\n\t\t// $json = json_encode( $xml );\n\t\t// $array = json_decode( $json, TRUE );\n\t\t// \techo '<pre>';\n\t\t// \twp_die( 'PARSING XML: ' . print_r($array) . '</pre>' );\n\t\t// }\n\n\t\t// if( WP_DEBUG ){\n\t\t// \techo '<pre>';\n\t\t// \twp_die( 'PARSING XML: ' . print_r($_xml->product[1]) . '</pre>' );\n\t\t// }\n\n\t}", "function importXML($file)\n\t{\n\t\tglobal $opt;\n\n $xr = new XMLReader();\n if (!$xr->open($file))\n {\n $xr->close();\n\t\t\treturn;\n }\n\n $xr->read();\n if ($xr->nodeType != XMLReader::ELEMENT)\n {\n echo 'error: First element expected, aborted' . \"\\n\";\n return;\n }\n if ($xr->name != 'gkxml')\n {\n echo 'error: First element not valid, aborted' . \"\\n\";\n return;\n }\n\n\t\t$startupdate = $xr->getAttribute('date');\n if ($startupdate == '')\n {\n echo 'error: Date attribute not valid, aborted' . \"\\n\";\n return;\n }\n\n while ($xr->read() && !($xr->name == 'geokret' || $xr->name == 'moves')) ;\n\n $nRecordsCount = 0;\n do\n {\n if ($xr->nodeType == XMLReader::ELEMENT)\n {\n\t\t\t\t$element = $xr->expand();\n\t\t\t\tswitch ($xr->name)\n\t\t\t\t{\n\t\t\t\t\tcase 'geokret':\n\t\t\t\t\t\t$this->importGeoKret($element);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'moves':\n\t\t\t\t\t\t$this->importMove($element);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$nRecordsCount++;\n }\n }\n while ($xr->next());\n\n $xr->close();\n\n\t\tsetSysConfig('geokrety_lastupdate', date($opt['db']['dateformat'], strtotime($startupdate)));\n\t}", "function xml_import_settings($xml = false)\n{\n\tglobal $vbulletin, $vbphrase;\n\n\tprint_dots_start('<b>' . $vbphrase['importing_settings'] . \"</b>, $vbphrase[please_wait]\", ':', 'dspan');\n\n\trequire_once(DIR . '/includes/class_xml.php');\n\n\t$xmlobj = new vB_XML_Parser($xml, $GLOBALS['path']);\n\tif ($xmlobj->error_no == 1)\n\t{\n\t\t\tprint_dots_stop();\n\t\t\tprint_stop_message('no_xml_and_no_path');\n\t}\n\telse if ($xmlobj->error_no == 2)\n\t{\n\t\t\tprint_dots_stop();\n\t\t\tprint_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-settings.xml', $GLOBALS['path']);\n\t}\n\n\tif(!$arr = $xmlobj->parse())\n\t{\n\t\tprint_dots_stop();\n\t\tprint_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());\n\t}\n\n\tif (!$arr['settinggroup'])\n\t{\n\t\tprint_dots_stop();\n\t\tprint_stop_message('invalid_file_specified');\n\t}\n\n\t$product = (empty($arr['product']) ? 'vbulletin' : $arr['product']);\n\n\t// delete old volatile settings and settings that might conflict with new ones...\n\t$vbulletin->db->query_write(\"DELETE FROM \" . TABLE_PREFIX . \"settinggroup WHERE volatile = 1 AND (product = '\" . $vbulletin->db->escape_string($product) . \"'\" . iif($product == 'vbulletin', \" OR product = ''\") . ')');\n\t$vbulletin->db->query_write(\"DELETE FROM \" . TABLE_PREFIX . \"setting WHERE volatile = 1 AND (product = '\" . $vbulletin->db->escape_string($product) . \"'\" . iif($product == 'vbulletin', \" OR product = ''\") . ')');\n\n\t// run through imported array\n\tif (!is_array($arr['settinggroup'][0]))\n\t{\n\t\t$arr['settinggroup'] = array($arr['settinggroup']);\n\t}\n\tforeach($arr['settinggroup'] AS $group)\n\t{\n\t\t// need check to make sure group product== xml product before inserting new settinggroup\n\t\tif (empty($group['product']) OR $group['product'] == $product)\n\t\t{\n\t\t\t// insert setting group\n\t\t\t/*insert query*/\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tINSERT IGNORE INTO \" . TABLE_PREFIX . \"settinggroup\n\t\t\t\t(grouptitle, displayorder, volatile, product)\n\t\t\t\tVALUES\n\t\t\t\t('\" . $vbulletin->db->escape_string($group['name']) . \"', \" . intval($group['displayorder']) . \", 1, '\" . $vbulletin->db->escape_string($product) . \"')\n\t\t\t\");\n\t\t}\n\n\t\t// build insert query for this group's settings\n\t\t$qBits = array();\n\t\tif (!is_array($group['setting'][0]))\n\t\t{\n\t\t\t$group['setting'] = array($group['setting']);\n\t\t}\n\t\tforeach($group['setting'] AS $setting)\n\t\t{\n\t\t\tif (isset($vbulletin->options[\"$setting[varname]\"]))\n\t\t\t{\n\t\t\t\t$newvalue = $vbulletin->options[\"$setting[varname]\"];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$newvalue = $setting['defaultvalue'];\n\t\t\t}\n\t\t\t$qBits[] = \"(\n\t\t\t\t'\" . $vbulletin->db->escape_string($setting['varname']) . \"',\n\t\t\t\t'\" . $vbulletin->db->escape_string($group['name']) . \"',\n\t\t\t\t'\" . $vbulletin->db->escape_string(trim($newvalue)) . \"',\n\t\t\t\t'\" . $vbulletin->db->escape_string(trim($setting['defaultvalue'])) . \"',\n\t\t\t\t'\" . $vbulletin->db->escape_string(trim($setting['datatype'])) . \"',\n\t\t\t\t'\" . $vbulletin->db->escape_string($setting['optioncode']) . \"',\n\t\t\t\t\" . intval($setting['displayorder']) . \",\n\t\t\t\t\" . intval($setting['advanced']) . \",\n\t\t\t\t1\" . (!defined('UPGRADE_COMPAT') ? \",\n\t\t\t\t\t'\" . $vbulletin->db->escape_string($setting['validationcode']) . \"',\n\t\t\t\t\t\" . intval($setting['blacklist']) . \",\n\t\t\t\t\t'\" . $vbulletin->db->escape_string($product) . \"'\" : '') . \"\\n\\t)\";\n\t\t}\n\t\t// run settings insert query\n\t\t/*insert query*/\n\t\t$vbulletin->db->query_write(\"\n\t\t\tINSERT INTO \" . TABLE_PREFIX . \"setting\n\t\t\t(varname, grouptitle, value, defaultvalue, datatype, optioncode, displayorder,\n\t\t\tadvanced, volatile\" . (!defined('UPGRADE_COMPAT') ? ', validationcode, blacklist, product' : '') . \")\n\t\t\tVALUES\n\t\t\t\" . implode(\",\\n\\t\", $qBits));\n\t}\n\n\t// rebuild the $vbulletin->options array\n\tbuild_options();\n\n\t// stop the 'dots' counter feedback\n\tprint_dots_stop();\n\n}", "function _findManifest()\n\t{\n\t\t// Get an array of all the xml files from teh installation directory\n\t\t$xmlfiles = JFolder::files($this->getPath('source'), '.xml$', 1, true);\n\t\t// If at least one xml file exists\n\t\tif (!empty($xmlfiles)) {\n\t\t\tforeach ($xmlfiles as $file)\n\t\t\t{\n\t\t\t\t// Is it a valid joomla installation manifest file?\n\t\t\t\t$manifest = $this->_isManifest($file);\n\t\t\t\tif (!is_null($manifest)) {\n\n\t\t\t\t\t// If the root method attribute is set to upgrade, allow file overwrite\n\t\t\t\t\t$root =& $manifest->document;\n\t\t\t\t\tif ($root->attributes('method') == 'upgrade') {\n\t\t\t\t\t\t$this->_overwrite = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the manifest object and path\n\t\t\t\t\t$this->_manifest =& $manifest;\n\t\t\t\t\t$this->setPath('manifest', $file);\n\n\t\t\t\t\t// Set the installation source path to that of the manifest file\n\t\t\t\t\t$this->setPath('source', dirname($file));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// None of the xml files found were valid install files\n\t\t\tJError::raiseWarning(1, 'JInstaller::install: '.JText::_('ERRORNOTFINDJOOMLAXMLSETUPFILE'));\n\t\t\treturn false;\n\t\t} else {\n\t\t\t// No xml files were found in the install folder\n\t\t\tJError::raiseWarning(1, 'JInstaller::install: '.JText::_('ERRORXMLSETUP'));\n\t\t\treturn false;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write object data to XML format
public function write() { $this->init(); $this->xmldata = call_user_func($this->write_func, $this->obj); if (!$this->format_errors()) $this->update_uid(); else $this->xmldata = null; return $this->xmldata; }
[ "public static function objectToXml($data);", "function toXml() {\n $xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n $xml .= \"<object>\\n\";\n foreach ($this as $key=>$value) {\n $xml .= TransferObject::xmlNode($key, $value);\n }\n $xml .= \"</object>\\n\\n\";\n return $xml;\n }", "public function objToXML($obj) {\n\t\t$this->getObject2XML($this->xml, $obj);\n \n\t\t$this->xml->endElement();\n \n\t\treturn $this->xml->outputMemory(true);\n\t}", "public function toXML();", "public function objToXML($obj) {\r\n\t\t$this->getObject2XML($this->xml, $obj);\r\n \r\n\t\t$this->xml->endElement();\r\n \r\n\t\treturn $this->xml->outputMemory(true);\r\n\t}", "abstract public function toXML();", "public function toXML(){\n\t\t//todo\n\t}", "public function objToXML($obj) {\n $this->getObject2XML($this->xml, $obj);\n\n $this->xml->endElement();\n\n return $this->xml->outputMemory(true);\n }", "public function toXml();", "public function objectToXml(ArrayObject $obj): string\n {\n //====================================================================//\n // Convert Object to XML Recursively\n $this->objectToXmlCore(self::$xml, array(\"SPLASH\" => $obj));\n //====================================================================//\n // Put End Element on Xml\n self::$xml->endElement();\n\n //====================================================================//\n // Output Result\n return self::$xml->outputMemory(true);\n }", "public function build_record_xml($obj) {\n $data = $this->prep_for_serialization($obj);\n $xw = new xmlWriter();\n $xw->openMemory();\n foreach($data as $key => $value) {\n $xw->writeElement($key, $value);\n }\n $xml = $xw->outputMemory(true);\n unset($xw);\n return $xml;\n }", "function xml_encode($obj, $root_node = 'root', $data=false, $node=false, $depth=false, $parent=false) {\n if (!$data) {\n\t\t\t$xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\n\t\t\t$xml .= xml_encode(0,0,$obj, $root_node, $depth = 0);\n\t\t\treturn $xml;\n } else {\n\t $xml = str_repeat(\"\\t\", $depth);\n\t $xml .= \"<$node>\\n\";\n\t foreach($data as $key => $val) {\n\t if(is_array($val) || is_object($val)) {\n\t \t$key = substr($node, -1) == \"s\" ? substr($node, 0,-1) : $key;\n\t $xml .= xml_encode(0,0, $val, $key, ($depth + 1), $node);\n\t } else {\n\t $xml .= str_repeat(\"\\t\", ($depth + 1));\n\t $xml .= \"<$key>\" . htmlspecialchars($val) . \"</$key>\\n\";\n\t }\n\t }\n\t $xml .= str_repeat(\"\\t\", $depth);\n\t $xml .= \"</$node>\\n\";\n\t return $xml;\n }\n }", "public function write($xml);", "public static function xml_encode($object)\n\t\t{\n\t\t\t$output\t=\t'';\n\t\t\t\n\t\t\t// loop over our object and parse the values\n\t\t\tforeach($object as $key => $val)\n\t\t\t{\n\t\t\t\tif(is_array($val))\n\t\t\t\t{\n\t\t\t\t\t// we have an array\n\t\t\t\t\t\n\t\t\t\t\t// check if current item is a single object (has an id) \n\t\t\t\t\tif(array_key_exists('id', $val))\n\t\t\t\t\t{\n\t\t\t\t\t\t// we have an id, make sure we let the following code know\n\t\t\t\t\t\t$use_id\t\t=\ttrue;\n\t\t\t\t\t\t$id\t\t\t=\t$val['id'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($val['id']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// no id, just use the object as a normal item\n\t\t\t\t\t\t$use_id\t\t=\tfalse;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(is_numeric($key))\n\t\t\t\t\t{\n\t\t\t\t\t\t// we have an id'ed item (or a generic item in a numbered array), use our generic item name\n\t\t\t\t\t\t$output\t.=\t'<item'. ($use_id ? ' id=\"'. $id .'\"' : '') . '>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// no id, just use the key name as the item name\n\t\t\t\t\t\t$output\t.=\t'<' . $key . ($use_id ? ' id=\"'. $id .'\"' : '') . '>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// recursive call to format the array items\n\t\t\t\t\t$output\t.=\toutput::xml_encode($val);\n\t\t\t\t\t\n\t\t\t\t\t// close our tag\n\t\t\t\t\tif(is_numeric($key))\n\t\t\t\t\t{\n\t\t\t\t\t\t$output\t.=\t'</item>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// recursive call to excode the array\n\t\t\t\t\t\t$output\t.=\t'</' . $key .'>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// not an array, its just a key => value item. \n\t\t\t\t\t$output\t.=\t'<'. $key .'>';\n\t\t\t\t\t$output\t.=\t$val;\n\t\t\t\t\t$output\t.=\t'</'. $key .'>' . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function encodeObj($obj, $root_node = 'response') {\n $xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n $xml .= self::encode($obj, $root_node, $depth = 0);\n return $xml;\n }", "public function encodeObj($obj, $root_node = 'response') {\r\n\t\t$xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\r\n\t\t$xml .= self::encode($obj, $root_node, $depth = 0);\r\n\t\treturn $xml;\r\n\t}", "public function encodeObj($obj, $root_node = 'response') {\n $xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\n $xml .= self::encode($obj, $root_node, $depth = 0);\n return $xml;\n }", "function writeObjects($xmlObj,$depth=0) {\n\t\t\n\t\t$objectList = array(\n\t\t\n\t\t\t'project' => 'project',\n\t\t\t'event' => 'event',\n\t\t\t'training' => 'training',\n\t\t\t'service' => 'service',\n \t\t\t'tool' => 'tool',\n\t\t\t'tool-portrait' => 'toolportraiteto',\n\t\t\t'contact' => 'contact',\n\t\t\t'university-data' => 'university',\n\t\t\t'hs-contacts' => '##SUB##',\n\t\t);\n\t\t\n\t\n\t\tforeach($xmlObj->children() as $key => $child) {\n\t\t\t$name = $child->getName();\n\t\t\t$castName = $objectList[$name];\n\t\t\tif($castName == '##SUB##'){\n\t\t\t\t$this->writeObjects($child,$depth+1);\n\t\n\t\t\t}elseif($castName != ''){\n\t\t\t\t// echo str_repeat('-',$depth).\">\".$objectname.\": \".$child->title.\" \\n\\r\";\n\t\t\t\t\n\t\t\t\t$object = new $castName();\n\t\t\t\t$object->setProcessMode('import','');\n\t\t\t\t$object->setSyncId($this->syncId);\n\t\t\t\t$objectconf = $object->fields['import'];\n\t\t\t\t$data = $this->getObjectData($child,$objectconf);\n\n\t\t\t\tif($name == 'tool-portrait'){\n\t\t\t\t\t//TODO\n\n\t\t\t\t\t// echo \"XNU8\";\n\t\t\t\t\t// print_r($child);\n\t\t\t\t}\n\n\n\t\t\t\tif($this->isOwnObject($data['objectid'])){\n\t\t\t\t\t$object->setPid($this->conf['ownPid']);\n\t\t\t\t\t$objectSourceType = 'own';\n\t\t\t\t}else{\n\t\t\t\t\t$object->setPid($this->conf['etoPid']);\n\t\t\t\t\t$objectSourceType = 'eto';\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$object->importData = $data;\n\t\t\t\t$object->processImportFields();\n\t\t\t\t$objectId = $object->getImportFieldValue('objectid');\n\t\t\t\t\n\t\t\t\t$objectUid = $this->getUidByUuid($objectId,$object->objectTable);\n\t\t\t\t// echo \"OBJECT UID $objectUid \\n\\r\";\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$object->loadByUuid($objectId);\n\n\t\t\t\t\t// Check if import object has higher tstamp as current db object one\n\t\t\t\t\t// Only write Data if import object has a bigger tstamp for own data or is eto data - cause here i allways update the syncid and eto feed has\n\t\t\t\t\t// allways the current data.\n\n\t\t\t\t\tif(!$this->isOwnObject($objectId) || ($object->processedImportData['tstamp'] > $object->getFieldValue('tstamp')) ){\n\t\t\t\t\t\t$msg = \"\\n\".'Updating '.$objectSourceType.' object '.$castName.' with objectid '.$objectId.\"\\n\";\n\t\t\t\t\t\t$this->writeLog($msg,1);\t\n\t\t\t\t\t\t$object->setData($object->processedImportData,'update');\n\t\t\t\t\t\t$this->writeMMOptions($object);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}catch(Exception $ex){\n\t\t\t\t\t\n\t\t\t\t\t$msg = 'Inserting '.$objectSourceType.' object '.$castName.' with objectid '.$objectId;\n $this->writeLog($msg,1);\n\t\t\t\t\t$object->setData($object->processedImportData,'insert');\n\t\t\t\t\t$this->writeMMOptions($object);\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\tif($name != 'contact')\n \t\t\t\t$this->writeObjects($child,$depth+1);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t// echo \"$name NOT IN LIST\";\n\t\t\t\t\n\t\t\t}\n \t\t}\n\t}", "public function apiXmlWriter() {\n\t\t$this->openMemory();\n\t\t$this->setIndent(true);\n\t\t$this->setIndentString(self::XML_INDENT);\n\t\t$this->startDocument(self::XML_VERSION, self::XML_FORMAT);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the cum base gmp.
public function setCumBaseGmp(?float $cumBaseGmp): ListeEmployes { $this->cumBaseGmp = $cumBaseGmp; return $this; }
[ "public function setCumBaseGmp($cumBaseGmp) {\n $this->cumBaseGmp = $cumBaseGmp;\n return $this;\n }", "public function getCumBaseGmp(): ?float {\n return $this->cumBaseGmp;\n }", "public function setBaseGrandTotal($baseGrandTotal);", "public function set_base_multiplier($type, $value){\n $this->set_info('field_base_multipliers', $type, $value);\n $new_value = $this->get_info('field_base_multipliers', $type);\n if ($new_value > MMRPG_SETTINGS_MULTIPLIER_MAX){ $this->set_info('field_base_multipliers', $type, MMRPG_SETTINGS_MULTIPLIER_MAX); }\n elseif ($new_value < MMRPG_SETTINGS_MULTIPLIER_MIN){ $this->set_info('field_base_multipliers', $type, MMRPG_SETTINGS_MULTIPLIER_MIN); }\n }", "public function set_base_value( $value ) {\n\t\t$this->base_value = $value;\n\t\t$this->base_value_signed = $this->invert_credit_sign( $value );\n\t}", "public function init( $number, $base = 10 )\n {\n return gmp_init( $number, $base );\n }", "public function setBasePricePercent() : Calculator\n {\n $dateTime = new \\DateTime(date('Y-m-d H:i:s'));\n $day = $dateTime->format('l');\n $hour = $dateTime->format('H');\n //$day = 'Friday';\n //$hour = '17';\n $this->base_price_percent = ($day === 'Friday' && ($hour >= 15 && $hour <= 20)) ? 13 : 11;\n return $this;\n }", "public function setBaseGrandTotal($amount);", "public function set_base_price_operator( $operator ) {\n $this->set_prop( 'base_price_operator', $operator );\n }", "public function setCumBrutAl($cumBrutAl) {\n $this->cumBrutAl = $cumBrutAl;\n return $this;\n }", "public function getBaseGmp(): ?float {\n return $this->baseGmp;\n }", "public function setCumPlafondGmp(?float $cumPlafondGmp): Bulletins {\n $this->cumPlafondGmp = $cumPlafondGmp;\n return $this;\n }", "public function getCumPlafondGmp() {\n return $this->cumPlafondGmp;\n }", "public function setCumPlafondGmp($cumPlafondGmp) {\n $this->cumPlafondGmp = $cumPlafondGmp;\n return $this;\n }", "public function getGmp($base = null)\n {\n $gmp = gmp_init($this->getHex(), 16);\n\n if (null !== $base)\n return gmp_strval($gmp, (int) $base);\n\n return $gmp;\n }", "function reset_base($new_base_chance) {\n global $base_chance, $noitem_chance, $oneitem_chance;\n $base_chance = $new_base_chance;\n $noitem_chance = 1;\n $oneitem_chance = 0;\n}", "function setBase_maxima($base_maxima) {\r\n $this->base_maxima = $base_maxima;\r\n }", "public function setBaseToGlobalRate($rate);", "public function setBaseTotalQtyOrdered($baseTotalQtyOrdered);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set block that is from entry.
public function setBlock($index, $entryID, $blockID) { $this->app->loadLang('block'); $type = 'system'; $block = isset($this->config->personal->index->block->{'b' . $index}->value) ? json_decode($this->config->personal->index->block->{'b' . $index}->value) : array(); $entry = $this->entry->getById($entryID); $this->view->params = $this->entry->getBlockParams($entry, $blockID); $this->view->block = ($block and $block->type == $type) ? $block : array(); $this->view->index = $index; $this->view->type = $type; $this->view->blockID = $blockID; $this->view->entryID = $entryID; $this->display(); }
[ "public function setBlock($block) {\n $this->block = $block;\n }", "public function setFromBlock(Block $block) {\r\n $this->X = $block->x;\r\n $this->Z = $block->z;\r\n }", "public function setBlock($block) : Field {\n // remember the block\n $this->block = $block;\n // return the block for chained method calling\n return $this;\n }", "private function setBlock($parent, $block) {\n\t\t$name = \"B_\".$block;\n\t\t$str = $this->getVar($parent);\n\t\tif($this->accurate){\n\t\t\t$str = str_replace(\"\\r\\n\", \"\\n\", $str);\n\t\t\t$reg = \"/\\t*<!--\\s*BEGIN\\s+$block\\s+-->\\n*(\\s*.*?\\n?)\\t*<!--\\s+END\\s+$block\\s*-->\\n?/sm\";\n\t\t} \n\t\telse $reg = \"/<!--\\s*BEGIN\\s+$block\\s+-->\\s*(\\s*.*?\\s*)<!--\\s+END\\s+$block\\s*-->\\s*/sm\";\n\t\tif(1!==preg_match($reg, $str, $m)) throw new UnexpectedValueException(\"bloco $block está mal formado\");\n\t\t$this->setValue($name, '');\n\t\t$this->setValue($block, $m[1]);\n\t\t$this->setValue($parent, preg_replace($reg, \"{\".$name.\"}\", $str));\n\t}", "public function setBlock($name, $value){\n $block['Name'] = $name;\n $block['Value'] = $value;\n array_push($this->Block,$block);\n }", "private function setBlockPosition($node){\n \n $position = $node->field_position->value;\n \n if($position && isset($this->positions[$position])){\n if(!isset($this->blockpositions[$position]))\n $this->blockpositions[$position] = [];\n \n $this->blockpositions[$position][] = $node;\n \n }\n }", "public function setBlockToRender (Block $block);", "function setBlockOverride($block, $custom_tag)\n {\n $this->block_override[$block] = $custom_tag;\n }", "public function setBlock(DerivationType $value): void\n {\n $this->blockAttr = $value;\n }", "public function setBlockId($block_id);", "public function setEntry($entry);", "function resetBlockOverride($block)\n {\n unset($this->block_override[$block]);\n }", "public function setBlock(array $configuration);", "public function set_parent_block() {\n\n\t\t$id = $_POST['id'];\n\t\t$document = $_POST['document'];\n\t\t$parent_layout = $_POST['parent_layout'];\n\t\t$parent_region = $_POST['parent_region'];\n\n\t\t$block = Cortex::get_block($document, $id);\n\n\t\tif ($block == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tCortex::set_parent_block($document, $block, $parent_layout, $parent_region);\n\t\texit;\n\t}", "function setHeaderBlock($blockName)\n {\n $this->_headerBlock = $blockName;\n }", "private function setBlockList()\n {\n $pattern = \"|(<!-- Start (?P<blockName>[\\w\\d]+) -->)(?P<blockElements>.*?)(<!-- End \\\\2 -->)|ismU\";\n preg_match_all($pattern, $this->getFile(), $matches);\n for ($i = 0; $i < count($matches[0]); $i++) {\n // Example : for <!-- Start Content --> block, return $this->blocks['Content'] = \"<p>Hello world !</p>\";\n $this->blockList[$matches['blockName'][$i]] = trim($matches['blockElements'][$i]);\n // and replace Content block by [Content] flag in the file.\n $this->setFile(str_replace($matches[0][$i], \"[\" . $matches['blockName'][$i]. \"]\", $this->getFile()));\n }\n }", "function setBlock($blockid = 0)\n {\n include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';\n if ($blockid == 0) {\n $this->block = new XoopsBlock($this->getVar('blockid'));\n $this->block->assignVar('options', $this->getVar('options', 'n'));\n $this->block->assignVar('title', $this->getVar('title', 'n'));\n } else {\n $this->block = new XoopsBlock($blockid);\n $this->block->assignVar('options', $this->block->getVar('options', 'n'));\n $this->block->assignVar('title', $this->block->getVar('title', 'n'));\n }\n }", "public function setNetblock($val)\n {\n $this->_propDict[\"netblock\"] = $val;\n return $this;\n }", "public function tagBlock(Block $block): void;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the sync_page column Example usage: $query>filterBySyncPage(1234); // WHERE sync_page = 1234 $query>filterBySyncPage(array(12, 34)); // WHERE sync_page IN (12, 34) $query>filterBySyncPage(array('min' => 12)); // WHERE sync_page >= 12 $query>filterBySyncPage(array('max' => 12)); // WHERE sync_page
public function filterBySyncPage($syncPage = null, $comparison = null) { if (is_array($syncPage)) { $useMinMax = false; if (isset($syncPage['min'])) { $this->addUsingAlias(TableSyncLogPeer::SYNC_PAGE, $syncPage['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($syncPage['max'])) { $this->addUsingAlias(TableSyncLogPeer::SYNC_PAGE, $syncPage['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(TableSyncLogPeer::SYNC_PAGE, $syncPage, $comparison); }
[ "public function addInCmsPageFilter()\n {\n return $this->getSelect()->where('main_table.in_cms_page = 1');\n }", "public function filterByBeginSync($beginSync = null, $comparison = null)\n {\n if (is_array($beginSync)) {\n $useMinMax = false;\n if (isset($beginSync['min'])) {\n $this->addUsingAlias(TableSyncLogPeer::BEGIN_SYNC, $beginSync['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($beginSync['max'])) {\n $this->addUsingAlias(TableSyncLogPeer::BEGIN_SYNC, $beginSync['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TableSyncLogPeer::BEGIN_SYNC, $beginSync, $comparison);\n }", "public function filterBySyncStatus($syncStatus = null, $comparison = null)\n {\n if (is_array($syncStatus)) {\n $useMinMax = false;\n if (isset($syncStatus['min'])) {\n $this->addUsingAlias(SyncPrimerPeer::SYNC_STATUS, $syncStatus['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($syncStatus['max'])) {\n $this->addUsingAlias(SyncPrimerPeer::SYNC_STATUS, $syncStatus['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SyncPrimerPeer::SYNC_STATUS, $syncStatus, $comparison);\n }", "public function addPageFilter($page) {\n\t\t $this->getSelect()->where('FIND_IN_SET('.$page.',main_table.page_id)');\n return $this;\n }", "function filterInt($field, $value) {\n if (($value = ltrim($value, '=')) !== '') {\n switch ($value[0]) {\n case '>': $this->where($field, '>', (int) substr($value, 1)); break;\n case '<': $this->where($field, '<', (int) substr($value, 1)); break;\n case '!': $this->where($field, '<>', (int) substr($value, 1)); break;\n default: $this->where($field, '=', (int) $value); break;\n }\n }\n }", "protected function _paginationFilter() {\n\t\t$conditions = array_filter($this->request->query, function($var) {\n\t\t\treturn $var !== '';\n\t\t});\n\t\tunset($conditions['url']);\n\t\tforeach (array('created') as $dateRangeField) {\n\t\t\tif (empty($conditions[$dateRangeField])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (preg_match('/^(?P<start>.*)\\s(-|to)\\s(?P<end>.*)$/is', $conditions[$dateRangeField], $range)) {\n\t\t\t\t$conditions[$this->Audit->alias . '.' . $dateRangeField . ' BETWEEN ? AND ?'] = array(\n\t\t\t\t\t(new DateTime($range['start']))->format('Y-m-d H:i:s'),\n\t\t\t\t\t(new DateTime($range['end']))->format('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t} elseif (strpos($conditions[$dateRangeField], ' ') !== false) {\n\t\t\t\t$conditions[$this->Audit->alias . '.' . $dateRangeField] = (new DateTime($conditions[$dateRangeField]))->format('Y-m-d H:i:s');\n\t\t\t} else {\n\t\t\t\t$conditions[$this->Audit->alias . '.' . $dateRangeField . ' BETWEEN ? AND ?'] = array(\n\t\t\t\t\t(new DateTime($conditions[$dateRangeField]))->format('Y-m-d 00:00:00'),\n\t\t\t\t\t(new DateTime($conditions[$dateRangeField]))->format('Y-m-d 23:59:59')\n\t\t\t\t);\n\t\t\t}\n\t\t\tunset($conditions[$dateRangeField]);\n\t\t}\n\n\t\tif (!empty($conditions['model'])) {\n\t\t\t$conditions['LOWER(' . $this->Audit->alias . '.model) LIKE'] = \"%\" . mb_strtolower($conditions['model']) . \"%\";\n\t\t}\n\t\tunset($conditions['model']);\n\n\t\tif (!empty($conditions['id'])) {\n\t\t\t$conditions[$this->Audit->alias . '.id'] = $conditions['id'];\n\t\t}\n\t\tunset($conditions['id']);\n\t\tunset($conditions['list']);\n\t\tunset($conditions['count']);\n\n\t\treturn $conditions;\n\t}", "function ccs_custom_page_filter($query) {\n /**\n * If we're not in the admin, and this isn't the main query, then return, as\n * it's impossible the query will match the one we're looking for\n */\n if ( !is_admin() && !$query->is_main_query() ) {\n return;\n }\n\n /**\n * Exclude Marketing Pages\n */\n if( !empty(get_query_var('content_pages')) ) {\n $excludeIds = [17779];\n $excludePages = get_pages(['child_of' => 17779]);\n foreach ($excludePages as $page) {\n $excludeIds[] = $page->ID;\n }\n\n $query->set( 'post__not_in', $excludeIds );\n }\n\n /**\n * Only show marketing pages\n */\n if( !empty(get_query_var('marketing_pages')) ) {\n $includeIds = [17779];\n $includePages = get_pages(['child_of' => 17779]);\n foreach ($includePages as $page) {\n $includeIds[] = $page->ID;\n }\n\n $query->set( 'post__in', $includeIds );\n }\n}", "protected function filter($c)\n {\n //FROM UNTIL SET (SERIAL_TYPE -> SERIAL)\n if ($this->hasRequestParameter('from')){ //ver que es YYYY-mm-dd\n $criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('from'), Criteria::GREATER_EQUAL);\n }\n \n if ($this->hasRequestParameter('until')){ //ver que es YYYY-mm-dd\n if (isset($criterion)){\n\t$criterion->addAnd($c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL));\n }else{\n\t$criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL);\n }\n }\n \n if (isset($criterion)){\n $c->add($criterion);\n }\n\n if($this->hasRequestParameter('set')&&(is_int($this->getRequestParameter('set')))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n }\n\n\n if(($this->hasRequestParameter('set'))&&($ret = strstr($this->getRequestParameter('set'), ':('))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n\n $c->add(MmPeer::SERIAL_ID, intval(substr($ret, 2))); \n }\n\n }", "public function paginateFilters();", "public function filterBySyncMedia($syncMedia = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($syncMedia)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $syncMedia)) {\n $syncMedia = str_replace('*', '%', $syncMedia);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TableSyncLogPeer::SYNC_MEDIA, $syncMedia, $comparison);\n }", "public function filter(string $column, int $value)\n {\n $perPage = 3;\n $operator = '<=';\n if ($column == \"age_limit\") {\n if ($value == 0) {\n $operator = '>=';\n }\n return $this->blogRepositoryInterface->filter($column, $operator, $value, $perPage);\n }\n if ($value != 2) {\n $operator = '=';\n }\n return $this->blogRepositoryInterface->filter($column, $operator, $value, $perPage);\n }", "public function scopeFilteredByString($query, $page, $column, $value){\n return self::where($column, \"like\", \"%$value%\")\n ->orderBy(\"created_at\", \"desc\")\n ->offset(self::PER_PAGE * ($page - 1))\n ->limit(self::PER_PAGE);\n }", "public function addPageFilter($page)\n\t{\n\t\tif ($page instanceof Mage_Cms_Model_Page) {\n\t\t\t$page = $page->getId();\n\t\t}\n\n\t\tif (is_array($page)) {\n\t\t\t$page = array('in' => $page);\n\t\t}\n\n\t\t$this->addFieldToFilter('page_id', $page);\n\t\treturn $this;\n\t}", "public function range_filter($field, $values)\n {\n $values = collect($values);\n\n if ( $values->get('min', false) && $values->get('max', false) )\n return $this->whereBetween($field, [ $values->get('min'), $values->get('max') ]);\n\n elseif ( $values->get('min', false) )\n return $this->where($field, '>=', $values->get('min') );\n\n elseif ( $values->get('max', false) )\n return $this->where($field, '<=', $values->get('max') );\n }", "public function actionFilterTable()\n {\n //get all params from post(or get)\n $client_name = Yii::app()->request->getParam('cli_name', '');\n $client_type_id = Yii::app()->request->getParam('cli_type_id',null);\n $invoice_code = Yii::app()->request->getParam('in_code','');\n $operation_status_id = Yii::app()->request->getParam('in_status_id','');\n $stock_city_id = Yii::app()->request->getParam('stock_city_id','');\n $date_from_str = Yii::app()->request->getParam('date_from_str','');\n $date_to_str = Yii::app()->request->getParam('date_to_str','');\n $page = Yii::app()->request->getParam('page',1);\n $on_page = Yii::app()->request->getParam('on_page',3);\n\n //date range by default\n $time_from = 0;\n $time_to = time() + (60 * 60 * 24);\n\n //criteria\n $c = new CDbCriteria();\n\n //if client name not empty\n if(!empty($client_name))\n {\n if(!empty($client_type_id))\n {\n //if not company (physical person)\n if($client_type_id != 1)\n {\n $names = explode(\" \",$client_name,2);\n if(count($names) > 1)\n {\n $c -> addCondition('client.name LIKE \"%'.$names[0].'%\" AND client.surname LIKE \"%'.$names[1].'%\"');\n }\n else\n {\n $c -> addCondition('client.name LIKE \"%'.$client_name.'%\"');\n }\n }\n\n //if company\n else\n {\n $c -> addCondition('client.company_name LIKE \"%'.$client_name.'%\"');\n }\n }\n else\n {\n $names = explode(\" \",$client_name,2);\n if(count($names) > 1)\n {\n $c -> addCondition('client.name LIKE \"%'.$names[0].'%\" AND client.surname LIKE \"%'.$names[1].'%\" OR client.company_name LIKE \"%'.$client_name.'%\"');\n }\n else\n {\n $c -> addCondition('client.name LIKE \"%'.$client_name.'%\" OR client.company_name LIKE \"%'.$client_name.'%\"');\n }\n }\n }\n elseif(!empty($client_type_id))\n {\n $c -> addCondition('client.type = '.$client_type_id.'');\n }\n\n if(!empty($stock_city_id))\n {\n $c -> addCondition('stock.location_id = '.$stock_city_id.'');\n }\n\n //if given dates\n if(!empty($date_from_str))\n {\n $dt = DateTime::createFromFormat('m/d/Y',$date_from_str);\n $time_from = $dt->getTimestamp();\n }\n if(!empty($date_to_str))\n {\n $dt = DateTime::createFromFormat('m/d/Y',$date_to_str);\n $time_to = $dt->getTimestamp();\n $time_to += (60*60*24); //add one day\n }\n\n //if invoice code set\n if(!empty($invoice_code))\n {\n $c -> addInCondition('invoice_code',array($invoice_code));\n }\n\n //if operation status set\n if(!empty($operation_status_id))\n {\n $c -> addInCondition('status_id',array($operation_status_id));\n }\n\n //search between times\n $c -> addBetweenCondition('date_created_ops',$time_from,$time_to);\n\n //get all items by conditions and limit them by criteria\n $operations = OperationsOut::model()->with(array('client','stock.location'))->findAll($c);\n\n $pagination = new CPagerComponent($operations,$on_page,$page);\n\n //render partial\n $this->renderPartial('_ajax_table_filtering',array('pager' => $pagination));\n\n }", "public function filterByLastSync($lastSync = null, $comparison = null)\n {\n if (is_array($lastSync)) {\n $useMinMax = false;\n if (isset($lastSync['min'])) {\n $this->addUsingAlias(AplikasiPeer::LAST_SYNC, $lastSync['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastSync['max'])) {\n $this->addUsingAlias(AplikasiPeer::LAST_SYNC, $lastSync['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AplikasiPeer::LAST_SYNC, $lastSync, $comparison);\n }", "public function filterBySyncKet($syncKet = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($syncKet)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $syncKet)) {\n $syncKet = str_replace('*', '%', $syncKet);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SyncPrimerPeer::SYNC_KET, $syncKet, $comparison);\n }", "public function filterByLastSync($lastSync = null, $comparison = null)\n {\n if (is_array($lastSync)) {\n $useMinMax = false;\n if (isset($lastSync['min'])) {\n $this->addUsingAlias(WsAplikasiPeer::LAST_SYNC, $lastSync['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastSync['max'])) {\n $this->addUsingAlias(WsAplikasiPeer::LAST_SYNC, $lastSync['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(WsAplikasiPeer::LAST_SYNC, $lastSync, $comparison);\n }", "function paginate($row,$page=0,$condition=array('1' => '1'),$field=null){\n\t\t\t$offset = $page*$row;\n\t\t\t$this->page_num = ceil($this->getRowsNumber()/ $row);\n\t\t\treturn $this->getWhere($condition,$field,$row,$offset);\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse a HTML string, clean up footnotes prior
public function parseString($html) { /** TODO: custom markdown-extra options, e.g. titles & classes **/ # <sup id="fnref:..."><a href"#fn..." rel="footnote">...</a></sup> # => <fnref target="..." /> $html = preg_replace('@<sup id="fnref:([^"]+)">\s*<a href="#fn:\1" rel="footnote">\s*\d+\s*</a>\s*</sup>@Us', '<fnref target="$1" />', $html); # <div class="footnotes"> # <hr /> # <ol> # # <li id="fn:...">...</li> # ... # # </ol> # </div> # => # <footnotes> # <fn name="...">...</fn> # ... # </footnotes> $html = preg_replace_callback('#<div class="footnotes">\s*<hr />\s*<ol>\s*(.+)\s*</ol>\s*</div>#Us', array(&$this, '_makeFootnotes'), $html); return parent::parseString($html); }
[ "private function _parseHTML()\r\n {\r\n $this->_tidyHTML();\r\n $this->_domHTML = new \\DOMDocument();\r\n $this->_domHTML->preserveWhiteSpace = false;\r\n //the following option tries to recover poorly formed documents\r\n $this->_domHTML->recover = true;\r\n $this->_domHTML->preserveWhiteSpace = true;\r\n $this->_domHTML->formatOutput = false;\r\n $this->_domHTML->loadXML($this->_html);\r\n //if titles are to be in uppercase we have to preparse the HTML string\r\n if ($this->_titles == 'uppercase') {\r\n $this->_str = $this->_titlesToUppercase();\r\n }\r\n $root = $this->_domHTML->documentElement;\r\n $this->_parseHTMLNode($root);\r\n }", "abstract public function parse(string &$html): string;", "function parse_html($html)\n {\n return HtmlDomParser::str_get_html($html);\n }", "public function parse($html);", "function parseAndCleanHtml($html) {\n $input = str_split($html);\n $result = '';\n \n $prev_char;\n foreach($input as $c) {\n if($c == '\t' || $c == \"\\n\") $c = ' '; //treat tabs, newlines as single whitespaces\n if($c == \"\\r\") continue; //skip \\r - windows-specific humbug\n if($c == '\"') $c = \"'\";\n \n switch($c) {\n case(' '):\n if($prev_char !== ' ') {\n $result .= ' ';\n }\n $prev_char = ' ';\n break;\n default:\n $result .= $c;\n $prev_char = $c;\n break;\n }\n }\n \n return $result;\n}", "public function parse()\n {\n// $page = preg_replace('{<script>.*?</script>}i', '<script></script>', $page);\n// $page = preg_replace('{<style>.*?</style>}i', '<style></style>', $page);\n// $page = preg_replace(\"{\\r|\\n}\", ' ', $page);\n $matches = [];\n preg_match_all(self::PATTERN, $this->html, $matches);\n $this->tags = $matches[1];\n foreach ($this->tags as &$tag) {\n $tag = strtolower($tag);\n }\n }", "public function clean(&$html);", "protected function DOM_finish_footnotes() {\r\n\t\t//<a href=\"#note\" name=\"footnote\" title=\"Link to note \" id=\"footnote\">\r\n\t\t//<a name=\"note\" id=\"note\" href=\"#footnote\" title=\"Link to footnote \">\r\n\t\t// (2011-06-27) the name attribute is deprecated\r\n\t\t//<a href=\"#note\" title=\"Link to note \" id=\"footnote\">\r\n\t\t//<a id=\"note\" href=\"#footnote\" title=\"Link to footnote \">\r\n\t\t$query1 = '//' . ReTidy::get_html_namespace() . 'a[@href=\"#note\"][@name=\"footnote\"] | //' . ReTidy::get_html_namespace() . 'a[@href=\"#note\"][@title=\"Link to note \"] | //' . ReTidy::get_html_namespace() . 'a[@href=\"#note\"][@id=\"footnote\"]';\r\n\t\t$query2 = '//' . ReTidy::get_html_namespace() . 'a[@href=\"#footnote\"][@name=\"note\"] | //' . ReTidy::get_html_namespace() . 'a[@href=\"#footnote\"][@title=\"Link to footnote \"] | //' . ReTidy::get_html_namespace() . 'a[@href=\"#footnote\"][@id=\"note\"]';\r\n\t\t\r\n\t\t$footnotes = $this->xpath->query($query1);\r\n\t\t$notes = $this->xpath->query($query2);\r\n\t\tforeach($footnotes as $footnote) {\r\n\t\t\t$tagless = ReTidy::tagless($footnote);\r\n\t\t\tforeach($footnote->attributes as $attribute) {\r\n\t\t\t\t$attribute->nodeValue .= $tagless;\r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach($notes as $note) {\r\n\t\t\t$tagless = ReTidy::tagless($note);\r\n\t\t\tforeach($note->attributes as $attribute) {\r\n\t\t\t\t$attribute->nodeValue .= $tagless;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public static function parseHtml($text){\n\n // Replace UTF-8 nbsp; with normal space\n $text = str_replace(\"\\xc2\\xa0\", ' ', $text);\n\n // Replace boldface with \\textbb{\n $text = preg_replace(\"/\\<b\\b[^\\>]*\\>|\\<strong\\b[^\\>]*\\>/smui\", \"\\\\textbf{\", $text);\n\n // Replace boldface with \\textbb{\n $text = preg_replace(\"/\\<em\\b[^\\>]*\\>/smui\", \"\\\\textit{\", $text);\n\n // Replace underline with \\textbb{\n $text = preg_replace(\"/\\<u\\b[^\\>]*\\>/smui\", \"\\\\underline{\", $text);\n\n // Replace superscript with \\textsuperscript{\n $text = preg_replace(\"/\\<sup\\b[^\\>]*\\>/smui\", \"\\\\textsuperscript{\", $text);\n\n // Replace subscript with \\textsubscript{\n // -( needs fixltx2e package )-\n $text = preg_replace(\"/\\<sub\\b[^\\>]*\\>/smui\", \"\\\\textsubscript{\", $text);\n\n // Replace end of boldface/underline/italic with }\n $text = preg_replace(\"/(\\s*)(\\<\\/b\\b[^\\>]*\\>|\\<\\/strong\\b[^\\>]*\\>|\\<\\/em\\b[^\\>]*\\>|\\<\\/u\\b[^\\>]*\\>|\\<\\/sup\\b[^\\>]*\\>|\\<\\/sub\\b[^\\>]*\\>)(([^a-z\\\\\\<]?)|([a-z]))/smui\", '}$4 $5', $text);\n\n // Replace ol with enumerate\n $text = preg_replace(\"/\\<ol\\b[^\\>]*\\>/smui\", \"\\\\begin{enumerate}\", $text);\n $text = preg_replace(\"/\\<\\/ol\\b[^\\>]*\\>/smui\", \"\\\\end{enumerate}\", $text);\n\n // Replace ul with itemize\n $text = preg_replace(\"/\\<ul\\b[^\\>]*\\>/smui\", \"\\\\begin{itemize}\", $text);\n $text = preg_replace(\"/\\<\\/ul\\b[^\\>]*\\>/smui\", \"\\\\end{itemize}\", $text);\n\n // Replace li with /item\n $text = preg_replace(\"/\\<li\\b[^\\>]*\\>/smui\", \"\\\\item \", $text);\n $text = preg_replace(\"/\\<\\/li\\b[^\\>]*\\>/smui\", \" \", $text);\n\n // Replace link with url{} by removing a tags\n $text = preg_replace(\"/\\<a\\b[^\\>]*\\>/smui\", \"\", $text);\n $text = preg_replace(\"/\\<\\/a\\b[^\\>]*\\>/smui\", \"\", $text);\n $text = preg_replace(\"/(https?:\\/\\/)?([\\da-z\\.-]+)(\\.|@)([a-z\\.]{2,6})([\\/\\w\\.-]*[\\/\\w-])*\\/?/smui\", '\\\\url{$0}', $text);\n\n // Remove paragraphs and replace the closing tag with a simple \\n\n $text = preg_replace(\"/\\<p\\b[^\\>]*\\>/smui\", \"\", $text);\n $text = preg_replace(\"/\\<\\s*\\/p\\b[^\\>]*\\>/smui\", \"\\n\", $text);\n\n return $text;\n }", "function clean_html($html)\n {\n // Strip comments\n $html = preg_replace('/\\<\\!--(.*?)--\\>/su', '', $html);\n // Convert b to strong and i to em\n $html = preg_replace('/(\\<\\/?)i(\\s+|\\>)/su', '$1em$2', $html);\n $html = preg_replace('/(\\<\\/?)b(\\s+|\\>)/su', '$1strong$2', $html);\n // Strip unwanted tags\n $html = strip_tags($html, '<strong><em><u><p><br><a><ul><ol><li><img>');\n // Strip style attributes\n return preg_replace('/(\\<[^>]+)\\sstyle\\=\"[^\"]*\"([^>]*\\>)/su', '$1$2', $html);\n }", "function fnCleanUpDescription($html){\r\n\t\t$ret = $html;\r\n\t\t$ret = strip_tags($ret);\r\n\t\treturn $ret;\r\n\t}", "static function cleanUpHTML($text) {\n\t\tif (class_exists('tidy')) {\n\t\t\t$tidy = new tidy();\n\t\t\t$text = $tidy->repairString($text, array('show-body-only'=>true, 'output-xhtml'=>true, 'wrap' =>false), 'utf8');\n\t\t}\n\t\telseif (class_exists('DOMDocument')) {\n\t\t\t$text = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>'.$text.'</body>';\n\t\t\t$doc = new DOMDocument();\n\t\t\t@$doc->loadHTML($text);\n\t\t\t$text = $doc->saveHTML();\n\n $text = preg_replace(array(\"/^\\<\\!DOCTYPE.*?<html>.*<body>/si\",\n \"!</body></html>$!si\"),\n \"\",\n $text);\n\t\t\t/*\n\t\t\t * // ##mygruz20170705141551\n\t\t\t * Commented out this way, as it converts HTML to HTML entities\n\t\t\tif (!class_exists('SmartDOMDocument')) { require_once (dirname(__FILE__).'/SmartDOMDocument.php'); }\n\t\t\t$doc = new SmartDOMDocument();\n\t\t\t$doc->loadHTML($text);\n\t\t\t$text = $doc->saveHTMLExact();\n\t\t\t*/\n\t\t}\n\t\telse {\n\t\t\tif (!function_exists('htmLawed')) { require_once (dirname(__FILE__).'/htmLawed.php'); }\n\t\t\t$text = preg_replace('/<[^>]*$/ui', '', $text);\n\t\t\t$text = htmLawed($text);\n\t\t}\n\n\t\treturn $text;\n\t}", "abstract public function parse(string &$markdown): string;", "function buffaloNewsEventParser($html){\r\n \r\n $html=file_get_html($html);//gets filecontents from passed in URL\r\n \r\n $priceCheck = $catCheck = FALSE;//true false checks needed as price and cat info are not formatted the same on each page\r\n $extractPrice = $extractCat = $extract =\"\";\r\n\r\n foreach ($html->find('p.special-p') as $a){//iterates through html\r\n\r\n $data = $a->plaintext.' ';//all the text inside p tags is now in data\r\n\r\n//finds price\r\n if($priceCheck == FALSE){\r\n $price = strstr($data, 'Price:');\r\n if($price != \"\"){\r\n $extractPrice = substr($price, strpos($price, \":\") + 1); \r\n $priceCheck = TRUE;\r\n }\r\n }\r\n//finds category\r\n if($catCheck ==FALSE){\r\n $category = strstr($data, 'Category:');\r\n if($category != \"\"){\r\n $extractCat = substr($category, strpos($category, \":\") + 1);\r\n $extractCat = strtolower($extractCat); \r\n $catCheck = TRUE;\r\n }\r\n }\r\n\r\n }\r\n $extract = $extractCat . '|' . $extractPrice; //concatenates with | delimeter to be exploded\r\n //echo $extract;\r\n\r\n return $extract;\r\n}", "function parseHtml ($html) {\n $doc = new DOMDocument();\n @$doc->loadHTML($html);\n $ret = array();\n\n $ret['creator'] = $this->usr->parseProfileHeader($doc);\n\n // TODO: I guess I could look at the actual page instea of guessing?\n //$ret['src'];\n $ret['content'] = $this->usr->doXPathQuery('//span[contains(@class, \"caption\")]', $doc)->item(0);\n $ret['dt_published'] = $doc->getElementById('picture')->getElementsByTagName('time')->item(0)->attributes->getNamedItem('datetime')->value;\n\n $ret['comments'] = $this->usr->parseComments($doc);\n\n return $ret;\n }", "function F_parseContent($input, $parselevel) {\n\n global $syntax;\n //abort out on simple cases\n if ($parselevel == 0) {\n return stripslashes($input);\n }\n if ($parselevel == 5) {\n return htmlspecialchars(stripslashes($input));\n }\n\n $htmlOut = \"\";\n\n $strings = explode(\"\\n\",$input);\n $lines = count($strings);\n\n for ($i=0; $i<$lines; $i++) {\n\n //working memory...add spaces to string ends to make regexps easier\n $ostring = \" \".trim($strings[$i]).\" \\n\";\n // print \"pristine |$ostring|\\n\\n\";\n\n //find tags we recognize with this parselevel and subst them to\n //<tag> ===> [tag]\n //and then subst the rest < --> &lt; > --> &gt;\n if ($parselevel == 2) {\n reset($syntax);\n $k = current($syntax);\n while ($k) {\n $k = key($syntax);\n $htmlk = \"<(\" . $k . \")>\"; //construct the html key\n $ostring = eregi_replace($htmlk,\"[\\\\1]\",$ostring);\n $k = next($syntax);\n }\n $ostring = htmlspecialchars($ostring);\n }\n\n// print \"ps|$ostring|sp\\n\\n\";\n\n //interpret tags for parse levels 1 and 2\n if ($parselevel <= 2) {\n reset($syntax);\n $k = current($syntax);\n while ($k) {\n $k = key($syntax);\n $v = $syntax[$k];\n\n $bracketk = \"\\[\" . $k . \"\\]\";\n $ostring = eregi_replace($bracketk,$v,$ostring);\n\n $bracketk = \"<\" . $k . \">\";\n $ostring = eregi_replace($bracketk,$v,$ostring);\n\n $k = next($syntax);\n }\n }\n \n //for level 3,4, start with htmlspecialchars\n if ($parselevel >= 3) {\n $ostring = htmlspecialchars($ostring);\n }\n\n\n //do in-lining of http://xxx.xxx to link, xxx@xxx.xxx to email\n if ($parselevel < 4) {\n //mailto\n $ostring = eregi_replace(\"([ ]+)([[:alnum:]\\.\\-]+\\@[[:alnum:]\\-]+\\.[\\.[:alnum:]]+)([^\\.[:alnum:]])\",\"\\\\1<a href=\\\"mailto:\\\\2\\\">\\\\2</A>\\\\3\", $ostring);\n\n //urls\n $ostring = eregi_replace(\"([ ]+)((http|https|ftp)\\:\\/\\/[[:alnum:]\\-]+\\.[[:alnum:]\\-]+[^[:space:]]*)([ ]+)\",\"\\\\1<a target=_blank href=\\\"\\\\2\\\">\\\\2</A>\\\\4\", $ostring);\n }\n\n //do the blank-line ---> <P> substitution.\n //everybody gets this; if you don't want even that, just save\n //the htmlspecialchars() version of the input\n if (strlen(trim($strings[$i]))==0) {\n $ostring = \"<p>\";\n }\n\n if ($parselevel > 1) {\n $htmlOut = $htmlOut . trim($ostring) . \"<br>\\n\";\n } else {\n $htmlOut = $htmlOut . trim($ostring) . \"\\n\";\n }\n\n }\n\n return stripslashes($htmlOut);\n}", "function html_to_quickhtml(string $htmltext) {\n $acceptabletags = '<br><p><iframe><table><thead><tbody><tfoot><tr><th><td><b><i><u><ol><ul><li>';\n $convertedtext = strip_tags($htmltext, $acceptabletags);\n return $convertedtext;\n }", "function parse_txtLInk_from_html($buffer)\n {\n\n $regexp = \"<a\\s[^>]*href=(\\\"??)([^\\\" >]*?)\\\\1[^>]*>(.*)<\\/a>\";\n if(preg_match_all(\"/$regexp/siU\", $buffer, $matches))\n {\n// $ret=implode('\\n',$matches[3]);\n $ret=array();\n foreach($matches[3] as $match)\n {\n $match=parse_txtBody_from_html($match);\n $ret[]=$match;\n }\n return $ret;\n }\n return null;\n }", "public function parseHtmlDom( simple_html_dom $html ) {\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send a message to all connections.
public function sendAll($message) { foreach ($this->connections as $id => $client) { $client['conn']->send($message); } }
[ "public function sendAll($message)\n {\n foreach ($this->connections as $connection) {\n $connection->send($message);\n }\n }", "public function sendAllMessages(): void\n {\n $this->acquireLock();\n $messages = $this->entityManager->getRepository(Message::class)->getAllMessageToSend();\n foreach ($messages as $message) {\n $this->sendMessage($message);\n }\n }", "private function sendMessageToAll($message)\n {\n foreach ($this->clients as $client) {\n $client->send(json_encode($message));\n }\n }", "public function send()\n {\n if($this->sockets && $this->users)\n {\n $userMessages = $this->getMessages();\n\n $idList = array();\n foreach($userMessages as $user => $messages)\n {\n /* Find client socket and send messages. */\n $strClient = array_search($user, $this->users);\n if($strClient)\n {\n $client = $this->sockets[$strClient];\n foreach($messages as $message)\n {\n unset($message->level);\n unset($message->user);\n $message->id = (int)$message->id;\n $message->data = json_decode($message->data);\n }\n $result = socket_write($client, helper::removeUTF8Bom(json_encode($messages)) . $this->eof);\n if($result === false)\n {\n $errorCode = socket_last_error($client);\n $error = socket_strerror($errorCode);\n $this->log($error, __FILE__, __LINE__);\n }\n else\n {\n foreach($messages as $message) $idList[] = $message->id;\n }\n }\n }\n /* Delete the sent messages. */\n $this->deleteMessages($idList);\n }\n }", "public function sendAllFromQueue();", "public function sendMessagesAll($sendSettings);", "public function sendToAll($data)\n {\n $collected = array();\n foreach ($this->clients as $client) {\n $collected[] = $client->send($data);\n }\n return $collected;\n }", "protected function sendUsers($data)\n {\n $msg = Json::encode($data);\n\n foreach ($this->userConnections as $userConnections) {\n if (is_array($userConnections)) {\n /** @var Connection[] $userConnections */\n foreach ($userConnections as $connection) {\n $connection->send($msg);\n }\n } else {\n $userConnections->send($msg);\n }\n }\n }", "public function sendMessagesAll($sendSettings){\r\n while(count($this->messages) > 0) {\r\n $this->sendMessageOne($sendSettings);\r\n }\r\n }", "private function sendToEach(\\SplObjectStorage $conns, $msg, ConnectionInterface $exclude = null) {\n\t\t$conns->rewind();\n\t\twhile ($conns->valid()) {\n\t\t\t$conn = $conns->current();\n\t\t\t\n\t\t\tif ($conn != $exclude) {\n\t\t\t\t$conn->send($msg);\n\t\t\t}\n\t\t\t\n\t\t\t$conns->next();\n\t\t}\n\t}", "public function sendBatch()\n {\n foreach ($this->queuedNotifications as $queuedNotification) {\n if ($queuedNotification['toClients']) {\n $this->sendToClients(\n $queuedNotification['entity'],\n $queuedNotification['force'],\n $queuedNotification['changeSet'],\n $queuedNotification['HTTPMethod'],\n $queuedNotification['options']\n );\n } else {\n $this->sendToServer(\n $queuedNotification['entity'],\n $queuedNotification['force'],\n $queuedNotification['changeSet'],\n $queuedNotification['HTTPMethod'],\n $queuedNotification['options']\n );\n }\n }\n\n $this->batchManager->sendAll();\n $this->clear();\n }", "public function sendMessages()\n {\n while ($message = $this->getQueue()->receive()->current()) {\n\n $messageBody = $message->getBody();\n\n $sender = $this->getSender();\n\n if ($this->sendToRecipients() && $toAddress = $messageBody->get('toAddress')) {\n $sender->addTo($toAddress);\n }\n if ($duplicateTo = $this->getDuplicateTo()) {\n $sender->addBcc($duplicateTo);\n }\n\n if ($sender->getRecipients()) {\n\n $sender->setSubject($messageBody->get('subject'));\n $sender->setBodyHtml($messageBody->get('message'));\n\n if ($from = $messageBody->get('from')) {\n $sender->setFrom($from['email'], $from['name']);\n } elseif ($sender->getDefaultFrom()) {\n $sender->setFromToDefaultFrom();\n }\n\n if ($replyTo = $messageBody->get('reply-to')) {\n $sender->setReplyTo($replyTo['email'], $replyTo['name']);\n } elseif ($sender->getDefaultReplyTo()) {\n $sender->setReplyToFromDefault();\n }\n\n $sender->send();\n }\n\n $this->_clearSender($sender);\n\n $this->getQueue()->deleteMessage($message);\n }\n }", "function sendForAllButMe ($me, $data) {\n\tglobal $Server;\n\n\tif (sizeof($Server->wsClients) > 1) {\n\t\tforeach ($Server->wsClients as $id => $client) {\n\t\t\tif ($id == $me) continue;\n\t\t\t$Server->wsSend($id, $data);\n\t\t}\n\t}\n}", "public function sendMessages(array $messages);", "public function sendBroadcast($message)\n\t{\n\t\tforeach($this->chatClients as $client) \n\t\t{\n\t\t\t$client->send($message);\n\t\t}\n\t}", "public function send(\n array $messages\n );", "public function batchSend() {\n return $this->send(TRUE);\n }", "function sendEmailToAll($subject,$message){\n\t\t$emails=$this->getAllUserEmails();\n\t\tfor($a=0;count($emails)>$a;$a++){\n\t\t\t$this->sendEmail($emails[$a],$subject,$message);\n\t\t\t\n\t\t}\n\t\t \n\t }", "public function sendMessage(string $message) {\r\n\r\n foreach($this->getLevel()->getPlayers() as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . $message);\r\n\r\n }\r\n\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides for aliroHTML methods to be used within heredoc as $this>html('method', ...)
protected function html () { $args = func_get_args(); $method = array_shift($args); $html = aliroHTML::getInstance(); return call_user_func_array(array($html, $method), $args); }
[ "abstract public function buildHTML();", "abstract public function makeHtml();", "abstract protected function _toHtml();", "public function renderHTML()\n {\n }", "public function printHTML() {\n\n }", "protected function showHtml()\n {\n }", "public function toHTML()\n {\n }", "public function returnHtml() //PUBLIC so we can access the elements WITHOUT COMPOSITE\n\n {\n $namespace = ((new \\ReflectionObject($this))->getNamespaceName());\n\n $ulevel_nspace = substr($namespace, 0, strrpos($namespace, '\\\\'));\n\n $class = $ulevel_nspace . '\\visitors\\ReturnHtmlVisitor';\n\n $visitor = new $class();\n\n return $this->accept($visitor);\n\n }", "public function buildHtml();", "abstract protected function setHtml();", "public function print_html();", "function papi_render_html_tag( $tag, $attr = [] ) {\n\techo papi_html_tag( $tag, $attr ); // xss\n}", "public function writeHtml()\n\t{\n\t\t$args = func_get_args();\n\t\tif (empty($args)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->code .= $this->indent;\n\t\t$this->code .= \"echo \";\n\t\t$sep = null;\n\t\tforeach ($args as $line) {\n\t\t\t$this->code .= $sep;\n\t\t\t$this->code .= 'htmlspecialchars(';\n\t\t\t$this->code .= $line;\n\t\t\t$this->code .= ')';\n\t\t\tif ($sep === null) {\n\t\t\t\t$sep = \",\\n\\t\".$this->indent;\n\t\t\t}\n\t\t}\n\t\t$this->code .= \";\\n\";\n\t}", "public function getMethodsHtml() {\n $html = array();\n foreach ($this->getClass()->getMethods() as $method) {\n // do not display private/protected items\n if (!$method->isPublic() && !$method->isStatic())\n continue;\n // do templating\n $template = new WebTemplate($this->template_item, WebTemplate::STRING);\n // create title\n $title = sprintf('%s%s <i>%s</i> <b>%s</b>(%s)', $method->isPublic() ? 'public' : '', $method->isStatic() ? ' static' : '', $this->getMethodReturnType($method), $this->getMethodName($method), $this->getMethodParameterTypes($method)\n );\n $template->replace('title', $title);\n // create description\n $template->replace('description', $this->getDescriptionHtml($method));\n // finish\n $html[] = $template->toString();\n }\n // return\n return implode('', $html);\n }", "function render()\n {\n print($this->html->renderTag());\n }", "public function html(){\n $content = new Parsedown();\n return $content->text($this->content);\n }", "function composeHtml() {\r\n\t\t\t$result = '';\r\n\t\t\tif ($this->html_template)\r\n\t\t\t\t$result = $this->html_template->show(true);\r\n\t\t\treturn $result;\r\n\t\t}", "public function HTMLstream()\n {\n?>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"library/htmlPage.css\">\n <title><?php echo($this->title); ?></title>\n </head>\n\n <body>\n <container> \n <header>\n <h3><?php echo($this->heading); ?></h3>\n <p><?php echo($this->tagline); ?></p>\n </header>\n <nav>\n <?php\n foreach($this->menu as $label=>$link){\n echo(' <a href=\"'.$link.'\">'.$label.\"</a>\\n\");\n }\n ?>\n </nav>\n\n <section>\n <?php echo($this->content); ?>\n </section>\n\n <footer>\n <p>&copy;2013 David</p>\n </footer>\n </container>\n </body>\n</html>\n<?php\n }", "public function setHtml( $html );" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return a new task with no timeout but ready to be executed
public static function factoryAsap($callback){ $task = new Worker_Task(NULL,NULL,$callback); $task->state = self::STATE_HIT; return $task; }
[ "protected function getNewTask()\n {\n try {\n $task = $this->client->request('getQueuedTask');\n } catch (\\Exception $e) {\n return null;\n }\n return $task['result'] ?? null;\n }", "public function createTask()\n {\n }", "private function createTask()\n {\n $task = new Task();\n $task->task_hash_id = Yii::app()->random->hashID();\n $task->install_command = $_POST['install_command'];\n $task->start_command = $_POST['start_command'];\n $task->end_command = $_POST['end_command'];\n $task->created_at = str_replace(\"+0000\", \"Z\", date(DATE_ISO8601, getdate()[0]));\n $task->updated_at = str_replace(\"+0000\", \"Z\", date(DATE_ISO8601, getdate()[0]));\n $task->save();\n\n return $task;\n }", "public function createScriptTask()\n {\n return new ScriptTask();\n }", "abstract public function scheduledTask();", "function taskCreate(){\r\n\t\t$method='task.create';\r\n\t\t$tags=$this->task;\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response, 'task_id');\r\n\t\t$this->task=new stdClass();\r\n\t\treturn $obj;\r\n\t}", "public static function getTask()\n {\n if (empty(self::$task)) {\n self::$task = new Task();\n }\n\n return self::$task;\n }", "public function getTask() {\n }", "public function createScriptTask();", "private function createTask() {\n $query = $this->createQuery();\n\n\t\techo $query;\n\n $task = $this->database->prepare($query);\n $task->execute($this->queryProperty->getWhereArgs());\n return $task;\n }", "public function instantiate($task);", "public function testCreateTask()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function getTaskFactory() {\n\t\treturn new TaskFactory();\n\t}", "abstract public function createNewTasks();", "protected function createTask()\n {\n // Split name and prepend Task namespace to it\n $name = $this->conf->get(array('task', 'type'), 'default');\n $namespace = array_merge(array('Task'), explode('/', $name));\n\n // Summon a Task with the current Migrator config\n return Migrator::summon(\n $namespace,\n $this->conf->export()\n );\n }", "public function getOneTask()\n {\n $broker = $this->getBrokerForNextTask();\n\n if (is_null($broker)) {\n return null;\n }\n\n $task = $broker->popBrokerTask();\n if ($task) {\n $broker->decreaseCachedCount(1);\n }\n\n // Service locator injection\n if ($task && $task->getTask() instanceof ServiceLocatorAwareInterface) {\n $task->injectServiceLocator($this->getServiceLocator());\n }\n return $task;\n }", "private function addTask()\n {\n $c = $this->maxThread - count($this->taskRunning);\n $isCbTaskCalled = false;\n while ($c > 0) {\n $task = array();\n // search failed first\n if (! empty($this->taskFail)) {\n $task = array_pop($this->taskFail);\n } else {\n // cbTask\n if (empty($this->taskPool) && empty($this->taskPoolAhead) &&\n false === $isCbTaskCalled && isset($this->cbTask)) {\n call_user_func($this->cbTask);\n $isCbTaskCalled = true;\n }\n if (! empty($this->taskPoolAhead)) {\n $task = array_pop($this->taskPoolAhead);\n } elseif (! empty($this->taskPool)) {\n if ($this->taskPoolType == 'stack') {\n $task = array_pop($this->taskPool);\n } else {\n $task = array_shift($this->taskPool);\n }\n }\n }\n $cache = null;\n if (! empty($task)) {\n $cache = $this->cache($task);\n if (null !== $cache) {\n // download task\n if (isset($task['opt'][CURLOPT_FILE])) {\n if (flock($task['opt'][CURLOPT_FILE], LOCK_EX)) {\n fwrite($task['opt'][CURLOPT_FILE], $cache['body']);\n flock($task['opt'][CURLOPT_FILE], LOCK_UN);\n }\n unset($cache['body']);\n }\n $this->process($task, $cache);\n $this->info['all']['cacheNum'] ++;\n $this->info['all']['finishNum'] ++;\n $this->callCbInfo();\n } else {\n $task = $this->curlInit($task);\n $this->taskRunning[(int) $task['ch']] = $task;\n curl_multi_add_handle($this->mh, $task['ch']);\n }\n } else {\n break;\n }\n if (null == $cache) {\n $c --;\n }\n }\n }", "public function testCreateTask()\n {\n }", "protected function get_test_scheduled_task() : \\core\\task\\scheduled_task {\n $task = $this->getMockForAbstractClass(\\core\\task\\scheduled_task::class);\n\n // Mock a lock on the task.\n $lock = $this->getMockBuilder(\\core\\lock\\lock::class)\n ->disableOriginalConstructor()\n ->getMock();\n $task->set_lock($lock);\n\n return $task;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create and setup QLabel lblFirstName
public function lblFirstName_Create($strControlId = null) { $this->lblFirstName = new QLabel($this->objParentObject, $strControlId); $this->lblFirstName->Name = QApplication::Translate('First Name'); $this->lblFirstName->Text = $this->objLogin->FirstName; return $this->lblFirstName; }
[ "public function lblFirstName_Create($strControlId = null) {\n\t\t\t$this->lblFirstName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblFirstName->Name = QApplication::Translate('First Name');\n\t\t\t$this->lblFirstName->Text = $this->objPerson->FirstName;\n\t\t\t$this->lblFirstName->Required = true;\n\t\t\treturn $this->lblFirstName;\n\t\t}", "public function lblFirstName_Create($strControlId = null) {\n\t\t\t$this->lblFirstName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblFirstName->Name = QApplication::Translate('First Name');\n\t\t\t$this->lblFirstName->Text = $this->objPerson->FirstName;\n\t\t\treturn $this->lblFirstName;\n\t\t}", "public function lblFirstName_Create($strControlId = null) {\n\t\t\t$this->lblFirstName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblFirstName->Name = QApplication::Translate('First Name');\n\t\t\t$this->lblFirstName->Text = $this->objSuspect->FirstName;\n\t\t\treturn $this->lblFirstName;\n\t\t}", "public function lblFirstName_Create($strControlId = null) {\n\t\t\t$this->lblFirstName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblFirstName->Name = QApplication::Translate('First Name');\n\t\t\t$this->lblFirstName->Text = $this->objParentPagerIndividual->FirstName;\n\t\t\treturn $this->lblFirstName;\n\t\t}", "public function lblOwnerFirstName_Create($strControlId = null) {\n\t\t\t$this->lblOwnerFirstName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblOwnerFirstName->Name = QApplication::Translate('Owner First Name');\n\t\t\t$this->lblOwnerFirstName->Text = $this->objRestaurantCopy1->OwnerFirstName;\n\t\t\t$this->lblOwnerFirstName->Required = true;\n\t\t\treturn $this->lblOwnerFirstName;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objUser->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objLogin->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objGroupRegistrations->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objPerson->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objParentPagerIndividual->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblUsername_Create($strControlId = null) {\n\t\t\t$this->lblUsername = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblUsername->Name = QApplication::Translate('Username');\n\t\t\t$this->lblUsername->Text = $this->objPublicLogin->Username;\n\t\t\t$this->lblUsername->Required = true;\n\t\t\treturn $this->lblUsername;\n\t\t}", "public function lblLastName_Create($strControlId = null) {\n\t\t\t$this->lblLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblLastName->Name = QApplication::Translate('Last Name');\n\t\t\t$this->lblLastName->Text = $this->objCommunicationListEntry->LastName;\n\t\t\treturn $this->lblLastName;\n\t\t}", "public function lblUsername_Create($strControlId = null) {\n\t\t\t$this->lblUsername = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblUsername->Name = QApplication::Translate('Username');\n\t\t\t$this->lblUsername->Text = $this->objLogin->Username;\n\t\t\treturn $this->lblUsername;\n\t\t}", "public function lblOwnerLastName_Create($strControlId = null) {\n\t\t\t$this->lblOwnerLastName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblOwnerLastName->Name = QApplication::Translate('Owner Last Name');\n\t\t\t$this->lblOwnerLastName->Text = $this->objRestaurantCopy1->OwnerLastName;\n\t\t\t$this->lblOwnerLastName->Required = true;\n\t\t\treturn $this->lblOwnerLastName;\n\t\t}", "function setLabelTemplateLastNameFirstName()\n { \n $this->setLabelTemplate( 'person_lname,person_fname','[person_lname], [person_fname]');\n }", "public function lblNome_Create($strControlId = null) {\n\t\t\t$this->lblNome = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNome->Name = QApplication::Translate('Nome');\n\t\t\t$this->lblNome->Text = $this->objColecao->Nome;\n\t\t\t$this->lblNome->Required = true;\n\t\t\treturn $this->lblNome;\n\t\t}", "function setLabelTemplateLastNameFirstNameID()\n { \n $this->setLabelTemplate( 'person_lname,person_fname,person_id','[person_lname], [person_fname] - [person_id]');\n }", "public function lblNome_Create($strControlId = null) {\n\t\t\t$this->lblNome = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNome->Name = QApplication::Translate('Nome');\n\t\t\t$this->lblNome->Text = $this->objTecido->Nome;\n\t\t\t$this->lblNome->Required = true;\n\t\t\treturn $this->lblNome;\n\t\t}", "public function lblNickname_Create($strControlId = null) {\n\t\t\t$this->lblNickname = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNickname->Name = QApplication::Translate('Nickname');\n\t\t\t$this->lblNickname->Text = $this->objParentPagerIndividual->Nickname;\n\t\t\treturn $this->lblNickname;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Break the chain and return subject
public function break() { return $this->subject; }
[ "public function chain() {\n\t\t\treturn $this->chain;\n\t\t}", "public function withFirstResults(): Chain;", "public function first()\n {\n return reset($this->chain);\n }", "public function dispatchNextJobInChain()\n {\n $me = $this;\n if (! empty($this->chained)) {\n dispatch(tap(unserialize(array_shift($this->chained)), function ($next) use($me) {\n $next->chained = $me->chained;\n }));\n }\n }", "public function setChainBreaker($break);", "public function shouldBreakChain()\n {\n return false;\n }", "public function dispatchNextJobInChain()\n {\n if (! empty($this->chained)) {\n dispatch(tap(unserialize(array_shift($this->chained)), function ($next) {\n $next->chained = $this->chained;\n\n $next->onConnection($next->connection ?: $this->chainConnection);\n $next->onQueue($next->queue ?: $this->chainQueue);\n $next->sharedData($this->sharedData);\n\n $next->chainConnection = $this->chainConnection;\n $next->chainQueue = $this->chainQueue;\n }));\n }\n }", "public function breakBarrier()\n {\n $this->generation->broken = true;\n $this->count = $this->parties;\n Cond::broadcast($this->cond);\n }", "public function takeBreak()\n {\n }", "public function breakInnerGroups() {\n $this->list = $this->getReferencesBroken();\n return $this;\n }", "public function getNextJobInChain(){\n $nextJob = null;\n\n $childrenJobs = $this->getChildrenJobs(false, '', $this->target_lang_id);\n foreach($childrenJobs as $childrenJob){\n if(!$childrenJob->isParentJob()){\n $nextJob = $childrenJob;\n break;\n }\n }\n\n return $nextJob;\n }", "public function getChain()\n {\n if (empty($this->chain))\n return self::$DEFAULT_CHAIN;\n return $this->chain;\n }", "public function testChain()\n {\n $config = array (\n 'init_node' => 'extractor',\n 'nodes' => array (\n 'extractor' => array (\n 'class' => 'extractor',\n 'type' => 'csv',\n 'output' => array ('mapi'),\n 'file' => 'etl/tests/csv/email.csv',\n 'skip_lines' => 1,\n 'header_line' => -1\n ),\n 'mapi' => array (\n 'class' => 'transformer',\n 'type' => 'map',\n 'output' => array ('filter_node'),\n ),\n 'filter_node' => array (\n 'class' => 'transformer',\n 'type' => 'filter',\n 'output' => array ('add_field'),\n ),\n 'add_field' => array (\n 'class' => 'transformer',\n 'type' => 'add_field',\n 'output' => array ('if'),\n ),\n 'if' => array (\n 'class' => 'transformer',\n 'type' => 'conditional_if',\n 'output' => array ('replace'),\n ),\n 'replace' => array (\n 'class' => 'transformer',\n 'type' => 'replace',\n 'output' => array ('loader'),\n ),\n 'loader' => array (\n 'class' => 'loader',\n 'type' => 'debug'\n )\n ));\n\n $etl = \\Giift\\Etl\\Chain::forge($config);\n\n $extractor = $etl->getNode('extractor');\n $this->assertNotEmpty($extractor);\n $extractor_output = $extractor->getOutputs();\n foreach ($extractor_output as $output) {\n $this->assertEquals('Giift\\\\Etl\\\\Transformer\\\\Map', get_class($output));\n }\n\n $map = $etl->getNode('mapi');\n $this->assertNotEmpty($map);\n $map_output = $map->getOutputs();\n foreach ($map_output as $output) {\n $this->assertEquals('Giift\\\\Etl\\\\Transformer\\\\Filter', get_class($output));\n }\n\n $filter = $etl->getNode('filter_node');\n $this->assertNotEmpty($filter);\n $filter_output = $filter->getOutputs();\n foreach ($filter_output as $output) {\n $this->assertEquals('Giift\\\\Etl\\\\Transformer\\\\AddField', get_class($output));\n }\n\n $addfield = $etl->getNode('add_field');\n $this->assertNotEmpty($addfield);\n $addfield_output = $addfield->getOutputs();\n foreach ($addfield_output as $output) {\n $this->assertEquals('Giift\\\\Etl\\\\Transformer\\\\ConditionalIf', get_class($output));\n }\n\n $if = $etl->getNode('if');\n $this->assertNotEmpty($if);\n $if_output = $if->getOutputs();\n foreach ($if_output as $output) {\n $this->assertEquals('Giift\\Etl\\Transformer\\Replace', get_class($output));\n }\n\n $replace = $etl->getNode('replace');\n $this->assertNotEmpty($replace);\n $replace_output = $replace->getOutputs();\n foreach ($replace_output as $output) {\n $this->assertEquals('Giift\\Etl\\Loader\\Debug', get_class($output));\n }\n }", "public function takeBreak()\n {\n return \"Break: I'm entitled to this...\";\n }", "public function chain($cache);", "public function selectDefaultChain();", "private static function create_chaining() {\n $i = count(self::$middlewares);\n $next = null;\n while($i) {\n list($middleware, $args) = self::$middlewares[--$i];\n $next = new $middleware($next, ...$args);\n }\n return $next;\n }", "public function getJobChain()\n {\n return $this->jobChain;\n }", "public function getChain()\n {\n $chain = [$this->currentCert];\n\n if (!is_array($this->currentCert) || !isset($this->currentCert['tbsCertificate'])) {\n return false;\n }\n while (true) {\n $currentCert = $chain[count($chain) - 1];\n for ($i = 0; $i < count($this->CAs); $i++) {\n $ca = $this->CAs[$i];\n if ($currentCert['tbsCertificate']['issuer'] === $ca['tbsCertificate']['subject']) {\n $authorityKey = $this->getExtension('id-ce-authorityKeyIdentifier', $currentCert);\n $subjectKeyID = $this->getExtension('id-ce-subjectKeyIdentifier', $ca);\n switch (true) {\n case !is_array($authorityKey):\n case is_array($authorityKey) && isset($authorityKey['keyIdentifier']) && $authorityKey['keyIdentifier'] === $subjectKeyID:\n if ($currentCert === $ca) {\n break 3;\n }\n $chain[] = $ca;\n break 2;\n }\n }\n }\n if ($i == count($this->CAs)) {\n break;\n }\n }\n foreach ($chain as $key => $value) {\n $chain[$key] = new X509();\n $chain[$key]->loadX509($value);\n }\n return $chain;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The result for the shared set mutate. Generated from protobuf field .google.ads.googleads.v1.services.MutateSharedSetResult shared_set_result = 15;
public function getSharedSetResult() { return $this->readOneof(15); }
[ "public function setSharedSetResult($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V0\\Services\\MutateSharedSetResult::class);\n $this->writeOneof(15, $var);\n\n return $this;\n }", "public function getSharedSet()\n {\n return $this->shared_set;\n }", "public function setSharedCriterionResult($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V0\\Services\\MutateSharedCriterionResult::class);\n $this->writeOneof(14, $var);\n\n return $this;\n }", "public function getSharedCriterionResult()\n {\n return $this->readOneof(14);\n }", "public function getSharedSet()\n {\n return isset($this->shared_set) ? $this->shared_set : '';\n }", "public function getCampaignSharedSet()\n {\n return $this->campaign_shared_set;\n }", "public function setSharedSetOperation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V8\\Services\\SharedSetOperation::class);\n $this->writeOneof(15, $var);\n\n return $this;\n }", "public function setSmartCampaignSettingResult($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V8\\Services\\MutateSmartCampaignSettingResult::class);\n $this->writeOneof(61, $var);\n\n return $this;\n }", "public function setGetSharingMetadataResponseMessage(?\\StructType\\EwsGetSharingMetadataResponseMessageType $getSharingMetadataResponseMessage = null): self\n {\n // validation for constraint: choice(CreateItemResponseMessage, DeleteItemResponseMessage, GetItemResponseMessage, UpdateItemResponseMessage, UpdateItemInRecoverableItemsResponseMessage, SendItemResponseMessage, DeleteFolderResponseMessage, EmptyFolderResponseMessage, CreateFolderResponseMessage, GetFolderResponseMessage, FindFolderResponseMessage, UpdateFolderResponseMessage, MoveFolderResponseMessage, CopyFolderResponseMessage, CreateFolderPathResponseMessage, CreateAttachmentResponseMessage, DeleteAttachmentResponseMessage, GetAttachmentResponseMessage, UploadItemsResponseMessage, ExportItemsResponseMessage, MarkAllItemsAsReadResponseMessage, GetClientAccessTokenResponseMessage, GetAppManifestsResponseMessage, GetClientExtensionResponseMessage, SetClientExtensionResponseMessage, GetEncryptionConfigurationResponseMessage, SetEncryptionConfigurationResponseMessage, GetOMEConfigurationResponseMessage, SetOMEConfigurationResponseMessage, FindItemResponseMessage, MoveItemResponseMessage, ArchiveItemResponseMessage, CopyItemResponseMessage, ResolveNamesResponseMessage, ExpandDLResponseMessage, GetServerTimeZonesResponseMessage, GetEventsResponseMessage, GetStreamingEventsResponseMessage, SubscribeResponseMessage, UnsubscribeResponseMessage, GetChannelEventsResponseMessage, ChannelSubscribeResponseMessage, ChannelUnsubscribeResponseMessage, SendNotificationResponseMessage, SyncFolderHierarchyResponseMessage, SyncFolderItemsResponseMessage, CreateManagedFolderResponseMessage, ConvertIdResponseMessage, GetSharingMetadataResponseMessage, RefreshSharingFolderResponseMessage, GetSharingFolderResponseMessage, CreateUserConfigurationResponseMessage, DeleteUserConfigurationResponseMessage, GetUserConfigurationResponseMessage, UpdateUserConfigurationResponseMessage, GetRoomListsResponse, GetRoomsResponse, GetRemindersResponse, PerformReminderActionResponse, ApplyConversationActionResponseMessage, FindMailboxStatisticsByKeywordsResponseMessage, GetSearchableMailboxesResponseMessage, SearchMailboxesResponseMessage, GetDiscoverySearchConfigurationResponseMessage, GetHoldOnMailboxesResponseMessage, SetHoldOnMailboxesResponseMessage, GetNonIndexableItemStatisticsResponseMessage, GetNonIndexableItemDetailsResponseMessage, FindPeopleResponseMessage, GetPasswordExpirationDateResponse, GetPersonaResponseMessage, GetConversationItemsResponseMessage, GetUserRetentionPolicyTagsResponseMessage, GetUserPhotoResponseMessage, MarkAsJunkResponseMessage, UpdateMailboxAssociationResponseMessage, UpdateGroupMailboxResponseMessage, PostModernGroupItemResponseMessage, GetUnifiedGroupUnseenDataResponseMessage)\n if ('' !== ($getSharingMetadataResponseMessageChoiceErrorMessage = self::validateGetSharingMetadataResponseMessageForChoiceConstraintsFromSetGetSharingMetadataResponseMessage($getSharingMetadataResponseMessage))) {\n throw new InvalidArgumentException($getSharingMetadataResponseMessageChoiceErrorMessage, __LINE__);\n }\n if (is_null($getSharingMetadataResponseMessage) || (is_array($getSharingMetadataResponseMessage) && empty($getSharingMetadataResponseMessage))) {\n unset($this->GetSharingMetadataResponseMessage);\n } else {\n $this->GetSharingMetadataResponseMessage = $getSharingMetadataResponseMessage;\n }\n \n return $this;\n }", "public function setSharedCriterion($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V3\\Resources\\SharedCriterion::class);\n $this->shared_criterion = $var;\n\n return $this;\n }", "public function setSharedCriterion($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V2\\Resources\\SharedCriterion::class);\n $this->shared_criterion = $var;\n\n return $this;\n }", "public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V13\\Enums\\SharedSetStatusEnum\\SharedSetStatus::class);\n $this->status = $var;\n\n return $this;\n }", "public function setShared(bool $shared);", "public function shared()\n {\n // Get user\n $user_id = Auth::id();\n\n // Get shared folders and files\n $folder_ids = Share::where('user_id', $user_id)\n ->where('type', 'folder')\n ->pluck('item_id');\n\n $file_ids = Share::where('user_id', $user_id)\n ->where('type', '!=', 'folder')\n ->pluck('item_id');\n\n // Get folders and files\n $folders = FileManagerFolder::with(['parent', 'shared:token,id,item_id,permission,protected'])\n ->where('user_id', $user_id)\n ->whereIn('unique_id', $folder_ids)\n ->get();\n\n $files = FileManagerFile::with(['parent', 'shared:token,id,item_id,permission,protected'])\n ->where('user_id', $user_id)\n ->whereIn('unique_id', $file_ids)\n ->get();\n\n // Collect folders and files to single array\n return collect([$folders, $files])->collapse();\n }", "public function setShared($shared);", "public function getShared()\n {\n return $this->shared;\n }", "public function setExplicitlyShared($var)\n {\n GPBUtil::checkBool($var);\n $this->explicitly_shared = $var;\n\n return $this;\n }", "public function shared() {\n return Share::Where('user_id', '=', $this->id)->where('share_type', '=', Models\\Social\\Share_type::SHARED_BY_USER)->get()->map(function ($item, $key) {\n return $item->post;\n });\n }", "public function storeSharedResult(SharedSearchResult $searchResult);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the address format definition for the provided country code.
protected function loadAddressFormatDefinition($countryCode) { if (!isset($this->addressFormatDefinitions[$countryCode])) { $filename = $this->definitionPath . 'address_format/' . $countryCode . '.json'; $rawDefinition = file_get_contents($filename); if ($rawDefinition) { $rawDefinition = json_decode($rawDefinition, true); $rawDefinition['country_code'] = $countryCode; $this->addressFormatDefinitions[$countryCode] = $rawDefinition; } else { // Bypass further loading attempts. $this->addressFormatDefinitions[$countryCode] = array(); } } return $this->addressFormatDefinitions[$countryCode]; }
[ "function create_address_format_definition($rawDefinition) {\n $addressFormat = array(\n 'locale' => determine_locale($rawDefinition),\n 'format' => null,\n );\n if (isset($rawDefinition['require'])) {\n $required = str_split($rawDefinition['require']);\n $addressFormat['required_fields'] = convert_fields($required);\n }\n if (isset($rawDefinition['upper'])) {\n $uppercase = str_split($rawDefinition['upper']);\n $addressFormat['uppercase_fields'] = convert_fields($uppercase);\n }\n if (isset($rawDefinition['state_name_type'])) {\n $addressFormat['administrative_area_type'] = $rawDefinition['state_name_type'];\n }\n if (isset($rawDefinition['zip_name_type'])) {\n $addressFormat['postal_code_type'] = $rawDefinition['zip_name_type'];\n }\n if (isset($rawDefinition['zip'])) {\n $addressFormat['postal_code_pattern'] = $rawDefinition['zip'];\n }\n if (isset($rawDefinition['postprefix'])) {\n $addressFormat['postal_code_prefix'] = $rawDefinition['postprefix'];\n }\n\n if (isset($rawDefinition['lfmt'])) {\n // Handle the China/Korea/Japan dual formats via translation.\n $language = $rawDefinition['lang'];\n $addressFormat['translations'][$language]['format'] = convert_format($rawDefinition['fmt']);\n $addressFormat['format'] = convert_format($rawDefinition['lfmt']);\n }\n else {\n $addressFormat['format'] = convert_format($rawDefinition['fmt']);\n }\n\n return $addressFormat;\n}", "public static function getAddressCountryFormat($country_id = 0) {\n $country_id = (int)$country_id;\n\n $tmp_obj = new JeproshopAddressFormatModelAddressFormat();\n $tmp_obj->country_id = $country_id;\n $out = $tmp_obj->getFormat($tmp_obj->country_id);\n $tmp_obj = null;\n return $out;\n }", "function location_load_country($country) {\n location_standardize_country_code($country);\n\n $file = drupal_get_path('module', 'location') . '/supported/location.' . $country . '.inc';\n if (file_exists($file)) {\n include_once($file);\n return TRUE;\n }\n return FALSE;\n}", "public static function getAddressCountryFormat($country_id = 0){\n $country_id = (int)$country_id;\n\n $tmp_obj = new JeproshopAddressFormatModelAddressFormat();\n $tmp_obj->country_id = $country_id;\n $out = $tmp_obj->getFormat($tmp_obj->country_id);\n unset($tmp_obj);\n return $out;\n }", "public function parseAddress(string $address, string $country = 'Australia'): Address;", "function oos_get_address_format_id($country_id) {\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $countriestable = $oostable['countries'];\n $address_format = $dbconn->Execute(\"SELECT address_format_id AS format_id FROM $countriestable WHERE countries_id = '\" . intval($country_id) . \"'\");\n if ($address_format->RecordCount() > 0) {\n return $address_format->fields['format_id'];\n } else {\n return '1';\n }\n }", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '1';\n }\n }", "public function importByCountry($country_code);", "function tep_get_address_format_id($country_id) {\n\t$ResultSet = Doctrine_Manager::getInstance()\n\t\t->getCurrentConnection()\n\t\t->fetchArray(\"select address_format_id as format_id from countries where countries_id = '\" . (int)$country_id . \"'\");\n\tif (sizeof($ResultSet) > 0){\n\t\treturn $ResultSet[0]['format_id'];\n\t}\n\telse {\n\t\treturn '1';\n\t}\n}", "public function get_address_formats() {\r\n\t\tif ( ! isset( $this->address_formats ) ) {\r\n\r\n\t\t\t// Common formats\r\n\t\t\t$postcode_before_city = \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode} {city}\\n{country}\";\r\n\r\n\t\t\t// Define address formats\r\n\t\t\t$this->address_formats = apply_filters('charitable_localisation_address_formats', array(\r\n\t\t\t\t'default' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city}\\n{state}\\n{postcode}\\n{country}\",\r\n\t\t\t\t'AU' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city} {state} {postcode}\\n{country}\",\r\n\t\t\t\t'AT' => $postcode_before_city,\r\n\t\t\t\t'BE' => $postcode_before_city,\r\n\t\t\t\t'CA' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{city} {state} {postcode}\\n{country}\",\r\n\t\t\t\t'CH' => $postcode_before_city,\r\n\t\t\t\t'CN' => \"{country} {postcode}\\n{state}, {city}, {address_2}, {address_1}\\n{company}\\n{name}\",\r\n\t\t\t\t'CZ' => $postcode_before_city,\r\n\t\t\t\t'DE' => $postcode_before_city,\r\n\t\t\t\t'EE' => $postcode_before_city,\r\n\t\t\t\t'FI' => $postcode_before_city,\r\n\t\t\t\t'DK' => $postcode_before_city,\r\n\t\t\t\t'FR' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode} {city_upper}\\n{country}\",\r\n\t\t\t\t'HK' => \"{company}\\n{first_name} {last_name_upper}\\n{address_1}\\n{address_2}\\n{city_upper}\\n{state_upper}\\n{country}\",\r\n\t\t\t\t'HU' => \"{name}\\n{company}\\n{city}\\n{address_1}\\n{address_2}\\n{postcode}\\n{country}\",\r\n\t\t\t\t'IS' => $postcode_before_city,\r\n\t\t\t\t'IT' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode}\\n{city}\\n{state_upper}\\n{country}\",\r\n\t\t\t\t'JP' => \"{postcode}\\n{state}{city}{address_1}\\n{address_2}\\n{company}\\n{last_name} {first_name}\\n {country}\",\r\n\t\t\t\t'TW' => \"{postcode}\\n{city}{address_2}\\n{address_1}\\n{company}\\n{last_name} {first_name}\\n {country}\",\r\n\t\t\t\t'LI' => $postcode_before_city,\r\n\t\t\t\t'NL' => $postcode_before_city,\r\n\t\t\t\t'NZ' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city} {postcode}\\n{country}\",\r\n\t\t\t\t'NO' => $postcode_before_city,\r\n\t\t\t\t'PL' => $postcode_before_city,\r\n\t\t\t\t'SK' => $postcode_before_city,\r\n\t\t\t\t'SI' => $postcode_before_city,\r\n\t\t\t\t'ES' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{postcode} {city}\\n{state}\\n{country}\",\r\n\t\t\t\t'SE' => $postcode_before_city,\r\n\t\t\t\t'TR' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{postcode} {city} {state}\\n{country}\",\r\n\t\t\t\t'US' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city}, {state_code} {postcode}\\n{country}\",\r\n\t\t\t\t'VN' => \"{name}\\n{company}\\n{address_1}\\n{city}\\n{country}\",\r\n\t\t\t));\r\n\t\t\r\n\t\t}\r\n\r\n\t\treturn $this->address_formats;\r\n\t}", "function tep_get_address_formats_for_countries() {\n $address_format_query = tep_db_query(\"select address_format_id, address_format from \" . TABLE_ADDRESS_FORMAT . \" order by address_format_id\");\n $address_format_array = array();\n $patterns = array('/\\$firstname \\$lastname/','/\\$streets/','/\\$city/','/\\$postcode/','/\\$state/','/\\$country/','/\\$/','/comma/','/cr/');\n $replacements = array(substr(ENTRY_FIRST_NAME, 0, -1) . '&nbsp;' . substr(ENTRY_LAST_NAME, 0, -1),substr(ENTRY_STREET_ADDRESS, 0, -1),substr(ENTRY_CITY, 0 ,-1),substr(ENTRY_POST_CODE,0,-1),substr(ENTRY_STATE,0,-1),substr(ENTRY_COUNTRY,0,-1),' ',';',' | '); \n while ($address_format_values = tep_db_fetch_array($address_format_query)) { \n $address_format_array[] = array('id' => $address_format_values['address_format_id'],\n 'text' => substr(TEXT_INFO_ADDRESS_FORMAT,0,-1) . '&nbsp;' . $address_format_values['address_format_id']. ' : | ' . preg_replace($patterns, $replacements, $address_format_values['address_format']));\n }\n return $address_format_array;\n }", "public function parseAddress(string $address, string $country = 'Australia'): Address\n {\n $parseResult = AddressParser::parse($address, $country);\n\n if (null !== $parseResult->getSuburb()) {\n try {\n $countryModel = Country::where(['name' => $country])->firstOrFail();\n\n $stateModel = State::where([\n 'country_id' => $countryModel->id,\n 'code' => $parseResult->getStateCode(),\n ])->firstOrFail();\n\n $suburbModel = Suburb::where([\n 'state_id' => $stateModel->id,\n 'name' => $parseResult->getSuburb(),\n 'postcode' => $parseResult->getPostCode(),\n ])->firstOrFail();\n\n $addressModel = Address::firstOrNew([\n 'address_line_1' => $parseResult->getAddressLine1(),\n 'suburb_id' => $suburbModel->id,\n ]);\n } catch (\\Exception $e) {\n $addressModel = Address::firstOrNew([\n 'address_line_1' => $address,\n ]);\n }\n } else {\n $addressModel = Address::firstOrNew([\n 'address_line_1' => $address,\n ]);\n }\n\n return $addressModel;\n }", "function formatAddress($delim, $streetAddress, $city, $zip, $subdivisionCode='', $countryCode='')\t{\r\n\r\n\t\t$formatedAddress = '';\r\n\r\n\t\t\t// Get country name\r\n\t\t$countryName = $this->getStaticInfoName('COUNTRIES', (($countryCode)?$countryCode:$this->defaultCountry));\r\n\t\tif( !$countryName )\t{ return $formatedAddress; }\r\n\r\n\t\t\t// Get address format\r\n\t\tif($this->typoVersion >= 3006000) {\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('cn_address_format', 'static_countries', 'cn_iso_3=\"'.trim((($countryCode)?$countryCode:$this->defaultCountry)).'\"');\r\n\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t\t} else {\r\n\t\t\t$query = 'SELECT cn_address_format FROM static_countries WHERE cn_iso_3=\"'.trim((($countryCode)?$countryCode:$this->defaultCountry)).'\" ';\r\n\t\t\t$res = mysql(TYPO3_db,$query);\r\n\t\t\techo mysql_error();\r\n\t\t\t$row = mysql_fetch_assoc($res);\r\n\t\t}\r\n\t\t$addressFormat = $row['cn_address_format'];\r\n\r\n\t\t\t// Get country subdivision name\r\n\t\t$countrySubdivisionName = $this->getStaticInfoName('SUBDIVISIONS', (($subdivisionCode)?$subdivisionCode:$this->defaultCountryZone), (($countryCode)?$countryCode:$this->defaultCountry));\r\n\r\n\t\t\t// Format the address\r\n\t\t$formatedAddress = $this->conf['addressFormat.'][$addressFormat];\r\n\t\t$formatedAddress = str_replace('%street', $streetAddress, $formatedAddress);\r\n\t\t$formatedAddress = str_replace('%city', $city, $formatedAddress);\r\n\t\t$formatedAddress = str_replace('%zip', $zip, $formatedAddress);\r\n\t\t$formatedAddress = str_replace('%countrySubdivisionCode', $subdivisionCode, $formatedAddress);\r\n\t\t$formatedAddress = str_replace('%countrySubdivisionName', $countrySubdivisionName, $formatedAddress);\r\n\t\t$formatedAddress = str_replace('%countryName', strtoupper($countryName), $formatedAddress);\r\n\t\t$formatedAddress = implode($delim, t3lib_div::trimExplode(';', $formatedAddress, 1));\r\n\r\n\t\treturn $formatedAddress;\r\n\t}", "function tep_get_address_format_id($country_id) {\n Global $languages_id;\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$country_id . \"' and language_id = '\" .(int)$languages_id. \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '1';\n }\n}", "public function load_address()\n {\n $matp = isset( $_POST['matp'] ) ? wc_clean( wp_unslash( $_POST['matp'] ) ) : '';\n\n $maqh = isset( $_POST['maqh'] ) ? intval( $_POST['maqh'] ) : '';\n\n if( $matp ){\n $result = $this->get_list_district( $matp );\n wp_send_json_success( $result );\n }\n\n if( $maqh ){\n $result = $this->get_list_village( $maqh );\n wp_send_json_success( $result );\n }\n\n wp_send_json_error();\n\n die();\n }", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '6';\n }\n}", "protected function parseAmwsStateOrRegion($country_code, $state) {\n $convert_states = $this->config->get('general.address_convert_states');\n if (!$convert_states) {\n return $state;\n }\n\n // For now, only USA states are supported.\n if ($country_code !== 'US') {\n return $state;\n }\n\n $state_lowercase = strtolower($state);\n\n // Load the list of administrative areas (subdivisions) for the country from\n // the `commerceguys/addressing` library. We expect the library to be under\n // the `vendor` folder in the standard location; but we may make this\n // configurable in the future.\n $subdivisions_dir = realpath(DRUPAL_ROOT . '/../vendor/commerceguys/addressing/resources/subdivision');\n $filename = $subdivisions_dir . '/' . $country_code . '.json';\n if (!file_exists($filename)) {\n $message = sprintf(\n 'The file containing the subdivisions for the country with code \"%s\" was not found at the expected location (\"%\").',\n $country_code,\n $filename\n );\n $this->logger->warning($message);\n\n return $state;\n }\n\n $subdivisions = json_decode(file_get_contents($filename));\n $subdivisions = get_object_vars($subdivisions->subdivisions);\n\n // First, check if we already have the state/region code.\n $subdivision_keys = array_map('strtolower', array_keys($subdivisions));\n if (in_array($state_lowercase, $subdivision_keys)) {\n return $state;\n }\n\n // Otherwise, check for a name match.\n foreach ($subdivisions as $code => $subdivision) {\n $has_name = property_exists($subdivision, 'name');\n if ($has_name && strtolower($subdivision->name) === $state_lowercase) {\n return $code;\n }\n }\n\n return $state;\n }", "public static function fromPostalCode($postal_code)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); \n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 8);\n\t\t$http_query = self::$GOOGLE_MAPS_API;\n\t\t$http_query .= \"json?\";\n\t\t$http_query .= \"address=\";\n\t\t$http_query .= $postal_code;\n\t\t$http_query = substr($http_query, 0, 1024);\n\n\t\tif (\\Cache::has(GOOGLE_API_CACHE_PREFIX.md5($http_query)))\n\t\t{\n\t\t\t$response = \\Cache::get(GOOGLE_API_CACHE_PREFIX.md5($http_query));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $http_query);\n\t\t\t$response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t\\Cache::put(GOOGLE_API_CACHE_PREFIX.md5($http_query), $response, GOOGLE_API_CACHE_TIMEOUT);\n\t\t}\n\n\t\tif (! $response)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$response = json_decode($response, true);\n\t\t$resolved_state_province = '';\n\n\t\ttry\n\t\t{\n\t\t\tforeach($response['results'][0]['address_components'] as $component)\n\t\t\t\tif(in_array('country', $component['types']))\n\t\t\t\t\t$resolved_country = $component['long_name'];\n\n\t\t\tforeach($response['results'][0]['address_components'] as $component) \n\t\t\t\tif(in_array('administrative_area_level_1', $component['types']))\n\t\t\t\t\t$resolved_state_province = $component[$resolved_country == 'Canada' ? 'long_name' : 'short_name'];\n\t\t}\n\t\tcatch (\\ErrorException $e)\n\t\t{\n\t\t\t/**\n\t\t\t * \\ErrorException: Undefined offset.\n\t\t\t * This means Google has changed the format of the JSON returned by this\n\t\t\t * API. This should really never happen. Handle it however you like.\n\t\t\t */\n\t\t}\n\n\t\tif (!isset($resolved_country) || !isset($resolved_state_province))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$d = new Destination($resolved_country, $resolved_state_province, $postal_code);\n\t\treturn $d;\n\t}", "public function getAddressFormatCode()\n {\n return $this->addressFormatCode;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns coordinates in [x, y] format
public function getCoordinates(): array;
[ "function getCoordinates() {\n return explode( ',', $this->map_coordinates );\n }", "function getCoords() {\n\t\treturn array(\n\t\t\t'x' => $this->x, \n\t\t\t'y' => $this->y,\n\t\t\t'lng' => $this->x,\n\t\t\t'lat' => $this->y,\n\t\t);\n\t}", "public function getCoordinates()\n {\n $coordinates = array();\n foreach ($this->components as $component)\n {\n $coordinates[] = $component->getCoordinates();\n }\n return $coordinates;\n }", "public function getCoordinates()\n {\n return $this->coordinates;\n }", "public function getListOfCoordinates();", "public function getCoordinates()\n {\n }", "public function getCoordinates(): array\n {\n return [$this->longitude, $this->latitude];\n }", "public function toCoordinate();", "public function getLocation()\n {\n return array($this->x, $this->y);\n }", "function get_coord(){\r\n \r\n return $this->latitud.\",\".$this->longitud;\r\n \r\n }", "public function getCoordinates() {\n\t\t$location = array(\n\t\t\t'latitude' => $this->fields['location_coordinates']['location_latitude'],\n\t\t\t'longitude' => $this->fields['location_coordinates']['location_longitude']\n\t\t);\n\n\t\treturn (object) array_map( function( $degree ) {\n\t\t\treturn is_numeric( $degree ) ? floatval( $degree ) : null;\n\t\t}, $location );\n\t}", "public function getCoordinates(){\n $coordinates = array();\n \n foreach ($this->areas as $area){\n foreach ($area->getCoordinates() as $coordarea){\n $coordinates[] = $coordarea;\n }\n }\n return $coordinates;\n }", "public function getCoordinates()\n {\n $coords = null;\n if ($this->hasLatitude() && $this->hasLongitude()) {\n $coordsArray = [\n GeoPointInterface::LATITUDE => $this->getLatitude(),\n GeoPointInterface::LONGITUDE => $this->getLongitude(),\n ];\n $coords = $this->geoPointFactory->create($coordsArray);\n }\n\n return $coords;\n }", "public function getLocation()\n {\n return [\n $this->x,\n $this->y,\n $this->width,\n $this->height,\n ];\n }", "private function getCoordinates()\n\t{\n\t\t// Check if we are overriding the default client's IP \n\t\t$ipSetting = \"\";\n\t\tif($this->ip != null) {\n\t\t\t$ipSetting = \"&IpAddress=\" . $this->ip;\n\t\t}\n\t\telse {\n\t\t\t$ipSetting = \"&IpAddress=\" . $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\t\t\n\t\t$url = self::geobytesUrl . $ipSetting;\n\t\t$result = $this->getUrl($url);\n\t\t$arr = json_decode($result, true);\n\t\tif($arr[\"geobytes\"][\"latitude\"] == null || $arr[\"geobytes\"][\"longitude\"] == null) {\n\t\t\t$latitude = 0;\n\t\t\t$longitude = 0;\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$latitude = $arr[\"geobytes\"][\"latitude\"];\n\t\t\t$longitude = $arr[\"geobytes\"][\"longitude\"];\n\t\t}\n\t\treturn array(\"latitude\"=>$latitude, \"longitude\"=>$longitude);\n\t}", "public function getXandY(): array {\n return [$this->x, $this->y];\n }", "public function getCoordinatesArray() {\n\n }", "function getNodeCoordinates() {\n if(empty($this->pool)) {\n $this->loadDefaultPool();\n }\n\n if(empty($this->count)) {\n $this->loadModel();\n }\n $db = & JFactory::getDBO();\n $query = \"SELECT geo_loc FROM #pool_stats WHERE count = \".$this->count.\" and \".\n \"geo_loc != \\\"0.0000, 0.0000\\\" and geo_loc != \\\"\\\" and geo_loc != \\\",\\\"\";\n $query = str_replace(\"#pool\", $this->pool->pool, $query);\n $db->setQuery($query);\n return $db->loadResultArray();\n }", "private function _getCoordinates()\n {\n $output = [];\n if (property_exists($this, 'coords')) {\n $count = count($this->coords)-1;\n for ($j=0; $j<=$count; $j++) {\n $title = ($this->coords[$j]['title']) ? stripslashes($this->coords[$j]['title']) : \"\";\n\n if (trim($this->coords[$j]['data'])) {\n $whole = trim($this->coords[$j]['data']);\n $row = explode(\"\\n\", Utility::removeEmptyLines($whole));\n\n foreach ($row as $loc) {\n $coord_array = Utility::makeCoordinates($loc);\n $coord = new \\stdClass();\n $coord->x = array_key_exists(1, $coord_array) ? (float)trim($coord_array[1]) : \"nil\";\n $coord->y = array_key_exists(0, $coord_array) ? (float)trim($coord_array[0]) : \"nil\";\n if (Utility::onEarth($coord) && $title != \"\") {\n $output[] = [\n 'type' => 'Feature',\n 'geometry' => ['type' => 'Point', 'coordinates' => [$coord->x,$coord->y]],\n 'properties' => ['title' => $title]\n ];\n }\n }\n }\n }\n }\n return $output;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get emails fields to search.
abstract public function getEmailsFields(?string $searchModuleName = null): array;
[ "public function getFieldsForEmail()\r\n {\r\n $submissionFields = $this->getFieldsForSubmissions();\r\n return ArrayHelper::map($submissionFields, 'name', 'label');\r\n }", "public function get_email_identifying_fields()\n {\n return Caldera_Forms_Forms::email_identifying_fields($this->form, true );\n }", "public function getSearchFields();", "public function querableFields() {\n return array(\n 'given' => 'Name.given',\n 'family' => 'Name.family',\n 'mail' => 'EmailAddress.mail'\n );\n }", "function getContactsWithEmails(){\n\t\t\t$sql = 'select firstname, lastname, stname1, city, state, zip, yob, email, phone, bio\n\t\t\t\t\tfrom voters where email <> \"\"';\n\t\t\t$list = $this -> db -> get_results($sql, 'ARRAY_A');\n\t\t\treturn $list;\n\n\t\t}", "public function getContactAllEmail()\n\t{\n\t\t$emails = 'nothing';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$response = self::call($url, $this->token, 'GET',$filter_arguments);\n\n\t\t\t$email_records = $response->records;\n\n\t\t\tforeach($email_records as $record)\n\t\t\t{\n\t\t\t\t$emails[] = $record->portal_name;\n\t\t\t}\n\t\t}\n\n\t\treturn $emails;\n\t}", "public function getEmails();", "function GetCustomFields()\n\t{\n\t\t$fields = array();\n\t\t$html_body = $this->body['h'];\n\t\tif ($html_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t$text_body = $this->body['t'];\n\t\tif ($text_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%field:(.*?)%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%%(.*?)%%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\t// in case the field went over multiple lines, strip them out.\n\t\tforeach ($fields as $p => $field) {\n\t\t\t$fields[$p] = str_replace(array(\"\\r\", \"\\n\"), \"\", $field);\n\t\t}\n\n\t\t$fields = array_unique($fields);\n\n\t\t$built_in_fields = array('emailaddress', 'unsubscribelink', 'confirmlink', 'openimage', 'mailinglistarchive', 'webversion');\n\t\tforeach ($built_in_fields as $p => $built_in_field) {\n\t\t\t$key = array_search($built_in_field, $fields);\n\t\t\tif ($key !== false) {\n\t\t\t\tunset($fields[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "public static function emails()\n {\n $emails = Company::whereType('4')->orderBy('default', 'DESC')->get();\n\n $return = [];\n foreach ($emails as $key => $email) {\n $p = [];\n $p['label'] = $email['label'];\n $p['email'] = $email['value'];\n $p['default'] = $email['default'];\n\n $return[] = $p;\n }\n \n return $return;\n }", "public function getDotmailerContactFields() {\n return $this->resources->GetDataFields();\n }", "public function getUserDataWithEmail(){\n return \\Drupal::database()\n ->select('users_field_data', 'u')\n ->fields('u', ['uid'])\n ->fields('u', ['mail'])\n ->fields('u', ['langcode'])\n ->isNotNull('u.mail')\n ->execute()\n ->fetchAll();\n }", "abstract protected function getEmailPartialParameters();", "public function fields()\n\t{\n\t\t$fullResult = $this->client->call(\n\t\t\t'crm.contact.fields'\n\t\t);\n\t\treturn $fullResult;\n\t}", "public function getEmailFormFields(DataContainer $dc)\n\t{\n\t\tif(!$dc->activeRecord)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$objFormFields = $this->Database->prepare('SELECT id,name,label FROM tl_form_field WHERE pid=? AND rgxp=?')->execute($dc->activeRecord->iso_wishlist_form, 'email');\n\t\tif(!$objFormFields->numRows)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$arrFormFields = array();\n\t\twhile($objFormFields->next())\n\t\t{\n\t\t\t$arrFormFields[$objFormFields->id] = $objFormFields->label . ' <span style=\"color:#ccc;\">[' . $objFormFields->name . ']</span>';\n\t\t}\n\t\t\n\t\treturn $arrFormFields;\t\t\n\t}", "function evf_get_all_email_fields_by_form_id( $form_id ) {\n\t$user_emails = array();\n\t$form_obj = EVF()->form->get( $form_id );\n\t$form_data = ! empty( $form_obj->post_content ) ? evf_decode( $form_obj->post_content ) : '';\n\n\tif ( ! empty( $form_data['form_fields'] ) ) {\n\t\tforeach ( $form_data['form_fields'] as $form_fields ) {\n\t\t\tif ( 'email' === $form_fields['type'] ) {\n\t\t\t\t$user_emails[ $form_fields['meta-key'] ] = $form_fields['label'];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $user_emails;\n}", "public function getEmails()\n {\n $search = request('q');\n $userList = User::all();\n $userList = User::select('*')\n ->where('email', 'like', '%'.$search.'%')\n ->get();\n $count = 0;\n // $emails[$count]['id'] = 1;\n // $emails[$count++]['text'] = $search;\n if(count($userList))\n {\n foreach ($userList as $user)\n {\n $emails[$count]['id'] = $user->id;\n $emails[$count++]['text'] = $user->email;\n }\n }\n else\n {\n $emails[$count]['id'] = '-1';\n $emails[$count++]['text'] = 'no result';\n }\n return ($emails);\n }", "public function getAccountContactEmails();", "protected function getResetPasswordMailFields()\n {\n \tif ($this->user->getUserId()) {\n \t\t$result = $this->user->getResetPasswordMailFields();\n \t} else {\n \t\t$result['reset_key'] = '';\n \t$result['reset_url'] = '';\n\n \t}\n \treturn $result;\n }", "public function getContactDataFields();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get service vouchers in use.
public function get_service_vouchers_in_use( $post_id ) { if ( ! $post_id ) { return null; } return (bool) carbon_get_post_meta( $post_id, 'ptv_service_vouchers_in_use' ); }
[ "public function getActiveVouchers() {\n $vouchers = $this->request('GET', \"/vouchers/\");\n return $this->normalizeVoucherList($vouchers);\n }", "public function getVouchers() {\n $sql = query_Select_Vouchers;\n $stmt = $this->con->prepare($sql);\n $stmt->execute();\n $vouchers = $stmt->get_result();\n $stmt->close();\n\n return $vouchers;\n }", "protected function GetActiveVouchers()\n {\n if (is_null($this->oActiveVouchers)) {\n $this->oActiveVouchers = new TShopBasketVoucherList();\n }\n\n return $this->oActiveVouchers;\n }", "public function get_occupied_servers()\n {\n $q = $this->db->where('expires >', 0)\n ->where('module', $this->module->active_service)\n ->get($this->sql_services_table);\n \n if($q->num_rows() > 0)\n {\n return $q->result();\n }\n }", "public function vouchers()\n {\n return $this->json_success(self::get_company_statistics(Auth::user()));\n }", "public function getVouchersList()\n {\n $vouchers = self::$uniFiClient->stat_voucher();\n $date = new \\DateTime();\n\n foreach ($vouchers as $voucher) {\n $interval = new \\DateInterval('PT' . $voucher->duration . 'M');\n $created = new \\DateTime();\n $created->setTimestamp($voucher->create_time);\n\n if ($created->add($interval) < $date) {\n $voucher->invalid = true;\n } else {\n $voucher->invalid = false;\n }\n }\n\n return $vouchers;\n }", "public function getAllVouchersList()\n {\n try {\n $vouchersList = Voucher::getAllVouchersList();\n return response()->json([\"message\" => \"There are \".count($vouchersList).\" available voucher(s).\", \n \"data\"=>$vouchersList]);\n } catch (NotFoundException $e) {\n return response()->json([\"message\" => $e->getMessage()]);\n }\n }", "public function findAllAvailable() {\n\t\treturn $this->availableServices;\n\t}", "abstract public function getNeededServicesList();", "public function getVouchersAction()\n {\n $vouchers = $this->getRepository()->getVoucherQuery()->getArrayResult();\n $this->View()->assign(['success' => true, 'data' => $vouchers]);\n }", "public function ListAvailableServices(){\n $args=\"\";\n $filter=\"AvailableServiceDescriptorList,AvailableServiceTypeList,AvailableServiceListVersion\";\n return $this->BASE->Upnp($this->SERVICEURL,$this->SERVICE,'ListAvailableServices',$args,$filter);\n }", "public function getRunningServices();", "public function testFetchActiveVouchers()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public static function getSelectedServiceUsers() {\n return Yii::app()->session[self::SERVICE_USERS_SELECTED];\n }", "private function getServices()\n {\n return $this->services;\n }", "public function listServices();", "public function getServices()\n {\n return ($this->services);\n }", "public function getRestrictedServices()\n {\n return $this->restricted_services;\n }", "public function getAllRunningServices()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will we autoemit the response?
public function autoEmitResponse() { return $this->_autoEmitResponse; }
[ "abstract protected function _response();", "public function response ();", "public function usesResponse();", "public static function response()\n {\n }", "function setResponse() {\n }", "public function responseAction(){\r\n $res = $this->response;\r\n }", "public function onResponse()\n {\n }", "public function setResponse() {\n }", "public function respond() {\n\t\tdebug(\"We are now building a response\",5);\n\t\t$this->response->build($this->path,$this->query,$this->fragment,$this->method,null);\n\t\t$this->response->send();\n\t}", "private function responseHandle() {\n // call hook function\n is_callable(config('hooks.onResponse')) && call_user_func(config('hooks.onResponse'), $this);\n // response data\n $this->responder->output();\n }", "abstract public function executeAndGetResponse();", "public function renderResponse() {\n $this->doRenderResponse = true;\n }", "public function disableAutoResponse()\n {\n $this->autoResponse = false;\n }", "public function send()\n {\n echo $this->response;die;\n }", "public function handlesResponse(): bool;", "private function importProcessAutoResp()\r\n\t{\r\n\t\t// TODO: add auto-responder\r\n\t}", "static function respond_with($response){\n\t\tignore_user_abort(true); # Set whether a client disconnect should abort script execution\n\t\tset_time_limit(0); # allow script to run forever\n\n\t\tob_start();\n\t\techo $response;\n\t\theader('Connection: close');\n\t\theader(\"Content-Encoding: none\"); # if compressed, content size will be smaller, and requester will continue waiting\n\t\theader('Content-Length: '.ob_get_length());\n\t\tob_end_flush(); # flush inner layer\n\t\tob_flush(); # flush all layers\n\t\tflush(); # push to browser\n\t}", "function _handler_response(&$app, &$c) {\n\t\t$c->param('app.view_http.response.status', $this->_http->getResponseCode());\n\t\t$c->param('app.view_http.response.body', $this->_http->getResponseBody());\n\t\t$c->param('app.view_http.response.headers', $this->_http->getResponseHeader());\n\t}", "public function outputResponse(){\n echo json_encode($this->response);\n //exit();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Request handlers can be chained, from Director to Controller to Form to FormField. Here, we can make a get request on a FormField.
function testRequestHandlerChaining() { $response = Director::test("testGoodBase1/TestForm/fields/MyField"); $this->assertEquals("MyField requested", $response->getBody()); /* We can also make a POST request on a form field, which could be used for in-place editing, for example. */ $response = Director::test("testGoodBase1/TestForm/fields/MyField" ,array("MyField" => 5)); $this->assertEquals("MyField posted, update to 5", $response->getBody()); }
[ "public function action_field()\n\t{\n\t\t// Get the original request from the referrer, so we can find which controller and action we should be expecting\n\t\t$req = $this->get_request(Request::$referrer);\n\n\t\tif ($req == NULL) {\n\t\t\t$response = array('status' => 'error', 'message' => 'Unable to determine original request.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$method = $this->get_form_provider($req);\n\t\t\t\t\n\t\t\t\tif ($method == NULL) {\n\t\t\t\t\t$response = array('status' => 'error', 'message' => 'Unable to find form provider for request.');\n\t\t\t\t} else {\n\t\t\t\t\t$form = $method->invoke(NULL);\n\t\t\n\t\t\t\t\t$field_name = $_POST['field'];\n\t\t\t\t\t$field = $form->find($field_name);\n\t\t\t\n\t\t\t\t\tif ($field == NULL) {\n\t\t\t\t\t\t$response = array('status' => 'error', 'message' => \"Field $field_name not found!\");\n\t\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$field->load($_POST['value']);\n\t\t\t\t\t\tif ($field->validate(TRUE))\n\t\t\t\t\t\t\t$response = array('status' => 'valid');\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$response = array('status' => 'invalid', 'message' => UTF8::ucfirst($field->error()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$response = array('status' => 'error', 'message' => $e->getMessage());\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->request->headers['Content-Type'] = 'application/json';\n\t\t$this->request->response = json_encode($response);\n\t}", "public function get() {\n $this->processRequest(); \n }", "public function testRequestHandlerChaining()\n {\n $response = Director::test(\"testGoodBase1/TestForm/fields/MyField\");\n $this->assertEquals(\"MyField requested\", $response->getBody());\n\n /* We can also make a POST request on a form field, which could be used for in-place editing, for example. */\n $response = Director::test(\"testGoodBase1/TestForm/fields/MyField\", [\"MyField\" => 5]);\n $this->assertEquals(\"MyField posted, update to 5\", $response->getBody());\n }", "public function getFormRequestInstance();", "public function getFormHandler();", "static public function get_real_get() { return self::get_real_input('GET'); }", "public function get($field);", "public function getFieldHandler();", "public function getForm();", "public abstract function getForm();", "public function getRequestFieldName();", "public function getRequest(){return $this->request;}", "public static function forGet(): self\n {\n return new self('GET');\n }", "public function getRequestAction();", "protected function addressBookGetSelectFieldRequest()\n {\n\n $resourcePath = '/api/AddressBook/SelectField';\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 ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $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 }", "protected function addressBookGetSearchFieldRequest()\n {\n\n $resourcePath = '/api/AddressBook/SearchField';\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 ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $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 }", "public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }", "protected function createRequestForm()\n\t{\n return new GetCustomFieldsForm();\n\t}", "protected function doGetDispatch() { throw new RequestException('Invalid GET request'); }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rebAdd() Will add a rebilling cycle.
public function rebAdd($amount, $date, $expr, $cycles) { $this->doRebill = '1'; $this->rebAmount = self::formatAmount($amount); $this->rebDate = $date; $this->rebExpr = $expr; $this->rebCycles = $cycles; }
[ "function rebAdd()\n {\n $this->bluepay_post_vars['unit'] = mb_strtoupper($this->bluepay_post_vars['unit']);\n $this->doRebill = '1';\n $this->rebAmount = $this->formatAmount($this->bluepay_post_vars['amount']);\n $this->rebDate = print_date(DATETIME24H, 'Y-m-d');\n $this->rebExpr = $this->bluepay_post_vars['length'] . ' ' . $this->bluepay_post_vars['unit'];\n $this->rebCycles = '';\n }", "public function rebAdd($data) {\n\t\tif (!empty($data['Transaction']['is_arb']) && !empty($data['TransactionItem'][0]['arb_settings'])) {\n\t\t\t$arbData = unserialize($data['TransactionItem'][0]['arb_settings']);\n\t\t\t\t\t\n\t\t\t// required : \"3 DAY\" to run every three days, \"1 MONTH\" to run monthly, \"1 YEAR\" to run yearly, \"2 WEEK\" to run bi-weekly, etc.\n\t\t\t$frequencyType = $arbData['ExecutionFrequencyType'] == 'Annually' ? '1 YEAR' : null;\n\t\t\t$frequencyType = $arbData['ExecutionFrequencyType'] == 'Monthly' ? '1 MONTH' : null;\n\t\t\t$frequencyType = $arbData['ExecutionFrequencyType'] == 'BiWeekly' ? '2 WEEK' : null;\n\t\t\t$frequencyType = empty($frequencyType) ? '1 MONTH' : null;\n\t\t\t\n\t\t\t\n\t\t\t$this->doRebill = '1';\n\t\t\t$this->rebAmount = self::formatAmount($arbData['PaymentAmount']);\n\t\t\t$this->rebDate = !empty($arbData['FirstPaymentDate']) ? $arbData['FirstPaymentDate'] : date('Y-m-d h:i:s');\n\t\t\t$this->rebExpr = $frequencyType; \n\t\t\t$this->rebCycles = $arbData['ExecutionFrequencyParameter'];\n\t\t}\n\t}", "public function recruiter_wise_billing(){\n\t\t\n\t\t\n\t}", "public function add_recurring($params){\n\t\t$RecurringBilling = array(\n\t\t\t\"Schedule\" => (isset($params['schedule']))?$params['schedule']:'monthly',\n\t\t\t\"Next\" => (isset($params['next_bill_date']))?$params['next_bill_date']:date('Y-m-d'),\n\t\t\t\"Amount\" => (isset($params['amount']))?$params['amount']:'',\n\t\t\t\"Enabled\" => (isset($params['enabled']))?$params['enabled']:true,\n\t\t);\n\t\tif(isset($params['subscription_expiration']))\n\t\t{\n\t\t\t$RecurringBilling['Expire'] = $params['subscription_expiration'];\n\t\t}\n\t\tif(isset($params['number_billing_periods']))\n\t\t{\n\t\t\t$RecurringBilling['NumLeft'] = $params['number_billing_periods'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$RecurringBilling['NumLeft'] = 9999;\n\t\t}\n\t\treturn $RecurringBilling;\n\t}", "public function cyclesAdd()\n {\n $this->cycles++;\n }", "public function addRecurring($cid,$allowDup,$progId,$merchId,$ccId,$affId,$daysToCharge) {\n\n $carray = array(\n php_xmlrpc_encode($this->key),\n php_xmlrpc_encode((int)$cid),\n php_xmlrpc_encode($allowDup),\n php_xmlrpc_encode((int)$progId),\n php_xmlrpc_encode((int)$merchId),\n php_xmlrpc_encode((int)$ccId),\n php_xmlrpc_encode((int)$affId),\n php_xmlrpc_encode($daysToCharge));\n return $this->methodCaller(\"InvoiceService.addRecurringOrder\",$carray);\n}", "public function addRecurringAdv($cid,$allowDup,$progId,$qty,$price,$allowTax,$merchId,$ccId,$affId,$daysToCharge) {\n\n $carray = array(\n php_xmlrpc_encode($this->key),\n php_xmlrpc_encode((int)$cid),\n php_xmlrpc_encode($allowDup),\n php_xmlrpc_encode((int)$progId),\n php_xmlrpc_encode($qty),\n php_xmlrpc_encode($price),\n php_xmlrpc_encode($allowTax),\n php_xmlrpc_encode($merchId),\n php_xmlrpc_encode((int)$ccId),\n php_xmlrpc_encode((int)$affId),\n php_xmlrpc_encode($daysToCharge));\n return $this->methodCaller(\"InvoiceService.addRecurringOrder\",$carray);\n}", "function repay_bank() {\n\t\t\n\t\t$amount = get_param('repayment');\n\t\tif (!$this->pay('bank', $amount)) {\n\t\t\t$this->cant_pay($amount);\n\t\t\treturn;\n\t\t\t}\t\t\n\t\t$bank_obj =& $this->id_to_obj('bank'); \n\t\t$bank_obj->repay($this->id, $amount);\n\t\t\n\t\tlog_and_confirm(\"repaid \" . CURRSYM . \"$amount of borrowings to the bank\",\n\t\t\t$this->id, 3);\n\t\t\n\t\t/* if the debt has been paid off, note this for system rules */\n\t\tif (!$this->debtor()) $this->paid_off_debts = TRUE;\n\t}", "protected function tuneForRecurring() {\n\t\tif ( $this->getData_Unstaged_Escaped( 'recurring' ) ) {\n\t\t\t$this->transactions['createHostedCheckout']['request']['cardPaymentMethodSpecificInput'] =\n\t\t\t\tarray_merge(\n\t\t\t\t\t$this->transactions['createHostedCheckout']['request']['cardPaymentMethodSpecificInput'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'tokenize',\n\t\t\t\t\t\t'recurringPaymentSequenceIndicator'\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t$this->transactions['createHostedCheckout']['values']['tokenize'] = true;\n\t\t\t$this->transactions['createHostedCheckout']['values']['isRecurring'] = true;\n\t\t\t$this->transactions['createHostedCheckout']['values']['recurringPaymentSequenceIndicator'] = 'first';\n\t\t\t$desc = WmfFramework::formatMessage( 'donate_interface-monthly-donation-description' );\n\t\t\t$this->transactions['createHostedCheckout']['values']['descriptor'] = $desc;\n\t\t\tif ( array_search( 'tokens', $this->transactions['getHostedPaymentStatus']['response'] ) === false ) {\n\t\t\t\t$this->transactions['getHostedPaymentStatus']['response'][] = 'tokens';\n\t\t\t}\n\t\t}\n\t}", "public function generateNextBillingCycle(DrupalDateTime $start_date, BillingCycle $billing_cycle);", "public function cancelRebillingCycle($rebillID) {\n $this->api = \"bp20rebadmin\";\n $this->transType = \"SET\";\n $this->rebillStatus = \"stopped\";\n $this->rebillID = $rebillID;\n }", "function increase_capacity () {\n\t\t\n\t\tglobal $zurich;\n\t\t\n\t\t$new_reservoir = new Reservoir();\n\t\t$new_reservoir->age = 0;\n\t\t$cost = $new_reservoir->building_cost;\n\t\tif (!$this->pay('bank', $cost)) {\n\t\t\t$this->cant_pay($cost);\n\t\t\treturn;\n\t\t\t}\n\t\t$new_key = 'a';\n\t\twhile ($this->factories[$new_key]) {\n\t\t\t$new_key = chr(ord($new_key) + 1);\n\t\t}\t\n\t\t$this->reservoirs[$new_key] = $new_reservoir;\n\t\tlog_and_confirm(\"increased capacity by building reservoir \\\"$new_key\\\"\", $this->id, 3);\n\t}", "function test_manual_recurring_payment_step_2()\n {\n\n // Stop here and mark this test as incomplete.\n $this->markTestIncomplete(\n 'skeleton for manual test of recur transaction amount'\n );\n\n // 1. enter the below values from the transaction log from test_manual_recurring_payment_step_1\n // 2. run the test and check the output for the subscriptionid and transactionid of the recur request\n\n // Set the below to match the original transaction, then run the test.\n $paymentmethod = \"KORTCERT\";\n $merchantid = 1130;\n $currency = \"SEK\";\n $cardtype = \"VISA\";\n $maskedcardno = \"444433xxxxxx1100\";\n $expirymonth = 02;\n $expiryyear = 16;\n $subscriptionid = 2960; // insert \n\n // the below applies to the recur request, and may differ from the original transaction\n $new_amount = \"2500\"; // in minor currency \n $new_customerrefno = \"test_manual_recurring_payment_step_1 \" . date('c');\n\n // below is actual test, shouldn't need to change it\n $request = new RecurTransaction(ConfigurationService::getDefaultConfig());\n $request->countryCode = \"SE\";\n $request->subscriptionId = $subscriptionid;\n $request->currency = $currency;\n $request->customerRefNo = $new_customerrefno;\n $request->amount = $new_amount;\n $response = $request->doRequest();\n\n // check that request was accepted\n $this->assertEquals(1, $response->accepted);\n\n // print the subscription id that succeeded to use to confirm the transaction\n //print_r( \" test_manual_recurring_payment_step_2() recur succeded using subscriptionid: \" . $response->subscriptionid .\" \" );\n //print_r( \" test_manual_recurring_payment_step_2() for more info, check logs for transaction: \" . $response->transactionid .\" \" ); \n }", "public function addBeverageToRefrigerator(Beverage $beverage) {\n $this->refrigerator->add( $beverage );\n }", "function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }", "public function addReference()\n {\n $this->_refCount++;\n }", "public function addRecurringOrder(OrderInterface $order);", "public function addReference() {\n\t\t$this->_refCount ++;\n\t}", "function test_manual_recurring_payment_step_2() {\n \n // Stop here and mark this test as incomplete.\n $this->markTestIncomplete(\n 'skeleton for manual test of recur transaction amount'\n );\n \n // 1. enter the below values from the transaction log from test_manual_recurring_payment_step_1\n // 2. run the test and check the output for the subscriptionid and transactionid of the recur request\n \n // Set the below to match the original transaction, then run the test.\n $paymentmethod = \"KORTCERT\"; \n $merchantid = 1130; \n $currency = \"SEK\"; \n $cardtype = \"VISA\"; \n $maskedcardno = \"444433xxxxxx1100\";\n $expirymonth = 02; \n $expiryyear = 16; \n $subscriptionid = 2960; // insert \n\n // the below applies to the recur request, and may differ from the original transaction\n $new_amount = \"2500\"; // in minor currency \n $new_customerrefno = \"test_manual_recurring_payment_step_1 \".date('c'); \n\n // below is actual test, shouldn't need to change it\n $request = new Svea\\RecurTransaction( Svea\\SveaConfig::getDefaultConfig() );\n $response = $request \n ->setSubscriptionId( $subscriptionid )\n ->setCurrency( $currency )\n ->setCustomerRefNo( $new_customerrefno )\n ->setAmount( $new_amount )\n ->setCountryCode( \"SE\" )\n ->doRequest(); \n \n // check that request was accepted\n $this->assertEquals( 1, $response->accepted ); \n\n // print the subscription id that succeeded to use to confirm the transaction\n print_r( \" test_manual_recurring_payment_step_2() recur succeded using subscriptionid: \" . $response->subscriptionid .\" \" );\n print_r( \" test_manual_recurring_payment_step_2() for more info, check logs for transaction: \" . $response->transactionid .\" \" ); \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mocks the messenger service.
private function getMessengerMock(){ $messenger = $this->prophesize(MessengerInterface::class); $messenger->addWarning(Argument::any()); $messenger->addError(Argument::any()); return $messenger; }
[ "public function getAndSetMessengerMock() {\n $this->messengerMock = $this\n ->getMockBuilder(Messenger::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n return $this->messengerMock;\n }", "private function getMessageMock()\n {\n return $this->getMockBuilder('Helthe\\Component\\Mandrill\\Message\\Message')\n ->disableOriginalConstructor()\n ->getMock();\n }", "public function testPostMessagesReceive()\n {\n }", "public function testGetWebchatGuestConversationMediarequest()\n {\n }", "public function testGetWebchatGuestConversationMessage()\n {\n }", "public function testGetConversationsChatMessage()\n {\n }", "public function testSendMessagesPermission()\n {\n $params = json_decode('{\"name\" : \"qtv\", \"age\" : 20}');\n $webhook = factory(Webhook::class)->create();\n $payload = factory(Payload::class)->create(['webhook_id' => $webhook->id]);\n $payloadHistory = factory(PayloadHistory::class)->create();\n\n $forwardChatworkService = new ForwardChatworkService(\n $webhook,\n $params,\n new PayloadHistoryRepository(),\n new MessageHistoryRepository()\n );\n\n $mock = m::mock(Chatwork::class);\n $mock->shouldReceive('room')->andThrow(new APIException(403, ['errors' => ['Permission']]));\n\n $response = $forwardChatworkService->sendMessages(['asd'], $mock, $payloadHistory->id);\n\n $this->assertDatabaseHas('message_histories', ['log' => 'Permission']);\n }", "public function testChatPostMessage()\n {\n }", "public function testGetConversationsMessagingIntegrationsWhatsapp()\n {\n }", "public function testMessagingUserComponentFactory() {\n\n }", "private function createMessageFactoryMock()\n {\n return $this->getMock('Ivory\\HttpAdapter\\Message\\MessageFactoryInterface');\n }", "public function testOnMessage()\n {\n $messager = $this\n ->getMockBuilder(LiveReloadMessager::class)\n ->setMethods(['output'])\n ->getMock();\n\n $this->sock = $this\n ->getMockBuilder('\\\\React\\\\Socket\\\\ConnectionInterface')\n ->getMock();\n\n $messager\n ->expects($this->at(2))\n ->method('output')\n ->with('Sending message \"Hello\" to 1 other connection');\n\n $connection = $this\n ->getMockBuilder('\\\\Ratchet\\\\Server\\\\IoConnection')\n ->setConstructorArgs([$this->sock])\n ->setMethods(['send'])\n ->getMock();\n\n $connection\n ->expects($this->once())\n ->method('send')\n ->with('Hello');\n\n $messager->onOpen(new IoConnection($this->sock));\n $messager->onOpen($connection);\n $messager->onMessage(new IoConnection($this->sock), 'Hello');\n }", "public function testForwardMessage()\n {\n }", "public function testGetAnSmsMessage()\n {\n }", "public function testPostWebchatGuestConversationMemberMessages()\n {\n }", "public function testGetConversation()\n {\n }", "public function testGetVoicemailMeMessages()\n {\n }", "public function testGetConversationsCall()\n {\n }", "public function testAcknowledgeChatMessage()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs a database query and returns the value of problem_caution based on the value of $id_problem passed to the function
public function get_problem_caution($id_problem) { $columns = array ('id_problem'); $records = array ($id_problem); $problem_caution_ = $this->query_from_teeth_gums_eyes_problems ( $columns, $records ); return count($problem_caution_)>0 ? $problem_caution_ [0] ['problem_caution'] : null; }
[ "public function get_problem($id_problem) {\n\t\t$columns = array ('id_problem');\n\t\t$records = array ($id_problem);\n\t\t$problem_ = $this->query_from_teeth_gums_eyes_problems ( $columns, $records );\n\t\treturn count($problem_)>0 ? $problem_ [0] ['problem'] : null;\n\t}", "public function get_problem_prevention($id_problem) {\n\t\t$columns = array ('id_problem');\n\t\t$records = array ($id_problem);\n\t\t$problem_prevention_ = $this->query_from_teeth_gums_eyes_problems ( $columns, $records );\n\t\treturn count($problem_prevention_)>0 ? $problem_prevention_ [0] ['problem_prevention'] : null;\n\t}", "public function get_genital_problem($id_genital_problem) {\n\t\t$columns = array ('id_genital_problem');\n\t\t$records = array ($id_genital_problem);\n\t\t$genital_problem_ = $this->query_from_genital_problems ( $columns, $records );\n\t\treturn count($genital_problem_)>0 ? $genital_problem_ [0] ['genital_problem'] : null;\n\t}", "function get_concept_from_ID ($concept_id)\n{\n global $errmsg;\n\n $concept_id = mysql_real_escape_string($concept_id);\n\n // Performing SQL query\n $query = \"SELECT * FROM libkw_concepts WHERE concept_id='$concept_id'\";\n $result = mysql_query($query) or die('Query failed: ' . mysql_error());\n\n\n if ($result) {\n while ($row = mysql_fetch_assoc($result)) {\n $concept_text = $row['concept_text'];\n }\n } else {\n mysql_free_result($result);\n failure($errmsg['generic']);\n }\n\n // Free resultset\n mysql_free_result($result);\n\n return $concept_text ;\n}", "public static function get_sample_test_case($problem_id) {\n $connection = DatabaseConnection::connection();\n $sql = \"SELECT sample_input, sample_output, sample_case_exec_time FROM problem_statements WHERE problem_statement_id=:id\";\n $statement = $connection->prepare($sql);\n $statement->execute(['id' => $problem_id]);\n $result = $statement->fetch();\n return $result;\n }", "public function getSolutionByProblemIdAndTestValue($problem_id, $test_value) {\r\n // check id and value exist\r\n $sql = \"SELECT problem_id, test_value, total_runs FROM solution WHERE problem_id = '$problem_id' AND test_value = '$test_value'\";\r\n $result = $this->dbQuery($sql);\r\n \r\n return $result;\r\n }", "function getPriority($id)\r\n{\r\n global $tpriorities_table, $db;\r\n\r\n $sql = \"select priority from $tpriorities_table where id='$id'\";\r\n $result = $db->query($sql);\r\n $row = $db->fetch_array($result);\r\n\r\n return $row[0];\r\n}", "public function get_problem_treatment($id_problem) {\n\t\t$columns = array ('id_problem');\n\t\t$records = array ($id_problem);\n\t\t$problem_treatment_ = $this->query_from_teeth_gums_eyes_problems ( $columns, $records );\n\t\treturn count($problem_treatment_)>0 ? $problem_treatment_ [0] ['problem_treatment'] : null;\n\t}", "function passCUSolutionid($m_solution_name)\n\t{\n\t\t$sql = \"select solution_id from cu_solutions where solution_name='\".$m_solution_name.\"'\";\n $pdo = CDBCon::GetInstance();\n $stmt = $pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n\t}", "public function getProblemId()\n {\n return $this->problem_id;\n }", "public function getProblemByID(Application $app, $id)\n\t{\n\t\t$problem = $app['redbean']->getRow( 'SELECT id, title, short_title, level FROM task ' .\n\t\t\t\t\t'WHERE id = :id',\n \t[':id' => $id]);\n\t\treturn $problem;\n\t}", "public function getProblemClassfctn($id){\n // dd($id);\n $prob = DB::table($this->problem_classifn_tb)->select('problem_description')->where('id','=',$id)->get();\n $prob->toArray();\n // dd($prob);\n // dd($prob[0]->problem_description);\n return $prob[0]->problem_description;\n }", "public function get_genital_problem_problems($id_genital_problem) {\n\t\t$columns = array ('id_genital_problem');\n\t\t$records = array ($id_genital_problem);\n\t\t$genital_problem_problems_ = $this->query_from_genital_problems ( $columns, $records );\n\t\treturn count($genital_problem_problems_)>0 ? $genital_problem_problems_ [0] ['genital_problem_problems'] : null;\n\t}", "public function getProblems($id){\n $this->db->query('SELECT * FROM problem where examid = :id');\n $this->db->bind(':id',$id);\n\n $data = $this->db->resultSet();\n return $data;\n }", "function getChoiceId($choice, $questionId){\r\n\tglobal $db;\r\n\tif(!$db) connectDb();\r\n\r\n\t$sql = \"SELECT a.id FROM choices AS a, questions AS b WHERE a.question_id=b.id AND b.id=$questionId AND a.choice='$choice'\";\r\n\r\n\t$result = null;\r\n\ttry {\r\n\t\techo $sql; echo '<br />';\r\n\t\t$result = $db->query($sql);\r\n\r\n\t}\r\n\tcatch (PDOException $e) {\r\n\t\t$error = $e->getMessage();\r\n\t}\r\n\treturn $result===false?null:$result->fetch(PDO::FETCH_OBJ)->id;\r\n\r\n}", "function getCorrection($idTest) {\n\t\trequire('db.php');\n\t\t$req = \"SELECT correctAnswer FROM question WHERE FK_idTest = $idTest\";\n\t\t$res = mysqli_query($co, $req) or die('err_getTest');\n\n\t\tif (mysqli_num_rows($res) != 0) { // if the request result have row(s)\n\t\t\t$answer = mysqli_fetch_all($res);\n\t\t\treturn $answer;\n\t\t}\n\t}", "function get_questions_detail($db_conn,$questions_id) {\n\t\t$statement = \"select * FROM M303DIAG_QUESTIONS \n\t\t\t\t\t\twhere QUESTION_ID='$questions_id'\";\n\t\tif ((($s1 = ociparse($db_conn, $statement)) === FALSE) || (ociexecute($s1) === FALSE)):\n\t\t\tdisplay_err($s1);\n\t\telse:\n\t\t\tif (($num_rows = ocifetchstatement($s1, $result)) === FALSE):\n\t\t\t\techo \"Error: no records returned\";\n\t\t\tendif;\n\t\t\t\n\t\t\treturn($result);\n\t\tendif;\n\t}", "public function get_healthProblem() {\n\t\t\n\t\t$query = $this->db->get('health_problem');\n\t\t$result = $query->result_array();\n\t\tif($result){\n\t\t\t\n\t\t\treturn $result;\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t} \n\t }", "public function get_eye_problem($id_eye_problem) {\n\t\t$columns = array ('id_eye_problem');\n\t\t$records = array ($id_eye_problem);\n\t\t$eye_problem_ = $this->query_from_eye_problems ( $columns, $records );\n\t\treturn count($eye_problem_)>0 ? $eye_problem_ [0] ['eye_problem'] : null;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parameters: > $location_a is an associative array that represents a full location where 'street' => the street portions of the location 'supplemental' => additional street portion of the location 'province' => the province, state, or territory 'country' => lowercased twoletter ISO code (REQUIRED) > $location_b is associative array that represents a full location in the same way that parameter $location_b does. Returns: a link to driving directions For now, assume siteadmin wants American driving directions linked to Yahoo! Driving Directions. Maybe later, we can add some kind of countryspecific settings page that allows the siteadmin to decide which site to link to for driving directions.
function location_driving_directions_link_ca($location_a, $location_b) { return _location_driving_directions_link_ca_yahoo($location_a, $location_b); }
[ "function _location_driving_directions_link_ca_yahoo($location_a, $location_b) {\n if (trim($location_b['country']) != 'ca' && trim($location_b['country']) != 'us') {\n return '';\n }\n\n // These are the fields that need to be in each location if we are to provide a direct\n // link to yahoo directions. If all of these fields don't have values, then we generate\n // a link to the *form* for Yahoo! driving directions rather than directly to the driving\n // directions themselves.\n\n\n foreach ($location_a as $field => $value) {\n $location_a[$field] = trim($value);\n }\n\n foreach ($location_b as $field => $value) {\n $location_b[$field] = trim($value);\n }\n\n if (_location_ca_enough_fields_for_yahoo($location_a) && _location_ca_enough_fields_for_yahoo($location_b)) {\n $yahoo_maps_path = 'dd_result';\n }\n else {\n $yahoo_maps_path = 'dd';\n }\n\n $get_query = '?';\n\n $get_query .= 'addr='. urlencode($location_a['street']) .'&amp;';\n $get_query .= 'csz='. _location_ca_yahoo_csz_get_field($location_a) .'&amp;';\n $get_query .= 'country='. urlencode($location_a['country']) .'&amp;';\n\n $get_query .= 'taddr='. urlencode($location_b['street']) .'&amp;';\n $get_query .= 'tcsz='. _location_ca_yahoo_csz_get_field($location_b) .'&amp;';\n $get_query .= 'tcountry='. urlencode($location_b['country']);\n\n $get_query .= '&amp;getrte='. urlencode('Get Directions');\n\n return ('http://ca.maps.yahoo.com/'. $yahoo_maps_path . $get_query);\n}", "function _location_driving_directions_link_de_suchen($location_a, $location_b) {\n\n foreach ($location_a as $field => $value) {\n $location_a[$field] = trim($value);\n }\n\n foreach ($location_b as $field => $value) {\n $location_b[$field] = trim($value);\n }\n\n if ($location_a['country'] == 'de' and $location_b['country'] == 'de') {\n $get_query = '?';\n\n // VON\n $query_parts = array();\n if (isset($location_a['street'])) {\n $query_parts[] = $location_a['street'];\n }\n if ($location_a['postal_code'] != '') {\n $query_parts[] = $location_a['postal_code'];\n }\n if ($location_a['city'] != '') {\n $query_parts[] = $location_a['city'];\n }\n $get_query .= 'route_from='. urlencode(implode(', ', $query_parts));\n\n // NACH\n $query_parts = array();\n if (isset($location_b['street'])) {\n $query_parts[] = $location_b['street'];\n }\n if ($location_b['postal_code'] != '') {\n $query_parts[] = $location_b['postal_code'];\n }\n if ($location_b['city'] != '') {\n $query_parts[] = $location_b['city'];\n }\n $get_query .= '&amp;route_to='. urlencode(implode(', ', $query_parts));\n\n return ('http://www.suchen.de/route'. $get_query);\n }\n}", "public function DirectionsLink()\n {\n return \"https://www.google.com/maps/dir//\".urlencode($this->Address);\n }", "function fn_get_available_destination($location)\n{\n $result = false;\n\n /**\n * Prepare params for getting available destination\n *\n * @param array $location Location for which destination is required\n */\n fn_set_hook('get_available_destination_pre', $location);\n\n $country = !empty($location['country']) ? $location['country'] : '';\n $state = !empty($location['state']) ? $location['state'] : '';\n $zipcode = !empty($location['zipcode']) ? $location['zipcode'] : '';\n $city = !empty($location['city']) ? $location['city'] : '';\n $address = !empty($location['address']) ? $location['address'] : '';\n\n if (!empty($country)) {\n\n $state_id = fn_get_state_id($state, $country);\n\n $condition = '';\n if (AREA == 'C') {\n $condition .= fn_get_localizations_condition('localization');\n\n if (!empty($condition)) {\n $condition = db_quote('OR (1 ?p)', $condition);\n }\n }\n\n $__dests = db_get_array(\"SELECT a.* FROM ?:destination_elements as a LEFT JOIN ?:destinations as b ON b.destination_id = a.destination_id WHERE b.status = 'A' ?p\", $condition);\n\n $destinations = array();\n foreach ($__dests as $k => $v) {\n $destinations[$v['destination_id']][$v['element_type']][] = $v['element'];\n }\n\n $concur_destinations = array();\n\n foreach ($destinations as $dest_id => $elm_types) {\n // Significance level. The more significance level means the most amount of coincidences\n $significance = 0;\n $dest_countries = !empty($elm_types['C']) ? $elm_types['C'] : array();\n foreach ($elm_types as $elm_type => $elms) {\n // Check country\n if ($elm_type == 'C') {\n $suitable = fn_check_element($elms, $country);\n if ($suitable == false) {\n break;\n }\n\n $significance += 1 * (1 / count($elms));\n }\n\n // Check state\n if ($elm_type == 'S') {\n // if country is in destanation_countries and it haven't got states,\n // we suppose that destanation cover all country\n if (!in_array($country, $dest_countries) || fn_get_country_states($country)) {\n $suitable = fn_check_element($elms, $state_id);\n if ($suitable == false) {\n break;\n }\n } else {\n $suitable = true;\n }\n $significance += 2 * (1 / count($elms));\n }\n // Check city\n if ($elm_type == 'T') {\n $suitable = fn_check_element($elms, $city, true);\n if ($suitable == false) {\n break;\n }\n $significance += 3 * (1 / count($elms));\n }\n // Check zipcode\n if ($elm_type == 'Z') {\n $suitable = fn_check_element($elms, $zipcode, true);\n if ($suitable == false) {\n break;\n }\n $significance += 4 * (1 / count($elms));\n }\n\n // Check address\n if ($elm_type == 'A') {\n $suitable = fn_check_element($elms, $address, true);\n if ($suitable == false) {\n break;\n }\n $significance += 5 * (1 / count($elms));\n }\n }\n\n $significance = number_format($significance, 4, '.', '');\n\n if ($suitable == true) {\n $concur_destinations[$significance][] = $dest_id;\n }\n }\n\n if (!empty($concur_destinations)) {\n ksort($concur_destinations, SORT_NUMERIC);\n $concur_destinations = array_pop($concur_destinations);\n\n $result = reset($concur_destinations);\n }\n }\n\n /**\n * Post processing of available destination\n *\n * @param array $location Location information\n * @param string $result Available destination\n * @param array $concur_destinations Destinations list\n */\n fn_set_hook('get_available_destination_post', $location, $result, $concur_destinations);\n\n return $result;\n}", "function dist_between_geo($geo1,$geo2){\n\t\t$c = curl_init();\n\t\t$url=\"https://maps.googleapis.com/maps/api/directions/json\";\n\t\t$destlat=$geo2[0];\n\t\t$destlng=$geo2[1];\n\t\t$lat=$geo1[0];\n\t\t$lng=$geo1[1];\n\t\t$argstr=\"?sensor=false&origin=\".$lat.\",\".$lng.\"&destination=\".$destlat.\",\".$destlng;\n curl_setopt($c, CURLOPT_URL, $url . $argstr);\n curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE);\n $data = curl_exec($c);\n curl_close($c);\n $d = json_decode($data);\n //echo $url.$argstr;\n if ($d->status != \"OK\") {\n if ($d->status == \"ZERO_RESULTS\") {\n return FALSE;\n }\n \n throw new Exception(\"API call to Google Maps Directions returned: \" . $d->status);\n }\n \n $no_of_legs = count($d->routes[0]->legs);\n\t\t//the distance to the nearest place in km\n\t\t//echo \"DIST\".$d->routes[0]->legs[0]->distance->value.\"DIST\";\n return round($d->routes[0]->legs[0]->distance->value, 1);\n\t}", "function DistanceBetweenLocation($location1, $location2){\n\t\t $dis = \"SELECT * FROM distance_info WHERE (location1 = '\".$location1.\"' AND location2 = '\".$location2.\"') OR (location1 = '\".$location2.\"' AND (location2 = '\".$location1.\"' )\";\n\t\tforeach($bdd -> query($dis) as $row){\n\t\t\t$distance = $row['distance'];\n\t\t\treturn $distance;\n\t\t}\n\t\t\n\t}", "function location_map_link($location = array(), $link_text = 'See map: ') {\n if (!isset($location['country']) || $location['country'] == 'xx') {\n return '';\n }\n\n location_load_country($location['country']);\n\n $default_func = 'location_map_link_'. $location['country'] .'_default_providers';\n $providers_func = 'location_map_link_'. $location['country'] .'_providers';\n $providers = function_exists($providers_func) ? $providers_func() : array();\n $selected_providers = variable_get('location_map_link_'. $location['country'], function_exists($default_func) ? $default_func() : array());\n\n $links = array();\n foreach ($selected_providers as $mapper) {\n $link_func = 'location_map_link_'. $location['country'] .'_'. $mapper;\n if (function_exists($link_func)) {\n if ($link = $link_func($location)) {\n $links[] = '<a href=\"'. $link .'\"'. (variable_get('location_maplink_external', 0) ? ' '. variable_get('location_maplink_external_method', 'target=\"_blank\"') : '') .'>'. $providers[$mapper]['name'] .'</a>';\n }\n }\n }\n if (count($links)) {\n return '<div class=\"location map-link\">'. t($link_text) . implode($links, \", \") .'</div>';\n }\n else {\n return NULL;\n }\n}", "function cd_map_link( $address, $city, $state, $zip ) {\n\n\n $address = (string)$address;\n $city = (string)$city;\n $state = (string)$state;\n $zip = (string)$zip;\n\n $address = preg_replace('/\\s+/', '+', $address);\n $city = preg_replace('/\\s+/', '+', $city);\n $state = preg_replace('/\\s+/', '+', $state);\n $zip = preg_replace('/\\s+/', '+', $zip);\n\n $href = $address . '+' . $city . '+' . $state . '+' . $zip;\n return $href;\n}", "public static function matchSourceLocateyness(array &$a, array &$b) {\n\t\tif( self::containsSourceLocations($a) and self::containsSourceLocations($b) ) return;\n\t\t\n\t\t$a = self::stripSourceLocations($a);\n\t\t$b = self::stripSourceLocations($b);\n\t}", "function latlon_distance_rhumb($lat_a, $lon_a, $lat_b, $lon_b) {\n // Convert our degrees to radians:\n list($lat1, $lon1, $lat2, $lon2) =\n _deg2rad_multi($lat_a, $lon_a, $lat_b, $lon_b);\n\n // First of all if this a true East/West line there is a special case:\n if ($lat1 == $lat2) {\n $mid = cos($lat1);\n } else {\n $delta = log( tan(($lat2 / 2) + (M_PI / 4))\n / tan(($lat1 / 2) + (M_PI / 4)) );\n $mid = ($lat2 - $lat1) / $delta;\n }\n\n // Calculate difference in longitudes, and if over 180, go the other\n // direction around the Earth as it will be a shorter distance:\n $dlon = abs($lon2 - $lon1);\n $dlon = ($dlon > M_PI) ? (2 * M_PI - $dlon) : $dlon;\n $distance = sqrt( pow($lat2 - $lat1,2) +\n (pow($mid, 2) * pow($dlon, 2)) ) * EARTH_R;\n\n return $distance;\n}", "public static function distanceBetween($location1, $location2) {\n $location1Coordinates = $location1->getLocation();\n $location2Coordinates = $location2->getLocation();\n $lat1 = $location1Coordinates['latitude'];\n $lon1 = $location1Coordinates['longitude'];\n $lat2 = $location2Coordinates['latitude'];\n $lon2 = $location2Coordinates['longitude'];\n\n return self::EARTH_RADIUS *\n (acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +\n cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad(abs($lon2 - $lon1)))));\n }", "private function generateAddress($location)\n {\n $locationName =$location->locationKeyCode;\n\n $locationId = $location->id;\n\n $location = $this->location->findOrFail($locationId);\n\n $levelId = $location->level_id;\n\n $level = $this->level_building->findOrFail($levelId);\n\n $levelName = $level->levelName;\n\n $building_id = $level->building_id;\n\n $building = $this->building->findOrFail($building_id);\n\n $buildingName = $building->buildingKeyCode;\n\n $street_id = $building->street_id;\n\n\n\n $street = $this->street->findOrFail($street_id);\n\n $streetName = $street->streetKeyCode;\n\n $agent_id = $street->agent_id;\n\n\n $this->agent_id =$agent_id;\n\n\n //$agent = $this->agent->findOrFail($agent_id);\n\n $agentName = \\App\\Agent::where('user_id', '=', $agent_id)->first()->agentName;\n\n return $buildingName.$levelName.$locationName. \"-\" . $streetName . \" ( \". $agentName . \" ) \";\n }", "public function getShortestPaths($a, $b)\n {\n $q = new Query(\n $this->db,\n <<<EOHD\nSTART a=node:words(word='$a'), b=node:words(word='$b')\nMATCH p=allshortestPaths((a)-[:IS_ADJACENT_TO*]->(b))\nRETURN p;\nEOHD\n );\n $resultSet = $q->getResultSet();\n $shortestPaths = array();\n foreach ($resultSet as $row) {\n $path = array();\n foreach ($row['p']->getNodes() as $node) {\n $path[] = $node->getProperty('word');\n }\n $shortestPaths[] = $path;\n }\n return array_unique($shortestPaths, SORT_REGULAR);\n }", "function sc_refer_cta( $atts ) {\n\t$join = shortcode_atts( array('location' => 'side'), $atts );\n\t$location = ( $join['location'] );\n\t$output = '<a href=\"'.site_url().'/refer-a-business\">';\n\t$output .= '<img src=\"'. get_template_directory_uri().'/img/tbw-grfx-'.$location.'-refer-btn.png\">';\n\t$output .= '</a>';\n\treturn $output;\n}", "function simple_latlong_angle($lat_a, $long_a, $lat_b, $long_b)\n{\n list($dx, $dy) = simple_latlong2xy($lat_a, $long_a, $lat_b, $long_b);\n return atan2($dy, $dx);\n}", "public static function LatLonBearing($lat1, $lon1, $lat2, $lon2)\n {\n\n // This is the initial bearing which if followed in a straight line will take\n // you from the start point to the end point; in general, the bearing you are\n // following will have varied by the time you get to the end point (if you were\n // to go from say 35°N,45°E (Baghdad) to 35°N,135°E (Osaka), you would start on\n // a bearing of 60° and end up on a bearing of 120°!).\n\n // If you are standing at ($lat1,$lon1) and pointing the shortest distance to\n // ($lat2,$lon2) this function tells you which direction you are pointing.\n // Returns one of the following 16 directions.\n // N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW\n\n // convert to radians to work with trig functions\n $lat1 = deg2rad($lat1);\n $lon1 = deg2rad($lon1);\n $lat2 = deg2rad($lat2);\n $lon2 = deg2rad($lon2);\n\n $y = sin($lon2 - $lon1) * cos($lat2);\n $x = cos($lat1) * sin($lat2) - sin($lat1) * cos($lat2) * cos($lon2 - $lon1);\n $bearing = atan2($y, $x);\n\n // Covert from radians to degrees\n $bearing = sprintf('%5.1f', rad2deg($bearing));\n\n // Convert to directions\n // -180=S -135=SW -90=W -45=NW 0=N 45=NE 90=E 135=SE 180=S\n if ($bearing < -191.25) {\n $direction = '---';\n } elseif ($bearing < -168.75) {\n $direction = gettext('S');\n } elseif ($bearing < -146.25) {\n $direction = gettext('SSW');\n } elseif ($bearing < -123.75) {\n $direction = gettext('SW');\n } elseif ($bearing < -101.25) {\n $direction = gettext('WSW');\n } elseif ($bearing < -78.75) {\n $direction = gettext('W');\n } elseif ($bearing < -56.25) {\n $direction = gettext('WNW');\n } elseif ($bearing < -33.75) {\n $direction = gettext('NW');\n } elseif ($bearing < -11.25) {\n $direction = gettext('NNW');\n } elseif ($bearing < 11.25) {\n $direction = gettext('N');\n } elseif ($bearing < 33.75) {\n $direction = gettext('NNE');\n } elseif ($bearing < 56.25) {\n $direction = gettext('NE');\n } elseif ($bearing < 78.75) {\n $direction = gettext('ENE');\n } elseif ($bearing < 101.25) {\n $direction = gettext('E');\n } elseif ($bearing < 123.75) {\n $direction = gettext('ESE');\n } elseif ($bearing < 146.25) {\n $direction = gettext('SE');\n } elseif ($bearing < 168.75) {\n $direction = gettext('SSE');\n } elseif ($bearing < 191.25) {\n $direction = gettext('S');\n } else {\n $direction = '+++';\n }\n\n// $direction = $bearing . \" \" . $direction;\n\n return $direction;\n }", "public function testShouldGetGeoLocationOfObjectAddress()\n\t {\n\t\t$xml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/datasets/adverts/a.xml\"));\n\t\t$advert = new Advert($xml);\n\n\t\t$advert->getGeoLocation();\n\t\t$this->assertRegExp(\"/[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{4}/ui\", $advert->date);\n\t\t$advert->createXML();\n\t\t$this->assertEquals(104.360772, $advert->lat);\n\t\t$this->assertEquals(52.250526, $advert->lang);\n\n\t\t$expectedxml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/datasets/adverts/b.xml\"));\n\t\t$advertxml = new SimpleXMLElement($advert->doc->saveXML());\n\t\t$props = [\"country\", \"region\", \"city\", \"address\", \"lat\", \"lang\", \"description\", \"price\", \"phone\", \"link\", \"rooms\", \"area\", \"name\", \"comission\", \"floor\", \"floors\"];\n\t\tforeach ($props as $prop)\n\t\t {\n\t\t\tif (empty($advertxml->$prop) === false && empty($expectedxml) === false)\n\t\t\t {\n\t\t\t\t$this->assertEquals($expectedxml->$prop, $advertxml->$prop);\n\t\t\t } //end if\n\n\t\t } //end foreach\n\n\t }", "function fn_exim_pickup_set_destinations($destinations, $lang_code, $main_destination = null)\n{\n if (!$main_destination) {\n return fn_exim_pickup_prepare_destinations($destinations, $lang_code);\n }\n\n if (!is_numeric($main_destination)) {\n $destinations .= $destinations ? \",{$main_destination}\" : $main_destination;\n return fn_exim_pickup_prepare_destinations($destinations, $lang_code);\n }\n\n $prepared_destinations = explode(',', fn_exim_pickup_prepare_destinations($destinations, $lang_code));\n $prepared_destination[] = $main_destination;\n return implode(',', array_unique($prepared_destinations));\n}", "function GetDrivingDistance($lat1, $long1, $lat2, $long2)\n\t{\n\t\t\n\t\t$url = \"https://maps.googleapis.com/maps/api/distancematrix/json?key=AIzaSyAQggnzNxn0UFplcovbvhXQPsA8-zUsDk8&origins=\".$lat1.\",\".$long1.\"&destinations=\".$lat2.\",\".$long2.\"&mode=driving&language=pl-PL\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response_a = json_decode($response, true);\n\t\t$dist = $response_a['rows'][0]['elements'][0]['distance']['value'];\n\t\t$time = $response_a['rows'][0]['elements'][0]['duration']['value'];\n\t\n\t\treturn array('distance' => $dist, 'time' => $time);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves metadata about data relations that depend on the given table name and schema. The structure of each element should be a KeyedCollection with the following keys: foreignTableName, foreignColumnName, localColumnName
public function getDependentDataRelations($schema, $tableName) { $sqlCommand = new MySqlCommand(); $strSQL = "SELECT TABLE_NAME as foreignTableName, REFERENCED_COLUMN_NAME as localColumnName, COLUMN_NAME as foreignColumnName FROM information_schema.key_column_usage WHERE REFERENCED_TABLE_NAME = ? AND REFERENCED_TABLE_SCHEMA = ?"; $sqlCommand->setCommandText($strSQL); $sqlCommand->addParam("Table", MySqlParameter::MYSQL_TYPE_VARCHAR, $tableName); $sqlCommand->addParam("Schema", MySqlParameter::MYSQL_TYPE_VARCHAR, $schema); return $this->getConnection()->executeQuery($sqlCommand); }
[ "public function getDependentDataRelations($schema, $tableName)\n {\n $sqlCommand = new MsSqlCommand();\n $strSQL = \"\n SELECT \n foreignTableName = FK.TABLE_NAME, \n foreignColumnName = CU.COLUMN_NAME, \n localTableName = PK.TABLE_NAME, \n localColumnName = PT.COLUMN_NAME, \n constraintName = C.CONSTRAINT_NAME \n FROM \n INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C \n INNER JOIN \n INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK \n ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME \n INNER JOIN \n INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK \n ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME \n INNER JOIN \n INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU \n ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME \n INNER JOIN \n ( \n SELECT \n i1.TABLE_NAME, i2.COLUMN_NAME \n FROM \n INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1 \n INNER JOIN \n INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2 \n ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME \n WHERE i1.CONSTRAINT_TYPE = 'PRIMARY KEY' \n ) PT \n ON PT.TABLE_NAME = PK.TABLE_NAME WHERE PK.TABLE_NAME = '{$tableName}'\";\n \n $sqlCommand->setCommandText($strSQL);\n return $this->getConnection()->executeQuery($sqlCommand);\n }", "public function discoverRelationships()\n\t{\n\t\tglobal $_DB;\n\n\t\t$query = \"SELECT KCU.CONSTRAINT_NAME, KCU.COLUMN_NAME, C.COLUMN_COMMENT, KCU.REFERENCED_TABLE_SCHEMA, KCU.REFERENCED_TABLE_NAME, \n\t\t\t\t T.TABLE_COMMENT, KCU.REFERENCED_COLUMN_NAME, C1.COLUMN_COMMENT\n\t\t\t\t FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU \n\t\t\t\t JOIN INFORMATION_SCHEMA.COLUMNS C \n\t\t\t\t \tON C.TABLE_SCHEMA = KCU.TABLE_SCHEMA AND C.TABLE_NAME = KCU.TABLE_NAME AND C.COLUMN_NAME = KCU.COLUMN_NAME \n\t\t\t\t JOIN INFORMATION_SCHEMA.COLUMNS C1\n\t\t\t\t ON C1.TABLE_SCHEMA = KCU.REFERENCED_TABLE_SCHEMA AND C1.TABLE_NAME = KCU.REFERENCED_TABLE_NAME AND C1.COLUMN_NAME = KCU.REFERENCED_COLUMN_NAME \n\t\t\t\t JOIN INFORMATION_SCHEMA.TABLES T\n\t\t\t\t \tON T.TABLE_SCHEMA = KCU.REFERENCED_TABLE_SCHEMA AND T.TABLE_NAME = KCU.REFERENCED_TABLE_NAME \n\t\t\t\t WHERE KCU.TABLE_SCHEMA = :schemaName \n\t\t\t\t AND KCU.TABLE_NAME = :tableName \n\t\t\t\t AND KCU.REFERENCED_TABLE_NAME IS NOT NULL \n\t\t\t\t ORDER BY C.ORDINAL_POSITION, KCU.COLUMN_NAME\";\n\t\t$params = array(':schemaName' => $this->getTableSchema(), ':tableName' => $this->getTableName());\n\n\t\t$statement = $_DB['thinker']->prepare($query);\n\t\t$statement->execute($params);\n\n\t\t$results = $statement->fetchAll(PDO::FETCH_NUM);\n\n\t\t$output = array();\n\n\t\tif($results)\n\t\t{\n\t\t\tforeach($results as $t)\n\t\t\t{\n\t\t\t\tlist($relationName, $columnName, $columnComment, $refSchema, $refTable, $refTableComment, $refColumnName, $refColumnComment) = $t;\n\n\t\t\t\t$output[] = THINKER_Object_Relationship::createFromParams($relationName, $this->getTableSchema(), $this->getTableName(), $this->getTableFriendlyName(), \n\t\t\t\t\t$columnName, $columnComment, $refSchema, $refTable, $refTableComment, $refColumnName, $refColumnComment);\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "private function getRelationMeta($name)\n {\n $query = $this->owner->getRelation($name);\n $remoteKey = array_values($query->link);\n $remoteKey = reset($remoteKey);\n $foreignKey = array_keys($query->via->link);\n $foreignKey = reset($foreignKey);\n return [\n 'foreignKey' => $foreignKey,\n 'remoteKey' => $remoteKey,\n 'tableName' => reset($query->via->from),\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 describeReferences($table, $schema=null){ }", "public function loadDependantTables()\n {\n foreach ($this->foreignListFetchers as $collectionFieldName => &$listFetcherDef) {\n /** @var $listFetcher ListFetcher */\n $listFetcher = $listFetcherDef['listFetcher'];\n /** @var $foreignKey ForeignKey */\n $foreignKey = $listFetcherDef['foreignKey'];\n $filter = array();\n foreach ($foreignKey->getReferences() as $column => $foreignColumn) {\n $filter[$column] = $this->$foreignColumn;\n }\n $this->additionalData[$collectionFieldName] = $listFetcher->getList($filter);\n }\n }", "abstract public function allTablesReferenced();", "public function getReferencedTable();", "public function getReferencedSchema();", "public function getRelations();", "public function getRelationships();", "abstract public function getStoreRelationTable();", "function getReferencedTableData($entity)\n{\n $tables = array();\n foreach($entity['fields'] as $f){\n $fk = getFK($entity['tablename'], $f['name']);\n \n $referenced_table = \"\";\n $title_field = \"\";\n $likely_page = \"\";\n // Get the referenced table and the title field to show\n // Now, what can we show? Is there a more useful field for\n // the valuelist than an id or the like? Maybe the title_field\n // of a page? Let's see if we can get one\n if ($fk['page'] == $entity[\"pagename\"]) {\n $page_info = getPageInfo($fk['ref_page']);\n $referenced_table = $page_info['tablename'];\n if (isMultipage($fk['ref_page'])) {\n $title_field = $page_info['title_field'];\n } else {\n $title_field = 'heading';\n }\n $likely_page = $fk['ref_page'];\n } else if ($fk['table'] == $entity['tablename']) {\n $referenced_table = $fk['ref_table'];\n //in principle, _sys_sections could be referenced - that's easy\n if ($referenced_table == '_sys_sections') {\n $title_field = 'heading';\n $likely_page = $fk['ref_page'];\n } else {\n // more likely are multipages\n $pk_field = getPKName($referenced_table);\n $pq = \"SELECT name,title_field FROM _sys_multipages WHERE tablename = '\".$referenced_table.\"'\";\n $result = pp_run_query($pq);\n $row = $result[0];\n if (count($result)>1) {\n $title_field = $pk_field;\n }\n //no chance of a good choice :-(\n else {\n // we have the one page for this table!\n $title_field = $row['title_field'];\n if ($title_field==\"\") {\n $title_field = $pk_field;\n }\n }\n $likely_page = $row['name'];\n }\n }\n if ($referenced_table != \"\") {\n $tables[] = array('fk'=>$fk,'table_name'=>$referenced_table, 'likely_page' => $likely_page , 'title_field' => $title_field);\n }\n }\n return $tables;\n}", "public function loadManyToOneRelationships($schemaArray, $table_entries) {\n\n // Identify the ManyToOne columns\n foreach ($schemaArray as $col) {\n\n $isManyToOneColumn = (\n array_key_exists('relationship', $col) &&\n $col['relationship']['type'] == 'MANYTOONE'\n );\n\n if ($isManyToOneColumn) {\n\n $foreign_id_column = $col['id'];\n\n if(array_key_exists('relationship', $col)) {\n $foreign_table_name = $col['relationship']['table_related'];\n\n } else {\n $message = 'Non single_file Many-to-One relationship lacks `table_related` value.';\n if(array_key_exists('column_name', $col)) {\n $message .= \" Column: \" . $col['column_name'];\n }\n if(array_key_exists('table_name', $col)) {\n $message .= \" Table: \" . $col['table_name'];\n }\n throw new Exception\\RelationshipMetadataException($message);\n }\n\n // Aggregate all foreign keys for this relationship (for each row, yield the specified foreign id)\n $yield = function($row) use ($foreign_id_column, $table_entries) {\n if(array_key_exists($foreign_id_column, $row)) {\n return $row[$foreign_id_column];\n }\n };\n $ids = array_map($yield, $table_entries);\n if (empty($ids)) {\n continue;\n }\n\n if(!TableSchema::canGroupViewTable($foreign_table_name)) {\n continue;\n }\n\n // Fetch the foreign data\n $select = new Select($foreign_table_name);\n $select->where->in('id', $ids);\n\n $columnNames = TableSchema::getAllNonAliasTableColumnNames($foreign_table_name);\n $select->columns($columnNames);\n\n $TableGateway = new RelationalTableGateway($this->acl, $foreign_table_name, $this->adapter);\n $rowset = $TableGateway->selectWith($select);\n $results = $rowset->toArray();\n\n $foreign_table = array();\n $columns = TableSchema::getAllNonAliasTableColumns($foreign_table_name);\n foreach ($results as $row) {\n $row = $this->parseRecordValuesByMysqlType($row, $columns);\n $foreign_table[$row['id']] = $row;\n }\n\n // Replace foreign keys with foreign rows\n foreach ($table_entries as &$parentRow) {\n if(array_key_exists($foreign_id_column, $parentRow)) {\n $foreign_id = (int) $parentRow[$foreign_id_column];\n $parentRow[$foreign_id_column] = null;\n // \"Did we retrieve the foreign row with this foreign ID in our recent query of the foreign table\"?\n if(array_key_exists($foreign_id, $foreign_table)) {\n $parentRow[$foreign_id_column] = $foreign_table[$foreign_id];\n }\n }\n }\n }\n }\n return $table_entries;\n }", "public static function getRelationsDefinition();", "function tripal_feature_chado_feature_relationship_schema() {\n $description = array();\n\n // Default table description in tripal_core.schema.api.inc: tripal_core_chado_feature_dbxref_schema()\n\n $description['foreign keys']['feature'] = array(\n 'table' => 'feature',\n 'columns' => array(\n 'object_id' => 'feature_id',\n 'subject_id' => 'feature_id',\n ),\n );\n $description['foreign keys']['cvterm'] = array(\n 'table' => 'cvterm',\n 'columns' => array(\n 'type_id' => 'cvterm_id',\n ),\n );\n return $description;\n}", "function tripal_stock_chado_contact_relationship_schema() {\n $description = array();\n\n $description['foreign keys']['cvterm'] = array(\n 'table' => 'cvterm',\n 'columns' => array(\n 'type_id' => 'cvterm_id',\n ),\n );\n\n $description['foreign keys']['contact'] = array(\n 'table' => 'contact',\n 'columns' => array(\n 'subject_id' => 'contact_id',\n 'object_id' => 'contact_id',\n ),\n );\n \n return $description;\n}", "abstract public function getRelations(): array;", "public function getForeignKeys ();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if this message is for a campaign.
public function isCampaign(): bool { return $this->source_type === Campaign::class; }
[ "public function isCampaign(): bool\n {\n return $this->isCampaign;\n }", "public function hasCampaign()\n {\n return ! is_null($this->campaign);\n }", "public function is_campaign() {\n\t\tif (isset($this->row['starts_at']) && $this->row['starts_at'] &&\n\t\t isset($this->row['ends_at']) && isset($this->row['ends_at'])) {\n\t\t return strtotime($this->row['starts_at']) <= time() && \n\t\t\t\t strtotime($this->row['ends_at']) >= time();\n\t\t} else if (isset($this->row['campaign_price']) && $this->row['campaign_price']) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function getCampaign()\n {\n return $this->isCampaign() ? $this->campaign : null;\n }", "function tve_ult_campaign_has_conversions( $campaign ) {\n\t// TODO: implement this after Conversion Events are implemented\n\n\t$campaign_id = is_numeric( $campaign ) ? $campaign : $campaign->ID;\n\n\treturn true;\n\n}", "private function retrieve_campaign()\n {\n global $wpdb;\n /* Executes the query */\n $query = 'SELECT * FROM ' . wp_adpress_campaigns::campaigns_table() . ' WHERE id=' . $this->id . ';';\n $results = $wpdb->get_row($query, ARRAY_A);\n if ($results === false) {\n $this->state = 'unset';\n return false;\n } else {\n $this->state = 'set';\n /* Populate the campaign object */\n $this->settings = unserialize($results['settings']);\n $this->ad_definition = unserialize($results['ad_definition']);\n return true;\n }\n }", "public static function isUserPartOfCurrentCampaign()\n {\n $member = CampaignUser::where('campaign_id', Session::get('campaign_id'))\n ->where('user_id', Auth::user()->id)\n ->first();\n return !empty($member);\n }", "public function getCampaign()\n {\n return $this->campaign;\n }", "function _healthgovau_find_current_campaign() {\n if (arg(0) == 'node' && is_numeric(arg(1))) {\n // It is a node page.\n $node = node_load(arg(1));\n if ($node->type == 'campaign') {\n // This is a campaign node.\n return $node->nid;\n }\n else if (isset($node->field_campaign[LANGUAGE_NONE])) {\n // This is a campaign related node.\n return $node->field_campaign[LANGUAGE_NONE][0]['target_id'];\n }\n \n return FALSE;\n }\n else {\n // This is not a node page.\n if (arg(0) == 'campaign' && is_numeric(arg(1))) {\n // This is a campaign related view page.\n return arg(1);\n }\n return FALSE;\n }\n}", "public function getCampaign()\n {\n return isset($this->campaign) ? $this->campaign : '';\n }", "public function getTeamCampaign()\n {\n return $this->team->campaign;\n }", "public function canBeCancelled(): bool\n {\n // we can cancel campaigns that still have draft messages, because they haven't been entirely dispatched\n // a campaign that doesn't have any more draft messages (i.e. they have all been sent) cannot be cancelled, because the campaign is completed\n\n if ($this->status_id === CampaignStatus::STATUS_SENT && $this->save_as_draft && $this->sent_count !== $this->messages()->count()) {\n return true;\n }\n\n return in_array($this->status_id, [CampaignStatus::STATUS_QUEUED, CampaignStatus::STATUS_SENDING], true);\n }", "public function can_access_campaign($campaign_client)\n {\n\n $user_clients = $this->check_user_clients();\n\n if($user_clients) {\n\n foreach ($user_clients as $client) {\n\n if($campaign_client[0] == $client) return true;\n\n }\n\n }\n\n return false;\n\n }", "public function getCampaign()//: Campaign\n\t{\n\t\treturn Campaign::getInstance($this->campaignID);\n\t}", "public function is_campaign_sent( $contact_id, $message_id, $campaign_id ) {\n\n\t\t\tglobal $wpdb;\n\n\t\t\t$ig_actions_table = IG_ACTIONS_TABLE;\n\n\t\t\t$sql = \"SELECT count(*) FROM $ig_actions_table WHERE contact_id = %d AND message_id = %d AND campaign_id = %d AND type = %d\";\n\n\t\t\treturn $wpdb->get_var( $wpdb->prepare( $sql, $contact_id, $message_id, $campaign_id, IG_MESSAGE_SENT ) );\n\t\t}", "public function getCampaignCriterion()\n {\n return $this->campaign_criterion;\n }", "public function getMailChimpCampaigns() {\n $result = $this->campaign->getCampaigns($this->default['campaign_fields']);\n if($result) {\n $count = $result['total_items'];\n if($count > 0) {\n return $result['campaigns'];\n }\n }\n return false;\n }", "public function getDefaultCampaign(): ?bool\n {\n return $this->_default_campaign;\n }", "public function getCampaignId()\n {\n return $this->campaign_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the language column
public function getLanguageColumn() { return $this->strLangColumn; }
[ "public function getLanguageIdColumnName() {}", "private function getColumn()\n {\n $t_colums = array('ru_name', 'uk_name');\n switch ($this->locale) {\n case 'uk':\n return $t_colums[1];\n break;\n default:\n return $t_colums[0];\n }\n }", "public function getTranslationLocaleColumn()\n {\n return 'locale';\n }", "function getColumnByLang($column){\n\t$result = \"\";\n\tif (isEN()){\n\t\t$result = $column.\"EN\";\n\t}\n\tif (isTW()){\n\t\t$result = $column.\"TW\";\n\t}\n\tif (isCN()){\n\t\t$result = $column.\"CN\";\n\t}\n\treturn $result;\n}", "protected function get_first_language_column() {\n\t\tforeach ( $this->model->get_languages_list() as $language ) {\n\t\t\tif ( empty( $this->filter_lang ) || $language->slug != $this->filter_lang->slug ) {\n\t\t\t\t$columns[] = 'language_' . $language->slug;\n\t\t\t}\n\t\t}\n\n\t\treturn empty( $columns ) ? '' : reset( $columns );\n\t}", "public function language()\n\t{\n\t\treturn $this->exth_record(self::EXTH_RECORD_TYPE_LANGUAGE);\n\t}", "function myLanguage () {\n\t\tif ($this->iExist()) :\n\t\t\t$r = $mysqli->query(\"SELECT language FROM students WHERE student_id = \".$this->myID().\" LIMIT 1\") or die( $mysqli->error );\n\t\t\t$row = $r->fetch_array(MYSQLI_ASSOC);\n\t\t\treturn $row['language'];\n\t\telse:\n\t\t\treturn NULL;\n\t\tendif;\n\t}", "public function getLanguage();", "public function getLanguage()\n {\n return $this->query->getLanguage();\n }", "public function language()\r\n {\r\n return $this->getFromHeader('language'); \r\n }", "public function get_database_language()\n {\n return $this->database_language;\n }", "public function getLanguage(): string\n {\n return $this->query->getLanguage();\n }", "public function get_language()\r\n\t{\r\n\t\treturn $this->get_attr('language');\r\n\t}", "function getLanguageId() {\n return $this->getFieldValue('language_id');\n }", "public function getLanguageConstant()\n {\n return $this->language_constant;\n }", "function getLanguage() {\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->language;\n }", "public function getLanguageName();", "public function getFieldEventLanguageID()\n\t{\n\t\treturn $this->GetDAL()->GetField(DotCoreEventDAL::EVENTS_LANGUAGE_ID);\n\t}", "public function getLang() {\r\n\t\treturn $this->getAtributo(\"lang\");\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This does not trigger automations! If you wish to trigger automations, please use the core module's `updateFields` method. Adds a field to the subscriber with the matching email. Note that both the field and the subscriber will be created if either is missing from system.
public function addField($parameters) { $response = $this->_constructCommandsResult($this->_client->post($this->_url, [ 'command' => [ 'command' => BentoCommandTypes::ADD_FIELD, 'email' => $parameters['email'], 'query' => $parameters['field'], ] ])); if ($response != null) { return $response; } else { throw new \Exception('[BentoCommands] Error adding fields to subscriber: ' . $parameters['email']); } }
[ "function AddCustomFieldInfo($subscriber_email=false, $customfields=array())\n\t{\n\t\tif (!$subscriber_email) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t* in case somehow the email addresses have a space before them (or after)\n\t\t* when they are stored in the system, trim it down.\n\t\t* otherwise we end up with a very hard to track down bug where custom fields/links\n\t\t* are not replaced - because the _recipientscustomfields array has a space before the address\n\t\t* but the base address doesn't have it.\n\t\t*/\n\t\t$this->_RecipientsCustomFields[trim($subscriber_email)] = $customfields;\n\t}", "protected abstract function getSubscriberCustomField( $email, $field_name );", "public function subscriberAddField(Subscriber $subscriber, int $field)\n {\n return $subscriber;\n }", "public static function convert_email_field() {\n\n\t\t// Create a new Email field.\n\t\tself::$field = new GF_Field_Email();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public function testAddSubscriberToFormWithCustomFields()\n {\n $result = $this->api->add_subscriber_to_form(\n $_ENV['CONVERTKIT_API_FORM_ID'],\n $this->generateEmailAddress(),\n 'First Name',\n [\n 'last_name' => 'Last Name',\n ]\n );\n\n // Check subscription object returned.\n $this->assertInstanceOf('stdClass', $result);\n $this->assertArrayHasKey('subscription', get_object_vars($result));\n\n // Fetch subscriber from API to confirm the custom fields were saved.\n $subscriber = $this->api->get_subscriber($result->subscription->subscriber->id);\n $this->assertEquals($subscriber->subscriber->fields->last_name, 'Last Name');\n }", "public function addEmail();", "public function addUserField($field) {}", "public function testUpdateSubscriberEmailAddress()\n {\n // Add a subscriber.\n $email = $this->generateEmailAddress();\n $result = $this->api->add_subscriber_to_sequence(\n $_ENV['CONVERTKIT_API_SEQUENCE_ID'],\n $email\n );\n\n // Get subscriber ID.\n $subscriberID = $result->subscription->subscriber->id;\n\n // Update subscriber's email address.\n $newEmail = $this->generateEmailAddress();\n $result = $this->api->update_subscriber(\n $subscriberID,\n '',\n $newEmail\n );\n\n // Confirm the change is reflected in the subscriber.\n $this->assertInstanceOf('stdClass', $result);\n $this->assertArrayHasKey('subscriber', get_object_vars($result));\n $this->assertArrayHasKey('id', get_object_vars($result->subscriber));\n $this->assertEquals(get_object_vars($result->subscriber)['id'], $subscriberID);\n $this->assertEquals(get_object_vars($result->subscriber)['email_address'], $newEmail);\n\n // Unsubscribe.\n $this->api->unsubscribe($newEmail);\n }", "public function register_company_email_field() {\n // add field in \"front-end\"\n function frontend_company_email_field( $fields ) {\n $fields['company']['company_email'] = array(\n 'label' => esc_html__( 'Company Email', 'wp-job-manager-company-profiles' ),\n 'type' => 'text',\n 'required' => false,\n 'priority' => 1.5\n );\n return $fields;\n }\n add_filter( 'submit_job_form_fields', 'frontend_company_email_field' );\n\n // add field in \"back-end\"\n function admin_company_email_field( $fields ) {\n $fields['_company_email'] = array(\n 'label' => esc_html__( 'Company Email', 'wp-job-manager-company-profiles' ),\n 'type' => 'text',\n 'required' => false,\n 'placeholder' => esc_html__( 'Company email which is used to contact company', 'wp-job-manager-company-profiles' ),\n 'description' => esc_html__( 'Company Website will be used for contact, if email not provided.', 'wp-job-manager-company-profiles' )\n );\n return $fields;\n }\n add_filter( 'job_manager_job_listing_data_fields', 'admin_company_email_field' );\n\t}", "public function addOrderField(\\comOrder $order, $subscriberId = null): void\n {\n if ($subscriberId) {\n $field = new SubscriptionStatus($this->commerce, 'mailchimp_field.subscribe', true);\n $field->setSubscriberId($this->getConfig('apikey'), $subscriberId);\n }\n else {\n // Add a plain text field showing the customer is not subscribed.\n $field = new Text($this->commerce, 'mailchimp_field.not_subscribed', $this->adapter->lexicon('commerce_mailchimp.order_field.value.not_subscribed'));\n }\n $order->setOrderField($field);\n\n }", "function subscriberAddWithCustomFieldsRedundant( $email, $name, $fields, $list_id = null )\n {\n $added = $this->subscriberAddWithCustomFields( $email, $name, $fields, $list_id );\n if ( $added && $added['Code'] == '0' )\n {\n $subscribed = $this->subscribersGetIsSubscribed( $email );\n if ( $subscribed == 'False' )\n {\n $added = $this->subscriberAddWithCustomFields( $email, $name, $fields, $list_id, true );\n return $added;\n }\n }\n \n return $added;\n }", "public function addEmail($email)\r\n {\r\n $this->email_addresses[] = $email;\r\n }", "public function mailing_list_subscribe()\n\t{\n\t\t// get parameters for first name, last name and email\n\t\t$first_name = ee()->TMPL->fetch_param('first_name');\n\t\t$last_name = ee()->TMPL->fetch_param('last_name');\n\t\t$email = ee()->TMPL->fetch_param('email');\n\n\t\tif(empty($email))\n\t\t{\n\t\t\treturn;\n\t\t}\t\n\n\t\t$this->update_constant_contact('create', $email, $first_name, $last_name);\n\n\t}", "function RegistrationEmailField($fieldname=\"NewEmail\",$fieldvalue=\"\")\n {\n if (empty($fieldvalue))\n {\n $fieldvalue=$this->CGI2NewEmail();\n }\n\n return $this->MakeInput($fieldname,$fieldvalue,30);\n }", "public static function ContactAddEmail()\n {\n require_once 'api/api.php';\n\n $contactIds = self::get_array('contacts');\n $senderEmail = strtolower(self::get('email'));\n $debug = self::get('debug');\n $gotError = false;\n\n $params = array(\n 'contact_id' => null, // set to NULL for now\n 'email' => $senderEmail,\n 'location_type_id' => self::getOtherLocationId(),\n 'version' => 3,\n );\n\n foreach ($contactIds as $contactId) {\n // Check to see if contact has the email address being assigend to it,\n // if doesn't have email address, add it to contact\n $query = \"\n SELECT e.email \n FROM civicrm_email e \n WHERE e.contact_id = $contactId\n \";\n $dbres = CRM_Core_DAO::executeQuery($query);\n $emailFound = false;\n while ($dbres->fetch()) {\n if (strtolower($dbres->email) == $senderEmail) {\n $emailFound = true;\n }\n }\n\n if (!$emailFound) {\n $params['contact_id'] = $contactId;\n $apires = civicrm_api('email', 'create', $params);\n if ($apires['is_error'] == 1) {\n $gotError = true;\n break;\n }\n }\n }\n\n if ($gotError) {\n self::exitError('Unable to add email');\n }\n else {\n self::exitSuccess('Email was added');\n }\n }", "public function addMailRecipient(string $email, string $name = ''): static;", "function setEmail($value) { $this->set('email', $value); }", "public function setEmail($value) { $this->email = $value; }", "function setEmail($newEmail)\n {\n $this->email = $newEmail; \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as numberOfContractedArtists The number of ContractedArtists associated with the SoundRecording.
public function getNumberOfContractedArtists() { return $this->numberOfContractedArtists; }
[ "public function getNumberOfNonContractedArtists()\n {\n return $this->numberOfNonContractedArtists;\n }", "public function getNumberOfWorksByArtist()\n {\n return $this->getRepository()\n ->getNumberOfWorks()\n ->getSingleScalarResult();\n }", "public static function getAuthorsCount(): int\n {\n return count(self::AUTHORS);\n }", "public function getNumberOfFeaturedArtists()\n {\n return $this->numberOfFeaturedArtists;\n }", "public function getSongCount();", "public function getSongsCount()\n {\n $db = new Database();\n\n return $db->count(Song::SONGS_TABLE, \"album_id = $this->id\");\n }", "public function getNumAuthors()\n {\n // TODO: Implement getNumAuthors() method.\n }", "protected function getArtists()\n {\n $this->connect();\n $sql = \"SELECT name, COUNT(title) AS number \n FROM artist\n JOIN song\n ON song.artist_id = artist.id\n GROUP by name\";\n $data;\n $results = $this->conn->query($sql);\n\n if ($results === false) {\n echo $this->language['error_data'];\n $this->disconnect();\n } else {\n while ($row = $results->fetch_assoc()) {\n $data[] = $row;\n }\n $results -> free();\n $this->disconnect();\n return $data;\n }\n }", "public function getNumberOfNonFeaturedArtists()\n {\n return $this->numberOfNonFeaturedArtists;\n }", "public function getContractorsCount()\n {\n return $this->count(self::contractors);\n }", "public function getAudienceCount(): int\n {\n return count($this->getSplitAudiences());\n }", "public function getWholesalersCount()\n {\n return $this->count(self::wholesalers);\n }", "public function getNumAuthors()\n {\n // TODO: Implement getNumAuthors() method.\n return 0;\n }", "public function getCountAlbums();", "public function getCount()\n\t{\n\t\treturn $this->_albumCount;\n\t}", "public function getNumberOfSongs(){\n $albumId = $this->id;\n $sql = \"SELECT count(id) as count from songs where album = $albumId\";\n $result = mysqli_query($this->connection, $sql);\n if(mysqli_num_rows($result)){\n return (mysqli_fetch_assoc($result))['count'];\n }\n return 0;\n }", "function getArtistWorksCount($artist_name) {\n\t\t$artist_name_for_search = mb_convert_encoding(makeSafeEntities($artist_name),\"UTF-8\", \"HTML-ENTITIES\");\n\t\t\n\t\t$search_string = $this->CollectionsUtils->formatSearchString(\"People\", $artist_name_for_search, G_EMUSEUM_ROOT_URL . G_EMUSEUM_CODE, \"objects\", \"advsearch\", 1);\n\t\t$search_results_xml = $this->CollectionsUtils->doSearch($search_string);\n\t\t\n\t\t$search_results_array = new SimpleXMLElement($search_results_xml);\n\t\t$num_results = $search_results_array->result[\"total\"];\n\t\t\n\t\treturn $num_results;\n\t}", "public function getNumberOfSongs(){\n\t\t\t$query = mysqli_query($this->con, \"SELECT id FROM Songs WHERE album='$this->id'\");\n\t\t\treturn mysqli_num_rows($query);\n\t\t}", "public function getEmbeddingsCount()\n {\n return $this->embeddings_count;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of sujet
public function setSujet(string $sujet) { $this->sujet = $sujet; return $this; }
[ "public function setSujet($Sujet) {$this->Sujet = $Sujet;}", "public function getSujet()\r\n {\r\n return $this->sujet;\r\n }", "public function getSujet()\n {\n return $this->sujet;\n }", "public function setSujet($sujet)\n {\n $this->sujet = $sujet;\n\n return $this;\n }", "public function getSujet_id()\n {\n return $this->sujet_id;\n }", "public function testSetCodeAssistantJuridique() {\n\n $obj = new BudgetT();\n\n $obj->setCodeAssistantJuridique(\"codeAssistantJuridique\");\n $this->assertEquals(\"codeAssistantJuridique\", $obj->getCodeAssistantJuridique());\n }", "public function testSetStatutJuridique() {\n\n $obj = new AttestationCacm();\n\n $obj->setStatutJuridique(\"statutJuridique\");\n $this->assertEquals(\"statutJuridique\", $obj->getStatutJuridique());\n }", "public function spausdinu() {\n echo $this->spalva; // \"ruda\" pasiekiu CLass kintamaji\n $this->spalva = 'balta';\n echo $this->spalva; // \"balta\" pasiekiu CLass kintamaji\n\n echo $this->kuoMinta; // \"mesa\" , privatus kintamieji pasiekiami visoej Class'eje\n }", "public function setCama(){\n $this->cama = \"Sim\";\n }", "public function testSetControleSaisieTp() {\n\n $obj = new Collaborateurs();\n\n $obj->setControleSaisieTp(\"controleSaisieTp\");\n $this->assertEquals(\"controleSaisieTp\", $obj->getControleSaisieTp());\n }", "public function testSetCodeAssistantJuridique() {\n\n $obj = new Clients();\n\n $obj->setCodeAssistantJuridique(\"codeAssistantJuridique\");\n $this->assertEquals(\"codeAssistantJuridique\", $obj->getCodeAssistantJuridique());\n }", "function setUtente(EUtente $utente){$this->utente=$utente;}", "public function testSetJourEcriture() {\n\n $obj = new SuiviCompteParticulier();\n\n $obj->setJourEcriture(\"jourEcriture\");\n $this->assertEquals(\"jourEcriture\", $obj->getJourEcriture());\n }", "function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }", "public function setUsuel($usuel)\n {\n\t\t\n\tif (!is_string($usuel) || empty($usuel))\n $this->erreurs[] = self::ERR_USUEL;\n else\n $this->usuel = $usuel;\n }", "public function setSenha ($usu_senha) {\n\t\t$this->usu_senha = $usu_senha;\n\t}", "public function setAtaqueProgramador($valor){\n $this->ataqueProgramador=$valor;\n }", "public function testSetJeudi() {\n\n $obj = new BonsTravauxInterventions();\n\n $obj->setJeudi(true);\n $this->assertEquals(true, $obj->getJeudi());\n }", "public function set_contenu($contenu) { $this->_contenu = $contenu; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Yahoo profile picture.
public function getYahooProfilePicture() { return $this->yahooProfilePicture; }
[ "public function getProfilePicture();", "public function getProfilePictureFromSource()\n {\n\t\t$response = $this->curlRequest($this->platform->getApiUrl('get_profile_pic', ['username_val' => $this->username]), null, array('Authorization: OAuth '.$this->token));\n\t\t$decode_response = json_decode($response, true);\n\t\tif(isset($decode_response[\"user_logo\"]))\n\t\t{\n\t\t\t$this->profil_picture_url = 'https://edge.sf.hitbox.tv'.$decode_response[\"user_logo\"];\n\t\t}\t\n }", "public function fnGetProfileImage()\n {\n //You can get a blog's avatar in 9 different sizes. The default size is 64x64.\n $strPhotoUrl = 'http://api.tumblr.com/v2/blog/' . $this->strUserBlog . '/avatar/512';\n echo 'Profile Image : <br> <img src=\"' . $strPhotoUrl . '\">';\n }", "function get_twitter_pic($username) {\r\n\t\t$twitter_pics = get_option(\"ffff_twitter_pics\");\r\n\t\t\r\n\t\t// cache hit?\r\n\t\tif (isset($twitter_pics[$username])) {\r\n\t\t\tif (time() < $twitter_pics[$username][\"expiry\"]) return $twitter_pics[$username][\"url\"];\r\n\t\t}\r\n\t\t\r\n\t\t// miss\r\n\t\t$url = \"http://twitter.com/users/show/{$username}.xml\";\r\n\t\t$data = $this->ffff_curl($url);\r\n\t\tif ($data) {\r\n\t\t\t$xml = simplexml_load_string($data);\r\n\t\t\tif ($xml && isset($xml->profile_image_url)) {\r\n\t\t\t\t$profile_image_url = (string) $xml->profile_image_url;\r\n\t\t\t\t$twitter_pics[$username] = array(\"expiry\"=>time()+_ffff_twitter_pics_ttl, \"url\"=>$profile_image_url);\r\n\t\t\t\tupdate_option(\"ffff_twitter_pics\", $twitter_pics);\t\t\t\r\n\t\t\t\treturn $profile_image_url;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getProfilePicture()\r\n\t\t{\r\n\t\t\treturn APP_IMG_URL.$this->profilePictureImg;\r\n\t\t\t\r\n\t\t}", "public function getDropboxProfilePicture()\n {\n return $this->dropboxProfilePicture;\n }", "public function get_profile_image() {\n\t\treturn '<img src=\"' . $this->get_profile_image_url() . '\" />';\n\t}", "public function getProfPic() {\n $response = $this->getRequest(\"me\");\n $response = json_decode($response->getBody()->getContents());\n \n if (count($response->{\"images\"}) == 0) {\n return null;\n } else {\n return $response->{\"images\"}[0]->{\"url\"};\n }\n }", "public function getUserProfilePicture(){\r\n $this->initDb();\r\n $un = \"\";\r\n $ui = $this->getUserId();\r\n require_once($_SERVER['DOCUMENT_ROOT'] . \"/biznavi/application/user/class/user.class.php\");\r\n $user = new user($ui);\r\n return $user->getProfilePicture();\r\n }", "public function getProfileImageUrl();", "public function getProfilePicture()\n {\n $baseUrl = 'img/clients/' . $this->id;\n return file_exists($baseUrl . self::JPG) ? '/' . $baseUrl . self::JPG : (\n file_exists($baseUrl . self::PNG) ? '/' . $baseUrl . self::PNG : '/img/default_avatar.jpg'\n );\n }", "function getProfile_pic()\r\n\t{\r\n\t\treturn $this->profile_pic;\r\n\t}", "public function getProfilePic()\n {\n return $this->profilePic;\n }", "public function getProfilePicture() {\r\n\t\tif ($this->_profilePicture == null) {\r\n\t\t\tif (strlen($this->email)) {\r\n\t\t\t\t$this->_profilePicture = UsersDataService::getUserProfilePicture(WebSoccer::getInstance(), null, $this->email);\r\n\t\t\t} else {\r\n\t\t\t\t$this->_profilePicture = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $this->_profilePicture;\r\n\t}", "public function getProfilePicture()\n {\n return $this->profilePicture;\n }", "public function getProfilePhoto()\r\n\t{ \r\n\t\t$username = $this->user['username'];\r\n\t\t$get_prof_pic_query = mysqli_query($this->db, \"SELECT prof_pic FROM users WHERE username='$username';\");\r\n\t\t$row = mysqli_fetch_array($get_prof_pic_query);\r\n\t\treturn $row['prof_pic']; \r\n\t}", "public function profilePicture()\n {\n if ($this->picture) {\n return \"/storage/{$this->picture}\";\n }\n\n return 'http://i.pravatar.cc/200';\n }", "public function getSalesforceProfilePicture()\n {\n return $this->salesforceProfilePicture;\n }", "function fetch_picture($nickname, $size='medium'){\n $picture = \"http://friendfeed-api.com/v2/picture/\" . urlencode($nickname).'?size='.$size;\n return $picture;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the locale record identifier.
public function getLocaleID();
[ "public function getIdentifier(): string { return $this->locale; }", "public function getCurrentLocaleId()\n {\n return $this->_localeId;\n }", "public function getLocaleKey()\n {\n return $this->localeKey ?: 'locale';\n }", "public function getLocaleKey(): string\n {\n return $this->localeKey ?? app('locale')->localeKey();\n }", "public function getRecordIdFieldName()\n {\n $metadata = $this->exportMetaData();\n $recordIdFieldName = $metadata[0]['field_name'];\n return $recordIdFieldName;\n }", "function getI18nIndentifier() {\n\t\treturn $this->getParam('i18n', 'identifier', 't');\n\t}", "public function getRecordId()\n {\n return $this->recordId;\n }", "public function getRecordNumber()\n {\n $value = $this->get(self::record_number);\n return $value === null ? (string)$value : $value;\n }", "function getRecordId()\n\t\t{ // return current record id.\n\t\t\treturn $this->intRecordId;\n\t\t}", "public function getRecordId(){\n return $this->recordId;\n }", "public function getCurrentLocaleId(): ?string\n\t{\n\t\treturn $this->current !== null ? $this->current->getId() : null;\n\t}", "public function getLanguageIdentifier();", "protected function getLocaleId($locale)\n {\n $sql = '\n SELECT `id`\n FROM `s_core_locales`\n WHERE `locale` = ?\n ';\n\n return Shopware()->Db()->fetchOne($sql, [$locale]);\n }", "function getLanguageId() {\n return $this->getFieldValue('language_id');\n }", "public function getRecordKey()\n {\n return $this->record_key;\n }", "public function getLocale(): string\n {\n return $this->localeCode;\n }", "public function getLid()\n {\n return $this->get(self::LID);\n }", "public function getUidLocalized()\n {\n return (int)$this->_localizedUid;\n }", "public function getLocalizedRouteKey($locale);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Items in negotiable quote where changed
public function hasItemChanges(CartInterface $quote) { return $this->hasDiscountChanges($quote, NegotiableQuoteInterface::ITEMS_CHANGED); }
[ "private function checkMissingAndAdd()\n {\n /** @var \\Magento\\Checkout\\Model\\Session $checkoutSession */\n $checkoutSession = $this->checkoutSessionFactory->create();\n $currentQuote = $checkoutSession->getQuote();\n\n if ($currentQuote->hasItems()) {\n foreach ($this->quote->getAllVisibleItems() as $item) {\n $found = false;\n \n foreach ($currentQuote->getAllItems() as $quoteItem) {\n if ($quoteItem->compare($item)) {\n $found = true;\n break;\n }\n }\n\n if (!$found) {\n $newItem = clone $item;\n $currentQuote->addItem($newItem);\n if ($item->getHasChildren()) {\n foreach ($item->getChildren() as $child) {\n $newChild = clone $child;\n $newChild->setParentItem($newItem);\n $currentQuote->addItem($newChild);\n }\n }\n }\n }\n\n $currentQuote->collectTotals();\n\n $this->quoteResource->save($currentQuote);\n }\n }", "private function duplicateLineItems(Quote $quote) {\n $lineItems = array();\n foreach ($quote->lineItems as $item) {\n $copy = new QuoteProduct;\n\n foreach($item->attributes as $name => $value)\n\n if ($name !== 'id' && $name !== 'listId') {\n $copy->$name = $value;\n }\n \n $lineItems[] = $copy;\n }\n return $lineItems;\n }", "public function getOldStagedQuoteState();", "public function testUpdateQuoteItems()\n {\n $data = [\n 'items' => [\n ['sku' => 1, 'qty' => 2, 'id' => 1],\n ],\n 'update' => 0\n ];\n $this->restriction->expects($this->any())\n ->method('canSubmit')->willReturn(true);\n $this->mockExtensionAttributes();\n $productMock = $this->createPartialMock(Product::class, ['canConfigure']);\n $productMock->expects($this->any())\n ->method('canConfigure')\n ->willReturn(true);\n $item =\n $this->createPartialMock(Item::class, ['getProduct', 'canConfigure', 'setQty']);\n $item->expects($this->any())\n ->method('getProduct')\n ->willReturn($productMock);\n $this->quote->expects($this->any())\n ->method('getItemById')\n ->willReturn($item);\n $this->quote->expects($this->any())\n ->method('getAllVisibleItems')\n ->willReturn([$item]);\n $this->quote->expects($this->any())\n ->method('getData')\n ->with('trigger_recollect')\n ->willReturn(true);\n $addressMock = $this->getMockBuilder(Address::class)\n ->disableOriginalConstructor()\n ->setMethods(['unsetData'])\n ->getMock();\n $addressMock->expects($this->once())\n ->method('unsetData')\n ->with('cached_items_all');\n $this->quote->expects($this->any())\n ->method('getAllAddresses')\n ->willReturn([$addressMock]);\n $this->quoteItemManagement->expects($this->once())\n ->method('recalculateOriginalPriceTax');\n $this->quoteItemsUpdater->expects($this->once())\n ->method('updateItemsForQuote')\n ->willReturn(true);\n\n $this->assertEquals(true, $this->quoteUpdater->updateQuote(1, $data));\n }", "public function isItemChanged(): bool\n\t{\n\t\treturn true;\n\t}", "function cancel_quotes($curr_oid) {\n global $wpdb;\n $related_quotes = $wpdb->get_results(\"SELECT * FROM quotes WHERE oid = '$curr_oid'\", ARRAY_A); //check the related quotes\n foreach($related_quotes as $openq) { //loop through all related quotes\n $curr_qid = $openq['qid'];\n $wpdb->update('quotes', array('quote_status' => \"Order Cancelled\"), array('qid' => \"$curr_qid\")); //update the quote status to show that the order was cancelled\n reimburse_bid_cost($curr_qid);\n }\n}", "public function &getChangedItens(){\n\n\t\t$itens = array();\n\n\t\tforeach ($this->itens as $object) {\n\t\t\tif($object->getChanged()) array_push($itens, $object);\n\t\t}\n\n\t\treturn $itens;\n\n\t}", "public function getAllSentOrDraft()\n {\n /** @var Quote[] $quotes */\n $quotes = $this->getORM()->find('Quote', \"quote_status IN (1,2) AND quote_delete = 0\");\n foreach ($quotes as $key => $quote)\n {\n $quotes[$key] = $this->getById($quote->id);\n }\n return $quotes;\n }", "function setNeedQuotes ($newNeedQuotes) {\n $this->needQuotes = $newNeedQuotes;\n }", "public function getNonRefundedLineItems();", "private function updateTransactionByQuote(Quote $quote)\n {\n for ($i = 0; $i < self::NUMBER_OF_ATTEMPTS; $i ++) {\n try {\n $spaceId = $this->scopeConfig->getValue('wallee_payment/general/space_id',\n ScopeInterface::SCOPE_STORE, $quote->getStoreId());\n if ($quote->getWalleeSpaceId() != $spaceId) {\n return $this->createTransactionByQuote($quote);\n }\n\n $transaction = $this->apiClient->getService(TransactionApiService::class)->read(\n $quote->getWalleeSpaceId(), $quote->getWalleeTransactionId());\n\n\t\t\t\tif (!($transaction instanceof Transaction) || $transaction->getState() != TransactionState::PENDING) {\n\t\t\t\t\treturn $this->createTransactionByQuote($quote);\n\t\t\t\t}\n\n if (! empty($transaction->getCustomerId()) && $transaction->getCustomerId() != $quote->getCustomerId()) {\n if ($this->submittingOrder) {\n throw new CustomerIdManipulationException();\n } else {\n return $this->createTransactionByQuote($quote);\n }\n }\n\n\t\t\t\treturn $this->createTransactionPending($quote, $transaction);\n } catch (VersioningException $e) {\n // Try to update the transaction again, if a versioning exception occurred.\n }\n }\n throw new VersioningException(__FUNCTION__);\n }", "public function markQuotesRecollectOnCatalogRules()\n {\n $quoteItemTable = $this->getTable('sales/quote_item');\n $productPriceTable = $this->getTable('catalogrule/rule_product_price');\n\n $select = $this->_getReadAdapter()\n ->select()\n ->distinct()\n ->from(array('t2' => $quoteItemTable), array('entity_id' => 'quote_id'))\n ->join(array('t3' => $productPriceTable), 't2.product_id = t3.product_id', array());\n\n $entityIds = $this->_getReadAdapter()->fetchCol($select);\n\n if (count($entityIds) > 0) {\n $where = $this->_getWriteAdapter()->quoteInto('entity_id IN (?)', $entityIds);\n $this->_getWriteAdapter()->update($this->getTable('sales/quote'), array('trigger_recollect' => 1), $where);\n }\n\n return $this;\n }", "protected function _checkMissingAndAdd()\n {\n $currentQuote = Mage::getSingleton('checkout/session')->getQuote();\n $currentItemIds = array();\n\n if ($currentQuote->hasItems()) {\n $currentSessionItems = $currentQuote->getAllItems();\n foreach ($currentSessionItems as $currentSessionItem) {\n $currentItemIds[] = $currentSessionItem->getId();\n }\n\n foreach ($this->_quote->getAllItems() as $item) {\n if (!in_array($item->getId(), $currentItemIds)) {\n $currentQuote->addItem($item);\n }\n }\n\n $currentQuote->collectTotals()->save();\n }\n }", "public function testUpdateTransactionLineItems()\n {\n }", "private static function removeAllItems($quote) {\n\t\tforeach ($quote->getItemsCollection() as $itemId => $item) {\n\t\t\tif (is_null($item->getId())) {\n\t\t\t\t$quote->getItemsCollection()->removeItemByKey($itemId);\n\t\t\t} else {\n\t\t\t\t$item->isDeleted(true);\n\t\t\t}\n\t\t}\n\t\treturn $quote;\n\t}", "private function _processReferencesChanged(){\n\n $cache = $this->_cache;\n $attrs = $this->getAttrs();\n foreach($cache as $key => $item){\n if(!isset($attrs[$key])) continue;\n $attr = $attrs[$key];\n if($attr['type'] == 'references'){\n if( $item instanceof Collection && $this->cleanData[$key] !== $item->makeRef()){\n// $this->cleanData[$key] = $item->makeRef();\n// $this->dirtyData[$key] = $item->makeRef();\n $this->__set($key,$item);\n }\n }\n }\n\n }", "abstract protected function applyChanges( Item $item );", "public function getPriceModifications();", "abstract protected function sync_inventory_changes();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the cotis normal dues zrd.
public function setCotisNormalDuesZrd(?bool $cotisNormalDuesZrd): Libelles { $this->cotisNormalDuesZrd = $cotisNormalDuesZrd; return $this; }
[ "public function setCotisNormalDuesZfu(?bool $cotisNormalDuesZfu): Libelles {\n $this->cotisNormalDuesZfu = $cotisNormalDuesZfu;\n return $this;\n }", "public function setEmolumentNormalAttribute($value)\n {\n $this->attributes['emolument_normal'] = unFormatMoney($value);\n }", "function setFidiCM(){\n\t\t$db=$this->db;\n\t\t$sql=\"UPDATE oneri.c_monetario SET fideiussione=(SELECT totale-coalesce(versato,0) from oneri.rate where pratica=$this->pratica and rata=6) WHERE pratica=$this->pratica;\";\n\t\t//echo $sql; \n\t\t$db->sql_query($sql);\n\t}", "public function testSetzRbtDemande() {\n\n $obj = new DecTvaCa12();\n\n $obj->setzRbtDemande(10.092018);\n $this->assertEquals(10.092018, $obj->getzRbtDemande());\n }", "public function testSetZ0033() {\n\n $obj = new DecTva();\n\n $obj->setZ0033(10.092018);\n $this->assertEquals(10.092018, $obj->getZ0033());\n }", "public function testSetTrancheC() {\n\n $obj = new Bulletins();\n\n $obj->setTrancheC(10.092018);\n $this->assertEquals(10.092018, $obj->getTrancheC());\n }", "public function testSetzExcedentVersement() {\n\n $obj = new DecTvaCa12();\n\n $obj->setzExcedentVersement(10.092018);\n $this->assertEquals(10.092018, $obj->getzExcedentVersement());\n }", "public function testSetCorres3() {\n\n $obj = new DecTva();\n\n $obj->setCorres3(\"corres3\");\n $this->assertEquals(\"corres3\", $obj->getCorres3());\n }", "public function testSetMontantTenuCredit() {\n\n $obj = new EcrituresEco();\n\n $obj->setMontantTenuCredit(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantTenuCredit());\n }", "public function getCotisNormalDuesZrd(): ?bool {\n return $this->cotisNormalDuesZrd;\n }", "public function testSetCorres5() {\n\n $obj = new DecTva();\n\n $obj->setCorres5(\"corres5\");\n $this->assertEquals(\"corres5\", $obj->getCorres5());\n }", "public function setCama(){\n $this->cama = \"Sim\";\n }", "public function testSetRemise3() {\n\n $obj = new CdeFournisseurMensu();\n\n $obj->setRemise3(10.092018);\n $this->assertEquals(10.092018, $obj->getRemise3());\n }", "public function testSetZ9999() {\n\n $obj = new DecTvaGroupe();\n\n $obj->setZ9999(10.092018);\n $this->assertEquals(10.092018, $obj->getZ9999());\n }", "public function testSetMontantHtCde() {\n\n $obj = new CdeTypeInspEntetes();\n\n $obj->setMontantHtCde(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantHtCde());\n }", "public function testSetNbC() {\n\n $obj = new LignesIjss();\n\n $obj->setNbC(10.092018);\n $this->assertEquals(10.092018, $obj->getNbC());\n }", "public function testSetQuantiteCde() {\n\n $obj = new CdeFournisseurMensu();\n\n $obj->setQuantiteCde(10.092018);\n $this->assertEquals(10.092018, $obj->getQuantiteCde());\n }", "public function testSetCumCpDus() {\n\n $obj = new Employes();\n\n $obj->setCumCpDus(10.092018);\n $this->assertEquals(10.092018, $obj->getCumCpDus());\n }", "public function setVat($value);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'invoiceGetSwissEsr'
protected function invoiceGetSwissEsrRequest() { $resourcePath = '/Invoice/getSwissEsr'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/xml', 'application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], ['application/x-www-form-urlencoded'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($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('token'); if ($apiKey !== null) { $queryParams['token'] = $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( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "function generateGetSRRequest($username, $password, $srID, array $queryFields) {\r\n $requestHeader = $this->generateSiebelRequestHeader($username, $password);\r\n $requestBody = $this->generateGetSRRequestBody($srID, $queryFields);\r\n\r\n return <<<REQUEST\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cus=\"http://siebel.com/CustomUI\" xmlns:quer=\"http://www.siebel.com/xml/WC_Service_Request_IO/Query\">\r\n {$requestHeader}\r\n {$requestBody}\r\n</soapenv:Envelope>\r\nREQUEST;\r\n }", "public function invoiceGetSwissEsrDataWithHttpInfo()\n {\n $returnType = '';\n $request = $this->invoiceGetSwissEsrDataRequest();\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function testInvoiceGetSwissEsrData()\n {\n }", "protected function indexSupplierInvoicesRequest($is_paid = null, $is_booked = null, $search = null, $supplier_number = null, $purchase_order_number = null)\n {\n\n $resourcePath = '/supplier-invoices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($is_paid !== null) {\n $queryParams['is_paid'] = ObjectSerializer::toQueryValue($is_paid);\n }\n // query params\n if ($is_booked !== null) {\n $queryParams['is_booked'] = ObjectSerializer::toQueryValue($is_booked);\n }\n // query params\n if ($search !== null) {\n $queryParams['search'] = ObjectSerializer::toQueryValue($search);\n }\n // query params\n if ($supplier_number !== null) {\n $queryParams['supplier_number'] = ObjectSerializer::toQueryValue($supplier_number);\n }\n // query params\n if ($purchase_order_number !== null) {\n $queryParams['purchase_order_number'] = ObjectSerializer::toQueryValue($purchase_order_number);\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 }", "private function generateEbsGetSRRequestBody($srID) {\r\n return <<<BODY\r\n<soapenv:Body>\r\n <get:InputParameters>\r\n <get:P_API_VERSION>1.0</get:P_API_VERSION>\r\n <get:P_INCIDENT_ID>{$srID}</get:P_INCIDENT_ID>\r\n <get:P_INCIDENT_NUMBER>NULL</get:P_INCIDENT_NUMBER>\r\n <get:X_GETSR_OUT_REC/>\r\n <get:X_TASKS/>\r\n <get:X_NOTES/>\r\n <get:X_CONTACT/>\r\n </get:InputParameters>\r\n</soapenv:Body>\r\nBODY;\r\n }", "function generateGetNoteRequest($username, $password, $srID, array $queryFields, $pageSize) {\r\n $requestHeader = $this->generateSiebelRequestHeader($username, $password);\r\n $requestBody = $this->generateGetNoteRequestBody($srID, $queryFields, $pageSize);\r\n\r\n return <<<REQUEST\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cus=\"http://siebel.com/CustomUI\" xmlns:quer=\"http://www.siebel.com/xml/WC_Service_Request_IO/Query\">\r\n {$requestHeader}\r\n {$requestBody}\r\n</soapenv:Envelope>\r\nREQUEST;\r\n }", "protected function onlineInvoiceRequest()\n {\n return new Remote\\Request(\n $this->_application,\n $this->onlineInvoiceRemoteUrl()\n );\n }", "public function retrieveInvoicesAction()\n {\n $invoiceId = $this->container->get('request')->get('id'); \n $baseUrl = $this->setGetContract->subUrlsInvoices.\"/$invoiceId\";\n $customerUrl= $baseUrl.\"?customer=$this->customerId\";\n $this->url = (isset($this->customerId)) ? $baseUrl : $customerUrl;\n $this->currentSubUrl = 'subUrlsInvoices';\n $this->datas = array();\n \n return $this->prepareRequest(); \n }", "public function gETInStockSubscriptionIdCustomerRequest($in_stock_subscription_id)\n {\n // verify the required parameter 'in_stock_subscription_id' is set\n if ($in_stock_subscription_id === null || (is_array($in_stock_subscription_id) && count($in_stock_subscription_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $in_stock_subscription_id when calling gETInStockSubscriptionIdCustomer'\n );\n }\n\n $resourcePath = '/in_stock_subscriptions/{inStockSubscriptionId}/customer';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($in_stock_subscription_id !== null) {\n $resourcePath = str_replace(\n '{' . 'inStockSubscriptionId' . '}',\n ObjectSerializer::toPathValue($in_stock_subscription_id),\n $resourcePath\n );\n }\n\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 (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\\build_query($formParams);\n }\n }\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 }", "protected function customerInvoicesV2Get_0Request($invoice_id)\n {\n // verify the required parameter 'invoice_id' is set\n if ($invoice_id === null || (is_array($invoice_id) && count($invoice_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_id when calling customerInvoicesV2Get_0'\n );\n }\n\n $resourcePath = '/v2/customerinvoices/{invoiceId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($invoice_id !== null) {\n $resourcePath = str_replace(\n '{' . 'invoiceId' . '}',\n ObjectSerializer::toPathValue($invoice_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 }", "public function upcomingInvoicesRequest()\n {\n\n $resourcePath = '/v2/billing/invoices/upcoming';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\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 (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\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function createInvoice();", "protected function indexCustomerInvoicesRequest($is_paid = null, $is_booked = null, $order_number = null, $customer_number = null, $search = null)\n {\n\n $resourcePath = '/customer-invoices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($is_paid !== null) {\n $queryParams['is_paid'] = ObjectSerializer::toQueryValue($is_paid);\n }\n // query params\n if ($is_booked !== null) {\n $queryParams['is_booked'] = ObjectSerializer::toQueryValue($is_booked);\n }\n // query params\n if ($order_number !== null) {\n $queryParams['order_number'] = ObjectSerializer::toQueryValue($order_number);\n }\n // query params\n if ($customer_number !== null) {\n $queryParams['customer_number'] = ObjectSerializer::toQueryValue($customer_number);\n }\n // query params\n if ($search !== null) {\n $queryParams['search'] = ObjectSerializer::toQueryValue($search);\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 }", "public function getInvoiceRequest($invoiceID)\n {\n // Verify the required parameter 'invoiceID' is set\n\n if ($invoiceID === null || (is_array($invoiceID) && count($invoiceID) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'invoiceID',\n 'getInvoice'\n ));\n }\n\n $resourcePath = '/Invoices/{InvoiceID}';\n $formParams = [];\n $queryParams = [];\n $httpBody = null;\n $multipart = false;\n\n \n\n// Path parameters\n if ($invoiceID !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceID' . '}',\n ObjectSerializer::toPathValue($invoiceID),\n $resourcePath\n );\n }\n\n\n // Body parameter\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 []\n );\n }\n\n \n // For model (json/xml)\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present.\n\n if ($headers['Content-Type'] === 'application/json') {\n $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBodyText = $_tempBody;\n }\n\n $httpBody = $this->createStream($httpBodyText);\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\n // FIXME: how do we do multiparts with PSR-7?\n // MultipartStream() is a Guzzle tool.\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->createStream($this->jsonEncode($formParams));\n\n } else {\n // for HTTP post (form)\n $httpBody = $this->createStream($this->buildQuery($formParams));\n }\n }\n\n\n return $this->buildHttpRequest(\n $headers,\n $queryParams,\n $httpBody,\n 'GET',\n $resourcePath\n );\n }", "public function testPurchaseInvoiceGETRequestPurchaseInvoiceIDGet()\n {\n }", "function composeWssLookUpSrBySrIdRequest($usr, $pwd, $srId, $contactPartyID) {\r\n $credential = $this->composeCredentialInHeader($usr, $pwd);\r\n return <<<REQUEST\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\">\r\n <soapenv:Header>$credential</soapenv:Header> \r\n <soapenv:Body>\r\n <tem:wssLookupSRBySR_ID>\r\n <tem:sr_id>$srId</tem:sr_id>\r\n <tem:contactPartyID>$contactPartyID</tem:contactPartyID> \r\n </tem:wssLookupSRBySR_ID>\r\n </soapenv:Body>\r\n</soapenv:Envelope>\r\nREQUEST;\r\n }", "protected function quotesV2ConvertToInvoiceRequest($id)\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 quotesV2ConvertToInvoice'\n );\n }\n\n $resourcePath = '/v2/quotes/{id}/converttocustomerinvoice';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function toInvoice($iv=null)\n\t{\n\t\t// Add Invoice Items\n\t\t$w = null;\n\t\tswitch ($this['kind']) {\n\t\tcase 'Monthly':\n\t\tcase 'Quarterly':\n\t\tcase 'Yearly':\n\t\t\t$w = array(\n\t\t\t\t'woi.kind = ? ' => array('Subscription'),\n\t\t\t\t'woi.status = ?' => array('Active')\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$w = array(\n\t\t\t\t'woi.status in (?)' => array('Active','Complete')\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\n\t\t$woi_list = $this->getWorkOrderItems($w);\n\t\tif ( (empty($woi_list)) || (!is_array($woi_list)) ) {\n\t\t\tthrow new Exception('No WorkOrder Items to Generate Invoice');\n\t\t}\n\n\t\t// Add to Existing Invoice or Create a New one\n\t\tif (!empty($iv)) {\n\t\t\tif ($iv instanceof Invoice) {\n\t\t\t\t// All Good\n\t\t\t} elseif (is_numeric($iv)) {\n\t\t\t\t$iv = new Invoice($iv);\n\t\t\t}\n\t\t} else {\n\t\t\t$iv = new Invoice();\n\t\t\t$iv['auth_user_id'] = $this['auth_user_id'];\n\t\t\t$iv['contact_id'] = $this['contact_id'];\n\t\t\t$iv['workorder_id'] = $this['id'];\n\t\t\t$iv['note'] = $this['note'];\n\t\t\t$iv->save();\n\t\t}\n\n\t\t// Add Items\n\t\t$ivi_c = 0;\n\t\tforeach ($woi_list as $woi) {\n\n\t\t\t$ivi = new InvoiceItem(); // array();\n\t\t\t$ivi['workorder_item_id'] = $woi['id'];\n\t\t\t$ivi['kind'] = $woi['kind'];\n\t\t\t$ivi['quantity'] = $woi['a_quantity'];\n\t\t\t$ivi['rate'] = $woi['a_rate'];\n\t\t\t$ivi['unit'] = $woi['a_unit'];\n\t\t\t$ivi['tax_rate'] = $woi['a_tax_rate'];\n\t\t\t$ivi['name'] = $woi['name'];\n\t\t\t$ivi['note'] = $woi['note'];\n\n\t\t\t$iv->addInvoiceItem($ivi);\n\t\t\t$ivi_c++;\n\n\t\t\t// If Complete then Mark as Billed\n\t\t\t// @todo needs to come from a workflow type list\n\t\t\t// @todo Handle WorkOrder Kind/Status too\n\t\t\tif ($woi['status'] == 'Complete') {\n\t\t\t\t$woi['status'] = 'Billed';\n\t\t\t\t$woi->save();\n\t\t\t}\n\t\t}\n\t\t$iv->save();\n\n\t\t// Close Single Job Work Orders\n\t\tif ($this['kind'] == 'Single') {\n\t\t\t$this['status'] = 'Closed';\n\t\t\t// Base_Diff::note($this,'Closed & converted to Invoice');\n\t\t}\n\n\t\t$this->save();\n\n\t\t// Add History\n\t\t$msg = sprintf('Invoice #%d created from Work Order #%d with %d items', $iv['id'], $this['id'], $ivi_c);\n\t\t// Base_Diff::note($this,$msg);\n\t\t// Base_Diff::note($iv,$msg);\n\t\t// $this->_d->commit();\n\n\t\treturn $iv;\n\t}", "public function get_manifests_2invoice_byProductIdAndSrcDestAndDate($req,$res,$args){//\n $wh_id = $args['wh_id'];\n $Customer = Customer::where('id',$args['cust_id'])->first();\n $Manifest = Manifest::where('payment_status','PENDING')\n ->where('customer_id',$args['cust_id'])\n ->where('product_id',$args['product_id'])\n ->where('status','DELIVERED')\n ->where('invoice_no','NOT_SET')\n ->where('created_date','>=',$args['start_date'].\" 00:00:00\")\n ->where('created_date','<=',$args['end_date'].\" 23:59:59\")\n ->whereRaw(\"(source_warehouse_id = \".$wh_id.\" OR destination_warehouse_id=\".$wh_id.\")\")\n //->with(['product','source_warehouse','destination_warehouse','transporter'])\n ->orderBy('created_date', 'DESC')\n ->get();\n $data = [ \"invoices\" => $Manifest, \"customer\" => $Customer ];\n return $res->withJSON($data,200);//\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the namespace used to resolve plugin commands.
public function setPluginsNamespace($namespace) { $this->pluginsNamespace = $namespace; }
[ "private function _setNamespace()\n {\n if (is_multisite()) {\n $namespace = get_current_site()->domain;\n }\n else {\n $namespace = get_bloginfo('name');\n }\n\n /* Namespace must be alphanumeric only string */\n $this->_pool->setNamespace(FormatTool::camelCase($namespace));\n }", "public function setNamespace( $ns ) { $this->namespace = $ns; }", "public function setNamespace($namespace);", "abstract public function setNamespace();", "protected function setNamespace()\n {\n $this->namespace =\n (has_filter('inrage/blocks/namespace')\n ? apply_filters('inrage/blocks/namespace', rtrim($this->namespace))\n : 'App\\\\' . $this->directoryClassname . 's');\n }", "function namespacePlugin($namespace, $plugin) {\n $this->finder->registerNamespacePlugin($namespace, $plugin);\n }", "protected function setCommandNamespace()\n {\n return \"century:queue:worker:activities\";\n }", "public function setDefaultNamespace($namespace);", "protected function setNamespace()\n {\n preg_match('/namespace (.*?);/', $this->code, $match_this_ns);\n if (isset($match_this_ns[1])) {\n $this->namespace = $match_this_ns[1];\n }\n }", "public function setNamespace($namespace) {\n\t\t$this->namespace = $namespace;\n\t}", "protected function setAuthConfigNamespace()\n\t{\n\t\t$this->replaceIn(\n\t\t\t$this->getAuthConfigPath(), $this->currentRoot.'\\\\User', $this->argument('name').'\\\\User'\n\t\t);\n\t}", "public function setPhpNamespace($var) {}", "protected function setApiatoNamespaces()\n {\n $this->call('app:name', [\n 'name' => $this->argument('name'),\n ]);\n $this->setBootstrapNamespaces();\n $this->setAppConfigNamespaces();\n }", "function addNamespacePlugin($namespace, $baseDir, $plugin);", "public function setDefaultNamespace($namespaceName){ }", "public function replaceNamespace(string $namespace, $hints): self;", "protected function pluginNamespace()\n {\n return sprintf(\"%s\\%s\", $this->rootNamespace(), $this->studlyName());\n }", "public static function setNamespace($namespace)\n {\n Form::$ns = [ $namespace ];\n }", "public function setArgumentNamespace(string $namespace): void\n {\n $this->argumentNamespace = $namespace;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the database container.
public function getDbContainer() { return $this->_dbContainer; }
[ "public function createContainer()\n {\n return new DatabaseContainer($this);\n }", "public function Database()\n\t{\n\t\t//\n\t\t// Get container.\n\t\t//\n\t\tif( ($container = $this->Container()) !== NULL )\n\t\t\treturn $container->db;\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t\n\t\treturn parent::Database();\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\n\t}", "public static function getContainer() {\n return static::$container;\n }", "public function getDatabase()\n {\n return $this->dbObject;\n }", "public static function getContainer(): self\n {\n return static::$container;\n }", "public function getDatabase() {\n // TODO: Rename to getDatabaseInstance();?\n return $this->db;\n }", "public static function getContainer() {\n return static::$container;\n }", "final protected function container()\n {\n return $this->application->getContainer();\n }", "public function getDatabase()\n\t{\n\t\treturn $this->dbObject; \n\t}", "final public function getDB()\n {\n if(!$this->has('db')){\n trigger_error('No Database was included into this Project using the Application $app->setDB() method.');\n $db = new Collection;\n $this->set('db', $db);\n return $db;\n }\n\n return $this->get('db');\n }", "protected function getContainer()\n {\n return $this->container;\n }", "public function getContainer();", "public function getContainer() {\n\t\treturn $this->definition->getContainer();\n\t}", "public function getContainer()\n {\n if ($this->_container != null) {\n return $this->_container;\n }\n\n if ($this->space_id != null) {\n $container = $this->space;\n } elseif ($this->user_id != null) {\n $container = $this->user;\n } else {\n throw new Exception(\"Could not determine container type!\");\n }\n\n $this->_container = $container;\n\n return $this->_container;\n }", "protected function container()\n {\n return $this->container ? $this->container : $this->container = app();\n }", "public function getStorageDatabase()\n {\n if (!isset($this->dbStorage)) {\n $dsn = 'mysql:dbname=centreon_storage;host=' . $this->container->getHost() . ';port=' .\n $this->container->getPort(3306, $this->webService);\n $this->dbStorage = new \\PDO(\n $dsn,\n 'root',\n 'centreon'\n );\n $this->dbStorage->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n }\n return $this->dbStorage;\n }", "protected function getContainer()\n {\n return $this->getHelper('container');\n }", "public static function getDefaultConnectionContainer(): Container\n {\n return Container::getInstance();\n }", "protected function get_db()\n\t{\n\t\treturn $this->connections['primary'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate the input Parameters: $username: username Returns true: parameters valid anything else: error string
function validate_input($username) { // Username if((!isset($username)) || (strlen($username) == 0)) { return 'Please provide an username'; } if(!ctype_alnum($username)) { return 'Username must only contain letters and numbers'; } if(strlen($username) < 4) { return 'Username must have at least 4 characters'; } if(strlen($username) > 30) { return 'User name cannot have more than 30 characters'; } return true; }
[ "public function usernameValid($username);", "public function isValidUsername()\n {\n }", "public function usernameEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // set the var equal to function call of username\r\n $username = $this->getUsername();\r\n // If the field is empty\r\n if ( empty($username) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"username\"] = \"Username is missing.\";\r\n // Other test calls the validator class and nameisvalid function to test\r\n // the user name is it returns invalid the message is displayed to the user\r\n } else if ( !Validator::nameIsValid($this->getUsername()) ) {\r\n $this->errors[\"username\"] = \"Username is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"username\"]) ? true : false ) ;\r\n }", "public abstract /*bool*/ function usernameMeetsConstraints(/*String*/$username) /*throws UserServiceException*/;", "public function testCheckUsernameRequirementsValid(): void\n {\n //Username format is valid (No invalid characters)\n $this->assertTrue(Website\\functions\\CheckFormat::checkUsername('Ilikeplanes123'));\n }", "function validate_username($username){\n if(strpos($username, \" \")!== false ){ return \"username/password format error.<br>\"; }\n else if(strlen($username) < 6){ return \"username/password format error.<br>\"; }\n else if(preg_match (\"/[^a-zA-Z0-9_-]/\", $username)){ return \"username/password format error.<br>\";}\n return \"\";\n }", "function validate_username($username)\r\n\t{\r\n\t\t//return preg_match(REGEX_USERNAME, $username);\r\n\t\treturn preg_match(REGEX_USERNAME, $username);\r\n\t}", "public function validateUsername($username)\r\n\t{\r\n\t\t$graphModule = new Graph();\r\n\r\n\t\t$count = $graphModule->countNodes('User', 'username', $username);\r\n \r\n\t\tif ($count) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n $this->_username = $username;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "abstract public function validateUser();", "function validUsernameForLogin() {\r\n //Initialize validated to true\r\n $validated = true;\r\n\r\n //Verify that provided username is not just an empty string\r\n if ($_POST['username'] === \"\") {\r\n //Add error message to errors array (empty string)\r\n $GLOBALS['errors']['username']['empty'] = \"No username was provided.\";\r\n \r\n //Reset validated to false\r\n $validated = false;\r\n }\r\n //Only display further error(s) if a password was attempted (not an empty string)\r\n else {\r\n //Verify that provided username exists in the database\r\n if (!usernameExists($_POST['username'])) {\r\n //Add error message to errors array (already in use)\r\n $GLOBALS['errors']['username']['nonexistant'] = \"This username isn't currently in our database.\";\r\n\r\n //Reset validated to false\r\n $validated = false;\r\n }\r\n }\r\n\r\n //Submit finalized determination whether or not username is valid\r\n return $validated;\r\n }", "protected function validateUsername($username) {\r\n\t\tif (empty($username)) {\r\n\t\t\tthrow new UserInputException('username');\r\n\t\t}\r\n\t\t\r\n\t\t// check for forbidden chars (e.g. the \",\")\r\n\t\tif (!UserUtil::isValidUsername($username)) {\r\n\t\t\tthrow new UserInputException('username', 'notValid');\r\n\t\t}\r\n\t\t\r\n\t\t// Check if username exists already.\r\n\t\tif (!UserUtil::isAvailableUsername($username)) {\r\n\t\t\tthrow new UserInputException('username', 'notUnique');\r\n\t\t}\r\n\t}", "function validate_username($field)\r\n {\r\n if ($field == \"\") return \"No value was entered in username, please enter a username<br>\";\r\n else if (strlen($field) < 5)\r\n return \"Usernames must be at least 5 characters<br>\";\r\n else if (preg_match(\"/[^a-zA-Z0-9_-]/\", $field))\r\n return \"Only letters, numbers, - and _ in usernames<br>\";\r\n return \"\";\r\n }", "public function validate_username($username) {\r\n $validated_username = false;\r\n\r\n if(strlen($username) !== 0 || strlen($username) < 10) {\r\n $validated_username = $username;\r\n }\r\n\r\n return $validated_username;\r\n }", "function validateUserName($name) {\r\n //if it's NOT valid\r\n if (strlen($name) < 4)\r\n return false;\r\n //if it's valid\r\n else\r\n return true;\r\n }", "function validateUsername($mUsername){\n if(strlen($mUsername) < 4){\n return false;\n }\n else{\n return true;\n }\n }", "function validate_username($field)\n {\n if ($field == \"\")\n return \"No Username was provided.<br>\";\n else if (strlen($field) < 6)\n return \"Username must contain at least 6 characters.<br>\";\n else if (preg_match(\"/[^a-zA-Z0-9_-]/\", $field))\n return \"Only a-z, A-Z, 0-9, - and _ allowed in Usernames.<br>\";\n return \"\";\n }", "function ValidUname( $username ) {\r\n global $reserved;\r\n \r\n $validusernames = \"#^[a-z][-a-z0-9]{2,}$#i\";\r\n if( preg_match( $validusernames , $username ) == 0 ) {\r\n return -1; // invalid\r\n }\r\n if( in_array( $username , $reserved ) ) {\r\n return -2; // reserved\r\n }\r\n return true;\r\n }", "function verify_username(&$username)\n\t{\n\t\t// this is duplicated from the user manager\n\n\t\t// fix extra whitespace and invisible ascii stuff\n\t\t$username = trim(preg_replace('#\\s+#si', ' ', strip_blank_ascii($username, ' ')));\n\n\t\t$length = vbstrlen($username);\n\t\tif ($length < $this->registry->options['minuserlength'])\n\t\t{\n\t\t\t// name too short\n\t\t\t$this->error('usernametooshort', $this->registry->options['minuserlength']);\n\t\t\treturn false;\n\t\t}\n\t\telse if ($length > $this->registry->options['maxuserlength'])\n\t\t{\n\t\t\t// name too long\n\t\t\t$this->error('usernametoolong', $this->registry->options['maxuserlength']);\n\t\t\treturn false;\n\t\t}\n\t\telse if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/', $username))\n\t\t{\n\t\t\t// name contains semicolons\n\t\t\t$this->error('username_contains_semi_colons');\n\t\t\treturn false;\n\t\t}\n\t\telse if ($username != fetch_censored_text($username))\n\t\t{\n\t\t\t// name contains censored words\n\t\t\t$this->error('censorfield');\n\t\t\treturn false;\n\t\t}\n\t\telse if ($this->dbobject->query_first(\"\n\t\t\tSELECT userid, username FROM \" . TABLE_PREFIX . \"user\n\t\t\tWHERE userid != \" . intval($this->existing['userid']) . \"\n\t\t\tAND\n\t\t\t(\n\t\t\t\tusername = '\" . $this->dbobject->escape_string(htmlspecialchars_uni($username)) . \"'\n\t\t\t\tOR\n\t\t\t\tusername = '\" . $this->dbobject->escape_string(htmlspecialchars_uni(preg_replace('/&#([0-9]+);/esiU', \"convert_int_to_utf8('\\\\1')\", $username))) . \"'\n\t\t\t)\n\t\t\"))\n\t\t{\n\t\t\t// name is already in use\n\t\t\t$this->error('usernametaken', $username, $this->registry->session->vars['sessionurl']);\n\t\t\treturn false;\n\t\t}\n\t\telse if (!empty($this->registry->options['illegalusernames']))\n\t\t{\n\t\t\t// check for illegal username\n\t\t\t$usernames = preg_split('/\\s+/', $this->registry->options['illegalusernames'], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\tforeach ($usernames AS $val)\n\t\t\t{\n\t\t\t\tif (strpos(strtolower($username), strtolower($val)) !== false)\n\t\t\t\t{\n\t\t\t\t\t// wierd error to show, but hey...\n\t\t\t\t\t$this->error('usernametaken', $username, $this->registry->session->vars['sessionurl']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we got here, everything is okay\n\t\t$username = htmlspecialchars_uni($username);\n\n\t\t$this->user['userid'] = 0;\n\t\treturn true;\n\t}", "public function validateUsername()\n {\n global $_CORELANG;\n\n if (empty($this->username)) {\n return true;\n }\n if (self::isValidUsername($this->username)) {\n if (self::isUniqueUsername($this->username, $this->id)) {\n return true;\n } else {\n $this->error_msg[] = $_CORELANG['TXT_ACCESS_USERNAME_ALREADY_USED'];\n }\n } else {\n $this->error_msg[] = $_CORELANG['TXT_ACCESS_INVALID_USERNAME'];\n }\n\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a incident entity.
public function showAction(Incident $incident) { $deleteForm = $this->createDeleteForm($incident); return $this->render('INAdminBundle:incident:show.html.twig', array( 'incident' => $incident, 'delete_form' => $deleteForm->createView(), )); }
[ "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ComDaufinBundle:Incident')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Incident entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ComDaufinBundle:Incident:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function getUnresolvedIncidentAction()\n {\n $repository = $this->getDoctrine()->getRepository(Incident::class);\n $incidents = $repository->findBy(['resolved_at' => null]);\n return $this->handleView($this->view($incidents));\n }", "public function getResolvedIncidentAction()\n {\n $repository = $this->getDoctrine()->getRepository(Incident::class);\n $incidents = $repository->findAll();\n $resolvedIncidents = [];\n foreach($incidents as $incident) {\n if ($incident->getResolvedAt() !== null) {\n $resolvedIncidents[] = $incident;\n }\n }\n return $this->handleView($this->view($resolvedIncidents));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FklFranklinBundle:Intervention')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Intervention entity.');\n }\n\n return $this->render('FklFranklinBundle:Intervention:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "function action_show_entity_detail() {\n $rc = rcmail::get_instance();\n\n /** @var rcmail_output_html $output */\n $output = $rc->output;\n\n $type = $this->getInput(self::INPUT_ENTITY_TYPE, rcube_utils::INPUT_GET);\n\n switch ($type) {\n case self::ENTITY_FILTER:\n $title = $this->gettext('rubik_filter.title_filter_form');\n break;\n case self::ENTITY_VACATION:\n $title = $this->gettext('rubik_filter.title_vacation_form');\n break;\n case self::ENTITY_REPLY:\n $title = $this->gettext('rubik_filter.title_reply_form');\n break;\n default:\n $title = '';\n break;\n }\n\n $output->set_env('rubik_details_title', $title);\n\n $output->send('rubik_filter.rubik_entity_details');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CertIncidentBundle:Incident')->findAll();\n \n return $this->render('CertIncidentBundle:Incident:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function showIncident($id)\n {\n // ->with() will eager-load all the relations. Try $incident = Incident::find($id);\n // $page = $incident->relation()->paginate(...)\n\n $data['incident'] = Incidents::find($id);\n $data['comments'] = $data['incident']->comments()->paginate();\n\n return view('incidents.show' , $data);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ExploticFormationBundle:Intervention')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Intervention entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ExploticFormationBundle:Intervention:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function showAction($id) {\n\t\t$em = $this->getDoctrine()->getManager();\n\n\t\t$entity = $em->getRepository('AcmeIssueBundle:Issue')->find($id);\n\n\t\tif (!$entity) {\n\t\t\tthrow $this->createNotFoundException('Unable to find Issue entity.');\n\t\t}\n\t\t$lines = $em->getRepository('AcmeIssueBundle:IssueLine')->findBy(\n\t\t\tarray('issue' => $id)\n\t\t);\n\n\t\treturn $this->render(\n\t\t\t'AcmeIssueBundle:Issue:show.html.twig',\n\t\t\tarray(\n\t\t\t\t'issue' => $entity,\n\t\t\t\t'lines' => $lines,\n\t\t\t)\n\t\t);\n\t}", "public function getincidentAction()\n {\n \t$response_type = $this->getRequest()->getParam('typeresponse',null);\n\t\t$model_incident = new Incident();\n\t\t$reponse = $model_incident->getIncidentByLocationResponse($response_type,43.2967,5.37639,5);\n\t\techo $reponse;\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('FSBASTTCoreBundle:Interview')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Interview entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FSBASTTAdminCrudBundle:Interview:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n\n ));\n }", "function show_view_instrument($id) {\n\n $instruments = entity_load('instrument', array($id));\n $instrument = $instruments[$id];\n\n drupal_set_title($instrument->name);\n $output = entity_view('instrument', array($instrument));\n\n return $output;\n}", "public function showIncoherenceInFormAction() {\n $incoherenceRepository = $this->getDoctrine()->getRepository('CoreBundle:IncoherenceLog');\n $incoherences = $incoherenceRepository->findByUser($this->getUser());\n\n return $this->render('@Core/Social/incoherence.html.twig', array(\n 'incoherences' => $incoherences,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BSFrontBundle:Event')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Event entity.');\n }\n\n return $this->render('BSFrontBundle:Event:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction($id)\n {\n $projects = $this->AllProject();\n $users = $this->Alluser();\n $statuses = $this->AllStatus();\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ErpBundle:Issue')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Issue entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ErpBundle:Issue:show.html.twig', array(\n 'entity' => $entity,\n 'projects' => $projects,\n 'users' => $users,\n 'statuses' => $statuses,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function viewCampaignInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n return $this->render('easy_admin/Campaign/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Estadofondo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estadofondo entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Estadofondo:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CertIncidentBundle:Incident')->find($id);\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Incident entity.');\n }\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n return $this->render('CertIncidentBundle:Incident:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function displayEntityBrowser();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether given value is has valid type
function isValidType($data);
[ "private function checkValueType($value) {\n if(is_string($value) || is_numeric($value) || is_null($value)) {\n return true;\n }\n\n return false;\n }", "public function checkType($value, $type) {\n\t\tswitch ($type) {\n\t\t\tcase \"int2\":\n\t\t\tcase \"int4\":\n\t\t\tcase \"int8\":\n\t\t\t\tif ($value != null && !is_numeric($value))\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tcase \"float4\":\n\t\t\tcase \"float8\":\n\t\t\t\tif ($value != null && !is_numeric($value))\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\n\t\t}\n\t\t// TODO: MySQL Types, date types.\n\t\treturn true;\n\t}", "protected function validateType($value)\n {\n }", "public function isValidValue($value)\n\t{\n\t\treturn gettype($value) === $this->phpType;\n\t}", "public function isValidValue($value)\n\t{\n\t\treturn $this->getType()->isValidValue($this->typeRegistry, $value);\n\t}", "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 isOfType($value) : bool;", "public function isType($value) {\n if ($this->type != null) {\n switch (strtolower($this->type)) {\n case 'string':\n return is_string($value);\n case 'array':\n return is_array($value);\n case 'resource':\n return is_resource($value);\n case 'float':\n case 'double':\n case 'real':\n return is_float($value);\n case 'int':\n case 'int':\n case 'long':\n return is_int($value);\n case 'bool':\n case 'boolean':\n return is_bool($value);\n }\n } else {\n return $this->class->isInstance($value);\n }\n }", "function checktype($value, array $validTypes)\n{\n $nativeTypes = [\n 'array' => 'is_array',\n 'bool' => 'is_bool',\n 'callable' => 'is_callable',\n 'double' => 'is_double',\n 'float' => 'is_float',\n 'int' => 'is_int',\n 'integer' => 'is_integer',\n 'long' => 'is_long',\n 'null' => 'is_null',\n 'numeric' => 'is_numeric',\n 'object' => 'is_object',\n 'real' => 'is_real',\n 'resource' => 'is_resource',\n 'scalar' => 'is_scalar',\n 'string' => 'is_string',\n ];\n\n $valid = false;\n foreach ($validTypes as $type) {\n if (isset($nativeTypes[$type])) {\n $valid = call_user_func($nativeTypes[$type], $value);\n } else {\n $valid = $value instanceof $type;\n }\n\n if ($valid) {\n break;\n }\n }\n\n if (!$valid) {\n $type = gettype($value);\n if (gettype($value) === 'object') {\n $type = get_class($value);\n }\n throw new InvalidArgumentException('Invalid type: '.$type.', Expected type(s): '.implode(', ', $validTypes));\n }\n\n return true;\n}", "abstract public function isValueValid($value);", "public function hasTypeFor($value);", "public function validateType($value): bool\n {\n return ($this->validator)($value);\n }", "private function validateType(): bool\n {\n switch ($this->options['type']) {\n case 'integer':\n $isValid = \\is_int($this->value) ? true : false;\n break;\n case 'float':\n $isValid = \\is_int($this->value) || \\is_float($this->value) ? true : false;\n break;\n default:\n $isValid = \\is_int($this->value) || \\is_float($this->value) ? true : false;\n break;\n }\n if (!$isValid) {\n $this->setError(self::VALIDATOR_ERROR_NUMBER_INCORRECT_TYPE);\n }\n return $isValid;\n }", "public function canHandleValue(mixed $value): bool;", "public function isValidValue($value)\n\t{\n\t\treturn $this->getType()->isValidValue($value);\n\t}", "protected function checkType(string $type, $value): bool\n {\n switch ($type) {\n case 'array':\n return \\is_array($value);\n\n case 'bool':\n case 'boolean':\n return \\is_bool($value);\n\n case 'callable':\n return \\is_callable($value);\n\n case 'float':\n case 'double':\n return \\is_float($value);\n\n case 'int':\n case 'integer':\n return \\is_int($value);\n\n case 'null':\n return $value === null;\n\n case 'numeric':\n return \\is_numeric($value);\n\n case 'object':\n return \\is_object($value);\n\n case 'resource':\n return \\is_resource($value);\n\n case 'scalar':\n return \\is_scalar($value);\n\n case 'string':\n return \\is_string($value);\n\n case 'mixed':\n return true;\n\n default:\n return ($value instanceof $type);\n }\n }", "public function isValid($value)\n {\n if ($value instanceof $this->className) {\n return true;\n }\n $this->error(self::NOT_INSTANCE_OF);\n return false;\n }", "protected function __isValidEnumValue(mixed $value): bool\n {\n return is_string($value) || is_int($value);\n }", "public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set path to ssl certificate
public function setSSLCertPath($path) { $this->sslCertPath = $path; return $this; }
[ "public function setCertificate($path)\n {\n $this->setCertificateFromPath($path);\n }", "public function setRootCertificatePath($path)\n {\n $this->_certPath = $path;\n }", "public static function setPathToCertificate($pathToCertificate) {\n self::$pathToCertificate = $pathToCertificate;\n }", "public function setCertificate(string $path, string $password=\"\"): void\n {\n if (!file_exists($path)) {\n throw new FileNotFoundException($path);\n }\n $this->connection->setOption(CURLOPT_SSLCERT, $path);\n if ($password) {\n $this->connection->setOption(CURLOPT_SSLCERTPASSWD, $password);\n }\n }", "function m_setssl_files($conn, $sslkeyfile, $sslcertfile){}", "public function configureSslPaths() {\n\t\t\n\t\t$helper = Mage::helper('netpayonlinepayments');\n\t\t\n\t\t$this->_ssl_path['use_cert'] = $helper->getApiCertEnabled();\n\t\t$this->_ssl_path['certificate'] = $helper->getApiCert();\n\t\t$this->_ssl_path['key'] = $helper->getApiKey();\n\t\t$this->_ssl_path['certificate_pass'] = $helper->getApiCertPass();\n\t}", "public function setClientCertificatePath($path)\n {\n $this->clientCertificatePath = $path;\n }", "private function trust_certificate( $crt_path ) {\n\n\t\tif ( IS_DARWIN ) {\n\t\t\tEE::log( 'You may need to enter password once for adding root certificate as trusted on your system.' );\n\t\t\tEE::exec( sprintf(\n\t\t\t\t'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain %s', $crt_path\n\t\t\t) );\n\t\t} else {\n\t\t\t$cert_path = '/usr/local/share/ca-certificates';\n\t\t\t$this->fs->copy( $this->root_pem, '/usr/local/share/ca-certificates/easyengine.crt' );\n\t\t\tEE::exec( 'update-ca-certificates' );\n\t\t}\n\t}", "public function buildCertificateConf($path, $url)\n {\n $config = str_replace('VALET_DOMAIN', $url, $this->files->get(__DIR__ . '/../stubs/openssl.conf'));\n $this->files->putAsUser($path, $config);\n }", "public function buildCertificateConf(string $path, string $url): void\n {\n $config = str_replace('VALET_DOMAIN', $url, $this->files->getStub('openssl.conf'));\n $this->files->putAsUser($path, $config);\n }", "public function withTrustedCerts(...$path) {}", "public function getSSLCertificatePath()\n {\n return $this->getParameter('sslCertificatePath');\n }", "public static function get_certificate_path()\n {\n }", "public function getCertificatePath()\n\t{\n\t\treturn CLIENT_WEB_DIR . \"/certificates/scorm/\" . $this->object->getId() . \"/\";\n\t}", "function mysqli_ssl_set ($key, $cert, $ca, $capath, $cipher) {}", "public function getSSLCertificatePath()\n {\n return $this->sslCertPath;\n }", "public function setTlsCertificates($capath, $certfile = null, $keyfile = null, $password = null) {}", "public function get_certificate_file() {\n return '../data/certificates/' . hash_secure($this->name) . '.crt';\n }", "public function setCertificateFromContentRaw($contentRaw)\n {\n $tempFilePath = parent::createTempFile();\n file_put_contents($tempFilePath, $contentRaw);\n $this->_certificatePath = $tempFilePath;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries LDAP for the records using the specified query.
public function searchByQuery($query) { $results = $this->ldap->search($this->basedn, $query); return $results; }
[ "function islandora_scholar_ldap_search($query) {\n $ldap_host = variable_get('scholar_ldap_host', '');\n $ldap_port = variable_get('scholar_ldap_port', '389');\n $ds = ldap_connect($ldap_host, $ldap_port) or die(\"Could not connect to ldap host!\");\n\n $bind_rdn = variable_get('scholar_ldap_bind_user', NULL);\n $bind_password = variable_get('scholar_ldap_bind_pass', NULL);\n\n if (!$bind = ldap_bind($ds, $bind_rdn, $bind_password)) {\n drupal_set_message(t('Could not bind to LDAP server at @ldap_host', array('@ldap_host' => $ldap_host)), 'error');\n }\n\n $basedn = variable_get('scholar_ldap_basedn', '');\n\n if (is_array($query)) {\n $filter = \"(&(objectClass=person)(uid=*)(|\";\n foreach ($query as $q) {\n $filter .= \"(fullName=* $q *)\";\n }\n $filter .= \"))\";\n }\n else {\n $filter = \"(&(objectClass=person)(uid=*)(fullName=$query))\";\n }\n\n $attr = array(\"dn\", \"cn\", \"mail\");\n\n $sr = ldap_search($ds, $basedn, $filter, array('uid', 'cn', 'fullname', 'mail', 'groupmembership'));\n\n $list = ldap_get_entries($ds, $sr);\n\n $count = $list['count'];\n if ($count == 0) {\n return NULL;\n }\n else {\n return $list;\n }\n}", "function query_AD() {\n\tglobal $conf, $exchange,$ad_user,$ad_password;\n\t\n\tlogit('Querying user information from AD');\n\t\n\t$connect = ldap_connect($conf->ad_server,$conf->ad_port) or logit('Could not connect to Active Directory, ' . ldap_error($connect));\n\t$bind = ldap_bind($connect, $ad_user, $ad_password) or logit('Could not bind to Active Directory, ' . ldap_error($connect));\n\n\t#$filter = \"objectClass=person\";\t# There might be objects of other classes around (e.g. groups) we don't want to fetch\n\t$filter = \"(&(objectClass=person)(!(objectClass=computer)))\"; #We don't want computers either\n\t# AD attribute names \n\t# username: sAMAccountName\n\t# prename: givenName\n\t# family name: sn\n\t$fetch_attributes = array('sAMAccountName','givenName','sn');\n\t\n\t# Additional Exchange schema attributes\n\t# department: department\n\t# rfc822mailbox: mail\n\t# houseidentifier: -\n\t# physicalDeliveryOfficeName: physicalDeliveryOfficeName\n\t# telephoneNumber: telephoneNumber\n\t# mobile: mobile\n\tif( $exchange ) {\n\t\t$fetch_attributes = array_merge($fetch_attributes, array('department', 'mail', 'physicalDeliveryOfficeName', 'telephoneNumber', 'mobile'));\n\t}\n\n\t$info = array();\n\t# loop through all dn with user information and fetch data\n\tforeach( $conf->ad_base_user_dn as $base_dn ) {\n\t\t#$results = ldap_list($connect, $base_dn, $filter, $fetch_attributes) or logit('Could not retrieve data, ' . ldap_error($connect));\n \t\t//ldap_list performs the query only on one level, ldap_search searches through the whole tree\n $results = ldap_search($connect, $base_dn, $filter, $fetch_attributes) or logit('Could not retrieve data, ' . ldap_error($connect));\n\t\t$info = array_merge($info, ldap_get_entries($connect, $results)) or logit('Could not get entries, ' . ldap_error($connect));\n\t}\n\t\n\tldap_close($connect); \n\n\tdebug1(print_r($info, TRUE));\n\treturn $info;\n}", "function query($filter,$attributes,$setResult=true)\n {\n $this->bind();\n $this->lastQuery = $filter;\n $sr = @ldap_search($this->linkID, \n self::$baseDN,\n $filter,\n $attributes,\n 0,\n UNL_Peoplefinder::$resultLimit,\n self::$ldapTimeout);\n if ($setResult) {\n $this->lastResultCount = @ldap_count_entries($this->linkID, $sr);\n $this->lastResult = @ldap_get_entries($this->linkID, $sr);\n $this->unbind();\n //sort the results\n for ($i=0;$i<$this->lastResult['count'];$i++) {\n if (isset($this->lastResult[$i]['givenname'])) {\n $name = $this->lastResult[$i]['sn'][0]\n . ', '\n . $this->lastResult[$i]['givenname'][0];\n } else {\n $name = $this->lastResult[$i]['sn'][0];\n }\n $this->lastResult[$i]['insensitiveName'] = strtoupper($name);\n }\n @reset($this->lastResult);\n $this->lastResult = @UNL_Peoplefinder_Driver_LDAP_Util::array_csort(\n $this->lastResult,\n 'insensitiveName',\n SORT_ASC);\n return $this->lastResult;\n } else {\n $result = ldap_get_entries($this->linkID, $sr);\n $this->unbind();\n return $result;\n }\n }", "function &getRecords($query)\n {\n // refer to wsdl for more info\n $query = new SOAP_Value('query', '{urn:AGProjects:NGNPro}DnsRecordQuery', $query);\n $result = $this->call('getRecords',\n $v = array('query' => $query),\n array('namespace' => 'urn:AGProjects:NGNPro:Dns',\n 'soapaction' => '',\n 'style' => 'rpc',\n 'use' => 'encoded'));\n return $result;\n }", "function ldap_query($uid,$entry)\n{\n\t$server = \"ldap.itd.umich.edu\";\n\t$port = 389;\n\t// check if ldap server is accessible\n\tif ( $fp = fsockopen($server,$port,$err,$errString,1) ) {\n\t\t// it's available\n\t\tfclose($fp);\n\t}\n\telse die(\"Unable to connect to LDAP server! $errString Please try again later.\");\n\t\n\t\t\n\t$conn = ldap_connect($server,$port);\n\tif ($conn)\n\t{\n\t\tldap_set_option($conn,LDAP_OPT_TIMELIMIT,5);\n\t\tif (ldap_bind($conn))\n\t\t{\n\t\t\t$dn = \"ou=People,dc=umich,dc=edu\";\n\t\t\t$filter = \"uid=\".$uid;\n\t\t\t$result=ldap_search($conn, $dn, $filter);\n\t\t $entries = ldap_get_entries($conn, $result);\n\t\t\t//$result = $entries[0][$entry][0];\n\t\t\t// if entry is private, only 'mail' returns\n\t\t\tif ( !isset($entries[0][$entry][0]) and $entry == \"cn\" ) return ldap_query($uid,\"mail\");\n\t\t\telse return $entries[0][$entry][0];\n\t\t}\n\t\telse return false;\n\t\tldap_close($conn);\n\t}\n\telse return false;\n}", "public function find($dn, $query)\n {\n static::$connected or $this->bind();\n\n $entries = $this->ldap->query($dn, $query)->execute()->toArray();\n return collect($entries)->map(function (SymfonyEntry $entry) {\n return new Entry($entry);\n });\n }", "private function connectldap_request($ldap_search){\n $lc = ldap_connect($this->LDAP_Host, $this->LDAP_Host_PORT);\n ldap_set_option($lc, LDAP_OPT_NETWORK_TIMEOUT, 3); # 3 second timeout limit\n ldap_set_option ($lc, LDAP_OPT_REFERRALS, 0);\n ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_bind($lc);\n \n $sr = ldap_search($lc,$ldap_search['basedn'],$ldap_search['filter']);\n $info = ldap_get_entries($lc, $sr);\n \n ldap_close($lc);\n return $info;\n }", "function bluepages_search ($filter, $attr = null, $key_attr = 'dn') {\n\t# setup filter array, attr list, and base dn\n\tif ( ! is_array($filter) )\n\t\t$filter = array($filter);\n\t$basedn = 'ou=bluepages,o=ibm.com';\n\t$attr = $attr ? $attr : array('uid', 'cn', 'mail', 'ibmserialnumber', 'employeecountrycode', 'notesid', 'ismanager', 'manager');\n\t# make sure $key is in attr array or we cannot use it\n\tif ( $key_attr != 'dn' && ! in_array($key_attr, $attr) )\n\t\t$attr[] = $key_attr;\n\n\t# setup ldap connection\n\tif ( ! $ds = _ldap_connect() )\n\t\treturn(false);\n\n\t# connect, bind and do a parallel search\n\t$conn = array_fill(0, sizeof($filter), $ds);\n\t$search_result = ldap_search($conn, $basedn, $filter, $attr);\n\n\t# process each of the search results\n\t$result = array();\n\tforeach ($search_result as $sr) {\n\n\t\t# check to see if we have hits for this result\n\t\tif (@ldap_count_entries($ds, $sr) == 0) continue;\n\n\t\t# get the values of each entry found\n\t\tfor ($entry = @ldap_first_entry($ds, $sr); $entry != false; $entry = @ldap_next_entry($ds, $entry)) {\n\n\t\t\t# get the dn of this entry, always\n\t\t\t$dn = @ldap_get_dn($ds, $entry);\n\n\t\t\t# get the hash key\n\t\t\tif ($key_attr && $key_attr != 'dn') {\n\t\t\t\t$key_val = @ldap_get_values($ds, $entry, $key_attr);\n\t\t\t\t$key_val = $key_val ? $key_val[0] : $dn;\n\t\t\t} else {\n\t\t\t\t$key_val = $dn;\n\n\t\t\t}\n\n\t\t\t# put the dn into the result hash\n\t\t\t$result[$key_val]['dn'] = $dn;\n\n\t\t\t# get each attr, missing attrs are stored as null values\n\t\t\tforeach ($attr as $a) {\n\t\t\t\t$val = @ldap_get_values($ds, $entry, $a);\n\t\t\t\t$result[$key_val][$a] = $val ? $val[0] : null;\n\t\t\t}\n\t\t}\n\t}\nreturn($result);\n}", "function _query($query) {\n\t\t$this->query = $this->_eval_query($query);\n if (!empty($this->query) && is_resource($this->MRes)) {\n\tUdm_Set_Agent_Param($this->MRes,UDM_PARAM_QUERY,$this->query);\n if($this->_result = udm_find($this->MRes,$this->query)) {\n\t\t\t\t$this->_set_ResParam('ResRows',UDM_PARAM_NUM_ROWS);\n\t\t\t\t$this->_set_ResParam('ResFound',UDM_PARAM_FOUND);\n\t\t\t\t$this->_set_ResParam('ResTime',UDM_PARAM_SEARCHTIME);\n\t\t\t\t$this->_set_ResParam('ResFDoc',UDM_PARAM_FIRST_DOC);\n\t\t\t\t$this->_set_ResParam('ResLDoc',UDM_PARAM_LAST_DOC);\n $this->maxPages = ceil($this->ResFound / $this->NumRows);\n\t\t\treturn TRUE;\n\t\t\t}\n \n return array(\"error\"=>\"mnogosearch:\" . udm_Error($this->MRes));;\n\t\t\n } else {\n\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function runQuery($scopedn, $ldapquery, $attributes, $scopelevel)\n {\n switch($scopelevel)\n {\n\n case \"sub\":\n $scope = \"ldap_search\";\n break;\n\n case \"one\":\n $scope = \"ldap_list\";\n break;\n\n case \"base\":\n $scope = \"ldap_read\";\n break;\n\n }\n\n return @$scope($this->ldap, $scopedn, $ldapquery, $attributes);\n \n }", "public static function search($query);", "public function query($query) {\n $query = urlencode($query);\n return $this->get(\"/services/data/v26.0/query/?q=$query\");\n }", "function employee_by_dn ($dn, $attr = null) {\n\tif ( ! is_array($dn) )\n\t\t$dn = array($dn);\n\t$attr = $attr ? $attr : array('cn', 'mail', 'uid');\n\t$filter = '(objectclass=*)';\n\n\t# setup ldap connection\n\tif ( ! $ds = _ldap_connect() )\n\t\treturn(false);\n\n\t# connect, bind and do a parallel search\n\t$conn = array_fill(0, sizeof($dn), $ds);\n\t$search_result = ldap_read($conn, $dn, $filter, $attr);\n\n\t# process each of the search results\n\t$result = array();\n\tforeach ($search_result as $sr) {\n\t\t# check to see if we have hits for this result\n\t\tif (@ldap_count_entries($ds, $sr) == 0)\n\t\t\tcontinue;\n\n\t\t# get the values of each entry found\n\t\tfor ($entry = @ldap_first_entry($ds, $sr); $entry != false; $entry = @ldap_next_entry($ds, $entry)) {\n\t\t\t# results are a dn keyed hash\n\t\t\t$dn = @ldap_get_dn($ds, $entry);\n\t\t\t$result[$dn]['dn'] = $dn;\n\n\t\t\t# get each attr, missing attrs are stored as null values\n\t\t\tforeach ($attr as $a) {\n\t\t\t\t$val = @ldap_get_values($ds, $entry, $a);\n\t\t\t\t$result[$dn][$a] = $val ? $val[0] : null;\n\t\t\t}\n\t\t}\n\t}\nreturn($result);\n}", "private function doSearch()\n {\n $function = $this->search_function;\n $this->search_result = @$function(\n $this->conn,\n $this->base,\n $this->filter,\n $this->attrs,\n 0,\n $this->size_limit,\n $this->time_limit,\n $this->deref\n );\n if (!$this->search_result) {\n throw new LdapException($this->conn);\n }\n\n // retrieve the first result\n $this->current_entry = ldap_first_entry($this->conn, $this->search_result);\n }", "protected static function query()\n {\n $model = ModelRepository::get(LdapWatcher::class);\n\n return $model::query();\n }", "public function testSearch()\n {\n $bdn = 'cn=admin,dc=demo,dc=squiz,dc=net';\n $pass = 'squiz';\n $conn = LDAP::connectToLDAP('localhost', 389, $bdn, $pass);\n\n $start = 'ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net';\n $filter = '(objectClass=*)';\n $sr = LDAP::search($conn, $start, $filter);\n $count = LDAP::getNumEntries($conn, $sr);\n PHPUnit_Framework_Assert::assertEquals(12, $count);\n\n $entries = LDAP::getEntries($conn, $sr);\n $data = LDAP::getData($entries);\n $dn = array();\n foreach ($data as $d) {\n $dn[] = $d['dn'];\n }\n\n sort($dn);\n $expected = array(\n 'ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=Manager,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=aschwarzenegger,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=blee,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=jchan,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=jrabbit,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=jroberts,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=mgibson,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=mmonroe,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=nkidman,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=sjohansson,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n 'uid=sstallone,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net',\n );\n PHPUnit_Framework_Assert::assertEquals($expected, $dn);\n\n }", "public function searchOne($baseDN, $filter = '(objectClass=*)', $attributes = array(), $attrsonly = 0, $sizelimit = 0, $timelimit = 0, $deref = LDAP_DEREF_NEVER) {\n\t\t$result = @ldap_list($this->conn, $baseDN, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);\n\t\tif (ldap_errno($this->conn)) {\n\t\t\tthrow new LdapException(ldap_error($this->conn), ldap_errno($this->conn));\n\t\t}\n\n\t\treturn new LdapResult($this->conn, $result);\n\t}", "public function fetch_records(Query $query): array;", "function searchRecords() {\r\n\t\t$searchQuery = $this->parameters ['query'];\r\n\t\t\r\n\t\tif ($this->recordModel->validationFactory->isQueryValid ( $searchQuery )) {\r\n\t\t\t$this->recordModel->setRecordListWithSearchQuery ( $this->userId, $searchQuery );\r\n\t\t\t$this->coreModel->setPageAlert ( \"success\", RECORD_SEARCH_SUCCESS );\r\n\t\t} else {\r\n\t\t\t$this->coreModel->setPageAlert ( \"danger\", RECORD_SEARCH_INVALID );\r\n\t\t\t$this->recordModel->setRecordListWithAll ( $this->userId );\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public Methods Set up ActivityNotifications's legacy theme directory. Starting with version 1.2, and ending with version 1.8, ActivityNotifications registered a custom theme directory ajanthemes which contained the ajandefault theme. Since ActivityNotifications 1.9, ajanthemes is no longer registered (and ajandefault no longer offered) on new installations. Sites using ajandefault (or a child theme of ajandefault) will continue to have ajanthemes registered as before.
public function register_theme_directory() { if ( ! ajan_do_register_theme_directory() ) { return; } register_theme_directory( $this->old_themes_dir ); }
[ "abstract protected function registerThemeLayouts();", "function _maybe_update_themes() {}", "function ajan_after_setup_theme() {\n\tdo_action ( 'ajan_after_setup_theme' );\n}", "function ajan_setup_updater() {\n\n\t// Are we running an outdated version of ActivityNotifications?\n\tif ( ! ajan_is_update() )\n\t\treturn;\n\n\tajan_version_updater();\n}", "public function setup_theme() {\n\n\t\t// Bail if something already has this under control\n\t\tif ( ! empty( $this->theme_compat->theme ) )\n\t\t\treturn;\n\n\t\t// Setup the theme package to use for compatibility\n\t\t\n\t}", "function twentysixteen_switch_theme() {}", "function _setThemes(){\n global $config;\n // set defaults ...\n $this->aThemes = array( 'path'=>$config['dir_tpl']\n , 'pathAdmin'=>$config['dir_tpl'].'admin/'\n , 'themes'=>array()\n );\n // get available themes (themes folder cannot be 'admin', and theme cannot be 'default') ...\n $config['theme'] = trim($config['theme'],'/');\n $config['themesFolder'] = trim($config['themesFolder'],'/');\n if(isset($config['themesFolder']) && $config['themesFolder'] != '' && $config['themesFolder'] != 'admin'){\n $themedir = $config['dir_tpl'].rtrim($config['themesFolder'],'/').'/';\n if(is_dir($themedir)){\n $oDir = dir($themedir);\n while(($name = $oDir->read()) !== false){\n if(substr($name,0,1)!='.' && $name!='default' && is_dir($themedir.$name)){\n $theme = ucwords(str_replace('_', ' ', $name));\n $this->aThemes['themes'][$name] = array( 'name'=>$theme, 'css'=>$this->_listCSSfiles($themedir.$name));\n }\n }\n $oDir->close();\n }\n }\n if($config['theme'] != 'default'){ // if we're using default there's nothing else to do\n // set the paths if the theme is valid (valid = at least one css file) ...\n if(isset($this->aThemes['themes'][$config['theme']]) && count($this->aThemes['themes'][$config['theme']]['css']) > 0){\n $this->aThemes['path'] = $config['dir_tpl'].$config['themesFolder'].'/'.$config['theme'].'/';\n // admin stays set to default if theme/admin does not exist ...\n if(is_dir($this->aThemes['path'].'admin/')){ $this->aThemes['pathAdmin'] = $this->aThemes['path'].'admin/'; }\n // we found the theme but which css do we use\n if(!in_array($config['template'], $this->aThemes['themes'][$config['theme']]['css'])){ // we haven't got the currently set one ...\n if(in_array('default.css', $this->aThemes['themes'][$config['theme']]['css'])){ // we have a default.css so use that\n $config['template'] = 'default.css';\n }else{ // use the first one found\n $config['template'] = $this->aThemes['themes'][$config['theme']]['css'][0];\n }\n }\n }else{ // we coudn't find the theme we were looking for, so reset to 'default'; we only need to set the name because the paths and stylesheets will be from default anyway\n $config['theme'] = 'default';\n }\n }\n $this->aThemes['themes']['default'] = array('name'=>'Default', 'css'=>$this->_listCSSfiles($config['dir_tpl']));\n $config['dir_theme'] = $this->aThemes['path'];\n }", "function accountswitcher_new_themes()\n{\n\taccountswitcher_revert_template_edits();\n\taccountswitcher_apply_template_edits();\n}", "public function theme_installer()\n {\n }", "function jr_mt_convert_ids( $settings ) {\n\tif ( is_array( $settings['ids'] ) ) {\n\t\tforeach ( $settings['ids'] as $key => $ids_array ) {\n\t\t\t/*\tBe sure that Theme has not been deleted.\n\t\t\t*/\n\t\t\t$jr_mt_all_themes = jr_mt_all_themes();\n\t\t\tif ( isset( $jr_mt_all_themes[ $ids_array['theme'] ] ) ) {\n\t\t\t\t/*\t$key:\n\t\t\t\t\t\t'' - Home entry\n\t\t\t\t*/\n\t\t\t\tif ( '' === $key ) {\n\t\t\t\t\tif ( '' === $settings['site_home'] ) {\n\t\t\t\t\t\t$settings['site_home'] = $ids_array['theme'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( isset( $ids_array['type'] ) ) {\n\t\t\t\t\t\tswitch ( $ids_array['type'] ) {\n\t\t\t\t\t\t\tcase 'admin':\n\t\t\t\t\t\t\t\t/*\tIgnore as Admin pages are ignored\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'prefix':\n\t\t\t\t\t\t\t\t/*\tURL Prefix\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t$url = JR_MT_HOME_URL . \"/$key\";\n\t\t\t\t\t\t\t\t$settings['url_prefix'][] = array(\n\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '*':\n\t\t\t\t\t\t\t\t/*\tURL Prefix with Asterisk\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t$url = JR_MT_HOME_URL . \"/$key\";\n\t\t\t\t\t\t\t\t$settings['url_asterisk'][] = array(\n\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'cat':\n\t\t\t\t\t\t\t\tif ( is_wp_error( get_the_category_by_ID( $key ) ) ) {\n\t\t\t\t\t\t\t\t\t/*\tIgnore non-existent Categories.\n\t\t\t\t\t\t\t\t\t\tThey were likely deleted.\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\tjr_mt_messages( 'Setting deleted for non-existent Category with ID=' . $key );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$url = get_category_link( $key );\n\t\t\t\t\t\t\t\t\t$settings['url'][] = array(\n\t\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\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\tbreak;\n\t\t\t\t\t\t\tcase 'archive':\n\t\t\t\t\t\t\t\t/*\tFrom ?m=yyyymm query originally\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t$yyyymm = $ids_array['id'];\n\t\t\t\t\t\t\t\t$year = intval( $yyyymm / 100 );\n\t\t\t\t\t\t\t\t$month = $yyyymm % 100;\n\t\t\t\t\t\t\t\t$url = get_month_link( $year, $month );\n\t\t\t\t\t\t\t\t$settings['url'][] = array(\n\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif ( FALSE === $ids_array['id'] ) {\n\t\t\t\t\t\t\t\t\t/*\tExact URL\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\t$url = JR_MT_HOME_URL . \"/$key\";\n\t\t\t\t\t\t\t\t\t$settings['url'][] = array(\n\t\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t/*\tSome Post type\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tget_permalink() can be used as early as Action Hook 'setup_theme',\n\t\t\t\t\t\t\t\t\t\tbut not in 'plugins_loaded' (Fatal Error).\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\tif ( FALSE === ( $url = get_permalink( $key ) ) ) {\n\t\t\t\t\t\t\t\t\t\t/*\tIgnore any non-existent IDs, typically deleted.\n\t\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\t\tjr_mt_messages( 'Setting deleted for non-existent Post/Page/Attachment with ID=' . $key );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$settings['url'][] = array(\n\t\t\t\t\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t\t\t\t\t'prep' => jr_mt_prep_url( $url ),\n\t\t\t\t\t\t\t\t\t\t\t'theme' => $ids_array['theme']\n\t\t\t\t\t\t\t\t\t\t);\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}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t/*\tMaybe later:\n\t\tunset( $settings['ids'] );\n\t*/\n\treturn $settings;\n}", "private function get_new_theme( $old_theme ){\n\t\t\n\t\t$themes = array(\n\t\t\t'accordion' => array(\n\t\t\t\t'theme' \t=> 'accordion',\n\t\t\t\t'params' \t=> array()\n\t\t\t),\n\t\t\t'carousel' => array(\n\t\t\t\t'theme' \t=> 'cristal',\n\t\t\t\t'params'\t=> array(\n\t\t\t\t\t'themes_params' => array(\n\t\t\t\t\t\t'cristal' => array(\n\t\t\t\t\t\t\t'navigation' => 'carousel'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'layout' => array(\n\t\t\t\t\t\t'class' \t\t=> 't-up-c-down background',\n\t\t\t\t\t\t'show_main_nav' => true\n\t\t\t\t\t),\n\t\t\t\t\t'content_text' => array(\n\t\t\t\t\t\t'show' => false\n\t\t\t\t\t),\n\t\t\t\t\t'content_date' => array(\n\t\t\t\t\t\t'show' => false\n\t\t\t\t\t),\n\t\t\t\t\t'content_author' => array(\n\t\t\t\t\t\t'show' => false\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'classic' => array(\n\t\t\t\t'theme' => 'simple',\n\t\t\t\t'params' => array()\n\t\t\t),\n\t\t\t'minimal' => array(\n\t\t\t\t'theme' => 'cristal',\n\t\t\t\t'params' => array(\n\t\t\t\t\t'themes_params' => array(\n\t\t\t\t\t\t'cristal' => array(\n\t\t\t\t\t\t\t'navigation' => 'dots'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'layout' => array(\n\t\t\t\t\t\t'class' => 'content-bottom background'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'smoke' => array(\n\t\t\t\t'theme' => 'cristal',\n\t\t\t\t'params' => array(\n\t\t\t\t\t'themes_params' => array(\n\t\t\t\t\t\t'cristal' => array(\n\t\t\t\t\t\t\t'navigation' => 'dots'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'layout' => array(\n\t\t\t\t\t\t'class' => 'content-left background',\n\t\t\t\t\t\t'show_side_nav' => false,\n\t\t\t\t\t\t'show_main_nav' => true\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'title_navigation' => array(\n\t\t\t\t'theme' => 'list',\n\t\t\t\t'params' => array()\n\t\t\t),\n\t\t\t'navobar' => array(\n\t\t\t\t'theme' => 'navobar',\n\t\t\t\t'params' => array()\n\t\t\t),\n\t\t\t// theme removed, defaults to simple\n\t\t\t'strips' => array(\n\t\t\t\t'theme' => 'simple',\n\t\t\t\t'params' => array(\n\t\t\t\t\t'layout' => array(\n\t\t\t\t\t\t'show_main_nav' => true,\n\t\t\t\t\t\t'show_side_nav' => true\n\t\t\t\t\t),\n\t\t\t\t\t'js' => array(\n\t\t\t\t\t\t'effect_duration' => .6\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t// theme removed, defaults to simple\n\t\t\t'ribbons' => array(\n\t\t\t\t'theme' => 'simple',\n\t\t\t\t'params' => array(\n\t\t\t\t\t'layout' => array(\n\t\t\t\t\t\t'show_main_nav' => true,\n\t\t\t\t\t\t'show_side_nav' => true\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t\t\n\t\tif( array_key_exists( $old_theme , $themes ) ){\n\t\t\treturn $themes[ $old_theme ];\n\t\t}\n\t\treturn false;\n\t}", "function twentynineteen_switch_theme() {}", "function uberMenu_register_theme_styles(){\n\tubermenu_registerStylePreset( 'theme-default-styles', 'Theme Default Style', get_stylesheet_directory_uri().'/assets/css/ubermenu.lite.css' );\n}", "abstract protected function _set_theme();", "private function initTheme() {\n\t\t// first we need to lookup the theme.\n\t\tkernel::processThemeManifest('themes/'.$this->theme.'/manifest.xml');\n\t}", "function bbp_set_theme_compat_templates($templates = array())\n{\n}", "function initDefaultTheme() {\r\n //TODO\r\n }", "protected function _update_theme_paths()\n {\n // Store a whole heap of template locations\n $this->_template_locations = array(\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/modules/' . $this->_module .'/layouts/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/modules/' . $this->_module .'/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/layouts/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/',\n APPPATH . 'modules/' . $this->_module . '/views/layouts/',\n APPPATH . 'modules/' . $this->_module . '/views/',\n APPPATH . 'views/layouts/',\n APPPATH . 'views/',\n \tPRIVATEPATH. 'modules/' . $this->_module .'/template/',\n \tPRIVATEPATH.'templates/'\n );\n\n // Will add paths into Smarty for \"smarter\" inheritance and inclusion\n $this->_add_paths();\n }", "function alm_theme_repeaters_installed(){\n \t //Empty return\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts body of HTML document
public static function get_body($html) { $my_dom = new \DOMDocument(); @$my_dom->loadHTML($html); $xpath = new \DOMXPath($my_dom); $nodes = $xpath->query("/html/body"); $body = ""; foreach($nodes as $node) { $body .= $node->nodeValue; } return $body; }
[ "protected function getBody($html) {\n $innerHTML = '';\n $dom = new \\DOMDocument();\n @$dom\n ->loadHTML($html);\n $elem = $dom->getElementsByTagName('body');\n\n for ($i = 0; $i < $elem->length; $i++) {\n $entry = $elem->item($i);\n $children = $entry->childNodes;\n foreach ($children as $child) {\n $innerHTML .= $child->ownerDocument->saveXML($child);\n }\n }\n\n $parsedHTML = $this->fixEncoding($innerHTML);\n\n return $parsedHTML;\n }", "private function get_body($html)\n\t{\n\t\tif ( empty($html) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$dom = new \\DOMDocument();\n\t\t$tmp_dom = new \\DOMDocument();\n\n\t\t@$dom->loadHTML(mb_convert_encoding($html, 'UTF-8'));\n\t\t\n\t\t// Get the body from the DOM and store it in $this->body\n\t\t$body = $dom->getElementsByTagName('body');\n\t\t$body = $body->item(0)->getElementsByTagName('*')->item(0);\n\t\t\n\t\t// Fucking PHP, I want my innerHTML method!\n\t\t$tmp_dom->appendChild($tmp_dom->importNode($body, TRUE));\n\t\t$body = $tmp_dom->saveHTML();\n\t\t\n\t\treturn $body;\n\t}", "public function getHtmlBody();", "function get_body($source_html){\r\n\t$chaine_html = implode(file ($source_html), \" \") ;\r\n\r\n\t$modele_body =\"/<body[^>]*>(.*)<\\/body>/is\";\r\n\t$modele_balises_scripts = '/<script[^>]*?>.*?<\\/script>/is';\r\n\r\n\t//Remplacer les scripts par des vides dans HTML\r\n\t$html_sans_script = preg_replace($modele_balises_scripts, '', $chaine_html);\r\n\t\r\n\t//Récuperer le body sans script\r\n\tpreg_match($modele_body,$html_sans_script,$body);\r\n\t\t\r\n\t$chaine_text = strtolower(preg_replace('#<[^>]+>#', ' ',$body[1]));\r\n\t\r\n\treturn $chaine_text;\r\n}", "function findHtmlBodyTag() {\n//$html = new simple_html_dom(); \n $html = file_get_html('http://www.safiratech.com/');\n echo \"$html\"; //ok\n $body = $html->find('body'); //returns Nothing\n echo \"body = \" . $body;\n}", "function getHtmlBodyElement($url)\n{\n error_reporting(0);\n $domDocument = new DOMDocument();\n\n $domDocument->loadHTML(file_get_contents($url));\n error_reporting(E_ALL | E_STRICT);\n\n return $domDocument->getElementsByTagName('body')->item(0);\n}", "function get_document_body($as_html)\n\t{\n\t\treturn $this->call(\"WebPage.GetDocumentBody?as_html=\".urlencode($as_html));\n\t}", "public function getHTMLBody()\n {\n $parser = $this->getParser();\n $return = $parser->getMessageBody('html');\n return $return;\n }", "public function bodyHtml(){\n return \\Parsedown::instance()->text($this->body);\n }", "function body() {\n return $this->document->getContent();\n }", "public function saveInnerBody()\r\n\t{\r\n\t\t$result = '';\r\n\t\t\r\n\t\tif(property_exists($this, 'documentElement'))\r\n\t\t\t$body = $this->querySelector('body');\r\n\t\telse\r\n\t\t\t$body = $this->getDocumentElementSafe();\r\n\t\t\r\n\t\tif(!$body)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tfor($node = $body->firstChild; $node != null; $node = $node->nextSibling)\r\n\t\t\t$result .= $this->saveHTML($node);\r\n\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function getBody()\n {\n return new HtmlPageCrawler($this->getBodyNode());\n }", "public function find_Body($data){\n $dom = $this->create_Dom($data);\n $body = $dom->getElementsByTagName('body');\n if($body == NULL){\n } // Not to Consider now.\n\n return $body;\n }", "private function getBodyElement()\n {\n return $this->domDocument->getElementsByTagName('body')->item(0);\n }", "public function getBodyContent()\n\t{\n\t\treturn $this->_pageData['data']['content'];\n\t}", "public function getBodyHTML()\n {\n return $this->bodyhtml;\n }", "public function getBodyHtml()\n {\n $part = $this->findBy(\"contentType\", \"text/html\");\n return isset($part[0]) ? $part[0]->getDecodedContent() : false;\n }", "public function getBodyContent() {}", "private function _parseBody( $template ){\n $code = $this->m_HTML[ $template ];\n $innerBody = \"\";\n /* get inner-body */\n $re = '/\\<body\\>([\\s\\S]*)\\<\\/body\\>/im';\n preg_match( $re, $code, $matches );\n if ( isset( $matches[1] )){\n $innerBody = $matches[1];\n $innerBody = $this->_replaceTags( $innerBody ); \n } else {\n $this->m_warning[\"body-missing\"] = $template; // has no <body>\n }\n $this->m_body[ $template ] = $innerBody;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert the date time in the IfUnmodifiedSince header to a Unix timestamp. The purpose of this headers is explained at:
function processIfUnmodifiedSinceHeader() { if(isset($_SERVER['HTTP_IF_UNMODIFIED_SINCE'])) { return strtotime($_SERVER['HTTP_IF_UNMODIFIED_SINCE']); } }
[ "public function getIfModifiedSince() {\n if (isset($this->ifModifiedSince)) {\n return $this->ifModifiedSince;\n }\n\n $header = $this->getHeader(Header::HEADER_IF_MODIFIED_SINCE);\n if (!$header) {\n return $this->ifModifiedSince = null;\n }\n\n return $this->ifModifiedSince = Header::parseTime($header);\n }", "protected static function parseIfModifiedSince($value)\n {\n return static::parseDate($value);\n }", "public function unixDatemodified()\n {\n return strtotime($this->datemodified);\n }", "protected function getIfModifiedSinceHeader()\n {\n $modifiedSince = null;\n\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {\n $modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];\n\n if (false !== ($semicolonPos = strpos($modifiedSince, ';'))) {\n $modifiedSince = substr($modifiedSince, 0, $semicolonPos);\n }\n }\n\n return $modifiedSince;\n }", "public static function getModifiedSinceHeader()\n {\n $modifiedSince = '';\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {\n $modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];\n\n // strip any trailing data appended to header\n if (false !== ($semicolonPos = strpos($modifiedSince, ';'))) {\n $modifiedSince = substr($modifiedSince, 0, $semicolonPos);\n }\n }\n return $modifiedSince;\n }", "public function getIfModifiedSince()\n {\n return isset( $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ] ) ? $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ] : null;\n }", "protected function getIfUnmodifiedSinceDate(): DateTimeInterface|null\n {\n // @see \\Aedart\\ETags\\Mixins\\RequestETagsMixin::ifUnmodifiedSinceDate\n return $this->request()->ifUnmodifiedSinceDate();\n }", "public function toUnix()\n\t{\n\t\treturn $this->timestamp;\n\t}", "private function check_if_modified_since_header() {\n $resource = DAV::$REGISTRY->resource(DAV::getPath());\n if ( !$resource || !$resource->isVisible() )\n return;\n if ( !( $lastModified = $resource->user_prop_getlastmodified() ) )\n return;\n if ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&\n ($when = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) &&\n $lastModified <= $when )\n throw new DAV_Status(DAV::HTTP_NOT_MODIFIED);\n if ( isset($_SERVER['HTTP_IF_UNMODIFIED_SINCE']) &&\n ($when = strtotime($_SERVER['HTTP_IF_UNMODIFIED_SINCE'])) &&\n $lastModified > $when )\n throw new DAV_Status(DAV::HTTP_PRECONDITION_FAILED);\n}", "public function getLastModified()\n {\n return $this->headers->getDate('Last-Modified');\n }", "public function getLastModified()\n {\n return $this->headers->getDate('Last-Modified');\n }", "function generate_http_last_modified($date) {\r\n // We need to add hours:minutes:seconds.\r\n $date = $date . ' 23:59:59';\r\n $unixtime = strtotime($date);\r\n return gmdate('D, d M Y H:i:s T', $unixtime);\r\n}", "function http_send_last_modified ($timestamp = null) {}", "public function getEntryDateAsUnixTimeStamp()\n {\n return $this->getAsInteger('entry_date');\n }", "private function getTimestamp($header)\n {\n $informations = explode('.', $header);\n if (count($informations) === 2)\n return $informations[0];\n return -1;\n }", "public function getLastModified() {\n\t\treturn $this->removeHeader('last-modified');\n\t}", "public function expiration_date_timestamp() {\n\t\treturn strtotime( $this->expiration_date );\n\t}", "public function getResponseTimeLocal() {\r\n return date('Y-m-d H:i:s', strtotime($this->_output->getResponseHeader()->timestamp));\r\n }", "public function getUnixTimestamp() {\n\t\treturn mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the Configuration's list of sizes for posters
public function getPosterSizes() { return $this->_data['images']['poster_sizes']; }
[ "public function getSizes()\n\t{\n\t\treturn $this->sizes;\n\t}", "public function allSizes()\n {\n return $this->sizes;\n }", "public function get_featurer_sizes() {\n\t\t$sizes = false;\n\n\t\tif ( cur_is_module_enabled('featurer') ) {\n\t\t\tif ( true === self::$modules['featurer']['sizes']['enabled'] ) {\n\t\t\t\t$sizes = self::$modules['featurer']['sizes']['sizes'];\n\t\t\t}\n\t\t}\n\n\t\treturn $sizes;\n\t}", "public static function getSizes()\n\t{\n\t\treturn self::$_sizes;\n\t}", "public function getSizes()\n\t{\n\n\t\t$strOptionsArray = array();\n\n\t\tforeach ($this->products as $objProduct) {\n\t\t\t$strSize = $objProduct->product_size;\n\n\t\t\tif (!empty($strSize) &&\n\t\t\t\t!in_array($strSize, $strOptionsArray) &&\n\t\t\t\t$objProduct->IsDisplayable\n\t\t\t)\n\t\t\t\t$strOptionsArray[$strSize] = $strSize;\n\n\t\t}\n\n\t\treturn $strOptionsArray;\n\t}", "function report_roster_get_options_size() {\n $sizes = array();\n\n foreach (array('small', 'medium', 'large') as $size) {\n $pixels = (int) get_config('report_roster', \"size_$size\");\n $label = get_string(\"size:$size\", 'report_roster');\n\n if ($pixels > 0) {\n $sizes[$pixels] = $label;\n }\n }\n\n return $sizes;\n}", "public function getImageSizeList()\r\n\t{\r\n\t\t$arrSizes = System::getImageSizes();\r\n\t\t$arrSizes['image_sizes'] = array_intersect_key($arrSizes['image_sizes'], array_flip(deserialize($this->sizeList)));\r\n\t\t\r\n\t\tif ($this->canEnterSize)\r\n\t\t{\r\n\t\t\treturn $arrSizes;\r\n\t\t}\r\n\t\treturn $arrSizes['image_sizes'];\r\n\t}", "public function getSizes() {\n if (is_null($this->_sizes) && $this->getCurrent()) {\n $rows = $this->getCurrent()\n ->findDependentRowset('Yourdelivery_Model_DbTable_Meal_SizesNn');\n $result = array();\n foreach ($rows as $size) {\n $mealParent = $size->findParentRow('Yourdelivery_Model_DbTable_Meal_Sizes');\n if ($mealParent) {\n $result[$mealParent->id] = array_merge(\n $mealParent->toArray(),\n //append some more informations about product\n array(\n 'cost' => $rows->current()->cost,\n 'pfand' => $rows->current()->pfand,\n 'mealId' => $rows->current()->mealId\n )\n );\n }\n }\n $this->_sizes = $result;\n }\n return $this->_sizes;\n }", "public function getThumbnailSizes()\n {\n $config = Shopware()->Container()->get('shopware.plugin.cached_config_reader')->getByPluginName('EmzBiancoTheme');\n $thumbnail_sizes = array($config['thumbnail_size_small'],\n $config['thumbnail_size_middle'],\n $config['thumbnail_size_large']);\n\n return $thumbnail_sizes;\n }", "public static function get_sizes() {\n\t\t$size_db = self::get_database_size();\n\t\t$upload_dir = wp_get_upload_dir();\n\n\t\t/*\n\t\t * We will be using the PHP max execution time to prevent the size calculations\n\t\t * from causing a timeout. The default value is 30 seconds, and some\n\t\t * hosts do not allow you to read configuration values.\n\t\t */\n\t\tif ( function_exists( 'ini_get' ) ) {\n\t\t\t$max_execution_time = ini_get( 'max_execution_time' );\n\t\t}\n\n\t\t// The max_execution_time defaults to 0 when PHP runs from cli.\n\t\t// We still want to limit it below.\n\t\tif ( empty( $max_execution_time ) ) {\n\t\t\t$max_execution_time = 30;\n\t\t}\n\n\t\tif ( $max_execution_time > 20 ) {\n\t\t\t// If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent\n\t\t\t// edge-case timeouts that may happen after the size loop has finished running.\n\t\t\t$max_execution_time -= 2;\n\t\t}\n\n\t\t// Go through the various installation directories and calculate their sizes.\n\t\t// No trailing slashes.\n\t\t$paths = array(\n\t\t\t'wordpress_size' => untrailingslashit( ABSPATH ),\n\t\t\t'themes_size' => get_theme_root(),\n\t\t\t'plugins_size' => WP_PLUGIN_DIR,\n\t\t\t'uploads_size' => $upload_dir['basedir'],\n\t\t);\n\n\t\t$exclude = $paths;\n\t\tunset( $exclude['wordpress_size'] );\n\t\t$exclude = array_values( $exclude );\n\n\t\t$size_total = 0;\n\t\t$all_sizes = array();\n\n\t\t// Loop over all the directories we want to gather the sizes for.\n\t\tforeach ( $paths as $name => $path ) {\n\t\t\t$dir_size = null; // Default to timeout.\n\t\t\t$results = array(\n\t\t\t\t'path' => $path,\n\t\t\t\t'raw' => 0,\n\t\t\t);\n\n\t\t\tif ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {\n\t\t\t\tif ( 'wordpress_size' === $name ) {\n\t\t\t\t\t$dir_size = recurse_dirsize( $path, $exclude, $max_execution_time );\n\t\t\t\t} else {\n\t\t\t\t\t$dir_size = recurse_dirsize( $path, null, $max_execution_time );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( false === $dir_size ) {\n\t\t\t\t// Error reading.\n\t\t\t\t$results['size'] = __( 'The size cannot be calculated. The directory is not accessible. Usually caused by invalid permissions.' );\n\t\t\t\t$results['debug'] = 'not accessible';\n\n\t\t\t\t// Stop total size calculation.\n\t\t\t\t$size_total = null;\n\t\t\t} elseif ( null === $dir_size ) {\n\t\t\t\t// Timeout.\n\t\t\t\t$results['size'] = __( 'The directory size calculation has timed out. Usually caused by a very large number of sub-directories and files.' );\n\t\t\t\t$results['debug'] = 'timeout while calculating size';\n\n\t\t\t\t// Stop total size calculation.\n\t\t\t\t$size_total = null;\n\t\t\t} else {\n\t\t\t\tif ( null !== $size_total ) {\n\t\t\t\t\t$size_total += $dir_size;\n\t\t\t\t}\n\n\t\t\t\t$results['raw'] = $dir_size;\n\t\t\t\t$results['size'] = size_format( $dir_size, 2 );\n\t\t\t\t$results['debug'] = $results['size'] . \" ({$dir_size} bytes)\";\n\t\t\t}\n\n\t\t\t$all_sizes[ $name ] = $results;\n\t\t}\n\n\t\tif ( $size_db > 0 ) {\n\t\t\t$database_size = size_format( $size_db, 2 );\n\n\t\t\t$all_sizes['database_size'] = array(\n\t\t\t\t'raw' => $size_db,\n\t\t\t\t'size' => $database_size,\n\t\t\t\t'debug' => $database_size . \" ({$size_db} bytes)\",\n\t\t\t);\n\t\t} else {\n\t\t\t$all_sizes['database_size'] = array(\n\t\t\t\t'size' => __( 'Not available' ),\n\t\t\t\t'debug' => 'not available',\n\t\t\t);\n\t\t}\n\n\t\tif ( null !== $size_total && $size_db > 0 ) {\n\t\t\t$total_size = $size_total + $size_db;\n\t\t\t$total_size_mb = size_format( $total_size, 2 );\n\n\t\t\t$all_sizes['total_size'] = array(\n\t\t\t\t'raw' => $total_size,\n\t\t\t\t'size' => $total_size_mb,\n\t\t\t\t'debug' => $total_size_mb . \" ({$total_size} bytes)\",\n\t\t\t);\n\t\t} else {\n\t\t\t$all_sizes['total_size'] = array(\n\t\t\t\t'size' => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ),\n\t\t\t\t'debug' => 'not available',\n\t\t\t);\n\t\t}\n\n\t\treturn $all_sizes;\n\t}", "public function getSizes() {\n return $this->_client->invokeExpecting(\n 'flickr.photos.getSizes',\n array('photo_id' => $this->getId()),\n 'com.flickr.FlickrPhotoSizes'\n );\n }", "public static function getSizes()\n {\n $db = DataBase::connect();\n\n $sortOrder = SIZE_SORT_ORDER ? \"ASC\" : \"DESC\" ;\n $result = $db->query(\"SELECT * FROM `size` ORDER BY `id` {$sortOrder}\");\n\n $sizes = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $sizes[$i]['size'] = $row['size'];\n $sizes[$i]['leonardo_prices'] = $row['leonardo_prices'];\n $sizes[$i]['frodo_prices'] = $row['frodo_prices'];\n $sizes[$i]['back_leg'] = $row['back_leg'];\n $sizes[$i]['image_size'] = $row['image_size'];\n\n $i++;\n }\n return $sizes;\n }", "public function get_size_options() {\n return array(\n '416x290' => '416px by 290px',\n '516x346' => '516px by 346px',\n '616x402' => '616px by 402px',\n '816x515' => '816px by 515px',\n 'responsive' => 'responsive (full-width of container)',\n 'custom' => 'custom',\n );\n }", "public static function wp_get_builtin_sizes()\n {\n return array(\n 'thumbnail' => array('width' => get_option('thumbnail_size_w'), 'height' => get_option('thumbnail_size_h'), 'crop' => get_option('thumbnail_crop')),\n 'medium' => array('width' => get_option('medium_size_w'), 'height' => get_option('medium_size_h'), 'crop' => get_option('medium_crop')),\n 'large' => array('width' => get_option('large_size_w'), 'height' => get_option('large_size_h'), 'crop' => get_option('large_crop')),\n );\n }", "public function private_sizes() {\n\t\t$extra_info = $this->extra_info();\n\n\t\tif ( ! empty( $extra_info['private_sizes'] ) ) {\n\t\t\treturn $extra_info['private_sizes'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getIconSizeOptions()\n {\n return ArrayLib::valuekey($this->config()->icon_sizes);\n }", "public function getSizes()\r\n {\r\n $sizes = array();\r\n foreach ($this as $bs) {\r\n /* @var ByteString $bs */\r\n $sizes[] = $bs->getSize();\r\n }\r\n return $sizes;\r\n }", "protected function _getImageSizeConfiguration()\n {\n return $this->_imageSizeConfiguration;\n }", "private function getFilteredSizes(): array\n {\n if (! empty($this->width)) {\n return array_filter(config('responsive-image-craft.sizes'), function ($responsiveWidth) {\n return $responsiveWidth <= $this->width;\n });\n }\n\n return config('responsive-image-craft.sizes');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add "first" and "last" CSS classes to dynamic sidebar widgets. Also adds numeric index class for each widget (widget1, widget2, etc.)
function widget_first_last_classes($params) { global $my_widget_num; // Global a counter array $this_id = $params[0]['id']; // Get the id for the current sidebar we're processing $arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets if(!$my_widget_num) {// If the counter array doesn't exist, create it $my_widget_num = array(); } if(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets return $params; // No widgets in this sidebar... bail early. } if(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar $my_widget_num[$this_id] ++; } else { // If not, create it starting with 1 $my_widget_num[$this_id] = 1; } $class = 'class="widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options if($my_widget_num[$this_id] == 1) { // If this is the first widget $class .= 'widget-first '; } elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget $class .= 'widget-last '; } //$params[0]['before_widget'] = str_replace('class="', $class, $params[0]['before_widget']); // Insert our new classes into "before widget" $params[0]['before_widget'] = preg_replace('/class=\"/', "$class", $params[0]['before_widget'], 1); return $params; }
[ "function yiw_widget_first_last_classes($params) {\n\n global $my_widget_num; // Global a counter array\n $this_id = $params[0]['id']; // Get the id for the current sidebar we're processing\n $arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets \n\n if(!$my_widget_num) {// If the counter array doesn't exist, create it\n $my_widget_num = array();\n }\n\n if(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\n return $params; // No widgets in this sidebar... bail early.\n }\n\n if(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\n $my_widget_num[$this_id] ++;\n } else { // If not, create it starting with 1\n $my_widget_num[$this_id] = 1;\n }\n\n $class = 'class=\"widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options\n\n if($my_widget_num[$this_id] == 1) // If this is the first widget\n $class .= 'widget-first ';\n if($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) // If this is the last widget\n $class .= 'widget-last ';\n\n $params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']); // Insert our new classes into \"before widget\"\n\n return $params;\n\n}", "function widget_first_last_classes($params) {\n\n\tglobal $my_widget_num; // Global a counter array\n\t$this_id = $params[0][\"id\"]; // Get the id for the current sidebar we\"re processing\n\t$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets\t\n\n\tif(!$my_widget_num) {// If the counter array doesn\"t exist, create it\n\t\t$my_widget_num = array();\n\t}\n\n\tif(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\n\t\treturn $params; // No widgets in this sidebar... bail early.\n\t}\n\n\tif(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\n\t\t$my_widget_num[$this_id] ++;\n\t} else { // If not, create it starting with 1\n\t\t$my_widget_num[$this_id] = 1;\n\t}\n\n\t$class = \"class='widget-\" . $my_widget_num[$this_id] . \" \"; // Add a widget number class for additional styling options\n\n\tif($my_widget_num[$this_id] == 1) { // If this is the first widget\n\t\t$class .= \"widget-first \";\n\t} elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget\n\t\t$class .= \"widget-last \";\n\t}\n\n\t//$params[0][\"before_widget\"] = str_replace(\"class='\", $class, $params[0][\"before_widget\"]); // Insert our new classes into 'before widget'\n\t$params[0][\"before_widget\"] = preg_replace(\"/class=\\'/\", '$class', $params[0][\"before_widget\"], 1);\n\treturn $params;\n\n}", "function widget_first_last_classes($params) {\r\n\r\n\tglobal $my_widget_num; // Global a counter array\r\n\t$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing\r\n\t$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets\r\n\r\n\tif(!$my_widget_num) {// If the counter array doesn't exist, create it\r\n\t\t$my_widget_num = array();\r\n\t}\r\n\r\n\tif(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\r\n\t\treturn $params; // No widgets in this sidebar... bail early.\r\n\t}\r\n\r\n\tif(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\r\n\t\t$my_widget_num[$this_id] ++;\r\n\t} else { // If not, create it starting with 1\r\n\t\t$my_widget_num[$this_id] = 1;\r\n\t}\r\n\r\n\t$class = 'class=\"widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options\r\n\r\n\tif($my_widget_num[$this_id] == 1) { // If this is the first widget\r\n\t\t$class .= 'widget-first ';\r\n\t} elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget\r\n\t\t$class .= 'widget-last ';\r\n\t}\r\n\r\n\t$params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']); // Insert our new classes into \"before widget\"\r\n\r\n\treturn $params;\r\n\r\n}", "function widget_first_last_classes($params) {\n\n\t\n\tglobal $my_widget_num; // Global a counter array\n\t$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing\n\t$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets\t\n\n\tif(!$my_widget_num) {// If the counter array doesn't exist, create it\n\t\t$my_widget_num = array();\n\t}\n\n\tif(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\n\t\treturn $params; // No widgets in this sidebar... bail early.\n\t}\n\n\tif(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\n\t\t$my_widget_num[$this_id] ++;\n\t} else { // If not, create it starting with 1\n\t\t$my_widget_num[$this_id] = 1;\n\t}\n\n\t$class = 'class=\"widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options\n\n\tif($my_widget_num[$this_id] == 1) { // If this is the first widget\n\t\t$class .= 'widget-first ';\n\t} elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget\n\t\t$class .= 'widget-last ';\n\t}\n\n\t$params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']); // Insert our new classes into \"before widget\"\n\n\treturn $params;\n\n}", "function widget_first_last_classes($params) {\n\n\tglobal $my_widget_num; // Global a counter array\n\t$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing\n\t$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets\n\n\tif(!$my_widget_num) {// If the counter array doesn't exist, create it\n\t\t$my_widget_num = array();\n\t}\n\n\tif(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\n\t\treturn $params; // No widgets in this sidebar... bail early.\n\t}\n\n\tif(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\n\t\t$my_widget_num[$this_id] ++;\n\t} else { // If not, create it starting with 1\n\t\t$my_widget_num[$this_id] = 1;\n\t}\n\n\t$class = 'class=\"widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options\n\n\tif($my_widget_num[$this_id] == 1) { // If this is the first widget\n\t\t$class .= 'widget-first ';\n\t} elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget\n\t\t$class .= 'widget-last ';\n\t}\n\n\t$params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']); // Insert our new classes into \"before widget\"\n\n\treturn $params;\n\n}", "function widget_first_last_classes($params) {\n\t\tglobal $my_widget_num; // Global a counter array\n\t\t$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing\n\t\t$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets\t\n\t\n\t\tif(!$my_widget_num) {// If the counter array doesn't exist, create it\n\t\t\t$my_widget_num = array();\n\t\t}\n\t\n\t\tif(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets\n\t\t\treturn $params; // No widgets in this sidebar... bail early.\n\t\t}\n\t\n\t\tif(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar\n\t\t\t$my_widget_num[$this_id] ++;\n\t\t} else { // If not, create it starting with 1\n\t\t\t$my_widget_num[$this_id] = 1;\n\t\t}\n\t\n\t\t$class = 'class=\"widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options\n\t\n\t\tif($my_widget_num[$this_id] == 1 && $my_widget_num[$this_id] != count($arr_registered_widgets[$this_id])) { // If this is the first widget\n\t\t\t$class .= ' first ';\n\t\t} elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget\n\t\t\t$class .= ' last ';\n\t\t}\n\t\n\t\t$params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']); // Insert our new classes into \"before widget\"\n\t\n\t\treturn $params;\n\t}", "function rock_star_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'footer-1' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-2' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-3' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-4' ) )\n\t\t$count++;\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = 'widget-area one';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = 'widget-area two';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = 'widget-area three';\n\t\t\tbreak;\n\t\tcase '4':\n\t\t\t$class = 'widget-area four';\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo 'class=\"' . $class . '\"';\n}", "function mbdmaster_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'footer-sidebar-1' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-sidebar-2' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-sidebar-3' ) )\n\t\t$count++;\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = 'one';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = 'two';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = 'three';\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo 'class=\"' . $class . ' section\"';\n}", "function cosmos_bottom_sidebar_class($params) {\n\n\t$sidebar_id = $params[0]['id'];\n\n\tif ( $sidebar_id == 'sidebar-bottom' ) {\n\n\t\t$total_widgets = wp_get_sidebars_widgets();\n\t\t$sidebar_widgets = count($total_widgets[$sidebar_id]);\n\t\t$class = 'class=\"span' . floor(12 / $sidebar_widgets) . ' ';\n\n\t\t$params[0]['before_widget'] = str_replace('class=\"', $class, $params[0]['before_widget']);\n\t}\n\n\treturn $params;\n}", "function comatose_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'sidebar-3' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'sidebar-4' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'sidebar-5' ) )\n\t\t$count++;\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = 'one';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = 'two';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = 'three';\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo 'class=\"' . $class . '\"';\n}", "function intuitive_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'sidebar-2' ) ) {\n\t\t$count++;\n\t}\n\n\tif ( is_active_sidebar( 'sidebar-3' ) ) {\n\t\t$count++;\n\t}\n\n\tif ( is_active_sidebar( 'sidebar-4' ) ) {\n\t\t$count++;\n\t}\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = 'one';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = 'two';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = 'three';\n\t\t\tbreak;\n\t}\n\n\tif ( $class ) {\n\t\techo 'class=\"widget-area footer-widget-area ' . $class . '\"';\n\t}\n}", "function ti_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'sidebar-3' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'sidebar-4' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'sidebar-5' ) )\n\t\t$count++;\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = ' col-1';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = ' col-2';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = ' col-3';\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo $class;\n}", "function cththemes_slbd_count_widgets( $sidebar_id ) {\n // If loading from front page, consult $_wp_sidebars_widgets rather than options\n // to see if wp_convert_widget_settings() has made manipulations in memory.\n global $_wp_sidebars_widgets;\n if ( empty( $_wp_sidebars_widgets ) ) :\n $_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() );\n endif;\n \n $sidebars_widgets_count = $_wp_sidebars_widgets;\n \n if ( isset( $sidebars_widgets_count[ $sidebar_id ] ) ) :\n $widget_count = count( $sidebars_widgets_count[ $sidebar_id ] );\n $widget_classes = 'widget-count-' . count( $sidebars_widgets_count[ $sidebar_id ] );\n if ( $widget_count % 6 == 0 && $widget_count >= 6 ) :\n // Six widgets er row if there are exactly four or more than six\n $widget_classes .= ' col-md-2';\n elseif ( $widget_count % 4 == 0 && $widget_count >= 4 ) :\n // Four widgets er row if there are exactly four or more than six\n $widget_classes .= ' col-md-3';\n elseif ( $widget_count % 3 == 0 && $widget_count >= 3 ) :\n // Three widgets per row if there's three or more widgets \n $widget_classes .= ' col-md-4';\n elseif ( 2 == $widget_count ) :\n // Otherwise show two widgets per row\n $widget_classes .= ' col-md-6';\n elseif ( 1 == $widget_count ) :\n // Otherwise show two widgets per row\n $widget_classes .= ' col-md-12';\n endif; \n\n return $widget_classes;\n endif;\n}", "function do_bstart_sidebar1_class_add( $classes, $important_classes ) {\n $classes[] = 'new-class-added-via-hook';\n return $classes;\n}", "function lk_footer_widget_count() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( 'footer-1' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-2' ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( 'footer-3' ) )\n\t\t$count++;\n\n\t$class = '';\n\n\tswitch ( $count ) {\n\t\tcase '1':\n\t\t\t$class = 'widget-count-1';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\t$class = 'widget-count-2';\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\t$class = 'widget-count-3';\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo $class;\n}", "function lobster_sidebar_class() {\n\t$lobster_theme_options = lobster_theme_options();\n\n\t$layout = $lobster_theme_options['layout'];\n\tif ( 1 == $layout || 2 == $layout || 6 == $layout ) {\n\t\t$end = ( 2 == $layout ) ? ' end' : '';\n\t\t$class = str_replace( 'col-md-', '', $lobster_theme_options['primary'] );\n\t\t$class = 'col-md-' . ( 12 - $class ) . $end;\n\t} else {\n\t\t$class = $lobster_theme_options['secondary'];\n\t}\n\n\techo 'class=\"' . $class . '\"';\n}", "function yogastudio_add_widget_number($prm) {\n\t\tif (is_admin()) return $prm;\n\t\tstatic $num=0, $last_sidebar='', $last_sidebar_id='', $last_sidebar_columns=0, $last_sidebar_count=0, $sidebars_widgets=array();\n\t\t$cur_sidebar = yogastudio_storage_get('current_sidebar');\n\t\tif (empty($cur_sidebar)) $cur_sidebar = 'undefined';\n\t\tif (count($sidebars_widgets) == 0)\n\t\t\t$sidebars_widgets = wp_get_sidebars_widgets();\n\t\tif ($last_sidebar != $cur_sidebar) {\n\t\t\t$num = 0;\n\t\t\t$last_sidebar = $cur_sidebar;\n\t\t\t$last_sidebar_id = $prm[0]['id'];\n\t\t\t$last_sidebar_columns = max(1, (int) yogastudio_get_custom_option('sidebar_'.($cur_sidebar).'_columns'));\n\t\t\t$last_sidebar_count = count($sidebars_widgets[$last_sidebar_id]);\n\t\t}\n\t\t$num++;\n\t\t$prm[0]['before_widget'] = str_replace(' class=\"', ' class=\"widget_number_'.esc_attr($num).($last_sidebar_columns > 1 ? ' column-1_'.esc_attr($last_sidebar_columns) : '').' ', $prm[0]['before_widget']);\n\t\treturn $prm;\n\t}", "function mb_sidebar_class() {\n\t$layout = mb_theme_options( 'layout' );\n\tif ( 1 == $layout || 2 == $layout || 6 == $layout ) {\n\t\t$end = ( 2 == $layout ) ? ' end' : '';\n\t\t$class = str_replace( 'c', '', mb_theme_options( 'primary' ) );\n\t\t$class = 'c' . ( 12 - $class ) . $end;\n\t} else {\n\t\t$class = mb_theme_options( 'secondary' );\n\t}\n\n\techo 'class=\"' . $class . '\"';\n}", "function agregarClaseIncremental($params = array()) {\n $sidebars = array('footer');\n $formatoClase = 'item-%s';\n\n if (is_admin() || empty($params[0]['id']) || !in_array($params[0]['id'], $sidebars)) {\n return $params;\n }\n\n static $i = 0;\n $i++;\n\n $buscar = 'class=\"';\n $reemplazar = 'class=\"' . sprintf($formatoClase, $i) . ' ';\n $params[0]['before_widget'] = str_replace($buscar, $reemplazar, $params[0]['before_widget']);\n\n return $params;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PUBLIC: fills in all the variables contained within the variable named $varname. The resulting value is returned as the function result and the original value of the variable varname is not changed. The resulting string is not "finished". RETURNS: the value of the variable $varname with all variables substituted. USAGE: subst(string $varname)
function subst($varname) { $varvals_quoted = array(); if (!$this->loadfile($varname)) { $this->halt("subst: unable to load $varname."); return false; } # quote the replacement strings to prevent bogus stripping of special chars reset($this->varvals); while(list($k, $v) = each($this->varvals)) { $varvals_quoted[$k] = preg_replace(array('/\\\\/', '/\$/'), array('\\\\\\\\', '\\\\$'), $v); } $str = $this->get_var($varname); $str = preg_replace($this->varkeys, $varvals_quoted, $str); return $str; }
[ "function subst($varname) {\n if (!$this->loadfile($varname)) {\n $this->halt(\"subst: unable to load $varname.\");\n return false;\n }\n\n $str = $this->get_var($varname);\n $str = preg_replace($this->varkeys, $this->varvals, $str);\n return $str;\n }", "function psubst($varname) {\n if ($this->debug & 4) {\n echo \"<p><b>psubst:</b> varname = $varname</p>\\n\";\n }\n print $this->subst($varname);\n\n return false;\n }", "function undollarize(string $variableName) : string\n{\n return Mailcode_Variables::undollarizeName($variableName);\n}", "function get_var($varname) {\n if (!is_array($varname)) {\n if (isset($this->varvals[$varname])) {\n $str = $this->varvals[$varname];\n } else {\n $str = \"\";\n }\n if ($this->debug & 2) {\n printf (\"<b>get_var</b> (with scalar) <b>%s</b> = '%s'<br>\\n\", $varname, htmlentities($str));\n }\n return $str;\n } else {\n reset($varname);\n while(list($k, $v) = each($varname)) {\n if (isset($this->varvals[$v])) {\n $str = $this->varvals[$v];\n } else {\n $str = \"\";\n }\n if ($this->debug & 2) {\n printf (\"<b>get_var:</b> (with array) <b>%s</b> = '%s'<br>\\n\", $v, htmlentities($str));\n }\n $result[$v] = $str;\n }\n return $result;\n }\n }", "function get_var($varname) {\n if (!is_array($varname)) {\n if (isset($this->varvals[$varname])) {\n $str = $this->varvals[$varname];\n } else {\n $str = \"\";\n }\n if ($this->debug & 2) {\n printf (\"<b>get_var</b> (with scalar) <b>%s</b> = '%s'<br/>\\n\", $varname, htmlentities($str));\n }\n return $str;\n } else {\n reset($varname);\n while(list($k, $v) = each($varname)) {\n if (isset($this->varvals[$v])) {\n $str = $this->varvals[$v];\n } else {\n $str = \"\";\n }\n if ($this->debug & 2) {\n printf (\"<b>get_var:</b> (with array) <b>%s</b> = '%s'<br/>\\n\", $v, htmlentities($str));\n }\n $result[$v] = $str;\n }\n return $result;\n }\n }", "function varname($varname)\r\n\t{\r\n\t\treturn preg_quote(\"{\".$varname.\"}\");\r\n\t}", "private function replaceInVariables() {\n\n\t\t$saved = [];\n\n\t\t$this->originalString = preg_replace_callback('/:[a-z_]+/', function ($match) use (&$saved) {\n\n\t\t\tstatic $id = 0;\n\t\t\t$id++;\n\n\t\t\t$saved['Variable'. $id] = $match[0];\n\n\t\t\treturn 'Variable'. $id;\n\n\t\t}, $this->originalString);\n\n\t\treturn $saved;\n\n\t}", "function set_var( $varname, $value = \"\", $substIfEmpty = \"\" )\r\n {\r\n if ( is_string( $value ) and $value == \"\" )\r\n $value = $substIfEmpty;\r\n\r\n $this->set_var_internal( $varname, $value );\r\n }", "function substitute_vars($str)\n {\n $str = str_replace('%login', $_SESSION['username'], $str);\n $str = str_replace('%l', $_SESSION['username'], $str);\n\n $parts = explode('@', $_SESSION['username']);\n\n if (count($parts) == 2) {\n $dc = 'dc='.strtr($parts[1], array('.' => ',dc=')); // hierarchal domain string\n\n $str = str_replace('%name', $parts[0], $str);\n $str = str_replace('%n', $parts[0], $str);\n $str = str_replace('%dc', $dc, $str);\n $str = str_replace('%domain', $parts[1], $str);\n $str = str_replace('%d', $parts[1], $str);\n }\n\n return $str;\n }", "function variable_name($var_name) {\r\n return strtolower(preg_replace(\"/[^a-z0-9_\\-]/i\", \"_\", $var_name));\r\n}", "function varname($varname) {\n return preg_quote(\"{\".$varname.\"}\");\n }", "function _foreach_replace($args)\r\n\t{\r\n\t\t$varname = $args[1];\r\n\t\treturn isset($this->tmp_replace[$varname])?$this->tmp_replace[$varname]:'';\r\n\t}", "private function replaceVariablesString($value) {\n if (!is_string($value)) {\n return $value;\n }\n preg_match_all('/\\{([^\\{]+)\\}/', $value, $variableMatches);\n $variables = $variableMatches[1];\n foreach($variables as $variable) {\n preg_match('/^([^:]+)[:]*(.*)$/', $variable, $matches);\n if (sizeof($matches > 0)) {\n $variableName = $matches[1];\n $parameters = $matches[2];\n $persistenceFacade = $this->getPersistenceFacade();\n\n // last_created_oid\n if ($variableName == 'last_created_oid') {\n $type = $parameters;\n if ($persistenceFacade->isKnownType($type)) {\n $oid = $persistenceFacade->getLastCreatedOID($type);\n $value = preg_replace(\"/{\".$variable.\"}/\", $oid, $value);\n }\n }\n\n // oid reference\n if ($persistenceFacade->isKnownType($variableName)) {\n $type = $variableName;\n $oid = $persistenceFacade->getLastCreatedOID($type);\n $value = $oid;\n }\n }\n }\n return $value;\n }", "public static function replaceVars($string) {\n\t\treturn WTemplateParser::replaceNodes($string, array('WTemplateCompiler', 'parseVar'));\n\t}", "static function substitute_vars($str)\n {\n $str = str_replace('%login', $_SESSION['username'], $str);\n $str = str_replace('%l', $_SESSION['username'], $str);\n\n $parts = explode('@', $_SESSION['username']);\n\n if (count($parts) == 2) {\n $dc = 'dc='.strtr($parts[1], array('.' => ',dc=')); // hierarchal domain string\n\n $str = str_replace('%name', $parts[0], $str);\n $str = str_replace('%n', $parts[0], $str);\n $str = str_replace('%dc', $dc, $str);\n $str = str_replace('%domain', $parts[1], $str);\n $str = str_replace('%d', $parts[1], $str);\n }\n\n return $str;\n }", "function replacePathVariables($pathWithVariables)\n{\n\t$path = $pathWithVariables;\n\tpreg_match_all(\"|\" . PATH_VARIABLE_DELIMITER . \"([a-z0-9 ]+)\" . PATH_VARIABLE_DELIMITER . \"|i\",\n\t\t$pathWithVariables, $variables);\n\tforeach ($variables[1] as $variable)\n\t{\n\t\t$variable = strtolower($variable);\n\t\t$path = preg_replace(\"|\" . PATH_VARIABLE_DELIMITER . $variable . PATH_VARIABLE_DELIMITER . \"|i\",\n\t\t\tgetOption(\"path:variable:{$variable}\"), $path);\n\t}\n\t\n\treturn $path;\n}", "public function replaceVars($str, array $vars){\n\t foreach($vars as $key => $value){\n\t $str = str_replace(\"{\" . $key . \"}\", $value, $str);\n\t }\n\t return $str;\n\t}", "function varname($varname) {\n return preg_quote(\"{\".$this->type.\" \".$varname.\"}\");\n }", "public function variableize($s) {\n\t\treturn preg_replace('/[^a-zA-Z0-9_]+/', '_', $s);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is an example of a function with no arguments.
function noArguments(){ echo "This function has no arguments!<br />"; }
[ "function fn2 () {\n\t\t\techo \"Function without param\";\n\t\t}", "protected abstract function applyNoArg();", "function e($a = null) {}", "function example()\n {\n }", "function exampleFn() {\n\t\n\t\n\t}", "function simpleFunction($name = 'Default String'){\n echo $name;\n}", "public function withAnyArguments() {}", "function empty_function() {\n\treturn NULL;\n}", "public function testFunction();", "public function example(): void\n {\n }", "public function testUndefinedParameter()\n {\n $this->generator->generate('foo', ['undefined' => 'value']);\n }", "function gen_zero_arg_error_case($fn_name, $code_block) {\n\t//push code onto the array $code_block\n\tarray_push ($code_block, \"// Zero arguments\");\n\tarray_push ($code_block, \"echo \\\"\\\\n-- Testing $fn_name() function with Zero arguments --\\\\n\\\";\");\n\tarray_push ($code_block, \"var_dump( $fn_name() );\");\n return $code_block;\n}", "public function testNoReturnType4(\n $param1,\n $param2\n);", "public static function noop() {\n\n }", "public function runInstantiatedNoArgumentsAction()\n {\n $output = run(ExampleNoArgumentAction::class);\n\n $this->assertEquals('Hello', $output);\n }", "public function never();", "public function howItWork();", "public function example()\n {\n //\n }", "function Zend_Server_Reflection_FunctionTest_function($var1, $var2, $var3 = null)\n{\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new CodeMember model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new CodeMember(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }
[ "public function actionCreate()\n {\n $model = new Member();\n\t $model->setKey();\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 actionCreate()\n {\n $model = new Member();\n\t\t$model->updated_by=Yii::$app->user->id;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->openid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new ActivationCode();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'activation_code_id' => $model->activation_code_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $grade_name = AdminGrade::find()->all();\n $model = new AdminMember();\n $request = Yii::$app->request;\n if($model->load($request->post())) {\n $model->real_name = PublicController::filter($model->real_name);\n $model->tel = PublicController::filter($model->tel);\n $model->invitation = PublicController::getInvitation();\n $model->created_time = time();\n $model->update_time = time();\n if($model->save()) {\n return $this->redirect(['index']);\n }else {\n return $this->render('create', [\n 'model' => $model,\n 'grade_name'=>$grade_name,\n ]);\n }\n }else {\n return $this->render('create', [\n 'model' => $model,\n 'grade_name'=>$grade_name,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new MemberAccount();\n $model->scenario = 'add';\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n if ($model->save(false)) {\n Yii::$app->session->setFlash('success', '添加成功');\n } else {\n Yii::$app->session->setFlash('error', '添加失败');\n }\n\n return $this->redirect(['index']);\n } else {\n\n Yii::$app->view->params['meta_title'] = '添加申请';\n $Payment = new Payment();\n $payment = $Payment->getPayment();\n\n return $this->render('create', [\n 'model' => $model,\n 'payment' => $payment\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new CodesParam();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $transaction = \\Yii::$app->db->beginTransaction();\n\n try {\n\n if($model->save()){\n\n $transaction->commit();\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n\n }catch (\\Exception $e) {\n\n \\Yii::$app->getSession()->setFlash('success', $e->getMessage());\n $transaction->rollBack();\n }\n\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Postcode;\n\n try {\n if ($model->load($_POST) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (!Yii::$app->request->isPost) {\n $model->load($_GET);\n }\n } catch (\\Exception $e) {\n $model->addError('_exception', $e->getMessage());\n }\n\n return $this->render('create', ['model' => $model]);\n }", "public function actionCreate()\n {\n $model = new Membershiprequest();\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 actionCreate()\n {\n $model = new SyndicateMember();\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n \n $model = new Admin();\n if ($model->load(Yii::$app->request->post())) {\n if ($user = $model->memberRegister()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n \n }", "public function actionCreate()\n {\n $model = new Qrcode();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'user_id' => $model->user_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionRegister() {\n $model = new SaccoMember();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->member_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Pesan();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new RandomCode();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new ShipmentPostcode();\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 actionCreate()\n {\n $model = new Vypusk81();\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 actionCreate()\n {\n $model = new Peminjaman();\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 actionCreate()\n {\n $model = new AccountingMounth();\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 actionCreate()\n {\n $model = new UserDetails();\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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
submit function for the construction info dropdowns building type should be one of: [flatland, complex, townhouse, custom] infotype should be one of: [overview, electrical, amenities, roof, services, exterior, substructure, foundations]
function submitConstructInfo($conn, $infoType, $buildingType, $comment){ $sql = "INSERT INTO constructioninfo (InfoType, BuildingType, Comment) VALUES (:infoType, :buildingType, :comment)"; $sth = $conn->prepare($sql); $sth->bindParam(':infoType', $infoType, PDO::PARAM_STR, 25); $sth->bindParam(':buildingType', $buildingType, PDO::PARAM_STR, 25); $sth->bindParam(':comment', $comment, PDO::PARAM_STR); $sth->execute(); $sth->closeCursor(); $return = ['message' => 'Successfully added the construction dropdown']; return $return; }
[ "function entity_toolbox_info_build($type, $info) {\n $instanceArgs = array(\n 'entity_type' => $type,\n 'raw_data' => $info['raw_data'],\n 'fieldable' => $info['raw_data']['fieldable'],\n 'module' => $info['raw_data']['module'],\n );\n $factoryArgs = array(\n 'entity_type' => $type,\n 'fieldable' => $info['raw_data']['fieldable'],\n 'instance_args' => $instanceArgs\n );\n $factory = hook_get_builder_factory('entity_toolbox_info', $factoryArgs);\n /** @var EntityToolboxInfoBuilder $builder */\n $builder = $factory->getInstance();\n $build = $builder->build();\n\n return $build;\n}", "public function buildForm()\n {\n $this->addSelect('collaboration_type', $this->getCodeList('CollaborationType', 'Activity'), trans('elementForm.collaboration_type'), $this->addHelpText('Activity_CollaborationType-code'), null, true);\n }", "function gp_project_type_create_form() {\n ?>\n <div class=\"form-field\">\n <label for=\"project-type-layout\"><?php _e( 'Layout', 'gp' ); ?></label>\n <select name=\"project-type-layout\" id=\"project-type-layout\" class=\"postform\">\n <?php echo it_array_to_select_options( gp_portfolio_layouts() ); ?>\n </select>\n <br>\n <span class=\"description\"><?php _e( 'Portfolio layout that will be used to display the project type.', 'gp' ); ?></span>\n </div>\n <div id=\"project-type-layout-option\" class=\"form-field\" style=\"display: none\">\n <label for=\"project-type-grid-size\"><?php _e( 'Grid Size', 'gp' ); ?></label>\n <select name=\"project-type-grid-size\" id=\"project-type-grid-size\">\n <?php echo it_array_to_select_options( GridPortfolioAdmin::get_grid_size_options(), GridPortfolio::DEFAULT_GRID_SIZE ); ?>\n </select>\n </div>\n <?php\n}", "function fluxus_project_type_create_form() {\n ?>\n <div class=\"form-field\">\n <label for=\"project-type-layout\"><?php _e( 'Layout', 'fluxus' ); ?></label>\n <select name=\"project-type-layout\" id=\"project-type-layout\" class=\"postform\">\n <?php echo it_array_to_select_options( fluxus_portfolio_layouts() ); ?>\n </select>\n <br>\n <span class=\"description\"><?php _e( 'Portfolio layout that will be used to display the project type.', 'fluxus' ); ?></span>\n </div>\n <div id=\"project-type-layout-option\" class=\"form-field\" style=\"display: none\">\n <label for=\"project-type-grid-size\"><?php _e( 'Grid Size', 'fluxus' ); ?></label>\n <select name=\"project-type-grid-size\" id=\"project-type-grid-size\">\n <?php echo it_array_to_select_options( GridPortfolioAdmin::get_grid_size_options(), GridPortfolio::DEFAULT_GRID_SIZE ); ?>\n </select>\n </div>\n <?php\n}", "public function buildForm()\n {\n $this\n ->addSelect('planned_disbursement_type', $this->getCodeList('BudgetType', 'Activity'), trans('elementForm.type'))\n ->addCollection('period_start', 'Activity\\PeriodStart', '', [], trans('elementForm.period_start'))\n ->addCollection('period_end', 'Activity\\PeriodEnd', '', [], trans('elementForm.period_end'))\n ->addCollection('value', 'Activity\\ValueForm', '', [], trans('elementForm.value'))\n ->addCollection('provider_org', 'Activity\\ProviderOrg', '', [], trans('elementForm.provider_org'))\n ->addCollection('receiver_org', 'Activity\\ReceiverOrg', '', [], trans('elementForm.receiver_org'))\n ->addRemoveThisButton('remove');\n }", "public function buildForm()\n {\n $this->addSelect('default_flow_type', $this->getCodeList('FlowType', 'Activity'), trans('elementForm.default_flow_type'), $this->addHelpText('Activity_DefaultFlowType-code'), null, true);\n }", "private function handle_technologie_build()\n {\n $this->_is_working['working_on'] = '';\n $this->_is_working['is_working'] = false;\n\n if ($this->_current_user['research_current_research'] != 0) {\n if ($this->_current_user['research_current_research'] != $this->_current_planet['planet_id']) {\n $working_planet = parent::$db->queryFetch(\"SELECT `planet_id`, `planet_name`, `planet_b_tech`, `planet_b_tech_id`, `planet_galaxy`, `planet_system`, `planet_planet`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \" . PLANETS . \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `planet_id` = '\" . (int) $this->_current_user['research_current_research'] . \"';\");\n }\n\n if (isset($working_planet)) {\n $the_planet = $working_planet;\n } else {\n $the_planet = $this->_current_planet;\n }\n\n if ($the_planet['planet_b_tech'] <= time() && $the_planet['planet_b_tech_id'] != 0) {\n $the_planet['planet_b_tech_id'] = 0;\n\n if (isset($working_planet)) {\n $working_planet = $the_planet;\n } else {\n $this->_current_planet = $the_planet;\n }\n } elseif ($the_planet['planet_b_tech_id'] == 0) {\n $this->_is_working['working_on'] = '';\n $this->_is_working['is_working'] = false;\n } else {\n $this->_is_working['working_on'] = $the_planet;\n $this->_is_working['is_working'] = true;\n }\n }\n }", "public function buildForm()\n {\n $this\n // ->addSelect('type', $this->getCodeList('DescriptionType', 'Activity'), trans('elementForm.description_type'), $this->addHelpText('Activity_Description-type'), '1', true)\n ->add(\n 'type',\n 'hidden',\n [\n 'value' => '1'\n ]\n )\n ->addGeneralDescription('narrative', trans('elementForm.text'), ['narrative_required' => true])\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addRemoveThisButton('remove_description');\n }", "function gameBuildAction(){\n global $session;\n\n $type = $_POST['buildaction'];\n $x = $_POST['x'];\n $y = $_POST['y'];\n $town = $_POST['town'];\n $character = $_POST['character'];\n\n if($this->checkBuildResources($type, $character))\n {\n if (!strcmp($type, \"upgrade\")) {\n $level = $_POST['level'];\n $level++;\n\n $this->gameUpgradeBuilding($x, $y, $town, $character, $type, $level);\n }\n else if (!strcmp($type, \"remove\")) {\n $level = $_POST['level'];\n\n $this->gameRemoveBuilding($x, $y, $town, $character, $type, $level);\n\n }\n else {\n $this->gameCreateBuilding($x, $y, $town, $character, $type);\n }\n }\n }", "function &buildForm();", "public function buildForm();", "public function buildForm()\n {\n $this\n ->addSelect(\n 'organization_role',\n $this->getCodeList('OrganisationRole', 'Activity'),\n trans('elementForm.organisation_role'),\n $this->addHelpText('Activity_ParticipatingOrg-role'),\n null,\n true\n )\n ->add('identifier', 'text', ['label' => trans('elementForm.identifier'), 'help_block' => $this->addHelpText('Activity_ParticipatingOrg-ref')])\n ->addSelect('organization_type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.organisation_type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->add('activity_id', 'text', ['label' => trans('elementForm.activity_id')])\n ->add('crs_channel_code','text',['label' => 'Crs Channel Code'])\n ->addNarrative('narrative', trans('elementForm.organisation_name'))\n ->addAddMoreButton('add', 'narrative')\n ->addRemoveThisButton('remove_narrative');\n }", "function add_building()\n {\n if ($_POST)\n {\n $config = Config::GetInstance();\n\n $db = new Database($config->DB_HOST, $config->DB_USERNAME, $config->DB_PASSWORD, $config->DB_NAME);\n $db->connect();\n $db->selectdb();\n\n $db->query('insert into data (u_hash, time, data, type) values (' .\n $db->quote(trim($_POST['hash'])) . ',' . time() . ',' . $db->quote(trim(urlencode($_POST['json']))) . ',' . $db->quote(trim('add_building')) .\n ')');\n }\n \n }", "function careerfy_vc_simple_jobs_listing_multi()\n{\n global $jobsearch_gdapi_allocation;\n\n $jobsearch__options = get_option('jobsearch_plugin_options');\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n $all_locations_type = isset($jobsearch__options['all_locations_type']) ? $jobsearch__options['all_locations_type'] : '';\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n\n $job_listsh_parms = array();\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'job_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'job_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Order dropdown will work for featured jobs only\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'job_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n ),\n 'description' => esc_html__(\"Choose job list items orderby.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Number of Jobs\", \"careerfy-frame\"),\n 'param_name' => 'job_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how many jobs you want to show.\", \"careerfy-frame\")\n );\n\n //\n $attributes = array(\n \"name\" => esc_html__(\"Simple Jobs Listing Multi\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_simple_jobs_listing_multi\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => $job_listsh_parms,\n );\n\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}", "public function action_building($param = \"\")\n\t{\n\t\tif( Session::has('user') || Auth::user() || Session::has('sa')){\n\t\t\t$user = Session::get('user');\n\t\t\tswitch ($param) {\n\t\t\t\t// case 'budget':\n\t\t\t\t// \tif(Input::has('submit') || Input::has('save')){\n\t\t\t\t// \t\t// Submitted Budget\n\t\t\t\t//\n\t\t\t\t// \t\t$values = Input::get();\n\t\t\t\t// \t\t//var_dump($vales);\n\t\t\t\t// \t\t//exit();\n\t\t\t\t// \t\t$submit = array_pop($values);\n\t\t\t\t//\n\t\t\t\t// \t\t$fy = \"FY\".(date('y')+1);\n\t\t\t\t// \t\tforeach ($values as $name=>$value) {\n\t\t\t\t// \t\t\techo $name . \":::\" . $value . \"<br>\";\n\t\t\t\t//\n\t\t\t\t// \t\t\tif($submit == \"Submit\"){\n\t\t\t\t// \t\t\t\techo \"Submit Data\";\n\t\t\t\t// \t\t\t} else {\n\t\t\t\t// \t\t\t\techo \"Save Data\";\n\t\t\t\t// \t\t\t}\n\t\t\t\t// \t\t\t// list($p,$buildingbudget_id) = explode(\"-\",$name);\n\t\t\t\t// \t\t\t// $bbp = new BuildingBudgetProposed;\n\t\t\t\t// \t\t\t// $bb = BuildingBudget::find($buildingbudget_id);\n\t\t\t\t// \t\t\t// //$bb->is_proposed = '1';\n\t\t\t\t// \t\t\t//\n\t\t\t\t// \t\t\t// $bbp->buildingbudget_id = $buildingbudget_id;\n\t\t\t\t// \t\t\t// $bbp->fyyear = $fy;\n\t\t\t\t// \t\t\t// if($value == null || $value == \"\"){\n\t\t\t\t// \t\t\t// \t$bbp->amount = '0.00';\n\t\t\t\t// \t\t\t// } else {\n\t\t\t\t// \t\t\t// \t$bbp->amount = $value;\n\t\t\t\t// \t\t\t// }\n\t\t\t\t// \t\t\t//\n\t\t\t\t// \t\t\t// $bb->save();\n\t\t\t\t// \t\t\t// $bbp->save();\n\t\t\t\t// \t\t}\n\t\t\t\t// \t\texit();\n\t\t\t\t// \t\tSession::flash('status_success', 'Your proposed building budget has been submitted');\n\t\t\t\t// \t\treturn Redirect::to('/admin/building');\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\t// View Users budget\n\t\t\t\t// \t\t$user = Session::get('user');\n\t\t\t\t// \t\tif(isset($_GET['building'])){\n\t\t\t\t// \t\t\t$entries = BuildingBudget::where('building_id','=',$_GET['building'])->where('is_proposed','=',0)->order_by('fund')->get();\n\t\t\t\t// \t\t} else {\n\t\t\t\t// \t\t\t$entries = BuildingBudget::where('building_id','=', $user->building_id)->where('is_proposed','=',0)->order_by('fund')->get();\n\t\t\t\t// \t\t}\n\t\t\t\t// \t\tif(sizeof($entries)>0){\n\t\t\t\t// \t\t\t$arrBudgets = array();\n\t\t\t\t// \t \t$arrExpended = array();\n\t\t\t\t// \t \t$arrProposed = array();\n\t\t\t\t//\n\t\t\t\t// \t \t$fy = date('y') + 1;\n\t\t\t\t//\n\t\t\t\t// \t \t$budgettotal = BuildingBudgetAmount::where('building_id','=', $user->building_id)->where('fyyear','=','FY'.$fy)->first();\n\t\t\t\t//\n\t\t\t\t// \t \tforeach($entries as $key=>$obj){\n\t\t\t\t// \t \t\t$arrBudgets[] = $obj;\n\t\t\t\t// \t \t\t$string = \"\";\n\t\t\t\t//\n\t\t\t\t// \t \t\tforeach (BuildingBudgetExpended::where('buildingbudget_id','=',$obj->id)->get() as $value) {\n\t\t\t\t// \t \t\t\t$string .= $value->fyyear . \" : $\".$value->amount.\"\\n\";\n\t\t\t\t// \t \t\t}\n\t\t\t\t//\n\t\t\t\t// \t \t\t$arrExpended[$obj->id] = $string;\n\t\t\t\t// \t \t}\n\t\t\t\t//\n\t\t\t\t// \t \treturn View::make('admin.buildingbudget', array('budgets'=>$arrBudgets,'expended'=>$arrExpended,'budgettotal'=>$budgettotal->amount))->nest('nav','partials.nav2');\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\treturn View::make('admin.buildingbudget2')->nest('nav','partials.nav2');\n\t\t\t\t// \t}\n\t\t\t\t// }\n\t\t\t\t// \tbreak;\n\n\t\t\t\tcase 'revenue':\n\t\t\t\t\tif(Input::has('submit')){\n\t\t\t\t\t\t// Submitted Revenues\n\t\t\t\t\t\t$values = Input::get();\n\t\t\t\t\t\t$submit = array_pop($values);\n\n\t\t\t\t\t\t$fy = \"FY\".(date('y')+1);\n\t\t\t\t\t\tforeach ($values as $name=>$value) {\n\t\t\t\t\t\t\tlist($p,$buildingrevenue_id) = explode(\"-\",$name);\n\t\t\t\t\t\t\t$brp = new BuildingRevenueProposed;\n\t\t\t\t\t\t\t$br = BuildingRevenue::find($buildingrevenue_id);\n\t\t\t\t\t\t\t$br->is_proposed = '1';\n\n\t\t\t\t\t\t\t$brp->buildingrevenue_id = $buildingrevenue_id;\n\t\t\t\t\t\t\t$brp->fyyear = $fy;\n\t\t\t\t\t\t\tif($value == null || $value == \"\"){\n\t\t\t\t\t\t\t\t$brp->amount = '0.00';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$brp->amount = $value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$br->save();\n\t\t\t\t\t\t\t$brp->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSession::flash('status_success', 'Your proposed building Revenues has been submitted');\n\t\t\t\t\t\treturn Redirect::to('/admin/building');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user = Session::get('user');\n\t\t\t\t\t\tif(isset($_GET['building'])){\n\t\t\t\t\t\t\t$entries = BuildingRevenue::where('building_id','=',$_GET['building'])->where('is_proposed','=',0)->get();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$entries = BuildingRevenue::where('building_id','=', $user->building_id)->where('is_proposed','=',0)->get();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(sizeof($entries)>0){\n\t\t\t\t\t\t\t$arrRevs = array();\n\t\t\t\t\t \t$arrExpended = array();\n\t\t\t\t\t \t$arrProposed = array();\n\t\t\t\t\t\t\tforeach($entries as $key=>$obj){\n\t\t\t\t\t \t\t$arrRevs[] = $obj;\n\t\t\t\t\t \t\t$string = \"\";\n\n\t\t\t\t\t \t\t//var_dump(BuildingRevenueExpended::where('buildingrevenue_id','=',$obj->id)->get() );\n\n\t\t\t\t\t \t\tforeach (BuildingRevenueExpended::where('buildingrevenue_id','=',$obj->id)->get() as $value) {\n\t\t\t\t\t \t\t\t$string .= $value->fyyear . \" : $\".$value->amount.\"\\n\";\n\t\t\t\t\t \t\t\tLog::write(\"info\", $obj->id.\":::\".$string);\n\t\t\t\t\t \t\t}\n\n\n\t\t\t\t\t \t\t$arrExpended[$obj->id] = $string;\n\t\t\t\t\t \t}\n\t\t\t\t\t\t\treturn View::make('admin.buildingrevenue', array('revenues'=>$arrRevs,'expended'=>$arrExpended))->nest('nav','partials.nav2');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn View::make('admin.buildingrevenue2')->nest('nav','partials.nav2');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'export':\n\n\t\t\t\t\t$entries = BuildingBudget::where('building_id','=',$user->building_id)->get();\n\t\t\t\t\t$budgetFile = \"\";\n\t\t \t\t$budgetFile = \"TI,FUND,FUNCTION,OBJECT,SCC,SUBJECT,OPU,IL,JOB,Description,Proposed\\r\\n\";\n\t\t \t\tforeach($entries as $bb){\n\n\t\t \t\t\t$bbp = BuildingBudgetProposed::where('buildingbudget_id','=',$bb->id)->first();\n\n\t\t \t\t\t$budgetFile .= $bb->ti . \",\";\n\t\t \t\t\t$budgetFile .= $bb->fund.\",\";\n\t\t \t\t\t$budgetFile .= $bb->function .\",\";\n\t\t \t\t\t$budgetFile .= $bb->object.\",\";\n\t\t \t\t\t$budgetFile .= $bb->scc.\",\";\n\t\t \t\t\t$budgetFile .= $bb->subject.\",\";\n\t\t \t\t\t$budgetFile .= $bb->opu.\",\";\n\t\t \t\t\t$budgetFile .= $bb->il.\",\";\n\t\t \t\t\t$budgetFile .= $bb->job.\",\";\n\t\t \t\t\t$budgetFile .= $bb->description.\",\";\n\t\t \t\t\t$budgetFile .= $bbp->amount.\"\\r\\n\";\n\t\t \t\t}\n\n\t\t \t\t$user = Session::get('user');\n\t\t \t\t$entries = BuildingRevenue::where('building_id','=',$user->building_id)->get();\n\n\t\t \t\t$revFile = \"\";\n\t\t \t\t$revFile .= \"TI,FUND,RECEIPT,SCC,SUBJECT,OPU,Description,Proposed\\r\\n\";\n\t\t \t\tforeach($entries as $br){\n\t\t \t\t\t$brp = BuildingRevenueProposed::where('buildingrevenue_id','=',$br->id)->first();\n\t\t \t\t\t$revFile .= $br->ti.\",\";\n\t\t \t\t\t$revFile .= $br->fund.\",\";\n\t\t \t\t\t$revFile .= $br->receipt.\",\";\n\t\t \t\t\t$revFile .= $br->scc.\",\";\n\t\t \t\t\t$revFile .= $br->subject.\",\";\n\t\t \t\t\t$revFile .= $br->opu.\",\";\n\t\t \t\t\t$revFile .= $br->description.\",\";\n\t\t \t\t\t$revFile .= $brp->amount.\"\\r\\n\";\n\t\t \t\t}\n\t\t \t\t$file = tempnam(\"tmp\", \"zip\");\n\t\t \t\t$zip = new ZipArchive();\n\t\t \t\t$zip->open($file, ZipArchive::OVERWRITE);\n\n\t\t \t\t$zip->addFromString(\"BUILDINGBUDGET.CSV\",$budgetFile);\n\t\t \t\t$zip->addFromString(\"BUILDINGREVENUE.CSV\",$revFile);\n\n\t\t \t\t$zip->close();\n\n\t\t\t\t\theader('Content-Type: application/zip');\n\t\t\t header('Content-Length: '.filesize($file));\n\t\t\t header('Content-Disposition: attachement; filename=\"budrev.zip\"');\n\t\t\t readfile($file);\n\t\t\t unlink($file);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn View::make('admin.dashboard')->nest('nav','partials.nav2');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tSession::flash('status_success', 'Output does not work..');\n\t\t\treturn View::make('admin.index2');\n\t\t}\n\t}", "public function createAction()\n {\n $entity = new Building_type();\n $request = $this->getRequest();\n\n //Set ค่า deleted = 0\n $entity->setDeleted(0);\n\n $form = $this->createForm(new Building_typeType(), $entity);\n $form->bindRequest($request);\n\n// if (!$form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n\n //Check ชื่อ TypeName ซ้ำ\n $getName = $entity->getTypeName();\n if (!$this->checkName($getName, \"\")){\n echo \"finish_comp\";\n exit();\n }\n\n $em->persist($entity);\n $em->flush();\n\n //สร้าง logs\n $this->addLogger('Insert Building Type', $entity);\n\n echo 'finish';\n exit();\n// return $this->redirect($this->generateUrl('building_type_show', array('id' => $entity->getId())));\n \n //}\n\n// return $this->render('FTRAdminBundle:Building_type:new.html.twig', array(\n// 'entity' => $entity,\n// 'form' => $form->createView()\n// ));\n }", "public function buildForm()\n {\n $this->addSelect('aid_type', $this->getAidTypeCodeList(), trans('elementForm.aid_type'), $this->addHelpText('Activity_Transaction_AidType-code'));\n }", "public function getbuildings(){\n\t\tif(isset($_POST)){\n\t\t\tif(isset($_POST['campus_id']) && $_POST['campus_id']!=''){\n\t\t\t\t$buildings = $this->mapModel->getBuildings($_POST);\n\t\t\t\techo json_encode(array('message'=>'buildings', 'result'=>$buildings));\n\t\t\t}else{\n\t\t\t\techo json_encode(array('message'=>'$_POST[\"campus_id\"] must be set and not be empty'));\n\t\t\t}\n\t\t}else{\n\t\t\techo json_encode(array('message'=>'use post'));\n\t\t}\n\n\t}", "function add_vendor_specific_info ( $entry, $form, &$data, &$field_type) {\n //cap_set corresponds to binary number with a 1 in each position where a checkbox is checked\n $cap_set = 0;\n for ($cap_num = 1; $cap_num <= 9; $cap_num++) {\n $entry_num = \"10.{$cap_num}\";\n if($entry[$entry_num] != '') {\n $cap_set = $cap_set | (1<<($cap_num-1));\n }\n }\n\n $data = array_merge($data, array('capability_extra' => $entry['11'], 'capability' => $cap_set, 'professional' => $entry['15']));\n $field_type[] = '%d';\n $field_type[] = '%s';\n $field_type[] = '%d';\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the networkName Network Name
public function getNetworkName() { if (array_key_exists("networkName", $this->_propDict)) { return $this->_propDict["networkName"]; } else { return null; } }
[ "abstract public function getNetworkName();", "function getNetworkName($networkID){\n\t\t\t\n\t\t\t$network = getDatabaseInfo(\"networks\", \"network_id\", $networkID);\n\t\t\t$networkName = $network['AREA'];\n\t\t\t\n\t\t\treturn $networkName;\n\t\t}", "function getNetworkName($network)\r\n{\r\n switch ($network) {\r\n case 1:\r\n return 'WLM/MSN';\r\n case 2:\r\n return 'LCS';\r\n case 4:\r\n return 'Mobile Phones';\r\n case 32:\r\n return 'Yahoo!';\r\n }\r\n return \"Unknown ($network)\";\r\n}", "protected function format_network_name( WP_Network $network ) {\n\t\treturn sprintf( '\"%s\" (%d)', $network->site_name, $network->id );\n\t}", "public function getNetworkPrefix() {\n return $this->networkPrefix;\n }", "public function getNetworkCode()\n {\n return $this->networkCode;\n }", "public function getNetwork()\n\t{\n\n\t\treturn $this['Network'];\n\n\t}", "public function getDnsName()\n {\n return isset($this->dns_name) ? $this->dns_name : '';\n }", "public function getNetworkId()\n {\n return $this->network_id;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetworkId() {\n return $this->network_id;\n }", "public function getNetworkTID() {\n\n\t\treturn $this->network . \"-\" . $this->network_tid;\n\t}", "function getNetworkID() {\n\t\treturn $this->getParamSet()->getParam(self::PARAM_NETWORK_ID);\n\t}", "public function getNetworkDisplayTitle($network)\n {\n if (!empty($this->definitions[$network]['display_title'])) {\n return $this->definitions[$network]['display_title'];\n }\n return ucfirst(str_replace('-', ' ', $network));\n }", "function getNetworkID() {\n\t\treturn $this->_NetworkID;\n\t}", "public function getPhoneNetworkPrefix() : string\n {\n return substr($this->_phone->getLocalFormat(), 0, 4);\n }", "public function getNodename()\n {\n $nodename = $this->nodename ?? $this->getNodenameFromId($this->identifier);\n\n return $nodename;\n }", "public function getNetworkProfile()\n {\n return $this->network_profile;\n }", "public function getNetworkUri()\n {\n return $this->network_uri;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up a WorkerPool to distribute an event to one of a pool of work handler threads. Each event will only be processed by one of the work handlers. The Disruptor will automatically start this processors when start() is called.
public function handleEventsWithWorkerPool(WorkHandlerList $workHandlers) { return $this->createWorkerPool(null, $workHandlers); }
[ "public function init()\n {\n $this->pool = $pool = new \\Swoole\\Process\\Pool($this->workCnt);\n\n $ctx = $this->ctx;\n $msgHandleFunc = $this->msgHandleFunc;\n $redisMqKey = $this->redisMqKey;\n $this->pool->on(\"WorkerStart\", function ($pool, $workerId) use ($ctx,$msgHandleFunc,$redisMqKey) {\n $process = $pool->getProcess();\n $pid = $process->pid;\n echo \"Worker#{$workerId} is started ,pid:$pid\\n\";\n\n while (true) {\n $msg = RedisUtils::brpop($redisMqKey,2);\n if ( $msg == null) continue;\n var_dump($msg);\n $bRet = call_user_func_array([$ctx, $msgHandleFunc],[$pid,$msg] );\n }\n echo \"Worker#{$workerId} is end\\n\";\n });\n\n $this->pool->on(\"WorkerStop\", function ($pool, $workerId) {\n echo \"Worker#{$workerId} is stopped\\n\";\n });\n\n }", "protected function setup_workers()\n {\n\n }", "public function setWorkerPool($var)\n {\n GPBUtil::checkString($var, True);\n $this->worker_pool = $var;\n\n return $this;\n }", "private function service__event_loop() {\n\t\t$this->event_base = event_base_new();\n\t\t// Signal handlers\n\t\t$this->event_add( 'SIGCHLD', SIGCHLD, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGCHLD' );\n\t\t$this->event_add( 'SIGHUP', SIGHUP, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGHUP' );\n\t\t$this->event_add( 'SIGINT', SIGINT, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGINT' );\n\t\t$this->event_add( 'SIGTERM', SIGTERM, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGTERM' );\n\t\t// Socket handlers\n\t\t$this->event_add( 'request', $this->request_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_request' );\n\t\t$this->event_add( 'offer', $this->offer_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_offer' );\n\t\t$this->event_add( 'response', $this->response_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_response' );\n\t\t// Heartbeat\n\t\t$timeout_microseconds = intval( 60e6 / $this->heartbeat_bpm );\n\t\t$this->event_add( 'heartbeat', 0, EV_TIMEOUT | EV_PERSIST,\n\t\t\t'service__heartbeat', $timeout_microseconds );\n\t\t// Initial worker start (run only once)\n\t\t$this->event_add( 'start', 0, EV_TIMEOUT,\n\t\t\t'service__supervise_workers', 1 );\n\t\tevent_base_loop( $this->event_base );\n\t\tif ( ! $this->is_worker ) {\n\t\t\t// Only workers should reach this code.\n\t\t\terror_log( \"Prefork service left event loop\" );\n\t\t\texit(1);\n\t\t}\n\t}", "protected function bootstrap() {\n $function_count = array();\n foreach($this->functions as $worker=>$config) {\n if(empty($function_count[$worker])){\n $function_count[$worker] = 0;\n }\n while($function_count[$worker] < $config[\"count\"]){\n $this->fork_worker($worker);\n $function_count[$worker]++;;\n }\n /**\n * php will eat up your cpu if you don't have this\n */\n usleep(50000);\n }\n }", "function processpool () {\n\t\t\n\t\t// agora vem o cbq.init\n\t\t/* Roteiro:\n\t\t * - pegar interface de saida (saida pra dentro (download-placa de rede do usuario) \n\t\t * - ou saida pra fora (upload-todas as placas externas ou a especificada no acl)\n\t\t * - calcular o weight\n\t\t * - nao vai ter rule pra saida (upload)\n\t\t * - na entrada (download) nao sei se o mark vai funcionar (TESTAR )\n\t\t * - verificar se vai ter bounded ou isolated\n\t\t * - - se for pelo maximo, BOUNDED=yes, ISOLATED=yes\n\t\t * - - se for pelo pool, PARENT=XXXX, LEAF=sfq, BOUNDED=no, ISOLATED=no\n\t\t * - - - o XXXX refere-se a classe q tem o maximo do pool\n\t\t * - - - precisa ser BOUNDED=yes, ISOLATED=no e LEAF=sfq\n\t\t */\n\t\t /*\n\t\t * Roteiro tecnico:\n\t\t * - Objetos:\n\t\t * \t\tthis.addcbq(array)\n\t\t * \t\t\tpega um array e adiciona ao $this.cbq\n\t\t * \t\t\tse for pool, tambem adiciona ao $this.pool a referencia\n\t\t * \t\t$this.pool\n\t\t * \t\t\ttabela com os pools e seus ID\n\t\t * \n\t\t */\n\t\t// primeiro: crio as regras para cada pool\n\t\t// soh posso criar uma vez, entao basta ver se a variavel\n\t\t// this->pools jah foi setada.\n\t\t$pools= xml::normalizeseq($this->conf[pools][pool]);\n\t\t$sp=0;\n\t\t\n\t\tif (trim($pools[0])==\"\") { $pools=array(); }\n\t\t\n\t\t//echo \"pools:\";print_r($pools);\n\t\t/*\n\t\t * [0] => Array\n\t\t\t (\n\t\t\t [id] => 1\n\t\t\t [prio] => 3\n\t\t\t [maxdownload] => 200\n\t\t\t [maxupload] => 100\n\t\t\t )\n\t\t */\n\t\t\n\t\t// para cada placa de rede interna eu tenho q salvar o pool de download lah\n\t\t$int_internal=$this->obj->getinterfaces(\"internal\");\n\t\tforeach ($int_internal as $k=>$v) {\n\t\t\tforeach ($pools as $kp=>$vp) {\n\t\t\t\t$shaperpool[$sp][out]=$v[device];\n\t\t\t\t$shaperpool[$sp][weight]=$vp[maxdownload]/10;\n\t\t\t\t$shaperpool[$sp][rate]=$vp[maxdownload];\n\t\t\t\t$shaperpool[$sp][pool]=$vp[id];\n\t\t\t\t$shaperpool[$sp][prio]=$vp[prio];\n\t\t\t\t$shaperpool[$sp][dir]=\"download\";\n\t\t\t\t$sp++;\n\t\t\t}\t\t\t\n\t\t}\n\t\t$int_external=$this->obj->getinterfaces(\"external\");\n\t\tforeach ($int_external as $k=>$v) {\n\t\t\tforeach ($pools as $kp=>$vp) {\n\t\t\t\t$shaperpool[$sp][out]=$v[device];\n\t\t\t\t$shaperpool[$sp][weight]=$vp[maxupload]/10;\n\t\t\t\t$shaperpool[$sp][rate]=$vp[maxupload];\n\t\t\t\t$shaperpool[$sp][pool]=$vp[id];\n\t\t\t\t$shaperpool[$sp][prio]=$vp[prio];\n\t\t\t\t$shaperpool[$sp][dir]=\"upload\";\n\t\t\t\t$sp++;\t\t\t\n\t\t\t}\n\t\t}\n\t\t//echo \"shaperpool:\";print_r($shaperpool);\n\t\t/*\n\t\t * \n\t\t [0] => Array\n\t\t (\n\t\t [out] => eth0\n\t\t [weight] => 20\n\t\t [rate] => 200\n\t\t [pool] => 1\n\t\t [prio] => 3\n\t\t [dir] => download\n\t\t )\n\t\t */\n\t\t// crio as regras de pool e salvo o seu ID no shaperpool pra ser usado depois\n\t\t// essas sao as regras pais (parent) que definem o maximo para as regras filhas usarem\n\t\t$varpooldefaults=array(\"leaf\"=>\"none\",\"prio\"=>\"5\");\n\t\tfor ($i=0;$i<count($shaperpool);$i++) {\n\t\t\t$varpool[$i]=array_merge($shaperpool[$i]);\n\t\t\tforeach ($varpooldefaults as $k=>$v) {\n\t\t\t\tif (!$varpool[$i][$k])\n\t\t\t\t\t$varpool[$i][$k]=$v;\n\t\t\t}\n\t\t\t$shaperpool[$i][poolparent] = $this->addcbq($varpool[$i]);\n\t\t}\n\t\t$this->shaperpool = $shaperpool;\n\t}", "public function start()\n {\n if ($this->isRunning()) {\n throw new StatusError('The worker pool has already been started.');\n }\n\n // Start up the pool with the minimum number of workers.\n $count = $this->minSize;\n while (--$count >= 0) {\n $worker = $this->createWorker();\n $this->idleWorkers->enqueue($worker);\n }\n\n $this->running = true;\n }", "protected static function initWorkers()\n {\n foreach (static::$_workers as $worker) {\n // Worker name.\n if (empty($worker->name)) {\n $worker->name = 'none';\n }\n\n // Get unix user of the worker process.\n if (empty($worker->user)) {\n $worker->user = static::getCurrentUser();\n } else {\n if (\\posix_getuid() !== 0 && $worker->user !== static::getCurrentUser()) {\n static::log('Warning: You must have the root privileges to change uid and gid.');\n }\n }\n\n // Socket name.\n $worker->socket = $worker->getSocketName();\n\n // Status name.\n $worker->status = '<g> [OK] </g>';\n\n // Get column mapping for UI\n\n // Listen.\n if (!$worker->reusePort) {\n $worker->listen();\n }\n }\n }", "protected function bootstrap() {\n\n\t\t$function_count = array();\n\n\t\t/**\n\t\t * If we have \"do_all\" workers, start them first\n\t\t * do_all workers register all functions\n\t\t */\n\t\tif(!empty($this->do_all_count) && is_int($this->do_all_count)){\n\n\t\t\tfor($x=0;$x<$this->do_all_count;$x++){\n\t\t\t\t$this->start_worker();\n\t\t\t}\n\n\t\t\tforeach($this->functions as $worker => $settings){\n\t\t\t\tif(empty($settings[\"dedicated_only\"])){\n\t\t\t\t\t$function_count[$worker] = $this->do_all_count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Next we loop the workers and ensure we have enough running\n\t\t * for each worker\n\t\t */\n\t\tforeach($this->functions as $worker=>$config) {\n\n\t\t\t/**\n\t\t\t * If we don't have do_all workers, this won't be set, so we need\n\t\t\t * to init it here\n\t\t\t */\n\t\t\tif(empty($function_count[$worker])){\n\t\t\t\t$function_count[$worker] = 0;\n\t\t\t}\n\n\t\t\twhile($function_count[$worker] < $config[\"count\"]){\n\t\t\t\t$this->start_worker($worker);\n\t\t\t\t$function_count[$worker]++;;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * php will eat up your cpu if you don't have this\n\t\t\t */\n\t\t\tusleep(50000);\n\n\t\t}\n\n\t\t/**\n\t\t * Set the last code check time to now since we just loaded all the code\n\t\t */\n\t\t$this->last_check_time = time();\n\n\t}", "static function createProcess()\n {\n foreach (self::$workers_no_listen_wait as $v) {\n foreach (range(0, $v->count - 1) as $id) {\n $process = self::_createProcess($v, $id);\n\n $v->swooleObj = $process;\n self::$workers_no_listen[] = $process;\n self::$process_worker[] = [$v, $id];\n }\n }\n\n self::$workers_no_listen_wait = [];\n }", "private function listen() {\n\t\t//By allowing twice the threads, concurrency is improved\n\t\tfor ($i = 0; $i < $this->numThreads*2; $i++) {\n\t\t\t$this->createFork(100+$i, 0);\n\t\t}\n\t}", "public function startProcessPool()\n {\n return $this->_runProcess(sprintf('%s -- pool', $this->_getImportBinary()));\n }", "private function _getRequestPool(): Pool\n {\n return new Pool($this->_getClient(), $this->_getRequestPromise(), [\n 'concurrency' => max(1, $this->configOfConcurrency),\n 'fulfilled' => function () {\n call_user_func_array([$this, '_responseSuccessHandle'], func_get_args());\n },\n 'rejected' => function () {\n call_user_func_array([$this, '_responseFailHandle'], func_get_args());\n }\n ]);\n }", "private function runWorkers()\n {\n if (!$this->allowNewInstances) {\n return;\n }\n\n $this->allowNewInstances = false;\n\n $this->forkWorker();\n\n $this->allowNewInstances = true;\n }", "protected function adjustRunningWorkers() : void\n {\n foreach ($this->poolsConfig as $pool => $workerConfig) {\n $workersActive = count($this->pids[$pool]);\n $workersTarget = (int)$workerConfig['instances'];\n if ($workersActive >= $workersTarget) {\n continue;\n }\n\n $workerDiff = $workersTarget - $workersActive;\n for ($i = 0; $i < $workerDiff; $i++) {\n $this->startupWorker($pool);\n }\n }\n }", "protected static function initWorkers()\n {\n foreach(self::$_workers as $worker)\n {\n // if worker->name not set then use worker->_socketName as worker->name\n if(empty($worker->name))\n {\n $worker->name = 'none';\n }\n // get the max length of worker->name for formating status info\n $worker_name_length = strlen($worker->name);\n if(self::$_maxWorkerNameLength < $worker_name_length)\n {\n self::$_maxWorkerNameLength = $worker_name_length;\n }\n // get the max length of worker->_socketName\n $socket_name_length = strlen($worker->getSocketName());\n if(self::$_maxSocketNameLength < $socket_name_length)\n {\n self::$_maxSocketNameLength = $socket_name_length;\n }\n // get the max length user name\n if(empty($worker->user) || posix_getuid() !== 0)\n {\n $worker->user = self::getCurrentUser();\n }\n $user_name_length = strlen($worker->user);\n if(self::$_maxUserNameLength < $user_name_length)\n {\n self::$_maxUserNameLength = $user_name_length;\n }\n // listen\n $worker->listen();\n }\n }", "protected function prepareWork() {\r\n $this->data = $this->shmStore->readString();\r\n if (!$this->data) {\r\n $this->logger->log(\"Worker could not successfully copy in data.\");\r\n // As work preparation is kicked off by SIGUSR1, wokrer exits signal handler processing to return to main\r\n // loop to await manager re-allocation\r\n return;\r\n } else {\r\n $this->work();\r\n }\r\n }", "protected static function forkWorkers()\n {\n foreach (self::$_workers as $worker) {\n if (self::$_status === self::STATUS_STARTING) {\n if (empty($worker->name)) {\n $worker->name = $worker->getSocketName();\n }\n\n }\n\n $worker->count = $worker->count <= 0 ? 1 : $worker->count;\n while (count(self::$_pidMap[$worker->workerId]) < $worker->count) {\n static::forkOneWorker($worker);\n }\n }\n }", "private function _createPool()\n {\n $schedule = Schedule::lookupById((int)$this->m_scheduleId);\n $divisionNameWithGender = $schedule->division->name . \" \" . $schedule->division->gender;\n $this->m_divisionNames[] = $divisionNameWithGender;\n $flight = Flight::lookupById((int)$this->m_flightId);\n $pool = Pool::create($flight, $schedule, $this->m_poolName);\n\n $this->m_messageString = \"Pool $pool->fullName successfully created\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
insert meta tag into page
public static function insertMeta() { $settings = app()->controller->settings; //register meta description cs()->registerMetaTag($settings['meta_description'], 'description'); //register meta keywords cs()->registerMetaTag($settings['meta_keywords'], 'keywords'); }
[ "protected static function addMeta() {\n // Todo: compan_* variables from command line otherwise use this one\n File::addContent(\n self::$root_dir_default_theme.'Page.ss', \n ' <meta name=\"author\" content=\"'.self::$project_company.', '.self::$project_company_adress.', '.self::$project_company_destination.', '.self::$project_company_web.', '.self::$project_company_email.'\">', \n '<meta http-equiv'\n );\n File::replaceContent(\n self::$root_dir_default_theme.'Page.ss',\n '$MetaTags(false)',\n '$MetaTags(true)'\n );\n }", "function jacqueline_head_add_page_meta() {\n\t\t?>\n\t\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1<?php if (jacqueline_get_theme_option('responsive_layouts')=='yes') echo ', maximum-scale=1'; ?>\">\n\t\t\t<meta name=\"format-detection\" content=\"telephone=no\">\n\n\t\t\t<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\" />\n\t\t\t<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\" />\n\t\t<?php\n\t}", "function yogastudio_head_add_page_meta() {\n\t\t?>\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1<?php if (yogastudio_get_theme_option('responsive_layouts')=='yes') echo ', maximum-scale=5'; ?>\">\n\t\t<meta name=\"format-detection\" content=\"telephone=no\">\n\t\n\t\t<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\" />\n\t\t<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\" />\n\t\t<?php\n\t}", "function charity_is_hope_head_add_page_meta() {\n\t\t?>\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1<?php if (charity_is_hope_get_theme_option('responsive_layouts')=='yes') echo ', maximum-scale=1'; ?>\">\n\t\t<meta name=\"format-detection\" content=\"telephone=no\">\n\t\n\t\t<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\" />\n\t\t<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\" />\n\t\t<?php\n\t}", "public function addMetadata()\n {\n if (phpQuery::pq('meta[content=\"sitecake\"]', $this->evaluated)->count() === 0) {\n phpQuery::pq('head', $this->evaluated)->prepend('<meta name=\"application-name\" content=\"sitecake\"/>');\n }\n }", "function addmeta( $name, $value )\n\t{\n\t\t// this will be used\n\t\t$meta = '<meta name=\"%s\" content=\"%s\" />';\n\t\t\n\t\t// add it\n\t\t$this->meta_tags .= sprintf( $meta, $name, $value );\n\t}", "protected function insertCustomMeta()\n {\n\n /** @var \\Story\\Session $session */\n $session = app('session');\n\n if ($session->get('__errors')) {\n $fields = $session->get('__fields', array());\n\n PageMeta::pushCustomMeta($this->page, $fields);\n }\n\n }", "public function seo_meta_information() {\n ?>\n <meta name=\"description\" content=\"web Ddesign and development materials\">\n <meta name=\"keywords\" content=\"HTML, CSS, JavaScript, php, wordpress, laravel\">\n <meta name=\"author\" content=\"moshiur rahman\">\n <?php\n }", "abstract function setExtraMetaTags();", "public function addMeta($name, $content);", "function fbs_page_meta( ) {\n\t\tglobal $_RESOLVED;\n\t\t?>\n\t\t<meta property=\"fb:app_id\" content=\"<? echo APP_ID; ?>\" />\n\t\t<meta property=\"og:title\" content=\"Demo Php Facebook App\"/>\n\t\t<meta property=\"og:site_name\" content=\"michaelreed.org\"/>\n\t\t<meta property=\"og:type\" content=\"\"/>\n\t <meta property=\"og:url\" content=\"\"/>\n\t <meta property=\"og:image\" content=\"\"/>\n\t\t<?\n\t}", "function __setMeta($meta);", "function setMetaTags($title)\n{\n\tglobal $cfg , $mycms;\n?>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"description\" content=\"\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" />\n\t<title><?=$cfg['TITLE']?> - <?=$title?></title>\n\t<link rel=\"icon\" type=\"image/ico\" href=\"images2/fav.png\"/>\n<?\n}", "public function add_some_output()\n {\n echo '<meta name=\"custom_meta\" content=\"Just a test string\">';\n }", "function loadMeta(){\n echo \"<!-- Metadata here -->\\n\";\n ?>\n<meta charset=\"<?php echo $this->charset;?>\"/>\n<meta name=\"viewport\" content=\"<?php echo $this->viewport;?>\"/>\n<?php\n }", "public function addMeta($meta, $value = null, $name = 'name');", "public function set_standard_meta()\n\t{\n\t\t// Meta description.\n\t\t$meta_description = $this->get_meta_description();\n\t\tif (! empty($meta_description)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t'content' => \\esc_attr($meta_description),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $meta_keywords ) ) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'keywords',\n\t\t\t\t\t'content' => esc_attr( implode( ',', array_filter( $meta_keywords ) ) ),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Canoncial url.\n\t\tif (! empty($canonical_url)) {\n\t\t\t$this->set_canonical_url($canonical_url);\n\t\t}\n\n\t\t// Deindex URL.\n\t\tif (absint($deindex_url)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'robots',\n\t\t\t\t\t'content' => 'noindex',\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}", "private function appendMetaTags( AbstractXhtml &$head ) {\n foreach ( $this->metaTags as $meta ) {\n $head->addContent( $meta );\n }\n }", "function seo_insere_remplace_metas($head, $contexte) {\n\n\t$append = '<!--seo_insere-->';\n\t// on ne fait rien si deja insere\n\tif (strpos($head, $append) !== false) {\n\t\treturn $head;\n\t}\n\n\tinclude_spip('inc/config');\n\t$config = lire_config('seo/');\n\t$i = seo_interprete_contexte($contexte);\n\t$is_sommaire = ($i['objet']=='sommaire');\n\n\tif (isset($config['meta_tags']['activate']) and $config['meta_tags']['activate']=='yes') {\n\t\t/* d'abord les meta tags */\n\t\t$meta_tags = seo_generer_meta_tags(null, $contexte);\n\n\t\tforeach ($meta_tags as $key => $meta) {\n\t\t\t$preg = '';\n\t\t\tif ($key=='title') {\n\t\t\t\t/**\n\t\t\t\t * Si le tag est <title>\n\t\t\t\t */\n\t\t\t\t$preg = \"/(<{$key}[^>]*>.*<\\/{$key}[^>]*>)/Uims\";\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Le tag est une <meta>\n\t\t\t\t */\n\t\t\t\t$preg = \"/(<meta\\s+name=['\\\"]{$key}['\\\"][^>]*>)/Uims\";\n\t\t\t}\n\n\t\t\t// remplacer la meta si on la trouve\n\t\t\tif ($preg and preg_match($preg, $head, $match)) {\n\t\t\t\tif (stristr($match[0], \"data-strict\") === FALSE)\n\t\t\t\t\t$head = str_replace($match[0], $meta, $head);\n\t\t\t} else {\n\t\t\t\t$append .= \"$meta\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t/* META GOOGLE WEBMASTER TOOLS */\n\tif (isset($config['webmaster_tools'])\n\t\tand isset($config['webmaster_tools']['activate'])\n\t\tand $config['webmaster_tools']['activate']=='yes'\n\t\tand $is_sommaire) {\n\t\t$append .= \"\\n\" . seo_generer_webmaster_tools();\n\t}\n\n\tif (isset($config['bing'])\n\t\tand isset($config['bing']['activate'])\n\t\tand $config['bing']['activate'] == 'yes'\n\t\tand $is_sommaire) {\n\t\t$append .= \"\\n\" . seo_generer_bing();\n\t}\n\n\t/* CANONICAL URL */\n\tif (isset($config['canonical_url'])\n\t\tand isset($config['canonical_url']['activate'])\n\t\tand $config['canonical_url']['activate']=='yes') {\n\t\t$append .= \"\\n\" . seo_generer_urls_canoniques($contexte);\n\t}\n\n\t/* GOOGLE ANALYTICS */\n\tif (isset($config['analytics'])\n\t\tand isset($config['analytics']['activate'])\n\t\tand $config['analytics']['activate']=='yes') {\n\t\t$append .= \"\\n\" . seo_generer_google_analytics();\n\t}\n\n\t/* ALEXA */\n\tif (isset($config['alexa'])\n\t\tand isset($config['alexa']['activate'])\n\t\tand $config['alexa']['activate'] == 'yes'\n\t\tand $is_sommaire) {\n\t\t$append .= \"\\n\" . seo_generer_alexa();\n\t}\n\n\tif ($append) {\n\t\t$append = \"\\n$append\\n\";\n\t\t// sinon ajouter en fin de </head>\n\t\tif ($p = stripos($head, '</head>')) {\n\t\t\t$head = substr_replace($head, $append, $p, 0);\n\t\t} else {\n\t\t\t$head .= $append;\n\t\t}\n\t}\n\n\treturn $head;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate that idnumber validation works on user create
public function testelisuseridnumbercreate() { global $CFG, $DB; // Create mapping record. $this->create_mapping_record('user', 'idnumber', 'customidnumber'); $this->load_csv_data(); $data = array( 'action' => 'create', 'username' => 'validtestusername', 'customidnumber' => 'testidnumber', 'password' => 'Rlippassword!0', 'firstname' => 'rlipfirstname', 'lastname' => 'rliplastname', 'email' => 'validtest@user.com', 'city' => 'Waterloo', 'country' => 'CA' ); $expectederror = "[user.csv line 2] User with username \"validtestusername\", email \"validtest@user.com\", idnumber"; $expectederror .= " \"testidnumber\" could not be created. customidnumber value of \"testidnumber\" refers to a user that"; $expectederror .= " already exists.\n"; $this->assert_data_produces_error($data, $expectederror, 'user'); }
[ "private function validateUserID(){\n if(is_numeric($this->user_id)){\n return true;\n }else{\n return false;\n }\n }", "function AJvalidateUserid() {\n\t$user = processInputVar('user', ARG_STRING);\n\tif(validateUserid($user))\n\t\tsendJSON(array('status' => 'valid'));\n\telse\n\t\tsendJSON(array('status' => 'invalid'));\n}", "public function validateId(){\n \n return preg_match(Config::$id_format, $this->id);\n }", "public function testValidationForUserId(): void\n {\n $errors = $this->Posts->newEntity(['user_id' => 'string'] + $this->example['Posts'])->getErrors();\n $this->assertEquals(['user_id' => ['naturalNumber' => I18N_SELECT_VALID_OPTION]], $errors);\n }", "public function ValidId()\r\n\t{\r\n\t\t$id = (int)$this->GetId();\r\n\t\tif ($id > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function validateID( $inId ) {\n\t//cannot be empty\n\t\n\tif( empty($inId) ) {\n\t\treturn false;\t//Failed validation\n\t}elseif(\t!preg_match(\"/^\\d+$/\", $inId )){\n\t\treturn false;\t//Failed validation\n\t}\telse {\n\t\treturn true;\t//Passes validation\t\n\t}\t\n}", "function validateIdNumber($idNumber, $name)\n\t\t{\n\t\t\t// include the Id Number Validator Class and validate the id number\n\t\t\tinclude(\"class_libraries/IdNumberValidator.php\");\n\t\t\t$idValidator = new IdNumberValidator();\n\t\t\t\n\t\t\t// validate the id number\n\t\t\t$result = $idValidator -> validateIdNumber($idNumber, $name);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return it\n\t\t\t\treturn $idValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "private function validateIdentifiers() {\n // validate user id\n if(($this->userId === false) || !preg_match('/^([a-z0-9]+)$/', $this->userId)) {\n return false;\n }\n\n // validate album id\n if(($this->albumId === false) || !preg_match('/^([0-9]+)$/', $this->albumId)) {\n return false;\n }\n\n return true;\n }", "function validateIdNumber($idNumber, $name)\n {\n //include the id number validator class to validate the id number and the name of the student if it matches\n include(\"../includes/class_libraries/IdNumberValidator.php\");\n $idNumberValidator = new IdNumberValidator();\n \n // validate the id number\n $result = $idNumberValidator -> validateIdNumber($idNumber, $name);\n \n // check the result if there is an error committed\n if($result == false)\n {\n // get the error and and return the error\n return $idNumberValidator -> getErrors();\n }\n \n return;\n }", "function validate_ID($id)\r\n{\r\n $pattern = \"/^[0-9]{3}$/\";\r\n return preg_match($pattern, $id);\r\n}", "public function id($data){\n\t\t$valid = false;\n\t\t//8 max digits, 2 min\n\t\t$regexp = \"^[[:digit:]]{1,11}$\";\n\t\t \t\n\t\tif(is_numeric($data) && eregi($regexp, $data))\n\t\t\t$valid = true;\n\t\t \t\t\n\t\treturn $valid; \t\n\t }", "function studentIDValid($id)\n{\n\t\n\t\n\tif(strlen($id)==8 && ctype_digit($id))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function setId_Validator($nValue){\n\t\t//security on null guy !!!\n\t\tif($nValue == null)\n\t\t\treturn false;\n\t\t//security on type guy !!!\n\t\tif(getType($nValue) == 'integer'){\n\t\t\t $this->members[\"nId_Validator\"] = $nValue;\n\t\t\t//Happy end\n\t\t\treturn true;\n\t\t}\n\t\t//Don't fool me next Time !!!\n\t\treturn false;\n\t}", "private function __validate_id() {\n if ($this->validate_id === false) {\n } elseif (isset($this->initial_data[\"id\"])) {\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"hosts\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2016);\n }\n } else {\n $this->errors[] = APIResponse\\get(2015);\n }\n }", "function is_valid_user($user_id) {\n $pre_str = \"usr\";\n if ((strpos($user_id, $pre_str) === false) ||\n (strpos($user_id, $pre_str) != 0)) {\n throw new PrefixException('$user_id does not contain the proper prefix.');\n }\n\n // throw an exception if the user ID is not the proper length\n if ((strlen($user_id) < 9)) {\n throw new LengthException('$user_id is less than the required length.');\n }\n\n if (validate($user_id)) {\n // user ID was found in the database\n return true;\n } else {\n // the specified user ID does not exist in the database\n return false;\n }\n\n}", "public static\tfunction validarID($id){\n \t /*Chequeo si el identificador es numerico*/\n \t $permitidos = \"0123456789\"; \n for ($i=0; $i < strlen($id); $i++)\n { \n if (strpos($permitidos, substr($id,$i,1)) === false)\n { \n /*Si no es así, devuelvo que el usuario es invalido*/\n return FALSE; \n } \n }\n \t return TRUE;\n \t}", "public function setIdValidationRule()\n {\n $this->rules[self::$ID_KEY] = ['required', 'integer', 'exists:experiment_sessions'];\n }", "public function validate_id(string $id): bool {\n //check if not a name is given instate of an id\n if( !($this->nameisfree($id)) ) {\n if( !(ctype_xdigit($id)) or strlen($id)!==12 ) {\n return false;\n }\n return false;\n\t\t}\n return true;\n\t}", "public function testNotValidIDCardNumber()\n {\n $this->assertFalse($this->rule->passes('id_card_number', 'ATL0000'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getParkRoll todo: cache this query large table
static function getParkRoll($limit=10, $offset=0) { $query = DB::select()->from('park_roll')->where('found','=',' ')->limit($limit)->offset($offset); $results = $query->execute(); return $results; }
[ "function sqlGetPark(){\n\t\tglobal $database, $location, $suburbs, $parkId, $currentPark;\n\t\t\n\t\ttry {\n\t\t\t$currentPark = [];\n\t\t\t$sql = \"SELECT * FROM parks WHERE parkId = :parkId\";\n\t\t\t$stmt = $database->prepare($sql);\n\t\t\t$stmt->bindParam(\":parkId\", $parkId);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\tif ($stmt->rowCount() > 0){\n\t\t\t\t$currentPark = $stmt->fetchAll();\n\t\t\t}\t\n\t\t}\n\t\tcatch (PDOException $e){\n\t\t\techo \"Error: \" . $e->getMessage();\n\t\t}\n\t}", "function getRelieverPitchingData(\n $season,\n $ds,\n $table,\n $starter_reliever,\n $pitcher_ds\n) {\n $pitcher_season = substr($pitcher_ds, 0, 4);\n $query =\n \"SELECT b.last_team as player_id,\n sum(a.total_outs) as total_outs,\n sum(a.total_games) as total_games,\n sum(a.singles) as singles,\n sum(a.doubles) as doubles,\n sum(a.triples) as triples,\n sum(a.home_runs) as home_runs,\n sum(a.walks) as walks,\n sum(a.strikeouts) as strikeouts,\n sum(a.ground_outs) as ground_outs,\n sum(a.fly_outs) as fly_outs,\n sum(a.plate_appearances) as plate_appearances,\n a.split,\n a.season,\n a.ds\n FROM $table a\n RIGHT OUTER JOIN retrosheet_historical_pitching b\n ON a.player_id = b.player_id\n AND b.season = $pitcher_season\n AND b.ds = '$pitcher_ds'\n AND b.split = 'Total'\n AND b.pitcher_type = 'R'\n WHERE a.season = $season\n AND a.pitcher_type = 'R'\n AND a.ds = '$ds'\n AND b.last_team is not null\n GROUP BY b.last_team, a.split, b.season, b.ds\";\n $season_data = exe_sql(DATABASE, $query);\n return index_by($season_data, 'player_id', 'split');\n}", "public function getParks() {\n if (isset($this->parks)) return $this->parks;\n else {\n $res = $this->query(\"SELECT * FROM `park`\");\n $parks = array();\n while($row = mysql_fetch_assoc($res)) {\n $park = new Entity($row[\"park_id\"], $row[\"park_name\"]);\n $parks[$row[\"park_id\"]] = $park;\n }\n $this->parks = $parks;\n return $parks;\n }\n\t\t}", "protected function getOptimizableTables() {}", "function loadLedger($year,$id){\r\n$sql = \"SELECT payroll.*, employee.employeeName FROM payroll, employee WHERE payroll.employeeId='$id' AND employee.employeeId='$id' AND payroll.year= '$year' ORDER BY sn DESC\";\r\nreturn $this->query($sql);\r\n}", "function getParkById($id)\r\n {\r\n //Create the select statement\r\n $select = 'SELECT id, park_name, location, num_ratings, sum_ratings, features, description\r\n FROM parks WHERE id=:id';\r\n \r\n //prepare the statement and bind the id\r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':id', $id, PDO::PARAM_INT);\r\n $statement->execute();\r\n \r\n \r\n $result = $statement->fetch(PDO::FETCH_ASSOC);\r\n \r\n if($result['num_ratings'] != 0) {\r\n $result['rating'] = floor($result['sum_ratings'] / $result['num_ratings']);\r\n } else {\r\n $result['rating'] = 0;\r\n }\r\n \r\n $result['features'] = explode(', ', $result['features']);\r\n \r\n //return the array holding the info pulled from the database \r\n return $result;\r\n }", "function getParkingSpot($db) {\n $sql = \"SELECT `parking_spot_id` FROM `parking_spot`\n WHERE `status` = 0 \n AND `ticket_id` IS NULL\n LIMIT 1\";\n $stmt = $db -> prepare ($sql);\n $stmt -> execute ();\n while ($row = $stmt -> fetch()) {\n return $row['parking_spot_id'];\n }\n }", "public function getAllParkingPasses(){\n $this->db->query(\"\n SELECT * \n FROM Parking_Pass;\n \");\n\n // ASSIGN RESULT SET\n $results = $this->db->resultSet();\n return $results;\n }", "public function getGadetUserPark($uid)\n {\n \t$sql = \"SELECT c.cav_name,p.car_color,p.location FROM parking AS p,parking_car AS c \n \t\t\tWHERE p.car_id=c.cid AND p.parking_uid=:uid\";\n \t\n \treturn $this->_rdb->fetchAll($sql,array('uid'=>$uid));\n }", "function getLockedTrips($year) {\n\n\t\t$obj_id = $this->guide_id;\n\t\t//$obj_id = 10;\n\n $query = 'SELECT DISTINCT `trip_id_fk`\n FROM `approvals`\n WHERE `trip_id_fk` IS NOT NULL\n AND `locked` IS NOT NULL\n AND `user_id_fk` = :user_id_fk\n AND EXTRACT(YEAR FROM `event_date`) = :year\n ORDER BY `event_date` ASC';\n\n $result = $this->db->select($query, array( 'user_id_fk' => $obj_id, 'year' => $year));\n\n\t\treturn $result;\n\t\t//return \"Here\";\n\n\t}", "function getRiwayatTransaksiPelangganByIdLogin() {\r\n\r\n $id_login = $this->session->userdata('sess_idlogin');\r\n $sql = \"SELECT riwayat_transaksi.*, data_pelanggan.no_ref, data_pelanggan.nama \r\n FROM riwayat_transaksi \r\n JOIN data_pelanggan ON riwayat_transaksi.no_ref = data_pelanggan.no_ref \r\n \r\n WHERE riwayat_transaksi.id_login = '$id_login' \r\n ORDER BY created_at DESC LIMIT 5\";\r\n\r\n // exec query builder \r\n $query = $this->db->query( $sql );\r\n\r\n return $query;\r\n\r\n }", "function lowStock()\n\t{\n\t $sql=\"select count(*) as cnt from product_inventory_table where rol>=soh\";\n\t\t $obj = new Bin_Query();\n\t\tif($obj->executeQuery($sql))\n\t\t{\t\t\n\t\t\t $output=$obj->records[0]['cnt'];\n\t\t\t\treturn $output;\n\t\t} \n\t}", "function get_arrests_by_poi($poiID)\n {\n global $conn;\n //query the database to select all data from the qp_arrest_warrant table and some data from qp_poi and qp_station by poiID and status arrest (1)\n $sql = 'SELECT qp_arrest_warrant.*, qp_poi.firstName AS poiFirstName, qp_poi.lastName AS poiLastName, qp_station.name AS stationName FROM qp_arrest_warrant INNER JOIN qp_poi USING (poiID) INNER JOIN qp_station USING (stationID) WHERE status = 1 AND qp_arrest_warrant.poiID = :poiID ORDER BY updatedDate';\n //use a prepared statement to enhance security\n $statement = $conn->prepare($sql);\n $statement->bindValue(':poiID', $poiID);\n $statement->execute();\n $result = $statement->fetchAll();\n $statement->closeCursor();\n return $result;\n }", "function getParks ($dbc, $limit, $offset) {\n $stmt = $dbc->prepare('SELECT * FROM national_parks LIMIT :limit OFFSET :offset;');\n $stmt->bindValue(':limit', $limit, PDO::PARAM_INT);\n $stmt->bindValue(':offset', $offset, PDO::PARAM_INT);\n $stmt->execute();\n $allTheRows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $allTheRows;\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM dbmc.evs_position_level\n\t\t\t\tWHERE evs_position_level.psl_id=?\";\n\t\t$query = $this->db->query($sql, array($this->psl_id));\n\t\treturn $query;\n\t}", "public function getPauperData(){\n $sql = \"select * from tournaments\n where format_tournament = 'pauper'\n order by tstamp DESC \n limit 5;\";\n\n $this->db->query($sql);\n\n //Assign Result Set\n $results = $this->db->resultSet();\n\n return $results;\n }", "function get_izin_rute_data_by_airlines_regulator($params) {\n $sql = \"SELECT \n airlines_nm, izin_rute_start, izin_rute_end, MAX(masa_berlaku)'masa_berlaku', tipe, capacity, SUM(frekuensi)'total_frekuensi',\n SUM((IF(pairing = 'VV', frekuensi * 2, frekuensi) * capacity))'kapasitas_week',\n SUM(((IF(pairing = 'VV', frekuensi * 2, frekuensi) * capacity) * 52))'kapasitas_year',\n SUM(penerbangan)'total_penerbangan', pairing\n FROM \n (\n SELECT d.airlines_nm, b.izin_id, b.izin_rute_start, b.izin_rute_end, MAX(b.izin_expired_date)'masa_berlaku',\n b.pairing, MAX(a.tipe)'tipe', MAX(a.capacity)'capacity', MAX(GET_FREKUENSI_TOTAL(a.izin_id, a.flight_no))'frekuensi',\n COUNT(flight_no)'penerbangan'\n FROM izin_data a\n INNER JOIN izin_rute b ON a.izin_id = b.izin_id\n INNER JOIN izin_registrasi c ON b.registrasi_id = c.registrasi_id\n INNER JOIN airlines d ON b.airlines_id = d.airlines_id\n WHERE b.airlines_id = ? AND b.izin_flight = ? AND c.izin_season LIKE ?\n AND b.izin_completed = '1' AND b.izin_approval = 'approved' AND b.izin_active = '1'\n GROUP BY a.izin_id\n ) result\n WHERE masa_berlaku >= ? \n AND (izin_rute_start LIKE ? OR izin_rute_end LIKE ?)\n GROUP BY izin_rute_start, izin_rute_end\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getManyRow($sql) {\n }", "public function getDataPeg1($id){\r\n //$q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n $q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n $query = $this->db->query($q)->row();\r\n \r\n return $query;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up places_number property.
private function setUpPlacesNumber() { $this->places_number = $this->columns_number * $this->rows_number; }
[ "public function setNbPlaces($nb_places)\n {\n $this->nb_places = $nb_places;\n\n return $this;\n }", "function getPlaceNum( )\n\t{\n\t\treturn $this->getDbCol( \"placenum\" );\n\t}", "protected function initNumbering()\n {\n $this->numbering = !isset($this->json->numbering)\n ? 'decimal'\n : $this->json->numbering;\n }", "public function initializeNumberPersons()\n {\n if(empty($this->numberPersons))\n {\n $this->numberPersons = $this->fixedNumberPersons;\n }\n }", "public function settingsNumber()\n {\n echo '<input type=\"number\" name=\"lbwpRelatedPostsNumber\" id=\"lbwpRelatedPostsNumber\" value=\"' . get_option('lbwpRelatedPostsNumber') . '\" class=\"small-text\">';\n }", "private function setUpGapsNumber()\n\t{\n\t\t$is_no_gaps_needed = ($this->items_number % $this->columns_number !== 0);\n\t\t\n\t\t$this->gaps_number = ($is_no_gaps_needed) ? $this->columns_number - ($this->items_number % $this->columns_number) : 0;\n\t}", "public function getNbPlaces()\n {\n return $this->nb_places;\n }", "function set_invoice_number(){\n if (!isset($this->number)) {\n $this->set('number', $this->get_default_invoice_number());\n }\n }", "public static function numberProps()\n {\n }", "public function setStreetNo($value){\n\t\t\t$this->street_no = $value;\n\t\t}", "protected function makeSortnumber()\n {\n $tmp = explode('.', $this->bean->name);\n $sortnumber = $this->bean->name;\n if (isset($tmp[0])) {\n if ($tmp[0] >= 30) {\n $aYear = '19' . $tmp[0];\n } else {\n $aYear = '20' . $tmp[0];\n }\n $sortnumber = $aYear;\n if (isset($tmp[1])) {\n $sortnumber .= $tmp[1];\n }\n }\n $this->bean->sortnumber = $sortnumber;\n }", "public function getTotalnbplace(): int\n {\n return $this->totalnbplace;\n }", "private function setInvoiceNumber()\n {\n if (isset($this->purchase->invoice_no)) {\n $this->invoiceNumber = $this->purchase->invoice_no;\n } else {\n $this->invoiceNumber = Purchase::count() ? Purchase::latest()->first()->invoice_no + 1 : 1; // take the last invoice number from database and increment by 1\n $this->invoiceNumber = str_pad($this->invoiceNumber, 4, '0', STR_PAD_LEFT); // add prefix if number is to sort\n }\n }", "function get_order_number() {\r\n\t\treturn apply_filters( 'learn_press_get_order_number', '#' . sprintf( \"%'.010d\", $this->id ), $this );\r\n\t}", "public function set_house_number( $house_number )\n{\n $this->house_number = $house_number;\n}", "protected function setNumberGenerator()\n {\n $this->transactionGenerator = $this->store->get('mpesa.transaction_id_handler');\n }", "public function setNumber($mines)\n {\n\t\t$this->type = GameObject::TYPE_NUMBER;\n\t\t$this->number = $mines;\n\t}", "public function setPoNumber($poNumber);", "private function setNumber($number)\n {\n $this->number = $number;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the contents directory path.
function get_contents_path ($contents_dir_name) { return CONTENTS_PATH . '/' . $contents_dir_name; }
[ "public function contentFileDirectory(): string\n {\n return dirname($this->root());\n }", "public static function get_content_dir() {\n\t\tif ( ! defined( 'WP_CONTENT_DIR' ) ) {\n\t\t\treturn FileSystem::path_join( PHP::getcwd(), 'wp-content' );\n\t\t} else {\n\t\t\treturn FileSystem::normalize_path( WP_CONTENT_DIR );\n\t\t}\n\t}", "public function getContentDir()\n {\n if ($this->contentDir == '') {\n return APP_PATH . DIRECTORY_SEPARATOR . 'content';\n }\n\n return $this->contentDir;\n }", "public function getContentPath()\n {\n return $this->contentPath;\n }", "function wp_content_dir() {\n return $this->find_folder(WP_CONTENT_DIR);\n }", "public static function ContentFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'Content';\n }", "function getFullPath(){\nreturn getcwd();\n}", "public function getPathToSiteFiles()\n {\n return sprintf('%s/../../httpdocs', __DIR__);\n }", "public function wp_content_dir() {}", "public function getHarvestedPath()\n {\n $harvestedContentDir = \\ANDS\\Util\\config::get('app.harvested_contents_path');\n \n $harvestedContentDir = rtrim($harvestedContentDir, '/') . '/';\n return $harvestedContentDir . $this->getTaskData('dataSourceID') . '/' . $this->getTaskData('batchID');\n }", "public function getDirectory()\n {\n $prefixDir = intval(floor($this->getKey() / 1000));\n\n return storage_path(\"app/attachments/{$prefixDir}\");\n }", "public function getDirectory() {\n return $this->orm->getDependencyInjector()->get('ride\\\\library\\\\system\\\\file\\\\File', 'assets');\n }", "protected function getGeneratedContentPath()\n {\n return __DIR__ . DIRECTORY_SEPARATOR . 'Generated';\n }", "private function getContentThumbnailBaseDir(): string\n {\n return realpath(StandaloneHelper::rootDir() . '/web/static/img/contents/');\n }", "public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }", "public function getFullPath(): string;", "public function getFileDir()\n {\n return($this->fileDir);\n }", "public function wp_content_dir()\n {\n }", "public function wp_content_dir()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Theme individual newsfeed event.
function theme_newsfeed_event($item, $op='normal') { $event_date = date('j M y', $item['timestamp']); $user_name = $item['user_name']; //l($item['user_name'], 'user/'.$item['uid']); $event_name = afo_newsfeed_event_convert($item['type_id']); if(strlen($item['arg0_filepath']) > 0) { $arg0_data = array( 'nid' => $item['arg0_nid'], 'title' => $item['arg0_title'], 'image' => $item['arg0_filepath'], 'name' => $item['name'], ); } switch($event_name) { case 'create node': $nid = $item['arg0']; $node_type = $item['arg1']; $destination = "node/$nid"; $thumb_data = is_array($arg0_data) ? $arg0_data : $nid; $thumbnail = theme('afo_display_node_thumbnail', $thumb_data, null, $destination); if($op=='short') { if($node_type == 'artwork') $event_description = "Added new $node_type."; else $event_description = "Added a new $node_type."; } else { $node_type_name = str_replace('_', ' ', $node_type); if($node_type == 'artwork') $event_description = "$user_name added new $node_type_name."; else $event_description = "$user_name added a new $node_type_name."; } //$link = l(t('View »'), $destination); break; case 'included in exhibition': $item_nid = $item['arg0']; $exhibition_nid = $item['arg1']; $destination = "node/$exhibition_nid"; $thumb_data = is_array($arg0_data) ? $arg0_data : $item_nid; $thumbnail = theme('afo_display_node_thumbnail', $thumb_data, null, $destination); if($op=='short') { $event_description = "Included in exhibition."; } else { $event_description = "{$user_name}'s artwork was included in an exhibition."; } //$link = l(t('View »'), $destination); break; case 'added to exhibition': $item_nid = $item['arg0']; $exhibition_nid = $item['arg1']; $destination = "node/$exhibition_nid"; $thumb_data = is_array($arg0_data) ? $arg0_data : $item_nid; $thumbnail = theme('afo_display_node_thumbnail', $thumb_data, null, $destination); if($op=='short') { $event_description = "Added to their exhibition."; } else { $event_description = "{$user_name} added to an exhibition."; } //$link = l(t('View »'), $destination); break; case 'user featured': $uid = $item['arg0']; $feature_name = $item['arg2']; $destination = "user/$uid"; $thumbnail = theme('afo_display_user_thumbnail', $uid, null, $destination); if($op=='short') { $event_description = "Featured"; if($feature_name) $event_description .= " in the $feature_name"; $event_description .= '.'; } else { $event_description = "{$user_name} was featured"; if($feature_name) $event_description .= " in the $feature_name"; $event_description .= '.'; } //$link = l(t('View »'), $destination); break; case 'node featured': $nid = $item['arg0']; $feature_name = $item['arg2']; $destination = "node/$nid"; $thumb_data = is_array($arg0_data) ? $arg0_data : $nid; $thumbnail = theme('afo_display_node_thumbnail', $thumb_data, null, $destination); if($op=='short') { $event_description = "Featured"; if($feature_name) $event_description .= " in the $feature_name"; $event_description .= '.'; } else { $event_description = "{$user_name}'s work was featured"; if($feature_name) $event_description .= " in the $feature_name"; $event_description .= '.'; } //$link = l(t('View »'), $destination); break; } /* if(!$thumbnail) { dsm('Newsfeed Thumbnail missing for following item.'); dsm($item); }; */ $content = ''; $content .= '<div class="item">'; $content .= $thumbnail; $content .= '<div class="details js-hide"><div class="details-inner">'; $content .= "<div class='date'>$event_date</div>"; $content .= t($event_description); $content .= '</div></div>'; $content .= '</div>'; return $content; }
[ "function iahm_event_rss_render() {\n\tget_template_part( 'feed', 'event' );\n}", "function wd_news() {\n\t\t\tinclude_once( ABSPATH . WPINC . '/feed.php' );\n\t\t\tif ( $rssobj = fetch_feed( 'https://webdesires.co.uk/feed/' ) ) {\n\t\t\t\t\n\t\t\t\t$content = '<ul>';\n\t\t\t\t$maxitems = $rssobj->get_item_quantity( 5 ); \n\n\t\t\t\t// Build an array of all the items, starting with element 0 (first element).\n\t\t\t\t$rss = $rssobj->get_items( 0, $maxitems );\n\t\t\t\t\n\t\t\t\tforeach ( $rss as $item ) {\n\t\t\t\t\t$content .= '<li class=\"schema\">';\n\t\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.clean_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\n\t\t\t\t\t$content .= '</li>';\n\t\t\t\t}\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', $content);\n\t\t\t} else {\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', 'Nothing to say...');\n\t\t\t}\n\t\t}", "public function oceanwp_news_output() {\n\t\t\t$this->oceanwp_rss_output( self::$feed );\n\t\t}", "function news() {\r\n\t\tinclude_once(ABSPATH . WPINC . '/feed.php');\r\n\t\t$rss = fetch_feed('http://feeds2.feedburner.com/ivankristianto');\r\n\t\t$rss_items = $rss->get_items( 0, $rss->get_item_quantity(5) );\r\n\t\t$content = '<ul>';\r\n\t\tif ( !$rss_items ) {\r\n\t\t\t$content .= '<li class=\"ivankristianto\">no news items, feed might be broken...</li>';\r\n\t\t} else {\r\n\t\t\tforeach ( $rss_items as $item ) {\r\n\t\t\t\t$content .= '<li class=\"ivankristianto\">';\r\n\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.esc_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\r\n\t\t\t\t$content .= '</li>';\r\n\t\t\t}\r\n\t\t}\t\t\t\t\t\t\r\n\t\t$content .= '<li class=\"rss\"><a href=\"http://feeds2.feedburner.com/ivankristianto\">Subscribe with RSS</a></li>';\r\n\t\t//$content .= '<li class=\"email\"><a href=\"http://ivankristianto.com/email-blog-updates/\">Subscribe by email</a></li>';\r\n\t\t$content .= '</ul>';\r\n\t\t$this->postbox('ivankristiantolatest', 'Latest from IvanKristianto.com', $content);\r\n\t}", "function do_feed_rss() {}", "function zerif_after_latest_news_trigger() {\n\tdo_action( 'zerif_after_latest_news' );\n}", "public function css_tricks_custom_feeds() {\n\t\tadd_feed( 'email', array( $this, 'get_me_the_email_feed_template' ) );\n\t}", "function my_custom_rss_render() {\n add_feed( 'marko', 'myRssFeed' ); \n}", "function gcm_feeds_tpl(){\n add_feed('whats', 'whats_feeds_render');\n add_feed('concerts', 'concerts_feeds_render');\n add_feed('community', 'community_feeds_render');\n add_feed('events', 'events_feed_render');\n}", "public function makeEvent() {\n $dom = ZLanguage::getModuleDomain('PostCalendar');\n\n $funcargs = array('objectid' => $this->getHooked_objectid(),\n 'SQLcache' => false);\n $article = ModUtil::apiFunc('News', 'user', 'get', $funcargs);\n\n $eventstatus = 1; // approved\n if ($article['published_status'] != News_Api_User::STATUS_PUBLISHED) { // article not published yet (draft, etc)\n return false;\n }\n\n $now = DateUtil::getDatetime(null, '%Y-%m-%d %H:%M:%S');\n $diff = DateUtil::getDatetimeDiff_AsField($now, $article['from'], 6);\n if ($diff > 0) {\n $eventstatus = -1; // hide published but pending events\n }\n\n $this->title = __('News: ', $dom) . $article['title'];\n $this->hometext = \":html:\" . __('Article link: ', $dom) . \"<a href='\" . ModUtil::url('News', 'user', 'display', array('sid' => $article['sid'])) . \"'>\" . substr($article['hometext'], 0, 32) . \"...</a>\";\n $this->aid = $article['cr_uid']; // userid of creator\n $this->time = $article['cr_date']; // mysql timestamp YYYY-MM-DD HH:MM:SS\n $this->informant = $article['cr_uid']; // userid of creator\n $this->eventDate = substr($article['from'], 0, 10); // date of event: YYYY-MM-DD\n $this->startTime = substr($article['from'], -8); // time of event: HH:MM:SS\n $this->eventstatus = $eventstatus;\n\n return true;\n }", "function add_calendar_feed(){\n\tadd_feed('kalender.ics', 'createcal');\n // Only uncomment these 2 lines the first time you load this script, to update WP rewrite rules\n\t//global $wp_rewrite;\n //$wp_rewrite->flush_rules( false );\n}", "function my_calendar_add_feed() {\n\tadd_feed( 'my-calendar-rss', 'my_calendar_rss' );\n\tadd_feed( 'my-calendar-ics', 'my_calendar_ical' );\n\tadd_feed( 'my-calendar-google', 'mc_ics_subscribe_google' );\n\tadd_feed( 'my-calendar-outlook', 'mc_ics_subscribe_outlook' );\n}", "function the_upcoming_service_feed() {\n add_feed('upcomingservices', 'upcoming_services_feed');\n}", "protected function addNewsfeedsToLayout()\n\t{\n\t\tif(!$GLOBALS['objPage']->layout)\n\t\t{\n\t\t\t$objLayout = $this->Database->prepare('SELECT news4ward_feeds FROM tl_layout WHERE fallback=\"1\"')->limit(1)->execute();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$objLayout = $this->Database->prepare('SELECT news4ward_feeds FROM tl_layout WHERE id=?')->limit(1)->execute($GLOBALS['objPage']->layout);\n\t\t}\n\n\t\tif(!$objLayout->numRows) return;\n\n\t\t$arrNews4wardIDs = deserialize($objLayout->news4ward_feeds,true);\n\t\tif(empty($arrNews4wardIDs)) return;\n\n\t\t$objNews4ward = $this->Database->prepare('SELECT feedBase,alias,format,title FROM tl_news4ward WHERE FIND_IN_SET(id,?) AND makeFeed=\"1\"')->execute(implode(',',$arrNews4wardIDs));\n\t\tif(!$objNews4ward->numRows) return;\n\n\t\t$strTagEnding = ($GLOBALS['objPage']->outputFormat == 'xhtml') ? ' />' : '>';\n\n\t\twhile($objNews4ward->next())\n\t\t{\n\t\t\t$base = strlen($objNews4ward->feedBase) ? $objNews4ward->feedBase : $this->Environment->base;\n\t\t\t$GLOBALS['TL_HEAD'][] = '<link rel=\"alternate\" href=\"' . $base . $objNews4ward->alias . '.xml\" type=\"application/' . $objNews4ward->format . '+xml\" title=\"' . $objNews4ward->title . '\"' . $strTagEnding . \"\\n\";\n\t\t}\n\n\t}", "function wpfc_sermon_podcast_feed() {\n\n\tload_template( WPFC_SERMONS . 'includes/podcast-feed.php');\n}", "public static function generateRssFeeds()\n {\n $newsmanager = new NewsManager();\n if (count(rex_clang::getAll()) >= 1) {\n foreach (rex_clang::getAll() as $key => $lang) {\n if ($lang->isOnline()) {\n $newsmanager->generateRssFeed($lang);\n }\n }\n }\n }", "function renderJEventsNews()\n\t{\n\n\t\t$cache = Factory::getCache(JEV_COM_COMPONENT, 'view');\n\t\t$cache->setLifeTime(86400);\n\t\t// In Joomla 1.7 caching of feeds doesn't work!\n\t\t$cache->setCaching(true);\n\n\t\t$app = Factory::getApplication();\n\t\tif (!isset($app->registeredurlparams))\n\t\t{\n\t\t\t$app->registeredurlparams = new stdClass();\n\t\t}\n\n\t\t$cache->get($this, 'renderJEventsNewsCached');\n\n\t}", "abstract protected function publishFeedStory();", "public function rss_updates()\n\t{\n\t\t$info = array(\n\t\t\t'title' \t\t=> 'Chocobo Riding - Mises à jour',\n\t\t\t'link'\t\t\t=> 'http://chocobo-riding.menencia.com',\n\t\t\t'description' \t=> \"Fil RSS des mises à jour de Chocobo Riding.\");\n\t\t$items = array();\n\t\t\n\t\t$topics = ORM::factory('topic')\n\t\t\t->where('theme_id', 1)\n\t\t\t->where('status', 0)\n\t\t\t->orderby('created', 'desc')\n\t\t\t->find_all(20);\n\t\t\n\t\tforeach ($topics as $topic)\n\t\t{\n\t\t \t$comment = $topic->comments[0];\n\t\t \t\n\t\t \t$items[] = array(\n\t\t \t\t'title'\t\t\t=> $topic->title,\n\t\t \t'link' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'guid' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'description' \t=> nl2br($comment->content),\n\t\t \t//'author' \t\t=> $post->user->username,\n\t\t \t'pubDate' \t=> date('D\\, j M Y H\\:i\\:s ', $topic->created).\"+0400\"\n\t\t );\n\t\t}\n\t\t\n\t\techo feed::create($info, $items);\n\t\t$this->profiler = null;\n $this->auto_render = false;\n header(\"content-type: application/xml\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Gets the 'liip_imagine.binary.loader.prototype.filesystem' service. This service is shared. This method always returns the same instance of the service.
protected function getLiipImagine_Binary_Loader_Prototype_FilesystemService() { return $this->services['liip_imagine.binary.loader.prototype.filesystem'] = new \Liip\ImagineBundle\Binary\Loader\FileSystemLoader($this->get('liip_imagine.mime_type_guesser'), $this->get('liip_imagine.extension_guesser'), '', ''); }
[ "protected function getLiipImagine_Binary_Loader_Prototype_FilesystemService()\n {\n return $this->services['liip_imagine.binary.loader.prototype.filesystem'] = new \\Liip\\ImagineBundle\\Binary\\Loader\\FileSystemLoader(${($_ = isset($this->services['liip_imagine.mime_type_guesser']) ? $this->services['liip_imagine.mime_type_guesser'] : $this->get('liip_imagine.mime_type_guesser')) && false ?: '_'}, ${($_ = isset($this->services['liip_imagine.extension_guesser']) ? $this->services['liip_imagine.extension_guesser'] : $this->get('liip_imagine.extension_guesser')) && false ?: '_'}, '', '');\n }", "protected function getFilesystemService()\n {\n return $this->services['filesystem'] = new \\Symfony\\Component\\Filesystem\\Filesystem();\n }", "protected function getSonata_Media_Filesystem_LocalService()\n {\n return $this->services['sonata.media.filesystem.local'] = new \\Gaufrette\\Filesystem($this->get('sonata.media.adapter.filesystem.local'));\n }", "protected function getOneupFlysystem_FileFilesystemFilesystemService()\n {\n return $this->services['oneup_flysystem.file_filesystem_filesystem'] = new \\League\\Flysystem\\Filesystem(new \\League\\Flysystem\\AwsS3v3\\AwsS3Adapter(($this->privates['app.s3_client'] ?? $this->getApp_S3ClientService()), $this->getEnv('AWS_S3_BUCKET_FILE_NAME'), NULL, []), ['visibility' => 'public', 'disable_asserts' => false]);\n }", "public function getLoaderFilesystem()\n {\n return $this->loaderFilesystem;\n }", "protected function getSonata_Media_Filesystem_LocalService()\n {\n return $this->services['sonata.media.filesystem.local'] = new \\Gaufrette\\Filesystem(${($_ = isset($this->services['sonata.media.adapter.filesystem.local']) ? $this->services['sonata.media.adapter.filesystem.local'] : $this->get('sonata.media.adapter.filesystem.local')) && false ?: '_'});\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\phpbb\\routing\\file_locator(${($_ = isset($this->services['filesystem']) ? $this->services['filesystem'] : ($this->services['filesystem'] = new \\phpbb\\filesystem\\filesystem())) && false ?: '_'}, './../');\n }", "public function get_filesystem()\n\t{\n\t\treturn $this->filesystem;\n\t}", "protected function getFileSystem() {\n return new Filesystem();\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\phpbb\\routing\\file_locator($this->get('filesystem'), './../');\n }", "protected function getFilesystemLoader() : PregMatchFilteredLoaderInterface\n {\n return $this->filesystemLoader;\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator($this->get('kernel'), '/var/www/htdocs/symfony/2.0.4-fp/app/Resources');\n }", "public function getFilesystem()\n {\n if (!isset($this->filesystem))\n {\n $this->filesystem = new sfFilesystem();\n }\n\n return $this->filesystem;\n }", "public function getFilesystemManager();", "protected function filesystem()\n {\n return $this->app->make(Filesystem::class);\n }", "protected function getLiipImagine_Binary_Loader_DefaultService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\liip\\\\imagine-bundle\\\\Binary\\\\Loader\\\\LoaderInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\liip\\\\imagine-bundle\\\\Binary\\\\Loader\\\\FileSystemLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\mime\\\\MimeTypeGuesserInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\mime\\\\MimeTypesInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\mime\\\\MimeTypes.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\liip\\\\imagine-bundle\\\\Binary\\\\Locator\\\\LocatorInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\liip\\\\imagine-bundle\\\\Binary\\\\Locator\\\\FileSystemLocator.php';\n\n $a = \\Symfony\\Component\\Mime\\MimeTypes::getDefault();\n\n return $this->services['liip_imagine.binary.loader.default'] = new \\Liip\\ImagineBundle\\Binary\\Loader\\FileSystemLoader($a, $a, new \\Liip\\ImagineBundle\\Binary\\Locator\\FileSystemLocator([0 => (\\dirname(__DIR__, 4).'/public')], false));\n }", "protected function getFileLocatorService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/config/FileLocatorInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/config/FileLocator.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/Config/FileLocator.php';\n\n return $this->privates['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator(($this->services['kernel'] ?? $this->get('kernel', 1)), (\\dirname(__DIR__, 4).'/src/Resources'), [0 => (\\dirname(__DIR__, 4).'/src')], false);\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator($this->get('kernel'), '/vagrant/project/app/Resources');\n }", "public function filesystem()\n {\n return app(MountManager::class)->getFilesystem($this->getDiskSlug());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a relative date option from the settings API into a standard format.
function sbx_parse_relative_date_option( $raw_value ) { $periods = array( 'days' => __( 'Day(s)', 'sealedbox' ), 'weeks' => __( 'Week(s)', 'sealedbox' ), 'months' => __( 'Month(s)', 'sealedbox' ), 'years' => __( 'Year(s)', 'sealedbox' ), ); $value = wp_parse_args( (array) $raw_value, array( 'number' => '', 'unit' => 'days', ) ); $value['number'] = ! empty( $value['number'] ) ? absint( $value['number'] ) : ''; if ( ! in_array( $value['unit'], array_keys( $periods ), true ) ) { $value['unit'] = 'days'; } return $value; }
[ "function wc_parse_relative_date_option($raw_value)\n {\n }", "private function parseDateTimeFormats()\n\t{\n\t\t// time format\n\t\t$this->assign('timeFormat', FrontendModel::getModuleSetting('core', 'time_format'));\n\n\t\t// date formats (short & long)\n\t\t$this->assign('dateFormatShort', FrontendModel::getModuleSetting('core', 'date_format_short'));\n\t\t$this->assign('dateFormatLong', FrontendModel::getModuleSetting('core', 'date_format_long'));\n\t}", "function convertToGlobalSettingFormat($sDate, $withTime = false)\n{\n\n $sDateformatdata = getDateFormatData(Yii::app()->session['dateformat']); // We get the Global Setting date format\n $usedDatetime = ($withTime === true ? $sDateformatdata['phpdate'].\" H:i\" : $sDateformatdata['phpdate']); //return also hours and minutes if asked for\n try {\n // Workaround for bug in older PHP version (confirmed for 5.5.9)\n // The bug is causing invalid dates to create an internal server error which cannot not be caught by try.. catch\n if (@strtotime($sDate) === false) {\n throw new Exception(\"Failed to parse date string ({$sDate})\");\n }\n $oDate = new DateTime($sDate); // We generate the Date object (PHP will deal with the format of the string)\n $sDate = $oDate->format($usedDatetime); // We apply it to the Date object to generate a string date\n return $sDate; // We return the string date\n } catch (Exception $e) {\n $oDate = new DateTime('1/1/1980 00:00'); // We generate the Date object (PHP will deal with the format of the string)\n $sDate = $oDate->format($usedDatetime); // We apply it to the Date object to generate a string date\n return $sDate; // We return the string date\n\n }\n}", "function validate_date_picker_field( $field ) {\n\t\t\n\t\t// v4 used date_format\n\t\tif( !empty($field['date_format']) ) {\n\t\t\t\n\t\t\t// extract vars\n\t\t\t$date_format = $field['date_format'];\n\t\t\t$display_format = $field['display_format'];\n\t\t\t\n\t\t\t// convert from js to php\n\t\t\t$display_format = acf_convert_date_to_php( $display_format );\n\t\t\t\n\t\t\t// append settings\n\t\t\t$field['display_format'] = $display_format;\n\t\t\t$field['save_format'] = $date_format;\n\t\t\t\n\t\t\t// clean up\n\t\t\tunset($field['date_format']);\n\t\t}\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field;\n\t\t\n\t}", "function cfdef_prepare_date_default( $p_value ) {\n\tif( is_blank( $p_value ) ) {\n\t\treturn '';\n\t}\n\n\t$t_value = trim( $p_value );\n\t$t_value_length = utf8_strlen( $t_value );\n\n\t# We are expanding {tomorrow}, {yesterday}, {+3 days}, {-7 days}, {next week}\n\t# See strtotime() for more details about supported formats.\n\tif( $t_value_length >= 3 && $t_value[0] == '{' && $t_value[$t_value_length - 1] == '}' ) {\n\t\t$t_value = utf8_substr( $t_value, 1, $t_value_length - 2 );\n\t\t$t_value = @strtotime( $t_value );\n\n\t\t# Different versions of PHP return different values in case of error.\n\t\tif( $t_value == -1 || $t_value === false ) {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\treturn $t_value;\n}", "function need_date_cleanup()\n{\n\tglobal $fcontents;\n\t$ct = preg_match_all (\"/\\n\\d DATE[^\\d]+(\\d\\d\\d\\d)[\\/\\\\\\\\\\-\\.](\\d\\d)[\\/\\\\\\\\\\-\\.](\\d\\d)/\",$fcontents,$matches, PREG_SET_ORDER);\n\tif($ct>0) {\n\t\t\treturn $matches[0];\n\t\t}\n\telse\n\t{\n\t\t\t$ct = preg_match_all (\"/\\n\\d DATE[^\\d]+(\\d\\d)[\\/\\\\\\\\\\-\\.](\\d\\d)[\\/\\\\\\\\\\-\\.](\\d\\d\\d\\d)/\",$fcontents,$matches, PREG_SET_ORDER);\n\t\tif($ct>0) {\n\t\t\t// The user needs to choose between DMY and MDY\n\t\t\t$matches[0][\"choose\"] = true;\n\t\t\treturn $matches[0];\n\t\t}\n\t\telse {\n\t\t\t$ct = preg_match_all (\"/\\n\\d DATE ([^\\d]+) [0-9]{1,2}, (\\d\\d\\d\\d)/\",$fcontents,$matches, PREG_SET_ORDER);\n\t\t\tif($ct>0) {\n\t\t\t\treturn $matches[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ct = preg_match_all(\"/\\n\\d DATE (\\d\\d)[^\\s]([^\\d]+)[^\\s](\\d\\d\\d\\d)/\", $fcontents, $matches, PREG_SET_ORDER);\n\t\t\t\tif($ct>0) {\n\t\t\t\t\treturn $matches[0];\n\t\t\t\t} else {\n\t\t\t\t\tif (preg_match_all(\"/^\\d DATE (BET|FROM) \\d\\d? (AND|TO) \\d\\d? \\w\\w\\w \\d\\d\\d\\d/m\", $fcontents, $matches, PREG_SET_ORDER)) {\n\t\t\t\t\t\treturn $matches[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function checkDateWithStrtotimeValuesDataProvider() {}", "function _parse_value_for_date($value, $key, $format_char)\n{\n if (is_array($value))\n {\n return (isset($value[$key])) ? $value[$key] : '';\n }\n else if (is_numeric($value))\n {\n return date($format_char, $value);\n }\n else if ($value == '' || ($key == 'ampm' && ($value == 'AM' || $value == 'PM')))\n {\n return $value;\n }\n else if (empty($value))\n {\n $value = date('Y-m-d H:i:s');\n }\n\n // english text presentation\n return date($format_char, strtotime($value));\n}", "public function form_process_date($atts = '') {\n global $mb_plugin_options;\n }", "function date_field_settings_validate(&$form, &$form_state) {\n $field = &$form_state['values']['field'];\n\n if ($field['settings']['tz_handling'] == 'none') {\n form_set_value($form['timezone_db'], '', $form_state);\n }\n else {\n form_set_value($form['timezone_db'], date_get_timezone_db($field['settings']['tz_handling']), $form_state);\n }\n\n if ($field['settings']['tz_handling'] != 'none' && !in_array('hour', array_filter($field['settings']['granularity']))) {\n form_set_error('field[settings][tz_handling]', t('Dates without hours granularity must not use any timezone handling.'));\n }\n\n // Extract the correct 'todate' value out of the two end date checkboxes.\n if ($field['settings']['enddate_get']) {\n if ($field['settings']['enddate_required']) {\n $field['settings']['todate'] = 'required';\n }\n else {\n $field['settings']['todate'] = 'optional';\n }\n }\n else {\n $field['settings']['todate'] = '';\n }\n\n // Don't save the pseudo values created in the UI.\n unset($field['settings']['enddate_get'], $field['settings']['enddate_required']);\n\n if (!empty($field['settings']['cache_enabled'])) {\n if (!is_numeric($field['settings']['cache_count'])) {\n form_set_error('field[settings][cache_count]', t('The number of cache values must be a number.'));\n }\n elseif ($field['settings']['cache_count'] < 0) {\n form_set_error('field[settings][cache_count]', t('The number of cache values must be a number 0 or greater.'));\n }\n }\n}", "function date_variabler(){\n \tglobal $config;\n \t\n \t$f = $config->getSetting('date_format') ? $config->getSetting('date_format') : 'r';\n return date($f);\n }", "private function parse_available_dates()\n {\n return $dates=explode(',',$this->proposed_dates[0]);\n }", "function date_parse_fixed($dateRaw)\n{\n $dateRaw = trim($dateRaw);\n if (strlen($dateRaw) === 4 && preg_match(\"/\\d{4}/\", $dateRaw) === 1) {\n $da = date_parse($dateRaw . \"-01-01\");\n $da[\"month\"] = false;\n $da[\"day\"] = false;\n return $da;\n }\n $da = date_parse($dateRaw);\n if (!$da) {\n return [];\n }\n if (\n array_key_exists(\"year\", $da) &&\n array_key_exists(\"month\", $da) &&\n array_key_exists(\"day\", $da)\n ) {\n if ($da[\"day\"] === 1) {\n if (preg_match(\"/\\b0?1(?:\\b|T)/\", $dateRaw) !== 1) {\n $da[\"day\"] = false;\n }\n }\n }\n return $da;\n}", "public static function parseDateString($input): string {\n return static::dateTimeImmutable($input)->format('Y-m-d');\n }", "function strtotime_safe( $p_date, $p_allow_null = false ) {\n\t\tif( !$p_allow_null && ( $p_date == null || is_blank ( $p_date ) || $p_date === 1 ) ) {\n\t\t\treturn date_get_null();\n\t\t}\n\n\t\tif ( config_get( 'short_date_format' ) == 'd/m/Y' ) {\n\t\t\treturn strtotime( str_replace( '/', '-', $p_date ) );\n\t\t} else {\n\t\t\treturn strtotime( $p_date );\n\t\t}\n\t}", "function parseDate($date)\n {\n $timezone = user() ? user()->timezone : config('app.timezone');\n if ($timezone == '') $timezone = config('app.timezone');\n $formatted_date = Carbon::createFromTimestamp(strtotime($date))->timezone($timezone);\n\n // Parse the date accordingly depending on the site config\n if (!site('parse-date-human-readable'))\n return $formatted_date->format('M d, Y');\n return $formatted_date->diffForHumans();\n }", "function ssc_parse_date($date){\n\t//see: http://www.php.net/manual/fi/function.strtotime.php#59748\n\treturn preg_replace(\"/^\\s*([0-9]{1,2})[\\/\\. -]+([0-9]{1,2})[\\/\\. -]+([0-9]{2,4})/\", \"\\\\2/\\\\1/\\\\3\", $date);\n}", "private function parseISODate() {\n $date = date(DATE_ATOM, time());\n $date = str_replace(array(\"T\", \":\"), \"-\", $date);\n return explode(\"+\", $date)[0];\n }", "function parse_date($s) {\n return intval(str_replace('-', '', $s));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convenience proxy to the router's url() method.
public function url() { $args = func_get_args(); return $this->_routerProxy('url', $args); }
[ "public function url()\n {\n return call_user_func_array([$this -> router, 'url'], func_get_args());\n }", "public function url()\n\t{\n\t\t$args = func_get_args();\n\n\t\tif (!isset($args[0])) {\n\t\t\t// return current url\n\t\t\treturn $this->request->url(false);\n\t\t} elseif ($args[0] === true) {\n\t\t\t// return current url with qs\n\t\t\treturn $this->request->url(true);\n\t\t} elseif (is_string($args[0]) && isset($this->urls[$args[0]])) {\n\t\t\t// get a predefined url\n\t\t\treturn $this->urls[$args[0]];\n\t\t} elseif ($args[0] === '/') {\n\t\t\t// return current url base\n\t\t\treturn $this->request->base;\n\t\t} elseif (is_string($args[0]) && isset($this->routes[$args[0]])) {\n\t\t\t$route = $args[0];\n\t\t\t$params = isset($args[1]) ? $args[1] : [];\n\t\t} elseif (is_array($args[0])) {\n\t\t\t$route = null;\n\t\t\t$params = $args[0];\n\t\t} else {\n\t\t\t$route = null;\n\t\t\t$params = [];\n\t\t}\n\t\t\n\t\t// get route\n\t\tif ($route === null) {\n\t\t\tif ($this->route === null) {\n\t\t\t\tthrow new RouterException('trying to build url without route');\n\t\t\t} else {\n\t\t\t\t$route = $this->route;\n\t\t\t}\n\t\t} \n\t\t\n\t\tif (!isset($this->routes[$route])) {\n\t\t\tthrow new RouterException('provided route ' . $route . ' is not defined');\n\t\t}\n\n\t\t// retain values\n\t\t$currentParams = $this->request->params();\n\t\tforeach ($this->retain as $param) {\n\t\t\tif (isset($currentParams[$param]) && (!isset($params[$param]) || $params[$param] === '')) {\n\t\t\t\t$params[$param] = $currentParams[$param];\n\t\t\t}\n\t\t}\n\t\t// call router builders on params\n\t\tforeach ($this->build as $build) {\n\t\t\t$params = $build($params);\n\t\t}\n\n\t\t// call route builders on params\n\t\tif (is_object($this->routes[$route]['build']) && method_exists($this->routes[$route]['build'], '__invoke')) {\n\t\t\t$params = $this->routes[$route]['build']($params);\n\t\t}\n\n\t\t// create uri with route and params\n\t\t$uri = $this->uri($this->routes[$route]['pattern'], $params);\n\n\t\t// get base url\n\t\tif (isset($params['base'])) {\n\t\t\t$base = $params['base'];\n\t\t} else {\n\t\t\t$request = $this->request->data();\n\t\t\t$protocol = isset($params['protocol']) ? $params['protocol'] : $request['protocol'];\n\t\t\t$domain = isset($params['domain']) ? $params['domain'] : $request['domain'];\n\t\t\t\n\t\t\tif(isset($params['port'])) {\n\t\t\t\t$port = (string) $params['port'];\n\t\t\t} elseif($protocol === 'https') {\n\t\t\t\t$port = '443';\n\t\t\t} else {\n\t\t\t\t$port = $request['port'];\n\t\t\t}\n\t\t\t$port = $port === '80' && $protocol === 'http' || $port === '443' && $protocol === 'https' ? '' : ':'.$port;\n\t\t\t$path = isset($params['path']) ? $params['path'] : $request['path'];\n\t\t\t$base = ($protocol !== '' ? $protocol . '://' : '//') . $domain . $port. '/' . $path;\n\t\t\t\n\t\t}\n\t\treturn rtrim($base, '/') . '/' . $uri;\n\t}", "function url() {\n\t$route_parts = func_get_args();\n\t\n\treturn trim(Url::getBase(), '/') .'/'. trim(preg_replace(\n\t\t'~/+~', \n\t\t'/', \n\t\timplode('/', $route_parts)\n\t), '/');\n}", "public function getUrl(): string\n {\n return $this->router->routeUrl($this);\n }", "function url()\n {\n $args = func_get_args();\n return call_user_func_array('HelperCommon::url', $args);\n }", "public function getUrl() {\n return Url::fromUri($this->uri, (array) $this->options);\n }", "function get_url() {\r\n\t\tforeach (bjoerne_get_url_resolvers() as $resolver) {\r\n\t\t\t$result = $resolver->get_url($this);\r\n\t\t\tif (null != $result) {\r\n\t\t\t\treturn $result;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$resolver = bjoerne_get_default_url_resolver();\r\n\t\treturn $resolver->get_url($this);\r\n\t}", "public function getUrl($route, array $args = null);", "function urlFor($route) {\n return container(\"RouterContract\")->generate($route);\n }", "function url_for($options)\n{\n if ($options instanceof \\Misago\\ActiveRecord\\Record)\n {\n $named_route = 'show_'.\\Misago\\ActiveSupport\\String::underscore(get_class($options)).'_url';\n return $named_route($options);\n }\n \n $default_options = array(\n 'anchor' => null,\n 'path_only' => true,\n 'protocol' => cfg_get('current_protocol'),\n 'host' => cfg_get('current_host'),\n 'port' => cfg_get('current_port'),\n 'user' => null,\n 'password' => null,\n );\n $mapping = array_diff_key($options, $default_options);\n $options = array_merge($default_options, $options);\n \n $map = \\Misago\\ActionController\\Routing\\Routes::draw();\n $path = $map->reverse($mapping);\n \n $query_string = array();\n foreach($mapping as $k => $v)\n {\n if (strpos($k, ':') !== 0) {\n $query_string[] = \"$k=\".urlencode($v);\n }\n }\n sort($query_string);\n \n $path .= (empty($query_string) ? '' : '?'.implode('&', $query_string)).\n (empty($options['anchor']) ? '' : \"#{$options['anchor']}\");\n \n if ($options['path_only']) {\n return $path;\n }\n return cfg_get('base_url').$path;\n}", "static function getRouterURL() {\n\n // Получим URL запроса\n $_url = $_SERVER['REQUEST_URI'];\n\n // Удалим из URL базовый путь\n $_urlBase = self::getUrlRes('/');\n $_url = str_replace($_urlBase, '', $_url);\n\n // Удалим из URL параметры\n $arrURL = explode('?', $_url);\n $_url = $arrURL[0];\n\n // Добавим \"/\"\n $_url = ltrim($_url, '/');\n $_url = rtrim($_url, '/');\n $_url = '/' . $_url;\n\n return $_url;\n }", "public static function router()\n\t{\n\t\t# Check to make sure there's a URL\n\t\tif (empty($_SERVER['PATH_INFO']))\n\t\t{\n\t\t\t$path = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$path = $_SERVER['PATH_INFO'];\n\t\t}\n\t\t\n\t\t$slice = substr($path, 1);\n\t\t$uri_str = explode(\"/\", $slice);\n\t\t\n\t\tforeach ($uri_str as $k => $v)\n\t\t{\n\t\t if (empty($v))\n\t\t {\n\t\t \tunset($uri_str[$k]);\n\t\t }\n\t\t}\n\t\t# Grab the last uri segment\n\t\tself::$uri = end($uri_str);\n\t}", "function url($route,$params=array(),$ampersand='&')\n{\n return Yii::app()->createUrl($route,$params,$ampersand);\n}", "public function asUrl()\n {\n return $this->getHostname().$this->asEndpoint();\n }", "protected function _getUrl()\n {\n return Router::url([\n 'plugin' => false,\n 'prefix' => false,\n 'controller' => 'Partners',\n 'action' => 'view',\n 'id' => $this->id,\n 'slug' => $this->slug,\n ]);\n }", "function url_for($route = null, $params = array(), $append_qs = true)\n{\n if (($num_args = func_num_args()) < 3 && is_array($route)) {\n $append_qs = $num_args > 1 ? $params : $append_qs;\n $params = $route;\n $route = request_route();\n } else {\n $route = isset($route) ? route_for($route) : request_path();\n }\n\n $qs = $params;\n\n $replace = function($match) use (&$params, &$qs) {\n\n if (array_key_exists($match['name'], $params)) {\n switch ($match['rule']) {\n case '' : $rule = '[^\\/]+'; break;\n case '#': $rule = '\\d+'; break;\n case '$': $rule = '[a-zA-Z0-9-_]+'; break;\n case '*': $rule = '.+'; break;\n default : $rule = $match['rule']; break;\n }\n $param = $params[$match['name']];\n if (preg_match('#^' . $rule . '$#', $param)) {\n unset($qs[$match['name']]);\n return $param;\n } else {\n throw new \\Exception($param . ' does not match ' . $rule);\n }\n } else {\n throw new \\Exception('missing route parameter ' . $match['name']);\n }\n };\n\n static $pattern = '/<(?:(?P<rule>.+?):)?(?P<name>[a-z_][a-z0-9_]+)>/i';\n\n $path = preg_replace_callback($pattern, $replace, $route);\n\n $schema = is_https() ? 'https://' : 'http://';\n\n $host = $_SERVER['HTTP_HOST'];\n\n $parts = parse_url($schema . $host . base_path($path));\n\n if (!$append_qs || empty($qs)) goto url;\n\n if (isset($parts['query'])) {\n parse_str($parts['query'], $query);\n $query = array_merge($query, $qs);\n } else {\n $query = $qs;\n }\n\n if ($query) {\n $parts['query'] = http_build_query($query);\n }\n\n url:\n return $schema . $host . $parts['path'] .\n (isset($parts['query']) ? '?' . $parts['query'] : null) .\n (isset($parts['fragment']) ? '#' . $parts['fragment'] : null);\n}", "public function route();", "public function getURL()\n {\n $params = $this->params;\n try {\n $relative = $this->route->assemble($params);\n } catch (\\Exception $e) {\n $relative = null;\n }\n if (!$relative) {\n return '/';\n }\n return '/' . $relative . '/';\n }", "public function getUrlGenerator();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search condition not supported
function searchCondition(&$query, $table, $value, $searchmode) { }
[ "public function searchQueryChecker();", "private function createCondition()\n\t{\n\t\tif ($this->searchOperator)\n\t\t{\n\t\t\tswitch ($this->searchOperator)\n\t\t\t{\n\t\t\t\tcase 'eq' : // Equal\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` = :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'ne' : // Not equal\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` != :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'bw' : // Begin with\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = $this->searchString.'%';\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'bn' : // Does not begin with\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = $this->searchString.'%';\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` NOT LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'ew' : // Ends with\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = '%'.$this->searchString;\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'en' : // Does not ends with\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = '%'.$this->searchString;\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` NOT LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'cn' : // Contain\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = '%'.$this->searchString.'%';\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'nc' : // Does not contain\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = '%'.$this->searchString.'%';\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` NOT LIKE :grid_search_string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'nu' : // Is null\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` IS NULL \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'nn' : // Not null\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` IS NOT NULL\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'in' : // In\n\t\t\t\t\t{\n\t\t\t\t\t\t//$this->searchString = explode(',', $this->searchString);\n\t\t\t\t\t\t//$this->searchString = \"'\".str_replace(',', \"','\", $this->searchString).\"'\";\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` IN ( :grid_search_string )\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'ni' : // Not in\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->searchString = \"'\".str_replace(',', \"','\", $this->searchString).\"'\";\n\t\t\t\t\t\t$this->searchCondition = \"`$this->searchField` NOT IN (:grid_search_string)\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function loadCriteriaSearch(){\n\n $request = Yii::$app->getRequest();\n $q = $request->getQueryParam('q', false);\n $s = $request->getQueryParam('s', false);\n $op = $request->getQueryParam('op', 'AND');\n// var_dump($q);exit;\n \n $checkArr = array();\n \n if ($q !== false) {\n //split to one item\n $tmpArr = explode(';', $q);\n \n foreach ($tmpArr as $one) {\n \n $tmpArr2 = explode('<=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//<=\n \n $tmpArr2 = explode('<', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//<\n \n $tmpArr2 = explode('>=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//>=\n \n $tmpArr2 = explode('>', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//>\n \n \n // = as default\n $tmpArr2 = explode('=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $one;\n continue;\n }//=\n }//use attributeName as index use condition as value\n \n }//query\n // var_dump($checkArr);exit;\n \n if ($s !== false) {\n //prepare check array\n $tmpArr = explode(';', $s);\n foreach ($tmpArr as $one) {\n $tmpArr2 = explode('=', $one);\n if (isset($tmpArr2[1])) {\n $checkArr[$tmpArr2[0]] = $tmpArr2[0].\" LIKE '%$tmpArr2[1]%' \";\n }\n }//use attributeName as index use condition as value\n }//like\n \n// var_dump($checkArr);\n// exit;\n if (!empty($checkArr)) {\n $checkedArr = eeAR::validateAttributes($this->_modelName, $checkArr);\n \n //render checked condition string.\n $this->_searchCondition = eeAR::generateSearchCondtionString($checkedArr, $op);\n \n// var_dump($this->_searchCondition);\n }\n \n // var_dump($this->_criteria);\n// exit;\n \n }", "public function getSearchCriteria()\n {\n }", "function searchCondition(&$query, $table, $value, $searchmode)\n { \n $query->addSearchCondition($this->getSearchCondition($query, $table, $value, $searchmode));\n }", "public function getTagsSearchCondition();", "function get_search_condition()\r\n {\r\n return $this->get_search_form()->get_condition();\r\n }", "protected function applySearch() {\n if (empty($this->searchQuery) || empty($this->searchFields)) {\n return;\n }\n\n $value = '%' . $this->searchQuery . '%';\n\n $condition = '';\n foreach ($this->searchFields as $field) {\n $condition .= ($condition == '' ? '' : ' OR ') . '{' . $field . '} LIKE %1%';\n }\n\n $this->query->addCondition($condition, $value);\n }", "function searchCondition(&$query, $table, $value, $searchmode)\n {\n $query->addSearchCondition($this->getSearchCondition($query, $table, $value, $searchmode));\n }", "public function conditionSearchCompany($param);", "function AdvancedSearchWhere() {\n\t\tglobal $Security, $contadores;\n\t\t$sWhere = \"\";\n\t\t$this->BuildSearchSql($sWhere, $contadores->id, FALSE); // id\n\t\t$this->BuildSearchSql($sWhere, $contadores->op, FALSE); // op\n\t\t$this->BuildSearchSql($sWhere, $contadores->zona, FALSE); // zona\n\t\t$this->BuildSearchSql($sWhere, $contadores->descripcion, FALSE); // descripcion\n\t\t$this->BuildSearchSql($sWhere, $contadores->programa, FALSE); // programa\n\t\t$this->BuildSearchSql($sWhere, $contadores->diahasta, FALSE); // diahasta\n\t\t$this->BuildSearchSql($sWhere, $contadores->objetivo, FALSE); // objetivo\n\t\t$this->BuildSearchSql($sWhere, $contadores->op2, FALSE); // op2\n\t\t$this->BuildSearchSql($sWhere, $contadores->horahasta, FALSE); // horahasta\n\t\t$this->BuildSearchSql($sWhere, $contadores->material, FALSE); // material\n\t\t$this->BuildSearchSql($sWhere, $contadores->orden, FALSE); // orden\n\n\t\t// Set up search parm\n\t\tif ($sWhere <> \"\") {\n\t\t\t$this->SetSearchParm($contadores->id); // id\n\t\t\t$this->SetSearchParm($contadores->op); // op\n\t\t\t$this->SetSearchParm($contadores->zona); // zona\n\t\t\t$this->SetSearchParm($contadores->descripcion); // descripcion\n\t\t\t$this->SetSearchParm($contadores->programa); // programa\n\t\t\t$this->SetSearchParm($contadores->diahasta); // diahasta\n\t\t\t$this->SetSearchParm($contadores->objetivo); // objetivo\n\t\t\t$this->SetSearchParm($contadores->op2); // op2\n\t\t\t$this->SetSearchParm($contadores->horahasta); // horahasta\n\t\t\t$this->SetSearchParm($contadores->material); // material\n\t\t\t$this->SetSearchParm($contadores->orden); // orden\n\t\t}\n\t\treturn $sWhere;\n\t}", "public function searchable();", "function AdvancedSearchWhere() {\r\n\t\tglobal $Security;\r\n\t\t$sWhere = \"\";\r\n\t\tif (!$Security->CanSearch()) return \"\";\r\n\t\t$this->BuildSearchSql($sWhere, $this->Id_Venta_Eq, FALSE); // Id_Venta_Eq\r\n\t\t$this->BuildSearchSql($sWhere, $this->FechaVenta, FALSE); // FechaVenta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Id_Tienda, FALSE); // Id_Tienda\r\n\t\t$this->BuildSearchSql($sWhere, $this->Id_Tel_SIM, FALSE); // Id_Tel_SIM\r\n\t\t$this->BuildSearchSql($sWhere, $this->Id_Cliente, FALSE); // Id_Cliente\r\n\t\t$this->BuildSearchSql($sWhere, $this->Num_IMEI, FALSE); // Num_IMEI\r\n\t\t$this->BuildSearchSql($sWhere, $this->Num_ICCID, FALSE); // Num_ICCID\r\n\t\t$this->BuildSearchSql($sWhere, $this->Num_CEL, FALSE); // Num_CEL\r\n\t\t$this->BuildSearchSql($sWhere, $this->Descripcion_SIM, FALSE); // Descripcion_SIM\r\n\t\t$this->BuildSearchSql($sWhere, $this->Reg_Venta_Movi, FALSE); // Reg_Venta_Movi\r\n\t\t$this->BuildSearchSql($sWhere, $this->Monto_Recarga_Movi, FALSE); // Monto_Recarga_Movi\r\n\t\t$this->BuildSearchSql($sWhere, $this->Folio_Recarga_Movi, FALSE); // Folio_Recarga_Movi\r\n\t\t$this->BuildSearchSql($sWhere, $this->ImprimirNotaVenta, FALSE); // ImprimirNotaVenta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Serie_NotaVenta, FALSE); // Serie_NotaVenta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Numero_NotaVenta, FALSE); // Numero_NotaVenta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Imprimirpapeleta, FALSE); // Imprimirpapeleta\r\n\t\t$this->BuildSearchSql($sWhere, $this->FolioImpresoPapeleta, FALSE); // FolioImpresoPapeleta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Maneja_Papeleta, FALSE); // Maneja_Papeleta\r\n\t\t$this->BuildSearchSql($sWhere, $this->Maneja_Activacion_Movi, FALSE); // Maneja_Activacion_Movi\r\n\t\t$this->BuildSearchSql($sWhere, $this->Con_SIM, FALSE); // Con_SIM\r\n\r\n\t\t// Set up search parm\r\n\t\tif ($sWhere <> \"\") {\r\n\t\t\t$this->Command = \"search\";\r\n\t\t}\r\n\t\tif ($this->Command == \"search\") {\r\n\t\t\t$this->Id_Venta_Eq->AdvancedSearch->Save(); // Id_Venta_Eq\r\n\t\t\t$this->FechaVenta->AdvancedSearch->Save(); // FechaVenta\r\n\t\t\t$this->Id_Tienda->AdvancedSearch->Save(); // Id_Tienda\r\n\t\t\t$this->Id_Tel_SIM->AdvancedSearch->Save(); // Id_Tel_SIM\r\n\t\t\t$this->Id_Cliente->AdvancedSearch->Save(); // Id_Cliente\r\n\t\t\t$this->Num_IMEI->AdvancedSearch->Save(); // Num_IMEI\r\n\t\t\t$this->Num_ICCID->AdvancedSearch->Save(); // Num_ICCID\r\n\t\t\t$this->Num_CEL->AdvancedSearch->Save(); // Num_CEL\r\n\t\t\t$this->Descripcion_SIM->AdvancedSearch->Save(); // Descripcion_SIM\r\n\t\t\t$this->Reg_Venta_Movi->AdvancedSearch->Save(); // Reg_Venta_Movi\r\n\t\t\t$this->Monto_Recarga_Movi->AdvancedSearch->Save(); // Monto_Recarga_Movi\r\n\t\t\t$this->Folio_Recarga_Movi->AdvancedSearch->Save(); // Folio_Recarga_Movi\r\n\t\t\t$this->ImprimirNotaVenta->AdvancedSearch->Save(); // ImprimirNotaVenta\r\n\t\t\t$this->Serie_NotaVenta->AdvancedSearch->Save(); // Serie_NotaVenta\r\n\t\t\t$this->Numero_NotaVenta->AdvancedSearch->Save(); // Numero_NotaVenta\r\n\t\t\t$this->Imprimirpapeleta->AdvancedSearch->Save(); // Imprimirpapeleta\r\n\t\t\t$this->FolioImpresoPapeleta->AdvancedSearch->Save(); // FolioImpresoPapeleta\r\n\t\t\t$this->Maneja_Papeleta->AdvancedSearch->Save(); // Maneja_Papeleta\r\n\t\t\t$this->Maneja_Activacion_Movi->AdvancedSearch->Save(); // Maneja_Activacion_Movi\r\n\t\t\t$this->Con_SIM->AdvancedSearch->Save(); // Con_SIM\r\n\t\t}\r\n\t\treturn $sWhere;\r\n\t}", "public function is_search()\n {\n }", "function AdvancedSearchWhere() {\r\n\t\tglobal $Security;\r\n\t\t$sWhere = \"\";\r\n\t\tif (!$Security->CanSearch()) return \"\";\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_booking_ai_id, FALSE); // fld_booking_ai_id\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_pickup_point, FALSE); // fld_pickup_point\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_customer_name, FALSE); // fld_customer_name\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_mobile_no, FALSE); // fld_mobile_no\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_booking_datetime, FALSE); // fld_booking_datetime\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_coupon_code, FALSE); // fld_coupon_code\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_driver_rating, FALSE); // fld_driver_rating\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_customer_feedback, FALSE); // fld_customer_feedback\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_is_cancelled, FALSE); // fld_is_cancelled\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_total_fare, FALSE); // fld_total_fare\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_booked_driver_id, FALSE); // fld_booked_driver_id\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_is_approved, FALSE); // fld_is_approved\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_is_completed, FALSE); // fld_is_completed\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_is_active, FALSE); // fld_is_active\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_created_on, FALSE); // fld_created_on\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_dropoff_point, FALSE); // fld_dropoff_point\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_estimated_time, FALSE); // fld_estimated_time\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_estimated_fare, FALSE); // fld_estimated_fare\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_brn_no, FALSE); // fld_brn_no\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_journey_type, FALSE); // fld_journey_type\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_vehicle_type, FALSE); // fld_vehicle_type\r\n\t\t$this->BuildSearchSql($sWhere, $this->fld_vehicle_mode, FALSE); // fld_vehicle_mode\r\n\r\n\t\t// Set up search parm\r\n\t\tif ($sWhere <> \"\") {\r\n\t\t\t$this->Command = \"search\";\r\n\t\t}\r\n\t\tif ($this->Command == \"search\") {\r\n\t\t\t$this->fld_booking_ai_id->AdvancedSearch->Save(); // fld_booking_ai_id\r\n\t\t\t$this->fld_pickup_point->AdvancedSearch->Save(); // fld_pickup_point\r\n\t\t\t$this->fld_customer_name->AdvancedSearch->Save(); // fld_customer_name\r\n\t\t\t$this->fld_mobile_no->AdvancedSearch->Save(); // fld_mobile_no\r\n\t\t\t$this->fld_booking_datetime->AdvancedSearch->Save(); // fld_booking_datetime\r\n\t\t\t$this->fld_coupon_code->AdvancedSearch->Save(); // fld_coupon_code\r\n\t\t\t$this->fld_driver_rating->AdvancedSearch->Save(); // fld_driver_rating\r\n\t\t\t$this->fld_customer_feedback->AdvancedSearch->Save(); // fld_customer_feedback\r\n\t\t\t$this->fld_is_cancelled->AdvancedSearch->Save(); // fld_is_cancelled\r\n\t\t\t$this->fld_total_fare->AdvancedSearch->Save(); // fld_total_fare\r\n\t\t\t$this->fld_booked_driver_id->AdvancedSearch->Save(); // fld_booked_driver_id\r\n\t\t\t$this->fld_is_approved->AdvancedSearch->Save(); // fld_is_approved\r\n\t\t\t$this->fld_is_completed->AdvancedSearch->Save(); // fld_is_completed\r\n\t\t\t$this->fld_is_active->AdvancedSearch->Save(); // fld_is_active\r\n\t\t\t$this->fld_created_on->AdvancedSearch->Save(); // fld_created_on\r\n\t\t\t$this->fld_dropoff_point->AdvancedSearch->Save(); // fld_dropoff_point\r\n\t\t\t$this->fld_estimated_time->AdvancedSearch->Save(); // fld_estimated_time\r\n\t\t\t$this->fld_estimated_fare->AdvancedSearch->Save(); // fld_estimated_fare\r\n\t\t\t$this->fld_brn_no->AdvancedSearch->Save(); // fld_brn_no\r\n\t\t\t$this->fld_journey_type->AdvancedSearch->Save(); // fld_journey_type\r\n\t\t\t$this->fld_vehicle_type->AdvancedSearch->Save(); // fld_vehicle_type\r\n\t\t\t$this->fld_vehicle_mode->AdvancedSearch->Save(); // fld_vehicle_mode\r\n\t\t}\r\n\t\treturn $sWhere;\r\n\t}", "public function event_search($conditions=null);", "function BasicSearchWhere() {\n\t\tglobal $Security;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\n\t\t$sSearchType = $this->BasicSearch->Type;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"=\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t\t$this->Command = \"search\";\n\t\t}\n\t\tif ($this->Command == \"search\") {\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\n\t\t\t$this->BasicSearch->setType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "function BasicSearchWhere() {\r\n\t\tglobal $Security;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\r\n\t\t$sSearchType = $this->BasicSearch->Type;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"=\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t\t$this->Command = \"search\";\r\n\t\t}\r\n\t\tif ($this->Command == \"search\") {\r\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\r\n\t\t\t$this->BasicSearch->setType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "public function whereSearch()\n {\n\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n $view = $this->pObj->view;\n\n $viewWiDot = $view . '.';\n\n // Query with OR and AND\n $str_whereOr = false;\n $arr_whereOr = array();\n // Query with AND NOT LIKE\n $str_whereNot = false;\n $arr_whereNot = array();\n\n\n\n //////////////////////////////////////////////////////////////////////////\n //\n // RETURN in case of no swords or no search fields\n\n if ( !($this->pObj->arr_swordPhrases && $this->pObj->csvSearch) )\n {\n return false;\n }\n // RETURN in case of no swords or no search fields\n //////////////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_search )\n {\n t3lib_div::devlog( '[INFO/SEARCH] Search fields:<br />' . $this->pObj->csvSearch, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SEARCH] Please configure: views.list.' . $mode . '.search', $this->pObj->extKey, 1 );\n }\n // DRS - Development Reporting System\n //////////////////////////////////////////////////////////////////////////\n //\n // Char for Wildcard\n\n $chr_wildcard = $this->pObj->str_searchWildcardCharManual;\n // Char for Wildcard\n //////////////////////////////////////////////////////////////////////////\n //\n // andWhere AND and OR\n\n $arrSearchFields = explode( ',', $this->pObj->csvSearch );\n $int_sword = 0;\n foreach ( $this->pObj->arr_swordPhrases[ 'or' ] as $arr_swords_and )\n {\n // Suggestion #7730\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n foreach ( ( array ) $arr_swords_and as $key => $value )\n {\n // First char of search word isn't a wildcard\n $int_firstChar = 0;\n if ( $value[ $int_firstChar ] != $chr_wildcard )\n {\n $value = '[[:<:]]' . $value;\n $arr_swords_and[ $key ] = $value;\n }\n // First char of search word isn't a wildcard\n // First char of search word is a wildcard\n if ( $value[ $int_firstChar ] == $chr_wildcard )\n {\n $value = substr( $value, 1, strlen( $value ) - 1 );\n $arr_swords_and[ $key ] = $value;\n }\n // First char of search word is a wildcard\n // Last char of search word isn't a wildcard\n $int_lastChar = strlen( $value ) - 1;\n if ( $value[ $int_lastChar ] != $chr_wildcard )\n {\n $value = $value . '[[:>:]]';\n $arr_swords_and[ $key ] = $value;\n }\n // Last char of search word isn't a wildcard\n // Last char of search word is a wildcard\n if ( $value[ $int_lastChar ] == $chr_wildcard )\n {\n $value = substr( $value, 0, -1 );\n $arr_swords_and[ $key ] = $value;\n }\n // Last char of search word is a wildcard\n }\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n foreach ( $arrSearchFields as $arrSearchField )\n {\n list($str_before_as, $str_behind_as) = explode( ' AS ', $arrSearchField );\n list($table, $field) = explode( '.', $str_before_as );\n $table = trim( $table );\n $field = trim( $field );\n\n // Suggestion #7730\n // Wildcard are used by default\n if ( !$this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '%\\' AND ' . $table . '.' . $field . ' LIKE \\'%';\n $str_whereTableField = implode( $str_wrap_sword, $arr_swords_and );\n $str_whereTableField = $table . '.' . $field . ' LIKE \\'%' . $str_whereTableField . '%\\'';\n }\n // Wildcard are used by default\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '\\') AND (' . $table . '.' . $field . ' REGEXP \\'';\n $str_whereTableField = implode( $str_wrap_sword, $arr_swords_and );\n $str_whereTableField = '(' . $table . '.' . $field . ' REGEXP \\'' . $str_whereTableField . '\\')';\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n if ( count( $arr_swords_and ) > 1 )\n {\n $str_whereTableField = '(' . $str_whereTableField . ')';\n }\n $arr_whereSword[ $int_sword ][] = $str_whereTableField;\n }\n $int_sword++;\n }\n foreach ( $arr_whereSword as $key_sword => $arr_fields )\n {\n $str_or = implode( ' OR ', $arr_fields );\n $arr_or[] = '( ' . $str_or . ' )';\n }\n $str_whereOr = implode( ' OR ', $arr_or );\n $str_whereOr = ' AND ( ' . $str_whereOr . ' )';\n // andWhere AND and OR\n //////////////////////////////////////////////////////////////////////////\n //\n // andWhere NOT\n\n if ( count( $this->pObj->arr_swordPhrases[ 'not' ] ) > 0 )\n {\n foreach ( $arrSearchFields as $arrSearchField )\n {\n list($str_before_as, $str_behind_as) = explode( ' AS ', $arrSearchField );\n list($table, $field) = explode( '.', $str_before_as );\n $table = trim( $table );\n $field = trim( $field );\n\n // Suggestion #7730\n // Wildcard are used by default\n if ( !$this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '%\\' AND ' . $table . '.' . $field . ' NOT LIKE \\'%';\n $str_whereNot = implode( $str_wrap_sword, $this->pObj->arr_swordPhrases[ 'not' ] );\n $str_whereNot = $table . '.' . $field . ' NOT LIKE \\'%' . $str_whereNot . '%\\'';\n }\n // Wildcard are used by default\n // The user has to add a wildcard\n if ( $this->pObj->bool_searchWildcardsManual )\n {\n $str_wrap_sword = '\\') AND (' . $table . '.' . $field . ' NOT REGEXP \\'';\n $str_whereNot = implode( $str_wrap_sword, $this->pObj->arr_swordPhrases[ 'not' ] );\n\n // First char of search word isn't a wildcard\n $int_firstChar = 0;\n if ( $str_whereNot[ $int_firstChar ] != $chr_wildcard )\n {\n $str_whereNot = '[[:<:]]' . $str_whereNot;\n }\n // First char of search word isn't a wildcard\n // First char of search word is a wildcard\n if ( $str_whereNot[ $int_firstChar ] == $chr_wildcard )\n {\n $str_whereNot = substr( $str_whereNot, 1, strlen( $str_whereNot ) - 1 );\n }\n // First char of search word is a wildcard\n // Last char of search word isn't a wildcard\n $int_lastChar = strlen( $str_whereNot ) - 1;\n if ( $str_whereNot[ $int_lastChar ] != $chr_wildcard )\n {\n $str_whereNot = $str_whereNot . '[[:>:]]';\n }\n // Last char of search word isn't a wildcard\n // Last char of search word is a wildcard\n if ( $str_whereNot[ $int_lastChar ] == $chr_wildcard )\n {\n $str_whereNot = substr( $str_whereNot, 0, -1 );\n }\n // Last char of search word is a wildcard\n $str_whereNot = '(' . $table . '.' . $field . ' NOT REGEXP \\'' . $str_whereNot . '\\')';\n }\n // The user has to add a wildcard\n // Suggestion #7730\n\n $arr_whereNot[] = $str_whereNot;\n }\n if ( count( $arr_whereNot ) > 0 )\n {\n $str_whereNot = implode( ' AND ', $arr_whereNot );\n $str_whereNot = ' AND ' . $str_whereNot;\n }\n }\n // andWhere NOT\n //////////////////////////////////////////////////////////////////////////\n //\n // RETURN andWhere\n\n $str_return = $str_whereOr . $str_whereNot;\n\n\n\n //////////////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_search )\n {\n t3lib_div::devlog( '[INFO/SEARCH] andWhere clause:<br />' . $str_return, $this->pObj->extKey, 0 );\n // \" AND ( ( tt_news.title LIKE '%Browser%' OR tt_news_cat.title LIKE '%Browser%' ) AND ( tt_news.title LIKE '%Erweiterung%' OR tt_news_cat.title LIKE '%Erweiterung%' ) )\"\n }\n // DRS - Development Reporting System\n\n return $str_return;\n // RETURN andWhere\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto create a class requiring a course id for minimum info
function auto_create_class($params = array()) { if (empty($this->courseid) and (empty($params) or !array_key_exists('courseid', $params))) { return false; } if (!empty($params)) { foreach($params as $key => $data) { $this->$key = $data; } } $defaults = $this->get_default(); if (!empty($defaults)) { foreach($defaults as $key => $data) { if (!isset($this->$key)) { $this->$key = $data; } } } // Check for course id one more time if (!empty($this->courseid) or 0 !== intval($this->courseid)) { $this->startdate = !isset($this->startdate) ? time() : $this->startdate; $this->enddate = !isset($this->enddate) ? time() : $this->enddate; if (!$this->data_insert_record()) { return false; // Something went wrong } } return $this->id; }
[ "protected function create_a_course() {\n $course = new stdClass;\n $course->id = 13; // Why 13, good question. MDL-21007\n $course->category = 2;\n $course->fullname = 'Anonymous test course';\n $course->shortname = 'ANON';\n $course->summary = '';\n return $course;\n }", "function mod_bongo_create_mod_course() {\n global $DB;\n\n // If the course has already been inserted, use the previous one.\n $courses = $DB->get_records('course', array('fullname' => get_string('bongoexamplecourse', 'mod_bongo')));\n if (!empty($courses)) {\n $id = -1;\n foreach ($courses as $course) {\n $id = $course->id;\n }\n return $id;\n }\n\n $categoryid = mod_bongo_find_or_create_course_category();\n\n $config = mod_bongo_create_course_object($categoryid);\n\n create_course($config);\n $course = $DB->get_record('course', array('fullname' => get_string('bongoexamplecourse', 'mod_bongo')));\n $id = $course->id;\n\n return $id;\n}", "protected function initcourse() {\n $data = array(\n 'idnumber' => 'TESTID001',\n 'name' => 'Test Course 1',\n 'syllabus' => '' // For some reason this field needs to be defined, or INSERT fails?!\n );\n\n return new course($data);\n }", "public function test_createclass() {\n $newcourse = $this->initcourse();\n $newcourse->save();\n\n $newobj = $this->initclass($newcourse->id);\n $newobj->save();\n\n $this->assertGreaterThan(0, $newobj->id);\n\n // Fetch the record from the database.\n $testobj = new pmclass($newobj->id);\n\n // Verify that the record returned from the database matches what was inserted.\n $this->assertEquals($newobj->id, $testobj->id);\n $this->assertEquals($newobj->idnumber, $testobj->idnumber);\n }", "function turnitintool_classsetup($course,$owner,$status='',&$tii,&$loaderbar) {\n\n // Make sure the Turnitin Module has been fully configured\n if (!turnitintool_check_config()) {\n turnitintool_print_error('configureerror','turnitintool',NULL,NULL,__FILE__,__LINE__);\n exit();\n }\n\n // Check to see if we have an ID and Title stored for this course\n if (!$turnitintool_course = turnitintool_get_record(\"turnitintool_courses\", \"courseid\", $course->id)) {\n $classexists=false;\n } else {\n $classexists=true;\n }\n\n // We do not have an ID stored\n // Action: Create the class on turnitin and store relevant details\n if (!$classexists) {\n\n // Create a Turnitin Comm Object\n if (isset($loaderbar->total)) {\n $loaderbar->total=$loaderbar->total+1;\n }\n\n // Create without IDs initially\n $uniquestring=strtoupper(uniqid());\n $turnitin_ctl=(strlen($course->fullname) > 76)\n ? substr($course->fullname,0,76).\"... (\".$uniquestring.\")\" : $course->fullname.\" (\".$uniquestring.\")\";\n\n $post->ctl=$turnitin_ctl;\n $post->idsync=1;\n $tii->createClass($post,$status);\n\n if ($tii->getRerror()) {\n if ($tii->getAPIunavailable()) {\n turnitintool_print_error('apiunavailable','turnitintool',NULL,NULL,__FILE__,__LINE__);\n } else {\n turnitintool_print_error($tii->getRmessage(),NULL,NULL,NULL,__FILE__,__LINE__);\n }\n exit();\n }\n\n $post->cid=$tii->getClassID();\n $turnitin_ctl=str_replace(\"(\".$uniquestring.\")\",\"(Moodle \".$post->cid.\")\",$turnitin_ctl);\n $turnitincourse=new object();\n $turnitincourse->courseid=$course->id;\n $turnitincourse->ownerid=$owner->id;\n $turnitincourse->turnitin_cid=$post->cid;\n $turnitincourse->turnitin_ctl=$turnitin_ctl;\n\n if (!$insertid=turnitintool_insert_record('turnitintool_courses',$turnitincourse)) {\n turnitintool_print_error('classupdateerror','turnitintool',NULL,NULL,__FILE__,__LINE__);\n exit();\n }\n $turnitincourse->id=$insertid;\n }\n // We already have an ID stored\n // Action: Do a call to Turnitin with the Stored IDs to ensure the class has not changed\n\n if (isset($insertid) AND !$turnitintool_course = turnitintool_get_record(\"turnitintool_courses\", \"courseid\", $course->id)) {\n turnitintool_print_error('classgeterror','turnitintool',NULL,NULL,__FILE__,__LINE__);\n exit();\n }\n\n // Create a Turnitin Comm Object\n if (isset($loaderbar->total)) {\n $loaderbar->total=$loaderbar->total+1;\n }\n\n $post->cid=$turnitintool_course->turnitin_cid;\n $post->ctl=$turnitintool_course->turnitin_ctl;\n $post->idsync=0;\n\n $tii->createClass($post,$status);\n\n if ($tii->getRerror()) {\n if ($tii->getAPIunavailable()) {\n turnitintool_print_error('apiunavailable','turnitintool',NULL,NULL,__FILE__,__LINE__);\n } else {\n turnitintool_print_error($tii->getRmessage(),NULL,NULL,NULL,__FILE__,__LINE__);\n }\n exit();\n }\n\n return $turnitintool_course;\n}", "public static function createCourse($fields) {\n $fields['metadata'] = self::createCourseMetadata($fields);\n $fields = self::validateAndSanitizeCourseFields($fields);\n $newId = eF_insertTableData(\"courses\", $fields);\n // Insert the corresponding lesson skill to the skill and lesson_offers_skill tables. Automatic skill generation only for the educational version\n EfrontSearch :: insertText($fields['name'], $newId, \"courses\", \"title\");\n $course = new EfrontCourse($newId);\n self::notifyModuleListenersForCourseCreation($course);\n return $course;\n }", "public function __construct(/* $name,$course,$specialitie */)\n {\n }", "public function set_course()\n\t\t{\n\t\t\t// Check for existing course\n\t\t\t$result = database::query(\"SELECT id FROM courses WHERE id=?;\", $this->id);\n\n\t\t\t// If course doesn't exist, insert this object\n\t\t\tif (count($result) === 0)\n\t\t\t{\n\t\t\t\t// Store course object by fields in database\n\t\t\t\t$success = database::query(\"INSERT INTO courses VALUES (null, ?, ?, ?, ?, ?);\", $this->year, $this->term, $this->subject, $this->number, $this->title);\n\n\t\t\t\t// Check for success\n\t\t\t\tif ($success)\n\t\t\t\t{\n\t\t\t\t\t// Set course's ID from database return (last insert ID)\n\t\t\t\t\t$this->id = $success;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// On failure, trigger warning\t\n\t\t\t\t\ttrigger_error(\"course->set_course() database insert failed with code: '\" . $success . \"'\", E_USER_WARNING);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Else, update this object\n\t\t\t\t$success = database::query(\"UPDATE courses SET year=?, term=?, subject=?, number=?, title=? WHERE id=?;\", $this->year, $this->term, $this->subject, $this->number, $this->title, $this->id);\n\n\t\t\t\t// Check for failure\n\t\t\t\tif (!$success)\n\t\t\t\t{\n\t\t\t\t\t// On failure, trigger warning\t\n\t\t\t\t\ttrigger_error(\"course->set_course() database update failed with code: '\" . $success . \"'\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $success;\n\t\t}", "public function getCourseInfo()\n\t{\n\t\t$gid = Request::getString('gid');\n\t\t$offering = Request::getString('offering');\n\t\t$section = Request::getString('section');\n\t\t$section = ($section ?: null);\n\n\t\t$this->course = new Course($gid);\n\t\t$this->course->offering($offering);\n\t\t$this->course->offering()->section($section);\n\t}", "function load_course_object($course = null, $courseid = 0) {\n global $CFG;\n\n if (empty($course) && empty($courseid)) {\n /// Nothing to do.\n return false;\n }\n\n if (empty($course)) {\n if (!($course = get_record('course', 'id', $courseid))) {\n return false;\n }\n }\n\n /// Load extra data from any specific course format functions.\n if (empty($course->format)) {\n $course->format = 'topics';\n }\n require_once($CFG->dirroot.'/course/format/course_format.class.php');\n $formatclassfile = $CFG->dirroot.'/course/format/'.$course->format.'/course_format.class.php';\n if (file_exists($formatclassfile)) {\n require_once($formatclassfile);\n $formatclass = 'course_format_'.$course->format;\n } else {\n $formatclass = 'course_format';\n }\n $thiscourseformat = new $formatclass($course);\n $thiscourseformat->get_course($course);\n\n /// Load the legacy global $course variable...\n global $course;\n $course = $thiscourseformat->course;\n\n return $thiscourseformat;\n }", "public static function getFromID($id) {\n $db = SQLiteManager::getInstance();\n $sql = Course::fetchSQL.\"WHERE classes.ID=\".$id;\n $result = $db->query($sql);\n return new Course($result->fetchArray(SQLITE3_ASSOC));\n }", "function create_course($wanted_code, $title, $tutor_name, $category_code, $course_language, $course_admin_id, $db_prefix, $firstExpirationDelay)\r\n{\r\n\t$keys = define_course_keys($wanted_code, \"\", $db_prefix);\r\n\r\n\tif(sizeof($keys))\r\n\t{\r\n\t\t$visual_code = $keys[\"currentCourseCode\"];\r\n\t\t$code = $keys[\"currentCourseId\"];\r\n\t\t$db_name = $keys[\"currentCourseDbName\"];\r\n\t\t$directory = $keys[\"currentCourseRepository\"];\r\n\t\t$expiration_date = time() + $firstExpirationDelay;\r\n\r\n\t\tprepare_course_repository($directory, $code);\r\n\t\tupdate_Db_course($db_name);\r\n\t\tfill_course_repository($directory);\r\n\t\tfill_Db_course($db_name, $directory, $course_language);\r\n\t\tadd_course_role_right_location_values($code);\r\n\t\tregister_course($code, $visual_code, $directory, $db_name, $tutor_name, $category_code, $title, $course_language, $course_admin_id, $expiration_date);\r\n\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t\treturn false;\r\n}", "private function create_test_course() {\n global $DB;\n\n // This will handle the creation of the course and category.\n $importdata = array(\n 'entity' => 'course',\n 'action' => 'create',\n 'shortname' => 'rlipshortname',\n 'fullname' => 'rlipfullname',\n 'category' => 'rlipcategory'\n );\n $this->run_core_course_import($importdata);\n return $DB->get_field('course', 'id', array('shortname' => 'rlipshortname'));\n }", "public function addCourse(){\n \n }", "function __construct($college_id, $college_name) {\n $this->college_id = $college_id;\n $this->college_name = $college_name;\n }", "private function create_course_module() {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/course/modlib.php');\n list($module, $context, $cw, $cm, $data) = prepare_new_moduleinfo_data($this->course, 'mumie', $this->section);\n $data->coursemodule = $data->id = add_course_module($data);\n return $data;\n }", "function createCourse($array) {\n global $db;\n \n if (!is_array($array))\n throw new Exception('Input must be an array.');\n \n //- Check inputs\n if (isset($array['schoolid']))\n $schoolid = $array['schoolid'];\n else\n throw new Exception('schoolid not sent in input.');\n \n if (isset($array['coursename']))\n $coursename = $array['coursename'];\n else\n throw new Exception('coursename not sent in input.');\n \n if (isset($array['major']))\n $major = $array['major'];\n else\n throw new Exception('major not sent in input.');\n \n if (isset($array['coursenum']))\n $coursenum = $array['coursenum'];\n else\n throw new Exception('coursenum not sent in input.');\n \n //- Check school ID\n $statement = $db->prepare(\"SELECT * FROM `schools` WHERE `id` = :id\");\n $statement->execute(array(':id' => $schoolid));\n \n if ($statement->fetch() === FALSE)\n return 's';\n \n //- Check major exists\n $statement = $db->prepare(\"SELECT * FROM `majors` WHERE `major` = :major AND `schoolid` = :schoolid;\");\n $statement->execute(array(':schoolid' => $schoolid, ':major' => $major));\n \n if ($statement->fetch() === FALSE)\n return 'm';\n \n //- Check course exists\n $statement = $db->prepare(\"SELECT * FROM `courses` WHERE `major` = :major AND `schoolid` = :schoolid AND `coursenum` = :coursenum;\");\n $statement->execute(array(':schoolid' => $schoolid, ':major' => $major, ':coursenum' => $coursenum));\n \n if ($statement->fetch() !== FALSE)\n return 'n';\n \n $id = genNewCourseId();\n \n //- Insert\n $statement = $db->prepare(\"INSERT INTO `courses` (`id`, `coursename`, `major`, `coursenum`, `schoolid`) VALUES (:id, :coursename, :major, :coursenum, :schoolid)\");\n $statement->execute(array(':id' => $id, ':coursename' => $coursename, ':major' => $major, ':coursenum' => $coursenum, ':schoolid' => $schoolid));\n \n return true;\n }", "private static function coursemodule_helper($course)\n {\n $newcm = new stdClass();\n $newcm->course = $course->id;\n $newcm->module = 17; // 17 == resource\n $newcm->visible = 1;\n $newcm->visibleold = 1;\n $newcm->visibleoncoursepage = 1;\n $newcm->groupmode = 0;\n $newcm->groupingid = 0;\n $newcm->showdescription = 0;\n return $newcm;\n }", "function core_course_create_categories_object()\n{\n\t//first, gather the necessary variables\n\tglobal $columns, $_REQUEST, $table_name;\n\n\t//then, convert variables for the Moodle object:\n\t/*\n\tlist of (\n\tobject {\n\tname string //new category name\n\tparent int Défaut pour « 0 » //the parent category id inside which the new category will be created\n\t- set to 0 for a root category\n\tidnumber string Optionnel //the new category idnumber\n\tdescription string Optionnel //the new category description\n\tdescriptionformat int Défaut pour « 1 » //description format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN)\n\ttheme string Optionnel //the new category theme. This option must be enabled on moodle\n\t}\n\t)*/\n\n\t$name = $columns['TITLE'];\n\n\tif ( $table_name == 'COURSE_SUBJECTS' )\n\t{\n\t\t// @since 5.8 Ability to set a Parent Category to Subjects. Used by Iomad plugin.\n\t\t$parent = ! empty( $_REQUEST['MOODLE_COURSE_SUBJECT_PARENT_CATEGORY'] ) ?\n\t\t\t$_REQUEST['MOODLE_COURSE_SUBJECT_PARENT_CATEGORY'] : 0;\n\n\t\t//$idnumber = (string)$_REQUEST['subject_id'];\n\t}\n\telseif ( $table_name == 'COURSES' )\n\t{\n\t\t//get the Moodle parent category\n\t\t$parent = MoodleXBETHELGet( 'subject_id', $_REQUEST['subject_id'] );\n\n\t\tif ( empty( $parent ) )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t//$idnumber = (string)$_REQUEST['course_id'];\n\t}\n\telse //error...\n\n\t{\n\t\treturn null;\n\t}\n\n\t$descriptionformat = 1;\n\n\t$categories = array(\n\t\tarray(\n\t\t\t'name' => $name,\n\t\t\t'parent' => $parent,\n\t\t\t//'idnumber' => $idnumber,\n\t\t\t'descriptionformat' => $descriptionformat,\n\t\t),\n\t);\n\n\treturn array( $categories );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Withdraw the earned points from the account.
public function withdrawEarnedPointsFromAccount(): void { event( new PointsWithdrawnFromAccount( $this->account->uuid, $this->revenue->earned_points, static::class, $this->getKey() ) ); }
[ "function do_withdraw()\n\t{\n\t\t$this->ipsclass->input['points'] = str_replace( ',', '', $this->ipsclass->input['points'] );\n\t\t$this->ipsclass->input['pts'] = str_replace( '-', '', intval($this->ipsclass->input['points']) );\n\t\t$pts = intval($this->ipsclass->input['points']);\n\t\t\n\t\tif ( !$this->ipsclass->vars['points_bank'] )\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_bank_offline'));\n\t\t}\n\t\t\n\t\tif ( !$this->ipsclass->member['deposited_points'] )\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_no_moneyinbank'));\n\t\t}\n\t\t\n\t\tif ( $this->ipsclass->member['deposited_points'] < $pts )\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_no_wd'));\n\t\t}\n\n\t\tif ( !$pts )\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_no_amount'));\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_update( 'members', array( 'deposited_points' => $this->ipsclass->member['deposited_points'] - $pts,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'points' => $this->ipsclass->member['points'] + $pts,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), 'id='.$this->ipsclass->member['id']\n\t\t\t\t\t\t\t\t\t );\n\t\t\n\t\t$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['withdrawed'], 'autocom=points' );\n\t}", "public function withdrawFromAccount(): void\n {\n event(\n new MoneyWithdrawnFromBalance(\n $this->account->uuid,\n $this->amount,\n static::class,\n $this->getKey()\n )\n );\n }", "function account_deposit_withdraw(){\n\t}", "public function balancewithdrawAction(){\n\t\t\t$amount = $this->getRequest()->getParam('widthdrawAmount');\n\t\t\t\n\t\t\tif($this->getRequest()->isPost()){\n\t\t\t\techo 'withdrawing';\n\t\t\t\tif($amount < $this->userObject->accountBalanceSummary->available_balance){\n\t\t\t\t$userAccountBalanceAndRewardPointProcessor = new AccountBalanceAndRewardPointProcessor($this->db, $this->userObject);\n\t\t\t\t\t\n\t\t\t\t$userAccountBalanceAndRewardPointProcessor->widthdrawBalance($amount);\n\t\t\t\t}else{\n\t\t\t\t\techo 'ERROR: you do not have enough to withdraw this sum';\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//not posted\n\t\t\t}\n\t\t\t\n\t\t\t$currentWithdraws = DatabaseObject_Helper_UserManager::loadUserWithdraws($this->db, $this->userObject->getId());\n\t\t\t$this->view->currentWithdraws = $currentWithdraws;\n\t\t\t$this->view->accountBalance = $this->userObject->accountBalanceSummary;\n\t\t}", "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "public function testWithdraw()\n {\n $this->seed();\n $user = User::find(1);\n $walletManager = new WalletManager($user);\n\n $wallet = $walletManager->withdraw(new Money(200, new Currency('TEST')));\n $this->assertNull($wallet);\n\n $walletManager->deposit(new Money(200, new Currency('TEST')));\n $wallet = $walletManager->withdraw(new Money(250, new Currency('TEST')));\n $this->assertNull($wallet);\n\n $wallet = $walletManager->withdraw(new Money(200, new Currency('TEST')));\n $balance = $wallet->balance;\n\n $this->assertEquals($balance, 0);\n }", "public function addEarnedPointsToAccount(): void\n {\n event(\n new PointsEarned(\n $this->account->uuid,\n $this->earned_points,\n static::class,\n $this->getKey()\n )\n );\n }", "public function withdraw()\n {\n return $this->update(['status' => 'withdrawn']);\n }", "public function doWithdraw($member_id, $out_trade_no, $money, $desc, $type)\n {\n }", "function withdrawAccount($origin, $amount, $arrayKey){\n \n return updateAccount($origin, $amount, $arrayKey, \"withdraw\"); \n \n }", "public function test_balance_withdraw(): void\n {\n $this->seed();\n\n $userPayer = User::where('type', 'person')->first();\n $oldBalance = User::where('type', 'person')->first()->wallet->balance;\n $walletPayerId = $userPayer->wallet->id;\n $walletPayeeId = Wallet::whereNotIn('id', [$walletPayerId])->first()->id;\n\n $newDataTransaction = [\n 'wallet_payer_id' => $walletPayerId,\n 'amount' => 1000,\n 'description' => 'Withdraw',\n 'type' => 'withdraw'\n ];\n\n $newTransaction = $this->transactionService->makeTransaction($newDataTransaction);\n $newBalance = $newTransaction->walletPayer->balance;\n $transactionAmount = $newTransaction->amount;\n $expectedBalance = ($oldBalance - $transactionAmount);\n\n $this->assertEquals($expectedBalance, $newBalance, 'actual value is equals to expected');\n }", "function fx_redeem_points($user_id,$cart_total){\n\tglobal $mysqli, $loyalty_rule;\n\t$points_required = ceil($cart_total/$loyalty_rule);\n\t$points = fx_check_points_available($user_id,$points_required);\n\tif($points){\n\t\t// finding out the points that we require to redeem the checkout items.\t\t\n\t\t$redeem_points_sql = \"UPDATE customers SET points = points - {$points_required} where id = {$user_id}\" ;\n\n\t\treturn $mysqli->query($redeem_points_sql);\t\t\n\t}else{\n\t\treturn false;\n\t}\n}", "public function advanceBalance() {\n\t\t$this->authorize('listPayrollTransaction', Transaction::class);\n\n\t\treturn $this->success($this->repo->advanceBalance($this->request->all()));\n\t}", "public function testWithdrawAmount()\n {\n //based on load Data Fixtures.\n $account_id = 1;\n $amount = 1;\n $currency = \"USD\";\n \n $client = static::createClient();\n $client->request(\"GET\", \"/api/v1/accounts/$account_id.json\");\n $before_saldo = $this->getSaldoFromContent($client->getResponse()->getContent(), $currency);\n \n // Submit a raw JSON string in the request body\n $client->request(\n \"PUT\",\n \"/api/v1/accounts/$account_id/amounts/$amount/currencies/$currency/opers/-.json\",\n array(),\n array(),\n array()\n );\n \n $this->assertNotEquals(\n 404, $client->getResponse()->getStatusCode(),\n \"Account not found!\"\n );\n \n \n $client->request(\"GET\", \"/api/v1/accounts/$account_id.json\");\n $after_saldo = $this->getSaldoFromContent($client->getResponse()->getContent(), $currency);\n $this->assertTrue( ($before_saldo - $amount === $after_saldo), \"Deposit failed!\");\n }", "public function testWithdrawExistingAccount()\n {\n $account = factory(Account::class)->create(['id' => '100', 'balance' => 20]);\n\n $response = $this->postJson('/event', [\n 'type' => 'withdraw',\n 'origin' => '100',\n 'amount' => 5,\n ]);\n\n $returnExpected = [\"origin\" => [\"id\" => \"100\", \"balance\" => 15]];\n\n $response\n ->assertStatus(201)\n ->assertExactJson($returnExpected);\n }", "public function withdraw(Request $request)\n {\n $this->validate($request, [\n 'amount' => 'required',\n 'user_id' => 'required',\n ]);\n\n $account = Account::where('user_id', $request->user_id)->first();\n if ($account->balance < $request->amount) {\n $account->balance -= $request->amount;\n\n if ($account->save()) {\n return response()->json([\n 'new_balance' => $account->balance,\n 'message' => 'Amount withdrawn.'\n ]);\n }\n } else {\n return response()->json([\n 'meesage' => \"The amount must not exceed the account holder's balance.\",\n ]);\n }\n }", "private function payout() {\n\n\t\t$bet = $this->strategy[\"bet\"];\n\t\t$winnings = $bet;\n\t\t$this->logger->info(\"Received payout of $${winnings} (Player $this->name)\");\n\t\t$this->balance += $bet + $winnings;\n\t\t$this->stats[\"amount_won\"] += $winnings;\n\n\t\tif (isset($this->strategy[\"take_odds\"]) && $this->roll) {\n\n\t\t\t\t$take_odds_bet = $this->strategy[\"bet\"] * $this->strategy[\"take_odds\"];\n\n\t\t\tif ($this->roll == 4 || $this->roll == 10) {\n\t\t\t\t$winnings = ($take_odds_bet * (2/1)) - $take_odds_bet;\n\n\t\t\t} else if ($this->roll == 5 || $this->roll == 9) {\n\t\t\t\t$winnings = ($take_odds_bet * (3/2)) - $take_odds_bet;\n\n\t\t\t} else if ($this->roll == 6 || $this->roll == 8) {\n\t\t\t\t$winnings = ($take_odds_bet * (6/5)) - $take_odds_bet;\n\n\t\t\t}\n\n\t\t\t$this->logger->info(sprintf(\"Oh, we took odds on point of %s as well! Here's an extra $%.2f! (Player $this->name)\", \n\t\t\t\t$this->roll, $winnings));\n\t\t\t$this->balance += $take_odds_bet + $winnings;\n\t\t\t$this->stats[\"amount_won\"] += $winnings;\n\n\t\t}\n\n\t\t$this->stats[\"wins\"]++;\n\n\t}", "function withdraw(int $accno, int $amnt)\n {\n //checks the bank ccountis active \n //the checks if sufficient money is there in the account\n if ($acc = ($this->bank->accountExist($accno)) !== false) {\n if ($this->bank->accounts[$acc]->getAmount() >= $amnt) {\n $this->bank->withdraw($amnt);\n echo \"Money Withdrawed\\n\";\n }\n //if not sufficient money\n else {\n echo \"insufficient Amount\\n\";\n }\n }\n //display message if account not found\n else {\n echo \"Account Not Found\\n\";\n }\n }", "public function edd_points_add_point_for_complete_purchase( $payment_id ) {\n\t\t\n\t\tglobal $edd_options, $current_user;\n\t\t\n\t\t//get payment data\n\t\t$paymentdata\t=\tedd_get_payment_meta( $payment_id );\n\t\t$userdata\t\t=\tedd_get_payment_meta_user_info( $payment_id );\n\t\t$user_id\t\t=\tisset( $userdata['id'] ) && !empty( $userdata['id'] ) ? $userdata['id'] : 0;\n\t\t\n\t\t//get discount towards points\n\t\t$gotdiscount = $this->model->edd_points_get_payment_discount( $payment_id );\n\t\t\n\t\t//check user has redeemed points or not & user_id should not empty\n\t\tif( isset( $gotdiscount ) && !empty( $gotdiscount ) && !empty( $user_id ) ) {\n\t\t\t\n\t\t\t//get discounte price from points\n\t\t\t$discountedpoints = $this->model->edd_points_calculate_points( $gotdiscount );\n\t\t\t\n\t\t\t//update user points\n\t\t\tedd_points_minus_points_from_user( $discountedpoints, $user_id );\n\t\t\t\n\t\t\t//points label\n\t\t\t$pointslable = $this->model->edd_points_get_points_label( $discountedpoints );\n\t\t\t\n\t\t\t//record data logs for redeem for purchase\n\t\t\t$post_data = array(\n\t\t\t\t\t\t\t\t'post_title'\t=> sprintf( __( 'Redeem %s for purchase', 'eddpoints' ), $pointslable ),\n\t\t\t\t\t\t\t\t'post_content'\t=> sprintf( __( '%s redeemed for purchasing download by redeeming the points and get discounts.', 'eddpoints' ), $pointslable ),\n\t\t\t\t\t\t\t\t'post_author'\t=>\t$user_id\n\t\t\t\t\t\t\t);\n\t\t\t//log meta array\n\t\t\t$log_meta = array(\n\t\t\t\t\t\t\t\t'userpoint'\t\t=>\t$discountedpoints,\n\t\t\t\t\t\t\t\t'events'\t\t=>\t'redeemed_purchase',\n\t\t\t\t\t\t\t\t'operation'\t\t=>\t'minus'//add or minus\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t//insert entry in log\n\t\t\t$this->logs->edd_points_insert_logs( $post_data, $log_meta );\n\t\t\t\n\t\t\t// set order meta, regardless of whether any points were earned, just so we know the process took place\n\t\t\tupdate_post_meta( $payment_id, '_edd_points_order_redeemed', $discountedpoints );\n\t\t\t\n\t\t} //end if to check points redeemed taken by buyer or not\n\t\t\n\t\t// get cartdata from older order\n\t\t$cartdata = edd_get_payment_meta_cart_details( $payment_id );\n\t\t\n\t\t//get bought points for points downloads types\n\t\t$boughtpoints = $this->model->edd_points_get_bought_points( $cartdata );\n\t\t\n\t\t//get cart points from cartdata and payment discount given to user\n\t\t$cartpoints = $this->model->edd_points_get_user_checkout_points( $cartdata, $gotdiscount );\n\t\t\n\t\t//add bought points to cart points\n\t\t$cartpoints = !empty( $boughtpoints ) ? ( $cartpoints + $boughtpoints ) : $cartpoints;\n\t\t\n\t\t//check checkout points earned points or user id is not empty\n\t\tif( !empty( $cartpoints ) && !empty( $user_id ) ) {\n\t\t\t\n\t\t\t//points label\n\t\t\t$pointslable = $this->model->edd_points_get_points_label( $cartpoints );\n\t\t\t\t\t\t\n\t\t\t//get user points after subtracting the redemption points\n\t\t\t$userpoints = edd_points_get_user_points();\n\t\t\t\n\t\t\t$post_data = array(\n\t\t\t\t\t\t\t\t'post_title'\t=> sprintf( __('%s earned for purchasing the downloads.','eddpoints'), $pointslable ),\n\t\t\t\t\t\t\t\t'post_content'\t=> sprintf( __('Get %s for purchasing the downloads.','eddpoints'), $pointslable ),\n\t\t\t\t\t\t\t\t'post_author'\t=>\t$user_id\n\t\t\t\t\t\t\t);\n\t\t\t$log_meta = array(\n\t\t\t\t\t\t\t\t'userpoint'\t\t=>\t$cartpoints,\n\t\t\t\t\t\t\t\t'events'\t\t=>\t'earned_purchase',\n\t\t\t\t\t\t\t\t'operation'\t\t=>\t'add'//add or minus\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t//insert entry in log\t\n\t\t\t$this->logs->edd_points_insert_logs( $post_data, $log_meta );\n\t\t\t\n\t\t\t//update user points\n\t\t\tedd_points_add_points_to_user( $cartpoints, $user_id );\n\t\t\t\n\t\t\t// set order meta, regardless of whether any points were earned, just so we know the process took place\n\t\t\tupdate_post_meta( $payment_id, '_edd_points_order_earned', $cartpoints );\n\t\t\t\n\t\t} //end if to check checkout points should not empty\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the associated trait.
public function getTrait(): ReflectedTrait { return $this->trait; }
[ "public function getTrait() {\n\t\treturn $this->hasOne(UserTrait::class, ['id' => 'trait_id']);\n\t}", "public function getTrait();", "public function getTrait(): string;", "public function getTrait(): string\n {\n return $this->introducedTrait;\n }", "public function getDeclaringTrait()\n\t{\n\t\t$traitName = $this->reflection->getDeclaringTraitName();\n\t\treturn null === $traitName ? null : $this->classes[$traitName];\n\t}", "public function getDeclaringTrait()\n\t{\n\t\treturn null === $this->declaringTraitName ? null : $this->getBroker()->getClass($this->declaringTraitName);\n\t}", "public function getTrait($traitName)\n {\n foreach ($this->getTraits() as $reflection) {\n if ($reflection->getName() === $traitName) {\n return $reflection;\n }\n }\n\n return;\n }", "public function getDeclaringTrait()\n\t{\n\t\tif (!isset($this->declaring_trait)) {\n\t\t\t$properties = $this->getDeclaringClass()->getProperties();\n\t\t\t$this->declaring_trait = isset($properties[$this->name])\n\t\t\t\t? $this->getDeclaringClass()\n\t\t\t\t: $this->getDeclaringTraitInternal($this->getDeclaringClass());\n\t\t}\n\t\treturn $this->declaring_trait;\n\t}", "public function getDeclaringTraitName();", "public function hasTrait($trait);", "public function getTrait(string $name): ReflectionTrait|null\n {\n return trait_exists($this->normalizeName($name)) ? new ReflectionTrait($name) : null;\n }", "public function getOwnTraits();", "protected function _findTrait($trait) {\n $namespace = implode('\\\\', explode('\\\\', trim($trait, '\\\\'), -1));\n $traitName = substr(trim($trait, '\\\\'), strlen($namespace) + 1); \n \n // try first with just the single file\n $traitFiles = new \\ArrayObject(\n array($this->_traitPath . '/' . str_replace('\\\\', '/', $trait) . '.php')\n );\n \n $iterator = new IsTraitIteractor($traitFiles->getIterator(), $namespace, $traitName);\n \n foreach ($iterator as $file) {\n return $file;\n }\n \n $iterator = new IsTraitIteractor(\n new \\RegexIterator( \n new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator(\n $this->_source,\n \\FilesystemIterator::UNIX_PATHS |\n \\FilesystemIterator::FOLLOW_SYMLINKS |\n \\FilesystemIterator::SKIP_DOTS \n )\n ),\n '/^.+\\/' . preg_quote($traitName, '/') . '\\.php$/i',\n \\RecursiveRegexIterator::GET_MATCH\n ),\n $namespace,\n $traitName\n );\n\n foreach ($iterator as $file) {\n if ($file instanceof \\SplFileInfo) {\n return $file->getPathname();\n }\n \n return $file[0];\n }\n \n return '';\n }", "function game_user_has_trait($game_user, $trait) {\n if ($game_user->meta == 'admin' ||\n (array_key_exists($trait, $game_user->traits) &&\n $game_user->traits[$trait])) {\n return TRUE;\n }\n}", "public function getTraitMock(): MockObject\n {\n return $this->mock;\n }", "function zg_user_has_trait(\\stdClass $game_user, $trait) {\n if ($game_user->meta == 'admin' ||\n (array_key_exists($trait, $game_user->traits) &&\n $game_user->traits[$trait])) {\n return TRUE;\n }\n return FALSE;\n}", "public function isTrait();", "public function getTraits();", "public function isTrait()\n {\n $this->scan();\n return $this->isTrait;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether or not the `populate_io_cache_on_flush` is true
public function populateIOCacheOnFlush() {}
[ "public function isFlushingCaches() {}", "protected function needsToFlush()\n {\n return\n $this->cacheIsEnabled() && $this->getCurrentRequest()->get('flush');\n }", "function populateIOCacheOnFlush();", "public function isForceFlush()\n {\n return !empty($this->forceFlush);\n }", "public static function isAutoFlush(){\n return self::$AutoFlush;\n }", "public function isFlushingCaches(): bool\n {\n return $this->getCommandMethodReflection()->isTaggedWith('flushescaches');\n }", "public function hasCaching(): bool;", "public function getForceFlush()\n {\n return (!empty($this->_session['force_flush']));\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function hasCache() {\n return !!$this->cache;\n }", "public function isCachable()\n {\n return $this->xmlGeneratorFacade->isCachable();\n }", "public function isAutoCache() {\n return true;\n }", "public function shouldCache(): bool\n {\n return true;\n }", "public function isAutoCache() {\n return false;\n }", "public static function flush()\n {\n if (self::config()->get('always_flush') === true) {\n self::doFlush();\n }\n\n return true;\n }", "public function isGlobalFOFCacheEnabled();", "protected function hasAutoCache()\n\t{\n\t\treturn true;\n\t}", "public static function should_cache() {\n\t\tif ( isset( $_GET['breeze_purge'] ) || ( isset( $_POST['action'] ) && 'heartbeat' === $_POST['action'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function canFlushEarly()\n {\n return $this->profiler['flush_early']\n && ! $this->profiler['strict']\n && ! $this->toolbar['enabled'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get A Supplier by Supplier ID
public function getASupplierById($supplier_id);
[ "public function find(int $id): Supplier\n {\n }", "public function getSuppliers($suppliers_id);", "public function getSupplier()\n {\n return $this->sendRequest('supplier');\n }", "public function getSupplier_id()\n {\n return $this->supplier_id;\n }", "function getSupplier() {\n\t\treturn mofilmSupplier::getInstance($this->getSupplierID());\n\t}", "public function getSupplierId() : SupplierId\n {\n return $this->supplierId;\n }", "public function getSupplierId()\n {\n return $this->supplierId;\n }", "public function getIdSupplier()\n {\n return $this->idSupplier;\n }", "public function getSupplier() {\n return $this->supplier;\n }", "public function bySupplierId($value)\r\n {\r\n return $this->byFieldValues('supplier_id', $value);\r\n }", "public function getSupplierData($supplier_id){\n $query = \"SELECT * FROM supplier WHERE supplier_id='\".$supplier_id.\"'\";\n try{\n $result = self::$db->executeQuery($query);\n $row = mysqli_fetch_array($result);\n return $row;\n\n }\n catch(Exception $e){\n echo $e;\n }\n }", "function getSupplierName($supplierID)\n {\n $sql = \"SELECT * FROM supplier WHERE supplierID = $supplierID\";\n $result = $this->db->query($sql);\n while ($supplier = $result->fetch_assoc())\n {\n return $supplier['SupplierName'];\n }\n }", "public function getSupplier()\n\t{\n\t\treturn $this->supplier;\n\t}", "public function get($supplierProductId);", "function fn_get_all_supplier_products($supplier_id)\n{\n return db_get_fields('SELECT object_id FROM ?:supplier_links WHERE ?:supplier_links.object_type = \\'P\\' AND ?:supplier_links.supplier_id = ?i', $supplier_id);\n}", "public function getSupplier()\n {\n return isset($this->Supplier) ? $this->Supplier : null;\n }", "public function get_product_by_supplier()\n {\n $supplier_id = $this->input->post('supplier_id',TRUE);\n\n $product_info_by_supplier = $this->db->select('*')\n ->from('product_information')\n ->where('supplier_id', $supplier_id)\n ->get()\n ->result();\n\n if ($product_info_by_supplier) {\n echo \"<select class=\\\"form-control\\\" id=\\\"supplier_id\\\" name=\\\"supplier_id\\\">\n\t\t\t<option value=\\\"\\\">\" . display('select_one') . \"</option>\";\n foreach ($product_info_by_supplier as $product) {\n echo \"<option value='\" . $product->product_id . \"'>\" . $product->product_name . '-(' . $product->product_model . ')' . \" </option>\";\n }\n echo \" </select>\";\n }\n }", "public function getBuyerSupplierRelationship() {\n $b = $this->requireBuyer();\n $s = $this->requireSupplier();\n return $this->get(\"v1/buyers/$b/suppliers/$s\");\n }", "public function testSupplierGetSpecificSupplierClassBysupplierClassId()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a given user is a Global Admin. Users present as an administrator on global.wordpress.org are treated as a global administrator in GlotPress.
public function is_global_administrator( $user_id ) { $user = get_user_by( 'id', $user_id ); // 115 = global.wordpress.org. Administrators on this site are considered global admins in GlotPress. if ( ! empty( $user->wporg_115_capabilities ) && is_array( $user->wporg_115_capabilities ) && ! empty( $user->wporg_115_capabilities['administrator'] ) ) { return true; } return false; }
[ "function check_user_admin() {\n\tglobal $is_user_admin;\n\tglobal $current_user;\n\tif(in_array('administrator', $current_user->roles)) {\n\t\t$is_user_admin = true;\n\t} else {\n\t\t$is_user_admin = false;\n\t}\n}", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isAdmin() {\n \n if ($this->user_type == 'Admin') {\n return true;\n }\n return false;\n }", "function isAdmin() {\n if ($user = $this->currentUser()) {\n return $user->admin;\n }\n return FALSE;\n }", "public function isAdmin() {\n\t\treturn ($this->currentUser['isAdmin']) ? true : false;\n\t}", "function isAdmin()\n {\n if ($this->getAuthOK())\n {\n if ($this->getUserPermWeight() == GC_AUTH_ADMIN)\n {\n return true;\n }\n }\n return false;\n }", "public static function isAdmin()\n\t{\n\t\tif( !isLogged() )\n\t\t\treturn false;\n\t\tif( !Security::dynamicPermissions() ) {\n\t\t\treturn false;\n\t\t}\n\t\t$userRights = &Security::dynamicUserRights();\n\t\treturn $userRights[ \".IsAdmin\" ];\n\t}", "function isAdmin() {\n return ($this->user_type=='admin');\n }", "function xnewsletter_userIsAdmin()\n{\n $xnewsletter = XnewsletterXnewsletter::getInstance();\n static $xnewsletter_isAdmin;\n //\n if (isset($xnewsletter_isAdmin)) {\n return $xnewsletter_isAdmin;\n }\n if (!$GLOBALS['xoopsUser']) {\n $xnewsletter_isAdmin = false;\n } else {\n $xnewsletter_isAdmin = $GLOBALS['xoopsUser']->isAdmin($xnewsletter->getModule()->mid());\n }\n return $xnewsletter_isAdmin;\n}", "public function isAdministrativeUser()\r\n\t{\r\n\t\treturn $this->hasPrivilege(Auth::RESTRICTED_USER_EDIT) ||\r\n\t\t\t$this->hasPrivilege(Auth::PROCESS_MANAGE);\r\n\t}", "function publisher_userIsAdmin()\r\n{\r\n global $xoopsUser;\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n static $publisher_isAdmin;\r\n\r\n if (isset($publisher_isAdmin)) {\r\n return $publisher_isAdmin;\r\n }\r\n\r\n if (!$xoopsUser) {\r\n $publisher_isAdmin = false;\r\n } else {\r\n $publisher_isAdmin = $xoopsUser->isAdmin($publisher->getModule()->getVar('mid'));\r\n }\r\n\r\n return $publisher_isAdmin;\r\n}", "public function isAuthorizedAdminUser() {\n\t\tif($_SESSION['is_admin_user'] == true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isUserAdmin()\n {\n return $this->user_type == User::USER_ADMIN;\n }", "public function isAdmin() {\n if ($this->isLogged() && $this->getUser()[\"role\"] === \"1\"){\n\n return true;\n }\n }", "public function isAdmin()\n\t{\n\t\t$user = $this->getUser();\n\t\treturn ($user && $user->admin);\n\t}", "private function isAdmin()\n {\n return \\Bouncer::is($this->user())->an('admin');\n }", "public static function is_admin()\n {\n return current_user_can(RP_WCDPD::get_admin_capability());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets Checkout Page Url. The URL that the buyer's browser should be redirected to after the checkout is completed.
public function setCheckoutPageUrl(?string $checkoutPageUrl): void { $this->checkoutPageUrl = $checkoutPageUrl; }
[ "public function set_checkout_page() {\n\t\t$this->is_checkout_page = true;\n\t\tif ( isset( $_POST['payment_method'] ) && '' != $_POST['payment_method'] ) {\n\t\t\t$this->should_verification_email_be_send = apply_filters( 'xlwuev_order_payment_method', true, $_POST ); // WPCS: input var ok, CSRF ok.\n\t\t}\n\t}", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl(\"masterpass/checkout/start\");\n }", "public function getCheckoutUrl()\n {\n return $this->checkoutUrl;\n }", "public function getCheckoutRedirectUrl() {\n\t\tif(Mage::getStoreConfig('opc_paypal_status')){\n\t\t\treturn Mage::getUrl('onepage/express/start');\n\t\t}\n\t\t\n\t\treturn parent::getCheckoutRedirectUrl();\n\t}", "public function getCheckoutUrl() {\n return $this->_checkoutUrl;\n }", "public function getCheckoutRedirectUrl()\n {\n return Mage::helper('nwtkco')->getCheckoutUrl();\n }", "public function getCheckoutRedirectUrl()\n {\n return $this->urlInterface->getUrl('kash/offsite/start', array('_secure'=>true));\n }", "public function getOPCheckoutUrl(){\n \tif (Mage::helper('wsu_opc')->isEnable()){\n \treturn $this->_getUrl('onepage', array('_secure'=>true));\n \t}else{\n \t\treturn parent::getOPCheckoutUrl();\n \t}\n }", "public function getCheckoutRedirectUrl()\n {\n return '';\n }", "public function getCheckoutUrl()\n {\n return $this->_urlBuilder->getUrl('duitku/epayjeniuspay/checkout', ['_secure' => $this->_request->isSecure()]);\n }", "public function setCurrentPageURL(): void {\n\t\t\t$pageURL = 'http';\n\t\t\tif($_SERVER[\"HTTPS\"] == \"on\") {\n\t\t\t\t$pageURL .= \"s\";\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_SERVER[\"HTTP_HOST\"])) {\n\t\t\t\t$pageURL .= \"://\" . $_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t\t} else {\n\t\t\t\t$pageURL .= \"://\" . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t\t}\n\t\t\t\n\t\t\t$this->analytics['current_page'] = parse_url($pageURL) + $this->analytics['current_page'];\n\t\t}", "public function getCheckoutUrl()\n {\n return $this->getUrl('checkout/mobilepay', array('_secure'=>true));\n }", "public function set_url() {\n global $PAGE, $CFG;\n $PAGE->set_url($CFG->wwwroot . '/mod/socialwiki/admin.php', array('pageid' => $this->page->id));\n }", "function setPageURL($page_url = null) {\n $this->page_url = $page_url;\n }", "public function set_url() {\n global $PAGE, $CFG;\n $PAGE->set_url($CFG->wwwroot . '/mod/socialwiki/prettyview.php', array('pageid' => $this->page->id));\n }", "public function getOPCheckoutUrl()\n {\n return $this->_getUrl('ketai/checkout');\n }", "function makeCheckOutLink(){\n\t #debug($this->conf);\n\t return $this->pi_linkToPage($this->pi_getLL('checkoutlink'),$this->conf['checkoutPid']);\n\t}", "public function getCheckoutUrl(): string\n {\n return $this->getUrl(\n 'checkout',\n [\n '_secure' => $this->getRequest()->isSecure(),\n self::KEY_PARALLEL => true,\n ]\n );\n }", "public function setRedirectURL($url) {\n Session::set('FF_Payment.RedirectionURL', $url);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable Deal Feature at sponsor area according to the user's listings
function system_enableDealForUser($user_id){ $level = new ListingLevel(EDIR_DEFAULT_LANGUAGE, true); $levelvalues = $level->getLevelValues(); $str_levels = ""; foreach($levelvalues as $value){ unset($listingHasPromotion); $listingHasPromotion = $level->getHasPromotion($value); if ($listingHasPromotion == "y"){ $str_levels .= $value.","; } } $str_levels = string_substr($str_levels, 0, -1); $dbMain = db_getDBObject(DEFAULT_DB, true); $dbObj = db_getDBObjectByDomainID(SELECTED_DOMAIN_ID, $dbMain); $sql = "SELECT id FROM Listing WHERE account_id = $user_id AND level IN ($str_levels)"; $result = $dbObj->query($sql); if (mysql_numrows($result) > 0){ return true; } else { return false; } }
[ "function _disable_custom_listing()\n{\n\tglobal $dbpdo;\n\t\n\t$sql = $dbpdo->prepare(\"UPDATE `custom_listings` SET `active` = 2 WHERE `id` = :custom_listing_id\");\n\t\n\t$data = array(\n\t'custom_listing_id' => (int)$_REQUEST['custom_listing_id']\n\t);\n\t\n\tif($sql->execute($data))\n\t{\n\t\treturn \"pass\";\n\t}\t\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}", "private function _set_social_list_enabled(){\n\t\t\t$enabled_social = array();\n\t\t\tforeach( $this->social_list as $key=>$value){\n\t\t\t\t$enabled = get_option('ywsl_'.$key.'_enable');\n\t\t\t\tif( $enabled == 'yes'){\n\t\t\t\t\t$enabled_social[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_data['enabled_social'] = $enabled_social;\n\t\t}", "public function isAddListingAllow()\n {\n global $account_info;\n\n $plan_using = $this->getUsingPlan($account_info['Plan_ID'], $account_info['ID']);\n\n /**\n * @todo TMP solution to allow new users to add listings without MS plan\n */\n if (!$account_info['plan']) {\n return true;\n }\n\n if ($account_info['plan']['Services']['add_listing']\n && (\n $account_info['plan']['Listing_number'] == 0\n || ($account_info['plan']['Listing_number'] > 0 && $plan_using['Listings_remains'] > 0)\n || (\n $account_info['plan']['Advanced_mode']\n && ($account_info['plan']['Standard_listings'] == 0 || $account_info['plan']['Featured_listings'] == 0)\n )\n )\n ) {\n return true;\n }\n\n return false;\n }", "public function isDealzEnabled() {\n return Mage::getStoreConfig ( 'superdeals/superdeals_group/deals_enable' );\n }", "function stm_enablePPL()\n{\n return get_theme_mod( 'dealer_pay_per_listing', false );\n}", "function approve_sponsorship($username_user, $username_sponsor)\n\t{\n\t\treturn adjust_sponsorship($username_user, $username_sponsor, \"approve\");\n\t}", "function wcfmgs_shop_staff_capability_fields( ) {\r\n\t\tglobal $WCFM, $WCFMgs;\r\n\t\tinclude_once( $WCFMgs->library->views_path . 'wcfmgs-view-shop-staff-capability.php' );\r\n\t}", "public function sp_enable() {\n\n\t\t$options \t= get_option( $this->group . '-options' );\n\t\t$option \t= isset( $options['sp-enable']) ? $options['sp-enable'] : 1;\n\t\t$id \t\t= $this->group.'-options[sp-enable]';\n\t\t?>\n\t\t<input type=\"hidden\" name=\"<?php echo $id; ?>\" value=\"false\">\n\t\t<input type=\"checkbox\" id=\"<?php echo $id; ?>\" name=\"<?php echo $id; ?>\" value=\"1\" <?php checked($option, 1); ?> />\n\t\t<label for=\"<?php echo $id; ?>\">Show suggested products.</label>\n\t\t<?php\n\t}", "protected function listCandidatesToggle()\n\t{\n\t\t$_SESSION[\"adn_cand_cpr\"] = (bool)$_POST[\"ct_cpr\"];\n\t\t$_SESSION[\"adn_cand_pro\"] = (bool)$_POST[\"ct_pro\"];\n\n\t\t$this->listCandidates();\n\t}", "function mark_listing_as_shipped($pid = 0, $bid = 0, $sellerid = 0, $buyerid = 0, $mode = '', $trackingnumber = '')\n\t{\n\t\tglobal $ilance, $phrase, $ilconfig;\n\t\tif ($mode == 'buynow')\n\t\t{\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"buynow_orders\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND buyer_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND owner_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND orderid = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t}\n\t\telse if ($mode == 'escrow')\n\t\t{\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"projects_escrow\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND user_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND project_user_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND escrow_id = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"project_bids\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND user_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND project_user_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND bid_id = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"project_realtimebids\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND user_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND project_user_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND bid_id = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t}\n\t\telse if ($mode == 'bid')\n\t\t{\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"project_bids\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND user_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND project_user_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND bid_id = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"project_realtimebids\n\t\t\t\tSET sellermarkedasshipped = '1',\n\t\t\t\tsellermarkedasshippeddate = '\" . DATETIME24H . \"',\n\t\t\t\tshiptracknumber = '\" . $ilance->db->escape_string($trackingnumber) . \"'\n\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\tAND user_id = '\" . intval($buyerid) . \"'\n\t\t\t\t\tAND project_user_id = '\" . intval($sellerid) . \"'\n\t\t\t\t\tAND bid_id = '\" . intval($bid) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t}\n\t\t$ilance->email->mail = fetch_user('email', $buyerid);\n\t\t$ilance->email->slng = fetch_user_slng($buyerid);\n\t\t$ilance->email->get('seller_marked_as_shipped');\n\t\t$ilance->email->set(array (\n\t\t\t'{{buyer}}' => fetch_user('username', $buyerid),\n\t\t\t'{{project_id}}' => intval($pid),\n\t\t\t'{{seller}}' => fetch_user('username', $sellerid),\n\t\t\t'{{tracking_number}}' => $trackingnumber,\n\t\t\t'{{project_title}}' => fetch_auction('project_title', $pid),\n\t\t));\n\t\t$ilance->email->send();\n\t}", "function BuddyListToggle()\n{\n\tglobal $user_info, $ID_MEMBER;\n\n\tcheckSession('get');\n\n\tisAllowedTo('profile_identity_own');\n\tis_not_guest();\n\n\tif (empty($_REQUEST['u']))\n\t\tfatal_lang_error(1, false);\n\t$_REQUEST['u'] = (int) $_REQUEST['u'];\n\n\t// Remove if it's already there...\n\tif (in_array($_REQUEST['u'], $user_info['buddies']))\n\t\t$user_info['buddies'] = array_diff($user_info['buddies'], array($_REQUEST['u']));\n\t// ...or add if it's not.\n\telse\n\t\t$user_info['buddies'][] = (int) $_REQUEST['u'];\n\n\t// Update the settings.\n\tupdateMemberData($ID_MEMBER, array('buddy_list' => \"'\" . implode(',', $user_info['buddies']) . \"'\"));\n\n\t// Redirect back to the profile\n\tredirectexit('action=profile;u=' . $_REQUEST['u']);\n}", "function wpcom_vip_enable_sharing() {\n\tadd_filter( 'post_flair', 'sharing_display', 20 );\n}", "public static function affiliates_support_plan_sale() {\n\t\tif( function_exists( 'affiliates_suggest_referral' ) ) {\n\t\t\tif( isset( $_REQUEST[ 'success' ] ) && $_REQUEST[ 'success' ] == 'true' ) { // Stripe payment\n\t\t\t\t$sub = 'Subscription ID: ' . $_REQUEST[ 'subscription' ];\n\t\t\t\t$data['cust_id'] = array(\n\t\t\t\t\t'title' => 'Customer ID: ',\n\t\t\t\t\t'domain' => 'domain',\n\t\t\t\t\t'value' => $_REQUEST[ 'cust_id' ]\n\t\t\t\t);\n\t\t\t\t$amount = $_REQUEST[ 'amount' ];\n\t\t\t\t$currency_id = 'GBP';\n\t\t\t\t$status = $_REQUEST[ 'success' ];\n\t\t\t\t$type = $_REQUEST[ 'type' ];\n\t\t\t\t$reference = 'Customer email: ' . $_REQUEST[ 'email' ];\n\t\t\t\t\n\t\t\t\taffiliates_suggest_referral( get_the_ID(), $sub, $data, $amount, $currency_id, $status, $type, $reference );\n\t\t\t\n\t\t\t} elseif( isset( $_REQUEST[ 'st' ] ) && $_REQUEST[ 'st' ] == 'Completed' ) { // PayPal payment\n\t\t\t\t$sub = 'Transaction ID: ' . $_REQUEST[ 'tx' ];\n\t\t\t\t$data['cust_id'] = array(\n\t\t\t\t\t'title' => 'Customer ID: ',\n\t\t\t\t\t'domain' => 'domain',\n\t\t\t\t\t'value' => $_REQUEST[ 'cust_id' ]\n\t\t\t\t);\n\t\t\t\t$amount = $_REQUEST[ 'amt' ];\n\t\t\t\t$currency_id = $_REQUEST[ 'cc' ];\n\t\t\t\t$status = $_REQUEST[ 'st' ];\n\t\t\t\t$type = $_REQUEST[ 'type' ];\n\t\t\t\t$reference = 'Customer email: ' . $_REQUEST[ 'email' ];\n\t\t\t\t\n\t\t\t\taffiliates_suggest_referral( get_the_ID(), $sub, $data, $amount, $currency_id, $status, $type, $reference );\n\t\t\t}\n\t\t}\n\t}", "public function toggle_optin_activated()\n {\n if ( ! current_user_has_privilege()) {\n exit;\n }\n\n $optin_campaign_id = absint($_POST['id']);\n $status = sanitize_text_field($_POST['status']);\n\n if ($status == 'true') {\n OptinCampaignsRepository::activate_campaign($optin_campaign_id);\n } else {\n OptinCampaignsRepository::deactivate_campaign($optin_campaign_id);\n }\n\n wp_die();\n }", "public function claimListingAction() {\r\n\r\n //CHECK USER VALIDATION\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET LOGGED IN USER INFORMATION \r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n\r\n $listingtype_id = $this->_listingType->listingtype_id;\r\n\r\n //GET LEVEL ID\r\n if (!empty($viewer_id)) {\r\n $level_id = $viewer->level_id;\r\n } else {\r\n $authorization = Engine_Api::_()->getItemTable('authorization_level')->fetchRow(array('type = ?' => 'public', 'flag = ?' => 'public'));\r\n if (!empty($authorization))\r\n $level_id = $authorization->level_id;\r\n }\r\n\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET LISTING ID \r\n $listing_id = $this->_getParam('listing_id', null);\r\n $listingtypeArray = $this->_listingType;\r\n\r\n //SET PARAMS\r\n $params = array();\r\n $params['listing_id'] = $listing_id;\r\n $params['viewer_id'] = $viewer_id;\r\n $inforow = Engine_Api::_()->getDbtable('claims', 'sitereview')->getClaimStatus($params);\r\n\r\n $this->view->status = 0;\r\n if (!empty($inforow)) {\r\n $this->view->status = $inforow->status;\r\n }\r\n\r\n //GET ADMIN EMAIL\r\n $coreApiSettings = Engine_Api::_()->getApi('settings', 'core');\r\n $defaultEmail = $coreApiSettings->getSetting('core.mail.from', \"email@domain.com\");\r\n $adminEmail = $coreApiSettings->getSetting('core.mail.contact', $defaultEmail);\r\n if (!$adminEmail)\r\n $adminEmail = $defaultEmail;\r\n\r\n //CHECK STATUS\r\n if ($this->view->status == 2) {\r\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\r\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already send a request to claim for this listing which has been declined by the site admin.\") . '</div>';\r\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\r\n }\r\n\r\n $this->view->claimoption = $claimoption = Engine_Api::_()->authorization()->getPermission($level_id, 'sitereview_listing', \"claim_listtype_$listingtype_id\");\r\n\r\n //FETCH\r\n $params = array();\r\n $this->view->userclaim = $userclaim = 0;\r\n $params['listing_id'] = $listing_id;\r\n $params['listingtype_id'] = $listingtype_id;\r\n $params['limit'] = 1;\r\n $listingclaiminfo = Engine_Api::_()->getDbtable('listings', 'sitereview')->getSuggestClaimListing($params);\r\n $userClaimValue = Engine_Api::_()->getDbTable('otherinfo', 'sitereview')->getColumnValue($listing_id, 'userclaim');\r\n\r\n if (!$claimoption || !$userClaimValue || empty($listingtypeArray->claimlink)) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n if (isset($userClaimValue)) {\r\n $this->view->userclaim = $userclaim = $userClaimValue;\r\n }\r\n\r\n if ($inforow['status'] == 3 || $inforow['status'] == 4) {\r\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\r\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already filed a claim for this listing: \\\"%s\\\", which is either on hold or is awaiting action by administration.\", Engine_Api::_()->getItem('sitereview_listing', $listing_id)->title) . '</div>';\r\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\r\n }\r\n\r\n if (!$inforow['status'] && $claimoption && $userclaim) {\r\n //GET FORM \r\n $this->view->form = $form = new Sitereview_Form_Claim_Claimlisting();\r\n\r\n //POPULATE FORM\r\n if (!empty($viewer_id)) {\r\n $value['email'] = $viewer->email;\r\n $value['nickname'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //GET EMAIL\r\n $email = $values['email'];\r\n\r\n //CHECK EMAIL VALIDATION\r\n $validator = new Zend_Validate_EmailAddress();\r\n $validator->getHostnameValidator()->setValidateTld(false);\r\n if (!$validator->isValid($email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter a valid email address.'));\r\n return;\r\n }\r\n\r\n //GET CLAIM TABLE\r\n $tableClaim = Engine_Api::_()->getDbTable('claims', 'sitereview');\r\n $db = Engine_Db_Table::getDefaultAdapter();\r\n $db->beginTransaction();\r\n try {\r\n //SAVE VALUES\r\n //GET SITEREVIEW ITEM\r\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\r\n $listing_type = Engine_Api::_()->getDbtable('listingtypes', 'sitereview')->getListingTypeColumn($sitereview->listingtype_id, 'title_singular');\r\n\r\n $httpVar = _ENGINE_SSL ? 'https://' : 'http://';\r\n $list_baseurl = $httpVar . $_SERVER['HTTP_HOST'] .\r\n Zend_Controller_Front::getInstance()->getRouter()->assemble(array('listing_id' => $listing_id, 'slug' => $sitereview->getSlug()), \"sitereview_entry_view_listtype_$sitereview->listingtype_id\", true);\r\n\r\n //MAKING LISTING TITLE LINK\r\n $list_title_link = '<a href=\"' . $list_baseurl . '\" >' . $sitereview->title . ' </a>';\r\n\r\n if ($listingtypeArray->claim_email) {\r\n //SEND CLAIM OWNER EMAIL\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($adminEmail, 'SITEREVIEW_'.$listing_type.'_CLAIMOWNER_EMAIL', array(\r\n 'list_title' => $sitereview->title,\r\n 'list_title_with_link' => $list_title_link,\r\n 'object_link' => $list_baseurl,\r\n 'site_contact_us_link' => $httpVar . $_SERVER['HTTP_HOST'] . Zend_Controller_Front::getInstance()->getBaseUrl() . '/help/contact',\r\n 'email' => $defaultEmail,\r\n 'queue' => false\r\n ));\r\n }\r\n\r\n $row = $tableClaim->createRow();\r\n $row->listing_id = $listing_id;\r\n $row->user_id = $viewer_id;\r\n $row->about = $values['about'];\r\n $row->nickname = $values['nickname'];\r\n $row->email = $email;\r\n $row->contactno = $values['contactno'];\r\n $row->usercomments = $values['usercomments'];\r\n $row->status = 3;\r\n $row->save();\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefreshTime' => '60',\r\n 'parentRefresh' => 'true',\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your request has been send successfully. You will now receive an email confirming Admin approval of your request.'))\r\n ));\r\n }\r\n }\r\n }", "function enableUserRelatedData($a_enable)\n\t{\n\t\t$this->tracking_user_related = (bool)$a_enable;\n\t}", "function wyzi_subscription_update_user_priveleges_to_business_owner ($user_id) {\n\n if ( current_user_can( 'maage_options' ) )\n return;\n\n $wyzi_subscription_options = get_option ('wyzi_pmpro_subscription_options');\n\n $u = new WP_User( $user_id );\n\n $u->remove_role( 'client' );\n $u->add_role( 'business_owner' );\n\n $points_available = get_user_meta( $user_id, 'points_available', true );\n if ( '' == $points_available ) {\n $points_available = 0;\n } else {\n $points_available = intval( $points_available );\n }\n\n $membership_level = pmpro_getMembershipLevelForUser($user_id);\n \n $points_available = intval($points_available) + intval($wyzi_subscription_options[$membership_level->id]['wyzi_sub_points_added']);\n update_user_meta ($user_id, 'points_available',$points_available);\n\n if( 'on' == get_option( 'wyz_can_become_vendor' ) && WyzHelpers::wyz_sub_can_bus_owner_do( $user_id, 'wyzi_sub_auto_vendorship' ) ) {\n WyzHelpers::make_user_vendor( $u );\n }\n\n WyzHelpers::add_extra_points( $user_id );\n\n }", "public function enableRequester() {\n\t\t$this->validRequester ();\n\t\t$postData = $this->params ['form'];\n\t\tif ($postData ['userId'] && is_numeric ( $postData ['userId'] )) {\n\t\t\t$userId = $postData ['userId'];\n\t\t\t$isRequester = 0;\n\t\t\tif ($postData ['isRequester'] == 1) {\n\t\t\t\t$isRequester = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->User->read ( null, $userId )) {\n\t\t\t\t$this->User->id = $userId;\n\t\t\t\t$this->User->saveField ( 'isRequester', $isRequester );\n\t\t\t\t$this->Ajax->success ( 'Update success.' );\n\t\t\t} else {\n\t\t\t\t$this->Ajax->error ( 'No such user.' );\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\t$this->Ajax->error ( 'Invalid userId.' );\n\t\t}\n\t}", "function enableUserRelatedData($a_enable)\n\t{\n\t\t$this->tracking_user_related = (bool) $a_enable;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set flag indicating if element represents an array
public function setIsArray($flag) { $this->_isArray = (bool) $flag; return $this; }
[ "function acf_is_array($array) {}", "public function setIsArray ( $flag )\n {\n $this->_isArray = (bool) $flag;\n\n return $this;\n }", "public function isTypehintArray()\n {\n return (bool) ($this->typehint === 'array');\n }", "function acf_is_array($array)\n{\n}", "public function valueIsArray() : bool\n {\n return ($this->type & OptionTypes::IS_ARRAY) === OptionTypes::IS_ARRAY;\n }", "protected function isArray() {\n\t\tif ( ! is_array($this->value)) $this->setIssue('is array');\n\t}", "public function isDataTypeArray()\n\t{\n\t\treturn substr($this->getRawDataType(), -2) == '[]';\n\t}", "function wponion_is_unarrayed( $field ) {\n\t\treturn ( isset( $field['un_array'] ) && true === $field['un_array'] );\n\t}", "public function isArrayType(): bool\n\t{\n\t\treturn $this->type === 'array' || preg_match('~(.+)\\[\\]~', $this->type);\n\t}", "function wponion_is_unarrayed( $field ) {\n\t\treturn ( isset( $field['un_array'] ) && true === $field['un_array'] ) ? true : false;\n\t}", "public function isAnArray()\n {\n $this->failIf(!is_array($this->data[0]));\n }", "public function isValueArray(): bool\n {\n return is_array($this->value);\n }", "function is_array ($var) {}", "function is_array() {\n if(count($this->data) > 1) {\n return true;\n } else {\n return false;\n }\n }", "private function getInternArrayIsArray(): bool\n {\n return $this->internArrayIsArray;\n }", "public function asArray($flag = true)\n {\n $this->asArray = (bool)$flag;\n return $this;\n }", "function is_array($value)\n{\n\treturn \\is_array($value);\n}", "protected function isArray() : bool\n {\n return false;\n }", "public function testIsArrayAccess()\n {\n $arr = array('nested' => array());\n $track = new TrackableArray($arr);\n\n $this->assertFalse(is_array($track['nested']));\n $this->assertTrue(ArrayFunctions::is_array_access($track['nested']));\n $this->assertInstanceOf('Sugarcrm\\Sugarcrm\\Util\\Arrays\\TrackableArray\\TrackableArray', $track['nested']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the question type ID of the question
function getQuestionTypeID() { global $ilDB; $result = $ilDB->queryF("SELECT questiontype_id FROM svy_qtype WHERE type_tag = %s", array('text'), array($this->getQuestionType()) ); if ($result->numRows() == 1) { $row = $ilDB->fetchAssoc($result); return $row["questiontype_id"]; } else { return 0; } }
[ "abstract public function get_question_type_int();", "function getQuestionType() {\n\t\treturn $this->data_array['question_type'];\n\t}", "public function getQuestionType()\n {\n return $this->questionType;\n }", "function getQuestionType()\n\t{\n\t\treturn $this->object->getQuestionType();\n\t}", "function GetQuestionType() {\n return $this->hunttype_arr['question_type'];\n }", "public function getIdQuestionType()\n {\n return $this->hasOne(Questiontype::className(), ['IdQuestionType' => 'IdQuestionType']);\n }", "public function getTypeQuestion()\n {\n return $this->typeQuestion;\n }", "function GetQuestionIdIdentifier()\n {\n return \"QuestionID\";\n }", "abstract public function get_question_type_string();", "function getQuestionType()\n\t{\n\t\treturn \"\";\n\t}", "public function getQuestiontype()\n {\n return $this->hasOne(QuestionType::className(), ['id' => 'question_type_id']);\n }", "function getQuestionType($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\tif ($question_id < 1) return -1;\n\t\t$result = $ilDB->queryF(\"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND \" .\n\t\t\t\"svy_question.questiontype_fi = svy_qtype.questiontype_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\treturn $data[\"type_tag\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "function _getQuestionType($question_id) \n\t{\n\t\tglobal $ilDB;\n\n\t\tif ($question_id < 1) return \"\";\n\n\t\t$result = $ilDB->queryF(\"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND svy_question.questiontype_fi = svy_qtype.questiontype_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\treturn $data[\"type_tag\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function getQuestionID()\n {\n return $this->get(self::QUES_ID);\n }", "function getQuadQuestionTypeId($qType) {\r\n $qt = 1;\r\n switch ($qType) {\r\n case 'Multiple Choice': ///Multiple Choice Single Select [MCSS text without media]\r\n $qt = 2;\r\n break;\r\n\r\n case 'Multiple Response': ///Multiple Choice Multiple Select [MCMS text without media]\r\n $qt = 3;\r\n break;\r\n\r\n case 'Matching': ///Linking Lines\r\n $qt = 14;\r\n break;\r\n\r\n //case 'Multiple Choice':\r\n case 'Numeric':\r\n case 'Pull-down list':\r\n case 'Fill in Blanks, Matrix':\r\n case 'Select a Blank':\r\n case 'Essay':\r\n case 'Ranking':\r\n case 'Java':\r\n case 'Macromedia Flash':\r\n $qt = 0;\r\n break;\r\n\r\n default:\r\n $qt = 0;\r\n break;\r\n }\r\n\r\n return $qt;\r\n }", "function GetQuestionsIdentifier()\n {\n return \"questions\";\n }", "public function getIdQuestion()\r\n {\r\n return $this->idQuestion;\r\n }", "public function getQuestionUserTypeId();", "protected function get_question_id()\n {\n return Request::get(\\Chamilo\\Application\\Weblcms\\Tool\\Implementation\\Reporting\\Manager::PARAM_QUESTION);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach a random number of genres to every profile
private function attachGenresToProfiles() { $genres = Genre::withTrashed()->get(); $profiles = Profile::withTrashed()->get(); foreach($profiles as $profile) { $data = $genres->random(mt_rand(1, static::MAX_ALLOWED_GENRES)); $profile->genres()->attach($data); } }
[ "private function allocate_random_users(): void {\n $this->ratingallocate->add_allocation($this->get_choice_id_by_title('B'), $this->studentsgreen[3]->id);\n $this->ratingallocate->add_allocation($this->get_choice_id_by_title('B'), $this->studentsred[7]->id);\n $this->ratingallocate->add_allocation($this->get_choice_id_by_title('C'), $this->studentsblue[9]->id);\n $this->ratingallocate->add_allocation($this->get_choice_id_by_title('D'), $this->studentsnogroup[2]->id);\n }", "function getRandomGenres($COMMON){\n // Run database query to return an array of genres\n $genres = getGenres($COMMON);\n $randomGenres = array();\n\n for($i = 0; $i < 3; $i++){\n\n\t// If there are no genres remaining, stop\n\tif(sizeof($genres) > 0){\n \t\t// Select a random genre from the array\n \t\t$nextGenre = $genres[rand(0, sizeof($genres) - 1)];\n \n \t\t// Remove chosen genre from array\n \t\tarray_splice($genres, array_search($nextGenre, $genres), 1);\n\n \t\t// Add chosen genre to result\n \t\tarray_push($randomGenres, $nextGenre);\n\t}\n }\n return $randomGenres;\n}", "protected function generateLikes()\n {\n $dice = mt_rand(1, 10);\n if ($dice <= 8) {\n $value = mt_rand(self::LIKES_MIN, self::LIKES_MAX/2);\n } else {\n $value = mt_rand(self::LIKES_MAX/2, self::LIKES_MAX);\n }\n $this->likesCount = $value;\n }", "private function generateRandomUserNames( $count )\r\n {\r\n\r\n }", "public function shuffle()\n {\n shuffle($this->population);\n }", "public function generatePersons(int $count = 20)\n {\n $faker = Factory::create();\n\n\n for ($i = 0; $i < $count; $i++) {\n PcrmPersons::create(\n [\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->phoneNumber,\n ]);\n }\n }", "function gen_stats(){\n $this->rolls = array();\n $x = 0;\n for( $x = 0; $x < 6; $x++) {\n $roll = random_int(1,6) + random_int(1,6) + random_int(1,6);\n array_push($this->rolls, $roll);\n }\n sort($this->rolls);\n }", "function AddRandomTracksFromBundle($trackids, $bundle, $num)\n{\n shuffle($bundle);\t\n $bundleSample = array_slice($bundle, 0, $num);\n foreach ($bundleSample as $item)\n {\n array_push($trackids, $item);\n }\n return $trackids;\n}", "private function generateGenome()\n\t{\n\t\tfor($a=1; $a<=3; $a++) {\n\t\t\tfor($b=1; $b<=3; $b++) {\n\t\t\t\tfor($c=1; $c<=3; $c++) {\n\t\t\t\t\tfor($d=1; $d<=3; $d++) {\n\t\t\t\t\t\tfor($e=1; $e<=3; $e++) {\n\t\t\t\t\t\t\tif($this->random or mt_rand(0,1000) < $this->mutation) {\n\t\t\t\t\t\t\t\t$this->genome[$a.$b.$c.$d.$e] = mt_rand(1,6);\n\t\t\t\t\t\t\t\tif( ! $this->random) {\n\t\t\t\t\t\t\t\t\terror_log(\"MUTATION!\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->genome[$a.$b.$c.$d.$e] = $this->parentGenome[mt_rand(1,2)][$a.$b.$c.$d.$e];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function random()\n {\n $this->setNumber(rand(1, 100));\n }", "function getRandomFiles($genre, $count = 1) {\n\t\t$tagList = array();\n\t\tforeach ((array)$genre as $g) {\n\t\t\t$tagList = array_merge($tagList, $this->getList(array('genre' => $g), 0, true));\n\t\t}\n\t\t$files = array();\n\t\t$keys = (array)array_rand($tagList, min($count, count($tagList)));\n\t\tforeach ($keys as $k) $files[] = $tagList[$k];\n\t\treturn $files;\n\t}", "protected function getGene()\n {\n return mt_rand(0, 9);\n }", "public function regenerate() {\n $json = file_get_contents(NameGenerator::API_URL . '&seed=' . $this->seed . '_' . $this->iterator);\n $json = json_decode($json);\n\n $this->gender = $json->results[0]->gender == 'male' ? Person::GENDER_MALE : Person::GENDER_FEMALE;\n $this->firstName = ucfirst($json->results[0]->name->first);\n $this->lastName = ucfirst($json->results[0]->name->last);\n \n // Increment the iterator\n $this->iterator++;\n }", "function newGeneration() {\n if($this->d) echo time().\" - GeneLIB : Initial pop = \". count($this->population) . \"\\n\";\n /* Select population */\n $this->population = $this->selector->selectNextGeneration($this->population);\n if($this->d) echo time().\" - GeneLIB : Population after tournament =\".count($this->population) . \"\\n\";\n /* Now do crossover */\n// $this->crossover_strategy->\n if($this->d) echo time(). \" - GeneLIB: Final pop = \". count($this->population) . \"\\n\";\n //Do mating, do mutation\n return $this->population;\n}", "function getRandomPerson() {\n\tglobal $db;\n\t$personList=$db->getPersonIdListWithPicture();\n\t\n\t$idrow=$personList[rand(0,sizeof($personList)-1)];\n\t\n\t$p=$db->getPersonByID($idrow[\"id\"]);\n\t// Testperson\n\t//$test = array(656, 2791,8041,9816,933);\n\t//$p=$db->getPersonByID($test[mt_rand(0,sizeof($test)-1)]);\n\t$class=$db->getClassById($p[\"classID\"]);\n\t$p[\"classText\"]=$class[\"text\"];\n\t$p[\"classEvening\"]=$class[\"eveningClass\"];\n\t$p[\"schoolName\"]=getSchoolNameById($p[\"schoolID\"]).\"\";\n\treturn $p;\n}", "private function randomHeroBonusLife()\n {\n if (mt_rand(1, 5) === 1) {\n $this->hero->increaseLife(50);\n }\n }", "public static function generateRandomDataRecords()\n {\n $db = \\Database::getInstance();\n for ($i = 0; $i < 10000; $i++)\n {\n $objMember = $db->query('SELECT id FROM tl_member ORDER BY RAND() LIMIT 1');\n $objSubject = $db->query('SELECT id FROM tl_subject ORDER BY RAND() LIMIT 1');\n $objStudent = $db->query('SELECT id FROM tl_student ORDER BY RAND() LIMIT 1');\n $set = array('teacher' => $objMember->id, 'student' => $objStudent->id, 'subject' => $objSubject->id, 'tstamp' => 999, 'skill1' => 1, 'skill2' => 2, 'skill3' => 3, 'skill4' => 4, 'skill5' => 1, 'skill6' => 1, 'skill7' => 1, 'skill8' => 1);\n $objRand = $db->prepare('SELECT id FROM tl_voting WHERE teacher=? AND student=? AND subject=?')->execute($objMember->id, $objStudent->id, $objSubject->id);\n if (!$objRand->numRows)\n {\n $db->prepare('INSERT INTO tl_voting %s')->set($set)->execute();\n }\n }\n }", "public function incrementGenerations()\r\n {\r\n $this->generations ++;\r\n\r\n return $this;\r\n }", "function selectNextGeneration($population) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all settings of the current user from database If the settings column empty the default setting will load in an object from config file.
protected static function getSettings() { self::$got = true; $data = DB::table(config('user-settings.database.table')) ->select(config('user-settings.database.column')) ->where(config('user-settings.database.primary_key'), '=', Auth::id()) ->get(); $settings = json_decode($data[0]->settings); if(json_last_error() !== JSON_ERROR_NONE){ self::$settings = (object) config('user-settings.settings'); return; } self::$settings = $settings; }
[ "function get_settings() {\r\n $user_settings = user_settings::retrieve_user_settings($this->id);\r\n return $user_settings;\r\n }", "function get_all_user_settings()\n {\n }", "public function get_all_settings(){\n $db = Database::newInstance();\n $query = \"SELECT * FROM tbl_settings\";\n\n return $db->read_db($query);\n }", "public function getSettings() {\n global $user;\n return churchcore_getUserSettings($this->modulename, $user->id);\n }", "private function getSettingsFromDatabase()\n {\n return self::$settingRepository->getSettings();\n }", "public static function get_all(){\n\t\t\t$db = new Db();\n\t\t\t$db = $db->get();\n\t\t\ttry{\n\t\t\t\t$query = $db->prepare(\"SELECT * FROM Settings\");\n\t\t\t\t$query->execute();\n\t\t\t\t$result = $query->fetchAll();\n\t\t\t}\n\t\t\tcatch(PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t\t$settings = $result;\n\t\t\treturn $settings;\n\t\t}", "public function getSettings() {\n\t\treturn $this->_executeGetRequest('user/settings');\n\t}", "private function loadSettings()\n {\n $this->settings = new Settings($this->db);\n return $this->settings->loadSettings();\n }", "private function get_settings()\r\n {\r\n if($this->user->has_access('Settings', 'Manage', FALSE))\r\n {\r\n // If they can manage the settings, show all\r\n return $this->setting_model->get_all();\r\n }\r\n else\r\n {\r\n // If they can't manage them, only show GUI settings\r\n return $this->setting_model->get_all_gui();\r\n }\r\n }", "public static function getUserSettings($user = false) {\n\n\t\tif (empty($user))\n\t\t\t$user = \\GO::user();\n\n\t\treturn \\GO\\Sync\\Model\\Settings::model()->findForUser($user);\n\t}", "public function settings()\n\t{\n\t\treturn $this->hasOne(config('core.acl.user_setting_model'), 'user_id');\n\t}", "public function getUserSettings($user_id){\n\t\t$sql = \"select setting, value from core_users_settings where user_id=?\";\n\t\t$user = $this->runRequest($sql, array($user_id));\n\t\t$res = $user->fetchAll();\n\t\t\n\t\t$out = array();\n\t\tforeach ($res as $r){\n\t\t\t$out[$r[\"setting\"]] = $r[\"value\"];\n\t\t}\n\t\treturn $out;\n\t}", "public function getUserSettings()\n {\n return $this->hasMany(UserSettings::className(), ['user_id' => 'id']);\n }", "public function GetSettings()\n {\n \n if (Session('settings_touchpoint_chat') && (!$this->reset_settings)) {\n $this->settings = Session('settings_touchpoint_chat');\n } else {\n \n $records = $this->SQL->GetArrayAll(array(\n 'table' => $this->TableChatSettings,\n 'keys' => 'setting_name,setting_value',\n 'where' => 'active=1',\n ));\n \n foreach ($records as $record) \n {\n $name = $record['setting_name'];\n $value = $record['setting_value'];\n $this->settings[$name] = $value;\n }\n \n $_SESSION['settings_touchpoint_chat'] = $this->settings;\n }\n }", "public function getSettings(){\n\t\t$sql=\"SELECT * FROM \".SETTING_TABLE;\n\t\t$result=$this->query($sql);\n\t\t$settings=array();\n\t\tif($result)\n\t\t\twhile($row=$result->fetch_assoc())\n\t\t\t\t$settings[$row['Setting']]=$row['Value'];\n\t\treturn $settings;\n\t}", "public function getSettings();", "public function user_settings() {\n return UserSettings::from_json(json_decode($this->json_client->get_user_settings()));\n }", "function GetSettings($user_info)\r\n\t{\r\n\t\t$userId = GetUserID($user_info);\r\n\t\t\r\n\t\t$strSQL = \"\r\n\t\t\tSELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\ttblUser\r\n\t\t\t\tLEFT JOIN tblOrganization ON tblUser.org_ID = tblOrganization.org_ID\r\n\t\t\tWHERE\r\n\t\t\t\tuser_ID = $userId\";\r\n\t\t\t\t\r\n\t\tOutputXMLList($strSQL, \"userSettings\", \"settings\");\r\n\t}", "private function load_settings()\n {\n $this->columns = DiviRoids_Settings()->get($this->settings_prefix . '-columns', true);\n $this->columns_divilibrary = DiviRoids_Settings()->get($this->settings_prefix . '-columns-divilibrary', true);\n $this->actions = DiviRoids_Settings()->get($this->settings_prefix . '-actions', true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the thumbnail (featured image) from the given post.
function delete_post_thumbnail($post) { }
[ "function instapress_remove_post_thumbnail() {\n remove_post_type_support( 'post', 'thumbnail' );\n}", "public function destroy_thumbnail(Post $post)\n {\n $this->authorize('update', $post);\n\n $post->update(['thumbnail_id' => null]);\n\n return redirect()->route('posts.edit', $post)->withSuccess(__('posts.updated'));\n }", "function zilla_reset_thumb_transient( $post_id ) {\n delete_transient( 'featured_image_' . $post_id );\n if ( has_post_thumbnail( $post_id ) ) {\n zilla_set_thumb_transient( $post_id );\n }\n}", "public static function deletePostThumbnail($postId) {\n // Get the ID of the thumbnail attachment\n $alreadyExistingThumbId = get_post_thumbnail_id($postId);\n\n // Delete the thumbnail from the post\n delete_post_thumbnail($postId);\n\n // Delete the attachment\n if($alreadyExistingThumbId) wp_delete_attachment($alreadyExistingThumbId);\n }", "public function removeThumbnail(): void\n {\n if (!$this->thumbnail) {\n return;\n }\n\n Storage::disk('uploads')->delete('thumbnails/' . $this->thumbnail);\n $this->thumbnail = null;\n }", "public function destroy(Post $post)\n {\n $this->authorize('update', $post);\n\n $post->update(['thumbnail_id' => null]);\n\n return $this->item($post);\n }", "function today_remove_post_thumbnail_box() {\n remove_meta_box( 'postimagediv', 'post', 'side' );\n}", "public function delete_thumbnail() {\r\n\t\t// Remove the thumbnail.\r\n\t\t$success = delete_post_thumbnail( $this->id );\r\n\r\n\t\t// Delete the thumbnail.\r\n\t\tif ( $success ) {\r\n\t\t\t$this->thumbnail = array();\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Action hook to fire after video thumbnail is deleted.\r\n\t\t *\r\n\t\t * @param int $id Video ID.\r\n\t\t *\r\n\t\t * @since 1.8.0\r\n\t\t */\r\n\t\tdo_action( 'wpmudev_vids_custom_videos_model_after_thumbnail_delete', $this->id );\r\n\r\n\t\t// Delete cache.\r\n\t\t$this->refresh_cache();\r\n\r\n\t\treturn $success;\r\n\t}", "function remove_featured_image_specials() {\n\tremove_theme_support( 'post-thumbnails', array( 'specials' ) );\n}", "public function add_thumbnail( $post ) {\n\t\tif ( isset( $this->properties['post_thumbnail'] ) ) {\n\t\t\t$attributes = array(\n\t\t\t\t'tmp_name' => download_url( $this->properties['post_thumbnail']['url'] ),\n\t\t\t\t'name' => $this->properties['post_thumbnail']['name'] . '.jpg',\n\t\t\t\t'type' => 'image/jpg',\n\t\t\t);\n\n\t\t\tif ( ! is_wp_error( $attributes['tmp_name'] ) ) {\n\t\t\t\t$media = media_handle_sideload( $attributes, $post );\n\n\t\t\t\tif ( ! is_wp_error( $media ) ) {\n\t\t\t\t\tset_post_thumbnail( $post, $media );\n\t\t\t\t} else {\n\t\t\t\t\tunlink( $attributes['url'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function _wp_post_thumbnail_context_filter_remove()\n {\n }", "function baseline_do_entry_featured_image() {\n if ( ! ( is_singular( array('post') ) && has_post_thumbnail() ) ) {\n \treturn;\n }\n\tthe_post_thumbnail( 'featured' );\n}", "function zkk_remove_featured_image_meta_box() {\n remove_meta_box( 'postimagediv', 'post', 'side' );\n remove_meta_box( 'postimagediv', 'page', 'side' );\n}", "public function remove()\n {\n if ($this->currentIsExists()) {\n unlink($this->currentImage());\n $this->removeThumbs();\n }\n }", "public function removeThumbnail(FileReference $thumbnail): void\n {\n $this->thumbnails->detach($thumbnail);\n }", "public function clearThumbnail() {\n $this->changes[] = [\n 'type' => 'thumbnail',\n 'clear' => true\n ];\n }", "function great_outdoors_reset_thumb_data_transient( $post_id ) {\n\t\tdelete_transient( 'featured_image_' . $post_id );\n\t\tif ( has_post_thumbnail( $post_id ) ) {\n\t\t\t$attachment_id = get_post_thumbnail_id( $post_id );\n\t\t\t$srcsets = great_outdoors_get_image_sizes( $attachment_id );\n\t\t\t$alt_text = great_outdoors_get_img_alt( $attachment_id );\n\t\t\tgreat_outdoors_set_image_transient( $post_id, $srcsets, $alt_text );\n\t\t}\n\t}", "function get_featured() {\n\tthe_post_thumbnail('full');\n}", "function rcp_hide_post_thumbnail( $return ) {\n\n\tif ( rcp_is_single_feature() ) {\n\t\t$return = false;\n\t}\n\n\treturn $return;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loops over each resources from a group then return an array of SimpleXML objects
function read_resource_all($resource_name, $level = 0) { $resources = []; // SimpleXML with the resources list that contains only the single resources id $xml_list = null; // single resource at the current iteration in the foreach loop $current_single_resource = null; // single resource id at the current iteration in the foreach loop $current_resource_id = 0; // first : retrieve the resources list from the read_resource($resource_name) method $xml_list = $this->read_resource($resource_name); // second : loop over each resource from the list and make a call to read_resource($resource_name, $id) specifying the id // $single_resource_content is a SimpleXML object that contains the single resource data and attributes foreach ( $xml_list as $single_resource_name => $single_resource_content ) { $current_resource_id = $single_resource_content->attributes()['id']; $current_single_resource = $this->read_resource($resource_name, $current_resource_id); $resources[] = $current_single_resource; } $this->retrieved_resource = $resources; return $resources; }
[ "protected function pullResources() {\n /* @var $parent modResource */\n $this->elements = array();\n\n /* add resources from pagetitle array to $this->elements */\n if (!empty($this->pagetitles)) {\n foreach ($this->pagetitles as $pagetitle) {\n $resObject = $this->modx->getObject('modResource', array('pagetitle' => trim($pagetitle)));\n if ($resObject) {\n $this->elements[] = $resObject;\n }\n }\n }\n /* add children of from pagetitle array to $this->elements */\n if (!empty($this->parents)) {\n foreach($this->parents as $parentId) {\n $parent = $this->modx->getObject('modResource', $parentId);\n if ($parent) {\n if ($this->includeParents) {\n $this->elements[] = $parent;\n }\n $children = $parent->getMany('Children');\n if (!empty ($children)) {\n $this->elements = array_merge($this->elements,$children);\n }\n }\n }\n\n }\n }", "public function getResources($group) {\n $resources = $this->request('GET', $group);\n\n // Capitalize all resources before sorting because some are already caps.\n $resources = array_map('strtoupper', $resources);\n sort($resources);\n return $resources;\n }", "protected function collectByNamespace(): Collection\n {\n // todo\n // launch resource-reader\n // which should traverse the namespace to find all resources\n // and later might have caching\n\n return new Collection;\n }", "public function getResources() {\n\t\treturn $this->getRouteDocumentation()->groupBy('resource');\n\t}", "function c4m_content_feed_groups_format_rss($groups) {\n $items = array();\n foreach ($groups->getIterator() as $item) {\n // Skip unpublished content.\n if ($item->status->value() != NODE_PUBLISHED) {\n continue;\n }\n\n $item_title = $item->title->value();\n $item_link = $item->url->value();\n $item_body = c4m_content_feed_convert_relative_links($item_link, $item->c4m_body->value->value());\n $item_file = isset($item->c4m_media) ? $item->c4m_media->value() : FALSE;\n\n $args = array(\n 'category' => t('Group'),\n 'pubDate' => format_date($item->created->value(), 'custom', 'r'),\n 'topics' => c4m_content_feed_format_topics($item->c4m_vocab_topic),\n 'geo' => c4m_content_feed_format_geo($item->c4m_vocab_geo),\n );\n $args[] = c4m_content_feed_format_rss_guid($item);\n\n if ($item_file) {\n $args[] = c4m_content_feed_format_rss_image($item_file);\n }\n\n $items[] = format_rss_item($item_title, $item_link, $item_body, $args);\n }\n return implode($items);\n}", "private function getUserResources()\n {\n $result = array();\n $userdata = $this->get('security.context')->getToken()->getUser();\n $groups = $userdata->getUserGroups()->toArray();\n foreach ($groups as $grp) {\n $resources = $grp->getResources();\n foreach ($resources as $res) {\n $result[$res->getId()] = $res->getName();\n }\n }\n\n return $result;\n }", "public function getAttributeGroupElements(): array;", "public function setResourceGroups() {\n $attributted = array();\n $groups = $this->modx->getCollection('modResourceGroupResource', array( 'document' => $this->object->get('id') ));\n if($groups){\n foreach($groups as $group){\n $attributted[] = $group->get('id');\n }\n }\n $nbAttributted = count($attributted);\n $resourceGroups = $this->getProperty('resource_groups', array());\n $nbResourceGroups = count($resourceGroups); \n if($nbResourceGroups > 0){\n /* assigning to group */\n foreach($resourceGroups as $id){\n if(!in_array($id, $attributted)){\n $resourceGroupResource = $this->modx->newObject('modResourceGroupResource');\n $resourceGroupResource->set('document_group',$id);\n $resourceGroupResource->set('document',$this->object->get('id'));\n if ($resourceGroupResource->save()) {\n $this->modx->invokeEvent('OnResourceAddToResourceGroup',array(\n 'mode' => 'resource-update',\n 'resource' => &$this->object,\n 'resourceGroup' => &$resourceGroup,\n ));\n }\n }\n }\n } \n if($nbAttributted > 0){\n /* if removing access to group */\n foreach($attributted as $id){\n if(!in_array($id, $resourceGroups)){\n $resourceGroupResource = $this->modx->getObject('modResourceGroupResource',array(\n 'document_group' => $id,\n 'document' => $this->object->get('id'),\n ));\n if ($resourceGroupResource && $resourceGroupResource instanceof modResourceGroupResource) {\n if ($resourceGroupResource->remove()) {\n $this->modx->invokeEvent('OnResourceRemoveFromResourceGroup',array(\n 'mode' => 'resource-update',\n 'resource' => &$this->object,\n 'resourceGroup' => &$resourceGroup,\n ));\n }\n }\n }\n }\n } \n return $resourceGroups;\n }", "public function generateSitemaps(): array\n {\n if (0 == $this->getDataCollector()->getCount()) {\n return [];\n }\n\n $groups = $this->getDataCollector()->getGroups();\n $currentGroup = 0;\n $files = [];\n\n foreach ($groups as $group) {\n $groupNo = 0;\n $filesInGroup = 0;\n ++$currentGroup;\n\n if ($this->getDataCollector()->getGroupCount($group) > 0) {\n $this->getXml()->openSitemap(\n $group . $this->getSeparator() . $groupNo . self::EXT,\n $this->getDataCollector()->getExtensions()\n );\n $files[$group . $this->getSeparator() . $groupNo . self::EXT] = null;\n\n while ($element = $this->getDataCollector()->fetch($group)) {\n $this->getXml()->addUrl($element);\n ++$filesInGroup;\n\n if (isset($element['lastmod'])) {\n if ($files[$group . $this->getSeparator() . $groupNo . self::EXT]) {\n if (\n strtotime($element['lastmod']) >\n strtotime($files[$group . $this->getSeparator() . $groupNo . self::EXT])\n ) {\n $files[$group . $this->getSeparator() . $groupNo . self::EXT] = $element['lastmod'];\n }\n } else {\n $files[$group . $this->getSeparator() . $groupNo . self::EXT] = $element['lastmod'];\n }\n }\n\n // self::SITEMAP_MAX_SIZE - 20 for buffer for close tag\n if (\n $filesInGroup >= self::ITEM_PER_SITEMAP ||\n $this->getXml()->getSitemapSize() >= (self::SITEMAP_MAX_SIZE - 20)\n ) {\n $this->getXml()->closeSitemap();\n\n if (!$this->getDataCollector()->isLast($group)) {\n ++$groupNo;\n $filesInGroup = 0;\n $this->getXml()->openSitemap(\n $group . $this->getSeparator() . $groupNo . self::EXT,\n $this->getDataCollector()->getExtensions()\n );\n $files[$group . $this->getSeparator() . $groupNo . self::EXT] = null;\n }\n }\n }\n\n $this->getXml()->closeSitemap();\n }\n }\n\n if ($this->isUseCompression() && [] !== $files) {\n $this->compressFiles($this->getSitepamsTempDirectory(), $files);\n }\n\n return $files;\n }", "public function getAllInstances()\n\t{\n\t\t$instances = [];\n\t\t\n\t\tforeach ($this->resources as $key => $namespace) \n\t\t{\n\t\t\t$obj = new $namespace;\n\t\t\t$instances[] = $obj;\n\t\t}\n\n\t\treturn $instances;\n\t}", "function get_servicegroup_objects_xml_output($request_args)\n{\n $output = \"\";\n\n $totals = grab_array_var($request_args, 'totals', false);\n\n $servicegroups = get_data_servicegroup($request_args);\n \n if (!empty($servicegroups)) {\n\n $output .= \"<servicegrouplist>\\n\";\n\n if ($totals) {\n $servicegroups = $servicegroups[0];\n $count = empty($servicegroups['total']) ? 0 : $servicegroups['total'];\n $output .= \" <recordcount>\" . $count . \"</recordcount>\\n\";\n } else {\n\n $output .= \" <recordcount>\" . count($servicegroups) . \"</recordcount>\\n\";\n\n foreach ($servicegroups as $rs) {\n\n $output .= \" <servicegroup id='\" . get_xml_db_field_val($rs, 'object_id') . \"'>\\n\";\n $output .= get_xml_db_field(2, $rs, 'instance_id');\n $output .= get_xml_db_field(2, $rs, 'servicegroup_name');\n $output .= get_xml_db_field(2, $rs, 'is_active');\n $output .= get_xml_db_field(2, $rs, 'config_type');\n $output .= get_xml_db_field(2, $rs, 'alias');\n $output .= \" </servicegroup>\\n\";\n\n }\n }\n\n $output .= \"</servicegrouplist>\\n\";\n }\n\n return $output;\n}", "protected function collectPagesXml()\n {\n $items = [];\n\n $modules = $this->moduleResolver->getModulesPath();\n foreach ($modules as $modulePath) {\n $modulePathArray = explode('/', $modulePath);\n $module = array_pop($modulePathArray);\n\n if (!is_readable($modulePath . '/Test/Page')) {\n continue;\n }\n\n $dirIterator = new \\RegexIterator(\n new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($modulePath . '/Test/Page', \\FilesystemIterator::SKIP_DOTS)\n ),\n '/.xml$/i'\n );\n\n foreach ($dirIterator as $fileInfo) {\n /** @var $fileInfo \\SplFileInfo */\n $fileName = $fileInfo->getBasename('.xml');\n $modulePath = str_replace('\\\\', '/', $modulePath);\n $folderPath = str_replace('\\\\', '/', $fileInfo->getPath());\n $area = trim(str_replace($modulePath . '/Test/Page', '', $folderPath), '/');\n\n $key = ($area ? \"{$area}_\" : '') . $fileName;\n $items[$key][] = [\n 'file_name' => $fileName,\n 'area' => $area,\n 'real_path' => str_replace('\\\\', '/', $fileInfo->getRealPath()),\n 'module' => $module,\n ];\n }\n }\n\n return $items;\n }", "function getResources() {\n\t\t$domain = $this->domain;\n\t\t$uri = \"https://apps-apis.google.com/a/feeds/calendar/resource/2.0/$domain/\";\n\t\tlist($resources, $next) = $this->getResourcePage($uri);\n\t\twhile ($next) {\n\t\t\tlist($nextresources, $next) = $this->getResourcePage($next);\n\t\t\tif (is_array($nextresources)) {\n\t\t\t\t$resources = array_merge($resources, $nextresources);\n\t\t\t}\n\t\t}\n\t\tksort($resources);\n\t\treturn $resources;\n\t}", "public function retrieveAllGroups();", "public function allObjects()\n\t{\n\t\t$r = new Graphite_ResourceList( $this );\n\t\tforeach( $this->t[\"op\"] as $object_uri=>$foo )\n\t\t{\n\t\t\t $r[] = new Graphite_Resource( $this, $object_uri );\n\t\t}\n\t\treturn $r;\n\t}", "public function elementActionAll(Request $request) {\n\n $data = [];\n\n foreach ($this->elementCollection() as $collection) {\n $base_name = str_replace('cohesion.assets.', '', $collection->collection);\n\n // Using the status /Drupal:keyValue here instead of the one from the\n // collection so the base collection can be modified in the loop.\n $assetLibrary = \\Drupal::keyValue($collection->collection);\n list($error, $group_data, $message) = \\Drupal::service('settings.endpoint.utils')->getAssets($assetLibrary, '__ALL__', $base_name, FALSE);\n\n // Patch in any custom element data.\n switch ($base_name) {\n case 'elements':\n $group_data = \\Drupal::service('custom.elements')->patchElementList($group_data);\n break;\n\n case 'element_forms':\n $group_data = \\Drupal::service('custom.elements')->patchElementBuilderForms($group_data);\n break;\n\n case 'form_defaults':\n $group_data = \\Drupal::service('custom.elements')->patchFormDefaults($group_data);\n break;\n\n case 'element_properties':\n $group_data = \\Drupal::service('custom.elements')->patchElementProperties($group_data);\n break;\n\n case 'property_group_options':\n $group_data = \\Drupal::service('custom.elements')->patchProperyGroupOptions($group_data);\n break;\n\n case 'static_assets':\n $group_data['api-urls'] = \\Drupal::service('custom.elements')->patchApiUrls($group_data['api-urls']);\n break;\n }\n\n // And finalize.\n if (!$error) {\n $data[$base_name] = $group_data;\n }\n else {\n $data = []; // Reset data if error found\n break;\n }\n }\n // Send response.\n return new CohesionJsonResponse([\n 'status' => !$error ? 'success' : 'error',\n 'data' => $data,\n ]);\n }", "private function getAclResources()\n {\n if ($this->aclResources !== null) {\n return $this->aclResources;\n }\n $aclFiles = Files::init()->getConfigFiles('acl.xml', []);\n $xmlResources = [];\n array_map(function ($file) use (&$xmlResources) {\n $config = simplexml_load_file($file[0]);\n $nodes = $config->xpath('.//resource/@id') ?: [];\n foreach ($nodes as $node) {\n $xmlResources[(string)$node] = $node;\n }\n }, $aclFiles);\n $this->aclResources = $xmlResources;\n return $this->aclResources;\n }", "private function createResourceGroups()\n {\n foreach ($this->api->getServices() as $service) {\n $this->resourceGroups[] = new ResourceGroup($service);\n }\n }", "public function getResources()\n {\n return $this->subResources;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to check current organization is Hybrid or Edge.
private function isHybrid(): bool { return ClientInterface::APIGEE_ON_GCP_ENDPOINT === $this->getClient()->getEndpoint(); }
[ "abstract function is_agency();", "public function isOrganizationApigeeX(): bool;", "public function isCorporateSite()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n $host = $request->server->get('HTTP_HOST', '');\n \n $isCorporate = ((substr($host, 0, 9) == 'corporate') || $request->attributes->get('isRestCorporate') == 'true');\n \n return $isCorporate;\n }", "public function isHiringOrganization();", "public function isOrganisationOther()\n {\n $types = [\n \\Common\\RefData::ORG_TYPE_OTHER,\n ];\n return in_array($this->getOrganisationType(), $types, false);\n }", "abstract public function isUserOrganization();", "public function is_network_mode() {\n\t\t// Bail if plugin is not network-active.\n\t\tif ( ! $this->is_network_active() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$site = get_site( get_current_blog_id() );\n\t\t$network = get_network( $site->network_id );\n\n\t\t// Use network mode when the site's domain is the same as the network's domain.\n\t\treturn $network && $site->domain === $network->domain;\n\t}", "public function isUserOrganization();", "public function isProtocolIndependent()\n {\n return is_null($this->scheme);\n }", "public function isNetworkMode(): bool\n\t{\n\t\t// Bail if plugin is not network-active.\n\t\tif(!$this->isNetworkActive())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$site = get_site(get_current_blog_id());\n\n\t\tif(is_null($site))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$network = get_network($site->network_id);\n\n\t\t// Use network mode when the site's domain is the same as the network's domain.\n\t\treturn $network && $site->domain === $network->domain;\n\t}", "protected function checkBrowserEdge()\n {\n if ($name = (stripos($this->_agent, 'Edge/') !== false ? 'Edge' : ((stripos($this->_agent, 'Edg/') !== false || stripos($this->_agent, 'EdgA/') !== false) ? 'Edg' : false))) {\n $aresult = explode('/', stristr($this->_agent, $name));\n if (isset($aresult[1])) {\n $aversion = explode(' ', $aresult[1]);\n $this->setVersion($aversion[0]);\n $this->setBrowser(BrowserInterface::BROWSER_EDGE);\n if (stripos($this->_agent, 'Windows Phone') !== false || stripos($this->_agent, 'Android') !== false) {\n $this->setMobile(true);\n }\n return true;\n }\n }\n return false;\n }", "public function fromAlipayApp()\n {\n return $this->request->getParam('_platform') === 'my';\n }", "public function isOrganization()\n {\n return in_array(Role::ORGANIZATION, $this->roles()->lists('id')->all());\n }", "function uses_gateway($EM_Booking){\n\t\treturn (!empty($EM_Booking->booking_meta['gateway']) && $EM_Booking->booking_meta['gateway'] == $this->gateway);\n\t}", "public function hasOsType()\n {\n return $this->get(self::OSTYPE) !== null;\n }", "public function isGeneral()\n {\n return $this->separation->getOrientations()->count() == 1;\n }", "public static function isOriginPlatform()\n {\n if (!isset($_SERVER['HTTP_ORIGIN'])) {\n return false;\n }\n return strpos($_SERVER['HTTP_ORIGIN'], 'platform');\n }", "public function is_sso_host() {\n\t\t\treturn $this->sso_host === $this->host;\n\t\t}", "public function supportsOrganizations(): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a list of default constructor arguments.
protected function getDefaultConstructorArguments() { return array('I am an assertion', true); }
[ "abstract protected function getDefaultConstructorArguments();", "public function get_constructor_args();", "public function getConstructorArguments();", "public function getConstructorArguments() {}", "public static function getDefaultParameters()\n {\n return array();\n }", "public function getConstructorArgs()\n {\n return $this->constructorArgs;\n }", "private function defaultArguments()\n {\n return [\n 'resolver' => Mockery::mock(SymfonyResolver::class),\n 'tokens' => null,\n 'checker' => null,\n 'key' => null,\n 'endpoint' => null,\n 'callbacks' => true,\n 'user' => true,\n 'type' => null,\n 'version' => true,\n 'batch' => null,\n 'hostname' => null,\n 'code' => true,\n 'strip' => null,\n 'project' => null,\n 'root' => $this->rootPath,\n 'env' => null,\n 'stage' => null,\n 'stages' => null,\n 'filters' => null,\n 'shutdownStrategy' => null,\n 'stripPathRegex' => null,\n 'projectRootRegex' => null,\n 'guzzle' => null,\n 'memoryLimitIncrease' => false,\n 'discardClasses' => [],\n 'redactedKeys' => [],\n 'featureFlags' => [],\n 'maxBreadcrumbs' => null,\n ];\n }", "static function default_params() {\n return array();\n }", "private function get_default_arguments()\n {\n return [\n 'type'\t\t\t=> 'string',\n 'description'\t=> '',\n 'single'\t\t=> true,\n 'show_in_rest'\t=> true\n ];\n }", "public function getConstructorArguments()\n {\n return $this->constructorArguments;\n }", "public function getConstructorParams(): array;", "protected function getConstructorArgs()\n {\n return $this->resolver->getReflected()->getConstructor()->getParameters();\n }", "public function provideValidCtorArguments()\n {\n return array(\n array( $this->createTwoDimArrayConfigArgument() ),\n array( $this->createStdClassConfigArgument() )\n );\n }", "protected function _getDefaultConstructorDefinition()\n {\n return [\n 'name' => '__construct',\n 'parameters' => [\n ['name' => 'objectManager', 'type' => '\\\\' . \\Magento\\Framework\\ObjectManagerInterface::class],\n ['name' => 'instanceName', 'defaultValue' => $this->getSourceClassName()],\n ],\n 'body' => \"\\$this->_objectManager = \\$objectManager;\\n\\$this->_instanceName = \\$instanceName;\",\n 'docblock' => [\n 'shortDescription' => ucfirst(static::ENTITY_TYPE) . ' constructor',\n 'tags' => [\n [\n 'name' => 'param',\n 'description' => '\\Magento\\Framework\\ObjectManagerInterface $objectManager',\n ],\n ['name' => 'param', 'description' => 'string $instanceName'],\n ],\n ]\n ];\n }", "abstract protected function getDefaultArgs();", "protected function init_defaults() {\n\t\t$this->arguments_defaults = array();\n\t}", "protected static function get_default_args() {\n\t\treturn array(\n\t\t\t'userpwd' => HS_API_KEY . ':X',\n\t\t);\n\t}", "public function defaultValues() {\n\t\treturn array();\n\t}", "public function getDefaultParameters()\n {\n return $this->defaultParameters;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the code collaborateur dest.
public function getCodeCollaborateurDest() { return $this->codeCollaborateurDest; }
[ "public function getCodeCollaborateurDest(): ?string {\n return $this->codeCollaborateurDest;\n }", "public function getCodeCollaborateur() {\n return $this->codeCollaborateur;\n }", "public function getCodeCollaborateur(): ?string {\n return $this->codeCollaborateur;\n }", "public function getCodeCollDest(): ?string {\n return $this->codeCollDest;\n }", "public function getCodeLiaisonDest(): ?string {\n return $this->codeLiaisonDest;\n }", "public function getCidadeDestino()\n {\n return $this->cidadeDestino;\n }", "public function getDestino()\n {\n return $this->destino;\n }", "public function getDestino()\r\n {\r\n return $this->destino;\r\n }", "public function getCodeCollabDst() {\n return $this->codeCollabDst;\n }", "public function getCommDest()\n\t{\n\t\treturn $this->comm_dest;\n\t}", "public function getDest()\n\t{\n\t\treturn $this->dest;\n\t}", "function getId_ctr_destino()\n {\n if (!isset($this->iid_ctr_destino) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_ctr_destino;\n }", "public function getDestCity()\n\t{\n\t\treturn $this->dest_city;\n\t}", "public function getPlanDestino() \n {\t \t\t \n \t$oPlanEstudio = Doctrine_Core::getTable('PlanesEstudios')->find($this->getIdplandestino());\n\n\t\treturn $oPlanEstudio;\t\t\n }", "public function getCodeOrgBtpdadsu() {\n return $this->codeOrgBtpdadsu;\n }", "public function testSetCodeCollaborateurDest() {\n\n $obj = new AppelsEnCours();\n\n $obj->setCodeCollaborateurDest(\"codeCollaborateurDest\");\n $this->assertEquals(\"codeCollaborateurDest\", $obj->getCodeCollaborateurDest());\n }", "public function testSetCodeCollaborateurDest() {\n\n $obj = new TravauxEnCours();\n\n $obj->setCodeCollaborateurDest(\"codeCollaborateurDest\");\n $this->assertEquals(\"codeCollaborateurDest\", $obj->getCodeCollaborateurDest());\n }", "public function getDestActivo()\n {\n return $this->destActivo;\n }", "public function getColaborador()\n {\n return $this->colaborador;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Product Type ID
public function setTypeId(string $value): ProductDataInterface;
[ "function setCurrentProductTypeID($ptid)\n {\n if ($this->isCorrectProductTypeId($ptid))\n {\n $this->currentProductTypeID = $ptid;\n }\n }", "public function setProductType($productType);", "public function setTypeId( $typeid );", "public function set_product_type($product_type)\n {\n }", "public function updateProductType($id, $data);", "public function setTypeID($value) {\n\t\t$this->_type_id = $value;\n\t}", "public function setType_id($type_id)\n {\n $this->type_id = $type_id;\n }", "public function setProductType ($value){\n\t\t$this->fields->item_XX_digital = $value;\n\t}", "public function setTypeId($type_id)\n {\n $this->type_id = $type_id;\n }", "public function setProductType($type)\n {\n $this->originalProductType = $type;\n \n $country = $this->getCustomerCountry();\n \n // If product is not downloadable, new law is not applicable\n if (!in_array($type, $this->downloadable))\n {\n $this->isNewLawApplicable = false;\n }\n \n if (!isset($this->rates[$country][$type]))\n {\n $type = self::STANDARD;\n }\n \n $this->productType = $type;\n }", "public function register_product_type() {\n \n require_once ( TM_PATHWCVIDEO . 'components/product/WC_Product_Type.php');\n }", "public function setProductEntityTypeId($value)\n {\n $this->_productEntityTypeId = $value;\n return $this;\n }", "private function getProductEntityTypeId()\r\n {\r\n return Mage::getModel('catalog/product')->getResource()->getEntityType()->getId();\r\n }", "function setDataType( $type )\n {\n if ( get_class( $type ) == \"ezdatatype\" )\n {\n $this->DataTypeID = $type->id(); \n }\n }", "function setProduct( &$value )\r\n {\r\n if ( is_a ( $value, \"eZProduct\" ) )\r\n $this->ProductID = $value->id();\r\n else\r\n $this->ProductID = $value;\r\n }", "public function setProductTypeInstance(Mage_Catalog_Model_Product $product)\n {\n $type = $product->getTypeId();\n if (!isset($this->_productTypeInstances[$type])) {\n $this->_productTypeInstances[$type] = Mage::getSingleton('catalog/product_type')\n ->factory($product, true);\n }\n $product->setTypeInstance($this->_productTypeInstances[$type], true);\n }", "public function set_type_id($type_id)\n {\n $this->set_default_property(self::PROPERTY_TYPE_ID, $type_id);\n }", "public function setIdProduct($idProduct){\n \t$this->idProduct = $idProduct;\n }", "function erp_acct_get_product_type_id_by_product_id( $product_id ) {\n global $wpdb;\n\n $type_id = $wpdb->get_var( $wpdb->prepare( \"SELECT product_type_id FROM {$wpdb->prefix}erp_acct_products WHERE id = %d\", $product_id ) );\n\n return $type_id;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make an instance of a User Manager.
protected function makeUserManager() { return app() ->makeWith( $this->requiredManager(), ['command' => $this->command] ) ->setValues( $this->username, $this->password, $this->database ); }
[ "private function getUserManager()\n {\n return $this->get('fos_user.user_manager');\n }", "protected function getUserManager()\n {\n return $this->getServiceLocator()->get(UserManager::class);\n }", "protected function getMaker_AutoCommand_MakeUserService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Command\\\\MakerCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\MakerInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Maker\\\\AbstractMaker.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Maker\\\\MakeUser.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Security\\\\UserClassBuilder.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Security\\\\SecurityConfigUpdater.php';\n\n $a = ($this->privates['maker.file_manager'] ?? $this->getMaker_FileManagerService());\n\n $this->privates['maker.auto_command.make_user'] = $instance = new \\Symfony\\Bundle\\MakerBundle\\Command\\MakerCommand(new \\Symfony\\Bundle\\MakerBundle\\Maker\\MakeUser($a, new \\Symfony\\Bundle\\MakerBundle\\Security\\UserClassBuilder(), ($this->privates['maker.security_config_updater'] ?? ($this->privates['maker.security_config_updater'] = new \\Symfony\\Bundle\\MakerBundle\\Security\\SecurityConfigUpdater())), ($this->privates['maker.doctrine_helper'] ?? $this->getMaker_DoctrineHelperService()), ($this->privates['maker.entity_class_generator'] ?? $this->getMaker_EntityClassGeneratorService())), $a, ($this->privates['maker.generator'] ?? $this->getMaker_GeneratorService()));\n\n $instance->setName('make:user');\n\n return $instance;\n }", "protected function getUserManager() {\n return $this->container->get('fos_user.user_manager');\n }", "public static function user()\n {\n return new static::$userModel;\n }", "static function getInstance() {\n\t\treturn new mofilmUserManager();\n\t}", "public function loginAsManager()\n {\n $user = User::factory(['type' => 'manager'])->create();\n $this->actingAs($user);\n }", "public function getUserManager() {\n return $this->container->get('fos_user.user_manager');\n }", "public function getUserInstance()\n {\n $class = $this->getUserClass();\n\n return new $class;\n }", "public function getUserManager()\n {\n return $this->application['silex_user.user_manager'];\n }", "public function createAUserAndBringIt()\n {\n return factory(User::class)->create();\n }", "public function getUserManager()\n\t{\n\t\treturn $this->userManager;\n\t}", "public static function get_instance() {\n\t\tnew WUS_User();\n\t}", "private function getUserManager($authID, $email = null) {\n\n // if the UserManager is null, create a new one using one or both\n // parameters\n if($this->userManager == null) {\n $userManagerClass = $this->getParameter('user_manager_class');\n $this->userManager = new $userManagerClass($authID, $email);\n }\n return $this->userManager;\n }", "public function getUserInstance()\n {\n $class = config('ziAuditable.users.model', User::class);\n\n return new $class;\n }", "protected function getSonata_User_Manager_UserService()\n {\n return $this->services['sonata.user.manager.user'] = new \\Sonata\\UserBundle\\Entity\\UserManagerProxy('AppBundle\\\\Entity\\\\User\\\\User', ${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'}, ${($_ = isset($this->services['fos_user.user_manager']) ? $this->services['fos_user.user_manager'] : $this->get('fos_user.user_manager')) && false ?: '_'});\n }", "protected function getUserModel() {\n return new User();\n }", "protected function getUserManager() {\n $container = NManagerNotificationBundle::getContainer();\n return $container->get('fos_user.user_manager');\n // return $this->container->get('fos_user.user_manager');\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defined BIND_SESSION_ENCRYPTCONFIRM_REQUEST() method validate confirm password register new user
protected static function BIND_SESSION_ENCRYPTCONFIRM_REQUEST($BIND_SESSION_ENCRYPTCONFIRM_REQUEST) { $BSER = $BIND_SESSION_ENCRYPTCONFIRM_REQUEST; $CONFIRMPASS_HASCONTAINS = isset($BIND_SESSION_ENCRYPTCONFIRM_REQUEST['CONFIRMPASS_HASCONTAINS']); $CONFIRMPASS_ERROR = isset($BIND_SESSION_ENCRYPTCONFIRM_REQUEST['CONFIRMPASS_HASERROR']); if((!is_null($BSER ) || !empty($BSER )) && $CONFIRMPASS_ERROR == true ) : return $BIND_SESSION_ENCRYPTCONFIRM_REQUEST['CONFIRMPASS_HASERROR']; elseif((!is_null($BSER ) || !empty($BSER )) && $CONFIRMPASS_HASCONTAINS == true ) : return $BIND_SESSION_ENCRYPTCONFIRM_REQUEST['CONFIRMPASS_HASCONTAINS']; endif; }
[ "public function onRegistrationConfirm(GetResponseUserEvent $event) {\n\t\trequire_once('UKM/inc/password.inc.php');\n\t\t\n\t\t$tokenGenerator = $this->container->get('fos_user.util.token_generator');\n\t\t$password = UKM_ordpass(true); // true gives numbers before words\n\t\t$event->getUser()->setPlainPassword( $password );\n\n \t\t$text = $this->container->getParameter('ukmdelta.sms.password.created');\n\t\t\n\t\t$UKMSMS = $this->container->get('ukmsms');\n try {\n\t $UKMSMS->sendSMS( $event->getUser()->getPhone(), str_replace('#code', $password, $text) );\n\t } catch( Exception $e ) {\n\t\t $this->container->get('session')->getFlashBag()->add('error', 'Kunne ikke sende engangskode på SMS ('.$e->getMessage().')');\n\t }\n\n\t}", "public function request_new_password(){\r\n $reqs = new \\Required_Parameters(array(),array(\"user_email_address\"));\r\n return $this->validate_output($reqs,false,null,array($this,\"request_new_password_callback\"),false);\r\n }", "function request_new_password() {\n\t\t//\n\t}", "public function confirmPassword()\n {\n $query = $this->request->getQueryParams();\n if ( ! empty($query['key']) && ! empty($query['request'])) {\n $email = base64_decode($query['request']);\n if ($query['key'] === md5(date('Ymd') . $email)) {\n $this->Flash->confirmPassword(null, [\n 'params' => [\n 'request' => $query['request'],\n 'key' => $query['key'],\n ],\n ]);\n\n return $this->redirect(['action' => 'home']);\n } else {\n $this->Flash->greatMessage(__(USER_MSG_0035));\n }\n } else {\n $this->Flash->error(__(USER_MSG_0022));\n }\n\n return $this->redirect(['action' => 'home']);\n }", "public function executePasswordRequest()\n\t{\n\t\tif ($this->getRequest()->getMethod() != sfRequest::POST)\n\t\t{\n\t\t\t// display the form\n\t\t\treturn sfView::SUCCESS;\n\t\t}\n\n\t\t// handle the form submission\n\t\t$c = new Criteria();\n\t\t$c->add(afGuardUserPeer::USERNAME, $this->getRequestParameter('email'));\n\t\t$user = afGuardUserPeer::doSelectOne($c);\n\n\t\t// email exists?\n\t\tif ($user)\n\t\t{\n\n if ($user->getUsername()) {\n $parameters = array(\n 'userObj' => $user,\n 'email' => $user->getUsername(),\n 'subject' => sfConfig::get('app_afGuardPlugin_subject'),\n 'from' => sfConfig::get('app_afGuardPlugin_from'),\n \t'validate' => md5($user->getSalt().$user->getPassword())\n );\n\n afAutomailer::saveMail('afGuardAuth', 'sendPasswordResetConfirmation', $parameters);\n }\n\n\n\t\t\tsfProjectConfiguration::getActive()->loadHelpers(array(\"Url\",\"Tag\"));\n\t\t\t$result = array('success' => true,'message'=>'Confirmation message has been sent to the email address associated with this account. ');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = array('success' => false,'message'=>'There is no user with this email address. Please try again!');\n\t\t}\n\n\t\t$result = json_encode($result);\n\t\treturn $this->renderText($result);\n\t}", "public function passwordConfirmationTest ()\n {\n if ($this->fields['password'] != $this->fields['passwordConfirmation']){\n $this->validationErrors[] = \"Confirmation password and password do not match.\";\n }\n }", "public function confirmPassword()\n {\n // Check password and confirm_password are same or not\n return ($this->data['User']['password'] == $this->data['User']['password2']);\n }", "abstract protected function getConfirmationSecret();", "function validPassword() {\r\n\t}", "public function confirm()\n\t{\n\t\t$this->add('confirm', 'required', true, 'Password is required.');\n\t\t$this->add('confirm', 'regexp', '#^[a-zA-Z0-9_\\-]*$#', 'Bad Password format.');\n\t\t$this->add('confirm', 'min', 4, 'Bad Password length, at least 4 characters.');\n\t\t$this->add('confirm', 'max', 30, 'Bad Password length, no more than 30 characters.');\n\t\t$this->add('confirm', 'isEqualToValidator', 'password', 'Password and Confirm Password have to be the same.');\n\n\t\t$this->setInformation('confirm', 'Confirm Password desciption, 4 to 30 characters...');\n\t}", "public function testConfirmRule() {\n\n\t\t// \n\t\t$rule = 'confirm:password';\n\n\t\t$key1 = 'password'; \n\t\t$value1 = 'nemanja123';\n\n\t\t$key2 = 'password2';\n\t\t$value2 = 'nemanja123'; // password is the same\n\t\t\n\t\t$key3 = 'password3';\n\t\t$value3 = 'nemanja123456'; // password different\n\t\t\n\t\t$msg = 'Password Must Be Confirmed';\n\n\t\t$this->request = [\n\t\t\t$key1 => $value1,\n\t\t\t$key2 => $value2,\n\t\t\t$key3 => $value3\n\t\t];\n\n\t\t$validator = new Validator($this->request);\n\t\t$validator->setRule($key2, $rule, $msg);\n\t\t$validator->setRule($key3, $rule, $msg);\n\t\t$validator->validateForm();\n\n\t\t$errors = $validator->getErrors();\n\n\t\t$this->assertNotContains(['name' => $key2, 'message' => $msg], $errors); \n\t\t// error is not in the array since values are equal\n\n \t\t$this->assertContains(['name' => $key3, 'message' => $msg], $errors); \n \t\t// error is in the array since values are not equal\n\n\t}", "private function matchPasswordAndConfirmPassword(){\n if ($this->newPassword===$this->confirmNewPassword){\n return true;\n }\n return false;\n }", "public function activatenewpasswordAction()\n {\n $newKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME, null);\n $userId = $this->getRequest()->getParam(User::COLUMN_USERID, null);\n\n $user = $this->_getUserFromIdAndKey($userId, $newKey);\n if(!$user){\n Globals::getLogger()->info(\"New password activation: user retrieval failed - userId=$userId, key=$newKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_SUCH_USER));\n }\n\n $user->{User::COLUMN_PASSWORD} = $user->newPassword;\n $user->newPassword = '';\n $user->activationKey = '';\n\n $id = $user->save();\n if($id != $user->{User::COLUMN_USERID}){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NEWPASSWORD_ACTIVATION_FAILED));\n }\n\n Utils::deleteCookie(User::COOKIE_MD5);\n Utils::deleteCookie(User::COOKIE_USERNAME);\n Utils::deleteCookie(User::COOKIE_REMEMBER);\n\n $this->_savePendingUserIdentity($userId);\n\n $this->_helper->redirectToRoute('userupdate',array('newPassword'=>true));\n }", "public function confirm() {\n $user_id = $_GET['id'];\n $token = $_GET['token'];\n $userConfirmed = $this->model->confirmToken($user_id, $token);\n\n if ($userConfirmed) {\n $this->model->setFlash('success', 'Votre compte a bien été validé');\n // $_SESSION['flash']['success'] = 'Votre compte a bien été validé';\n header('location:index.php?controller=security&action=formLogin');\n } else {\n $this->model->setFlash('danger', \"Ce token n'est plus valide\");\n // $_SESSION['flash']['danger'] = \"Ce token n'est plus valide\";\n header('location:index.php?controller=security&action=formRegister');\n }\n }", "public function checkPassword() {}", "public function otp_verify () {\n\n $entered_otp = $_POST['otp'];\n $hash = $_SESSION['prec']['otp'];\n $userid = $_SESSION['prec']['user_id'];\n\n if (password_verify($entered_otp, $hash)) {\n $user = array(\n 'password'=>$_SESSION['prec']['new_pass']\n );\n if($this->user_model->update_user($user,$userid)) {\n echo json_encode(array('stat'=>true));\n } else {\n echo json_encode(array('success'=>false, 'err'=>'Password not updated.'));\n }\n } else {\n echo json_encode(array('stat'=>false, 'form_error'=>'Invalid OTP'));\n }\n }", "function verification_password_confirmation($pwd, $pwdbis) {\n $error = 0;\n if ($pwd !== $pwdbis) {\n $error = 1;\n }\n return $error;\n}", "public function setPassword(){\n $password=$this->request->getVar('pass');\n $correct=$this->request->getVar('passC');\n if(!$this->validate([\"pass\"=>\"required|max_length[20]|min_length[6]|matches[passC]|alpha_numeric_space\"])||$password!=$correct){\n echo \"Validation failed\";\n return;\n }\n $user=$this->session->get('userId');\n $model=new RegisteredUser();\n $model->setPassword($user,$password);\n echo \"Password has been successfully changed\";\n\n }", "public function registration() : int{\n if (isset($_POST['username']) && isset($_POST['pass']) && isset($_POST['passVerify']) ){\n $username = SecurityController::sanitize($_POST['username']);\n $pass = SecurityController::checkPass(SecurityController::sanitize($_POST['pass']));\n $userManager = new UserManager();\n $user = $userManager->getByUsername(strtolower($username));\n if (is_null($user)) {\n if (!is_null($pass)){\n if ($pass === $_POST['passVerify']){\n if ($userManager->add($username,password_hash($pass,PASSWORD_BCRYPT))) {\n return 1;\n }\n else {\n return -1;\n }\n }\n else {\n return -2;\n }\n }\n else {\n return -3;\n }\n }\n else {\n return -4;\n }\n }\n return -5;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get first element of an array PHP have the reset() method which do pretty the same thing, but we have to use a variable reference as parameter so we cannot use an expression without a WARNING. "reset" is also not a great name for just retrieve the first element of an array. the FALSE return if array is empty is also weird. NULL by default is more logical.
function first(array $array, $valueIfEmpty = NULL) { $r = reset($array); return ($r === FALSE)?$valueIfEmpty:$r; }
[ "public function first(){\n\t\treturn reset($this->arr);\n\t}", "public function first() {\n\t\tif(!$this->array || count($this->array) == 0) return null;\n\t\t$sliced = array_slice($this->array, 0, 1);\n\t\tif($sliced && is_array($sliced)) return $sliced[0];\n\t\treturn NULL;\n\t}", "static function first( $array ) {\n return array_shift( $array );\n }", "function getFirstValue($array)\n {\n if (! is_array($array)) {\n return false;\n }\n return reset($array);\n }", "function enfant_get_first($data)\n{\n if (is_array($data)) {\n return reset($data);\n }\n}", "function array_value_first(array $array)\n {\n return $array ? array_values($array)[0] : null;\n }", "function first($array) {\n return $array[0];\n }", "function first( array $array ) {\n\n return $array[0];\n}", "function array_first ($array)\n{\n\t$single = array_slice (array_values ($array), 0, 1);\n\tif (count ($single))\n\t\treturn $single[0];\n}", "function array_key_first(array $array)\n {\n if (count($array)) {\n reset($array);\n return key($array);\n }\n\n return null;\n }", "public static function first(){\n\t\t// if items array is not empty return the first item, otherwise return null.\n\t\treturn static::count()? static::$items[0] : null;\n\t}", "function first(array $array, $count = null)\n{\n return $count ? \\array_slice($array, 0, $count, true) : \\array_shift($array);\n}", "public function getFirstElement() {\r\n\t\t$tmp = $this->toArray();\r\n\t\treset($tmp);\r\n\t\treturn current($tmp);\r\n\t}", "function array_key_first(array $array)\n {\n return $array ? array_keys($array)[0] : null;\n }", "protected function takeFirstElement($arr=[]){\n\t\tarray_shift($arr);\n\t\treturn $arr;\n\t}", "public function first() {\n\t\t\treturn (isset($this->arrItems[0]) ? $this->arrItems[0] : null);\n\t\t}", "function array_peek(array $array) {\n $cnt = count($array);\n return $cnt === 0 ? null : $array[$cnt - 1];\n }", "public static function first(){\n\t\t$args = func_get_args();\n\t\treturn current(array_filter( is_array($args[0]) ? $args[0] : $args ));\n\t}", "function first_value($arr)\n{\n\tforeach ($arr as $k=>$v) return $v;\n\treturn null;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch the npc quest handler instance.
public function npcQuestsHandler(): NpcQuestsHandler { return $this->npcQuestsHandler; }
[ "public function getHandler();", "public function get_questoes()\n {\n // loads the associated object\n if (empty($this->questoes))\n $this->questoes = new Questoes($this->questoes_id);\n \n // returns the associated object\n return $this->questoes;\n }", "public function get_owning_quest() {\n if (empty($this->instance->parentcontextid)) {\n return 0;\n }\n $parentcontext = context::instance_by_id($this->instance->parentcontextid);\n if ($parentcontext->contextlevel != CONTEXT_MODULE) {\n return 0;\n }\n $cm = get_coursemodule_from_id('quest', $parentcontext->instanceid);\n if (!$cm) {\n return 0;\n }\n return $cm->instance;\n }", "public function getQuestByType(int $type)\n {\n return $this->quests[$type];\n }", "public function getEntityHandler()\n {\n return $this->entityHandler;\n }", "abstract protected function getHandlerObject();", "function getHandler()\r\n\t{\r\n\t\treturn $this->_curl_handler;\r\n\t}", "public function getHandler() {\n return $this->drupal;\n }", "protected function _getSearchDataHandler()\n {\n return $this->getModelFromCache('XenForo_Model_Search')->getSearchDataHandler('kmk_faq_question');\n }", "private function getPlayer( )\n\t{\n\t\t$playerHandlerFileName = 'embedia' . $this->playerName . '.php';\n\t\t$file = dirname(__FILE__) . '/players/' . $playerHandlerFileName;\n\t\tif (file_exists($file))\n\t\t{\n\t\t\t// @TODO autoloaders sholud've picked this up !\n\t\t\trequire_once($file);\n\t\t\t$playerHandlerClass = 'embedia'.$this->playerName;\n\t\t\tif (class_exists($playerHandlerClass, false))\n\t\t\t{\n\t\t\t\treturn new $playerHandlerClass($this);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn INVALID_PLAYER_HANDLER;\n\t\t}\n\t}", "public function instantiate(string $handler) : QueryHandler;", "public function getHandler(string $observableClass): BaseHandler\n {\n return $this->handlers[$observableClass];\n }", "public function getSelectionHandler() {\n $options = [\n 'target_type' => $this->configuration['target_type'],\n // 'handler' key intentionally absent as we want the selection manager to\n // choose the best option.\n // @see \\Drupal\\Core\\Entity\\EntityReferenceSelection\\SelectionPluginManager::getInstance()\n 'handler_settings' => $this->configuration['handler_settings'],\n ];\n return \\Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);\n }", "function &getHandler($action)\n {\n atkimport(\"atk.handlers.atkactionhandler\");\n $handler = &atkActionHandler::getDefaultHandler($action);\n $handler->setNode($this);\n return $handler;\n }", "public function getHandler()\n {\n if (static::$_handler === null) {\n\n $requestConfig = array_merge([\n 'class' => 'yii\\httpclient\\Request',\n 'format' => Client::FORMAT_JSON,\n ], $this->requestConfig);\n\n $responseConfig = array_merge([\n 'class' => 'promocat\\rest\\components\\RestResponse',\n 'format' => Client::FORMAT_JSON\n ], $this->responseConfig);\n\n static::$_handler = new Client([\n 'baseUrl' => $this->baseUrl,\n 'requestConfig' => $requestConfig,\n 'responseConfig' => $responseConfig\n ]);\n }\n\n return static::$_handler;\n }", "protected static function get_handler() {\n\t\t$type = self::get_option('bbsub_handler_type', 'postmark');\n\t\t$options = self::get_option('bbsub_handler_options', array());\n\n\t\t// Get the appropriate handler\n\t\t$handler = self::get_handler_class($type);\n\t\t$handler = apply_filters('bbsub_handler_' . $type, new $handler($options), $options);\n\n\t\treturn $handler;\n\t}", "private static function GetHandler()\r\n {\r\n // Create a database connection only if one doesn?t already exist\r\n if (!isset(self::$_mHandler))\r\n {\r\n // Execute code catching potential exceptions\r\n try\r\n {\r\n // Create a new PDO class instance\r\n self::$_mHandler =\r\n new PDO(PDO_DSN, DB_USERNAME, DB_PASSWORD,\r\n array(PDO::ATTR_PERSISTENT => DB_PERSISTENCY, PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\r\n\r\n // Configure PDO to throw exceptions\r\n self::$_mHandler->setAttribute(PDO::ATTR_ERRMODE,\r\n PDO::ERRMODE_EXCEPTION);\r\n }\r\n catch (PDOException $e)\r\n {\r\n // Close the database handler and trigger an error\r\n self::Close();\r\n trigger_error($e->getMessage(), E_USER_ERROR);\r\n }\r\n }\r\n\r\n // Return the database handler\r\n return self::$_mHandler;\r\n }", "public function getHandler(): ISessionHandler\n {\n return $this->handler;\n }", "public function getqueryHandler()\n {\n return $this->queryHandler;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Actualiza el estado de la reserva en la table reserva de la base
function updateReservationStatus($codigo_reserva) { global $connect; $sql_update_query = "UPDATE reserva SET estado=1 WHERE (codigo_reserva = '$codigo_reserva');"; // Realizamos la consulta a la tabla $updated = $connect->executeIDU($sql_update_query); if (!$updated) { echo "no se pudo acceder a la base"; return false; } }
[ "public function setStatus() {\n if ($this->dt_num_races === null)\n $this->setData();\n else {\n $this->dt_status = $this->calcStatus();\n DB::set($this);\n }\n }", "function actVac(){\n $pdo= new conexion();\n $query = $pdo ->prepare(\"UPDATE vacaciones\"\n . \" SET FechaInicial = :FechaInicial,\"\n . \" FechaFinal = :FechaFinal,\"\n . \" Estado = :Estado WHERE idVacation = :idVacation;\");\n $query->bindValue(\":FechaInicial\", $this->FechaIni);\n $query->bindValue(\":FechaFinal\", $this->FechaFin);\n $query->bindValue(\":Estado\", $this->Estado);\n $query->bindValue(\":idVacation\", $this->idVacaciones);\n $query->execute();\n \n }", "public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}", "public function reserve()\n {\n $this->update(['reserved_at' => Carbon::now()]);\n }", "public function save() : void {\n\t\t$insert = \"INSERT INTO recurrent_appointment SET %s\";\n\t\t$update = \"UPDATE recurrent_appointment SET %s WHERE id = :id\";\n\t\t$values = \"id=:id,mode=:mode,day_end=:day_end,time_end=:time_end,owner_id=:owner_id,\n\t\t\troom_id=:room_id,day_start=:day_start,time_start=:time_start,description=:description\";\n\n\t\t$mode = empty($this->id) ? $insert : $update;\n\t\t$query = sprintf($mode, $values);\n\n\t\t$statm = $this->db->prepare($query);\n\t\t$statm->setFetchMode(PDO::FETCH_ASSOC);\n\n\t\t$binds = $this->to_array();\n\t\tunset($binds[\"created\"]);\n\t\tunset($binds[\"updated\"]);\n\n\t\t$statm->execute($binds);\n\t}", "public function update_reservation_table($data_table)\n {\n $this->load->model('reservation_model');\n\n $reservation_in_table = $this->reservation_model->get_table($data_table->table_id, 1);\n\n // $checking_table_used=$this->reservation_model->get_all_where(\"order\",array('date(start_order)'=>date(\"Y-m-d\"),'table_id'=>$data_table->table_id,'IFNULL(reservation_id,0)'=>0));\n $data_table->reservation_id = 0;\n if (!empty($reservation_in_table)) {\n $booking_start_lock = $this->store_model->get_general_setting('booking_start_lock')->value;\n $now = now();\n $from_time = strtotime(\"-\" . $booking_start_lock . \" minutes\", strtotime($reservation_in_table->book_date));\n \n if ($now >= $from_time && ($data_table->table_status == 1 || $data_table->table_status == 6)) {\n $data_table->reservation_id = $reservation_in_table->id;\n $data_table->id = 6;\n $data_table->status_name = 'select';\n $this->reservation_model->save('table', array('table_status' => 6), $data_table->table_id);\n } else if ($data_table->table_status == 6) {\n $data_table->id = 1;\n $data_table->status_name = 'empty';\n $this->reservation_model->save('table', array('table_status' => 1), $data_table->table_id);\n\n }\n\n }\n\n }", "public function changeStatut(){\n\n $vehicule = Vehicules::find(request('vehicule')['id']);\n\n $vehicule->id_statut = request('vehicule')['id_statut'];\n\n $vehicule->save();\n }", "public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }", "public function atualizar()\n {\n }", "public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }", "function actualizarTablero($pos, $val){\n $pos = \"pos\".$pos;\n $db = $this->connection();\n $stmt = $db->prepare(\"UPDATE board SET $pos=?\");\n $stmt->execute(array($val));\n }", "function funcaoGravarAtualizarTreinamentosHist($conn, $dados){\n// $grava->bindValue(\":treinamentos_nome\",$dados[1]);\n// $grava->bindValue(\":treinamentos_id\",$dados[0]);\n// \n \n $grava = $conn->prepare(\"UPDATE treinamentos_historico SET treinamentos_matricula = :treinamentos_matricula, \n treinamentos_nome = :treinamentos_nome, treinamentos_admissao = :treinamentos_admissao, treinamentos_desc_funcao = :treinamentos_desc_funcao, \n treinamentos_turno = :treinamentos_turno, treinamentos_cc = :treinamentos_cc, treinamentos_centro_custo = :treinamentos_centro_custo,\n treinamentos_gerencia = :treinamentos_gerencia, treinamentos_responsavel = :treinamentos_responsavel, treinamentos_desc_curso = :treinamentos_desc_curso, \n treinamentos_horas = :treinamentos_horas, treinamentos_data_inicio = :treinamentos_data_inicio, treinamentos_emissao_conclusao = :treinamentos_emissao_conclusao, \n treinamentos_fornecedor = :treinamentos_fornecedor, treinamentos_cpf = :treinamentos_cpf, treinamentos_rg = :treinamentos_rg, treinamentos_validade = :treinamentos_validade,\n treinamentos_status = :treinamentos_status, treinamentos_referencia = :treinamentos_referencia, treinamentos_onda = :treinamentos_onda, \n treinamentos_atividade_especial = :treinamentos_atividade_especial, treinamentos_externo_interno = :treinamentos_externo_interno,\n treinamentos_necessario = :treinamentos_necessario, treinamentos_justificar = :treinamentos_justificar, treinamentos_obs = :treinamentos_obs WHERE treinamentos_id = :treinamentos_id\");\n \n $grava-> bindValue(\":treinamentos_id\",$dados[0]);\n $grava-> bindValue(\":treinamentos_matricula\",$dados[1]);\n $grava-> bindValue(\":treinamentos_nome\",$dados[2]);\n $grava-> bindValue(\":treinamentos_admissao\",$dados[3]);\n $grava-> bindValue(\":treinamentos_desc_funcao\",$dados[4]);\n $grava-> bindValue(\":treinamentos_turno\",$dados[5]);\n $grava-> bindValue(\":treinamentos_cc\",$dados[6]);\n $grava-> bindValue(\":treinamentos_centro_custo\",$dados[7]);\n $grava-> bindValue(\":treinamentos_gerencia\",$dados[8]);\n $grava-> bindValue(\":treinamentos_responsavel\",$dados[9]);\n $grava-> bindValue(\":treinamentos_desc_curso\",$dados[10]);\n $grava-> bindValue(\":treinamentos_horas\",$dados[11]);\n $grava-> bindValue(\":treinamentos_data_inicio\",$dados[12]);\n $grava-> bindValue(\":treinamentos_emissao_conclusao\",$dados[13]);\n $grava-> bindValue(\":treinamentos_cpf\",$dados[14]);\n $grava-> bindValue(\":treinamentos_rg\",$dados[15]);\n $grava-> bindValue(\":treinamentos_validade\",$dados[16]);\n $grava-> bindValue(\":treinamentos_status\",$dados[17]);\n $grava-> bindValue(\":treinamentos_referencia\",$dados[18]);\n $grava-> bindValue(\":treinamentos_onda\",$dados[19]);\n $grava-> bindValue(\":treinamentos_atividade_especial\",$dados[20]);\n $grava-> bindValue(\":treinamentos_externo_interno\",$dados[21]);\n $grava-> bindValue(\":treinamentos_necessario\",$dados[22]);\n $grava-> bindValue(\":treinamentos_justificar\",$dados[23]);\n $grava-> bindValue(\":treinamentos_obs\",$dados[24]);\n $grava->execute();\n \n }", "public function setReserved() {\n $this->activityId = Vacancy::RESERVE;\n $this->Save();\n }", "public static function crearReserva(){\r\n if(!isset($_SESSION)) session_start();\r\n $idUsuario= $_POST['idUsuario'];\r\n $idActividad= $_POST['idActividad'];\r\n $plazasOcupadas = $_POST['plazasOcup'];\r\n $fecha = $_POST['fecha'];\r\n $totalPlazas = $_POST['totalPlazas'];\r\n $idRes=\"NULL\";\r\n\r\n $fech = getdate();\r\n $dia = $fech['mday'];\r\n $mes = $fech['mon'];\r\n $anho = $fech['year'];\r\n $hora = $fech['hours'];\r\n if ($hora == \"0\" || $hora == \"1\" || $hora == \"2\" || $hora == \"3\" || $hora == \"4\" || $hora == \"5\" || $hora == \"6\" || $hora == \"7\" || $hora == \"8\" || $hora == \"9\") {\r\n $hora = \"0$hora\";\r\n }\r\n $min = $fech['minutes'];\r\n\r\n $hoy = \"$anho-$mes-$dia $hora:$min:00\";\r\n\r\n\r\n if( ($_SESSION['tipoUsuario']==\"DeportistaTDU\") || ($_SESSION['tipoUsuario']==\"DeportistaPEF\")){\r\n $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n $fecha_entrada = strtotime($fecha);\r\n if($fecha_actual > $fecha_entrada){\r\n $error = \"ERROR. La fecha para reservar ya ha pasado.\";\r\n header(\"Location: ../views/error.php?error=$error\");\r\n }else{\r\n if ($plazasOcupadas<$totalPlazas) {\r\n //Creamos Reserva\r\n $reserva = new Reserva();\r\n\r\n $reserva->setIdReserva($idRes);\r\n $reserva->setFecha($hoy);\r\n $reserva->setIdUsuario($idUsuario);\r\n $reserva->setIdActividad($idActividad);\r\n Reserva::guardarReserva($reserva);\r\n //Sumamos una plazaOcupada de la Actividad\r\n Actividad::sumarPlaza($idActividad,$plazasOcupadas);\r\n //Redireccionamos a vista\r\n header(\"Location: ../views/Deportista/consultarActividades.php?id=$idActividad\"); \r\n }else{\r\n $error = \"ERROR. Las plazas ya estan Ocupadas\";\r\n header(\"Location: ../views/error.php?error=$error\");\r\n }\r\n }\r\n }else{\r\n $error = \"ERROR. No tiene permiso para eliminar la Reserva\";\r\n header(\"Location: ../views/error.php?error=$error\");\r\n }\r\n }", "public function precios_proveedor($producto_id, $proveedor_id, $costo, $margen, $precio, $existencia, $activo){\n\n if($activo == true){\n\n $this->Precios->updateAll(['activo' => false], ['producto_id' => $producto_id]); \n\n }\n\n // CHECO SI EXISTE UN REGISTRO DE PRECIOS\n $registro_precio = $this->Precios->find('all', ['conditions' => ['Precios.producto_id'=>$producto_id, 'proveedor_id'=>$proveedor_id]])->first();\n\n if(!empty($registro_precio)){\n\n $registro_precio['costo'] = $costo;\n $registro_precio['margen'] = $margen;\n $registro_precio['precio'] = $precio;\n $registro_precio['existencia'] = $existencia;\n $registro_precio['activo'] = $activo;\n $registro_precio['modified'] = date('Y-m-d H:m:s');\n\n $this->Precios->save($registro_precio);\n\n echo \"Precio Actualizado: \".$producto_id.\"\\n\";\n\n }else{\n\n $nuevo_registro_precio = $this->Precios->newEntity();\n $nuevo_registro_precio['producto_id'] = $producto_id;\n $nuevo_registro_precio['proveedor_id'] = $proveedor_id;\n $nuevo_registro_precio['usuario_id'] = 3;\n $nuevo_registro_precio['costo'] = $costo;\n $nuevo_registro_precio['margen'] = $margen;\n $nuevo_registro_precio['precio'] = $precio;\n $nuevo_registro_precio['existencia'] = $existencia;\n $nuevo_registro_precio['activo'] = $activo;\n $nuevo_registro_precio['created'] = date('Y-m-d H:m:s');\n $nuevo_registro_precio['modified'] = date('Y-m-d H:m:s');\n\n $this->Precios->save($nuevo_registro_precio);\n\n echo \"Precio Nuevo: \".$producto_id.\"\\n\";\n\n }\n \n }", "public function refresh() : void\n {\n $this->row = $this->row->getTable()->createSelectionInstance($this->getTableName())->get($this->primaryKey->getValue());\n $this->initiateProperties();\n }", "public function salvar_upgrade_plano() {\n\n /**\n * 1 Altera o plano do distribuidor + a difereça do plano novo.\n * 2 Incluir o plano antigo em histórico de planos.\n * 3 Finaliza o Upgrade.\n */\n\n if ($this->input->post('plano')) {\n\n $plano = $this->db->where('pa_id', $this->input->post('plano'))->get('planos')->row();\n \n $compra = $this->db->where('co_total_valor != 0.00')\n ->where('co_eplano',1)\n ->where('co_id_distribuidor', get_user()->di_id)\n ->where('co_pago', 1)->get('compras')->row();\n\n //checando se ele ja vez uma compra para o mesmo plano.\n $co_plan = $this->db->where('co_id_distribuidor', get_user()->di_id)\n ->where('co_eupgrade',1)\n ->where('co_id_plano', $this->input->post('plano'))\n ->get('compras')->row();\n\n //pegando o id do plano\n if (isset($_POST['pa_tipo']))\n $tipo_plano = !empty($_POST['pa_tipo'][0]) ? $_POST['pa_tipo'][0] : $_POST['pa_tipo'][1];\n else\n $tipo_plano = 0;\n\n unset($_POST['pa_tipo']);\n\n //Sabendo qual pais o usuário pertence\n $pais = $this->db->where('ci_id', get_user()->di_cidade)\n ->join('estados', 'ci_estado=es_id')\n ->get('cidades')\n ->row();\n \n //Calculando a diferênça do plano.\n $hash_boleto_new = criar_hash_boleto();\n $planoAtual = DistribuidorDAO::getPlano(get_user()->di_id);\n \n //Se não tem o plano para o usuário então cria um nova compra de um plano\n if (count($co_plan) == 0) {\n //Plano upgrade.\n $plano_upgrade = $this->db->where('pug_id_plano_upgrade',$plano->pa_id)\n ->where('pug_id_plano',$planoAtual->pa_id)\n ->get('planos_upgrades')\n ->row();\n \n //gerando uma nova comprar do plano do distribuidor.\n $this->db->insert('compras', array(\n 'co_tipo' => 1,\n 'co_entrega' => 1,\n 'co_id_distribuidor' => get_user()->di_id,\n 'co_entrega_cidade' => get_user()->di_cidade,\n 'co_entrega_uf' => get_user()->di_uf,\n 'co_entrega_bairro' => get_user()->di_bairro,\n 'co_entrega_cep' => get_user()->di_cep,\n 'co_entrega_complemento' => get_user()->di_complemento,\n 'co_entrega_numero' => get_user()->di_numero,\n 'co_entrega_logradouro' => get_user()->di_endereco,\n 'co_total_pontos' => $plano_upgrade->pug_pontos,\n 'co_situacao' => 5,\n 'co_id_plano' => $plano->pa_id,\n 'co_eplano' => 1,\n 'co_pago' => 0,\n 'co_forma_pgt_txt'=>'Upgrade para o plano: <b>'.$plano->pa_descricao.'</b>',\n 'co_eupgrade' => 1,\n 'co_tipo_plano' => $tipo_plano,\n 'co_forma_pgt' => 1,\n 'co_hash_boleto' => $hash_boleto_new,\n 'co_total_valor' => $plano_upgrade->pug_valor,\n 'co_data_insert' => date('Y-m-d H:i:s')\n ));\n \n $id_compra = $this->db->insert_id();\n \n //Salvar o compra em produtos_comprados\n $this->db->insert('produtos_comprados',array(\n 'pm_id_compra'=>$id_compra,\n 'pm_valor'=>$plano_upgrade->pug_valor,\n 'pm_quantidade'=>1,\n 'pm_tipo'=>1,\n 'pm_pontos'=>$plano_upgrade->pug_pontos,\n 'pm_id_produto'=>$plano_upgrade->pug_produto,\n 'pm_valor_total'=> $plano_upgrade->pug_valor,\n ));\n \n } else {\n //Pega o id do plano\n $id_compra = $co_plan->co_id;\n \n }\n\n //Pegando o ultimo plano do usuário.\n $planoAtual = DistribuidorDAO::getPlano(get_user()->di_id);\n redirect(base_url('index.php/loja/pagar_transparente?c=' . $id_compra .'&paymentMethod=0'));\n }\n }", "public function restored(Reserva $reserva)\n {\n //\n }", "function updateReservations1x(){\n global $wpdb;\n global $DOPBSP;\n \n $control_data = $wpdb->query('SHOW TABLES LIKE \"'.$DOPBSP->tables->reservations.'\"');\n\n if ($wpdb->num_rows != 0){\n $new_columns = array('total_price' => 'CHANGE total_price price_total FLOAT DEFAULT '.$this->db_config->reservations['price_total'].' NOT NULL',\n 'discount' => 'CHANGE discount discount_price FLOAT DEFAULT '.$this->db_config->reservations['discount_price'].' NOT NULL',\n 'deposit' => 'CHANGE deposit deposit_price FLOAT DEFAULT '.$this->db_config->reservations['deposit_price'].' NOT NULL',\n 'paypal_transaction_id' => 'CHANGE paypal_transaction_id transaction_id VARCHAR(128) DEFAULT \"'.$this->db_config->reservations['transaction_id'].'\" COLLATE '.$this->db_collation.' NOT NULL',\n 'info' => 'CHANGE info form TEXT COLLATE '.$this->db_collation.' NOT NULL');\n $valid = true;\n\n $columns = $wpdb->get_results('SHOW COLUMNS FROM '.$DOPBSP->tables->reservations);\n\n foreach ($columns as $column){\n if ($column->Field == 'discount_price'\n || $column->Field == 'deposit_price'){\n $valid = false;\n }\n }\n\n if ($valid){\n foreach ($columns as $column){\n foreach ($new_columns as $key => $query){\n if ($column->Field == $key){\n $wpdb->query('ALTER TABLE '.$DOPBSP->tables->reservations.' '.$query);\n }\n }\n } \n\n /*\n * Update reservations data.\n */\n $reservations = $wpdb->get_results('SELECT * FROM '.$DOPBSP->tables->reservations);\n\n foreach ($reservations as $reservation){\n switch ($reservation->payment_method){\n case '0':\n $payment_method = 'none';\n break;\n case '1':\n $payment_method = 'default';\n break;\n case '2':\n $payment_method = 'paypal';\n break;\n default:\n $payment_method = $reservation->payment_method;\n }\n\n $form = json_decode($reservation->form);\n\n for ($i=0; $i<count($form); $i++){\n $form[$i]->translation = $form[$i]->name;\n }\n\n $wpdb->update($DOPBSP->tables->reservations, array('discount_price' => $reservation->discount,\n 'deposit_price' => $reservation->deposit,\n 'form' => json_encode($form),\n 'payment_method' => $payment_method), \n array('id' => $reservation->id));\n } \n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of APELLIDOPATERNOC.
public function setAPELLIDOPATERNOC($APELLIDOPATERNOC) { $this->APELLIDOPATERNOC = $APELLIDOPATERNOC; return $this; }
[ "function setApellidoP($ApellidoP) {\r\n $this->ApellidoP = $ApellidoP;\r\n }", "private function setPiVars() {\n\t\t// Conference name\n\t\t$this->markerArray['###SPN_CONF_NAME###'] = htmlspecialchars($this->piVars['name']);\n\t\t$this->markerArray['###VAL_CONF_NAME###'] = htmlspecialchars($this->piVars['name']);\n\t\t\n\t\t// Conference description\n\t\t$this->markerArray['###SPN_CONF_DESCRIPTION###'] = htmlspecialchars($this->piVars['description']);\n\t\t$this->markerArray['###VAL_CONF_DESCRIPTION###'] = htmlspecialchars($this->piVars['description']);\n\t\t\n\t\t// Conference duration\n\t\t$this->markerArray['###SPN_CONF_DURATION###'] = htmlspecialchars($this->piVars['duration']);\n\t\t$this->markerArray['###VAL_CONF_DURATION###'] = htmlspecialchars($this->piVars['duration']);\n\t\t\n\t\t// Join confirmation checkbox\n\t\tif ($this->piVars['joinconfirm'] == 'on') {\n\t\t\t$this->markerArray['###CHECKED_JOIN_CONFIRM###'] = ' checked=\"checked\" ';\n\t\t} else {\n\t\t\t$this->markerArray['###CHECKED_JOIN_CONFIRM###'] = '';\n\t\t}\n\t\t\n\t\t// Planned conferece ceckbox\n\t\tif ($this->piVars['schedule'] == 'on') {\n\t\t\t$this->markerArray['###CHECKED_PLANNED###'] = ' checked=\"checked\" ';\n\t\t\t$this->markerArray['###DISPLAY_NONE_CONF_DATE_TIME###'] = '';\n\t\t} else {\n\t\t\t$this->markerArray['###CHECKED_PLANNED###'] = '';\n\t\t\t$this->markerArray['###DISPLAY_NONE_CONF_DATE_TIME###'] = 'display:none;';\n\t\t}\n\t\t\n\t\t// Planned date\n\t\tif ($this->piVars['day']) {\n\t\t\t$this->markerArray['###VAL_CONF_DAY###'] = htmlspecialchars($this->piVars['day']);\n\t\t}\n\t\tif ($this->piVars['month']) {\n\t\t\t$this->markerArray['###VAL_CONF_MONTH###'] = htmlspecialchars($this->piVars['month']);\n\t\t}\n\t\tif ($this->piVars['year']) {\n\t\t\t$this->markerArray['###VAL_CONF_YEAR###'] = htmlspecialchars($this->piVars['year']);\n\t\t}\n\t\t\n\t\t// Planned time\n\t\tif ($this->piVars['hour']) {\n\t\t\t$this->markerArray['###VAL_CONF_HOUR###'] = htmlspecialchars($this->piVars['hour']);\n\t\t}\n\t\tif ($this->piVars['minutes']) {\n\t\t\t$this->markerArray['###VAL_CONF_MINUTE###'] = htmlspecialchars($this->piVars['minutes']);\n\t\t}\n\t}", "public function setAPELLIDOPATERNO($APELLIDO_PATERNO)\r\n {\r\n $this->APELLIDO_PATERNO = $APELLIDO_PATERNO;\r\n\r\n return $this;\r\n }", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "public function _setPrecio($Precio)\n\t {\n\t $this->Precio = $Precio;\n\t }", "public function testSetTotpOffsetWithInvalid() {\n $this->Otp->setTotpOffset(0.1);\n }", "public static function setPointValue()\n\t{\n\t\tself::$value = (include \"bootstrap/values.php\")[self::getConfiguration()[\"pointValue\"]];\n\t}", "function set_pantone($pantone_name){\r\n\t\t$this->pantone=$pantone_name;\r\n\t\t$this->cmyk['c']=$this->pantone_pallete[$pantone_name]['c'];\r\n\t\t$this->cmyk['m']=$this->pantone_pallete[$pantone_name]['m'];\r\n\t\t$this->cmyk['y']=$this->pantone_pallete[$pantone_name]['y'];\r\n\t\t$this->cmyk['b']=$this->pantone_pallete[$pantone_name]['b'];\r\n\t\t\r\n\t\t$this->convert_cmyk_to_rgb();\r\n\t\t$this->convert_rgb_to_hex();\t\t\r\n\t}", "function set_pantone_pc($pantone_name)\n {\n $this->pantone_pc = $pantone_name;\n $this->cmyk['c'] = $this->pantone_pallete_pc[$pantone_name]['c'];\n $this->cmyk['m'] = $this->pantone_pallete_pc[$pantone_name]['m'];\n $this->cmyk['y'] = $this->pantone_pallete_pc[$pantone_name]['y'];\n $this->cmyk['b'] = $this->pantone_pallete_pc[$pantone_name]['b'];\n\n $this->convert_cmyk_to_rgb();\n $this->convert_rgb_to_hex();\n }", "public function setTbAutorApresentacaoPessoal($tbAutorApresentacaoPessoal){\n\t$this->tbAutorApresentacaoPessoal = $tbAutorApresentacaoPessoal;\n}", "function setlatitud($value)\n {\n $this->latitud = ($value == '') ?\n DB_DataObject_Cast::sql('NULL') : $value;\n }", "public function testSetIndCp() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setIndCp(10.092018);\n $this->assertEquals(10.092018, $obj->getIndCp());\n }", "public function setNaics($value)\n {\n $this->naics = $value;\n }", "public function testSetPLafondExo() {\n\n $obj = new Etablissements();\n\n $obj->setPLafondExo(10.092018);\n $this->assertEquals(10.092018, $obj->getPLafondExo());\n }", "public function setCirculante_P(){\n\t\t$this->Circulante_P = $this->getFornecedores() \n\t\t+ $this->getEmprestimos_Bancarios() \n\t\t+ $this->getObrigacoes_Sociais_e_Impostos_a_Recolher() \n\t\t+ $this->getContas_a_Pagar_C() \n\t\t+ $this->getLucros_a_Distribuir() \n\t\t+ $this->getProvisoes();\n\t}", "public function setGPS()\n {\n }", "public function testSetIndemnCpPlaf() {\n\n $obj = new EmpDadsuParam();\n\n $obj->setIndemnCpPlaf(10.092018);\n $this->assertEquals(10.092018, $obj->getIndemnCpPlaf());\n }", "public function setPrecio_venta($precio_venta)\n {\n $this->precio_venta = $precio_venta;\n\n return $this;\n }", "public function setTbTradutorApresentacaoPessoal($tbTradutorApresentacaoPessoal){\n\t$this->tbTradutorApresentacaoPessoal = $tbTradutorApresentacaoPessoal;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
makeTitleFriendly formats the post title properly in utf8
private function makeTitleFriendly($title) { // parse title for problem entities $title = htmlentities($title, ENT_QUOTES, "UTF-8"); $problem_chars = array( '&#039;' => '%26amp%3B%238217%3B', '&#039;' => '&amp;#8217;', '&amp;' => '%26amp%3Bamp%3B', '...' => '&#8230;', '&amp;' => '&amp;amp;', ); foreach($problem_chars as $true_char => $crap_char) { $title = str_replace($crap_char, $true_char, $title); } return $title; }
[ "function format_blog_title($title)\n {\n return ucfirst(str_replace(array(POSTS_DIR, '/', '.md', '-'), array('', '', '', ' '), $title));\n }", "function makeURLFriendly($pre_title){\n\t$symbol_swap = array('symbols' => array('%', '&', '&amp;'), 'words' => array(' percent ', 'and', 'and'));\n \t$post_title = str_replace($symbol_swap['symbols'], $symbol_swap['words'], stripslashes($pre_title));\n \t$post_title = ereg_replace(\"[^A-Za-z0-9 -]\", '', $post_title);\n \t$post_title = strtolower(preg_replace('/[-|\\s]+/','-', $post_title));\n\treturn $post_title;\n}", "function sanitize_title_with_dashes($title) {\n\t$title = strip_tags($title);\n\t// Preserve escaped octets.\n\t$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n\t// Remove percent signs that are not part of an octet.\n\t$title = str_replace('%', '', $title);\n\t// Restore octets.\n\t$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n\t$title = remove_accents($title);\n\tif (seems_utf8($title)) {\n\t\tif (function_exists('mb_strtolower')) {\n\t\t\t$title = mb_strtolower($title, 'UTF-8');\n\t\t}\n\t\t$title = utf8_uri_encode($title, 200);\n\t}\n\n\t$title = strtolower($title);\n\t$title = preg_replace('/&.+?;/', '', $title); // kill entities\n\t$title = str_replace('.', '-', $title);\n\t$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n\t$title = preg_replace('/\\s+/', '-', $title);\n\t$title = preg_replace('|-+|', '-', $title);\n\t$title = trim($title, '-');\n\n\treturn $title;\n}", "function sanitize_title_with_dashes($title)\n {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n $title = $this->remove_accents($title);\n if ($this->seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = $this->utf8_uri_encode($title, 200);\n }\n\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = str_replace('.', '-', $title);\n $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n\n return $title;\n }", "function tc_clean_slug($title) {\n\t\t$title = strtolower(str_replace(array('-','_'), ' ', $title));\n\t\t$title = ucwords($title);\n\t\treturn $title;\n\t}", "function wt_html_sanitize_title( $title ) {\n\treturn wp_kses( $title, wt_html_allowed() );\n}", "static function to_title($slug) {\n $title = ucwords(str_replace(['_', '-'], ' ', $slug));\n $title = trim($title, '^');\n return $title;\n }", "function cdn_do_post_title() {\n\techo cdn_make_post_title();\n}", "function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) {\n\t$title = strip_tags($title);\n\t// Preserve escaped octets.\n\t$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n\t// Remove percent signs that are not part of an octet.\n\t$title = str_replace('%', '', $title);\n\t// Restore octets.\n\t$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n\tif (seems_utf8($title)) {\n\t\tif (function_exists('mb_strtolower')) {\n\t\t\t$title = mb_strtolower($title, 'UTF-8');\n\t\t}\n\t\t$title = utf8_uri_encode($title, 200);\n\t}\n\n\t$title = strtolower($title);\n\t$title = preg_replace('/&.+?;/', '', $title); // kill entities\n\t$title = str_replace('.', '-', $title);\n\n\tif ( 'save' == $context ) {\n\t\t// Convert nbsp, ndash and mdash to hyphens\n\t\t$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );\n\n\t\t// Strip these characters entirely\n\t\t$title = str_replace( array(\n\t\t\t// iexcl and iquest\n\t\t\t'%c2%a1', '%c2%bf',\n\t\t\t// angle quotes\n\t\t\t'%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba',\n\t\t\t// curly quotes\n\t\t\t'%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d',\n\t\t\t'%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',\n\t\t\t// copy, reg, deg, hellip and trade\n\t\t\t'%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',\n\t\t\t// acute accents\n\t\t\t'%c2%b4', '%cb%8a', '%cc%81', '%cd%81',\n\t\t\t// grave accent, macron, caron\n\t\t\t'%cc%80', '%cc%84', '%cc%8c',\n\t\t), '', $title );\n\n\t\t// Convert times to x\n\t\t$title = str_replace( '%c3%97', 'x', $title );\n\t}\n\n\t$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n\t$title = preg_replace('/\\s+/', '-', $title);\n\t$title = preg_replace('|-+|', '-', $title);\n\t$title = trim($title, '-');\n\n\treturn $title;\n}", "public function sanitize_title($title) {\n\n\t\t$title = strtolower($title);\n\t\t$title = preg_replace('/&.+?;/', '', $title); // kill entities\n\t\t$title = str_replace('.', '-', $title);\n\t\t$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n\t\t$title = preg_replace('/\\s+/', '-', $title);\n\t\t$title = preg_replace('|-+|', '-', $title);\n\t\t$title = trim($title, '-');\n\n\t\treturn $title;\n\n\t}", "function prepare_document_title($title)\n{\n\t$title = strtr($title, array(\n\t\t'<br />' => ' — ',\n\t));\n\t$title = strip_tags($title);\n\n\treturn $title;\n}", "function tevolution_post_title()\r\n{\r\n\t$title = get_the_title();\r\n\t$is_related = get_query_var('is_related');\r\n\tif ( strlen( $title ) == 0 )\r\n\t\treturn;\r\n\tif (( is_singular() || is_single()) && !is_front_page() && !is_home() && !$is_related)\r\n\t\t$title = sprintf( '<h1 class=\"entry-title\">%s</h1>', $title );\r\n\telse\r\n\t\t$title = sprintf( '<h2 class=\"entry-title\"><a itemprop=\"url\" href=\"%s\" title=\"%s\" rel=\"bookmark\">%s</a></h2>', get_permalink(), the_title_attribute( 'echo=0' ), $title);\r\n\techo $title;\r\n}", "function bd_get_wp_title(){\n\n\tob_start();\n\twp_title();\n\t$wp_title = ob_get_contents();\n\tob_end_clean();\n\t$wp_title = preg_replace(\"/&#?[a-z0-9]{2,8};/i\",\"\",$wp_title);\n\t$wp_title = preg_replace (\"/\\s+/\", \" \", $wp_title);\n\treturn $wp_title;\n\n}", "function format_game_title($title){\n return str_replace(' ','',ucwords(str_replace('_',' ',str_replace('-',' ',$title))));\n}", "function sanitize_title( $unsafe_title ) {\n\t$title = $unsafe_title;\n\t$title = strip_tags( $title );\n\t$title = preg_replace( \"/\\s+/\", ' ', trim( $title ) );\n\treturn apply_filter( 'sanitize_title', $title, $unsafe_title );\n}", "function GetTitleAsFriendlyUrl()\r\n {\r\n # Convert the title to a string object.\r\n $str = new JaxpString($this->Title);\r\n\r\n # Return the encoded text.\r\n return $str->ToFriendlyUrlText();\r\n }", "protected function _sanitizeTitle($title) \r\n {\r\n $title = preg_replace('/[^A-Za-z0-9-]+/', '-', $title);\r\n \r\n return trim(strtolower($title));\r\n }", "function pf_clean_topic_title($title=\"\")\n\t{\n\t\tif ($this->ipsclass->vars['etfilter_punct'])\n\t\t{\n\t\t\t$title\t= preg_replace( \"/\\?{1,}/\" , \"?\" , $title );\t\t\n\t\t\t$title\t= preg_replace( \"/(&#33;){1,}/\" , \"&#33;\", $title );\n\t\t}\n\t\t\n\t\tif ($this->ipsclass->vars['etfilter_shout'])\n\t\t{\n\t\t\t$title = ucwords(strtolower($title));\n\t\t}\n\t\t\n\t\treturn $title;\n\t}", "function wpex_esc_title( $post = '' ) {\n\techo wpex_get_esc_title( $post );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs the free migrations.
public function run_free_migrations() { }
[ "public function migrate() {\n if (isset($this->dbResetter)) {\n $this->dbResetter->resetDb();\n }\n foreach($this->migrations as $migration) {\n $migration->migrate($this->test);\n }\n }", "protected function runApplicationMigrations()\n {\n $migrations = $this->app->make('migration.repository');\n\n if (! $migrations->repositoryExists()) $migrations->createRepository();\n\n $migrator = $this->app->make('migrator');\n\n $migrator->run(base_path() . '/database/migrations');\n }", "public function migrate() {\n\n $this->scan_migration_files();\n $this->is_non_migration_file_exist();\n $this->filter_nonmigrated_files();\n\n $this->execute();\n }", "public function execute() {\n // Get old migration offset from Wordpress, defaulting to 0 (zero)\n $migrationOffset = get_option($this->optionName, 0);\n\n // Loop through migrations starting at the old offset\n for ($c=$migrationOffset; $c < sizeof($this->migrations); $c++) {\n call_user_func($this->migrations[$c]);\n }\n\n // Save the new migration offset into Wordpress\n update_option($this->optionName, $c);\n }", "public function runMigrations()\n {\n Artisan::call('migrate', ['--path' => 'plugins/' . $this->vendor . '/' . $this->name . '/database/migrations/']);\n }", "protected function _initSchemaMigrations() {\n\t\t$options = array(\n\t\t\t'direction' => 'up',\n\t\t\t'scope' => 'Migrations'\n\t\t);\n\t\t/** @var DboSource $db */\n\t\t$db = ConnectionManager::getDataSource($this->connection);\n\n\t\t$this->clearCache();\n\n\t\tif (!in_array($db->fullTableName('schema_migrations', false, false), $db->listSources())) {\n\t\t\t$options['forceAll'] = true;\n\t\t}\n\n\t\t$this->migrate($options);\n\t}", "private function runAllMigrations()\r\n {\r\n foreach ($this->getConfig() as $config) {\r\n $migrations = new Migrations($config);\r\n $migrations->migrate($config);\r\n }\r\n }", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "protected static function migrate()\n {\n if (static::$migrated) {\n return;\n }\n\n Artisan::call('migrate', ['--database' => 'docs_sqlite']);\n\n static::$migrated = true;\n }", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "public function runMigrations($migrations) {\n\t\tif (empty($migrations)) {\n\t\t\treturn;\n\t\t}\n\t\t$current = $this->getAppVersion($this->app);\n\t\tif ($this->to_version === null) {\n\t\t\t$to_version = max(array_keys($migrations));\n\t\t} else {\n\t\t\t$to_version = $this->to_version;\n\t\t}\n\t\tif ($to_version == $current) {\n\t\t\treturn; // Nothing to do\n\t\t}\n\t\t$the_way = 'up'; // Tribute to Pat Metheny\n\t\tif ($to_version > $current) {\n\t\t\t// upgrade\n\t\t\t$min = $current + 1;\n\t\t\t$max = $to_version;\n\t\t} else {\n\t\t\t// downgrade\n\t\t\t$the_way = 'do';\n\t\t\t$max = $current;\n\t\t\t$min = $to_version + 1;\n\t\t}\n\t\t// Filter the migrations\n\t\t$to_run = array();\n\t\tforeach ($migrations as $order=>$name) {\n\t\t\tif ($order < $min or $order > $max) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($the_way == 'up') {\n\t\t\t\t$to_run[] = array($order, $name);\n\t\t\t} else {\n\t\t\t\tarray_unshift($to_run, array($order, $name));\n\t\t\t}\n\t\t}\n\t\tasort($to_run);\n\t\t// Run the migrations\n\t\tforeach ($to_run as $migration) {\n\t\t\t$this->runMigration($migration, $the_way);\n\t\t}\n\t}", "private function runMigrationsAndSeed()\n {\n if (env('DB_DATABASE') === ':memory:') {\n $this->artisan('migrate', ['--seed' => true]);\n }\n }", "protected function runTestMigrations()\n {\n if ( Schema::hasTable( 'fruits' ) ) {\n return;\n }\n\n Schema::create( 'fruits', function ( Blueprint $table ) {\n $table->increments( 'id' );\n $table->string( 'name' );\n $table->integer( 'price' );\n } );\n }", "public function migrate()\n\t{\n\t\t// Set our group arg & call migration\n\t\t$this->arguments->setOpt('group', $this->group->get('cn'));\n\t\t\\App::get('client')->call('migration', 'run', $this->arguments, $this->output);\n\t}", "public function backfill_new_db()\n\t{\n\t\t$this->logger->debug('Beginning to backfill untracked migrations.');\n\n\t\t// Do not clobber class scope of this variable\n\t\t$applied_versions = new Migrating_Forward($this->db);\n\n\t\tforeach ($this->migrations as $migration)\n\t\t{\n\t\t\tif ($this->should_skip(true, $migration))\n\t\t\t{\n\t\t\t\t$this->logger->debug(\"Skipping $migration\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->logger->debug(\"Tracking $migration\");\n\t\t\t$applied_versions->track_version_affected($migration);\n\t\t}\n\t}", "public function applyMigrations()\n {\n $this->createMigrationsTable();\n $appliedMigrations = $this->getAppliedMigrations();\n\n $newMigrations = [];\n $files = scandir(Application::$ROOT_DIR . '/../migrations');\n $toApplyMigrations = array_diff($files, $appliedMigrations);\n foreach ($toApplyMigrations as $migration) {\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n\n require_once Application::$ROOT_DIR . '/../migrations/' . $migration;\n $className = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $className();\n $this->log(\"Applying migration $migration\");\n $instance->up();\n $this->log(\"Applied migration $migration\");\n $newMigrations[] = $migration;\n }\n\n if (!empty($newMigrations)) {\n $this->saveMigrations($newMigrations);\n } else {\n $this->log(\"There are no migrations to apply\");\n }\n }", "public function migrate()\n {\n }", "protected function migrateAndSeedDB(): void\n {\n if (self::$migrated) {\n return;\n }\n // migrate and seed database once for all tests\n Artisan::call('migrate:fresh');\n Artisan::call('db:seed');\n self::$migrated = true;\n }", "private function resetAllMigrationsRun(): void\n {\n $this->migrationsRun = null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get "custom_delimiter" from request with optional "other" delimiter
protected function getDelimitersFromRequest() { $delimiters = array(); $delimiters['custom'] = $this->request->getValidInputRequest( 'custom_delimiter', array( 'Assert\Choice' => array( 'choices' => $this->getImportDelimiters(), ), ), $this->getDefaultDelimiter() ); $delimiters['other'] = $this->request->getValidInputRequest( 'custom_delimiter_other', array( 'Assert\Type' => array( 'type' => 'string', ), 'Assert\Length' => array( 'max' => 1, ), ), $this->getDefaultDelimiter() ); return $delimiters; }
[ "public function getDelimiterValue()\n {\n $delimiters = $this->getDelimitersFromRequest();\n $delimiter = $delimiters['custom'];\n\n switch ($delimiter) {\n case \"other\":\n $delimiter = $delimiters['other'];\n break;\n\n case '\\t':\n $delimiter = \"\\t\";\n break;\n }\n\n return $delimiter;\n }", "public function getDelimiterField()\n {\n return $this->getOption('delimiter');\n }", "abstract public function getRouteDelimiter();", "public function getDelimiter()\n {\n return $this->_request->getParam(Import::FIELD_FIELD_SEPARATOR, ',');\n }", "public function get_delimiter() {\n return apply_filters(\"terawallet_{$this->export_type}_export_delimiter\", $this->delimiter);\n }", "public function getFieldsSeparator();", "private function getSeparationChar(): string\n {\n $character = $this->request->getParsedBody()['separationCharacter'];\n switch ($character) {\n case 'pipe':\n $character = '|';\n break;\n case 'semicolon':\n $character = ';';\n break;\n case 'colon':\n $character = ':';\n break;\n case 'comma':\n default:\n $character = ',';\n break;\n }\n\n return $character;\n }", "public function getDelimiter() {\n return $this->delimiter;\n }", "public function getFieldDelimiter()\n {\n return $this->fieldDelimiter;\n }", "function custom_separator($separator) {\n return \"|\";\n}", "public function getDelimiter()\n {\n return $this->delimiter;\n }", "private function getDelimiterRegEx() {\n\t\treturn '/' . implode('|' , array_map(function ($element) {return '(' . $element . ')';}, $this->delimiters)) . '/';\n\t}", "public function getMultipleValueDelimiter();", "public function getSerialPostDelimiter();", "public function getDelimiter(): string\n {\n if (isset($this->config[self::DELIMITER])) {\n return $this->config[self::DELIMITER];\n }\n\n return self::DEFAULT_DELIMITER;\n }", "protected function _getDelimiter() {\n\t\treturn ',';\n\t}", "public function getSeparator()\n {\n return \"OR\";\n }", "protected function getImportDelimiters()\n {\n return array_keys($GLOBALS['app_list_strings']['import_delimeter_options']);\n }", "public function getMultipleFieldDelimiter()\n {\n return $this->getConfiguration()->getMultipleFieldDelimiter();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find an alias matching both public and internal url
public function findAlias($publicUrl, $internalUrl) { $ret = null; $params = ['public_url' => $publicUrl, 'internal_url' => $internalUrl]; if ($alias = $this->getRepository()->findOneBy($params)) { $ret = $alias; } return $ret; }
[ "private function makeAliasFromUrl()\r\n {\r\n // remove site folder instead of server_name from request url\r\n // (because site could be located in subdirectory)\r\n\r\n $result = ($_SERVER['REQUEST_URI'] == SITE_FOLDER) ? '' : str_replace (SITE_FOLDER, \"\", $_SERVER['REQUEST_URI']);\r\n\r\n // separate alias part from parametrs one\r\n $result = explode(\"?\",$result);\r\n $alias = $result[0];\r\n\r\n // re-write '$alias' without the first and last slashes\r\n\r\n // we check for slash in the beginning '$alias{0}', because there are two possible situations:\r\n // site location is in root directory (most common sit) or in sub-directory (you sometimes need that)\r\n // in the last one '$alias' goes with the slash '/' in the beginning,\r\n // so we remove this one as well inside of next if-else body sections\r\n\r\n $last = substr($alias, -1);\r\n\r\n if ($last != '/') { $alias = ($alias{0} != '/') ? $alias : substr($alias,1); }\r\n\r\n else if ($last == '/') { $alias = ($alias{0} != '/') ? substr($alias,0,-1): substr($alias,1,-1); }\r\n\r\n //\r\n return $alias;\r\n\r\n }", "public function getAlias();", "private function getTermUrlAlias() {\n $query = db_select('url_alias', 'u')\n ->fields('u', array('alias'))\n ->condition('source', '/taxonomy/term/' . $this->tid)\n ->execute();\n if($aliases = $query->fetchAll()) {\n $aliases = current($aliases)->alias;\n $this->urlAlias = ltrim($aliases,\"/\");\n }\n else {\n drupal_set_message(t('You do not have any url aliases generate for taxonomy terms, see Taxonomy Facets module readme file.'),'warning');\n }\n\n }", "function vpopmail_alias_get($alias, $domain)\n{\n}", "public function testUrlAlias() {\n $path_alias = $this->loadPathAliasByConditions([\n 'path' => '/taxonomy/term/4',\n 'alias' => '/term33',\n 'langcode' => 'und',\n ]);\n $this->assertSame('/taxonomy/term/4', $path_alias->getPath());\n $this->assertSame('/term33', $path_alias->getAlias());\n $this->assertSame('und', $path_alias->language()->getId());\n\n // Alias with no slash.\n $path_alias = $this->loadPathAliasByConditions(['alias' => '/source-noSlash']);\n $this->assertSame('/admin', $path_alias->getPath());\n $this->assertSame('und', $path_alias->language()->getId());\n }", "public function alias_alive_from_alias($alias){\n $alias=san(strtolower($alias));\n $sql=OriginSql::getInstance();\n $res=$sql->select('acc','*',2,array('alias=\"'.$alias.'\"'),'',1);\n if ($res!=0) {\n //$this->log('account.inc->alias_alive_from_alias true',0,true);\n return true;\n } else {\n $this->log('account.inc->alias_alive_from_alias false',0,true);\n return false;\n }\n }", "function alias_expand_host($name) {\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name])) {\n\t\t$ip_arr = explode(\" \", $aliastable[$name]);\n\t\tforeach($ip_arr as $ip) {\n\t\t\tif (!is_ipaddr($ip))\n\t\t\t\treturn null;\n\t\t}\n\t\treturn $aliastable[$name];\n\t} else if (is_ipaddr($name))\n\t\treturn $name;\n\telse\n\t\treturn null;\n}", "public function findByAlias($alias, $published = true);", "function xarModGetAlias($alias) { return xarModAlias::resolve($alias);}", "function _drush_sitealias_load_alias($alias, $alias_path_context = NULL) {\n $all_site_aliases = drush_get_context('site-aliases');\n $result = array();\n\n // Check to see if this is a relative alias ('@site/@peer')\n $relative_alias_pos = strpos($alias, '/@');\n if ($relative_alias_pos !== false) {\n $primary_alias = substr($alias,0,$relative_alias_pos);\n $relative_alias = substr($alias,$relative_alias_pos + 1);\n $primary_record = drush_sitealias_get_record($primary_alias);\n _drush_sitealias_find_and_load_alias(substr($relative_alias,1), $primary_record);\n $result = drush_sitealias_get_record($relative_alias);\n if (!empty($result)) {\n if (array_key_exists('inherited', $result)) {\n $result = array_merge($primary_record, $result);\n }\n $result['#name'] = $relative_alias;\n _drush_sitealias_add_inherited_values_to_record($result);\n _drush_sitealias_cache_alias($alias, $result);\n }\n }\n else {\n // Only aliases--those named entities that begin with '@'--can be loaded this way.\n // We also skip any alias that has already been loaded.\n if ((substr($alias,0,1) == '@') && !array_key_exists($alias,$all_site_aliases)) {\n $aliasname = substr($alias,1);\n $result = _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context);\n if (!empty($result)) {\n $alias_options = array('site-aliases' => array($aliasname => $result));\n _drush_sitealias_add_inherited_values($alias_options['site-aliases']);\n drush_set_config_special_contexts($alias_options);\n if (array_key_exists('#file', $result)) {\n drush_log(dt('Loaded alias !alias from file !file', array('!alias' => $alias, '!file' => $result['#file'])));\n }\n }\n }\n }\n\n return $result;\n}", "public function getAlias($alias);", "public static function replaceAlias ($alias){\n // was a name replacement, but changed to id so user names can be changed.\n $alias = strtolower($alias) ; #all aliases are lower case\n # echo \"checking for alias for $alias\" . BR;\n if (preg_match('/^\\w+$/',$alias)){ # match alias format\n if (in_array($alias,array_keys(Definitions::$user_aliases))){\n $lookup = Definitions::$user_aliases[$alias];\n # echo \"Found $lookup\". BR;\n return $lookup;\n }\n }\n # echo \"No alias.\" . BR;\n return '';\n }", "function drush_sitealias_cache_alias_by_path($alias_record) {\n if (!isset($alias_record['remote-host']) && isset($alias_record['root']) && isset($alias_record['uri']) && isset($alias_record['#name']) && isset($alias_record['#file'])) {\n $path = drush_sitealias_local_site_path($alias_record);\n if ($path) {\n $cid = drush_get_cid('alias-path-', array(), array($path));\n $alias_path_data = array(\n '#name' => $alias_record['#name'],\n '#file' => $alias_record['#file'],\n );\n drush_cache_set($cid, $alias_path_data);\n }\n }\n}", "public function resolveAlias(string $alias);", "function alias($name,$params=array()) {\n\t\tif (!is_array($params))\n\t\t\t$params=$this->parse($params);\n\t\tif (empty($this->hive['ALIASES'][$name]))\n\t\t\tuser_error(sprintf(self::E_Named,$name),E_USER_ERROR);\n\t\t$url=$this->build($this->hive['ALIASES'][$name],$params);\n\t\treturn $url;\n\t}", "function alias_expand($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name]))\n\treturn $aliastable[$name];\n\telse if (is_ipaddr($name) || is_subnet($name))\n\treturn $name;\n\telse\n\treturn null;\n}", "function UseAlias(&$params, $paramName)\r\n {\r\n $sefConfig = SEFConfig::getConfig();\r\n\r\n $param = $params->get($paramName, 'global');\r\n if( ($param == 'alias') ||\r\n ($param == 'global' && $sefConfig->useAlias) )\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "function alias_expand($name) {\n\t\n\tglobal $aliastable;\n\t\n\tif (isset($aliastable[$name]))\n\t\treturn $aliastable[$name];\n\telse if (is_ipaddr($name) || is_subnet($name) || is_ipaddr6($name))\n\t\treturn $name;\n\telse\n\t\treturn null;\n}", "public function getAliases();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Step 2: Generate a Base64 Policy
protected function generatePolicy(): void { $policy = [ 'expiration' => $this->getExpirationDate(), 'conditions' => [ ['bucket' => $this->bucket], ['acl' => (string)$this->options->get('acl')], ['starts-with', '$key', $this->options->get('valid_prefix')], $this->getPolicyContentTypeArray(), ['content-length-range', 0, $this->mbToBytes($this->options->get('max_file_size'))], ['success_action_status' => $this->options->get('success_status')], ['x-amz-credential' => $this->credentials], ['x-amz-algorithm' => self::ALGORITHM], ['x-amz-date' => $this->getFullDateFormat()] ] ]; $policy = $this->addAdditionalInputs($policy); $this->base64Policy = base64_encode(json_encode($policy)); }
[ "public function get_policy()\n\t{\n\t\treturn base64_encode($this->json_policy);\n\t}", "function generateCodeChallenge()\n {\n $hash = pack('H*', hash(\"SHA256\", $this->generateCodeVerifier()));\n \n return $this->base64url_encode($hash);\n }", "protected function applyPolicy()\n {\n $jsonPolicy64 = base64_encode($this->jsonPolicy);\n $this->formInputs['policy'] = $jsonPolicy64;\n\n $this->formInputs['signature'] = base64_encode(hash_hmac(\n 'sha1',\n $jsonPolicy64,\n $this->client->getCredentials()->getSecretKey(),\n true\n ));\n }", "public function generate_iam_policy() {\n\n\t\tWP_Cli::print_value( $this->get_iam_policy() );\n\n\t}", "public static function genNewToken() {\r\n\t return vUtils::base64_url_encode(vUtils::genKey());\r\n\t}", "function GenFkey()\n{\n $bytes = openssl_random_pseudo_bytes(32);\n return base64_encode($bytes);\n}", "function generateCodeVerifier()\n {\n return $this->base64url_encode(pack('H*', $this->codeVerifier));\n }", "function generateApiKey($str_length){\n //base 62 map\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n //get enough random bits for base 64 encoding (and prevent '=' padding)\n //note: +1 is faster than ceil()\n $bytes = openssl_random_pseudo_bytes(3*$str_length/4+1);\n\n //convert base 64 to base 62 by mapping + and / to something from the base 62 map\n //use the first 2 random bytes for the characters\n $repl = unpack('C2', $bytes);\n\n $first = $chars[$repl[1]%62];\n $second = $chars[$repl[2]%62];\n return strtr(substr(base64_encode($bytes), 0, $str_length), '+/', \"$first$second\");\n\n}", "function fromBase64Web(string $base64): string\n{\n return base64_decode(strtr($base64, '-_', '+/'));\n}", "function generateAcceptFromKey(string $key): string\n{\n return \\base64_encode(\\sha1($key . GUID, true));\n}", "public static function toBase64($value) {}", "private function generateSecret()\n {\n $randomBytes = random_bytes(10);\n\n return Base32::encodeUpper($randomBytes) ;\n }", "public function base64($filePath);", "function salt_hmac($size1=4,$size2=6) {\n$hprand = rand(4,6); $i = 0; $hpass = \"\";\nwhile ($i < $hprand) {\n$hspsrand = rand(1,2);\nif($hspsrand!=1&&$hspsrand!=2) { $hspsrand=1; }\nif($hspsrand==1) { $hpass .= chr(rand(48,57)); }\nif($hspsrand==2) { $hpass .= chr(rand(65,70)); }\n++$i; } return $hpass; }", "function fromBase64Web(string $base64): string\n{\n $decoded = base64_decode(strtr($base64, '-_', '+/'));\n assert($decoded !== false);\n return $decoded;\n}", "public function storeImageBase64($base64Image, $type) {\n \t$decodedImage = base64_decode($base64Image);\n \t$imageName = rand(1, 999) .'_role_' . time() . '.png';\n \t$fp = fopen(public_path() . '/imgs/' . $type . '/' . $imageName, 'wb+');\n \tfwrite($fp, $decodedImage);\n \tfclose($fp);\n \treturn $imageName;\n }", "public function storeImageBase64($base64Image, $type) {\n \t$decodedImage = base64_decode($base64Image);\n \t$imageName = rand(1, 999) . time() . '.png';\n \t$fp = fopen(public_path() . '/imgs/' . $type . '/' . $imageName, 'wb+');\n \t$fp_thumb = fopen(public_path() . '/imgs/' . $type . '/thumb/' . $imageName, 'wb+');\n \tfwrite($fp, $decodedImage);\n \tfclose($fp);\n \tfwrite($fp_thumb, $decodedImage);\n \tfclose($fp_thumb);\n \treturn $imageName;\n }", "private function generateSecret()\n\t{\n\t\t$randomBytes = random_bytes(10);\n\t\t\n\t\treturn Base32::encodeUpper($randomBytes);\n }", "function BASE64URL_digital_generate($dato, $privatekey)\n \t{\n $privres = openssl_pkey_get_private(array($privatekey,null));\n\n if (!$privres)\n {\n die(\"Private key is not valid\");\n\n }\n\n $firma = \"\";\n\n $resp = openssl_sign($dato,$firma,$privres);\n\n openssl_free_key($privres);\n\n if($resp){\n\n $base64 = base64_encode($firma);\n\n $crypttext = preg_replace('/(\\\\/)/' ,'_',$base64);\n $crypttext = preg_replace('/(\\+)/','-',$crypttext);\n $crypttext = preg_replace('/(=)/' ,'.',$crypttext);\n\n //$urlencoded = urlencode($base64);\n return $crypttext;\n }\n else{\n die(\"RSA Signature was unsuccesful\");\n }\n\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get y of element by name
function get_y_by_name($name) { return $this->z_get_y_by_name($name); }
[ "public function getY()\n {\n return $this->getElement(1);\n }", "public function getPositionY() {\n\t\treturn $this->elements['position']['y'];\n\t}", "public function getY()\n {\n return $this->_data['coords'][1];\n }", "public function getY() {\r\n\t\treturn $this->y;\r\n\t}", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->position->getY();\n }", "function getY() {\n return 'ball_' . substr($this->pair, -1, 1);\n }", "public function getY() {\n return $this->pPosition->top;\n }", "public function getY(): float\n {\n return $this->y;\n }", "public function getCoordY() {\n \treturn $this->_coordY;\n }", "public function getValY() {\n return $this->valY;\n }", "protected function getTextY()\r\n {\r\n switch ($this->options['textposition']) {\r\n case 'top':\r\n $y = $this->getContentOffsetTop() + 2;\r\n break;\r\n default:\r\n $y = $this->getContentOffsetTop() + $this->getHeight() + 2;\r\n }\r\n return $y;\r\n }", "public function getY()\n {\n if ( ! $this->hasY()) {\n $this->setY($this->getDefaultY());\n }\n return $this->y;\n }", "function z_get_y_by_inner_text($text,$exactly)\n\t{\n\t\treturn $this->call(\"$this->prefix.GetYByInnerText?text=\".urlencode($text).\"&exactly=\".urlencode($exactly));\n\t}", "public function get_axis_y() {\n return $this->axis_y;\n }", "public function getYField()\n {\n return $this->yField;\n }", "function findElement( $name ) {\r\n\t\treturn $this->elements[ $name ];\r\n\t}", "public function getPositionY()\n {\n return $this->position_y;\n }", "public function getPositionY ()\n {\n return $this->_positionY;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'postApiTicketThreads'
protected function postApiTicketThreadsRequest($id, $thread_type = null, $reply = null, $status = null, $to = null, $files = null, $act_as_type = null, $act_as_email = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling postApiTicketThreads' ); } $resourcePath = '/ticket/{id}/threads.json'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } // form params if ($thread_type !== null) { $formParams['threadType'] = ObjectSerializer::toFormValue($thread_type); } // form params if ($reply !== null) { $formParams['reply'] = ObjectSerializer::toFormValue($reply); } // form params if ($status !== null) { $formParams['status'] = ObjectSerializer::toFormValue($status); } // form params if ($to !== null) { $formParams['to'] = ObjectSerializer::toFormValue($to); } // form params if ($files !== null) { $formParams['files'] = ObjectSerializer::toFormValue($files); } // form params if ($act_as_type !== null) { $formParams['actAsType'] = ObjectSerializer::toFormValue($act_as_type); } // form params if ($act_as_email !== null) { $formParams['actAsEmail'] = ObjectSerializer::toFormValue($act_as_email); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/x-www-form-urlencoded'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($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 OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $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( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function getApiTicketThreadsRequest($id)\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 getApiTicketThreads'\n );\n }\n\n $resourcePath = '/ticket/{id}/threads.json';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 // 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 // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 }", "protected function restTicketsTicketIdPostRequest($ticket_id)\n {\n // verify the required parameter 'ticket_id' is set\n if ($ticket_id === null || (is_array($ticket_id) && count($ticket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ticket_id when calling restTicketsTicketIdPost'\n );\n }\n\n $resourcePath = '/rest/tickets/{ticketId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($ticket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'ticketId' . '}',\n ObjectSerializer::toPathValue($ticket_id),\n $resourcePath\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 $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\\build_query($formParams);\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\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createThread()\n {\n //prevent CSRF\n if (!isset($_POST['token']) || !Token::check($_POST['token'], false))\n {\n echo json_encode(['displayError' => Controller::$language->invokeOutput('frequent/badRequest')]);\n }else{\n unset($_POST['token']);\n $addThread = threadsAPI::getInstance()->createThread($_POST);\n if (is_string($addThread))\n {\n Token::destroyToken();\n echo json_encode([\"done\" => $addThread, 'redirect' => 'forum/'.$_POST['forum_id']]);\n }else{\n if (is_array($addThread))\n echo json_encode($addThread);\n else\n echo json_encode(['displayError' => Controller::$language->invokeOutput('frequent/wrong')]);\n }\n }\n }", "public function createTicketAvailRQ()\n\t{\n\t\tglobal $CONFIG;\n\t\t$_REQUEST[\"echoToken\"] = \"DummyEchoToken\";\n\t\t$_REQUEST[\"sessionId\"] = \"DummySessionId\";\n\t\t$_REQUEST[\"Language\"] = \"ENG\";\n\t\t$_REQUEST[\"Credentials_User\"] = $CONFIG[\"user\"];\n\t\t$_REQUEST[\"Credentials_Password\"] = $CONFIG[\"password\"];\n\t\t$_REQUEST[\"PaginationData_itemsPerPage\"] = \"25\";\n\t\t$_REQUEST[\"PaginationData_pageNumber\"] = \"1\";\n\t\t$_REQUEST[\"ServiceOccupancy_AdultCount\"] = \"1\";\n\t\t$_REQUEST[\"ServiceOccupancy_ChildCount\"] = \"0\";\n\t\t$_REQUEST[\"Destination_code\"] = \"PMI\";\n\t\t//$_REQUEST[\"Destination_Value\"] = \"Jaaarrrl\";\n\t\t$_REQUEST[\"Destination_Name_Fake\"] = \"Fake\";\n\t\t$_REQUEST[\"DateFrom_date\"] = $this->tomorrow();\n\t\t$_REQUEST[\"DateTo_date\"] = $this->day_after_tomorrow();\n\t}", "protected function putApiTicketThreadRequest($ticket_id, $id, $reply = null)\n {\n // verify the required parameter 'ticket_id' is set\n if ($ticket_id === null || (is_array($ticket_id) && count($ticket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ticket_id when calling putApiTicketThread'\n );\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 putApiTicketThread'\n );\n }\n\n $resourcePath = '/ticket/{ticketId}/thread/{id}.json';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($ticket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'ticketId' . '}',\n ObjectSerializer::toPathValue($ticket_id),\n $resourcePath\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 // form params\n if ($reply !== null) {\n $formParams['reply'] = ObjectSerializer::toFormValue($reply);\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/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 getTicketWorkflowCountRequest()\n {\n \n\n $resourcePath = '/ticket_workflows/counts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\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 // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $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 }", "public function whmcs_create_ticket($params = array()) {\n\t\t$params['action'] = 'OpenTicket';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function createThread()\r\n {\r\n $req_result = $this->thread->createThread();\r\n print(json_encode($req_result));\r\n }", "protected function channelsV2MessagingThreadsTidPutRequest($tid, $post_thread_request = null)\n {\n // verify the required parameter 'tid' is set\n if ($tid === null || (is_array($tid) && count($tid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $tid when calling channelsV2MessagingThreadsTidPut'\n );\n }\n\n $resourcePath = '/channels/v2/messaging/threads/{tid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($tid !== null) {\n $resourcePath = str_replace(\n '{' . 'tid' . '}',\n ObjectSerializer::toPathValue($tid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($post_thread_request)) {\n $_tempBody = $post_thread_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 threadActions() {\n\t\t/**\n\t\t * Set TsBase value so that it will not show \"Error Permission\" but set $accessPermissionErrorStatus so that we can check that agent has permission or not\n\t\t * @var boolean\n\t\t */\n\t\t$this->isAjax = true;\n\n\t\tif(isset($this->request->post['event'])){\n\t\t\tif(!in_array($this->request->post['event'], array('reply[message]', 'forward[message]', 'internal[message]', 'getViewers')))\n\t\t\t\t$this->checkEventAccessPermission(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'key'=>self::CONTROLLER_NAME, \n\t\t\t\t\t\t\t\t\t\t\t\t\t'event'=> self::CONTROLLER_NAME.'.'.$this->request->post['event']\n\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);\n\n\t\t}else{\n\t\t\t$this->accessPermissionErrorStatus = true;\n\t\t}\n\n\t\t$this->language->load('ticketsystem/all');\n\n\t\t$json = array();\n\n\t\tif(!$this->accessPermissionErrorStatus){\n\t\t\t$this->load->model('ticketsystem/tickets');\n\n\t\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST')) {\n\t\t\t\t$event = $this->request->post['event'];\n\t\t\t\tswitch ($event) {\n\t\t\t\t\tcase 'deletethread':\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t 'id' => $this->request->post['id'],\n\t\t\t\t\t\t\t 'thread_id' => str_replace(array('deletethread-','split-'), '', $this->request->post['threadId']),\n\t\t\t\t\t\t\t 'agent_id' => $this->agent['id'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->model_ticketsystem_tickets->deleteTicketThread($data['thread_id']);\n\t\t\t\t\t\t$json['success'] = $this->language->get('text_success_delete_thread');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'split':\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t 'id' => $this->request->post['id'],\n\t\t\t\t\t\t\t 'thread_id' => str_replace(array('deletethread-','split-'), '', $this->request->post['threadId']),\n\t\t\t\t\t\t\t 'agent_id' => $this->agent['id'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$ticket_id = $this->model_ticketsystem_tickets->copyTicket($data['id']);\n\t\t\t\t\t\t$ticket_url = $this->url->link('ticketsystem/tickets/edit', 'token=' . $this->session->data['token'] .'&id='.$ticket_id, 'SSL');\n\t\t\t\t\t\t$this->model_ticketsystem_tickets->updateTicketThread(array('ticket_id' => $ticket_id, 'thread_id' => $data['thread_id']));\n\t\t\t\t\t\t$this->model_ticketsystem_tickets->addAgentTicket(array('ticket_id' => $ticket_id, 'agent_id' => $this->agent['id']));\n\t\t\t\t\t\t$json['success'] = sprintf($this->language->get('text_success_split_ticket'), $ticket_url, $ticket_id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase preg_match('/\\[message\\]/', $event) ? true: false:\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t 'ticket_id' => $this->request->post['id'],\n\t\t\t\t\t\t\t 'agent_id' => $this->agent['id'],\n\t\t\t\t\t\t\t 'type' => preg_replace('/\\[message\\]/', '', $event),\n\t\t\t\t\t\t\t 'message' => $this->request->post['html'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->model_ticketsystem_tickets->updateTicketDrafts($data);\n\t\t\t\t\t\t$json['success'] = $this->language->get('text_success_draft_ticket');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'getViewers':\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t 'ticket_id' => $this->request->post['id'],\n\t\t\t\t\t\t\t 'agent_id' => $this->agent['id'],\n\t\t\t\t\t\t\t 'type' => $event,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->model_ticketsystem_tickets->clearExtraViewers($data);\n\t\t\t\t\t\t$viewers = $this->model_ticketsystem_tickets->getTicketViewAgent($data['ticket_id']);\n\t\t\t\t\t\t$json['viewers'] = $agents = [];\n\t\t\t\t\t\tif($viewers){\n\t\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t\t\tforeach ($viewers as $viewer) {\n\t\t\t\t\t\t\t\tif($viewer['agent_id'] != $this->agent['id']){\n\t\t\t\t\t\t\t\t\t$agent = $this->model_ticketsystem_agents->getAgent(array('a.id' => $viewer['agent_id']));\n\t\t\t\t\t\t\t\t\tif($agent)\n\t\t\t\t\t\t\t\t\t\t$agents[] = $agent['name_alias'] ? $agent['name_alias'] : $agent['username'];\n\t\t\t\t\t\t\t\t\t$count++;\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$json['viewers'] = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'viewers' => implode(', ', $agents),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'no' => $count,\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}else\n\t\t\t$json['warning'] = $this->language->get('error_permission');\n\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "protected function postWorkforcemanagementTimeoffrequestsRequest($body = null)\n {\n\n $resourcePath = '/api/v2/workforcemanagement/timeoffrequests';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function createSupportTicketUsingPostRequest($support_ticket_request)\n {\n // verify the required parameter 'support_ticket_request' is set\n if ($support_ticket_request === null || (is_array($support_ticket_request) && count($support_ticket_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $support_ticket_request when calling createSupportTicketUsingPost'\n );\n }\n\n $resourcePath = '/support_ticket';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($support_ticket_request)) {\n $_tempBody = $support_ticket_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function actionThreadsForm()\n {\n\t $ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);\n\t\tlist($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId);\n\t\t\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\t\n\t\t//Only admins can add restrictions\n\t\tif(!$visitor['is_admin'])\n\t\t{\n\t\t return $this->responseNoPermission();\n\t\t}\n\t\t\n\t\t//Register variable for use in our template\n\t\t$viewParams = array(\n\t\t\t'thread' => $thread\n\t\t);\n\t\t\n return $this->responseView('', 'KomuKu_threads_add', $viewParams);\n }", "public function submitTicketICT(){\n $fd = new Freshdesk();\n $attributes = request()->all();\n $staffemail = Auth::user()->email;\n $subject = \"[ICT] \" . $attributes['subject'];\n $body = \"<b>Location: </b>\" . $attributes['location'] . \"<br><b>Room: </b> \" . $attributes['room'] . \"<br><b>Date: </b> \" . $attributes['date'] . \"<br><br><b>Request Info: </b><br>\" . $attributes['description'] . \"\";\n $ticket_payload = json_encode(array(\n \"email\" => $staffemail,\n \"subject\" => $subject,\n \"description\" => $body,\n \"priority\" => 1,\n \"status\" => 2,\n \"tags\" => array(\"Web Portal\", $attributes['location'])\n ));\n $response = $fd->createTicket($ticket_payload);\n return response()->json(array($response), 200);\n }", "protected function plantbatchesV1AdditivesPostRequest()\n {\n\n $resourcePath = '/plantbatches/v1/additives';\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 $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\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function actionAddThread()\n\t{\n\t\t$this->_assertPostOnly();\n\n\t\t$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);\n\t\t$forumName = $this->_input->filterSingle('node_name', XenForo_Input::STRING);\n\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$forum = $ftpHelper->assertForumValidAndViewable($forumId ? $forumId : $forumName);\n\n\t\t$forumId = $forum['node_id'];\n\n\t\t$this->_assertCanPostThreadInForum($forum);\n\n\t\tif (!XenForo_Captcha_Abstract::validateDefault($this->_input))\n\t\t{\n\t\t\treturn $this->responseCaptchaFailed();\n\t\t}\n\n\t\t$visitor = XenForo_Visitor::getInstance();\n\n\t\t$input = $this->_input->filter(array(\n\t\t\t'title' => XenForo_Input::STRING,\n\t\t\t'attachment_hash' => XenForo_Input::STRING,\n\n\t\t\t'watch_thread_state' => XenForo_Input::UINT,\n\t\t\t'watch_thread' => XenForo_Input::UINT,\n\t\t\t'watch_thread_email' => XenForo_Input::UINT,\n\n\t\t\t'_set' => array(XenForo_Input::UINT, 'array' => true),\n\t\t\t'discussion_open' => XenForo_Input::UINT,\n\t\t\t'sticky' => XenForo_Input::UINT,\n\n\t\t\t'poll' => XenForo_Input::ARRAY_SIMPLE, // filtered below\n\t\t));\n\t\t$input['message'] = $this->getHelper('Editor')->getMessageText('message', $this->_input);\n\t\t$input['message'] = XenForo_Helper_String::autoLinkBbCode($input['message']);\n\n\t\t$pollInputHandler = new XenForo_Input($input['poll']);\n\t\t$pollInput = $pollInputHandler->filter(array(\n\t\t\t'question' => XenForo_Input::STRING,\n\t\t\t'responses' => array(XenForo_Input::STRING, 'array' => true),\n\t\t\t'multiple' => XenForo_Input::UINT,\n\t\t\t'public_votes' => XenForo_Input::UINT,\n\t\t\t'close' => XenForo_Input::UINT,\n\t\t\t'close_length' => XenForo_Input::UNUM,\n\t\t\t'close_units' => XenForo_Input::STRING\n\t\t));\n\n\t\t// note: assumes that the message dw will pick up the username issues\n\t\t$writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');\n\t\t$writer->set('user_id', $visitor['user_id']);\n\t\t$writer->set('username', $visitor['username']);\n\t\t$writer->set('title', $input['title']);\n\t\t$writer->set('node_id', $forumId);\n\n\t\t// discussion state changes instead of first message state\n\t\t$writer->set('discussion_state', $this->getModelFromCache('XenForo_Model_Post')->getPostInsertMessageState(array(), $forum));\n\n\t\t// discussion open state - moderator permission required\n\t\tif (!empty($input['_set']['discussion_open']) && $this->_getForumModel()->canLockUnlockThreadInForum($forum))\n\t\t{\n\t\t\t$writer->set('discussion_open', $input['discussion_open']);\n\t\t}\n\n\t\t// discussion sticky state - moderator permission required\n\t\tif (!empty($input['_set']['sticky']) && $this->_getForumModel()->canStickUnstickThreadInForum($forum))\n\t\t{\n\t\t\t$writer->set('sticky', $input['sticky']);\n\t\t}\n\n\t\t$postWriter = $writer->getFirstMessageDw();\n\t\t$postWriter->set('message', $input['message']);\n\t\t$postWriter->setExtraData(XenForo_DataWriter_DiscussionMessage::DATA_ATTACHMENT_HASH, $input['attachment_hash']);\n\n\t\t$writer->preSave();\n\n\t\tif ($pollInput['question'] !== '')\n\t\t{\n\t\t\t$pollWriter = XenForo_DataWriter::create('XenForo_DataWriter_Poll');\n\t\t\t$pollWriter->bulkSet(\n\t\t\t\tXenForo_Application::arrayFilterKeys($pollInput, array('question', 'multiple', 'public_votes'))\n\t\t\t);\n\t\t\t$pollWriter->set('content_type', 'thread');\n\t\t\t$pollWriter->set('content_id', 0); // changed before saving\n\t\t\tif ($pollInput['close'])\n\t\t\t{\n\t\t\t\tif (!$pollInput['close_length'])\n\t\t\t\t{\n\t\t\t\t\t$pollWriter->error(new XenForo_Phrase('please_enter_valid_length_of_time'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pollWriter->set('close_date', strtotime('+' . $pollInput['close_length'] . ' ' . $pollInput['close_units']));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$pollWriter->addResponses($pollInput['responses']);\n\t\t\t$pollWriter->preSave();\n\t\t\t$writer->mergeErrors($pollWriter->getErrors());\n\n\t\t\t$writer->set('discussion_type', 'poll', '', array('setAfterPreSave' => true));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pollWriter = false;\n\n\t\t\tforeach ($pollInput['responses'] AS $response)\n\t\t\t{\n\t\t\t\tif ($response !== '')\n\t\t\t\t{\n\t\t\t\t\t$writer->error(new XenForo_Phrase('you_entered_poll_response_but_no_question'));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$writer->hasErrors())\n\t\t{\n\t\t\t$this->assertNotFlooding('post');\n\t\t}\n\n\t\t$writer->save();\n\n\t\t$thread = $writer->getMergedData();\n\n\t\tif ($pollWriter)\n\t\t{\n\t\t\t$pollWriter->set('content_id', $thread['thread_id'], '', array('setAfterPreSave' => true));\n\t\t\t$pollWriter->save();\n\t\t}\n\n\t\t$this->_getThreadWatchModel()->setVisitorThreadWatchStateFromInput($thread['thread_id'], $input);\n\n\t\t$this->_getThreadModel()->markThreadRead($thread, $forum, XenForo_Application::$time, $visitor['user_id']);\n\n\t\tif (!$this->_getThreadModel()->canViewThread($thread, $forum))\n\t\t{\n\t\t\t$return = XenForo_Link::buildPublicLink('forums', $forum, array('posted' => 1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$return = XenForo_Link::buildPublicLink('threads', $thread);\n\t\t}\n\n\t\treturn $this->responseRedirect(\n\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\t$return,\n\t\t\tnew XenForo_Phrase('your_thread_has_been_posted')\n\t\t);\n\t}", "protected function deleteApiTicketRequest($id)\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 deleteApiTicket'\n );\n }\n\n $resourcePath = '/ticket/{id}.json';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 // 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 // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createTickets($params) {\n\t\t$id_board = null;\n\t\tforeach ($params as $param => $value) {\n\t\t\tif (empty($value)) {\n\t\t\t\t$index = array_search($param, $params);\n\t\t\t\tunset($index);\n\t\t\t}\n\t\t\tif ('board' === $param) {\n\t\t\t\t$id_board = $params[$param];\n\t\t\t\tunset($params[$param]);\n\t\t\t}\n\t\t}\n\n\t\t$date = new DateTime('now');\n\t\t$params['creation_date'] = $date->format('Y-m-d H:i:s');\n\t\t$bhs = new BoardHasTicket();\n\t\t$ticket = self::create($params);\n\t\t$id_ticket = $ticket->id;\n\t\t$bhs->createBoardHasTicket($id_board, $id_ticket);\n\n\t\t$ticket = $this->findTickets($id_ticket);\n\n\t\treturn $ticket;\n\t}", "protected function membershipOrdersPostMembershipOrderRequest($data)\n {\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling membershipOrdersPostMembershipOrder'\n );\n }\n\n $resourcePath = '/api/v1/MembershipOrders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n ['application/json', 'text/json', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 \n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Token');\n if ($apiKey !== null) {\n $headers['Token'] = $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\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }