query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Determine if the passed token has a condition of one of the passed types.
public function hasCondition($stackPtr, $types) { return $this->__call(__FUNCTION__, func_get_args()); }
[ "public function hasConditionType(string $type): bool;", "private function foundOneOf($tokentypes) {\n\t\tforeach ( $tokentypes as $tokentype ) {\n\t\t\tif ($this->token->getType () == $tokentype)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasCondition();", "function isApplicableFor (Tokenized $token) : bool;", "private function check($token_type)\n {\n if ($this->atEnd()) {\n return false;\n }\n\n return $this->current()->getTokenType() === $token_type;\n }", "private function is($type) {\n return $this->nextToken != null and $this->nextToken[0] == $type;\n }", "public function isCondition($name);", "public function hasToken($token);", "function bare_pages_context_conditions_check($type) {\n // Failsafe\n if ($type != 'child' && $type != 'parent') {\n return false;\n }\n \n // Other modules' custom \"context\" detection\n $bool_arr = array();\n foreach (module_implements('detect_bp_' . $type . '_context') as $module) {\n $bool_arr[] = module_invoke($module, 'detect_bp_' . $type . '_context');\n }\n \n // Default detection is OR\n // (means anyone saying true \"wins\")\n // (if it was AND, anyone saying false \"wins\")\n // @todo configurable custom settings form for conditions checking method (AND)\n if (!empty($bool_arr)) {\n $checking_method = variable_get('bp_checking_method', 'OR');\n foreach($bool_arr as $bool) {\n if ($checking_method == 'OR' && $bool) {\n return true;\n }\n if ($checking_method == 'AND' && !$bool) {\n return false;\n }\n }\n }\n \n // Default behavior (when no other modules provide detection)\n else {\n // @todo configurable custom settings form for param\n $var_name = variable_get('bp_' . $type . '_get_param_name', 'b' . $type);\n if (!empty($_GET[$var_name])) {\n return true;\n }\n }\n \n return false;\n}", "public function isNext(int ...$tokenTypes): bool;", "function check_type($token)\n{\n if($token->type != \"type\")\n {\n fwrite(STDERR, \"ERROR:Other lexical or syntax error.\\n\");\n exit(23);\n }\n}", "abstract public function check_token($token = null);", "private function isToken($token, $typeMask = null)\n {\n if (! $token instanceof Token) {\n return false;\n }\n\n if ($typeMask === null || (bool) ($token->getType() & $typeMask)) {\n return true;\n }\n\n return false;\n }", "protected function matchToken(int $position, int $type): bool {\n if (!isset($this->_tokens[$position])) {\n return false;\n }\n\n if ($type === Scanner\\Token::ANY) {\n // A token has been found. We do not care which one it was\n return true;\n }\n\n return ($this->_tokens[$position]->type === $type);\n }", "private static function isOperator($tokenType) {\n\t\t\tswitch ($tokenType) {\n\t\t\t\t\n\t\t\t\tcase 'T_CLONE':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_NEW':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '[':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_POW': // **\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_INC': // ++\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_DEC': // --\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '~':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_INT_CAST': // (int) or (integer)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_DOUBLE_CAST': // (double) or (real) or (float)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_STRING_CAST': // (string)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_ARRAY_CAST': // (array)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_OBJECT_CAST': // (object)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_BOOL_CAST': // (bool) or (boolean)\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '@':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_INSTANCEOF':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '!':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '*':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '/':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '%':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '+':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '-':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '.':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_SL': // <<\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_SR': // >>\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '<':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_SMALLER_OR_EQUAL': // <=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '>':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_GREATER_OR_EQUAL': // >=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_EQUAL': // ==\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_NOT_EQUAL': // != or <>\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_IDENTICAL': // ===\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_IS_NOT_IDENTICAL': // !==\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '&':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '^':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '|':\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\tcase 'T_BOOLEAN_AND':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_BOOLEAN_OR':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '?':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase ':':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase '=';\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_PLUS_EQUAL': // +=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_MINUS_EQUAL': // -=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_MUL_EQUAL': // *=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_POW_EQUAL': // **=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_DIV_EQUAL': // /=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_CONCAT_EQUAL': // .=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_MOD_EQUAL': // %=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_AND_EQUAL': // &=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_OR_EQUAL': // |=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_XOR_EQUAL': // ^=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_SL_EQUAL': // <<=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_SR_EQUAL': // >>=\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_DOUBLE_ARROW': // =>\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_LOGICAL_AND': // and\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_LOGICAL_XOR': // xor\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase 'T_LOGICAL_OR': // or\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase ',':\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t} // end switch\n\t\t}", "protected function is($type)\n\t{\n\t\tif ($this->valid())\n\t\t{\n\t\t\treturn ($this->token->type == $type);\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function isOperator(Token $token)\n {\n if(T_STRING == $token->getType()) {\n if(isset($this->byPass[$token->getValue()])) {\n return false;\n }\n return isset($this->operatorsStrings[$token->getValue()]);\n }\n\n return isset($this->operators[$token->getType()]);\n }", "public function hasToken(string $lexeme): bool;", "private static function isOperator(TokenInterface $token)\n {\n return in_array($token->getType(), [\n TokenInterface::TYPE_OPERATOR_ASSIGNMENT,\n TokenInterface::TYPE_OPERATOR_COPY,\n TokenInterface::TYPE_OPERATOR_DELETE,\n TokenInterface::TYPE_OPERATOR_MODIFY,\n TokenInterface::TYPE_OPERATOR_REFERENCE,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy datas from $_POST to object
public function copyFromPost() { /* Classical fields */ foreach ($this->fields AS $key => $more) { if (array_key_exists($key, $_POST)) { /* Do not take care of password field if empty */ if ($key == 'passwd' AND empty($_POST[$key])) { continue; } /* Automatically encrypt password in MD5 */ if ($key == 'passwd' AND !empty($_POST[$key])) { $this->{$key} = Tools::encrypt($_POST[$key]); } else { $this->{$key} = $_POST[$key]; } } elseif (isset($this->{$key}) && !empty($this->{$key}) && $this->{$key} != null){ continue; } else { $this->{$key} = ''; } } }
[ "protected function copyFromPost(&$object) {\r\n\t\t/* Classical fields */\r\n\t\tforeach ( $_POST as $key => $value ) {\r\n\t\t\tif ($key == 'active_column' || $key == 'active_menu' || $key == 'active_element') {\r\n\t\t\t\t$key = 'active';\r\n\t\t\t}\r\n\t\t\tif (key_exists($key, $object)) {\r\n\t\t\t\t$object->{$key} = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Multilingual fields */\r\n\t\t$rules = call_user_func(array (get_class($object), 'getValidationRules' ), get_class($object));\r\n\t\tif (sizeof($rules ['validateLang'])) {\r\n\t\t\t$languages = Language::getLanguages(false);\r\n\t\t\tforeach ( $languages as $language )\r\n\t\t\t\tforeach ( $rules ['validateLang'] as $field => $validation )\r\n\t\t\t\t\tif (isset($_POST [$field . '_' . intval($language ['id_lang'])])) {\r\n\t\t\t\t\t\t$object->{$field} [intval($language ['id_lang'])] = $_POST [$field . '_' . intval($language ['id_lang'])];\r\n\t\t\t\t\t}\r\n\t\t}\r\n\t}", "public function set_data_from_post() {\n\t\t$this->data = array();\n\t\tforeach ($this->fields as $field) {\n\t\t\tif (array_key_exists($field, $_POST)) {\n\t\t\t\tif (in_array($field, $this->fields_bitwise)) {\n\t\t\t\t\t// Bitwise field.\n\t\t\t\t\t$this->data[$field] = array();\n\t\t\t\t\tif (is_array($_POST[$field])) {\n\t\t\t\t\t\tforeach ($_POST[$field] as $key => $value) {\n\t\t\t\t\t\t\tif (ctype_digit($value)) {\n\t\t\t\t\t\t\t\t$this->data[$field][] = $value;\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} else {\n\t\t\t\t\t// Normal field.\n\t\t\t\t\tif (is_scalar($_POST[$field])) {\n\t\t\t\t\t\t$this->data[$field] = trim($_POST[$field]);\n\t\t\t\t\t\tif ($this->data[$field] === '') {\n\t\t\t\t\t\t\t$this->data[$field] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->data[$field] =\n\t\t\t\t\t\t\t\t$this->convert_windows_characters($this->data[$field]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->data[$field] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Field not submitted.\n\t\t\t\tif (in_array($field, $this->fields_bitwise)) {\n\t\t\t\t\t$this->data[$field] = array();\n\t\t\t\t} else {\n\t\t\t\t\t$this->data[$field] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->data['set_from'] = 'post';\n\t}", "function seed_from_POST()\n\t{\n\t\tforeach($_POST as $key => $value)\n\t\t{\n\t\t\t$this->$key = !isset($key[$value]) || is_null(trim($key[$value])) ? \"\" : $value;\n\t\t\tif ($key != \"submit\")\n\t\t\t{\n\t\t\t\t$this->$key = $value;\n\t\t\t//\techo \"<br />\".$this->$key;\n\t\t\t}\n\t\t}\n\t}", "public function recuperar_post()\n\t{\n\t\tforeach ($this->model_fields as $nombre => $metadata)\n\t\t{\n\t\t\t// si el valor del post es un arreglo, transforma los valores a llaves del arreglo\n\t\t\tif (is_array($this->CI->input->post($nombre)))\n\t\t\t{\n\t\t\t\t$arr = array();\n\n\t\t\t\tforeach ($this->CI->input->post($nombre) as $key => $val)\n\t\t\t\t{\n\t\t\t\t\t$arr[$val] = $val;\n\t\t\t\t}\n\n\t\t\t\t$this->$nombre = $arr;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tipo_campo = $metadata->get_tipo();\n\n\t\t\t\tif ($tipo_campo == 'id' OR $tipo_campo == 'boolean' OR $tipo_campo == 'integer')\n\t\t\t\t{\n\t\t\t\t\t$this->$nombre = (int) $this->CI->input->post($nombre);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->$nombre = $this->CI->input->post($nombre);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function from_post( $object );", "protected function copyFromPost(&$object, $table)\r\r\n {\r\r\n /* Classical fields */\r\r\n foreach ($_POST as $key => $value) {\r\r\n if (array_key_exists($key, $object) && $key != 'id_' . $table) {\r\r\n /* Do not take care of password field if empty */\r\r\n if ($key == 'passwd' && Tools::getValue('id_' . $table) && empty($value)) {\r\r\n continue;\r\r\n }\r\r\n /* Automatically encrypt password in MD5 */\r\r\n if ($key == 'passwd' && !empty($value)) {\r\r\n $value = Tools::encrypt($value);\r\r\n }\r\r\n $object->{$key} = $value;\r\r\n }\r\r\n }\r\r\n\r\r\n /* Multilingual fields */\r\r\n $rules = call_user_func(array(get_class($object), 'getValidationRules'), get_class($object));\r\r\n if (count($rules['validateLang'])) {\r\r\n $languages = Language::getLanguages(false);\r\r\n foreach ($languages as $language) {\r\r\n foreach (array_keys($rules['validateLang']) as $field) {\r\r\n if (isset($_POST[$field . '_' . (int) $language['id_lang']])) {\r\r\n $object->{$field}[(int) $language['id_lang']] = $_POST[$field . '_' . (int) $language['id_lang']];\r\r\n }\r\r\n }\r\r\n }\r\r\n }\r\r\n }", "function addPostData () {\r\n\t\tforeach (get_class_vars(get_class($this)) as $field=>$value) {\r\n\t\t\tif ($field!='id' AND $field[1] != '_' AND isset($_POST[$field])) {\r\n\t\t\t\t$this->$field = trim($_POST[$field]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->forceBools();\r\n \t}", "function addPostData () {\n\t\tforeach (get_class_vars(get_class($this)) as $field=>$value) {\n\t\t\tif ($field!='id' AND $field[1] != '_' AND isset($_POST[$field])) {\n\t\t\t\t$this->$field = trim($_POST[$field]);\n\t\t\t}\n\t\t}\n\t\t$this->forceBools();\n \t}", "public static function ProcessPostData($objectName){\n\t\t\t$obj = new $objectName();\n\t\t\t\n\t\t\tforeach(Input::all() as $key => $value) {\n\t\t\t\tif(!is_array($value)){\n\t\t\t\t\t$obj->$key = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $obj;\n\t\t}", "function load_from_form () {\n if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];\n if (array_key_exists('password', $_POST)) $this->password = $_POST['password'];\n if (array_key_exists('active', $_POST)) $this->active = $_POST['active'];\n if (array_key_exists('actkey', $_POST)) $this->actkey = $_POST['actkey'];\n if (array_key_exists('email', $_POST)) $this->email = $_POST['email'];\n if (array_key_exists('regdate', $_POST)) $this->regdate = $_POST['regdate'];\n }", "function copyFormData()\n {\n\t\tglobal $application;\n // eliminate copying on construction\n $SessionPost = modApiFunc(\"Session\", \"get\", \"SessionPost\");\n $this->ViewState = $SessionPost[\"ViewState\"];\n $this->ViewState['LargeImage'] = str_replace($application->appIni['URL_IMAGES_DIR'],'',$this->ViewState['LargeImage']);\n $this->ViewState['SmallImage'] = str_replace($application->appIni['URL_IMAGES_DIR'],'',$this->ViewState['SmallImage']);\n\n //Remove some data, that should not be sent to action one more time, from ViewState.\n if(isset($this->ViewState[\"ErrorsArray\"]) &&\n count($this->ViewState[\"ErrorsArray\"]) > 0)\n {\n $this->ErrorsArray = $this->ViewState[\"ErrorsArray\"];\n unset($this->ViewState[\"ErrorsArray\"]);\n }\n\n foreach ($SessionPost as $key => $value)\n {\n \tif (!is_array($value))\n \t{\n $this->POST[$key] = prepareHTMLDisplay($value);\n \t}\n \telse\n \t{\n $this->POST[$key] = $value;\n \t}\n }\n }", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }", "function processPostVars()\n {\n $this->id = (integer)$_POST['id'];\n $this->title = trimStrip($_POST['title']);\n $this->text = trimStrip($_POST['text']);\n $this->type = (integer)$_POST['type'];\n $this->object_id = (integer)$_POST['object_id'];\n $this->datefrom = czechToSQLDateTime(trimStrip($_POST['datefrom']));\n $this->dateto = czechToSQLDateTime(trimStrip($_POST['dateto']));\n /* Handle user id. If someone changes the news record, she or he\n will automatically take over the ownership. */\n if (SessionDataBean::getUserRole() == USR_ADMIN)\n {\n $authorId = $_POST['author_id'];\n if (empty ($authorId))\n {\n $this->author_id = 0;\n }\n else\n {\n $this->author_id = (integer)$authorId;\n }\n }\n else\n {\n $this->author_id = SessionDataBean::getUserId();\n }\n }", "function fillFromPost()\n\t\t{\n\t\t\t$cacheKey = static::$_tableName;\n\t\t\tforeach ($_POST as $fieldName => $fieldValue) {\n\t\t\t\tif (array_key_exists($fieldName, static::$_fieldTypes[$cacheKey])) {\n\t\t\t\t\t$this->$fieldName = $fieldValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function setData()\n\t{\n\t\t$this->nonce = sanitize_text_field($_POST['nonce']);\n\t\t$data = [];\t\t\n\t\tforeach( $_POST as $key => $value ){\n\t\t\t$data[$key] = $value;\n\t\t}\n\t\t$this->data = $data;\n\t}", "public function setFormDataFromPost(){\n $this->setFormData($_POST[$this->getFormName()]);\n }", "public function postAsObj() {\n $rawPostData = file_get_contents('php://input');\n \n $oPostData = json_decode($rawPostData);\n Debug::echo(StrUtil::asStr($oPostData, 'POST'));\n \n return $oPostData;\n }", "private function _setPostData() {\r\n $this->postData = $this->_trimData($_POST);\r\n }", "public function input()\n\t{\n\t\treturn (Object) $_POST;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select Specific details of lead specified in arguments
function selectLeadDetails($leadId, $select = array('salutation_name', 'first_name', 'last_name')) { global $db; $strSelect = implode(', ', $select); try { $stmt = $db->prepare("SELECT $strSelect FROM leads l WHERE l.id = :leadid"); $stmt->bindParam(":leadid", $leadId); $stmt->execute(); $rows = $stmt->columnCount(); if ($rows > 0) { $details = $stmt->fetch(PDO::FETCH_ASSOC); } return ($details)? $details : NULL; } catch (Exception $exc) { throw new Exception($exc->getMessage()); } }
[ "public function lead_details($lead_id){\n\n $this->db->select('Ld.id,Ld.lead_identification,Ld.lead_ticket_range,Ld.opened_account_no,Ld.created_by_branch_id,Ld.customer_name,Ld.contact_no,Ld.remark,La.employee_name,La.status,La.is_deleted,La.is_updated,La.followup_date,db_master_products.title,rs.reminder_text,rs.is_cancelled,La.reason_for_drop,La.desc_for_drop')\n ->from('db_leads AS Ld')\n ->join('db_lead_assign AS La', 'La.lead_id = Ld.id', 'left')\n ->join('db_master_products', 'db_master_products.id = Ld.product_id', 'left')\n ->join('db_reminder_scheduler AS rs','rs.lead_id=Ld.id','left')\n ->order_by(\"La.id\", \"desc\")\n ->order_by(\"rs.id\", \"desc\")\n ->limit(1,0)\n ->where('Ld.id',$lead_id);\n $result = $this->db->get()->result_array();\n return $result;\n }", "private function scrapLeadSite() {\n\t\t$leadDAO = new LeadDAO($this->getDoctrine());\n\t\t$leadList = $leadDAO->getLeadList(array(), '0', $this->noOfRecord);\n\t\tif(!empty($leadList)) {\n\t\t\tforeach($leadList as $leadDetail) {\n\t\t\t\t$lead = $this->scrapDetailUrl($leadDetail['houzzUrl']);\n\t\t\t\tif(!empty($lead)) {\n\t\t\t\t\t$lead['id'] = $leadDetail['id'];\n\t\t\t\t\t$lead['leadStatus'] = '1';\n\t\t\t\t\t$leadDAO->editLead($lead);\n\t\t\t\t} else {\n\t\t\t\t\t$lead = array();\n\t\t\t\t\t$lead['id'] = $leadDetail['id'];\n\t\t\t\t\t$lead['leadStatus'] = '2';\n\t\t\t\t\t$leadDAO->editLead($lead);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function findLead($param){\r\n $param = trim($param);\r\n $spaces = substr_count($param, ' ');\r\n $result = \"-1\";\r\n if($spaces == 1){\r\n $parts = explode(\" \",$param);\r\n $leads = Lead::where('fname', 'like','%'.$parts[0].'%')->orWhere('lname', 'like','%'.$parts[0].'%')->pluck('id');\r\n if($leads!=null) {\r\n $result = $leads;\r\n }\r\n }elseif($spaces == 0){\r\n $leads = Lead::where('fname', 'like','%'.$param.'%')\r\n ->orWhere('lname', 'like','%'.$param.'%')\r\n ->orWhere('email', 'like','%'.$param.'%')\r\n ->orWhere('phone', 'like','%'.$param.'%')\r\n ->orWhere('phone2', 'like','%'.$param.'%')\r\n ->orWhere('fileno', 'like','%'.$param.'%')\r\n ->pluck('id');\r\n if($leads!=null) {\r\n $result = $leads;\r\n }\r\n }\r\n return $result;\r\n }", "function getMatchDetails() {\n $funcargs = func_get_args();\n return call_user_func_array(\"get_match_details\", $funcargs);\n }", "function getBasicLeads() {\n\n //leadId condition is WHERE clause removed \n // select criteria of \"capture_trigger\" and select criteria of user info is retained - no changes done.\n // add new conditon : leadStatus must be new \n $getBasicLeadQry = \" SELECT * FROM user_leads_basic as lb \";\n $getBasicLeadQry.= \" WHERE lb.status = \" . BASIC_NEW;\n $getBasicLeadQry.= \" AND lb.lead_id > 5661993 AND (lb.user_id IS NOT NULL OR (lb.email IS NOT NULL AND lb.phone IS NOT NULL AND lb.name IS NOT NULL)) AND (lb.capture_trigger IN ('formsubmit', 'form-submit', 'reg', 'login', 'ws-gateway', 'cart', 'phoneupdate', 'reg.android', 'clickthrough')) \";\n $getBasicLeadQry.= \" ORDER BY lb.lead_id ASC LIMIT 1\";\n\n \n $leadResult = db_query($getBasicLeadQry);\n\n if ($leadResult === false) {\n $errMsg = \"Basic Lead : There was some DB error. Datetime :\" . date(\" Y-m-d H:i:s\");\n $errMsg.= \"\\n Query :\\n \".$getBasicLeadQry;\n $errData = $GLOBALS[\"jaws_db\"][\"error\"];\n logErrors(BASIC_LEAD_LOG, \"getBasicLeads\", $errMsg, [$errData]);\n\n return false;\n }\n\n if (!empty($leadResult)) {\n //Mark the record as processed\n $updateFlag = updateStatus($leadResult[0]['lead_id'], LEAD_PROCESSING);\n\n if ($updateFlag == FALSE) {\n $errMsg = \" Failed Basic Lead Update Status: Datetime :\" . date(\" Y-m-d H:i:s\");\n $errData = $GLOBALS[\"jaws_db\"][\"error\"];\n logErrors(BASIC_LEAD_LOG, \"getBasicLeads\", $errMsg, [$errData]);\n\n return false;\n }\n }\n\n return $leadResult;\n}", "function selectResponsible($parameters)\n{\n\tglobal $db;\n // check the parameters and add to where clause\n $where = '';\n\n\n\n\n\n\n\n // find responsible by string\n if(!empty($parameters['searchAll']))\n {\n // there are two possibilities: find string in keyword, file_ending or in context-info\n\n\n // check in DB for entries matching\n $query = \"\n SELECT\n `id`\n FROM\n `\".$GLOBALS['dataBaseToUse'].\"`.`tl_members`\n WHERE\n (`firstname` like '%\".addslashes($parameters['searchAll']).\"%'\n OR `lastname` like '%\".addslashes($parameters['searchAll']).\"%'\n OR `street` like '%\".addslashes($parameters['searchAll']).\"%'\n OR `city` like '%\".addslashes($parameters['searchAll']).\"%'\n OR `postal` like '%\".addslashes($parameters['searchAll']).\"%')\n \";\n\n\n $result = $db -> query($query);\n\n $responsibleIdArray = array(0);\n while($row = mysqli_fetch_assoc($result))\n {\n $responsibleIdArray[] = $row['id'];\n }\n\n $where .= \"\n `tl_members`.`id` in (\".implode(', ',$responsibleIdArray).\")\";\n\n }\n\n // paging contains results per block as blocksize and number of block used for the query\n if(!empty($parameters['paging']))\n {\n // blocksize from setting or standard\n if(!empty($parameters['paging']['blocksize']))\n $blocksize = 0+$parameters['paging']['blocksize'];\n else\n $blocksize = 20;\n\n if(!empty($parameters['paging']['block']))\n $block = 0+$parameters['paging']['block'];\n else\n $block = 1;\n\n $parameters['limit'] = \" LIMIT \".(($block-1) * $blocksize).\", \".$blocksize.\" \";\n }\n\n if(!empty($parameters['order']))\n $where .= addslashes($parameters['order']);\n\n if(!empty($parameters['limit']))\n $where .= addslashes($parameters['limit']);\n\n // select responsible\n\n // get ids for responsible entries\n\t$query = \"\n\t\t SELECT\n SQL_CALC_FOUND_ROWS\n `tl_members`.`id`\n FROM\n\t\t `\".$GLOBALS['dataBaseToUse'].\"`.`tl_members`\n\n\t\t WHERE\n\n \".$where.\"\n\t \";\n\n\t$result = $db -> query($query);\n\n\n $return = array();\n\n // reports\n $return['parameters'] = $parameters;\n $return['numResults'] = '';\n\n while($row = mysqli_fetch_assoc($result))\n {\n $return['data'][$row['id']] = array();\n }\n\n // number of possible results\n $countResult = $db -> query(\"SELECT FOUND_ROWS()\");\n $countArray = $row = mysqli_fetch_assoc($countResult);\n $return['numResults'] = $countArray['FOUND_ROWS()'];\n\n // now get the values\n if(!empty($return['data']))\n {\n $responsibleData = getResponsible(array_keys($return['data']));\n #print_r($responsibleData);\n foreach($responsibleData as $idResponsible => $row)\n $return['data'][$idResponsible] = $row;\n }\n\n\n return $return;\n\n}", "public function showLeadDetails($lead_id) {\n\t\t$leadDetail = new Lead($lead_id);\n\t\t$appointment = $leadDetail->appointment;\n\t\t$date = explode(' ', $appointment);\n\n\t\treturn view(\"leadDetailEdit\", [\"leadDetail\"=>$leadDetail, \"date\"=>$date[0]]);\n\t}", "abstract public function getDetailCall();", "public function getDetailsBySalary(){\n if(func_num_args()>0){\n $posCode = func_get_arg(0);\n $salary = func_get_arg(1);\n $teamCode = func_get_arg(2);\n try {\n $select = $this->select()\n ->from($this,array('plr_details','plr_id','plr_value','fppg'))\n ->where('status=?',1)\n ->where('plr_position=?',$posCode)\n ->where('plr_value<=?',$salary)\n ->where('plr_team_code IN (?)',$teamCode); \n $select = stripcslashes($select);\n \n $result = $this->getAdapter()->fetchAll($select);\n if($result){\n return $result;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n \n }else{\n throw new Exception(\"Argument not passed\");\n }\n \n }", "public function meetingDetails() {\n $sql = \"select tmm.meeting_type,tmm.location,tmm.start_date,tmm.start_time,tmm.location,tmm.purpose,tmmd.meeting_minute_id,tmmd.employee_type,tmmd.account_no from tbl_meeting_minute tmm INNER JOIN tbl_meeting_minute_detail tmmd ON tmmd.meeting_minute_id=tmm.meeting_minute_id WHERE tmm.status='1'\";\n //echo $sql;\n return $result = $this->db->mod_select($sql);\n }", "function getLandingLead($user) {\n\t\t$userID = $user->id;\n\n\t\tif ($this->status != \"Started\") {\n\t\t\tif(\\Session::has('referFrom') && \\Session::get('referFrom') == 'massmail') {\n\t\t\t\t$this->start();\n\n\t\t\t\t\\Session::forget('referFrom');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception(\"You need to start the campaign first before generating leads for it\");\n\t\t\t}\n\t\t}\n\n\t\t$lead = Lead::where(\"leads.status\", \"Unactioned\")\n\t\t\t->where('campaignID', $this->id)\n\t\t\t->whereRaw('(timeOpened IS NULL OR timeOpened < (NOW() - INTERVAL 20 SECOND))')\n\t\t\t->orderBy(\"leads.id\", \"ASC\")\n\t\t\t->select('leads.*')\n\t\t\t;\n\n\t\t$this->applyPrevNextFilter($lead, $this->getPrevNextFilterForUser($userID));\n\t\t$newLead = $lead = $lead->first();\n\n\t\tif (!$newLead) {\n\t\t\t//search for any \n\t\t\t$newLead = Lead::where('campaignID', $this->id)\n\t\t\t\t->orderBy(\"leads.id\", \"ASC\")\n\t\t\t\t->select('leads.*')\n\t\t\t\t;\n\n\t\t\t$this->applyPrevNextFilter($newLead, $this->getPrevNextFilterForUser($userID));\n\t\t\t$newLead = $newLead->first();\n\t\t\tif ($newLead) {\n\t\t\t\treturn $newLead;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t//if ($minUnactioned) {\n\t\t//\t$userLead = Lead::where('status', 'Actioned')\n\t\t//\t\t->where(\"id\", \"<\", $minUnactioned)\n\t\t//\t\t->where('firstActioner', $user->id)\n\t\t//\t\t->where('campaignID', $this->id)\n\t\t//\t\t->orderBy('id', 'desc')\n\t\t//\t\t->first();\n\t\t//}\n\t\t//else {\n\t\t//\t$userLead = Lead::where('status', 'Actioned')\n\t\t//\t\t->where('firstActioner', $user->id)\n\t\t//\t\t->where('campaignID', $this->id)\n\t\t//\t\t->orderBy('id', 'desc')\n\t\t//\t\t->first();\n\t\t//}\n\n\t\t// No unactioned lead was found in this campaign. Generate new lead\n\t\tif(!$lead) {\n\t\t\t$lead = $this->createNewLead($user);\n\t\t}\n\t\telse {\n\t\t\t// Updating timeEdited and Status for lead\n\t\t\tif($this->autoReferences == 'Yes')\n\t\t\t{\n\t\t\t\t$date = new DateTime();\n\t\t\t\t$referenceNumber = $this->autoReferencePrefix.$date->getTimestamp();\n\t\t\t\t$lead->referenceNumber = $referenceNumber;\n\t\t\t\t$lead->save();\n\t\t\t}\n\n\t\t\t/*\n\t\t\t$lead->firstActioner = $userID;\n\t\t\t$lead->lastActioner = $userID;\n\t\t\t$lead->timeEdited = new DateTime;\n\t\t\t$lead->status = 'Actioned';\n\t\t\t$lead->save();\n\t\t\t\n\t\t\t$this->save();\n\n\t\t\t// Update calls remaining as a lead was marked as actioned\n\t\t\tif ($this->callsRemaining > 0) {\n\t\t\t\t$this->recalculateCallsRemaining();\n\t\t\t}\n\t\t\t*/\n\t\t}\n\n\t\treturn $lead;\n\t}", "public function getLead()\n\t{\n\t\treturn $this->lead;\n\t}", "public function getDetails();", "private function findLead()\n {\n $lead = $this->executeSweetApi('GET', env('APP_SWEET_API') . \"/api/ssi/v1/frontend/ssi-leads/\" . $this->customer_id);\n if (empty($lead)) {\n return array();\n }\n return $lead;\n }", "function get_student_leads($params = array())\n {\n\n $query \t\t\t\t= \"\";\n $limit_cond \t\t= \"\";\n $course_cond \t\t= \"\";\n $location_cond \t\t= \"\";\n $teaching_type_cond = \"\";\n\n\n if(!empty($params['start']) && !empty($params['limit']) && $params['start'] >= 0 && $params['limit'] >= 0) {\n\n $limit_cond = ' LIMIT '.$params['start'].', '.$params['limit'];\n\n } elseif(empty($params['start']) && !empty($params['limit']) && $params['limit'] >= 0){\n\n $limit_cond = ' LIMIT '.$params['limit'];\n }\n\n\n\n if(!empty($params['course_slug'])) {\n\n \t$course_id \t = $this->get_categoryid_by_slug($params['course_slug']);\n\n \tif(empty($course_id))\n \t\treturn FALSE;\n\n \t$course_cond = \" AND sl.course_id IN (\".$course_id.\") \";\n }\n\n if(!empty($params['location_slug'])) {\n\n \t$location_id = $this->get_locationid_by_slug($params['location_slug']);\n\n \tif(empty($location_id))\n \t\treturn FALSE;\n\n \t$location_cond = \" AND sl.location_id IN (\".$location_id.\") \";\n }\n\n if(!empty($params['teaching_type_slug'])) {\n\n \t$teaching_type_id = $this->get_teachingtypeid_by_slug($params['teaching_type_slug']);\n\n \tif(empty($teaching_type_id))\n \t\treturn FALSE;\n\n \t$teaching_type_cond = \" AND sl.teaching_type_id IN (\".$teaching_type_id.\") \";\n }\n\n\n \t$query = \"SELECT u.*, sl.*, sl.id AS lead_id FROM \".TBL_USERS.\" u \n \t\t\t INNER JOIN \".TBL_USERS_GROUPS.\" ug ON ug.user_id=u.id \n \t\t\t INNER JOIN \".TBL_STUDENT_LEADS.\" sl ON sl.user_id=u.id \n \t\t\t WHERE u.active=1 AND u.visibility_in_search='1' AND u.availability_status='1' \n AND u.is_profile_update=1 AND ug.group_id=2 AND sl.status='opened' \n \t\t\t \".$course_cond.\" \n \t\t\t \".$location_cond.\" \n \t\t\t \".$teaching_type_cond.\" \n \t\t\t ORDER BY sl.id DESC \".$limit_cond.\" \";\n\n\n $result_set = $this->db->query($query); \n\n return ($result_set->num_rows() > 0) ? $result_set->result() : array();\n }", "function getBeerDetails( $beer_id )\n{\n\t\n}", "public function select($persona_has_semillero);", "abstract protected function getDetailLinkQuery();", "function testeSelectPorMaisDeUmParametro(){\n $oPaciente = new lPaciente();\n $oPaciente->createTablePaciente();\n print_r($oPaciente->insertPacienteCompleto(\"Teste1\", \"1234567\",\"364.964.588-00\", \"Unimed\", \"M\", \"A-\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\"));\n print_r(\"\\n\");\n print_r($oPaciente->insertPacienteCompleto(\"Teste2\", \"1234567\",\"364.964.588-77\", \"Plano B\", \"F\", \"A+\", null, null, null, \"teste@email.com\"));\n print_r(\"\\n\\n\");\n\n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oPaciente->selectPaciente(null, \"Teste2\", \"1234567\",\"364.964.588-77\", \"Plano B\", \"F\", \"A+\", null, null, null, \"teste@email.com\"));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is version order creation time?
public function isVersionOrderCreationTime();
[ "public function isVersionOrderCreationTime()\n {\n $versionOrder = $this->getVersionOrder();\n\n return $versionOrder == self::VERSION_ORDER_CREATION_TIME;\n }", "public function shouldCreateVersion() {\n\t\treturn $this->createVersion;\n\t}", "public function hasVersions(): bool;", "public function isVersionable();", "public function shouldVersion()\n {\n if (!config('streams::system.versioning_enabled', true)) {\n return false;\n }\n\n if ($this->versioningDisabled()) {\n return false;\n }\n\n if ($this->wasRecentlyCreated) {\n return true;\n }\n\n if ($this->getVersionDifferences()) {\n return true;\n }\n\n return false;\n }", "function isNeeded()\n {\n return !file_exists($this->name)\n or $this->getTimestamp() > @filemtime($this->name);\n }", "public function isVersionActivelyMaintained() : bool {}", "function isCreated() \n {\n $isCreated = $this->getValueByFieldName( 'module_isCreated' );\n return ( (int) $isCreated == 1 );\n }", "public function isAutoVersion(): bool\n {\n return $this->isAutoVersion;\n }", "public function isAutoVersion(): bool\n {\n return $this->autoVersion;\n }", "protected function versionFileExists() : bool\n {\n return Storage::exists(static::NEW_VERSION_FILE);\n }", "public function isArchivedVersion()\n\t{\n\t\treturn ($this->archivedOnDatetime !== null) ? true : false;\n\t}", "function _check_version_cache()\n\t{\n\t\t// check cache first\n\t\t$cache_expire = 60 * 60 * 24;\t// only do this once per day\n\t\t$this->load->helper('file');\t\n\t\t$contents = read_file(APPPATH.'cache/ee_version/current_version');\n\n\t\tif ($contents !== FALSE)\n\t\t{\n\t\t\t$details = unserialize($contents);\n\n\t\t\tif (($details['timestamp'] + $cache_expire) > $this->localize->now)\n\t\t\t{\n\t\t\t\treturn $details;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public static function isVersioned()\n {\n return in_array('Divergence\\\\Models\\\\Versioning', class_uses(get_called_class()));\n }", "function is_latest_version()\r\n {\r\n $rdm = RepositoryDataManager :: get_instance();\r\n return $rdm->is_latest_version($this);\r\n }", "private function isRevisioned(): bool\n {\n return $this->getRevisionId() !== null;\n }", "function out_of_date() {\n if($GLOBALS['previous_version'] == $GLOBALS['current_version']) {\n return false;\n } else {\n return true;\n }\n}", "function have_existing_version() {\n\n\t\tif ( isset( $this->existing_version ) AND ! empty( $this->existing_version ) AND $this->existing_version > 0 ) {\n\t\t\t$this->set( 'have_existing_version', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_existing_version', 0 );\n\t\t}\n\n\t\treturn $this->have_existing_version;\n\n\t}", "public static function isLatest() {\n\t\treturn self::compareVersion(self::getLatest()) < 1;\n\t}", "public static function isLatest() {\r\n\t\treturn static::compareVersion ( static::getLatest () ) < 1;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject the current media storage
public function setMediaStorage(MediaStorageInterface $mediaStorage);
[ "public function upload_media_in_storage() {\n \n // Upload the media's files\n (new MidrubBaseAdminComponentsCollectionSettingsHelpers\\Settings)->upload_media_in_storage();\n \n }", "protected abstract function getMediaObjectPersistence();", "public function getMediaStorage()\n {\n return $this->helper->getMediaStorage();\n }", "function load_media_resources()\n\t{\n\t\t$media = new stdClass;\n\t\t$media->cdnUri = $this->CFG->cloudstorage->cdn->uri;\n\t\t$this->page->set_media($media);\n\t}", "private function registerMediaObject()\n {\n $this->app->bind(\n 'htmlelements::mediaobject',\n function () {\n return new MediaObject;\n }\n );\n }", "public function storage(): FilesystemManager\n {\n return app(MediaService::class)->storage();\n }", "protected function initStorage()\n {\n $this->disk(config('admin.upload.disk'));\n }", "protected function setStorage()\n {\n $this->store = Storage::disk('local');\n }", "protected function registerStorage()\n {\n $this->app->singleton('file.storage', function ($app) {\n return new StorageManager($app);\n });\n\n $this->app->singleton('file.storage.store', function ($app) {\n return $app['file.storage']->driver();\n });\n }", "private function initStorage()\n\t{\n\t \tinclude_once('./Services/Administration/classes/class.ilSetting.php');\n\t \t$this->storage = new ilSetting('mcst');\n\t \tinclude_once('./Modules/MediaCast/classes/class.ilObjMediaCast.php');\n\t \t$this->purposeSuffixes = array_flip(ilObjMediaCast::$purposes);\n\t \t \n\t \t$this->purposeSuffixes[\"Standard\"] = array(\"mp3\",\"flv\",\"mp4\",\"m4v\",\"mov\",\"wmv\",\"gif\",\"png\");\n $this->purposeSuffixes[\"AudioPortable\"] = array(\"mp3\");\n $this->purposeSuffixes[\"VideoPortable\"] = array(\"mp4\",\"m4v\",\"mov\");\n $this->setDefaultAccess(\"users\");\n\t\tinclude_once(\"./Services/Utilities/classes/class.ilMimeTypeUtil.php\");\t\t \n $mimeTypes = array_unique(array_values(ilMimeTypeUtil::getExt2MimeMap()));\n sort($mimeTypes);\n $this->setMimeTypes($mimeTypes);\n\t}", "protected function registerStorage()\n {\n $this->app->singleton('jwt.storage', function () {\n return $this->getConfigInstance('storage');\n });\n }", "public function registerUploader(): void\n {\n $this->app->bind('mediable.uploader', function (Container $app) {\n return new MediaUploader(\n $app['filesystem'],\n $app['mediable.source.factory'],\n $app['config']->get('mediable')\n );\n });\n $this->app->alias('mediable.uploader', MediaUploader::class);\n }", "public function initializeMediaResource()\n {\n $this->append('resource_url');\n $this->append('resource_api');\n }", "protected function bindMediaManager()\n {\n Container::getInstance()->singleton(MediaManager::class, function ($app) {\n return new MediaManager($app, new UrlCompiler);\n });\n }", "public function registerMediaManager()\n {\n $this->app->singleton(MediaManager::class, function ($app) {\n return new MediaManager($app, $app->make(UrlGenerator::class));\n });\n }", "private function _getMedia() {\r\n $this->mediaFiles = glob($this->config->get('mediaDir') .\r\n '*.' . $this->config->get('fileExtension'));\r\n foreach ($this->mediaFiles as $key => &$file) {\r\n $media = new TinamboMedia(\r\n $this,\r\n $file\r\n );\r\n if ($media->getId() > $this->lastMediaId) {\r\n $this->lastMediaId = $media->getId();\r\n }\r\n $this->media[] = $media;\r\n }\r\n }", "public function getStorage(): StorageInterface;", "public function storage(/* ... */)\n {\n return $this->_storage;\n }", "private static function media()\n {\n $files = ['QR'];\n $folder = static::$root.'Media'.'/';\n\n self::call($files, $folder);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function scrape_between This function returns all data between two HTML tags to reduce search space.
function scrape_between($data, $start, $end){ $data = stristr($data, $start); // Stripping all data from before $start $data = substr($data, strlen($start)); // Stripping $start $stop = stripos($data, $end); // Getting the position of the $end of the data to scrape $data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape return $data; // Returning the scraped data from the function }
[ "public static function getBetweenText( $html, $tag_before, $tag_after ) { \n\t\t$tag_before = preg_quote($tag_before);\n\t\t$tag_after = preg_quote($tag_after);\n\t\t$match = '';\n\t\tpreg_match_all(\"/$tag_before(.*?)$tag_after/uis\", $html, $match);\n\t\treturn $match[1];\n\t}", "function getTextBetweenHTML($url,$startPoint,$endPoint) {\n$content = file_get_contents($url); \n$comment=explode($startPoint,$content); \n$comment=explode($endPoint,$comment[1]);\t\n$html = $comment[0];\nreturn $html;\n}", "function parseTwoPartBetween($strIn, $strStart, $strStartEnd, $strEnd)\n{\n//this is useful for certain HTML and XML parsing operations, where you know how a tag begins and ends, but not what is in the middle, and you also know precisely what you are \n//looking for at the end of what you seek.\n//i've tried to write this function several times and this is the first time i've managed to pull it off\n//December 18, 2008 Judas Gutenberg\n//totally rewritten from scratch October 25, 2011 to fix a serious bug\n\t$bwlInData=false;\n\t$intStartCursor=0;\n\t$intStartEndCursor=0;\n\t$intEndCursor=0;\n\t$bwlPossiblyInEnd=false;\n\t$bwlPossiblyInStart=false;\n\t$bwlPossiblyInStartEnd=false;\n\t$bwlBetweenStartAndStartEnd=false;\n\t$out=\"\";\n\t$provisional=\"\";\n\tfor($i = 0; $i < strlen($strIn)+1; $i++) \n\t{\n\t\t//echo $chr . \" \" . $bwlInData . \":\" . $intStartEndCursor. \"-\" . $bwlBetweenStartAndStartEnd . \"\\n\";\n\t\t$chr=substr($strIn,$i,1);\n\t\tif($bwlInData)\n\t\t{\n\t\t\t$chrEnd=substr($strEnd,$intEndCursor,1);\n\t\t\tif($chr==$chrEnd && ($intEndCursor==0 || $bwlPossiblyInEnd))\n\t\t\t{\n\t\t\t\t$intEndCursor++;\n\t\t\t\t$bwlPossiblyInEnd=true;\n\t\t\t\t \n\t\t\t\tif($intEndCursor==strlen($strEnd))\n\t\t\t\t{\n\t\t\t\t\treturn $out ;\n\t\t\t\t}\n\t\t\t \t$provisional.=$chr;\n\t\t \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bwlPossiblyInEnd=false;\n\t\t\t\t$intEndCursor=0;\n\t\t\t\tif($provisional!=\"\")\n\t\t\t\t{\n\t\t\t\t\t$out.= $provisional;\n\t\t\t\t\t$provisional=\"\";\n\t\t\t\t}\n\t\t\t\t$out.= $chr;\n\t\t\t}\t\n\t\t}\n\t\telse //not in bwldata\n\t\t{\n\t\t\tif($chr==substr($strStart,$intStartCursor,1))\n\t\t\t{\n\t\t\t\t$bwlPossiblyInStart=true;\n\t\t\t\t$intStartCursor++;\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($bwlPossiblyInStart && $chr!=substr($strStart,$intStartCursor,1)) //started okay but character bad\n\t\t\t{\n\t\t\t\t$bwlPossiblyInStart=false;\n\t\t\t\t$intStartCursor=0;\n\t\t\t\t\n\t\t\t}\n\t\t\tif($intStartCursor==strlen($strStart) && $bwlPossiblyInStart)\n\t\t\t{\n\t\t\t\t$bwlBetweenStartAndStartEnd=true;\n\t\t\t\t$bwlPossiblyInStart=false;\n\t\t\t}\n\t\t\t\n\t \t\tif($bwlBetweenStartAndStartEnd)\n\t \t\t{\n\t \t\t\t\n\t \t\t\tif($chr==substr($strStartEnd,$intStartEndCursor,1))\n\t\t\t\t{\n\t\t\t\t\t$bwlPossiblyInStartEnd=true;\n\t\t\t\t\t$intStartEndCursor++;\n\t\t\t\t}\n\t\t\t\telse if($bwlPossiblyInStartEnd && $chr!=substr($strStartEnd,$intStartEndCursor,1)) //started okay but character bad\n\t\t\t\t{\n\t\t\t\t\t$bwlPossiblyInStartEnd=false;\n\t\t\t\t\t\n\t\t\t\t\t$intStartEndCursor=0;\n\t\t\t\t\t//$out.=$chr;\n\t\t\t\t}\n\t \t\t\tif($intStartEndCursor==strlen($strStartEnd) && $bwlPossiblyInStartEnd)\n\t\t\t\t{\n\t\t\t\t\t$bwlInData=true;\n\t\t\t\t\t$bwlPossiblyInStartEnd=false;\n\t\t\t\t}\n\t \t\t}\n\t\t}\n\t}\n\treturn $out;\n}", "public function testFindAllBetweenReturnsArray()\n {\n $analyzer = $this->create(array('1', '2', '3', '4', '5'));\n $tokens = $analyzer->findAllBetween('3', 0, 4);\n $this->assertInternalType('array', $tokens);\n }", "function get_value_between($ident, $content){\n\t\t$matches = array();\n\t\t$t = preg_match('/@' . $ident . '-start@(.*?)\\\\@' . $ident . '-end@/s', $content, $matches);\n\t\treturn isset( $matches[1] ) ? $matches[1] : '';\n\t}", "public static function return_between($string, $start = '', $stop = '', $incl = TRUE)\n\t{\n\t\tif ($start == '' || $stop == '') exit(\"You must supply a start word and end word\");\n\t\n\t\t$_temp = PONG_parse::split_string($string, $start, FALSE, $incl);\n\t\treturn PONG_parse::split_string($_temp, $stop, TRUE, $incl);\n\t}", "public function getScrapedContent();", "public function extract_value_between($body, $start_text = null, $end_text = null)\n {\n $start_position = strpos($body, $start_text);\n $start_length = strlen($start_text);\n $end_position = strpos($body, $end_text, $start_position);\n\n if (($end_position > $start_position) && ! $start_position === false) {\n return trim(substr($body, $start_position + $start_length, $end_position - $start_position - $start_length));\n } else {\n return null;\n }\n }", "abstract public function scrape();", "public function whereBetween();", "function searchHTML($html, $beginString, $endString)\n {\n $temp = explode($beginString, $html);\n if (count($temp) > 1)\n {\n $temp = explode($endString, $temp[1]);\n return $temp[0];\n }\n return \"\";\n }", "private function rewrite_between()\n {\n if (!$this->rewrite_between) {\n return;\n }\n $pattern = '/\\\\s*(CAST\\([^\\)]+?\\)|[^\\\\s\\(]*)?\\\\s*BETWEEN\\\\s*([^\\\\s]*)?\\\\s*AND\\\\s*([^\\\\s\\)]*)?\\\\s*/ims';\n do {\n if (preg_match($pattern, $this->_query, $match)) {\n $column_name = trim($match[1]);\n $min_value = trim($match[2]);\n $max_value = trim($match[3]);\n $max_value = rtrim($max_value);\n $replacement = \" ($column_name >= $min_value AND $column_name <= $max_value)\";\n $this->_query = str_ireplace($match[0], $replacement, $this->_query);\n }\n $this->num_of_rewrite_between--;\n } while ($this->num_of_rewrite_between > 0);\n }", "public function getReviewsBetween(\\DateTime $start, \\DateTime $end)\n {\n //setup\n $url = self::baseUrl . $this->slug;\n $context = stream_context_create(array('http' => array('header' => 'User-Agent: Mozilla compatible')));\n $response = file_get_contents($url, false, $context);\n $html = HtmlDomParser::str_get_html($response);\n\n $carbonStartDate = Carbon::instance($start); //convert datetime to carbon type for comparison\n $carbonEndDate = Carbon::instance($end);\n $totalReviewsAvailable = self::getNumberOfAvailableReviews($html);\n $allUrls = self::generateUrlsForNextPages($url, $totalReviewsAvailable);\n\n array_unshift($allUrls,$url); //prepend first url\n $endDateIndex = self::getEndDateUrlIndex($allUrls, $carbonEndDate); //array index containing URL last url before end date i.e. first page of reviews we care about\n $newUrlArray=array_slice($allUrls,$endDateIndex); //remove unnecessary urls\n $reviews = [];\n //deal with urls on first page\n foreach(self::getReviewsAtUrl($newUrlArray[0]) as $review){\n if(!($review->date)->greaterThan($carbonEndDate)){ //if review date is newer than end date\n $reviews[] = $review;\n }\n }\n //deal with rest of urls, cutting off reviews before start date\n $newUrlArray = array_slice($newUrlArray,1);\n foreach($newUrlArray as $currentUrl){\n foreach (self::getReviewsAtUrl($currentUrl) as $review) { //array of reviews at URL\n if (!($review->date)->greaterThan($carbonStartDate)) { //terminate if review date older than start date\n return $reviews;\n }\n $reviews[] = $review;\n }\n }\n return $reviews;\n }", "function find_between($s, $str1, $str2, $ignore_case = false) {\n\t $func = $ignore_case ? stripos : strpos;\n\t $start = $func($s, $str1);\n\t if ($start === false) {\n\t\t\treturn '';\n\t }\n\t\n\t $start += strlen($str1);\n\t $end = $func($s, $str2, $start);\n\t if ($end === false) {\n\t\t\treturn '';\n\t }\n\t\n\t return substr($s, $start, $end - $start);\n\t}", "function fetchBetweenField($field, $left, $right);", "public function getDataBetween($start, $end)\n {\n $sql = \"SELECT `DATE`, `READ` FROM ELECTRICITY_METER_READS WHERE ( `DATE` BETWEEN '$start' AND '$end')\";\n $sql2 = \"SELECT `DATE`, `READ` FROM ELECTRICITY_METER_READS WHERE ( `DATE` = '$start' )\";\n\n // if sql query is ok\n if ($db = $this->DBH->query($sql2)) {\n // if searched DATA not exists\n if ($db->fetchColumn() == 0) {\n\n $tab_a = $this->checkOneBeforeData($start);\n $tab_b = $this->fetchDbData($sql);\n\n // return range\n return array_merge($tab_a, $tab_b);\n } else {\n // return range\n return $this->fetchDbData($sql);\n }\n }\n return false;\n\n\n }", "public function testFindAllBetweenDoesNotSearchAfterEndIndex()\n {\n $analyzer = $this->create(array('1', '2', '3', '4', '5'));\n $tokens = $analyzer->findAllBetween('5', 0, 3);\n $this->assertInternalType('array', $tokens);\n $this->assertNotContains(4, $tokens);\n }", "function scrape() \n {\n $home = $this->curl_home(); // just to set a cookie\n $az = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');\n foreach ($az as $ln)\n {\n $page = 1;\n $pages = null;\n $index = $this->curl_index($ln);\n # set the $pages variable\n $check = preg_match('/<h4>Page\\s[0-9]*\\sof\\s([0-9]*)<\\/h4>/Uis', $index, $match);\n if ($check) { $pages = $match[1]; }\n else { $pages = 1; }\n # start pagination loop\n for ($i = 1; $i <= $pages; $i++)\n {\n if ($page > 1)\n {\n $index = $this->curl_page($page);\n }\n # build booking_ids and extraction\n $check = preg_match_all('/oid\\:\\\"(.*)\\\"/Uis', $index, $match);\n if ($check)\n {\n $booking_ids = $match[1];\n foreach ($booking_ids as $booking_id)\n {\n $details = $this->curl_details($booking_id);\n $extraction = $this->extraction($details, $booking_id);\n if ($extraction == 100) { $this->report->successful = ($this->report->successful + 1); $this->report->update(); }\n if ($extraction == 101) { $this->report->other = ($this->report->other + 1); $this->report->update(); }\n if ($extraction == 102) { $this->report->bad_images = ($this->report->bad_images + 1); $this->report->update(); }\n if ($extraction == 103) { $this->report->exists = ($this->report->exists + 1); $this->report->update(); }\n if ($extraction == 104) { $this->report->new_charges = ($this->report->new_charges + 1); $this->report->update(); }\n $this->report->total = ($this->report->total + 1); $this->report->update();\n }\n } \n $page++;\n } // end for loop\n } // end a-z loop\n $this->report->failed = ($this->report->other + $this->report->bad_images + $this->report->exists + $this->report->new_charges);\n $this->report->finished = 1;\n $this->report->stop_time = time();\n $this->report->time_taken = ($this->report->stop_time - $this->report->start_time);\n $this->report->update();\n return true; \n }", "function get_tags($html)\n{\nforeach($html->find('span.myClass') as $e)\n return $e->outertext . '<br>';\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtains lead routing rules.
public function getRoutingRules($data) { $admin = &Yii::app()->settings; $online = $admin->onlineOnly; Session::cleanUpSessions(); $sessions = Session::getOnlineUsers(); $criteria = new CDbCriteria; $criteria->order = "priority ASC"; $rules = X2Model::model('LeadRouting')->findAll($criteria); foreach ($rules as $rule) { $arr = LeadRouting::parseCriteria($rule->criteria); $flagArr = array(); foreach ($arr as $criteria) { if (isset($data[$criteria['field']])) { $val = $data[$criteria['field']]; $operator = $criteria['comparison']; $target = $criteria['value']; if ($operator != 'contains') { switch ($operator) { case '>': $flag = ($val >= $target); break; case '<': $flag = ($val <= $target); break; case '=': $flag = ($val == $target); break; case '!=': $flag = ($val != $target); break; default: $flag = false; } } else { $flag = preg_match("/$target/i", $val) != 0; } $flagArr[] = $flag; } } if (!in_array(false, $flagArr) && count($flagArr) > 0) { $users = $rule->users; $users = explode(", ", $users); if (is_null($rule->groupType)) { if ($online == 1) $users = array_intersect($users, $sessions); }else { $groups = $rule->users; $groups = explode(", ", $groups); $users = array(); foreach ($groups as $group) { if ($rule->groupType == self::WITHIN_GROUPS) { $links = GroupToUser::model()->findAllByAttributes( array('groupId' => $group)); foreach ($links as $link) { $usernames[] = User::model()->findByPk($link->userId)->username; } } else { // $rule->groupType == self::BETWEEN_GROUPS $users[] = $group; } } if ($online == 1 && $rule->groupType == self::WITHIN_GROUPS) { foreach ($usernames as $user) { if (in_array($user, $sessions)) $users[] = $user; } }elseif ($rule->groupType == self::WITHIN_GROUPS) { $users = $usernames; } } if ($rule->groupType == self::WITHIN_GROUPS) { $users = array_values( array_intersect( Profile::model()->getUsernamesOfAvailableUsers(), $users)); } $users[] = $rule->rrId; $rule->rrId++; $rule->save(); return $users; } } }
[ "protected function rewrite_rules() {\n $rules = array();\n foreach ( $this->routes as $route ) {\n /** @var Route $route */\n $rules = array_merge($rules, $route->rewrite_rules());\n }\n return $rules;\n }", "public function getRoutingRules($data) {\n\t\t$admin = &Yii::app()->params->admin;\n\t\t$online = $admin->onlineOnly;\n\t\t$this->cleanUpSessions();\n\t\t$sessions = Session::getOnlineUsers();\n $criteria=new CDbCriteria;\n $criteria->order=\"priority ASC\";\n\t\t$rules = X2Model::model('LeadRouting')->findAll($criteria);\n\t\tforeach ($rules as $rule) {\n\t\t\t$arr = LeadRouting::parseCriteria($rule->criteria);\n\t\t\t$flagArr = array();\n\t\t\tforeach ($arr as $criteria) {\n\t\t\t\tif (isset($data[$criteria['field']])) {\n\t\t\t\t\t$val = $data[$criteria['field']];\n\t\t\t\t\t$operator = $criteria['comparison'];\n\t\t\t\t\t$target = $criteria['value'];\n\t\t\t\t\tif ($operator != 'contains') {\n\t\t\t\t\t\tswitch ($operator) {\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t$flag = ($val >= $target);\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$flag = ($val <= $target);\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$flag = ($val == $target);\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$flag = ($val != $target);\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\t$flag = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$flag = preg_match(\"/$target/i\", $val) != 0;\n\t\t\t\t\t}\n\t\t\t\t\t$flagArr[] = $flag;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!in_array(false, $flagArr) && count($flagArr) > 0) {\n\t\t\t\t$users = $rule->users;\n\t\t\t\t$users = explode(\", \", $users);\n\t\t\t\tif (is_null($rule->groupType)) {\n\t\t\t\t\tif ($online == 1)\n\t\t\t\t\t\t$users = array_intersect($users, $sessions);\n\t\t\t\t}else {\n\t\t\t\t\t$groups = $rule->users;\n\t\t\t\t\t$groups = explode(\", \", $groups);\n\t\t\t\t\t$users = array();\n\t\t\t\t\tforeach ($groups as $group) {\n\t\t\t\t\t\tif ($rule->groupType == 0) {\n\t\t\t\t\t\t\t$links = GroupToUser::model()->findAllByAttributes(array('groupId' => $group));\n\t\t\t\t\t\t\tforeach ($links as $link) {\n\t\t\t\t\t\t\t\t$usernames[] = User::model()->findByPk($link->userId)->username;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$users[] = $group;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($online == 1 && $rule->groupType == 0) {\n\t\t\t\t\t\tforeach ($usernames as $user) {\n\t\t\t\t\t\t\tif (in_array($user, $sessions))\n\t\t\t\t\t\t\t\t$users[] = $user;\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($rule->groupType == 0){\n $users=$usernames;\n }\n\t\t\t\t}\n\t\t\t\t$users[] = $rule->rrId;\n\t\t\t\t$rule->rrId++;\n\t\t\t\t$rule->save();\n\t\t\t\treturn $users;\n\t\t\t}\n\t\t}\n\t}", "function getRoutes(): array;", "function getRouteRequirements();", "public function getMatchRules();", "public function get_rewrite_rules() {\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'regex' => '^login/?$',\n\t\t\t\t'query' => 'index.php?nomad_user_login=login',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'regex' => '^logout/?$',\n\t\t\t\t'query' => 'index.php?nomad_user_login=logout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'regex' => '^login/forgot-password/?$',\n\t\t\t\t'query' => 'index.php?nomad_user_login=forgot_password',\n\t\t\t),\n\t\t);\n\n\t}", "public function getRouteMatch();", "private function getRoutes()\n\t{\n\t\t//get and return the routes array\n\t\treturn $this->routes;\n\n\t}", "public function getRoutes()\n {\n /**\n * Traverse all routes connected to the mapper in match order, \n * and assemble an array of $routes used to build the output\n */\n $routes = array();\n foreach ($this->_mapper->matchList as $route) {\n // name of this route, or empty string if anonymous\n $routeName = '';\n foreach ($this->_mapper->routeNames as $name => $namedRoute) {\n if ($route === $namedRoute) { $routeName = $name; break; }\n }\n\n // request_method types recognized by this route, or empty string for any\n $methods = array('');\n if (isset($route->conditions['method']) && is_array($route->conditions['method']) ) {\n $methods = $route->conditions['method'];\n }\n\n // hardcoded defaults that can't be overriden by the request path as {:key=>\"value\"}\n $hardcodes = array();\n foreach ($route->hardCoded as $key) {\n $value = isset($route->defaults[$key]) ? $route->defaults[$key] : 'NULL';\n $dump = \":{$key}=>\\\"{$value}\\\"\";\n ($key == 'controller') ? array_unshift($hardcodes, $dump) : $hardcodes[] = $dump;\n }\n $hardcodes = empty($hardcodes) ? '' : '{'. implode(', ', $hardcodes) .'}'; \n\n // route data for output \n foreach ($methods as $method) {\n $routes[] = array('name' => $routeName,\n 'method' => $method,\n 'path' => '/' . $route->routePath,\n 'hardcodes' => $hardcodes);\n }\n }\n\n return $routes;\n }", "public static function getMatchedRoute() {}", "public function get_routes() {\r\n\t\treturn array();\r\n\t}", "function getRoutePattern();", "public function getWhitelistedRoutes();", "public static function getRoutes()\n {\n return self::$compiled['routes'];\n }", "public function getAllRoutes();", "public function getRoute() : array;", "private function getMatchedRoutes()\n\t{\n\t\t$result = array();\n\t\t$matchedRoutes = $this->getContext()->getRequest()->getAttribute('matched_routes', 'org.agavi.routing');\n\n\t\tforeach( $matchedRoutes as $matchedRoute ) {\n\t\t\t$result[$matchedRoute] = $this->getContext()->getRouting()->getRoute($matchedRoute);\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function getExtraRoutes()\n {\n $rules = [];\n foreach ($this->getExtraControllers() as $class) {\n $controllerInst = Controller::singleton($class);\n $link = Director::makeRelative($controllerInst->Link());\n $route = rtrim($link ?? '', '/') . '//$Action/$ID/$OtherID';\n $rules[$route] = $class;\n }\n return $rules;\n }", "public function get_source_based_routes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $list = array();\n\n $rules = $this->_get_rules();\n\n foreach ($rules as $rule) {\n if (!($rule->get_flags() & (Rule::SBR_HOST)))\n continue;\n\n $info = array();\n\n $info['name'] = $rule->get_name();\n $info['interface'] = $rule->get_parameter();\n $info['address'] = $rule->get_address();\n $info['enabled'] = $rule->is_enabled();\n\n $list[] = $info;\n }\n\n return $list;\n }", "public function getBestRoutesForRouter()\n {\n return $this->best_routes_for_router;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unset relevent keys before stats object is inserted into db
public function unsetKeysBeforeCreate($stats) { foreach ($this->keysOnlyUsedDuringCreation() as $key) { unset($stats[$key]); } return $stats; }
[ "public static function reset_draw_stats_entries()\r\n {\r\n db::sql(\"DELETE FROM `tl_users_stats_draw`;\", DB_NAME);\r\n }", "public function clearData()\n {\n $this->save();\n $this->_data = array();\n $this->_indexes = array();\n $this->_preloaded = false;\n }", "private function clearLatestData_() {\n\t\t$this->debug( 'Clearing latest stats.' );\n\t\t$sql = 'TRUNCATE TABLE '.ContestStatistics::$dbTable;\n\t\t$this->db->query( $sql );\n\t}", "public function clearKeys() {\n //bind data\n for($i = 0; $i < count($this->sqlKeys[1]) ; $i++) {\n $this->sqlKey(\"#\". $this->sqlKeys[1][$i] .\"#\", \"\");\n }\n \n //lets see it\n F::sysLog($this->sqlCommand);\n F::sysLog(\"</sql-command>\");\n }", "function resetKeys() {\n $this->keys = array_keys($this->records);\n }", "public function clearValues() {\n\t\t\t$fields = get_object_vars($this);\n\t\t\tforeach ($fields as $field => $value)\n\t\t\t\tif(substr($field, 0, 1) != '_')\n\t\t\t\t\t$this->$field = null;\n\t\t}", "function initializeDatabaseStats()\n {\n // First drop and recreate the stats tables\n $this->statsModel = StatsTable::Factory($this->connector, false, $this->metric_type, $this->period_type, true, true);\n\n // And drop the raw dataset\n if ( $this->maintain_raw )\n {\n $this->rawModel = StatsTable::Factory($this->connector, true, $this->metric_type, $this->period_type, true, true);\n }\n\n }", "public function resetValues()\r\n {\r\n foreach ($this->obj_to_db_trans as $obj_prop => $db_field) {\r\n $this->{$obj_prop}=null;\r\n }\r\n }", "function _unsetData() {\n\t\tunset($this->title);\n\t\tunset($this->creators);\n\t\tunset($this->subjects);\n\t\tunset($this->abstract);\n\t\tunset($this->publisher);\n\t\tunset($this->contributors);\n\t\tunset($this->datePublished);\n\t\tunset($this->types);\n\t\tunset($this->formats);\n\t\tunset($this->identifier);\n\t\tunset($this->sources);\n\t\tunset($this->language);\n\t\tunset($this->relations);\n\t\tunset($this->galleyURLs);\n\t\tunset($this->suppFileURLs);\n\t\tunset($this->copyright);\n\t}", "public function clearStats()\n {\n // Delete player game stats\n $this->deletePlayerGameStats();\n\n // Clear game stats\n $this->homeTeamScore = null;\n $this->homeTeamYellowCards = 0;\n $this->homeTeamRedCards = 0;\n $this->visitingTeamScore = null;\n $this->visitingTeamYellowCards = 0;\n $this->visitingTeamRedCards = 0;\n $this->notes = '';\n }", "public function resetFieldValues()\n {\n parent::resetFieldValues();\n $this->tableName = null;\n $this->columns = array();\n $this->indexes = array();\n }", "private function _cleanUpMetaEmptiness () {\n $model = $this->owner;\n $meta = $model->{$this->metaField};\n\n foreach ($meta as $lang => &$subMeta) {\n foreach ($subMeta as $key => $value) {\n if (empty($value)) {\n unset($subMeta[$key]);\n }\n }\n\n if (empty($subMeta)) {\n unset($meta[$lang]);\n }\n }\n unset($subMeta);\n\n $model->{$this->metaField} = $meta;\n }", "protected function clearValues(){\n\t\t$this->values = $this->stdValues;\n\t}", "public function resetMeta()\n {\n $this->_new = true;\n $this->_changed = true;\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n }", "private static function cleanup_user_meta() {\n\t\tglobal $wpdb;\n\n\t\tforeach ( self::$user_meta_keys as $meta_key ) {\n\t\t\t$wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $meta_key ) );\n\t\t}\n\t}", "private function invalidate()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$this->data = array();\r\n\t\t\t$this->populated = array();\r\n\t\t\t\r\n\t\t\tunset( $this->name );\r\n\t\t\tunset( $this->id );\r\n\t\t\tunset( $this->data );\r\n\t\t\tunset( $this->info );\r\n\t\t\tunset( $this->populated );\r\n\t\t\t\r\n\t\t}", "public function flushValues()\r\n {\r\n $this->kvpairs = [];\r\n }", "protected function restoreInnoDbStats()\n {\n $value = $this->mysql_innodbstats_value;\n if ($value !== null) {\n // restoring old variable\n $this->adapter->query(\"set global innodb_stats_on_metadata='$value'\", Adapter::QUERY_MODE_EXECUTE);\n }\n }", "private function prepareCustomOptionAggregateTable()\n {\n $this->getConnection()->delete($this->getCustomOptionAggregateTable());\n }", "public function reset_stat()\n {\n $this->update_campaign_meta($this->optin_campaign_id, $this->impression, (int)0);\n $this->update_campaign_meta($this->optin_campaign_id, $this->conversion, (int)0);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to check if archive is a flex loop. This doesn't check if viewing an actual archive, but this layout should not be an option if ! is_archive()
function mai_is_flex_loop() { // Bail if not a content archive. if ( ! mai_is_content_archive() ) { return false; } // Get columns. $columns = mai_get_columns(); // If we have more than 1 column or if we are using featured image as bg image, it's a flex loop. if ( ( $columns > 1 ) || ( 'background' === mai_get_archive_setting( 'image_location', true, genesis_get_option( 'image_location' ) ) ) ) { return true; } // Not a flex loop. return false; }
[ "function mai_is_content_archive() {\n\n\tglobal $wp_query;\n\n\tif ( ! $wp_query->is_main_query() ) {\n\t\treturn false;\n\t}\n\n\t$is_archive = false;\n\n\t// Blog\n\tif ( is_home() ) {\n\t\t$is_archive = true;\n\t}\n\t// Term archive\n\telseif ( is_category() || is_tag() || is_tax() ) {\n\t\t$is_archive = true;\n\t}\n\t// CPT archive - this may be called too early to use get_post_type()\n\telseif ( is_post_type_archive() ) {\n\t\t$is_archive = true;\n\t}\n\t// Author archive\n\telseif ( is_author() ) {\n\t\t$is_archive = true;\n\t}\n\t// Search results\n\telseif ( is_search() ) {\n\t\t$is_archive = true;\n\t}\n\n\treturn $is_archive;\n}", "function aton_qodef_is_masonry_template(){\n\n\t\t$page_id = aton_qodef_get_page_id();\n\t\t$page_template = get_page_template_slug($page_id);\n\t\t$page_options_template = aton_qodef_options()->getOptionValue('blog_list_type');\n\n\t\tif(!is_archive()){\n\t\t\tif($page_template == 'blog-masonry.php' || $page_template =='blog-masonry-full-width.php'){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}elseif(is_archive() || is_home()){\n\t\t\tif($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width'){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "function kloe_qodef_is_masonry_template(){\n\t\t\t\n\t\t\t$page_id = kloe_qodef_get_page_id();\n\t\t\t$page_template = get_page_template_slug($page_id);\n\t\t\t$page_options_template = kloe_qodef_options()->getOptionValue('blog_list_type');\n\n\t\t\tif(!is_archive()){\n\t\t\t\tif($page_template == 'blog-masonry.php' || $page_template =='blog-masonry-full-width.php'){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}elseif(is_archive() || is_home()){\n\t\t\t\tif($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width'){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t}", "function is_gallery_archive() {\n\treturn is_post_type_archive( 'gallery' ); \n}", "public function isArchive()\n {\n\n if (is_post_type_archive(\"job-listing\")) {\n return true;\n }\n\n return false;\n }", "public function is_flex_rendering() {\n\t\t\treturn ! empty( $this->args['flex'] ) && 'block' !== $this->args['content_layout'];\n\t\t}", "private function isFilteredArchive()\n {\n return is_archive() && (is_category() || is_tag() || is_tax() || is_date() || is_author());\n }", "function archive(){\n \n /*\n * set base variables\n */\n \n $this->View->add(\"wxp_content_template\", WXP::get_path(\"#loop\")->dir());\n \n /*\n * if posts exceed the amount of that allotted per page,\n * tell view to include the pager nav \n */\n \n global $wp_query;\n \n if($wp_query->max_num_pages > 1){\n $this->View->add(\"paged_archive\", true);\n }\n \n /*\n * include the error no posts template if the archive has no posts\n */\n \n if(!have_posts()){\n $this->View->add(\"wxp_content_template\", \n WXP::get_path(\"#error\")->name(\"no-posts\")->dir());\n } \n \n \n }", "function wild_archive_loop() {\n\n\tif ( have_posts() ) {\n\n\t\tdo_action( 'genesis_before_while' );\n\n\t\twhile ( have_posts() ) {\n\n\t\t\tthe_post();\n\t\t\tdo_action( 'genesis_before_entry' );\n\n\t\t\t// Template part\n\t\t\t$partial = apply_filters( 'wild_loop_partial', 'archive' );\n\t\t\t$context = apply_filters( 'wild_loop_partial_context', is_search() ? 'search' : get_post_type() );\n\t\t\tget_template_part( 'partials/' . $partial, $context );\n\n\t\t\tdo_action( 'genesis_after_entry' );\n\n\t\t}\n\n\t\tdo_action( 'genesis_after_endwhile' );\n\n\t} else {\n\n\t\tdo_action( 'genesis_loop_else' );\n\n\t}\n}", "function leto_wc_archive_check() {\n if ( is_shop() || is_product_category() || is_product_tag() ) {\n return true;\n } else {\n return false;\n }\n}", "function pta_is_post_type_archive($specific_post_type = false) {\n\tstatic $is_post_type_index;\n\t\n\tif(!isset($is_post_type_index)) {\n\t\tglobal $wp; // this is where the matched query is stored\n\n\t\t$q = $wp->matched_query;\n\t\tparse_str($q, $q); // make query string into an array\n\n\t\t$post_type_index = isset($q['post_type_index']) ? $q['post_type_index'] : false;\n\t\t$post_type = get_query_var('post_type');\n\t\t$enabled_post_type_archives = pta_get_settings('enabled_post_type_archives');\n\t\n\t\tif($post_type_index == '1' and in_array($post_type, $enabled_post_type_archives))\n\t\t\t$is_post_type_index = true;\n\t\telse\n\t\t\t$is_post_type_index = false;\n\t}\n\t\n\tif($is_post_type_index and $specific_post_type !== false)\n\t\treturn ($specific_post_type == get_query_var('post_type'));\n\t\n\treturn $is_post_type_index;\n}", "function thematic_archiveloop() {\n\tdo_action('thematic_archiveloop');\n}", "function is_video_playlist_archive() {\n\treturn is_playlist_archive() && is_tax( 'playlist_type', 'video');\n}", "function astra_check_is_bb_themer_layout() {\n\n\t\t$is_layout = false;\n\n\t\t$post_type = get_post_type();\n\t\t$post_id = get_the_ID();\n\n\t\tif ( 'fl-theme-layout' === $post_type && $post_id ) {\n\n\t\t\t$is_layout = true;\n\t\t}\n\n\t\treturn $is_layout;\n\t}", "public function is_post_format_archive() {\n\t\t$wp_query = $this->wp_query_wrapper->get_main_query();\n\n\t\treturn $wp_query->is_tax( 'post_format' );\n\t}", "function has_archives_page( $type = '' ) {\n\n\t$page = get_archives_page( $type );\n\tif ( is_null( $page ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function hasLayout()\n {\n return $this->getLayout() !== '';\n }", "function the7_generic_archive_loop() {\n\t\tdo_action( 'presscore_before_loop' );\n\n\t\t$config = presscore_config();\n\n\t\t// backup config\n\t\t$config_backup = $config->get();\n\n\t\t// masonry container open\n\t\techo '<div ' . presscore_masonry_container_class( array( 'wf-container' ) ) . presscore_masonry_container_data_atts() . '>';\n\t\twhile ( have_posts() ) {\n\t\t\tthe_post();\n\t\t\tpresscore_archive_post_content();\n\t\t\t$config->reset( $config_backup );\n\t\t}\n\t\t// masonry container close\n\t\techo '</div>';\n\n\t\tdt_paginator();\n\n\t\tdo_action( 'presscore_after_loop' );\n\t}", "function getIsArchive()\n {\n return (bool) $this->_bIsArchive;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created Community in storage.
public function store(CreateCommunityRequest $request) { $input = $request->all(); $community = $this->communityRepository->create($input); $community->users()->attach(Auth::id()); Flash::success(trans('flash.store', ['model' => trans_choice('functionalities.communities', 1)])); return redirect(route('communities.index')); }
[ "public function store(CreateCommunityRequest $request)\n {\n $input = $request->all();\n\n $community = $this->communityRepository->create($input);\n\n Flash::success('Community saved successfully.');\n\n return redirect(route('communities.index'));\n }", "public function newCommunity()\n\t\t{\n\t\t\t$name \t\t= $this->input->get('name') ;\n\t\t\t$abbr \t\t= $this->input->get('abbrevation') ;\n\t\t\t$leader \t= $this->input->get('leader') ;\n\t\t\t$district \t= $this->input->get('district') ;\n\n\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\tif(empty($name) || empty($abbr) ){\n\n\t\t\t\t\tthrow new Exception(\"Warning: Important fields missing\");\n\t\t\t\t}\n\n\n\t\t\t\tif( empty($district) ){\n\t\t\t\t\t\n\t\t\t\t\tthrow new Exception(\"Error: Invalid district\");\n\t\t\t\t}\n\n\t\t\t\t//data to check for uniqueness\n\t\t\t\t$cdata = ! empty($leader) ? ['name' => $name, 'abbrevation'=> $abbr, 'leader' => $leader] : ['name' => $name, 'abbrevation'=> $abbr] ;\n\n\t\t\t\t$feedback = $this->mdl_communities->exists($cdata) ;\n\n\t\t\t\tif($feedback['status'] ){\n\t\t\t\t\tthrow new Exception(\"Community with this \". $feedback['field']. \" already exists. Duplicates not allowed\" );\n\t\t\t\t\t\n\t\t\t\t}\t\n\n\t\t\t\t$cdata['date_created'] \t= $this->date_time->now('Y-m-d') ; \n\t\t\t\t$cdata['created_by'] \t= $this->session->admin_id ;\n\t\t\t\t$cdata['district_id'] \t= $district ;\n\n\n\t\t\t\tif(! $this->mdl_communities->create($cdata) ){\n\t\t\t\t\tthrow new Exception(\"Error: couldn't create Community at the moment\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data['status'] = 'success' ; \n\t\t\t}\n\t\t\tcatch(Exception $e){\n\n\t\t\t\t$data['status'] = 'error' ;\n\t\t\t\t$data['message'] = $e->getMessage() ;\n\t\t\t}\t\t\n\t\t\t\n\t\t\techo json_encode($data) ;\n\n\t\t}", "public function store(CreateConectivityRequest $request)\n {\n $input = $request->all();\n\n $conectivity = $this->conectivityRepository->create($input);\n\n Flash::success('Conectivity saved successfully.');\n\n return redirect(route('admin.conectivities.index'));\n }", "public function addNewDataOfferToCommunity()\n {\n Session::put('menu_item_parent', 'content');\n Session::put('menu_item_child', 'communities');\n Session::put('menu_item_child_child', '');\n $communities = Community::orderby('created_at', 'desc')\n ->get();\n return view('admin.communities.add_new_to_community', compact('communities'));\n }", "public function store()\n\t{\n\t\t$credentials=Input::all();\n\t\t$venue_user_id=Auth::id();\n\t\t$venue_institute_id=Institute::getInstituteforUser($venue_user_id);\n\t\t\n\t\t$credentials['venue_institute_id']=$venue_institute_id;\n\t\t$credentials['venue_user_id']=$venue_user_id;\n\t\t$institute=Institute::where('id',$credentials['venue_institute_id'])->first()->institute_url;\n\t\t$locality=Locality::where('id',$credentials['venue_locality_id'])->first()->locality_url;\n\t\t// dd($locality);\n\t\t$credentials['venue']=$institute.'-'.$locality;\n\t\t\n\t\t$validator = Validator::make($credentials, Venue::$rules);\n\t\tunset($credentials['csrf_token']);\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($validator)->with('failure',Lang::get('venue.venue_create_failed'));\n\t\t}\n\t\t$created=Venue::create($credentials);\n\t\tif($created)\n\t\t\treturn Redirect::to('/venues')->with('success',Lang::get('venue.venue_created'));\n\t\telse\n\t\t\treturn Redirect::back()->withInput()->with('failure',Lang::get('venue.venue_create_failed'));\t\n\t}", "public function store(CreateCitiesRequest $request)\n {\n $city = new Cities();\n $city->name = $request['name'];\n $city->districts_id = $request['districts_id'];\n\n $district = Districts::find($request['districts_id']);\n\n $city->district($district);\n $city->save();\n\n\n return redirect()->route(config('quickadmin.route') . '.cities.index');\n }", "public function persist()\n {\n try {\n CommunityLink::from(auth()->user())->contribute($this->all());\n if (auth()->user()->isTrusted()) {\n flash('Thank for the contribution!', 'success');\n } else {\n flash()->overlay('Your contribution will be approved shortly', 'thanks');\n }\n } catch (CommunityLinkAlreadySubmitted $e) {\n flash()->overlay('we will instead bump the timestamps and bring that link back to the top',\n 'That link has already been submitted');\n }\n }", "public function store() {\n request()->validate([\n 'course_group_name' => 'required|unique:multilingual_course_group,name'\n ]);\n\n DB::connection('mysql')->table('multilingual_course_group')\n ->insert(['name' => request('course_group_name')]);\n\n return response('Successfully created a course group.', 200);\n }", "public function store(CreatecentreinteretsRequest $request)\n {\n $input = $request->all();\n\n $centreinterets = $this->centreinteretsRepository->create($input);\n\n Flash::success('Centreinterets saved successfully.');\n\n return redirect(route('admin.centreinterets.index'));\n }", "public function create($val)\n {\n $expected = [\n 'public_name' => '',\n 'private_name' => '',\n 'can_post' => '',\n 'searchable' => '',\n 'privacy' => 1,\n 'public_url',\n 'private_url'\n ];\n\n /**\n * @var $public_name\n * @var $private_name\n * @var $can_post\n * @var $searchable\n * @var $privacy\n * @var $public_url\n * @var $private_url\n */\n extract(array_merge($expected, $val));\n\n $name = ($privacy == 1) ? $public_name : $private_name;\n\n if (empty($name)) return false;\n\n $community = $this->model->newInstance();\n $community->title = sanitizeText($name, 100);\n $community->user_id = \\Auth::user()->id;\n $community->privacy = sanitizeText($privacy);\n\n if ($privacy == 1) {\n $community->can_post = sanitizeText($can_post);\n $community->can_join = 1;\n $community->searchable = 1;\n $community->slug = $public_url;\n } else {\n $community->can_post = 1;\n $community->can_join = 0;\n $community->searchable = sanitizeText($searchable);\n $community->slug = $private_url;\n }\n $community->save();\n\n /**\n * Add this user to the notification receivers for this community\n */\n $this->notificationReceiver->add(\\Auth::user()->id, 'community', $community->id);\n\n $this->event->fire('community.add', [$community]);\n return $community;\n }", "public function store()\n {\n\n $this->formValidator();\n\n $item = $this->model::create($this->getData());\n\n session()->flash('message', __($this->messages['create']));\n session()->flash('type', 'success');\n\n $this->resetInputFields();\n $this->emit('authorStore');\n }", "public function store(CreateProviderRequest $request)\n {\n $input = $request->all();\n\n $provider = $this->providerRepository->create($input);\n\n Flash::success('Provider saved successfully.');\n\n return redirect(route('providers.index'));\n }", "public function store()\n {\n $this->authorize('create', Modpack::class);\n\n request()->validate([\n 'name' => ['required'],\n 'slug' => ['required', 'unique:modpacks', 'alpha_dash'],\n 'status' => ['required', 'in:public,private,draft'],\n 'modpack_icon' => ['nullable', 'image', Rule::dimensions()->minWidth(50)->ratio(1)],\n ]);\n\n $modpack = Modpack::create([\n 'name' => request('name'),\n 'slug' => request('slug'),\n 'status' => request('status'),\n 'icon_path' => request('modpack_icon', new NullFile)->store('modpack_icons'),\n 'team_id' => request()->user()->currentTeam->id,\n ]);\n\n $modpack->addCollaborator(auth()->user()->id);\n\n return redirect('/modpacks/'.request('slug'));\n }", "public function store(CreateElectionRequest $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'description' => 'required',\n 'election_category_id' => 'required|integer',\n ]);\n\n $input = $request->all();\n\n $election = $this->electionRepository->create($input);\n\n Flash::success('Election saved successfully.');\n\n return redirect(route('elections.index'));\n }", "public function store()\n\t{\n\t\t//create new city\n\t\t$City = new City;\n\n\t\t//pupulate city attributes\n\t\t$City->name = Input::get('name');\n\t\t$City->province = Input::get('province');\n\t\t$City->population = Input::get('population');\n\t\t$City->save();\n\n\t\t//Redirect\n\t\tSession::flash('message', \"City: \" . $City->name . \" is successfully created\");\n\t\treturn Redirect::to('city');\n\t}", "public function store(CreateCatalogRequest $request)\n {\n\n $input = $request->all();\n\n if (\\Auth::user()->can('isAdmin')) {\n $input['status'] = 1 ;\n }else{\n $input['status'] = 0 ;\n } \n $input['cover'] = $this->uploadingCover($request);\n $input['full'] = $this->uploadingFull($request);\n\n $catalogInput = [\n 'cover' => $input['cover'],\n 'full' => $input['full'],\n 'status' => $input['status'],\n 'user_id' => $input['user_id'],\n 'category_id' => $input['category_id'],\n ];\n $catalog = $this->catalogRepository->create($catalogInput); \n $catalog_id = $catalog->id;\n\n $value = Str::random(9);\n foreach ($input['metadata'] as $key => $valueKey) {\n CatalogMetadataValue::create([\n 'metadata_id'=>$key,\n 'metadata_key'=>$valueKey,\n 'value'=> $value,\n 'catalog_id'=>$catalog->id\n ]);\n }\n \n \n if (! \\Auth::user()->can('isAdmin')) {\n // $admin = \\App\\Models\\User::where('role_id','1')->first();\n // Mail::to($admin->email)->send(new NotifyNewCatalog($catalog));\n } \n\n Flash::success('Catalog saved successfully.');\n\n return redirect(route('catalogs.index_with_category',$request->category_id));\n }", "public function store()\n {\n date_default_timezone_set('America/Sao_Paulo');\n \t\t$date_create_at = date('Y-m-d H:i:s');\n\n $clientesTable = TableRegistry::get('clientes');\n $cliente = $clientesTable->newEntity();\n $cliente->cliente_nome = $this->request->data('cliente_nome');\n $cliente->cliente_sobrenome = $this->request->data('cliente_sobrenome');\n $cliente->cliente_created_at = $date_create_at;\n\n if($clientesTable->save($cliente))\n {\n $msg = \"Cliente cadastrado com sucesso!\";\n }\n else\n {\n $msg = \"Erro ao cadastrar cliente!\";\n }\n $this->set('msg', $msg);\n }", "public function storeToDatabase() {\n\t\tif($this->getPet()->getLoader()->getBlockPetsConfig()->storeToDatabase()) {\n\t\t\tif($this->getPet()->getLoader()->getDatabase()->petExists($this->getPet()->getPetName(), $this->getPet()->getPetOwnerName())) {\n\t\t\t\t$this->getPet()->getLoader()->getDatabase()->updatePetExperience($this->getPet()->getPetName(), $this->getPet()->getPetOwnerName(), $this->getPet()->getPetLevel(), $this->getPet()->getPetLevelPoints());\n\t\t\t\t$this->getPet()->getLoader()->getDatabase()->updateChested($this->getPet()->getPetName(), $this->getPet()->getPetOwnerName());\n\t\t\t} else {\n\t\t\t\t$this->getPet()->getLoader()->getDatabase()->registerPet($this->getPet());\n\t\t\t}\n\t\t}\n\t}", "public function store()\n {\n (new CollectionsFunctions($this->context->dbDriver))->storeCollection($this, $this->rights);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all tweets with mentioned hashtag since id.
function campaign_tweetcounter_get_tweets($oauth, $hashtag, $since_id = FALSE) { $statuses = array(); $hashtag = preg_replace('/^\#/', '', $hashtag); $params = array( 'q' => '#' . $hashtag, 'count' => '100', 'result_type' => 'recent', 'include_entities' => 'true', ); if ($since_id) { $params['since_id'] = $since_id; } $query = http_build_query($params); $response = campaign_tweetcounter_request('tweets', $oauth, '?' . $query); if (!empty($response->statuses)) { $statuses = $response->statuses; } return $statuses; }
[ "protected function generateTweetsByHashtag()\n {\n $this->setTweets($this->twitter->getSearch(array(\n 'q' => '#'.$this->value,\n 'count' => 100,\n 'result_type' => 'recent'\n ))->statuses);\n }", "public function getTwitterHashtags()\n {\n return $this->twitterHashtags;\n }", "function getHashtagTweets($hashTag) {\n\n $url = 'http://search.twitter.com/search.atom?q='.urlencode($hashTag) ;\n echo \"<p>Connecting to <strong>$url</strong> ...</p>\";\n $ch = curl_init($url);\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $xml = curl_exec ($ch);\n curl_close ($ch);\n\n //If you want to see the response from Twitter, uncomment this next part out:\n //echo \"<p>Response:</p>\";\n //echo \"<pre>\".htmlspecialchars($xml).\"</pre>\";\n\n $affected = 0;\n $twelement = new SimpleXMLElement($xml);\n foreach ($twelement->entry as $entry) {\n $text = trim($entry->title);\n $author = trim($entry->author->name);\n $time = strtotime($entry->published);\n $id = $entry->id;\n echo \"<p>Tweet from \".$author.\": <strong>\".$text.\"</strong> <em>Posted \".date('n/j/y g:i a',$time).\"</em></p>\";\n }\n\n return true ;\n }", "function get_tweets($url, $user_name, $since_id) {\n\t\t//if since id is omitted only one tweet is returned.\n\t\t//Return first tweet and id surrounded by <tweet> and <id> tags.\n\t\t\n\t //Set access tokens here - see: https://dev.twitter.com/apps/\n\t\t$settings = array(\n\t\t\t'oauth_access_token' => \"YOUR_OAUTH_ACCESS_TOKEN\",\n\t\t\t'oauth_access_token_secret' => \"YOUR_OAUTH_ACCESS_TOKEN_SECRET\",\n\t\t\t'consumer_key' => \"YOUR_CONSUMER_KEY\",\n\t\t\t'consumer_secret' => \"YOUR_CONSUMER_SECRET\"\n\t\t);\n\n\t\t$getfield = '?q=@'.$user_name;\n\t\tif($since_id == \"\") {\n\t\t\t$getfield = $getfield.'&count=1';\n\t\t} else {\n\t\t\t$getfield = $getfield.'&since_id='.$since_id;\n\t\t}\n\t\t$requestMethod = 'GET';\n\t\t\n\t\t$twitter = new TwitterAPIExchange($settings);\n\t\t$response = $twitter->setGetfield($getfield)\n\t\t\t\t\t ->buildOauth($url, $requestMethod)\n\t\t\t\t\t ->performRequest();\n\t\t\t\n\t\t//Get since id from response\n\t\t$tweets = json_decode($response, true);\n\t\treturn '<id>'.$tweets[\"statuses\"][0][\"id\"].'</id><tweet>'.$tweets[\"statuses\"][0][\"text\"].'</tweet>';\n\t}", "function ozh_ta_get_hashtags( $tweet ) {\n $list = array();\n foreach( $tweet->entities->hashtags as $tag ) {\n $list[] = $tag->text;\n }\n return $list;\n}", "public function get_hashtags($tweet)\n{\n $matches = array();\n preg_match_all('/#([^\\s]+)/', $tweet, $matches);\n return $matches[0];\n \n}", "public function getTweets()\n {\n // Construct query string\n $lastIdStr = $this->lastIdStr;\n $queryString = sprintf(\n '%s&q=%s&since_id=%s',\n $this->queryString,\n $this->query,\n $lastIdStr\n );\n\n // Call Twitter API\n $twitter = new TwitterAPIExchange($this->settings);\n try {\n $result = $twitter->setGetfield($queryString)\n ->buildOauth($this->url, $this->method)\n ->performRequest();\n $data = json_decode($result, true);\n } catch (Throwable $t) {\n $data['errors'] = $t->getMessage();\n }\n\n // Exit if errors, e.g. rate limit exceeded\n if (isset($data['errors'])) {\n var_dump($data['errors']);\n return;\n }\n\n // Process\n $tweets = [];\n foreach (($data['statuses'] ?? []) as $tweet) {\n $idStr = $tweet['id_str'] ?? '';\n $text = $tweet['text'] ?? '';\n if (preg_match($this->censoredWordsRegex, $text)) {\n continue;\n }\n\n $lastIdStr = ($idStr > $lastIdStr) ? $idStr : $lastIdStr;\n $tweets[$idStr] = $text;\n }\n ksort($tweets); // oldest to newest\n\n // Update class vars\n $this->lastIdStr = $lastIdStr;\n foreach ($tweets as $idStr => $tweet) {\n $this->tweets[] = $tweet;\n }\n }", "public function getTweets()\n {\n if (empty($this->attributes['twitter_username'])) {\n return [];\n }\n\n $tweets = json_decode(Twitter::getUserTimeline([\n 'screen_name' => $this->attributes['twitter_username'],\n 'format' => 'json'\n ]), true);\n\n $keys = array_flip(['id_str', 'text']);\n $tweets = array_map(function($tweet) use ($keys) {\n return array_intersect_key($tweet, $keys);\n }, $tweets);\n\n $hidden = $this->hiddenContents()->where('type', '=', 'twitter')->pluck('external_id')->toArray();\n if (Auth::check() && Auth::id() === $this->attributes['id']) {\n // Flag hidden tweets and show last 15, to allow the user to manage them\n if (count($hidden) > 0) {\n $tweets = array_map(function($tweet) use($hidden) {\n if (in_array($tweet['id_str'], $hidden)) {\n $tweet['hidden'] = true;\n }\n return $tweet;\n }, $tweets);\n }\n $amount = 15;\n } else {\n // Remove hidden tweets for other or non-logged users and return only last 5\n if (count($hidden) > 0) {\n $tweets = array_filter($tweets, function($tweet) use($hidden) {\n return !in_array($tweet['id_str'], $hidden);\n });\n }\n $amount = 5;\n }\n\n $tweets = array_splice($tweets, 0, $amount);\n\n return $tweets;\n }", "function filtra_tweets($tweets,$hashtags){\n\t\t//\n\t\t$id_nodo = 0;\n\t\t//\n\t\tforeach($tweets as $elements){\n\t\t\t$lgSaveTweet = false;\n\t\t\t$tweet_hashtags = $elements['_tweetHashTag'];\n\n\t\t\t//verifica se o tweet sera salvo ou nao\n\t\t\tif ($tweet_hashtags != null){\n\t\t\t\t$result = array_intersect($hashtags, $tweet_hashtags);\n\t\t\t\t\n\t\t\t\tif (sizeof($result) > 0){\n\t\t\t\t\t//tem alguma hashtag valida;\n\t\t\t\t\t$lgSaveTweet = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$lgSaveTweet){\n\t\t\t\tunset($tweets[$id_nodo]);\n\t\t\t}\n\t\t\t$id_nodo += 1;\n\t\t}\n\t\t\n\t\treturn $tweets;\n\t}", "function get_hashtag($id)\n {\n return $this->db->get_where('hashtags',array('id'=>$id))->row_array();\n }", "private function get_tags($following) {\n\t\t// convert json data to associative array\n\t\t$following = json_decode($following, true);\n\t\t$following = $following[\"ids\"];\n\t\t\n\t\t// prepare sanitizer for converting hashtags to keywords\n\t\t$this->load->model(\"sanitizer_model\");\n\n\t\t// limit to 100 users per request\n\t\t$queries = array();\n\t\t$index = 0;\n\t\tfor($i = 0; $i < count($following); $i++) {\n\t\t\tif($i == 0 || ($i % 100 == 0) ) {\n\t\t\t\tif($i > 0) { $index++; }\n\t\t\t\t$queries[$index] = $following[$i];\n\t\t\t} else {\n\t\t\t\t$queries[$index] = $queries[$index] . \",\" . $following[$i]; \n\t\t\t}\n\t\t}\n\n\t\t// make the requests for user's latest tweets\n\t\tforeach($queries as $userIDs) {\n\t\t\t// get user's latest tweets\n\t\t\t$url = \"https://api.twitter.com/1.1/users/lookup.json\";\n\t\t\t$getfield = '?include_entities=true&user_id='.$userIDs;\n\n\t\t\t$tweets = $this->twitter->setGetfield($getfield)\n\t\t\t->buildOauth($url, \"GET\")\n\t\t\t->performRequest();\n\t \t$this->queryCheck($tweets);\n\t\t\t$tweets = json_decode($tweets, true);\n\n\t\t\tforeach($tweets as $tweet) {\n\t\t\t\t// get tweet ID, status, and hashtags\n\t\t\t\t$tweetID = @$tweet[\"id\"];\n\t\t\t\t$tweetStatus = @$tweet[\"status\"][\"text\"];\n\t\t\t\tpreg_match_all('/#[^\\s]*/i', $tweetStatus, $hashtags);\n\n\t\t\t\t// if tweet has hashtag(s), add to array\n\t\t\t\tif(count($hashtags[0]) > 0) {\n\t\t\t\t\tforeach($hashtags as $hashtag) {\n\t\t\t\t\t\t// sanitize the tag\n\t\t\t\t\t\t$sanitized = $this->sanitizer_model->sanitize($hashtag);\n\t\t\t\t\t\t// add to array\n\t\t\t\t\t\t$this->add_tag($sanitized, $tweetStatus);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort into trending order, if any\n\t\t// TODO - move this out into a function\n\t\t$temp = $this->tags;\n\t\t$sortedArray = array();\n\n\t\tfor($j = 0; $j < count($temp); $j++) {\n\t\t\t$mostSoFar = 0; \n\t\t\t$index = 0;\n\t\t\tfor($i = 0; $i < count($temp); $i++) {\n\t\t\t\t$count = count($temp[$i][\"ids\"]);\n\n\t\t\t\tif($count > $mostSoFar) {\n\t\t\t\t\t$mostSoFar = $count;\n\t\t\t\t\t$index = &$temp[$i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add highest so far to sorted array\n\t\t\tarray_push($sortedArray, $index);\n\t\t\t// remove from old array\n\t\t\t$index = array(\"tag\" => \"\", \"ids\" => array());\n\t\t}\n\n\t\t// update private tags array with the sorted array\n\t\t$this->tags = json_encode($sortedArray);\n\t}", "private function get_tweets() {\n\t\t// Bail if what we need is not set!\n\t\tif ( empty( $this->twitter_connexion ) || empty( $this->twitter_username ) )\n\t\t\treturn false;\n\n\t\t$latest_id = false;\n\n\t\t$params = array( \n\t\t\t'screen_name' => $this->twitter_username,\n\t\t\t'exclude_replies' => true\n\t\t);\n\n\t\tif ( ! empty( $this->latest_tweet ) )\n\t\t\t$params['since_id'] = $this->latest_tweet;\n\n\t\t$connection = $this->get_access_token();\n\t\t$content = $connection->get( 'statuses/user_timeline' , $params );\n\n\t\tif ( empty( $content ) )\n\t\t\treturn;\n\n\t\t$from_user_link = bp_core_get_userlink( $this->user_id );\n\t\t\n\t\tforeach( $content as $tweet ) {\n\t\t\t// init vars\n\t\t\t$retweeted = $action = $permalink = false;\n\n\t\t\tif ( ! empty( $tweet->retweeted_status ) ) {\n\t\t\t\t$retweeted = $tweet;\n\t\t\t\t$tweet = $tweet->retweeted_status;\n\t\t\t\t$retweeted_user = '<a href=\"https://twitter.com/'.$tweet->user->screen_name.'\">' . $tweet->user->name .'</a>';\n\t\t\t\t$action = sprintf( __( '%s retweeted %s', 'thaim-utilities' ), $from_user_link, $retweeted_user );\n\t\t\t} else {\n\t\t\t\t$action = sprintf( __( '%s tweeted', 'thaim-utilities' ), $from_user_link );\n\t\t\t}\n\n\t\t\t$the_tweet = $tweet->text;\n\t\t\t$permalink = 'https://twitter.com/' . $tweet->user->screen_name . '/status/' . $tweet->id_str;\n\n\t\t\t$created = ! empty( $retweeted ) ? strtotime( $retweeted->created_at ) : strtotime( $tweet->created_at );\n\t\t\t$tweet_id = ! empty( $retweeted ) ? $retweeted->id_str : $tweet->id_str;\n\n\t\t\tif ( empty( $latest_id ) || $latest_id < $tweet_id )\n\t\t\t\t$latest_id = $tweet_id;\n\n\t\t\t// hashtags\n\t\t\tif ( ! empty( $tweet->entities->hashtags ) ) {\n\t\t\t\tforeach( $tweet->entities->hashtags as $hashtag ) {\n\t\t\t\t\t$the_tweet = str_replace( \n\t\t\t\t\t\t$hashtag->text,\n\t\t\t\t\t\t'<a href=\"https://twitter.com/search?q=%23'.$hashtag->text.'&src=hash\">'.$hashtag->text.'</a>',\n\t\t\t\t\t\t$the_tweet\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// mentions\n\t\t\tif ( ! empty( $tweet->entities->user_mentions ) ) {\n\t\t\t\tforeach( $tweet->entities->user_mentions as $mention ) {\n\t\t\t\t\t$the_tweet = str_replace( \n\t\t\t\t\t\t$mention->screen_name, \n\t\t\t\t\t\t'<a href=\"https://twitter.com/'.$mention->screen_name.'\" title=\"'.$mention->name.'\">'.$mention->screen_name.'</a>',\n\t\t\t\t\t\t$the_tweet\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// urls\n\t\t\tif ( ! empty( $tweet->entities->urls ) ) {\n\t\t\t\tforeach( $tweet->entities->urls as $url ) {\n\t\t\t\t\t$the_tweet = str_replace( \n\t\t\t\t\t\t$url->url, \n\t\t\t\t\t\t'<a href=\"'.$url->url.'\" title=\"'.$url->expanded_url.'\">'.$url->display_url.'</a>',\n\t\t\t\t\t\t$the_tweet\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// media\n\t\t\tif ( ! empty( $tweet->entities->media ) ) {\n\t\t\t\tforeach( $tweet->entities->media as $media ) {\n\t\t\t\t\t$the_tweet = str_replace( \n\t\t\t\t\t\t$media->url, \n\t\t\t\t\t\t'<a href=\"'.$media->url.'\" title=\"'.$media->expanded_url.'\">'.$media->display_url.'</a>',\n\t\t\t\t\t\t$the_tweet\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$args = array(\n\t\t\t\t'action' => $action,\n\t\t\t\t'type' => 'twitter_tweet',\n\t\t\t\t'content' => $the_tweet,\n\t\t\t\t'item_id' => $tweet_id,\n\t\t\t\t'recorded_time' => $this->get_date( $created ),\n\t\t\t\t'tweet_permalink' => $permalink,\n\t\t\t);\n\n\t\t\t$this->publish_activity( $args );\n\t\t}\n\n\t\t/* this way, next time we will start from latest saved one !*/\n\t\tif ( ! empty( $latest_id ) )\n\t\t\tbp_update_user_meta( $this->user_id, 'thaim_twitter_latest_tweet_id', $latest_id );\n\t}", "public function getTweetById($id) \n\t{\n\t}", "function getFollowedHashtagPosts($userID)\n\t{\n\t\t\n\t}", "public function getTweet($id){\n\t\t$this->db->where('id', $id);\n\t\treturn $this->db->get('tweets')->result_array();\n\t}", "public function getHashtags()\r\n\t{\r\n\t\t$hashtags = GMySQLi::getRegisters( 'Hashtags', \r\n\t\t\t\t\t\t\t\t\t\t\tarray( 'idHashtag, hashtag' ), 'Users_idUser = ' . $_SESSION[ 'idUser' ],\r\n\t\t\t\t\t\t\t\t\t\t\t'idHashtag ASC' );\r\n\t\t\r\n\t\treturn $hashtags;\r\n\t}", "function get_tweet_feed_from_friends($connection, $user_id) {\n\t$query = \"SELECT m.username, t.message, t.id \".\n\t\"FROM members m \".\n\t\t\"INNER JOIN tweets t ON t.members_id=m.id \". \n\t\t\"INNER JOIN followers f ON f.members_id=m.id \". \n\t\"WHERE f.followed_by=$user_id \".\n\t\"ORDER BY t.id DESC;\";\n\n\treturn _get_tweets($connection, $query);\n}", "public function extractHashtags() {\r\n preg_match_all(self::REGEX_HASHTAG, $this->tweet, $matches);\r\n return $matches[3];\r\n }", "public function getRetweeters($tweet_id) {\n \n $url = \"statuses/retweets/$tweet_id.json\";\n $params = ['query' => [\n 'count' => '100',\n ]];\n $res = $this->request($url, $params);\n\n $retweeters = json_decode($res->getBody());\n return $retweeters;\n \n }", "public function getLastTweets($id, Request $request) {\n if (Cache::has($id)) {\n return Cache::get($id);\n }\n $lastTweets = $this->_service->getLastTweets($id, 10);\n Cache::add($id, $lastTweets, 30);\n return $lastTweets;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses $smNavigationData looking for the block pertaining to the current SMTool or SMFolder. Returns it.
protected function getNavigationDataForThisObject($navigationData = null) { global $smSiteNavigationData; if (!$navigationData) { $navigationData = $smSiteNavigationData; } $returnVal = null; // $this is an SMFolder: $this.id should equal $navigationData['site_instance_id'] if (get_class($this) == 'SMFolder') { foreach ((array)$navigationData['pages'] as $page) { // matching folder if ($page['app_name'] == 'folder' && $page['site_instance_id'] == $this->getID()) { $returnVal = $page; } // non-matching folder else if ($page['app_name'] == 'folder') { $returnVal = $this->getNavigationDataForThisObject($page); } } } // $this is an SMTool: $this.id should eqla $navigationData['id'] else if (get_class($this) == 'SMTool') { foreach ((array)$navigationData['pages'] as $page) { // matching tool if ($page['id'] == $this->getID()) { $returnVal = $page; } // folder: examine contents else if ($page['app_name'] == 'folder') { $returnVal = $this->getNavigationDataForThisObject($page); } } } return $returnVal; }
[ "private function navigationDataForCurrentFolder($incomingData = null) {\n\t\t\tglobal $smSiteNavigationData;\n\t\t\t$returnData = null;\n\t\t\t\n\t\t\t// choose navData based on what we got (since this is a recursive method)\n\t\t\tif ($incomingData) {\n\t\t\t\tif (smDebugToolStructure) { echo 'navigationDataForCurrentFolder found incomingData<br>'; }\n\t\t\t\t$navData = $incomingData;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (smDebugToolStructure) { echo 'navigationDataForCurrentFolder was NOT called recursively. Using smSiteNavigtationData (navjson).<br>'; }\n\t\t\t\t$navData = $smSiteNavigationData;\n\t\t\t}\n\n\t\t\tif (smDebugToolStructure) { \n\t\t\t\techo 'navigationDataForCurrentFolder name: '. $navData['name'] .' | app_name: '. $navData['app_name'] .' | ';\n\t\t\t\techo 'id: '. $navData['site_instance_id'] .' | this id: '. $this->getID() .'<br>';\n\t\t\t}\n\n\n\t\t\t// check to see if we're at the site level\n\t\t\tif ($navData['app_name'] == 'site' && $navData['site_instance_id'] == $this->getID()) {\n\t\t\t\tif (smDebugToolStructure) { echo 'AT SITE LEVEL! Return now.<br>'; }\n\t\t\t\t$returnData = $navData;\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t\tcomb through this level of navData. If app_name = folder && site_instance_id == $this->id\n\t\t\t\tthen we've found the match\n\t\t\t*/\n\t\t\telse {\n\t\t\t\t// start looking for folders\n\t\t\t\tforeach ($navData['pages'] as $pageOrFolder) {\n\t\t\t\t\n\t\t\t\t\t// if we found a match, don't continue to search for another...\n\t\t\t\t\tif ($this->smFoundNavigationDataForCurrentFolderMatch) {\n\t\t\t\t\t\tif (smDebugToolStructure) { echo '<b>Continued with loop. This folder: '. $pageOrFolder['name'] .'. TERMINATING LOOP.</b><br>'; }\n\t\t\t\t\t\tbreak; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// found a folder\n\t\t\t\t\tif ($pageOrFolder['app_name'] == 'folder') {\n\t\t\t\t\t\tif (smDebugToolStructure) { echo 'Examining Folder with id: '. $pageOrFolder['id'] .' | site_instance_id: '. $pageOrFolder['site_instance_id'] .' | this->id: '. $this->getID() .'<br>'; }\n\t\t\t\t\t\t\n\t\t\t\t\t\t// found the folder\n\t\t\t\t\t\tif ($pageOrFolder['site_instance_id'] == $this->getID()) {\n\t\t\t\t\t\t\tif (smDebugToolStructure) { echo '<b>FOUND MATCH: '. $pageOrFolder['name'] .'</b><br>'; }\n\t\t\t\t\t\t\t$this->smFoundNavigationDataForCurrentFolderMatch = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$returnData = $pageOrFolder;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// else if there are pages in the folder, recursively check those\n\t\t\t\t\t\telse if ($pageOrFolder['pages']) {\n\t\t\t\t\t\t\tif (smDebugToolStructure) { echo 'calling navigationDataForCurrentFolder with subpages<br>'; }\n\t\t\t\t\t\t\t$returnData = $this->navigationDataForCurrentFolder($pageOrFolder);\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\t\n\t\t\t// if we're back on the root call, reset smFoundNavigationDataForCurrentFolderMatch because this method is used more than once...\n\t\t\tif (!$incomingData) {\n\t\t\t\t$this->smFoundNavigationDataForCurrentFolderMatch = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $returnData;\n\t\t}", "public function getMainNavigation(){\n\t\t$d = new Database();\n\t\t$d->open('hacker_blog');\n\t\t$sql = \"SELECT * FROM navigation \";\n\t\tif($this->type == 'private'){\n\t\t\t$sql .= \" WHERE public = 0 \";\n\t\t} else {\n\t\t\t$sql .= \" WHERE private = 1 \";\n\t\t}\n\t\t$s = $d->q($sql);\n\t\tif($s && $d->numrows() >= 1){\n\t\t\t$arr = array();\n\t\t\twhile($r = $d->mfa()){\n\t\t\t\t//print_r($r);\n\t\t\t\tarray_push($arr, $r);\n\t\t\t}\n\t\t\t$this->messages = array(\"success\"=>\"Found Navigation\");\n\t\t\t$this->current = $arr;\n\t\t\treturn $arr;\n\t\t\t$d->close();\n\t\t} else {\n\t\t\t$this->messages = array(\"error\"=>\"Could not Find Navigation\");\n\t\t\t$d->close();\n\t\t\treturn false;\n\t\t}\n\t}", "function ParseCurrentBlock()\n\t{\n\t\treturn $this->Parse($this->currentBlock);\n\t}", "public function getNavigation()\n {\n if ($this->_parentContainer instanceof NavigationInterface) {\n return $this->_parentContainer;\n } elseif ($this->_parentContainer instanceof Item) {\n return $this->_parentContainer->getNavigation();\n }\n\n return null;\n }", "public function systemAdminMenuBlockPage() {\n return $this->systemManager->getBlockContents();\n }", "public function navigationMenuGroup(): ?string\n {\n return $this->navigation->group;\n }", "public function getFolder()\n {\n if ($this->isExtension) {\n return $this->blockSlug;\n }\n $folder = $this->theme->getFolder() . '/blocks/archived/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n $folder = $this->theme->getFolder() . '/blocks/elements/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n $folder = $this->theme->getFolder() . '/blocks/php/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n return $this->theme->getFolder() . '/blocks/' . basename($this->blockSlug);\n }", "public function getNavigation($navigation_name = null);", "public function getNavigation()\n {\n }", "function shiftr_get_global_block_data( string $block = '' ) {\n $global_flexi_builder = get_field( 'flexi_blocks_builder-global', 'options' );\n $block_found = false;\n\n if ( ! empty( $global_flexi_builder ) ) {\n foreach ( $global_flexi_builder as $layout ) {\n\n if ( $layout['acf_fc_layout'] == $block ) {\n $block_found = $layout;\n unset( $layout['acf_fc_layout'] );\n }\n }\n }\n\n return $block_found;\n}", "public function getSection(){\n\t\t$section = array_shift($this->sections);\n\t\tif ( $section === null ) {\n\t\t\t$stack = $this->getStack();\n\t\t\tif ( !empty($stack) ) {\n\t\t\t\t$this->clearStack();\n\t\t\t\treturn $stack;\n\t\t\t}\n\t\t}\n\t\treturn $section;\n\t}", "public function MenuCurrentItem() {\n return $this->MainMenu()->find('Code', 'KapostAdmin');\n }", "function getParent()\n {\n return $this->collection->block ?? null;\n }", "public function getMenuOfLocation()\n {\n return $this->menuOfLocation;\n }", "public function getModuleNav()\n {\n return $this->module_nav;\n }", "public function getNavLocation()\n {\n return $this->nav_location;\n }", "private function getNavigationItem($url, $data) {\n\t\t$result = null;\n\t\t// First check if it is at this level, if so we have found the end condition, so return a single-value array\n\t\tforeach ($data as $item) {\n\t\t\tif (is_null($result) && trim($item['url'], '/') === $url) {\n\t\t\t\t$result = $item;\n\t\t\t}\n\t\t}\n\t\t// Now check through children of each item, and compose an array using the successful candidate and its index\n\t\tforeach ($data as $item) {\n\t\t\tif (is_null($result) && isset($item['children'])) {\n\t\t\t\t$result = $this->getNavigationItem($url, $item['children']);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getCurrentSection()\n\t{\n\t\treturn $this->_currentSection;\n\t}", "function getDisplayBlock() {\n\t\treturn $this->getData('displayBlock');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Injecting dependencies. This time we have typehinted our TwitterFeedReader to ensure that we can't pass strange dependencies into our constructor. THAT guy is foiled!
public function __construct(TwitterFeedReader $twitterFeedReader) { $this->twitterFeedReader = $twitterFeedReader; }
[ "public function testFeedReaderCanBeInstantiated()\n {\n $s = new TwitterFeedReader;\n }", "public function __construct()\n {\n $this->twitter = new TwitterRepo();\n }", "function __construct()\n {\n $this->twitter = new TwitterOAuth($this->consumer, $this->consumersecret, $this->accesstoken, $this->secrettoken);\n }", "public function __construct(FeedReaderInterface $feedReader)\n {\n $this->feedReader = $feedReader;\n }", "private function __construct()\n {\n $this->twitterService = TwitterService::getInstance();\n }", "public function __construct()\n {\n $this->annotationReader = new AnnotationReader();\n }", "public function __construct()\n {\n $this->CONSUMER_KEY = '';\n $this->CONSUMER_SECRET = '';\n\n $this->access_token = '';\n $this->access_token_secret = '';\n\n $this->connection = new TwitterOAuth($this->CONSUMER_KEY, $this->CONSUMER_SECRET, $this->access_token, $this->access_token_secret);\n }", "public function __construct(AnnotationReader $reader)\n\t{\n\t\t$this->reader = $reader;\n\t}", "public function testFeedReaderCanBeInstantiated()\n {\n $f = new FacebookFeedReader;\n }", "public function __construct()\n {\n // It is possible to use interface and inversion of control here to inject related repository.\n $this->subscriberRepository = new SubscriberRepository();\n $this->fieldRepository = new FieldRepository();\n }", "public function __construct()\n {\n parent::__construct();\n\n // add in the sources\n $this->repository = new GitHubUsersRepository(\n new GitHubUsersCache(),\n new GitHubUsersApi()\n );\n }", "public function __construct() {\n $this->twitterController = new TwitterController;\n\t}", "function __construct(){\n\n\t\t// oauth connection to Twitter API\n\t\t$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_ACCESS_TOKEN, OAUTH_ACCESS_TOKEN_SECRET);\n\n\t\t//URL of the twitter API with given hashtag Search\n\t\t$url = BASE_URL . '?q=' . urlencode( '#' . HASHTAG ) . '&result_type=recent&count='. COUNT;\n\n\t\t// Storing Response from the API\n\t\t$response = $connection->get($url);\n\n\t\t$this->twitter_response = $response;\n\n\t}", "protected function getAnnotations_ReaderService()\n {\n $this->services['annotations.reader'] = $instance = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\n\n $a = new \\Doctrine\\Common\\Annotations\\AnnotationRegistry();\n $a->registerLoader('class_exists');\n\n $instance->addGlobalIgnoredName('required', $a);\n\n return $instance;\n }", "public function __construct($oauth_access_token, $oauth_access_token_secret, $consumer_key, $consumer_secret, $user_id)\n {\n $this->_proxy = new TwitterProxy($oauth_access_token, $oauth_access_token_secret, $consumer_key, $consumer_secret, $user_id);\n }", "public function setupAnnotationsReader(AdapterInterface $adapter = null)\r\n {\r\n if (null == $adapter) {\r\n $this->annotationReader = new Memory();\r\n } else {\r\n $this->annotationReader = $adapter;\r\n }\r\n }", "public function __construct(BundleReaderInterface $reader)\r\n {\r\n $this->reader = $reader;\r\n }", "public function __construct()\n {\n $this->client = new TwitterAPIExchange([\n 'oauth_access_token' => getenv('TWITTER_OAUTH_ACCESS_TOKEN'),\n 'oauth_access_token_secret' => getenv('TWITTER_OAUTH_ACCESS_TOKEN_SECRET'),\n 'consumer_key' => getenv('TWITTER_CONSUMER_KEY'),\n 'consumer_secret' => getenv('TWITTER_CONSUMER_SECRET')\n ]);\n\n parent::__construct();\n }", "private function injectDependencies()\n {\n if (!method_exists($this, 'inject')) {\n return;\n }\n\n $container = Container::getInstance();\n\n $reflector = new \\ReflectionClass(static::class);\n $method = $reflector->getMethod('inject');\n $parameters = $method->getParameters();\n\n // make the required parameters\n $buildParams = [];\n foreach ($parameters as $parameter) {\n $buildParams[] = $container->make($parameter->getClass()->name);\n }\n\n\n call_user_func_array([$this, 'inject'], $buildParams);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the validation rule builders.
public function getBuilders(): array { return collect($this->rules)->map(function ($rules, string $actionMethod) { return $this->resolveRulesFor($actionMethod); })->all(); }
[ "public static function builders()\n {\n return self::$builders;\n }", "function getBuilders(): array\n {\n return $this->builders;\n }", "public function getBuilders()\r\n {\r\n foreach ($this->_builders as &$builder) {\r\n if (is_string($builder)) {\r\n $builder = new $builder;\r\n }\r\n }\r\n return $this->_builders;\r\n }", "public final function getValidators(): array\n {\n return $this->validations;\n }", "public function getRulesets();", "public function getValidators(): array\n {\n return $this->validators;\n }", "public function createValidators()\n {\n $validators = new \\ArrayObject();\n foreach ($this->rules() as $rule) {\n if ($rule instanceof Validator) {\n $validators->append($rule);\n } elseif (is_array($rule) && isset($rule[0], $rule[1])) { // attributes, validator type\n $validator = \\ozerich\\api\\validators\\base\\Validator::createValidator($rule[1], $this, (array)$rule[0], array_slice($rule, 2));\n $validators->append($validator);\n } else {\n throw new InvalidConfigException('Invalid validation rule: a rule must specify both attribute names and validator type.');\n }\n }\n\n return $validators;\n }", "public function getValidators() {\n return $this->validators;\n }", "public static function getValidators()\n {\n if (isset(static::$validators)) {\n return static::$validators;\n }\n\n // Set a series of validators to validate whether a route matches some criteria.\n return static::$validators = [\n new MethodValidator(),\n new HostValidator(),\n new UriValidator(),\n ];\n }", "public function createValidators()\r\n {\r\n $validators = new ArrayObject();\r\n\r\n foreach ($this->rules() as $rule) {\r\n if ($rule instanceof Validator) {\r\n $validators->append($rule);\r\n } elseif (is_array($rule) && isset($rule[0], $rule[1])) { // attributes, validator type\r\n $validator = ZValidator::createValidator($rule[1], $this, (array)$rule[0], array_slice($rule, 2));\r\n $validators->append($validator);\r\n } else {\r\n throw new InvalidConfigException('Invalid validation rule: a rule must specify both attribute name On and validator type.');\r\n }\r\n }\r\n\r\n return $validators;\r\n }", "protected function getBuilders() {\n $builders = $this->crud::builders();\n\n if ($this->option('only') && !empty($this->option('only'))) {\n $builders = array_intersect_key($builders, array_flip($this->option('only')));\n }\n\n $filesystem = resolve('Illuminate\\Filesystem\\Filesystem');\n\n $this->builders = collect($builders)->map(function($class) use(&$filesystem) {\n return new $class($filesystem, $this->crud);\n });\n }", "public static function getValidators()\n {\n if (isset(static::$validators)) {\n return static::$validators;\n }\n\n // To match the route, we will use a chain of responsibility pattern with the\n // validator implementations. We will spin through each one making sure it\n // passes and then we will know if the route as a whole matches request.\n return static::$validators = [\n new UriValidator(),\n new MethodValidator(),\n new SchemeValidator(),\n new HostValidator()\n ];\n }", "public function build_ruleset() {\n\t\treturn new \\PHPixie\\Validate\\Ruleset();\n\t}", "public function getValidatorsThatBreakTheChain()\n {\n return $this->validatorsThatBreakTheChain;\n }", "public static function getValidators()\n\t{\n\t\tif (isset(static::$validators)) {\n\t\t\treturn static::$validators;\n\t\t}\n\n\t\t// To match the route, we will use a chain of responsibility pattern with the\n\t\t// validator implementations. We will spin through each one making sure it\n\t\t// passes and then we will know if the route as a whole matches request.\n\t\treturn static::$validators = [\n\t\t\tnew CaptureProtocolValidator, new RemoteIpValidator,\n\t\t\tnew ServerPortValidator, new ServerProtocolValidator,\n\t\t\tnew RawValidator, new RegexValidator,\n\t\t\tnew CallableValidator\n\t\t];\n\t}", "public function getValidators()\n {\n $adapter = $this->getTransferAdapter();\n $validators = $adapter->getValidators($this->getName());\n if ($validators === null) {\n $validators = array();\n }\n\n return $validators;\n }", "public function getBuilderFactory()\n {\n return $this->builder_factory;\n }", "public function getValidators(){\n return $this->_comparison_list;\n }", "public static function getValidators()\n\t{\n\t\tif ( isset( static::$validators ) )\n\t\t\treturn static::$validators;\n\n\t\t// To match the route, we will use a chain of responsibility pattern with the\n\t\t// validator implementations. We will spin through each one making sure it\n\t\t// passes and then we will know if the route as a whole matches request.\n\t\treturn static::$validators = [\n\t\t\tnew MethodValidator,\n\t\t\tnew SchemeValidator,\n\t\t\tnew HostValidator,\n\t\t\tnew UriValidator,\n\t\t];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation gETCarrierAccountsAsync List all carrier accounts
public function gETCarrierAccountsAsync() { return $this->gETCarrierAccountsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; } ); }
[ "public function gETCarrierAccounts()\n {\n $this->gETCarrierAccountsWithHttpInfo();\n }", "public function listAccounts()\n {\n return $this->apiRequest('system.listaccounts');\n }", "public function listAllAccounts(){\r\n return $this->identityGateway->listAllAccounts();\r\n }", "public function listAllAccounts(){\n return $this->identityGateway->listAllAccounts();\n }", "public function listAccounts()\n {\n return $this->execute('listaccts', []);\n }", "public function listAccountsReturncarrier($accountId, $optParams = array())\n {\n $params = array('accountId' => $accountId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_ShoppingContent_ListAccountReturnCarrierResponse\");\n }", "public function listAccountsReturncarrier($accountId, $optParams = [])\n {\n $params = ['accountId' => $accountId];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], ListAccountReturnCarrierResponse::class);\n }", "public function pOSTCarrierAccountsAsync($carrier_account_create)\n {\n return $this->pOSTCarrierAccountsAsyncWithHttpInfo($carrier_account_create)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getAccountIdentitiesAsync()\n {\n return $this->getAccountIdentitiesAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function listOptionsAccountAsync()\n {\n return $this->listOptionsAccountAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function listDeliveryAccountsAsync($settle)\n {\n return $this->listDeliveryAccountsAsyncWithHttpInfo($settle)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function carriers(){\r\n return $this->entityManager->getRepository('BackOfficeBundle:Carrier')->findAll();\r\n }", "public function getContactAccounts() {\n $this->contain();\n return $this->findAllByIsContact(1);\n }", "public function getAllAccounts()\n\t\t{\n\n\t\t\treturn $this->getTable()->get();\n\t\t}", "public function listAccounts();", "public function meGetCollateralAccounts();", "public function testAll()\n {\n VCR::insertCassette('carrier_accounts/all.yml');\n\n $carrierAccounts = CarrierAccount::all();\n\n $this->assertContainsOnlyInstancesOf('\\EasyPost\\CarrierAccount', $carrierAccounts);\n }", "public function getAccounts()\n {\n return $this->request('GET', 'account');\n }", "public function listCoinbaseAccounts(): array;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
two uses to this script: 1. load cities into cities table (done only once). (will be done when loadToDB==1) 2. (primary usage) search venues data using the API. (when requestData==1). returns something og the form array(boolean, "error message")
function addNewCity($foursquare,$cityName, // cityName - no underscore $jsonsDir,$venuesDir,$splitNum,$categotyId,$loadToDB,$requestData,$conn){ // google API part $googleApiKey = "AIzaSyDutGO-yGZstF2N3IjGOUv8kWYWi9aGGGk"; $boundingBox = $foursquare->getBoundingBox($cityName,$googleApiKey); // null when we have problem in requesting google api if($boundingBox === null){ return array(false,"Something went wrong... Please try again."); // error } if($boundingBox === 0){ return array(false,"City wasn't found. Try a different city."); // error } if(!inUSA($boundingBox)){ return array(false,"This city is not in the USA"); // error } if(cityAlreadyInTableBB($conn,$boundingBox)){ return array(false,"We already have this city"); // error (kind of) } $titleToIndex = array('cityId'=>0,'cityName'=>1,'north_lat'=>2,'south_lat'=>3, 'east_lon'=>4,'west_lon'=>5); $cityArr = array_fill(0,sizeof($titleToIndex),''); $cityArr[$titleToIndex['cityName']] = $cityName; $cityArr[$titleToIndex['north_lat']] = $boundingBox['north_lat']; $cityArr[$titleToIndex['south_lat']] = $boundingBox['south_lat']; $cityArr[$titleToIndex['east_lon']] = $boundingBox['east_lon']; $cityArr[$titleToIndex['west_lon']] = $boundingBox['west_lon']; // put city in DB: cityId,cityName,boundingBox-details //(only one time - controlled by flag $loadToDB) if ($loadToDB){ addEntryToCityTable($conn, $cityArr, $titleToIndex); } if(!$requestData) return array(true,''); // when already have the data //assume city already exists in db //now do the api requsts $requestType = "venues/search"; $cityNameDir = str_replace(' ','_',$cityName).'/'; $outputDir = $jsonsDir.$venuesDir.$cityNameDir; if(!in_array(str_replace('/','',$cityNameDir),scanDir($jsonsDir.$venuesDir))) mkdir($outputDir); $requestsNum = requestCityFunc($foursquare,$cityName,$boundingBox,$requestType,$categotyId,$outputDir,$splitNum); // not enough results for the city if($requestsNum<=$splitNum) return array(false,"Requesting restaurants has failed. Please try again."); // error return array(true,''); }
[ "function discoverWorldcitiesAvailable()\n{\n global $dbConn;\n $params = array();\n $query = \"SELECT C.id as cityid,C.country_code, C.state_code, C.name, C.latitude, C.longitude, CO.name AS country_name, ST.state_name FROM webgeocities AS C INNER JOIN cms_countries AS CO ON C.country_code=CO.code LEFT JOIN states AS ST ON C.country_code=ST.country_code AND C.state_code=ST.state_code WHERE C.order_display>=2 ORDER BY C.name ASC\";\n\n $select = $dbConn->prepare($query);\n\n $res = $select->execute();\n\n $ret = $select->rowCount();\n if (!$res || ($ret == 0)) {\n return false;\n } else {\n $ret_arr = $select->fetchAll();\n\n return $ret_arr;\n }\n}", "public function loadCities()\n {\n $this->db->dropCollection($this->collection);\n $this->db->createIndex($this->collection, 'region_id', ['unique' => true]);\n\n $this->loadClient();\n $regionIDList = $this->client->getRegionIDList();\n\n foreach($regionIDList as $regionID) {\n\n if($name = $this->client->getCityName($regionID)) {\n $this->loadFromArray(['regionId' => $regionID, 'name' => $name]);\n $this->save();\n }\n\n if($count = $this->client->getCityOfferCount($regionID)) {\n $this->offerCount->loadFromArray(['regionId' => $regionID, 'count' => $count]);\n $this->offerCount->save();\n }\n\n }\n }", "function get_data_ville_by_name($city) {\n\tglobal $CONFIG, $DATA_VILLE_CACHE;\n\n\t$city = preg_replace('#^st #', 'saint ', $city);\n\t$city = preg_replace('#(^le |^la |^les |l\\' )#', '', $city);\n\t$city = str_replace(' ', '-', trim($city));\n\t$city = sanitise_string($city);\n\n\tif ($city == \"\") {\n\t\treturn false;\n\t}\n\n/*\tif (isset($DATA_VILLE_CACHE[$city])) {\n\t\treturn $DATA_VILLE_CACHE[$city];\n\t}*/\n\n\t$result = get_data(\"SELECT * FROM villes_data vd\n\t\t\t\t\t\t\tJOIN regions_data rd ON rd.region=vd.region\n\t\t\t\t\t\t\tJOIN departements_data dd ON dd.dep=vd.dep\n\t\t\t\t\t\t\tWHERE ville='$city'\");\n\n\tif ($result) {\n\t/*\tif (!$DATA_VILLE_CACHE) {\n\t\t\t$DATA_VILLE_CACHE = array();\n\t\t}\n\n\t\t$DATA_VILLE_CACHE[$city] = $result;*/\n\t\treturn $result;\n\t}\n\n\treturn false;\n}", "public function searchCity() { \n \tcheck_ajax_referer( 'wrapido-nonce','nonce' ); \n \t$results = [];\n \t\n \t$term = sanitize_text_field( $_GET['term'] );\n\n \t$db = Wrapido_DB::get_instance();\n \t$cities = $db->searchCity($term);\n \t\n \tforeach ($cities as $city) {\n \t\t$results[] = [ 'id' => $city['id'], 'value' => $city['name'], 'postcode' => $city['postcode'] ];\n \t}\n \t\n \techo json_encode( $results );\n \tdie(); \n }", "public function getCities() {\r\n\t\t\r\n\t\t$url = $this->_buildURL('cities');\r\n\t\treturn $this->_call($url);\r\n\t}", "function get_cities() {\n\t\t$state = $_GET['state'];\n\t\t$id = WCIS_Data::get_province_id($state);\n\t\t$cities = WCIS_Data::get_cities($id);\n\t echo json_encode($cities);\n\n\t\twp_die();\n\t}", "protected function getCities(): void\n {\n $response = Http::post('https://api.novaposhta.ua/v2.0/json/', [\n \"modelName\" => \"Address\",\n \"calledMethod\" => \"getCities\",\n ]);\n\n Storage::put(\n 'nova-poshta/cities.json',\n collect($response->json()['data'])->toJson()\n );\n }", "function getAllCities($connection) {\n $sql = getCitiesSQL();\n $rows = array();\n try {\n $result = runQuery($connection, $sql, null);\n \n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n $rows[] = $row;\n }\n return json_encode($rows);\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n } \n}", "function get_city_id($city){\n $url = LOCATION_CITY_URL . ACCU_WEATHER_KEY;\n $query = '&q=' . $city;\n\n $results = file_get_contents($url . $query);\n $results = json_decode($results, true);\n\n if(!is_null($results)) {\n foreach ($results as $result) {\n if (strcmp($result['Country']['ID'], 'US') == 0) {\n $local_name = $result['LocalizedName'];\n $key = $result['Key'];\n $state = $result['AdministrativeArea']['ID'];\n $geo = array('lat' => $result['GeoPosition']['Latitude'],\n 'lon' => $result['GeoPosition']['Longitude']);\n break;\n }\n }\n $city_object = array(\n 'localname' => $local_name,\n 'key' => $key,\n 'postal' => 0,\n 'state' => $state,\n 'geo' => $geo\n );\n return $city_object;\n }\n return false;\n}", "public function getNorthWestCities(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, m.municipality_id,\n\t\t\t\t\t\t p.province_id, p.province_name \n\t\t\t\t\t\t FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t LEFT JOIN provinces p\n\t\t\t\t\t\t ON m.province_id = p.province_id\n\t\t\t\t\t\t WHERE p.province_id = '8'\n\t\t\t\t\t\t ORDER BY city_name ASC\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create province object\n\t\t\t\t\t\t$province = new Province();\n\t\t\t\t\t\t$province->setProvinceID($row['province_id']);\n\t\t\t\t\t\t$province->setProvinceName($row['province_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setProvince($province);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\n\t\t\t\t\t\tarray_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public static function getCities() {\n $c_url = ExploreModel::generateApiUrl('explore', array('token'=>Session::get('user_token')));\n $result = ExploreModel::getResult($c_url, 'get');\n\n $return = array();\n if ( $result['status'] ) {\n //reconstructs object \n foreach ( $result['output'] AS $city ) {\n $return[ $city['city_id'] ] = $city['name'];\n }\n }\n\n return $return;\n }", "public function ajaxLoadCityByIndustry(){\n global $product_api;\n $response = [\n 'status' => 400,\n 'msg' => \"Data Not found!\",\n 'data' => '<option>All</option>'\n ];\n $industryID = get_option('wpsa_industry_id', 4);\n $industryID = isset($_POST['Industry']) && !empty($_POST['Industry']) ? $_POST['Industry'] : $industryID;\n $cities = $product_api->post('GetCities/JSON', ['id'=>$industryID]);\n if( $cities->StatusCode == 200 && count( $cities->Content ) ){\n $response = [\n 'status' => 200,\n 'msg' => \"Load data successful!\"\n ];\n $data = '<option>All</option>';\n foreach ($cities->Content as $city) {\n $data .= '<option value=\"'. $city->Id .'\">'. $city->LocationItemName .'</option>';\n }\n $response['data'] = $data;\n }else{\n $response = [\n 'status' => $cities->StatusCode,\n 'msg' => $cities->Error\n ];\n }\n echo json_encode($response);\n die();\n }", "public function city()\n {\n\t\t $this->_first_checks();\n\n $postcode = Router::getVariable('postcode');\n\t\t// $city = tosearch(Router::getVariable('city'));\n\t\t $cities = mexplode(array('+','$'),tosearch(Router::getVariable('city')));\n\n\t\t if ($postcode !== null) {\n \t$query = \"SELECT city, postcode, department FROM cities WHERE postcode = '$postcode';\";\n\t\t } else\n\n\t\t if ($cities !== null) {\n \t$query = \"SELECT city, postcode, department FROM cities\";\n\n\t\t\tforeach($cities as $city) {\n\t\t\t\tif ($city['separator'] == 'first') {\n\t\t\t\t\t$query .= \" WHERE cities.search_city\";\n\t\t\t\t} else \n\t\t\t\tif ($city['separator'] == '+') {\n\t\t\t\t\t$query .= \" OR cities.search_city\";\n\t\t\t\t} else {\n\t\t\t\t\t$query .= \" AND cities.search_city\";\n\t\t\t\t} // if\n\n\t\t\t\tif ($city['operator'] == 'equal') {\n\t\t\t\t\t$query .= \" =\";\n\t\t\t\t\t$query .= \" '$city[name]'\";\n\t\t\t\t} else {\n\t\t\t\t\t$query .= \" LIKE\";\n\t\t\t\t\t$query .= \" '%$city[name]%'\";\n\t\t\t\t}\n\t\t\t} // foreach\n\t\t\t$query .= \" LIMIT 0,12;\";\n\t\t }\n\t\t \n\t\t $this->_execute_query($query);\n }", "public function getArrayAlleCities(){\n\t\t$cities = array();\n\t\t$db = $this->createConnection(); //uit abstractdao.php\n\t\t$result = $db->query(\"select * from cities\");\n\t\tif($result){ \n\t\t\t$aantalrecords=$result->num_rows;\n\t\t\t$aantalVelden=$result->field_count;\n\t\t\t//echo \"$aantalrecords\";\n\t\t\twhile ($row = $result->fetch_array()){\n\t\t\t\t//airport object\n\t\t\t\t//$geo_name_id,$latitude,$longitude\n\t\t\t\t$city = new City($row[\"geo_name_id\"],$row[\"latitude\"],$row[\"longitude\"]);\n\t\t\t\t//toevoegen aan het array\n\t\t\t\tarray_push($cities,$city);\t\t\n\t\t\t}\n\t\t\t$result->close();\n\t\t}\n\t\t$db->close();\n\t\treturn $cities;\n\t}", "function getVenues(){\n $data = array();\n\n try {\n if ($stmt = $this->conn->prepare('SELECT * FROM venue ORDER BY name')){\n //Executing \n $stmt->execute();\n\n //Retrieving data\n while ($row = $stmt->fetch()){\n $data[] = $row;\n }\n }\n return $data;\n\n } catch (PDOException $e) {\n //can log message\n echo $e->getMessage();\n return array();\n }\n }", "function getAllStateAndCity()\n{\n global $dbhandler0;\n\n //===============================================\n //start query\n $sqlcheck = \"SELECT b.va_state_name,a.va_city_name,a.i_state_id,a.i_city_id \n FROM city a \n left join state b on a.i_state_id = b.i_state_id \n order by a.va_city_name\";\n //===============================================\n\n $res = $dbhandler0->query($sqlcheck);\n return ($res);\n}", "function fn_get_store_location_cities(array $params = [])\n{\n $condition = [\n 'lang_code' => db_quote('descriptions.lang_code = ?s', isset($params['lang_code'])\n ? $params['lang_code']\n : CART_LANGUAGE),\n ];\n\n if (!empty($params['status'])) {\n $condition['status'] = db_quote('?:store_locations.status = ?s', $params['status']);\n }\n\n if (!empty($params['company_id'])) {\n $condition['company_id'] = db_quote('?:store_locations.company_id IN (?n)', $params['company_id']);\n }\n\n $cities = db_get_fields(\n 'SELECT DISTINCT(descriptions.city) FROM ?:store_locations LEFT JOIN ?:store_location_descriptions AS descriptions ON ?:store_locations.store_location_id = descriptions.store_location_id WHERE ?p',\n implode(' AND ', $condition)\n );\n\n return $cities;\n}", "public function searchUserNearbyCity($city) {\n $users = array();\n $db = MySQLDatabase::getInstance();\n\n $query = \"SELECT distinct(u.user_id) AS 'user_id' \";\n $query.=\"FROM practice_user pu \";\n $query.=\"LEFT JOIN user u ON pu.user_id = u.user_id \";\n $query.=\"LEFT JOIN practice p ON p.practice_id = pu.practice_id \";\n\t$query.=\"LEFT JOIN address a ON p.address_id = a.address_id \";\n $query.=\"LEFT JOIN city c ON c.id = a.city_id \";\n $query.=\"WHERE c.alpha = ? OR c.code = ? \";\n\n $records = $db->getRecords($query, array($city, $city));\n $userIds = array();\n\n if (!is_null($records)) {\n foreach ($records as $record) {\n if(!is_null($record['user_id'])) array_push($userIds, (int) $record['user_id']);\n }\n }\n\n //If we find less then 10 users we will look in the nearby cities\n if (count($userIds) <= 10) {\n $query = \"SELECT longitude,latitude FROM city WHERE alpha = ? OR code = ? \";\n $record = $db->getRecord($query, array($city, $city));\n $longitude = $record['longitude'];\n $latitude = $record['latitude'];\n $longitudeLow = $longitude - 0.2;\n $longitudeHigh = $longitude + 0.2;\n $latitudeLow = $latitude - 0.2;\n $latitudeHigh = $latitude + 0.2;\n\n $extraCities = array();\n $query = \"SELECT alpha FROM city WHERE longitude BETWEEN $longitudeLow AND $longitudeHigh AND latitude BETWEEN $latitudeLow AND $latitudeHigh \";\n\n $records = $db->getRecords($query);\n if ($records != null) {\n foreach ($records as $record) {\n array_push($extraCities, $record['alpha']);\n }\n }\n\n\t $query = \"SELECT distinct(u.user_id) AS 'user_id' \";\n\t $query.=\"FROM practice_user pu \";\n\t $query.=\"LEFT JOIN user u ON pu.user_id = u.user_id \";\n\t $query.=\"LEFT JOIN practice p ON p.practice_id = pu.practice_id \";\n\t $query.=\"LEFT JOIN address a ON p.address_id = a.address_id \";\n\t $query.=\"LEFT JOIN city c ON c.id = a.city_id \";\n\t $query.=\"WHERE c.alpha IN ('\". implode('\\', \\'', $extraCities). \"') \";\n\n\t $records = $db->getRecords($query);\n\n\t if ($records != null) {\n\t\tforeach ($records as $record) {\n\t\t if(!is_null($record['user_id'])) array_push($userIds, (int) $record['user_id']);\n\t\t}\n\t }\n }\n\n\t// remove duplicates\n $userIds = $this->removeDuplicatesFromArray($userIds);\n\n return $this->loadMultiple($userIds);\n }", "function requestCityFunc($foursquare,$cityName,$boundingBox,$requestType,$categoryId,$outputDir,$splitNum){\n\t$requestsNum = 0;\n\t$outputDirArr = array_flip(scanDir($outputDir));\n\n\t// splitting the city to few rectangles\n\tlist($bbMat,$deltaNS,$deltaEW) = getBoundingBoxMat($boundingBox,$splitNum);\n\n\tforeach($bbMat as $lat=>$latArr){\t\n\t\tforeach($latArr as $lon=>$stam){\n\t\t\t$ne = formatCoodrdinates($lat).','.formatCoodrdinates($lon);\n\t\t\t$sw = formatCoodrdinates($lat-$deltaNS).','.formatCoodrdinates($lon-$deltaEW);\n\t\t\t\n\t\t\t// Prepare parameters\n\t\t\t$params = array(\"sw\"=>\"$sw\",\n\t\t\t\t\t\t\t\"ne\"=>\"$ne\",\n\t\t\t\t\t\t\t\"categoryId\"=>$categoryId, // food category\n\t\t\t\t\t\t\t\"intent\"=>\"browse\");\n\t\t\t// build fileName\n\t\t\t$nameParams = $params;\n\t\t\tarray_unshift($nameParams,$cityName);\n\t\t\t$fileName = createFileNameByParams($nameParams);\n\t\t\t\n\t\t\t// request api only if not exists\n\t\t\tif(!array_key_exists($fileName,$outputDirArr)){\n\t\t\t\t$isGoodResponse = getAndSaveJSON($foursquare,$requestType,$params,$fileName,$outputDir);\n\t\t\t\tif($isGoodResponse)\n\t\t\t\t\t$requestsNum++;\n\t\t\t}else{\n\t\t\t\t$requestsNum++; // as if a request succeeded\n\t\t\t}\n\t\t}\n\t}\n\treturn $requestsNum;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Doctors data API accepts four parameters doctor_id : doctor id which user will select API will return following parameters doctors details all doctors related details address address from previously booked camps for which same doctor was assigned message message relevant to api response status SUCCESS / FALSE $user_id = '116';
public function doctor_data(){ $response_data = ''; $address = ''; $user_id = $this->input->post('doctor_id'); $doctors_data = $this->db->query("SELECT * FROM doctors WHERE doctors.id = '".$user_id."'"); if ($doctors_data->num_rows() > 0) { $address_data = $this->db->query("SELECT * FROM camp_clinic_booking WHERE id = '".$doctors_data->result()[0]->id."' ORDER BY id LIMIT 1"); if ($address_data->num_rows() > 0) { $address = $address_data->result()[0]->address; } $response_data = array('message' => 'SUCCESS', 'status' => 'SUCCESS', 'doctors_data' => $doctors_data->result(), 'address' => $address); } else { $response_data = array('message' => 'Doctor Selection Invalid', 'status' => 'failed'); } $this->response($response_data); }
[ "public function get_doctor_detail($doctor_id) {\n $doctor_query = \"\n SELECT\n user_id,\n user_first_name,\n user_last_name,\n user_photo,\n user_photo_filepath,\n user_status,\n user_phone_number,\n user_email,\n user_gender,\n user_phone_verified,\n user_email_verified,\n doctor_detail_year_of_experience, \n doctor_detail_language_id, \n doctor_detail_speciality,\n address_name,\n address_name_one,\n address_city_id,\n address_state_id,\n address_country_id,\n address_pincode,\n address_latitude,\n address_longitude,\n address_locality,\n auth_phone_number as user_updated_email,\n doctor_detail_is_term_accepted,\n doctor_detail_term_accepted_date\n FROM \n \" . TBL_USERS . \" \n LEFT JOIN \n \" . TBL_DOCTOR_DETAILS . \" \n ON \n doctor_detail_doctor_id=user_id AND \n doctor_detail_status=1 \n LEFT JOIN\n \" . TBL_USER_AUTH . \" \n ON \n user_id = auth_user_id AND auth_type = 1\n LEFT JOIN \n \" . TBL_ADDRESS . \" \n ON \n address_user_id=user_id AND address_type=1\n \";\n $doctor_query.=\"\n WHERE\n user_id='\" . $doctor_id . \"' \n GROUP BY\n user_id \n \";\n\n $doctor_data = $this->get_single_row_by_query($doctor_query);\n return $doctor_data;\n }", "public function get_doctor_patient_detail($requested_data) {\n\n $columns = \"user_id, \n user_first_name,\n user_last_name,\n CONCAT(user_first_name,' ',user_last_name) AS user_name,\n user_photo_filepath,\n user_unique_id,\n user_details_dob,\n user_details_weight,\n user_details_height,\n user_details_smoking_habbit,\n user_details_alcohol,\n appointment_type,\n GROUP_CONCAT(clinical_notes_reports_appointment_id) as kco_appointment_id,\n GROUP_CONCAT(clinical_notes_reports_doctor_user_id) as kco_doctor_id,\n GROUP_CONCAT(clinical_notes_reports_kco) as kco,\n GROUP_CONCAT(clinical_notes_reports_clinic_id) as clinic_id\n \";\n\n $get_patient_detail_query = \" SELECT \" . $columns . \" \n FROM \n \" . TBL_USERS . \" \n LEFT JOIN\n \" . TBL_USER_DETAILS . \" ON user_id = user_details_user_id\n LEFT JOIN \n \" . TBL_APPOINTMENTS . \" ON user_id = appointment_user_id\n LEFT JOIN\n \" . TBL_CLINICAL_NOTES_REPORT . \" ON clinical_notes_reports_user_id = user_id AND clinical_notes_reports_status = 1\n WHERE \n appointment_id = '\" . $requested_data['appointment_id'] . \"' \n AND \n appointment_user_id = '\" . $requested_data['patient_id'] . \"'\n AND\n appointment_clinic_id = '\" . $requested_data['clinic_id'] . \"' \n AND\n appointment_doctor_user_id = '\" . $requested_data['doctor_id'] . \"' \n AND \n appointment_status != 9 \";\n\n $get_patient_data = $this->get_single_row_by_query($get_patient_detail_query);\n\n return $get_patient_data;\n }", "public function get_doctor_list_post() {\n $clinic_id = !empty($this->post_data['clinic_id']) ? trim($this->Common_model->escape_data($this->post_data['clinic_id'])) : \"\";\n if (empty($clinic_id)) {\n $this->bad_request();\n }\n $requested_data = array(\n 'clinic_id' => $clinic_id,\n 'doctor_clinic_mapping_role_id' => 1\n );\n $get_doctor_list = $this->doctor->get_doctor_list($requested_data);\n\t\t\n if (!empty($get_doctor_list)) {\n $this->my_response = array(\n \"status\" => true,\n \"message\" => lang(\"common_detail_found\"),\n \"data\" => $get_doctor_list,\n );\n } else {\n $this->my_response = array(\n \"status\" => true,\n \"message\" => lang(\"common_detail_not_found\"),\n );\n }\n $this->send_response();\n }", "public function matchingDoctor(){\n $userId = $this->getUserId();\n $doctorId = $this->matchDoctor();\n $userName = $this->getUserName($userId);\n $doctorName = $this->getUserName($doctorId);\n $isFriend = $this->relation->isFriend($userId, $doctorId);\n\n $idList['user_id'] = $userId;\n $idList['doctor_id'] = $doctorId;\n\n if (count($isFriend) == 0) {\n $relation = array(\n 'user_id' => $userId,\n 'user_name' => $userName,\n 'friend_id' => $doctorId,\n 'friend_name' => $doctorName\n );\n $this->relation->createRelation($relation);\n $relation = array(\n 'user_id' => $doctorId,\n 'user_name' => $doctorName,\n 'friend_id' => $userId,\n 'friend_name' => $userName\n );\n $this->relation->createRelation($relation);\n }\n redirect('chat/haveChat/'.$userId.'/'.$doctorId);\n }", "public function getDoctorClinics($doctor_id)\n {\n $doctor_user = self::getUserById($doctor_id);\n if (!$doctor_user) {\n return false;\n }\n $doctor_account = self::getAccountById($doctor_user->account_id);\n if (!$doctor_account) {\n return false;\n }\n try {\n if ($doctor_account->type == ApiController::ACCOUNT_TYPE_POLY) {\n $get_doctor_clinics = Clinic::join('users', 'clinics.account_id', 'users.account_id')\n ->join('accounts', 'clinics.account_id', 'accounts.id')\n ->join('specialities', 'clinics.speciality_id', 'specialities.id')\n ->where('accounts.type', ApiController::ACCOUNT_TYPE_POLY)\n ->where('users.id', $doctor_id)\n ->where('users.role_id', ApiController::ROLE_DOCTOR)\n ->select('clinics.id',\n 'clinics.fees',\n 'clinics.premium_fees',\n 'accounts.type as account_type',\n 'specialities.' . app()->getLocale() . '_speciality as speciality',\n 'clinics.' . app()->getLocale() . '_name',\n DB::raw('CONCAT(clinics.' . app()->getLocale() . '_name,\" \", \"(\" ,\" \",specialities.' . app()->getLocale() . '_speciality,\" \", \")\") AS name'),\n 'clinics.pattern'\n )\n ->get()->reject(function ($value, $key) {\n // remove the days with no working hours\n $clinic = json_decode($value);\n return ($clinic->working_hours_start_end) == '';\n })->values();\n } else {\n\n $get_doctor_clinics = Clinic::join('users', 'clinics.account_id', 'users.account_id')\n ->join('provinces', 'provinces.id', 'clinics.province_id')\n ->join('accounts', 'accounts.id', 'clinics.account_id')\n ->join('doctor_details', 'doctor_details.account_id', 'accounts.id')\n ->join('specialities', 'doctor_details.speciality_id', 'specialities.id')\n ->where('accounts.type', ApiController::ACCOUNT_TYPE_SINGLE)\n ->where('users.id', $doctor_id)\n ->where('users.role_id', ApiController::ROLE_DOCTOR)\n ->select('clinics.id',\n 'clinics.fees',\n 'clinics.premium_fees',\n 'clinics.lat',\n 'clinics.lng',\n 'accounts.type as account_type', 'specialities.' . app()->getLocale() . '_speciality as speciality',\n 'clinics.pattern',\n 'provinces.' . app()->getLocale() . '_name as province_name',\n DB::raw('clinics.' . app()->getLocale() . '_address as name')\n )\n ->get()->reject(function ($value, $key) {\n // remove the days with no working hours\n $clinic = json_decode($value);\n if (($clinic->working_hours_start_end) == '') {\n return true;\n }\n return false;\n })->values();\n }\n } catch (\\Exception $e) {\n return ApiController::catchExceptions($e->getMessage());\n }\n return $get_doctor_clinics;\n }", "public static function get_doctor_details($id){\n try{\n $dbo = myPDO::get_dbcon();\n $pstmt = $dbo->prepare(\"SELECT * FROM `mms_doctors` \"\n .\"WHERE `DoctorID`=:id\");\n $pstmt->bindValue(\":id\", $id);\n $result = $pstmt->fetch();\n if ($result){\n return $result;\n }\n else{\n return FALSE;\n }\n }\n catch(PDOException $e){\n echo $e->getTraceAsString();\n }\n }", "public function setDoctor_id($doctor_id)\r\r\n {\r\r\n $this->doctor_id = $doctor_id;\r\r\n\r\r\n return $this;\r\r\n }", "function get_doors($user,$pass,$id){\n\tglobal $config;\n\t$response=send_request($config->api_fullpath.\"zone/$id/door\",$user,$pass);\n\tif($response->response_status != \"200\") return false;\n\telse {\n\t\tfor($i=0;$i<count($response->data);$i++){\n\t\t\tif(!isset($response->data[$i]->name)) {\n\t\t\t\t$response->data[$i]->name = $response->data[$i]->description;\n\t\t\t}\n\t\t}\n\t\treturn $response->data;\n\t}\n}", "public function getDoctor_id()\r\r\n {\r\r\n return $this->doctor_id;\r\r\n }", "protected function build_person_data($user_id)\n {\n }", "public function get_doctor_avialability_post() {\n try {\n $clinic_id = !empty($this->post_data['clinic_id']) ? $this->Common_model->escape_data($this->post_data['clinic_id']) : '';\n $clinic_id_arr = !empty($this->post_data['clinic_id_arr']) ? $this->post_data['clinic_id_arr'] : '';\n $doctor_id = !empty($this->post_data['doctor_id']) ? $this->Common_model->escape_data($this->post_data['doctor_id']) : '';\n\n if (empty($doctor_id) ||\n empty($clinic_id)\n ) {\n $this->bad_request();\n }\n $this->load->model('Clinic_model', 'clinic');\n $get_role_details = $this->Common_model->get_the_role($this->user_id);\n if (!empty($get_role_details['user_role_data'])) {\n $permission_data = array(\n 'role_data' => $get_role_details['user_role_data'],\n 'module' => 13,\n 'key' => 3\n );\n $check_module_permission = $this->check_module_permission($permission_data);\n if ($check_module_permission == 2) {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang('permission_error');\n $this->send_response();\n }\n }\n\t\t\t\n /*$clinic_columns = \"clinic_availability_id, \n clinic_availability_clinic_id, \n clinic_availability_week_day, \n clinic_availability_session_1_start_time, \n clinic_availability_session_1_end_time, \n clinic_availability_session_2_start_time, \n clinic_availability_session_2_end_time, \n clinic_availability_created_at, \n clinic_availability_status \";\n\n $clinic_where_availability = array(\n 'clinic_availability_clinic_id' => $clinic_id,\n 'clinic_availability_status !=' => 9\n );*/\n $get_clinic_availability_list = $this->clinic->get_clinic_availability($clinic_id_arr);\n $get_clinic_availability = [];\n foreach ($get_clinic_availability_list as $key => $value) {\n $get_clinic_availability[$value['clinic_availability_clinic_id']][] = $value;\n }\n // $get_clinic_availability = $this->Common_model->get_all_rows(TBL_CLINIC_AVAILABILITY, $clinic_columns, $clinic_where_availability);\n\n /*$columns = \"doctor_availability_id, \n doctor_availability_clinic_id, \n doctor_availability_user_id, \n doctor_availability_week_day, \n doctor_availability_appointment_type,\n doctor_availability_session_1_start_time,\n doctor_availability_session_1_end_time, \n doctor_availability_session_2_start_time, \n doctor_availability_session_2_end_time,\n doctor_availability_status\";\n\n\n $where_availability = array(\n 'doctor_availability_clinic_id' => $clinic_id,\n 'doctor_availability_user_id' => $doctor_id,\n 'doctor_availability_status !=' => 9\n );\n\n $get_doctor_availability = $this->Common_model->get_all_rows(TBL_DOCTOR_AVAILABILITY, $columns, $where_availability);*/\n $get_doctor_availability = $this->clinic->get_doctor_availability($clinic_id_arr, $doctor_id);\n $send_availability = array();\n\n if (!empty($get_doctor_availability)) {\n\n $appointment_type = array(1);\n $alreay_appointment_type = array();\n\n foreach ($get_doctor_availability as $availability) {\n $send_availability[$availability['doctor_availability_appointment_type']][] = $availability;\n }\n\n $final_array = array();\n $index = 0;\n foreach ($send_availability as $key => $data) {\n $alreay_appointment_type[] = $key;\n $final_array[$index]['doctor_availability_appointment_type'] = $key;\n $final_array[$index]['data'] = $data;\n $index++;\n }\n\n $appointment_type_difference = array_diff($appointment_type, $alreay_appointment_type);\n foreach ($appointment_type_difference as $key => $data) {\n $final_array[$index]['doctor_availability_appointment_type'] = $data;\n $final_array[$index]['data'] = array();\n $index++;\n }\n\n $final_array = msort($final_array, 'doctor_availability_appointment_type');\n $doctor_availability_arr = [];\n foreach ($final_array as $key => $availability) {\n $doctor_availability_arr[$key]['doctor_availability_appointment_type'] = $availability['doctor_availability_appointment_type'];\n foreach ($availability['data'] as $value) {\n $doctor_availability_arr[$key]['data'][$value['doctor_availability_clinic_id']][] = $value;\n }\n }\n $this->my_response['status'] = true;\n $this->my_response['message'] = lang('common_detail_found');\n $this->my_response['data'] = $doctor_availability_arr;\n $this->my_response['clinic_availability'] = $get_clinic_availability;\n\n\t\t\t\t//GET CURRENT CLINIC SESSTION MAPPING DETAILS\n\t\t\t\t$clinic_data = $this->clinic->get_clinic_list($this->user_id);\n\t\t\t\tif(isset($clinic_data) && !empty($clinic_data) && count($clinic_data) > 0){\n $minTimeArr = [];\n $maxTimeArr = [];\n $durationArr = [];\n foreach ($clinic_data as $key => $value) {\n $durationArr[] = $value['doctor_clinic_mapping_duration'];\n $minTimeArr[] = strtotime($value['doctor_clinic_doctor_session_1_start_time']);\n $maxTimeArr[] = strtotime($value['doctor_clinic_doctor_session_1_end_time']);\n if(!empty($value['doctor_clinic_doctor_session_2_end_time']))\n $maxTimeArr[] = strtotime($value['doctor_clinic_doctor_session_2_end_time']);\n $clinic_data[$key]['online_in_clinic'] = \"1\";\n $clinic_data[$key]['online_tele_clinic'] = \"1\";\n if(!empty($value['setting_data'])) {\n $booking_arr = json_decode($value['setting_data']);\n if(!empty($booking_arr->tele_consultation))\n $clinic_data[$key]['online_tele_clinic'] = $booking_arr->tele_consultation;\n if(!empty($booking_arr->tele_consultation))\n $clinic_data[$key]['online_in_clinic'] = $booking_arr->doctor_visit;\n }\n }\n $minTime = date(\"H:i:s\", min($minTimeArr));\n $maxTime = date(\"H:i:s\", max($maxTimeArr));\n $minDuration = min($durationArr);\n $slots = get_time_slots($get_clinic_availability_list, $minTime, $maxTime, $minDuration);\n $this->my_response['other_data'] = [\n 'minTime' => $minTime,\n 'maxTime' => $maxTime,\n 'minDuration' => $minDuration,\n 'timeSlots' => $slots,\n ];\n\t\t\t\t\t$this->my_response['clinic_data'] = $clinic_data;\n\t\t\t\t}\n } else {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang('common_detail_not_found');\n }\n $this->send_response();\n } catch (ErrorException $ex) {\n $this->error = $ex->getMessage();\n $this->store_error();\n }\n }", "function sendDoctor($id=\"\")\n\t{\n\t $notification = $this->my_model->getfields('bulk_notification','title,message,status',array('id'=>$id));\n\t $title = $notification[0]->title;\n\t $message = $notification[0]->message;\n\t $type = 'bulk';\n\t $doctors = $this->my_model->getfields(DOCTOR,'id,name,device_type,device_token',array('status'=>'1')); \n\t if(!empty($doctors))\n\t {\n\t foreach($doctors as $doctor)\n\t {\n\t $device_token = $doctor->device_token;\n\t $device_type = $doctor->device_type;\n\t $doctorId = $doctor->id;\n\t \n\t $notificationData = array(\n // 'user_id'=> $userId,\n 'doctor_id'=> $doctorId,\n // 'booking_id'=> $booking_id,\n 'title'=> $title,\n 'message'=> $message,\n 'type' => $type,\n 'status'=>'0',\n 'send_to'=>'doctor',\n 'created_date'=> date('Y-m-d H:i:s'),\n );\n $notificationID= $this->user_model->insert_data('notification',$notificationData);\n if($device_type=='android')\n\t {\n $this->user_model->android_pushh1($device_token,$message,$title,$type,$notificationID);\n\t }\n\t else if($device_type=='Iphone')\n\t {\n\t $this->user_model->iphone1($device_token,$message,$title,$type,$notificationID); \n\t }\n\t }\n\t }\n\t$this->msgsuccess('Notification send successfully');\n\tredirect(\"notification/importnotification\"); \n\t}", "public function gerDoctorVisitById($id){\n $doctors = DB::table('permissions')->select('users.name', 'users.surname', 'users.id')\n ->join('users', 'users.id', '=', 'permissions.inFrom')\n ->where('users.idTypeUser', '=', 1)\n ->where('permissions.inFrom', '=', $id)\n ->count();\n if($doctors!=0){\n $visits = DB::table('visits')->select('users.name', 'users.surname', 'visits.id', 'visits.startVisit', 'visits.endVisit', 'visits.comment', 'visits.active')\n ->join('users', 'visits.idPatient', '=', 'users.id')\n ->where('visits.idDoctor', '=', $id)\n ->orderBy('visits.startVisit', 'asc')\n ->get();\n return $visits;\n }else{\n return false;\n }\n }", "public function actionUseradvisorlist() {\n\n $userId = Yii::app()->getSession()->get('wsuser')->id;\n $createdBy = \"\";\n $user = Yii::app()->db->createCommand()\n ->select('indemnification_check')\n ->from('user u')\n ->join('consumervsadvisor ca', 'u.createdby=ca.advisor_id and u.id=ca.user_id')\n ->where('ca.user_id=:id ', array(':id' => $userId))\n ->queryAll();\n if (isset($user)) {\n foreach ($user as $value) {\n $indemnification_check = $value['indemnification_check'];\n if ($indemnification_check == 1) {\n $createdBy = 'advisor';\n } else {\n $createdBy = \"\";\n }\n }\n }\n $userAdvisor = Yii::app()->db->createCommand()\n ->select('ca.user_id, ca.advisor_id, ca.permission, ca.status, u.email, advp.firstname, advp.lastname, advp.profilepic')\n ->from('consumervsadvisor ca')\n ->join('advisor u', 'ca.advisor_id=u.id')\n ->join('advisorpersonalinfo advp', 'ca.advisor_id=advp.advisor_id')\n ->where(' ca.user_id =:userId ', array(':userId' => $userId))\n ->queryAll();\n\n if (count($userAdvisor) != 0) {\n $advisorPermission = array();\n foreach ($userAdvisor as $value) {\n\n $advisorPermission[$value['permission']][] = $value;\n }\n krsort($advisorPermission);\n $advisorDetails = array();\n foreach ($advisorPermission as $key => $sortvalue) {\n\n foreach ($sortvalue as $value) {\n\n $credentials = $this->getDesignations($value['advisor_id']);\n\n $value['credentials'] = $credentials['verified'];\n $value['advhash'] = md5('AdvisorHash' . $value['advisor_id']);\n $advisorDetails[] = $value;\n }\n }\n\n $this->sendResponse(200, CJSON::encode(array(\"status\" => \"OK\", \"userdata\" => $advisorDetails, \"loggedin_user_created_by\" => $createdBy)));\n } else {\n $this->sendResponse(200, CJSON::encode(array(\"status\" => 'OK', \"connectedAdv\" => \"NULL\", \"loggedin_user_created_by\" => $createdBy)));\n }\n }", "public function show_prescription_for_doctor($user_id)\n {\n\n try{\n $doc = \\App\\Models\\Doctor::where('user_id', $user_id)->findOrFail();\n }\n catch(ModelNotFoundException $exception)\n {\n return response()->json($exception->getMessage(), 400);\n }\n $prescriptions = \\App\\Models\\Prescription::where('doctor_id', $user_id)->get();\n return response()->json($prescriptions);\n }", "public function get_doctor_avialability_post() {\n\n try {\n $clinic_id = !empty($this->post_data['clinic_id']) ? $this->Common_model->escape_data($this->post_data['clinic_id']) : '';\n $doctor_id = !empty($this->post_data['doctor_id']) ? $this->Common_model->escape_data($this->post_data['doctor_id']) : '';\n\n if (empty($doctor_id) ||\n empty($clinic_id)\n ) {\n $this->bad_request();\n }\n\n $get_role_details = $this->Common_model->get_the_role($this->user_id);\n if (!empty($get_role_details['user_role_data'])) {\n $permission_data = array(\n 'role_data' => $get_role_details['user_role_data'],\n 'module' => 13,\n 'key' => 3\n );\n $check_module_permission = $this->check_module_permission($permission_data);\n if ($check_module_permission == 2) {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang('permission_error');\n $this->send_response();\n }\n }\n\n\n $clinic_columns = \"clinic_availability_id, \n clinic_availability_clinic_id, \n clinic_availability_week_day, \n clinic_availability_session_1_start_time, \n clinic_availability_session_1_end_time, \n clinic_availability_session_2_start_time, \n clinic_availability_session_2_end_time, \n clinic_availability_created_at, \n clinic_availability_status \";\n\n $clinic_where_availability = array(\n 'clinic_availability_clinic_id' => $clinic_id,\n 'clinic_availability_status !=' => 9\n );\n\n $get_clinic_availability = $this->Common_model->get_all_rows(TBL_CLINIC_AVAILABILITY, $clinic_columns, $clinic_where_availability);\n\n $columns = \"doctor_availability_id, \n doctor_availability_clinic_id, \n doctor_availability_user_id, \n doctor_availability_week_day, \n doctor_availability_appointment_type,\n doctor_availability_session_1_start_time,\n doctor_availability_session_1_end_time, \n doctor_availability_session_2_start_time, \n doctor_availability_session_2_end_time,\n doctor_availability_status\";\n\n\n $where_availability = array(\n 'doctor_availability_clinic_id' => $clinic_id,\n 'doctor_availability_user_id' => $doctor_id,\n 'doctor_availability_status !=' => 9\n );\n\n $get_doctor_availability = $this->Common_model->get_all_rows(TBL_DOCTOR_AVAILABILITY, $columns, $where_availability);\n $send_availability = array();\n\n if (!empty($get_doctor_availability)) {\n\n $appointment_type = array(1);\n $alreay_appointment_type = array();\n\n foreach ($get_doctor_availability as $availability) {\n $send_availability[$availability['doctor_availability_appointment_type']][] = $availability;\n }\n\n $final_array = array();\n $index = 0;\n foreach ($send_availability as $key => $data) {\n $alreay_appointment_type[] = $key;\n $final_array[$index]['doctor_availability_appointment_type'] = $key;\n $final_array[$index]['data'] = $data;\n $index++;\n }\n\n $appointment_type_difference = array_diff($appointment_type, $alreay_appointment_type);\n\n foreach ($appointment_type_difference as $key => $data) {\n $final_array[$index]['doctor_availability_appointment_type'] = $data;\n $final_array[$index]['data'] = array();\n $index++;\n }\n\n $final_array = msort($final_array, 'doctor_availability_appointment_type');\n\n $this->my_response['status'] = true;\n $this->my_response['message'] = lang('common_detail_found');\n $this->my_response['data'] = $final_array;\n $this->my_response['clinic_availability'] = $get_clinic_availability;\n } else {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang('common_detail_not_found');\n }\n\n $this->send_response();\n } catch (ErrorException $ex) {\n $this->error = $ex->getMessage();\n $this->store_error();\n }\n }", "public function get_clinic_whole_detail($clinic_id, $doctor_id) {\n $clinic_query = \"\n \n SELECT\n clinic_id,\n clinic_name,\n clinic_contact_number,\n clinic_email,\n \n address_id,\n address_name,\n address_name_one,\n address_city_id,\n address_state_id,\n address_country_id,\n address_pincode,\n address_latitude,\n address_longitude,\n address_locality,\n doctor_clinic_mapping_duration,\n doctor_clinic_mapping_fees,\n clinic_filepath,\n clinic_services,\n clinic_phone_verified,\n clinic_email_verified,\n doctor_clinic_mapping_fees,\n doctor_clinic_doctor_session_1_start_time,\n doctor_clinic_doctor_session_1_end_time,\n doctor_clinic_doctor_session_2_start_time,\n doctor_clinic_doctor_session_2_end_time\n FROM \n \" . TBL_CLINICS . \" \n LEFT JOIN \n \" . TBL_ADDRESS . \" \n ON \n address_user_id=clinic_id AND \n address_type=2 AND \n address_status=1\n LEFT JOIN \n \" . TBL_DOCTOR_CLINIC_MAPPING . \" \n ON \n doctor_clinic_mapping_clinic_id=clinic_id AND \n doctor_clinic_mapping_status=1 AND \n doctor_clinic_mapping_user_id=\" . $doctor_id . \" \n WHERE\n clinic_status=1 \n AND \n clinic_id=\" . $clinic_id . \" \n \";\n $clinic_data = $this->get_single_row_by_query($clinic_query);\n return $clinic_data;\n }", "public function get_doctor(){\n $model = new restfulModel();\n $data = json_decode(file_get_contents(\"php://input\"));\n \n $authenticate=$this->auth_token($data->token);\n\n if($authenticate['result']==\"true\"){\n\n $return=$model->get_doctor_model($data);\n \n if($return['result']==\"true\"){\n $response = json_encode(array(\n \"status\" => \"success\",\n \"response\" =>array(\"timestamp\"=>date(\"Y-m-d\").\" \".date(\"h:i:sa\")) ,\n \"data\" => $return['data']\n ));\n return $response;\n }else{\n $response = json_encode(array(\n \"status\" => \"fail\",\n \"error\" =>array(\"type\"=>\"sql\", \"message\"=>\"unsuccessful to Get doctor list\") ,\n\n ));\n\n return $response;\n };\n }else{\n $response = json_encode(array(\n \"status\" => \"fail\",\n \"error\" =>array(\"type\"=>\"sql\", \"message\"=>\"Token Invalid\"),\n ));\n\n return $response;\n } \n }", "public function getMyDoctorsList($request, $user);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function returns the default value of a parameter.
protected function getDefaultValue($param) { return self::$param_info[$param]['default']; }
[ "abstract protected function getDefaultValue($param);", "function default_value(&$var, $def = null) {\n return isset($var)?$var:$def;\n}", "public function defaultValue($default = NULL);", "public function getDefaultValue() { return $this->default_value; }", "private static function parse_policy_parameter ($param, $default_value) {\n return (!isset($param) || is_null($param) || !$param->value()) ?\n $default_value :\n (is_int($default_value) ?\n intval($param->value()) :\n $param->value()) ;\n }", "function conf_get_param($param, $default_value=null)\n{\n global $conf;\n \n if (isset($conf[$param]))\n {\n return $conf[$param];\n }\n return $default_value;\n}", "public function get_default_value()\n {\n return $this->default_value;\n }", "public function getDefaultValue()\n {\n return $this->defaultValue;\n }", "function getParameter($parameter, $default=false){\n\n\t}", "public function getParamDefaultValue($key, $default = null)\n {\n return config('api-response.parameters_defaults.' . $key, $default);\n }", "public function getValidDefaultValue(): mixed;", "protected function resolveByDefault(\\ReflectionParameter $param) {\n return $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;\n }", "function getRequestedParameter($param,$default='',$request)\n\t{\n\t\tif (isset($request[$param]) && $request[$param])\n\t\t\t$default = $request[$param];\n\t\treturn $default;\n\t}", "function value_or_default($value, $default)\n{\n return empty($value) ? $default : $value;\n}", "public function getParameter($name, $default = null)\n {\n if (isset($this->parameters[$name]))\n {\n return $this->parameters[$name];\n }\n\n return $default;\n }", "public function getDefaultParameter($key)\n {\n return isset($this->defaultParameters[$key]) ? $this->defaultParameters[$key] : null;\n }", "function config_getParameter($param='option',$default=null)\n{\n if (!isset($GLOBALS['config-parameters'][$param])) {\n return($default);\n }\n return($GLOBALS['config-parameters'][$param]);\n}", "public function getParam (string $name, mixed $default = NULL)\n {\n }", "private static function extractDefaultValue(ReflectionParameter $parameter): mixed\n {\n #todo drop isDefaultValueAvailable ???\n if (!$parameter->isOptional() || !$parameter->isDefaultValueAvailable()) {\n return null;\n }\n\n return $parameter->getDefaultValue();\n }", "function getDefault(&$isset, $default)\n{\n\t$argCount = func_num_args();\n\tif ($argCount < 3)\n\t\treturn isset($isset) ? $isset : $default;\n\telse\n\t{\n\t\tfor($i = 1; $i < $argCount; $i++)\n\t\t{\n\t\t\t$arg = func_get_arg($i);\n\t\t\tif (isset($arg))\n\t\t\t\treturn $arg;\n\t\t}\n\t}\n\n\t// Nothing was set\n\treturn false;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Redirect to new URL. Used as a fallback function for the old URL structure of Elementor page edit URL. Fired by `template_redirect` action.
public function redirect_to_new_url() { if ( ! isset( $_GET['elementor'] ) ) { return; } $document = Plugin::$instance->documents->get( get_the_ID() ); if ( ! $document ) { wp_die( __( 'Document not found.', 'elementor' ) ); } if ( ! $document->is_editable_by_current_user() || ! $document->is_built_with_elementor() ) { return; } wp_safe_redirect( $document->get_edit_url() ); die; }
[ "function _template_redirect() {\n\n\t\t}", "public function template_redirect() {\n\t\t// If there is no path, nothing to do.\n\t\tif ( empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$path = \\sanitize_text_field( \\wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\n\t\t// If it's not a wp-sitemap request, nothing to do.\n\t\tif ( \\substr( $path, 0, 11 ) !== '/wp-sitemap' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$redirect = $this->get_redirect_url( $path );\n\n\t\tif ( ! $redirect ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->redirect->do_safe_redirect( \\home_url( $redirect ), 301 );\n\t}", "public static function template_redirect() {\n\n if ( $state = self::get_routed_state() ) {\n\n $state_url = $state['parentUrl'] . $state['url'];\n $redirect_url = wp_ng_get_base_url() . '#' . $state_url;\n\n wp_safe_redirect($redirect_url);\n exit();\n }\n }", "public function old_settings_redirect()\n {\n }", "function bp_template_redirect() {\n\tdo_action( 'bp_template_redirect' );\n}", "protected function redirectToCurrentPage()\n {\n $this->calculateLinkVars();\n // Instantiate \\TYPO3\\CMS\\Frontend\\ContentObject to generate the correct target URL\n /** @var $cObj ContentObjectRenderer */\n $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);\n $parameter = $this->page['uid'];\n $type = GeneralUtility::_GET('type');\n if ($type && MathUtility::canBeInterpretedAsInteger($type)) {\n $parameter .= ',' . $type;\n }\n $typolinkParameters = array('parameter' => $parameter);\n $redirectUrl = $cObj->typoLink_URL(\n $this->addAdditionalParamsToShortcutTypolink($typolinkParameters)\n );\n\n // Prevent redirection loop\n if (!empty($redirectUrl)) {\n // redirect and exit\n HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307);\n }\n }", "public function template_redirect() {\n\t\t\tglobal $wp_query, $post;\n\n\t\t\tif ( is_attachment() ) {\n\t\t\t\t$post_parent = $post->post_parent;\n\n\t\t\t\tif ( $post_parent ) {\n\t\t\t\t\twp_safe_redirect( get_permalink( $post->post_parent ), 301 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\t$wp_query->set_404();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( is_author() || is_date() ) {\n\t\t\t\t$wp_query->set_404();\n\t\t\t}\n\t\t}", "public function redirect_to_edit_page()\n {\n wp_redirect(admin_url('/post.php?post=' . $this->id . '&action=edit'));\n exit;\n }", "private function setRedirectUrl()\n {\n $redirectTemplate = $this->getConfig('redirect_template');\n if (empty($redirectTemplate)) {\n return;\n }\n\n $redirect = str_replace('{policy}', $this->getPolicy(), $redirectTemplate);\n\n $url = Str::startsWith($redirect, '/')\n ? URL::to($redirect)\n : $redirect;\n\n $this->redirectUrl($url);\n }", "protected function redirect() {\n\n Tools::redirectLink($this->redirect_after);\n }", "public function onRedirect(){}", "public function template_redirect() {\t\n\t\tif ( is_singular( 'aiovg_videos' ) ) {\t\t\n\t\t\tglobal $wp_query;\n\t\t\t\n\t\t\t$page = (int) $wp_query->get( 'page' );\n\t\t\tif ( $page > 1 ) {\n\t\t \t\t// Convert 'page' to 'paged'\n\t\t \t \t$wp_query->set( 'page', 1 );\n\t\t \t \t$wp_query->set( 'paged', $page );\n\t\t\t}\n\t\t\t\n\t\t\t// Prevent redirect\n\t\t\tremove_action( 'template_redirect', 'redirect_canonical' );\t\t\n\t \t}\t\n\t}", "protected function redirect(){\n\n\t\tif(!empty($this->redirect_url))\n\t\t\tSugarApplication::redirect($this->redirect_url);\n\t}", "function redirect_to_new_location( $post_new_location ) {\n\n\t //301 redirect to new location\n\t\theader( \"HTTP/1.1 301 Moved Permanently\" );\n\t\theader( \"Location: $post_new_location\" );\n\t}", "function parentredirect()\n\t{\n\t\t$id = JRequest::getInt('id', 0, 'post');\n\t\t$pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');\n\t\t$className = JRequest::getVar('plugin', 'fabrikfield', 'post');\n\t\t$elementModel = $pluginManager->getPlugIn($className, 'element');\n\t\t$elementModel->setId($id);\n\t\t$row =& $elementModel->getElement();\n\t\t$row->checkin();\n\t\t$to = JRequest::getInt('redirectto');\n\t\t$this->_task = 'edit';\n\t\tJRequest::setVar('cid', array($to));\n\t\t$this->edit();\n\t}", "public function redirect( $new_file ) {\n\t\t$realpath = realpath($new_file);\n\t\tif ( $realpath == $this->template_file )\n\t\t\treturn;\n\n\t\t$this->is_parsed = false;\n\t\t$this->template_file = $realpath;\n\t\t$this->redirect = true;\n\t}", "function performRedirect() {\n // Back to the edit view we go...\n \n $this->redirect(array('action' => 'edit',\n $this->viewVars['cmp_enrollment_configurations'][0]['CmpEnrollmentConfiguration']['id']));\n \n }", "public function template_redirect()\n {\n remove_action('template_redirect', 'wp_shortlink_header', 11);\n }", "protected function redirectToListTemplate()\n {\n $contentId = $this->getRequest()->get('content_id');\n $this->redirectToRoute(\n 'admin.content.update',\n array(),\n array('content_id' => $contentId, 'current_tab' => 'modules')\n );\n }", "function carr_redirect() {\n\tglobal $post;\n\t$post_type = get_post_type();\n\n\tif ( is_single() && $post_type == 'post' ) {\n\t\t$clickthrough = get_post_meta( $post->ID, 'source_url', true );\n\n\t\tif ( $clickthrough ) {\n\t\t\twp_redirect( $clickthrough );\n\t\t\texit;\n\t\t}\n\n\t\tif ( has_category( 'in-the-news') ) {\n\t\t\t$news_type_select = get_post_meta($post->ID, \"news_type_select\", true );\n\n\t\t\tif ( 'pdf' == $news_type_select ) {\n\t\t\t\t$attachments = attachments_get_attachments();\n\t\t\t\tif ( $attachments ) {\n\t\t\t\t\t$pdf = $attachments[0]['location'];\n\n\t\t\t\t\twp_redirect( $pdf );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t} elseif ( 'external' == $news_type_select ) {\n\t\t\t\t$source_url = get_post_meta($post->ID, \"source_url\", true );\n\n\t\t\t\twp_redirect( $source_url );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( is_single() && $post_type == 'industries' ) {\n\t\t$new_url = esc_url( home_url( '/' ) ) . 'industries/#' . $post->post_name;\n\t\twp_redirect( $new_url );\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as shippingCarrierUsed This field is deprecated.
public function getShippingCarrierUsed() { return $this->shippingCarrierUsed; }
[ "public function getShippingServiceUsed()\n {\n return $this->shippingServiceUsed;\n }", "public function getFreightShipping()\n {\n return $this->freightShipping;\n }", "public function getListedShippingServiceCost()\n {\n return $this->listedShippingServiceCost;\n }", "public function getShippingCharge()\n {\n return $this->shippingCharge;\n }", "public function getMinFreeShipping();", "public function getGlobalShippingEnabled()\n {\n return $this->globalShippingEnabled;\n }", "public function getAvailableShippingServiceOptions()\n {\n return $this->_fields['AvailableShippingServiceOptions']['FieldValue'];\n }", "public function getShippingCost()\r\n {\r\n return $this->shipping_cost;\r\n }", "public function getCurrentShippingCost()\n {\n if (!is_null($this->shipping_cost_override))\n return $this->shipping_cost_override;\n else\n return $this->shipping_cost;\n }", "public function getEnableShipping()\n {\n return $this->enableShipping;\n }", "public function getClassifiedAdShippingMethodEnabled()\n {\n return $this->classifiedAdShippingMethodEnabled;\n }", "public function getShippingService()\n {\n return $this->_fields['ShippingService']['FieldValue'];\n }", "public function getShippingCost()\n {\n return $this->shipping_cost;\n }", "public function shipping(): Shipping\n {\n return $this->cart->shipping;\n }", "public function getGlobalShipping()\n {\n return $this->globalShipping;\n }", "public function getShippingInfo()\n {\n return $this->shippingInfo;\n }", "public function requiresShipping() {\n\t\treturn $this->column('requires_shipping');\n\t}", "public function getShippingCost()\n \t {\n \t \treturn $this->shippingCost;\n \t }", "public function getCurrentShippingRate()\n {\n return $this->_currentShippingRate;\n }", "public function isUsed()\n\t{\n\t\t$row = Db::getInstance()->getRow('\n\t\tSELECT COUNT(`id_carrier`) AS total\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE `id_carrier` = '.(int)$this->id);\n\n\t\treturn (int)$row['total'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a die to dieArray
public function add_die($die) { $this->dieArray[] = $die; }
[ "public function add_die(BMDie $die) {\n // need to search with strict on to avoid identical-valued\n // objects matching\n if (!in_array($die, $this->validDice, TRUE)) {\n if (is_array($die->skillList)) {\n foreach ($die->skillList as $skill) {\n if (FALSE !== array_search($this->type, $skill::incompatible_attack_types())) {\n return;\n }\n }\n }\n $this->validDice[] = $die;\n }\n }", "public function addDeath(): void\n {\n $this->deaths += 1;\n }", "public function add(array $array);", "protected function _add(array $alarm)\n {\n }", "public function addDice()\n {\n $valueReceived = $this->request->getVar(\"value\");\n $data = [];\n if ($this->validateDie($valueReceived)) {\n $this->loadDiceRollerState();\n $this->diceRoller->addDice(1, $valueReceived);\n $data[\"current_roll\"] = \"Current roll: \" . strval($this->diceRoller);\n $this->saveDiceRollerState();\n $this->response->setStatusCode(200);\n } else {\n // Bad Request\n $this->response->setStatusCode(400);\n $data['message'] = \"Sorry, Bad Request. <br /> \";\n $data['message'] .= \"Select another dice from the list and try again <br />\";\n $data['message'] .= \"Resetting the roller\";\n $this->diceRoller = new DiceRoller();\n }\n echo json_encode($data);\n }", "public function add($row) {\n\t\tif ($row instanceof db_row) {\n\t\t\t$this->_rows[$this->_count] = $row;\n\t\t\t$array = $row->getData();\n\t\t} else {\n\t\t\t$array = $row;\n\t\t}\n\t\t$this->cfg->setInArray('data', $this->_count, $array);\n\t\t$this->_count++;\n\t}", "function rollDiceArray(){\n global $dice;\n global $numDice;\n for($i=0; $i<5; $i++){ // Plays 5 dice to the table.\n array_push($dice, rand(1,6));\n echo \"<img src='img/\".$dice[$numDice].\".png'/>\";\n $numDice++;\n }\n }", "public function addEgg()\n {\n $this->eggs++;\n }", "public function roll()\n {\n foreach ($this->dices as $key => $value) {\n $this->values[$key] = $value->rollDie();\n $this->graphics[$key] = $value->graphic();\n }\n }", "public function testCreateAnyDie()\n {\n $die = DieFactory::create([0, 0, 1, 2, 9]);\n $this->assertInstanceOf(AnyDie::class, $die, \"DieFactory returns the wrong instance\");\n }", "public function add(array $passives)\n {\n foreach ($passives as $passive) {\n if ($passive instanceof ChampionPassiveInterface) {\n $this->passives[$passive->getChampionID()] = $passive;\n continue;\n }\n $this->logger->error('Incorrect object supplied to Champion Passives service', [$passive]);\n }\n }", "function arraypush($array)\r\n {\r\n array_push($array, \"eight\", \"nine\");\r\n return print_r($array, true);\r\n\r\n }", "abstract protected function addArrayValue(string $value, mixed &$array);", "public function add_drug($drug_array = array()) {\n if (!empty($drug_array) && is_array($drug_array)) {\n $inserted_id = $this->insert($this->drug_table, $drug_array);\n return $inserted_id;\n }\n return 0;\n }", "function array_add_unique(&$array, $value)\n {\n (new Arr())\n ->addUnique($array, $value);\n }", "public function Add($element) {\n $this->Array[] = $element;\n }", "public function __construct(int $dices = 3) \n {\n $this->dices = [];\n $this->values = [];\n\n for ($i = 0; $i < $dices; $i++) {\n $this->dices[] = new Dice();\n }\n //$this->values[] = $this->rollAllDices();\n }", "public static function add(&$array, $object)\r\n {\r\n $array[spl_object_hash($object)] = $object;\r\n }", "private function addDvd(Dvd $dvd)\n {\n // get ID from dvd object\n $id = $dvd->getId();\n\n // add dvd object to array, with index of the ID\n $this->dvds[$id] = $dvd;\n\n }", "public function addDish($venueName,$entreeName, $dishID, &$json_a){\n $exists = false;\n for($i = 0; !$exists && ($i < count($this->venues)); $i++)\n if(strcmp($this->venues[$i]->name,$venueName) == 0){\n $exists = true;\n $this->venues[$i]->add(new Entree($entreeName, $dishID, &$json_a));\n }\n if(!$exists){\n $newVen = new Venue($venueName);\n $newVen->add(new Entree($entreeName, $dishID, &$json_a));\n array_push($this->venues, $newVen);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Dim in an OpenXML Drawing (pictures in an XLSX)
function TbsPicGetDim_Drawings($Txt, $Pos, $FieldPos, $FieldLen, $Offset, $dim_inner) { // The <a:ext> coordinates must have been found previously. if ($dim_inner===false) return false; // The current file must be an XLSX drawing sub-file. if (strpos($this->TBS->OtbsCurrFile, 'xl/drawings/')!==0) return false; if ($Pos==0) { // The parent element has already been found $PosEl = 0; } else { // Found parent element $loc = clsTbsXmlLoc::FindStartTag($Txt, 'xdr:twoCellAnchor', $Pos, false); if ($loc===false) return false; $PosEl = $loc->PosBeg; } $loc = clsTbsXmlLoc::FindStartTag($Txt, 'xdr:to', $PosEl, true); if ($loc===false) return false; $p = $loc->PosBeg; $res = array(); $el_lst = array('w'=>'xdr:colOff', 'h'=>'xdr:rowOff'); foreach ($el_lst as $i=>$el) { $loc = clsTbsXmlLoc::FindElement($Txt, $el, $p, true); if ($loc===false) return false; $beg = $Offset + $loc->GetInnerStart(); if ($beg>$FieldPos) $beg = $beg - $FieldLen; $val = $dim_inner[$i.'v']; $tval = $loc->GetInnerSrc(); $res[$i.'b'] = $beg; $res[$i.'l'] = $loc->GetInnerLen(); $res[$i.'u'] = ''; $res[$i.'v'] = $val; $res[$i.'t'] = $tval; $res[$i.'o'] = intval($tval) - $val; } $res['r'] = ($res['hv']==0) ? 0.0 : $res['wv']/$res['hv']; // ratio W/H; $res['dec'] = 0; $res['cpt'] = 12700; return $res; }
[ "function TbsPicGetDim_Drawings($Txt, $Pos, $FieldPos, $FieldLen, $Offset, $dim_inner) {\n\n\t\t// The <a:ext> coordinates must have been found previously.\n\t\tif ($dim_inner===false) return false;\n\t\t// The current file must be an XLSX drawing sub-file.\n\t\tif (strpos($this->TBS->OtbsCurrFile, 'xl/drawings/')!==0) return false;\n\t\t\n\t\tif ($Pos==0) {\n\t\t\t// The parent element has already been found\n\t\t\t$PosEl = 0;\n\t\t} else {\n\t\t\t// Found parent element\n\t\t\t$loc = clsTbsXmlLoc::FindStartTag($Txt, 'xdr:twoCellAnchor', $Pos, false);\n\t\t\tif ($loc===false) return false;\n\t\t\t$PosEl = $loc->PosBeg;\n\t\t}\n\t\t\n\t\t$loc = clsTbsXmlLoc::FindStartTag($Txt, 'xdr:to', $PosEl, true);\n\t\tif ($loc===false) return false;\n\t\t$p = $loc->PosBeg;\n\n\t\t$res = array();\n\n\t\t$el_lst = array('w'=>'xdr:colOff', 'h'=>'xdr:rowOff');\n\t\tforeach ($el_lst as $i=>$el) {\n\t\t\t$loc = clsTbsXmlLoc::FindElement($Txt, $el, $p, true);\n\t\t\tif ($loc===false) return false;\n\t\t\t$beg = $Offset + $loc->GetInnerStart();\n\t\t\tif ($beg>$FieldPos) $beg = $beg - $FieldLen;\n\t\t\t$val = $dim_inner[$i.'v'];\n\t\t\t$tval = $loc->GetInnerSrc();\n\t\t\t$res[$i.'b'] = $beg;\n\t\t\t$res[$i.'l'] = $loc->GetInnerLen();\n\t\t\t$res[$i.'u'] = '';\n\t\t\t$res[$i.'v'] = $val;\n\t\t\t$res[$i.'t'] = $tval;\n\t\t\t$res[$i.'o'] = intval($tval) - $val;\n\t\t}\n\n\t\t$res['r'] = ($res['hv']==0) ? 0.0 : $res['wv']/$res['hv']; // ratio W/H;\n\t\t$res['dec'] = 0;\n\t\t$res['cpt'] = 12700;\n\n\t\treturn $res;\n\n\t}", "function gttn_tpps_xlsx_get_dimension($location) {\n $reader = new XMLReader();\n $reader->open($location);\n while ($reader->read()) {\n if ($reader->nodeType == XMLReader::ELEMENT and $reader->name == 'dimension') {\n $dim = $reader->getAttribute('ref');\n $reader->close();\n return $dim;\n }\n }\n return NULL;\n}", "protected function getDimensions($filename) {\n\n \t$command = $this->_identify_path.\" \".$filename;\n \t$this->log(\"Käivitame käsu: \" . $command);\n $output2 = array();\n $output=exec($command, $output2);\n\n\t\t$this->log(\"Result:\\n\" . print_r($output2, true));\n // echo \"<hr> identify \" . $this->_identify_path.\" \".$filename .\"<hr>\";\n $result=explode(\" \",$output);\n \n //echo \"<pre>\".print_r($output, true).\"</pre>\";\n \n $dim=explode(\"x\",$result[2]);\n $dim[\"x\"] = $dim[0];\n $dim[\"y\"] = $dim[1];\n\n return $dim;\n }", "function GetLogicalPaperRect(){}", "function GetPaperRectPixels(){}", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "function xml_shape($id,$type)\n{\n\t$dom = new DOMDocument();\n\t//--------test------\n\t//\t$dom->load(\"shape.xml\");\n\t//--------test-------\n\t$dom->load(\"http://www.hzbus.cn/Page/linestop.axd?id=\".$id.\"&type=\".$type);\n\t$node = $dom->getElementsByTagName(\"Line\");\n\t$seprate = $node->item(0)->getAttribute(\"shape\");\n\t$sep_count = explode(',',$seprate);\n\t$count = 0;\n\t$num = 0;\n\tforeach($sep_count as $recl)\n\t{\n\t\t$check = strlen($sep_count[$num]);\n\t\tif( $check > 0)\n\t\t{\n\t\t\t$shape[$count] = explode(' ',$sep_count[$num]);\n\t\t\t$count++;\n\t\t}\t\n\t\t$num++;\n\t}\n\treturn $shape;\n}", "public function getDetailLineDim1(): string;", "function getGeometry($sFile) {\r\n exec('identify -format \"%g - %f\" ' . $sFile, $aOutput);\r\n $aOutputParts = explode('-', $aOutput[0]);\r\n\r\n // return just the geometry prefix of the line without extra whitespace\r\n // Sample output : 100x2772+0+0 - sprite2.jpg\r\n return trim($aOutputParts[0]);\r\n}", "public static function getDimensionSymbol(): ?string;", "function GetPrintDimensions($width, $height) {\n\t\n\t$orientation = ImageOrientation ($width, $height);\n\t\n\t$imageDims = array (\"width\"=>$width, \"height\"=>$height);\n\n\t$artborder = ArtBorderWidthFromSide (ImageGreaterSide($width, $height));\n\t$paperDims = array (\"width\"=>$width + (2*$artborder), \"height\"=>$height + (2*$artborder));\n\t\n\t$imageDimsOrdered = ImageGreaterSideFirst($width, $height);\n\t$frameDims = GetFrameDimensions ($width, $height);\n\n\t// Areas\n\t// While width/height are in inches or cm, areas are in\n\t// in meters or feet. So, we get the conversion factor\n\t// between inches and ft2, or cm and meters2\n\tif (UNIT == \"inch\") {\n\t\t$x = 144;\n\t} else {\n\t\t// UNIT must be CM\n\t\t$x = 1000;\n\t}\n\n\t$imageArea = round(($imageDims['width'] * $imageDims['height'])/$x,3);\n\t$paperArea = round(($paperDims['width'] * $paperDims['height'])/$x,3);\n\t$matteArea = round(($frameDims['width'] * $frameDims['height'])/$x,3);\n\n\t$res = array (\n\t\t\"orientation\"\t\t=> $orientation,\n\t\t\"imageDims\"\t\t\t=> $imageDims,\n\t\t\"imageDimsOrdered\"\t=> $imageDimsOrdered,\n\t\t\"paperDims\"\t\t\t=> $paperDims,\n\t\t\"frameDims\"\t\t\t=> $frameDims,\n\t\t\"imageArea\"\t\t\t=> $imageArea,\n\t\t\"paperArea\"\t\t\t=> $paperArea,\n\t\t\"matteArea\"\t\t\t=> $matteArea,\n\t\t\"frameArea\"\t\t\t=> $matteArea\n\t\t);\n\t\t//var_dump($res);\n\treturn $res;\n}", "public function getPageDimensions($pagenum='') {\n\n\t\t\tif (empty($pagenum)) {\n\n\t\t\t\t$pagenum = $this->page;\n\n\t\t\t}\n\n\t\t\treturn $this->pagedim[$pagenum];\n\n\t\t}", "public function svg_dimensions( $svg ){\n\t\t\t$svg = function_exists( 'simplexml_load_file' ) ? simplexml_load_file( $svg ) : null;\n\t\t\t$width = 0;\n\t\t\t$height = 0;\n\t\t\tif( $svg ){\n\t\t\t\t$attributes = $svg->attributes();\n\t\t\t\tif( isset( $attributes->width, $attributes->height ) ){\n\t\t\t\t\t$width = floatval( $attributes->width );\n\t\t\t\t\t$height = floatval( $attributes->height );\n\t\t\t\t}elseif( isset( $attributes->viewBox ) ){\n\t\t\t\t\t$sizes = explode( \" \", $attributes->viewBox );\n\t\t\t\t\tif( isset( $sizes[2], $sizes[3] ) ){\n\t\t\t\t\t\t$width = floatval( $sizes[2] );\n\t\t\t\t\t\t$height = floatval( $sizes[3] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (object)array( 'width' => $width, 'height' => $height );\n\t\t}", "static function get_svg_dimensions( $svg ) {\n\t\t$svg = simplexml_load_file( $svg );\n\t\t$attributes = $svg->attributes();\n\t\t$width = (string) $attributes->width;\n\t\t$height = (string) $attributes->height;\n\t\treturn (object) array( 'width' => $width, 'height' => $height );\n\t}", "public function getObjDrawing() {\n\t\treturn new \\PHPExcel_Worksheet_Drawing();\n\t}", "public function getPageDimensions($pagenum='') {\n if (empty($pagenum)) {\n $pagenum = $this->page;\n }\n return $this->pagedim[$pagenum];\n }", "public function getDimensions(): string {\n // TODO:\n return \"\";\n }", "protected function get_image_dimension($src) {\n preg_match('/\\__(.*?)\\./', $src, $match);\n if(count($match)>1) {\n $dimension = explode('x',$match[1]);\n return ['width=\"'.$dimension[0].'\"', 'height=\"'.$dimension[1].'\"'];\n }\n return [];\n }", "public function getDimensionX()\n {\n return $this->dimension_x;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the model class.
public function getModelClass(): string { return $this->model_class; }
[ "public function getModelClass()\n\t{\n\t\treturn $this->model_class;\n\t}", "final public function modelClass()\r\n {\r\n $parts = explode('\\\\', get_class($this));\r\n return $parts[count($parts) - 1];\r\n }", "protected function _getClassModel()\r\n {\r\n return $this->getModelFromCache('ThemeHouse_Objects_Model_Class');\r\n }", "public function getModelClass()\n {\n // If self class name is endded with 'Schema', remove it and return.\n $class = get_class($this);\n if (($p = strrpos($class, 'Schema')) !== false) {\n return substr($class, 0, $p);\n }\n // throw new Exception('Can not get model class from ' . $class );\n return $class;\n }", "protected function getModelClass()\n {\n if(empty($this->modelClass)) {\n throw new Exception('No model resource has been specified in the API Controller');\n }\n return $this->modelClass;\n }", "public function getResolvedModelClass() {\n if (!isset($this->_resolvedModelClass)) {\n if (isset($this->owner->modelClass)) {\n // Model class has been specified in the controller:\n $modelClass = $this->owner->modelClass;\n } else {\n // Attempt to find an active record model named after the\n // controller. Typically the case in custom modules.\n $modelClass = ucfirst($this->owner->id);\n if (!class_exists($modelClass)) {\n $modelClass = 'Admin'; // Fall-back default\n }\n }\n $this->_resolvedModelClass = $modelClass;\n }\n return $this->_resolvedModelClass;\n }", "public function getBaseModelClass()\n\t{\n\t\treturn $this->getLastNamespaceSegment($this->getBaseModel());\n\t}", "function getModelType() {\n\t\treturn $this->_modelType;\n\t}", "public function getModelClassName()\n {\n }", "private function type()\n {\n return (new Model)->getType();\n }", "function getModelType(){\n\t\treturn $this->_modelType;\n\t}", "public function type()\n {\n return self::model();\n }", "abstract protected function getModelClass(): string;", "public function getRepositoryModel()\n {\n return get_class($this->model);\n }", "public function fetch_class()\n {\n return $this->class;\n }", "public function getClass() {\n return $this->_class;\n }", "public function getCredentialModelClass()\n {\n if (is_null($this->credentialModelClass)) {\n $modelClass = Yii::$app->getUser()->identityClass;\n } else {\n $modelClass = $this->credentialModelClass;\n }\n return $modelClass;\n }", "public function getRelatedModelClass()\n {\n $fqController = explode('\\\\', static::class);\n $model = Pluralizer::singular(str_replace('Controller', '', end($fqController)));\n\n $ns = $this->getModelNamespace() ? : 'App';\n return $ns . '\\\\' . $model;\n }", "public function GetModel()\n {\n return $this->_viewData->GetModel();\n }", "public function getClass()\n {\n return $this->getProperty('class');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all articles with a technical name like the string given.
public function getWithTechnicalNameLike($technicalName) { return $this->model ->newQuery() ->with(['media', 'translations' => function ($query) { $query->where('locale', content_locale()); }]) ->where('technical_name', 'like', "{$technicalName}.%") ->orderBy('order_column') ->get(); }
[ "function searchArticlesByName($article_name, $ignore_offlines = false, $clang = false, $category = false) {\r\n\t\tglobal $REX;\r\n\t\tif($clang === false) $clang = $REX[CUR_CLANG];\r\n\t\t$offline = $ignore_offlines ? \" and status = 1 \" : \"\";\r\n\t\t$oocat = $category ? \" and startpage = 1 \" : \"\";\r\n\t\t$artlist = array();\r\n\t\t$sql = new sql;\r\n\t\t$sql->setQuery(\"select \".implode(',',OORedaxo::getClassVars()).\" from rex_article where name like '$article_name' AND clang='$clang' $offline $oocat\");\r\n\t\tfor ($i = 0; $i < $sql->getRows(); $i++) {\r\n foreach(OORedaxo::getClassVars() as $var){\r\n $article_data[\"_\".$var] = $sql->getValue($var);\r\n }\r\n $artlist[] = new OOArticle($article_data);\r\n\t\t\t$sql->next();\r\n\t\t}\r\n\t\treturn $artlist;\r\n\t}", "public function Article_by_name($string) {\n\t\t$articles = new array(); // Article_ array\n\t\t$sql = \"SELECT id,catagory_id, title,content,status, writter_id FROM articles WHERE $Article_Object->title=$string \";\n\t\t$result = $GLOBALS['DB_Conn']->query($sql);\n\t\t while($re=mysql_fetch_array($result)){\n\t\t $articles[] = $re[0];\n\t\t }\n\t\treturn $articles;\n\t}", "public function getWithTechnicalNameLike($technicalName);", "public function getAllArticlesByName($name)\n {\n $articles = Article::paginateArticlesByName($name, 10);\n\n return $articles;\n }", "public function getArticles() {\r\n $sql = 'select ar_id as id, ar_name as name, ar_desc as description, ar_pic as picture, ar_price as price'\r\n . ' from t_articles';\r\n $articles = $this->executerRequete($sql);\r\n return $articles;\r\n }", "public function getAllArticles()\n\t{\n\t\t\n\t\t$articles = $this->dataOperation->getAll('Select Label,ExternalKey,Language_Code\n\t\t\t\t\t\t\t\t\t\t\t\t from cs_stg_incr_article \n\t\t\t\t\t\t\t\t\t\t\t\t where Language_Code='.\"'en'\" );\n\t\t\t\t\n return $articles;\n\t\t\n\t}", "function GetSuppliers($filterArt, $filterText)\n {\n $sqlStatement = \n \"SELECT \n supl_city_code,\n supl_fax,\n supl_id,\n supl_mail,\n supl_mobile,\n supl_name,\n supl_phone,\n supl_street,\n cont_name,\n city_name\n FROM supplier\n LEFT JOIN city ON city.city_id = supplier.supl_city_id\n LEFT JOIN country ON city.city_cont_id = country.cont_id\";\n \n \n if($filterArt !== null && $filterArt !== \"\")\n {\n $sqlStatement = $sqlStatement.\" WHERE \".DefuseInputs($filterArt).\" LIKE '%\".DefuseInputs($filterText).\"%'\";\n }\n $sqlStatement = $sqlStatement.\";\";\n \n\n $dataRows = ExecuteReaderAssoc($sqlStatement);\n \n return $dataRows;\n }", "function Search($key)\n {\n\n $this->db->like('name', $key);\n $this->db->or_like('content', $key);\n $articles = $this->db->get('articles')->result_array();\n if (!$articles)\n return false;\n else return $articles;\n }", "public function search_byName($name) {\n $name = $name.\"%\";\n $query = $this->_bdd->prepare(\"select * from NEWS where titre like :name order by Id DESC\");\n $query->bindParam(\":name\", $name);\n $query->execute();\n $data = array();\n $i = 0;\n while($rep = $query->fetch()) {\n $data[$i] = $rep;\n $i++;\n }\n return $data;\n }", "function search_articles_with_tag($string, $limit = 0){\n\t$conn = open_db();\n\t$string = mysqli_real_escape_string($conn, $string);\n\t$query = \"SELECT DISTINCT a.id AS id, a.headline AS headline, a.userid AS userid, u.name AS author, a.blogid AS blogid FROM articles AS a, article_tag1 AS at, users AS u, tags AS t WHERE a.userid = u.id AND a.id = at.articleid AND t.id = at.tagid AND t.name LIKE '%$string%' ORDER BY id DESC\";\n\tif($limit > 0) $query .= \" LIMIT $limit\";\n\t$result = mysqli_query($conn, $query);\n\t$list = array();\n\tif($result){\n\t\twhile($row = mysqli_fetch_assoc($result)){\n\t\t\t$list[] = $row;\n\t\t}\n\t}\n\tclose_db($conn);\n\treturn $list;\n}", "public function getScientificNameByAlpha()\n {\n return $this\n ->createQueryBuilder('s')\n ->orderBy('s.scientificName', 'ASC')\n ;\n }", "public function actionGetArticlesByAuthor(){\n $author = Author::findOne(['name' => Yii::$app->request->get('name')]);\n $data = Author::getArticles($author->id);\n return $this->render('index', [\n 'articles' => $data['articles'],\n 'pagination' => $data['pagination'],\n ]);\n }", "public function searchProductsByCategoryNameAndKeyword();", "function view_by_name () {\n\t\tif (empty($_GET[\"id\"])) {\n\t\t\treturn _e(\"Missing article name\");\n\t\t}\n\t\t// Get article info\n\t\t$article_info = db()->query_fetch(\"SELECT * FROM \".db('articles_texts').\" WHERE short_url='\"._es($_GET[\"id\"]).\"'\");\n\t\tif (empty($article_info)) {\n\t\t\treturn _e(\"No such article!\");\n\t\t}\n\t\t// Re-map id\n\t\t$_GET[\"id\"] = $article_info[\"id\"];\n\t\t// Display article\n\t\treturn $this->view($article_info);\n\t}", "function searchArticles($keys) {\n $raw_json = file_get_contents(\"http://localhost:8983/solr/help_data/query?q=\" . $keys);\n $json = json_decode($raw_json, true);\n $response = $json['response'];\n $articles = null;\n if ($response['numFound'] > 0) {\n $docs = $response['docs'];\n\n $wizards = array();\n $regulars = array();\n foreach($docs as $doc) {\n $article = new Article($doc);\n if ($article->getArticleType() === \"wizard\") {\n $wizards[] = $article;\n }\n else {\n $regulars[] = $article;\n }\n }\n \n $sorted = $wizards;\n foreach($regulars as $regular) {\n $sorted[] = $regular;\n }\n\n $articles = new Requests($sorted, Requests::Articles);\n }\n\n return $articles;\n}", "function getArticles() {\n $query = \"SELECT Core_Article.categoryID, Core_Category.categoryName, Core_Article.pageID, Core_Page.pageName,\n Core_Article.artID, Core_Article.title, Core_Article.creationDate, Core_Article.modifyDate, Core_Article.accessLevel\n FROM Core_Article\n INNER JOIN Core_Category ON Core_Category.categoryID = Core_Article.categoryID\n INNER JOIN Core_Page ON Core_Page.pageID = Core_Article.pageID\n \";\n \n $content = $this->handleQuery($query);\n \n return $content;\n }", "public function allArticles()\n {\n }", "public function actionGetArticlesByCategory(){\n $category = Category::findOne(['title' => Yii::$app->request->get('title')]);\n $data = Category::getArticles($category->id);\n return $this->render('index', [\n 'articles' => $data['articles'],\n 'pagination' => $data['pagination'],\n ]);\n }", "public function tagNameDisplay(){\n $this->connect();\n $id = $_GET['id'];\n $sql='SELECT name FROM articles INNER JOIN articles_tags ON articles.article_id = articles_tags.article_id INNER JOIN tags ON articles_tags.tag_id = tags.tag_id WHERE articles.article_id=' .$id . ' AND articles.isPublished=1';\n $statement = $this->db->prepare($sql);\n $statement->execute();\n $result = $statement->fetchAll(\\PDO::FETCH_COLUMN);\n return $result;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load all initialized actions/filter, models and external files
public function load() { $this->includes(); $this->inits(); }
[ "public function _loadFilters()\n {\n //include_once XOOPS_ROOT_PATH.'/class/filters/filter.php';\n //foreach ($this->_filters as $f) {\n //\t include_once XOOPS_ROOT_PATH.'/class/filters/'.strtolower($f).'php';\n //}\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\t\tcore::loadClass(\"person_model\");\n\t\tcore::loadClass(\"key_type_model\");\n\t\tcore::loadClass(\"key_status_model\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "private static function load() {\n $paths = self::get_paths();\n\n // Loads application services\n Utils::load_files($paths[\"service_path\"]);\n\n // Loads application models\n Utils::load_files($paths[\"model_path\"]);\n\n // Loads application controllers\n Utils::load_files($paths[\"controller_path\"]);\n }", "public function init() {\n $this->setImport(array(\n 'services.models.*',\n 'services.components.*',\n // 'application.controllers.*',\n 'application.modules.logistics.models.*',\n 'application.components.*',\n \t'application.modules.products.models.*',\n \t'application.modules.systems.models.*',\n \t'application.modules.purchases.models.*',\n 'application.modules.warehouses.models.*',\n ));\n }", "public function init() {\n $this->setImport(array(\n 'systems.models.*',\n 'systems.components.*',\n // 'application.controllers.*',\n 'application.components.*',\n\t\t\t'application.modules.products.models.*',\n 'application.modules.purchases.models.*',\n \t'application.modules.warehouses.models.*',\t\n \t'application.modules.orders.models.*',\n \t'application.modules.logistics.models.*',\t\t\n \t'application.modules.logistics.components.*',\n \t'application.modules.pda.models.*',\t\t\n \t'application.modules.users.models.*',\n \t'application.modules.services.models.*',\n \t'application.modules.services.components.*',\n \t'application.vendors.*',\n \t'services.modules.ebay.components.*',\n \t'services.modules.ebay.controllers.*',\n \t'services.modules.ebay.models.*',\n \t'services.modules.warehouse.components.*',\n \t'services.modules.warehouse.controllers.*',\n \t'services.modules.warehouse.models.*',\n ));\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "private function _load_models() {\n\t\tforeach ($this->models as $model) {\n\t\t\t$this -> load -> model($this -> _model_name($model), $model);\n\t\t}\n\t}", "final public static function loadFilters() {\n \n }", "function initModels()\n {\n $dirname = Router::getAppPath().'/models/';\n if ($handle = opendir($dirname)) \n {\n while (false !== ($entry = readdir($handle))) \n {\n if (strlen($entry) > 2)\n require_once $dirname.$entry;\n }\n closedir($handle);\n }\n }", "public function loadAllFiles(){\n\t\tinclude_once(\"activation/class-tgm-plugin-activation.php\");\n\t\tinclude_once(\"controllers/frontpage_controller.php\");\n\t\tinclude_once(\"controllers/classes/wp_feeds_cpt.php\");\t\n\t\tinclude_once(\"cache/wp-tlc-transients/tlc-transients.php\");\t\t\n\t\tinclude_once(\"cache/feed-rest-cache.php\");\t\t\n\t}", "public function LoadImportantFiles()\n {\n /*\n * load admin routes\n */\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/admin.php');\n\n /*\n * load Authenticate routes\n */\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/auth.php');\n\n\n /*\n * load Guest routes\n */\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/guest.php');\n\n /*\n * load migrations files\n */\n\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n /*\n * loads views files\n */\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laraflat');\n }", "protected static function _loadModels()\r\n\t{\r\n\t\t//Search for models in the models folder\t\t\r\n\t\t$iterator = new FilesystemIterator(self::MODELS_PATH);\r\n\t\tforeach ($iterator AS $file_info) \r\n\t\t{\r\n\t\t\trequire( $file_info->getPathname() );\r\n\t\t}\r\n\t}", "public function loadHooks() {\n\t\t\n\t\t$utils = Utilities::get_instance();\n\t\t$utils->log(\"Loading admin_* hooks\");\n\t\tadd_action( 'admin_init', array( $this, 'register' ), 10 );\n\t\tadd_action( 'admin_menu', array( $this, 'addToAdminMenu' ), 10 );\n\t\t\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'loadInputJS' ) );\n\t\t\n\t\t$utils->log(\"Loading settings-options filter hooks\");\n\t\tadd_filter( 'e20r-settings-option-name', array( $this, 'getOptionName' ), 10, 2 );\n\t\t\n\t\t$utils->log(\"Loading View specific JS path filter\");\n\t\tadd_filter( 'e20r-settings-enqueue-js-path', 'E20R\\PMPro\\Addon\\Email_Confirmation\\Views\\Inputs\\Select::jsPath', 10, 1 );\n\t\t\n\t}", "private function load_dependencies() {\n\n\t\t$this->loader = new Loader();\n\t\t$TSB_hooks_loader = new Init_Functions();\n\t\t$this->loader->add_action( 'init', $TSB_hooks_loader, 'app_output_buffer' );\n\n//\t\t$this->loader->add_action( 'init', \t$TSB_hooks_loader, 'remove_admin_bar' );\n\n\t}", "public function init() {\n\n\t\t// Set up actions and filters as necessary\n\t\t$this->add_hooks();\n\n\t}", "public static function _init(){\n\t\t\tEvents::call('on_before_apps_load');\n\t\t\tforeach(glob(CFG::get('ABS_K2F').'apps/*') as $appname)\n\t\t\t\tif(is_dir($appname))\n\t\t\t\t\tself::load(basename($appname));\n\t\t\tEvents::call('on_after_apps_load');\n\t\t}", "public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( STKBX_DIR . 'lib/admin.php' );\n\t\t}\n\t}", "public function init() {\n $this->setImport([\n 'application.modules.sys.controllers.*',\n 'application.modules.sys.forms.*'\n ]);\n }", "public function loadResources()\n {\n $this->loadViewsFrom($this->path.'/resources/views/', 'ext-'.$this->getName());\n $this->loadTranslationsFrom($this->path.'/resources/lang/', $this->getName());\n }", "private function load_dependencies() {\n // The class responsible for orchestrating the actions and filters of the core plugin.\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-iip-events-loader.php';\n\n // The class responsible for defining all actions that occur in the admin area.\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-iip-events-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-iip-events-api.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-iip-events-cpt.php';\n\n // The class responsible for defining all actions that occur in the public-facing side of the site.\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-iip-events-public.php';\n $this->loader = new IIP_Event\\Loader();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the url of the video that can be inserted in an iframe
public function buildVideoUrl($params) { $videoId = $this->_getVideoId($params); if (!empty($videoId)) { $videoUrl = '//vk.com/video_ext.php' . $videoId; if ($iframeUrlParams) { $videoUrl = $this->_addParamsToUrl($videoUrl, $iframeUrlParams); } return $videoUrl; } }
[ "private function createVideoUrl() {\n\t\t$arguments = array();\n\t\t$arguments['tx_jwplayer_pi1'] = array();\n\t\t$arguments['tx_jwplayer_pi1']['action'] = 'showVideo';\n\t\t$arguments['tx_jwplayer_pi1']['controller'] = 'Player';\n\t\t$settings = $this->settings;\n\t\t$settings['autostart']= TRUE;\n\t\t$settings['movie']= self::UPLOAD_PATH.$settings['movie'];\n\t\t$arguments['tx_jwplayer_pi1']['flash_player_config'] = $this->flashConfigGenerator->encode($settings, $this->getUploadPath() );\n\t\t$url = $this->uriBuilder->setArguments($arguments)->setCreateAbsoluteUri(TRUE)->buildFrontendUri();\n\t\treturn $url;\n\t}", "public function video_url() {\n\t\treturn wp_get_attachment_url( $this->video_id() );\n\t}", "private function create_string_how_to_video() {\n\t\t$video_url = set_url_scheme( 'https://www.youtube.com/embed/b51J1ay7fyk' );\n\n\t\treturn\n\t\t\t'<div style=\"text-align:center; margin: 0px auto 3em;\">' .\n\t\t\t\"<iframe width='560' height='315' src='{$video_url}' frameborder='0' allowfullscreen></iframe>\" .\n\t\t\t'</div>';\n\t}", "public static function build_blog_popup_video_link() {\n\t\t\t$post_id = get_the_ID();\n\t\t\t$video_src = get_post_meta($post_id, 'post_single_video_src', true);\n\t\t\tswitch($video_src) {\n\t\t\t\tcase 'youtube':\n\t\t\t\t\t$video_url = get_post_meta($post_id, 'post_youtube_video_url', true);\n\t\t\t\t\tif(substr_count($video_url, '?') > 0) {\n\t\t\t\t\t\t$video_url = substr($video_url,(stripos($video_url,'?v=')+3));\n\t\t\t\t\t}\n\t\t\t\t\tif(substr_count($video_url, '&') > 0) {\n\t\t\t\t\t\t$video_url = substr($video_url, 0, stripos($video_url,'&'));\n\t\t\t\t\t}\n\t\t\t\t\t$video_url = 'http://youtube.com/watch?v='.$video_url.'&amp;width=1200&amp;height=675';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vimeo':\n\t\t\t\t\t$video_url = get_post_meta($post_id, 'post_vimeo_video_url', true);\n\t\t\t\t\tif(substr_count($video_url, 'vimeo.com/') > 0) {\n\t\t\t\t\t\t$video_url = substr($video_url,(stripos($video_url, 'vimeo.com/')+10));\n\t\t\t\t\t}\n\t\t\t\t\tif(substr_count($video_url, '&') > 0) {\n\t\t\t\t\t\t$video_url = substr($video_url, 0, stripos($video_url,'&'));\n\t\t\t\t\t}\n\t\t\t\t\t$video_url = 'http://vimeo.com/'.$video_url.'&amp;width=1200&amp;height=675';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$video_url = '';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\treturn $video_url;\n\t\t}", "public function getVideoUrl()\n {\n\t\treturn $this->video_url ?: $this->channel->getVideoUrl($this);\n\t}", "public function getVideoUrl()\n {\n $value = $this->get(self::VIDEO_URL);\n return $value === null ? (string)$value : $value;\n }", "public function getUrlVideo()\n {\n return $this->urlVideo;\n }", "function generateVideoEmbedUrl($url){\n $finalUrl = '';\n if(strpos($url, 'facebook.com/') !== false) {\n //it is FB video\n $finalUrl.='https://www.facebook.com/plugins/video.php?href='.rawurlencode($url).'&show_text=1&width=200';\n }else if(strpos($url, 'vimeo.com/') !== false) {\n //it is Vimeo video\n $videoId = explode(\"vimeo.com/\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://player.vimeo.com/video/'.$videoId;\n }else if(strpos($url, 'youtube.com/') !== false) {\n //it is Youtube video\n $videoId = explode(\"v=\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://www.youtube.com/embed/'.$videoId;\n }else if(strpos($url, 'youtu.be/') !== false){\n //it is Youtube video\n $videoId = explode(\"youtu.be/\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://www.youtube.com/embed/'.$videoId;\n }else{\n //Enter valid video URL\n }\n return $finalUrl;\n }", "function system_getVideoURL($iframe)\n{\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n\n // Check if there is a url in the text\n if (preg_match($reg_exUrl, $iframe, $url)) {\n $video_url = str_replace(\"'\", '', $url[0]);\n $video_url = str_replace('\"', '', $video_url);\n $video_url = explode('&', $video_url);\n\n return $video_url[0];\n }\n}", "public function get_iframe_src(){\r\n\t\treturn self::calculate_url($this->params);\r\n\t}", "private function generateUrlForVideo(string $url) : string\n {\n $id = str_after($url, \"=\");\n return \"https://drive.google.com/file/d/\".$id.\"/preview\";\n }", "function neu_custom_iframe_video(){\n\t// get iframe HTML\n\t$iframe = get_field('video');\n\n\n\t// use preg_match to find iframe src\n\tpreg_match('/src=\"(.+?)\"/', $iframe, $matches);\n\t$src = $matches[1];\n\n\n\t// add extra params to iframe src\n\t$params = array(\n\t /*'controls' => 0,*/\n\t 'hd' => 1,\n\t 'autoplay' => 0,\n\t 'rel' \t=> 0,\n\t);\n\n\t$new_src = add_query_arg($params, $src);\n\n\t$iframe = str_replace($src, $new_src, $iframe);\n\n\n\t// add extra attributes to iframe html\n\t$attributes = 'frameborder=\"0\"';\n\n\t$iframe = str_replace('></iframe>', ' ' . $attributes . '></iframe>', $iframe);\n\n\treturn $iframe;\n}", "public function getVideoUrl()\n\t{\n\t\treturn $this->video_url;\n\t}", "public function getURL(){\n return 'https://www.youtube.com/watch?v=' . $this->VideoID;\n }", "function generateVideoEmbedUrl($url){\n $finalUrl = '';\n if(strpos($url, 'facebook.com/') !== false) {\n //it is FB video\n $finalUrl.='https://www.facebook.com/plugins/video.php?href='.rawurlencode($url).'&show_text=1&width=200';\n }else if(strpos($url, 'vimeo.com/') !== false) {\n //it is Vimeo video\n $videoId = explode(\"vimeo.com/\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://player.vimeo.com/video/'.$videoId;\n }else if(strpos($url, 'youtube.com/') !== false) {\n //it is Youtube video\n $videoId = explode(\"v=\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://www.youtube.com/embed/'.$videoId;\n }else if(strpos($url, 'youtu.be/') !== false){\n //it is Youtube video\n $videoId = explode(\"youtu.be/\",$url)[1];\n if(strpos($videoId, '&') !== false){\n $videoId = explode(\"&\",$videoId)[0];\n }\n $finalUrl.='https://www.youtube.com/embed/'.$videoId;\n }else{\n //Enter valid video URL\n }\n return $finalUrl;\n}", "public function getVideoUrl()\n {\n return $this->video_url;\n }", "function video_iframe_YT($video_url)\n{\n $video_iframe = '';\n // -----------------\n if (!empty($video_url)) {\n $video_url = video_cleanURL_YT($video_url);\n $video_iframe = '<iframe height=\"280\" src=\"' . $video_url . '\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>';\n }\n // -----------------\n return $video_iframe;\n}", "abstract public function get_embed_url();", "private function getVideo()\n {\n $video_area = $this->_parser->find('.video-promotion', 0);\n if ($video_area) {\n $video = $video_area->find('a', 0)->href;\n\n return Helper::videoUrlCleaner($video);\n }\n\n return '';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the Organisation model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Organisation::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
[ "protected function findModel($id)\n {\n if (($model = Organization::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('error', 'backend.controllers.organization_page_error', ['ru' => 'The requested page does not exist.']));\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Organizations::findOne($id)) !== null) {\r\n return $model;\r\n }\r\n\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }", "public function find($identifier): ?Model;", "protected function findOrganizationModel($id)\n {\n if (($model = Organization::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested organization does not exist.');\n }", "public function findById($id): Organization{\n $query = <<<SQL\n select id, name, ROUND(longitude/100000, 5) longitude, ROUND(latitude/100000, 5) latitude\n from organizations\n where id=:id;\nSQL;\n $query = $this->db->prepare($query);\n $query->execute([':id' => $id]);\n\n\n $organization = $query->fetch();\n\n if($organization === false){\n throw new ResourceNotFoundException('Could not find organization with given id!');\n }\n \n return new Organization(\n $organization['name'],\n new Point($organization['longitude'], $organization['latitude']),\n $organization['id']\n );\n }", "public function lookupAction()\n {\n $organisationId = (int) $this->params()->fromQuery('organisation');\n $view = new \\Laminas\\View\\Model\\JsonModel();\n\n $data = $this->getOrganisation($organisationId);\n if (!$data) {\n return $this->notFoundAction();\n }\n $view->setVariables(\n [\n 'id' => $data['id'],\n 'name' => $data['name'],\n ]\n );\n\n return $view;\n }", "public function find($id)\n {\n return $this->orgData->find($id);\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = DataRepair::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n \t$model = InputCompanies::find()->where(['guid' => $id])->one();\n \tif ($model !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n /* if (($model = InputCompanies::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n } */\n }", "public function find($organizationId)\n {\n return $this->organization->findOrFail($organizationId);\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = qvdocs::find($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Pay::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\n {\n if (($model = AdvertPosition::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException(200,Yii::t('base',40001));\n }", "protected function findModel($id)\n {\n if (($model = Skenario1::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n{\nif (($model = PsmfSection::findOne($id)) !== null) {\nreturn $model;\n} else {\nthrow new HttpException(404, 'The requested page does not exist.');\n}\n}", "final protected function findModel($companyId)\n {\n $companyId = $this->stringDecode($companyId);\n if (($model = Company::findOne($companyId)) !== null) {\n return $model;\n }\n\n $message = Yii::t(\n 'app',\n 'The requested page does not exist {id}',\n [ 'id' => $companyId]\n );\n\n $bitacora = new Bitacora();\n $bitacora->register(\n $message,\n 'findmodel',\n MSG_SECURITY_ISSUE\n );\n throw new NotFoundHttpException($message);\n }", "protected function findModel($idProjeto)\n {\n if (($model = Projeto::findOne($idProjeto)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = PublicAccount::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModelByPk(\\CActiveRecord $finder, $pk, $throwExceptionIfNotFound = true)\n\t{\n\t\t// Find the model\n\t\t$model = $finder->findByPk($pk);\n\n\t\t// Make sure it's found\n\t\tif (empty($model) && $throwExceptionIfNotFound) {\n\t\t\tthrow new \\CHttpException(404, get_class($finder).' with id \"'.$pk.'\" not found');\n\t\t}\n\n\t\treturn $model;\n\t}", "public function findFirstByPk($pk);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return true if the linked list is empty
public function isEmpty() { //return false if linked list has nodes }
[ "public function is_empty()\r\n\t{\r\n\t\treturn empty( $this->list );\r\n\t}", "public function isEmpty() {\n return 0 === sizeof($this->list);\n }", "function isEmpty() {\n return empty($this->head) && empty($this->tail);\n }", "public function isEmpty()\n {\n return $this->list->is_empty();\n }", "public function isEmpty()\n {\n return !is_array($this->list) || count($this->list) === 0;\n }", "public function empty()\n {\n return count($this->items) <= 0;\n }", "public final function __isEmpty() : bool {\n\t\t\treturn ($this instanceof ILinkedList\\Nil\\Type);\n\t\t}", "public function isEmpty(): bool\n {\n return empty($this->tree);\n }", "public function is_empty() {\n\t\treturn $this->has_lock && 0 === $this->count();\n\t}", "function isEmpty()\r\n\t{\r\n\t\treturn ($this->countGraphs()==0);\r\n\t}", "private function isEmpty(){\n return empty($this->items);\n }", "public function isEmpty()\n {\n return $this->length === 0;\n }", "public function isFull(): bool {\n return $this->tail === (($this->head + 1) % $this->size);\n }", "function isEmpty() {\n return count($this->deque) == 0;\n }", "function isEmpty() {\n return $this->root == null;\n }", "public function isFilled()\n {\n return is_array($this->list) && count($this->list) > 0;\n }", "public function isEmpty()\n {\n return $this->stack->getSize() == 0;\n }", "public function isEmpty() : bool\n {\n return empty($this->queue);\n }", "public function isEmpty()\n {\n if ($this->count == intval(0)) {\n return true;\n } else if ($this->count > intval(0)) {\n return false;\n }\n }", "public function isEmpty() {\n return $this->root === null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of fv_economic_activity.
public function getEconomic_activity() { return $this->fv_economic_activity; }
[ "public function getActivity()\n {\n if (!isset($this->data['fields']['activity'])) {\n if ($this->isNew()) {\n $this->data['fields']['activity'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('activity', $this->data['fields'])) {\n $this->addFieldCache('activity');\n $data = $this->getRepository()->getCollection()->findOne(array('_id' => $this->getId()), array('activity' => 1));\n if (isset($data['activity'])) {\n $this->data['fields']['activity'] = (string) $data['activity'];\n } else {\n $this->data['fields']['activity'] = null;\n }\n }\n }\n\n return $this->data['fields']['activity'];\n }", "public function fValue() {\n\t\treturn $this->column('f_value');\n\t}", "public function getEstActivo()\n {\n return $this->estActivo;\n }", "public function getvisitFinance()\n {\n return $this->visitfinance;\n }", "public function getValor_oferta()\n {\n return $this->valor_oferta;\n }", "public function getValue()\n {\n return $this->getField(OBX::OBSERVATION_RESULT_FIELD);\n }", "public function activity() {\n\t\tif ( empty( $this->meta['activity'] ) ) {\n\t\t\t$activity = new Tribe__Events__Aggregator__Record__Activity;\n\t\t\t$this->update_meta( 'activity', $activity );\n\t\t}\n\n\t\treturn $this->meta['activity'];\n\t}", "public function getEstciv(){\n\t\treturn $this->estciv;\n\t}", "public function getActivityRating()\n {\n return isset($this->activity_rating) ? $this->activity_rating : 0;\n }", "function getStatValue()\r\n { \r\n return $this->getValueByFieldName('statvalues_value');\r\n }", "public function activity() {\n\t\treturn $this->session['last_activity'];\n\t}", "public function getEducationalActivities()\n {\n if (array_key_exists(\"educationalActivities\", $this->_propDict)) {\n return $this->_propDict[\"educationalActivities\"];\n } else {\n return null;\n }\n }", "function getActivityId() {\n return $this->activity_id;\n }", "public function getFiscEvo() {\n return $this->fiscEvo;\n }", "public function getActivityRef()\n {\n return $this->activityRef;\n }", "public function getPeriodoActivo() {\n return $this->periodoActivo;\n }", "public function getEstadoFacturaCuentaVivienda(){\n return $this->estadoFacturaCuentaVivienda;\n }", "public static function periodo_actual()\n {\n $periodoActivo = Periodo::where('anoStatus', 'A')\n ->where('INCOdigo', Self::codigo_inst_seleccionada())\n ->first();\n return $periodoActivo != null ? $periodoActivo : null;\n }", "public function ejercicioActivo()\n {\n \t $fecha =$this->where('activo',1)->get()->first();\n \t return $fecha->fecha_cierre;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: Dashboard Google Page Rank Plugin URI: Description: Shows your google pagerank in the wordpress dashboard Author: Weston Deboer Version: 1.1 Author URI:
function gpr_wp_dashboard_test() { include('pagerank.php'); $url = get_bloginfo('url'); echo $url.' has a Page Rank of '.$pr_rank; echo getpagerank($url ); }
[ "function PN_Referer_Default()\n{\n\tglobal $pluginMenuURL, $pluginSelfParam;\n\tif (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['page']))\n\t\t$_GET['page'] = $_POST['page'];\n\t\n\t$page = Setting::getBlogSetting('RowsPerPageReferer',20);\n\tif (empty($_POST['perPage'])) { \n\t\t$perPage = $page; \n\t} else if ($page != $_POST['perPage']) { \n\t\tSetting::setBlogSetting('RowsPerPageReferer',$_POST['perPage']); \n\t\t$perPage = $_POST['perPage']; \n\t} else { \n\t\t$perPage = $_POST['perPage']; \n\t} \n?>\n\t\t\t\t\t\t<div id=\"part-statistics-rank\" class=\"part\">\n\t\t\t\t\t\t\t<h2 class=\"caption\"><span class=\"main-text\"><?php echo _t(\"리퍼러 순위\");?></span></h2>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<table class=\"data-inbox\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th class=\"number\"><span class=\"text\"><?php echo _t(\"순위\");?></span></th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"site\"><span class=\"text\"><?php echo _t(\"리퍼러\");?></span></th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n<?php\n\t$temp = Statistics::getRefererStatistics(getBlogId());\n\tfor ($i=0; $i<count($temp); $i++) {\n\t\t$record = $temp[$i];\n\t\t\n\t\t$className = ($i % 2) == 1 ? 'even-line' : 'odd-line';\n\t\t$className .= ($i == sizeof($temp) - 1) ? ' last-line' : '';\n?>\n\t\t\t\t\t\t\t\t\t<tr class=\"<?php echo $className;?> inactive-class\" onmouseover=\"rolloverClass(this, 'over')\" onmouseout=\"rolloverClass(this, 'out')\">\n\t\t\t\t\t\t\t\t\t\t<td class=\"rank\"><?php echo $i + 1;?>.</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"site\"><a href=\"http://<?php echo Misc::escapeJSInAttribute($record['host']);?>\" onclick=\"window.open(this.href); return false;\"><?php echo htmlspecialchars($record['host']);?></a> <span class=\"count\">(<?php echo $record['count'];?>)</span></td>\n\t\t\t\t\t\t\t\t\t</tr>\n<?php\n\t}\n?>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<hr class=\"hidden\" />\n\t\t\t\t\t\t\n\t\t\t\t\t\t<form id=\"part-statistics-log\" class=\"part\" method=\"post\" action=\"<?php echo $pluginMenuURL;?>\">\n\t\t\t\t\t\t\t<h2 class=\"caption\"><span class=\"main-text\"><?php echo _t(\"리퍼러 로그\");?></span></h2>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<table class=\"data-inbox\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th class=\"number\"><span class=\"text\">날짜</span></th>\n\t\t\t\t\t\t\t\t\t\t<th class=\"site\"><span class=\"text\">주소</span></th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n<?php\n\t$more = false;\n\tlist($referers, $paging) = Statistics::getRefererLogsWithPage($_GET['page'], $perPage);\n\tfor ($i=0; $i<count($referers); $i++) {\n\t\t$record = $referers[$i];\n\t\t\n\t\t$className = ($i % 2) == 1 ? 'even-line' : 'odd-line';\n\t\t$className .= ($i == sizeof($referers) - 1) ? ' last-line' : '';\n?>\n\t\t\t\t\t\t\t\t\t<tr class=\"<?php echo $className;?> inactive-class\" onmouseover=\"rolloverClass(this, 'over')\" onmouseout=\"rolloverClass(this, 'out')\">\n\t\t\t\t\t\t\t\t\t\t<td class=\"date\"><?php echo Timestamp::formatDate($record['referred']);?></td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"address\"><a href=\"<?php echo Misc::escapeJSInAttribute($record['url']);?>\" onclick=\"window.open(this.href); return false;\" title=\"<?php echo htmlspecialchars($record['url']);?>\"><?php echo fireEvent('ViewRefererURL', htmlspecialchars(UTF8::lessenAsEm($record['url'], 70)), $record);?></a></td>\n\t\t\t\t\t\t\t\t\t</tr>\n<?php\n\t}\n?>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"data-subbox\">\n\t\t\t\t\t\t\t\t<div id=\"page-section\" class=\"section\">\n\t\t\t\t\t\t\t\t\t<div id=\"page-navigation\">\n\t\t\t\t\t\t\t\t\t\t<span id=\"page-list\">\n<?php\n\t$paging['prefix'] = $pluginSelfParam . '&page=';\n\t$pagingTemplate = '[##_paging_rep_##]';\n\t$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';\n\techo str_repeat(\"\\t\", 8).Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate).CRLF;\n?>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"page-count\">\n\t\t\t\t\t\t\t\t\t\t<?php echo Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 0);?>\n\t\t\t\t\t\t\t\t\t\t<select name=\"perPage\" onchange=\"document.getElementById('part-statistics-log').submit()\">\t\t\t\t\t\n<?php\n\tfor ($i = 10; $i <= 30; $i += 5) {\n\t\tif ($i == $perPage) {\n?>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $i;?>\" selected=\"selected\"><?php echo $i;?></option>\n<?php\n\t\t} else {\n?>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $i;?>\"><?php echo $i;?></option>\n<?php\n\t\t}\n\t}\n?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t<?php echo Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 1);?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"clear\"></div>\n<?php \n}", "function wp_dashboard_plugins()\n{\n}", "public function getPageRank()\n\t{\n\t\t$chwrite = $this->CheckHash($this->HashURL($this->url));\n\n\t\t$url=\"http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=\".$chwrite.\"&features=Rank&q=info:\".$this->url.\"&num=100&filter=0\";\n\t\t$data = $this->getPage($url);\n\t\tpreg_match('#Rank_[0-9]:[0-9]:([0-9]+){1,}#si', $data, $p);\n\t\t$value = isset($p[1]) ? $p[1] : 0;\n\n\t\treturn $value;\n\t}", "function pagerank_($url,$width=100,$method='image') \n {\n \tif (!preg_match('/^(http:\\/\\/)?([^\\/]+)/i', $url)) { $url='http://'.$url; }\n \t$pr=SITE_ANALYSE::getpr($url);\n \t$pagerank=\"PageRank: $pr/10\";\n \n \t//The (old) image method\n \tif ($method == 'image') {\n \t$prpos=$width*$pr/10;\n \t$prneg=$width-$prpos;\n \t$html='<img src=\"pos.jpg\" width='.$prpos.' height=15px border=0 alt=\"'.$pagerank.'\"><img src=\"neg.jpg\" width='.$prneg.' height=15px border=0 alt=\"'.$pagerank.'\">';\n \t}\n \t//The pre-styled method\n \tif ($method == 'style') {\n \t$prpercent=100*$pr/10;\n \t$html='<div style=\"position: relative; width: '.$width.'px; padding: 0; background: #D9D9D9;\"><strong style=\"width: '.$prpercent.'%; display: block; position: relative; background: #5EAA5E; text-align: center; color: #333; height: 10px; line-height: 10px;\"><span></span></strong></div>';\n \t}\n \n \n if($pr=='')\n {\n $out= '<font color=red><b>Unrank</b></font>';\n }\n else\n {\n \t $out=\"<b>Page Rank:</b>(<font color=red><b>$pr<b></font>/10)\";\n \t}\n \treturn $pr;//$out;\n }", "function GooglePR_install() {\r\n\tglobal $pluginName;\r\n\t$arrPlugin['Name']=\"GooglePR\"; //Plugin name\r\n\t$arrPlugin['Desc']=\"GooglePR\"; //Plugin title\r\n\t$arrPlugin['Type']=\"Func\"; //Plugin type\r\n\t$arrPlugin['Code']=\"\"; //Plugin htmlcode\r\n\t$arrPlugin['Path']=\"\"; //Plugin Path\r\n\t$arrPlugin['DefaultField']=\"\"; //Default Filed\r\n\t$arrPlugin['DefaultValue']=\"\"; //Default value\r\n\r\n\t$ActionMessage=install_plugins($arrPlugin);\r\n\treturn $ActionMessage;\r\n}", "public function update_statistics()\r\n {\r\n $pagerank = Google::get_pagerank($this->domain);\r\n\r\n DB::connect()->exec(\"UPDATE site SET pagerank = '$pagerank' WHERE id = '$this->id' LIMIT 1\");\r\n\r\n $this->update_keyword_rankings();\r\n }", "public function plugin_page() {\n\n\t\t// load partial\n\t\trequire_once AMC_PLUGIN_DIR . 'admin/partials/amc-admin-plugin-page-display.php';\n\n\t}", "public function facetwp_ga() {\n\n\n\t\tif ( function_exists( 'FWP' ) && FWP()->display->load_assets ) {\n\n?>\n<script>\n(function($) {\n$(document).on('facetwp-loaded', function() {\n\tif (FWP.loaded && (typeof ga == 'function') ) {\n\t\tga('send', 'pageview', window.location.pathname + window.location.search);\n\t}\n});\n})(jQuery);\n</script>\n<?php\n\n\t\t}\t\n\n\t}", "function plugin_shortcode() {\r\n \r\n ?>\r\n\r\n\t<h2><?php _e('Add wpPlugin', 'wpscripts'); ?></h2>\r\n\t\r\n\t<div style=\"width: 600px;\">\r\n\t\t<p>\r\n\t\t\tUse the Macro code below to display the wpPlugin in your website.\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\tYou must create a dedicated page for this feed. After you create the page, copy and paste the Macro Code into the page. You must use HTML view when you add the Macro Code.\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\tMacro Code:\r\n\t\t\t<br />\r\n\t\t\t<h3>[plugins]</h3>\r\n\t\t</p>\r\n\t</div>\r\n\t\r\n\t<?php\t\t\r\n\t\r\n }", "function cps_admin_add_page() {\t\n\tadd_options_page( CUDESO_POST_STATS_PLUGIN_NAME . ' Settings', 'Cudeso Post Stats', 'manage_options', __FILE__ , 'cps_plugin_options_page');\n}", "function nsp_DisplayCreditsPage() {\n\n global $pagenow;\n $support_pluginpage=\"<a href='https://wordpress.org/support/plugin/newstatpress' target='_blank'>\".__('support page','newstatpress').\"</a>\";\n $author_linkpage=\"<a href='http://newstatpress.altervista.org/?page_id=2' target='_blank'>\".__('the author','newstatpress').\"</a>\";\n $CreditsPage_tabs = array( 'development' => __('Development','newstatpress'),\n 'translation' => __('Translation','newstatpress'),\n 'donation' => __('Donation','newstatpress')\n );\n $page='nsp_credits';\n \n $contributors = array(\n array('Stefano Tognon', 'NewStatPress developer'),\n array('cHab', 'NewStatPress collaborator'),\n array('Daniele Lippi', 'Original StatPress developer'),\n array('Sisko', 'Open link in new tab/window<br>New displays of data for spy function<br>'),\n array('from wp_slimstat', 'Add option for not track given IPs<br /> Add option for not track given permalinks'),\n array('Ladislav', 'Let Search function to works again'),\n array('from statpress-visitors', 'Add new OS (+44), browsers (+52) and spiders (+71)<br /> Add in the option the ability to update in a range of date<br /> New spy and bot'),\n array('Maurice Cramer','Add dashboard widget<br /> Fix total since in overwiew<br /> Fix missing browser image and IE aligment failure in spy section<br /> Fix nation image display in spy'),\n array('Ruud van der Veen', 'Add tab delimiter for exporting data'),\n array('kjmtsh', 'Many fixes about empty query result and obsolete functions'),\n array('Adrián M. F.', 'Find a XSS and a SQL injection'),\n array('White Fir Design', 'Find a SQL injection'),\n array('Michael Kapfer - HSASec-Team', 'Find a persistent XSS via HTTP-Header (Referer)(no authentication required)')\n );\n\n $translators = array(\n array('shilom', 'French Update'),\n array('Alphonse PHILIPPE', 'French Update'),\n array('Vincent G.', 'Lithuanian Addition'),\n array('Christopher Meng', 'Simplified Chinese Addition'),\n array('godOFslaves', 'Russian Update'),\n array('Branco', 'Slovak Addition'),\n array('Peter Bago', 'Hungarian Addition'),\n array('Boulis Antoniou', 'Greek Addition'),\n array('Michael Yunat', 'Ukranian Addition'),\n array('Pawel Dworniak', 'Polish Update'),\n array('Jiri Borovy', 'Czech Update')\n );\n\n $donators = array(\n array('Sergio L.', '08/12/2014 <br /> 29/12/2013 <br /> 14/09/2013 <br /> 01/09/2013 <br />03/08/2013'),\n array('Ottavio F.', '14/10/2013'),\n array('Hubert H.', '01/08/2013'),\n array('Fleisher D.', '12/02/2015')\n );\n\n echo \"<div class='wrap'><h2>\"; _e('Credits','newstatpress'); echo \"</h2>\";\n echo \"<table><tr><td>\";\n $credits_introduction=sprintf(__('If you have found this plugin usefull and you like it, you can support the development by reporting bugs on the %s or by adding/updating translation by contacting directly %s. As this plugin is maintained only on free time, you can also make a donation by clicking on the button to support the work.','newstatpress'), $support_pluginpage, $author_linkpage);\n echo $credits_introduction;\n echo \"</td><td class='don'>\";\n echo \"<form method='post' target='_blank' action='https://www.paypal.com/cgi-bin/webscr'>\n <input type='hidden' value='_s-xclick' name='cmd'></input>\n <input type='hidden' value='F5S5PF4QBWU7E' name='hosted_button_id'></input>\n <input class='button button-primary perso' type=submit value='\"; _e('Make a donation','newstatpress');\n echo \"'></form></td></tr></table>\";\n\n if ( isset ( $_GET['tab'] ) ) nsp_DisplayTabsNavbarForMenuPage($CreditsPage_tabs,$_GET['tab'],$page);\n else nsp_DisplayTabsNavbarForMenuPage($CreditsPage_tabs, 'development',$page);\n\n if ( $pagenow == 'admin.php' && $_GET['page'] == $page ){\n\n if ( isset ( $_GET['tab'] ) ) $tab = $_GET['tab'];\n else $tab = 'development';\n\n echo \"<table class='credit'>\\n\";\n echo \"<thead>\\n<tr><th class='cell-l'>\"; _e('Contributor','newstatpress');\n switch ( $tab ) {\n\n case 'development' :\n echo \"</th>\\n<th class='cell-r'>\"; _e('Description','newstatpress'); echo \"</th></tr>\\n</thead>\\n<tbody>\";\n foreach($contributors as $contributors)\n {\n echo \"<tr>\\n<td class='cell-l'>$contributors[0]</td>\\n<td class='cell-r'>$contributors[1]</td>\\n</tr>\\n\";\n };\n break;\n\n case 'translation' :\n echo \"</th>\\n<th class='cell-r'>\"; _e('Language','newstatpress'); echo \"</th></tr>\\n</thead>\\n<tbody>\";\n foreach($translators as $contributors)\n {\n echo \"<tr>\\n\";\n echo \"<td class='cell-l'>$contributors[0]</td>\\n\";\n echo \"<td class='cell-r'>$contributors[1]</td>\\n\";\n echo \"</tr>\\n\";\n };\n break;\n\n case 'donation' :\n echo \"</th>\\n<th class='cell-r'>\"; _e('Date','newstatpress'); echo \"</th></tr>\\n</thead>\\n<tbody>\";\n foreach($donators as $contributors)\n {\n echo \"<tr>\\n\";\n echo \"<td class='cell-l'>$contributors[0]</td>\\n\";\n echo \"<td class='cell-r'>$contributors[1]</td>\\n\";\n echo \"</tr>\\n\";\n };\n break;\n }\n echo \"</tbody>\";\n echo \"<table class='credit-footer'>\\n<tr>\\n<td>\"; _e('Plugin homepage','newstatpress');\n echo \": <a target='_blank' href='http://newstatpress.altervista.org'>Newstatpress</a></td></tr>\";\n echo \"<tr>\\n<td>\"; _e('RSS news','newstatpress');\n echo \": <a target='_blank' href='http://newstatpress.altervista.org/?feed=rss2'>\"; _e('News','newstatpress'); echo \"</a></td></tr>\";\n echo \"</tr></table>\";\n echo \"</table>\";\n }\n}", "function wikiplugin_trackerprefill_help() {\n\t$help = tra('Displays a button to link to a page with a tracker plugin with prefilled tracker fields.');\n\t$help .= '~np~{TRACKERPREFILL(page=trackerpage,label=text,field1=id,value1=, field2=id,value2=... /)}';\n\treturn $help;\n}", "function challenge_page()\n{\n add_menu_page(\n \"Galan's Plugin\",\n \"Galan's Plugin\",\n 'manage_options',\n plugin_dir_path(__FILE__) . 'view.php',\n null,\n 'dashicons-thumbs-up',\n 100\n );\n}", "function swp_endpoint_footer_social_google_plus_link(){\n \n /***** register slider title *****/\n register_rest_route(\n 'swp/v1/general-settings',\n '/footer/google-plus/',\n array(\n 'methods' => 'GET',\n 'callback' => array( $this, 'swp_endpoint_footer_social_google_plus_link_callback' ),\n )\n );\n }", "function custom_toolbar_link($wp_admin_bar) {\n\t$args = array(\n\t\t'id' => 'wpbeginner',\n\t\t'title' => 'Search WPBeginner', \n\t\t'href' => 'https://www.google.com:443/cse/publicurl?cx=014650714884974928014:oga60h37xim', \n\t\t'meta' => array(\n\t\t\t'class' => 'wpbeginner', \n\t\t\t'title' => 'Search WPBeginner Tutorials'\n\t\t\t)\n\t);\n\t$wp_admin_bar->add_node($args);\n}", "function league_rank_load_widget() {\n\tregister_widget( 'league_rank_widget' );\n}", "function rkv_yoast_ga_page() {\n // check for the defined file in the event that the plugin\n // has been removed\n if ( ! defined( 'GAWP_FILE' ) ) {\n return;\n }\n // set the path\n $path = plugin_dir_path( GAWP_FILE );\n // load our two files\n require_once( $path . 'admin/class-admin-ga-js.php' );\n require_once( $path . 'admin/pages/settings.php' );\n}", "function pagerank($url, $width=40, $method='style') {\n if (!preg_match('/^(http:\\/\\/)?([^\\/]+)/i', $url)) {\n $url = 'http://' . $url;\n }\n $pr = getpr($url);\n $pagerank = \"$pr <img src=\\\"/img/pr$pr.gif\\\" width=\\\"40\\\" height=\\\"5\\\" border=\\\"0\\\" align=\\\"absmiddle\\\">\";\n\n//The (old) image method\n if ($method == 'image') {\n $prpos = $width * $pr / 10;\n $prneg = $width - $prpos;\n $html = '<img src=\"http://www.google.com/images/pos.gif\" width=' . $prpos . ' height=4 border=0 alt=\"' . $pagerank . '\"><img src=\"http://www.google.com/images/neg.gif\" width=' . $prneg . ' height=4 border=0 alt=\"' . $pagerank . '\">';\n }\n//The pre-styled method\n if ($method == 'style') {\n $prpercent = 100 * $pr / 10;\n $html = '<div style=\"position: relative; width: ' . $width . 'px; padding: 0; background: #D9D9D9;\"><strong style=\"width: ' . $prpercent . '%; display: block; position: relative; background: #5EAA5E; text-align: center; color: #333; height: 4px; line-height: 4px;\"><span></span></strong></div>';\n }\n\n $out = '' . $pagerank . '';\n return $out;\n}", "public function _set_obj_pagerank()\n {\n $pr = $this->_pagerank_handler->get_page_rank_from_google($this->get('url'), $this->get('pagerank'));\n\n $this->setVar('pagerank', $pr);\n $this->setVar('pagerank_update', time());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a gallery based on slug.
public function get_gallery_by_slug( $slug ) { return envira_get_gallery_by_slug( $slug ); }
[ "public static function findBySlug($slug)\n {\n return self::where(['slug' => $slug])->with('photos')->first();\n }", "function ap_get_galleries()\r\n{\r\n return get_posts([\r\n 'post_type' => 'rl_gallery',\r\n ]);\r\n}", "protected function listGalleries()\n {\n $galleries = new galleryList();\n $galleries = $galleries->isPublished()->get();\n\n /*\n * Set url's for each gallery\n */\n\n $galleries->each(function($gallery){\n $gallery->setUrl($this->galleryPage,$this->controller);\n\n $gallery->categories->each(function($category){\n $category->setUrl($this->categoryPage,$this->controller);\n });\n });\n\n return $galleries;\n }", "public function getGallery(): Gallery\n {\n return Gallery::findById($this->galleryId);\n }", "function find_gallery( $id ) { \n global $wpdb;\n \n if( is_numeric($id) ) {\n $gallery = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM \" .$wpdb->prefix . \"cvg_gallery WHERE gid = %d\", $id ) );\n } \n \n // Build the object from the query result\n if ($gallery) {\n // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it\n $gallery->title = stripslashes($gallery->title);\n $gallery->galdesc = stripslashes($gallery->galdesc);\n $cool_video_gallery = new CoolVideoGallery();\n $gallery->abspath = $cool_video_gallery->winabspath . $gallery->path;\n \n return $gallery; \n } else \n return false;\n }", "public static function single_listing_gallery() {\n\t\tDirectorist_Support::single_listing_gallery();\n\t}", "function get_gallery( $post_id = null )\n {\n return post_gallery()->{'_c_return_GalleryController@get'}( $post_id );\n }", "public function getUserGalleries();", "public function getGallery() \n {\n // Parameter is required as a string\n $this->validateParameter('code', $this->param['code'], STRING);\n $this->qr->setEventCode($this->param['code']);\n \n if ( !$this->qr->getGallery() ) { \n $this->throwException(GALLERY_NOT_AVAILABLE, \"Nothing found with your code. Double check your code.\");\n }\n\n $this->response(GALLERY_SUCCESS_OBTAINED, $this->qr->getImages());\n }", "function jet_engine_get_gallery() {\n\tif ( ! class_exists( 'Jet_Engine_Img_Gallery' ) ) {\n\t\trequire_once jet_engine()->plugin_path( 'includes/classes/gallery.php' );\n\t}\n}", "public function get_gallery( $id ) {\n\n\t\t\t// Return the gallery data.\n\t\t\treturn envira_get_gallery( $id );\n\n\t\t}", "public function getGallery() {\n return $this->gallery;\n }", "function showGalleries()\n\t{\n\t\tglobal $_CFG;\n\t\tglobal $web;\n\t\t\n\t\t$portfolioManager = new PortfolioManager();\n\t\t$cat = $web->active_category;\n\t\t$gallery = '';\n\t\t$defTitle = '';\n\t $defDesc = '';\n\t\t\n\t\t// getting project description\n\t\t$properties = @unserialize( $web->category_data[$cat]['properties']);\n\t if ( @$properties['description_title'] AND @$properties['description_text'] ) {\n\t $defTitle = $properties['description_title'];\n\t $defDesc = $properties['description_text'];\n\t }\n\t \n\t\t$query = \"SELECT * FROM _mod_portfolio WHERE active=1 AND category_id=\".$cat.\" ORDER BY sort_id ASC\";\n\t\t$sql_res = mysql_query( $query );\n\t\twhile ( $portfolioArr = mysql_fetch_assoc($sql_res) )\n\t\t{\n\t\t\tif ( $portfolioArr['image_small'] )\n\t\t\t{\n\t\t\t\t$image = @unserialize( $portfolioArr['image_small'] );\n\t\t\t\t$title \t = $defTitle ? $defTitle : $portfolioArr['title_'.$web->lang_prefix];\n\t\t\t\t$desc = $defDesc ? $defDesc : $portfolioArr['description_'.$web->lang_prefix];\n\t\t\t\t$imageSrc = $portfolioManager->getMainImageUrl( basename($image['src']) );\n\t\t\t\t$thumbSrc = $portfolioManager->getThumbnailUrl( basename($image['src']) );\n\n\t\t\t\t$gallery .= '<li><a href=\"#\"><img src=\"/images/'.$thumbSrc.'\" data-large=\"/images/'.$imageSrc.'\" title=\"'.$title.'\" data-description=\"'.htmlspecialchars($desc).'\"></a></li>'.\"\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $gallery )\n\t\t{\n\t\t \n\t\t\treturn array(\n\t\t\t\t\t\t'gallery' =>' \n\t\t\t\t\t\t<div id=\"rg-gallery\" class=\"rg-gallery\">\n \t\t\t\t\t\t<div class=\"rg-thumbs\">\n <div class=\"es-carousel-wrapper\">\n <div class=\"es-carousel\">\n <ul>'.$gallery.'</ul>\n </div>\n </div>\n </div>\n </div>');\n\t\t\t\n\t\t} else {\n\t\t\treturn array( \n\t\t\t\t\t\t'gallery' => '<div style=\"font-size:14px; letter-spacing:3px; font-weight:bold; \">Sorry, gallery is empty!</div>',\n\t\t\t );\n\t\t}\n\t}", "public function gallery()\n {\n $sql = 'SELECT * FROM `photos`';\n return $this->_db->fetchAll($sql);\n }", "public function Gallery() {\n if($this->Images()->exists()) {\n $vars = array(\n 'HideDescription' => $this->HideDescription,\n 'Images' => $this->Images()->sort('SortOrder')\n );\n\n return $this->renderWith('Gallery',$vars);\n } else\n return \"\";\n }", "public function getAllGallery() {\n return $this->galleryCollectionFactory->create()\n ->addFieldToFilter(\"status\", \"1\")\n ->setOrder('updated_at', 'DESC');\n }", "static function instance_from_gallery($shortcode){\n\n\t}", "public function AllGalleries() {\n\n $apipath = '/allconvertzen';\n return $this->CallAPI($apipath);\n }", "public function get_by_slug($slug)\r\n {\r\n // Build query\r\n $sql = 'SELECT product_name, product_description, product_paypal_html, image_filename, ';\r\n $sql .= ' product_price_low, product_price_high, collection_name, collection_slug FROM products ';\r\n $sql .= 'LEFT JOIN images ON products.image_id = images.image_id ';\r\n $sql .= 'LEFT JOIN collections ON products.collection_id = collections.collection_id ';\r\n $sql .= 'WHERE product_slug = ?';\r\n\r\n // Execute\r\n $query = $this->db->query($sql, array($slug));\r\n\r\n // return single result\r\n return $query->row_array();\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will register a webhook url for the invitee.canceled event
public function registerInviteeCanceled($url){ return $this->register(['url'=>$url,'events'=>['invitee.canceled']]); }
[ "public function removeWebhook();", "public function get_cancel_endpoint()\n {\n }", "abstract public function onCancel(Request $request);", "public function getCanceledUrl()\n {\n return $this->getVal('canceled_url');\n }", "function set_cancel_url($cancel_url){\n $this->cancel_url = $cancel_url;\n return $cancel_url;\n }", "function getCancelUrl() {\n return assemble_url('invoice_cancel', array('invoice_id' => $this->getId()));\n }", "function deactivate_webhook($webhook_id) {\n return $this->put_request($this->_lists_base_route.'webhooks/'.$webhook_id.'/deactivate.json', '');\n }", "function get_cancel_url(){\n return $this->cancel_url;\n }", "public function setWebhookUrl($webhookUrl);", "public function getCancelUrl()\n {\n return $this->getApiUrl().'cancel';\n }", "public static function webhookUrl()\n {\n return config('cashier.webhook') ?? route('cashier.webhook');\n }", "public function delete(&$webhook)\n {\n }", "public function cancelInvite(Request $request) {\n try {\n $validator = Validator::make($request->all(), [\n 'teamName' => 'required|string',\n 'userEmail' => 'required|email',\n ]);\n if($validator->fails()) {\n $message = $validator->errors()->all();\n return JSONResponse::response(400, $message);\n }\n\n $teamName = Session::get('team_name');\n $teamNameCheck = Team::where('teamName','=',$teamName)\n ->first();\n\n if(!$teamNameCheck) {\n return JSONResponse::response(400,\"Invalid Team Name\");\n }\n\n $email = $request->input('userEmail');\n $emailCheck = Registration::where('emailId','=',$email)\n ->first();\n\n if(!$emailCheck) {\n return JSONResponse::response(400,\"Invalid Email ID\");\n }\n\n $inviteStatusCheck = Invite::where('toRegistrationId','=',$emailCheck->id)\n ->where('fromTeamId','=',$teamNameCheck->id)\n ->where('status','=','SENT')\n ->first();\n\n if(!$inviteStatusCheck) {\n return JSONResponse::response(400,\"Invalid Request. No Invite to Cancel\");\n }\n\n Notification::where('userId','=',$emailCheck->id)\n ->where('messageType','=','INVITE')\n ->where('teamName','=',$teamName)\n ->delete();\n\n Invite::where('toRegistrationId','=',$emailCheck->id)\n ->where('fromTeamId','=',$teamNameCheck->id)\n ->delete();\n\n return JSONResponse::response(200,\"Invite Cancelled\");\n\n } catch (Exception $e) {\n Log::error($e->getMessage().\" \".$e->getLine());\n return JSONResponse::response(500, $e->getMessage());\n }\n }", "public function process_webhook_canceled($post) {\n $order = $this->get_order($post['reference']);\n\n\t\tif (!$order) {\n WC_Yuansfer_Logger::log('Could not find order: ' . $post['reference']);\n\t\t\treturn;\n\t\t}\n\n $status = $order->get_status();\n\n\t\tif ('on-hold' !== $status || 'cancelled' !== $status) {\n\t\t\treturn;\n\t\t}\n\n\t\t$order->update_status('cancelled', __('This payment has cancelled.', 'woocommerce-yuansfer'));\n\n\t\tdo_action('wc_gateway_yuansfer_process_webhook_payment_error', $order, $post);\n\t}", "public function getCancelUrl()\n {\n return $this->cancel_url;\n }", "public function getCancelUrl() {\n }", "public function deleteWebhook($uniqueId);", "function venture_invite_remove() {\n $code = arg(2);\n if ($code) {\n global $user;\n $invite = invite_load($code);\n \n // Inviter must be the current user.\n if ($invite->inviter->uid == $user->uid) {\n db_query(\"UPDATE {invite} SET canceled = 1 WHERE reg_code = '%s'\", $invite->reg_code);\n \n if (!$invite->joined && $invite->expiry > time()) {\n drupal_set_message(\"Invitation to {$invite->email} has been withdrawn.\");\n }\n }\n else {\n drupal_set_message('Unable to remove invitation.', 'error');\n }\n }\n}", "public function workflow_cancel() {\n // nonce check\n check_ajax_referer( 'owf_signoff_ajax_nonce', 'security' );\n\n // sanitize post_id\n $post_id = intval( sanitize_text_field( $_POST[\"post_id\"] ) );\n\n // capability check\n if ( ! OW_Utility::instance()->is_post_editable( $post_id ) ) {\n wp_die( __( 'You are not allowed to create/edit post.' ) );\n }\n\n /* sanitize incoming data */\n $user_id = get_current_user_id();\n $history_id = intval( sanitize_text_field( $_POST[\"history_id\"] ) );\n $user_comments = sanitize_text_field( $_POST[\"comments\"] );\n\n\n $comments[] = array( \"send_id\" => $user_id, \"comment\" => stripcslashes( $user_comments ) );\n $comments_json = json_encode( $comments );\n\n // cancel the workflow.\n $data = array(\n 'action_status' => \"cancelled\",\n 'comment' => $comments_json,\n 'post_id' => $post_id,\n 'from_id' => $history_id,\n 'create_datetime' => current_time( 'mysql' )\n );\n $action_history_table = OW_Utility::instance()->get_action_history_table_name();\n $review_action_table = OW_Utility::instance()->get_action_table_name();\n $new_action_history_id = OW_Utility::instance()->insert_to_table( $action_history_table, $data );\n\n if ( isset( $_POST[ \"hi_task_user\" ] ) && $_POST[ \"hi_task_user\" ] != \"\" ) {\n $current_actor_id = intval( sanitize_text_field( $_POST[ \"hi_task_user\" ] ) );\n } else {\n $current_actor_id = get_current_user_id();\n }\n\n $ow_email = new OW_Email( );\n $ow_history_service = new OW_History_Service();\n\n if ( $new_action_history_id ) {\n global $wpdb;\n // delete all the unsend emails for this workflow\n $ow_email->delete_step_email( $history_id, $current_actor_id );\n $result_history = $wpdb->update( $action_history_table, array( 'action_status' => 'processed' ), array( 'ID' => $history_id ) );\n\n $result_review_history = $wpdb->update( $review_action_table, array( 'review_status' => 'cancelled',\n 'update_datetime' => current_time( 'mysql' ) ), array( 'action_history_id' => $history_id ) );\n\n // send email about workflow cancelled\n $post = get_post( $post_id );\n $post_author = get_userdata( $post->post_author );\n $title = \"'{$post->post_title}' was cancelled from the workflow\";\n $full_name = OW_Utility::instance()->get_user_name( $user_id );\n\n $msg = sprintf( __( '<div>Hello %1$s,</div><p>The post <a href=\"%2$s\" title=\"%3$s\">%3$s</a> has been cancelled from the workflow.</p>', 'oasisworkflow' ), $post_author->display_name, esc_url( get_permalink( $post_id ) ), $post->post_title );\n\n if ( ! empty( $user_comments ) ) {\n $msg .= \"<p><strong>\" . __( 'Additionally,', \"oasisworkflow\" ) . \"</strong> {$full_name} \" . __( 'added the following comments', \"oasisworkflow\" ) . \":</p>\";\n $msg .= \"<p>\" . nl2br( $user_comments ) . \"</p>\";\n }\n\n $msg .= __( \"<p>Thanks.</p>\", \"oasisworkflow\" );\n\n $message = '<html><head></head><body><div class=\"email_notification_body\">' . $msg . '</div></body></html>';\n\n $ow_email = new OW_Email( );\n $ow_email->send_mail( $post->post_author, $title, $message );\n\n // clean up after workflow complete\n $this->cleanup_after_workflow_complete( $post_id );\n wp_send_json_success();\n }\n }", "public function getCancelURL()\n {\n return $this->cancelURL;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the version number of the plugin.
public function get_plugin_version() { return $this->version; }
[ "public static function get_version() {\n\t\t$plugin = self::get_instance();\n\t\treturn $plugin->version;\n\t}", "public static function get_plugin_version() {\n\t\t\t$self = self::get_instance();\n\n\t\t\tif ( ! isset( $self->version ) ) {\n\t\t\t\t$data = get_file_data( $self->plugin_file, array(\n\t\t\t\t\t'Version' => 'Version'\n\t\t\t\t) );\n\n\t\t\t\t$self->version = $data['Version'];\n\t\t\t}\n\n\t\t\treturn $self->version;\n\t\t}", "public static function getVersion() {\n if (!function_exists('get_plugin_data')) {\n require_once(ABSPATH . 'wp-admin/includes/plugin.php');\n }\n $pluginData = get_plugin_data(VERSIONPRESS_PLUGIN_DIR . \"/versionpress.php\", false, false);\n return $pluginData['Version'];\n }", "public function get_plugin_version() {\n\t\tif ( isset( $this->_plugin_version ) ) {\n\t\t\treturn $this->_plugin_version;\n\t\t}\n\t\treturn 0;\n\t}", "public function getVersion()\n {\n return $this->getPluginInformationValue('currentVersion');\n }", "static function get_plugin_version() {\n\t\t$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');\n\t\tself::$version = $plugin_data['version'];\n\t\treturn $plugin_data['version'];\n\t}", "function getPluginVersion()\n\t{\n\t\tif (is_object($this->plug_node))\n\t\t{\n\t\t\treturn $this->plug_node->get_attribute(\"PluginVersion\");\n\t\t}\n\t}", "function GetVersion() {\n\t\t\tif(!function_exists('get_plugin_data')) {\n\t\t\t\tif(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+\n\t\t\t\telse if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1\n\t\t\t\telse return \"0.ERROR\";\n\t\t\t}\n\t\t\t$data = get_plugin_data(__FILE__);\n\t\t\treturn $data['Version'];\n\t\t}", "public function get_plugin_version() {\n return $this->plugin_version;\n }", "function get_plugin_version() {\n\tif ( ! function_exists( 'get_plugins' ) )\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$plugin_folder = get_plugins('/' . $this->plugin_dir );\t\n\t\treturn $plugin_folder[$this->plugin_path]['Version'];\n\t}", "protected function get_plugin_version() {\n\t\t$plugin_version = filter_input( INPUT_GET, 'plugin_version', FILTER_SANITIZE_STRING );\n\t\t// Replace slashes to secure against requiring a file from another path.\n\t\t$plugin_version = str_replace( array( '/', '\\\\' ), '_', $plugin_version );\n\n\t\treturn $plugin_version;\n\t}", "public static function get_version() {\n\t\treturn self::get_package()->get_version();\n\t}", "function upme_get_plugin_version() {\n $default_headers = array('Version' => 'Version');\n $plugin_data = get_file_data(__FILE__, $default_headers, 'plugin');\n return $plugin_data['Version'];\n}", "public function getOPCPluginVersion()\n\t{\n\t\tJSession::checkToken('GET') or $this->jsonReturn(array('error' => 1, 'msg' => JText::_('JINVALID_TOKEN')));\n\t\t\n\t\t$version = $this->getVersion();\n\t\t$this->jsonReturn(array('error' => 0, 'msg' => '', 'version' => $version));\n\t}", "public function getPluginVersion()\n\t{\n\t\treturn (string) Mage::getConfig()->getNode('modules/Ferratum_Ferbuy/version');\n\t}", "private function plugin_version()\n {\n // if no version exist, we assume then it's first install an set the current version\n if (false == get_option('hackerspace_version')) {\n add_option('hackerspace_version', HACKERSPACE_PLUGIN_VERSION);\n }\n // get the version number\n $plugin_version = get_option('hackerspace_version');\n\n return $plugin_version;\n }", "public function getVersionNo()\n {\n return $this->versionNo;\n }", "function get_version()\r\n\t{\r\n\t\t$this->query(\"SELECT VERSION() AS version\");\r\n\t\t$this->next_record();\r\n\t\treturn $this->f(\"version\");\r\n\t}", "function myplugin_installed_version() {\n\n\treturn get_option( MYPLUGIN_NAME ); // returns the version number of this plugin that the current stored data is registered to.\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test report with empty constants
public function test_report_with_empty_constants() { $this->constants = new TestConstants(); $sut = $this->make_instance(); $run = $sut->run(); codecept_debug($run); $this->assertMatchesJsonSnapshot(json_encode($run, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); }
[ "public function testNoOptions()\n {\n $this->executeReport($this->getResults(), array());\n }", "public function testCommandWithReportConfigurationUnknown(): void\n {\n $process = $this->phpbench(\n 'run --report=\\'{\"generator\": \"foo_table\"}\\' benchmarks/set4/NothingBench.php'\n );\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('generator service \"foo_table\" does not exist', $process->getErrorOutput());\n }", "public function testGenerateAllReportsVoid()\n {\n $reportGenerator = $this->makeReportGeneratorVoid();\n $response = $reportGenerator->generateAllReports();\n $this->assertEquals(\n [\n 'total' => 0\n ],\n $response\n );\n $reportGenerator = $this->makeReportGeneratorVoid();\n $response = $reportGenerator->generateAllReports(\"2020-01-01\");\n $this->assertEquals(\n [\n 'total' => '0'\n ],\n $response\n );\n \n }", "#[@test]\n public function emptyIptcData() {\n $this->assertEquals('', IptcData::$EMPTY->getTitle());\n }", "public function testEmptyLogTypes(): void\n {\n $types = new LogTypes();\n static::assertSame(self::$allLogtypes, $types->get());\n }", "public function testSystemInfo()\n\t{\n\t\t$this->assertNotEmpty(\\App\\Utils\\ConfReport::getConfig(), 'System information report should be not empty');\n\t}", "public function assertEmpty(): void\n {\n $this->assertAlert()->missing(\"Failed to assert that there is no alerts.\");\n }", "public function testEmptyWarn()\n {\n ZLog::resetInstance();\n ZLog::warn('PHPUnit');\n }", "public function testConstants(): void {\n $this->assertEquals(1, AntifloodValidator::BAD_REPOSITORY_ERROR, \"1. The code error expected is not ok.\");\n $this->assertEquals(2, AntifloodValidator::BAD_ENTITY_ERROR, \"2. The code error expected is not ok.\");\n }", "public function testReportWithNullNarrative()\n {\n \t\n \t$response = $this->call('POST', 'flag', array('FlagID'=>1,'NarrativeID'=>1, 'report-comment'=>'test','_token'=>csrf_token()));\t\n \t$flag = Flag::find(1);\n \t$this->assertNull($flag);\n\n }", "public function testSetEmptyDescription()\n\t{\n\t\t$this->getDummyReport()->setDescription(null);\n\t}", "public function testThrowsExceptionIfValuesMissing()\n\t{\n\t\t$this->template->getOutput();\n\t}", "public function testGetConstantsFilterByCategoryAndPattern()\n {\n $constants = $this->pci->getConstants('Core', '^NULL$');\n\n $expected = array(\n 'NULL' => array(\n 'versions' => array('4.0.0', '', '4.0.0', ''),\n 'uses' => 2,\n 'sources' => array(TEST_FILES_PATH . 'source2.php'),\n 'namespace' => '\\\\',\n 'excluded' => false,\n ),\n );\n\n $this->assertEquals(\n $expected, $constants\n );\n }", "public function testUnsuccesfullReportFormDueToEmptyFields()\n {\n $user = $this->createOperatorUser();\n\n $this->actingAs($user)->visit('report')\n ->type('', 'statement')\n ->type('', 'description')\n ->type('', 'patient_id')\n ->press('Add Report')\n ->see('The description field is required.')\n ->see('The statement field is required.')\n ->see('The patient id field is required.');\n }", "public function testReportsWithLimitZero() : void\n {\n $fizz = new FizzBuzz();\n $fizz->program(0);\n $this->assertEquals(0, $fizz->reportArray[\"fizz\"]);\n $this->assertEquals(0, $fizz->reportArray[\"buzz\"]);\n $this->assertEquals(0, $fizz->reportArray[\"fizzbuzz\"]);\n $this->assertEquals(0, $fizz->reportArray[\"lucky\"]);\n $this->assertEquals(0, $fizz->reportArray[\"integer\"]);\n }", "public function testDoNotReportByDefault()\n {\n // trace isn't sampled.\n $endpoint = Endpoint::createAsEmpty();\n $reporter = new InMemory();\n $sampler = BinarySampler::createAsNeverSample();\n\n $tracing = TracingBuilder::create()\n ->havingLocalServiceName(self::SERVICE_NAME)\n ->havingLocalEndpoint($endpoint)\n ->havingReporter($reporter)\n ->havingSampler($sampler)\n ->build();\n $tracer = $tracing->getTracer();\n\n $span = $tracer->newTrace();\n $span->setName('test');\n $span->start();\n $span->finish();\n\n $tracer->flush();\n $spans = $reporter->flush();\n $this->assertCount(0, $spans);\n }", "public static function testGetUndefinedES() {\n\n echo Notice::get(800, 'es');\n }", "public function test_version1importlogsemptyfield() {\n // Create mapping record.\n $this->create_mapping_record('course', 'shortname', 'customshortname');\n\n // Validation for unspecified field \"shortname\".\n $data = array('action' => 'update', 'customshortname' => '');\n $expectederror = \"[course.csv line 2] Course could not be updated. Required field customshortname is unspecified or\";\n $expectederror .= \" empty.\\n\";\n $this->assert_data_produces_error($data, $expectederror, 'course');\n }", "public function testReportCheckNoSalesNoToken()\n {\n // Do Request\n $this->_request('GET', '/api/1.5.0/report-nosales')\n ->_result(['error' => 'no-token']);\n }", "public function testOutputEmptyStrings(): void\n {\n $data = [\n ['Header 1', 'Header', 'Empty'],\n ['short', 'Longish thing', ''],\n ['Longer thing', 'short', ''],\n ];\n $this->helper->output($data);\n $expected = [\n '+--------------+---------------+-------+',\n '| <info>Header 1</info> | <info>Header</info> | <info>Empty</info> |',\n '+--------------+---------------+-------+',\n '| short | Longish thing | |',\n '| Longer thing | short | |',\n '+--------------+---------------+-------+',\n ];\n $this->assertEquals($expected, $this->stub->messages());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process export remaining carts
function processExportRemainingCarts($idShop, $module) { $data = $module->cronExport('carts', $idShop, true, 'start'); for ($i = 0; $i < (int) $data['totalChunks']; $i++) { MailChimp::resetGuzzle(); $module->cronExport('carts', $idShop, true, 'next'); } die('ok'); }
[ "function processExportRemainingCarts($idShop, $module)\n{\n $data = $module->cronExportCarts($idShop, true, 'start');\n for ($i = 0; $i < (int) $data['totalChunks']; $i++) {\n $module->cronExportCarts($idShop, true, 'next');\n }\n\n die('ok');\n}", "function exportCart ( ) {\n\t\t$export = array(\n\t\t\t'timestamp' => time(),\n\t\t\t'currency' => $this->owner->getConfigS('shopcurrency'),\n\t\t\t'grandtotal' => $this->getGrandTotalCart(),\n\t\t\t'shipping_handling' => $this->getShippingHandlingTotal(),\n\t\t\t'tax' => $this->getTotalTax(),\n\t\t\t'extrashippingdescr' => $this->owner->extrashipping[ $this->getExtraShippingIndex() ]['description'],\n\t\t\t'lines' => array()\n\t\t\t);\n\n\t\t// remove dependencies on data.php\n\t\tforeach( $this->Prods as $cid => $line ) {\n\t\t\t$export['lines'] [ $cid ] = array(\n\t\t\t\t'productid' => $line['productid'],\n\t\t\t\t'name' => $line['name'],\n\t\t\t\t'descr' => $line['descr'],\n\t\t\t\t'sku' => $line['sku'],\n\t\t\t\t'price' => $line['price'],\n\t\t\t\t'qty' => $line['qty'],\n\t\t\t\t'subtotal' => $this->getSubtotalPriceProduct( $cid ),\n\t\t\t\t'taxname' => $line['taxname'],\t\t\t\t\t\t\t\t// dependent\n\t\t\t\t'taxperc' => $this->lookupTaxPerc( $line['taxname'] ),\t\t// independent\n\t\t\t\t'handling' => $line['handling'],\n\t\t\t\t'shipping' => $line['shipping'],\n\t\t\t\t'options' => $line['options'],\t\t\t\t\t\t\t\t// dependent\n\t\t\t\t'optionstext' => $this->getOptionsAsText ( $cid )\t\t\t// independent\n\t\t\t );\n\t\t}\n\n\t\t$export['lineitemcount'] = $this->getNumberOfLineItems();\n\n\t\treturn $export;\n\t}", "public function displayAjaxExportAllCarts()\n {\n $idShops = Tools::getValue('shops');\n $exportRemaining = (bool) Tools::isSubmit('remaining');\n if (Tools::isSubmit('start')) {\n $totalCarts = MailChimpCart::getCarts(null, 0, 0, $exportRemaining, true);\n $totalChunks = ceil($totalCarts / static::EXPORT_CHUNK_SIZE);\n\n die(json_encode([\n 'totalChunks' => $totalChunks,\n 'totalCarts' => $totalCarts,\n ]));\n } elseif (Tools::isSubmit('next')) {\n $count = (int) Tools::getValue('count');\n\n if ($exportRemaining) {\n $success = $this->exportCarts(0, $idShops, $exportRemaining);\n } else {\n $success = $this->exportCarts(($count - 1) * static::EXPORT_CHUNK_SIZE, $idShops, $exportRemaining);\n }\n\n die(json_encode([\n 'success' => $success,\n 'count' => ++$count,\n ]));\n }\n }", "public function exportData()\n {\n $orders = $this->getOrdersCollection();\n if (count($orders) === 0) return;\n foreach ($orders as $order) {\n try {\n $this->exportClerk->conductExport($order);\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'KL_Rulemailer.log', true);\n }\n\n $this->lastExported = $order->getId();\n }\n // Remember which order was the last one to have been exported\n Mage::getModel('core/config')->saveConfig('kl_rulemailer/last_exported/order_id', $this->lastExported);\n }", "public function exportallAction() {\n\t\t$name = \"bank_export_\" . date( \"d_m_y_Hi\" );\n\n\t\t$outputfile = new Varien_Io_File();\n\t\t$path = Mage::getBaseDir( 'var' ) . DS . 'export' . DS;\n\t\t$outputfile->setAllowCreateFolders( true );\n\t\t$outputfile->open( array( 'path' => $path ) );\n\t\t$filepath = $path . DS . $name . '.csv';\n\t\t$outputfile->streamOpen( $filepath, 'w+' );\n\t\t$outputfile->streamLock( true );\n\n\t\t$count = 0;\n\t\t$bankitems = Mage::getModel( 'bankintegration/bankintegration' )->getCollection()->getItems();\n\t\tforeach ( $bankitems as $bankitem ) {\n\t\t\t$outputfile->streamWrite( \"\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getDate() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getName() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getAccount() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getType() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getAmount() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getRemarks() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getStatus() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindorder() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindname() ) );\n\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindamount() ) );\n\t\t\t$outputfile->streamWrite( \"\\\"\\n\" );\n\n\t\t\t$count = $count + 1;\n\t\t}\n\n\t\t$outputfile->streamUnlock();\n\t\t$outputfile->streamClose();\n\n\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess( Mage::helper( 'bankintegration' )->__( 'Total of %d item(s) were successfully exported', $count ) );\n\n\t\t$this->_redirectReferer();\n\t}", "public function exportProducts() : void\n {\n $this->logger->info(\"BoxalinoExporter: Preparing products for account {$this->getAccount()}.\");\n try{\n $this->productExporter->setAccount($this->getAccount())\n ->setFiles($this->getFiles())\n ->setLibrary($this->getLibrary())\n ->setIsDelta($this->getIsDelta())\n ->export();\n } catch(\\Exception $exc)\n {\n throw $exc;\n }\n }", "public function process_export() {\n\n\t\t// Check for run switch.\n\t\tif ( empty( $_GET['export'] ) || empty( $_GET['form_id'] ) || 'all' !== $_GET['export'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Security check.\n\t\tif ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'wpforms_entry_list_export' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once WPFORMS_PLUGIN_DIR . 'pro/includes/admin/entries/class-entries-export.php';\n\n\t\t$export = new WPForms_Entries_Export();\n\t\t$export->entry_type = 'all';\n\t\t$export->form_id = absint( $_GET['form_id'] );\n\t\t$export->export();\n\t}", "public function downloadinventoryAction() {\r\n\r\n\t\t/// Get seller product ids\r\n\t\t$product_ids = array();\r\n\t\t$querydata = Mage::getModel('marketplace/product') \r\n\t\t\t\t\t\t-> getCollection() \r\n\t\t\t\t\t\t-> addFieldToFilter('userid', array('eq' => Mage::getSingleton('customer/session')-> getId())) \r\n\t\t\t\t\t\t-> addFieldToFilter('status', array('neq' => '2') )\r\n\t\t\t\t\t\t-> getData();\r\n\r\n\t\tforeach ($querydata as $key => $value) {\r\n\t\t\t$product_ids[] = $value['mageproductid'];\r\n\t\t\t$childIds = Mage::getModel('catalog/product_type_configurable') -> getChildrenIds($value['mageproductid']);\r\n\t\t\tif (is_array($childIds)) {\r\n\t\t\t\tforeach ($childIds['0'] as $key => $value) {\r\n\t\t\t\t\t$product_ids[] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Get stock collection\r\n\t\t$data = Mage::getModel('cataloginventory/stock_item') -> getCollection() -> addFieldToFilter('product_id', $product_ids) -> getData();\r\n\r\n\t\t$fileName = 'new.csv';\r\n\r\n\t\t$csv = \"sku,quantity,name,size_config,colour,type_id\\n\";\r\n\t\tforeach ($data as $key => $value) {//just dummy loop\r\n\t\t\t$_product=Mage::getSingleton('catalog/product')->load($value['product_id']);\r\n\t\t\t// $data1 = array();\r\n\t\t\t// $data1[] = $_product-> getSku();\r\n\t\t\t// $data1[] = $value['qty'];\r\n\t\t\t// $data1[] = $_product-> getName();\r\n\t\t\t// $data1[] = $_product->getResource()->getAttribute('size_config')->getSource()->getOptionText($_product->getSizeConfig());\r\n\t\t\t// $data1[] = $_product->getResource()->getAttribute('colour')->getSource()->getOptionText($_product->getColour());\r\n\t\t\t// $data1[] = $_product->getTypeId();\r\n\t\t\t// $csv .= implode(',', $data1) . \"\\n\";\r\n\t\t\t$csv.=$_product-> getSku().','.$value['qty'].',\"'. $_product-> getName().'\",'.$_product->getResource()->getAttribute('size_config')->getSource()->getOptionText($_product->getSizeConfig()).','.$_product->getResource()->getAttribute('colour')->getSource()->getOptionText($_product->getColour()).','. $_product->getTypeId().\"\\n\";\r\n\t\t}\r\n\t\t// Download csv\r\n\t\t$this -> _prepareDownloadResponse('stock.csv', $csv, 'text/csv');\r\n\t}", "public function exportItems() : void\n {\n if (!$this->getSuccessOnComponentExport())\n {\n return;\n }\n\n $this->_exportExtra(\"categories\", $this->categoryExporter);\n $this->_exportExtra(\"translations\", $this->translationExporter);\n $this->_exportExtra(\"manufacturers\", $this->manufacturerExporter);\n $this->_exportExtra(\"prices\", $this->priceExporter);\n $this->_exportExtra(\"advancedPrices\", $this->priceAdvancedExporter);\n $this->_exportExtra(\"reviews\", $this->reviewsExporter);\n $this->_exportExtra(\"tags\", $this->tagExporter);\n $this->_exportExtra(\"visibility\", $this->visibilityExporter);\n $this->_exportExtra(\"image\", $this->imagesExporter);\n\n if ($this->config->exportProductImages())\n {\n $this->_exportExtra(\"media\", $this->mediaExporter);\n }\n\n if ($this->config->exportProductUrl())\n {\n $this->_exportExtra(\"urls\", $this->urlExporter);\n }\n\n $this->_exportExtra(\"facets\", $this->facetExporter);\n $this->_exportExtra(\"options\", $this->optionExporter);\n\n /** @var ItemsAbstract $itemExporter */\n foreach($this->itemExportersList as $itemExporter)\n {\n $this->_exportExtra($itemExporter->getPropertyName(), $itemExporter);\n }\n }", "function export_front_quantite() {\n\t\t$data = $this->pbf->get_data_export ( '', '', 'indicator_verified_value', 'Quantity' );\n\t\t$file_name_is = str_replace ( ' ', '_', 'export_front_quantite' ) . '.xls';\n\t\t$redirect = 'data/';\n\t\t$this->export_quantity ( $data, $file_name_is, $redirect );\n\t}", "public function massShippingCvsAction()\n {\n $_file = '';\n $_fileName = 'mondialrelay_export_' . Mage::getSingleton('core/date')->date('Ymd_His') . '.txt';\n\n $_orderIds = (array) $this->getRequest()->getPost('order_ids');\n if (count($_orderIds) > 100)\n {\n $this->_getSession()->addError(\n Mage::helper('mondialrelay')->__('Too many orders: 100 max. by export file.'));\n return $this->_redirectReferer();\n }\n foreach ($_orderIds as $_orderId)\n {\n $_order = Mage::getModel('sales/order')->load($_orderId);\n if ($_order->getId())\n {\n $_carrier = $_order->getShippingCarrier();\n if ($_carrier instanceof Man4x_MondialRelay_Model_Carrier_Abstract)\n {\n $_file .= $_carrier->getFlatFileData($_order);\n }\n }\n }\n $_fileCharset = 'ISO-8859-1'; // possibly unicode\n $_file = utf8_decode($_file);\n $_fileMimeType = 'text/plain'; // possibly 'application/csv' for csv format;\n return $this->_prepareDownloadResponse($_fileName, $_file, $_fileMimeType . '; charset=\"' . $_fileCharset . '\"');\n }", "public function exportselAction() {\n\t\t$name = \"bank_export_\" . date( \"d_m_y_Hi\" );\n\n\t\t$outputfile = new Varien_Io_File();\n\t\t$path = Mage::getBaseDir( 'var' ) . DS . 'export' . DS;\n\t\t$outputfile->setAllowCreateFolders( true );\n\t\t$outputfile->open( array( 'path' => $path ) );\n\t\t$filepath = $path . DS . $name . '.csv';\n\t\t$outputfile->streamOpen( $filepath, 'w+' );\n\t\t$outputfile->streamLock( true );\n\n\t\t$ids = $this->getRequest()->getParam( 'bankintegration' );\n\n\t\tif ( !is_array( $ids ) ) {\n\t\t\tMage::getSingleton( 'adminhtml/session' )->addError( Mage::helper( 'bankintegration' )->__( 'Please select one or more items' ) );\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$bankitems = Mage::getModel( 'bankintegration/bankintegration' )->getCollection()->addFieldToFilter( 'entry_id', $id )->getItems();\n\t\t\t\t\tforeach ( $bankitems as $bankitem ) {\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getDate() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getName() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getAccount() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getType() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getAmount() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getRemarks() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getStatus() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindorder() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindname() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\";\\\"\" );\n\t\t\t\t\t\t$outputfile->streamWrite( trim( $bankitem->getBindamount() ) );\n\t\t\t\t\t\t$outputfile->streamWrite( \"\\\"\\n\" );\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess(\n\t\t\t\t\tMage::helper( 'bankintegration' )->__( 'Total of %d item(s) were successfully exported', count( $ids ) )\n\t\t\t\t);\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\tMage::getSingleton( 'adminhtml/session' )->addError( $e->getMessage() );\n\t\t\t}\n\t\t}\n\n\t\t$outputfile->streamUnlock();\n\t\t$outputfile->streamClose();\n\n\t\t$this->_redirectReferer();\n\t}", "public function catch_export_request() {\n if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'wf_woocommerce_csv_im_ex') {\n switch ($_GET['action']) {\n case \"export\" :\n $user_ok = $this->hf_user_permission();\n if ($user_ok) {\n include_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );\n WF_ProdImpExpCsv_Exporter::do_export('product');\n } else {\n wp_redirect(wp_login_url());\n }\n break;\n case \"export_images\" :\n $user_ok = $this->hf_user_permission();\n if ($user_ok) {\n include_once( 'includes/exporter/class-wf-prodimg-exporter.php' );\n WF_ProdImg_Exporter::do_export();\n } else {\n wp_redirect(wp_login_url());\n }\n break;\n }\n }\n }", "private function exportAll()\n {\n $files = Mage::getModel('factfinder/export_type_product')->saveAll();\n echo \"Successfully generated the following files:\\n\";\n foreach ($files as $file) {\n echo $file . \"\\n\";\n }\n }", "function filter_my_order_items ($is_export_record, $product_id, $export_options, $export_id) {\n\t// Unless you want this to execute for every export you should check the id here:\n\t// if ($export_id === 5) {\n\n\t// Your code here\n\n\treturn true;\n}", "public function process_export() {\n\n\t\t// first get the User Memberships according to form criteria\n\t\t$user_memberships_ids = $this->get_user_memberships_ids();\n\n\t\t// export options\n\t\t$this->export_meta_data = isset( $_POST['wc_memberships_members_export_meta_data'] ) ? 1 === (int) $_POST['wc_memberships_members_export_meta_data'] : $this->export_meta_data;\n\n\t\tif ( ! empty( $user_memberships_ids ) ) {\n\t\t\t// try to set unlimited script timeout and generate file for download\n\t\t\t@set_time_limit( 0 );\n\t\t\t$this->download( $this->file_name, $this->get_csv( $user_memberships_ids ) );\n\t\t} else {\n\t\t\t// tell the user there were no User Memberships to export\n\t\t\twc_memberships()->get_message_handler()->add_error( __( 'No User Memberships found matching the criteria to export.', 'woocommerce-memberships' ) );\n\t\t}\n\t}", "public function actionExportSelectedRows(){\n try{\n $sellerInfo = AssociateSeller::getAssociatedSellerList();\n\n //echo \"<pre>\";print_r($sellerInfo);die; \n $data = Yii::$app->request->post();\n $multipleProductIds=$data['multipleProductIds'];\n if(empty($multipleProductIds))\n {\n Yii::$app->session->setFlash('error','Please select product to export');\n return $this->redirect(Yii::$app->params['WEB_URL'].'index.php?r=product/index');\n }\n\n $this->product->id_product=$multipleProductIds;\n $exportedData=$this->product->singleExport();\n $exportedDataRTrim = array();\n $i = 0;\n foreach ($exportedData as $key => $model) {\n $mrp=0;\n $sellingPrice=0;\n $shop_margin=0;\n $pg_fee=0;\n $shipping_charge=0;\n $totalMargin=0;\n $discount=0;\n $total_deductions=0;\n $mrp=$model['base_price'];\n $sellingPrice=$model['sell_price'];\n $shop_margin=$model['shop_margin'];\n $pg_fee=$model['pg_fee'];\n $shipping_charge=$model['shipping_charge'];\n $quantity=1;\n //$serviceTax is stored in configuration table\n $serviceTax = Yii::$app->params['margin_service_tax'];\n\n /*for shop margin*/\n $a = ($sellingPrice * $shop_margin) / 100 ;\n $A = $a + ( $a * $serviceTax / 100 );\n /*for payment gateway fee*/ \n $b = ($sellingPrice * $pg_fee) / 100 ;\n $B = $b + ( $b * $serviceTax / 100 );\n /*for shipping cost*/\n $c = $shipping_charge * $quantity;\n $C = $c + ( $c * $serviceTax / 100 );\n /*shop total margin*/\n $totalMargin = $A + $B + $C;\n /*total vendor payout*/\n $vendorPayout = $sellingPrice - $totalMargin;\n $vendor_payout=number_format($vendorPayout,2);\n $exportedData[$i]['vendor_payout'] = $vendor_payout;\n\n $imgPath = Helper::getImagePath($model['id_image'], 'thickbox', 'jpg', 'default');\n $exportedData[$i]['id_image'] = $imgPath;\n $i++;\n }\n $j=0;\n foreach ($exportedData as $key => $value) {\n $i=0;\n foreach ($value as $name => $data) {\n if (isset($sellerInfo) && count($sellerInfo)>0)\n { \n if($i <= 12)\n {\n $exportedDataRTrim[$j][$i] = $data;\n $i++; \n }\n \n }\n else\n {\n if( $name != 'vendor' || $name != 'date_upd'){\n if($i <= 10)\n {\n $exportedDataRTrim[$j][$i] = $data;\n $i++; \n }else{\n if($i == 12)\n {\n $exportedDataRTrim[$j][10] = $data;\n }\n $i++;\n }\n } \n } \n }\n $j++;\n }\n if($exportedDataRTrim){\n if (isset($sellerInfo) && count($sellerInfo)>0){\n $exportColumnsValues=[['Status','Product Name','Product ID','Category name','Seller SKU','Modified Date','Stock','Base Price','Selling Price','Vendor Payout','Seller Name','Shop Name','Img']];\n }\n else{\n $exportColumnsValues=[['Status','Product Name','Product ID','Category name','Seller SKU','Stock','Base Price','Selling Price','Vendor Payout','Shop Name','Img']];\n }\n $exportColumnsValues = array_merge($exportColumnsValues,$exportedDataRTrim);\n \n $fileName='order_'.date('Y-m-d').'.csv'; \n // echo \"<hr>\";print_r($exportColumnsValues);die;\n Export::exportCsv($exportColumnsValues, $fileName);\n }\n else\n {\n Yii::$app->session->setFlash('error','Error in exporting orders.Try after some time');\n return $this->redirect(Yii::$app->params['WEB_URL'].'index.php?r=product/index');\n } \n \n }\n catch(Exception $e){\n CustomException::errorLog($e->getMessage(), __FUNCTION__, __FILE__, __LINE__);\n }\n\n }", "protected function startExportProcess(): void\n {\n $this->exportResultsToFile();\n\n $this->updateReportJobStatus();\n\n if ($this->isLastChunk()) {\n $this->completeReportExport();\n } else {\n $this->processNextChunk();\n }\n }", "public function catch_export_request() {\n\n\t\t\tif ( !empty( $_GET[ 'action' ] ) && !empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'wf_woocommerce_csv_im_ex' ) {\n\t\t\t\tswitch ( $_GET[ 'action' ] ) {\n\t\t\t\t\tcase \"export\" :\n\t\t\t\t\t\t$user_ok = self::hf_user_permission();\n\t\t\t\t\t\tif ( $user_ok ) {\n\t\t\t\t\t\t\tinclude_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );\n\t\t\t\t\t\t\tWF_ProdImpExpCsv_Exporter::do_export( 'product' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twp_redirect( wp_login_url() );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function prepareExport()\n {\n $this->reporter->do_export = true;\n $this->reporter->_load_currency();\n $this->runQuery();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a personReference object (array).
private function constructPersonReference(Request $request) { $personReference = [ "tenant_id" => $this->requester->getTenantId(), "person_id" => $request->personId, "name" => $request->name, "relationship" => $request->relationship, "description" => $request->description, "phone" => $request->phone ]; return $personReference; }
[ "public static function createFromArray($fields) \n\t{\n\t\t$person = new Person();\n\t\tself::populate($person,$fields);\n\t\treturn $person;\n\t}", "public function getReferences(): array;", "protected function makeReferenceForm()\n {\n $faker = \\Faker\\Factory::create();\n $projects = [];\n for ($i = 0; $i < 3; $i++) {\n $projects[] = [\n 'name' => $faker->sentence(),\n 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years')->format('Y-m-d'),\n 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day')->format('Y-m-d')\n ];\n }\n return [\n 'name' => $faker->name(),\n 'email' => $faker->safeEmail(),\n 'description' => $faker->paragraphs(2, true),\n 'relationship_id' => Relationship::inRandomOrder()->first()->id,\n 'projects' => $projects,\n ];\n }", "public function make()\n {\n $person = (new Entities\\Person)\n ->setFirstName('Bob')\n ->setLastName('Norman');\n\n $person->getContacts()->push(\n (new Entities\\Contact)\n ->setType('email')\n ->setValue('bob.norman@example.com')\n );\n\n $person->getContacts()->push(\n (new Entities\\Contact)\n ->setType('mobile_phone')\n ->setValue('555-625-1199')\n );\n\n $person->getAddresses()->push(\n (new Entities\\Address)->setType('billing')\n ->setLine1('Chestnut Street 92')\n ->setCity('Louisville')\n ->setState('Kentucky')\n ->setCountry('United States')\n ->setPostcode('40202')\n );\n\n $person->getAddresses()->push(\n (new Entities\\Address)->setType('delivery')\n ->setLine1('Foo bar Street 123')\n ->setCity('Melbourne')\n ->setState('Victoria')\n ->setCountry('Australia')\n ->setPostcode('3000')\n );\n \n return $person;\n }", "static public function createFileReferenceFromArray(array $data) {\n $file = new FileReference;\n self::callSetters($file, $data);\n return $file;\n }", "public function createDBRef(array $a) {}", "static function get_reference($ref){\n $ref = self::parse_reference($ref) ;\n if ($ref == false) {\n return false;\n }\n $quotes = array();\n $book_name = $ref[4];\n // Fetches verse(s) for each verse/verse range parsed.\n for ($i = 0; $i < count($ref[2]); $i++) {\n $params = array( $ref[0], $ref[1], $ref[2][$i]);\n $temps = self::get_verse_or_verse_range( $params , $ref[3]) ;\n if ($temps == false) {\n return false;\n }\n foreach ($temps as $temp){\n $quotes[]= $temp;\n }\n }\n return array( $quotes, $book_name ) ; \n }", "function createReference()\n\t{\n\t\tglobal $ilDB;\n\n\t\tif (!isset($this->id))\n\t\t{\n\t\t\t$message = \"ilObject::createNewReference(): No obj_id given!\";\n\t\t\t$this->raiseError($message,$this->ilias->error_obj->WARNING);\n\t\t}\n\n\t\t$next_id = $ilDB->nextId('object_reference');\n\t\t$query = \"INSERT INTO object_reference \".\n\t\t\t \"(ref_id, obj_id) VALUES (\".$ilDB->quote($next_id,'integer').','.$ilDB->quote($this->id ,'integer').\")\";\n\t\t$this->ilias->db->query($query);\n\n\t\t$this->ref_id = $next_id;\n\t\t$this->referenced = true;\n\n\t\treturn $this->ref_id;\n\t}", "private function makePerson(array $data): Person\n {\n return (new Person())\n ->setId((int)$data['id'])\n ->setCard($data['card'])\n ->setEmail($data['email'])\n ->setPhone($data['phone']);\n }", "protected function createParametersArrayAndReferences()\n { \n $this->paramsReferences = array();\n $this->paramsReferences['types'] = &$this->paramTypes;\n \n foreach ($this->placeholders as $placeholder)\n {\n $this->params[$placeholder] = NULL;\n $this->paramsReferences[$placeholder] = &$this->params[$placeholder];\n }\n }", "public function getResultReferences() : array;", "public function setPerson(array $person)\n {\n $this->person = $person;\n return $this;\n }", "public function dataTestReferenceSingle() {\n $property_id = 'some-property';\n $value = 'some-value';\n $uuid = uniqid('existing-reference-uuid-');\n\n return [\n 'found an existing reference' => [\n $property_id, $value, $uuid, NULL, $uuid,\n ],\n 'created a new reference' => [\n $property_id, $value, NULL, $uuid, $uuid,\n ],\n 'neither found existing nor created new reference' => [\n $property_id, $value, NULL, NULL, $value,\n ],\n ];\n }", "public function __construct(array $pronoun_Reference = array())\n {\n $this\n ->setPronoun_Reference($pronoun_Reference);\n }", "public static function convertReferenceTextToReferenceObject\r\n\t(\r\n\t\t$referenceText\t\t// <str> A reference text, possibly multi-line, to convert.\r\n\t)\t\t\t\t\t\t// RETURNS <array> the resulting reference object.\r\n\t\r\n\t// $referenceObject = Skydata::convertReferenceTextToReferenceObject($referenceText);\r\n\t{\r\n\t\t/*\r\n\t\t\t// Cities.Born In=\"Ankh\"\r\n\t\t\t// Cities.Lived In=[\"Ankh\", \"Catalyst\", \"Skywood\"]\r\n\t\t\t\r\n\t\t\t{\r\n\t\t\t\t\"Cities\": {\r\n\t\t\t\t\t\"Born In\": \"Ankh\",\r\n\t\t\t\t\t\"Lived In\": [\r\n\t\t\t\t\t\t\"Ankh\",\r\n\t\t\t\t\t\t\"Catalyst\",\r\n\t\t\t\t\t\t\"Skywood\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t// Make sure there is actually text to convert\r\n\t\tif(empty($referenceText)) { return array(); }\r\n\t\t\r\n\t\t$referenceObject = array();\r\n\t\t\r\n\t\t// Loop through every line individually in the reference text\r\n\t\t$referenceMultiLine = explode(PHP_EOL, $referenceText);\r\n\t\t\r\n\t\tforeach( $referenceMultiLine as $referenceString ) {\r\n\t\t\t\r\n\t\t\t// Found a reference. Must match the expected formatting of: Table.Reference Name=\"ID of Thing\"\r\n\t\t\t// If not, skip that line:\r\n\t\t\tif(strpos($referenceString, \".\") === false or strpos($referenceString, \"=\") === false) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlist($refPrep, $refJSON) = explode(\"=\", $referenceString, 2);\r\n\t\t\tlist($refTable, $refName) = explode(\".\", $refPrep, 2);\r\n\t\t\t\r\n\t\t\t// Make sure the reference table is loaded.\r\n\t\t\tif(in_array($refTable, self::$tableList)) {\r\n\t\t\t\t\r\n\t\t\t\tif(empty(self::$table[$refTable])) {\r\n\t\t\t\t\tself::$table[$refTable] = self::getTable( $getTable );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Make sure the string has valid JSON or skip it\r\n\t\t\tif(!json_decode($refJSON, true)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If the value is a string, wrap it in an array:\r\n\t\t\t$isMany = true;\r\n\t\t\t\r\n\t\t\tif(!is_array($refJSON)) {\r\n\t\t\t\t$isMany = false;\r\n\t\t\t\t$refJSON = array($refJSON);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If the value is an array:\r\n\t\t\t// Loop over each value to ensure it exists.\r\n\t\t\t// If a value doesn't exist, we skip it.\r\n\t\t\tforeach( $refJSON as $refID ) {\r\n\t\t\t\t\r\n\t\t\t\t$refID = trim($refID);\r\n\t\t\t\t\r\n\t\t\t\t// Check if this value has a constraint, and must match a legitimate value:\r\n\t\t\t\tif(!empty(self::$table[$refTable]['structure']['references'][$refTable][$refName])) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$check = self::$table[$refTable]['structure']['references'][$refTable][$refName];\r\n\t\t\t\t\t$constrained = (!empty($check['constrained']) ? (bool) $check['constrained'] : false );\r\n\t\t\t\t\t\r\n\t\t\t\t\t// The value is constrained, therefore it must match or be bypassed:\r\n\t\t\t\t\tif($constrained) {\r\n\t\t\t\t\t\tif(empty(self::$table[$refTable]['data'][$refID])) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Reference is successful. Add it to the reference object.\r\n\t\t\t\tif(empty($referenceObject[$refTable])) {\r\n\t\t\t\t\t$referenceObject[$refTable] = array();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($isMany) {\r\n\t\t\t\t\tif(empty($referenceObject[$refTable][$refName])) {\r\n\t\t\t\t\t\t$referenceObject[$refTable][$refName] = array();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$referenceObject[$refTable][$refName][] = $refID;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\t$referenceObject[$refTable][$refName] = $refID;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $referenceObject;\r\n\t}", "public function createReference()\n\t{\n\t\tif (!$this->hasCollection()) {\n\t\t\trequire_once 'Shanty/Mongo/Exception.php';\n\t\t\tthrow new Shanty_Mongo_Exception('Can not create reference. Document does not belong to a collection');\n\t\t}\n\t\t\n\t\treturn MongoDBRef::create($this->getCollection(), $this->getId());\n\t}", "function & userCreateFromArray($aParameters) {\n $oUser = & new User($aParameters[0], $aParameters[1], $aParameters[2], $aParameters[3], $aParameters[4], $aParameters[5], $aParameters[6], $aParameters[7], $aParameters[8], $aParameters[9], $aParameters[10]);\n return $oUser;\n}", "public static function createFromArray($fields) \n\t{\n\t\t$address = new Address();\n\t\tself::populate($address,$fields);\n\t\treturn $address;\n\t}", "public static function make(){\n return new RelationContact();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set/Create template compile directory
public function setCompileDirectory() { $compilePath = $this->getTemplatesDirectory() . DIRECTORY_SEPARATOR . $this->compileDirectoryName . DIRECTORY_SEPARATOR; if (!file_exists($compilePath)) { static::mkdir($compilePath); } $this->compilePath = $compilePath; }
[ "private function setTemplateFolderPath(){\n $this->TemplateFolderPath = dirname(__DIR__) . DIRECTORY_SEPARATOR . \"frontend\" . DIRECTORY_SEPARATOR . \"templates\" . DIRECTORY_SEPARATOR;\n }", "function set_template_dir($dir)\n {\n $this->smarty->addTemplateDir($dir);\n\n if (!isset($this->smarty->compile_id))\n {\n $compile_id = \"1\";\n $compile_id .= ($real_dir = realpath($dir))===false ? $dir : $real_dir;\n $this->smarty->compile_id = base_convert(crc32($compile_id), 10, 36 );\n }\n }", "public function setTemplateDir($dir);", "abstract function setTemplateDir($inTemplateDir);", "private function createSrc()\n {\n $src = \"$this->path/src\";\n\n $this->fs->makeDirectory($src);\n\n recurse_copy(__DIR__.\"/../templates/*\", $this->path);\n }", "protected function registeTemplateDir() {\r\n $this->Application()->Template()->addTemplateDir(\r\n $this->Path() . 'Views/'\r\n );\r\n }", "function set_template_dir ($dir)\n\t{\n\t\t$this->set_directory('template_dir', $dir);\n\t}", "function setTemplateDir( $dir ) {\r\n\t\t\t$this->_tpl->template_dir = realpath( $dir );\r\n\t\t}", "abstract public function addTemplateDir($path);", "function setTemplateDir( $dir ) {\r\n\t\t\t$this->_templateDir = realpath( $dir );\r\n\t\t}", "public function testSetsTemplatesDirectory()\n {\n $templatesDirectory = dirname(__FILE__) . '/templates';\n $this->view->setTemplatesDirectory($templatesDirectory);\n $this->assertEquals($templatesDirectory, $this->view->getTemplatesDirectory());\n }", "public function createTemplateFile()\n\t{\t\t\n\t\t// css\n\t\tif (!is_dir($this->config['dir']['asset'] . '/css')) {\n\t\t // dir doesn't exist, make it\n\t\t mkdir($this->config['dir']['asset'] . '/css');\n\t\t}\n\n\t\t//js\n\t\tif (!is_dir($this->config['dir']['asset'] . '/js')) {\n\t\t mkdir($this->config['dir']['asset'] . '/js');\n\t\t}\n\n\t\t// css file\n\t\tfile_put_contents( $this->config['dir']['asset'] . '/css/bootstrap.min.css', file_get_contents(__DIR__ . '/tpl/css/bootstrap.min.css'));\n\t\tfile_put_contents( $this->config['dir']['asset'] . '/css/bootstrap-theme.min.css', file_get_contents(__DIR__ . '/tpl/css/bootstrap-theme.min.css'));\n\n\t\t// js file\n\t\tfile_put_contents( $this->config['dir']['asset'] . '/js/jquery.js', file_get_contents(__DIR__ . '/tpl/js/jquery.js'));\n\t\tfile_put_contents( $this->config['dir']['asset'] . '/js/bootstrap.min.js', file_get_contents(__DIR__ . '/tpl/js/bootstrap.min.js'));\n\n\t\t// index html\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/index.html.tpl', file_get_contents(__DIR__ . '/tpl/index.html.tpl'));\n\n\t\t// post layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/post.html.tpl', file_get_contents(__DIR__ . '/tpl/post.html.tpl'));\n\t\t\n\t\t// page layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/page.html.tpl', file_get_contents(__DIR__ . '/tpl/page.html.tpl'));\n\n\t\t// category layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/category.html.tpl', file_get_contents(__DIR__ . '/tpl/category.html.tpl'));\n\n\t\t// author layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/author.html.tpl', file_get_contents(__DIR__ . '/tpl/author.html.tpl'));\n\n\t\t// sidebar layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/sidebar.html.tpl', file_get_contents(__DIR__ . '/tpl/sidebar.html.tpl'));\n\n\t\t// header layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/header.html.tpl', file_get_contents(__DIR__ . '/tpl/header.html.tpl'));\n\n\t\t// master layout\n\t\tfile_put_contents( $this->config['dir']['layout'] . '/layout.html.tpl', file_get_contents(__DIR__ . '/tpl/layout.html.tpl'));\n\t}", "function _application_templates_folder(){\n Template::add_path(Application::get_site_path() . Configuration::get('paths', 'templates','application/templates'));\n}", "static public function setBackendTemplateDir()\n {\n self::setTemplateForMode('backend');\n }", "function directory($views_sub_directory) {\n// $this->_smarty->template_dir = $this->_smarty->template_dir . DIRECTORY_SEPARATOR . $views_sub_directory;\n $this->_template_sub_directory = $views_sub_directory . DIRECTORY_SEPARATOR;\n// $this->_smarty->compile_dir = $this->_smarty->compile_dir . DIRECTORY_SEPARATOR . $views_sub_directory;\n }", "public function setCompileDir($dir='app/views_c/')\r\n {\r\n $this->_smarty->compile_dir = $this->_path.$dir;\r\n }", "protected function pointConfigFileTemplatesToNewLocation()\n {\n\t$configPath = app_path('config/packages/way/generators/config.php');\n\t$updated = str_replace('vendor/way/generators/src/Way/Generators/templates', $this->option('path'), File::get($configPath));\n\n\tFile::put($configPath, $updated);\n }", "function setTemplateDirectory($sourcedir) {\n $this->templateRoot = $this->getCheckedDirname($sourcedir);\n }", "public function getDirPath() { return Template::$TEMPLATES_DIR_PATH . \"/\" . $this->dirname; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a file name from a path. i.e. 'path/to/a/name.less' > 'name'
private function getFilenameFromPath($path) { $pathBits = explode('/', $path); $file = end($pathBits); $fileBits = explode('.', $file); $filename = $fileBits[0]; return $filename; }
[ "public function filename($path)\n {\n return $this->pathInfo($path, PATHINFO_FILENAME);\n }", "function filename_from_path($path)\n{\n $data = explode( '/', $path );\n return $data[ count( $data ) -1 ];\n}", "function getFilename($path) {\r\n\t$splitPath = spliti('[/\\]', $path);\r\n\t\r\n\treturn $splitPath[count($splitPath)-1]; // return the filename only\r\n}", "public function templateNameFromPath($path)\n {\n return stripos($path, $this->templatesDir) === 0\n ? mb_substr($path, mb_strlen($this->templatesDir))\n : $path;\n }", "function extractFileName($path) {\n\n return array_pop(explode(\"/\",$path));\n\n}", "public static function getNameFromPath( string $path ) : string\n {\n $array = StringUtility::getExplodedStringArray( '/', $path );\n $count = count( $array );\n \n if( $count > 0 )\n return $array[ $count - 1 ]; // last element\n \n return \"\"; // empty string\n }", "public static function extract_filename( $file_path = '' ) {\n\t\t$file_parts = explode( '/', $file_path );\n\t\treturn $file_parts[ count( $file_parts ) - 1 ];\n\t}", "function get_file_title($path)\n\t{\t\t\t \n\t\treturn $this->get_title($path);\n\t}", "abstract protected function get_less_file_name();", "public static function extractFileNameWithExtension($path){\r\n\r\n\t\t$osSeparator = FilesManager::getInstance()->getDirectorySeparator();\r\n\r\n\t\tif(self::isEmpty($path)){\r\n\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$path = self::formatPath($path);\r\n\r\n\t\tif(strpos($path, $osSeparator) !== false){\r\n\r\n\t\t\t$path = substr(strrchr($path, $osSeparator), 1);\r\n\t\t}\r\n\r\n\t\treturn $path;\r\n }", "public function basename($path);", "public static function basename( $path ) { return Path::basename($path); }", "private function basename($path)\n {\n $separators = '/';\n if (DIRECTORY_SEPARATOR != '/') {\n // For Windows OS add special separator.\n $separators .= DIRECTORY_SEPARATOR;\n }\n\n // Remove right-most slashes when $path points to directory.\n $path = rtrim($path, $separators);\n\n // Returns the trailing part of the $path starting after one of the directory separators.\n $filename = preg_match('@[^'.preg_quote($separators, '@').']+$@', $path, $matches) ? $matches[0] : '';\n\n return $filename;\n }", "function getFilename($path, $base) { //{{{\n return sprintf(\"%s%s/%s.xml\", DOC_DIR, $path, $base);\n}", "public function getFilename()\n {\n $file = basename($this->srcPath);\n\n $ops = str_replace(array('&', ':', ';', '?', '.', ','), '-', $this->operations);\n return trim($ops . '-' . $file, './');\n }", "function getFileSourceName($path)\n {\n global $_phpDocumentor_options;\n $pathinfo = $this->proceduralpages->getPathInfo($path, $this);\n $pathinfo['source_loc'] = str_replace($_phpDocumentor_options['Program_Root'].'/','',$pathinfo['source_loc']);\n $pathinfo['source_loc'] = str_replace('/','_',$pathinfo['source_loc']);\n return \"fsource_{$pathinfo['package']}_{$pathinfo['subpackage']}_{$pathinfo['source_loc']}\";\n }", "static function filename($name){\r\n\t\treturn ucfirst($name);\r\n\t}", "function find_file_basename($path) {\n $file_path_basename = pathinfo($path);\n //Determine the basename\n $file_basename = $file_path_basename['basename'];\n return $file_basename;\n }", "public static function getFileNameWithoutExtension($path)\n {\n $fileName = pathinfo($path, PATHINFO_FILENAME);\n\n return $fileName;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if the repository has a composer file for a given identifier, false otherwise.
function hasComposerFile($identifier);
[ "public function hasComposerFile(string $identifier): bool;", "public function hasComposerFile(): bool\n {\n return file_exists(sprintf('%s/composer.json', $this->baseDirectory));\n }", "public function usesComposer()\n\t{\n\t\t$path = $this->app['path.base'].DIRECTORY_SEPARATOR.'composer.json';\n\n\t\treturn $this->app['files']->exists($path);\n\t}", "private function isComposerProject(): bool {\n return file_exists(implode(DIRECTORY_SEPARATOR, [\n $this->getDirectory(),\n \"composer.json\",\n ]));\n }", "protected function composerJsonFileExists()\n {\n return $this->zip->locateName('composer.json', ZipArchive::FL_NODIR);\n }", "static function isLoaded($composer) {\n if (is_string($composer)) {\n if (file_exists($composer)) {\n $composer = json_decode(file_get_contents($composer));\n if (!$composer)\n throw new \\Exception(\"bad composer.json file\");\n }\n else {\n throw new \\Exception(\"no composer.json file\");\n }\n }\n $packages = self::getInstalledPackages();\n return (isset($packages[$composer->name]));\n }", "public function isComposerPackage()\n {\n return\n ! empty($this->content) &&\n $this->hasName() &&\n (\n $this->hasPackageType() ||\n $this->isSatisPackage()\n );\n }", "function is_installed_via_composer(): bool\n{\n $assumedVendorDir = dirname(__DIR__, 3);\n # try to see if we can find a vendor directory\n $isVendorDir = ends_with($assumedVendorDir, 'vendor');\n # check if it's actually a vendor directory\n $hasAutoloadFile = file_exists(implode(DIRECTORY_SEPARATOR, [$assumedVendorDir, 'autoload.php']));\n # check if there's an autoload.php file present inside the vendor directory\n return $isVendorDir && $hasAutoloadFile;\n}", "public function hasRepositoryByName(string $name): bool;", "public function hasPackage(): bool;", "public static function composerHasPackage(string $package): bool\n {\n $composer = static::getProjectComposer();\n\n foreach (['require', 'require-dev'] as $section) {\n if (isset($composer[$section][$package])) {\n return true;\n }\n }\n\n return false;\n }", "public function isAvailable()\n {\n $package = AssetPackage::fromFullName($this->getFullName());\n\n $repository = Yii::createObject(PackageRepository::class, []);\n\n return $repository->exists($package);\n }", "public function hasPackage() : bool;", "private function has_composer() {\n\t\tif ( WPEX_VC_ACTIVE && $this->post_id ) {\n\t\t\t$post_content = get_post_field( 'post_content', $this->post_id );\n\t\t\tif ( $post_content && strpos( $post_content, 'vc_row' ) ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "protected function checkWritableComposerVendor()\r\n {\r\n $path = base_path('vendor');\r\n return $this->isWritable($path);\r\n }", "public function packagesExists(): bool\n {\n return file_exists($this->rootPath . '/package.json') ? true : false;\n }", "public static function localPackageExists() {\n return file_exists(DIR_FS_WORK . 'updates/update.phar');\n }", "public function hasLicenseFile()\n {\n return $this->license_file !== null;\n }", "private function composerInstalled($session) {\n $composerCheck = $this->applicationInstalledCheck('composer');\n $filename = implode('', $composerCheck['output']);\n \n if($composerCheck['status'] === 0 && file_exists($filename)) {\n $session->set('composer', $filename);\n \n return true;\n } else {\n $composerCheck = $this->applicationInstalledCheck('composer.phar');\n $filename = implode('', $composerCheck['output']);\n \n if($composerCheck['status'] === 0 && file_exists($filename)) {\n $session->set('composer', $filename);\n \n return true;\n }\n }\n \n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return GraphQL query string by categoryId
private function getQuery(int $categoryId): string { return <<<QUERY { categoryList(filters: {ids: {in: ["$categoryId"]}}) { id name children_count children { id name children_count } } } QUERY; }
[ "public function getCategory(): string\n {\n return 'graphql';\n }", "public function transferCategoriesQuery(): string;", "private function buildCategoryCountQuery(): string\n {\n $language = $this->requestInputService->getInputValue(QueryConstants::LANGUAGE_KEY);\n\n $query =\n \"SELECT \" .\n \"name, \" .\n \"games_played AS \" . QueryConstants::AMOUNT_COLUMN_NAME . \" \" .\n \"FROM \" .\n \"category \";\n\n $query .= $this->buildWhereSubQuery($language);\n\n $query .=\n \"ORDER BY \" .\n \"amount DESC \" .\n \"LIMIT \" . QueryConstants::LIMIT_NUMBER;\n\n return $query;\n }", "public function queryCategories() : ContainerQuery;", "function findByCatWithInputTypeTitleWithDbal($concetCatId) {\n $conn = $this->getEntityManager()->getConnection();\n $qb = $conn->createQueryBuilder();\n $qb->select(\"concept_params.id_concept_params\"\n . \",concept_params.name\"\n . \",concept_params.description\"\n . \",concept_param_input_types.title\"\n )\n ->from(\"concept_params\"\n , \"concept_params\")//alias\n ->innerJoin(\"concept_params\"\n , \"concept_param_input_types\"\n , \"concept_param_input_types\"//alias\n , \"concept_params.id_concept_param_input_types=concept_param_input_types.id_concept_param_input_types\")\n ->innerJoin(\"concept_params\"\n , \"concept_categories\"\n , \"concept_categories\"//alias\n , \"concept_params.id_concept_categories=concept_categories.id_concept_categories\")\n ->where(\"concept_categories.id_concept_categories=:id_concept_categories\")\n ;\n $stmt = $conn->prepare($qb->getSQL());\n $stmt->bindValue(\":id_concept_categories\", $concetCatId);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res;\n }", "function _culturefeed_content_build_categories_query($values) {\n $query = '';\n $rows = _culturefeed_content_convert_categories_to_rows($values);\n\n // Loop through all possible field rows.\n foreach (array_filter($rows) as $value) {\n if ($value['type'] == 'all' || empty($value['ids'])) {\n continue;\n }\n\n $not_equal = (int)$value['equal'];\n $query .= '&fq=(';\n\n $selected = array_values($value['ids']);\n\n for ($j = 0; $j<count($selected); $j++) {\n $cat_id = $selected[$j];\n\n // Check for possible grouped values and split them up.\n if (strpos($cat_id, ',')) {\n $cat_ids = explode(',', $cat_id);\n $selected = array_merge($selected, $cat_ids);\n continue;\n }\n\n $type = $value['type'];\n $query .= ($not_equal ? 'NOT ' : '');\n $query .= \"category_$type\" .\"_id:$cat_id\";\n\n if(count($selected)-1 > $j) {\n $query .= ' OR ';\n }\n else {\n continue;\n }\n }\n\n $query .= ')';\n }\n\n return $query;\n}", "function TestCase_lookup_category_name_by_id($category_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_category_name_by_id', array(new xmlrpcval($category_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getPostCategory($category_id)\n {\n if ($category_id == 1) \n {\n return \"watches\";\n }\n if ($category_id == 2) \n {\n return \"sunglasses\";\n }\n if ($category_id == 3) \n {\n return \"furnishing\";\n }\n\n }", "protected function categorySql($v){\n\n\t\t$categories = \"SELECT DISTINCT `E`.`category_string` AS `category_name` \". feedFrom::fromConstruct(\"all\") . reportQueryWhere();\n\t\t\n\t\tif($v == \"ghost\"){\n\t\t\t$select = \"SELECT DISTINCT `map`.`category_string` \";\n\t\t\t$join = \" LEFT \";\n\t\t\t$where = \" WHERE (`feed`.`category_name` IS NULL OR `feed`.`category_name` = '') AND (`map`.`id` IS NOT NULL OR `map`.`cattax_id` IS NOT NULL)\";\n\t\t} elseif($v == \"missing\") {\n\t\t\t$select = \"SELECT DISTINCT `feed`.`category_name` \";\n\t\t\t$join = \" RIGHT \";\n\t\t\t$where = \" WHERE (`feed`.`category_name` IS NOT NULL AND `feed`.`category_name` <> '') AND (`map`.`id` IS NULL OR `map`.`cattax_id` IS NULL)\";\n\t\t}\n\n\t\t$sql = $select . \" AS `category` FROM `\" . _DB_NAME_ . \"`.`mc_cattax_mapping` AS `map` \" . $join . \" JOIN (\" . $categories . \") AS `feed` ON `cattax_merchant_id` = '\" . _MERCHANTID_ . \"' AND `feed`.`category_name` = `map`.`category_string` \" . $where . \" ORDER BY `category`\";\n\n\t\treturn $sql;\n\t}", "function getCategory($id);", "public function get_category_name($iduser, $idcategory) {\n\t \t$s = \"SELECT category_name \"; \n $f = \"FROM p_category \";\n $w = \"WHERE user_iduser = \" . $iduser . \" AND idcategory = \" . $idcategory; \n \n $query_string = $s . $f . $w; \n \n\t \treturn $this->instance->query($query_string);\n\t }", "public function getCategoryProductsQuery();", "function findThisCategory($category_id){\n\t\tglobal $conn;\n\n\t\t$sql = \"SELECT * FROM category WHERE cat_id = {$category_id}\";\n\t\t$select_one_category_query = $conn->query($sql);\n\n\t\twhile ($row = $select_one_category_query->fetch_assoc()) {\n\t\t\t$cat_id = $row['cat_id'];\n\t\t\t$cat_title = $row['cat_title'];\n\t\t\techo \"{$cat_title}\";\n\t\t}\n\t}", "public function getDQL();", "public function findByIdWithCategory($id);", "public static function getLiteralsQuery($languageId = false) {\n\t\t$query = '';\n\t\tself::getConnectionType ();\n\t\tswitch ($_SESSION ['s_dbConnectionType']) {\n\t\t\tcase self::DB_MYSQL :\n\t\t\t\t$query = UtilMysql::getLiteralsQuery ( $languageId );\n\t\t\t\tbreak;\n\t\t\tcase self::DB_ORACLE :\n\t\t\t\tbreak;\n\t\t\tcase self::DB_SQLSERVER :\n\t\t\t\tbreak;\n\t\t\tcase self::DB_POSTGRESQL :\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $query;\n\t}", "public function getFeedCategoryTermQuery() {\r\n if (!$this->queryFeedCategoryTerm) {\r\n $this->queryFeedCategoryTerm = db_select('feed_category_term', 'fct')->fields('fct');\r\n $this->queryFeedCategoryTerm->join('feed_category_term_index', 'fcti', 'fcti.fctid = fct.fctid');\r\n $this->queryFeedCategoryTerm->join('feed_category', 'fc', 'fc.fcid = fct.fcid');\r\n }\r\n return $this->queryFeedCategoryTerm;\r\n }", "protected function getUrlFormatForCategorySelector() {\n\t\t$urlParameters = array(\n\t\t\t'id' => $this->id\n\t\t);\n\t\tif ($this->currentPage > 1) {\n\t\t\t$urlParameters['curPage'] = $this->currentPage;\n\t\t}\n\t\tif (($searchField = t3lib_div::_GP('search_field'))) {\n\t\t\t$urlParameters['search_field'] = $searchField;\n\t\t}\n\t\tif ($this->sortParameter != '') {\n\t\t\t$urlParameters[$this->sortParameterName] = $this->sortParameter;\n\t\t}\n\t\tif ($this->sortDirectionParameter) {\n\t\t\t$urlParameters[$this->sortDirectionParameterName] = $this->sortDirectionParameter;\n\t\t}\n\t\t$parameters = substr(t3lib_div::implodeArrayForUrl('', $urlParameters), 1);\n\t\t$parameters = str_replace('%', '%%', $parameters);\n\t\treturn 'index.php?' . $parameters . '&cat=%1$s';\n\t}", "function getAssetCat($asset_cat_id)\n{\n return \"SELECT asset_cat_desc, asset_class_id FROM asset_categories WHERE asset_cat_id = \".$asset_cat_id.\";\";\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAddToProjectsUrl Return send welcome message URL
function getSendWelcomeMessageUrl() { return assemble_url('people_company_user_send_welcome_message', array( 'company_id' => $this->getCompanyId(), 'user_id' => $this->getId(), )); }
[ "public function getProjectUrl()\n {\n return Mage::getUrl('xcentia_projects/project/view', array('id'=>$this->getId()));\n }", "public function project_url(){\n\t\treturn $this->the_url;\n\t}", "function getSendReminderUrl() {\n \treturn assemble_url('reminders_add', array('parent_id' => $this->getId()));\n }", "function prepareProjectURL($project){\n return returnFullURL().$project;\n }", "function wiki_get_url_for_project( $p_project_id ) {\n\t\treturn wiki_call( 'get_url_for_project', array( $p_project_id ) );\n\t}", "public function projectURL($target_project);", "function goone_signup_url() {\n global $CFG;\n\n $partnerurl = \"\";\n $partnerid = get_config('mod_goone', 'partnerid');\n if (!empty($partnerid)) {\n $partnerurl = \"&partner_portal_id=\".$partnerid;\n }\n $url = 'https://auth.GO1.com/oauth/authorize?client_id=Moodle&response_type=code&redirect=false&redirect_uri='\n .$CFG->wwwroot.'&new_client=Moodle'.$partnerurl;\n return $url;\n}", "function discussions_handle_on_quick_add(&$quick_add_urls) {\n $quick_add_urls['discussion'] = assemble_url('project_discussions_quick_add', array('project_id' => '-PROJECT-ID-'));\n }", "function get_personal_message_creation_url()\r\n {\r\n return $this->get_url(array(self :: PARAM_ACTION => self :: ACTION_CREATE_PUBLICATION));\r\n }", "public function actionUpdatejetwebhookurl()\n {\n \t$allClients = []; \n\n \t$sql = \"SELECT `id`,`username`,`auth_key` FROM `user` WHERE `auth_key`!='' AND id=14\";\n\n \t$allClients = Data::sqlRecords($sql,'all','select');\n \tforeach ($allClients as $key => $value) \n \t{\n\t\t\t$sc = new ShopifyClientHelper($value['username'], $value['auth_key'],PUBLIC_KEY,PRIVATE_KEY);\n\t\t\t//Createwebhook::createNewWebhook($sc,$value['username'],$value['auth_key']);\n\t\t\t//echo \"<hr><pre>\";\n\t\t\tprint_r($sc->call('GET','/admin/webhooks.json'));\n\t\t\tdie(\"<hr>Newly Created\");\n \t} \t\n }", "private function saveAsProjectUrl() {\n $pre = 'http://' . $_SERVER['HTTP_HOST'];\n if ($this->user->hasRole('ROLE_PARENT')) {\n $this->return['saveAsProjectUrl'] = $pre . $this->container->get('router')->generate('user_parent_my_stories_drafts');\n } elseif ($this->user->hasRole('ROLE_CHILD')) {\n $this->return['saveAsProjectUrl'] = $pre . $this->container->get('router')->generate('user_child_my_stories_drafts');\n } elseif ($this->user->hasRole('ROLE_SCHOOL')) {\n $this->return['saveAsProjectUrl'] = $pre . $this->container->get('router')->generate('user_school_my_stories_drafts');\n } elseif ($this->user->hasRole('ROLE_EDUCATOR')) {\n $this->return['saveAsProjectUrl'] = $pre . $this->container->get('router')->generate('user_educator_my_stories_drafts');\n }\n }", "function source_module_add_repository_url($project) {\n return assemble_url('repository_add',array('project_id'=>$project->getId()));\n }", "public function getReorgUrl()\n\t{\n return $this->getUrl(\n array(\n \t'path' => '/project',\n \t'method' => 'reorg',\n \t'projectId' => $this->getProjectId()\n )\n );\n\t}", "function thb_get_project_url() {\n\t\treturn thb_get_post_meta( thb_get_page_ID(), 'project_url' );\n\t}", "function wiki_mediawiki_get_url_for_project( $p_project_id ) {\n\t\treturn wiki_mediawiki_get_url_for_page_id( wiki_mediawiki_get_page_id_for_project( $p_project_id ) );\n\t}", "function link_project( $p_event, $p_project_id ) {\n\t\treturn $this->base_url( $p_project_id ) . 'Main_Page';\n\t}", "function get_the_hrb_project_create_url( $post_id = 0, $query_args = array() ) {\n\tglobal $wp_rewrite;\n\n\tif ( $wp_rewrite->using_permalinks() ) {\n\t\treturn user_trailingslashit( get_permalink( HRB_Project_Create::get_id() ) ) . ( $post_id ? $post_id : '' );\n\t}\n\n\t$args = array();\n\n\tif ( $post_id ) {\n\t\t$args = array( 'project_id' => $post_id );\n\t}\n\t$args = wp_parse_args( $query_args, $args );\n\n\treturn add_query_arg( $args, get_permalink( HRB_Project_Create::get_id() ) );\n}", "protected function getProjectUrl() {\n\t\treturn Mage::getBaseUrl();\t\t\n\t}", "private function setProjectURL(){\n\n\t\t$this->projectURL = $this->baseURL.\"project/\";\n\t}", "function getPeopleUrl() {\n return Router::assemble('project_people', array('project_slug' => $this->getSlug()));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find active document signature by source id and type.
public function findActiveDocumentSignatureBySourceIdAndType($accountId, $type) { return $this->findOneDocumentSignatureBySourceIdAndType($accountId, $type, true); }
[ "public function findActiveDocumentSignature($id)\n {\n return $this->findOneDocumentSignatureBy(['id' => $id, 'active' => true]);\n }", "public function getDocumentSignatureType();", "public function get_audit_signature_id($id, &$document) {\n\n $invitations = $this->invite->getInvitations($id);\n\n $events = $this->getEvents($id);\n\n $signatures = $this->signature->getDocumentSignatures($id);\n\n $timeline = array();\n\n $signature_status = $this->getSignatureStatus($id);\n $signatures_needed_count = count($signature_status['signatures_needed']);\n\n if ($document->document_status == 'draft') {\n $signature_status_label = 'Created';\n } else if ($signature_status['invitation_count'] > 0) {\n\n if ($signatures_needed_count > 0) {\n $signature_status_label = sprintf(__(\"Awaiting %s signatures\", 'esig'), $signatures_needed_count);\n } else {\n $signature_status_label = 'Completed';\n }\n }\n $document->signature_status = isset($signature_status_label) ? $signature_status_label : '';\n\n // Created\n if (esig_older_version($id)) {\n foreach ($events as $event) {\n $timekey = strtotime($event->date);\n\n while (array_key_exists($timekey, $timeline)) {\n\n $timekey++;\n }\n\n $timeline[$timekey] = array(\n \"date\" => $event->date,\n \"event_id\" => $event->id,\n \"log\" => $event->event_data\n );\n }\n } else {\n\n // older version start here \n $creator = $this->user->getUserByWPID($document->user_id);\n\n $timeline[strtotime($document->date_created) - 1] = array(\n \"date\" => $document->date_created,\n \"log\" => \"Document {$document->document_title}<br/>\\n\" .\n \"Uploaded by {$creator->first_name} - {$creator->user_email}<br/>\\n\" .\n \"IP: {$document->ip_address}<br/>\\n\"\n );\n\n // Invitations\n foreach ($invitations as $invitation) {\n\n $recipient = $this->user->getUserdetails($invitation->user_id, $invitation->document_id);\n $recipient_txt = $recipient->first_name . ' - ' . $recipient->user_email;\n $log = \"Document sent for signature to $recipient_txt<br/>\";\n if ($invitation->invite_sent > 0) {\n\n $timekey = strtotime($invitation->invite_sent_date);\n if (array_key_exists($timekey, $timeline)) {\n $timekey = strtotime($invitation->invite_sent_date) + 1;\n }\n $timeline[$timekey] = array(\n 'date' => $invitation->invite_sent_date,\n 'log' => $log\n );\n }\n }\n\n //event loop start here . \n foreach ($events as $event) {\n\n $data = json_decode($event->event_data);\n\n // Views\n if ($event->event == 'viewed') {\n\n if ($data->fname) {\n $viewer = $this->user->getUserdetails($data->user, $event->document_id);\n $viewer_txt = $data->fname . ' - ' . $viewer->user_email;\n } elseif ($data->user) {\n $viewer = $this->user->getUserdetails($data->user, $event->document_id);\n $viewer_txt = $viewer->first_name . ' - ' . $viewer->user_email;\n }\n\n $viewer_txt = $viewer_txt ? \" by $viewer_txt\" : '';\n $log = sprintf(__(\"Document viewed %1s<br/>\\n IP: %2s\\n\", 'esig'), $viewer_txt, $data->ip);\n\n // Signed by all\n } else if ($event->event == 'name_changed') {\n if ($data->fname) {\n $new_signer_name = stripslashes_deep($data->fname);\n }\n\n if ($data->user) {\n\n $viewer = $this->user->getUserdetails($data->user, $event->document_id);\n $viewer_txt = stripslashes_deep($viewer->first_name);\n }\n // $viewer_txt = $viewer_txt ? \" by $viewer_txt\" : '';\n //R$log = \"Signer name $viewer_txt was changed to $new_signer_name by $viewer->user_email <br/> \\n\" . \"IP: {$data->ip}\\n\";\n $log = sprintf(__(\"Signer name %s was changed to %s by %s <br/> \\n\" . \"IP: %s}\\n\", \"esign\"), $viewer_txt, $new_signer_name, $viewer->user_email, $data->ip);\n } else if ($event->event == 'all_signed') {\n\n $log = __(\"The document has been signed by all parties and is now closed.\", 'esig');\n }\n\n $timekey = strtotime($event->date);\n if (array_key_exists($timekey, $timeline)) {\n $timekey = strtotime($event->date) + 1;\n }\n $timeline[$timekey] = array(\n \"date\" => $event->date,\n \"log\" => $log\n );\n }\n\n\n\n // Signatures\n foreach ($signatures as $signature) {\n\n $signer_name = $this->user->get_esig_signer_name($signature->user_id, $id);\n $user = $this->user->getUserdetails($signature->user_id, $id);\n\n $user_txt = $signer_name . ' - ' . $user->user_email;\n\n $log = sprintf(__(\"Document signed by %1s<br/>\\n IP: %2s\", 'esig'), $user_txt, $signature->ip_address);\n\n $timekey = strtotime($signature->sign_date);\n if (array_key_exists($timekey, $timeline)) {\n $timekey = strtotime($signature->sign_date) + 1;\n }\n $timeline[strtotime($timekey)] = array(\n \"date\" => $signature->sign_date,\n \"log\" => $log\n );\n }\n } // older timeline genarator end here \n // Set timezone\n //date_default_timezone_set('UTC');\n\n\n\n $html = <<<EOL\n\t\t\t\t<div class=\"document-meta\">\n\t\t\t\t\t<span class=\"doc_title\">Audit Trail</span><br/>\n\t\t\t\t\tDocument name: {$document->document_title}<br/>\n\t\t\t\t\tUnique document ID: {$document->document_checksum}<br/>\n\t\t\t\t\tStatus: {$document->signature_status}\n\t\t\t\t</div>\n\t\t\t\t<ul class=\"auditReport\">\nEOL;\n\n // Sort\n\n\n\n ksort($timeline);\n\n $days = array();\n $audittrail = \"\";\n\n $previous_day = \"\";\n $html .= \"<table class=\\\"day\\\">\\n\";\n foreach ($timeline as $k => $val) {\n //$date = date('l M jS h:iA e', $k);\n\n $val['timestamp'] = $k;\n $date4sort = date('Y:m:d', $k);\n if ($previous_day != $date4sort) {\n list($yyyy, $mm, $dd) = preg_split('/[: -]/', $date4sort);\n $day_timestamp = strtotime(\"$mm/$dd/$yyyy\");\n $default_dateformat = get_option('date_format');\n $html .= \"<th colspan=\\\"2\\\" class=\\\"day_label\\\">\" . date($default_dateformat, $k) . \"</th>\\n\";\n }\n\n // Creates Audit Trail Serial # Hash on Documents //\n $previous_day = $date4sort;\n $default_timeformat = get_option('time_format');\n\n $event_id = isset($val['event_id']) ? $val['event_id'] : NULL;\n\n if ($event_id) {\n\n $doc_timezone = $this->esig_get_document_timezone($document->document_id);\n\n if (!empty($doc_timezone)) {\n date_default_timezone_set($doc_timezone);\n $esig_timezone = date('T');\n } else {\n $esig_timezone = $this->get_esig_event_timezone($document->document_id, $event_id);\n // Set timezone\n date_default_timezone_set($this->esig_get_timezone_string_old($esig_timezone));\n if ($esig_timezone != 'UTC') {\n\n $esig_timezone = str_replace('.5', '.3', $esig_timezone);\n $esig_timezone = $esig_timezone . '000';\n }\n }\n } else {\n date_default_timezone_set('UTC');\n $esig_timezone = NULL;\n }\n\n $li = \"<td class=\\\"time\\\">\" . date($default_timeformat, $val['timestamp']) . ' ' . $esig_timezone . \"</td>\";\n $li .= \"<td class=\\\"log\\\">\" . $val['log'] . \"</td>\";\n $html .= \"<tr>$li</tr>\";\n\n\n\n if ((strpos($val['log'], \"closed\") > 0) && ($audittrail == \"\")) {\n\n $audittrail = $html;\n }\n }\n\n $hash = '';\n\n if ($this->getSignedresult($id))\n $hash = wp_hash($audittrail);\n\n //echo $hash ; \n return $hash;\n }", "public function GetSignature($id) {\n return (isset($this->all[$id]) ? $this->all[$id] : null);\n }", "function findSource($sourceId) {\n\t\treturn $this->controller->model->find('first', array(\n\t\t\t'conditions' => array('Image.id' => $sourceId),\n\t\t\t'contain' => array('Metadata', 'Version' => array('Metadata'))\n\t\t));\n\n\t}", "private function getFirstSignature() { \n $signature = $this->getDoctrine()\n ->getRepository('AppBundle:Signature')\n ->find(1);\n \n return $signature;\n }", "public function getDirectorSignature()\n {\n return $this->hasOne(CmsStorageFile::className(), ['id' => 'director_signature_id']);\n }", "public function getSource($index, $type, $id)\n {\n if ($this->db->dslVersion >= 7) {\n return $this->db->get([$index, '_doc', $id]);\n } else {\n return $this->db->get([$index, $type, $id]);\n }\n }", "public function findOneOwnerSignatureBy(array $criteria)\n {\n return $this->ownerSignatureRepository->findOneBy($criteria);\n }", "abstract protected function getImageIdentifier($source);", "public function getRecipientSignatureDocflow()\n {\n return $this->get(self::RECIPIENTSIGNATUREDOCFLOW);\n }", "function Aastra_read_signature($user)\n{\nreturn(Aastra_get_user_context($user,'signature'));\n}", "public function getReferencedSignatureID()\n {\n return $this->referencedSignatureID;\n }", "function get_volunteer_signature($volunteer_id, $event_id) {\n\t$db_link = setup_db();\n\n\tif(!($volunteer_id && $event_id))\n\t\treturn FALSE;\n\n\t$query = \"SELECT * FROM `volunteer_event` WHERE `volunteer_id` = {$volunteer_id} AND `event_id` = {$event_id}\";\n\t$result = mysqli_query($db_link, $query) or die(mysqli_error($db_link));\n\treturn _get_row($result);\n}", "public function getSignatureID()\n {\n return $this->signatureID;\n }", "public function getDocumentSignature($user_id, $document_id) {\n\n $sig = $this->getDocumentSignatureData($user_id, $document_id);\n\n if (!empty($sig)) {\n //echo '<h1>,'.stripslashes($this->decrypt($sig->signature_salt, $sig->signature_data)).'</h1>';\n return stripslashes($this->decrypt($sig->signature_salt, $sig->signature_data));\n }\n }", "public function signedDocument() {\n return self::query($this->client, [$this->id, self::SIGNED_DOCUMENT]);\n }", "public function findDocumentSignaturesBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n {\n return $this->documentSignatureRepository->findBy($criteria, $orderBy, $limit, $offset);\n }", "function getUserSignatureArrayFromID($userID) {\n\t\tglobal $DB;\n\t\n\t\t$sql = \"SELECT attachsig, signature FROM `\" . USERSDBTABLEPREFIX . \"users` WHERE id='\" . $userID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\twhile ($row = $DB->fetch_array($result)) {\n\t\t\t\t// Make sure we filter our signature\n\t\t\t\treturn array($row['attach_sig'], runWordFilters($row['signature']));\n\t\t\t}\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set testcases to run
public function setSelectedTestcases(array $testcases = array()) { $this->selectedTestcases = $testcases; }
[ "public function setTestcases($testcases) {\n $this->testcases = $testcases;\n }", "public function runTests() {\n\t}", "public function runSelectedTests(){\n\t\tself::getAvailableTests(); // just to include all files\n\n\t\tif (array_key_exists('runtest', $_REQUEST)) {\n\n\t\t\t// logging\n\t\t\trequire_once( dirname(__FILE__) .DS. 'SimpleHtmlReporter.php');\n\n\t\t\t$out = \"\\n\".str_repeat('=',50).\"\\nStarting tests, executed by user [\".self::getUserName().\"]. Deleted [\".TestUtils::flushTempDir().\"] files from temp dir [\".DIR_TEMP.\"]\\n\".str_repeat('=',50);\n\t\t\tTestUtils::log($out, self::LOGNAME, TestUtils::LEVEL_INFO);\n\n\t\t\t$selected_tests = array();\n\n\t\t\tforeach($_REQUEST['runtest'] as $test_case=>$methods) {\n\t\t\t\tif(is_array($methods)){\n\t\t\t\t\t$selected_tests[$test_case] = array_keys($methods);\n\t\t\t\t}else{\n\t\t\t\t\t$this->errors[] = '<div class=\"alert alert-error\">Caution - TestCase \"'.$test_case.'\" has no selected unit test.</div>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$reporter = new SimpleHtmlReporter();\n\t\t\t$reporter->setTests($selected_tests);\n\n\t\t\t$test_suite = new TestSuite();\n\t\t\tforeach($selected_tests as $class=>$methods) {\n\t\t\t\t/**\n\t\t\t\t* @var WebTestCase\n\t\t\t\t*/\n\t\t\t\t$test_case = new $class();\n\n\t\t\t\t// uprav nastavenia podla typu prostredia\n\t\t\t\t$modifier_class = $class.'Set';\n\t\t\t\tif(class_exists($modifier_class, false)){\n\t\t\t\t\t// pozri priklad v testing/database.php\n\t\t\t\t\t$test_case = call_user_func(array($modifier_class, 'set'), $test_case);\n\t\t\t\t}\n\n\t\t\t\t$test_suite->add($test_case);\n\t\t\t}\n\n\t\t\t$test_suite->run($reporter);\n\t\t\tself::$output_result_tests = $reporter->getOutput();\n\n\t\t\t// logging\n\t\t\tforeach($reporter->getStatus() as $name=>$test_case) {\n\t\t\t\t$log = '['.$test_case['passed'].'] passed, ['.$test_case['failed'].'] failed for ['.$name.']. Executed methods: '.implode(', ', $test_case['methods']);\n\t\t\t\tif (sizeof($test_case['messages']) > 0) {\n\t\t\t\t\t$log .= \"\\n\" . implode(\"\\n\", $test_case['messages']);\n\t\t\t\t}\n\t\t\t\tTestUtils::log(strip_tags($log), self::LOGNAME, TestUtils::LEVEL_INFO);\n\t\t\t}\n\t\t\t$timeMemory = \" -- Execution time [\".TestUtils::execTime().'], memory usage ['.TestUtils::getMemoryUsage().']';\n\t\t\tTestUtils::log($timeMemory, self::LOGNAME, TestUtils::LEVEL_INFO);\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "abstract public function testsuites();", "public function runTests() {\n\n\t\tif(Director::is_cli()) {\n\t\t\t$this->setReporter( new CliTestReporter() );\n\t\t} else {\n\t\t\t$this->setReporter( new SapphireTestReporter() );\n\t\t}\n\n\t\tif ($this->getFrameworkTestResults() == null) {\n\t\t\t$this->setFrameworkTestResults(new PHPUnit_Framework_TestResult());\n\t\t}\n\t\t$this->getFrameworkTestResults()->addListener( $this->getReporter() );\n\n\t\t$this->beforeRunTests();\n\t\t$this->getSuite()->run($this->getFrameworkTestResults());\n\t\t$this->afterRunTests();\n\t}", "public function setTests(array $tests): \\void {}", "abstract protected function run_tests($code, $testcases);", "protected static function initExecuteSetupOnAllTest()\n {\n if(null === static::$executeSetupOnAllTest) {\n static::$executeSetupOnAllTest = true;\n }\n }", "public function run()\n {\n foreach ($this->getTestMethods() as $method)\n {\n $test = $method->getName();\n\n $this->info(sfInflector::humanize(sfInflector::underscore(substr($test, 4))));\n $this->setUp();\n $this->$test();\n $this->tearDown();\n }\n }", "public function test_functionals()\n {\n chdir(MAD_ROOT . '/test');\n passthru('phpunit --group functional AllTests'); \n }", "function _runTestFiles() {\n\t\t$this->content .= $this->_runtest('security_check_test_files');\n\t}", "public function runTests()\n {\n $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->properties->getProperty('vendor.dir')))\n ->bootstrap('bootstrap.php')\n ->configFile('phpunit.xml')\n ->run();\n }", "public function runTests()\n {\n\n // run PHPUnit\n $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->getVendorDir()))\n ->configFile('phpunit.xml')\n ->run();\n }", "public function setUp() {\n $this->suite= new TestSuite();\n }", "public function testSetAllowedRunConfigurations()\n {\n }", "function wptest_listall_testcases($test_classes) {\n\techo \"\\nWordPress Tests available TestCases:\\n\\n\";\n\tnatcasesort( $test_classes );\n\techo array_reduce($test_classes, '_wptest_listall_testcases_helper');\n\techo \"\\nUse -t TestCaseName to run individual test cases\\n\";\t\n}", "function buildAndRunTests()\n{\n}", "public function run(){\n echo \"\\n==== Running tests =====\\n\";\n \n $nonTestFunctions = [ \"run\", \"runBeforeEach\", \"invokeMethod\", \"runAfterEach\" ];\n $shouldRunBeforeEach = method_exists($this, 'runBeforeEach');\n $shouldRunAfterEach = method_exists($this, 'runAfterEach');\n \n $tests = get_class_methods($this);\n foreach($tests as $testFunc){\n if( in_array($testFunc, $nonTestFunctions )){ continue; } \n if( $shouldRunBeforeEach ){ $this->runBeforeEach(); }\n try{\n $this->{$testFunc}();\n echo \"[{$testFunc}] PASSED \\n\";\n }\n catch (\\Exception $err) {\n echo \"[{$testFunc}] FAILED : {$err->getMessage()}\\n\";\n }\n if( $shouldRunBeforeEach ){ $this->runBeforeEach(); }\n }\n echo \"========================\\n\\n\";\n }", "function setTestMode($istest)\r\n\t{\r\n\t\t$this->testMode = $istest;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return's the body content stored in body stream
public function getBodyContent();
[ "public static function bodyStream() {\n\t\treturn fopen(self::REQUEST_BODY_STREAM, 'r');\n\t}", "public function getRawBody()\n {\n if ($this->stream) {\n $this->readStream();\n }\n return $this->content;\n }", "public function getFullBodyContents() {\n\t\t$offset = $this->getBody()->tell();\n\t\t$this->getBody()->rewind();\n\t\t$body = $this->getBody()->getContents();\n\t\t$this->getBody()->seek($offset);\n\t\t\n\t\treturn $body;\n\t}", "public function getBody()\r\n {\r\n return $this->body;\r\n }", "public function body() {\r\n return $this->body ;\r\n }", "public static function getBody()\n {\n $temp = fopen('php://temp', 'w+');\n\n stream_copy_to_stream(\n fopen('php://input', 'r'),\n $temp\n );\n\n rewind($temp);\n\n return new Stream($temp);\n }", "public static function bodyStream() {\n\t\treturn fopen(self::RESPONSE_BODY_STREAM, 'w');\n\t}", "public static function getRequestBodyStream () {}", "public function getBody()\n {\n\treturn $this->response->getBody();\n }", "public function getBody()\n {\n return (string)$this->response->getBody();\n }", "function http_get_request_body_stream()\n {\n }", "public function getContentStream();", "public function getRawBodyAsStream()\n\t{\n\t\treturn fopen('php://input', 'r');\n\t}", "public function getBody() {\n\t\tif ( isset($this->couch_response['body']) )\n\t\t\treturn $this->couch_response['body'];\n\t}", "public function getBody(): string {\r\n return $this->_response['body'];\r\n }", "public function body()\n {\n return (string) $this->response->getBody();\n }", "public function getBody()\n {\n if ($this->getStorage() == Config::ATTACHMENT_STORAGE_FS) {\n return file_get_contents($this->getExternalPath());\n }\n\n return $this->getData('body');\n }", "public function\n\t\t\tbody() {\n\t\t\t\treturn $this->response_section_get('body');\n\t\t\t}", "public function getRequestBodyStream()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forces the API key to regenerate and saves the record
public function regenerateApiKey() { $this->apiKey = false; return $this->save(false, ['apiKey']); }
[ "public function updateApikey();", "public function save( ApiKey $api_key ): ApiKey;", "public function reset_key()\n {\n $response = $this->check_request('Changing web key');\n if (!$response) {\n $wpid = \\get_current_user_id();\n $person = TableMembers::findByWordpressID($wpid);\n $newkey = generate_key();\n $this->log_info(\"Change key for $wpid: \" . $person->web_key .\n \" => $newkey\");\n $response = $this->get_response(false, \"New web key generated\");\n $response['newkey'] = $newkey;\n }\n exit(json_encode($response));\n }", "function CreateAPIKey( )\n{\n}", "function saveApiKey(){\r\n\t//return true\r\n}", "public function saveapiKey($key)\n {\n $this->api_key=$key;\n \n \n }", "public function create(){\n\t\t//must be ajax\n\t\tif(Request::ajax()){\n\t\t\t$user = Auth::user();\n\t\t\t$userId = $user->id;\n\n\t\t\t//only allowed one key\n\t\t\t$numberOfKeys = ApiKey::where('user_id', $userId)->count();\n\t\t\tif($numberOfKeys !== 0){\n\t\t\t\treturn response()->json(array('error' => 'Requesting too many keys'), 403);\n\t\t\t}\n\t\t\t$apiKeyModel = new ApiKey();\n\t\t\t$key = md5(microtime());\n\t\t\t$apiKeyModel->user_id = $userId;\n\t\t\t$apiKeyModel->api_key = $key;\n\t\t\t$saved = $apiKeyModel->save();\n\t\t\tif($saved){\n\t\t\t\treturn response()->json(array('key' => $key));\n\t\t\t\t// return redirect('/apikey');\n\t\t\t} else {\n\t\t\t\treturn response()->json(array('error' => 'Unable to generate key'), 500);\n\t\t\t}\n\t\t}\n\t}", "public function generateApiKey() {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $apikey = '';\n for ($i = 0; $i < 64; $i++) {\n $apikey .= $characters[rand(0, strlen($characters) - 1)];\n }\n $apikey = base64_encode(sha1(uniqid('ue' . rand(rand(), rand())) . $apikey));\n $apikey = rtrim(strtr($apikey, '+/', '-_'), '=');\n $this->apiKey = $apikey;\n }", "public function regenerateAPIKey($oldApiKey) {\n\n // Redirect not logged in users\n if (!$this->_loggedIn) {\n return Redirect::to('home');\n }\n\n // Delete old api key\n $apiKeysModel = new ApiKeysModel();\n $apiKeysModel->deleteApiKey($oldApiKey);\n\n // Generate new api key\n $apiKeysModel->generateAPIKey($this->_userId);\n }", "public function apiPrePersist()\n {\n $this->generateApiKey();\n $this->generateApiToken();\n }", "public function generateApiKey()\n {\n /** @var Mage_Core_Helper_Data $coreHelper */\n $coreHelper = Mage::helper('core');\n\n $apiKey = $coreHelper->getRandomString(40);\n\n /** @var Mage_Core_Model_Config $coreConfig */\n $coreConfig = Mage::getModel('core/config');\n\n $apiUser = $this->getApiUser();\n\n if ($apiUser->getId()) {\n $apiUser->setApiKey($apiKey)->save();\n }\n\n $modifiedDateTime = Mage::getModel('core/date')->gmtDate();\n\n $coreConfig->saveConfig('zenstores_core/config/apikey', $apiKey);\n $coreConfig->saveConfig('zenstores_core/config/apikey_modified', $modifiedDateTime);\n\n // Clean config cache\n Mage::app()->getCacheInstance()->cleanType('config');\n\n return $apiKey;\n }", "public function setNewApiToken()\n {\n $this->api_token = Str::uuid();\n $this->save();\n }", "private function generateAPIKey()\n {\n $user = $_SESSION[\"user\"];\n $key = $this->facade->generateAPIKey($user->getID()); // This method returns the key..\n $user->setAPIKey($key);\n echo $key;\n }", "public function regenerateValidationKey() {\r\n//\t\t$this->saveAttributes(array(\r\n//\t\t\t'validation_key' => md5(mt_rand() . mt_rand() . mt_rand()),\r\n//\t\t));\r\n $this->validation_key = md5(mt_rand() . mt_rand() . mt_rand());\r\n }", "public function regenerateValidationKey() {\n $this->saveAttributes(array(\n 'active_key' => md5(mt_rand() . mt_rand() . mt_rand()),\n ));\n \n }", "public function generateApiKey() {\n\n $apiKey = uniqid();\n \n $rows = $this->dbContext->update($this->id, $apiKey);\n\n if ($rows != 0) \n {\n return $this->getUser($this->id);\n } \n else\n {\n $this->messages[] = \"Api key generation error.\";\n }\n\n return $this;\n\t\t}", "private function generateAPIKey() {\r\n\r\n\t\t\t// Generate the unique key... (one of many ways to do this)\r\n\t\t\t$key = md5(uniqid(rand(), true));\r\n\r\n\t\t\treturn $key;\r\n\r\n\t\t}", "public function regenerateValidationKey()\n\t{\n $validation_key = md5(mt_rand() . mt_rand() . mt_rand());\n\t\t$this->saveAttributes(compact('validation_key'));\n\t}", "function generateAPIKey(){\n\treturn uniqid('apikey_');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a new flavor
public function store() { // Slug Validation for Translations if ( Input::get('language') ){ $slug = Str::slug(Input::get('flavor_title') . '-' . Input::get('language')); } else { $slug = Str::slug(Input::get('flavor_title')); } $validation = Validator::make([ 'title' => Input::get('flavor_title'), 'slug' => $slug ], [ 'title' => 'required', 'slug' => 'unique:flavors,slug' ]); if ( $validation->fails() ) return Redirect::back()->withErrors($validation); $this->product_factory->createProduct(Input::all()); return Redirect::route('edit_products') ->with('success', 'Product successfully added.'); }
[ "function set_flavor($flavor){\n $this->flavor = $flavor ;\n return $this->flavor ;\n }", "public function setFlavor($flavor) {\n\t\tif ($this->configurationCheck) {\n\t\t\t$this->configurationCheck->setFlavor($flavor);\n\t\t}\n\t}", "protected function setFlavor($flavor = null)\n {\n if (is_array($flavor)) {\n $flavor = new Flavor($flavor);\n }\n // @todo put this inside a try/catch\n if (is_null($flavor)) {\n $flavor = taste($this->source);\n }\n if (is_null($flavor->header)) {\n // Flavor is immutable, give me a new one with header set to lickHeader return val\n $flavor = $flavor->copy(['header' => taste_has_header($this->source)]);\n }\n $this->flavor = $flavor;\n\n return $this;\n }", "function get_flavor(){\n return $this->flavor ;\n }", "protected function adjustFlavor() {\n $services = MxcDropshipIntegrator::getServices();\n $modelManager = $services->get('models');\n $products = $modelManager->getRepository(Product::class)->findAll();\n /** @var Product $product */\n foreach ($products as $product) {\n $article = $product->getArticle();\n if ($article === null) continue;\n $flavor = $product->getFlavor();\n if (empty($flavor)) continue;\n $flavorFilter = array_map('trim', explode(',', $flavor));\n $flavorFilter = '|' . implode('|', $flavorFilter) . '|';\n ArticleTool::setArticleAttribute($article, 'mxcbc_flavor', $flavor);\n ArticleTool::setArticleAttribute($article, 'mxcbc_flavor_filter', $flavorFilter);\n }\n }", "public function flavor($id = null)\n\t{\n\t return new Flavor($this, $id);\n\t}", "function insert( $flavor )\r\r\n\t{\r\r\n\t\t$res = $this->db->insert( 'mb_flavors', $flavor );\r\r\n\r\r\n\t\tif ( $res ){\r\r\n\t\t\treturn $this->db->insert_id();\r\r\n\t\t}\r\r\n\t\telse\r\r\n\t\t{\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t}", "public static function flavor($data = array(), $api_key = FALSE)\n\t{\n\t\treturn self::factory($data, $api_key, 'flavors');\n\t}", "public function getFlavor()\n {\n return $this->flavor;\n }", "public function save(Feature $feature, $userKey, $variant);", "public function flavorJson()\n {\n return [\n 'type' => 'Uuid',\n 'required' => false,\n 'location' => self::JSON,\n 'description' => 'The flavor reference for the desired flavor for your server instance.',\n ];\n }", "function it_exchange_variants_addon_create_variant_preset( $args ) {\n\t$defaults = array(\n\t\t'post_status' => 'publish',\n\t\t'ping_status' => 'closed',\n\t\t'comment_status' => 'closed',\n\t);\n\t$defaults = apply_filters( 'it_exchange_add_variant_preset_defaults', $defaults );\n\n\t// Convert our API keys to WP keys\n\tif ( isset( $args['slug'] ) )\n\t\t$args['post_name'] = $args['slug'];\n\tif ( isset( $args['title'] ) )\n\t\t$args['post_title'] = $args['title'];\n\tif ( isset( $args['order'] ) )\n\t\t$args['menu_order'] = $args['order'];\n\n\t$args = ITUtility::merge_defaults( $args, $defaults );\n\n\t// Convert $args to insert post args\n\t$post_args = array();\n\t$post_args['post_status'] = $args['post_status'];\n\t$post_args['post_type'] = 'it_exng_varnt_preset';\n\t$post_args['post_title'] = empty( $args['title'] ) ? __( 'New Preset', 'LION' ) : $args['title'];\n\t$post_args['post_name'] = empty( $args['post_name'] ) ? 'new-preset' : $args['post_name'];\n\t$post_args['post_content'] = empty( $args['post_content'] ) ? '' : $args['post_content'];\n\t$post_args['menu_order'] = empty( $args['menu_order'] ) ? 0 : $args['menu_order'];\n\n\t// Insert Post and get ID\n\tif ( $product_id = wp_insert_post( $post_args ) ) {\n\n\t\t// Setup metadata\n\t\t$meta = array();\n\t\tif ( ! empty( $args['slug'] ) )\n\t\t\t$meta['slug'] = $args['slug'];\n\t\tif ( ! empty( $args['image'] ) )\n\t\t\t$meta['image'] = $args['image'];\n\t\tif ( ! empty( $args['values'] ) )\n\t\t\t$meta['values'] = $args['values'];\n\t\tif ( ! empty( $args['default'] ) )\n\t\t\t$meta['default'] = $args['default'];\n\t\tif ( ! empty( $args['ui-type'] ) )\n\t\t\t$meta['ui-type'] = $args['ui-type'];\n\t\tif ( ! empty( $args['core'] ) )\n\t\t\t$meta['core'] = $args['core'];\n\t\tif ( ! empty( $args['version'] ) )\n\t\t\t$meta['version'] = $args['version'];\n\n\t\t// Save metadata\n\t\tupdate_post_meta( $product_id, '_it_exchange_variants_addon_preset_meta', $meta );\n\n\t\t// Return the ID\n\t\treturn $product_id;\n\t}\n\treturn false;\n}", "function shop_set_favorite_post()\n {\n $param = $this->post();\n $userid = isset($param['phone']) ? $param['phone'] : '';\n $type = isset($param['type']) ? $param['type'] : '';\n $favorite_id = isset($param['object_id']) ? $param['object_id'] : '';\n\n if ($this->user_model->isExistUserId($userid, 1) == false) {\n $this->response(array('status' => false, 'err_code' => 6, 'error' => 'This user does not exist in server.'), 200);\n return;\n }\n\n $favorite_info = array(\n 'shop' => $userid,\n 'type' => $type,\n 'favorite_id' => $favorite_id\n );\n $insert_id = $this->favorite_model->add($favorite_info);\n\n // if favorite thing is activity then, favorite provider together\n if ($type == 0) {\n $activity = $this->activity_model->getItemById($favorite_id);\n\n if ($activity != NULL) {\n $favorite_info = array(\n 'shop' => $userid,\n 'type' => 1,\n 'favorite_id' => $activity->provider_id\n );\n\n $this->favorite_model->add($favorite_info);\n }\n }\n $this->response(array('status' => true, 'favorite_id' => $insert_id, 'data' => 'favorite add success'), 200);\n }", "public function save()\n {\n App::config('theme')->set($this->name, $this->config(['menus', 'positions', 'widgets']));\n }", "public static function store_backVariation ($request)\n {\n $backVariation = new BackVariations;\n $backVariation->name = $request->get('name');\n $backVariation->abbreviation = $request->get('abbreviation');\n $backVariation->idx = $request->get('idx');\n $backVariation->created_by = '1';\n $backVariation->dt_created = date('Y-m-d, H:i:s');\n $backVariation->status = 'Active';\n\n if ($backVariation->save()){\n return true;\n } else {\n return false;\n }\n }", "public function created(Variant $variant);", "public static function save_variations()\n {\n }", "public function createFlavorBox()\n {\n $flavorList = $this->getInfo(FLAVORS);\n if (!empty($flavorList)) {\n $boxes = \"\";\n foreach ($flavorList as &$item) {\n $boxes .= '<div class=\"card '. ($item[\"avaliable\"]==1?'bg-success':'bg-warning') .' font-weight-bold text-center ingredient-container\" title=\"' . $this->sanitizeForID($item[\"name\"]) .'\">' .\n '<div class=\"card-header\"><strong>' . ucfirst($item[\"name\"]) . '</strong></div>' .\n '<ul class=\"list-group list-group-flush\">' .\n '<li class=\"list-group-item\">¿Esta disponible?: <u>' . $this->definedIsValue($item[\"avaliable\"]) . '</u></li>' .\n '<li class=\"list-group-item\">' .\n '<a class=\"font-weight-bold\" data-toggle=\"collapse\" href=\"#' . $this->sanitizeForID($item[\"name\"]) . 'FlavorCollapse\" role=\"button\" aria-expanded=\"false\">Otros detalles<br/><small>(click para mostrar)</small></a>' .\n '<div class=\"collapse\" id=\"' . $this->sanitizeForID($item[\"name\"]) . 'FlavorCollapse\"><hr/>' .\n '¿Es licor?: <u>' . $this->definedIsValue($item[\"isLiqueur\"]) . '</u><br/>' .\n '¿Sabor especial?: <u>' . $this->definedIsValue($item[\"isSpecial\"]) . '</u><br/>' .\n '¿Es exclusivo?: <u>' . $this->definedIsValue($item[\"isExclusive\"]) . '</u><br/>' .\n 'Precio: <u>' . $this->definedPrice($item[\"price\"]) . '</u><br/>' .\n '</div>' .\n '</li>' .\n '</ul>' .\n '<div class=\"card-body row\">' .\n '<a class=\"col-6\" onclick=\"modify(\\'Flavor\\',\\'' . $item[\"name\"] . '\\')\"><i class=\"material-icons\">create</i></a>' .\n '<a class=\"col-6\" onclick=\"deleteModal(\\'flavor\\',\\'' . $item[\"name\"] . '\\')\"><i class=\"material-icons\">delete</i></a>' .\n '</div>' .\n '</div>';\n }\n\n return $boxes;\n } else {\n return \"No hay sabores para mostrar.\";\n }\n }", "protected function storeVersion()\n {\n $versions = $this->versions();\n $this->storeConfiguredVersion($versions);\n\n if($this->storage->has('version')) return;\n $this->storeLatestVersion($versions);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new lUFTWP
public function setLUFTWP($lUFTWP) { $this->lUFTWP = $lUFTWP; return $this; }
[ "public function setPlu($plu)\n {\n $this->plu = $plu;\n\n return $this;\n }", "public function set_lp(string $_lp) {\n $this->_lp = $_lp;\n return $this;\n}", "public function setLUPUS($LUPUS)\n {\n $this->LUPUS = $LUPUS;\n\n return $this;\n }", "public function setNPWP(string $npwp) : void;", "public function setTlz($tlz);", "public function setPF($pF) {\n\t\t$this->pF = $pF;\n\t}", "public function addLpUserFields(): self\n {\n $this->addCustomUserFields(\n [\n [\n 'name' => 'UF_CARD_NUM_INTARO',\n 'title' => 'Номер карты программы лояльности',\n ],\n ],\n 'string'\n );\n\n $this->addCustomUserFields(\n [\n [\n 'name' => 'UF_LP_ID_INTARO',\n 'title' => 'Номер аккаунта в программе лояльности',\n ],\n ],\n 'string',\n ['EDIT_IN_LIST' => 'N']\n );\n\n $this->addCustomUserFields(\n [\n [\n 'name' => 'UF_REG_IN_PL_INTARO',\n 'title' => 'Зарегистрироваться в программе лояльности',\n ],\n [\n 'name' => 'UF_AGREE_PL_INTARO',\n 'title' => 'Я согласен с условиями программы лояльности',\n ],\n [\n 'name' => 'UF_PD_PROC_PL_INTARO',\n 'title' => 'Согласие на обработку персональных данных',\n ],\n [\n 'name' => 'UF_EXT_REG_PL_INTARO',\n 'title' => 'Активность в программе лояльности',\n ],\n ]\n );\n\n return $this;\n }", "public function setUParam($u_param)\n {\n $this->u_param = $u_param;\n\n return $this;\n }", "public function setPuTr3($puTr3) {\n $this->puTr3 = $puTr3;\n return $this;\n }", "public function setPuTr1($puTr1) {\n $this->puTr1 = $puTr1;\n return $this;\n }", "function assignLabel($w, $t, $p) {\n global $DEBUG;\n if ($DEBUG) {\n $DEBUG(\"assignLabel($w,$t,$p)\");\n }\n $b = $this->inblossom[$w];\n assert($this->label[$w] == 0 && $this->label[$b] == 0);\n $this->label[$w] = $this->label[$b] = $t; # BAKERT issue ???\n $this->labelend[$w] = $this->labelend[$b] = $p;\n $this->bestedge[$w] = $this->bestedge[$b] = -1;\n if ($t == 1) {\n # $b became an S-vertex/blossom; add it(s vertices) to the queue.\n foreach ($this->blossomLeaves($b) as $leaf) {\n $this->queue[] = $leaf;\n if ($DEBUG) {\n $DEBUG(\"PUSH $leaf\");\n }\n }\n } elseif ($t == 2) {\n # $b became a T-vertex/blossom; assign $this->label $S to its $this->mate.\n # (If $b is a non-trivial blossom, its $base is the only vertex\n # with an external $this->mate.)\n $base = $this->blossombase[$b];\n assert($this->mate[$base] >= 0);\n $this->assignLabel($this->endpoint[$this->mate[$base]], 1, $this->mate[$base] ^ 1);\n }\n }", "public function set_unit($p_unit){\n\t\t$this->v_unit = $p_unit;\n\t}", "public\n function set_pv($_pv) {\n $this->_pv = $_pv;\n\n return $this;\n }", "public function setWTLS(array $wTLS)\n {\n $this->wTLS = $wTLS;\n return $this;\n }", "public function setUF( $sUF ) {\n $this->sUF = $sUF;\n }", "public function setLName($lname) {\n $this->lname = $lname;\n }", "public function __construct($puerto) {\n\t\t$this->puerto = $puerto;\t\n\t}", "public function set_puce($_puce)\n {\n $this->_puce = $_puce;\n\n return $this;\n }", "public function setUF($sUF) {\n $this->sUF = $sUF;\n }", "function set_TLD($top_level_domain)\r\n{\r\n\t$this->TLD = $top_level_domain;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for replaceNamespacedDaemonSetStatus .
public function testReplaceNamespacedDaemonSetStatus() { }
[ "public function testPatchNamespacedDaemonSetStatus()\n {\n }", "public function testReplaceExtensionsV1beta1NamespacedDaemonSetStatus()\n {\n\n }", "public function testPatchExtensionsV1beta1NamespacedDaemonSetStatus()\n {\n\n }", "public function testReadNamespacedDaemonSetStatus()\n {\n }", "public function testReplaceNamespacedDaemonSet()\n {\n }", "public function testReplaceNamespacedDeploymentConfigStatus()\n {\n\n }", "public function testReplaceExtensionsV1beta1NamespacedReplicaSetStatus()\n {\n\n }", "public function testReplaceNamespacedJobStatus()\n {\n }", "public function testPatchCoreV1NamespacedPodStatus()\n {\n\n }", "public function testReplaceNamespacedIngressStatus()\n {\n }", "public function testReplaceCoreV1NamespaceStatus()\n {\n\n }", "public function testReplaceNamespacedPersistentVolumeClaimStatus()\n {\n }", "public function testPatchExtensionsV1beta1NamespacedReplicaSetStatus()\n {\n\n }", "public function testPatchNamespacedReplicationControllerStatus()\n {\n }", "public function testPatchNamespacedJobStatus()\n {\n }", "public function testPatchCoreV1NamespacedReplicationControllerStatus()\n {\n\n }", "public function testReplaceNamespacedResourceQuotaStatus()\n {\n }", "public function testReplaceExtensionsV1beta1NamespacedIngressStatus()\n {\n\n }", "public function testReplaceExtensionsV1beta1NamespacedHorizontalPodAutoscalerStatus()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the 'test.client.history' service.
protected function getTest_Client_HistoryService() { return new \Symfony\Component\BrowserKit\History(); }
[ "public function historySubscriber()\n {\n $history = new History();\n\n // Place new adapter on client class\n $this->testClass->setClientSubscriber($history);\n\n return $history;\n }", "public function getHistory(): History\n {\n return $this->history;\n }", "public function getHttpClientHistory()\n {\n return $this->history;\n }", "public function getHistory() {\n\t\treturn $this->history;\n\t}", "public function history()\n {\n return $this->hasMany('App\\ServiceHistory', 'id_service')->orderBy('created_at', 'desc')->get();\n }", "function history() {\n\t\treturn app('history');\n\t}", "public function getHistoryObj() {\r\n\t\treturn $this->history;\r\n\t}", "private function getHistory()\r\n\t{\r\n\t\treturn $this->page->get('//page/history');\r\n\t}", "function getHistory()\n\t{\n\t\tif (!$this->isLoaded)\n\t\t{\n\t\t\treturn array(); // don't bother if we're note loaded.\n\t\t}\n\t\t$history = new MongoHistory($this->site, array('collection' => $this->historyCollection));\n\t\treturn $history->find(array(\n\t\t\t'class' => __CLASS__,\n\t\t\t'targetId' => $this->get('_id'),\n\t\t))->sort(array('created_date' => -1));\n\t}", "public function getHistoryContainer(): array {\n return $this->historyContainer;\n }", "public function createHistory()\n {\n return new History(new Validator(), new Info());\n }", "public function getHistoryTracking()\n\t{\n\t\treturn $this->historyTracking; \n\n\t}", "public function getCustomerHistory()\n\t{\n\t\treturn $this->history;\n\t}", "public function history(): HistoryIteratorInterface;", "public function getHistoryEntries() {\n\t\treturn $this->historyEntries;\n\t}", "public function createHistory()\n {\n $class = $this->getClass();\n $history = new $class;\n return $history;\n }", "public function getHistory() {\n $this->loadDataFromDegree();\n return $this->data->info->history;\n }", "function &singleton()\n {\n static $history;\n\n if (!isset($history)) {\n $history = new Horde_History();\n }\n\n return $history;\n }", "public function getHistory()\n {\n return Wrapper\\Player\\Senior::history($this->getId());\n }", "public function getStatusHistory()\n {\n return $this->status_history;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the accumulated score. Returns the result of the accumulated score. The score that can be lost if the result of the roll is one.
public function getAccumulatedScore() { return $this->score; }
[ "public function totalScore()\n {\n return $this->score + $this->roundScore;\n }", "public function getTotalScore()\n\t{\n\t\treturn $this->totalScore;\n\t}", "public function getTotalScore()\n {\n return $this->total_score;\n }", "public function getScore()\n {\n return Calculator::getInstance()->calculate($this->getPoints());\n }", "public function getTotalScore() {\n return $this->testScore + $this->experienceScore + $this->interviewScore;\n }", "public function GetTotal() {\n return array_sum($this->rolls);\n }", "public function GetTotal() {\n return array_sum($this->rolls);\n }", "public function score()\n {\n $score = 0;\n $roll = 0;\n\n for ($frames = 1; $frames <= 10; $frames++) {\n\n if ($this->isStrike($roll)) {\n $score += $this->calcStrikeScore($roll);\n $roll += 1;\n } elseif ($this->isSpare($roll)) {\n $score += $this->calcSpareScore($roll);\n $roll += 2;\n } else {\n $score += $this->calcFrameScore($roll);\n $roll += 2;\n }\n\n }\n\n return $score;\n }", "public function GetAverage() {\n return round(array_sum($this->rolls) / count($this->rolls), 1);\n }", "public function score()\n {\n $score = array_sum($this->getCardsValues());\n $bonus = @$this->handBonuses[$this->identifyHand()];\n\n if (strpos($this->identifyHand(), 'High') === 0) {\n $score += (max($this->getCardsValues()) * 2);\n }\n\n return $score + $bonus;\n }", "public function sum(): int\n {\n foreach ($this->rolls as $roll) {\n $this->sum += $roll;\n }\n return $this->sum;\n }", "public function calculateTotalScore(): int\n {\n\n $len = count($this->scoreboxes) - 1;\n $this->totalScore = 0;\n\n for ($i = 0; $i <= $len; $i++) {\n $this->totalScore += $this->scoreboxes[$i]->getScore();\n }\n\n return $this->totalScore;\n }", "public function get_score()\n {\n return $this->score;\n }", "public function calculate()\n {\n $score = $this->getScore();\n\n /**\n * If it is a strike it adds the score of the two next balls.\n * If it is the last turn (the 10th), the player has two more\n * balls and the points are added to the 10th ball.\n */\n if ($this->isStrike()) {\n if ($this->turn <= self::MAX_TURN\n && ($firstAfter = $this->getNext()) instanceof Ball\n && ($secondAfter = $firstAfter->getNext()) instanceof Ball\n ) {\n $score += $firstAfter->getScore() + $secondAfter->getScore();\n } else {\n // Don't add the 11th and the 12nd balls.\n $score = 0;\n }\n }\n\n return $score;\n }", "public function playerSum()\n {\n return $this->player->getLastRollSum();\n }", "public function getTotalScores(): int {\n return $this->totalScores;\n }", "public function getTotal(){\n $total = 0;\n foreach($this->dices as $dice){\n $total += $dice->roll();\n }\n return $total;\n }", "public function getScore()\n {\n $quizScore = $this->score;\n\n $articleScore = DB::table('articles')->where('user_id', $this->id)\n ->sum('score');\n\n $questionScore = DB::table('questions')->where('user_id', $this->id)\n ->sum('score');\n\n return $quizScore + $articleScore + $questionScore;\n }", "public function score()\n {\n return $this->scoreForFrame($this->numberOfFrames());\n }", "public function totalLevel()\n {\n if ($this->noTotalLevelFound) {\n $sum = 0;\n foreach($this instanceof OSRSPlayer ? OSRSHiscores::SKILL_MAP : RS3Hiscores::SKILL_MAP as $skill) {\n if ($skill === 'Overall') {\n // 'Overall' is a cumulative so we skip it for the sum.\n continue;\n }\n $sum += $this->get($skill)->level ?: 1;\n }\n return $sum;\n }\n return $this->get('overall')->level;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse description only if description block is present
function _parseDescription() { if ($this->checkTemplateBlockExists('description')) { $this->tpl->parse('description'); return $this->tpl->text('description'); } else { return false; } }
[ "public function parse_description_field($description)\n {\n }", "function parseDescription($descriptionLine){\r\n\t\tif(strpos($descriptionLine,\"*\")<=2) $descriptionLine=substr($descriptionLine,(strpos($descriptionLine,\"*\")+1));\r\n\r\n\t \t//geen lege comment regel indien al in grote omschrijving\r\n\t \tif(trim(str_replace(Array(\"\\n\",\"\\r\"),Array(\"\",\"\"),$descriptionLine))==\"\"){\r\n\t \t\tif($this->obj->fullDescription==\"\")\r\n\t \t\t\t$descriptionLine=\"\";\r\n\t\t\t$this->smallDescriptionDone=true;\r\n\t\t}\r\n\r\n\t\tif(!$this->smallDescriptionDone)//add to small description\r\n\t\t\t$this->obj->smallDescription.=$descriptionLine;\r\n\t\telse{//add to full description\r\n\t\t\t$this->obj->fullDescription.=$descriptionLine;\r\n\t\t}\r\n\t }", "function parseDescription($descriptionLine) {\n\t\tif (strpos($descriptionLine, \"*\") <= 2)\n\t\t\t$descriptionLine = substr($descriptionLine, (strpos($descriptionLine, \"*\") + 1));\n\n\t\t//geen lege comment regel indien al in grote omschrijving\n\t\t//nenhuma linha de comentário vazia se já em grande descrição\n\t\tif (trim(str_replace(Array(\"\\n\", \"\\r\"), Array(\"\", \"\"), $descriptionLine)) == \"\") {\n\t\t\tif ($this->obj->fullDescription == \"\")\n\t\t\t\t$descriptionLine = \"\";\n\t\t\t$this->smallDescriptionDone = true;\n\t\t}\n\t\tif (!$this->smallDescriptionDone)//add to small description\n\t\t\t$this->obj->smallDescription .= trim($descriptionLine).\" \\n\";\n\t\telse {//add to full description\n\t\t\t$this->obj->fullDescription .= trim($descriptionLine).\" \\n\";\n\t\t}\n\t}", "protected function parseDescription($docblock)\n {\n $lastLineEmpty = null;\n $started = false;\n $lines = [];\n foreach ($docblock as $line) {\n $line = rtrim($line);\n $trimmed = trim($line);\n $currentLineEmpty = $trimmed === '';\n $started = $started || !$currentLineEmpty;\n\n // Skip initial empty lines\n if ($currentLineEmpty && empty($lines)) {\n continue;\n }\n\n // If we hit two consecutive empty lines in a row, we're done\n if ($currentLineEmpty && $lastLineEmpty) {\n break;\n }\n\n // We stop if we encounter an annotation\n if (substr($trimmed, 0, 1) === '@') {\n break;\n }\n\n $lines[] = $line;\n\n $lastLineEmpty = $currentLineEmpty;\n }\n\n $text = implode(PHP_EOL, $lines);\n\n list($this->headline, $this->description) = array_map('trim', explode('.', $text, 2));\n }", "private function extractDescription($description)\n {\n if ($description = $description['@cdata']) {\n return $description;\n }\n\n return $description;\n }", "function _parseTransactionDescription() {\n\t\t$results = array();\n\t\tif (preg_match_all('/[\\n]:86:(.*?)(?=\\n:|$)/s', $this->getCurrentTransactionData(), $results)\n\t\t\t\t&& !empty($results[1])) {\n\t\t\treturn $this->_sanitizeDescription(implode(PHP_EOL, $results[1]));\n\t\t}\n\t\treturn '';\n\t}", "function parseDescription( $descriptionLine ) {\n\t\tif ( strpos( $descriptionLine, \"*\" ) <= 2 ) {\n\t\t\t$descriptionLine = substr( $descriptionLine, ( strpos( $descriptionLine, \"*\" ) + 1 ) );\n\t\t}\n\n\t\t//geen lege comment regel indien al in grote omschrijving\n\t\tif ( trim( str_replace( Array( \"\\n\", \"\\r\" ), Array( \"\", \"\" ), $descriptionLine ) ) == \"\" ) {\n\t\t\tif ( $this->obj->fullDescription == \"\" ) {\n\t\t\t\t$descriptionLine = \"\";\n\t\t\t}\n\t\t\t$this->smallDescriptionDone = true;\n\t\t}\n\n\t\tif ( ! $this->smallDescriptionDone )//add to small description\n\t\t{\n\t\t\t$this->obj->smallDescription .= $descriptionLine;\n\t\t} else {//add to full description\n\t\t\t$this->obj->fullDescription .= $descriptionLine;\n\t\t}\n\t}", "private function __validate_description() {\n if (isset($this->initial_data['description'])) {\n $this->validated_data[\"description\"] = $this->initial_data['description'];\n } else {\n $this->validated_data[\"description\"] = \"\";\n }\n }", "public function initilaizeDescription()\n {\n if(emoty($this->getDescription)){\n $descriptionify = new Descriptionify();\n $this->Description = $descriptionify->descriptionify($this->Nom);\n }\n }", "private function parseDescription($doc)\n {\n // matches anything up to a \"@\"\n preg_match('/([a-zA-Z]([^@]+|([^\\r]?[^\\n][^\\s]*[^\\*])+))/m', $doc, $desc);\n \n if (isset($desc[1])) {\n $desc = $desc[1];\n $desc = explode(\"\\n\", $desc);\n \n foreach ($desc as $k => $part) {\n // removes errant stars from the middle of a description\n $desc[$k] = trim(preg_replace('#^\\*#', '', trim($part)));\n \n if (!preg_match('/[a-zA-Z0-9]/', $part)) {\n $desc[$k] = PHP_EOL;\n }\n }\n \n $desc = implode(' ', $desc);\n $desc = trim($desc);\n \n return $desc;\n }\n \n return null;\n }", "public function parse( $commentBlock) \r\n\t{\r\n\t\t$this->currentTag = 'description';\r\n\t\t$description = preg_replace('/^(\\s*(\\/\\*\\*|\\*\\/|\\*))/m', '', $commentBlock);\r\n\t\t$info = array();\r\n\t\t$lines = explode( \"\\n\", $description );\r\n\t\tforeach ( $lines as $line ) {\r\n\t\t\t$info = $this->parseLine( $line, $info );\r\n\t\t}\r\n\t\treturn $info; //array( 'description' => $description );\r\n\t}", "private function parseDescription() {\n // Regular Expression patterns used to match strings in the description.\n $patterns = [\n 'module' => 'project/(?<module>\\w+)',\n 'risk' => 'Security risk[^\\d]+(?<risk>\\d+)',\n 'version' => 'releases/(?<version>7[\\.x\\d-]+)',\n ];\n // Parse the name of the module & the criticality from the description.\n $regular_expression = '%' . implode('|', $patterns) . '%';\n preg_match_all($regular_expression, $this->advisory->description, $matches);\n foreach ($patterns as $key => &$value) {\n $value = max($matches[$key] ?? []);\n }\n return $patterns;\n }", "protected function parseTransactionDescription()\n {\n $results = [];\n if (preg_match('/:86:([\\d]{3}(?=\\?)|)(.*?)(?=(:6[12][\\w]?:|$))/s', $this->getCurrentTransactionData(), $results)\n && !empty($results[2])\n ) {\n if ($results[1] !== '') {\n return $this->parseTransactionStructuredDescription($results[1], $results[2]);\n }\n return $this->sanitizeDescription($results[2]);\n }\n\n return '';\n }", "public function parse(array $description);", "private function parse_block()\n {\n // split at each line\n foreach (preg_split(\"/(\\r?\\n)/\", $this->docblock) as $line) {\n\n // if starts with an asterisk\n if (preg_match('/^(?=\\s+?\\*[^\\/])(.+)/', $line, $matches)) {\n $info = $matches[1];\n\n // remove wrapping whitespace\n $info = trim($info);\n\n // remove leading asterisk\n $info = preg_replace('/^(\\*\\s+?)/', '', $info);\n\n // if it doesn't start with an \"@\" symbol\n // then add to the description\n if ($info[0] !== '@') {\n $this->description .= rtrim(\"\\n$info\", '*');\n\n continue;\n }\n // get the name of the param\n preg_match('/@(\\w+)/', $info, $matches);\n $param_name = $matches[1];\n\n // remove the param from the string\n $value = str_replace(\"@$param_name \", '', $info);\n\n // if the param hasn't been added yet, create a key for it\n if (!isset($this->all_params[$param_name])) {\n $this->all_params[$param_name] = [];\n }\n\n // push the param value into place\n $this->all_params[$param_name][] = $value;\n\n continue;\n }\n }\n }", "function mDESC(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DESC;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:181:3: ( 'desc' ) \n // Tokenizer11.g:182:3: 'desc' \n {\n $this->matchString(\"desc\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function testParseDescriptionLines()\n\t{\n\t\t$rawData = [\n\t\t\t':20:STARTUMSE',\n\t\t\t':25:00000000/0221122370',\n\t\t\t':28C:00000/001',\n\t\t\t':60F:C170428EUR6670,54',\n\t\t\t':61:1705030503CR223,72N062NONREF',\n\t\t\t':86:166?00GUTSCHRIFT?109251?20EREF+CCB.122.UE.266455?21SVWZ+Re 17',\n\t\t\t'-H-0005 vom 24.04?22.2017?30DRESDEFF850?31DE00000000000000000000?',\n\t\t\t'32TEST TEST GBR',\n\t\t\t':62F:C170503EUR6894,26',\n\t\t\t'-',\n\t\t\t':20:STARTUMSE',\n\t\t\t':25:00000000/0221122370',\n\t\t\t':28C:00000/001',\n\t\t\t':60M:C170428EUR6894,26',\n\t\t\t':61:1705030503CR3105.74N062NONREF',\n\t\t\t':86:166?00GUTSCHRIFT?109251?20EREF+CCB.122.UE.266455?21SVWZ+Re 17',\n\t\t\t'-H-0005 vom 24.04?22.2017?30DRESDEFF850?31DE00000000000000000000?',\n\t\t\t'32TEST TEST GBR',\n\t\t\t':62F:C170503EUR10000,00',\n\t\t\t'-',\n\t\t\t':20:STARTUMSE',\n\t\t\t':25:00000000/0221122370',\n\t\t\t':28C:00000/001',\n\t\t\t':60F:C170429EUR10000,00',\n\t\t\t':61:1705030503CR100,00N062NONREF',\n\t\t\t':86:166?00GUTSCHRIFT?109251?20EREF+CCB.122.UE.266455?21SVWZ+Re 17',\n\t\t\t'-H-0005 vom 24.04?22.2017?30DRESDEFF850?31DE00000000000000000000?',\n\t\t\t'32TEST TEST GBR',\n\t\t\t':62F:C170503EUR10100,00',\n\t\t\t'-'\n\t\t];\n\n\t\t$parser = new MT940(implode(\"\\r\\n\", $rawData));\n\t\t$result = $parser->parse(MT940::TARGET_ARRAY);\n\t\t$this->assertEquals(\n\t\t\t'EREF+CCB.122.UE.266455SVWZ+Re 17-H-0005 vom 24.04.2017',\n\t\t\t$result[0]['transactions'][0]['description']['description_1']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'166',\n\t\t\t$result[0]['transactions'][0]['transaction_code']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'223.72',\n\t\t\t$result[0]['transactions'][0]['amount']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'2017-04-29',\n\t\t\t\t\t\t$result[2]['date']\n\t\t\t\t);\n\t\t$this->assertEquals(\n\t\t\t10000.00,\n\t\t\t$result[2]['start_balance']['amount']\n\t\t);\n\t}", "public function testDescriptionFilter(){\n $this->item->setDescription('<p>abcde</p>');\n \n $this->assertEquals($this->item->getDescription(), 'abcde');\n }", "public function is_description($line){\n return preg_match($this->description_regex, $line);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a whereGeoShape condition.
public function whereGeoShape( string $field, array $shape, string $relation = 'INTERSECTS', string $boolean = 'must' ): self { $this->wheres[$boolean][] = [ 'geo_shape' => [ $field => [ 'shape' => $shape, 'relation' => $relation, ], ], ]; return $this; }
[ "public function whereGeoShape($field, array $shape, $relation = 'INTERSECTS', $boolean = 'must')\n {\n $this->wheres[$boolean][] = [\n 'geo_shape' => [\n $field => [\n 'shape' => $shape,\n 'relation' => $relation,\n ],\n ],\n ];\n\n return $this;\n }", "public function orWhereGeoWithin($column, $shape, array $coords)\n\t{\n\t\treturn $this->whereGeoWithin($column, $shape, $coords, '$or');\n\t}", "private function setPhotoGeoWhere($where) {\n \t$this->photoGeoWhere = $where;\n }", "protected function addAdditionalWhereConditions() {}", "protected function where_clause_map_graphics()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_map_graphics'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$map_graphics = $this->incoming_record->get_map_graphics();\n\t\t$where_fragment = '';\n\t\tif($map_graphics != '')\n\t\t{\n\t\t\t$where_fragment=\" and l.map_graphics = {$this->db->quote($map_graphics)}\";\n\t\t}\n\t\treturn $where_fragment;\n\t}", "function region_where_clause( $lat, $lon, $radius ) {\n // http://stackoverflow.com/questions/973363/mysql-not-using-my-indexes\n // http://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude\n // http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates\n $basekm = 6371.0; // 111.1;\n $coslat = cos($lat * M_PI / 180.0);\n $dlat = $radius / $basekm;\n $dlon = asin(sin($dlat) / $coslat); // $dlat * $coslat\n $bbox = wkt_bbox_around($lat, $lon, $dlat * 180.0 / M_PI, $dlon * 180.0 / M_PI);\n return \"MBRContains($bbox, coord)\";\n}", "public function whereGeoPolygon($field, array $points, $boolean = 'must')\n {\n $this->wheres[$boolean][] = [\n 'geo_polygon' => [\n $field => [\n 'points' => $points,\n ],\n ],\n ];\n\n return $this;\n }", "abstract protected function addWhereOperator($operator);", "private static function applyUserFiltersSearchArea($definition, array &$bool) {\n if (!empty($definition['searchArea'])) {\n $bool['must'][] = [\n 'geo_shape' => [\n 'location.geom' => [\n 'shape' => $definition['searchArea'],\n 'relation' => 'intersects',\n ],\n ],\n ];\n }\n }", "public function get_where_clause();", "public function appendWhere($where_sql, $bind_fields = FALSE);", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "protected function where_clause_map_location()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_map_location'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$map_location = $this->incoming_record->get_map_location();\n\t\t$where_fragment = '';\n\t\tif($map_location != '')\n\t\t{\n\t\t\t$where_fragment=\" and l.map_location = {$this->db->quote($map_location)}\";\n\t\t}\n\t\treturn $where_fragment;\n\t}", "private function whereClause()\n {\n // Adding search conditions :\n if (!empty($this->m_searchconditions)) {\n $searchOperator = ($this->m_searchmethod == '' || $this->m_searchmethod == 'AND') ? 'AND':'OR';\n $this->m_conditions[] = QueryPart::implode($searchOperator, $this->m_searchconditions, true);\n }\n\n // Adding conditions only if there are some:\n if (empty($this->m_conditions)) {\n return new QueryPart('');\n }\n\n $query = new QueryPart('WHERE');\n $query->append(QueryPart::implode('AND', $this->m_conditions, true));\n return $query;\n }", "public function buildWhereRadius($radiuses, &$search_where = array(), $col_latitude = 'Latitude', $col_longitude = 'Longitude')\n {\n\n // Search Group\n $search_group = array();\n $search_square_group = array();\n\n // Search Radiuses\n if (!empty($radiuses) && is_string($radiuses)) {\n $radiuses = json_decode($radiuses, true); // Parse as JSON Array\n if (is_array($radiuses) && !empty($radiuses)) {\n foreach ($radiuses as $radius) {\n list ($latitude, $longitude, $radius) = explode(',', $radius);\n if (!empty($latitude) && !empty($longitude) && !empty($radius)) {\n\n $search_group[] = \"(((Acos(\"\n . \"Sin((\" . floatval($latitude) . \" * Pi() / 180)) * \"\n . \"Sin((\" . $col_latitude . \" * Pi() / 180)) + \"\n . \"Cos((\" . floatval($latitude) . \" * Pi() / 180)) * \"\n . \"Cos((\" . $col_latitude . \" * Pi() / 180)) * \"\n . \"Cos(((\" . floatval($longitude) . \" - \" . $col_longitude . \") * Pi() / 180))\"\n . \")) * 180 / Pi()) * 60 * 1.1515) <= \" . floatval($radius);\n\n // Radius search on it's own is slow, beacuse it is computing math without an index, we will build a square around the radiuses\n $square = $this->buildGeospaceSquare(floatval($latitude), floatval($longitude), floatval($radius));\n if (!empty($square)) {\n $search_square_group[] = '('. $col_latitude . ' BETWEEN \\'' . $square['south'] . '\\' AND \\'' . $square['north'] . '\\' '\n . 'AND ' . $col_longitude . ' BETWEEN \\'' . $square['west'] . '\\' AND \\'' . $square['east'] . '\\')';\n }\n\n }\n }\n } else {\n return false;\n }\n }\n\n\n // Add to Search Criteria\n if (!empty($search_square_group)) {\n $search_where[] = '(' . implode(' OR ', $search_square_group) . ')';\n }\n\n // Add to Search Criteria\n if (!empty($search_group)) {\n $search_where[] = \"(\" . implode(\" OR \", $search_group) . \")\";\n }\n\n // Return Radius Searches\n return $radiuses;\n }", "public function addFilter(string $whereClause, mixed $bindings = null): static;", "public function whereClause(){\n $groupGraphPattern10 = null;\n\n\n try {\n // Sparql10.g:88:5: ( ( WHERE )? groupGraphPattern ) \n // Sparql10.g:88:7: ( WHERE )? groupGraphPattern \n {\n // Sparql10.g:88:7: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql10.g:88:7: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause475); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause478);\n $groupGraphPattern10=$this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n $this->_q->setWhere($groupGraphPattern10);\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "protected function _applyBoundsConditions($options, $bounds) {\n// lng_sql = bounds.crosses_meridian? ? \"(#{qualified_lng_column_name}<#{ne.lng} OR #{qualified_lng_column_name}>#{sw.lng})\" : \"#{qualified_lng_column_name}>#{sw.lng} AND #{qualified_lng_column_name}<#{ne.lng}\"\n// bounds_sql = \"#{qualified_lat_column_name}>#{sw.lat} AND #{qualified_lat_column_name}<#{ne.lat} AND #{lng_sql}\"\n// options[:conditions] = merge_conditions(options[:conditions], bounds_sql)\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the delegated roles if any.
public function getDelegatedRoles(): array { return $this->getSigned()['delegations']['roles'] ?? []; }
[ "public static function get_roles()\n {\n }", "public function getUserRoles() {\n return $this->roles;\n }", "public function getRoles()\r\n {\r\n return $this->roles;\r\n }", "public function getRoles()\n {\n return isset($this->Roles) ? $this->Roles : null;\n }", "public function getRoles()\n {\n if ($this->initialized === false) {\n $this->initialize();\n }\n\n if ($this->roles !== null) {\n return $this->roles;\n }\n\n $this->roles = ['Neos.Flow:Everybody' => $this->policyService->getRole('Neos.Flow:Everybody')];\n\n $authenticatedTokens = array_filter($this->getAuthenticationTokens(), static function (TokenInterface $token) {\n return $token->isAuthenticated();\n });\n\n if (empty($authenticatedTokens)) {\n $this->roles['Neos.Flow:Anonymous'] = $this->policyService->getRole('Neos.Flow:Anonymous');\n return $this->roles;\n }\n\n $this->roles['Neos.Flow:AuthenticatedUser'] = $this->policyService->getRole('Neos.Flow:AuthenticatedUser');\n\n /** @var $token TokenInterface */\n foreach ($authenticatedTokens as $token) {\n $account = $token->getAccount();\n if ($account === null) {\n continue;\n }\n\n $this->roles = array_merge($this->roles, $this->collectRolesAndParentRolesFromAccount($account));\n }\n\n return $this->roles;\n }", "public function getMentionRolesAttribute()\n {\n $roles = new Collection([], 'id');\n\n foreach ($this->channel->guild->roles as $role) {\n if (array_search($role->id, $this->attributes['mention_roles']) !== false) {\n $roles->push($role);\n }\n }\n\n return $roles;\n }", "public static function getRoles(){\n return self::$admin_roles;\n }", "public function getAll()\n {\n return $this->roles->roles;\n }", "public function getUserRoles()\n {\n return $this->user_roles;\n }", "public function role_lookup()\n\t{\n\t\t$roles = $this->role_model->get_roles();\n\t\treturn $roles;\n\t}", "private function adminRoles()\n {\n return role()->adminRoles();\n }", "public function getRoles() {\n $rolesCtrl = new RolesController();\n return $rolesCtrl->getRoles();\n }", "public function get_roles() {\n\t\t$query = $this->db->get($this->tables['roles']);\t\t\t\t// Get all from the database\n\t\treturn ($query->num_rows > 0) ? $query->result_array() : FALSE;\t\t// Return the array, or false if empty\n\t}", "public static function get_roles() {\n global $DB;\n\n $roles = $DB->get_records_menu('role', null, '', 'id, shortname');\n return $roles;\n }", "public function getRequiredRoles();", "public function getAclRoles()\n {\n return isset($this->_configs[self::ACL_ROLES])\n ? $this->_configs[self::ACL_ROLES] : null;\n }", "public function getList()\n\t\t{\n\t\t\treturn $this->rolesList;\n\t\t}", "public function get_wp_roles()\n {\n global $wp_roles;\n\n if (class_exists('WP_Roles')) {\n if (! isset($wp_roles)) {\n $wp_roles = new \\WP_Roles();\n }\n }\n\n return $wp_roles;\n }", "public function getRoles()\n {\n return ArrayUtility::translateArrayValues(\n ArrayHelper::map(UserProfileRoleSearch::searchAll(), 'id', 'name'), 'amosadmin', AmosAdmin::className()\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Affichage d'un message pour mot de passe non identique
function mdpPasIdentique() { return '<div class="alert alert-warning" role="alert"> Les mots de passe ne sont pas identiques. </div>'; }
[ "function mdpPasIdentique() {\n\t\treturn '<div class=\"alert alert-warning\" role=\"alert\">\n\t\t\t\tLes mots de passe ne sont pas identiques.\n\t\t\t</div>';\n\t}", "private function getPassword(): string\n {\n return json_decode($this->getSender()->messenger_settings)->sms->password;\n }", "public function necesitaCambiarPassword();", "function chg_login_message(){\n //Написать что то с инструкцией о входе\n }", "public function getUserMessage();", "function envoyerPwd() {\r\n\t\t$row=SelectMultiple(\"if_utilisateur\",\"login\",$this->login);\r\n \tif ($row[\"numuti\"]) {\r\n\t\t\t$corps= \"Bonjour,\\n\\nSuite à votre demande, voici votre mot de passe : \\n\\n\";\r\n\t\t\t$corps.=\" --> \".easy($row[\"pwd\"],\"d\");\r\n\t\t\t$corps.=\"\\n\\nVous souhaitant bonne réception,\\n\\n\";\r\n\t\t\t$corps.=\"--------------------\\n\";\r\n\t\t\t$corps.=\"www.ifip.asso.fr\\n\\n\";\r\n\t\t\t//$corps.=$bv_rvd[\"email\"].\"\\n\\n\";\r\n\t\t\t//$corps.=$bv_rvd[\"tel\"].\"\\n\";\r\n\t\t\t$corps.=\"--------------------\\n\";\r\n\t\r\n\t $entete=\"Content-type: text/plain\\nStatus: U\\nReply-To: ifip@ifip.asso.fr\\nFrom: www.ifip.asso.fr <ifip@ifip.asso.fr>\";\r\n\t\t\tmail($this->login,\"Mot de passe !\",$corps,$entete,\"-f 'ifip@ifip.asso.fr'\");\t\t\r\n\t\t\t$m=\"Nous venons de vous adresser votre mot de passe à l'\\adresse $this->login\";\r\n\t\t} else {\r\n\t\t\t$m=\"Votre adresse e-mail n\\'est pas valide.\";\r\n\t\t} \r\n\t\treturn $m;\r\n }", "function modificationMdpFaite() {\n\t\treturn '<div class=\"alert alert-success\" role=\"alert\">\n\t\t\t\tVotre mot de passe a bien été changé.\n\t\t\t</div>';\n\t}", "protected function lostPasswordMessage($message): string\n {\n if (!$this->isLostPassOrExpired()) {\n return $message;\n }\n\n // \\Expire_Passwords_Login_Screen::lost_password_message():109\n return \\str_replace('<br><p>', '<p class=\"message\">', $message);\n }", "function verif_mdp() {\n\tif (empty($_POST[\"mdp\"]) && empty($_POST[\"mdpp\"])) {\n\t\techo '{\"mdp\":\"a remplir\",\"mdpp\":\" a remplir\"}';\n\t}\n\telse if (!empty($_POST[\"mdp\"]) && empty($_POST[\"mdpp\"])) {\n\t\techo '{\"mdpp\":\"a remplir\"}';\n\t}\n\telse if (empty($_POST[\"mdp\"]) && !empty($_POST[\"mdpp\"])) {\n\t\techo '{\"mdp\":\"a remplir\"}';\n\t}\n\t\n\tif (!empty($_POST[\"mdp\"]) && !empty($_POST[\"mdpp\"])) {\n\t\tif ($_POST[\"mdp\"] == $_POST[\"mdpp\"]) {\n\t\t\tif (preg_match(\"#^[a-zA-Z0-9]{5,20}$#\", $_POST[\"mdp\"])) {\n\t\t\t\techo '{\"mdp\":\"ok\",\"mdpp\":\"ok\"}';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '{\"mdp\":\"uniquement lettres chiffres ., -, _ et avec longueur min: 5\",\"mdpp\":\"uniquement lettres chiffres ., -, _ et avec longueur min: 5\"}';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo '{\"mdp\":\"les password doivent etre identiques.\",\"mdpp\":\"les password doivent etre identiques.\"}';\n\t\t}\n\t}\n}", "function change_email_message( $message, $user_id, $user_args, $subscription_id, $status, $expiration ){\n\t\treturn 'Hey you have a username '.$user_args['user_login'] . 'and password'. $user_args['user_pass'].' now.';\n\t}", "public function mensagemLogin(){\n return 'Login ou senha inválido!';\n }", "function valider_mdp($mdp, $conf)\r\n\t{\r\n\t\t$format = \"/[a-zA-Z0-9-_]/\";\r\n\t\tif (preg_match($format, $mdp) AND $mdp == $conf)\r\n\t\t{\r\n\t\t\treturn password_hash($mdp, PASSWORD_DEFAULT);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo '<body onLoad=\"alert(\\'Erreur de mot de passe\\')\">';\r\n\t\t\techo '<meta http-equiv=\"refresh\" content=\"0;URL=inscription.php\">';\r\n\t\t}\r\n\t}", "static function GetLoginMessage() {\n\t\treturn isset($_SESSION['Primal']['LoginMessage']) ? $_SESSION['Primal']['LoginMessage'] : null;\n\t}", "public function get_sender_password(){\n\n\t\treturn $this->senderPassword;\n\n\t}", "function wpse_71284_custom_post_password_msg( $form )\n{\n // No cookie, the user has not sent anything until now.\n if ( ! isset ( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) )\n return $form;\n\n // Translate and escape.\n $msg = esc_html__( 'Sorry, your password is wrong.', 'your_text_domain' );\n\n // We have a cookie, but it doesn’t match the password.\n $msg = \"<p class='custom-password-message text-center'>$msg</p>\";\n\n return $msg . $form;\n}", "function aiowps_login_message($message = '') \r\n {\r\n global $aio_wp_security;\r\n $msg = '';\r\n if(isset($_GET[$this->key_login_msg]) && !empty($_GET[$this->key_login_msg]))\r\n {\r\n $logout_msg = strip_tags($_GET[$this->key_login_msg]);\r\n }\r\n if (!empty($logout_msg))\r\n {\r\n switch ($logout_msg) {\r\n case 'session_expired':\r\n $msg = sprintf(__('Your session has expired because it has been over %d minutes since your last login.', 'all-in-one-wp-security-and-firewall'), $aio_wp_security->configs->get_value('aiowps_logout_time_period'));\r\n $msg .= ' ' . __('Please log back in to continue.', 'all-in-one-wp-security-and-firewall');\r\n break;\r\n case 'admin_user_changed':\r\n $msg = __('You were logged out because you just changed the \"admin\" username.', 'all-in-one-wp-security-and-firewall');\r\n $msg .= ' ' . __('Please log back in to continue.', 'all-in-one-wp-security-and-firewall');\r\n break;\r\n default:\r\n }\r\n }\r\n if (!empty($msg))\r\n {\r\n $msg = htmlspecialchars($msg, ENT_QUOTES, 'UTF-8');\r\n $message .= '<p class=\"login message\">'. $msg . '</p>';\r\n }\r\n return $message;\r\n }", "public function setNonMatchingPasswordMessage() {\n\t\t$this->message .= 'Passwords do not match.<br />';\n\t}", "private function setMessageValue() {\n\t\tif(isset($_POST[self::$register])) {\n\t\t\tif(empty($_POST[self::$name]) && empty($_POST[self::$password]) && empty($_POST[self::$passwordRepeat])) {\n\t\t\t\t$this->message = 'Username has too few characters, at least 3 characters. <br>\n\t\t\t\tPassword has too few characters, at least 6 characters. <br>\n\t\t\t\tUser exists, pick another username. <br>';\n\t\t\t} else if(empty($_POST[self::$name]) || strlen($_POST[self::$name]) < 3) {\n\t\t\t\t$this->message = 'Username has too few characters, at least 3 characters.<br>';\n\t\t\t} else if (empty($_POST[self::$password]) || strlen($_POST[self::$password]) < 6) {\n\t\t\t\t$this->message .= 'Password has too few characters, at least 6 characters.<br>';\n\t\t\t} else if ($_POST[self::$passwordRepeat] != $_POST[self::$password] || empty($_POST[self::$passwordRepeat])) {\n\t\t\t\t$this->message .= 'Passwords do not match.<br>';\n\t\t\t} else if (ctype_alnum($_POST[self::$name]) == false) {\n\t\t\t\t$this->message .= 'Username contains invalid characters.<br>';\n\t\t\t}\n\t\t}\n\t}", "function CrypterMDP($mdp, $mdp_Actuel) {\r\n\r\n //La fonction password_hash() est predéfini pour crypter la mot de passe, \r\n //il prend deux paramètre s le première la mote de passe et la douxième PASSWORD_DEFAULT c'est une constante de l'algorithme predéfini.\r\n $nouvelle_passe = password_hash(\"$mdp\", PASSWORD_DEFAULT);\r\n $rep = \"\";\r\n if ($nouvelle_passe != $mdp_Actuel) {\r\n $rep = $nouvelle_passe;\r\n }\r\n return $rep;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for comDayCqDamS7damCommonServletsS7damProductInfoServlet .
public function testComDayCqDamS7damCommonServletsS7damProductInfoServlet() { $client = static::createClient(); $path = '/system/console/configMgr/com.day.cq.dam.s7dam.common.servlets.S7damProductInfoServlet'; $crawler = $client->request('POST', $path); }
[ "public function testComDayCqDamS7damCommonServletsS7damProductInfoServlet() {\n\n }", "public function testComAdobeGraniteAcpPlatformPlatformServlet() {\n\n }", "public function testComDayCqDamCoreImplServletMetadataGetServlet() {\n\n }", "public function testComDayCqDamCoreImplServletMultipleLicenseAcceptServlet() {\n\n }", "function product_detail_amp( $name, $id,$vendor, Request $request)\t//Shows product detail\n\t{\n\t\t//echo $name.\",\".$id.\",\".$vendor;exit;\t\t\n\t\t// Redirects to product_detail_new function if product is comparitive product.. \n\t\tif( empty( $vendor ) && !isset( $vendor ) )\n\t\t{\n\t\t\treturn redirect( 'product/'.$name.\"/\".$id.\"/amp\" );\n\t\t}\n\t\t$bname = explode(\"-\", $name );\n\t\t// Checks if the product is BOOK.. \n\t\tif( end( $bname ) == \"book\" )\n\t\t{\n\t\t\t$args = \"&isBook=true\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$args = \"\";\n\t\t}\n\t\t$id=$id.\"-\".$vendor;\n\t\t//SOLR URL for getting product detail\n\t\t$url = composer_url( 'ext_prod_detail.php?_id='.$id.$args );\n\t\t$data['product'] = file_get_contents( $url );\t\t\n\t\t$data['product'] = json_decode($data['product']);\n\n\t\t//List of PRODUCTS> \n\t\tif( isset( $data['product']->return_txt ) )\n\t\t\t$data['product'] = $data['product']->return_txt;\n\t\telse\n\t\t\t$data['product'] = \"\";\n\n\t\tif( end( $bname ) == \"book\" && is_object( $data['product'] ) )\n\t\t{\n\t\t\t$data['product']->grp = \"books\";\n\t\t}\n\n\t\t//IF PRODUCT FOUND..\n\t\tif(!empty($data['product']))\n\t\t{ \t\t\t\n\t\t\tif($name !== create_slug($data['product']->name) && ($data['product']->grp != \"books\") )\n\t\t\t{\n\t\t\t\t#if URL name doesn't match to product name\t\t\t\t\n\t\t\t\treturn redirect( \"product/\".create_slug($data['product']->name).\"/\".$data['product']->id.\"-\".$data['product']->vendor.\"/amp\" );\n\t\t\t}\n\t\t\t/*****Creating Title***/\n\t\t\tif(isset($data['product']->seo_title) && (!empty($data['product']->seo_title)))\n\t\t\t{\n\t\t\t\t$data['title'] = $data['product']->seo_title;\n\t\t\t}\n\t\t\t//// RELATED PRODUCTS list.. \n\t\t\t$viewurl = composer_url( 'site_view_also.php?info='.urlencode($data['product']->name).'&cat='.urlencode($data['product']->category).'&pid='.$id.$args );\t\t\t\n\t\t\t$data['ViewAlso'] = file_get_contents($viewurl);\t\t\t\n\t\t\t$data['ViewAlso'] = json_decode($data['ViewAlso']);\n\t\t\t$data['ViewAlso'] = $data['ViewAlso']->return_txt;\t\t\t\n\t\t\t$data['full'] = false;\n\t\t\t$data['moreimage'] = false;\t\t\t\t\t\t\t\n\t\t\t$data['page_title'] = \"\";\t\t\t\n\n\t\t\tif( isset( $data['product']->category ) )\n\t\t\t{\n\t\t\t\t$data['c_name'] = $data['product']->category; // Category name to be used in DETAIL VIEW file.. \n\t\t\t}\n\n\t\t\t$response = new \\Illuminate\\Http\\Response( view(\"v1.amp.product_detail\",$data) );\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect( 'search?search_text='.unslug($name).'&group=all' );\n\t\t\t//404 Page, as the product not found.. \n\t\t\tabort(404);\n\t\t}\t\t\n\t}", "public function testComDayCqWcmCoreImplServletsReferenceSearchServlet() {\n\n }", "public function testGetAemProductInfo()\n {\n $client = static::createClient();\n\n $path = '/system/console/status-productinfo.json';\n\n $crawler = $client->request('GET', $path);\n }", "public function testRouteProduct()\n {\n $response = $this->runApp('GET', '/product');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('ok', (string)$response->getBody());\n }", "public function testOrgApacheSlingServletsGetImplVersionVersionInfoServlet()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.servlets.get.impl.version.VersionInfoServlet';\n\n $crawler = $client->request('POST', $path);\n }", "public function testComAdobeCqExperiencelogImplExperienceLogConfigServlet() {\n\n }", "public function actionWalmartproductinfo()\n {\n $sku = false;\n $productdata = \"add sku on url like ?sku=product_sku\";\n if (isset($_GET['sku'])) {\n $sku = $_GET['sku'];\n }\n $merchant_id = MERCHANT_ID;\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($sku) {\n $productdata = $walmartHelper->getItem($sku);\n }\n print_r($productdata);\n die;\n }", "public function testComDayCqWcmCoreImplServletsThumbnailServlet() {\n\n }", "public function testComAdobeCqDtmImplServletsDTMDeployHookServlet() {\n\n }", "public function testComDayCqWcmCoreImplServletsFindReplaceServlet() {\n\n }", "public function testComDayCqDamCoreImplServletAssetXMPSearchServlet() {\n\n }", "public function test_find_product_name()\n {\n $name = \"Test Name Product.\";\n $categories = [\n \"Informatica\",\n \"Portatili\"\n ];\n $price = \"320,99\";\n $this->assertEquals(\n $name,\n $this->service->findNameProduct($this->getHtmlProductPage($name, $categories, $price))\n );\n }", "public function testComDayCqDamCoreImplServletBatchMetadataServlet() {\n\n }", "public function test_get_selected_product_not_found() {\n $response = $this->runApp('GET', '/product/barangabc');\n\n $this->assertEquals(404, $response->getStatusCode());\n $this->assertContains('product not found', json_decode($response->getBody(), true));\n }", "function pageInfo()\n\t{\n\t\t$sql= \"SELECT product_id,title,meta_desc,meta_keywords FROM products_table where product_id= \".(int)$_GET['prodid'].\" and status=1\";\n\t\t$query = new Bin_Query();\n\t\tif($query->executeQuery($sql))\n\t\t{\t\t\n\t\t\treturn Display_DProductDetail::pageInfo($query->records);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"No Products Found\";\n\t\t}\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that reflection() returns the ReflectionClass object.
public function testReflection() { $this->assertInstanceOf('ReflectionClass', $this->object->reflection()); }
[ "public function getClassReflection(): ReflectionClass;", "public function testLoadClassReflectionFromObject()\n {\n $object = new ReflectionClassTested();\n $reflection = Reflection::loadClassReflection($object);\n\n $this->assertInstanceOf('ReflectionClass', $reflection);\n $this->assertEquals('FiveLab\\Component\\Reflection\\ReflectionClassTested', $reflection->getName());\n }", "public function testGetReflectionClass()\n {\n if (!interface_exists('Doctrine\\ORM\\Proxy\\Proxy')) {\n $this->markTestSkipped('Doctrine\\ORM\\Proxy\\Proxy does not exist.');\n } else {\n $obj = new DummyEntity();\n $adapter = new OrmDataStorage();\n $class = $adapter->getReflectionClass($obj);\n\n $this->assertEquals($class->getName(), get_class($obj));\n }\n }", "protected function reflectionClass() {\n if ( empty( $this->reflection['class'] ) ) {\n $this->reflection['class'] = new ReflectionClass( get_called_class() );\n }\n return $this->reflection['class'];\n }", "protected function _getReflection()\n {\n if (is_null($this->_reflection)) {\n $this->_reflection = new \\ReflectionClass($this->_class);\n }\n return $this->_reflection;\n }", "public function getReflection()\n {\n $underTest = $this->underTest;\n\n return new ReflectionClass($underTest);\n }", "public function testReflectClass2()\n {\n $reflection = Zend_Server_Reflection::reflectClass('Zend_Server_Reflection_testClass', false, 'zsr');\n $this->assertEquals('zsr', $reflection->getNamespace());\n }", "public function testFromReflectionClassIsInterface()\n {\n\n // create a servlet instance\n $servlet = $this->getMockBuilder('AppserverIo\\Psr\\Servlet\\ServletInterface')\n ->setMethods(get_class_methods('AppserverIo\\Psr\\Servlet\\ServletInterface'))\n ->getMock();\n\n // create a PHP \\ReflectionClass instance\n $phpReflectionClass = $this->getMockBuilder('\\ReflectionClass')\n ->setMethods(array('isAbstract', 'isInterface'))\n ->disableOriginalConstructor()\n ->getMock();\n\n // mock the methods\n $phpReflectionClass\n ->expects($this->once())\n ->method('isInterface')\n ->will($this->returnValue(true));\n\n // create a ReflectionClass instance\n $reflectionClass = $this->getMockBuilder('AppserverIo\\Lang\\Reflection\\ReflectionClass')\n ->setMethods(array('toPhpReflectionClass', 'implementsInterface'))\n ->setConstructorArgs(array($servlet, array(), array()))\n ->getMock();\n\n // mock the methods\n $reflectionClass\n ->expects($this->any())\n ->method('toPhpReflectionClass')\n ->will($this->returnValue($phpReflectionClass));\n $reflectionClass\n ->expects($this->once())\n ->method('implementsInterface')\n ->will($this->returnValue(true));\n\n // check that the descriptor has not been initialized\n $this->assertNull($this->descriptor->fromReflectionClass($reflectionClass));\n }", "public function testGetTypeObject() {\n $classes = array('ReflectionClass', 'ezcTestClass');\n foreach ($classes as $class) {\n \t$type = $this->factory->getType($class);\n \tself::assertInstanceOf('ezcReflectionType', $type);\n self::assertInstanceOf('ezcReflectionObjectType', $type);\n self::assertInstanceOf( 'ReflectionClass', $type->getClass() );\n }\n\n\t\t$type = $this->factory->getType('NoneExistingClass');\n\t\tself::assertInstanceOf( 'ReflectionClass', $type->getClass() );\n }", "private function getReflection(): ReflectionClass {\n return new ReflectionClass($this->containerClass);\n }", "function getReflectionClass($obj);", "protected function getReflection(): ReflectionClass\n {\n if (is_null($this->reflection)) {\n $this->reflection = new ReflectionClass($this);\n }\n\n return $this->reflection;\n }", "public function getReflectionClass() {\n\t\tif ($this->reflClass === NULL) {\n\t\t\t$this->_initializeReflection();\n\t\t}\n\t\treturn $this->reflClass;\n\t}", "protected final function _reflection() {\n\t\t\ttry {\n\t\t\t\treturn new \\ReflectionObject( $this );\n\t\t\t}\n\t\t\tcatch( \\ReflectionException $e ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function getReflection(): \\ReflectionClass\n {\n return $this->subject_reflection;\n }", "public function getReflectionClass(): ReflectionClass\n {\n if (!$this->reflectionClass) {\n $this->reflectionClass = new ReflectionClass($this->getName());\n }\n\n return $this->reflectionClass;\n }", "private function getReflectionObject() {\n\n $this->reflectionObject = isset($this->reflectionObject) ? $this->reflectionObject : new \\ReflectionObject($this);\n\n return $this->reflectionObject;\n }", "public function testFromReflectionClassWithNoActionImplementation()\n {\n\n // create a reflection class from the \\stdClass\n $reflectionClass = new ReflectionClass('\\stdClass', array(), array());\n\n // check that the descriptor has not been initialized\n $this->assertNull($this->descriptor->fromReflectionClass($reflectionClass));\n }", "public function testLoadMethodReflectionFromClassName()\n {\n $reflection = Reflection::loadMethodReflection('FiveLab\\Component\\Reflection\\ReflectionClassTested', 'someMethod');\n\n $this->assertInstanceOf('ReflectionMethod', $reflection);\n $this->assertEquals('someMethod', $reflection->getName());\n $this->assertEquals('FiveLab\\Component\\Reflection\\ReflectionClassTested', $reflection->getDeclaringClass()->getName());\n }", "public static function getReflectionClass(string $className): \\ReflectionClass|false\n {\n try {\n return new \\ReflectionClass($className);\n } catch (\\Exception $e) {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns active search parameter
public function getActSearchParam() { return oxRegistry::getConfig()->getRequestParameter('searchparam'); }
[ "public function _get_search_param()\r\n\t{\r\n\t}", "public function getSearchParam(){\r\n return $this->_searchParam;\r\n }", "public function getSearchParam()\r\n {\r\n return $this->searchParam;\r\n }", "public function getSearchQueryParameter()\n {\n return $this->search_query_parameter;\n }", "public function getActSearchTag()\n {\n return oxRegistry::getConfig()->getRequestParameter('searchtag');\n }", "public static function getCurrentSearch()\n\t{\n\t\treturn self::getSearchNamespace()->currentsearch;\n\t}", "function culturefeed_search_get_active_search_page() {\n if ($type = culturefeed_get_searchable_type_by_path()) {\n return culturefeed_get_search_page($type);\n }\n}", "public function toParam()\n {\n return $this->searchTerm;\n }", "public function SearchQuery()\n {\n return Controller::curr()->getRequest()->getVar('Search');\n }", "public function getSearchId()\n {\n return $this->getParameter('searchId');\n }", "public function isSearchActive();", "public function getGlobalSearch()\n {\n return (string) $this->request->get(\"sSearch\",\"\");\n }", "public function getSearchVar()\n\t{\n\t\treturn $this->_getData('search_var')\n\t\t\t? $this->_getData('search_var')\n\t\t\t: 's';\n\t}", "private function getSearchKeyword()\r\n\t{\r\n\t\t$keyword = '';\r\n\t\t\r\n\t\tif (!empty($this->params['url']['search']))\r\n\t\t{\r\n\t\t\t$keyword = trim($this->params['url']['search']);\r\n\t\t}\r\n\t\telse if (!empty($this->params['named']['search']))\r\n\t\t{\r\n\t\t\t$keyword = trim($this->params['named']['search']);\r\n\t\t}\r\n\t\t\r\n\t\treturn $keyword;\r\n\t}", "public function getLikeParam() {\n return $this->get(self::LIKE_PARAM);\n }", "public function getSearchQueryString()\n {\n return $this->getRequest()->getParam($this->getQueryParamName());\n }", "protected function searchQueryParam()\n {\n return 'query';\n }", "public function getSearchMode()\n {\n return $this->searchMode;\n }", "function get_search_name() {\n $get_name = $_GET['search_input'];\n return $get_name;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register CSS and Javascript Register CSS and Javascript Register custom CSS and Javascript for this plugin. Multiple code blocks can be implemented to enable multiple stylesheets or javascript files.
function register_css_and_js() { // Access the global data structure global $trj_golem_data; /* * Register a css stylesheet */ // Stylesheet name $stylesheet = 'styles.css'; // Register the stylesheet wp_register_style('trj_golem', $trj_golem_data['paths']['css_url'] . $stylesheet); // Enqueue the stylesheet wp_enqueue_style('trj_golem'); /* * Register a javascript file */ // Javascript filename $js_file = "script.js"; // Register the file wp_register_script( 'trj_golem', $trj_golem_data['paths']['js_url'] . $js_file); // Enqueue the script wp_enqueue_script('trj_golem'); }
[ "public function addCustomCSSandJS(){\n \n $this->addCss('/plugins/brunomagconcept/whitelabel/assets/css/admin-overrides.css', 'core');\n $this->addJs('/plugins/brunomagconcept/whitelabel/assets/js/custom-javascript.js', 'core');\n echo $this->makeAssets();\n \n }", "public function loadCssAndJs() {\n //wp_register_style( 'vc_extend_style', plugins_url('assets/vc_content-block.css', __FILE__) );\n //wp_enqueue_style( 'vc_extend_style' );\n\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'vc_extend_js', plugins_url('assets/vc_extend.js', __FILE__), array('jquery') );\n }", "private function register_scripts_and_styles() {\n\t\tif(is_admin()) {\n \t\t$this->load_file(PLUGIN_NAME, '/' . PLUGIN_SLUG . '/js/admin.js', true);\n\t\t} else { \n\t\t\t$this->load_file(PLUGIN_NAME, '/' . PLUGIN_SLUG . '/css/widget.css');\n\t\t} // end if/else\n\t}", "public function loadCssAndJs() {\r\n wp_register_style( 'vc_extend_style', plugins_url('assets/vc_extend.css', __FILE__) );\r\n wp_enqueue_style( 'vc_extend_style' );\r\n\r\n // If you need any javascript files on front end, here is how you can load them.\r\n //wp_enqueue_script( 'vc_extend_js', plugins_url('assets/vc_extend.js', __FILE__), array('jquery') );\r\n }", "private function registerStylesAndScripts()\n {\n $urlPath = $this->wordpressConfig->getUrlPath();\n\n $this->wordpress->registerStyle(\n self::HANDLE_STYLE_ADMIN,\n $urlPath . 'assets/css/uamAdmin.css',\n [],\n UserAccessManager::VERSION,\n 'screen'\n );\n\n $this->wordpress->registerScript(\n self::HANDLE_SCRIPT_GROUP_SUGGEST,\n $urlPath . 'assets/js/jquery.uam-group-suggest.js',\n ['jquery'],\n UserAccessManager::VERSION\n );\n\n $this->wordpress->registerScript(\n self::HANDLE_SCRIPT_TIME_INPUT,\n $urlPath . 'assets/js/jquery.uam-time-input.js',\n ['jquery'],\n UserAccessManager::VERSION\n );\n\n $this->wordpress->registerScript(\n self::HANDLE_SCRIPT_ADMIN,\n $urlPath . 'assets/js/functions.js',\n ['jquery'],\n UserAccessManager::VERSION\n );\n }", "function registry_css_js() {\n\t\t/* registry css */\n\t\t/* wp_enqueue_style( 'style', get_stylesheet_uri()); */\n\n wp_enqueue_style( 'reset', THEME_URL . '/common/css/reset.css' );\n wp_enqueue_style( 'layout', THEME_URL . '/common/css/layout.css' );\n // wp_enqueue_style( 'module', THEME_URL . '/common/css/module.css' );\n wp_enqueue_style( 'helper', THEME_URL . '/common/css/helper.css' );\n wp_enqueue_style( 'magnific-popup-css', THEME_URL . '/common/css/magnific-popup.min.css' );\n wp_enqueue_style( 'style', THEME_URL . '/common/css/style.css' );\n\n\t /* registry js */\n\t wp_enqueue_script( 'jquery-min', THEME_URL . '/common/js/jquery-3.2.1.min.js', false, true );\n\t wp_enqueue_script( 'crossfade', THEME_URL . '/common/js/crossfade.jquery.js', false, true );\n\t wp_enqueue_script( 'parallax', THEME_URL . '/common/js/jquery.parallax-scroll.js', false, true );\n\t wp_enqueue_script( 'magnific-popup', THEME_URL . '/common/js/jquery.magnific-popup.min.js', false, true );\n\t wp_enqueue_script( 'scripts', THEME_URL . '/common/js/scripts.js', false, true );\n\n\t}", "public function registerPluginFiles()\n\t{\n\t\t/* publish assets dir */\n\t\t$assetsUrl = $this->getAssetsUrl('wheels.widgets.assets.modalmanager');\n\n\t\t/* @var $cs CClientScript */\n\t\t$cs = \\Yii::app()->getClientScript();\n\n\t\t$cs->registerCssFile($assetsUrl . '/css/bootstrap-modal.css');\n\t\t$cs->registerScriptFile($assetsUrl . '/js/bootstrap-modal.js', \\CClientScript::POS_END);\n\t\t$cs->registerScriptFile($assetsUrl . '/js/bootstrap-modalmanager.js', \\CClientScript::POS_END);\n\t}", "public function registerScripts()\n\t{\n\t\tparent::registerCoreScripts();\n\t\t$cs=Yii::app()->getClientScript();\t\t\n\t\t$cs->registerCoreScript('jquery.ui');\n\t\t$cs->registerCssFile($this->assetUrl.'/'.$this->widgetCssFile);\n\t}", "public function registerCoreScripts()\r\n {\r\n self::publishAssets() ;\r\n\r\n $cs = Yii::app()->getClientScript();\r\n $cs->registerCssFile(self::$themeUrl . '/' . self::$theme . '/' . self::$cssFile);\r\n $cs->registerCssFile(self::$themeUrl . '/icon.css');\r\n\r\n $cs->registerCoreScript('jquery');\r\n\r\n $cs->registerScriptFile(self::$assetsUrl . '/' . self::$scriptFile, CClientScript::POS_END);\r\n }", "public function registerAssets() {\n wp_enqueue_style( self::TEXT_DOMAIN . '-style', get_stylesheet_uri(), array(), date('Ymd') . 's2' );\n\n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( self::TEXT_DOMAIN . '-plugins', get_template_directory_uri() . '/assets/js/vendor.js', array(), date('Ymd') . 's2', true );\n wp_enqueue_script( self::TEXT_DOMAIN . '-scripts', get_template_directory_uri() . '/assets/js/scripts.js', array(), date('Ymd') . 's2', true );\n wp_localize_script( self::TEXT_DOMAIN . '-scripts', 'wpAjax', array(\n 'url' => admin_url('admin-ajax.php'),\n //'nonce' => wp_create_nonce(self::NONCE),\n ));\n }", "function wp_enqueue_registered_block_scripts_and_styles()\n {\n }", "public function loadCssAndJs() {\n wp_register_style( 'vc_extend_style', plugins_url('assets/vc_modal.css', __FILE__) );\n wp_enqueue_style( 'vc_extend_style' );\n\n // If you need any javascript files on front end, here is how you can load them.\n wp_enqueue_script( 'vc_extend_js', plugins_url('assets/vc_modal.js', __FILE__), array('jquery') );\n }", "public function kiwip_register_and_enqueue(){\n\t\t/* Register */\n\t\twp_register_style('kiwip-custom-post-type-css', $this->url.'/css/kiwip-custom-post-type.css', 'false', time(), 'screen');\n\t\twp_register_style('kiwip-custom-post-type-css-jquery-ui', $this->url.'/css/smoothness/jquery-ui-1.8.20.custom.css', false, time(), 'screen'); // ??\n\t\twp_register_script('kiwip-custom-post-type-js', $this->url.'/js/kiwip-custom-post-type.js', array('jquery', 'jquery-ui-datepicker'), time(), true);\n\t\twp_register_script('kiwip-medialibrary-uploader-js', $this->url.'/js/medialibrary-uploader.js', false, time(), true);\n\n\t\t/* Enqueue */\n\t\twp_enqueue_style('kiwip-custom-post-type-css');\n\t\twp_enqueue_style('kiwip-custom-post-type-css-jquery-ui');\n\t\twp_enqueue_script('kiwip-custom-post-type-js');\n\t\t//wp_enqueue_script('kiwip-medialibrary-uploader-js');\n\t}", "public function toolset_register_block_editor_assets() {\n\t\t$toolset_assets_manager = Toolset_Assets_Manager::getInstance();\n\n\t\t$toolset_assets_manager->register_script(\n\t\t\t'toolset-custom-html-block-js',\n\t\t\tTOOLSET_COMMON_URL . '/toolset-blocks/assets/js/custom.html.block.editor.js',\n\t\t\tarray( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ),\n\t\t\tTOOLSET_COMMON_VERSION\n\t\t);\n\n\t\twp_localize_script(\n\t\t\t'toolset-custom-html-block-js',\n\t\t\t'toolset_custom_html_block_strings',\n\t\t\tarray()\n\t\t);\n\n\t\t$toolset_assets_manager->register_style(\n\t\t\t'toolset-custom-html-block-editor-css',\n\t\t\tTOOLSET_COMMON_URL . '/toolset-blocks/assets/css/custom.html.block.editor.css',\n\t\t\tarray( 'wp-blocks', 'wp-edit-blocks' ),\n\t\t\tTOOLSET_COMMON_VERSION\n\t\t);\n\n\t\t$toolset_assets_manager->register_style(\n\t\t\t'toolset-custom-html-block-editor-frontend-css',\n\t\t\tTOOLSET_COMMON_URL . '/toolset-blocks/assets/css/custom.html.block.style.css',\n\t\t\tarray( 'wp-blocks', 'wp-edit-blocks' ),\n\t\t\tTOOLSET_COMMON_VERSION\n\t\t);\n\t}", "public static function register_assets() {\n\t\tself::register_style( 'wc-block-editor', plugins_url( 'build/editor.css', __DIR__ ), array( 'wp-edit-blocks' ) );\n\t\tself::register_style( 'wc-block-style', plugins_url( 'build/style.css', __DIR__ ), array() );\n\n\t\t// Shared libraries and components across all blocks.\n\t\tself::register_script( 'wc-blocks', plugins_url( 'build/blocks.js', __DIR__ ), array(), false );\n\t\tself::register_script( 'wc-vendors', plugins_url( 'build/vendors.js', __DIR__ ), array(), false );\n\n\t\t// Individual blocks.\n\t\tself::register_script( 'wc-handpicked-products', plugins_url( 'build/handpicked-products.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-best-sellers', plugins_url( 'build/product-best-sellers.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-category', plugins_url( 'build/product-category.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-new', plugins_url( 'build/product-new.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-on-sale', plugins_url( 'build/product-on-sale.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-top-rated', plugins_url( 'build/product-top-rated.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-products-by-attribute', plugins_url( 'build/products-by-attribute.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-featured-product', plugins_url( 'build/featured-product.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-featured-category', plugins_url( 'build/featured-category.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-categories', plugins_url( 'build/product-categories.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-tag', plugins_url( 'build/product-tag.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t}", "public function register_assets() {\n\n\t\t$assets = core\\Assets::get_instance();\n\t\tadd_action( 'admin_enqueue_scripts', array( $assets, 'enqueue_admin_styles' ), 95 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $assets, 'enqueue_admin_scripts' ), 95 );\n\t\tadd_action( 'admin_footer', array( $assets, 'enqueue_admin_templates' ), 95 );\n\t\tadd_action( 'enqueue_block_editor_assets', array( $assets, 'enqueue_block_editor_scripts' ), 95 );\n\t}", "function cap_vc_extend_js_css() {\n //wp_enqueue_style( 'cap_vc_extend_style' );\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'cap_vc_extend_js', plugins_url('cap_vc_extend.js', __FILE__), array('jquery') );\n}", "protected function addModulePageAssets()\n {\n $this->context->controller->addJqueryPlugin('cooki-plugin');\n $this->context->controller->addJqueryPlugin('cookie-plugin');\n $this->context->controller->addjqueryPlugin('fancybox');\n\n $this->context->controller->addCSS(array(\n _THEME_CSS_DIR_.'category.css' => 'all',\n _THEME_CSS_DIR_.'product_list.css' => 'all',\n ));\n }", "public function register_css_settings(){\r $this->plugin_settings_tabs[$this->css_settings_key] = 'CSS';\r register_setting( \r $this->css_settings_key, \r $this->css_settings_key,\r array( $this, 'sanitize' )\r );\r add_settings_section( \r 'section_css', \r 'Enter Custom CSS', \r array( $this, 'print_section_info' ), \r $this->css_settings_key \r );\r add_settings_field( \r 'css_value', \r 'CSS Styles', \r array( $this, 'css_callback' ), \r $this->css_settings_key, \r 'section_css',\r 'css_value'\r ); \r }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns a list of hyphenation patterns, that are available.
public static function getAvailableHyphenatePatterns() { if (self::$hyphenatePatterns != NULL) { return self::$hyphenatePatterns; } self::$hyphenatePatterns = array(); $files = file_scan_directory(libraries_get_path('tcpdf') . '/hyphenate_patterns', '/.tex$/', array('nomask' => '/(\.\.?|CVS)$/'), 1); foreach ($files as $file) { self::$hyphenatePatterns[basename($file->uri)] = str_replace('hyph-', '', $file->name); } return self::$hyphenatePatterns; }
[ "private function getPatterns()\n\t{\n\t\t$rtrn = '';\n\t\treset($this->patterns);\n\t\tforeach ($this->patterns as $pattern)\n\t\t{\n\t\t\t$rtrn .= '('.$pattern['expression'].')|';\n\t\t}\n\t\t$rtrn = substr($rtrn, 0, -1);\n\t\treturn '~'.$rtrn.'~'.($this->ignoreCase ? 'i' : '');\n\t}", "public static function patterns() {\n\t\treturn array_merge(static::$patterns, static::$optional);\n\t}", "public function getPatterns() {\n return $this->_patterns;\n }", "public function getDashPattern() {}", "protected function getNonCatchablePatterns()\n {\n return array('\\s+', ',', '(.)');\n }", "private function getPatterns() {\n return [\n 'facebook.com\\/(.*)\\/videos\\/(.*)',\n 'facebook.com\\/(.*)\\/photos\\/(.*)',\n 'facebook.com\\/(.*)\\/posts\\/(.*)',\n 'flickr.com\\/photos\\/(.*)',\n 'flic.kr\\/p\\/(.*)',\n 'instagram.com\\/p\\/(.*)',\n 'open.spotify.com\\/track\\/(.*)',\n 'twitter.com\\/(.*)\\/status\\/(.*)',\n 'vimeo.com\\/\\d{7,9}',\n 'youtube.com\\/watch[?]v=(.*)',\n 'youtu.be\\/(.*)',\n 'ted.com\\/talks\\/(.*)',\n ];\n }", "public function getPatterns()\n {\n if (!$this->patternsCache) {\n $this->patternsCache = $this->getOption('patterns');\n usort($this->patternsCache, function (Pattern $first, Pattern $second) {\n return $first->priority - $second->priority;\n });\n }\n\n return $this->patternsCache;\n }", "protected function patterns() {\n $fieldname = $this->_field->name();\n\n $patterns = parent::patterns();\n $patterns[\"[[{$fieldname}:linked]]\"] = array(false);\n $patterns[\"[[{$fieldname}:base64]]\"] = array(false);\n $patterns[\"[[{$fieldname}:tn]]\"] = array(false);\n $patterns[\"[[{$fieldname}:tn-url]]\"] = array(false);\n $patterns[\"[[{$fieldname}:tn-linked]]\"] = array(false);\n $patterns[\"[[{$fieldname}:tn-base64]]\"] = array(false);\n\n return $patterns; \n }", "protected function getValidationPatterns() {\n $patterns = [\n 'AT' => 'U[A-Z\\d]{8}',\n 'BE' => '(0\\d{9}|\\d{10})',\n 'BG' => '\\d{9,10}',\n 'CY' => '\\d{8}[A-Z]',\n 'CZ' => '\\d{8,10}',\n 'DE' => '\\d{9}',\n 'DK' => '\\d{8}',\n 'EE' => '\\d{9}',\n 'EL' => '\\d{9}',\n 'ES' => '[A-Z]\\d{7}[A-Z]|\\d{8}[A-Z]|[A-Z]\\d{8}',\n 'FI' => '\\d{8}',\n 'FR' => '[0-9A-Z]{2}\\d{9}',\n 'HR' => '\\d{11}',\n 'HU' => '\\d{8}',\n 'IE' => '[A-Z\\d]{8}|[A-Z\\d]{9}',\n 'IT' => '\\d{11}',\n 'LT' => '(\\d{9}|\\d{12})',\n 'LU' => '\\d{8}',\n 'LV' => '\\d{11}',\n 'MT' => '\\d{8}',\n 'NL' => '\\d{9}B\\d{2}',\n 'PL' => '\\d{10}',\n 'PT' => '\\d{9}',\n 'RO' => '\\d{2,10}',\n 'SE' => '\\d{12}',\n 'SI' => '\\d{8}',\n 'SK' => '\\d{10}',\n ];\n\n return $patterns;\n }", "public function getBlacklistPatterns()\n {\n return $this->blacklist_patterns;\n }", "abstract protected function getLicensePatterns();", "protected function _extendRegex()\n {\n return [];\n }", "public function getPatternNames() {\n\t\t$package = array();\n\t\tforeach ($this->patterns as $pattern) {\n\t\t\t$package[] = $pattern->getPatternName();\n\t\t}\n\t\t\n\t\treturn $package;\n\t}", "private function get_quote_pattern_short(): array {\n\t\treturn ['sub', 'fix', 'adj', 'subord', 'sub', 'verb', 'poss', 'adj', 'noun'];\n\t}", "public function getPatternFlags()\n {\n return null;\n }", "public function getPatternFlags()\n {\n return $this->getConfig('pattern_flags');\n }", "final public function getPatternArray() {}", "public function getPatterns()\n {\n $regexp = $words = array();\n\n if (isset($this->_params['words_file']) &&\n is_readable($this->_params['words_file'])) {\n /* Read the file and iterate through the lines. */\n $lines = file($this->_params['words_file']);\n foreach ($lines as $line) {\n /* Strip whitespace and comments. */\n $words[] = preg_replace('|#.*$|', '', trim($line));\n }\n }\n\n if (isset($this->_params['words'])) {\n $words = array_merge(\n $words,\n array_map('trim', $this->_params['words'])\n );\n }\n\n foreach ($words as $val) {\n if (strlen($val)) {\n $regexp[\"/(\\b(\\w*)$val\\b|\\b$val(\\w*)\\b)/i\"] = $this->_getReplacement($val);\n }\n }\n\n return array('regexp' => $regexp);\n }", "abstract public function getRegexps();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the target for the React to mount to.
public function render_target() { }
[ "public function render($target)\n {\n print($this->buildGraphImgTag($target));\n }", "public function renderSelf();", "function render($target_or_options, array $additional_options = []): string\n{\n return get_renderer()->render($target_or_options, $additional_options);\n}", "public function executeRender(){\r\n\techo $this->getAction()->getComponent('linker', 'structureActions', array('node' => $this->getRoute()->getObject()));\r\n\r\n }", "public function render() {\n $this->controller->render();\n }", "function renderToClient();", "private function handleRender(): string {\n $this->beforeRender();\n $components = $this->render();\n\n if((array)$this->state && $components instanceof Tag){\n // $componentProps = ['component'=> base64_encode(serialize($this)), 'component-state'=> $this->state];\n $componentProps = ['component'=> $this->encode(), 'component-state'=> $this->state];\n $components->props = (object)array_merge((array)$components->props,$componentProps);\n }\n\n if(!is_array($components)) $components = [$components]; //must be list of components\n\n $components = array_map(function($v){ return $v instanceof React ? $v : htmlspecialchars((string)$v); }, $components);\n\n return implode('', $components);\n }", "public function render() {\n $node = \\Quanta\\Common\\NodeFactory::loadOrCurrent($this->env, $this->getTarget());\n $this->setTarget($node->getAuthor());\n return parent::render();\n }", "public function setTargetRenders($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Deploy\\V1\\Release\\TargetRender::class);\n $this->target_renders = $arr;\n\n return $this;\n }", "public function onMount() {\n }", "public function render()\n {\n $this->renderer->render($this->response);\n }", "public function hydrate() {\n ?>\n <script>\n <?php foreach ( $this->components as $component ): ?>\n ReactDOM.hydrate(\n React.createElement(<?php echo $component->name(); ?>, <?php echo $component->json(); ?>),\n document.getElementById('<?php echo $component->identifier(); ?>')\n );\n <?php endforeach; ?>\n </script>\n <?php\n }", "public function render()\n {\n $pluginArgs = [\n 'index' => $this->arguments['index']->getUid(),\n ];\n\n return $this->renderExtbaseLink($pluginArgs, $this->getPageUid($this->arguments['pageUid'], 'detailPid'));\n }", "protected function render()\r\n {\r\n $settings = $this->get_settings_for_display();\r\n include NVM_DIR_PATH . '/inc/elementor/widgets/' . static::class . '/render.php';\r\n }", "public function render() {\n\t\t$requestUrl = Celsus_Routing::linkTo('auth_facebook_request', array('context' => 'connect'));\n\t\t?><a href=\"<?= $requestUrl ?>\" id=\"facebook-connect\"><img src=\"/i/facebook-connect.png\" title=\"Connect With Facebook\" alt=\"Connect With Facebook\"></a>\n\t\t<?php\n\t}", "public function render()\n {\n return '<base href=\"' . htmlspecialchars($this->controllerContext->getRequest()->getHttpRequest()->getBaseUri()) . '\" />';\n }", "public function render()\n\t{\n\t\t$users = $this->log->fetch_dashboard_listing();\n\n\t\trequire dirname( __FILE__ ) . '/templates/dashboard-widget.php';\n\t}", "function render()\n {\n echo $this->getOutput();\n }", "abstract function render();", "public function build()\n {\n if (isset($this->component)) {\n return $this->component;\n }\n\n $this->component = BuildUtil::removeNullElements([\n 'type' => ComponentType::BUTTON,\n 'action' => $this->actionBuilder->buildTemplateAction(),\n 'flex' => $this->flex,\n 'margin' => $this->margin,\n 'height' => $this->height,\n 'style' => $this->style,\n 'color' => $this->color,\n 'gravity' => $this->gravity,\n 'position' => $this->position,\n 'offsetTop' => $this->offsetTop,\n 'offsetBottom' => $this->offsetBottom,\n 'offsetStart' => $this->offsetStart,\n 'offsetEnd' => $this->offsetEnd,\n 'adjustMode' => $this->adjustMode,\n ]);\n\n return $this->component;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Init area editing form.
public function initAreaEditingForm($a_edit_property) { global $lng, $ilCtrl; include_once("Services/Form/classes/class.ilPropertyFormGUI.php"); $form = new ilPropertyFormGUI(); $form->setOpenTag(false); $form->setCloseTag(false); // name if ($a_edit_property != "link" && $a_edit_property != "shape") { $ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name"); $ti->setMaxLength(200); $ti->setSize(20); $ti->setRequired(true); $form->addItem($ti); } // save and cancel commands if ($a_edit_property == "") { $form->setTitle($lng->txt("cont_new_trigger_area")); $form->addCommandButton("saveArea", $lng->txt("save")); } else { $form->setTitle($lng->txt("cont_new_area")); $form->addCommandButton("saveArea", $lng->txt("save")); } return $form; }
[ "public function editarea() {\n\t\tif ($this->secureCheck ()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$id = \"\";\n\t\tif ($this->request->isParameterNotEmpty ( 'actionid' )) {\n\t\t\t$id = $this->request->getParameter ( \"actionid\" );\n\t\t}\n\t\t\n\t\t$model = new SyArea ();\n\t\t$area = $model->getArea ( $id );\n\t\t\n\t\t$modelCss = new SyBookingTableCSS ();\n\t\t$css = $modelCss->getAreaCss ( $id );\n\t\t\n\t\t$navBar = $this->navBar ();\n\t\t$this->generateView ( array (\n\t\t\t\t'navBar' => $navBar,\n\t\t\t\t'area' => $area,\n\t\t\t\t'css' => $css \n\t\t) );\n\t}", "public function area_edit_page()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$data['district_lists'] = $this->Setting_model->district_list(35);\n\t\t$data['area_edit'] = $this->Setting_model->area_by_id($id);\n\n\t\t$this->load->view('settings/area/area_edit', $data);\n\t}", "public function init()\n\t{\n\t\tparent::init();\n\n\t\t/**\n\t\t * form\n\t\t */\n\t\t$this->setAttrib('id', 'formConfiguration');\n\n\n\t}", "protected function InitForm()\n {\n $this->htmlCode = $this->LoadElement();\n $name = 'Code';\n $this->AddField(new Textarea($name, $this->htmlCode->GetCode()));\n $this->SetRequired($name);\n $this->AddCssClassField();\n $this->AddCssIDField();\n $this->AddSubmit();\n }", "function initializeCategEditForm() {\n if (!(isset($this->categDialog) && is_object($this->categDialog))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = $this->categ;\n $hidden = array(\n 'cmd' => 'edit_categ',\n 'save' => 1,\n 'categ_id' => $this->params['categ_id']\n );\n $fields = array(\n 'linkcateg_title' => array(\n 'Title', 'isNoHTML', TRUE, 'input', 200\n ),\n 'linkcateg_description' => array(\n 'Description', 'isSomeText', FALSE, 'textarea', 8\n )\n );\n $this->categDialog = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden);\n $this->categDialog->msgs = &$this->msgs;\n $this->categDialog->loadParams();\n }\n }", "function build_editing_form()\r\n {\r\n\r\n // $this->addElement($this->add_name_field());\r\n $this->addElement('hidden', SurveyContextTemplate :: PROPERTY_ID);\r\n $this->build_footer('Update');\r\n }", "protected abstract function InitForm();", "function initializeCategEditForm() {\n if (!(isset($this->categDialog) && is_object($this->categDialog))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = $this->categs[$this->params['categ_id']];\n $hideButtons = FALSE;\n $useToken = TRUE;\n if ($this->module->hasPerm(2, FALSE)) {\n $hidden = array(\n 'cmd' => 'edit_categ',\n 'save' => 1,\n 'categ_id' => $this->params['categ_id']\n );\n $fields = array(\n 'forumcat_title' => array('Title', 'isNoHTML', TRUE, 'input', 200),\n 'forumcat_desc' => array('Description', 'isNoHTML', FALSE, 'textarea', 8)\n );\n } else {\n $hideButtons = TRUE;\n $useToken = FALSE;\n $hidden = NULL;\n $fields = array(\n 'forumcat_title' => array('Title', 'isNoHTML', TRUE, 'info'),\n 'forumcat_desc' => array('Description', 'isNoHTML', FALSE, 'info')\n );\n }\n $this->categDialog = new base_dialog($this, $this->paramName, $fields, $data, $hidden);\n $this->categDialog->dialogHideButtons = $hideButtons;\n $this->categDialog->useToken = $useToken;\n $this->categDialog->msgs = &$this->msgs;\n $this->categDialog->loadParams();\n }\n }", "function build_editing_form()\r\n {\r\n\r\n // $survey_template_user = $this->survey_template_user;\r\n // $property_names = $survey_template_user->get_additional_property_names();\r\n //\r\n // foreach ($property_names as $property_name)\r\n // {\r\n // $this->add_textfield($property_name, $property_name, true);\r\n // }\r\n // $this->addElement('hidden', SurveyTemplate :: PROPERTY_ID);\r\n // $this->build_footer('Update');\r\n }", "public function init()\n {\n parent::init();\n \n // form should use p4cms-ui styles.\n $this->setAttrib('class', 'p4cms-ui role-form role-edit-form');\n\n // disable changing role name\n $this->getElement('id')\n ->setAttrib('disabled', true);\n }", "function initializeQuestionEditForm() {\n if (!(isset($this->dialogQuestion) && is_object($this->dialogQuestion))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n if (@$this->params['cmd'] != 'add_question') {\n $data = $this->question;\n $hidden = array(\n 'cmd' => 'edit_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id'],\n 'question_id' => $this->params['question_id']\n );\n $btnCaption = 'Edit';\n } else {\n $data = array();\n $hidden = array(\n 'cmd' => 'create_question',\n 'save' => 1,\n 'group_id' => $this->params['group_id']\n );\n $btnCaption = 'Save';\n }\n $fields = array(\n 'question_title' => array('Title', 'isNoHTML', TRUE, 'input', 250),\n 'question_text' => array('Text', 'isSomeText', FALSE, 'simplerichtext', 12),\n 'question_link' => array('Link', 'isSomeText', FALSE, 'simplerichtext', 4)\n );\n $this->dialogQuestion = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden\n );\n $this->dialogQuestion->msgs = &$this->msgs;\n $this->dialogQuestion->loadParams();\n $this->dialogQuestion->baseLink = $this->baseLink;\n $this->dialogQuestion->dialogTitle =\n papaya_strings::escapeHtmlChars($this->_gt('Properties'));\n $this->dialogQuestion->buttonTitle = $btnCaption;\n $this->dialogQuestion->dialogDoubleButtons = FALSE;\n }\n }", "function initializeCatalogsEditForm() {\n if (!(isset($this->catalogDialog) && is_object($this->catalogDialog))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = $this->catalog;\n $hidden = array(\n 'cmd' => 'edit_catalog',\n 'save' => 1,\n 'catalog_id' => $this->params['catalog_id']\n );\n $fields = array(\n );\n $this->catalogDialog = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden\n );\n $this->catalogDialog->msgs = &$this->msgs;\n $this->catalogDialog->loadParams();\n }\n }", "protected function _construct()\n {\n parent::_construct();\n $this->setId('glugox_pdf_edit_tabs');\n $this->setDestElementId('edit_form');\n $this->setTitle(__('Basic Settings'));\n }", "public function initAvailabilitySettingsForm()\n {\n global $ilCtrl;\n require_once('Customizing/global/plugins/Services/Repository/RepositoryObject/MumieTask/classes/forms/class.ilMumieTaskFormAvailabilityGUI.php');\n $form = new ilMumieTaskFormAvailabilityGUI();\n $form->setFields(!$this->object->isGradepoolSet());\n $form->addCommandButton('submitAvailabilitySettings', $this->i18N->globalTxt('save'));\n $form->addCommandButton('editProperties', $this->i18N->globalTxt('cancel'));\n $form->setFormAction($ilCtrl->getFormAction($this));\n\n $this->form = $form;\n }", "public function show_editform() {\n $this->item_form->display();\n }", "public static function loadEditArea($cfg)\n {\n $document = JFactory::getDocument();\n $document->addScript(JURI::root(true).$cfg['path'].'/'.$cfg['type']);\n\n $translates = array('txt' => 'brainfuck'\n , 'pot' => 'po');\n\n// if(array_key_exists($cfg['syntax'], $translates))\n $syntax =(array_key_exists($cfg['syntax'], $translates)) ? $translates[$cfg['syntax']] : $cfg['syntax'];\n\n// $syntax =(in_array($cfg['syntax'], $translates)) ? $cfg['syntax'] : 'brainfuck';\n\n $debug =(ECR_DEBUG) ? ',debug: true'.NL : '';\n\n $js = <<<EOF\n <!-- **************** -->\n <!-- **** load **** -->\n <!-- *** EditArea *** -->\n <!-- **************** -->\n editAreaLoader.init({\n id : \"{$cfg['textarea']}\"\n ,syntax: \"$syntax\"\n ,start_highlight: true\n ,replace_tab_by_spaces: 3\n ,end_toolbar: 'html_select, autocompletion'\n ,plugins: \"html, autocompletion\"\n ,autocompletion: true\n ,font_size: {$cfg['font-size']}\n // ,is_multi_files: true\n $debug\n });\nEOF;\n\n $document->addScriptDeclaration($js);\n\n ecrScript('editor');\n }", "public function buildForm()\n {\n $this\n ->addCollection('default_aid_type', 'Activity\\AidType','default_aid_type')\n ->addAddMoreButton('add', 'default_aid_type');\n }", "public function admin_page_form_edit() {\n\n\t\t\tinclude_once 'partials/ws-form-form-edit.php';\n\t\t}", "function initializeCatalogTypeEditForm() {\n if (!(isset($this->catalogTypeDialog) && is_object($this->catalogTypeDialog))) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = $this->catalogTypes[$this->params['type_id']];\n $hidden = array(\n 'cmd' => 'edit_type',\n 'save' => 1,\n 'type_id' => (int)$this->params['type_id'],\n 'lng_id' => $this->lngSelect->currentLanguageId\n );\n $fields = array(\n 'catalogtype_title' => array('Title', 'isSomeText', TRUE, 'input', 250),\n 'catalogtype_name' => array('Name', 'isSomeText', TRUE, 'input', 50),\n 'Always Load',\n 'catalogtype_loadlinks' => array('Links', 'isNum', TRUE, 'yesno'),\n 'catalogtype_loadteaser' => array('Teaser', 'isNum', TRUE, 'yesno'),\n );\n $this->catalogTypeDialog = new base_dialog(\n $this, $this->paramName, $fields, $data, $hidden\n );\n $this->catalogTypeDialog->dialogTitle = $this->_gt('Edit');\n $this->catalogTypeDialog->msgs = &$this->msgs;\n $this->catalogTypeDialog->loadParams();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$sql = "INSERT INTO delivery VALUES('','" . $data['id_delivery'] . "','" . $data['type_deliv'] . "','" . $data['sub_type'] . "','" . $data['no_resi'] . "','" . $data['nik'] . "','" . $data['jmlh_barang'] . "','" . $data['jenis_barang'] . "','" . $data['front_desk'] . "','" . $data['deliv_status'] . "','" . $data['date_time'] . "','" . $data['id_barang'] . "')";
public function insertd($data_deliv) { // $sql = "INSERT INTO `delivery` (`id_delivery`, `type_deliv`, `sub_type`, `no_resi`, `nik`, `jmlh_barang`, `jenis_barang`, `front_desk`, `deliv_status`, `date_time`, `id_barang`) VALUES (NULL, 'E-commerce', 'Shopee', '12345', '09876', '4', 'pakaian', 'mega', 'Belum Diambil', '2019-07-01 09:38:23', '33');" // $this->db->query($sql); return $this->db->insert('delivery', $data_deliv); }
[ "function insertKelas($data){\n //VALUES ('$start', '$end', '$durasi', '$nama_kegiatan', '$ruang', '$hari','$tgl_kegiatan',1)\";\n //$result = mysql_query($sql) or die (mysql_error());\n $this->db->insert('jadwal', $data);\n }", "public function insert_delivery($arr_data){\n\n\t\treturn $this->db->insert($this->_table,$arr_data);\n\n\t}", "public function tambah_data($data){\n\t\t$this->db->insert('tbl_surat',$data);\n\t}", "public function insert_order_detail($data)\n\t{\n\t\t$this->db->insert('detail_transaksi', $data);\n\t}", "function tambahTransaksi($idPegawai, $tanggalTransaksi, $jumlahTransaksi, $total)\n{\n return \"INSERT INTO transaksi (id_pegawai, tgl_transaksi, jumlah_transaksi, total) VALUES ('$idPegawai', '$tanggalTransaksi', '$jumlahTransaksi', '$total')\";\n}", "function input_transaksi($id_transaksi,$kode_kamar,$id_konsumen,$id_konsumen2,$total,$tambahan,$tanggal_bayar,$bulan,$tahun){\n\t\tmysql_query(\"INSERT INTO transaksi (id_transaksi,kode_kamar,id_konsumen,id_konsumen2,total,tambahan,tanggal_bayar,bulan,tahun) VALUES ('$id_transaksi','$kode_kamar','$id_konsumen','$id_konsumen2','$total','$tambahan','$tanggal_bayar','$bulan','$tahun')\");\n\t}", "public function insert_banner($data){\n $this->db->insert('banners', $data);\n }", "public function insert_data_fund_transfer($data)\n\t{\n\t\t$this->db->insert('fund_transfer',$data);\n\t}", "function adddelivery()\n {\n $sql = \"insert into delivery(CustomerID, RiderID, RequestID, Delivery_Type, Delivery_Status, Delivery_Time) values (:CustomerID, :RiderID, :RequestID, :Delivery_Type, :Delivery_Status, :Delivery_Time)\";\n $args = [':CustomerID'=>$this->CustomerID, ':RiderID'=>$this->RiderID, ':RequestID'=>$this->RequestID, ':Delivery_Type'=>$this->Delivery_Type, ':Delivery_Status'=>$this->Delivery_Status, ':Delivery_Time'=>$this->Delivery_Time];\n $stmt = DeliveryModel::connect()->prepare($sql);\n $stmt->execute($args);\n\n $sql1 = \"update request set Request_Status=:Request_Status, Reason=:Reason WHERE RequestID=:RequestID\";\n $args1 = [':Request_Status'=>$this->Request_Status,':Reason'=>$this->Reason, ':RequestID'=>$this->RequestID];\n $stmt1 = DeliveryModel::connect()->prepare($sql1);\n $stmt1->execute($args1);\n }", "function insert_jadwal($data){\n return $this->db->insert('cuti', $data);\n }", "function simpanAngsuran($tgl,$tgl_tempo, $ags_ke, $telat, $denda, $no, $id_nsb)\r\n\t{\r\n\t\t$query=\"insert into angsuran(tgl,tgl_tempo,ags_ke, telat, denda, no, id_nasabah) \r\n\t\tvalues('$tgl','$tgl_tempo', '$ags_ke', '$telat', '$denda', '$no', '$id_nsb')\";\r\n\t\t$hasil=mysql_query($query);\r\n\t}", "public function add($data){\r\n\t\t/*$sql = \"insert into transfer (date,to_warehouse,from_warehouse,total,note,user) values(?,?,?,?,?,?)\";\r\n\t\tif($this->db->query($sql,$data)){*/\r\n\t\tif($this->db->insert('transfer',$data)){\r\n\t\t\treturn $insert_id = $this->db->insert_id(); \r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "function insert_killmail($data, $database) {\r\n $cmd = \"INSERT INTO killmail (killID, killmail_id, killmail_time, solar_system_id) \" . \r\n \"VALUES (?,?,?,?)\";\r\n $stmt = $database->prepare($cmd);\r\n $stmt->bindParam(1, $data[0], PDO::PARAM_INT);\r\n $stmt->bindParam(2, $data[1], PDO::PARAM_INT);\r\n $stmt->bindParam(3, $data[2], PDO::PARAM_STR);\r\n $stmt->bindParam(4, $data[3], PDO::PARAM_INT);\r\n $stmt->execute();\r\n}", "public function insert($data){\n $desa_id = $data['id'];\n\n // Masalah dengan auto_increment meloncat. Paksa supaya berurutan.\n // https://ubuntuforums.org/showthread.php?t=2086550\n // PERHATIAN: insert ke tabel akses memasukkan dua baris duplikat, sehingga\n // perlu dibuatkan index unik (perlu dicari sebabnya -- mungkin bug di mysql atau codeigniter)\n $sql = \"ALTER TABLE akses AUTO_INCREMENT = 1\";\n $this->db->query($sql);\n $akses = array();\n $akses['desa_id'] = $desa_id;\n $akses['url_referrer'] = $data['url'];\n $akses['request_uri'] = $_SERVER['REQUEST_URI'];\n $akses['client_ip'] = get_client_ip_server();\n if (!empty($data['external_ip'])) $akses['external_ip'] = $data['external_ip'];\n $akses['opensid_version'] = (isset($data['version']) ? $data['version'] : '1.9');\n $akses['tgl'] = $data['tgl_ubah'];\n $out2 = $this->db->insert('akses',$akses);\n return \"akses: \".$out2;\n }", "function oath_insert($data)\n\t{\n\t$this->db->insert('oath_details', $data);\n\t}", "function newsKategori_TambahData(\n\t\t$tbl_newskategori,\n\t\t$id, $idupline, $keterangan, $keteranganinggris,\n\t\t$posisi, $urutan,\n\t\t$homepagetampil, $menuatas1, $menuatas2,\n\t\t$menubawah1, $menubawah2, $statustampil,\n\t\t$imagefile, $imagelogo, $imageheader, $imagebackground,\n\t\t$hit, $linkjudul, $keyword\n\n\t){\n\t\t$sql = mysql_query(\"INSERT INTO $tbl_newskategori\n\t\t(\n\t\t\tid, idupline, keterangan, keteranganinggris,\n\t\t\tposisi, urutan,\n\t\t\thomepagetampil, menuatas1, menuatas2,\n\t\t\tmenubawah1, menubawah2, statustampil,\n\t\t\timagefile, imagelogo, imageheader, imagebackground,\n\t\t\thit, linkjudul, keyword\n\t\t\t\n\t\t)VALUES(\n\t\t\t'$id', '$idupline',\n\t\t\t'$keterangan', '$keteranganinggris',\n\t\t\t'$posisi', '$urutan',\n\t\t\t'$homepagetampil', '$menuatas1', '$menuatas2',\n\t\t\t'$menubawah1', '$menubawah2', '$statustampil',\n\t\t\t'$imagefile', '$imagelogo', '$imageheader', '$imagebackground',\n\t\t\t'$hit', '$linkjudul', '$keyword'\n\t\t)\");\n\t\treturn $sql;\n\t}", "function addProd($idc,$cat,$desi,$img,$pa,$pv,$fiche){\n\n $sql = \"INSERT INTO `produit`( `IDC`, `ID_CAT`, `DESI`, `PHOTO`, `PRIXA`, `PRIXV`, `QNT`, `FTECH`, `FLAG`)\nVALUES ($idc,$cat,'$desi','$img',$pa,$pv,0,'$fiche',0)\";\n \n $insertData = array(\n 'IDP' => 'null' ,\n 'IDC' =>$idc ,\n 'ID_CAT' =>$cat ,\n 'DESI' =>$desi ,\n 'PHOTO' =>$img ,\n 'PRIXA' =>$pa ,\n 'PRIXV' =>$pv ,\n 'QNT' =>0 ,\n 'FTECH' =>$fiche ,\n 'FLAG' =>0 \n );\n return insert($rowarray,'produit');\n}", "function pollingKategori_TambahData(\n\t\t$tbl_pollingkategori,\n\t\t$id, $idupline, $keterangan, $keteranganinggris,\n\t\t$posisi, $urutan,\n\t\t$homepagetampil, $menuatas1, $menuatas2,\n\t\t$menubawah1, $menubawah2, $statustampil,\n\t\t$imagefile, $imagelogo, $imageheader, $imagebackground,\n\t\t$hit, $linkjudul, $keyword\n\n\t){\n\t\t$sql = mysql_query(\"INSERT INTO $tbl_pollingkategori\n\t\t(\n\t\t\tid, idupline, keterangan, keteranganinggris,\n\t\t\tposisi, urutan,\n\t\t\thomepagetampil, menuatas1, menuatas2,\n\t\t\tmenubawah1, menubawah2, statustampil,\n\t\t\timagefile, imagelogo, imageheader, imagebackground,\n\t\t\thit, linkjudul, keyword\n\t\t\t\n\t\t)VALUES(\n\t\t\t'$id', '$idupline',\n\t\t\t'$keterangan', '$keteranganinggris',\n\t\t\t'$posisi', '$urutan',\n\t\t\t'$homepagetampil', '$menuatas1', '$menuatas2',\n\t\t\t'$menubawah1', '$menubawah2', '$statustampil',\n\t\t\t'$imagefile', '$imagelogo', '$imageheader', '$imagebackground',\n\t\t\t'$hit', '$linkjudul', '$keyword'\n\t\t)\");\n\t\treturn $sql;\n\t}", "function insertPesanan($_data){\n // #TODO nanti bikin return status insert data nya ya\n $this->db->insert('pesanan_laundry',$_data);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the scopeType property value. The type of the scope where the policy is created. One of Directory, DirectoryRole, Group. Required.
public function setScopeType(?string $value): void { $this->getBackingStore()->set('scopeType', $value); }
[ "public function setScopeType($val)\n {\n $this->_propDict[\"scopeType\"] = $val;\n return $this;\n }", "public function validateScopeType($scopeType);", "public function getScopeType()\n {\n return $this->scopeType;\n }", "protected function addType($type, $id, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null)\n {\n switch ($type) {\n case 'text':\n $this->_resourceConfig->saveConfig(\n 'cart2quote_quote_form_settings/quote_form_custom_field_' . $id . '/type',\n 'text',\n $scopeType,\n $scopeCode\n );\n $this->_resourceConfig->saveConfig(\n 'cart2quote_quote_form_settings/quote_form_custom_field_' . $id . '/label',\n 'text',\n $scopeType,\n $scopeCode\n );\n break;\n case 'textarea':\n $this->_resourceConfig->saveConfig(\n 'cart2quote_quote_form_settings/quote_form_custom_field_' . $id . '/type',\n 'textarea',\n $scopeType,\n $scopeCode\n );\n $this->_resourceConfig->saveConfig(\n 'cart2quote_quote_form_settings/quote_form_custom_field_' . $id . '/label',\n 'text',\n $scopeType,\n $scopeCode\n );\n break;\n }\n }", "protected function getScope($type)\n {\n switch ($type) {\n case AbstractFee::CART_TYPE:\n return 'mageworxFeeForm';\n case AbstractFee::SHIPPING_TYPE:\n return 'mageworxShippingFeeForm';\n case AbstractFee::PAYMENT_TYPE:\n return 'mageworxPaymentFeeForm';\n default:\n return 'mageworxFeeForm';\n }\n }", "function SetScope( $scope )\n {\n if (is_string($scope))\n $scope = preg_split(\"/\\s+/\",$scope);\n\n // basic scope is always on\n if (array_search(\"basic\",$scope) === false)\n $scope[] = \"basic\";\n\n $this->scope = $scope;\n }", "public function setRequestType(int $access_scope): self\n {\n $this->request_type = ucfirst($this->explainAccessScope($access_scope));\n return $this;\n }", "private function firewallOnScopes($grantType, $scopes) {\n $onlyForAuthed = ['user', 'user:externalaccounts',\n 'user:apps', 'plugin:submit',\n 'users:search'];\n\n if ($grantType == 'client_credentials') {\n foreach ($onlyForAuthed as $scope) {\n if (in_array($scope, $scopes)) {\n throw new InvalidScope($scope);\n }\n }\n }\n }", "public function SetPeriodType($periodType)\r\n\t\t{\r\n\t\t\t\t$this->periodType = $periodType;\r\n\t\t}", "public function setEntityType(string $type);", "public function set_type( $type ) {\n\t\t$this->review_type = $type;\n\n\t\t$this->update_meta( APP_REVIEWS_C_RECIPIENT_TYPE_KEY, $this->review_type, true );\n\t}", "public function set_scope($scope)\n\t{\n\t\t$this->scope = $scope;\n\t}", "public function setGrantType(string $grantType): void\n {\n $this->grantType = $grantType;\n }", "public function setGrantType($type, Array $info = null, Request $request = null)\n {\n $defaultInfos = array('redirect_uri' => '', 'scope' => '');\n\n switch ($type) {\n case self::GRANT_TYPE_AUTHORIZATION:\n\n if ( ! isset($info['redirect_uri']) && $request) {\n $info['redirect_uri'] = $this->getUrlWithoutOauth2Parameters($request);\n }\n\n if ( ! isset($info['scope'])) {\n $info['scope'] = '';\n }\n break;\n default:\n throw new InvalidArgumentException(sprintf(\n 'Only %s grant type is currently supported'\n , self::GRANT_TYPE_AUTHORIZATION\n )\n );\n }\n\n $this->grantType = $type;\n $this->grantInfo = array_merge($defaultInfos, $info);\n\n return $this;\n }", "public function assignEntityTypeNode(EntityScope $scope) {\n $entity = $scope->getEntity();\n $entity->entityType = 'node';\n $this->setEntityPath($entity);\n }", "public function setScope(?string $scope): void\n {\n $this->scope = $scope;\n }", "public function setScope(string $scope): void\n {\n $values = explode(' ', $scope);\n $this->scope = array_filter($values, 'strlen');\n }", "public function setScope()\n {\n $this->setData('scope_id', $this->getWebsiteId() . ':' . $this->getStoreId());\n }", "function setRequestType($requestType) {\n\t\t$this->m_requestType = $requestType;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to edit a Newsletter entity.
private function createEditForm(Newsletter $entity) { $form = $this->createForm(new NewsletterType(), $entity, array( 'action' => $this->generateUrl('newsletters_update', array('id' => $entity->getId())), 'method' => 'PUT', )); //$form->add('submit', 'submit', array('label' => 'Update')); return $form; }
[ "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ExtranetBundle:Newsletters')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Newsletter entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ExtranetBundle:Default:Newsletter/edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CoreNewsletterBundle:Newsletter')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Newsletter entity.');\n }\n\n $editForm = $this->createForm(new NewsletterType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CoreNewsletterBundle:Newsletter:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "private function createCreateForm(Newsletter $entity)\r\n {\r\n $form = $this->createForm(new NewsletterType(), $entity, array(\r\n 'action' => $this->generateUrl('newsletters_create'),\r\n 'method' => 'POST',\r\n ));\r\n\r\n //$form->add('submit', 'submit', array('label' => 'Create'));\r\n\r\n return $form;\r\n }", "private function createEditForm(News $entity)\n {\n $form = $this->createForm(new NewsType(), $entity, array(\n 'action' => $this->generateUrl('news_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n return $form;\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CoreNewsletterBundle:NewsletterEmail')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find NewsletterEmail entity.');\n }\n\n $editForm = $this->createForm(new NewsletterEmailType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CoreNewsletterBundle:NewsletterEmail:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "private function createEditForm(News $entity)\n {\n $user = $this->get('security.context')->getToken()->getUser();\n\n $form = $this->createForm(new NewsType($user->getId()), $entity, array(\n 'action' => $this->generateUrl('news_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array(\n 'class' => 'form-horizontal',\n 'novalidate' => 'novalidate',\n )\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update', 'attr' => array('class' => 'btn btn-primary')));\n $form->add('reset', 'reset', array('label' => 'Reset', 'attr' => array('class' => 'btn btn-danger')));\n\n return $form;\n }", "private function createEditForm(Notas $entity)\n {\n $form = $this->createForm(new NotasType(), $entity, array(\n 'action' => $this->generateUrl('notas_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(EmailTemplate $entity)\n {\n $form = $this->createForm(new EmailTemplateType(), $entity, array(\n 'action' => $this->generateUrl('ccc_email_template_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array(\n 'label' => 'ccc.email-template.update', \n 'translation_domain' => 'CCCEmailTemplate',\n 'attr' => array('class' => 'btn')\n ));\n\n return $form;\n }", "private function createEditForm( Mesa $entity ) {\n\t\t$form = $this->createForm( new MesaType(),\n\t\t\t$entity,\n\t\t\tarray(\n\t\t\t\t'action' => $this->generateUrl( 'mesas_update', array( 'id' => $entity->getId() ) ),\n\t\t\t\t'method' => 'PUT',\n\t\t\t\t'attr' => array( 'class' => 'box-body' )\n\t\t\t) );\n\n\t\t$form->add(\n\t\t\t'submit',\n\t\t\t'submit',\n\t\t\tarray(\n\t\t\t\t'label' => 'Actualizar',\n\t\t\t\t'attr' => array( 'class' => 'btn btn-primary pull-right' ),\n\t\t\t)\n\t\t);\n\n\t\treturn $form;\n\t}", "public function createAction()\n {\n $entity = new Newsletter();\n $request = $this->getRequest();\n $form = $this->createForm(new NewsletterType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('newsletter'));\n\n }\n\n return $this->render('CoreNewsletterBundle:Newsletter:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "private function createEditForm(Acta $entity)\n {\n $form = $this->createForm(new ActaType(), $entity, array(\n 'action' => $this->generateUrl('acta_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function newsletterAction() {\n\n $newsletter = new Newsletter();\n $form = $this->createForm(new NewsletterType(), $newsletter);\n\n return $this->render('DuskUserBundle:Default:newsletter.html.twig', array('form' => $form->createView()));\n }", "private function _getForm()\n {\n $newsletterForm = new Form_Newsletter(array(\n 'method' => 'post'\n ));\n \n $this->view->newsletterForm = $newsletterForm;\n \n return $newsletterForm;\n }", "private function createEditForm(Topic $entity)\n {\n $form = $this->createForm(new EditTopicType(), $entity, array(\n 'action' => $this->generateUrl('topic_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Aktywacja $entity)\n {\n $form = $this->createForm(new AktywacjaType(), $entity, array(\n 'action' => $this->generateUrl('aktywacja_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Mailbox $entity)\n {\n $form = $this->createForm(new MailboxType(), $entity, array(\n 'action' => $this->generateUrl('mailbox_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(SourceColonie $entity)\n {\n $form = $this->createForm(new SourceColonieType(), $entity, array(\n 'action' => $this->generateUrl('sourcecolonie_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier'));\n\n return $form;\n }", "private function createEditForm(Annonce $entity)\n {\n $form = $this->createForm(new AnnonceType(), $entity, array(\n 'action' => $this->generateUrl('annonce_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Marquer comme Vu'));\n\n return $form;\n }", "private function createEditForm(Nacionalidade $entity)\n {\n $form = $this->createForm(new NacionalidadeType(), $entity, array(\n 'action' => $this->generateUrl('nacionalidade_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert UCS4 strin into UCS4 garray
function _ucs4_string_to_ucs4($input) { $output = array(); $inp_len = strlen($input); // Input length must be dividable by 4 if ($inp_len % 4) { $this->_error('Input UCS4 string is broken'); return false; } // Empty input - return empty output if (!$inp_len) return $output; for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) { // Increment output position every 4 input bytes if (!($i % 4)) { $out_len++; $output[$out_len] = 0; } $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); } return $output; }
[ "protected function _ucs4_string_to_ucs4($input)\n {\n $output = array();\n $inp_len = strlen($input);\n // Input length must be dividable by 4\n if ($inp_len % 4) {\n $this->_error('Input UCS4 string is broken');\n return false;\n }\n // Empty input - return empty output\n if (!$inp_len) return $output;\n for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) {\n // Increment output position every 4 input bytes\n if (!($i % 4)) {\n $out_len++;\n $output[$out_len] = 0;\n }\n $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );\n }\n return $output;\n }", "function _utf8_to_ucs4($input)\n {\n $output = array();\n $out_len = 0;\n $inp_len = strlen($input);\n $mode = 'next';\n $test = 'none';\n for ($k = 0; $k < $inp_len; ++$k) {\n $v = ord($input[$k]); // Extract byte from input string\n\n if ($v < 128) { // We found an ASCII char - put into stirng as is\n $output[$out_len] = $v;\n ++$out_len;\n if ('add' == $mode) {\n $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);\n return false;\n }\n continue;\n }\n if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char\n $start_byte = $v;\n $mode = 'add';\n $test = 'range';\n if ($v >> 5 == 6) { // &110xxxxx 10xxxxx\n $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left\n $v = ($v - 192) << 6;\n } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx\n $next_byte = 1;\n $v = ($v - 224) << 12;\n } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n $next_byte = 2;\n $v = ($v - 240) << 18;\n } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx\n $next_byte = 3;\n $v = ($v - 248) << 24;\n } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx\n $next_byte = 4;\n $v = ($v - 252) << 30;\n } else {\n $this->_error('This might be UTF-8, but I don\\'t understand it at byte '.$k);\n return false;\n }\n if ('add' == $mode) {\n $output[$out_len] = (int) $v;\n ++$out_len;\n continue;\n }\n }\n if ('add' == $mode) {\n if (!$this->_allow_overlong && $test == 'range') {\n $test = 'none';\n if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {\n $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k);\n return false;\n }\n }\n if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx\n $v = ($v - 128) << ($next_byte * 6);\n $output[($out_len - 1)] += $v;\n --$next_byte;\n } else {\n $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);\n return false;\n }\n if ($next_byte < 0) {\n $mode = 'next';\n }\n }\n } // for\n return $output;\n }", "private static function ucs4array_ucs4($input)\n {\n $output = '';\n foreach ($input as $v) {\n $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);\n }\n return $output;\n }", "function _ucs4_to_ucs4_string($input)\n {\n $output = '';\n // Take array values and split output to 4 bytes per value\n // The bit mask is 255, which reads &11111111\n foreach ($input as $v) {\n $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);\n }\n return $output;\n }", "function utfstring_to_ords($input, $encoding = 'UTF-8'){\r\n // Turn a string of unicode characters into UCS-4BE, which is a Unicode\r\n // encoding that stores each character as a 4 byte integer. This accounts for\r\n // the \"UCS-4\"; the \"BE\" prefix indicates that the integers are stored in\r\n // big-endian order. The reason for this encoding is that each character is a\r\n // fixed size, making iterating over the string simpler.\r\n $input = mb_convert_encoding($input, \"UCS-4BE\", $encoding);\r\n\r\n // Visit each unicode character.\r\n $ords = array();\r\n for ($i = 0; $i < mb_strlen($input, \"UCS-4BE\"); $i++) {\r\n // Now we have 4 bytes. Find their total numeric value.\r\n $s2 = mb_substr($input, $i, 1, \"UCS-4BE\");\r\n $val = unpack(\"N\", $s2);\r\n $ords[] = $val[1];\r\n }\r\n return $ords;\r\n}", "protected function _ucs4_to_ucs4_string($input)\n {\n $output = '';\n // Take array values and split output to 4 bytes per value\n // The bit mask is 255, which reads &11111111\n foreach ($input as $v) {\n $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);\n }\n return $output;\n }", "function utf8ToUnicodeArray($str) {\n\t\t\t$unicode = array ();\n\t\t\t$values = array ();\n\t\t\t$lookingFor = 1;\n\n\t\t\tfor ($i = 0; $i < strlen($str); $i++) {\n\t\t\t\t$thisValue = ord($str[$i]);\n\t\t\t\tif ($thisValue < 128)\n\t\t\t\t\t$unicode[] = $thisValue;\n\t\t\t\telse {\n\n\t\t\t\t\tif (count($values) == 0)\n\t\t\t\t\t\t$lookingFor = ($thisValue < 224) ? 2 : 3;\n\n\t\t\t\t\t$values[] = $thisValue;\n\n\t\t\t\t\tif (count($values) == $lookingFor) {\n\n\t\t\t\t\t\t$number = ($lookingFor == 3) ? (($values[0] % 16) * 4096) + (($values[1] % 64) * 64) + ($values[2] % 64) : (($values[0] % 32) * 64) + ($values[1] % 64);\n\n\t\t\t\t\t\t$unicode[] = $number;\n\t\t\t\t\t\t$values = array ();\n\t\t\t\t\t\t$lookingFor = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $unicode;\n\t\t}", "function utf8_to_unicode($str,$strict=false) {\r\n $mState = 0; // cached expected number of octets after the current octet\r\n // until the beginning of the next UTF8 character sequence\r\n $mUcs4 = 0; // cached Unicode character\r\n $mBytes = 1; // cached expected number of octets in the current sequence\r\n\r\n $out = array();\r\n\r\n $len = strlen($str);\r\n\r\n for($i = 0; $i < $len; $i++) {\r\n\r\n $in = ord($str{$i});\r\n\r\n if ( $mState == 0) {\r\n\r\n // When mState is zero we expect either a US-ASCII character or a\r\n // multi-octet sequence.\r\n if (0 == (0x80 & ($in))) {\r\n // US-ASCII, pass straight through.\r\n $out[] = $in;\r\n $mBytes = 1;\r\n\r\n } else if (0xC0 == (0xE0 & ($in))) {\r\n // First octet of 2 octet sequence\r\n $mUcs4 = ($in);\r\n $mUcs4 = ($mUcs4 & 0x1F) << 6;\r\n $mState = 1;\r\n $mBytes = 2;\r\n\r\n } else if (0xE0 == (0xF0 & ($in))) {\r\n // First octet of 3 octet sequence\r\n $mUcs4 = ($in);\r\n $mUcs4 = ($mUcs4 & 0x0F) << 12;\r\n $mState = 2;\r\n $mBytes = 3;\r\n\r\n } else if (0xF0 == (0xF8 & ($in))) {\r\n // First octet of 4 octet sequence\r\n $mUcs4 = ($in);\r\n $mUcs4 = ($mUcs4 & 0x07) << 18;\r\n $mState = 3;\r\n $mBytes = 4;\r\n\r\n } else if (0xF8 == (0xFC & ($in))) {\r\n /* First octet of 5 octet sequence.\r\n *\r\n * This is illegal because the encoded codepoint must be either\r\n * (a) not the shortest form or\r\n * (b) outside the Unicode range of 0-0x10FFFF.\r\n * Rather than trying to resynchronize, we will carry on until the end\r\n * of the sequence and let the later error handling code catch it.\r\n */\r\n $mUcs4 = ($in);\r\n $mUcs4 = ($mUcs4 & 0x03) << 24;\r\n $mState = 4;\r\n $mBytes = 5;\r\n\r\n } else if (0xFC == (0xFE & ($in))) {\r\n // First octet of 6 octet sequence, see comments for 5 octet sequence.\r\n $mUcs4 = ($in);\r\n $mUcs4 = ($mUcs4 & 1) << 30;\r\n $mState = 5;\r\n $mBytes = 6;\r\n\r\n } elseif($strict) {\r\n /* Current octet is neither in the US-ASCII range nor a legal first\r\n * octet of a multi-octet sequence.\r\n */\r\n trigger_error(\r\n 'utf8_to_unicode: Illegal sequence identifier '.\r\n 'in UTF-8 at byte '.$i,\r\n E_USER_WARNING\r\n );\r\n return false;\r\n\r\n }\r\n\r\n } else {\r\n\r\n // When mState is non-zero, we expect a continuation of the multi-octet\r\n // sequence\r\n if (0x80 == (0xC0 & ($in))) {\r\n\r\n // Legal continuation.\r\n $shift = ($mState - 1) * 6;\r\n $tmp = $in;\r\n $tmp = ($tmp & 0x0000003F) << $shift;\r\n $mUcs4 |= $tmp;\r\n\r\n /**\r\n * End of the multi-octet sequence. mUcs4 now contains the final\r\n * Unicode codepoint to be output\r\n */\r\n if (0 == --$mState) {\r\n\r\n /*\r\n * Check for illegal sequences and codepoints.\r\n */\r\n // From Unicode 3.1, non-shortest form is illegal\r\n if (((2 == $mBytes) && ($mUcs4 < 0x0080)) ||\r\n ((3 == $mBytes) && ($mUcs4 < 0x0800)) ||\r\n ((4 == $mBytes) && ($mUcs4 < 0x10000)) ||\r\n (4 < $mBytes) ||\r\n // From Unicode 3.2, surrogate characters are illegal\r\n (($mUcs4 & 0xFFFFF800) == 0xD800) ||\r\n // Codepoints outside the Unicode range are illegal\r\n ($mUcs4 > 0x10FFFF)) {\r\n\r\n if($strict){\r\n trigger_error(\r\n 'utf8_to_unicode: Illegal sequence or codepoint '.\r\n 'in UTF-8 at byte '.$i,\r\n E_USER_WARNING\r\n );\r\n\r\n return false;\r\n }\r\n\r\n }\r\n\r\n if (0xFEFF != $mUcs4) {\r\n // BOM is legal but we don't want to output it\r\n $out[] = $mUcs4;\r\n }\r\n\r\n //initialize UTF8 cache\r\n $mState = 0;\r\n $mUcs4 = 0;\r\n $mBytes = 1;\r\n }\r\n\r\n } elseif($strict) {\r\n /**\r\n *((0xC0 & (*in) != 0x80) && (mState != 0))\r\n * Incomplete multi-octet sequence.\r\n */\r\n trigger_error(\r\n 'utf8_to_unicode: Incomplete multi-octet '.\r\n ' sequence in UTF-8 at byte '.$i,\r\n E_USER_WARNING\r\n );\r\n\r\n return false;\r\n }\r\n }\r\n }\r\n return $out;\r\n }", "function unistr_to_ords($str, $encoding = 'UTF-8'){\n // Even if some of those characters are multibyte.\n $str = mb_convert_encoding($str,\"UCS-4BE\",$encoding);\n $ords = \"\";;\n \n // Visit each unicode character\n for($i = 0; $i < mb_strlen($str,\"UCS-4BE\"); $i++){ \n // Now we have 4 bytes. Find their total\n // numeric value.\n $s2 = mb_substr($str,$i,1,\"UCS-4BE\"); \n $val = unpack(\"N\",$s2); \n $ords.= $val[1]; \n } \n return($ords);\n}", "protected function _ucs4_to_utf8($input)\n {\n $output = '';\n foreach($input as $k => $v)\n {\n if($v < 128)\n { // 7bit are transferred literally\n $output .= chr($v);\n }\n elseif($v < (1 << 11))\n { // 2 bytes\n $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));\n }\n elseif($v < (1 << 16))\n { // 3 bytes\n $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));\n }\n elseif($v < (1 << 21))\n { // 4 bytes\n $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) .\n chr(128 + ($v & 63));\n }\n elseif(self::$safe_mode)\n {\n $output .= self::$safe_char;\n }\n else\n {\n $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k);\n return false;\n }\n }\n return $output;\n }", "protected function _ucs4_to_utf8($input)\n {\n $output = '';\n foreach ($input as $k => $v) {\n if ($v < 128) { // 7bit are transferred literally\n $output .= chr($v);\n } elseif ($v < (1 << 11)) { // 2 bytes\n $output .= chr(192+($v >> 6)).chr(128+($v & 63));\n } elseif ($v < (1 << 16)) { // 3 bytes\n $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));\n } elseif ($v < (1 << 21)) { // 4 bytes\n $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));\n } elseif (self::$safe_mode) {\n $output .= self::$safe_char;\n } else {\n $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);\n return false;\n }\n }\n return $output;\n }", "public function unencodedAndEncodedGRids(): array\n\t{\n\t\treturn [\n\t\t\t['A12425GABC1234002', 'A12425GABC1234002M'],\n\t\t\t['A12425GXYZ9876008', 'A12425GXYZ98760086'],\n\t\t\t['A12425G1234567890', 'A12425G1234567890L'],\n\t\t];\n\t}", "public function goodGRidsEncoded(): array\n\t{\n\t\treturn [\n\t\t\t'A12425GABC1234002M',\n\t\t\t'A1-2425G-ABC1234002-M',\n\t\t\t'A12425GXYZ98760086',\n\t\t\t'A1-2425G-XYZ9876008-6',\n\t\t\t'A12425G1234567890L',\n\t\t\t'A1-2425G-1234567890-L',\n\t\t];\n\t}", "function gb2u($str){\n return mb_convert_encoding($str,'UTF-8','GBK');\n}", "function UTF8_to_unicode_array( $utf8_text )\r\n{\r\n // Create an array to receive the unicode character numbers output\r\n $output = array( );\r\n\r\n // Cycle through the characters in the UTF-8 string\r\n for ( $pos = 0; $pos < strlen( $utf8_text ); $pos++ )\r\n {\r\n // Retreive the current numerical character value\r\n $chval = ord($utf8_text[$pos]);\r\n\r\n // Check what the first character is - it will tell us how many bytes the\r\n // Unicode value covers\r\n\r\n if ( ( $chval >= 0x00 ) && ( $chval <= 0x7F ) )\r\n {\r\n // 1 Byte UTF-8 Unicode (7-Bit ASCII) Character\r\n $bytes = 1;\r\n $outputval = $chval; // Since 7-bit ASCII is unaffected, the output equals the input\r\n }\r\n else if ( ( $chval >= 0xC0 ) && ( $chval <= 0xDF ) )\r\n {\r\n // 2 Byte UTF-8 Unicode\r\n $bytes = 2;\r\n $outputval = $chval & 0x1F; // The first byte is bitwise ANDed with 0x1F to remove the leading 110b\r\n }\r\n else if ( ( $chval >= 0xE0 ) && ( $chval <= 0xEF ) )\r\n {\r\n // 3 Byte UTF-8 Unicode\r\n $bytes = 3;\r\n $outputval = $chval & 0x0F; // The first byte is bitwise ANDed with 0x0F to remove the leading 1110b\r\n }\r\n else if ( ( $chval >= 0xF0 ) && ( $chval <= 0xF7 ) )\r\n {\r\n // 4 Byte UTF-8 Unicode\r\n $bytes = 4;\r\n $outputval = $chval & 0x07; // The first byte is bitwise ANDed with 0x07 to remove the leading 11110b\r\n }\r\n else if ( ( $chval >= 0xF8 ) && ( $chval <= 0xFB ) )\r\n {\r\n // 5 Byte UTF-8 Unicode\r\n $bytes = 5;\r\n $outputval = $chval & 0x03; // The first byte is bitwise ANDed with 0x03 to remove the leading 111110b\r\n }\r\n else if ( ( $chval >= 0xFC ) && ( $chval <= 0xFD ) )\r\n {\r\n // 6 Byte UTF-8 Unicode\r\n $bytes = 6;\r\n $outputval = $chval & 0x01; // The first byte is bitwise ANDed with 0x01 to remove the leading 1111110b\r\n }\r\n else\r\n {\r\n // Invalid Code - do nothing\r\n $bytes = 0;\r\n }\r\n\r\n // Check if the byte was valid\r\n if ( $bytes !== 0 )\r\n {\r\n // The byte was valid\r\n\r\n // Check if there is enough data left in the UTF-8 string to allow the\r\n // retrieval of the remainder of this unicode character\r\n if ( $pos + $bytes - 1 < strlen( $utf8_text ) )\r\n {\r\n // The UTF-8 string is long enough\r\n\r\n // Cycle through the number of bytes required,\r\n // minus the first one which has already been done\r\n while ( $bytes > 1 )\r\n {\r\n $pos++;\r\n $bytes--;\r\n\r\n // Each remaining byte is coded with 6 bits of data and 10b on the high\r\n // order bits. Hence we need to shift left by 6 bits (0x40) then add the\r\n // current characer after it has been bitwise ANDed with 0x3F to remove the\r\n // highest two bits.\r\n $outputval = $outputval*0x40 + ( (ord($utf8_text[$pos])) & 0x3F );\r\n }\r\n\r\n // Add the calculated Unicode number to the output array\r\n $output[] = $outputval;\r\n }\r\n }\r\n\r\n }\r\n\r\n // Return the resulting array\r\n return $output;\r\n}", "function MakeUnicodeArray($map)\r\n{\r\n\t$ranges = array();\r\n\tforeach($map as $c=>$v)\r\n\t{\r\n\t\t$uv = $v['uv'];\r\n\t\tif($uv!=-1)\r\n\t\t{\r\n\t\t\tif(isset($range))\r\n\t\t\t{\r\n\t\t\t\tif($c==$range[1]+1 && $uv==$range[3]+1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$range[1]++;\r\n\t\t\t\t\t$range[3]++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$ranges[] = $range;\r\n\t\t\t\t\t$range = array($c, $c, $uv, $uv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$range = array($c, $c, $uv, $uv);\r\n\t\t}\r\n\t}\r\n\t$ranges[] = $range;\r\n\r\n\tforeach($ranges as $range)\r\n\t{\r\n\t\tif(isset($s))\r\n\t\t\t$s .= ',';\r\n\t\telse\r\n\t\t\t$s = 'array(';\r\n\t\t$s .= $range[0].'=>';\r\n\t\t$nb = $range[1]-$range[0]+1;\r\n\t\tif($nb>1)\r\n\t\t\t$s .= 'array('.$range[2].','.$nb.')';\r\n\t\telse\r\n\t\t\t$s .= $range[2];\r\n\t}\r\n\t$s .= ')';\r\n\treturn $s;\r\n}", "function utf16be_to_utf8(&$str) {\r\n $uni = unpack('n*',$str);\r\n return unicode_to_utf8($uni);\r\n }", "function textToArray($text)\n {\n $ar = array_slice(unpack(\"C*\", \"\\0\".$text), 1);\n return $ar;\n }", "function radius_cvt_string ($data) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an order from the ACP Order Screen
function createFromOrderScreen() { global $_POST, $dbConn; $basket = new Cart(); //This iterates over each item in the order items row until a row is not defined, which marks the end of the table for ($i=1; isset($_POST['item'.$i.'ID']); $i++) { //This order item row exists, create an item in the cart based on this //Skip this row if the item's quantity is 0 if ($_POST['item'.$i.'Qty'] == 0) continue; //Skip Final ID if ($_POST['item'.$i.'ID'] == '') continue; //Pull the price from the post form in case the user has set a custom price $basket->addItem($_POST['item'.$i.'ID'], $_POST['item'.$i.'Qty'], floatval(str_replace('&pound;','',$_POST['item'.$i.'Price']))); } //Iterate through coupons and create a reference to each one //TODO: The system does not currently apply the actions on the server for ($i=1; isset($_POST['coupon'.$i.'Key']); $i++) { $result = $dbConn->query('SELECT id FROM keys WHERE `key` = "'.$_POST['coupon'.$i.'Key'].'" LIMIT 1'); $result = $dbConn->fetch($result); $keyID = $result['id']; unset($result); $basket->addKey($keyID); } //Set whether VAT has been applied to this order $basket->applyVAT(!isset($_POST['vatExempt'])); //Set up the customer for the billing address if ($_POST['billingID'] != "New") { //The customer already exists. Just use that $billing = new Customer($_POST['billingID']); } else { //The customer is new, create an ID for them now $billing = new Customer(); $billing->populate($_POST['customerBillingName'], $_POST['customerBillingAddress1'], $_POST['customerBillingAddress2'], $_POST['customerBillingAddress3'], $_POST['customerBillingPostcode'], $_POST['customerBillingCountry'], NULL, //TODO: Add Email support NULL, 1 //TODO: Contact Opt-out ); } //Check if the shipping address is configured if (isset($_POST['noShipping'])) { //The shipping address is the same as billing. Just take from there $shipping = @$billing; //@ Saves memory by using an alias } else { //The shipping address is different. Load it the same as before if ($_POST['shippingID'] != "New") { //The customer already exists. Just use that $shipping = new Customer($_POST['shippingID']); } else { //The customer is new, create an ID for them now $shipping = new Customer(); $shipping->populate($_POST['customerShippingName'], $_POST['customerShippingAddress1'], $_POST['customerShippingAddress2'], $_POST['customerShippingAddress3'], $_POST['customerShippingPostcode'], $_POST['customerShippingCountry'], NULL, //TODO: Add Email support NULL, 1 //TODO: Contact Opt-out ); } } //That's all the data passed. Create the Order. $basketID = $basket->getID(); $orderStatus = $_POST['orderStatus']; $basket->__destruct(); //Force call for PHP4 unset($basket); $billingID = $billing->getID(); $shippingID = $shipping->getID(); $billing->__destruct(); $shipping->__destruct(); unset($billing,$shipping); //Unset after due to potential alias $dbConn->query('INSERT INTO orders (basket,status,billing,shipping,assignedTo) VALUES ('.$basketID.',"'.$orderStatus.'",'.$billingID.','.$shippingID.','.$GLOBALS['acp_uid'].')'); return new Order($dbConn->insert_id()); }
[ "public function createOrderAction(){\n\t\tif (!$this->_loadValidSubscription()) {\n\t\t\treturn;\n\t\t}\n\t\t$subscription = Mage::registry('current_subscription');\n\n\t\t$this->createOrder($subscription);\n\t}", "public function createOrder()\n {\n\n $cart = $this->options['user']->getCart();\n // Fill in client ID from current cart\n $params['clientid'] = $cart->getClientId();\n // Get payment method from submitted form\n $params['paymentmethod'] = $this->getValue('payment_method');\n $productIndex = 0;\n foreach ($cart->getCartProducts() as $cartProduct)\n {\n // Get params for each of cart products\n $productParams = $this->generateProductsParams($cartProduct);\n foreach ($productParams as $productParamKey => $productParamValue)\n {\n // Save params with appended product index\n $params[$productParamKey . \"[$productIndex]\"] = $productParamValue;\n }\n $productIndex++;\n }\n // Execute order creation method from WHMCS Connection object\n return PluginWhmcsConnection::initConnection()->createOrder($params);\n }", "public function createOrder()\n {\n }", "public function createOrder() {\n\n\t if(!$this->getOrderid()){\n\t\t\t\n\t\t\t$theOrder = Orders::create ( $this->getCustomerId(), Statuses::id('tobepaid', 'orders'), null );\n\t\n\t\t\t// For each item in the cart\n\t\t\tforeach ($this->getItems() as $item){\n\t\t\t\t$item = Orders::addOrderItem ($item);\n\t\t\t}\n\t\t\t\n\t\t\t$this->setOrderid($theOrder['order_id']);\n\t\t\t\n\t\t\t// Send the email to confirm the order\n\t\t\tOrders::sendOrder ( $theOrder['order_id'] );\n\t\t\t\n\t\t\treturn Orders::getOrder();\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\treturn Orders::find($this->getOrderid());\n\t\t}\n\t\t\n\t}", "public function actionPlaceOrder()\n {\n return new Order(['id' => 666]);\n }", "public function creating(Order $order)\n {\n\n }", "function createOrder(){\n\t\t$order = new Order();\n\t\t$order->write();\n\t\t$item1a = $this->mp3player->createItem(2);\n\t\t$item1a->write();\n\t\t$order->Items()->add($item1a);\n\t\t$item1b = $this->socks->createItem();\n\t\t$item1b->write();\n\t\t$order->Items()->add($item1b);\n\t\t\n\t\t$payment = new Payment();\n\t\t$payment->OrderID = $order->ID;\n\t\t$payment->AmountAmount = 200;\n\t\t$payment->AmountCurrency = 'USD';\n\t\t$payment->Status = 'Success';\n\t\t$payment->write();\n\t\t\n\t\t$order->calculate();\n\t\t$order->write();\n\t\treturn $order;\n\t}", "public function createNewOrder(): \\BtcRelax\\Model\\Order\n {\n $vAM = \\BtcRelax\\Core::createAM();\n $pUser = $vAM->getUser();\n $newOrder = new \\BtcRelax\\Model\\Order();\n $newOrder->createNew($pUser);\n $this->setCurrentOrder($newOrder);\n return $newOrder;\n }", "public function createFromOrder()\n {\n // Create proto\n if (Mage::app()->getRequest()->getParam('create_ticket')) {\n $order = Mage::getModel('sales/order')->load(Mage::app()->getRequest()->getParam('order_id'));\n\n $history = Mage::app()->getRequest()->getPost();\n $history = @$history['history'];\n\n $proto = Mage::getModel('helpdeskultimate/proto')\n ->setSubject(Mage::helper('helpdeskultimate')->__('Order #%s', $order->getIncrementId()))\n ->setContent(trim(@$history['comment']))\n ->setContentType('text/plain')\n ->setFrom($order->getCustomerEmail())\n ->setStatus(AW_Helpdeskultimate_Model_Proto::STATUS_PENDING)\n ->setStoreId($order->getStoreId())\n ->setSource('order')\n ->setCreatedBy(AW_Helpdeskultimate_Model_Ticket::CREATED_BY_ADMIN)\n ->setOrderId($order->getId());\n try {\n $proto->save();\n if ($proto->canBeConvertedToMessage()) {\n $proto->convertToMessage();\n } else {\n $proto->convertToTicket();\n }\n $proto->setStatus(AW_Helpdeskultimate_Model_Proto::STATUS_PROCESSED)->save();\n }\n catch (Exception $e) {\n $this->log(\"Error occuring when create ticket from order: {$e->getMessage()}\");\n $proto->setStatus(AW_Helpdeskultimate_Model_Proto::STATUS_FAILED)->save();\n }\n }\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}", "public function placeOrder() {\n $body = $this->objectConverter->convert($_POST, Order::CLASS);\n $this->storeService->placeOrder($body);\n }", "public function make()\n {\n $order = (new Entities\\Order)\n ->setTotalDiscount(1050)\n ->setCustomer(\n (new Entities\\Person)->setIdentifiers(collect([\n 'ap21_id' => 745619\n ]))\n );\n\n $order->getContacts()->push(\n (new Entities\\Contact)\n ->setType('email')\n ->setValue('bob@example.com')\n );\n\n $order->getAddresses()->push(\n (new Entities\\Address)\n ->setType('billing')\n ->setLine1('101 Cremorne St')\n ->setCity('Melbourne')\n ->setState('VIC')\n ->setPostcode('3183')\n ->setCountry('AU')\n );\n\n $order->getAddresses()->push(\n (new Entities\\Address)\n ->setType('delivery')\n ->setLine1('200 Swan St')\n ->setCity('Melbourne')\n ->setState('VIC')\n ->setPostcode('3183')\n ->setCountry('AU')\n );\n\n $order->getPayments()->push(\n (new Entities\\Payment)\n ->setIdentifiers(collect([\n 'ap21_settlement' => '20111129',\n 'ap21_reference' => 'Ref1',\n ]))\n ->setAttributes(collect([\n 'card_type' => 'Visa',\n 'auth_code' => '1234',\n 'message' => 'payment_statusCURRENTbank_'\n ]))\n ->setType('CreditCard')\n ->setAmount(6190)\n );\n\n $order->getLineItems()->push(\n (new Entities\\LineItem)\n ->setQuantity(1)\n ->setTotal(5990)\n ->setDiscount(\n collect([\n 'DiscountTypeId' => 1,\n 'Value' => 1050\n ])\n )\n ->setSellable(\n (new Entities\\Variant)\n ->setIdentifiers(collect([\n 'ap21_sku_id' => 9876\n ]))\n ->setPrice(5990)\n )\n );\n\n $order->setFreightOption(\n (new Entities\\FreightOption)\n ->setId(123)\n ->setName('Express Australia Post')\n ->setValue(1250)\n );\n\n return $order;\n }", "public function _createOrder()\n {\n $this->_helper->log(\"=========In _createOrder=========\");\n try {\n $orderToken = \"\";\n //getting Magic posted data\n $orderData = $this->getRequest()->getParams();\n $this->_helper->log($orderData);\n //get current quote\n if ($this->getCheckoutSession()->getMagicMode() == \"cart\") {\n $cartId = $this->getCheckoutSession()->getMagicCartId();\n } elseif ($this->getCheckoutSession()->getMagicMode() == \"product\") {\n $cartId = $this->getCheckoutSession()->getMagicQuoteId();\n }\n if (isset($cartId)) {\n $quote = $this->getQuoteById($cartId);\n } else {\n $quote = $this->getCheckoutSession()->getQuote();\n }\n if ($this->getCheckoutSession()->getMagicMode() == \"product\") {\n $quote->setIsActive(1)->save();\n }\n\n //Setting selected shipping method in quote at last moment to make sure we have correct one\n if (isset($orderData[\"OrderRequest\"][\"shipping\"][\"shippingMethod\"][\"token\"]) && isset($orderData[\"OrderRequest\"][\"shipping\"][\"shippingMethod\"][\"token\"]) != \"\") {\n $this->setShippingMethodInCreateOrder($quote, $orderData[\"OrderRequest\"][\"shipping\"][\"shippingMethod\"][\"token\"]);\n }\n\n $customerEmail = (isset($orderData[\"OrderRequest\"][\"email\"])) ? $orderData[\"OrderRequest\"][\"email\"] : \"\";\n //load existing customer or treat as guest user and also check if customer has default billing address or not\n $defaultBillingAddressId = $this->prepareCustomer($quote, $customerEmail);\n\n //updating quote shipping/billing address with magic data\n $this->updateCustomerAddressWithMagicData($orderData, $quote, $defaultBillingAddressId);\n\n //reserve order ID\n $quote->reserveOrderId();\n $quote->save();\n $merchantReferenceQuoteId = $quote->getReservedOrderId();\n\n $this->_helper->log(\"merchantReferenceQuoteId: \" . $merchantReferenceQuoteId);\n\n $this->_helper->log(\"shippingNotes: \" . $$orderData[\"OrderRequest\"][\"shipping\"][\"address\"][\"notes\"]);\n\n $this->_helper->log(\"billingNotes: \" . $orderData[\"OrderRequest\"][\"billing\"][\"address\"][\"notes\"]);\n\n //merchant order created successfully\n if ($merchantReferenceQuoteId) {\n //get order notes\n $shippingNotes = (isset($orderData[\"OrderRequest\"][\"shipping\"][\"address\"][\"notes\"])) ? $orderData[\"OrderRequest\"][\"shipping\"][\"address\"][\"notes\"] : \"shi[pping notes are here\";\n $billingNotes = (isset($orderData[\"OrderRequest\"][\"billing\"][\"address\"][\"notes\"])) ? $orderData[\"OrderRequest\"][\"billing\"][\"address\"][\"notes\"] : \"billinging notes are here\";\n //save order notes in session for later update in order\n $this->getCheckoutSession()->setShippingNotes($shippingNotes);\n $this->getCheckoutSession()->setBillingNotes($billingNotes);\n\n\n //create Magic order\n $this->_helper->log(\"Before Magic order\");\n $this->_helper->log(\"getQuote: ID Before Magic order\" . $quote->getId());\n $orderData = $this->createMagicOrder($quote, $orderData);\n $this->_helper->log(\"getQuote: ID after Magic order\" . $quote->getId());\n $this->_helper->log(\"After Magic order\");\n $this->_helper->log($orderData);\n\n if ($orderData[\"magicOrderToken\"] == \"\") {\n $this->getCheckoutSession()->unsMagicCartId();\n $this->getCheckoutSession()->unsMagicQuoteId();\n $response = $this->_helper->handleErrors(self::CREATE_MAGIC_ORDER_ERROR);\n } else {\n $this->_helper->log(\"Magic order Created Successfully\");\n $response = ['error' => false, 'message' => $orderData];\n }\n\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n $result = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n } else {\n $this->getCheckoutSession()->unsMagicCartId();\n $this->getCheckoutSession()->unsMagicQuoteId();\n $this->getCheckoutSession()->unsMagicCartId();\n $response = $this->_helper->handleErrors(self::CREATE_ORDER_ERROR);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n $result = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n $this->_helper->log(\"Order Exception : There was a problem with order creation.\");\n }\n } catch (LocalizedException $e) {\n $this->getCheckoutSession()->unsMagicCartId();\n $this->getCheckoutSession()->unsMagicQuoteId();\n $response = $this->_helper->handleErrors(self::CREATE_ORDER_ERROR);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n $result = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n $this->_helper->log(\"_confirm : Transaction LocalizedException: \" . $e->getMessage());\n } catch (Exception $e) {\n $this->getCheckoutSession()->unsMagicCartId();\n $this->getCheckoutSession()->unsMagicQuoteId();\n $response = $this->_helper->handleErrors(self::CREATE_ORDER_ERROR);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n $result = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n $this->_helper->log(\"_confirm : Transaction Exception: \" . $e->getMessage());\n }\n if ($this->getCheckoutSession()->getMagicMode() == \"product\") {\n $quote->setIsActive(0)->save();\n }\n\n return $result;\n }", "private function storeOrder(): void\n {\n $session = Model::getSession();\n\n // Save the addresses\n $createAddress = $session->get('guest_address')->toCommand();\n $createShipmentAddress = $session->get('guest_shipment_address')->toCommand();\n\n $this->get('command_bus')->handle($createAddress);\n $this->get('command_bus')->handle($createShipmentAddress);\n\n $shipmentMethod = $session->get('shipment_method');\n $paymentMethod = $session->get('payment_method');\n\n // Recalculate order\n $this->cart->calculateTotals();\n\n // Some variables we need later\n $cartTotal = $this->cart->getTotal();\n $vats = $this->cart->getVats();\n\n // Add shipment method to order\n if ($shipmentMethod['data']['vat']) {\n $cartTotal += $shipmentMethod['data']['price'];\n $cartTotal += $shipmentMethod['data']['vat']['price'];\n\n if (!array_key_exists($shipmentMethod['data']['vat']['id'], $vats)) {\n $vat = $this->getVat($shipmentMethod['data']['vat']['id']);\n $vats[$vat->getId()] = [\n 'title' => $vat->getTitle(),\n 'total' => 0,\n ];\n }\n\n $vats[$shipmentMethod['data']['vat']['id']]['total'] += $shipmentMethod['data']['vat']['price'];\n }\n\n // Order\n $createOrder = new CreateOrder();\n $createOrder->sub_total = $this->cart->getSubTotal();\n $createOrder->total = $cartTotal;\n $createOrder->paymentMethod = $this->getPaymentMethods()[$paymentMethod->payment_method]['label'];\n $createOrder->invoiceAddress = $createAddress->getOrderAddressEntity();\n $createOrder->shipmentAddress = $createShipmentAddress->getOrderAddressEntity();\n $createOrder->shipment_method = $shipmentMethod['data']['name'];\n $createOrder->shipment_price = $shipmentMethod['data']['price'];\n\n $this->get('command_bus')->handle($createOrder);\n\n // Vats\n foreach ($vats as $vat) {\n $createOrderVat = new CreateOrderVat();\n $createOrderVat->title = $vat['title'];\n $createOrderVat->total = $vat['total'];\n $createOrderVat->order = $createOrder->getOrderEntity();\n\n $this->get('command_bus')->handle($createOrderVat);\n\n $createOrder->addVat($createOrderVat->getOrderVatEntity());\n }\n\n // Products\n foreach ($this->cart->getValues() as $product) {\n $createOrderProduct = new CreateOrderProduct();\n $createOrderProduct->sku = $product->getProduct()->getSku();\n $createOrderProduct->title = $product->getProduct()->getTitle();\n $createOrderProduct->price = $product->getProduct()->getPrice();\n $createOrderProduct->amount = $product->getQuantity();\n $createOrderProduct->total = $product->getTotal();\n $createOrderProduct->order = $createOrder->getOrderEntity();\n\n $this->get('command_bus')->handle($createOrderProduct);\n\n $createOrder->addProduct($createOrderProduct->getOrderProductEntity());\n }\n\n // Start the payment\n $paymentMethod = $this->getPaymentMethod($session->get('payment_method')->payment_method);\n $paymentMethod->setOrder($createOrder->getOrderEntity());\n $paymentMethod->setData($session->get('payment_method'));\n $paymentMethod->prePayment();\n }", "public function createTaskOrderAction()\n {\n $params = array();\n\n $params['hotelid'] = $this->getHotelId();\n $params['task_id'] = $this->getPost('taskid');\n $params['user_id'] = $this->getPost('userid');\n $params['room_no'] = $this->getPost('roomno');\n $params['admin_id'] = $this->getPost('adminid');\n $params['memo'] = $this->getPost('memo');\n\n $params['status'] = ServiceModel::TASK_ORDER_STATUS_OPEN;\n $params['count'] = $this->getPost('count') ? intval($this->getPost('count')) : 1;\n\n $result = $this->_serviceModel->saveTaskOrder($params);\n $this->echoJson($result);\n }", "private function createOrder(): void\n {\n try {\n $orderRequest = $this->orderBuilder->buildOrderRequestBase($this->checkoutSession->getQuote());\n $orderRequest->setCustomer(\n $this->orderBuilder->buildCustomer($this->checkoutSession->getQuote())\n ->setUser($this->hokodoQuote->getUserId())\n ->setOrganisation($this->hokodoQuote->getOrganisationId())\n );\n if ($this->config->getValue(Config::TOTALS_FIX)) {\n $items[] = $this->orderBuilder->buildTotalItem($this->checkoutSession->getQuote());\n } else {\n $items = $this->orderBuilder->buildOrderItems($this->checkoutSession->getQuote());\n }\n $orderRequest->setItems($items);\n if ($dataModel = $this->orderGatewayService->createOrder($orderRequest)->getDataModel()) {\n $this->hokodoQuote->setOrderId($dataModel->getId());\n $this->hokodoQuote->setOfferId('');\n $this->hokodoQuoteRepository->save($this->hokodoQuote);\n } else {\n throw new NotFoundException(__('No order found in API response'));\n }\n } catch (\\Exception $e) {\n $data = [\n 'message' => 'Hokodo_BNPL: createOrder call failed with error',\n 'error' => $e->getMessage(),\n ];\n $this->logger->error(__METHOD__, $data);\n throw new Exception(\n __($e->getMessage())\n );\n }\n }", "public function createOrderPaymentManually()\r\n {\r\n $wishlist_id = $this->inputfilter->clean($this->app->get('PARAMS.id'), 'alnum');\r\n \r\n $flash = \\Dsc\\Flash::instance();\r\n \r\n $this->app->set('meta.title', 'Payment | Create Order from Wishlist | Shop');\r\n \r\n $item = $this->getItem();\r\n $this->app->set('wishlist', $item);\r\n \r\n $this->app->set('manual_payment', true);\r\n \r\n $view = $this->theme;\r\n $view->event = $view->trigger('onShopCreateOrderPaymentManually', array(\r\n 'item' => $item,\r\n 'tabs' => array(),\r\n 'content' => array()\r\n ));\r\n echo $view->render('Shop/Admin/Views::wishlists/create_order_payment.php');\r\n }", "public function testCreateOrder()\n {\n $this->assertTrue(ShipmentsHelper::isLogisticModeEnabled());\n //====================================================================//\n // Create a New Order\n $customer = $this->getOrCreateCustomer();\n $this->getOrCreateAddress($customer);\n $order = $this->createOrder($customer, $this->getOrCreateProduct());\n //====================================================================//\n // Verify New Order\n $this->assertNotEmpty($order->getEntityId());\n $this->assertEquals(Order::STATE_NEW, $order->getState());\n $this->assertEquals(\"OrderDraft\", OrderStatusHelper::toSplash((string) $order->getState()));\n //====================================================================//\n // Load Splash Order Manager\n /** @var SplashOrder $splashOrder */\n $splashOrder = Splash::object(\"Order\");\n $this->assertInstanceOf(SplashOrder::class, $splashOrder);\n\n //====================================================================//\n // Mark Order as Processing\n $this->assertNotEmpty(\n $splashOrder->set($order->getId(), array(\"state\" => SplashStatus::PROCESSING))\n );\n //====================================================================//\n // Verify Order\n $processingOrder = $splashOrder->load($order->getId());\n $this->assertInstanceOf(Order::class, $processingOrder);\n $this->assertEquals(Order::STATE_PROCESSING, $processingOrder->getState());\n\n //====================================================================//\n // Mark Order as In Transit\n $trackingNumber = uniqid(\"track_\");\n $this->assertNotEmpty(\n $splashOrder->set($order->getId(), array(\n \"state\" => SplashStatus::IN_TRANSIT,\n \"track_number\" => $trackingNumber,\n ))\n );\n //====================================================================//\n // Verify Order\n $completeOrder = $splashOrder->load($order->getId());\n $this->assertInstanceOf(Order::class, $completeOrder);\n $this->assertEquals(Order::STATE_COMPLETE, $completeOrder->getState());\n //====================================================================//\n // Verify Order Tracking Number\n $trackingOrder = $splashOrder->get($order->getId(), array(\"track_number\"));\n $this->assertIsArray($trackingOrder);\n $this->assertArrayHasKey(\"track_number\", $trackingOrder);\n $this->assertEquals($trackingNumber, $trackingOrder[\"track_number\"]);\n\n //====================================================================//\n // Mark Order as Delivered\n $this->assertNotEmpty(\n $splashOrder->set($order->getId(), array(\"state\" => SplashStatus::DELIVERED))\n );\n //====================================================================//\n // Verify Order\n $deliveredOrder = $splashOrder->load($order->getId());\n $this->assertInstanceOf(Order::class, $deliveredOrder);\n $this->assertEquals(Order::STATE_CLOSED, $deliveredOrder->getState());\n }", "public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->order_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a tbody object with "form.calculation_act.row.html" rows
public function html_act_tbody($i, $records, $valid_rules, $model_article, $model_calculation) { $rows = array(); $ii= 1; foreach($records as $record){ $rows[] = $this->html_act_row($i, $ii, $record, $valid_rules, $model_article, $model_calculation); $ii++; } return $this->wrapTag('tbody',$rows); }
[ "private function generateRows()\n {\n $this->rows = array();\n\n // empty row for cloneable js\n $this->addRow();\n\n $values = $this->getForm()->getValue($this->getName());\n\n if (is_array($values) && count($values)) {\n foreach ($values As $key => $rowValues) {\n $this->currentRowIndex = $key;\n $this->addRow($rowValues);\n }\n } else {\n $this->addRow();\n }\n }", "private function getTableDataRows()\n {\n $calculatorData = $this->calculatorData;\n $instalmentsNumber = $this->instalmentsNumber;\n\n $result = '';\n\n ob_start();\n\n ?>\n <?php foreach ($this->tableDataRowHeaders as $key => $header) : ?>\n <?php $class = ''; ?>\n <tr>\n <?php if ('totalValue' === $key) {\n $class = 'font-weight-bold';\n } ?>\n <td class=\"<?= $class ?>\"><?php echo $this->getRowHeaderValue($key) ?></td>\n\n <td class=\"text-right <?= $class ?> \"><?php echo number_format($calculatorData[$key], 2, ',', ' ') ?></td>\n <?php if ($instalmentsNumber > 1) : ?>\n <?php for ($i = 1; $i <= $instalmentsNumber; $i++) : ?>\n <td class=\"text-right\"><?php echo $this->getInstalmentValue($key, $i === 1); ?>\n </td>\n <?php endfor; ?>\n <?php endif; ?>\n </tr>\n\n <?php endforeach; ?>\n <?php\n\n $result = ob_get_contents();\n ob_clean();\n return $result;\n }", "public function create_tbody($data){\n $this->tablehtml .= \" <tbody>\".\"\\n\";\n foreach ($data as $row) { // loops through all rows\n $this->tablehtml .= \" <tr>\".\"\\n\";\n foreach($row as $key=>$value) { // loops through all columns of a row\n $this->tablehtml .= \" <td>\".$value.\"</td>\".\"\\n\"; // adds a value to a column in a row\n }\n $this->tablehtml .=\" </tr>\".\"\\n\";\n } // end foreach\n $this->tablehtml .= \" </tbody>\".\"\\n\";\n }", "public function getTbody()\n {\n $count = Cart::instance('shopping')->count();\n if ($count) {\n $empty = false;\n $tbody = \"\";\n foreach (Cart::instance('shopping')->content() as $row) {\n $tbody .= \"<tr>\";\n $tbody .= \"<input type='hidden' name='id[]' value='$row->id'>\";\n $tbody .= \"<td><div class='form-group'><input name='cartCheck[]' id='check\";\n $tbody .= $row->id.\"' type='checkbox' value='$row->id'></div></td>\";\n $img = Presenter::smallimg(Voyager::image($row->options->image));\n $tbody .= \"<td><a href='\".url('bookstore/book/'.$row->id).\"' target='_blank'>\";\n $tbody .= \"<img class='img-thumbnail' src='$img' alt='$row->name' style='width:100px'></a></td>\";\n $tbody .= \"<td><a href='\".url('bookstore/book/'.$row->id).\"' target='_blank'>$row->name</a></td>\";\n $tbody .= \"<td>\".$row->options->list_price.\"元</td>\";\n $tbody .= \"<td><span class='deeporange-color'>\".$row->options->discount;\n $tbody .= \"折</span><br>\".$row->price.\"元</td>\";\n $tbody .= \"<td><div id='quantity_\".$row->id.\"' class='form-group'>\";\n $tbody .= \"<input aria-label='數量' name='book_quantity[]' data-id='\".$row->id.\"' \";\n $tbody .= \"type='text' value='$row->qty' style='width:100px'>\";\n $tbody .= Presenter::findBookStock($row->id);\n $tbody .= \"<input type='hidden' id='stock_\".$row->id;\n $tbody .= \"' value='\".Presenter::findBookStockVal($row->id).\"'>\";\n $tbody .= \"<label class='sr-only'>\".$row->name.\"</label>\";\n $tbody .= \"</div></td>\";\n $subtotal = $row->price * $row->qty;\n $tbody .= \"<td>\".$subtotal.\"元</td>\";\n $tbody .= \"<td><button type='button' id='del_\".$row->id.\"' \";\n $tbody .= \"data-id='\".$row->id.\"' class='btn'>刪除</button></td>\";\n $tbody .= \"</tr>\";\n }\n } else {\n $tbody = \"<tr><td colspan='8'><div class='text-center'><b>購物車無商品</b></div></td></tr>\";\n $empty = true;\n }\n\n return compact('count', 'tbody', 'empty');\n }", "function form_table( $rows ) {\n\t\t\t$content = '<table class=\"form-table\">';\n\t\t\t$i = 1;\n\t\t\tforeach ( $rows as $row ) {\n\t\t\t\t$class = '';\n\t\t\t\tif ( $i > 1 ) {\n\t\t\t\t\t$class .= 'yst_row';\n\t\t\t\t}\n\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t$class .= ' even';\n\t\t\t\t}\n\t\t\t\t$content .= '<tr id=\"' . $row['id'] . '_row\" class=\"' . $class . '\"><th valign=\"top\" scrope=\"row\">';\n\t\t\t\tif ( isset( $row['id'] ) && $row['id'] != '' )\n\t\t\t\t\t$content .= '<label for=\"' . $row['id'] . '\">' . $row['label'] . ':</label>';\n\t\t\t\telse\n\t\t\t\t\t$content .= $row['label'];\n\t\t\t\t$content .= '</th><td valign=\"top\">';\n\t\t\t\t$content .= $row['content'];\n\t\t\t\t$content .= '</td></tr>';\n\t\t\t\tif ( isset( $row['desc'] ) && !empty( $row['desc'] ) ) {\n\t\t\t\t\t$content .= '<tr class=\"' . $class . '\"><td colspan=\"2\" class=\"yst_desc\"><small>' . $row['desc'] . '</small></td></tr>';\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$content .= '</table>';\n\t\t\treturn $content;\n\t\t}", "public function create_html_table()\n {\n echo \"<table>\";\n\n //lay down the header row\n echo \"<tr>\";\n //header names are stored here; display them\n for($i=0; $i<sizeof($this->col_names); $i++)\n {\n\n echo \"<th>\".$this->col_name_map[$this->col_names[$i]].\"</th>\";\n }\n //done with the header row\n echo \"</tr>\";\n //now will add rows to the table the header names are keys to the second dimension of $row_values_arr\n $this->add_rows_to_table();\n //close this table\n echo \"</table>\";\n }", "public function getHTML() {\n\t\t$html='<table';\n\t\tif ($this->title!==null){\n\t\t\t$html.= ' title=\"'.$this->title.'\"';\n\t\t} \t\t\n\t\t$html.='>'.PHP_EOL;\n\t \n\t\t// Add a header row with the headings\n\t\t$html .= \"<tr>\";\n\t\tforeach ($this->headings as $field=>$value) {\n\t\t\t$html .=\"<th class=\\\"$field\\\">$value</th>\";\n\t\t}\n\t\t$html .= '</tr>'.PHP_EOL;;\n\n\t\t// add a detail row for each row in the recordset\n\t\t$rowClass=\"odd\"; // odd if odd numbered row, else even\n\t\tforeach ($this->resultSet as $row){\n\t\t\t$html .='<tr class=\"'.$rowClass.'\">'; \n\t\t\tforeach ($this->templates as $field=>$template) {\n\t\t\t\t$html .='<td class=\"'.$field.'\">';\n\t\t\t\t$html .=$this->applyTemplate($row, $field, $template); \n\t\t\t\t$html .='</td>'; \n\t\t\t}\n\t\t\t$html .= \"</tr>\".PHP_EOL;\n\t\t\t$rowClass =($rowClass == 'odd') ? 'even' : 'odd'; \n\t\t}\n\t\treturn $html.'</table>'.PHP_EOL ;\n\t}", "protected function generateTableBodyRows()\n\t{\n\t\tforeach($this->data as $row)\n\t\t{\n\t\t\t$this->table .= '<tr>';\n\n\t\t\t$this->generateTableBodyRowCells($row);\n\n\t\t\t$this->table .= '</tr>';\n\t\t}\n\t}", "protected function getFormTableContent() {\n $s_style = 'font-size:' . $this->_emailFontSize . '; font-family:' . $this->_emailFontFamily . ';';\n $bgCol1 = '#FFFFFF';\n $bgCol2 = '#e4edf9';\n $bgColDarkerBG = '#cddaeb';\n $colOutline = '#8a99ae';\n $rowCount = 0;\n $s_ret = '<table cellpadding=\"5\" cellspacing=\"0\" style=\"' . $s_style . '\">';\n foreach ($this->_formElements as $o_el) {\n if (is_object($o_el)===false) {\n //do nothing.. this is a simple text element for form html block etc.\n } else {\n if ($o_el->showInEmail() === true) {\n\n $bgCol = $bgCol1;\n if ($rowCount % 2 == 0) {\n $bgCol = $bgCol2;\n }\n\n $elType = get_class($o_el);\n $elId = $o_el->getId();\n\n switch ($elType) {\n case 'JsonFormBuilder_elementMatrix':\n $type = $o_el->getType();\n $cols = $o_el->getColumns();\n $rows = $o_el->getRows();\n $r_cnt = 0;\n $s_val = '<table cellpadding=\"5\" cellspacing=\"0\" style=\"' . $s_style . ' font-size:10px;\"><tr><td>&nbsp;</td>';\n $c_cnt = 0;\n foreach ($cols as $column) {\n $s_val.='<td style=\"' . ($c_cnt == 0 ? 'border-left:1px solid ' . $colOutline . '; ' : '') . 'background-color:' . $bgColDarkerBG . '; border-right:1px solid ' . $colOutline . '; border-bottom:1px solid ' . $colOutline . '; border-top:1px solid ' . $colOutline . ';\"><em>' . htmlspecialchars($column) . '</em></td>';\n $c_cnt++;\n }\n $s_val.='</tr>';\n foreach ($rows as $row) {\n $c_cnt = 0;\n $s_val.='<tr><td style=\"' . ($r_cnt == 0 ? 'border-top:1px solid ' . $colOutline . '; ' : '') . 'background-color:' . $bgColDarkerBG . '; border-right:1px solid ' . $colOutline . '; border-left:1px solid ' . $colOutline . '; border-bottom:1px solid ' . $colOutline . ';\"><em>' . htmlspecialchars($row) . '</em></td>';\n foreach ($cols as $column) {\n $s_val.='<td style=\"text-align:center; border-right:1px solid ' . $colOutline . '; border-bottom:1px solid ' . $colOutline . ';\">';\n switch ($type) {\n case 'text':\n $s_val.=htmlspecialchars($this->postVal($elId . '_' . $r_cnt . '_' . $c_cnt));\n break;\n case 'radio':\n $s_val.=($c_cnt == $this->postVal($elId . '_' . $r_cnt) ? '&#10004;' : '-');\n break;\n case 'check':\n $s_postVal = $this->postVal($elId . '_' . $r_cnt);\n if (empty($s_postVal) === false && in_array($c_cnt, $s_postVal) === true) {\n $s_val.='&#10004;';\n } else {\n $s_val.='-';\n }\n break;\n }\n $s_val.='</td>';\n $c_cnt++;\n }\n $r_cnt++;\n $s_val.='</tr>';\n }\n $s_val.='</table>';\n break;\n case 'JsonFormBuilder_elementFile':\n if (isset($_FILES[$elId])) {\n $s_val = $_FILES[$elId]['name'];\n if ($_FILES[$elId]['size'] == 0) {\n $s_val = 'None';\n }\n }\n break;\n case 'JsonFormBuilder_elementCheckboxGroup':\n $s_val = implode(', ',$this->postVal($o_el->getId()));\n break;\n case 'JsonFormBuilder_elementDate':\n $s_val = $this->postVal($o_el->getId() . '_0') . ' ' . $this->postVal($o_el->getId() . '_1') . ' ' . $this->postVal($o_el->getId() . '_2');\n break;\n default:\n $s_val = nl2br(htmlspecialchars($this->postVal($o_el->getId())));\n break;\n }\n\n if($elType==='JsonFormBuilder_elementEmailHtml'){\n $s_ret.=$o_el->outputEmailHTML();\n }else{\n if(empty($s_val)===false){\n $s_ret.='<tr valign=\"top\" bgcolor=\"' . $bgCol . '\"><td><b>' . htmlspecialchars(strip_tags($o_el->getLabel())) . ':</b></td><td>' . $s_val . '</td></tr>';\n $rowCount++;\n }\n }\n\n }\n }\n }\n $s_ret.='</table>';\n return $s_ret;\n }", "public function addTable () {\n $html = '';\n if (!empty($this->chartData['rows'])) {\n $indicator = ActiveRecordTradeData::model()->getListLabel('listType', $this->reportValue);\n if (!empty($this->indicator)) {\n foreach ($this->listIndicator() as $key => $val) {\n if (array_key_exists($this->indicator, $val)) {\n $indicator = $val[$this->indicator];\n break;\n }\n }\n }\n\n $html = $this->render('trade/table', array(\n 'id' => $this->chartId,\n 'data' => $this->chartData,\n 'indicator' => $indicator,\n ), true);\n }\n\n return $html;\n }", "public function buildTbody()\n {\n\n $conf = $this->getConf();\n\n // create the table body\n $body = '<tbody>'.NL;\n\n // simple switch method to create collored rows\n $num = 1;\n $pos = 1;\n foreach ($this->data as $key => $row) {\n\n $objid = $row['buiz_protocol_message_rowid'];\n $rowid = $this->id.'_row_'.$objid;\n\n $body .= '<tr class=\"wcm wcm_ui_highlight row'.$num.' node-'.$objid.'\" '\n.' id=\"'.$rowid.'\" >'.NL;\n\n $body .= '<td valign=\"top\" class=\"pos\" name=\"slct['.$objid.']\" style=\"text-align:right;\" >'.$pos.'</td>'.NL;\n\n $body .= '<td valign=\"top\" style=\"text-align:right;\" >'.$row['buiz_protocol_m_time_created'].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row['core_person_lastname'].', '.$row['core_person_firstname'].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row['buiz_protocol_message_context'].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row['buiz_protocol_message_message'].'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $pos ++;\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n } //end foreach\n\n if ($this->dataSize > ($this->start + $this->stepSize)) {\n $body .= '<tr class=\"wgt-block-appear\" >'\n .'<td class=\"pos\" >&nbsp;</td>'\n .'<td colspan=\"'.$this->numCols.'\" class=\"wcm wcm_action_appear '.$this->searchForm.' '.$this->id.'\" >'\n .'<var>'.($this->start + $this->stepSize).'</var>'\n .$this->image('wgt/bar-loader.gif','loader').' Loading the next '.$this->stepSize.' entries.</td>'\n .'</tr>';\n }\n\n $body .= '</tbody>'.NL;\n //\\ Create the table body\n return $body;\n\n }", "public function getAllEntriesAsRows() {\n $allModels = $this -> getAllMiscObjectEntries();\n $html = \"\";\n foreach ($allModels as $model) {\n $objectRowID = \"12\" . strval($model -> getIdMisc());\n $editAndDelete = \"</td><td><button class='btn basicBtn' onclick='updateMisc(\"\n . $objectRowID . \",\"\n . $model -> getIdMisc() . \",\"\n . $model -> getIdTrackableObject() . \",\"\n . $model -> getIdTypeFilter()\n . \")'>Update</button>\"\n . \"</td><td><button class='btn basicBtn' onclick=\" . '\"deleteMisc('\n . $model -> getIdMisc()\n . ')\"> Delete</button>';\n $html = $html . \"<tr id='\" . $objectRowID . \"'><td>\" . $model -> getName()\n . \"</td><td>\" . $model -> getDescription()\n . \"</td><td>\" . $model -> getIsHazard()\n . \"</td><td>\" . $model -> getLongitude()\n . \"</td><td>\" . $model -> getLatitude()\n . \"</td><td>\" . $model -> getImageDescription()\n . \"</td><td>\" . $model -> getImageLocation()\n . \"</td><td>\" . $model -> getType()\n . $editAndDelete\n . \"</td></tr>\";\n }\n return $html;\n }", "public function renderTableBody() {\n $models = array_values($this->dataProvider->getModels());\n $keys = $this->dataProvider->getKeys();\n $rows = [];\n foreach ($models as $index => $model) {\n $key = $keys[$index];\n if ($this->beforeRow !== null) {\n $row = call_user_func($this->beforeRow, $model, $key, $index, $this);\n if (!empty($row)) {\n $rows[] = $row;\n }\n }\n $rows[] = $this->renderTableRow($model, $key, $index);\n\n if ($this->afterRow !== null) {\n $row = call_user_func($this->afterRow, $model, $key, $index, $this);\n if (!empty($row)) {\n $rows[] = $row;\n }\n }\n }\n //-- TODO new\n $cJSON = \\Yii::$app->conservation\n ->setConserveGridDB($this->dataProvider->conserveName, $this->dataProvider->pagination->pageParam, $this->dataProvider->pagination->getPage());\n $cJSON = \\Yii::$app->conservation\n ->setConserveGridDB($this->dataProvider->conserveName, $this->dataProvider->pagination->pageSizeParam, $this->dataProvider->pagination->getPageSize());\n //-- TODO new\n if (empty($rows) && $this->emptyText !== false) {\n $colspan = count($this->columns);\n\n return \"<tbody>\\n<tr><td colspan=\\\"$colspan\\\">\" . $this->renderEmpty() . \"</td></tr>\\n</tbody>\";\n } else {\n return \"<tbody>\\n\" . implode(\"\\n\", $rows) . \"\\n</tbody>\";\n }\n }", "function form_table($rows) {\n\t\t\t$content = '<table class=\"form-table\">';\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$content .= '<tr valign=\"top\"><th scrope=\"row\">';\n\t\t\t\tif (isset($row['id']) && $row['id'] != '')\n\t\t\t\t\t$content .= '<label for=\"'.$row['id'].'\">'.$row['label'].':</label>';\n\t\t\t\telse\n\t\t\t\t\t$content .= $row['label'];\n\t\t\t\tif (isset($row['desc']) && $row['desc'] != '')\n\t\t\t\t\t$content .= '<br/><small>'.$row['desc'].'</small>';\n\t\t\t\t$content .= '</th><td>';\n\t\t\t\t$content .= $row['content'];\n\t\t\t\t$content .= '</td></tr>'; \n\t\t\t}\n\t\t\t$content .= '</table>';\n\t\t\treturn $content;\n\t\t}", "public function TableAsHtml(){\n //checking if the method: runSql() was invoked before...\n \n if (!$this->dataSetReady()) { return '';} \n \n /* ------------ creating table with all data from dataSet -----------------------*/\n $tableHeader = '<table class=\"table_ctp table_filtered display\">';\n $tableHeader.='<thead><tr>'; \n \n /*********** generating each column label dynamically *****************/\n foreach ($this->columnHeaders as $field) { \n $tableHeader.='<th>'.$field.'</th>'; \n }\n\n /* concatening header */\n $tableHeader .= '</tr></thead>';\n\n \n /*********** adding tbody element ***************/ \n $iteration = 0; \n\n // $tableBody = $this->getBodyTable(); \n $tableBody = '<tbody>'; \n \n /************* dynamic body **********************/ \n foreach ($this->dataSet as $row) { \n /* gettin row */\n $rowAsArray = $this->RowToArray( $row );\n /* each row pushing to the rows (body to render)*/\n array_push( $this->rows, $rowAsArray ); \n\n $currentRow = $this->rows[$iteration];\n\n /* conver row to HTML: $row */\n $tableBody.= $this->rowArrayToHTML( $currentRow ); \n\n $iteration++;\n }//end: foreach \n\n $tableFooter = '<tfoot><tr>';\n\n /*********** generating each column label dynamically *****************/\n foreach ($this->columnHeaders as $field) { \n $tableFooter.='<td>'.$field.'</td>';\n }\n\n $tableFooter.='</tr></tfoot>'; \n \n $this->tableAsHtml = $tableHeader.$tableBody.$tableFooter; \n \n return $this->tableAsHtml;\n }", "private function addRowSummary() {\n\t\t$html = \"\";\n\t\t$value = \"-\";\n\t\tforeach ( $this->temp as $tempcolumn ) {\n\t\t\t$html .= \"<tr>\";\n\t\t\tforeach ( $this->columns as $column ) {\n\t\t\t\tif ($column ['alias'] == key ( $tempcolumn )) {\n\t\t\t\t\t\n\t\t\t\t\tif (class_exists ( key ( $tempcolumn [key ( $tempcolumn )] ['action'] ) )) {\n\t\t\t\t\t\t$class = key ( $tempcolumn [key ( $tempcolumn )] ['action'] );\n\t\t\t\t\t\t$method = $tempcolumn [key ( $tempcolumn )] ['action'] [$class];\n\t\t\t\t\t\t$values = $tempcolumn [key ( $tempcolumn )] ['values'];\n\t\t\t\t\t\t$value = call_user_func ( array ($class, $method ), $values );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$html .= \"<td>\" . $value . \"</td>\";\n\t\t\t\t} else {\n\t\t\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html .= \"</tr>\";\n\t\t}\n\t\treturn $html;\n\t}", "public function buildAjaxTbody()\n {\n\n $icons = [];\n $icons['closed'] = '<i class=\"fa fa-caret-right\" ></i>';\n\n // create the table body\n $body = '';\n\n $pos = $this->start + 1;\n $num = 1;\n\n foreach ($this->dataEntity as $row) {\n\n $objid = $row['dset_rowid'];\n $rowid = $this->id.'_row_'.$objid;\n\n if ($this->enableNav) {\n $navigation = $this->rowMenu\n (\n $objid,\n $row,\n null,\n null,\n 'dset'\n );\n $navigation = '<td valign=\"top\" class=\"nav_split\" >'.$navigation.'</td>'.NL;\n }\n\n $body .= <<<HTML\n\n <tr class=\"wcm wcm_ui_highlight row{$num} wgt-border-top\" id=\"{$rowid}\" >\n <td valign=\"top\" class=\"pos\" >{$pos}</td>\n <td valign=\"top\" class=\"ind1\" ><span\n class=\"wgt-loader\"\n wgt_source_key=\"users\"\n wgt_eid=\"{$objid}\" >{$icons['closed']}</span>\n <a\n href=\"maintab.php?c={$this->domainNode->domainUrl}.edit&amp;objid={$row['dset_rowid']}\"\n class=\"wcm wcm_req_ajax\" >\n <i class=\"fa fa-file-alt\" ></i> {$row['dset_text']}\n </a> ({$row['num_users']})\n </td>\n <td colspan=\"2\" >&nbsp;</td>\n {$navigation}\n </tr>\n\nHTML;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n ++$pos;\n\n }\n\n\n if ($this->dataSize > ($this->start + $this->stepSize)) {\n $body .= '<tr>'\n .'<td colspan=\"'.$this->numCols.'\" class=\"wcm wcm_action_appear '.$this->searchForm.' '.$this->id.'\" >'\n .'<var>'.($this->start + $this->stepSize).'</var>'\n .'Loading the next '.$this->stepSize.' entries.</td>'\n .'</tr>';\n }\n\n return $body;\n\n }", "public function display ()\r\n {\r\n // table object\r\n $table = $this->_htmlFactory->createTable();\r\n if (! empty($this->_attributes)) {\r\n $attribute = $this->tableAttributes($this->_attributes);\r\n // set attribute in table tag\r\n $table->setAttribute(' ' . $attribute);\r\n }\r\n // is / create table caption\r\n if ($this->_tableCaption) {\r\n $caption = $this->_htmlFactory->createCaption($this->_tableCaption, false, 'caption');\r\n $table->setCaption($caption);\r\n }\r\n // set a table header\r\n if (! empty($this->_headline)) {\r\n $this->tableHeaderline($table);\r\n }\r\n // set a table footer\r\n if (! empty($this->_footer)) {\r\n $this->tableFooter($table);\r\n }\r\n // set data body run through the data array\r\n $rowI = $cellI = 0; // ... row and cell counter\r\n foreach ($this->_htmlContent as $row) {\r\n $attribute = false;\r\n if (isset($this->_attributesRow[$rowI]) && ! empty($this->_attributesRow[$rowI])) {\r\n $attribute = $this->tableAttributes($this->_attributesRow[$rowI]);\r\n }\r\n $tableElement = $this->_htmlFactory->createElement('tr', $attribute);\r\n $table->setElement($tableElement);\r\n foreach ($row as $values) {\r\n $attribute = false;\r\n if (isset($this->_tagAttributes[$cellI]) && ! empty($this->_tagAttributes[$cellI])) {\r\n $attribute = $this->tableAttributes($this->_tagAttributes[$cellI]);\r\n }\r\n $buildElement = $this->_htmlFactory->createRowElement($values, $attribute, 'td');\r\n $tableElement->setTagElement($buildElement);\r\n $cellI ++;\r\n }\r\n $cellI = 0;\r\n $rowI ++;\r\n }\r\n return $table->display();\r\n }", "public function html_inp_row($record, $i, $model_observation, $model_article, $model_calculation){\n\t\t\n\t\t \n\t//\tGet valid_rules:\n\t\t$observation \t= new observation($record['observation']);\n\t\t$valid_rules = $observation->is_available ? $observation->valid_rules() : $observation->valid_rules('value'); \n\t\t\n\t//\tDecode description field:\n\t\t$record['description'] = htmlspecialchars_decode($record['description'], ENT_HTML5);\n\t\t \n\t//\tAdd field[href] : href to admin-page of observation to $record['observation']:\n\t\t$record['observation']['href'] \t= '';\n\t\tif ( array_key_exists('ID', $record['observation']) ){\n\t\t\t$observation \t\t\t\t= $model_observation->get_ar_with_path_to_record($record['observation']['ID']);\n\t\t\t$record['observation']['href'] \t= array_key_exists('href', $observation)? $observation['href'] : '';\n\t\t}\n\t\t \n\t//\tAssign $record to 'input' $i to 'i':\n\t\t$this->addReplacement('input', $record);\n\t\t$this->addReplacement('i', $i);\n\t\t \n\t//\tActions:\n\t\t$html= $this->html_act_tbody($i, $record['actions'], $valid_rules, $model_article, $model_calculation);\n\t\t$this->addReplacement('tbody', $html);\n\t\n\t\treturn $this->getHtml('form.calculation_inp.row.html');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================= END ADD/ REMOVE/ UPDATE/ GET BLOGPOST DATA IN journal2_blog_post ============================ ======================= START ADD/ REMOVE/ UPDATE/ GET POST DETAILS IN journal2_blog_post ============================
public function addPostDetails($post_data) { $this->db->query( "INSERT INTO " . DB_PREFIX . "journal2_blog_post_description (`post_id`,`language_id`,`name`, `description`, `meta_title`, `meta_keywords` , `meta_description`, `keyword`, `tags`) VALUES (" . (int)($post_data['post_id']) . "," . (int)($post_data['language_id']). ",'" . $this->db->escape($post_data['name']) . "','" . $this->db->escape($post_data['description']) . "','" . $this->db->escape($post_data['meta_title']) . "','" . $this->db->escape($post_data['meta_keywords']) . "','" . $this->db->escape($post_data['meta_description']) . "','" . $this->db->escape($post_data['keyword']) . "','" . $this->db->escape($post_data['tags']) . "')" ); }
[ "public function saveBlogPost() {\r\n\t\t\r\n\t\t//$this->verifyID($toid);\r\n\t\t$html_tags = '<b><p><br></br><u><ul><li><table><tr><th><td><i>';\r\n\r\n\t\t// controleer of submit gepost is\r\n\t\tif (isset($_POST['admblogsubmit'])) {\r\n\t\t\t\r\n\t\t\t// check: velden voor titel en content zijn niet leeg\r\n\t\t\tif (!empty($_POST[\"admblogtitle\"] && $_POST['admblogcontent'])) {\r\n\r\n\t\t\t\t// schrijf post inputs weg naar variabelen\r\n\t\t\t\t$admblogtitle = strip_tags($_POST[\"admblogtitle\"], $html_tags);\r\n\t\t\t\t$admblogintro = strip_tags($_POST[\"admblogintro\"], $html_tags);\r\n\t\t\t\t$admblogcontent = strip_tags($_POST[\"admblogcontent\"], $html_tags);\r\n\t\t\t\t$admurl = strtolower(preg_replace('/[[:space:]]+/', '-', $_POST['admblogtitle']));\r\n\t\t\t\t\r\n\t\t\t\t// maak PDO connectie om weg te schrijven + set attributes voor error meldingen\r\n\t\t\t\t$stmt = new PDO(\"mysql:host=localhost;dbname=demo\", 'root', '');\r\n\t\t\t\t$stmt->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t\t\r\n\t\t\t\t// try query\r\n\t\t\t\ttry {\r\n\t\t\t\t\t\t$query = $stmt->prepare(\"INSERT INTO `evdnl_blog_posts_yc` (create_date, modify_date, title, intro, content, dashedtitle) VALUES(CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$admblogtitle', '$admblogintro', '$admblogcontent', '$admurl')\");\r\n\t\t\t\t\t\t$query->execute();\r\n\t\t\t\t\t\t$this->createBlogPostFile();\r\n\r\n\t\t\t\t\t\t// sluit PDO connectie\r\n\t\t\t\t\t\t$query = NULL;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// catch error\r\n\t\t\t\t\tcatch (PDOException $e) {\r\n\t\t\t\t\t\techo $e->getMessage();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function lb_update_live_blog(){\n\t\t$post_id = $_POST[\"post_id\"];\n\t\t\n\t\tif(!get_post_meta($post_id, self::KEY, true)){\n\t\t\twp_die;\n\t\t}\n\t\t\n\t\t$current_post = get_post($post_id);\n\t\t$current_post_title = $current_post->post_title;\n\n\t\t$args = array(\n\t\t\t'post_type' => self::POST_TYPE,\n 'orderby' => 'date',\n 'order' => 'DESC'\n\t\t);\n\t\t\n\t\t$liveblog = new WP_Query($args);\t\t\n\t\t\n\t\t$response = array();\n\t\t$response_html = '';\n while ($liveblog->have_posts())\n {\n\t\t\t$liveblog->the_post();\n\t\t\t//Only display the entries in current post.\n\t\t\tif( $current_post_title == $liveblog->post->post_title){\n\t\t\t\t$author = get_author_name($liveblog->post->post_author);\n\t\t\t\t$date = $liveblog->post->post_date;\n\t\t\t\t$content = $liveblog->post->post_content;\n\t\t\t\t$post = array();\n\t\t\t\t$post['author'] = $author;\n\t\t\t\t$post['date'] = $date;\n\t\t\t\t$post['content'] = $content;\n\t\t\t\t\n\t\t\t\tarray_push($response, $post);\n\t\t\t}\n\t\t}\n\t\t\n\t\techo json_encode($response);\n\t\twp_die();\n\t}", "private function __saveNc3BlogEntryFromNc2($nc2JournalPosts) {\n\t\t$this->writeMigrationLog(__d('nc2_to_nc3', ' Blog Entry data Migration start.'));\n\n\t\t/* @var $BlogEntry BlogEntry */\n\t\t/* @var $Nc2ToNc3Category Nc2ToNc3Category */\n\t\t$BlogEntry = ClassRegistry::init('Blogs.BlogEntry');\n\t\t$Nc2ToNc3Category = ClassRegistry::init('Nc2ToNc3.Nc2ToNc3Category');\n\n\t\tCurrent::write('Plugin.key', 'blogs');\n\t\t//Announcement モデルで\tBlockBehavior::settings[nameHtml]:true になるため、ここで明示的に設定しなおす\n\t\t//$BlogEntry->Behaviors->Block->settings['nameHtml'] = false;\n\n\t\t//BlockBehaviorがシングルトンで利用されるため、BlockBehavior::settingsを初期化\n\t\t//@see https://github.com/cakephp/cakephp/blob/2.9.6/lib/Cake/Model/BehaviorCollection.php#L128-L133\n\t\t//$BlogEntry->Behaviors->Block->settings = $BlogEntry->actsAs['Blocks.Block'];\n\n\t\t//$Nc2Journal = $this->getNc2Model('journal');\n\t\t$BlocksLanguage = ClassRegistry::init('Blocks.BlocksLanguage');\n\t\t$Block = ClassRegistry::init('Blocks.Block');\n\t\t$Topic = ClassRegistry::init('Topics.Topic');\n\t\t$Like = ClassRegistry::init('Likes.Like');\n\n\t\tforeach ($nc2JournalPosts as $nc2JournalPost) {\n\t\t\t$BlogEntry->begin();\n\t\t\ttry {\n\t\t\t\t$data = $this->generateNc3BlogEntryData($nc2JournalPost);\n\t\t\t\tif (!$data) {\n\t\t\t\t\t$BlogEntry->rollback();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$nc3BlockId = $data['Block']['id'];\n\t\t\t\t$nc2CategoryId = $nc2JournalPost['Nc2JournalPost']['category_id'];\n\t\t\t\t$data['BlogEntry']['category_id'] = $Nc2ToNc3Category->getNc3CategoryId($nc3BlockId, $nc2CategoryId);\n\n\t\t\t\t$Block = ClassRegistry::init('Blocks.Block');\n\t\t\t\t$Blocks = $Block->findById($nc3BlockId, null, null, -1);\n\t\t\t\t$nc3RoomId = $Blocks['Block']['room_id'];\n\n\t\t\t\t// @see https://github.com/NetCommons3/Topics/blob/3.1.0/Model/Behavior/TopicsBaseBehavior.php#L365\n\t\t\t\tCurrent::write('Block.id', $nc3BlockId);\n\t\t\t\tCurrent::write('Room.id', $nc3RoomId);\n\n\t\t\t\t$BlocksLanguage->create();\n\t\t\t\t$BlogEntry->create();\n\t\t\t\t$Block->create();\n\t\t\t\t$Topic->create();\n\n\t\t\t\t// @see https://github.com/NetCommons3/Workflow/blob/3.1.0/Model/Behavior/WorkflowBehavior.php#L171-L175\n\t\t\t\t$nc3Status = $data['BlogEntry']['status'];\n\t\t\t\tCurrent::$permission[$nc3RoomId]['Permission']['content_publishable']['value'] = ($nc3Status != 2);\n\n\t\t\t\t// Hash::merge で BlogEntry::validate['publish_start']['datetime']['rule']が\n\t\t\t\t// ['datetime','datetime'] になってしまうので初期化\n\t\t\t\t// @see https://github.com/NetCommons3/Blogs/blob/3.1.0/Model/BlogEntry.php#L138-L141\n\t\t\t\t$BlogEntry->validate = [];\n\n\t\t\t\tif (!($nc3BlogEntry = $BlogEntry->saveEntry($data))) {\n\t\t\t\t\t// 各プラグインのsave○○にてvalidation error発生時falseが返ってくるがrollbackしていないので、\n\t\t\t\t\t// ここでrollback\n\t\t\t\t\t$BlogEntry->rollback();\n\n\t\t\t\t\t// print_rはPHPMD.DevelopmentCodeFragmentに引っかかった。\n\t\t\t\t\t// var_exportは大丈夫らしい。。。\n\t\t\t\t\t// @see https://phpmd.org/rules/design.html\n\n\t\t\t\t\t$message = $this->getLogArgument($nc2JournalPost) . \"\\n\" .\n\t\t\t\t\t\tvar_export($BlogEntry->validationErrors, true);\n\t\t\t\t\t$this->writeMigrationLog($message);\n\t\t\t\t\t$BlogEntry->rollback();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isset($data['Like'])) {\n\t\t\t\t\t$data['Like']['content_key'] = $nc3BlogEntry['BlogEntry']['key'];\n\t\t\t\t\t$Like->create();\n\t\t\t\t\t$Like->save($data);\n\t\t\t\t}\n\n\t\t\t\tunset(Current::$permission[$nc3RoomId]['Permission']['content_publishable']['value']);\n\n\t\t\t\t$nc2PostId = $nc2JournalPost['Nc2JournalPost']['post_id'];\n\t\t\t\t$idMap = [\n\t\t\t\t\t$nc2PostId => $BlogEntry->id\n\t\t\t\t];\n\t\t\t\t$this->saveMap('BlogEntry', $idMap);\n\t\t\t\t$BlogEntry->commit();\n\n\t\t\t} catch (Exception $ex) {\n\t\t\t\t// NetCommonsAppModel::rollback()でthrowされるので、以降の処理は実行されない\n\t\t\t\t// $BlogFrameSetting::savePage()でthrowされるとこの処理に入ってこない\n\t\t\t\t$BlogEntry->rollback($ex);\n\t\t\t\tthrow $ex;\n\t\t\t}\n\t\t}\n\n\t\tCurrent::remove('Block.id');\n\t\tCurrent::remove('Room.id');\n\t\tCurrent::remove('Plugin.key');\n\n\t\t$this->writeMigrationLog(__d('nc2_to_nc3', ' Blog Entry data Migration end.'));\n\t\treturn true;\n\t}", "protected function fetchPostDataFromDatabase() {\n\t\tlist($row) = t3blog_db::getRecFromDbJoinTables(\n\t\t\t'tx_t3blog_post, be_users', // TABLES\n\t\t\t'tx_t3blog_post.uid as postuid, tx_t3blog_post.title, tx_t3blog_post.tagClouds,tx_t3blog_post.author, tx_t3blog_post.date, tx_t3blog_post.cat, tx_t3blog_post.allow_comments,tx_t3blog_post.number_views, be_users.uid, be_users.username, be_users.email, be_users.admin, be_users.admin, be_users.realName, be_users.uid AS useruid, be_users.lastlogin, be_users.tx_t3blog_avatar',\n\t\t\t'tx_t3blog_post.uid='.intval($this->uid).' AND (be_users.uid=tx_t3blog_post.author)'\n\t\t);\n\t\treturn $row;\n\t}", "function present_blogpost($post, $id=null) { //*** added post #\n \n // format any errors\n $message = '';\n if (count($this->errors) > 0) {\n foreach ($this->errors as $booboo) {\n $message .= $booboo . BR;\n }\n $message .= BR;\n }\n \n // present blog post info\n $today = date(\"Y-m-d\");\n $post->date = $today;\n \n $this->data['message'] = $message;\n $this->data['f_post_id'] = makeTextField('Blog Post ID #', 'post_id', $post->id, \n \"Unique blog post identifier, system-assigned\", 10, 10, true);\n $this->data['f_post_date'] = makeTextField('Post Date (YYYY-MM-DD)', 'post_date', $today, '', 19);\n $this->data['f_post_title'] = makeTextField('Post Title (max 140 characters)', 'post_title', $post->title, '', 140, 60);\n $this->data['f_post_content'] = makeTextArea('Blog Content', 'post_content', $post->content, '', 66600, 60, 20);\n \n $this->data['pagebody'] = 'blog_edit';\n \n $this->data['btn_post_submit'] = makeSubmitButton(\n 'Process Blog Post', \n \"Click here to validate the blog post\", \n 'btn-success');\n \n $this->data['the_id'] = (!empty($id)) ? $id : '';\n $this->render();\n }", "public function postOnBlog()\n {\n\t\t//first validate title, if title contains no letters it will be saved in the DB and cannot be accessed by slug (As slug will be empty)\n if (Validation::titleValidation($_POST['Title']))\n\t\t{\n $bm=new BlogModel();\n $rows_affected=$bm->newPost($_POST['Author'], $_POST['Category'], $_POST['ActualPost'], $_POST['Title'], SlugGenerator::slugify($_POST['Title']));\n \n if($rows_affected==1) {\n if (LoginUser::validateLoginAdmin()) { Render::$menu=\"templates\\menu_admin.php\"; \n }\n Render::$content=\"you have successfully posted a new blog post!\";\n Render::renderPage(\"user\");\n \n }else{\n \n if (LoginUser::validateLoginAdmin()) { Render::$menu=\"templates\\menu_admin.php\"; \n }\n Render::$content= \"bad luck, there was an error....\";\n Render::renderPage(\"user\");\n \n \n }\n }else{\n\t\t\n\t\t $message = \"The title is empty.\";\n echo \"<script type='text/javascript'>alert('$message');window.location = '/admin/new-post';</script>\";\n\t\t\n\t\t}\n\t}", "public function detailBlog() {\n\t\t\n\t}", "function blog_content(){\n\tglobal $ssc_database, $ssc_site_path;\n\t\n\t$result = $ssc_database->query(\"SELECT name, comments, page FROM #__blog WHERE id = %d LIMIT 1\", $_GET['path-id']);\n\tif ($result && $data = $ssc_database->fetch_assoc($result)){\n\t\t// Load display library\n\t\tif (!ssc_load_library('sscText')){\n\t\t\tssc_not_found();\n\t\t\treturn;\n\t\t}\n\n\t\t// Get blog settings\n\t\tssc_set_title($data['name']);\n\t\t$_GET['param'] = explode(\"/\", $_GET['param']);\n\t\t$_GET['blog_comments'] = (bool)$data['comments'];\n\t\t$action = array_shift($_GET['param']);\n\n\t\tif ($action == '' || $action == 'page'){\n\t\t\t// Show paged posts\n\t\t\tarray_unshift($_GET['param'], 'page');\n\t\t\tif (count($_GET['param']) > 2)\n\t\t\t\tssc_not_found();\n\t\t\t\t\n\t\t\treturn _blog_gen_post($data['page'], $_GET['path'] . '/page/', \n\t\t\t\t\"SELECT p.id, p.title, p.created, p.urltext, u.displayname author, count(c.post_id) count, p.body, p.commentsdisabled FROM\n\t\t\t\t#__blog_post p LEFT JOIN #__user u ON u.id = p.author_id LEFT JOIN #__blog_comment c ON (post_id = p.id AND (status & %d = 0))\n\t\t\t\tWHERE blog_id = %d AND p.is_draft = 0 GROUP BY p.id ORDER BY p.created DESC\", SSC_BLOG_COMMENT_SPAM, $_GET['path-id']);\n\t\t}\t\t\n\t\telseif ($action == 'tag'){\n\t\t\t// Show posts for the tag\n\n\t\t\tif (count($_GET['param']) == 2 || count($_GET['param']) > 3)\n\t\t\t\tssc_not_found();\n\t\t\t\t\n\t\t\t$tag = array_shift($_GET['param']);\n\t\t\tif (empty($tag))\n\t\t\t\tssc_not_found();\t// If to parameter for the tag, die gracefully\n\t\t\t\t\n\t\t\treturn _blog_gen_post($data['page'], $_GET['path'] . '/tag/'.$tag.'/page/', \n\t\t\t\t\"SELECT p.id, p.title, p.created, p.urltext, u.displayname author, count(c.post_id) count, p.body, p.commentsdisabled FROM \n\t\t\t\t#__blog_post p LEFT JOIN #__user u ON u.id = p.author_id LEFT JOIN #__blog_comment c ON (post_id = p.id AND (status & %d = 0))\n\t\t\t\tLEFT JOIN #__blog_relation r ON r.post_id = p.id LEFT JOIN #__blog_tag t ON t.id = r.tag_id WHERE blog_id = %d AND p.is_draft = 0 AND t.tag = '%s'\n\t\t\t\tGROUP BY p.id ORDER BY p.created DESC\", SSC_BLOG_COMMENT_SPAM, $_GET['path-id'], $tag);\n\t\t\t\n\t\t}\n\t\telseif ($action == 'id'){\n\t\t\t// Redirect as needed\n\t\t\tif (count($_GET['param']) != 1)\n\t\t\t\tssc_not_found();\t// Extra parameters\n\t\t\t\t\n\t\t\t$result = $ssc_database->query(\"SELECT created, urltext FROM #__blog_post WHERE id = %d AND is_draft = 0 LIMIT 1\", (int)array_shift($_GET['param']));\n\t\t\tif ($data = $ssc_database->fetch_object($result)){\n\t\t\t\tssc_redirect($_GET['path'] . date(\"/Y/m/d/\", $data->created) . $data->urltext, 301);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Post ID doesn't exist - kill\n\t\t\tssc_not_found();\n\t\t\t\n\t\t}\n\t\telseif ($action == 'feed'){\n\t\t\t// Internal redirect to atom feed\n\t\t\t$feedPath = $ssc_site_path . '/modules/blog/atom-' . $_GET['path-id'] . '.xml';\n\t\t\t\n\t\t\t// Check if feed exists yet\n\t\t\tif (!file_exists($feedPath))\n\t\t\t\tssc_not_found();\n\n\t\t\t// Try and read it\t\t\t\n\t\t\t$rss = file_get_contents($feedPath);\n\n\t\t\t// See if read success?\n\t\t\tif ($rss === FALSE)\n\t\t\t\tssc_not_found();\t// Guess not - die gracefully\n\t\t\t\t\n\t\t\t// Output rss\n\t\t\theader(\"Content-Type: application/xml\", true);\n\t\t\techo $rss;\n\t\t\t\n\t\t\t// And now quit ...\n\t\t\tssc_close();\n\t\t\t// ... fully\n\t\t\texit (0);\n\t\t}\n\t\telseif ($action == 'atom') {\n\t\t\tif (count($_GET['param']) > 1)\n\t\t\t\tssc_not_found();\n\t\t\t\t\n\t\t\theader(\"Content-Type: application/atom+xml\", true);\n\t\t\tinclude $ssc_site_path . '/modules/blog/rss.inline.php';\n\t\t\t\n\t\t\tssc_close();\n\t\t\texit (0);\n\t\t}\n\t\telse {\n\t\t\t// Not those - is int?\n\t\t\t$action = (int)$action;\n\t\t\t// Check for bad first param\n\t\t\tif ($action == 0){\n\t\t\t\tssc_not_found();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Check if the post name exists?\n\t\t\tif (!empty($_GET['param'][2])){\n\t\t\t\t// Retrieve post\n\t\t\t\t$result = $ssc_database->query(\n\t\t\t\t\t\"SELECT p.id, p.title, p.created, p.urltext, p.commentsdisabled, u.displayname author, p.body FROM #__blog_post p \n\t\t\t\t\tLEFT JOIN #__user u ON u.id = p.author_id WHERE blog_id = %d AND p.is_draft = 0 AND p.urltext = '%s' \n\t\t\t\t\tLIMIT 1\", $_GET['path-id'], $_GET['param'][2]);\n\n\t\t\t\tif (!($data = $ssc_database->fetch_object($result))){\n\t\t\t\t\t// No post with name - kill output\n\t\t\t\t\tssc_not_found();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't allow any further params\n\t\t\t\tif (!empty($_GET['param'][3])){\n\t\t\t\t\t// Unless admin, and the param is 'mark'\n\t\t\t\t\tif (login_check_auth(\"blog\") && $_GET['param'][3] == 'mark'){\n\t\t\t\t\t\tif ($ssc_database->query(\"UPDATE #__blog_comment SET status = status | %d WHERE post_id = %d\", SSC_BLOG_COMMENT_READ, $data->id))\n\t\t\t\t\t\t\tssc_add_message(SSC_MSG_INFO, t('Marked the comments as read'));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tssc_not_found();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Comments disabled flag\n\t\t\t\t$comments_disabled = $data->commentsdisabled;\n\t\t\t\t// Post id number\n\t\t\t\t$pid = $data->id;\n\n\t\t\t\t$out = \"\\n<h3>$data->title</h3>\\n\";\n\t\t\t\t$out .= t(\"Posted !date at !time by !author\\n\", \n\t\t\t\t\tarray(\t'!date' => date(ssc_var_get('date_med', SSC_DATE_MED), $data->created),\n\t\t\t\t\t\t\t'!time' => date(ssc_var_get('time_short', SSC_TIME_SHORT), $data->created),\n\t\t\t\t\t\t\t'!author' => $data->author)) . '<br />';\n\t\t\t\t\n\t\t\t\t$result = $ssc_database->query(\"SELECT tag FROM #__blog_relation r, #__blog_tag t WHERE r.tag_id = t.id AND r.post_id = %d ORDER BY tag ASC\", $data->id);\n\t\t\t\t\n\t\t\t\t// Retrieve list of tags for the post\n\t\t\t\tif ($ssc_database->number_rows()){\n\t\t\t\t\t$out .= \"Tagged: \";\n\t\t\t\t\t$txt = '';\n\t\t\t\t\twhile($dat = $ssc_database->fetch_object($result))\n\t\t\t\t\t\t$txt .= ', ' . l($dat->tag, $_GET['path'] . '/tag/' . $dat->tag);\n\t\t\t\t\t\n\t\t\t\t\t$txt = substr($txt, 2);\n\t\t\t\t\t$out .= $txt.'<br />';\n\t\t\t\t}\n\n\t\t\t\t$out .= sscText::convert($data->body);\n\t\t\t\n\t\t\t\tif ($_GET['blog_comments']){\n\t\t\t\t\t// Retrieve comments\n\t\t\t\t\t$out .= '<div class=\"clear\"></div><h3 id=\"comments\">Comments</h3>';\n\t\t\t\t\t\n\t\t\t\t\t// Are we admin?\n\t\t\t\t\t$is_admin = login_check_auth(\"blog\");\n\t\t\t\t\t\n\t\t\t\t\tif ($is_admin){\n\t\t\t\t\t\t$result = $ssc_database->query(\"SELECT id, author, email, site, created, status, body FROM #__blog_comment \n\t\t\t\t\t\tWHERE post_id = %d ORDER BY created ASC\", $data->id, SSC_BLOG_COMMENT_SPAM, SSC_BLOG_COMMENT_SPAM);\n\t\t\t\t\t\t// Start spam/ham/commentstate form\n\t\t\t\t\t\t$out .= '<form action=\"\" method=\"post\"><div><input type=\"hidden\" name=\"form-id\" value=\"blog_spam_ham\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Show (dis-)enable comments button on posts with or without comments\n\t\t\t\t\t\tif ($comments_disabled == 0){\n\t\t\t\t\t\t\t$sub_disable_comments = array(\t'#value' => 'Disable Comments', '#type' => 'submit',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'#name' => \"disable_comments[$pid]\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$sub_disable_comments = array(\t'#value' => 'Enable Comments', '#type' => 'submit', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'#name' => \"enable_comments[$pid]\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Render button\n\t\t\t\t\t\t$out .= theme_render_input($sub_disable_comments);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$result = $ssc_database->query(\"SELECT author, email, site, created, body FROM #__blog_comment \n\t\t\t\t\t\tWHERE post_id = %d AND status & %d = 0 ORDER BY created ASC\", $data->id, SSC_BLOG_COMMENT_SPAM);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$result || $ssc_database->number_rows($result) == 0){\n\t\t\t\t\t\t// Bad SQL\n\t\t\t\t\t\t$out .= t('There are no comments posted yet.');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Admin user - show spam/ham/commentstate options\n\t\t\t\t\t\tif ($is_admin){\n\t\t\t\t\t\t\t// For each comment, show it, it's visible state, and possible options\n\t\t\t\t\t\t\twhile ($data = $ssc_database->fetch_object($result)){\n\t\t\t\t\t\t\t\t$status = $data->status;\t\n\t\t\t\t\t\t\t\t$out .= \"<div class='\" . ($status & SSC_BLOG_COMMENT_SPAM ? \"blog-spam-icon\" : \"blog-notspam-icon\") . \"'><p>\" . nl2br(check_plain($data->body)) . \"</p><p>\";\n\t\t\t\t\t\t\t\t$out .= t(\"Posted !date at !time by !author\\n\", \n\t\t\t\t\t\t\t\t\t\tarray(\t'!date' => date(ssc_var_get('date_med', SSC_DATE_MED), $data->created),\n\t\t\t\t\t\t\t\t\t\t\t\t'!time' => date(ssc_var_get('time_short', SSC_TIME_SHORT), $data->created),\n\t\t\t\t\t\t\t\t\t\t\t\t'!author' => \n\t\t\t\t\t\t\t\t\t\t(empty($data->site) ? check_plain($data->author) : l(check_plain($data->author), $data->site)))) . '</p>';\n\n\t\t\t\t\t\t\t\t$sub_hide = array('#value' => 'Hide comment', '#type' => 'submit');\n\t\t\t\t\t\t\t\t$sub_show = array('#value' => 'Show comment', '#type' => 'submit');\n\t\t\t\t\t\t\t\t$sub_spam = array('#value' => 'Mark spam', '#type' => 'submit');\n\t\t\t\t\t\t\t\t$sub_ham = array('#value' => 'Unmark spam', '#type' => 'submit');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// If tree for actions\n\t\t\t\t\t\t\t\tif ($status & SSC_BLOG_COMMENT_CAN_SPAM){\n\t\t\t\t\t\t\t\t\t// Hasn't been re-submitted yet\n\t\t\t\t\t\t\t\t\tif ($status & SSC_BLOG_COMMENT_SPAM){\n\t\t\t\t\t\t\t\t\t\t// Was marked as spam\n\t\t\t\t\t\t\t\t\t\t$sub_ham['#name'] = \"ham[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_ham);\n\t\t\t\t\t\t\t\t\t\t$sub_show['#name'] = \"show[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_show);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t// Was not marked spam\n\t\t\t\t\t\t\t\t\t\t$sub_spam['#name'] = \"spam[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_spam);\n\t\t\t\t\t\t\t\t\t\t$sub_hide['#name'] = \"hide[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_hide);\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\telse {\n\t\t\t\t\t\t\t\t\t// Has already been resubmitted\n\t\t\t\t\t\t\t\t\tif ($status & SSC_BLOG_COMMENT_SPAM){\n\t\t\t\t\t\t\t\t\t\t// Currently spam/hidden\n\t\t\t\t\t\t\t\t\t\t$sub_show['#name'] = \"show[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_show);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// Marked as normal currently\n\t\t\t\t\t\t\t\t\t\t$sub_hide['#name'] = \"hide[$data->id]\";\n\t\t\t\t\t\t\t\t\t\t$out .= theme_render_input($sub_hide);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$out .= '</div><hr />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t// Just show comments\n\t\t\t\t\t\t\twhile ($data = $ssc_database->fetch_object($result)){\n\t\t\t\t\t\t\t\t//$out .= \"<div class='gravatar' style='background-image: url(\\\"\"._blog_gravatar_get_url($data->email).\"\\\");'>\";\n\t\t\t\t\t\t\t\t$out .= '<p>' . nl2br(check_plain($data->body)) . '</p><p>';\n\t\t\t\t\t\t\t\t$out .= t(\"Posted !date at !time by !author\\n\", \n\t\t\t\t\t\t\t\t\t\tarray(\t'!date' => date(ssc_var_get('date_med', SSC_DATE_MED), $data->created),\n\t\t\t\t\t\t\t\t\t\t\t\t'!time' => date(ssc_var_get('time_short', SSC_TIME_SHORT), $data->created),\n\t\t\t\t\t\t\t\t\t\t\t\t'!author' => \n\t\t\t\t\t\t\t\t\t\t\t(empty($data->site) ? $data->author : l($data->author, $data->site)))) . '</p><hr />'; //'</p></div><hr />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t// End admin form\n\t\t\t\t\tif ($is_admin)\n\t\t\t\t\t\t$out .= '</div></form>';\n\t\t\t\t\t\n\t\t\t\t\tif (($comments_disabled == 0) || $is_admin) {\n\t\t\t\t\t\t$out .= ssc_generate_form('blog_guest_comment', $pid);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$out .= '<br />' . t(\"Sorry, commenting has been closed on this post.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $out;\n\t\t\t}\n\t\t\telseif (isset($_GET['param'][0])) {\n\t\t\t\t// First param set not expecting anything - kill page\n\t\t\t\tssc_not_found();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Yearly archive\n\t\t\t\treturn _blog_gen_post(10000, $_GET['path'] . '/page/', \n\t\t\t\t\t\"SELECT p.id, p.title, p.created, p.urltext, u.displayname author, count(c.post_id) count, p.commentsdisabled FROM \n\t\t\t\t\t#__blog_post p LEFT JOIN #__blog_comment c ON (post_id = p.id AND (c.status & %d = 0)) LEFT JOIN #__user u ON u.id = p.author_id \n\t\t\t\t\tWHERE blog_id = %d AND p.created >= %d AND p.created < %d AND p.is_draft = 0 GROUP BY p.id ORDER BY p.created DESC\",\n\t\t\t\t\tSSC_BLOG_COMMENT_SPAM, $_GET['path-id'], mktime(0, 0, 0, 1, 1, $action), mktime(0, 0, 0, 1, 0, $action + 1));\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t// Find content\n\t\n\t\n\tssc_not_found();\n}", "function save_blog_entry($blog) {\t\n\t$db = new PstahlSqlite(); \n\tif(!$db) {\n\t\t$_POST['popup_message'] = 'Cannot establish sqlite database connection. Please check your configuration.';\n\t\treturn false;\n\t}\n\n\tif( isset($blog['BLOG_ID']) && $blog['BLOG_ID']!='' ) {\n\t\t// update blog if id already exist\n\t\t$blog = $db->update_blog($blog);\n\t\tset_blog_params($blog);\t\n\t\t$_POST[\"info_message\"] = \"Post Successfully updated.\";\n\t}\n\telse {\n\t\t// create blog for non-existent id\n\t\t$blog = $db->create_blog($blog);\t\n\t\tset_blog_params($blog);\n\t\t$_POST[\"info_message\"] = \"Post successfully created.\";\t\t\n\t}\t\t\n}", "public function getBlog()\n {\n $this->app->db->connect();\n $sql = <<<EOD\nSELECT\n*,\nDATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\nDATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $res = $this->app->db->executeFetchAll($sql, [\"post\"]);\n return $res;\n }", "function blog_get_page_content_edit($guid, $revision = NULL) {\n\n\t$return = array(\n\t\t'buttons' => '',\n\t\t'filter' => '',\n\t);\n\n\t$vars = array();\n\t$vars['internalid'] = 'blog-post-edit';\n\t$vars['internalname'] = 'blog_post';\n\n\tif ($guid) {\n\t\t$blog = get_entity((int)$guid);\n\n\t\t$title = elgg_echo('blog:edit');\n\n\t\tif (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {\n\t\t\t$vars['entity'] = $blog;\n\n\t\t\t$title .= \": \\\"$blog->title\\\"\";\n\n\t\t\tif ($revision) {\n\t\t\t\t$revision = get_annotation((int)$revision);\n\t\t\t\t$vars['revision'] = $revision;\n\t\t\t\t$title .= ' ' . elgg_echo('blog:edit_revision_notice');\n\n\t\t\t\tif (!$revision || !($revision->entity_guid == $guid)) {\n\t\t\t\t\t$content = elgg_echo('blog:error:revision_not_found');\n\t\t\t\t\t$return['content'] = $content;\n\t\t\t\t\t$return['title'] = $title;\n\t\t\t\t\treturn $return;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$body_vars = blog_prepare_form_vars($blog, $revision);\n\n\t\t\telgg_push_breadcrumb($blog->title, $blog->getURL());\n\t\t\telgg_push_breadcrumb(elgg_echo('edit'));\n\n\t\t\t$content = elgg_view_form('blog/save', $vars, $body_vars);\n\t\t\t$content .= elgg_view('js/blog/save_draft');\n\t\t\t$sidebar = elgg_view('blog/sidebar_revisions', $vars);\n\t\t} else {\n\t\t\t$content = elgg_echo('blog:error:cannot_edit_post');\n\t\t}\n\t} else {\n\t\telgg_push_breadcrumb(elgg_echo('blog:new'));\n\t\t$body_vars = blog_prepare_form_vars($blog);\n\n\t\t$title = elgg_echo('blog:new');\n\t\t$content = elgg_view_form('blog/save', $vars, $body_vars);\n\t\t$content .= elgg_view('js/blog/save_draft');\n\t}\n\n\t$return['title'] = $title;\n\t$return['content'] = $content;\n\t$return['sidebar'] = $sidebar;\n\treturn $return;\n}", "function fetch_blog_detail_data($id) {\n\t\t$sql = mysql_query(\"select jc.* from `jos_content` jc where id=\".$id.\" and jc.state=1\");\n\t\t$article_res = mysql_fetch_array($sql);\n\t\treturn $article_res;\n\t}", "public function load()\n\t{\n\t\t$sql_ary = array(\n\t\t\t'SELECT'\t=> 'bp.id,\n\t\t\t\t\t\t\tbp.category,\n\t\t\t\t\t\t\tbp.title,\n\t\t\t\t\t\t\tbp.poster_id,\n\t\t\t\t\t\t\tbp.post,\n\t\t\t\t\t\t\tbp.options,\n\t\t\t\t\t\t\tbp.bitfield,\n\t\t\t\t\t\t\tbp.uid,\n\t\t\t\t\t\t\tbp.ptime,\n\t\t\t\t\t\t\tbp.read_count,\n\t\t\t\t\t\t\tbp.last_edit_time,\n\t\t\t\t\t\t\tbp.edit_count,\n\t\t\t\t\t\t\tbp.comment_count,\n\t\t\t\t\t\t\tbp.comment_lock',\n\t\t\t'FROM'\t\t=> array(\n\t\t\t\tBLOG_POSTS_TABLE => 'bp',\n\t\t\t),\n\t\t\t'WHERE'\t\t=> 'bp.id = ' . $this->id,\n\t\t);\n\n\t\t$sql\t= $this->db->sql_build_query('SELECT', $sql_ary);\n\t\t$result\t= $this->db->sql_query($sql);\n\t\t$post\t= $this->db->sql_fetchrow($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tif (!empty($post))\n\t\t{\n\t\t\t$this->set_data($post);\n\t\t\t$this->load_comments();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Blog doesn't exist, so re-set the ID to `0`\n\t\t\t$this->id = 0;\n\t\t}\n\t}", "function RecentBlogPosts() {\r\n\t\t//if the blog posts have not been called yet\r\n\t\tif(!$this->blog_posts) {\r\n\t\t\t//get all blog entries corresponding to the selected blog holder, or all if blog holder == 0\r\n\t\t\tif (isset($this->BlogIdToShow) && $this->BlogIdToShow > 0) {\r\n\t\t\t\t$this->blog_posts = DataObject::get('BlogEntry', '`ParentID` = '.$this->BlogIdToShow, '`Date` DESC', null, $this->DisplayAmount);\r\n\t\t\t} else {\r\n\t\t\t\t//show all blog's posts\r\n\t\t\t\t$this->blog_posts = DataObject::get('BlogEntry', null, '`Date` DESC', null, $this->DisplayAmount);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->ShowCommentsOnly) {\r\n\t\t\t$blog_post_ids = array();\r\n\t\t\tforeach ($this->blog_posts as $blog_post) {\r\n\t\t\t\t$blog_post_ids[] = $blog_post->ID;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$posts_ids_string = implode(\",\", $blog_post_ids);\r\n\t\t\t\r\n\t\t\t//$blog_post_comments = DataObject::get('PageComment', \"`NeedsModeration` = '0' AND `IsSpam` = '0' AND `ParentID` IN (\".$posts_ids_string.\")\", \"`Created` DESC\", null, $this->DisplayAmount);\r\n\t\t\t$blog_post_comments = DataObject::get('PageComment', \"`NeedsModeration` = '0' AND `IsSpam` = '0'\", \"`Created` DESC\", null, $this->DisplayAmount);\r\n\t\t\t\r\n\t\t\tif ($blog_post_comments) {\r\n\t\t\t\treturn $blog_post_comments;\r\n\t\t\t} else {\r\n\t\t\t\treturn new ArrayData(array('NoPosts'=>'There are no comments on any posts in this blog right now.'));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif($this->blog_posts) {\r\n\t\t\t\treturn $this->blog_posts;\r\n\t\t\t} else\t{\r\n\t\t\t\treturn new ArrayData(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'NoPosts'=>'There are no blog posts for this blog right now.'\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n }", "public function blogAction() {\n \n $this->view->currentPage = 'connect';\n \n $blogEntries = new Datasource_Cms_Connect_BlogEntries();\n $blogEntriesArray = $blogEntries->getAll();\n \n\n $mainBlogEntry = array();\n $summaryBlogEntries = array();\n $poolBlogEntries = array();\n \n foreach($blogEntriesArray as $currentBlogEntry) {\n \n if($currentBlogEntry['status'] == 1) {\n \n $mainBlogEntry[] = $currentBlogEntry;\n }\n else if($currentBlogEntry['status'] == 2) {\n \n $summaryBlogEntries[] = $currentBlogEntry;\n }\n else {\n \n $poolBlogEntries[] = $currentBlogEntry;\n }\n }\n \n \n $this->view->connectBlogMain =\n $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $mainBlogEntry);\n \n $this->view->connectBlogSummary =\n $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $summaryBlogEntries);\n \n $this->view->connectBlogPool =\n $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $poolBlogEntries);\n \n \n $passThrough = $this->_helper->getHelper('FlashMessenger')->getMessages();\n if (count($passThrough)>0) {\n \n if (isset($passThrough[0]['saved'])) {\n \n if ($passThrough[0]['saved'] == true) $this->view->saved=true;\n }\n if (isset($passThrough[0]['deleted'])) {\n \n if ($passThrough[0]['deleted'] == true) $this->view->deleted=true;\n }\n if (isset($passThrough[0]['statusChanged'])) {\n \n if ($passThrough[0]['statusChanged'] == true) $this->view->statusChanged=true;\n }\n if (isset($passThrough[0]['errorMessage'])) {\n \n $this->view->errorMessage = $passThrough[0]['errorMessage'];\n }\n }\n }", "function pull_post()\n\t{\n\t\t$this->preorderID = @$_POST['preorderID'];\n\t\tif ($this->preorderID) { $this->set_preorderID($this->preorderID); }\n\n\t\tif (@$_POST['itemID']) { $this->set_itemID(@$_POST['itemID']); }\n\n\t\t$active = (isset($_GET['active'])?$_GET['active']:@$_POST['active']);\n\t\tif (!strlen($active)) { $active = PRE_ACTIVE; }\n\t\t$this->active = $active;\n\n\t\tif (isset($_POST['info']))\n\t\t{\n\t\t\t$this->info = $_POST['info'];\n\t\t\twhile (list($key,$val) = each($this->info)) { $this->info[$key] = stripslashes($val); }\n\t\t\treset($this->info);\n\t\t}\n\n\t\tif (isset($_POST['customerinfo']))\n\t\t{\n\t\t\t$this->customerinfo = $_POST['customerinfo'];\n\t\t\twhile (list($key,$val) = each($this->customerinfo)) { $this->customerinfo[$key] = stripslashes($val); }\n\t\t\treset($this->customerinfo);\n\t\t}\n\n\t\tif (isset($_POST['customer_status']))\n\t\t{\n\t\t\t$this->customer_status = $_POST['customer_status'];\n\t\t\treset($this->customer_status);\n\t\t}\n\n\t\t$this->customerID = @$_POST['customerID'];\n\t}", "public function importBlogPost() {\n\t\tforeach($this->simpleXml->channel->children()->item as $item) {\n\t\t\t$content = $item->children($this->namespaces['content'])->encoded;\n\t\t\t$excerpt = $item->children($this->namespaces['excerpt'])->encoded;\n\t\t\t$post = $item->children($this->namespaces['wp']);\n\n\t\t\t// Check for existing post\n\t\t\tif($post->post_type == \"post\" && !array_key_exists((string) $post->post_id, $this->posts)) {\n\t\t\t\t$blogPost = BlogPost::create();\n\t\t\t\t$blogPost->Title = (string) $item->title;\n\t\t\t\t$blogPost->MetaTitle = (string) $item->title;\n\t\t\t\t$blogPost->MetaDescription = (string) $excerpt;\n\t\t\t\t$blogPost->URLSegment = (string) $post->post_name;\n\t\t\t\t$blogPost->setCastedField(\"PublishDate\", $post->post_date_gmt);\n\t\t\t\t$blogPost->Content = (string) $this->parseHTML($content);\n\t\t\t\t$blogPost->WordpressID = (string) $post->post_id;\n\t\t\t\t$blogPost->ParentID = $this->getBlog()->ID;\n\n\t\t\t\t// Hook to update BlogPost\n\t\t\t\t$this->extend(\"beforeImportBlogPost\", $item, $blogPost);\n\n\t\t\t\tif(!$this->isDryRun()) {\n\t\t\t\t\t$blogPost->writeToStage(\"Stage\");\n\t\t\t\t\tif((string) $post->status == \"publish\") {\n\t\t\t\t\t\t$blogPost->publish(\"Stage\", \"Live\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->posts[$blogPost->WordpressID] = $blogPost;\n\t\t\t\t$this->addImportedObject(\"BlogPost\", $blogPost);\n\n\t\t\t\t// Add attachments\n\t\t\t\t$this->addAttachments($item, $blogPost);\n\t\t\t}\n\t\t}\n\t}", "function update_post_content( $data ) {\n\n\t$add_title = ' myproject.com';\n\t$add_banner = '<div class=\"banner\"><img src=\"' . get_template_directory_uri() . '/banner/1.png\" alt=\"Banner\" title=\"Banner\" /></div>';\n\t$log_message = 'Post ' . $data['ID'] . ' was updated';\n\n\t$sub_title = stripslashes(substr($data['post_title'], -strlen(addslashes($add_title))));\n\tif( $sub_title != $add_title ){\n \t$data['post_title'] .= $add_title ;\n\t}\t\n\n\t$sub_content = stripslashes(substr($data['post_content'], -strlen(addslashes($add_banner))));\n\n\tif( $sub_content != $add_banner ){\n \t$data['post_content'] .= $add_banner ;\n\t}\n\n\terror_log($log_message);\n\n return $data;\n}", "public function loadPost()\n\t{\n\t\t$sql_ary = array(\n\t\t\t'SELECT'\t=> 'bp.id,\n\t\t\t\t\t\t\tbp.category,\n\t\t\t\t\t\t\tbp.title,\n\t\t\t\t\t\t\tbp.poster_id,\n\t\t\t\t\t\t\tbp.post,\n\t\t\t\t\t\t\tbp.post_options,\n\t\t\t\t\t\t\tbp.post_bitfield,\n\t\t\t\t\t\t\tbp.post_uid,\n\t\t\t\t\t\t\tbp.ptime,\n\t\t\t\t\t\t\tbp.post_read_count,\n\t\t\t\t\t\t\tbp.post_last_edit_time,\n\t\t\t\t\t\t\tbp.post_edit_count,\n\t\t\t\t\t\t\tbp.post_comment_count,\n\t\t\t\t\t\t\tbp.post_comment_lock',\n\t\t\t'FROM'\t\t=> array(\n\t\t\t\tBLOG_POSTS_TABLE => 'bp',\n\t\t\t),\n\t\t\t'WHERE'\t\t=> 'bp.id = ' . $this->id,\n\t\t);\n\n\t\t$sql\t= $this->db->sql_build_query('SELECT', $sql_ary);\n\t\t$result\t= $this->db->sql_query($sql);\n\t\t$post\t= $this->db->sql_fetchrow($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\t$this->setPostData($post);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ based on the latt/long passed in, get a list of venues and their city_region and intersection fucntion returns distance in Km Used when adding new venue to guess the nearest intersection / city_region / neighbourhood
function getNearbyVenueIntersection( $lat, $lng, $venueId = null) { $distance = 10; // 1 = 1000 metres, 10 = 10km $limit = 10; $venueLat = floatval($lat); $venueLng = floatval($lng); $result = $this->find('all', array('fields' => array( 'Venue.id', 'Venue.name', 'Venue.slug', 'Venue.address', 'Venue.geo_lat', 'Venue.geo_lng', '(6371 * acos( cos( radians(' . $venueLat . ') ) * cos( radians( geo_lat ) ) * cos( radians( geo_lng ) - radians('. $venueLng .') ) + sin( radians(' . $venueLat . ') ) * sin( radians( geo_lat ) ) ) ) AS distance' ), 'conditions' => array( 'Venue.publish_state_id' => Configure::read('Venue.published'), 'Venue.id !=' => $venueId ), 'group' => array( "Venue.id HAVING distance <= $distance"), 'order' => 'distance', 'limit' => $limit, 'contain' => array('City.name', 'CityRegion.name', 'CityNeighbourhood.name', 'Intersection.name' ) ) ); //debug($result); exit; if ($result) { return($result); } else { return false; } }
[ "function _getNearByVenues( $venueLatt, $venueLong ) {\r\n\t\t$distance = 1; // 1000 metres\r\n\r\n\t\t$venueLatt = floatval($venueLatt);\r\n\t\t$venueLong = floatval($venueLong);\r\n\r\n\t\t$result1 = $this->Venue->query( \"SELECT Venue.name, Venue.subname, Venue.slug, Venue.address, Venue.geo_latt, Venue.geo_long, Venue.slug, Venue.flag_published,\r\n\t\t\t\t\t\t\t\t(6371 * acos( cos( radians( $venueLatt ) ) * cos( radians( geo_latt ) ) *\r\n\t\t\t\t\t\t\t\t\tcos( radians( geo_long ) - radians( $venueLong ) ) + sin( radians( $venueLatt ) ) *\r\n\t\t\t\t\t\t\t\t\tsin( radians( geo_latt ) ) ) ) AS distance,\r\n\t\t\t\t\t\t\t\t\tVenueType.name\r\n\r\n\t\t\t\t\t\t\t\tFROM venues As Venue\r\n\t\t\t\t\t\t\t\tLEFT JOIN `venue_types` AS `VenueType` ON (`Venue`.`venue_type_id` = `VenueType`.`id`)\r\n\t\t\t\t\t\t\t\tHAVING distance <= $distance AND Venue.flag_published = 1\r\n\t\t\t\t\t\t\t\tORDER BY distance\r\n\t\t\t\t\t\t\t\tLIMIT 1 , 10;\");\r\n\r\n \r\n\r\n /* //debug($calc);\r\n $this->Venue->contain('VenueType.name');\r\n $result2 = $this->Venue->find('all', array(\r\n 'fields' => array( 'Venue.name', 'Venue.subname', 'Venue.slug', 'Venue.address',\r\n \"6371 * acos( cos( radians( {$venueLatt} ) ) *\r\n cos( radians( geo_latt ) ) *\r\n cos( radians( geo_long ) - radians( {$venueLong} ) ) +\r\n sin( radians( {$venueLatt} ) ) * sin( radians( geo_latt ) ) ) AS distance \"\r\n ),\r\n\r\n 'conditions' => array( 'distance <=' => $distance, 'Venue.flag_published' => 1), //'distance <=' => $distance,\r\n 'order' => ' `distance` ASC ',\r\n 'limit' => array() //'1,10'\r\n )\r\n );\r\n\r\n debug($result1);debug($result2); exit(); */\r\n\r\n //debug($result1);\r\n\t\tif ($result1) {\r\n\t\t\treturn($result1);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getVenues($lat, $lng)\n {\n\n $cache = $this->getCache();\n $cacheKey = 'foursquare-venues-for-lat-' . $lat . '-and-long-' . $lng;\n\n // Verify if we have data in the Cache.\n if (!$cache->contains($cacheKey)) {\n\n $cat = str_replace(\" \", ',', $this->_categories);\n $url = \"https://api.foursquare.com/v2/venues/search?v=20120610&ll={$lat},{$lng}&intent=browse&radius=9500&limit=100&categoryId=\" . $cat . \"&client_id=\" . $this->key . \"&client_secret=\" . $this->secret;\n $result = file_get_contents($url); // do the call.\n $venues = json_decode($result, true);\n $spots = array('venues' => array());\n\n if ($venues['meta']['code'] == 200) {\n foreach ($venues['response'] as $venues) {\n $i = 0;\n foreach ($venues as $venue) {\n\n // Check if the joint has more than 10 check-ins ever.\n if ($venue['stats']['checkinsCount'] > 10) {\n $spots['venues'][$i]['id'] = isset($venue['id']) ? $venue['id'] : '';\n $spots['venues'][$i]['name'] = isset($venue['name']) ? $venue['name'] : '';\n $spots['venues'][$i]['latitude'] = isset($venue['location']['lat']) ? $venue['location']['lat'] : '';\n $spots['venues'][$i]['longitude'] = isset($venue['location']['lng']) ? $venue['location']['lng'] : '';\n $spots['venues'][$i]['address'] = isset($venue['location']['address']) ? $venue['location']['address'] : '';\n $spots['venues'][$i]['crossStreet'] = isset($venue['location']['crossStreet']) ? $venue['location']['crossStreet'] : '';\n $spots['venues'][$i]['city'] = isset($venue['location']['city']) ? $venue['location']['city'] : '';\n $spots['venues'][$i]['state'] = isset($venue['location']['state']) ? $venue['location']['state'] : '';\n $spots['venues'][$i]['postalCode'] = isset($venue['location']['postalCode']) ? $venue['location']['postalCode'] : '';\n $spots['venues'][$i]['country'] = isset($venue['location']['country']) ? $venue['location']['country'] : '';\n $spots['venues'][$i]['url'] = isset($venue['url']) ? $venue['url'] : '';\n $spots['venues'][$i]['people'] = isset($venue['hereNow']['count']) ? $venue['hereNow']['count'] : '';\n $spots['venues'][$i]['categories'] = $venue['categories'];\n $spots['venues'][$i]['contact'] = $venue['contact'];\n $spots['venues'][$i]['stats'] = $venue['stats'];\n\n $i++;\n }\n }\n }\n }\n\n // Store the array in the Cache.\n $cache->save($cacheKey, $spots, 600);\n } else {\n // Fetch the array in case we already had it in the cache.\n $spots = $cache->fetch($cacheKey);\n }\n\n // return the JSON Object.\n return json_encode($spots);\n }", "function find_distance($start_state, $start_city, $radius, $cityfile) {\n\t$cities = json_decode(add_headers_to_json($cityfile));\n\t$start_city = str_replace(\"-\", \" \", $start_city);\n\t$start_city = find_city_by_name($cityfile, $start_city, $start_state);\n\t$nearby_cities = array();\n\n\t$lon1 = deg2rad($start_city->longitude); // convert from degrees to radians\n\t$lat1 = deg2rad($start_city->latitude);\n\t$earth_radius = 3959; //in miles\n\t\n\tforeach ($cities as $city) {\n\t\t$lon2 = deg2rad($city->longitude);\n\t\t$lat2 = deg2rad($city->latitude);\n\n\t\t//determine difference\n\t\t$latDelta = $lat1 - $lat2;\n\t\t$lonDelta = $lon1 - $lon2;\n\n\t\t//Vicenty formula\n\t\t$lonDelta = $lon1 - $lon2;\n\t\t$a = pow(cos($lat1) * sin($lonDelta), 2) +\n\t\t pow(cos($lat2) * sin($lat1) - sin($lat2) * cos($lat1) * cos($lonDelta), 2);\n\t\t$b = sin($lat2) * sin($lat1) + cos($lat2) * cos($lat1) * cos($lonDelta);\n\n\t\t$angle = atan2(sqrt($a), $b);\n\t\t$distance= $angle * $earth_radius;\n\n\t \tif ($distance <= $radius && $distance != 0) {\n\t \t\t// for UI\n\t \t\t// echo $city->name.\", \".$city->state.': '.$distance.' miles away<br>';\n\t \t\t$nearby_cities[] = $city;\n\t \t}\n\t}\n\treturn $nearby_cities;\n}", "function api_whosonfirst_places_getIntersects(){\n\n\t\tapi_utils_features_ensure_enabled(array(\n\t\t\t\"spatial\", \"spatial_intersects\"\n\t\t));\n\n\t\t$swlat = null;\n\t\t$swlon = null;\n\n\t\t$nelat = null;\n\t\t$nelon = null;\n\n\t\tif ($wofid = request_int64(\"id\")){\t\t\n\t\t\tapi_output_error(501);\n\t\t}\n\n\t\telse {\n\n\t\t\t$swlat = request_float(\"min_latitude\");\n\t\t\t$swlat = trim($swlat);\n\n\t\t\tif (! $swlat){\n\t\t\t\tapi_output_error(432);\n\t\t\t}\n\n\t\t\tif (! geo_utils_is_valid_latitude($swlat)){\n\t\t\t\tapi_output_error(436);\n\t\t\t}\n\n\t\t\t$swlon = request_float(\"min_longitude\");\n\t\t\t$swlon = trim($swlon);\n\n\t\t\tif (! $swlon){\n\t\t\t\tapi_output_error(433);\n\t\t\t}\n\n\t\t\tif (! geo_utils_is_valid_longitude($swlon)){\n\t\t\t\tapi_output_error(437);\n\t\t\t}\n\t\t\t\n\t\t\t$nelat = request_float(\"max_latitude\");\n\t\t\t$nelat = trim($nelat);\n\n\t\t\tif (! $nelat){\n\t\t\t\tapi_output_error(434);\n\t\t\t}\n\n\t\t\tif (! geo_utils_is_valid_latitude($nelat)){\n\t\t\t\tapi_output_error(438);\n\t\t\t}\n\n\t\t\t$nelon = request_float(\"max_longitude\");\n\t\t\t$nelon = trim($nelon);\n\n\t\t\tif (! $nelon){\n\t\t\t\tapi_output_error(435);\n\t\t\t}\n\n\t\t\tif (! geo_utils_is_valid_longitude($nelon)){\n\t\t\t\tapi_output_error(439);\n\t\t\t}\n\n\t\t\tif ($swlat > $nelat){\n\t\t\t\tapi_output_error(436);\n\t\t\t}\n\n\t\t\tif ($swlon > $nelon){\n\t\t\t\tapi_output_error(437);\n\t\t\t}\n\t\t}\n\n\t\t$more = array();\n\n\t\tif ($cursor = request_str(\"cursor\")){\n\n\t\t\tapi_whosonfirst_places_ensure_valid_cursor($cursor);\n\t\t\t$more['cursor'] = $cursor;\n\t\t}\n\n\t\tif ($placetype = request_str(\"placetype\")){\n\n\t\t\tapi_whosonfirst_places_ensure_valid_placetype($placetype);\n\t\t\t$more['wof:placetype_id'] = whosonfirst_placetypes_name_to_id($placetype);\n\t\t}\n\n\t\t$flags = api_whosonfirst_ensure_existential_flags();\n\t\t$more = array_merge($more, $flags);\n\n\t\tif ($extras = api_whosonfirst_utils_get_extras()){\n\t\t\t$more[\"extras\"] = $extras;\n\t\t}\n\n\t\tapi_utils_ensure_pagination_args($more);\n\n\t\t$rsp = whosonfirst_spatial_intersects($swlat, $swlon, $nelat, $nelon, $more);\n\n\t\tif (! $rsp['ok']){\n\t\t\tapi_output_error(513);\n\t\t}\n\n\t\t$results = whosonfirst_spatial_inflate_results($rsp);\n\n\t\t$pagination = $rsp['pagination'];\n\n\t\t$more['is_tile38'] = 1;\t# because this: https://github.com/whosonfirst/whosonfirst-www-api/issues/8\n\t\tapi_whosonfirst_output_enpublicify($results, $more);\n\n\t\t$out = array(\n\t\t\t'places' => $results\n\t\t);\n\n\t\tif ($GLOBALS['cfg']['environment'] == 'dev'){\n\t\t\t$out['_query'] = $rsp['command'];\n\t\t}\n\n\t\tapi_utils_ensure_pagination_results($out, $pagination);\n\n\t\t$more = array(\n\t\t\t'key' => 'places',\n\t\t);\n\n\t\tapi_output_ok($out, $more);\n\t}", "function venues($geolat, $geolong, $q = null, $l = null) {\n\t \n\t $params = array_filter(compact('geolat', 'geolong', 'q', 'l'));\n\t \n\t\t$url = \"http://api.foursquare.com/v1/venues\";\n\t\treturn $this->__processGroups($this->Http->get($url, $params, $this->__getAuthHeader()));\n\t\t\n\t}", "public function CityLatLngRadiusRating($lat1,$long1,$city1,$radius1,$rating1) {\n\t\n\t\t$radius_new = $radius1 * 1609.34;\n\t\trequire_once 'rendezvousClass.php';\n\t\t$data = new Rendezvous();\n\t\t$newCity = str_replace(\" \", \"%2B\", $city1);\n\t\t\n\t\t$resp_oauthtoken = file_get_contents ( \"https://api.foursquare.com/v2/venues/explore?ll=$lat1,$lng1&radius=$radius_new&near=$newCity&oauth_token=34BKKF5OYKVTDBGZEWADDVHZB1NJQHZ2AEIOSOD0LRQ3T3KL&v=20151125\");\n\t\t$obj = json_decode ( $resp_oauthtoken, true );\n\t\t\n\t\t$result = array ();\n\t\t\n\t\tif (floatval ( $obj ['meta'] ['code'] ) == 200) {\n\t\tfor($i = 0; $i < sizeOf ( $obj ['response'] ['groups'] ['0'] ['items']); $i ++) {\n\t\t\t\tif (floatval ( $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['rating'] ) >= floatval ( $rating1 )) {\n\t\t\t\t\t$id = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['id'];\n\t\t\t\t\t$venueName = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['name'];\n\t\t\t\t\t$venueAddress = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['address'];\n\t\t\t\t\t$venueLatitude = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['lat'];\n\t\t\t\t\t$venueLongitude = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['lng'];\n\t\t\t\t\t$city = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['city'];\n\t\t\t\t\t$state = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['state'];\n\t\t\t\t\t$phone = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['contact']['formattedPhone'];\n\t\t\t\t\t$rating = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['rating'];\n\t\t\t\t\t$url = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['url'];\n\t\t\t\t\t$zipcode = $obj ['response'] ['groups'] ['0'] ['items'] [$i] ['venue'] ['location']['postalCode'];\n\t\t\t\t\t$resultlatlongrr = array (\n\t\t\t\t\t\t\t\"id\" => $id,\n\t\t\t\t\t\t\t\"name\" => $venueName,\n\t\t\t\t\t\t\t\"address\" => $venueAddress,\n\t\t\t\t\t\t\t\"lat\" => $venueLatitude,\n\t\t\t\t\t\t\t\"lng\" => $venueLongitude,\n\t\t\t\t\t\t\t\"city\" => $city,\n\t\t\t\t\t\t\t\"state\" => $state,\n\t\t\t\t\t\t\t\"phone\" => $phone,\n\t\t\t\t\t\t\t\"rating\" => $rating,\n\t\t\t\t\t\t\t\"url\"=>$url,\n\t\t\t\t\t\t\t\"zipcode\"=>$zipcode\n\t\t\t\t\t);\n\t\t\t\t\tarray_push($result,$resultlatlongrr);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tif (sizeOf ( $result ) >= 1) {\n\t\t\t\t$insertReturn = $data->insertVenue($result);\n\t\t\t} else {\n\t\t\t\techo $obj ['response'] ['warning'] ['text'];\n\t\t\t}\t\t\t\n\t\t\t$returnData = $data->selectVenueDataFromCityLatLongRatingRadius($city1, $lat1, $lng1, $rating1, $radius1);\t\t\t\n\t\t\treturn $returnData;\n\t\t} else\n\t\t\t\n\t\t\treturn \"Please check the credential again !!\";\n\t}", "function getClosestLava($result) {\n $locationLong = $_GET['locationLong'];\n $locationLat = $_GET['locationLat'];\n \n // Stores each lavatory and its distance\n $lavatories = array();\n \n // Will eventually store the closest lavatory\n $closestLava = array();\n \n // Populate the lavatories array with the query results\n while ($next = pg_fetch_array($result, NULL, PGSQL_ASSOC)) {\n $lavaLong = $next['longitude'];\n $lavaLat = $next['latitude'];\n \n // Calculate the lavatory's distance from the user\n $distance = getDistance(deg2rad($locationLat), deg2rad($locationLong),\n deg2rad($lavaLat), deg2rad($lavaLong));\n \n // Store this lavatory and its distance in lavatories\n $newEntry = array('lid' => $next['lavatory_id'],\n 'building' => $next['building_name'],\n 'room' => $next['room_number'],\n 'distance' => $distance,\n 'reviews' => $next['num_reviews'],\n 'type' => $next['lavatory_type'],\n 'latitude' => $next['latitude'],\n 'longitude' => $next['longitude'],\n 'floor' => $next['floor']);\n\n // Safely calculate the average rating\n if ($next['num_reviews'] == 0) {\n $newEntry['avgRating'] = 0;\n } else {\n $newEntry['avgRating'] = $next['rating_total']\n / $next['num_reviews'];\n }\n\n array_push($lavatories, $newEntry);\n }\n \n // Iterate through lavatories and find the lavatory with minimum distance\n $closestLava = $lavatories[0];\n foreach ($lavatories as $lavatory) {\n if ($closestLava['distance'] > $lavatory['distance']) {\n $closestLava = $lavatory;\n }\n }\n\n return $closestLava;\n}", "function get_nearby_cities($lat, $long, $distance){\n global $wpdb;\n $nearbyCities = $wpdb->get_results( \n \"SELECT DISTINCT \n city_latitude.post_id,\n city_latitude.meta_key,\n city_latitude.meta_value as cityLat,\n city_longitude.meta_value as cityLong,\n ((ACOS(SIN($lat * PI() / 180) * SIN(city_latitude.meta_value * PI() / 180) + COS($lat * PI() / 180) * COS(city_latitude.meta_value * PI() / 180) * COS(($long - city_longitude.meta_value) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance,\n wp_posts.post_title\n FROM \n wp_postmeta AS city_latitude\n LEFT JOIN wp_postmeta as city_longitude ON city_latitude.post_id = city_longitude.post_id\n INNER JOIN wp_posts ON wp_posts.ID = city_latitude.post_id\n WHERE city_latitude.meta_key = 'city_latitude' AND city_longitude.meta_key = 'city_longitude'\n HAVING distance < $distance\n ORDER BY distance ASC;\"\n );\n\n if($nearbyCities){\n return $nearbyCities;\n }\n}", "function nearestLocations($lat1, $lon1, $listings, $size) { \n //array of closest objects\n $closest = [];\n for ($i = 0; $i < count($listings); $i++) {\n $lat = $listings[$i]->latitude;\n $lon = $listings[$i]->longitude;\n $dist = haversineGreatCircleDistance($lat1, $lon1, $lat, $lon);\n if (count($closest) < $size and $dist != 0) {\n $closest[$dist] = $listings[$i];\n } else if ($dist != 0) {\n $closest = compareDist($closest, $dist, $listings[$i]);\n }\n }\n return $closest;\n}", "function assign_district($lat,$long){\n\t// conversion table\n\t$lat_a=array(\"Central and Western\"=>22.279991,\"Eastern\"=>22.273389,\"Islands\"=>22.262792,\"Kowloon City\"=>22.33066,\"Kwai Tsing\"=>22.354908,\"Kwun Tong\"=>22.310369,\"North\"=>22.500908,\"Sai Kung\"=>22.383689,\"Sha Tin\"=>22.37713,\"Sham Shui Po\"=>22.32859,\"Southern\"=>22.243216,\"Tai Po\"=>22.442322,\"Tsuen Wan\"=>22.371323,\"Tuen Mun\"=>22.390829,\"Wan Chai\"=>22.276022,\"Wong Tai Sin\"=>22.342962,\"Yau Tsim Mong\"=>22.311603,\"Yuen Long\"=>22.444538);\n\t$long_a=array(\"Central and Western\"=>114.158798,\"Eastern\"=>114.236078,\"Islands\"=>113.965542,\"Kowloon City\"=>114.192017,\"Kwai Tsing\"=>114.126099,\"Kwun Tong\"=>114.222703,\"North\"=>114.155826,\"Sai Kung\"=>114.270787,\"Sha Tin\"=>114.19744,\"Sham Shui Po\"=>114.160285,\"Southern\"=>114.19744,\"Tai Po\"=>114.165506,\"Tsuen Wan\"=>114.11416,\"Tuen Mun\"=>113.972513,\"Wan Chai\"=>114.175147,\"Wong Tai Sin\"=>114.192981,\"Yau Tsim Mong\"=>114.170688,\"Yuen Long\"=>114.022208);\n\n\t$distsq_min=100;\n\t$current_district=\"\";\n\t// find nearest point and assign that to be this district\n\tforeach($lat_a as $district=>$this_lat){\n\t\t$this_long = $long_a[$district];\n\t\t$latmean = deg2rad(($lat+$this_lat)/2);\n\t\t$latdiff = deg2rad($lat-$this_lat);\n\t\t$longdiff = deg2rad($long-$this_long);\n\t\t$distsq = pow($latdiff,2) + pow(pow(cos($latmean),2)*$longdiff,2);\n\t\tif ($distsq<$distsq_min){\n\t\t\t$distsq_min=$distsq;\n\t\t\t$current_district=$district;\n\t\t}\n\t}\n\treturn $current_district;\n\t\n}", "public function getLocations($sourceLat='',$sourceLon='',$radiusKm = 5){\n\n require_once 'GoogleMap.php';\n $location = array();\n $proximity = GoogleMap::mathGeoProximity($sourceLat, $sourceLon, $radiusKm); \n\n $SQL = \"SELECT * FROM s00_02_locations WHERE (latit BETWEEN \" . number_format($proximity['latitudeMin'], 12, '.', '') . \"\n AND \" . number_format($proximity['latitudeMax'], 12, '.', '') . \")\n AND (longit BETWEEN \" . number_format($proximity['longitudeMin'], 12, '.', '') . \"\n AND \" . number_format($proximity['longitudeMax'], 12, '.', '') . \") \";\n\n\n // $SQL = \"SELECT * , ( 3959 * ACOS( COS( RADIANS( 6.843419 ) ) * COS( RADIANS( $sourceLat ) ) * COS( RADIANS( $sourceLon ) - RADIANS( 79.957329 ) ) + SIN( RADIANS( 6.843419 ) ) * SIN( RADIANS( $sourceLat ) ) ) ) AS distance\n // FROM s00_02_locations\n // WHERE `shop_code` = '$shop_code'\n // HAVING distance < $radiusKm\";\n \n $rslt = mysqli_query($this->conn,$SQL);\n while($row = mysqli_fetch_assoc($rslt)){\n $objLocation = new stdClass();\n $objLocation->shop_code = $row['shop_code'];\n $objLocation->name = $row['name'];\n $objLocation->description = $row['description'];\n $objLocation->address = $row['address'];\n $objLocation->featured = $row['featured'];\n $objLocation->longit = $row['longit'];\n $objLocation->latit = $row['latit'];\n $objLocation->contact_no = $row['contact_no'];\n $objLocation->open_hours = $row['open_hours'];\n $objLocation->closed_hours = $row['closed_hours'];\n $objLocation->availability = $row['availability'];\n $objLocation->categories = $this->getLocationCategories($row['shop_code']);\n $objLocation->created_at = $row['created_at'];\n $objLocation->saving_upto = $row['saving_upto'];\n $objLocation->images = $this->getImages($row['shop_code'],'s00_02_locations');\n\n array_push($location, $objLocation);\n }\n return $location; \n }", "function getPlaces($ll) {\n\n // search by lat/lng, sort by distance, limit to 50 (max possible), set radius to 10km.\n $url = \"https://api.foursquare.com/v3/places/nearby?ll=\".$ll->lat.\",\".$ll->lng.\"&sort=distance&limit=50&radius=10000\";\n\n // Curl\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Accept: application/json',\n 'Authorization: '.$apikey\n ));\n\n $json=curl_exec($ch);\n\n $a = json_decode($json);\n\n // Update the checkins table to include the JSON object containing the closest venues for each checkin.\n $query = \"UPDATE checkins SET nearby = '\".pg_escape_string($json).\"' WHERE fullurl = '\".$ll->fullurl.\"'\";\n pg_query($query) or die(pg_last_error());\n\n }", "function haversine($lat1, $long1, $lat2, $long2) {\n static $numCalls = 0;\n \n return ( $numCalls++ % 3 ) * IN_RANGE_MAX_DISTANCE;\n }", "function findNearTrips($location, $destination, $dateFrom, $dateTo, $priceFrom, $priceTo, array $inTrips, User $passenger, $distance);", "public function findAllVenuesByProximity($lat, $long, $distance, $unit = 'KM') {\n\t\t\t\t\t\t\t\t$earthRadius = $unit == 'KM' ? 6371 : 3958;\n\t\t\t\t\t\t\t\t$q =\"SELECT\n\t\t\t\t\t\t\t\tid, (\n\t\t\t\t\t\t\t\t\t\t{$earthRadius} * acos (\n\t\t\t\t\t\t\t\t\t\t\t\tcos ( radians({$lat}) )\n\t\t\t\t\t\t\t\t\t\t\t\t* cos( radians( latitude ) )\n\t\t\t\t\t\t\t\t\t\t\t\t* cos( radians( longitude ) - radians({$long}) )\n\t\t\t\t\t\t\t\t\t\t\t\t+ sin ( radians({$lat}) )\n\t\t\t\t\t\t\t\t\t\t\t\t* sin( radians( latitude ) )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) AS distance\n\t\t\t\t\t\t\t\tFROM venue\n\t\t\t\t\t\t\t\tHAVING distance < {$distance}\n\t\t\t\t\t\t\t\tORDER BY distance;\";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$results = $this->doQuery($q);\n\t\t\t\t\t\t\t\t$venues = $this->load($results);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Populate the distance from the user\n\t\t\t\t\t\t\t\tforeach ($venues as $venue) {\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($result->id === $venue->id) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$venue->distanceFromUser = $result->distance;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\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\treturn $venues;\n\t\t\t\t}", "function LocationsInArea($longitude, $lattitude,$distance){\n\n$sdb = dbconnect();\n$sc = new MongoCollection($sdb,'locations');\n$lnglat = array($longitude, $lattitude);\n$LocationsinArea = $sc->aggregate(\narray('$geoNear'=>array('near' => $lnglat, 'maxDistance' =>$distance, 'distanceField'=>'dist.calculated', 'spherical' => true))\n);\n$AllLocations = $LocationsinArea['result'];\nreturn $AllLocations;\n}", "function find_carpool_match($lat1,$lon1){\n\t\tglobal $connection;\n $query = \"SELECT *, \n\t\t\t\t( 3959 * acos( cos( radians('$lat1') ) * \n\t\t\t\t cos( radians( Lat ) ) * \n\t\t\t\t cos( radians( Lng ) - \n\t\t\t\t radians('$lon1') ) + \n\t\t\t\t sin( radians('$lat1') ) * \n\t\t\t\t sin( radians( Lat ) ) ) ) \n\t\t\t\t AS distance FROM employees WHERE NeedCarpool=1 HAVING distance < 5 ORDER BY distance ASC LIMIT 0, 10\";\n\n\t\t$result = mysqli_query($connection,$query);\n confirm_query($result);\n if($result)\n return $result;\n else\n return null; \n \n }", "function getTotalRouteDistance($startStop,$firstJunction,$secondJunction,$intermediateDistance,$endStop,$startOffsetDistance,$endOffsetDistance)\r\n{\r\n\t\r\n\t//latitude & longitude for startStop\r\n\t$query=\"SELECT Latitude, Longitude FROM Stops WHERE (StopName ='\".$startStop.\"')\";\r\n\t$result=mysql_query($query);\r\n\t$row=mysql_fetch_row($result);\r\n\t\r\n\t$lat1=$row[0];\r\n\t$lon1=$row[1];\r\n\r\n\t//latitude & longitude for firstJunction\r\n\t$query=\"SELECT Latitude, Longitude FROM Stops WHERE (StopName ='\".$firstJunction.\"')\";\r\n\t$result=mysql_query($query);\r\n\t$row=mysql_fetch_row($result);\r\n\t$lat2=$row[0];\r\n\t$lon2=$row[1];\r\n\t\r\n\t$dist1=distance($lat1, $lon1, $lat2, $lon2, \"K\");\r\n\t \r\n\t//latitude & longitude for secondJunction\r\n\t$query=\"SELECT Latitude, Longitude FROM Stops WHERE (StopName ='\".$secondJunction.\"')\";\r\n\t$result=mysql_query($query);\r\n\t$row=mysql_fetch_row($result);\r\n\t$lat3=$row[0];\r\n\t$lon3=$row[1];\r\n\r\n\t//latitude & longitude for endStop\r\n\t$query=\"SELECT Latitude, Longitude FROM Stops WHERE (StopName ='\".$endStop.\"')\";\r\n\t$result=mysql_query($query);\r\n\t$row=mysql_fetch_row($result);\r\n\t$lat4=$row[0];\r\n\t$lon4=$row[1];\r\n\t\r\n\t$dist2=distance($lat3, $lon3, $lat4, $lon4, \"K\");\r\n\r\n\t$total=$startOffsetDistance+$dist1+$intermediateDistance+$dist2+$endOffsetDistance;\r\n\treturn $total;\r\n\r\n}", "private function _gooleNearby()\n {\n\n $latLong = $this->getLatLong();\n\n $query = $this->httpClient->get(env('NEARBY_URL'), [\n 'query' => [\n 'key' => env('GOOGLE_API_KEY'),\n 'types' => 'real_estate_agency,lodging,establishment',\n 'location' => implode(',', $latLong),\n 'radius' => 5000,\n //'radius-in-meters-max-50-000-meters',\n ],\n ]);\n $response = json_decode($query->getBody()->getContents());\n $result = [];\n foreach ($response->results as $item) {\n $result[] = $item;\n }\n\n while (!empty($response->next_page_token)) {\n\n sleep(2); // Google forced us to wait before calling next request\n\n $query = $this->httpClient->get(env('NEARBY_URL'), [\n 'query' => [\n 'key' => env('GOOGLE_API_KEY'),\n 'pagetoken' => $response->next_page_token,\n ],\n ]);\n\n $response = json_decode($query->getBody()->getContents());\n\n foreach ($response->results as $item) {\n $result[] = $item;\n }\n }\n\n return $result;\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns tenant scope for this model.
public static function getTenantScope() { return TenantScopeFacade::getFacadeRoot(); }
[ "public function get_scope()\n {\n return $this->scope;\n }", "public function getScope()\n {\n return $this->fields['scope'];\n }", "public function getTenantObject()\n {\n return $this->tenant;\n }", "public function getTenant()\n {\n return $this->hasOne(TenantDetails::className(), ['Tenant_id' => 'Tenant_id']);\n }", "public function get_scope()\r\n\t{\r\n\t\treturn $this->get_attr('scope');\r\n\t}", "public function tenant(): BelongsTo\n {\n return $this->belongsTo(config('tenant.models.tenant'), config('tenant.foreign_key'));\n }", "public function Tenant() \n {\n if (time() > ($this->expiration-RAXSDK_FUDGE)) {\n $this->Authenticate();\n }\n return $this->tenant;\n }", "public function getScope()\n\t{\n\t\treturn $this->scopes[0]??null;\n\t}", "public function getScopesRelation()\n {\n return parent::getScopes();\n }", "public function GetScope() {\n \t$separator = $this->getScopeSeparator();\n \treturn implode($separator, $this->config->get('Client_Data', 'scope'));\n }", "public function getScopeType()\n {\n return $this->scopeType;\n }", "public function getScope(): string {\n return (string) $this->getAttribute('scope');\n }", "public function tenant()\n {\n // Because some users aren't belongs any tenant\n return $this->belongsToMany(Tenant::class);\n }", "public static function tenant() {\n if (self::$handler) {\n return self::$handler->getTenant();\n }\n\n $qualifier = self::_getTenantQualifier();\n\n if ($qualifier) {\n $tenant = Cache::read($qualifier);\n if (!$tenant) {\n throw new MultiTenantException(\"MTApp::tenant() tenant not defined\");\n }\n $modelConf = self::config('model');\n $tbl = TableRegistry::get($modelConf['className']);\n $entity = $tbl->newEntity($tenant);\n $entity->set('id', $tenant['id']);\n return $entity;\n }\n\n throw new MultiTenantException(\"MTApp::tenant() tenant not defined\");\n }", "public function getScopes()\n {\n return $this->scopes;\n }", "public function getAdminScope()\n {\n $scope = 'default';\n $scopeId = 0;\n $scopeCode = '';\n if ($storeCode = Mage::app()->getRequest()->getParam('store')) {\n $scope = 'stores';\n $scopeId = (int)Mage::getConfig()->getNode('stores/' . $storeCode . '/system/store/id');\n $scopeCode = $storeCode;\n } elseif ($websiteCode = Mage::app()->getRequest()->getParam('website')) {\n $scope = 'websites';\n $scopeId = (int)Mage::getConfig()->getNode('websites/' . $websiteCode . '/system/website/id');\n $scopeCode = $websiteCode;\n }\n\n return array('scope' => $scope, 'scope_id' => $scopeId, 'scope_code' => $scopeCode);\n }", "public function getTenant()\n {\n return $this\n ->em\n ->getRepository($this->entityName)\n ->findOneBy(array($this->fieldName => $this->hostName))\n ;\n }", "public function scopes()\n {\n return $this->scopes;\n }", "public function getTableScope()\n {\n return $this->cfgTableScope;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the byte counter of a chain.
public function getChainByteCounter($table, $chain) { if (isset($this->fileTree[$table][$chain]['byte-counter'])) return $this->fileTree[$table][$chain]['byte-counter']; return NULL; }
[ "public function count_bytes() : int {\n $bytes = 0;\n foreach ($this->lines as $line) { $bytes += strlen($line); }\n return $bytes;\n }", "function getDownloadCount() {\n\t\t\t$cache = $this->readCache();\n\t\t\treturn $cache[12];\n\t\t}", "public function getReceivedBytes(): int;", "public function getChainId() : int\n {\n $chainId = null;\n $this->web3->net->version(function($err, $res) use (&$chainId) {\n if ($err) {\n throw new \\Exception($err->getMessage(), $err->getCode());\n } else {\n $chainId = $res;\n }\n });\n\n \n if (is_string($chainId)) {\n return intval($chainId);\n } else {\n throw new \\Exception(\"There was a problem retrieving the chain id!\", 14000);\n }\n }", "public function getBouncedCount();", "public function getCertificateCount();", "public function getCounter()\n {\n return $this->redis->get($this->counterKey);\n }", "public function getTorrentCount(): int\n {\n return $this->torrentCount;\n }", "public function totalHashCount() : int;", "public function count()\n {\n return count($this->buffer);\n }", "public function getSentBytes(): int;", "public function byteCount()\n\t{\n\t\treturn strlen($this->string);\n\t}", "public function get_block_count() {\n return $this->_execute('getblockcount')['count'];\n }", "public function getCounter() {\n $provider = new Pfb_Provider_HttpProvider();\n $provider->setObjectSource('http://urls.api.twitter.com/1/urls/count.json?url=' . rawurlencode($this->referenceUrl) . '&callback=twttr.receiveCount');\n $json = json_decode(preg_replace('#.*(\\{.+\\}).*#s', '$1', $provider->requestObject('GET')->getBody()));\n return (int)$json->{'count'};\n }", "public function countPeers()\n {\n return PeerCount::createFromJson($this->getJson('COUNTPEERS'));\n }", "public function getDownloadsCount() {\n\t\treturn Stash::instance()->get(DownloadsCounter::PROPERTY, $this);\n\t}", "public function bytesReceived() : int\n {\n return $this->bytesReceived;\n }", "public function getTxoctetcount(): int\n {\n return $this->txoctetcount;\n }", "public function getCountOfChars() {\n\t\treturn $this->countChars($this->message . $this->signature);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delivery servers usage logs
public function actionDelivery_servers_usage_logs() { $request = Yii::app()->request; $log = new DeliveryServerUsageLog('search'); $log->unsetAttributes(); $log->attributes = (array)$request->getQuery($log->modelName, array()); $this->setData(array( 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('misc', 'View delivery servers usage logs'), 'pageHeading' => Yii::t('misc', 'View delivery servers usage logs'), 'pageBreadcrumbs' => array( Yii::t('misc', 'Delivery servers usage logs'), ) )); $this->render('delivery-servers-usage-logs', compact('log')); }
[ "public function get_delivery_stats() {\n\t\t\t\treturn $this->build_request()->fetch( '/deliverystats' );\n\t\t}", "public function get_delivery_logs()\n {\n }", "public function do_server_side_stats() {\n\t\t$urls = $this->get_stats_urls();\n\t\tforeach ( $urls as $url ) {\n\t\t\t$this->do_server_side_stat( $url );\n\t\t}\n\t\t$this->stats = array();\n\t}", "private function usageStats()\n {\n if ( self::USAGE_STATS )\n {\n try\n {\n $er = error_reporting( );\n error_reporting( 0 );\n file_get_contents( 'http://stats.nicholasdejong.com/usage.php?t=class&n=' . __CLASS__, FALSE, stream_context_create( array (\n\n 'http' => array (\n\n 'timeout' => 2\n )\n ) ) );\n error_reporting( $er );\n }\n catch ( Exception $e )\n {\n }\n }\n }", "public static function sendReportMetrics()\n {\n $uc_settings = Settings::instance()->getValues('Upgrade_center');\n $license_number = $uc_settings['license_number'];\n\n if ($license_number) {\n $metrics = fn_get_schema('reporting', 'metrics');\n\n foreach ($metrics as &$value) {\n if (is_callable($value)) {\n $value = call_user_func($value);\n }\n }\n unset($value);\n\n $logging = Http::$logging;\n Http::$logging = false;\n\n Http::post(\n Registry::get('config.resources.updates_server') . '/index.php?dispatch=license_tracking.report',\n array(\n 'metrics' => $metrics,\n 'license_number' => $license_number\n ),\n array(\n 'timeout' => 10\n )\n );\n\n Http::$logging = $logging;\n }\n }", "function update_statistics() {\n\n\t\t// 1. Get the number of pages from yesterday\n\t\t$this->db->query(\n\t\t\t\"insert into logging values (\n\t\t\t\tdate_trunc('d', now() - interval '1 day') ,\n\t\t\t\t'pages',\n\t\t\t\t(select count(*)\n\t\t\t\tfrom page\n\t\t\t\twhere created between date_trunc('d', now() - interval '1 day')\n\t\t\t\t\t\t and date_trunc('d', now() + interval '1 day'))\n\t\t\t)\"\n\t\t);\n\n\t\t// 2. Get the total number of pages scanned\n\t\t$this->db->query(\n\t\t\t\"insert into logging values (\n\t\t\t\tdate_trunc('d', now() - interval '1 day') ,\n\t\t\t\t'total-pages',\n\t\t\t\t(select count(*) from page)\n\t\t\t)\"\n\t\t);\n\n\t\t// 3. Get the number of bytes used in the /books/ directory\n\t\t$output = array();\n\t\texec('du -sk '.$this->cfg['data_directory'], $output);\n\t\t$bytes = preg_replace('/ +\\.$/', '', $output[0]);\n\t\t$this->db->query(\n\t\t\t\"insert into logging values (\n\t\t\t\tdate_trunc('d', now() - interval '1 day') ,\n\t\t\t\t'disk-usage',\n\t\t\t\t\".($bytes * 1024).\"\n\t\t\t)\"\n\t\t);\n\n\t}", "public static function flushStatsOutput()\n {\n static::$addStatsToQueue = false;\n static::sendAllStats();\n }", "private function serverUptime() {\n\t \t$pattern = '/Server uptime:\\s([0-9a-z\\ ]+)\\<\\/dt\\>/';\n\t\tpreg_match($pattern, $this->_curl_response, $matches);\n\t\t$this->_data[] = array(\"server_uptime\",$matches[1]);\t\n\t}", "public function statistics_collector($params) {\n if (!empty($params['formatter'])) {\n $formatter = $params['formatter'];\n $jobDao = new PluginHudsonJobDao(CodendiDataAccess::instance());\n $dar = $jobDao->countJobs($formatter->groupId);\n $count = 0;\n if ($dar && !$dar->isError()) {\n $row = $dar->getRow();\n if ($row) {\n $count = $row['count'];\n }\n }\n $formatter->clearContent();\n $formatter->addEmptyLine();\n $formatter->addLine(array($GLOBALS['Language']->getText('plugin_hudson', 'title')));\n $formatter->addLine(array($GLOBALS['Language']->getText('plugin_hudson', 'job_count', array(date('Y-m-d'))), $count));\n echo $formatter->getCsvContent();\n $formatter->clearContent();\n }\n }", "function log_results() {\r\n\r\n\t\tif ( $this->is_updating ) {\r\n\r\n\t\t\t$this->jetpack = Jetpack::init();\r\n\t\t\t$items_to_log = array( 'plugin', 'theme' );\r\n\r\n\t\t\tforeach( $items_to_log as $items ) {\r\n\t\t\t\t$this->log_items( $items );\r\n\t\t\t}\r\n\r\n\t\t\t$this->jetpack->do_stats( 'server_side' );\r\n\t\t\t$this->jetpack->log( 'autoupdates', $this->log );\r\n\t\t}\r\n\t}", "public function sendLogs() {\n if(empty($this->_logs)) {\n return;\n }\n foreach($this->_logs AS $logGroupName => $logStreams) {\n $location = array(\n 'logGroupName' => $logGroupName,\n );\n $location['logGroupName'] = $this->getLogGroup($location['logGroupName']);\n foreach($logStreams AS $logStreamName => $logEventsBatches) {\n $location['logStreamName'] = $this->getLogStream($location['logGroupName'], $logStreamName);\n foreach($logEventsBatches AS $logEvents) {\n $this->putLogEvents($location, $logEvents);\n }\n }\n }\n $this->_logs = array();\n }", "public function report()\n {\n if ($this->diff === null) {\n $this->end();\n }\n\n $this->statsdInstace->send($this->name, $this->diff, StatsdClient::TIMER_MS);\n }", "private function showStats()\n {\n echo \"\\n\";\n echo \"Process completed successfully.\";\n echo \"\\n\";\n echo \"\\n\";\n echo \"/\\/\\/\\/\\/\\/\\/\\/\\/\\n\";\n echo \"Backlinks: \".(sizeof($this->backlinks)).\"\\n\";\n echo \"Unique Domains: \".(sizeof($this->domains)).\"\\n\";\n echo \"Time: \".(microtime(true) - $this->start).\" seconds\\n\";\n echo \"/\\/\\/\\/\\/\\/\\/\\/\\/\";\n echo \"\\n\";\n }", "public function getStatistics(){\n\t\treturn $ses->getSendStatistics();\n\t}", "private function _channelStats()\n {\n $dbh = $this->_connectToDb();\n \n $stmt = $dbh->query(\"select nick, count(*) as counter FROM log_table WHERE channel = '\". $this->_data->channel .\"' GROUP BY nick;\");\n \n $this->_message($this->_data->nick .': stats for '. $this->_data->channel .':');\n $rows = $stmt->fetchAll(PDO::FETCH_OBJ);\n foreach ($rows AS $row) {\n $this->_message($row->nick .' has '. $row->counter .' lines of babble.'); \n }\n \n }", "public static function log_usage($action = '')\n {\n update_site_option('wpmdb_usage', array('action' => $action, 'time' => time()));\n }", "public function send()\n {\n $subject = 'Statistics Report';\n $body = $this->report;\n\n /** @var UserModel $userModel */\n $userModel = MidasLoader::loadModel('User');\n $admins = $userModel->getAdmins();\n foreach ($admins as $admin) {\n $email = $admin->getEmail();\n Zend_Registry::get('notifier')->callback(\n 'CALLBACK_CORE_SEND_MAIL_MESSAGE',\n array(\n 'to' => $email,\n 'subject' => $subject,\n 'html' => $body,\n 'event' => 'statistics_report',\n )\n );\n }\n }", "private function logDelCount()\n {\n $key = 'cacheDeleteCount'.date('Y-m-d');\n JsMemcache::getInstance()->incrCount($key);\n\n $key .= '::'.date('H');\n JsMemcache::getInstance()->incrCount($key);\n }", "function logMemberStats(){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// get the member stats if not already there\n\t\tif(!$data_set){\n\t\t\t$this->getMemberStats();\n\t\t}\n\t\t\n\t\t// log them into daily stats\n\t\t$queryInsert = sprintf(\"INSERT INTO s_dailystats(member_count, member_total_score, quiz_total, quiz_draft, quiz_published, quiz_modify, quiz_archive, quiz_total_score, quiz_total_taken, quiz_total_taken_unique, quiz_total_likes, quiz_total_questions, quiz_total_options)\n\t\tVALUES(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)\", \n\t\t$this->member_count,\n\t\t$this->member_total_score,\n\t\t$this->quiz_total,\n\t\t$this->quiz_draft,\n\t\t$this->quiz_published,\n\t\t$this->quiz_modify,\n\t\t$this->quiz_archive,\n\t\t$this->quiz_total_score,\n\t\t$this->quiz_total_taken,\n\t\t$this->quiz_total_taken_unique,\n\t\t$this->quiz_total_likes,\n\t\t$this->quiz_total_questions,\n\t\t$this->quiz_total_options);\n\t\tmysql_query($queryInsert, $quizroo) or die(mysql_error());\n\t}", "public function stored_stats()\n\t{\n\t\t$this->util_model->isLoggedIn();\n\t\t\n\t\t$storedStats = $this->util_model->getStoredStats(3600);\n\t\t\n\t\t$this->output\n\t\t\t->set_content_type('application/json')\n\t\t\t->set_output(\"[\".implode(\",\", $storedStats).\"]\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move entry points in place.
function moveEntryPHPpoints() { $rootDir = __DIR__ . '/../tmp_uploaded_update/phplist/public_html/lists'; $downloadedFiles = scandir($rootDir); foreach ($downloadedFiles as $filename) { $oldFile = $rootDir . '/' . $filename; $newFile = __DIR__ . '/../' . $filename; if (in_array($filename, $this->excludedFiles)) { rename($oldFile, $newFile); } } }
[ "public function escortPositions(): void;", "public function moveScriptsToFooter()\n {\n global $wp_scripts;\n $notInFooter = array_diff($wp_scripts->queue, $wp_scripts->in_footer);\n $wp_scripts->in_footer = array_merge($wp_scripts->in_footer, $notInFooter);\n }", "private function moveToEntry() {\n\t\twhile($this->xpp->name != \"entry\") {\n\t\t\tif (!$this->xpp->read())\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function consolidate()\n {\n $oldPositions = $this->getPositions();\n $positions = range(1, count($oldPositions));\n $newPos = array_combine($oldPositions, $positions);\n foreach( $this->getCards() as $card )\n {\n $card->setPosition($newPos[$card->getPosition()]);\n }\n }", "public function moveFins()\n {\n //Assuming that all animals swim in this same way\n }", "function move_resources() {\n if($this->valid_request) {\n // Move stylesheets to head\n if($this->styles) {\n $this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer);\n }\n // Move the scripts to the bottom of the page\n if($this->scripts) {\n $this->buffer = str_ireplace($this->marker, $this->marker.$this->scripts, $this->buffer);\n }\n if($this->other_output) {\n $this->buffer = str_replace($this->marker, $this->marker.$this->other_output, $this->buffer);\n }\n }\n }", "public function move()\n {\n }", "function postInstallEntryPoint(EntryPoint $entryPoint) {\n\n }", "function orderup()\n\t{\n\t\t$this->reorder($dir = -1);\n\t}", "function move( $args, $assoc_args ) {\n\n $support = CmdlineSupport::preCondtion();\n list( $clubId, $eventId ) = $support->getEnvError();\n $last_error = error_get_last();\n if( !is_null( $last_error ) ) {\n WP_CLI::error(\"Wrong env for ... clubId, eventId, bracketName \");\n exit;\n }\n\n error_clear_last();\n list( $source, $dest, $bracketName ) = $args;\n $last_error = error_get_last();\n if( !is_null( $last_error ) ) {\n WP_CLI::error(\"Wrong args for ... source destination bracketname \");\n exit;\n }\n \n $fromId = \"M($eventId,$source)\";\n $toId = \"M($eventId,$dest)\";\n \n date_default_timezone_set(\"America/Toronto\");\n $stamp = date(\"Y-m-d h:i:sa\");\n\n $evts = Event::find( array( \"club\" => $clubId ) );\n $found = false;\n $target = null;\n if( count( $evts ) > 0 ) {\n foreach( $evts as $evt ) {\n $target = $support->getEventRecursively( $evt, $eventId );\n if( isset( $target ) ) {\n $found = true;\n break;\n }\n }\n if( $found ) {\n $club = Club::get( $clubId );\n $name = $club->getName();\n $evtName = $target->getName();\n $td = new TournamentDirector( $target );\n if( $td->moveEntrant( $source, $dest ) ) {\n WP_CLI::success(\"Position moved.\");\n }\n else {\n WP_CLI::warning(\"Position was not moved\");\n }\n }\n else {\n WP_CLI::warning( \"tennis signup move ... could not find event with Id '$eventId' for club with Id '$clubId'\" );\n }\n }\n else {\n WP_CLI::warning( \"tennis signup move ... could not find any events for club with Id '$clubId'\" );\n }\n\n }", "public function move() {\r\n // Update velocity\r\n $this->updateVelocity();\r\n\r\n // Velocity claming if enabled\r\n if($this->swarm->getConfig('clampVelocityValues')) {\r\n $this->clampVelocityValues();\r\n }\r\n\r\n // Update position\r\n $this->updatePosition();\r\n\r\n // Position claming if enabled\r\n if($this->swarm->getConfig('clampPositionValues')) {\r\n $this->clampPositionValues();\r\n }\r\n\r\n // Run through the training data and calculate error rate\r\n $this->calculateCurrentErrorRate();\r\n\r\n // Update personal and global scores\r\n $this->checkIfBetter();\r\n }", "function preUninstallEntryPoint(EntryPoint $entryPoint) {\n\n }", "public static function moveEscaper()\n\t{\n\t\tif (class_exists('\\\\Laminas\\\\Escaper\\\\Escaper') && is_file(static::getClassFilePath('\\\\Laminas\\\\Escaper\\\\Escaper')))\n\t\t{\n\t\t\t$base = basename(__DIR__) . '/' . static::$basePath . 'Escaper';\n\n\t\t\tforeach ([$base, $base . '/Exception'] as $path)\n\t\t\t{\n\t\t\t\tif (! is_dir($path))\n\t\t\t\t{\n\t\t\t\t\tmkdir($path, 0755);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = [\n\t\t\t\tstatic::getClassFilePath('\\\\Laminas\\\\Escaper\\\\Exception\\\\ExceptionInterface') => $base . '/Exception/ExceptionInterface.php',\n\t\t\t\tstatic::getClassFilePath('\\\\Laminas\\\\Escaper\\\\Exception\\\\InvalidArgumentException') => $base . '/Exception/InvalidArgumentException.php',\n\t\t\t\tstatic::getClassFilePath('\\\\Laminas\\\\Escaper\\\\Exception\\\\RuntimeException') => $base . '/Exception/RuntimeException.php',\n\t\t\t\tstatic::getClassFilePath('\\\\Laminas\\\\Escaper\\\\Escaper') => $base . '/Escaper.php',\n\t\t\t];\n\n\t\t\tforeach ($files as $source => $dest)\n\t\t\t{\n\t\t\t\tif (! static::moveFile($source, $dest))\n\t\t\t\t{\n\t\t\t\t\t// @codeCoverageIgnoreStart\n\t\t\t\t\tdie('Error moving: ' . $source);\n\t\t\t\t\t// @codeCoverageIgnoreEnd\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function beforeNextMove(): void;", "protected function _moveAppClasses() {\n\t\t$files = array(\n\t\t\tAPP . 'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',\n\t\t\tAPP . 'controllers' . DS . 'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',\n\t\t\tAPP . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',\n\t\t\tAPP . 'models' . DS . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',\n\t\t);\n\t\tforeach ($files as $old => $new) {\n\t\t\tif (file_exists($old)) {\n\t\t\t\t$this->out(__d('cake_console', 'Moving %s to %s', $old, $new));\n\n\t\t\t\tif ($this->params['dry-run']) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->_move($old, $new);\n\t\t\t}\n\t\t}\n\t}", "public function rearrange() {\n $required_fields = array(array('content_id', 'direction'), array('Content ID', 'Direction'));\n // check if required POST values exist\n if (!Misc::check_required_fields($required_fields)) return;\n\n $this->perform_rearrange_shift($this->f3->get('POST.content_id'), $this->f3->get('POST.direction'));\n }", "private function moveFiles()\n {\n // Ensure we have the file permissions not in cache as new files were installed.\n clearstatcache();\n // Now move all the files over.\n $destinationDir = $this->file->get(self::SETTING_DESTINATION_DIR);\n $ioHandler = $this->getIO();\n $logging = $ioHandler->isVeryVerbose();\n $this->folders = [];\n foreach (Finder::create()->in($this->tempDir)->ignoreDotFiles(false)->ignoreVCS(false) as $file) {\n $this->moveFile($file, $destinationDir, $logging, $ioHandler);\n }\n\n foreach (array_reverse($this->folders) as $folder) {\n if ($logging) {\n $ioHandler->write(sprintf('remove directory %s', $folder));\n }\n rmdir($folder);\n }\n }", "function parallax_hook_entry_top() {\n \tdo_action( 'parallax_entry_top' );\n \tdo_action( 'tha_entry_top' );\n }", "public function moveLegs()\n {\n //Assuming that all animals using this method walk this same way\n }", "private function handleEntryPoint(){\n\t\tif(!empty($_REQUEST['entryPoint'])){\n\t\t\t$this->loadMapping('entry_point_registry');\n\t\t\t$entryPoint = $_REQUEST['entryPoint'];\n if (!$this->entryPointExists($entryPoint)\n || ($this->checkEntryPointRequiresAuth($entryPoint) && !isset($GLOBALS['current_user']->id))) {\n ACLController::displayNoAccess();\n sugar_cleanup(true);\n }\n\t\t\t\trequire_once($this->entry_point_registry[$entryPoint]['file']);\n\t\t\t\t$this->_processed = true;\n\t\t\t\t$this->view = '';\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test constructor exception wrong 1st parameter.
public function testConstructorException1st2(): void { $this->expectException(Exception::class); $this->e(false); }
[ "public function test___construct_calledWithBadValue_throw()\n {\n $this->setExpectedException($this->getExceptionToArgument('InvalidNativeArgumentException'));\n $this->getSut($this->getBadNativeValue());\n }", "public function test_not_valid_data_excention_is_thrown_in_constructor_method()\n {\n $this->setExpectedException(InvalidArgumentException::class);\n $collection = new Collection(3);\n $collection = new Collection(\"A string\");\n }", "public function should_throw_exception_on_bad_construction_parameters() {\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\n\t\tnew ImageSize( 23, 100, 200, false );\n\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\n\t\tnew ImageSize( 'foo', 'bar', 200, false );\n\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\n\t\tnew ImageSize( 'foo', 100, 'bar', false );\n\t}", "public function testConstructorExceptions(){\r\n \r\n try{\r\n //bad url: should throw exception\r\n $url = new \\Altumo\\String\\Url('');\r\n $this->assertTrue( false );\r\n }catch( \\Exception $e ){\r\n $this->assertTrue( true );\r\n }\r\n \r\n try{\r\n //shouldn't throw\r\n $url = new \\Altumo\\String\\Url();\r\n $this->assertTrue( true );\r\n }catch( \\Exception $e ){\r\n $this->assertTrue( false );\r\n }\r\n \r\n }", "public function testValidPassArgsToConstructor(): \\Exception\n {\n $ex = new Exceptions\\TemplateExtensionException('This is a test exception', 45);\n\n $this->assertTrue($ex instanceof Exceptions\\TemplateExtensionException);\n $this->assertEquals((string) $ex->getMessage(), 'This is a test exception');\n $this->assertEquals($ex->getCode(), 45);\n $this->assertTrue(false == empty($ex->getTrace()));\n\n return $ex;\n }", "public function testConstructorException()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $dom = new DomQuery(new \\stdClass);\n }", "public function testConstructFailure() {\n\t\t\t// We shouldn't have anything set yet...\n\t\t\t$this->assertNull($this->Helper->Syntax);\n\t\t\t\n\t\t\t// Expect an exception and run the construct\n\t\t\t$this->expectException('InvalidArgumentException');\n\t\t\t$this->Helper->__construct('no such syntax!');\n\t\t}", "public function testConstructorWithInvalidData()\n {\n $this->expectException(\\BadMethodCallException::class);\n\n new Slug(['henk' => 'de vries']);\n }", "public function test___construct_failure()\n {\n $this->engine_struct_param->type = \"fooo\";\n $this->setExpectedException(\"Exception\");\n new Engines_MyMemory($this->engine_struct_param);\n }", "public function testConstructExceptionInvalidKeys()\n {\n $this->setExpectedException(\n 'Zend\\Cloud\\Infrastructure\\Exception\\InvalidArgumentException',\n 'The param \"'.Instance::INSTANCE_ID.'\" is a required param for Zend\\Cloud\\Infrastructure\\Instance'\n );\n $instance = new Instance(self::$adapter,array('foo'=>'bar'));\n }", "public function testConstructParamOneError()\n {\n // Prepare the expected exception\n $oArrayException = new Services_AMEE_Exception(\n 'Services_AMEE_ProfileItem constructor method called ' .\n 'with the parameter array\\'s first parameter not being ' .\n 'the required Services_AMEE_Profile object'\n );\n\n try {\n $oProfileItem = new Services_AMEE_ProfileItem(\n array('one', 'two', 'three')\n );\n } catch (Exception $oException) {\n // Test the Exception was correctly thrown\n $this->assertEquals(\n $oException->getMessage(),\n $oArrayException->getMessage()\n );\n return;\n }\n\n // If we get here, the test has failed\n $this->fail('Test failed because expected Exception was not thrown');\n }", "public function testConstructThrowsExceptionIfBIsNotANumber()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n new Linear(1, 'foo');\n \n return;\n }", "public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}", "public function testConstructThrowsExceptionIfMIsNotANumber()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n new Linear('foo', 1);\n \n return;\n }", "public function testConstructorException()\n {\n $this->expectException(ConfigException::class);\n $this->expectExceptionCode(ConfigException::MISSING_MERCHANT_ID);\n $this->expectExceptionMessage(ExceptionMessages::$configErrorMessages[ConfigException::MISSING_MERCHANT_ID]);\n\n $reflectedClass = new ReflectionClass(Config::class);\n $constructor = $reflectedClass->getConstructor();\n $constructor->invoke($this->configMock, []);\n }", "public function testConstructorWithExtra()\n {\n $this->expectException(ValidationException::class);\n $this->expectExceptionCode(ValidationException::UNDEFINED_VALIDATION_EXCEPTION);\n $this->expectExceptionMessageRegExp(\n sprintf(\n \"/%s %s$/\",\n static::EXTRA,\n ExceptionMessages::$validationMessages[\n ValidationException::UNDEFINED_VALIDATION_EXCEPTION\n ]\n )\n );\n\n throw new ValidationException(ValidationException::UNDEFINED_VALIDATION_EXCEPTION, static::EXTRA);\n }", "public function testConstructor()\n {\n $allowed = array(\n \"boolean\",\n \"string\"\n );\n \n $exception = new UnexpectedTypeException(\"type exception\", 404, null, $allowed);\n \n $this->assertTrue($exception->getMessage() == \"type exception\\n Allowed types : boolean, string\");\n }", "public function testIfThrowsOnWrongArguments() : void\n {\n\n // Prepare.\n $this->expectException(InstanceCreationWrongParamException::class);\n\n // Test.\n InstancesFactory::fromArray(true, []);\n }", "public function testNonKeyValuePairInConstructorThrowsException() : void\n {\n $this->expectException(InvalidArgumentException::class);\n new HashTable(['foo' => 'bar']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the unpublish extension to the builder.
protected function addUnpublish(Builder $builder) { $builder->macro('unpublish', function (Builder $builder) { $builder->withPublished(); $column = $this->getPublishedAtColumn($builder); return $builder->update([ $column => null, ]); }); }
[ "protected function addWithoutUnpublished(Builder $builder)\n {\n $builder->macro('withoutUnpublished', function (Builder $builder) {\n $model = $builder->getModel();\n\n $builder->withoutGlobalScope($this)->where($model->getQualifiedPublishAtColumn(), '<=', $model->freshTimestamp())->whereNotNull($model->getQualifiedPublishAtColumn());\n\n return $builder;\n });\n }", "protected function addUndoPublish(Builder $builder): void\n {\n $builder->macro('undoPublish', function (Builder $builder) {\n return $builder->update(['published_at' => null]);\n });\n }", "public function unpublish()\n\t{\n\t\t$this->changestate(0); // Security checks are done by the called method\n\t}", "public function unpublishAll();", "public function unpublishHook(Hook $hook);", "protected function addWithoutNotPublished(Builder $builder): void\n {\n $builder->macro('withoutNotPublished', function (Builder $builder) {\n return $builder->withoutGlobalScope($this)->whereNotNull('published_at');\n });\n }", "function unpublish(PostInterface $post);", "protected function addOnlyUnpublished(Builder $builder)\n {\n $builder->macro('onlyUnpublished', function (Builder $builder) {\n $model = $builder->getModel();\n\n $builder->withoutGlobalScope($this)->whereNull(\n $model->getQualifiedPublishAtColumn()\n );\n\n return $builder;\n });\n }", "public function unpublish()\n {\n return $this->update(['published' => 0]);\n }", "function unpublish($task = 'unpublish', $alt = 'Unpublish')\r\n\t{\r\n\t\t$this->bar = & JToolBar::getInstance('Locator');\r\n\t\t// Add an unpublish button\r\n\t\t$this->bar->appendButton( 'Standard', 'unpublish', $alt, $task, false, false );\r\n\t}", "protected function addUnreview(Builder $builder)\n {\n $builder->macro('unreview', function (Builder $builder) {\n $builder->allReviewable();\n\n return $builder->update([$builder->getModel()->getReviewableColumn() => 0]);\n });\n }", "public function onAfterUnpublish()\n {\n $this->owner->getListObject()->doUnpublish();\n }", "public function actionUnpublish()\n {\n $this->_application->unPublish();\n $this->_em->persist($this->_application);\n $this->addMessage('success', 'Application Un-Published.');\n $this->redirectPath('setup/publishapplication');\n }", "public static function unpublishing($callback)\n {\n static::registerModelEvent('unpublishing', $callback);\n }", "public function invalidateDocumentBeforeUnpublishing(UnpublishEvent $event)\n {\n $document = $event->getDocument();\n\n if ($document instanceof StructureBehavior) {\n $this->invalidateDocumentStructure($document);\n }\n\n if ($document instanceof ResourceSegmentBehavior\n && $document instanceof WorkflowStageBehavior\n && $document->getPublished()\n ) {\n $this->invalidateDocumentUrls($document, $this->documentInspector->getLocale($document));\n }\n }", "public function doUnpublish() {\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\t$field->doDeleteFromStage('Live');\n\t\t\t}\n\t\t}\n\t\t\n\t\tparent::doUnpublish();\n\t}", "public function setNodeFromPublicWorkspaceForUnpublishing(UnpublishEvent $event)\n {\n $this->setNodeFromPublicWorkspace($event);\n }", "public function presentUnpublishUrl(){\n return route('posts.unpublish',['posts' => $this->post_slug]);\n }", "public function unpublish()\n\t{\n\t\tif (!$this->getId())\n\t\t{\n\t\t\tthrow new RecordNotLoaded(\"Can't unlock a not loaded DataModel\");\n\t\t}\n\n\t\tif (!$this->hasField('enabled'))\n\t\t{\n\t\t\treturn $this;\n\t\t}\n\n\t\tif (method_exists($this, 'onBeforeUnpublish'))\n\t\t{\n\t\t\t$this->onBeforeUnpublish();\n\t\t}\n\n\t\t$this->behavioursDispatcher->trigger('onBeforeUnpublish', [&$this]);\n\n\t\t$enabled = $this->getFieldAlias('enabled');\n\n\t\t$this->$enabled = 0;\n\t\t$this->save();\n\n\t\tif (method_exists($this, 'onAfterUnpublish'))\n\t\t{\n\t\t\t$this->onAfterUnpublish();\n\t\t}\n\n\t\t$this->behavioursDispatcher->trigger('onAfterUnpublish', [&$this]);\n\n\t\treturn $this;\n\t}", "public function unPublish() : void\n {\n $this->is_published = State::UN_PUBLISHED;\n $this->saveOrFail();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Push a details item fields to the data array
public function pushDetailsItem($fields) { $defaults = array( 'id' => '', 'name' => '' ); $this->data['ecommerce']['detail']['products'][] = $this->getDefaults($fields, $defaults); }
[ "public function pushItemField(array $data);", "public function AddCustomerDetails(){\n // this is a valuable piece of code\n // here we are iterating over the items array and decorating the items in the array with the customer name property\n // since array are object references, we dont push the stuff back into the array\n require_once('customer.php'); \n foreach ($this->items as $item){\n $customer = new customer($item->customerid);\n $item->name = $customer->name . ' [' . $item->orderdate_ts . ']';\n }\n }", "protected function _setDataFromDetails()\n {\n $data = $this->getDetailsArray();\n \n $this->setName($data['name']);\n $this->setLat($data['lat']);\n $this->setLng($data['lng']);\n $this->setLatlngtext($data['lat'] . $data['lng']);\n $this->setGeonameId($data['geonameId']);\n $this->setCountry($data['countryCode']);\n }", "protected function addItemDetails(&$item) \r\n\t{\r\n\t\t//$item->totals = KTBTrackerHelper::getUserTotals($item);\r\n\t\t$this->getUserInfo($item);\r\n\t}", "private function _addMoreInfoToData(){\n foreach($this->data as $record){\n $model = $record['partCode'][0];\n $piece = $record['partCode'][1];\n $record['model'] = $model;\n\n $householdRegEx = \"/^[A-L]$/i\";\n $butlerRegE = \"/^[M-V]$/i\";\n $companionRegE = \"/^[W-Z]$/i\";\n if(preg_match($householdRegEx, $model)){\n $record['line'] = \"household\";\n }else if (preg_match($butlerRegE, $model)){\n $record['line'] = \"butler\";\n }else if (preg_match($companionRegE, $model)){\n $record['line'] = \"companion\";\n }\n\n if($piece === '1'){\n $record['piece'] = \"top\";\n }else if($piece === '2'){\n $record['piece'] = \"torso\";\n }else if($piece === '3'){\n $record['piece'] = \"bottom\";\n }\n\n $dataArray[] = $record;\n }\n\n $this->data = $dataArray;\n }", "function addInformation(FormInformationItem $anInformation){\r\n\t\tarray_push($this->arrayInformation, $anInformation);\r\n\t}", "public function addExtraDetailsToRegister( ) {\r\n $data= $this->apicaller->contact()->addExtraDetailsToRegister(array(\r\n 'contact-id' => '36411094',\r\n 'attr-name1' => 'sponsor1',\r\n 'attr-value1' => '0',\r\n 'product-key' => 'dotcoop',\r\n ));\r\n print_r($data);\r\n }", "abstract function addToItem($dataItem, $field, $value);", "public function addMoreInfos() {\n $data = [\n 'id_user' => $_POST['id_user'],\n 'offre_emploi' => $_POST['offre_emploi'],\n 'cnss' => $_POST['cnss'],\n 'certificate' => $_POST['certificate'],\n 'illness_records' => $_POST['illness_records'],\n 'illness_records' => $_POST['illness_records']\n ];\n echo '<pre>';\n var_dump($data);\n echo '</pre>';\n die();\n }", "public function prepareDetails() {\n\t\t\tfor ($i=0; $i<count($this->allfields); $i++) {\n \n\t\t\t\t$field = $this->allfields[$i];\n\t\t\t\t$this->label = $field['label'];\n\t\t\t\t$this->placeholder = $field['placeholder'];\n\t\t\t\t$this->keyword = $field['keyword']; $this->keyword = strtolower($this->keyword);\n\t\t\t\t$this->type = $field['type']; $this->type = strtolower($this->type);\n\t\t\t\t$this->minimum = $field['minimum'];\n\t\t\t\t$this->maximum = $field['maximum'];\n\t\t\t\t\n if (isset($field['required']) && $field['required'] == \"on\") {\n $this->required = \"required\"; \n }\n \n\t\t\t\t$this->default = $field['default'];\n\t\t\t\t$this->formtype = $this->type; \n\n\t\t\t\t$this->i = $i;\n \n\t\t\t\t$this->prepareHtml();\n//\t\t\t\t$this->prepareChecks();\n//\t\t\t\t$this->prepareSql();\n//\t\t\t\t$this->prepareJs();\n\n\t\t\t\t// Get the unique keyword for user\n\t\t\t \t// it's always the first field\n\t\t\t\tif ($i == 1) {\n\t\t\t\t\t$this->unique_user = $this->keyword;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addToDetails($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The Details property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Details[] = $item;\n return $this;\n }", "function wcms_add_meeting_details_to_order_items($item, $cart_item_key, $values, $order)\n{\n $post_id = $item['product_id'];\n $details_html = '<br/>';\n $details_html .= _wcms_meeting_details_concise_html($post_id);\n $item->add_meta_data('Meeting Details', $details_html, true);\n}", "public function pushItemField(array $data) {\n\t\tif($this->logger && $this->logger->getLevel() > 2) $this->logger->logTrace();\n\n\t\t$table = 'tx_decosdata_domain_model_itemfield';\n\t\t$data = array_merge($this->propertyDefaults, $data);\n\t\t$data['field'] = $this->getFieldUid($data['field']);\n\n\t\t$whereData = [\n\t\t\t'field' => $data['field'],\n\t\t\t'item' => $data['item'],\n\t\t\t'pid' => $data['pid']\n\t\t];\n\n\t\tif ($data['field_value'] === NULL) {\n\t\t\t// if fieldvalue is NULL while the field previously existed with a value for this item, remove it\n\t\t\tif (isset($this->itemFields[$data['field']])) {\n\t\t\t\t$data['deleted'] = 1;\n\t\t\t\t$this->databaseConnection->exec_UPDATEquery(\n\t\t\t\t\t$table,\n\t\t\t\t\t$this->databaseHelper->getWhereFromConditionArray($whereData, $table),\n\t\t\t\t\t$data\n\t\t\t\t);\n\t\t\t}\n\t\t\t// otherwise, just don't register it\n\t\t} else {\n\t\t\t// if we have a field value, always upsert\n\t\t\t$this->databaseHelper->execUpsertQuery($table, $data, array_keys($whereData));\n\t\t}\n\t}", "private function addDetailsInRows()\n\t{\n\t\tforeach ($this->data_show as &$row)\n\t\t\tforeach ($this->data as $row_original)\n\t\t\t{\n\t\t\t\t$is_group = true;\n\t\t\t\t\n\t\t\t\tforeach ($this->col_group as $key)\n\t\t\t\t\tif($row[$key] != $row_original[$key])\n\t\t\t\t\t\t$is_group = false;\n\t\t\t\t\n\t\t\t\tif($is_group)\n\t\t\t\t{\n\t\t\t\t\t// total amount\n\t\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t\t$row[$this->col_aggr_sum] += $row_original[$this->col_aggr_sum];\n\t\t\t\t\t\n\t\t\t\t\t// add details\n\t\t\t\t\t$row_tmp = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach ($this->data[0] as $col => $val)\n\t\t\t\t\t\tif(!in_array($col, $this->col_show) || $col == $this->col_aggr_sum)\n\t\t\t\t\t\t\t$row_tmp[$col] = $row_original[$col];\n\t\t\t\t\t\n\t\t\t\t\t$row['details'][] = $row_tmp;\n\t\t\t\t}\n\t\t\t}\n\t}", "private function extractItemDetailsOfOrder()\r\n {\r\n foreach($this->getOrder()->orderItems as $item){\r\n $this->items[] = $this->getItemDetails($item);\r\n }\r\n }", "private function addDetail()\n { \n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n $Tickets = new Tickets($params);\n \n if($_REQUEST['changed_status'] != 0)\n {\n \n $Tickets->setStatus($_REQUEST['changed_status']);\n $Tickets->update();\n //save log \n $this->saveLog($_REQUEST['changed_status'], $_REQUEST['ticket_id'], null);\n }\n \n $data = array();\n $data['subject'] = stripslashes(trim($_REQUEST['subject']));\n $data['notes'] = stripslashes(trim($_REQUEST['notes']));\n $data['user_id'] = $_SESSION['LOGIN_USER']['userId'];\n \n //$Tickets = new Tickets($params);\n $details_id = $Tickets->addDetails($data);\n\n if($details_id)\n {\n $files = $this->getUploadedFiles();\n $this->saveAttachments($files, $_REQUEST['ticket_id'], $details_id);\n }\n \n //Send Email To resolvers, source, etc.\n $this->sendEmail($_REQUEST['ticket_id'], $data['subject']);\n \n \n \n echo '[{\"isError\":0, \"message\":\"Details added Successfully.\"}]';\n exit;\n }", "private function addItemFields(&$fields, &$validator, $order) {\n\t $items = $order->Items();\n\n\t if ($items) foreach ($items as $item) {\n\t $fields['Items'][] = new OrderItemField($item);\n\t }\n\t}", "public function fillFields($data);", "private function setBillingDetails()\n {\n $details = [];\n $details['name'] = request()->name;\n $details['email'] = request()->email;\n $details['address'] = request()->address;\n $details['city'] = request()->city;\n $details['region'] = request()->region;\n $details['postalcode'] = request()->postalcode;\n $details['phone'] = request()->phone;\n\n $this->order->billing_details = $details;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a customer check debit request for the given $order
public function create_echeck_debit( WC_Order $order ) { $this->create_transaction( self::AUTH_CAPTURE, $order ); }
[ "public function check_debit( \\WC_Order $order ) {\n\n\t\t$request = $this->get_new_echeck_request( $order );\n\n\t\t$request->set_echeck_data();\n\n\t\treturn $this->perform_request( $request );\n\t}", "public function createPaymentRequest($order);", "public function debit() \n {\n $sOxid = $this->_oFcpoHelper->fcpoGetRequestParameter(\"oxid\");\n if ($sOxid != \"-1\" && isset($sOxid)) {\n $oOrder = $this->_oFcpoHelper->getFactoryObject(\"oxorder\");\n $oOrder->load($sOxid);\n\n $sBankCountry = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_bankcountry');\n $sBankAccount = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_bankaccount');\n $sBankCode = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_bankcode');\n $sBankaccountholder = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_bankaccountholder');\n $sAmount = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_amount');\n $sCancellationReason = $this->_oFcpoHelper->fcpoGetRequestParameter('bnpl_debit_cancellation_reason');\n\n $oPORequest = $this->_oFcpoHelper->getFactoryObject('fcporequest');\n\n if (in_array($oOrder->oxorder__oxpaymenttype->value, array('fcpopl_secinvoice', 'fcpopl_secinstallment', 'fcpopl_secdebitnote'))) {\n $oPORequest->addParameter('addPayData[cancellation_reason]', $sCancellationReason);\n }\n\n if ($sAmount) {\n $dAmount = (double) str_replace(',', '.', $sAmount);\n\n // amount for credit entry has to be negative\n if ($dAmount > 0) {\n $dAmount = (double) $dAmount * -1;\n }\n\n if ($dAmount < 0) {\n $oResponse = $oPORequest->sendRequestDebit($oOrder, $dAmount, $sBankCountry, $sBankAccount, $sBankCode, $sBankaccountholder);\n }\n } elseif ($aPositions = $this->_oFcpoHelper->fcpoGetRequestParameter('debit_positions')) {\n $dAmount = 0;\n foreach ($aPositions as $sOrderArtKey => $aOrderArt) {\n if ($aOrderArt['debit'] == '0') {\n unset($aPositions[$sOrderArtKey]);\n continue;\n }\n $dAmount += (double)$aOrderArt['price'];\n }\n $oResponse = $oPORequest->sendRequestDebit($oOrder, $dAmount, $sBankCountry, $sBankAccount, $sBankCode, $sBankaccountholder, $aPositions);\n }\n\n $this->_sResponsePrefix = 'FCPO_DEBIT_';\n $this->_aResponse = $oResponse;\n }\n }", "protected function do_check_transaction( $order ) {\n\n\t\t$response = $this->get_api()->check_debit( $order );\n\n\t\t// success! update order record\n\t\tif ( $response->transaction_approved() ) {\n\n\t\t\t$last_four = substr( $order->payment->account_number, -4 );\n\n\t\t\t// check order note. there may not be an account_type available, but that's fine\n\t\t\t$message = sprintf( _x( '%s Check Transaction Approved: %s account ending in %s', 'Supports direct cheque', $this->text_domain ), $this->get_method_title(), $order->payment->account_type, $last_four );\n\n\t\t\t// optional check number\n\t\t\tif ( ! empty( $order->payment->check_number ) ) {\n\t\t\t\t$message .= '. ' . sprintf( _x( 'Check number %s', 'Supports direct cheque', $this->text_domain ), $order->payment->check_number );\n\t\t\t}\n\n\t\t\t// adds the transaction id (if any) to the order note\n\t\t\tif ( $response->get_transaction_id() ) {\n\t\t\t\t$message .= ' ' . sprintf( _x( '(Transaction ID %s)', 'Supports direct cheque', $this->text_domain ), $response->get_transaction_id() );\n\t\t\t}\n\n\t\t\t$order->add_order_note( $message );\n\n\t\t}\n\n\t\treturn $response;\n\n\t}", "protected function get_new_echeck_request( \\WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$request = $this->get_new_request( array(\n\t\t\t'type' => 'payment',\n\t\t\t'payment_type' => 'echeck',\n\t\t) );\n\n\t\treturn $request;\n\t}", "public function create_billing_agreement() {\n\n\t\tif ( ! isset( $_GET['action'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( $_GET['action'] ) {\n\n\t\t\t// create billing agreement for reference transaction.\n\t\t\tcase 'cartflows_paypal_create_billing_agreement':\n\t\t\t\t// bail if no token.\n\t\t\t\tif ( ! isset( $_GET['token'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// get token to retrieve checkout details with.\n\t\t\t\t$token = esc_attr( $_GET['token'] );\n\t\t\t\t$order_id = intval( $_GET['order_id'] );\n\t\t\t\t$step_id = intval( $_GET['step_id'] );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t$express_checkout_details_response = $this->perform_express_checkout_details_request( $token );\n\n\t\t\t\t\t// Make sure the billing agreement was accepted.\n\t\t\t\t\tif ( 1 == $express_checkout_details_response['BILLINGAGREEMENTACCEPTEDSTATUS'] ) {\n\n\t\t\t\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t\t\t\tif ( is_null( $order ) ) {\n\t\t\t\t\t\t\tthrow new Exception( __( 'Unable to find order for PayPal billing agreement.', 'cartflows-pro' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// we need to process an initial payment.\n\t\t\t\t\t\tif ( $order->get_total() > 0 ) {\n\n\t\t\t\t\t\t\t$billing_agreement_response = $this->perform_express_checkout_request(\n\t\t\t\t\t\t\t\t$token,\n\t\t\t\t\t\t\t\t$order,\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'payment_action' => 'Sale',\n\t\t\t\t\t\t\t\t\t'payer_id' => $this->get_value_from_response( $express_checkout_details_response, 'PAYERID' ),\n\t\t\t\t\t\t\t\t\t'step_id' => $step_id,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $this->has_error_api_response( $billing_agreement_response ) ) {\n\n\t\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->set_payment_method( 'paypal' );\n\n\t\t\t\t\t\t// Store the billing agreement ID on the order and subscriptions.\n\t\t\t\t\t\tupdate_post_meta( wcf_pro()->wc_common->get_order_id( $order ), '_paypal_subscription_id', $this->get_value_from_response( $billing_agreement_response, 'BILLINGAGREEMENTID' ) );\n\n\t\t\t\t\t\t$order->payment_complete( $billing_agreement_response['PAYMENTINFO_0_TRANSACTIONID'] );\n\n\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\texit;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\twp_safe_redirect( wc_get_cart_url() );\n\t\t\t\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t} catch ( Exception $e ) {\n\n\t\t\t\t\twc_add_notice( __( 'An error occurred, please try again or try an alternate form of payment.', 'cartflows-pro' ), 'error' );\n\n\t\t\t\t\twp_redirect( wc_get_cart_url() );\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t}\n\t}", "function CustomerDonation($order_id, $order_comment, $order_payment_trx_details, $order_submission_date, $order_due_date,$order_ipaddress, $order_channel_code,\n\t\t$token, $campaign_key, $donation_amount, $project_id,$donor_name, $donor_email, $donor_genre, $donor_pan_number, $donor_tax_payer,$donor_addressline, $donor_country_iso2, $donor_state_iso2, $donor_city, $donor_zipcode)\n\t\t{\n\t\t\t\t\t$this->order_id = $order_id;\n\t\t\t\t\t$this->order_comment = $order_comment;\n\t\t\t\t\t$this->order_submission_date = $order_submission_date;\n\t\t\t\t\t$this->order_due_date = $order_due_date;\n\t\t\t\t\t$this->order_channel_code = $order_channel_code;\n\t\t\t\t\t$this->order_payment_trx_details = $order_payment_trx_details;\n\t\t\t\t\t$this->token = $token;\n\t\t\t\t\t$this->campaign_key = $campaign_key;\n\t\t\t\t\t$this->donation_amount = $donation_amount;\n\t\t\t\t\t$this->project_id = $project_id;\n\t\t\t\t\t$this->order_ipaddress = $order_ipaddress;\n\t\t\t\t\t$this->donor_name = $donor_name;\n\t\t\t\t\t$this->donor_email = $donor_email;\n\t\t\t\t\t$this->donor_genre = $donor_genre;\n\t\t\t\t\t$this->donor_pan_number = $donor_pan_number;\n\t\t\t\t\t$this->donor_tax_payer = $donor_tax_payer;\n\t\t\t\t\t$this->donor_addressline = $donor_addressline;\n\t\t\t\t\t$this->donor_country_iso2 = $donor_country_iso2;\n\t\t\t\t\t$this->donor_state_iso2 = $donor_state_iso2 ;\n\t\t\t\t\t$this->donor_city = $donor_city;\n\t\t\t\t\t$this->donor_zipcode = $donor_zipcode;\n\t\t}", "public static function get_or_create_customer_from_order($order)\n {\n }", "private function payment_tokenization($order) {\n\n try {\n $referenceCode = $order->id;\n\n $client = new ExtendedClient(\n $this->endpointURL, array(\n 'merchantID' => $this->merchantID,\n 'transactionKey' => $this->transactionKey\n )\n );\n\n $request = new stdClass();\n $request->clientLibrary = \"PHP\";\n $request->clientLibraryVersion = phpversion();\n $request->clientEnvironment = php_uname();\n $request->merchantID = $this->merchantID;\n $request->merchantReferenceCode = $referenceCode;\n\n\n\n //CUSTOMIZATION ADDED AVS VALIDATION FEATURE\n // disable Address Verification Services (AVS)\n $businessRules = new stdClass();\n if( $this->avs === true ){\n $ignore_avs = false;\n } else {\n $ignore_avs = true;\n }\n $businessRules->ignoreAVSResult = $ignore_avs;\n $request->businessRules = $businessRules;\n\n\n\n $paySubscriptionCreateService = new stdClass();\n $paySubscriptionCreateService->run = 'true';\n $request->paySubscriptionCreateService = $paySubscriptionCreateService;\n\n $billTo = new stdClass();\n $billTo->firstName = __($order->billing_first_name, 'woocommerce');\n $billTo->lastName = __($order->billing_last_name, 'woocommerce');\n $billTo->street1 = __($order->billing_address_1, 'woocommerce');\n $billTo->city = __($order->billing_city, 'woocommerce');\n $billTo->state = __($order->billing_state, 'woocommerce');\n $billTo->postalCode = __($order->billing_postcode, 'woocommerce');\n $billTo->country = __($order->billing_country, 'woocommerce');\n $billTo->email = __($order->billing_email, 'woocommerce');\n $billTo->ipAddress = !empty($_SERVER['HTTP_X_FORWARD_FOR']) ? $_SERVER['HTTP_X_FORWARD_FOR'] : $_SERVER['REMOTE_ADDR'];\n\n $request->billTo = $billTo;\n\n $card_number = str_replace(' ', '', woocommerce_clean($_POST['cybersource-card-number']));\n $card_cvc = str_replace(' ', '', woocommerce_clean($_POST['cybersource-card-cvc']));\n $card_exp_year = str_replace(' ', '', woocommerce_clean($_POST['cybersource-card-expiry']));\n $productinfo = sprintf(__('%s - Order %s', 'woocommerce'), esc_html(get_bloginfo()), $order->id);\n\n $exp = explode(\"/\", $card_exp_year);\n if (count($exp) == 2) {\n $card_exp_month = str_replace(' ', '', $exp[0]);\n $card_exp_year = str_replace(' ', '', $exp[1]);\n } else {\n wc_add_notice(__('Payment error: Card expiration date is invalid', 'woocommerce'), \"error\");\n return false;\n }\n\n $card = new stdClass();\n $card->accountNumber = $card_number;\n $card->expirationMonth = $card_exp_month;\n $card->expirationYear = '20' . $card_exp_year;\n\n $cardtype = $this->get_cc_type($card_number);\n\n if (empty($cardtype)) {\n $order->add_order_note(\n sprintf(\n \"%s Payment Failed with message: '%s'\", $this->method_title, \"Could not determine the credit card type.\"\n )\n );\n wc_add_notice(__('Transaction Error: Could not determine the credit card type.', 'woocommerce'), \"error\");\n return false;\n } else {\n $card->cardType = $cardtype;\n }\n\n //ADDED BY TARUN\n $card->cvNumber = $card_cvc;\n //ADDED BY TARUN\n\n $request->card = $card;\n $purchaseTotals = new stdClass();\n $purchaseTotals->currency = get_woocommerce_currency();\n $request->purchaseTotals = $purchaseTotals;\n\n $recurringSubscriptionInfo = new stdClass();\n $recurringSubscriptionInfo->frequency = 'on-demand';\n $request->recurringSubscriptionInfo = $recurringSubscriptionInfo;\n\n $reply = $client->runTransaction($request);\n\n $order_user_id = $order->customer_user;\n $reason = $this->reason_code($reply->reasonCode);\n\n // wc_add_notice('5 Transaction Error: '.$reason.' ', 'error');\n // return false;\n\n if( $this->debugMode == 'on' ){\n $order->add_order_note( sprintf(\n \"3 Debug %s => '%s'\", $reply->reasonCode, $reason\n ) ); }\n\n $cardTypeName= $this->get_cc_type_name($card_number);\n\n switch ($reply->decision) {\n case 'ACCEPT':\n if (isset($reply->paySubscriptionCreateReply->subscriptionID) && !empty($reply->paySubscriptionCreateReply->subscriptionID)) {\n $subscription_id = $reply->paySubscriptionCreateReply->subscriptionID;\n if (!empty($order_user_id)) {\n update_user_meta($order_user_id, \"cybersource_subscription_id\", $subscription_id);\n\t\t\t\t\t\t\t\t // update_user_meta($order_user_id, \"cybersource_subscription_id_\", $subscription_id);\n\t\t\t\t\t\t\t\t update_user_meta($order_user_id, \"card_type\", $cardtype);\n\t\t\t\t\t\t\t\t update_user_meta($order_user_id, \"card_exp_date\", $exp);\n//\n//// update_user_meta($order_user_id, \"cybersource_subscription_id_\" . $subscription_id, [\n//// 'card_number' => substr($card_number, -4, 4),\n//// 'card_type' => $cardtype,\n//// 'card_exp_date' => $exp\n//// ]);\n\n $token = new WC_Payment_Token_CC();\n $token->set_token($subscription_id);\n $token->set_gateway_id($this->id); // `$this->id` references the gateway ID set in `__construct`\n\n $token->set_card_type($cardTypeName);\n\n $token->set_last4(substr($card_number, -4, 4));\n $token->set_expiry_month($card_exp_month);\n $token->set_expiry_year('20' . $card_exp_year);\n\n\t\t\t\t\t\t\t\t\t\t$token->set_user_id($order_user_id);\n $token->save();\n \n update_post_meta($referenceCode, 'cybersource_token_id', $token->get_id());\n }\n //\n update_post_meta($referenceCode, 'cybersource_token', $subscription_id);\n update_post_meta($referenceCode, 'cybersource_token_card_type', $cardTypeName);\n update_post_meta($referenceCode, 'cybersource_token_expire_date', $card_exp_month.'/20'.$card_exp_year);\n\n return $subscription_id;\n }\n break;\n case 'ERROR':\n\t\t\t\t\t\t\t$order->add_order_note(\n sprintf(\n \"%s PaymentError with message: '%s'\", $this->method_title, $reply->decision . \" - \" . $reason\n )\n );\n case 'REVIEW':\n\t\t\t\t\t\t$order->add_order_note(\n sprintf(\n \"%s Payment Review with message: '%s'\", $this->method_title, $reply->decision . \" - \" . $reason\n )\n );\n case 'REJECT':\n $order->add_order_note(\n sprintf(\n \"%s Payment Failed with message: '%s'\", $this->method_title, $reply->decision . \" - \" . $reason\n )\n );\n\n //OLD wc_add_notice(__('Transaction Error: Could not complete your payment', 'woocommerce'), \"error\");\n wc_add_notice('Transaction Error: Could not complete your payment - '.$reason.' - card type: '.$cardtype.'.', 'error');\n break;\n }\n } catch (SoapFault $e) {\n $order->add_order_note(\n sprintf(\n \"%s Payment Failed with message: '%s'\", $this->method_title, $e->faultcode . \" - \" . $e->faultstring\n )\n );\n\n wc_add_notice(__('Transaction Error: Could not complete your payment', 'woocommerce'), \"error\");\n }\n return false;\n }", "public function debit()\n {\n $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');\n $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);\n\n $this->paymentObject->debit('http://www.heidelpay.com', 'FALSE', 'http://www.heidelpay.com');\n\n /* disable frontend (ifame) and submit the credit card information directly (only for testing) */\n $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE');\n $this->paymentObject->getRequest()->getAccount()->setHolder($this->holder);\n $this->paymentObject->getRequest()->getAccount()->setNumber($this->creditCartNumber);\n $this->paymentObject->getRequest()->getAccount()->set('expiry_month', $this->creditCardExpiryMonth);\n $this->paymentObject->getRequest()->getAccount()->set('expiry_year', $this->creditCardExpiryYear);\n $this->paymentObject->getRequest()->getAccount()->setBrand($this->creditCardBrand);\n $this->paymentObject->getRequest()->getAccount()->set('verification', $this->creditCardVerification);\n\n /* prepare request and send it to payment api */\n $request = $this->paymentObject->getRequest()->toArray();\n\n /** @var Response $response */\n list($result, $response) =\n $this->paymentObject->getRequest()->send($this->paymentObject->getPaymentUrl(), $request);\n\n $this->assertTrue($response->isSuccess(), 'Transaction failed : ' . print_r($response->getError(), 1));\n $this->assertFalse($response->isPending(), 'debit is pending');\n $this->assertFalse($response->isError(), 'debit failed : ' . print_r($response->getError(), 1));\n\n $this->logDataToDebug($result);\n\n return (string)$response->getPaymentReferenceId();\n }", "function debit($total, $creditCard)\n {\n }", "public function testOneOrderWithoutCaptureAndCancel()\n {\n $envConfiguration = new \\Paggi\\SDK\\EnvironmentConfiguration();\n $orderCreator = new \\Paggi\\SDK\\Order();\n $cardCreator = new \\Paggi\\SDK\\Card();\n\n $envConfiguration->setEnv(\"Staging\");\n $envConfiguration->setToken(getenv(\"TOKEN\"));\n $envConfiguration->setPartnerIdByToken(getenv(\"TOKEN\"));\n\n $orderCreator = new \\Paggi\\SDK\\Order();\n $envConfiguration = new \\Paggi\\SDK\\EnvironmentConfiguration();\n $cardCreator = new \\Paggi\\SDK\\Card();\n $card = $cardCreator->create(\n [\n \"cvv\" => \"123\",\n \"year\" => \"2022\",\n \"number\" => \"4485200700046446\",\n \"month\" => \"09\",\n \"holder\" => \"BRUCE WAYNER\",\n \"document\" => \"16123541090\",\n ]\n );\n $charge\n = [\n \"amount\" => 5000,\n \"card\" => [\"id\" => $card->id],\n ];\n $orderParams\n = [\n \"capture\" => false,\n \"external_identifier\" => \"ABC123\",\n \"ip\" => \"8.8.8.8\",\n \"charges\" => [$charge],\n \"customer\" =>\n [\n \"name\" => \"Bruce Wayne\",\n \"document\" => \"86219425006\",\n \"email\" => \"bruce@waynecorp.com\",\n ],\n ];\n $response = $orderCreator->create($orderParams);\n $cancel = $response->cancel($response->id);\n $this->assertRegExp(\"/cancelled/\", $cancel->status);\n }", "private function createDeclineForm( Order $order ) {\n $action = $this->generateUrl( 'vendor_order_decline', array('idRelation' => $order->getRelation()->getId(), 'idOrder' => $order->getId()) );\n \n $form = $this->createForm( new OrderDeclinalType(), null, array(\n 'action' => $action,\n 'method' => 'PUT',\n ) );\n \n $form->add( 'submit', 'submit' );\n \n return $form;\n }", "public function test_token_by_create_an_order()\n {\n $response = $this->call('POST', '/api/order', [\n 'address' => [\n 'first_name' => 'test',\n 'last_name' => 'test',\n 'address' => 'test',\n 'phone' => '123456',\n 'email' => 'test@test.com',\n 'country' => 'test',\n 'city' => 'test',\n 'zipcode' => '12345',\n ],\n 'products' => [\n [\n 'product_id' => 1,\n 'quantity' => 1,\n ]\n ]\n ]);\n\n $this->assertEquals(403, $response->getStatusCode());\n }", "public function sendOrderConfirmationRequest(int $orderId): EasycreditOrderConfirmationResponseTransfer;", "public function create_credit_card_auth( WC_Order $order ) {\n\n\t\t$this->create_transaction( self::AUTH_ONLY, $order );\n\t}", "function commerce_license_billing_rules_create_recurring_order($order) {\n commerce_license_billing_create_recurring_order($order);\n}", "public function confirmOrder(RequestConfirmOrder $request);", "function growdev_freshbooks_create_customer( $payment_id ) {\n\n\tglobal $edd_options;\n\n\t$payment = get_post( $payment_id );\n\t$payment_meta = get_post_meta($payment->ID, '_edd_payment_meta', true);\n\t$user_info = maybe_unserialize($payment_meta['user_info']); \n\n\tgrowdev_freshbooks_addlog( 'Creating customer record in FreshBooks for email: ' . $user_info['email'] );\n\t\n\t$xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\";\n\t$xml .= \"<request method=\\\"client.create\\\">\"; \t\t\n\t$xml .= \"<client>\";\n\t$xml .= \"<first_name>\" . $user_info['first_name'] . \"</first_name>\";\n\t$xml .= \"<last_name>\" . $user_info['last_name'] . \"</last_name>\";\n\t$xml .= \"<email>\" . $user_info['email'] . \"</email>\";\n\n\t// Add customer info\n\tif ( isset($user_info['address']) ){\n\t if (isset($user_info['address']['line1'])) \n\t\t $xml .= \"<p_street1>\" . $user_info['address']['line1'] .\"</p_street1>\";\n\t\tif (isset($user_info['address']['line2']))\n\t\t $xml .= \"<p_street2>\" . $user_info['address']['line2'] .\"</p_street2>\";\n\t\tif (isset($user_info['address']['city']))\n\t\t $xml .= \"<p_city>\" . $user_info['address']['city'] .\"</p_city>\";\n\t\tif (isset($user_info['address']['state'] ))\n\t\t $xml .= \"<p_state>\" . $user_info['address']['state'] .\"</p_state>\";\n\t\tif (isset($user_info['address']['country']))\n\t \t$xml .= \"<p_country>\" . $user_info['address']['country'] .\"</p_country>\";\n\t \tif (isset($user_info['address']['zip']))\n\t \t$xml .= \"<p_code>\" . $user_info['address']['zip'] .\"</p_code>\";\n\t}\n\n\t$xml .= \"</client>\";\n\t$xml .= \"</request>\"; \n\n\ttry {\n\n\t\t$result = growdev_freshbooks_apicall( $xml );\n\n\t} catch ( Exception $e ) {\n\n\t\tgrowdev_freshbooks_addlog( $e->getMessage() ); \n\t\treturn 0;\n\n\t}\n\t$response = new SimpleXMLElement( $result );\n\t$is_error = isset( $response['error'] ) ? true : false;\n\n\tif ( ($response->attributes()->status == 'ok') && !$is_error ) {\n\t\t// get the first client\n\t\tif (isset( $response->client_id )) {\n\t\t\treturn $response->client_id ; \n\t\t} else {\n\t\t\tgrowdev_freshbooks_addlog( 'Unable to create client' . $response ); \n\t\t\tthrow new Exception('Unable to create client' . $response );\n\t\t}\n\t\t\t\t\t\n\t} else {\n\t\t// An error occured\n\t\t$error_string = __('There was an error looking up this customer in FreshBooks:','edd') . \"\\n\" . \n\t\t\t\t\t\t__('Error: ','edd') . $response->error . \"\\n\" . \n\t\t\t\t\t\t__('Error Code: ','edd') . $response->code . \"\\n\" . \n\t\t\t\t\t\t__('Error in field: ','edd') . $response->field;\n\t\t\t\t\t\t\n\t\tgrowdev_freshbooks_addlog( $error_string );\n\t\tthrow new Exception('Unable to create client' . $response );\n\t}\t\t\t\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement getPackedSize() method.
public function getPackedSize() { }
[ "public function getUnpackedSize() {}", "public function getPackSize() : int\n {\n return $this->packSize;\n }", "public function extractSize();", "function GetSize(){}", "public function packedLen(): int\n {\n return vscf_message_info_editor_packed_len_php($this->ctx);\n }", "public function __getSize(){\n return $this->$size\n }", "public function getCompressedSize():string\n {\n }", "public function getSize() {\n\t\treturn $this->size;\n\t}", "public function getSize() {\n\t\treturn OMVModuleZFSUtil::bytesToSize($this->size);\n\t}", "abstract function sizeable();", "public function get_size_string()\n {\n return sprintf(\"%sx%s\", $this->size['x'], $this->size['y']);\n }", "public function psize() {\n if ($this->_m_psize !== null)\n return $this->_m_psize;\n $this->_m_psize = ($this->ptrSizeId() == \\BlenderBlend\\PtrSize::BITS_64 ? 8 : 4);\n return $this->_m_psize;\n }", "abstract public function memorySize();", "abstract protected function calculatePartSize();", "public function getTotalSize(): int;", "public function calculateSize()\n {\n $total = 0;\n\n foreach ($this->data as $data) {\n $total = $total + mb_strlen($data, '8bit');\n }\n\n $this->sizeBytes = $total;\n\n return $this->sizeBytes;\n }", "public function getSize()\n\t{\n\t\treturn $this->fixedArray->getSize();\n\t}", "function siSize()\r\n {\r\n\r\n $units = array( \"GB\" => 10737741824,\r\n \"MB\" => 1048576,\r\n \"KB\" => 1024,\r\n \"B\" => 0 );\r\n $decimals = 0;\r\n $size = $this->Size;\r\n $shortsize = $this->Size;\r\n\r\n while ( list( $unit_key, $val ) = each( $units ) )\r\n {\r\n if ( $size >= $val )\r\n {\r\n $unit = $unit_key;\r\n if ( $val > 0 )\r\n {\r\n $decimals = 2;\r\n $shortsize = $size / $val;\r\n }\r\n break;\r\n }\r\n }\r\n $shortsize = number_format( ( $shortsize ), $decimals);\r\n $size = array( \"size\" => $size,\r\n \"size-string\" => $shortsize,\r\n \"unit\" => $unit );\r\n return $size;\r\n }", "public function getMapSize() {\n\t\treturn $this->mapSize;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of user_id_user.
public function getUserIdUser(): int { return $this->user_id_user; }
[ "public function getId_user()\r\n {\r\n return $this->id_user;\r\n }", "public function getUserID()\n\t{\n\t\treturn $this->user_id;\n\t}", "public function getUserId()\n\t{\n\t\t$column = self::COL_USER_ID;\n\t\t$v = $this->$column;\n\n\t\tif ($v !== null) {\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function getUserID() {\n return $this->_getField(\"user\", 0, 2);\n }", "public function getUserId()\n {\n return (property_exists($this->_user_request, 'user_id')) ? $this->_user_request->user_id : false;\n }", "public function get_user_id() {\n\t\treturn $this->customer_user ? intval( $this->customer_user ) : 0;\n\t}", "function getUserId(){\n return $this->user_id;\n }", "protected function getUserId()\n\t{\n\t\t$user_id = $this->input->get->getString('user_id');\n\t\tif (isset($user_id))\n\t\t{\n\t\t\tif ($this->checkUserId() == true)\n\t\t\t{\n\t\t\t\treturn $user_id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->app->errors->addError(\"201\", array($this->input->get->getString('user_id')));\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function userGetId($user_key_id)\n {\n return $this->rawCall(\n array(\n 'method' => 'realm.user_get_id',\n 'user_key_id' => $user_key_id\n )\n );\n }", "public function getUserId()\n {\n return $this->readOneof(3);\n }", "private function extract_user_id($user_id) {\r\n \r\n foreach ($this->data['users'] as $key => $value) {\r\n \r\n if ($value->id == $user_id) return $key;\r\n \r\n }\r\n \r\n return FALSE;\r\n }", "public function getUserID();", "static private function _getUserID(&$user){\n // if name is not a number, get the matching id\n if(! is_numeric($user)){\n $userMapper = new Mapper('User');\n // retrieve the data\n $userMapper->filter('username = (?)',$user);\n $userResult = $userMapper->get();\n\n // if nothing in DB yet, return -1\n if(count($userResult['User']) == 0)\n {\n return -1;\n }\n else{\n return $userResult['User'][0]->id;\n }\n }\n else{\n return intval($user);\n }\n }", "private function getUserID()\n {\n if ($this->_auth->hasIdentity()) {\n $user = $this->_auth->getIdentity();\n $id = $user->id;\n\n return $id;\n }\n }", "public function getUserId() {\n\t\treturn \\OCP\\User::getUser ();\n\t}", "public function getUserID()\n {\n if (isset($this->id)) {\n return (int) $this->id;\n } else {\n $this->id = (int) $this->app['session']->get('user_id');\n return $this->id;\n }\n }", "public function getIIdUser()\n {\n return $this->iIdUser;\n }", "public function getUserId()\n {\n return $this->idTokenClaims[$this->userIdKey] ?? null;\n }", "public function getUserId()\n {\n return isset($this->accessToken['user_id']) ? $this->accessToken['user_id'] : null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the 'form.type.country' service. This service is shared. This method always returns the same instance of the service.
protected function getForm_Type_CountryService() { return $this->services['form.type.country'] = new \Symfony\Component\Form\Extension\Core\Type\CountryType(); }
[ "protected function getOroLocale_Form_Type_CountryService()\n {\n return $this->services['oro_locale.form.type.country'] = new \\Oro\\Bundle\\LocaleBundle\\Form\\Type\\CountryType();\n }", "protected function getSylius_Form_Type_CountryChoiceService()\n {\n return $this->services['sylius.form.type.country_choice'] = new \\Sylius\\Bundle\\AddressingBundle\\Form\\Type\\CountryChoiceType(${($_ = isset($this->services['sylius.repository.country']) ? $this->services['sylius.repository.country'] : $this->get('sylius.repository.country')) && false ?: '_'});\n }", "protected function getSylius_Form_Type_CountryChoiceService()\n {\n return $this->services['sylius.form.type.country_choice'] = new \\Sylius\\Bundle\\AddressingBundle\\Form\\Type\\CountryEntityChoiceType('Sylius\\\\Component\\\\Addressing\\\\Model\\\\Country');\n }", "protected function getCountryService()\n {\n if ($this->countryService === null) {\n $this->countryService = ServiceRegister::getService(WarehouseCountryService::CLASS_NAME);\n }\n\n return $this->countryService;\n }", "protected function getSylius_Form_Type_ZoneMemberCountryService()\n {\n return $this->services['sylius.form.type.zone_member_country'] = new \\Sylius\\Bundle\\AddressingBundle\\Form\\Type\\ZoneMemberCountryType('Sylius\\\\Component\\\\Addressing\\\\Model\\\\ZoneMemberCountry', array(0 => 'sylius'));\n }", "protected function getCountryFactory() {\n return \\Drupal::service('iso3166.country_factory');\n }", "protected function getSylius_Form_Type_CountryCodeChoiceService()\n {\n return $this->services['sylius.form.type.country_code_choice'] = new \\Sylius\\Bundle\\AddressingBundle\\Form\\Type\\CountryCodeChoiceType(${($_ = isset($this->services['sylius.repository.country']) ? $this->services['sylius.repository.country'] : $this->get('sylius.repository.country')) && false ?: '_'});\n }", "public function getGenericCountry()\n {\n if (method_exists($this->extension, 'getGenericCountry')) {\n return $this->extension->getGenericCountry();\n }\n\n // Use save generic country\n return $this->configuration->getData('generic_country');\n }", "protected function getSylius_Repository_CountryService()\n {\n return $this->services['sylius.repository.country'] = new \\Sylius\\Bundle\\ResourceBundle\\Doctrine\\ORM\\EntityRepository($this->get('doctrine.orm.default_entity_manager'), $this->get('doctrine.orm.default_entity_manager')->getClassMetadata('Sylius\\\\Component\\\\Addressing\\\\Model\\\\Country'));\n }", "public function getcountry()\n {\n return $this->_fields['country']['FieldValue'];\n }", "public function country(){\n\t\treturn Country::find(session($this->key));\n\t}", "public function getcountry() {\n /**\n * Returning the resource Model for 'country'\n */\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'country' );\n }", "public function getCountry()\n {\n \t\tif ($this->__blnRestored && empty($this->__blnValid[self::COUNTRY_ID_FIELD])) {\n\t\t\tthrow new Caller(\"CountryId was not selected in the most recent query and is not valid.\");\n\t\t}\n if ((!$this->objCountry) && (!is_null($this->intCountryId))) {\n $this->objCountry = Country::Load($this->intCountryId);\n }\n return $this->objCountry;\n }", "public function getCountryObject()\n {\n return $this->getWrapper()->getCountry($this->country);\n }", "protected function getSylius_PromotionRuleChecker_ShippingCountryService()\n {\n return $this->services['sylius.promotion_rule_checker.shipping_country'] = new \\Sylius\\Component\\Core\\Promotion\\Checker\\Rule\\ShippingCountryRuleChecker(${($_ = isset($this->services['sylius.repository.country']) ? $this->services['sylius.repository.country'] : $this->get('sylius.repository.country')) && false ?: '_'});\n }", "protected function getCountryManager() {\n if (!$this->countryManager) {\n $this->countryManager = \\Drupal::service('country_manager');\n }\n\n return $this->countryManager;\n }", "public static function country() : CountriesRepositoryContract\n {\n return app()->get(CountriesRepositoryContract::class);\n }", "public function getCountryField()\n {\n return $this->country_field;\n }", "public function country()\n {\n if (! $this->bean->country) {\n $this->bean->country = R::dispense('country');\n }\n return $this->bean->country;\n }", "public function getScountry()\n {\n return $this->scountry;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Should every piece of every order entered be logged as it comes in? This helps solve problems when people think they submitted correct orders but may not have, but it can use up lots of disk space and waste resources every time orders are submitted. Every complaint about incorrect orders have been found via the order logs to be correctly received, so it's probably not worth enabling this unless you get many complaints. If this is set to false orders will not be logged, if it returns a writable directory orders will be logged there. Must not be accessible to the web server, as sensitive info is stored in this folder.
public static function orderlogDirectory() { return false; return '../orderlogs'; }
[ "private static function checkPaths() {\n\t\tif(!is_dir (self::$logpath)) mkdir(self::$logpath, 0777);\n\t\tif(!is_file(self::$logfile)) file_put_contents(self::$logfile, \"<?\\n/**\\n#\\n# Tools FTP Log file\\n#\\n*/\\n\\n\");\n\t}", "public function isLoggingForced() {\n return Mage::getStoreConfigFlag(static::XML_PATH_FORCE_LOG);\n }", "private static function checkPaths() {\n\t\tif(!is_dir (self::$logpath)) mkdir(self::$logpath, 0777);\n\t\tif(!is_file(self::$logfile)) file_put_contents(self::$logfile, \"<?\\n/**\\n#\\n# Tools Tool Log file\\n#\\n*/\\n\\n\");\n\t}", "public function check_paths() {\n\t\tif ( ! defined( 'SSP_DEBUG' ) || ! SSP_DEBUG ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( ! is_dir( $this->log_dir_path ) ) {\n\t\t\tmkdir( $this->log_dir_path );\n\t\t}\n\t\tif ( ! is_file( $this->log_path ) ) {\n\t\t\tfile_put_contents( $this->log_path, '' ); //phpcs:ignore WordPress.WP\n\t\t}\n\t}", "public function storeLog($order_id)\n {\n $log['price_discount'] = WC()->session->get('woo_price_discount', array());\n $log['cart_discount'] = WC()->session->get('woo_cart_discount', array());\n\n add_post_meta($order_id, 'woo_discount_log', json_encode($log), 1);\n\n // Reset the Coupon Status.\n WC()->session->set('woo_coupon_removed', '');\n }", "private static function _checkPaths() {\n\t\tif(!is_dir (self::$logpath)) mkdir(self::$logpath, 0777);\n\t\tif(!is_dir (self::$backuppath)) mkdir(self::$backuppath, 0777);\n\t\tif(!is_file(self::$logfile)) file_put_contents(self::$logfile, \"<?\\n/**\\n#\\n# Tools Backup Log file\\n#\\n*/\\n\\n\");\n\t}", "private function is_debug_log_writable_or_show_notice() {\n\t\t$log_dir = $this->get_log_dir();\n\t\t$log_file = $this->get_log_file();\n\t\t$index_file = $this->get_index_file();\n\t\tif ( ! file_exists( $log_dir ) ) {\n\t\t\tif ( ! mkdir( $log_dir, 0777, true) ) {\n\t\t\t\t$this->add_notice_for_dir( $log_dir );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif ( ! file_exists( $index_file ) ) {\n\t\t\t$index_html = fopen( $index_file, 'w' );\n\t\t\tif ( false === $index_html ) {\n\t\t\t\t$this->add_notice_for_file( $index_file );\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tfclose( $index_html );\n\t\t\t}\n\t\t}\n\t\tif ( ! file_exists( $log_file ) ) {\n\t\t\t$log = fopen( $log_file, 'w' );\n\t\t\tif ( false === $log ) {\n\t\t\t\t$this->add_notice_for_file( $log_file );\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tfclose( $log );\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private static function checkPaths() {\n\t\tif(!is_dir (self::$logpath)) mkdir(self::$logpath, 0777);\n\t\tif(!is_dir (self::$backuppath)) mkdir(self::$backuppath, 0777);\n\t\tif(!is_file(self::$logfile)) file_put_contents(self::$logfile, \"<?\\n/**\\n#\\n# Tools Zip Log file\\n#\\n*/\\n\\n\");\n\t\tif(is_file(self::$backupfile)) @unlink(self::$backupfile);\n\t\tself::cleanLog();\n\t}", "public function logAction(){ \n\t\tif($this->changeDir($this->log_location) ){\n\t\t\tif( $handle = fopen($this->filename , 'a+t')) { \n\t\t\t\t $this->writeToFile($handle); \n\t\t\t}else{ \n\t\t\t\t//Manually create file\n\t\t\t\ttouch($this->filename);\n\t\t\t\tif( $handle = fopen($this->filename , 'a+t')) { \n\t\t\t\t\t$this->writeToFile($handle); \n\t\t\t\t} \n\t\t\t} \n\t\t} \n\t\treturn true; \n\t}", "public function testScopedLoggingStrict(): void\n {\n $this->_deleteLogs();\n\n Log::setConfig('debug', [\n 'engine' => 'File',\n 'path' => LOGS,\n 'levels' => ['notice', 'info', 'debug'],\n 'file' => 'debug',\n 'scopes' => null,\n ]);\n Log::setConfig('shops', [\n 'engine' => 'File',\n 'path' => LOGS,\n 'levels' => ['info', 'debug', 'warning'],\n 'file' => 'shops',\n 'scopes' => ['transactions', 'orders'],\n ]);\n\n Log::write('debug', 'debug message');\n $this->assertFileDoesNotExist(LOGS . 'shops.log');\n $this->assertFileExists(LOGS . 'debug.log');\n\n $this->_deleteLogs();\n\n Log::write('debug', 'debug message', 'orders');\n $this->assertFileExists(LOGS . 'shops.log');\n $this->assertFileDoesNotExist(LOGS . 'debug.log');\n\n $this->_deleteLogs();\n\n Log::drop('shops');\n }", "public function exportOrder($order) {\n // Outbound report to Central Station not implemented\n $dirPath = Mage::getBaseDir('var') . DS . 'export';\n Mage::log(\"Export Order ... $dirPath\");\n $exportPath = $dirPath . DS . $order->getIncrementId() . '.xml';\n Mage::log(\"Adding export: \" . $exportPath);\n if($this->centralStationApproved($order)) {\n Mage::getModel('d4dl_orderinspector/queueorder')->queueuOrder($order, \"okay_to_ship\");\n }\n\n //if the export directory does not exist, create it\n if (!is_dir($dirPath)) {\n mkdir($dirPath, 0777, true);\n }\n\n $data = $order->getData();\n\n $xml = new SimpleXMLElement('<root/>');\n\n $callback =\n function ($value, $key) use (&$xml, &$callback) {\n if ($value instanceof Varien_Object && is_array($value->getData())) {\n $value = $value->getData();\n }\n if (is_array($value)) {\n array_walk_recursive($value, $callback);\n }\n $xml->addChild($key, serialize($value));\n };\n\n array_walk_recursive($data, $callback);\n\n file_put_contents(\n $exportPath,\n $xml->asXML()\n );\n\n return true;\n }", "public function printLogToFile()\n {\n file_put_contents(self::LOGFILENAME, \"=== \" . date('Y-m-d H:i:s') . \" === \\n\");\n if (!empty($this->brockenData)) {\n file_put_contents(self::LOGFILENAME, var_export($this->brockenData, TRUE), FILE_APPEND);\n }\n printf(\"Printed all not valid data to '%s' file. \\n\", self::LOGFILENAME);\n }", "protected function shouldLog()\n {\n return !in_array(env('APP_ENV'), config('moloquent-logger.ignore_environments'));\n }", "function enableLog() {\n\t\t(is_a($this->multipay, 'SofortLib')) ? $this->multipay->enableLog() : '';\n\t\t(is_a($this->transactionData, 'SofortLib')) ? $this->transactionData->enableLog() : '';\n\t\t(is_a($this->confirmSr, 'SofortLib')) ? $this->confirmSr->enableLog() : '';\n\t\treturn true;\n\t}", "function writefile_debug($log, $convoArr)\n {\n global $new_convo_id, $old_convo_id;\n $session_id = ($new_convo_id === false) ? session_id() : $new_convo_id;\n $myFile = _DEBUG_PATH_ . $session_id . '.txt';\n if (!IS_WINDOWS)\n {\n $log = str_replace(\"\\n\", \"\\r\\n\", $log);\n $log = str_replace(\"\\r\\r\", \"\\r\", $log);\n }\n file_put_contents($myFile, $log);\n }", "public static function log_platform_special_directories()\n\t{\n\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"JPATH_BASE :\" . JPATH_BASE );\n\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"JPATH_SITE :\" . JPATH_SITE );\n\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"JPATH_ROOT :\" . JPATH_ROOT );\n\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"JPATH_CACHE :\" . JPATH_CACHE );\n\t\tAEUtilLogger::WriteLog(_AE_LOG_INFO, \"Computed root :\" . self::get_site_root() );\n\t}", "protected function is_logging_enabled() {\n\n\t\treturn false;\n\t}", "public function log() {\n\t\tif ( 'yes' === get_option( 'lifterlms_woocommerce_logging_enabled', 'no' ) ) {\n\t\t\tforeach ( func_get_args() as $data ) {\n\t\t\t\tllms_log( $data, 'woocommerce' );\n\t\t\t}\n\t\t}\n\t}", "function is_valid_order($order) {\n $is_valid_order = true;\n\n // check if Header is present\n if (!array_key_exists(HEADER, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Header:\\n\" . var_export($order, true));\n }\n\n // check if Lines is present\n else if (!array_key_exists(LINES, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Lines:\\n\" . var_export($order, true));\n }\n\n // check if Lines is an array\n else if (!is_array($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with non-array Lines:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one Line item\n else if (!count($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Line items:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one total demand\n else if (line_demand_total($order[LINES]) === 0) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with zero total demand:\\n\" . var_export($order, true));\n }\n\n return $is_valid_order;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if an action exists in a given module.
public function actionExists($module, $action) { if (isset($this->modules[$module]['commands'][$action]['cmd'][$this->hostOS])) { return true; } return false; }
[ "public function module_has_action($action)\n\t{\n\t\tif (empty($this->CI->item_actions)) return FALSE;\n\t\treturn (isset($this->CI->item_actions[$action]) OR in_array($action, $this->CI->item_actions));\n\t}", "public function actionExists($action){\n return method_exists($this, $action);\n }", "public function actionExists($action);", "function action_exists($name)\n {\n if (isset($GLOBALS['actions'][$name])) {\n return true;\n } else {\n return false;\n }\n }", "public function isActionAvailable($action);", "public function hasAction($actionId);", "function audition_action_exists($action) {\n\t$exists = array_key_exists($action, audition_get_actions());\n\n\t/**\n\t * Filter whether an action exists or not.\n\t *\n\t * @since 7.0\n\t *\n\t * @param bool $exists Whether the action exists or not.\n\t * @param string $action The action name.\n\t */\n\treturn apply_filters('audition_action_exists', $exists, $action);\n}", "function action_exists($name)\n{\n return Plugins::instance()->action_exists($name);\n}", "public static function doHasAction($module,$do,$action = null) {\n if(is_null($action)) {\n $actions = self::getGlobalOption('actions','editrecord', $module);\n if(!is_array($actions)) return true;\n $action = $do;\n } else {\n $actions = self::getActionsFor( $do, $module, true );\n }\n if(key_exists($action, $actions)) return true;\n return false;\n }", "public function ensureActionExists()\n {\n return method_exists($this->prolet, $this->action);\n }", "protected function actionExists($action)\n {\n return (bool) Route::getRoutes()->getByAction($action);\n }", "public function isActionExists($resourceName, $actionName);", "public function hasAction(string $name): bool;", "public static function hasPermission($action);", "public function hasAction($name) {\n\t\treturn $this->actions->has($name);\n\t}", "function handler_exists($action)\r\n{\r\n\tglobal $HANDLER;\r\n\treturn (isset($HANDLER[$action]));\r\n}", "public static function has_action($event)\n\t{\n if (self::$_debug_level == self::DEBUG_ACTIONS || self::$_debug_level == self::DEBUG_ALL) {\n self::log_message('ACTION - Checking if event \"'.$event.'\" has actions.');\n }\n return (isset(self::$_actions[$event]) && count(self::$_actions[$event]) > 0);\n\t}", "public function checkPossibleAction($action)\n {\n }", "public function hasActionName() {}", "private function ensureActionExists()\n {\n $afCU = new afConfigUtils($this->module);\n if ($afCU->isActionDefined($this->action)) {\n return true;\n }\n\n $actionFilePath = $afCU->generateActionFilePath($this->action);\n\n $fileExists = file_exists($actionFilePath);\n $fileWritable = is_writable($actionFilePath);\n $dirWritable = is_writable(dirname($actionFilePath));\n if (!$dirWritable ||\n $dirWritable && $fileExists && !$fileWritable) {\n return 'I need write permissions to '.$actionFilePath.'. Please check file/dir permissions.';\n }\n\n file_put_contents($actionFilePath, $this->renderActionFileContent());\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Added meta to a collection. The $mediaId is actually the WordPress Post/Attachment ID.
function add_media_to_collection( $mediaId, $collectionId, $isRemove = false ) { $id = $this->get_id_for_collection( $collectionId ); $str = get_post_meta( $id, '_post_image_gallery', TRUE ); $ids = !empty( $str ) ? explode( ',', $str ) : array(); $index = array_search( $mediaId, $ids, false ); if ( $isRemove ) { if ( $index !== FALSE ) unset( $ids[$index] ); } else { // If mediaId already there then exit. if ( $index !== FALSE ) return; array_push( $ids, $mediaId ); } // Update _post_image_gallery update_post_meta( $id, '_post_image_gallery', implode( ',', $ids ) ); // Add a default featured image if none add_post_meta( $id, '_thumbnail_id', $mediaId, true ); }
[ "function add_media_to_collection( $mediaId, $collectionId ) {\n global $wplr;\n\n // Upload the file to the gallery\n $gallery_id = $wplr->get_meta( 'nextgen_gallery_id', $collectionId );\n $abspath = get_attached_file( $mediaId );\n $file_data = file_get_contents( $abspath );\n $file_name = M_I18n::mb_basename( $abspath );\n $attachment = get_post( $mediaId );\n $storage = C_Gallery_Storage::get_instance();\n $image = $storage->upload_base64_image( $gallery_id, $file_data, $file_name );\n $wplr->set_meta( 'nextgen_collection_' . $collectionId . '_image_id', $mediaId, $image->id() );\n\n // Import metadata from WordPress\n $image_mapper = C_Image_Mapper::get_instance();\n $image = $image_mapper->find( $image->id() );\n if ( !empty( $attachment->post_excerpt ) )\n $image->alttext = $attachment->post_excerpt;\n if ( !empty( $attachment->post_content ) )\n $image->description = $attachment->post_content;\n $image_mapper->save( $image );\n }", "function add_media_to_collection( $mediaId, $collectionId ) {\n // $post = get_post( $mediaId );\n // global $wpdb;\n // $bwg_image = $wpdb->prefix . \"bwg_image\";\n // $wpdb->insert( $bwg_image,\n // array(\n // 'gallery_id' => $collectionId,\n // 'author' => get_current_user_id()\n // )\n // );\n }", "function add_media_to_collection( $mediaId, $collectionId, $reOrder = false ) {\n\t\t$this->log( sprintf( \"add_media_to_collection %d to collection %d.\", $mediaId, $collectionId ), true );\n\t}", "function set_media_to_collection( $mediaId, $collectionId, $isRemove = false ) {\n\t\tglobal $wplr;\n\n\t\t$maps = $this->get_mappings();\n\t\tforeach ( $maps as $map ) { // TODO: Make the overall operation mapping-wise\n\t\t\t$mode = $map->posttype_mode;\n\t\t\t$wplr_pt_posttype = $this->get_metaname_for_posttype( $map->id );\n\t\t\t$wplr_pt_term_id = $this->get_metaname_for_term_id( $map->id );\n\t\t\t$id = $wplr->get_meta( $wplr_pt_posttype, $collectionId );\n\n\t\t\t// Main collection\n\t\t\t$this->set_media_to_collection_one( $id, $mediaId, $mode, $map,\n\t\t\t\t$collectionId, $wplr_pt_posttype, $wplr_pt_term_id, $isRemove, false );\n\n\t\t\t// Translations\n\t\t\t$ids = $this->get_translations_for_post( $id );\n\t\t\tif ( !empty( $ids ) ) {\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$this->set_media_to_collection_one( $id, $mediaId, $mode, $map,\n\t\t\t\t\t\t$collectionId, $wplr_pt_posttype, $wplr_pt_term_id, $isRemove, true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addPostMedia($post_id,$media_id,$link_type='attachment')\n\t{\n\t\t$post_id = (integer) $post_id;\n\t\t$media_id = (integer) $media_id;\n\t\t\n\t\t$f = $this->getPostMedia(array('post_id'=>$post_id,'media_id'=>$media_id,'link_type'=>$link_type));\n\t\t\n\t\tif (!$f->isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$cur = $this->con->openCursor($this->table);\n\t\t$cur->post_id = $post_id;\n\t\t$cur->media_id = $media_id;\n\t\t$cur->link_type = $link_type;\n\t\t\n\t\t$cur->insert();\n\t\t$this->core->blog->triggerBlog();\n\t}", "private function addMediaById($mediaId)\n {\n $this->queue['id'][] = $mediaId;\n }", "function remove_media_from_collection( $mediaId, $collectionId ) {\n global $wplr;\n $imageId = $wplr->get_meta( 'nextgen_collection_' . $collectionId . '_image_id', $mediaId );\n $image_mapper = C_Image_Mapper::get_instance();\n $image = $image_mapper->find( $imageId );\n $storage = C_Gallery_Storage::get_instance();\n $storage->delete_image( $image );\n $wplr->delete_meta( 'nextgen_collection_' . $collectionId . '_image_id', $mediaId );\n }", "public function on_media_add( $media_id ) {\n\t\t$media = mpp_get_media( $media_id );\n\n\t\tif ( is_null( $media ) || 'video' !== $media->type || $media->is_remote ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add to conversion queue.\n\t\tmpplt_add_item( array( 'media_id' => $media_id ) );\n\n\t\t// Add to video preview generation queue.\n\t\tmpplt_add_item(\n\t\t\tarray(\n\t\t\t\t'media_id' => $media_id,\n\t\t\t\t'queue_type' => 'preview_generation',\n\t\t\t)\n\t\t);\n\t}", "function add_meta($post_id)\n {\n }", "public function mw_newMediaObject(/**\n * Fires after a new attachment has been added via the XML-RPC MovableType API.\n *\n * @since 3.4.0\n *\n * @param int $id ID of the new attachment.\n * @param array $args An array of arguments to add the attachment.\n */\n$args) {}", "public function registerMediaCollections(): void\n {\n $this->addMediaCollection('postImages');\n }", "public function insert($userId, $collection, Google_Service_PlusPages_Media $postBody, $optParams = array()) {\n $params = array('userId' => $userId, 'collection' => $collection, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_PlusPages_Media\");\n }", "public function sdb_add_post_meta($post_id, $key, $value, $is_single = false) {\n global $wpdb;\n add_post_meta($post_id, $key, $value, $is_single);\n return $wpdb->insert_id;\n }", "public function register_meta(): void {\n\t\tregister_meta(\n\t\t\t'post',\n\t\t\tself::POSTER_ID_POST_META_KEY,\n\t\t\t[\n\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'description' => __( 'Attachment id of generated poster image.', 'web-stories' ),\n\t\t\t\t'show_in_rest' => true,\n\t\t\t\t'default' => 0,\n\t\t\t\t'single' => true,\n\t\t\t\t'object_subtype' => 'attachment',\n\t\t\t]\n\t\t);\n\t}", "function remove_media_from_collection($mediaId, $collectionId)\n\t{\n\t\twp_rml_move(-1, array( $mediaId ), true);\n\t}", "function add($media)\n {\n // Validation\n if (!$media->valid) {\n $media->addErrors($media->errors);\n return false;\n }\n \n $db = mm_getDatabase();\n $sql = \"INSERT INTO mm_media \"\n . \" (owner_id, owner_type,\"\n . \" filename,\"\n . \" name, description, width, height,\"\n . \" mime_type, sortorder)\"\n . \" VALUES (\"\n . intval($media->owner_id)\n . \",\" . dq($media->owner_type)\n . \",\" . dq($media->filename)\n . \",\" . dq($media->name)\n . \",\" . dq($media->description)\n . \",\" . intval($media->width)\n . \",\" . intval($media->height)\n . \",\" . dq($media->mime_type)\n . \",\" . intval($media->sortorder)\n . \")\";\n $db->execute($sql);\n $media->id = $id = $db->lastInsertId();\n if (!$media->filename) $media->filename = $media->generateFilename();\n if (!$this->moveOrDelete($media)) {\n // Roll back\n $media->delete();\n return false;\n }\n else {\n // Update the record with the generated filename\n $media->filename = $media->generateFilename();\n $db->execute(\"UPDATE mm_media SET filename=? WHERE id=?\", array($media->filename, $media->id));\n return true;\n }\n }", "function set_media( $post_id, $media ) {\n\t$settings = get_settings(); // phpcs:ignore\n\t$current_media_posts = get_attached_media( get_allowed_mime_types(), $post_id );\n\t$current_media = [];\n\n\t// Create mapping so we don't create duplicates\n\tforeach ( $current_media_posts as $media_post ) {\n\t\t$original = get_post_meta( $media_post->ID, 'dt_original_media_url', true );\n\t\t$current_media[ $original ] = $media_post->ID;\n\t}\n\n\t$found_featured_image = false;\n\n\t// If we only want to process the featured image, remove all other media\n\tif ( 'featured' === $settings['media_handling'] ) {\n\t\t$featured_keys = wp_list_pluck( $media, 'featured' );\n\n\t\t// Note: this is not a strict search because of issues with typecasting in some setups\n\t\t$featured_key = array_search( true, $featured_keys ); // @codingStandardsIgnoreLine Ignore strict search requirement.\n\n\t\t$media = ( false !== $featured_key ) ? array( $media[ $featured_key ] ) : array();\n\t}\n\n\tforeach ( $media as $media_item ) {\n\n\t\t// Delete duplicate if it exists (unless filter says otherwise)\n\t\t/**\n\t\t * Filter whether media should be deleted and replaced if it already exists.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param bool true Controls whether pre-existing media should be deleted and replaced. Default 'true'.\n\t\t * @param int $post_id The post ID.\n\t\t */\n\t\tif ( apply_filters( 'dt_sync_media_delete_and_replace', true, $post_id ) ) {\n\t\t\tif ( ! empty( $current_media[ $media_item['source_url'] ] ) ) {\n\t\t\t\twp_delete_attachment( $current_media[ $media_item['source_url'] ], true );\n\t\t\t}\n\n\t\t\t$image_id = process_media( $media_item['source_url'], $post_id );\n\t\t} else {\n\t\t\tif ( ! empty( $current_media[ $media_item['source_url'] ] ) ) {\n\t\t\t\t$image_id = $current_media[ $media_item['source_url'] ];\n\t\t\t} else {\n\t\t\t\t$image_id = process_media( $media_item['source_url'], $post_id );\n\t\t\t}\n\t\t}\n\n\t\t// Exit if the image ID is not valid.\n\t\tif ( ! $image_id ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tupdate_post_meta( $image_id, 'dt_original_media_url', $media_item['source_url'] );\n\t\tupdate_post_meta( $image_id, 'dt_original_media_id', $media_item['id'] );\n\n\t\tif ( $media_item['featured'] ) {\n\t\t\t$found_featured_image = true;\n\t\t\tset_post_thumbnail( $post_id, $image_id );\n\t\t}\n\n\t\t// Transfer all meta\n\t\tif ( isset( $media_item['meta'] ) ) {\n\t\t\tset_meta( $image_id, $media_item['meta'] );\n\t\t}\n\n\t\t// Transfer post properties\n\t\twp_update_post(\n\t\t\t[\n\t\t\t\t'ID' => $image_id,\n\t\t\t\t'post_title' => $media_item['title'],\n\t\t\t\t'post_content' => $media_item['description']['raw'],\n\t\t\t\t'post_excerpt' => $media_item['caption']['raw'],\n\t\t\t]\n\t\t);\n\t}\n\n\tif ( ! $found_featured_image ) {\n\t\tdelete_post_meta( $post_id, '_thumbnail_id' );\n\t}\n}", "public function addMedia($file, $collectionName = 'default', $preserveOriginal = false, $addAsTemporary = false);", "function remove_media_from_collection( $mediaId, $collectionId ) {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the minlength attribute value.MDN: Defines the minimum number of characters allowed in the element. Parent tags allowed: ,
public function get_minlength() { return $this->get_attr('minlength'); }
[ "public function getMinLength()\r\r\n {\r\r\n return $this->minLength;\r\r\n }", "public function getMinLength()\n {\n return $this->min_length;\n }", "public function getMinLength()\n {\n return $this->minLength;\n }", "public function getMinLength()\r\n {\r\n return $this->_length;\r\n }", "public function getMinimumLength()\n {\n return $this->minimum_length;\n }", "public function getMinimumLength()\n {\n if (array_key_exists(\"minimumLength\", $this->_propDict)) {\n return $this->_propDict[\"minimumLength\"];\n } else {\n return null;\n }\n }", "public function getMinLen()\n {\n return isset($this->min_len) ? $this->min_len : 0;\n }", "protected function getMinLengthToSearch()\n {\n return $this->_minLength;\n }", "public function getMinIdentityLength();", "protected function getMinLengthField() { ?>\r\n\t\t<div class=\"form-group\">\r\n\t\t\t<label>Min length (characters)</label>\r\n\t\t\t<input type=\"number\" v-model=\"field.minlength\">\r\n\t\t</div>\r\n\t<?php }", "public function set_minlength($value)\r\n\t{\r\n\t\treturn $this->set_attr('minlength', $value);\r\n\t}", "public function getMltMinWordLength () {}", "function getMinPasswordLength() {\n\t\treturn $this->getData('minPasswordLength');\n\t}", "public function getNationalNumberMinLength()\n {\n return $this->_nationalNumberMinLength;\n }", "public function has_minlength(): bool {\n\t\treturn $this->has_attribute( 'minlength' );\n\t}", "public function getMinPrefixLength()\n {\n return $this->min_prefix_length;\n }", "public function getMin()\n {\n return $this->getAttribute('min');\n }", "function testMinlen(){\n\t\t#mdx:minlen\n\t\tParam::get('description')->filters()->minlen(10, \"Description must be at least %d characters long!\");\n\n\t\t$error = Param::get('description')->process(['description'=>'Test'])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains('at least 10', $error);\n\n\t}", "public static function getPasswordLenMin() {\n $retVal = Settings::getItem(Settings::KEY_PASSWORD_LEN_MIN);\n if (!empty($retVal)) {\n return $retVal;\n }\n return 6;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds sanitization callback function: text align
function skyre_sanitize_text_align( $input ) { $talign = skyre_get_text_aligns(); if ( array_key_exists( $input, $talign ) ) { return $input; } else { return ''; } }
[ "function getTextAlignment(){}", "function setTextAlignment($alignment){}", "function do_bbcode_align($action, $attr, $content, $params, $node_object) {\n\treturn '<div style=\"text-align:'. $attr['default'] .'\">'. $content .'</div>';\n}", "function aligner($letexte, $justif='') {\n\t$letexte = trim($letexte);\n\tif (!strlen($letexte)) return '';\n\n\t// Paragrapher proprement\n\t$letexte = paragrapher($letexte, true);\n\n\t// Inserer les alignements\n\tif ($justif)\n\t\t$letexte = str_replace(\n\t\t'<p class=\"spip\">', '<p class=\"spip\" align=\"'.$justif.'\">',\n\t\t$letexte);\n\n\treturn $letexte;\n}", "function aling_center($text){\n $pad = $this->width;\n return str_pad($text,$pad,\" \",STR_PAD_BOTH);\n }", "private function align_text ( $font_size, $font, $str, $width, $type )\n {\n $margin = 30;\n if ( $type == 'left' )\n {\n $newX = $margin; // ako si levi, treba poceti od margine, sto zavisi od ulazne slike\n } \n if ( $type == 'center' )\n {\n $box = imagettfbbox( $font_size, 0, $font, $str);\n $newX = $width/2 - ($box[2]-$box[0])/2;\n }\n if ( $type == 'right' )\n {\n $box = imagettfbbox( $font_size, 0, $font, $str);\n $newX = $width - ($box[2]-$box[0]) - $margin;\n } \n return $newX;\n }", "public static function textAlign($text, $align = self::TEXT_ALIGN_LEFT, $text_width = 76, $newline_str = \"\\n\",\r\n $cut_words = true, $paragraph_sep_lines = 1, $paragraph_indent = 0)\r\n {\r\n // remove redundant spaces\r\n $text = trim(preg_replace('/ +/', ' ', $text));\r\n\r\n switch ($align & 0x0F)\r\n {\r\n case self::TEXT_ALIGN_LEFT:\r\n {\r\n // add paragraph indents\r\n if ($paragraph_indent > 0)\r\n {\r\n $indent = str_repeat(\"\\0\", $paragraph_indent);\r\n $text = $indent . str_replace($newline_str, $newline_str . $indent, $text);\r\n }\r\n\r\n $text = str_replace($newline_str, str_repeat($newline_str, $paragraph_sep_lines + 1), $text);\r\n $text = wordwrap($text, $text_width, $newline_str, $cut_words);\r\n return str_replace(\"\\0\", ' ', $text);\r\n }\r\n\r\n case self::TEXT_ALIGN_CENTER:\r\n case self::TEXT_ALIGN_RIGHT:\r\n {\r\n $text = str_replace($newline_str, str_repeat($newline_str, $paragraph_sep_lines + 1), $text);\r\n $text = wordwrap($text, $text_width, $newline_str, $cut_words);\r\n $lines = explode($newline_str, $text);\r\n\r\n $pad_type = $align == self::TEXT_ALIGN_RIGHT ? STR_PAD_LEFT : STR_PAD_BOTH;\r\n\r\n for ($l = 0; $l < count($lines); $l++)\r\n {\r\n $line_len = strlen($lines[$l]);\r\n if ($line_len == 0) { continue; }\r\n $line_add = $text_width - $line_len;\r\n\r\n if ($line_add > 0)\r\n {\r\n $lines[$l] = str_pad($lines[$l], $text_width, ' ', $pad_type);\r\n }\r\n }\r\n\r\n return implode($newline_str, $lines);\r\n }\r\n\r\n case self::TEXT_ALIGN_JUSTIFY:\r\n {\r\n // split text into paragraphs\r\n $paragraphs = explode($newline_str, $text);\r\n\r\n for ($p = 0; $p < count($paragraphs); $p++)\r\n {\r\n // trim paragraph\r\n $paragraphs[$p] = trim($paragraphs[$p]);\r\n\r\n // add paragraph indents\r\n if ($paragraph_indent > 0)\r\n {\r\n $indent = str_repeat(\"\\0\", $paragraph_indent);\r\n $paragraphs[$p] = $indent . str_replace($newline_str, $newline_str . $indent, $paragraphs[$p]);\r\n $nulls_added = true;\r\n }\r\n\r\n // wrap paragraph words\r\n $paragraphs[$p] = wordwrap($paragraphs[$p], $text_width, $newline_str, $cut_words);\r\n\r\n // split paragraph into lines\r\n $paragraphs[$p] = explode($newline_str, $paragraphs[$p]);\r\n\r\n // last line index\r\n $pl_to = ($align & self::TEXT_ALIGN_FLAG_JUSTIFY_ALL_LINES) ? count($paragraphs[$p]) : count($paragraphs[$p]) - 1;\r\n\r\n for ($pl = 0; $pl < $pl_to; $pl++)\r\n {\r\n // spaces to be added\r\n $line_spaces_to_add = $text_width - strlen($paragraphs[$p][$pl]);\r\n // split line\r\n $paragraphs[$p][$pl] = explode(' ', $paragraphs[$p][$pl]);\r\n // number of words per line\r\n $line_word_count = count($paragraphs[$p][$pl]);\r\n\r\n if ($line_word_count > 1 && $line_spaces_to_add > 0)\r\n {\r\n // spaces per each word (float)\r\n $line_spaces_per_word = $line_spaces_to_add / ($line_word_count - 1);\r\n $word_spaces_to_add = 0;\r\n\r\n for ($w = 0; $w < $line_word_count - 1; $w++)\r\n {\r\n // (float) spaces to add\r\n $word_spaces_to_add += $line_spaces_per_word;\r\n // actual number of spaces to add (int)\r\n $word_spaces_to_add_int = (int) round($word_spaces_to_add);\r\n\r\n if ($word_spaces_to_add_int > 0)\r\n {\r\n $paragraphs[$p][$pl][$w] .= str_repeat(' ', $word_spaces_to_add_int);\r\n $word_spaces_to_add -= $word_spaces_to_add_int;\r\n }\r\n }\r\n }\r\n\r\n // restore line\r\n $paragraphs[$p][$pl] = implode(' ', $paragraphs[$p][$pl]);\r\n }\r\n\r\n // replace \"\\0\" with spaces\r\n if ($nulls_added)\r\n {\r\n $paragraphs[$p][0] = str_replace(\"\\0\", ' ', $paragraphs[$p][0]);\r\n }\r\n\r\n // restore paragraph\r\n $paragraphs[$p] = implode($newline_str, $paragraphs[$p]);\r\n }\r\n\r\n // restore text\r\n $paragraphs = implode(str_repeat($newline_str, $paragraph_sep_lines + 1), $paragraphs);\r\n\r\n return $paragraphs;\r\n }\r\n }\r\n }", "public function textFormats() {\n $this->str = preg_replace('#\\[b\\](.+?)\\[/b\\]#', '<b>$1</b>', $this->str);\n $this->str = preg_replace('#\\[u\\](.+?)\\[/u\\]#', '<u>$1</u>', $this->str);\n $this->str = preg_replace('#\\[i\\](.+?)\\[/i\\]#', '<i>$1</i>', $this->str);\n $this->str = preg_replace('#\\[tt\\](.+?)\\[/tt\\]#', '<code class=\"inline\">$1</code>', $this->str);\n $this->str = preg_replace('#\\[del\\](.+?)\\[/del\\]#', '<del>$1</del>', $this->str);\n $this->str = preg_replace('#\\[ins\\](.+?)\\[/ins\\]#', '<ins>$1</ins>', $this->str);\n $this->str = preg_replace('#\\[mark\\](.+?)\\[/mark\\]#', '<mark>$1</mark>', $this->str);\n $this->str = preg_replace('#\\[address\\](.+?)\\[/address\\]#s', '<address>$1</address>', $this->str);\n $this->str = preg_replace('=&amp;=is', '&', $this->str);\n }", "function getTextDecoration(){}", "function aligner($str, $justification = 'L') {\n global $j2justtype;\n assert(array_key_exists($justification, $j2justtype));\n $justtype = $j2justtype[$justification];\n\n $fieldsbyrow = array();\n foreach (explode(\"\\n\", $str) as $line)\n $fieldsbyrow[] = explode('$', $line);\n $maxfields = max(array_map('count', $fieldsbyrow));\n\n foreach (range(0, $maxfields-1) as $col) {\n $maxwidth = 0;\n foreach ($fieldsbyrow as $fields)\n $maxwidth = max($maxwidth, strlen($fields[$col]));\n foreach ($fieldsbyrow as &$fields)\n $fields[$col] = str_pad($fields[$col], $maxwidth, ' ', $justtype);\n unset($fields); // see http://bugs.php.net/29992\n }\n $result = '';\n foreach ($fieldsbyrow as $fields)\n $result .= implode(' ', $fields) . \"\\n\";\n return $result;\n}", "public function gettextdecoration()\n {\n }", "public function textAlign($value) {\n return $this->css('text-align', $value);\n }", "public function stdWrap_wrapAlignDataProvider() {}", "function MarginSetText($line, $text){}", "private function align_center_img_txt ($text_new)\n \t{\n \t\t$text_new = trim($text_new);\n \t\t$text_a_tmp = explode(\"\\n\", $text_new);\n \t\t$max_line_length1 = 0;\n\t \tforeach($text_a_tmp as $line){\n\t \t\tif ( mb_strlen($line) > $max_line_length1) $max_line_length1 = mb_strlen($line);\n\t \t}\n\t \t$text_new = ''; // reset\n\t \tforeach($text_a_tmp as $line){\n\t \t\t$text_new .= $this->mb_str_pad($line, $max_line_length1, ' ', STR_PAD_BOTH) . \"\\n\";\n\t \t}\n\t \treturn $text_new;\n \t}", "public static function alignProvider() {\n\t\treturn array(\n\t\t\tarray( 'left', 'left', 'Failed to accept a left align value' ),\n\t\t\tarray( 'LEFT', 'left', 'Failed to accept an ALL CAPS align value' ),\n\t\t\tarray( ' left ', 'left', 'Failed to trim spaces from align value' ),\n\t\t\tarray( 'center', 'center', 'Failed to accept a center align value' ),\n\t\t\tarray( 'right', 'right', 'Failed to accept a right align value' ),\n\t\t);\n\t}", "public function formatPlain($text);", "function trusttext_mark($text) {\n\tglobal $CFG;\n\tif (! empty ( $CFG->enabletrusttext ) and (strpos ( $text, TRUSTTEXT ) === FALSE)) {\n\t\treturn TRUSTTEXT . $text;\n\t} else {\n\t\treturn $text;\n\t}\n}", "function MarginGetText($line){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows the user to add another privilege in the application
public function addAction(){ $this->title = 'Add a new privilege.'; $form = new PrivilegeForm(); $privilegeModel = new Privilege(); if($this->getRequest()->isPost()){ if($form->isValid($this->getRequest()->getPost())){ $privilegeModel->save($form->getValues()); $this->_helper->FlashMessenger( array( 'msg-success' => 'The privilege was successfully added.', ) ); //Regenerate Flag and Flippers App_FlagFlippers_Manager::save(); $this->_redirect('/privileges/'); } } $this->view->form = $form; }
[ "public function addPrivilegeAction() {\n\n }", "public function addSitePrivileges()\n {\n\n }", "public function testUpdatePrivilege()\n {\n }", "protected function privilegeAction()\n {\n $userRoleID = $this->flattenArray($this->userRole->getRepo()->findBy(['role_id'], ['user_id' => $this->thisRouteID()]));\n /* additional data we are dispatching on this route to our event dispatcher */\n $eventDispatchData = ['user_id' => $this->thisRouteID(), 'prev_role_id' => $userRoleID[0]];\n\n $this->simpleUpdateAction\n ->setAccess($this, Access::CAN_EDIT_PRIVILEGE)\n ->execute($this, UserRoleEntity::class, UserRoleActionEvent::class, NULL, __METHOD__, [], $eventDispatchData, $this->userRole)\n ->render()\n ->with(\n [\n 'roles' => $this->roles->getRepo()->findAll(),\n 'user_role' => $userRoleID,\n 'row' => $this->toArray($this->findOr404()),\n 'temp_role' => $this->tempRole->getRepo()->findBy(['*'], ['user_id' => $this->thisRouteID()])\n ]\n )\n ->form($this->userPrivilege)\n ->end();\n }", "public function testCreatePrivilege()\n {\n }", "public function testUpdatePrivilege1()\n {\n }", "public function addSitePrivileges()\n {\n if ($this->addSitePrivilegeStatement == null) {\n $this->addSitePrivilegeStatement = $this->connection->prepare(\"\n INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,0,1,NULL)\");\n }\n $this->addSitePrivilegeStatement->execute(array($this->user->getUsername()));\n $this->sitePrivilege = 1;\n }", "public function addRootPrivileges();", "public function privilegeAction()\n {\n $privileges = array();\n\n foreach ($this->acl->getPrivilegeRoles() as $privilege => $roles) {\n $privileges[$privilege][$this->_('Privilege')] = $privilege;\n $privileges[$privilege][$this->_('Allowed')] = $roles[\\Zend_Acl::TYPE_ALLOW] ? implode(', ', $roles[\\Zend_Acl::TYPE_ALLOW]) : null;\n $privileges[$privilege][$this->_('Denied')] = $roles[\\Zend_Acl::TYPE_DENY] ? implode(', ', $roles[\\Zend_Acl::TYPE_DENY]) : null;\n }\n\n // Add unassigned rights to the array too\n $all_existing = $this->getUsedPrivileges();\n $unassigned = array_diff_key($all_existing, $privileges);\n $nonexistent = array_diff_key($privileges, $all_existing);\n unset($nonexistent['pr.nologin']);\n unset($nonexistent['pr.islogin']);\n ksort($nonexistent);\n\n foreach ($unassigned as $privilege => $description) {\n $privileges[$privilege] = array(\n $this->_('Privilege') => $privilege,\n $this->_('Allowed') => null,\n $this->_('Denied') => null\n );\n }\n ksort($privileges);\n\n $this->html->h2($this->_('Project privileges'));\n $this->_showTable($this->_('Privileges'), $privileges, true);\n\n // Nonexistent rights are probably left-overs from old installations, this should be cleaned\n if (!empty($nonexistent)) {\n $this->_showTable($this->_('Assigned but nonexistent privileges'), $nonexistent, true);\n }\n // $this->acl->echoRules();\n }", "public function create_super_admin_capability()\n {\n global $db_driver; global $CONFIG;global $db;\n $user_log_id = $db_driver->get_record('user_log', 'id', array('email'=>$CONFIG->admin_email));\n if(empty($user_log_id['id']))\n {\n echo (\"Error NO SUPER ADMIN: The system don't have any log account created with this email yet-> \".$CONFIG->admin_email.\". Please sign Up an account with this email\");\n //header(\"Location: ../log/SignIn.php\");\n }else\n {\n $super_admin_capability = $this->get_superadmin(); //check if there is one user already with super_admin capability\n if (empty($super_admin_capability))\n { //if there is not one, then createa a super_admin_user\n $stmt = $db->prepare(\"INSERT INTO user_capabilities (log_id, permission) VALUES (:log_id, :permission) \");\n $stmt->bindValue(':log_id', $user_log_id['id']);\n $stmt->bindValue(':permission', 'super_admin');\n $stmt->execute();\n }\n }\n\n }", "public function testCreatePrivilege3()\n {\n }", "function privilegeFromName($privilegeName);", "function fd_add_new_admin_caps()\n{\n\t$admin_role = get_role( 'administrator' );\n\t$admin_role->add_cap( 'create_food');\n\t$admin_role->add_cap( 'read_food');\n\t$admin_role->add_cap( 'edit_food');\n\t$admin_role->add_cap( 'read_others_food');\n\t$admin_role->add_cap( 'read_others_foods');\n\t$admin_role->add_cap( 'edit_others_food');\n\t$admin_role->add_cap( 'edit_others_foods');\n\t$admin_role->add_cap( 'delete_food');\n\t$admin_role->add_cap( 'delete_foods');\n\t$admin_role->add_cap( 'publish_food');\n\t$admin_role->add_cap( 'edit_published_food');\n\t$admin_role->add_cap( 'read_private_food');\n\t\n\t\n}", "function addPrivilege( $prop) {\r\n\t\t$idUser\t\t= (integer)($prop[\"idUser\"]);\r\n\t\t$category\t= RegExp($prop[\"category\"], \"[a-zA-Z0-9_\\ ]+\");\r\n\t\t$page\t\t= RegExp($prop[\"page\"], \"[a-zA-Z0-9_\\ \\/\\.\\,\\-\\\\\\*\\+]+\");\r\n\t\t$field\t\t= mysql_real_escape_string($prop[\"field\"]);\r\n\t\t$privilege\t= RegExp($prop[\"privilege\"], '-|r|w|x');\r\n\t\t$format\t\t= isset($prop[\"format\"])? $prop[\"format\"]: \"OBJECT\";\r\n\t\t\r\n\t\tif ( !$idUser) {\r\n\t\t\t$idUser\t= $_SESSION[\"id-admin\"];\r\n\t\t}\r\n\t\t\r\n\t\t//o usuário tem o privilégio necessário para adicionar permissões???\r\n\t\tif ( CheckPrivileges( '*', \"OBJECT\", \"users/privileges/\") < 2) {\r\n\t\t\tdie(\"Negado!\");\r\n\t\t}\r\n\t\t\r\n\t\t$result\t= mysql_query(\"SELECT id, nome FROM a744e89c3d WHERE id = $idUser\");\r\n\t\t$row\t= mysql_fetch_assoc($result);\r\n\t\t\r\n\t\tif ( !$row[\"nome\"]) {\r\n\t\t\tdie(\"Usu&aacute;rio n&atilde;o existe!\");\r\n\t\t}\r\n\t\t\r\n\t\tLogAdmActivity( array(\r\n\t\t\t\"page\"\t\t=> \"/jsAdmin/Usuarios/privilegios/{$row['nome']}/\",\r\n\t\t\t\"action\"\t=> \"insert\",\r\n\t\t\t\"name\"\t\t=> \"privilegio\",\r\n\t\t\t\"value\"\t\t=> $value,\r\n\t\t\t\"remarks\"\t=> \"Adição de privilégio para o usuário\"\r\n\t\t));\r\n\t\t\r\n\t\t$row\t= mysql_fetch_array(mysql_query(\"\r\n\t\t\tSELECT\r\n\t\t\t\tid\r\n\t\t\tFROM\r\n\t\t\t\tprvlgs_flds\r\n\t\t\tWHERE\r\n\t\t\t\t1 = 1\r\n\t\t\t\tAND category\t= '$category'\r\n\t\t\t\tAND url\t\t\t= '$page'\r\n\t\t\t\tAND field\t\t= '$field'\r\n\t\t\"));\r\n\t\t$idPage\t= $row[0];\r\n\t\t\r\n\t\tif ( !$idPage) {\r\n\t\t\t$sql\t= \"\r\n\t\t\t\tINSERT INTO prvlgs_flds(\r\n\t\t\t\t\tcategory, url, field\r\n\t\t\t\t)\r\n\t\t\t\tVALUES(\r\n\t\t\t\t\t'$category', '$page', '$field'\r\n\t\t\t\t)\r\n\t\t\t\";\r\n\t\t\t$result\t= mysql_query( $sql) or die(\"SQL UPDATE Error (1)\");\r\n\t\t\t$idPage\t= mysql_insert_id();\r\n\t\t}\r\n\t\t\r\n\t\tif ( !$idPage) {\r\n\t\t\tdie(\"Page not found!\");\r\n\t\t}\r\n\t\t\r\n\t\t$sql\t= \"\r\n\t\t\tINSERT INTO prvlgs(\r\n\t\t\t\tid_user, id_page, privilege\r\n\t\t\t)\r\n\t\t\tSELECT\r\n\t\t\t\t$idUser, $idPage, '$privilege'\r\n\t\t\tFROM\r\n\t\t\t\tprvlgs\r\n\t\t\tWHERE\r\n\t\t\t\t1 = 1\r\n\t\t\t\tAND id_user\t\t= $idUser\r\n\t\t\t\tAND id_page\t\t= $idPage\r\n\t\t\t\tAND privilege\t= '$privilege'\r\n\t\t\tHAVING\r\n\t\t\t\tCOUNT(*) = 0\r\n\t\t\";\r\n\t\t$result\t= mysql_query( $sql) or die(\"SQL INSERT Error (2)\");\r\n\t\t\r\n\t\tif ( $format == \"JSON\") {\r\n\t\t\tprint(\"\r\n\t\t\t\t//#privilege created successfully (\". mysql_affected_rows() .\")\r\n\t\t\t\tidPage\t= $idPage;\r\n\t\t\t\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function addPrivilege($type, $id) {\n\t\tglobal $guava;\n\t\tswitch($type) {\n\t\t\tcase 'user':\n\t\t\t\t$userInfo = $guava->getUser($id);\n\t\t\t\tif($userInfo) {\n\t\t\t\t\t$priv_array = array('type' => 'user', 'id' => $id, 'access' => 'read', 'name' => $userInfo['username']);\n\t\t\t\t\tif(!$this->privExists($priv_array,'read')) {\n\t\t\t\t\t\t$this->privs[] = $priv_array;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'group':\n\t\t\t\t$groupInfo = $guava->getGroup($id);\n\t\t\t\tif($groupInfo) {\n\t\t\t\t\t$priv_array = array('type' => 'group', 'id' => $id, 'access' => 'read', 'name' => $groupInfo['name']);\n\t\t\t\t\tif(!$this->privExists($priv_array,'read')) {\n\t\t\t\t\t\t$this->privs[] = $priv_array;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'role':\n\t\t\t\t$roleInfo = $guava->getRole($id);\n\t\t\t\tif($roleInfo) {\n\t\t\t\t\t$priv_array = array('type' => 'role', 'id' => $id, 'access' => 'read', 'name' => $roleInfo['name']);\n\t\t\t\t\tif(!$this->privExists($priv_array,'read')) {\n\t\t\t\t\t\t$this->privs[] = $priv_array;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->rebuildListTarget();\n\t}", "function setPrivileges($module_id, $read, $add, $update, $delete)\n\t\t{\n\t\t\t$new_privileges = array('read'=>$read, 'add'=>$add, 'update'=>$update,'delete'=>$delete);\n\t\t\t$this->mPrivileges[$module_id] = $new_privileges;\n\t\t}", "protected function updatePrivileges()\n { \n $user = User::find($this->request->input('id'));\n $user->privileges = $this->request->input('value');\n $user->save(); \n }", "public function add() {\n\t\t$role_capabilities = array();\n\t\tforeach ( $this->capabilities as $capability => $roles ) {\n\t\t\t$role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles );\n\t\t}\n\n\t\tforeach ( $role_capabilities as $role => $capabilities ) {\n\t\t\twpcom_vip_add_role_caps( $role, $capabilities );\n\t\t}\n\t}", "function acpperms_member_add()\n\t{\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'ACP Restrictions' );\n\t\t$this->ipsclass->admin->nav[] = array( '' , 'Add an administrator' );\n\t\t\n\t\t//-------------------------------\n\t\t// INIT\n\t\t//-------------------------------\n\t\t\n\t\t//-------------------------------\n\t\t// Show the form\n\t\t//-------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->html->acp_perms_add_admin_form();\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"Admin Restrictions\";\n\t\t$this->ipsclass->admin->page_detail = \"This section will allow you to manage your admin restriction permissions.\";\n\t\t$this->ipsclass->admin->output();\n\t}", "public function testCreatePrivilege5()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable a stringmatch type as supported.
protected function addStringMatchType (osid_type_Type $type) { $this->stringMatchTypes[] = $type; }
[ "public function supports(string $string): bool;", "public function setRegExMatch() {\r\n $this->db->sqliteCreateFunction('REGEX_MATCH',array($this,'RegExMatch'),2);\r\n }", "public function setStringToMatch($string) : void\n {\n $this->setString('stringToMatch', $string);\n \n }", "public function setMatch( $match );", "public function addMatchTypes( array $matchTypes ): void {\n $this->matchTypes = array_merge($this->matchTypes, $matchTypes);\n }", "public function addMatchTypes($matchTypes)\n {\n $this->matchTypes = array_merge($this->matchTypes, $matchTypes);\n }", "#[@test]\n public function stringIsAssignableFromStringType() {\n $this->assertTrue(Primitive::$STRING->isAssignableFrom(Primitive::$STRING));\n }", "public function matchDisplayName($displayName, osid_type_Type $stringMatchType, $match) {\n \t$this->matchNumber($displayName, $stringMatchType, $match);\n }", "public function stringFilter()\n {\n $filter = $this->defaultFilterFactory->createforType('string');\n $this->assertInstanceOf('stubFilterBuilder', $filter);\n $this->assertInstanceOf('stubStringFilter', $filter->getDecoratedFilter());\n }", "public function addMatchTypes($matchTypes)\n {\n // TODO: Implement addMatchTypes() method.\n }", "public static function setTypeRegex($type, $regex) {\n\t\tstatic::$typesRegex[$type] = $regex;\n\t}", "public function set_matching($matching);", "public function setRegexForPlateValidation($regex);", "function setSearchTextType($inSearchTextType) {\n\t\tif ( $inSearchTextType !== $this->_SearchTextType ) {\n\t\t\tif ( !in_array($inSearchTextType, array(self::SEARCH_TEXT_EXACT, self::SEARCH_TEXT_LIKE, self::SEARCH_TEXT_MATCH, self::SEARCH_TEXT_MATCH_BOOLEAN)) ) {\n\t\t\t\tthrow new systemException(\"The search text modifier must be one of: 1 - Like, 2 - Match, 3 - Exact or 4 - Match Boolean\");\n\t\t\t}\n\t\t\t$this->_SearchTextType = $inSearchTextType;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function matching(string|array $regex)\n {\n $regexes = self::toArrayOfStrings($regex);\n $this->matching = self::merge($this->matching, $regexes);\n }", "function mREGEX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REGEX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:276:3: ( 'regex' ) \n // Tokenizer11.g:277:3: 'regex' \n {\n $this->matchString(\"regex\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function setTypeString($type, $name){ }", "public function setMatchRequired(bool $matchRequired = true)\n {\n $this->matchRequired = $matchRequired;\n }", "public function requireMixedCase()\n {\n $this->mixedCase = true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modify Multimedia Objects status.
private function modifyMultimediaObjectsStatus($values) { $dm = $this->get('doctrine_mongodb.odm.document_manager'); $repo = $dm->getRepository('PumukitSchemaBundle:MultimediaObject'); $repoTags = $dm->getRepository('PumukitSchemaBundle:Tag'); $tagService = $this->get('pumukitschema.tag'); $executeFlush = false; foreach ($values as $id => $value) { $mm = $repo->find($id); if ($mm) { if ($this->isGranted(Permission::CHANGE_MMOBJECT_PUBCHANNEL)) { foreach ($value['channels'] as $channelId => $mustContainsTag) { $mustContainsTag = ('true' == $mustContainsTag); $tag = $repoTags->find($channelId); if (!$this->isGranted(Permission::getRoleTagDisableForPubChannel($tag->getCod()))) { if ($mustContainsTag && (!($mm->containsTag($tag)))) { $tagAdded = $tagService->addTag($mm, $tag, false); $executeFlush = true; } elseif ((!($mustContainsTag)) && $mm->containsTag($tag)) { $tagAdded = $tagService->removeTag($mm, $tag, false); $executeFlush = true; } } } } if ($this->isGranted(Permission::CHANGE_MMOBJECT_STATUS) && $value['status'] != $mm->getStatus()) { $mm->setStatus($value['status']); $executeFlush = true; } } } if ($executeFlush) { $dm->flush(); } }
[ "function ctools_export_set_object_status($object, $new_status = TRUE) {\r\n $table = $object->table;\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n $status = variable_get($export['status'], array());\r\n\r\n // Compare\r\n if (!$new_status && $object->export_type & EXPORT_IN_DATABASE) {\r\n unset($status[$object->{$export['key']}]);\r\n }\r\n else {\r\n $status[$object->{$export['key']}] = $new_status;\r\n }\r\n\r\n variable_set($export['status'], $status);\r\n}", "public function isMediaUpdateEnabled();", "public function getMediaStatus();", "public function setStatusPrivate();", "function photogallery_admin_changephotostatus() \n{\n $pid = (int)FormUtil::getPassedValue ('pid');\n \n if (!SecurityUtil::confirmAuthKey('PhotoGallery')) {\n $url = pnModURL('PhotoGallery', 'admin', 'main');\n return LogUtil::registerAuthidError ($url);\n }\n\n if (pnModAPIFunc('PhotoGallery', 'admin', 'changephotostatus', array('pid' => $pid,\n 'active' => $photo['active']))) {\n if ($photo['active']) {\n $message = _PHOTO_PHOTOACTIVATED;\n } else { \n $message = _PHOTO_PHOTODEACTIVATED;\n }\n\n LogUtil::registerStatus ($message);\n }\n\n $url = pnModURL('PhotoGallery', 'admin', 'editgallery', array('gid' => $photo['gid']));\n return pnRedirect($url);\n}", "function updateVideoStatus()\n{\n\t$qry = 'SELECT video.id as ID, IFNULL(upVideo.id, 0) as upID, IFNULL(prevVideo.id, 0) as prevID, \n\t\t\tvideo.video as item, video.video_preview as itemPreview, upVideo.type as type\n\t\t\tFROM video \n\t\t\tINNER JOIN ftp_queue upVideo ON upVideo.type_id=video.id AND upVideo.type_to_name = video.video AND upVideo.status = 3\n\t\t\tLEFT JOIN ftp_queue prevVideo ON prevVideo.type_id=video.id AND prevVideo.type_to_name = video.video_preview \n\t\t\t\tAND prevVideo.status = 3\n\t\t\tWHERE video.status=4';\n\t$result = getResultSet($qry);\n\tprocessStatus($result);\n\t\n}", "public function setStatusPublic();", "public function update()\r\n\t{\r\n\t\tif($this->input['status_id'] && $this->input['media_id'])\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$status_id = $this->input['status_id'];\r\n\t\t\t$media_id = urldecode($this->input['media_id']);\r\n\t\t\t\r\n\t\t\tstr_replace(\",\",\"\",$media_id, $count);\r\n\t\t\tif(!$count)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\t$sql = \"UPDATE \".DB_PREFIX.\"media SET status_id = \".$status_id.\" WHERE id = \".$media_id;\r\n\t\t\t\t$this->db->query($sql);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$media_ids = explode(\",\",$media_id);\r\n\t\t\t\t$sql = \"UPDATE \".DB_PREFIX.\"media SET status_id = \".$status_id.\" WHERE id = \";\r\n\t\t\t\tforeach ($media_ids as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sqls = $sql.$value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->db->query($sqls);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$sql = \"SELECT * FROM \".DB_PREFIX.\"media where id IN(\" . $media_id . \")\";\r\n\t\t\t$mids = $space = \"\";\r\n\t\t\t$q = $this->db->query($sql);\r\n\r\n\t\t\tinclude_once(ROOT_DIR . 'lib/class/albums.class.php');\r\n\t\t\t$this->albums = new albums();\r\n\t\t\twhile($row = $this->db->fetch_array($q))\r\n\t\t\t{\r\n\t\t\t\t$mids .= $space . $row['material_id'];\r\n\t\t\t\t$space = \",\";\r\n\t\t\t\t$albums_info = array(\r\n\t\t\t\t\t'id' => $row['material_id'],\r\n\t\t\t\t\t'host' => $row['host'] . $row['dir'],\r\n\t\t\t\t\t'filepath' => $row['filepath'] . $row['filename'],\r\n\t\t\t\t);\r\n\t\t\t\t$tt = $this->albums->add_sys_albums(1, serialize($albums_info));\r\n\t\t\t\t//file_put_contents('./cache/11.php',$tt,FILE_APPEND);\r\n\t\t\t}\r\n\t\t\t$this->material->updateMaterial($mids,$status_id);\r\n\t\t\t\r\n\t\t\t$info = array(\r\n\t\t\t\t'status_id' => $status_id,\r\n\t\t\t\t'media_id' => $media_id,\r\n\t\t\t);\r\n\t\t\t$this->setXmlNode('media','info');\r\n\t\t\t$this->addItem($info);\r\n\t\t\treturn $this->output();\t\r\n\t\t}\t\r\n\t}", "function file_set_status(&$file, $status) {\n if (db_query('UPDATE {files} SET status = %d WHERE fid = %d', $status, $file->fid)) {\n $file->status = $status;\n return TRUE;\n }\n return FALSE;\n}", "public function alterarStatus() {\r\n \r\n }", "public function setStreamingStatus(stdClass $status)\n {\n $this->serverStreamingStatus = $status;\n }", "public function executeChange()\n {\n $status = intval($this->getRequestParameter('status'));\n if(($status < -1)||($status > 3)) return $this->renderComponent('mms', 'list');\n if ($this->getUser()->getAttribute('user_type_id', 1) != 0) return $this->renderComponent('mms', 'list');\n\n\n if($this->hasRequestParameter('ids')){\n $mms = MmPeer::retrieveByPKs(json_decode($this->getRequestParameter('ids')));\n\n\n foreach($mms as $mm){\n\t$mm->setStatusId($status);\n\t$mm->save();\n }\n \n\n }elseif($this->hasRequestParameter('id')){\n $mm = MmPeer::retrieveByPk($this->getRequestParameter('id'));\n $mm->setStatusId($status);\n $mm->save();\n\n }elseif($this->getRequestParameter('all')){\n $mms = MmPeer::doSelect(new Criteria());\n\t \n foreach($mms as $mm){\n\t$mm->setStatusId($status);\n\t$mm->save();\n }\n }\n\n return $this->renderComponent('mms', 'list');\n }", "static public function updateStatus(Correlative $obj, $status){\n\t\tswitch($obj->getId()){\n\t\t\tcase 1:\n\t\t\t\tself::$_mStatus1 = $status;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\tself::$_mStatus2 = $status;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t}\n\t}", "function setTimeRecordsStatus($new_status) {\n $ids = $this->getTimeRecordIds();\n if(is_foreachable($ids)) {\n $update = db_execute('UPDATE ' . TABLE_PREFIX . 'project_objects SET integer_field_2 = ? WHERE id IN (?)', $new_status, $ids);\n if($update) {\n cache_remove_by_pattern(TABLE_PREFIX . 'project_objects_id_*');\n return true;\n } else {\n return $update;\n } // if\n } // if\n return true;\n }", "public function testUpdateVideo()\n {\n }", "public function testUpdateOrganizationCameraOnboardingStatuses()\n {\n }", "function updateStatus(){\n\t\t\n\t\tif($this->data)\n\t\t{\n\t\t\t$mmm_id = $this->Session->read('id');\n\t\t\t$band_id = $this->data['Dashboard']['bandid'];\n\t\t\n\t\t\t$result= $this->Fb->find(array('mmm_id'=>$mmm_id,'band_id'=>$band_id,'status'=>1));\n\t\t\tif($result)\n\t\t\t{\n\t\t\t\n\t\t\t\t\n\t\t\t\t$this->facebook->set_user($result['Fb']['user_id'], $result['Fb']['session_key']);\n\t\t\t\tif(!empty($this->data['Dashboard']['fbs_page']) or !empty($this->data['Dashboard']['fbs_profile']))\n\t\t\t\t{\n\t\t\t\t\tif($this->facebook->api_client->users_isAppUser($result['Fb']['user_id'])==0) // if not application user & revoke extended permission and delete application\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Your Facebook account is not yet linked to Motion Music Manager. Go to the settings page and add your Facebook profile.\";\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$this->facebook->set_user($result['Fb']['user_id'], $result['Fb']['session_key']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t$uid = $result['Fb']['user_id'];\n\t\t\t\t$login_id = $result['Fb']['login_id'];\n\t\t\t\t$text = $this->data['Dashboard']['status'];\n\t\t\t\t$message = NULL;\n\t\t\t\t\n\t\t\t\t// if user has active page.\n\t\t\t\tif(!empty($this->data['Dashboard']['fbs_page']))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$page = addslashes($result['Fb']['page']);\n\t\t\t\t\t$pResult = $this->Fbpage->find(array('name'=>$page,array('not'=>array('p_id'=>null))));\n\t\t\t\t\tif($pResult)\n\t\t\t\t\t{\n\t\t\t\t\t\t$pid = $pResult['Fbpage']['p_id'];\n\t\t\t\t\t\t// update facebook page status.\n\t\t\t\t\t\t$id= $this->facebook->api_client->users_setStatus($text,$pid);\n\t\t\t\t\t\t//$id = $this->facebook->api_client->stream_publish($text,null,null,$pid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($id==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$message = \"Facebook page status updated succesfully<br>\";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$message = \"We need your permission to publish a status update to your Facebook page. Go to the settings page and edit your Facebook publish permissions.<br>\";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // if(!empty($this->data['Dashboard']['fbs_page']))\n\t\t\t\t\n\t\t\t\t// Update Facebook user status.\n\t\t\t\tif(!empty($this->data['Dashboard']['fbs_profile']))\n\t\t\t\t{\n\t\t\t\t\t$id= $this->facebook->api_client->users_setStatus($text,$uid);\n\t\t\t\t\tif($id==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= \" Facebook status updated succesfully\";\t\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$message .= \"We need your permission to publish a status update to your Facebook personal profile. Go to the settings page and edit your Facebook publish permissions.\";\t\n\t\t\t\t\t}\n\t\t\t\t} // if(!empty($this->data['Dashboard']['fbs_profile']))\n\t\t\t\t\n\t\t\t\techo $message;\n\t\t\t\t\n\t\t\t} //if($result)\n\t\t\t\t\n\t\t} // if($this->data)\n\t\t\n\t\texit;\n\t}", "function media_theplatform_mpx_update_video($video) {\n $timestamp = REQUEST_TIME;\n\n // Fetch video_id and status from mpx_video table for given $video.\n $mpx_video = media_theplatform_mpx_get_mpx_video_by_field('guid', $video['guid']);\n\n // If we're performing an update, it means this video is active.\n // Check if the video was inactive and is being re-activated:\n if ($mpx_video['status'] == 0) {\n $details = 'video re-activated';\n }\n else {\n $details = NULL;\n }\n\n // Update mpx_video record.\n $update = db_update('mpx_video')\n ->fields(array(\n 'title' => $video['title'],\n 'guid' => $video['guid'],\n 'description' => $video['description'],\n 'thumbnail_url' => $video['thumbnail_url'],\n 'release_id' => $video['release_id'],\n 'status' => 1,\n 'updated' => $timestamp,\n 'id' => $video['id'],\n ))\n ->condition('guid', $video['guid'], '=')\n ->execute();\n\n // @todo: (maybe). Update all files with guid with new title if the title is different.\n $image_path = 'media-mpx/' . $video['guid'] . '.jpg';\n // Delete thumbnail from files/media-mpx directory.\n file_unmanaged_delete('public://' . $image_path);\n // Delete thumbnail from all the styles.\n // Now, the next time file is loaded, MediaThePlatformMpxStreamWrapper\n // will call getOriginalThumbnail to update image.\n image_path_flush($image_path);\n // Write mpx_log record.\n global $user;\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'video',\n 'type_id' => $mpx_video['video_id'],\n 'action' => 'update',\n 'details' => $details,\n );\n media_theplatform_mpx_insert_log($log);\n\n // If fields are mapped, save them to the file entity\n media_theplatform_mpx_update_file_fields($mpx_video['fid'], $video['fields']);\n\n // Return code to be used by media_theplatform_mpx_import_all_videos().\n return 'update';\n}", "public function set_status()\n\t{\n\t\treturn;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a Tecnico entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('OsBundle:Tecnico')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Tecnico entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('OsBundle:Tecnico:show.html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
[ "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ColegioAdminBundle:TipoColegio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TipoColegio entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ColegioAdminBundle:TipoColegio:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('OsBundle:Tecnico')->findAll();\n\n return $this->render('OsBundle:Tecnico:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('TechTBundle:Tbdettecnico')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Tbdettecnico entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('TechTBundle:Tbdettecnico:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ColegioAdminBundle:TipoColegio')->findAll();\n\n return $this->render('ColegioAdminBundle:TipoColegio:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function showAction($id) {\r\n $em = $this->getDoctrine()->getEntityManager();\r\n\r\n $entity = $em->getRepository('MedicinaKernelBundle:Oficina')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('No se ha encontrado la oficina solicitada');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('BackendBundle:Oficina:show.html.twig', array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Compania')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Compania entity.');\n }\n\n $deleteForm = $this->createForm(CompaniaType::class);\n\n return $this->render('AppBundle:Compania:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Contenedor')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Contenedor entity.');\n }\n\n return $this->render('BackendBundle:Contenedor:show.html.twig', array(\n 'entity' => $entity\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Tipocorresponsalia')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Tipocorresponsalia entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Tipocorresponsalia:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $em1=$this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('SiviuqMainBundle:Convocatoria')->find($id);\n \n $query=$em1->createQuery('SELECT p FROM SiviuqMainBundle:Proyectos p JOIN p.numeroConvocatoria c \n \t\tJOIN p.grupoInvestigacionId gi JOIN gi.programaId pr JOIN pr.facultadId fi JOIN p.lineaInvestigacion li\n \t\tJOIN p.investigadorPrincipal ip WHERE c.id=:id');\n $query->setParameter('id',$id);\n $proyectos=$query->getResult();\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Convocatoria entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiviuqMainBundle:Convocatoria:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n \t'proyectos' => $proyectos,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MTConnectBundle:Coleta')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Coleta entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MTConnectBundle:Coleta:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Activo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Activo entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $accion = 'Ver Expediente de Activo: ' . $entity->getNombre();\n $this->get(\"gema.utiles\")->traza($accion);\n\n return $this->render('gemaBundle:Activo:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Puerto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Puerto entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AppBundle:Puerto:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('QQiRecordappBundle:Ciclo')->findAll();\n\n return $this->render('QQiRecordappBundle:Ciclo:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FundeuisEducacionBundle:UsuarioCurso')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find UsuarioCurso entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FundeuisEducacionBundle:UsuarioCurso:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id)\n {\n $request = $this->getRequest();\n $locale = $request->getLocale(); \n\n $usuario = $this->get('security.context')->getToken()->getUser();\n $id_usuario = $usuario->getId();\n\n $em = $this->getDoctrine()->getManager();\n $entity_comerciohor = $em->getRepository('FrontendBundle:Comerciohor')->find($id);\n\n if (!$entity_comerciohor) {\n throw $this->createNotFoundException('Unable to find Comerciohor entity.');\n } \n\n $entity_comercio = $em->getRepository('FrontendBundle:Comercio')->find($id_usuario); \n \n if( $id_usuario == $entity_comerciohor->getComercio()->getId() )\n {\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FrontendBundle:Comerciohor:show.html.twig', array( \n 'entity_comerciohor' => $entity_comerciohor,\n 'entity_comercio' => $entity_comercio, \n 'delete_form' => $deleteForm->createView(), \n 'lenguaje' => $locale \n ));\n }\n else\n {\n return $this->redirect($this->generateUrl('comerciohor'));\n } \n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Centro')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Centro entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BackendBundle:Centro:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('CatMSAdminBundle:Seo')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Seo entity.');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render(\r\n 'CatMSAdminBundle:Seo:show.html.twig',\r\n array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(),\r\n )\r\n );\r\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Traza')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se encontro la Traza solicitada.');\n }\n\n return $this->render('gemaBundle:Traza:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction($id) {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('GestionEmploisBundle:Emploi')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Emploi entity.');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('GestionEmploisBundle:Emploi:show.html.twig', array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(),));\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates the spectrum based on the annotation array. The more annotations fit to the spectrum, the higher the score
public function getSpectrumScore($annotations, $massprop, $intensityprop, $annotationprop, $threshold, $thresholdtype) { $arrReturn = array(); $dblFactor = 0; $dblInt = 0; $dblMass = 0; $dblMassMax = 0; $dblMassMin = 0; $k = 0; $l = count($annotations); $varEntry = null; $aFound = 0; if ($thresholdtype === 'da') { $dblFactor = $threshold; } for ($i=0,$j= count($this->spectrum); $i<$j; $i++) { $dblMass = $this->spectrum[$i]['mass']; $dblInt = $this->spectrum[$i]['intensity']; if ($thresholdtype === 'ppm') { $dblFactor = 0.000001 * $threshold * $dblMass; } if ($thresholdtype === 'percent') { $dblFactor = 0.01 * $threshold * $dblMass; } $dblMassMin = $dblMass - $dblFactor; $dblMassMax = $dblMass + $dblFactor; $strAnnot = ''; for ($k=0; $k<$l; $k++) { $varEntry = $annotations[$k]; if ($varEntry[$massprop] >= $dblMassMin && $varEntry[$massprop] <= $dblMassMax) { $aFound++; } } } if ($aFound === 0) { return 0; } return $aFound / count($annotations); }
[ "public function get_array_scores();", "public function annotateSpectrum($annotations, $massprop, $intensityprop, $annotationprop, $threshold, $thresholdtype)\r\n\t{\r\n\t\t$arrReturn = array();\r\n\t\t$dblFactor = 0;\r\n\t\t$dblInt = 0;\r\n\t\t$dblMass = 0;\r\n\t\t$dblMassMax = 0;\r\n\t\t$dblMassMin = 0;\r\n\t\t$k = 0;\r\n\t\t$l = count($annotations);\r\n\t\t$varEntry = null;\r\n\t\t\r\n\t\tif ($thresholdtype === 'da') {\r\n\t\t\t$dblFactor = $threshold;\r\n\t\t}\r\n\t\t\r\n\t\tfor ($i=0,$j= count($this->spectrum); $i<$j; $i++) {\r\n\t\t\t$dblMass = $this->spectrum[$i]['mass'];\r\n\t\t\t$dblInt = $this->spectrum[$i]['intensity'];\r\n\t\t\t\r\n\t\t\tif ($thresholdtype === 'ppm') {\r\n\t\t\t\t$dblFactor = 0.000001 * $threshold * $dblMass;\r\n\t\t\t}\r\n\t\t\tif ($thresholdtype === 'percent') {\r\n\t\t\t\t$dblFactor = 0.01 * $threshold * $dblMass;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dblMassMin = $dblMass - $dblFactor;\r\n\t\t\t$dblMassMax = $dblMass + $dblFactor;\r\n\t\r\n\t\t\t$strAnnot = '';\r\n\t\t\tfor ($k=0; $k<$l; $k++) {\r\n\t\t\t\t$varEntry = $annotations[$k];\r\n\t\t\t\t\r\n\t\t\t\tif ($varEntry[$massprop] >= $dblMassMin && $varEntry[$massprop] <= $dblMassMax) {\r\n\t\t\t\t\t$strAnnot .= $varEntry[$annotationprop].' ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($strAnnot !== '') {\r\n\t\t\t\t$strAnnot = substr($strAnnot, 0, strlen($strAnnot)-1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tunset($varTemp);\r\n\t\t\t$varTemp[$massprop] = $dblMass;\r\n\t\t\t$varTemp[$intensityprop] = $dblInt;\r\n\t\t\t$varTemp[$annotationprop] = $strAnnot;\r\n\t\t\t$arrReturn[] = $varTemp;\r\n\t\t}\r\n\t\t\r\n\t\treturn $arrReturn;\r\n\t}", "public function calculate_starfield( $quality_labels, $team_data ){\n\t\t\t\n\t\t\t$starfield_array = array();\n\t\t\t$weights = $this -> weights;\n\t\t\t$domain_factor = array();\n\t\t\t$starfield_overall = 0;\n\t\t\t// print_r($weights);\n\t\n\t\t\t// Step through the domains\n\t\t\tforeach ( $quality_labels as $qual_name){\n\t\t\t\t\t// echo '<br>domain: ' . $qual_name . '<br>';\n\t\t\t\t\n\t\t\t\tif($qual_name != 'overall'){\n\n\t\t\t\t\t$composite_number = 0;\n\t\t\t\t\t// Step through the indicator weights for the domain and the team values for the indicator\n\t\t\t\t\t// $domain_factor[$qual_name] = 0;\n\t\t\t\t\tforeach ($weights as $w_row ){\n\t\t\t\t\t\t$domain_factor[$qual_name] += $w_row[$qual_name];\n\t\t\t\t\t}\n\t\t\t\t\t// echo '<br>domain factor:' . $domain_factor[$qual_name] . '<br>';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($weights as $w_row ){\n\t\t\t\t\t\t// Retrieve the indicator name\n\t\t\t\t\t\t$data_name = $w_row['short_label'];\n\t\t\t\t\t\t// echo '<br>indicator:' . $data_name . '<br>';\n\t\t\t\t\t\t// Retrieve the team value for that indicator\n\t\t\t\t\t\t$temp_value0 = $team_data[$data_name];\n\t\t\t\t\t\t// echo 'raw value:' . $temp_value0 . '<br>';\n\t\t\t\t\t\t// Apply the threshold for this indicator\n\t\t\t\t\t\t$data_value = $this -> d2d_apply_threshold( $temp_value0, $w_row['lower'], $w_row['upper'] );\n\t\t\t\t\t\t// echo 'normalized value:' . $data_value . '<br>';\n\t\t\t\t\t\t// Apply the weight to the modified indicator value\n\t\t\t\t\t\t$temp_number = $data_value * $w_row[$qual_name];\n\t\t\t\t\t\t// echo 'weighted value:' . $temp_number . '<br>';\n\t\t\t\t\t\t// Add the weighted contribution of this indicator value to this domain for this team\n\t\t\t\t\t\t$composite_number += $temp_number;\n\t\t\t\t\t}\n\t\t\t\t\t// Format the calculated value\n\t\t\t\t\t$temp_score = number_format( $composite_number ,2 );\n\t\t\t\t\t$starfield_array[$qual_name] = number_format( $composite_number/$domain_factor[$qual_name] ,2 );\n\t\t\t\t\t$starfield_overall += $temp_score;\n\t\t\t\t\t// echo 'accumulated contribution:' . $starfield_array[$qual_name] . '<br>';\n\t\t\t\t\t// echo 'starfield_overall:' . $starfield_overall. '<br>';\n\t\t\t\t} else {\n\t\t\t\t\t$starfield_array['overall'] = $starfield_overall;\n\t\t\t\t\t// echo 'overall contribution:' . $starfield_array['overall'] . '<br>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// echo '<br>Starfield<br>';\n\t\t\t// Return the complete list\n\t\t\t// print_r($starfield_array);\n\t\t\t// echo '<br>';\n\t\t\treturn $starfield_array;\n\t\t}", "public function noiseScore();", "public function score(array $predictions, array $labels) : float;", "public function analyse()\n {\n $result = [];\n $w = $this->w = $this->image->getWidth();\n $h = $this->h =$this->image->getHeight();\n\n $this->od = new \\SplFixedArray($h * $w * 3);\n $this->sample = new \\SplFixedArray($h * $w);\n for ($y = 0; $y < $h; $y++) {\n for ($x = 0; $x < $w; $x++) {\n $p = ($y) * $this->w * 3 + ($x) * 3;\n $rgb = $this->image->pickColor($x, $y);\n $this->od[$p + 1] = $this->edgeDetect($x, $y, $w, $h);\n $this->od[$p] = $this->skinDetect($rgb[0], $rgb[1], $rgb[2], $this->sample($x, $y));\n $this->od[$p + 2] = $this->saturationDetect($rgb[0], $rgb[1], $rgb[2], $this->sample($x, $y));\n }\n }\n\n $scoreOutput = $this->downSample($this->options['scoreDownSample']);\n $topScore = -INF;\n $topCrop = null;\n $crops = $this->generateCrops();\n\n foreach ($crops as &$crop) {\n $crop['score'] = $this->score($scoreOutput, $crop);\n if ($crop['score']['total'] > $topScore) {\n $topCrop = $crop;\n $topScore = $crop['score']['total'];\n }\n }\n\n $result['topCrop'] = $topCrop;\n\n if ($this->options['debug'] && $topCrop) {\n $result['crops'] = $crops;\n $result['debugOutput'] = $scoreOutput;\n $result['debugOptions'] = $this->options;\n $result['debugTopCrop'] = array_merge([], $result['topCrop']);\n }\n\n return $result;\n }", "public function visualScore();", "public function calculateScore();", "function OCR($img, $expected, $input, $lookup_array, $ann) {\n\tglobal $correct; // refer to the non local $correct variable\n\t$output = \"\"; \n\t\n\t/* Display image for reference */\n\t$output .= \"Image: <img src='images/$img'><br>\" . PHP_EOL;\n\n\t// Run the ANN\n\t$calc_out = fann_run($ann, $input);\n\t\n\t$output .= 'Raw: ' . $calc_out[0] . '<br>' . PHP_EOL;\n\t$output .= 'Trimmed: ' . floor($calc_out[0]*100)/100 . '<br>' . PHP_EOL;\n\t$output .= 'Decoded Symbol: ';\n\t\n\t/* What did the ANN think it saw? */\n\tfor($i = 0; $i < count($lookup_array); $i++) {\n if( floor($lookup_array[$i][0]*100)/100 == floor($calc_out[0]*100)/100) {\n\t $output .= $lookup_array[$i][1] . '<br>' . PHP_EOL;\n\t $output .= \"Expected: $expected <br>\" . PHP_EOL;\n\t $output .= 'Result: ';\n\t if($expected == $lookup_array[$i][1]){\n\t \t$output .= '<span class=\"green\">Correct!</span>';\n\t\t\t\t\n\t\t\t\t++$correct;\n\t\t\t\t\n\t }else{\n\t \t$output .= '<span class=\"red\">Incorrect!</span> <a href=\"train_ocr.php\">Retrain OCR</a>';\n\t }\n\t\t}\n\t}\n\t$output .= '<br><br>' . PHP_EOL;\n\t\n\treturn $output;\t\n}", "public static function calculate(array $hitSpectrum): float\n {\n $totalElements = count($hitSpectrum, COUNT_RECURSIVE) - count($hitSpectrum);\n $coveredElements = array_sum(array_map(function ($row) {\n return array_sum($row);\n }, $hitSpectrum));\n\n $density = $coveredElements / $totalElements;\n\n return floatval(1 - abs(1 - 2 * $density));\n }", "public function getSimilarityMeasures();", "function fann_get_sarprop_step_error_threshold_factor($ann){}", "private function setScore() {\n foreach ($this->aKnows as &$aKnow) {\n $score = 0;\n\n #Simples\n if ($aKnow['school'])\n $score += WEIGHT_SCHOOL;\n if ($aKnow['location'])\n $score += WEIGHT_LOCATION;\n if ($aKnow['work'])\n $score += WEIGHT_WORK;\n if ($aKnow['seen'])\n $score += ($aKnow['seen'] * WEIGHT_SEEN);\n if ($aKnow['tags'])\n $score += ($aKnow['tags'] * WEIGHT_TAG);\n\n #Combination School: \n if ($aKnow['school'] && $aKnow['work'])\n $score += WEIGHT_SCHOOL_WORK;\n if ($aKnow['school'] && $aKnow['location'])\n $score += WEIGHT_SCHOOL_WORK;\n if ($aKnow['school'] && $aKnow['location'] && $aKnow['work'])\n $score += WEIGHT_SCHOOL_LOCATION_WORK;\n if ($aKnow['school'] && $aKnow['birthdate'])\n $score += WEIGHT_SCHOOL_BIRTH;\n \n #Combination Location: \n if ($aKnow['location'] && $aKnow['birthdate'])\n $score += WEIGHT_LOCATION_BIRTH;\n if ($aKnow['location'] && $aKnow['work'])\n $score += WEIGHT_LOCATION_WORK;\n if ($aKnow['location'] && $aKnow['seen'])\n $score += WEIGHT_LOCATION_SEEN;\n \n #Combination Common Friends: \n if ($aKnow['commons'])\n $score += WEIGHT_COMMON * $aKnow['commons'];\n if ($aKnow['commons'] && $aKnow['school'])\n $score += WEIGHT_COMMON_SCHOOL;\n if ($aKnow['commons'] && $aKnow['work'])\n $score += WEIGHT_COMMON_WORK;\n if ($aKnow['commons'] && $aKnow['location'])\n $score += WEIGHT_COMMON_LOCATION;\n \n $aKnow['score'] = $score;\n }\n array_sort_by_column($this->aKnows, 'score'); \n }", "public function analyse()\n {\n $result = [];\n $w = $this->w = imagesx($this->oImg);\n $h = $this->h = imagesy($this->oImg);\n\n $this->od = new \\SplFixedArray ($h * $w * 3);\n $this->aSample = new \\SplFixedArray ($h * $w);\n for ($y = 0; $y < $h; $y++)\n {\n for ($x = 0; $x < $w; $x++)\n {\n $p = ($y) * $this->w * 3 + ($x) * 3;\n $aRgb = $this->getRgbColorAt($x, $y);\n $this->od [$p + 1] = $this->edgeDetect($x, $y, $w, $h);\n $this->od [$p] = $this->skinDetect($aRgb [0], $aRgb [1], $aRgb [2], $this->sample($x, $y));\n $this->od [$p + 2] = $this->saturationDetect($aRgb [0], $aRgb [1], $aRgb [2], $this->sample($x, $y));\n }\n }\n\n $scoreOutput = $this->downSample($this->options ['scoreDownSample']);\n $topScore = -INF;\n $topCrop = null;\n $crops = $this->generateCrops();\n\n foreach ($crops as &$crop)\n {\n $crop ['score'] = $this->score($scoreOutput, $crop);\n if ($crop ['score'] ['total'] > $topScore)\n {\n $topCrop = $crop;\n $topScore = $crop ['score'] ['total'];\n }\n }\n\n $result ['topCrop'] = $topCrop;\n\n if ($this->options ['debug'] && $topCrop)\n {\n $result ['crops'] = $crops;\n $result ['debugOutput'] = $scoreOutput;\n $result ['debugOptions'] = $this->options;\n $result ['debugTopCrop'] = array_merge([], $result ['topCrop']);\n }\n\n return $result;\n }", "function UpdateScores() {\n $this->scores = [];\n foreach ($this->termArray->getAllTerms() as $rowTerm) {\n foreach ($this->termArray->results[$rowTerm->phrase] as $rowResultIndex => $rowResult) {\n $this->scores[$rowTerm->phrase][$rowTerm->position][$rowResultIndex] = $this->CalculateScore($rowTerm, $rowResultIndex, $rowResult);\n }\n }\n }", "function input_annotation($sentence,$input,$segmentation) {\n global $biconcor;\n list($words,$coverage_vector) = split(\"\\t\",$input);\n\n # get information from line in input annotation file\n $coverage = array();\n foreach (split(\" \",$coverage_vector) as $item) {\n if (preg_match(\"/[\\-:]/\",$item)) {\n list($from,$to,$corpus_count,$ttable_count,$ttable_entropy) = preg_split(\"/[\\-:]/\",$item);\n $coverage[$from][$to][\"corpus_count\"] = $corpus_count;\n $coverage[$from][$to][\"ttable_count\"] = $ttable_count;\n $coverage[$from][$to][\"ttable_entropy\"] = $ttable_entropy;\n }\n }\n $word = split(\" \",$words);\n\n # compute the display level for each input phrase\n for($j=0;$j<count($word);$j++) {\n $box[] = array();\n $separable[] = 1;\n }\n $max_level = 0;\n for($length=1;$length<=7;$length++) {\n for($from=0;$from<count($word)-($length-1);$from++) {\n $to = $from + ($length-1);\n if (array_key_exists($from,$coverage) &&\n array_key_exists($to,$coverage[$from]) &&\n array_key_exists(\"corpus_count\",$coverage[$from][$to])) {\n $level=0;\n\t$available = 0;\n\twhile(!$available) {\n\t $available = 1;\n\t $level++;\n\t for($j=$from;$j<=$to;$j++) {\n if (array_key_exists($level,$box) &&\n array_key_exists($j,$box[$level])) {\n\t $available = 0;\n\t }\n }\n }\n\tfor($j=$from;$j<=$to;$j++) {\n\t $box[$level][$j] = $to;\n\t}\n\t$max_level = max($max_level,$level);\n\tfor($j=$from+1;$j<=$to;$j++) {\n\t $separable[$j] = 0;\n\t}\n }\n }\n }\n $separable[count($word)] = 1;\n\n # display input phrases\n $sep_start = 0;\n for($sep_end=1;$sep_end<=count($word);$sep_end++) {\n if ($separable[$sep_end] == 1) {\n # one table for each separable block\n print \"<table cellpadding=1 cellspacing=0 border=0 style=\\\"display: inline;\\\">\";\n for($level=$max_level;$level>=1;$level--) {\n # rows for phrase display\n\tprint \"<tr style=\\\"height:5px;\\\">\";\n\tfor($from=$sep_start;$from<$sep_end;$from++) {\n\t if (array_key_exists($from,$box[$level])) {\n\t $to = $box[$level][$from];\n $size = $to - $from + 1;\n\t if ($size == 1) {\n\t print \"<td><div style=\\\"height:0px; opacity:0; position:relative; z-index:-9;\\\">\".$word[$from];\n }\n\t else {\n\t\t$color = coverage_color($coverage[$from][$to]);\n\t\t$phrase = \"\";\n\t\t$highlightwords = \"\";\n $lowlightwords = \"\";\n\t\tfor($j=$from;$j<=$to;$j++) {\n\t\t if ($j>$from) { $phrase .= \" \"; }\n\t\t $phrase .= $word[$j];\n $highlightwords .= \" document.getElementById('inputword-$sentence-$j').style.backgroundColor='#ffff80';\";\n $lowlightwords .= \" document.getElementById('inputword-$sentence-$j').style.backgroundColor='\".coverage_color($coverage[$j][$j]).\"';\";\n\t\t}\n\t print \"<td colspan=$size><div style=\\\"background-color: $color; height:3px;\\\" onmouseover=\\\"show_word_info($sentence,\".$coverage[$from][$to][\"corpus_count\"].\",\".$coverage[$from][$to][\"ttable_count\"].\",\".$coverage[$from][$to][\"ttable_entropy\"].\"); this.style.backgroundColor='#ffff80';$highlightwords\\\" onmouseout=\\\"hide_word_info($sentence); this.style.backgroundColor='$color';$lowlightwords;\\\"\".($biconcor?\" onclick=\\\"show_biconcor($sentence,'\".htmlspecialchars($phrase).\"');\\\"\":\"\").\">\";\n }\n print \"</div></td>\";\n\t $from += $size-1;\n\t }\n\t else {\n\t print \"<td><div style=\\\"height:\".($from==$to ? 0 : 3).\"px;\\\"></div></td>\";\n\t }\n\t}\n\tprint \"</tr>\\n\";\n }\n # display input words\n print \"<tr><td colspan=\".($sep_end-$sep_start).\"><div style=\\\"position:relative; z-index:1;\\\">\";\n for($j=$sep_start;$j<$sep_end;$j++) {\n if ($segmentation && array_key_exists($j,$segmentation[\"input_start\"])) {\n $id = $segmentation[\"input_start\"][$j]; \n print \"<span id=\\\"input-$sentence-$id\\\" style=\\\"border-color:#000000; border-style:solid; border-width:1px;\\\" onmouseover=\\\"highlight_phrase($sentence,$id);\\\" onmouseout=\\\"lowlight_phrase($sentence,$id);\\\">\";\n }\n if (array_key_exists($j,$coverage)) {\n $color = coverage_color($coverage[$j][$j]);\n $cc = $coverage[$j][$j][\"corpus_count\"];\n $tc = $coverage[$j][$j][\"ttable_count\"];\n $te = $coverage[$j][$j][\"ttable_entropy\"];\n }\n else { # unknown words\n\t $color = '#ffffff';\n $cc = 0; $tc = 0; $te = 0;\n }\n print \"<span id=\\\"inputword-$sentence-$j\\\" style=\\\"background-color: $color;\\\" onmouseover=\\\"show_word_info($sentence,$cc,$tc,$te); this.style.backgroundColor='#ffff80';\\\" onmouseout=\\\"hide_word_info($sentence); this.style.backgroundColor='$color';\\\"\".($biconcor?\" onclick=\\\"show_biconcor($sentence,'\".htmlspecialchars($word[$j]).\"');\\\"\":\"\").\">$word[$j]</span>\";\n if ($segmentation && array_key_exists($j,$segmentation[\"input_end\"])) {\n print \"</span>\";\n }\n print \" \";\n }\n print \"</div></td></tr>\\n\";\n print \"</table>\\n\";\n $sep_start = $sep_end;\n }\n }\n print \"<br>\";\n}", "public function classify($text)\n {\n $totalDocCount = array_sum($this->docs);\n\n $tokens = $this->tokenizer->tokenize($text);\n\n $scores = array();\n\n foreach ($this->labels as $label => $labelCount) {\n $logSum = 0;\n\n $docCount = $this->docs[$label];\n $inversedDocCount = $totalDocCount - $docCount;\n\n if (0 === $inversedDocCount) {\n continue;\n }\n\n foreach ($tokens as $token) {\n $totalTokenCount = isset($this->tokens[$token]) ? $this->tokens[$token] : 0;\n\n if (0 === $totalTokenCount) {\n continue;\n }\n\n $tokenCount = isset($this->data[$label][$token]) ? $this->data[$label][$token] : 0;\n $inversedTokenCount = $this->inversedTokenCount($token, $label);\n\n $tokenProbabilityPositive = $tokenCount / $docCount;\n $tokenProbabilityNegative = $inversedTokenCount / $inversedDocCount;\n\n $probability = $tokenProbabilityPositive / ($tokenProbabilityPositive + $tokenProbabilityNegative);\n\n $probability = ((1 * 0.5) + ($totalTokenCount * $probability)) / (1 + $totalTokenCount);\n\n if (0 === $probability) {\n $probability = 0.01;\n } elseif (1 === $probability) {\n $probability = 0.99;\n }\n\n $logSum += log(1 - $probability) - log($probability);\n }\n\n $scores[$label] = 1 / (1 + exp($logSum));\n }\n\n arsort($scores, SORT_NUMERIC);\n\n return $scores;\n }", "function fann_get_sarprop_step_error_threshold_factor($ann)\n{\n}", "function SDArray($arrArray){\r\n\t//mean of the squares minus the square of the means\r\n\t$Variance = pow(avgArray($arrArray),2)-avgArray(sqrArray($arrArray));\r\n\t$SD = pow($Variance,0.5);\r\n\treturn $SD;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set number of pages.
private function setNumberOfPages(): void { $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page); }
[ "private function setPages()\n {\n $this->pages_count = (int) ceil( $this->records_count / $this->per_page );\n }", "protected function updateNumPages(): void\n {\n $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int)ceil($this->totalItems / $this->itemsPerPage));\n }", "public function setPagesCount(int $val) : void\n {\n $this->pages_count = $val;\n }", "protected function updateNumPages() {\n $this->num_pages = ( $this->items_per_page == 0 ? 0 : (int) ceil( $this->total_items / $this->items_per_page ) );\n }", "private function setPage() {\r\n if($this->page > $this->pager['last']) {\r\n $this->page = $this->pager['last'];\r\n }\r\n $this->page = $this->page < 1 ? 1 : $this->page;\r\n }", "public function setPageNumber(int $page): self;", "protected function setNextNumPage()\n\t{\n\t\t$this->next_num_page = 0;\n\t\tif ( $this->current_page_number < $this->num_pages )\n\t\t{\n\t\t\t$this->next_num_page = ( $this->current_page_number + 1 );\n\t\t}\n\t}", "public function setItemsPerPage($number);", "public function set_page_count($count)\n {\n $this->_page_count = $count;\n }", "protected function setTotalPages()\n {\n $pages = ceil($this->getItemCount() / $this->getPageSize());\n\n if ($pages > 0) {\n $this->totalPages = $pages;\n } else {\n $this->totalPages = 1;\n }\n }", "public function setCurrentPageNumber(): void\n {\n if (isset($_GET[$this->queryStringPageNumberParam])) {\n $this->currentPageLinkNumber = (int) htmlspecialchars($_GET[$this->queryStringPageNumberParam]);\n } else {\n $this->currentPageLinkNumber = 1;\n }\n }", "public function setPage(int $page): self;", "public function setCurrentPageNumber($currentPageNumber);", "function set_records_per_page($n){ $this->records_per_page = $n; }", "function SetMaxPage($page){}", "function setNumFiles() {\n\t\t$this->numFiles = $this->calcNumFiles($this->totalRows, $this->pagesPerFile);\n\t\t$this->debug(\"numFiles: $this->numFiles <br />\");\n\t}", "function set_page($page)\n {\n $this->list_page = (int)$page;\n }", "public function setElementsPerPage($count);", "private function updateCountPages()\n {\n $this->countPages++;\n if ($this->countPages % 10 == 0) {\n $this->snapshot->updateAttributes(['count_pages' => $this->countPages]);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read all logfiles (if existent)
public static function getLogfiles() { try { $texte = file_get_contents(Path::path_logs() . 'texte_errors.log'); } catch (\Exception $exception) { $texte = '[Not found]'; } try { $morph = file_get_contents(Path::path_logs() . 'morph_errors.log'); } catch (\Exception $exception) { $morph = '[Not found]'; } try { $general = file_get_contents(Path::path_logs() . 'general_errors.log'); } catch (\Exception $exception) { $general = '[Not found]'; } return [ 'texte' => $texte, 'morph' => $morph, 'general' => $general, 'laravel' => Helper::getLaravelLog(true) ]; }
[ "public static function get_log_files()\n {\n }", "private function checkLogFiles()\n {\n foreach ($this->filesystem->all() as $path) {\n $this->checkLogFile($path);\n }\n }", "protected function read_working_logs_dir() {\n $working_logs = [];\n $working_dir = $this->get_working_log_dir();\n //do the directory read and cache the results in the static\n if (!$handle = opendir($working_dir)) {\n throw new Exception(__FUNCTION__ . \": Can't open directory. We should have noticed earlier (in setup_required_directories) that this wasn't going to work. \\n\");\n }\n while (($file = readdir($handle)) !== FALSE) {\n $temp_date = FALSE;\n if (preg_match($this->regex_for_working_log(), $file)) {\n $full_path = $working_dir . '/' . $file;\n $temp_date = $this->get_working_log_file_date($file);\n }\n if (!$temp_date) {\n continue;\n }\n $working_logs[$temp_date][] = $full_path;\n }\n return $working_logs;\n }", "function get_log_files()\n {\n clearos_profile(__METHOD__, __LINE__);\n try {\n $list = array();\n $log_viewer = new Log_Viewer();\n $files = $log_viewer->get_log_files();\n foreach ($files as $file) {\n if (preg_match('/.*\\d$/', $file))\n continue;\n $list[Log_Viewer::FOLDER_LOG_FILES . '/' . $file] = $file;\n }\n return $list;\n } catch (Exception $e) {\n throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);\n }\n }", "protected function readLogFile() {}", "public function getLogFiles()\n {\n $path = $this->getLogHelper()->getLogDir();\n if (!file_exists($path)) {\n return array();\n }\n\n $io = new Varien_Io_File();\n $io->open(array('path' => $path));\n $files = $io->ls(Varien_Io_File::GREP_FILES);\n\n return $files;\n }", "private static function getLogFileList()\n {\n return array_map('basename', glob(storage_path('logs/*.log')));\n }", "private function getLogFiles()\n {\n return $this->_logManagerHelper->getLogFiles();\n }", "public function getLogFilesData()\n {\n if ($this->data) {\n return $this->data;\n }\n\n $filesCount = 0;\n $this->currentDate = $this->dateTime->date('Y-m-d');\n clearstatcache();\n $entry = $this->directory->read();\n foreach ($entry as $file) {\n // Take into account only files with \"log\" extension\n if (!$this->directory->isFile($file) || pathinfo($file, PATHINFO_EXTENSION) != 'log') {\n continue;\n }\n $logEntriesNumber = 0;\n $fileHandler = $this->directory->openFile($file);\n $fileSize = $fileHandler->stat()['size'];\n // If file is readable then calculate log entries number\n if ($this->directory->isReadable($file)) {\n // Sometimes file can be very huge, so defend against such case by reading just 350MB of data per file\n $readSize = min($fileSize, self::MAX_FILE_SIZE_TO_OPEN_FOR_LOG_ENTRIES_CALC);\n $fileContent = $fileHandler->read($readSize);\n if ($fileContent === '') {\n continue;\n }\n // This is regular expression for log file entries like [2015-09-16 15:44:19] main.CRITICAL: ...\n $matched = (int)preg_match_all('~\\[([\\d-]+)\\s([\\d:]+)\\].*?:\\s(.*)~', $fileContent);\n $logEntriesNumber += $matched;\n // Collect system log messages\n if ($file == self::SYSTEM_LOG_FILE\n && preg_match_all('~\\[[\\d-]+\\s[\\d:]+\\].*?:\\s.*~', $fileContent, $matches)\n ) {\n $this->getSystemLogMessages($matches);\n $this->getCurrentSystemLogMessages($matches);\n }\n // Collect debug log messages\n if ($file == self::DEBUG_LOG_FILE\n && preg_match_all('~\\[[\\d-]+\\s[\\d:]+\\].*?:\\s.*~', $fileContent, $matches)\n ) {\n $this->getDebugLogMessages($matches);\n $this->getCurrentDebugLogMessages($matches);\n }\n $fileLines = explode(PHP_EOL, $fileContent);\n // Collect exception log messages\n if ($file == self::EXCEPTION_LOG_FILE) {\n $this->getExceptionLogs($fileLines);\n }\n // For long files output progress\n $countLines = count($fileLines);\n if ($countLines % 50000 == 0) {\n $this->logger->info('File \"' . $file . '\": ' . $countLines . ' lines processed...');\n }\n } else {\n $logEntriesNumber = 'File is not readable';\n }\n if ($fileSize > self::MAX_FILE_SIZE_TO_OPEN_FOR_LOG_ENTRIES_CALC) {\n $logEntriesNumber = 'File is too big. Only '\n . $this->dataFormatter->formatBytes(self::MAX_FILE_SIZE_TO_OPEN_FOR_LOG_ENTRIES_CALC, 3, 'IEC')\n . ' of data was read.';\n }\n $modifiedTime = $fileHandler->stat()['mtime'];\n $data = [\n self::LOG_FILES => [\n $filesCount => [\n $file,\n $this->dataFormatter->formatBytes($fileSize, 3, 'IEC'),\n $logEntriesNumber,\n $this->dateTime->date('r', $modifiedTime)\n ]\n ]\n ];\n $fileHandler->close();\n $this->data = array_merge_recursive($this->data, $data);\n $filesCount++;\n }\n $data = [\n self::SYSTEM_MESSAGES => $this->prepareLogMessagesReportData($this->systemLogMessages),\n self::CURRENT_SYSTEM_MESSAGES => $this->prepareLogMessagesReportData($this->currentSystemLogMessages),\n self::DEBUG_MESSAGES => $this->prepareLogMessagesReportData($this->debugLogMessages),\n self::CURRENT_DEBUG_MESSAGES => $this->prepareLogMessagesReportData($this->currentDebugLogMessages),\n self::EXCEPTION_MESSAGES => $this->prepareLogMessagesReportData($this->exceptionLogMessages, true),\n self::CURRENT_EXCEPTION_MESSAGES => $this->prepareLogMessagesReportData(\n $this->currentExceptionLogMessages,\n true\n )\n ];\n $this->data = array_merge($this->data, $data);\n\n return $this->data;\n }", "function logfiles_list() {\n\tglobal $amp_conf;\n\n\t$dir = scandirr($amp_conf['ASTLOGDIR'], true);\n\n\t//only show files, relative to $amp_conf['ASTLOGDIR']\n\tforeach ($dir as $k => $v) {\n\t\tif (!is_file($v)) {\n\t\t\tunset($dir[$k]);\n\t\t} else {\n\t\t\t$dir[$k] = str_replace($amp_conf['ASTLOGDIR'] . '/', '', $v); //relative paths only\n\t\t}\n\t}\n\n\treturn array_values($dir);\n}", "public static function get_files()\r\n {\r\n $dir = sfConfig::get('sf_root_dir') . '/log/';\r\n \r\n if (is_dir($dir)) {\r\n $aFiles = array();\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if ($file != '.' && $file != '..' && $file != '.svn' && is_file($dir . $file)) {\r\n $modification = filemtime($dir . $file);\r\n $aFiles[$modification] = $file;\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n \r\n krsort($aFiles);\r\n $aFiles = array_values($aFiles);\r\n \r\n return $aFiles;\r\n } else {\r\n return false;\r\n }\r\n }", "public function readlog()\n {\n }", "static function scanDebugLogs()\r\n\t{\r\n\t\t$path = Settings::getValue(\"email\", \"debugging_mode_output_path\");\r\n\r\n\t\t$logs = array();\r\n\r\n\t\ttrace(\"EmailManager::Scanning $path\", 3);\r\n\r\n\t\t$handle = opendir($path);\r\n\r\n\t\tif(!$handle)\r\n\t\t\treturn;\r\n\r\n\t\t$idx = 0;\r\n\t\twhile(false !== ($file = readdir($handle)))\r\n\t\t{\r\n\t\t\t// omit \".\" and \"..\" in the directory\r\n\t\t\tif (!preg_match(\"/(^\\.{1,2}$)/i\", $file))\r\n\t\t\t{\r\n\t\t\t\t$log = new EmailDebugLog();\r\n\t\t\t\t$log->log_id = $idx;\r\n\t\t\t\t$log->filename = $file;\r\n\t\t\t\t$log->date = date(\"F d, Y g:ia\", (filemtime($path . DIRECTORY_SEPARATOR . $file)));\r\n\t\t\t \t$logs[$log->log_id] = $log;\r\n\t\t\t \t$idx++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t closedir($handle);\r\n\r\n\t return $logs;\r\n\t}", "public static function get_log_files() {\n\t\t$files = scandir( CARTFLOWS_LOG_DIR );\n\t\t$result = array();\n\n\t\tif ( ! empty( $files ) ) {\n\t\t\tforeach ( $files as $key => $value ) {\n\t\t\t\tif ( ! in_array( $value, array( '.', '..' ), true ) ) {\n\t\t\t\t\tif ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {\n\t\t\t\t\t\t$result[ sanitize_title( $value ) ] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function logFiles()\n {\n if (!$this->debug->getCfg('logEnvInfo.files', Debug::CONFIG_DEBUG)) {\n return;\n }\n $this->debug->logFiles->output();\n }", "protected function get_old_logs($dir_handle) {\n \t\n \t$sec_thirtydays = (time() - (30 * 86400));\n \t\n \tif(is_resource($dir_handle)) {\n \t\t\n \t\tif($files = scandir($this->_log_dir_path)) {\n \t\t\t\n \t\t\tforeach($files as $file) {\n \t\t\t\t\n \t\t\t\t$curr_file = $this->_log_dir_path . $file;\n \t\t\t\t\n \t\t\t\tif(is_file($curr_file)) {\n \t\t\t\t\t\n \t\t\t\t\tif(($ftime = filectime($curr_file)) && ($ftime <= $sec_thirtydays)) {\n \t\t\t\t\t\t\n \t\t\t\t\t\t$this->_old_logs[] = $curr_file;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n }", "public function readLog () {\n }", "public function readLog($cond = Array())\r\n {\r\n\r\n $f_date = date(\"Y-m-d\");\r\n if (isset($cond[\"f_date\"]))\r\n $f_date = $cond[\"f_date\"];\r\n\r\n //read all log file\r\n $dir = dir($this->dir_path);\r\n $list_log = Array();\r\n\r\n while (false !== ($entry = $dir->read())) {\r\n if (strlen($entry) > 5) {\r\n preg_match(\"/^log-(.*)\\.log$/\", $entry, $match);\r\n $to_date = (isset($cond['to_date'])) ? (strtotime($match[1]) <= strtotime($cond['to_date'])) : true;\r\n if (strtotime($match[1]) >= strtotime($f_date) && $to_date) {\r\n //$list_log[] = $entry;\r\n //Search log file line\r\n $list_log[] = $this->searchLogInFile($entry, $cond);\r\n }\r\n }\r\n }\r\n echo \"<pre>\";\r\n var_dump($list_log);\r\n\r\n //Ok, now we will read file to compare with condition\r\n }", "private function readRawLog() {\n\t\tif(!file_exists($this->getLogPath())) {\n\t\t\treturn array();\t\t\n\t\t}\n\t\telse {\n\t\t\tinclude($this->getLogPath());\n\t\t\treturn $theLog;\t\t\t\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/================= / Admin Campaigns /================= / List Campaigns. Displays the first 15 entries by default.
function admin_campaigns_list( $page = 1, $perpage = 15 ) { $request['page'] = $page; $request['perpage'] = $perpage; return $this->hook( "/campaigns.json", "campaign", $request, 'GET', 'admin' ); }
[ "public function listCampaign(){\n\n $token = generateAccessToken();\n $campaigns = listCampaign($token);\n return $campaigns['data'];\n\n }", "public function getCampaigns()\n {\n }", "public function listCampaigns()\n\t{\n\t\t$url = $this->getBetaAPIURL() . 'campaigns';\n\t\t$header = $this->getHeaderAuthBearer();\n\t\t$request = json_decode($this->cURLGet($url, $header));\n\t\treturn $request;\n\t}", "public function campaign_get_list()\n\t{\n\t\t$this->api_url = $this->base_url.'/campaign';\n\t\t$object = $this->curl_get();\n\n\t\treturn $this->output($object);\n\t}", "function getCampaignList() {\r\n return $this->execCommad('getCampaignList',\"\");\r\n }", "public function campaigns()\n {\n $campaigns = App::get('database')->getAll('campaigns');\n\n echo json_encode($campaigns);\n }", "static function campaigns_at_footer(){\n\t\t$campaign = self::get_campaigns(3);\n\t\techo $campaign;\n\t\t\n\t}", "static function campaigns_top_of_header(){\n\t\t$campaign = self::get_campaigns(1);\n\t\techo $campaign;\n\t}", "public function campaignAccounts()\n {\n // Get campaign lists.\n $this->view->campaigns = $this->model->getAccounts();\n\n // Generate the drop down HTML template.\n $this->view->render('campaign/dropdown', true);\n\n }", "public function campaigns()\n {\n return Campaigns::load();\n }", "public function fetchActiveCampaigns() {}", "function txtads_list( $campaign_id, $page = 1, $perpage = 6 )\n {\n $request['page'] = $page;\n $request['perpage'] = $perpage;\n\n return $this->hook( \"/campaigns/{$campaign_id}/txtads.json\", \"txtad\", $request, 'GET' );\n }", "public function getCampaigns() {\n\t\t// Make the call and return the data\n\t\treturn $this->makeCall(\"/a/{$this->setAccountId()}/c/{$this->setClientFolderId()}/campaigns\", 'GET');\n\t}", "public function actionIndex() {\n $searchModel = new ClientCampaignSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function get_all_campaigns()\r\n {\r\n $query = $this->db->query(\"SELECT * FROM campaigns\");\r\n \treturn $query->result_array();\r\n }", "function get_campaigns()\n\t{\n\t\treturn $this->mailchimp->campaigns();\n\t}", "public function listCampaigns() {\n try {\n $manualCampaigns = Campaigns::select('id as value','name as label')->where('targeting_type', 'manual')->whereNotIn('id', function ($query) {\n $query->select(DB::raw('manual_id'))\n ->from('campaign_connection');\n })->get();\n $autoCampaigns = Campaigns::select('id as value','name as label')->where('targeting_type', 'auto')->whereNotIn('id', function ($query) {\n $query->select(DB::raw('auto_id'))\n ->from('campaign_connection');\n })->get();\n $result = [\n 'autoCampaigns' => $autoCampaigns,\n 'manualCampaigns' => $manualCampaigns\n ];\n } catch (\\Exception $e) {\n return response()->json(['errors' => [$e->getMessage()]], 422);\n }\n return response()->json(['data' => $result], 200);\n }", "public function index()\n {\n $campaigns = Campaign::orderBy('created_at', 'desc')->get()->toArray();\n\n return view('pages.campaign_id_overview')->with('state', $campaigns);\n }", "public function testListCampaigns()\n {\n $response = $this->get('/api/campaigns');\n\n $response->assertStatus(200);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
4.5.12 deleteDriverGroup This action deletes a driver group and the assignments of all drivers to that group. The drivers detached through this action are not being deleted.
public function deleteDriverGroup($params);
[ "function deleteGroup($group) {}", "public function delete_group() {\n\n // Deletes Groups\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Groups)->delete_group();\n\n }", "public function deleteGroup()\n {\n $this->showDeleteConfirm = false;\n DB::transaction(function () {\n foreach ($this->group->collections as $collection) {\n $collection->products()->detach();\n $collection->customerGroups()->detach();\n $collection->channels()->detach();\n $collection->forceDelete();\n }\n $this->group->forceDelete();\n });\n\n $this->notify(__('adminhub::notifications.collection-groups.deleted'), 'hub.collection-groups.index');\n }", "public function deleting(Adgroup $adgroup);", "public function delete_group()\n {\n $sql = \"DELETE FROM pefs_database.pef_group WHERE grp_id=?\";\n $this->db->query(\n $sql,\n array($this->grp_id)\n );\n }", "public function deleteGroup(int $groupId);", "public function delete() {\n\t\t// Delete passwords and all ssl data of this group\n\t\t$passwordList = $this->getPasswordList();\n\t\t$passwordList->deleteListItems();\n\n\t\t// Delete members from group\n\t\t$memberList = $this->getMemberList();\n\t\t$memberList->deleteListItems();\n\n\t\t// Delete group\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'], 'tx_passwordmgr_group')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroup', 'Removed group '.$this['uid']);\n\t}", "function delete_group()\n\t{\n\t\t$this->Phonebook_model->delete_group();\n\t}", "public function deleteGroup($groupId)\n {\n $this->db->query('DELETE FROM charactergroups WHERE id = ?', 'i', $groupId);\n }", "public function delete( User_Group $user_group );", "public function delete($group)\n\t{\n\t\t$group->ranks->each(function ($rank) {\n\t\t\tdeletor(Rank::class)->delete($rank);\n\t\t});\n\n\t\t// Delete the rank group\n\t\t$group->delete();\n\n\t\treturn $group;\n\t}", "public function delete()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // TODO -- it would be nice to check to see if group is still in use\n Validation_Exception::is_valid($this->validate_group_name($this->group_name, FALSE, FALSE));\n\n if (! $this->exists())\n throw new Group_Not_Found_Exception($this->group_name);\n\n $shell = new Shell();\n $shell->execute(self::COMMAND_SAMBA_TOOL, \"group delete '\" . $this->group_name . \"'\", TRUE);\n\n $this->_signal_transaction(lang('accounts_deleted_group'));\n }", "function deleteGroup($group){\n \n Log::info(\"Entering GroupBusinessService.deleteGroup() \");\n \n //create connection to database\n $database = new Database();\n $db = $database->getConnection();\n \n // Create a Group Data Service with this connection and calls deleteGroup method/\n $dbService = new GroupDataService($db);\n $flag = $dbService->deleteGroup($group);\n \n // close the connection\n $db = null;\n \n // return the finder result\n Log::info(\"Exit GroupBusinessService.deleteGroup() \");\n return $flag;\n }", "public function actionDeleteGroup()\n\t{\n\t\t$this->requirePostRequest();\n\t\t$this->requireAjaxRequest();\n\n\t\t$groupId = craft()->request->getRequiredPost('id');\n\n\t\tcraft()->userGroups->deleteGroupById($groupId);\n\n\t\t$this->returnJson(array('success' => true));\n\t}", "public function delete_group($group_name, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['GroupName'] = $group_name;\n\n\t\treturn $this->authenticate('DeleteGroup', $opt, $this->hostname);\n\t}", "function delete_group($id){\n deleteRecord(TAB_GR_SERV, \"groupId = $id\");\n deleteRecord(TAB_GROUPS, \"id = $id\");\n}", "public function delete_group($group_para)\n {\n }", "public function deleteAction()\n {\n $customerGroup = Mage::getModel('customer/group');\n if ($id = (int)$this->getRequest()->getParam('id')) {\n try {\n $customerGroup->load($id);\n $customerGroup->delete();\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customer')->__('The customer group has been deleted.'));\n $this->getResponse()->setRedirect($this->getUrl('*/customer_group'));\n return;\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->getResponse()->setRedirect($this->getUrl('*/customer_group/edit', array('id' => $id)));\n return;\n }\n }\n\n $this->_redirect('*/customer_group');\n }", "public function deleteByGroup($group_id)\n {\n $where = array('group_id = ?' => array((int) $group_id));\n $this->delete($where);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register settings on admin page, called if is_admin() && pageId = YoPressBase::instance()>getAdminPageId match
public function registerAdminSettings();
[ "public function admin_init() {\n\t\t\tdo_action( 'learndash_settings_page_init', $this->settings_page_id );\n\t\t}", "public function on_hook_admin_menu_setup(){\n\t\t$menu_slug = BTM_Plugin_Options::get_instance()->get_admin_menu_slug();\n\n\t\t// Admin Settings submenu page init\n\t\tadd_submenu_page(\n\t\t\t$menu_slug,\n\t\t\t__( 'Settings', 'background_task_manager' ),\n\t\t\t__( 'Settings', 'background_task_manager' ),\n\t\t\t'manage_options',\n\t\t\t'btm-settings',\n\t\t\tarray(\n\t\t\t\t$this,\n\t\t\t\t'btm_admin_settings_sub_page'\n\t\t\t)\n\t\t);\n\t}", "public function add_settings_page() {\n\t\tadd_menu_page('Legion Settings', 'Legion', 'edit_pages', 'legion-settings', array($this, 'create_admin_page'));\n\t}", "protected function _registerSettingsPage()\n {\n // Add action to register field sections to tab\n $this->on('!wprss_add_settings_fields_sections',\n array($this, '_renderSettingsPage'), 10, 1);\n }", "public function admin_page_init() {\n\t\tforeach ( $this->fields as $key => $field ) {\n\t\t\tregister_setting(\n\t\t\t\tstatic::METHOD_PREFIX . '_options', // Option group\n\t\t\t\tstatic::MENU_SLUG . '-' . $field, // Option name\n\t\t\t\t'this is a test....'\n\t\t\t);\n\n\t\t\tadd_settings_section(\n\t\t\t\tstatic::METHOD_PREFIX . '_main', // ID\n\t\t\t\tstatic::PAGE_TITLE . ' Settings', // Title\n\t\t\t\tarray($this, 'print_section_info'), // Callback\n\t\t\t\tstatic::METHOD_PREFIX . '_settings' // Page\n\t\t\t);\n\n\t\t\tadd_settings_field(\n\t\t\t\tstatic::MENU_SLUG . '-' . $field, // ID\n\t\t\t\t$key, // Title\n\t\t\t\tarray( $this, 'option_validator' ), // Callback\n\t\t\t\tstatic::METHOD_PREFIX . '_settings', // Page\n\t\t\t\tstatic::METHOD_PREFIX . '_main', // Section\n\t\t\t\t$field\n\t\t\t);\n\t\t}\n\t}", "private function maybeSetupAdminSettings(): void\n {\n if (\\is_admin()) {\n require_once 'AdminSettings.php';\n $adminSettings = new AdminSettings();\n $adminSettings->init();\n }\n }", "public function admin_settings_page() {\n\t\tCortex::render_template('cortex-admin-settings-page.php');\n\t}", "function tux_su_settings_admin_page() {\n\n\tif ( ! current_user_can( 'administrator' ) ) {\n\n\t\treturn;\n\n\t}\n\n\t?>\n\t<div class=\"wrap\">\n\t\t<h1 class=\"wp-heading-inline\"><?php esc_html_e( 'Tuxedo Software Updater Settings', 'tuxedo-software-updater' ); ?></h1>\n\t\t<hr class=\"wp-header-end\">\n\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t<?php\n\t\t\tsettings_fields( 'tux_su_settings' );\n\t\t\tdo_settings_sections( 'tuxedo-su-settings' );\n\t\t\tsubmit_button();\n\t\t\t?>\n\t\t</form>\n\t</div>\n\t<?php\n\n}", "function register_admin_page() {\n\t\t\t\n\t\t\tadd_submenu_page( 'options-general.php', self::$admin_page_title, self::$admin_menu_title, 'update_core', self::$admin_page_slug, array( __CLASS__, 'render_admin_page' ) );\n\t\t\t\n\t\t}", "function SetAdminConfiguration() {\n\t\t\tadd_options_page(\"3B Meteo\", \"3B Meteo\", 8, basename(__FILE__), array(\"TreBiMeteo\",'DesignAdminPage'));\n\t\t}", "public function register_page_settings(){\r $this->plugin_settings_tabs[$this->page_settings_key] = 'Page';\r register_setting( \r $this->page_settings_key, \r $this->page_settings_key,\r array( $this, 'sanitize' )\r );\r add_settings_section( \r 'section_page', \r 'Page Settings', \r array( $this, 'print_section_info' ), \r $this->page_settings_key \r );\r add_settings_field( \r 'title_background', \r 'Title Background', \r array( $this, 'page_image_callback' ), \r $this->page_settings_key, \r 'section_page',\r 'title_background' \r );\r add_settings_field( \r 'contact_ribbon', \r 'Contact Us Ribbon', \r array( $this, 'page_image_callback' ), \r $this->page_settings_key, \r 'section_page',\r 'contact_ribbon' \r );\r add_settings_field( \r 'contact_text', \r 'Contact Us Text. (Works for home page as well)', \r array( $this, 'page_textarea_callback' ), \r $this->page_settings_key, \r 'section_page',\r 'contact_text' \r );\r add_settings_field( \r 'sidebar_position', \r 'Choose Sidebar Position', \r array( $this, 'sidebar_position_callback' ), \r $this->page_settings_key, \r 'section_page',\r 'sidebar_position' \r );\r \r }", "public function register_settings_page() {\n\t\tif ( ! $this->check_manage_capability() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_menu_page(\n\t\t\t__( 'Network Settings', 'wordpress-seo' ) . ' - Yoast SEO',\n\t\t\t__( 'SEO', 'wordpress-seo' ),\n\t\t\t$this->get_manage_capability(),\n\t\t\t$this->get_page_identifier(),\n\t\t\t[ $this, 'network_config_page' ],\n\t\t\t$this->get_icon_svg()\n\t\t);\n\n\t\t$submenu_pages = $this->get_submenu_pages();\n\t\t$this->register_submenu_pages( $submenu_pages );\n\t}", "public static function add_admin_page() {\n\n // Allow to themes to disable database option\n if ( apply_filters( 'ejo_cookie_consent_custom_content', true ) ) {\n\n // Add admin page to options\n add_options_page(\n 'Cookie Consent',\n 'Cookie Consent',\n 'manage_privacy_options',\n 'ejo-cookie-consent',\n [ static::class, 'admin_page' ]\n );\n\n }\n }", "function proximity_radius_register_admin_page() {\n\t\tadd_menu_page(\n\t\t\tesc_html__( 'Proximity Radius', 'proximity-radius' ),\n\t\t\tesc_html__( 'Proximity Radius', 'proximity-radius' ),\n\t\t\t'edit_posts',\n\t\t\t'proximity-radius',\n\t\t\tfunction () {\n\t\t\t\trequire __DIR__ . '/pages/admin.php';\n\t\t\t},\n\t\t\t'dashicons-media-default'\n\t\t);\n\t}", "private function define_admin_hooks() {\n\t\t// Register admin settings page\n\t\t$settings = new Url_shortener_settings_page();\n\t\tadd_action( 'admin_menu', array( $settings, 'url_shortener_create_settings' ) );\n\t\tadd_action( 'admin_init', array( $settings, 'url_shortener_setup_sections' ) );\n\t\tadd_action( 'admin_init', array( $settings, 'url_shortener_setup_fields' ) );\n\n\t\t// Register widget\n\t\tadd_action( 'widgets_init', function () {\n\t\t\tregister_widget( 'Url_shortener_widget' );\n\t\t} );\n\t}", "public function register_settings_screen () {\n\t\tglobal $wooslider;\n\t\t$this->settings_version = $wooslider->version; // Use the global plugin version on this settings screen.\n\n\t\t$hook = add_submenu_page( 'edit.php?post_type=slide', $this->name, $this->menu_label, 'manage_options', $this->page_slug, array( &$this, 'settings_screen' ) );\n\t\t\n\t\t$this->hook = $hook;\n\n\t\tif ( isset( $_GET['page'] ) && ( $_GET['page'] == $this->page_slug ) ) {\n\t\t\tadd_action( 'admin_notices', array( &$this, 'settings_errors' ) );\n\t\t\tadd_action( 'admin_print_scripts', array( &$this, 'enqueue_scripts' ) );\n\t\t\tadd_action( 'admin_print_styles', array( &$this, 'enqueue_styles' ) );\n\t\t}\n\t}", "function nv_add_settings_page(){\n add_users_page('Nuvoh2o Settings', 'Nuvoh2o Settings', 'manage_options', 'nuvoh2o_settings', array( $this, 'nv_settings_page_content'));\n }", "public function duplicate_page_settings()\n {\n if (current_user_can('manage_options')) {\n include 'inc/admin-settings.php';\n }\n }", "public function admin_menu() {\n register_setting($this->cc->values[ 'option_page' ], $this->cc->values[ 'settings_name' ], array($this->cc, 'save_settings_callback'));\n if ( method_exists( 'BeRocket_updater', 'get_plugin_count' ) ) {\n add_submenu_page(\n 'berocket_account',\n $this->cc->info[ 'norm_name' ] . ' ' . __( 'Settings', 'BeRocket_domain' ),\n $this->cc->info[ 'norm_name' ],\n $this->option_page_capability(),\n $this->cc->values[ 'option_page' ],\n array(\n $this->cc,\n 'option_form'\n )\n );\n\n return false;\n }\n\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether to show the Category field on form
function snax_link_show_category_field() { return 'disabled' !== snax_link_category_field(); }
[ "function snax_text_show_category_field() {\n\treturn 'disabled' !== snax_text_category_field();\n}", "public function category_filter() {\n\n\t\t$categories = get_terms( 'form_category' );\n\t\tif ( $categories && ! is_wp_error( $categories ) ) {\n\t\t\techo Give()->html->category_dropdown( 'category', $this->get_category() );\n\t\t}\n\t}", "public function category_add_form_fields() {\n\t\t?>\n\t\t<div class=\"form-field term-sitefeed-wrap\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>Include in Site Feed?</legend>\n\t\t\t\t<label><input type=\"radio\" name=\"aad_category_in_feed\" value=\"yes\" checked>Yes</label>\n\t\t\t\t<label><input type=\"radio\" name=\"aad_category_in_feed\" value=\"no\">No</label>\n\t\t\t</fieldset>\n\t\t\t<p class=\"description\">Set to 'No' to exclude this category from the main site RSS Feed. It will still be\n\t\t\t\tpossible to see the feed for this category specifically. </p>\n\t\t</div>\n\t\t<?php\n\t}", "function form_field_type_category($category){\r\n return 'ACF';\r\n }", "function show_form_to_create_category(){\n\t\t$data = array();\n\t\t$data['form_name'] = \"Create new category\";\n\t\t\n\t\t// external css\n\t\t$data['ext_css'] = array(\n\t\t\t);\n\t\t// external js\n\t\t$data['ext_js'] = array(\n\t\t\t'assets/js/category/category.js',\n\t\t\t'assets/js/category/category_event.js',\n\t\t\t);\n\n\t\t// To show Admin Menu\n\t\tif($this->tank_auth->is_logged_in())\n\t\t{\n\t\t\t$data['is_logged_in'] = $this->tank_auth->is_logged_in();\n\t\t\t$data['user_id']\t= $this->tank_auth->get_user_id();\n\t\t\t$data['username']\t= $this->tank_auth->get_username();\n\t\t}\n\n\t\t$this->smarty->view('admin_category/admin_view_describe_category_form', $data);\n\t}", "function print_filter_show_category() {\n\tglobal $t_select_modifier, $t_filter;\n\t?>\n\t\t<!-- Category -->\n\t\t<select <?php echo $t_select_modifier;?> name=\"<?php echo FILTER_PROPERTY_CATEGORY;?>\">\n\t\t\t<option value=\"<?php echo META_FILTER_ANY?>\" <?php check_selected( $t_filter[FILTER_PROPERTY_CATEGORY], META_FILTER_ANY );?>>[<?php echo lang_get( 'any' )?>]</option>\n\t\t\t<?php print_category_filter_option_list( $t_filter[FILTER_PROPERTY_CATEGORY] )?>\n\t\t</select>\n\t\t<?php\n}", "private function AddCategoryField() \n {\n $name = 'Category';\n $value = '';\n if ($this->article->Exists()) {\n $value = $this->article->GetCategory()->GetID();\n }\n $field = new Select($name, $value);\n $field->AddOption('', Trans('Core.PleaseSelect'));\n $catList = new CategoryListProvider($this->archive);\n $categories = $catList->ToArray();\n foreach ($categories as $category) {\n $field->AddOption($category->GetID(), $category->GetName());\n }\n $this->AddField($field);\n $this->SetRequired($name);\n }", "public function isCategory()\r\n {\r\n return $this->type == Page::TYPE_CATEGORY;\r\n }", "function mgm_category_form($category){\t\t\t\r\r\n\t// member types\r\r\n\t$access_membership_types = mgm_get_class('post_category')->get_access_membership_types();\r\r\n\t// init\r\r\n\t$membership_types = array();\r\r\n\t// check\r\r\n\tif(isset($category->term_id) && $category->term_id>0){\r\r\n\t\t// check\r\r\n\t\tif(isset($access_membership_types[$category->term_id])){\r\r\n\t\t\t$membership_types = $access_membership_types[$category->term_id];\r\r\n\t\t}\r\r\n\t}\r\r\n\t// access list\r\r\n\t$mgm_category_access = mgm_make_checkbox_group('mgm_category_access[]', mgm_get_class('membership_types')->membership_types, $membership_types, MGM_KEY_VALUE);?>\r\r\n\t<script language=\"javascript\">\r\r\n\t\t<!--\r\r\n\t\tjQuery(document).ready(function(){\t\r\r\n\t\t\t<?php if(isset($category->term_id) && intval($category->term_id) > 0):?> \t\t\t\t\t\t\t\r\r\n\t\t\tvar html='<tr class=\"form-field form-required\">' +\r\r\n\t\t\t\t\t ' \t<th scope=\"row\" valign=\"top\"><label for=\"cat_name\"><?php _e('Category Protection','mgm')?></label></th>' +\r\r\n\t\t\t\t\t '\t<td><div>'+\"<?php echo $mgm_category_access; ?>\"+'</div>'+\r\r\n\t\t\t\t\t ' <p><?php _e('Only selected membership types can access the category (Leave all unchecked to allow public access.)','mgm') ?></p></td>' +\r\r\n\t\t\t\t\t '</tr>';\r\r\n\t\t\tjQuery(\"#edittag .form-table\").append(html);\r\r\n\t\t\t<?php else:?>\t\t\t\r\r\n\t\t\tvar html ='<div class=\"form-field\">'+\r\r\n\t\t\t\t\t\t\t'<label for=\"mgm_category_access\"><?php _e('Category Protection','mgm')?></label>'+\r\r\n\t\t\t\t\t\t\t\"<?php echo $mgm_category_access; ?>\"+\r\r\n\t\t\t\t\t\t\t'<p><?php _e('Only selected membership types can access the category (Leave all unchecked to allow public access.)','mgm') ?>.</p>'+\r\r\n\t\t\t\t\t '</div>';\t\t\t\t\t\t\t\t\r\r\n\t\t\tjQuery(\"#addtag p.submit\").before(html);\r\r\n\t\t\t<?php endif;?>\r\r\n\t\t});\r\r\n\t\t//-->\r\r\n\t</script>\r\r\n\t<?php\t\t\r\r\n}", "function showCategory()\r\n {\r\n }", "public function showOnCMSForm() {\n if (self::get_config_setting('add_to_form')) {\n if (!in_array($this()->class, self::get_config_setting('exclude_from_class_names') ?: [])) {\n return true;\n }\n }\n return false;\n }", "public function hasCategory(): bool;", "public function isValidCategory() {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\n\t\t// if no splits then category is required otherwise MUST be NULL (will be ignored in Save)\n\t\tif (empty($_POST['splits']) && empty($_POST['category_id'])) {\n\t\t\t$this->form_validation->set_message('isValidCategory', 'The Category Field is Required');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "protected function category_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('category_name', translate('category'), 'trim|required|callback_unique_category');\n $this->form_validation->set_rules('type', translate('category_for'), 'required');\n }", "public function validCategory($cat)\n {\n if(empty($cat))\n {\n echo $this->errors[] = self::CAT_INVALID;\n return false; \n }\n else\n return true;\n }", "public function is_categories_screen() {\n\n\t\treturn Framework\\SV_WC_Helper::is_current_screen( 'edit-product_cat' );\n\t}", "protected function isCategoryPage(): bool\n {\n return 'category' === Dispatcher::getInstance()->getController();\n }", "function extra_category_fields( $tag ) { //check for existing featured ID\r\n\t\t$t_id = $tag->term_id;\r\n\t\t$securePage = esc_attr( get_term_meta( $t_id, 'secure-page', true) );\r\n\t\t?>\r\n\t\t<tr class=\"form-field\">\r\n\t\t\t<th scope=\"row\" valign=\"top\">\r\n\t\t\t\t<label for=\"cat_securePage\"><?php _e('Secure Category'); ?></label><br />\r\n\t\t\t</th>\r\n\t\t\t<td>\r\n\t\t\t\t<input \r\n\t\t\t\t\ttype=\"checkbox\" \r\n\t\t\t\t\tname=\"secure-page\" \r\n\t\t\t\t\tid=\"Cat_meta[secure-page]\" \r\n\t\t\t\t\tvalue=\"1\"\r\n\t\t\t\t\t<?php echo $securePage == '1' ? ' checked=\"checked\"' : ''; ?>\r\n\t\t\t\t><br />\r\n\t\t\t\t<span class=\"description\">Secure's the content and only risk management users can see them.</span>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\r\n\t\t<?php\r\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read file and return an array of words in the file
public function readFileByWord() { if ($this->exists) { $filecontents = file_get_contents ( $this->filename ); $words = preg_split ( '/[\s]+/', $filecontents, - 1, PREG_SPLIT_NO_EMPTY ); return $words; } else { return false; } }
[ "private function wordArray()\n {\n $wordArray = array(file('wordlist.txt'));\n return $wordArray[0];\n }", "function get_file_words($file, $exclude) {\n\t$result = array();\n\n\t$content = file_get_contents($file);\n\tif (!empty($content)) {\n\t\t$words = explode(' ', $content);\n\n\t\tforeach ($words as $word) {\n\t\t\t$clean_word = clean_word($word);\n\t\t\tif (!empty($clean_word) \n\t\t\t\t&& !in_array($clean_word, $exclude) \n\t\t\t\t&& !in_array($clean_word, $result)) {\n\t\t\t\t\t\n\t\t\t\t$result[] = $clean_word;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $result;\n}", "function getWordList() {\n $wordlist = file(__dir__ . '/words.txt', FILE_IGNORE_NEW_LINES);\n if ($wordlist === FALSE) {\n throw new Exception('words.txt missing');\n }\n\t\treturn $wordlist;\n\t}", "function loadWords() {\n global $words;\n global $numwords;\n $input = fopen(\"./words.txt\", \"r\");\n\n while (true) {\n $str = fgets($input);\n if (!$str) break;\n $words[] = rtrim($str);\n $numwords++;\n }\n\n fclose($input);\n}", "function fileToTwoDArray($file) {\n\tif(empty($file)){\n\t\techo 'FUNCTION ERROR: fileToTwoDArray($file), param file looks to be empty or null.<br />';\n\t\texit(-1);\n\t}\n\t$index = 0;\n\t$lines = file($file);\n\t$file_array = array(array());\n\t\n\tforeach ($lines as $line_num => $line) {\n\t\t$clean = trim($line);\n \t\t$file_array[$index]['word'] = $clean;\n \t\t$file_array[$index]['count'] = 0;\n \t\t$index++;\n\t}\n\treturn $file_array;\n}", "function read( $filename )\n\t{\n\t\t$filt = array();\n\n\t\t// verify that file exists; if not, create it\n\t\tif( !file_exists( $filename ) )\n\t\t{\n\t\t\t$fid = fopen( $filename, 'xb' );\n\t\t\tfclose( $fid );\n\t\t}\t\n\t\t\n\t\t$raw = file( $filename );\n\t\tforeach( $raw as $line )\n\t\t{\n\t\t\t$tmp = explode( \"\\t\", $line );\n\t\t\tforeach( $tmp as $key=>$item ) $tmp[$key] = trim( $item );\n\t\t\t$filt[] = $tmp;\n\t\t}\n\t\t\n\t\treturn $filt;\n\t}", "function getStopwordsFromFile(): array{\n $mystopwordFilePath = $_SERVER['DOCUMENT_ROOT'].\"/ecommerce/files/stopwords.txt\";\n $stopword_array = array();\n if(file_exists($mystopwordFilePath)){\n try {\n $file_handle = fopen($mystopwordFilePath, \"r\");\n $theData = fread($file_handle, filesize($mystopwordFilePath));\n $my_array = explode(\",\", $theData);\n foreach($my_array as $stopword){\n $stopword_array[] = trim($stopword,\"'\");\n }\n } catch (\\Exception $e) {\n $error = $e->getMessage();\n debugfilewriter($error);\n }\n finally {\n fclose($file_handle);\n return $stopword_array;\n }\n }else{\n debugfilewriter(\"Error: File exist function of stopwords.txt file return false\");\n return $stopword_array;\n }\n}", "function file_to_array($file_name)\n{\n $f = fopen($file_name, \"r\");\n $array = array();\n $index = 0;\n while (!feof($f)) { // While not the end of the file\n $line = fgets($f);\n if (trim($line) != \"\") {\n $array[$index] = $line;\n $index++;\n }\n }\n fclose($f);\n return $array;\n}", "function allWords($filename)\n{\n foreach (lines($filename) as $line) {\n $words = explode(' ', strtolower(preg_replace(\"/[\\W_]+/\", ' ', $line)));\n\n foreach ($words as $word) {\n if (!empty($word)) {\n yield $word;\n }\n }\n }\n}", "public function getFileContent()\n {\n $filepath = $this->getFilePath();\n\n if (is_file($filepath)) {\n $wordsArray = include $filepath;\n asort($wordsArray);\n\n return $wordsArray;\n }\n\n return false;\n }", "function getMagicWords(){\n\t\t$data = file_get_contents(plugin_dir_url( __FILE__ ) . 'magicWords.txt');\n\t\t$commandsArray = explode(\"\\n\", $data);\n\t\t$finalArray = array();\n\n\t\tforeach($commandsArray as $line){\n\t\t\t$subData = explode(\":\", $line);\n\t\t\t$finalArray[trim($subData[0])] = trim($subData[1]);\n\t\t}\n\n\t\treturn $finalArray;\n\t}", "public function loadThesaurusFile($filename){\r\n\t\t\r\n\t\t$fp = fopen($filename, 'r') or die(\"Couldn\\'t open file, sorry\");\r\n\t\t$line=fgets($fp);\r\n\t\twhile (!feof($fp))\r\n\t\t{\r\n //$part1 is a word $part2 is the whole line \r\n\t\t\tlist($part1, $part2) = explode(',', $line, 2);\r\n\t\t\t// Next line shortens synonyms to just one synonym\r\n\t\t\t//list($part2, $part3) = explode(',', $part2, 2);\r\n\t\t\t//add to array\r\n\t\t\t$this->thesaurus[$part1] = trim($part2);\r\n\t\t\t$line=fgets($fp);\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "private function read_lines() {\n $contents_array = [];\n //.txt files\n if (filesize($this->filename) > 0) {\n $handle = fopen($this->filename, \"r\");\n $contents = trim(fread($handle, filesize($this->filename)));\n $contents_array = explode(\"\\n\", $contents); \n fclose($handle);\n }\n return $contents_array; \n }", "public function getCountries() {\n $returnArr = array();\n $lines = file(\"countries.txt\");\n foreach ($lines as $line) {\n $tmp = explode(\" - \", $line); \n if (sizeof($tmp) == 2) {\n $returnArr[trim($tmp[1])] = trim($tmp[0]);\n }\n }\n return $returnArr;\n }", "function fileToArray($file) {\n\tif(empty($file)){\n\t\techo 'FUNCTION ERROR: fileToArray($file), param file looks to be empty or null.<br />';\n\t\texit(-1);\n\t}\n\t$index = 0;\n\t$lines = file($file);\n\t$file_array = array();\n\n\tforeach ($lines as $line_num => $line) {\n \t\t$clean = trim($line);\n \t\t$file_array[$index] = $clean;\n \t\t$index++;\n\t}\n\treturn $file_array;\n}", "function parse_countries ( string $file_name ) : array {\n\t$file = __DIR__.'/'.$file_name;\n\tif ( is_file( $file ) ) {\n\t\treturn @explode( \"\\x0a\", @file_get_contents( $file ) );\n\t}\n\treturn [];\n}", "function readQuestions($filename) {\n\t$displayQuestions = array();\n\t\n\tif (file_exists($filename) && is_readable($filename)) {\n\t\t$questions = file($filename);\n\t\n\t\t// Loop through each line and explode it into question and choices\n\t\tforeach ($questions as $key => $value) {\n\t\t\t$displayQuestions[] = explode(\":\",$value);\n\t\t}\t\t\t\t\n\t}\n\telse { echo \"Error finding or reading questions file.\"; }\n\t\n\treturn $displayQuestions;\n}", "public function extractWords() {\n $matches = [];\n preg_match_all(\"/\\b[a-zA-Z]+\\b/\", $this->_txt, $matches);\n return $matches;\n }", "function loadGlossary($path) {\n $words = [];\n $sections = scandir($path);\n \n foreach ($sections as $name) {\n $file = realpath($path . DIRECTORY_SEPARATOR . $name);\n if (is_file($file)) {\n $words = array_merge($words, loadGlossaryFile($file));\n }\n }\n \n return $words;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of date_birth
public function getDateBirth() { return $this->date_birth; }
[ "public function getDateOfBirth() {\n\t\treturn $this->getAsInteger('date_of_birth');\n\t}", "public function get_birth_date(){\n\t\treturn $this->v_birth_date->sec;\n\t}", "public function getBirthDate();", "public function getDate_Birth()\r\n\t{\r\n\t\treturn $this->date_birth;\r\n\t}", "public function getBirthdate();", "public function getDateBirthDate() {\n return $this->dateBirthDate;\n }", "public function getDateofbirth()\n\t{\n\t\treturn $this->dateofbirth;\n\t}", "public function getBirthday()\n {\n return $this->getFieldValue('birthday');\n }", "public function getDateOfBirthDay()\n {\n return $this->date_of_birth_day;\n }", "public function getBirthDate() {\r\n $day = $this->day;\r\n $month = $this->month;\r\n $year = $this->year;\r\n\r\n //Se $day e` un numero inferiore a 10\r\n //$day sara` preceduto da uno 0\r\n if ($day < 10 ) {\r\n $day = 0 . $day;\r\n }\r\n\r\n //Se $month e` un numero inferiore a 10\r\n //$month sara` preceduto da uno 0\r\n if ($month < 10 ) {\r\n $month = 0 . $month;\r\n }\r\n\r\n $birth_date = $year . \"-\" . $month . \"-\" . $day;\r\n return $birth_date;\r\n }", "public function getBirthDate()\n {\n return $this->_birthDate;\n }", "public function getBirthday()\n {\n return $this->getField('birthday');\n }", "public function getBirthday()\n {\n return $this->data['fields']['birthday'];\n }", "public function getBirthday() {\n return $this->_data['birthday'];\n }", "public function getBirthDate()\n {\n return $this->getProfile() ? $this->getProfile()->getBirthDate() : null;\n }", "public function getBirthday()\r\n {\r\n return $this->birthday;\r\n }", "public function getBirthday()\n {\n if (isset($this->userInfo['birthday'])) {\n $this->userInfo['birthday'] = str_replace('0000', date('Y'), $this->userInfo['birthday']);\n $result = date('d.m.Y', strtotime($this->userInfo['birthday']));\n } else {\n $result = null;\n }\n return $result;\n }", "public function getBirthdateNumber()\n {\n return $this->birthdateNumber;\n }", "public function getBirthday() {\n\t\t\treturn $this->birthday; \n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify cURL timeouts are appropriately reported.
public function testWithCurlTimeout() { $handle = curl_init(); curl_setopt($handle, CURLOPT_TIMEOUT_MS, 1); $safeCurl = new SafeCurl($handle); $safeCurl->execute("https://httpstat.us/200?sleep=100"); }
[ "public function testCurlTimeout()\n {\n $expected = env('GOOGLE_CURL_TIMEOUT');\n $actual = Config::curlTimeout();\n\n $this->assertEquals($expected, $actual);\n }", "public function testConnectTimeoutExceeded()\n {\n $this->connection = new DefaultConnection(1, -1);\n try {\n $responseHandler = function ($httpStatusCode, $data, $headers) {\n };\n $startTime = time();\n $this->connection->get('https://www.example.org:12345', [], $responseHandler);\n $this->fail('Expected connect timeout error');\n } catch (ErrorException $e) {\n $endTime = time();\n $expectedErrorMessage1 = 'cURL error ' . CURLE_OPERATION_TIMEOUTED;\n $expectedErrorMessage2 = 'cURL error ' . CURLE_COULDNT_CONNECT;\n if (function_exists('curl_strerror')) {\n $expectedErrorMessage1 .= ' (' . curl_strerror(CURLE_OPERATION_TIMEOUTED) . ')';\n $expectedErrorMessage2 .= ' (' . curl_strerror(CURLE_COULDNT_CONNECT) . ')';\n }\n $expectedErrorMessagePattern = '/' . preg_quote($expectedErrorMessage1) . '|' . preg_quote($expectedErrorMessage2) . '/';\n $this->assertRegExp($expectedErrorMessagePattern, $e->getMessage());\n $this->assertTrue($endTime - $startTime <= 2, 'Connect timeout should occur within 2 seconds');\n }\n }", "private function checkSnifferTimeout()\n {\n if ($this->snifferTimeout !== false) {\n if (($this->lastSniff + $this->snifferTimeout) < time()) {\n $this->sniffHosts();\n }\n }\n\n }", "private function checkReadTimeout() {\n\t\t$info = stream_get_meta_data($this->stream);\n\n\t\tif (isset($info['timed_out']) && $info['timed_out']) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Request timed out.\");\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\t}", "public function testConnectionTimeout()\n {\n $testTimeout = '1';\n\n EasyPost::setConnectTimeout($testTimeout);\n $connectionTimeout = EasyPost::getConnectTimeout();\n\n $this->assertEquals($testTimeout, $connectionTimeout);\n }", "public function checkTimeOut($ch, $time){\n\t\tif(curl_errno($ch) == self::$CURLE_OPERATION_TIMEDOUT){\n\t\t\tcurl_close($ch);\n\t\t\t$this->setIcsFlagError(true);\n\t\t\tthrow new Intuiko_ConnectedStore_Exception('request ended in timeout error after ' . $time . 's');\n\t\t}\n\t}", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "public function testTimeout(): void\n {\n $this->client->setTimeout(20);\n $this->assertSame(20,\n $this->client->getTimeout());\n\n $this->client->setConnectionTimeout(24);\n $this->assertSame(24,\n $this->client->getConnectionTimeout());\n }", "function check_timeouts()\n {\n \t$ids = $this->running_timeouts();\n \tforeach ($ids as $id => $pid)\n \t\tif ($pid and $this->is_running($pid))\n \t\t\t$this->timeout($id, $pid);\n }", "public function testCanFetchResponseTime()\n {\n $this->assertInternalType('float', $this->curlClient->latency());\n }", "public function getTimeout() {\n return $this->curl_timeout;\n }", "public function setCurlConnectTimeout($curl_connect_timeout);", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function testTimeoutOptions()\n {\n $connection = getConnection();\n \n $oldTimeout = $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n $oldConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $oldRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n\n static::assertEquals($oldTimeout, $oldConnectTimeout);\n static::assertEquals($oldTimeout, $oldRequestTimeout);\n\n $connection->setOption(ConnectionOptions::OPTION_TIMEOUT, 12);\n $newTimeout = $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n $newConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $newRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n \n static::assertEquals(12, $newTimeout);\n static::assertEquals(12, $newConnectTimeout);\n static::assertEquals(12, $newRequestTimeout);\n \n $connection->setOption(ConnectionOptions::OPTION_TIMEOUT, 42);\n $newTimeout = $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n $newConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $newRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n \n static::assertEquals(42, $newTimeout);\n static::assertEquals(42, $newConnectTimeout);\n static::assertEquals(42, $newRequestTimeout);\n\n $connection->setOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT, 1.5);\n try {\n $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n static::assertFalse(true);\n } catch (\\Exception $e) {\n // OPTION_TIMEOUT is gone once OPTION_CONNECT_TIMEOUT is used\n }\n\n $newConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $newRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n \n static::assertEquals(1.5, $newConnectTimeout);\n static::assertEquals(42, $newRequestTimeout);\n \n $connection->setOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT, 24.5);\n $newConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $newRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n \n try {\n $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n static::assertFalse(true);\n } catch (\\Exception $e) {\n // OPTION_TIMEOUT is gone once OPTION_REQUEST_TIMEOUT is used\n }\n \n static::assertEquals(1.5, $newConnectTimeout);\n static::assertEquals(24.5, $newRequestTimeout);\n \n \n $connection->setOption(ConnectionOptions::OPTION_TIMEOUT, 8);\n $newTimeout = $connection->getOption(ConnectionOptions::OPTION_TIMEOUT);\n $newConnectTimeout = $connection->getOption(ConnectionOptions::OPTION_CONNECT_TIMEOUT);\n $newRequestTimeout = $connection->getOption(ConnectionOptions::OPTION_REQUEST_TIMEOUT);\n \n static::assertEquals(8, $newTimeout);\n static::assertEquals(8, $newConnectTimeout);\n static::assertEquals(8, $newRequestTimeout);\n }", "public function test_timeout() {\n $q = test_question_maker::make_question('pycode', 'timeout');\n $code = \"def timeout():\\n while (1):\\n pass\";\n $response = array('answer' => $code);\n $result = $q->grade_response($response);\n $this->assertEqual($result[0], 0);\n $this->assertEqual($result[1], question_state::$gradedwrong);\n $this->assertTrue(isset($result[2]['_testresults']));\n $testResults = unserialize($result[2]['_testresults']);\n $this->assertEqual(count($testResults), 1);\n $this->assertFalse($testResults[0]->isCorrect);\n // Need to accommodate different error messages from the 2 sandboxes\n $this->assertTrue($testResults[0]->output == 'SIGTERM (timeout or too much memory?)'\n or $testResults[0]->output == \"***Time Limit Exceeded***\");\n }", "protected function timeOuts()\n {\n $ret = 0;\n foreach ($this->cards() as $c) {\n if ($c->action == 'timeout') {\n $ret++;\n }\n }\n return $ret;\n }", "function testTimeoutRecover() {\n\t\t$init = $this->getDonorTestData();\n\t\t$init['payment_method'] = 'cc';\n\t\t$init['payment_submethod'] = 'visa';\n\t\t$init['email'] = 'innocent@localhost.net';\n\t\t$init['ffname'] = 'cc-vmad';\n\n\t\t$gateway = $this->getFreshGatewayObject( $init );\n\t\t$gateway::setDummyGatewayResponseCode( '11000400' );\n\t\t$gateway->do_transaction( 'SET_PAYMENT' );\n\t\t$loglines = self::getLogMatches( LogLevel::INFO, '/Repeating transaction for timeout/' );\n\t\t$this->assertNotEmpty( $loglines, \"Log does not say we retried for timeout.\" );\n\t}", "public function http_request_timeout() {\n return 2;\n }", "public function isTimeoutReached(): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that proper method calls are made in ItemManager's setExpired() method
public function testSetItemExpired() { putenv('DB_CONNECTION=sqlite_testing'); Log::shouldReceive('info'); Mail::shouldReceive('to'); $item = factory(\App\item::class)->make([ 'End_Date' => Carbon::today() ]); $item->save(); $this->assertDatabaseHas('items', [ 'id' => $item->id, 'Status' => 'pending' ]); $userRepoMock = Mockery::mock('App\Repositories\UserRepository'); $itemRepoMock = Mockery::mock('App\Repositories\ItemRepository'); $transactionRepoMock = Mockery::mock('App\Repositories\TransactionRepository'); $paymentManager = Mockery::mock('App\Domain\PaymentManager'); $itemRepoMock->shouldReceive('getExpiredItems')->with()->once(); $itemRepoMock->shouldReceive('find'); $transactionRepoMock->shouldReceive('getAllByItemId'); $itemManager = new ItemManager($itemRepoMock, $transactionRepoMock, $userRepoMock, $paymentManager); $itemManager->setExpired(); }
[ "public function testItemExpiration()\n {\n $this->assertTrue(true);\n }", "public function Cache_And_Get_Expired() {\n\t\t// Arrange\n\t\t$cache = $this->GetCache();\n\t\t$date = new DateTime();\n\t\t$date = $date->sub(new DateInterval(\"P1Y\"));\n\t\t$cacheItem = new \\EggCup\\CacheItem(\"key\", $date, array(), \"value\");\n\t\t// Act\n\t\t$cache->Cache($cacheItem);\n\t\t// Assert\n\t\tAssert::IsFalse($cache->TryGetByKey(\"key\", $value));\n\t}", "public function testSetExpireInvalid()\n {\n $this->priority->setExpire(86500);\n }", "public function testUseByDateExpired1() {\n\t\t\n\t\t$ingredient = new FridgeIngredient('test', 10, 'grams', '21/10/2014');\n\t\treturn assert('$ingredient->hasExpired() == true');\n\t}", "public function testExpiration()\n {\n $key = new Key(uniqid(__METHOD__, true));\n $clockDelay = $this->getClockDelay();\n\n /** @var PersistingStoreInterface $store */\n $store = $this->getStore();\n\n $store->save($key);\n $store->putOffExpiration($key, 2 * $clockDelay / 1000000);\n $this->assertTrue($store->exists($key));\n\n usleep(3 * $clockDelay);\n $this->assertFalse($store->exists($key));\n }", "public function testCheckIfAccountExpired()\n {\n }", "public function testExpired():void {\n // Internal Check.\n self::$ci->jwt->payload(\"exp\", time());\n $this->assertTrue(self::$ci->jwt->expired());\n self::$ci->jwt->payload(\"exp\", time() + (7 * 24 * 60 * 60));\n $this->assertFalse(self::$ci->jwt->expired());\n\n // Supplied Token Check.\n self::$ci->jwt->payload(\"exp\", time());\n $jwt = self::$ci->jwt->sign();\n $this->assertTrue(self::$ci->jwt->expired($jwt));\n self::$ci->jwt->payload(\"exp\", time() + (7 * 24 * 60 * 60));\n $jwt = self::$ci->jwt->sign();\n $this->assertFalse(self::$ci->jwt->expired($jwt));\n // Empty Expire.\n // Absent exp field means token cannot expire.\n self::$ci->jwt->create();\n $this->assertFalse(self::$ci->jwt->expired());\n }", "public function testToggleExpirable()\n {\n $card = new Card();\n // Not expirable\n $card->setLifeTime(null);\n $this->assertNotTrue($card->getLifeTime()->hasExpirationDate());\n // Expirable\n $card->setLifeTime(new \\DateTime());\n $this->assertTrue($card->getLifeTime()->hasExpirationDate());\n // Not expirable again\n $card->setLifeTime(null);\n $this->assertNotTrue($card->getLifeTime()->hasExpirationDate());\n }", "public function is_expired();", "public function testExpiry() {\n\t\t$session1 = uniqid();\n\t\t$store = $this->getStore();\n\n\t\t// Store data now\n\t\t$data1 = array(\n\t\t\t'Food' => 'Pizza'\n\t\t);\n\t\t$store->write($session1, serialize($data1));\n\t\t$result1 = $store->read($session1);\n\t\t$this->assertEquals($data1, unserialize($result1));\n\n\t\t// Go to the future and test that the expiry is accurate\n\t\tSS_Datetime::set_mock_now('2040-03-16 12:00:00');\n\t\t$result2 = $store->read($session1);\n\t\t$this->assertEmpty($result2);\n\t}", "public function testPostApiQueueItemExpiration() {\n $queue = $this->createQueue();\n\n // Test that we can claim an item that is expired and we cannot claim an\n // item that has not expired yet.\n $queue->createItem([$this->randomMachineName() => $this->randomMachineName()]);\n $item = $queue->claimItem();\n $this->assertNotFalse($item, 'The item can be claimed.');\n $item = $queue->claimItem();\n $this->assertFalse($item, 'The item cannot be claimed again.');\n // Set the expiration date to the current time minus the lease time plus 1\n // second. It should be possible to reclaim the item.\n $this->setExpiration($queue, time() - 31);\n $item = $queue->claimItem();\n $this->assertNotFalse($item, 'Item can be claimed after expiration.');\n\n $queue->deleteQueue();\n }", "public function expiredAction()\n\t{\n\n\t}", "public function testPermissionIsExpired()\n {\n $ds = $this->buildMock(true);\n $perm = new PermissionModel($ds, [\n 'id' => 1234,\n 'expire' => strtotime('-1 day')\n ]);\n\n $this->assertTrue($perm->isExpired());\n }", "public function testValidTtl()\n {\n $pool = new EphemeralCachePool();\n $item = $pool->getItem('test');\n\n $dt = new \\DateTime();\n $dt->modify('+10 seconds');\n\n $item->set('value', $dt);\n $item->set('value', null);\n $item->set('value', 10);\n\n $this->assertEquals('value', $item->get());\n }", "public function markAsExpired()\n {\n $this->getDbQueryManager()->get(ExpireIrhpPermitsQuery::class)->execute([]);\n }", "private function inactive_item_reminder() {\n }", "public function testSettingExpiration()\n {\n $expiration = new DateTime('now');\n $this->response->setExpiration($expiration);\n $this->assertEquals($expiration->format('r'), $this->response->getHeaders()->get('Expires'));\n }", "public function setExpiredStatus()\n {\n $this->_em->createQueryBuilder()\n ->update($this->_entityName, 'a')\n ->set('a.status', Document::STATUS_EXPIRED)\n ->where('a.expirationDate < :today')\n ->setParameter('today', new \\DateTime('today'))\n ->getQuery()\n ->execute();\n }", "public function testExpiredEvaluationShouldReturnFromService(): void {\n // item should be empty\n\n $got = $this->client->evaluate(BOOL_FLAG_IDENTIFIER, false);\n // wait to expire\n sleep(EXPIRE_AFTER + 1);\n // expired, no item in cache\n $item = $this->cache->getItem($this->client->getCacheKeyName(BOOL_FLAG_IDENTIFIER, HARNESS_IDENTIFIER))->get();\n $this->assertEmpty(\n $item\n );\n $this->assertNull($item);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }