query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Generated from protobuf field string total_share = 33; | public function getTotalShare()
{
return $this->total_share;
} | [
"function bimber_essb_entry_share_count() {\n $counters = bimber_essb_get_sharecount();\n\n $number = isset( $counters['total'] ) ? $counters['total'] : 0;\n\n return $number;\n\n//\treturn bimber_essb_get_post_sharecount();\n}",
"public function setTotalShare($var)\n {\n GPBUtil::checkString($var, True);\n $this->total_share = $var;\n\n return $this;\n }",
"public function getShareCounter() {\r\n\treturn $this->shareCounter;\r\n }",
"public function getShare()\n {\n\n if ($this->portfolio->balance['btc'] == 0) {\n return 0;\n }\n\n $share = $this->amount * $this->price_btc / $this->portfolio->balance['btc'] * 100;\n\n return $share;\n\n }",
"function bunchy_render_entry_share_count() {\n\techo bunchy_capture_entry_share_count();\n}",
"function bunchy_get_entry_share_count() {\n\treturn apply_filters( 'bunchy_entry_share_count', - 1 );\n}",
"function social_shares() {\n $url = get_permalink( $post_id );\n $json = file_get_contents(\"http://api.sharedcount.com/?url=\" . rawurlencode($url));\n $counts = json_decode($json, true);\n $totalcounts = $counts[\"Twitter\"] +\n$counts[\"Facebook\"][\"total_count\"] +\n$counts[\"GooglePlusOne\"];\n echo \"<div>$totalcounts Share</div>\";\n}",
"function get_media_shares_total() {\n\t\tif ( ! wp_verify_nonce( $_POST['get_media_shares_total_nonce'], 'get_media_total' ) ) {\n\t\t\tdie( -1 );\n\t\t}\n\n\t\tglobal $wpdb;\n\t\t$monarch_options = $this->monarch_options;\n\n\t\t$total_counts_data = str_replace( '\\\\', '' , $_POST[ 'media_total' ] );\n\t\t$total_counts_data_array = json_decode( $total_counts_data, true );\n\n\t\t$table_name = $wpdb->prefix . 'et_social_stats';\n\n\t\t$media_url = $total_counts_data_array[ 'media_url' ];\n\t\t$post_id = $total_counts_data_array[ 'post_id' ];\n\n\t\t// construct sql query to get count of media shares for the required post\n\t\t$sql = \"SELECT COUNT(*) FROM $table_name WHERE action = %s AND media_url like %s AND post_id = %d\";\n\t\t$sql_args = array(\n\t\t\t'media',\n\t\t\t$media_url,\n\t\t\t$post_id\n\t\t);\n\n\t\t$i = 0;\n\t\tforeach ( $monarch_options[ 'sharing_networks_networks_sorting' ][ 'class' ] as $network ) {\n\t\t\t//do not count likes\n\t\t\tif ( 'like' != $network ) {\n\t\t\t\t$operator = 0 < $i ? ' OR ' : ' AND ( ';\n\t\t\t\t$sql .= \"{$operator}network = %s\";\n\t\t\t\t$sql_args[] = $network;\n\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$sql .= ');';\n\n\t\t$total_media_shares = $wpdb->get_var( $wpdb->prepare( $sql, $sql_args ) );\n\n\t\tdie( $this->get_compact_number( $total_media_shares ) );\n\t}",
"function thrive_social_fetch_count_t_share( $url ) {\n\treturn 0;\n}",
"public function get_total_count_sharethis ( $url ) {\n\t\t$total_share_url = \"http://rest.sharethis.com/reach/getUrlInfo.php?\"\n\t\t\t\t\t\t\t.\"url=\".urlencode($url)\n\t\t\t\t\t\t\t.\"&provider=total\"\n\t\t\t\t\t\t\t.\"&pub_key=$pubkey\"\n\t\t\t\t\t\t\t.\"&access_key=$accesskey\";\n\t\t$total_count = json_decode ( file_get_contents( $total_share_url ) )->total;\n\t\t$total_count = $total_count->inbound + $total_count->outbound;\n\t\treturn $total_count;\n\t}",
"public function user_share_counts_by_share_type($params)\r\n {\r\n $data = $this->call_oauth2_metrics(\"v3/user/share_counts_by_share_type\", $params);\r\n return $data[\"share_counts_by_share_type\"];\r\n }",
"public function getShareRatio()\n {\n return $this->shareRatio;\n }",
"public function sharedCostNumber()\n {\n return ltrim(static::numerify($this->generator->parse(\n static::randomElement(static::$sharedCostFormats)\n )));\n }",
"public function getShareBenefitsMoney()\n {\n return $this->share_benefits_money;\n }",
"function get_the_share_favcount() {\n global $share;\n return $share->fav_count;\n}",
"public function getTotalBillableTransferUsage() {\n return @$this->attributes['total_billable_transfer_usage'];\n }",
"public function countShared($type) {\n }",
"function bimber_essb_show_entry_share_count( $show, $share_count ) {\n\t// WP Admin > ESSB > Social Sharing > Share Counters Setup > Avoid Social Negative Proof.\n\t$social_proof_enable = essb_option_bool_value('social_proof_enable');\n\n\tif ( $social_proof_enable ) {\n\t\t// WP Admin > ESSB > Social Sharing > Share Counters Setup > Avoid Social Negative Proof > Display total counter after this value of shares is reached.\n\t\t$share_count_threshold = essb_option_value( 'total_counter_hidden_till' );\n\n\t\tif ( absint( $share_count ) < absint( $share_count_threshold ) ) {\n\t\t\t$show = false;\n\t\t}\n\t}\n\n\treturn $show;\n}",
"function GetSashSize(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cycleBudgets for the model. | public function cycleBudgets()
{
return $this->hasMany(CycleBudget::class);
} | [
"public function budgets()\n {\n # Defines A One-To-Many Relationship\n return $this->hasMany('App\\Budget');\n }",
"public function budgets()\n {\n \treturn $this->hasMany(Budget::class);\n }",
"public function getCycles()\n {\n return $this->cycles;\n }",
"public function getBillingCycles()\n {\n return $this->billingCycles;\n }",
"public function cycle()\n {\n return $this->belongsTo('App\\Models\\Cycle', 'cycle_id');\n }",
"public function cycle()\n {\n return $this->belongsTo('App\\Models\\Cycle');\n }",
"public static function getCurrentBudgets()\n {\n $sql = 'select budgetType as Budget, amount as Amount from budgets';\n return query($sql);\n }",
"public function getCycle();",
"public function getCycle()\n {\n return $this->getPackage()->getCycle();\n }",
"public function getCycle()\n {\n return $this->cycle;\n }",
"public function getBudget()\n {\n $ch = new Curl;\n\n return $ch->get(OVOID::BASE_ENDPOINT . 'v1.0/budget/detail', null, $this->_aditionalHeader())->getResponse();\n }",
"public function getCyclesWithSubjects()\n {\n $subjectCyclesIds = $this->getStudySubjects()\n ->select(['subject_cycle_id'])\n ->union($this->getStudySubjects()\n ->joinWith('subjectCycle')\n ->select(['subject_cycle.parent_id'])\n )\n ->distinct()\n ->column();\n\n $subjectCycles = SubjectCycle::find()\n ->where(['id' => $subjectCyclesIds])\n ->all();\n\n $subjectCycles = SubjectCycle::getTree([], $subjectCycles);\n\n function mapSubjectsToCycles($subjectCycles, $studySubjects)\n {\n return array_map(function ($subjectCycle) use ($studySubjects) {\n $subjectCycle['subjects'] = array_reduce($studySubjects, function ($acc, StudySubject $item) use ($subjectCycle) {\n if ($item->subject_cycle_id == $subjectCycle['id']) {\n $acc[] = $item;\n }\n return $acc;\n });\n if (isset($subjectCycle['children'])) {\n $subjectCycle['children'] = mapSubjectsToCycles($subjectCycle['children'], $studySubjects);\n }\n return $subjectCycle;\n }, $subjectCycles);\n }\n\n return mapSubjectsToCycles($subjectCycles, $this->studySubjects);\n }",
"public function getBudgetDetails()\n {\n $activities = $this->all();\n $budgetDetails = $this->exchangeRateService->budgetDetails($activities);\n\n return $budgetDetails;\n }",
"public function budgets()\n {\n return $this->belongsToMany('App\\Models\\Budget', 'budgets_favourite_transactions')\n ->orderBy('name', 'asc');\n }",
"public function cashbacks()\n {\n return $this->hasMany(Cashback::class);\n }",
"public static function billingCycleValues(): array\n {\n return [\n 'daily' => [\n 'frequency_amount' => 1,\n 'frequency_unit' => 'day',\n ],\n 'monthly' => [\n 'frequency_amount' => 1,\n 'frequency_unit' => 'month',\n ],\n 'yearly' => [\n 'frequency_amount' => 1,\n 'frequency_unit' => 'year',\n ],\n ];\n }",
"public function budgets()\n {\n return $this->belongsToMany('App\\Models\\Budget', 'budgets_transactions')\n ->withPivot('allocated_fixed', 'allocated_percent', 'calculated_allocation')\n ->orderBy('name', 'asc');\n }",
"public function getDiscs(): DiscList\n {\n return $this->discs;\n }",
"public function findAll() {\n $sql = \"select * from t_currency order by curr_label\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $currencys = array();\n foreach ($result as $row) {\n $currencyId = $row['curr_id'];\n $currencys[$currencyId] = $this->buildDomainObject($row);\n }\n return $currencys;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the variable the condition is evaluated for. | public function getVariableName()
{
return $this->variableName;
} | [
"public function getVarName()\n {\n return $this->varName;\n }",
"public function getVarName(): string\n {\n return $this->varName;\n }",
"public function variableExpression()\n {\n return (string) $this->data->variableExpression;\n }",
"public function getVarName() {\n return sprintf(\"$%s\", $this->getName());\n }",
"public function getVariableKey() {\n\t\t// custom provided variable name\n\t\tif ($this->_viewVar !== null) {\n\t\t\treturn $this->_viewVar;\n\t\t}\n\n\t\treturn self::buildVariableKey($this->_field);\n\t}",
"function get_var_name($var) {\n foreach ($GLOBALS as $var_name => $value) {\n if ($value === $var) {\n return $var_name;\n }\n }\n return 'array';\n }",
"public function varname(){\r\n $template = ( isset(WPF()->data['template']) ) ? WPF()->data['template'] : WPF()->current_object['template'];\r\n if( $template == 'members' ){\r\n $varname = WPF()->data['varname'];\r\n } else {\r\n $varname = ( wpfval( WPF()->data, 'varname') ) ? WPF()->data['varname'] : 'data';\r\n $varname = apply_filters( 'wpforo_user_custom_field_varname', $varname);\r\n $varname = ( $varname ) ? $varname : 'data';\r\n }\r\n return $varname;\r\n }",
"public function getNameOfLanguageVariable()\n {\n return $this->nameOfLanguageVariable ? : self::getGlobalNameOfLanguageVariable();\n }",
"public function getRepVarName ()\n {\n\n return $this->rep_var_name;\n }",
"public function isVariable() {\n return 'var' === $this->name;\n }",
"function getVarValue( $varname )\n {\n //if ( preg_match(\"/(.*)\\.(.*)/\", $varname, $regs ))\n\n if( sizeof( $regs = explode(\".\", $varname ) ) == 2 ) //this is faster then preg_match\n {\n $lastitem = sizeof( $this->content[ $regs[0] .\"_\". $this->index[$regs[0]] ] );\n\n $lastitem > 1 ? $lastitem-- : $lastitem = 0;\n\n $block = &$this->content[ $regs[0] .\"_\". $this->index[ $regs[0] ] ][$lastitem];\n $varname = $regs[1];\n }\n else\n {\n $block = &$this->currentBlock;\n }\n\n return $block[\"_V:$varname\"];\n }",
"public function varJoinName()\n\t{\n\t\treturn $this->propertyName($this->joinRef);\n\t}",
"function getVariable($name, $defValue = null) {\n if(is_array($name)) {\n $name = $name[1];\n }\n \n $i = $this->stackPosition;\n while($i >= 0 && !array_key_exists($name, $this->stack[$i])) {\n $i--;\n } \n \n return $i >= 0 ? $this->stack[$i][$name] : $defValue; \n }",
"function getVarName()\n {\n return 'aMemberVar';\n }",
"public static function variableName()/*# : string */\n {\n return '[a-zA-Z_\\x7f-\\xff][\\w\\x7f-\\xff]*';\n }",
"public function get_name()\n\t\t{\n\t\t\treturn \"Condition\";\n\t\t}",
"public function getScopedVariableNames();",
"public function getVariableSymbol();",
"private function getVariableNameFromNode(Node $node): ?string\n {\n return match (true) {\n $node instanceof \\PHPStan\\Node\\ClassPropertyNode => $node->getName(),\n $node instanceof Node\\Expr\\PropertyFetch => $node->name->name,\n $node instanceof Node\\Expr\\Variable => $node->name,\n $node instanceof Node\\Param => $node->var->name,\n default => null\n };\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert all elements to string. | public function __toString()
{
$return = '';
foreach ($this as $element)
{
$return .= (string) $element;
}
return $return;
} | [
"protected function to_string($arr){\n\t\t\t\n\t\t}",
"public static function convertToString($element) {\n if (is_array($element)) {\n return (string) \\Drupal::service('renderer')->renderPlain($element);\n }\n else {\n return (string) $element;\n }\n }",
"private function listToText(array $elements): string {\n return implode(',', array_map(function(UXML $elem) {\n return $elem->asText();\n }, $elements));\n }",
"public static function toRepr($element): string\n {\n if ($element === NULL) {\n return \"null\";\n }\n\n if (is_scalar($element)) {\n if ($element === true || $element === false) {\n return 'bool(' . ($element ? 'true' : 'false') . ')';\n } else {\n return sprintf('%s(%s)', gettype($element), strval($element));\n }\n }\n\n if (is_array($element)) {\n $ret = '';\n\n foreach ($element as $value) {\n $ret .= self::toRepr($value) . ', ';\n }\n\n return '[' . $ret . ']';\n }\n\n if (is_object($element)) {\n return sprintf('%s', get_class($element));\n }\n\n return '???';\n }",
"private function childObj2str()\n {\n if ($this->hasChildNodes()) {\n // Iterate over childList\n $out = '';\n foreach ($this->childNodes as $child) {\n $out .= \"$child\";\n }\n return $out;\n } else {\n return '';\n }\n }",
"public function __toString () {\n\t\t$text = '';\n\n\t\tforeach ($this->items as $name => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$value = json_encode($value);\n\t\t\t}\n\n\t\t\t$text .= \"$name: $value\\n\";\n\t\t}\n\n\t\treturn $text;\n\t}",
"protected function contentToString()\n {\n $string = '';\n if (!is_null($this->content)) {\n foreach ($this->content as $c) {\n $string .= $c->toString();\n }\n }\n\n return $string;\n }",
"public function __toString()\n {\n $list = \"\";\n foreach ($this->_result as $r) {\n $r = (array)$r;\n $list .= reset($r) . \",\";\n }\n $list = rtrim($list, \",\");\n return $list;\n }",
"public function toString() {\r\n return implode( ',', $this->_items );\r\n }",
"public function convertArray(array $list){\n return \"\";\n }",
"public static function toString()\n {\n $stringArr = [];\n collect(self::all())->each(function ($item, $key) use (&$stringArr) {\n $stringArr[] = $key . ': ' . $item;\n });\n\n return implode(',', $stringArr);\n }",
"public function convertToString()\n {\n }",
"public static function asString() {\n\t return implode(static::glue(), static::values());\n }",
"protected function convertTranslatableMarkupToStringRecursive(array $element) {\n foreach ($element as $key => $value) {\n if ($value instanceof TranslatableMarkup) {\n $element[$key] = (string) $value;\n }\n elseif (is_array($value)) {\n $element[$key] = $this->convertTranslatableMarkupToStringRecursive($value);\n }\n }\n return $element;\n }",
"private function toStr($arr) {\n $modified = array();\n $len = count($arr);\n for ($i = 0; $i < $len; $i++) {\n $cur = $arr[$len-$i-1];\n $modified[$i] = $this->hexTransform($cur);\n }\n return implode(\"\", $modified);\n }",
"abstract protected function doToString();",
"public function __toString() {\n\t\t$options = array_filter($this->toArray());\n\t\treturn implode(' ', $options);\n\t}",
"public function __tostring() {\n $str = '';\n foreach($this as $value) {\n if($value) {\n $str .= '1';\n }\n else {\n $str .= '0';\n }\n }\n \n return $str;\n }",
"public function toString () {\r\n\t\t#C:\\HaxeToolkit\\haxe\\std/php/_std/Array.hx:197: characters 10-54\r\n\t\t$arr = $this->arr;\r\n\t\t$strings = [];\r\n\t\tforeach ($arr as $key => $value) {\r\n\t\t\t$strings[$key] = Boot::stringify($value, 9);\r\n\t\t}\r\n\t\treturn \"[\" . (implode(\",\", $strings)??'null') . \"]\";\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the match rules of this league. | public function getMatchRules() {
return $this->matchRules;
} | [
"public function getMatchingRules()\n {\n return $this->_matchingRules;\n }",
"public function getRules();",
"public function getRules(): array\n {\n return $this->aRules;\n }",
"public function get_all_rules() {\n\t\treturn $this->rules;\n\t}",
"public function getContestRules()\n {\n return $this->_contestRules;\n }",
"protected function getRules()\n {\n return array_merge($this->_instanceRules, static::$_rules);\n }",
"private static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'director' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ],\n 'runlength' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 30,\n 'max_range' => 300\n ]\n ],\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'activated' => [\n 'filter' => FILTER_VALIDATE_BOOLEAN,\n 'flags' => FILTER_NULL_ON_FAILURE\n ],\n 'price' => FILTER_VALIDATE_FLOAT\n ];\n }",
"function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}",
"public function getScoringRules($league_id = false) {\n\t\t\n\t\tif ($league_id === false) { $league_id = $this->id; }\n\t\t$rules = array('batting'=>array(),'pitching'=>array());\n\t\t$default = false;\n\t\tforeach($rules as $key => $data) {\n\t\t\t// TEST for custom scoring rules\n\t\t\t// if not present, use the default rules for the league (league_id 0)\n\t\t\t$this->db->where('league_id',$league_id);\n\t\t\t$this->db->from('fantasy_leagues_scoring_'.$key);\n\t\t\t$count = $this->db->count_all_results();\n\t\t\tif ($count == 0) {\n\t\t\t\t$league_id = 0;\n\t\t\t}\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->where('league_id',$league_id);\n\t\t\t$query = $this->db->get('fantasy_leagues_scoring_'.$key);\n\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t$cats = array();\n\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\tfor ($i = 0; $i < 12; $i++) {\n\t\t\t\t\t\t$columnT = \"type_\".$i;\n\t\t\t\t\t\t$columnV = \"value_\".$i;\n\t\t\t\t\t\tif ($row->$columnT != -1) {\n\t\t\t\t\t\t\t$cats = $cats + array($row->$columnT=>$row->$columnV);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$rules[$key] = $cats;\n\t\t\t}\n\t\t\t$query->free_result();\n\t\t}\n\t\t$rules['league_id'] = $league_id;\n\t\treturn $rules;\n\t}",
"public function getRRules()\n\t{\n\t\treturn $this->rrules;\n\t}",
"public function get_rules($league_id) {\n\t\n\t\t$league_id\t= $this->sanitize( $league_id );\n\t\t$data = $this->fetch(\"SELECT league, rules FROM `\" . $this->prefix . \"leagues` WHERE id = '$league_id'\");\n\t\tif( $data ) {\n\t\t\t$league = array(\n\t\t\t\t\t'league' => $data['0']['league'],\n\t\t\t\t\t'rules' => $data['0']['rules']\n\t\t\t);\n\t\t\treturn $league;\n\t\t}\n\t\n\t}",
"public function getValidationRules();",
"public function getRules()\n\t{\n\t\t$socket = $this->_getSocket();\n\t\t$packet = $this->_requestWithChallenge($socket, self::A2S_RULES, self::A2S_RULES_RESPONSE);\n\t\tif(empty($packet))\n\t\t\treturn array();\n\t\t\n\t\t$this->_raw = $packet;\n\t\t$count = $this->_getushort();\n\t\t$rules = array();\n\t\tfor($i = 0; $i < $count; $i++)\n\t\t{\n\t\t\t$name = $this->_getnullstr();\n\t\t\t$value = $this->_getnullstr();\n\t\t\t\n\t\t\tif(!empty($name))\n\t\t\t\t$rules[$name] = $value;\n\t\t}\n\t\t\n\t\tksort($rules);\n\t\treturn $rules;\n\t}",
"public function getRule();",
"public function getAppliedRules()\n {\n return $this->get(self::applied_rules);\n }",
"public function getRules()\n\t{\n\t\treturn $this->inputRules;\n\t}",
"public function getRules(): array\n {\n return $this->getSpec('rules');\n }",
"public function getPruralRules();",
"public function getLeagueTeamsMatches()\n {\n return $this->leagueTeamsMatches;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set option for field, that is not already chained. | public function setOption($field, $option, $value)
{
if (isset($this -> fields[$field][0]) && $this -> fields[$field][0] == 'chain') {
throw new \BadMethodCallException('Method setOption() does not work with chain rules!');
}
$this -> fields[$field][1][$option] = $value;
return $this;
} | [
"public function setOption($key, $value = null);",
"public function setOption($name, $value);",
"public function setOption($key, $value);",
"public function setOption($name, $value)\n {\n if ($name == 'cached_entity') {\n $this->setCachedEntity($value);\n } else {\n parent::setOption($name, $value);\n }\n }",
"public function testSetOption()\n\t{\n\t\t$this->options->expects($this->once())\n\t\t\t->method('set')\n\t\t\t->with('testkey', 'testvalue');\n\n\t\t$this->assertThat(\n\t\t\t$this->object->setOption('testkey', 'testvalue'),\n\t\t\t$this->equalTo($this->object)\n\t\t);\n\t}",
"public function testSetOption()\n {\n $this->setExpectedException('\\\\FurryBear\\\\Common\\\\Exception\\\\NotImplementedException');\n \n $this->proxy->expects($this->any())\n ->method('setOption')\n ->will($this->throwException(new \\FurryBear\\Common\\Exception\\NotImplementedException()));\n \n $this->proxy->setOption('name', 'value');\n }",
"public function testSetOption()\n\t{\n\t\t$this->object->setOption('key', 'value');\n\n\t\t$this->assertThat(\n\t\t\t$this->options->get('key'),\n\t\t\t$this->equalTo('value')\n\t\t);\n\t}",
"function _set_opt($option, $value)\n {\n @curl_setopt($this->handle_id, $option, $value);\n }",
"public function setOption($option, $value);",
"function setOption( &$option )\r\n {\r\n if ( is_a( $option, \"eZOption\" ) )\r\n {\r\n $this->OptionID = $option->id();\r\n }\r\n }",
"function setOption( &$option )\n {\n if ( get_class( $option ) == \"ezoption\" )\n {\n $this->OptionID = $option->id();\n }\n }",
"public function setDefault($field, $value);",
"public function setUninterpretedOption($var) {}",
"function addDefaultOption($field)\n\t{\n\t\tif(!$this->defaultBlank || $this->parent->data->get($field)) return;\n\t\t\n\t\tif(count($this->options) && !array_search(\"\", $this->options))\n\t\t{\n\t\t\t// want the blank at the top - array_merge causes issues; copy array instead\n\t\t\t$options[\"\"] = $this->defaultText;\n\t\t\tforeach($this->options as $key => $value)\n\t\t\t{\n\t\t\t\t$options[$key] = $value;\n\t\t\t}\n\t\t\t$this->options = $options;\n\t\t}\n\t}",
"public function setField(Field $field) {\n\t\t$this->field = $field; \n\t}",
"public function setOption ($option, $value){\n $this->guard();\n @ldap_set_option($option, $value);\n }",
"function setField(FormField $field) {\n\t\t$this->field = $field;\n\t}",
"public function setAdditionalCurlOpt($option, $value);",
"function acf_update_option($option = '', $value = '', $autoload = \\null) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CSS for Block Editor | public function blockEditorStyle()
{
wp_enqueue_style('td-editor-block-style', get_stylesheet_directory_uri() . td_asset_path('css/gutenberg.css'), [], null, 'screen');
} | [
"function plume_block_editor_styles() {\n\t// Enqueue the editor styles.\n\twp_enqueue_style('plume-block-editor-styles', get_theme_file_uri('/assets/css/editor-style-block.css'), array(), wp_get_theme()->get('Version'), 'all');\n\n\t// Add inline style from the Customizer.\n\t// wp_add_inline_style('plume-block-editor-styles', plume_get_customizer_css('block-editor'));\n\n\t// Enqueue the editor script.\n\twp_enqueue_script('plume-block-editor-script', get_theme_file_uri('/assets/js/editor-script-block.js'), array('wp-blocks', 'wp-dom'), wp_get_theme()->get('Version'), true);\n}",
"protected function get_block_type_editor_style() {\n\t\treturn null;\n\t}",
"function bitad_block_editor_styles()\n{\n\t// Enqueue the editor styles.\n\twp_enqueue_style('bitad-block-editor-styles', get_theme_file_uri('/assets/css/editor-style-block.css'), array(), wp_get_theme()->get('Version'), 'all');\n\t// wp_enqueue_style('fonts', get_template_directory_uri() . '/assets/css/fonts.css', null, $theme_version, 'all');\n\t// wp_enqueue_style('layout', get_template_directory_uri() . '/assets/css/layout.css', null, $theme_version, 'all');\n\t// wp_enqueue_style('typography', get_template_directory_uri() . '/assets/css/typography.css', null, $theme_version, 'all');\n}",
"function twentytwenty_block_editor_settings() {}",
"function my_custom_block_styles() {\n // register_block_style('core/table', [ 'name' => 'sample', 'label' => 'Sample Style' ]);\n}",
"function asp_block_editor_settings() {\n\n\t// Block Editor Palette.\n\t$editor_color_palette = array(\n array(\n 'name' => __( 'Purple', 'asp' ),\n 'slug' => 'uw-purple',\n 'color' => '#4b2e83',\n ),\n array(\n 'name' => __( 'White', 'asp' ),\n 'slug' => 'uw-white',\n 'color' => '#fff',\n ),\n array(\n 'name' => __( 'Gray', 'asp' ),\n 'slug' => 'uw-gray',\n 'color' => '#c9c9c9',\n ),\n array(\n 'name' => __( 'Dark Gray', 'asp' ),\n 'slug' => 'uw-gray-dark',\n 'color' => '#5A5A5A',\n ),\n array(\n 'name' => __( 'Menu Gray', 'asp' ),\n 'slug' => 'uw-gray-menu',\n 'color' => '#707070',\n ),\n array(\n 'name' => __( 'Link Blue', 'asp' ),\n 'slug' => 'uw-link',\n 'color' => '#0074bb',\n ),\n array(\n 'name' => __( 'Gold', 'asp' ),\n 'slug' => 'uw-gold',\n 'color' => '#b7a57a',\n ),\n array(\n 'name' => __( 'Light Gold', 'asp' ),\n 'slug' => 'uw-gold-light',\n 'color' => '#e8e3d3',\n ),\n array(\n 'name' => __( 'Dark Gold', 'asp' ),\n 'slug' => 'uw-gold-dark',\n 'color' => '#85754d',\n ),\n array(\n 'name' => __( 'Bright Gold', 'asp' ),\n 'slug' => 'uw-gold-bright',\n 'color' => '#ffd800',\n ),\n array(\n 'name' => __( 'Black', 'asp' ),\n 'slug' => 'uw-black',\n 'color' => '#000000',\n ),\n );\n\n\tadd_theme_support( 'editor-color-palette', $editor_color_palette );\n\n}",
"function site_block_editor_styles() {\n wp_enqueue_style( 'site-block-editor-styles', get_theme_file_uri( 'css/editor-style.css' ), false, '1.0', 'all' );\n}",
"function site_block_editor_styles() {\n wp_enqueue_style( 'site-block-editor-styles', get_theme_file_uri( '/style-editor.css' ), false, '1.0', 'all' );\n}",
"function get_block_editor_theme_styles()\n {\n }",
"function generate_block_editor_styles_html() {\n\t$handles = array(\n\t\t'wp-block-editor',\n\t\t'wp-block-library',\n\t\t'wp-edit-blocks',\n\t);\n\n\t$block_registry = \\WP_Block_Type_Registry::get_instance();\n\n\tforeach ( $block_registry->get_all_registered() as $block_type ) {\n\t\tif ( ! empty( $block_type->style ) ) {\n\t\t\t$handles[] = $block_type->style;\n\t\t}\n\n\t\tif ( ! empty( $block_type->editor_style ) ) {\n\t\t\t$handles[] = $block_type->editor_style;\n\t\t}\n\t}\n\n\t$handles = array_unique( $handles );\n\t$done = wp_styles()->done;\n\n\tob_start();\n\n\twp_styles()->done = array();\n\twp_styles()->do_items( $handles );\n\twp_styles()->done = $done;\n\n\twp_add_inline_script(\n\t\t'wporg-pattern-script',\n\t\tsprintf(\n\t\t\t'window.__editorStyles = JSON.parse( decodeURIComponent( \\'%s\\' ) );',\n\t\t\trawurlencode( wp_json_encode( array( 'html' => ob_get_clean() ) ) )\n\t\t),\n\t\t'before'\n\t);\n}",
"function udesign_dynamic_block_editor_styles() {\r\n\r\n\tglobal $udesign_options;\r\n\r\n\t$general_font_family = preg_replace( '/:.*/','', $udesign_options['general_font_family'] );\r\n\t$headings_font_family = preg_replace( '/:.*/','', $udesign_options['headings_font_family'] );\r\n\tob_start();\r\n\t?>\r\n\t/**\r\n\t * U-Design dynamic block editor styles.\r\n\t */\r\n\t.editor-styles-wrapper, .editor-styles-wrapper p {\r\n\t\tfont-family:'<?php echo $general_font_family; ?>';\r\n\t\tfont-weight: <?php echo udesign_block_editor_parse_font_variants('general', 'weight'); ?>;\r\n\t\tfont-style: <?php echo udesign_block_editor_parse_font_variants('general', 'style'); ?>;\r\n\t\tfont-size: <?php echo $udesign_options['general_font_size']; ?>px;\r\n\t\tline-height: <?php echo $udesign_options['general_font_line_height']; ?>;\r\n\t}\r\n\t.editor-styles-wrapper .has-small-font-size { font-size: <?php echo ( $udesign_options['general_font_size'] - 2 ); ?>px; }\r\n\t.editor-styles-wrapper .has-normal-font-size { font-size: <?php echo $udesign_options['general_font_size']; ?>px; }\r\n\t.editor-styles-wrapper .has-medium-font-size { font-size: <?php echo ( $udesign_options['general_font_size'] + 4 ); ?>px; }\r\n\t.editor-styles-wrapper .has-large-font-size { font-size: <?php echo ( $udesign_options['general_font_size'] + 20 ); ?>px; }\r\n\t.editor-styles-wrapper .has-larger-font-size { font-size: <?php echo ( $udesign_options['general_font_size'] + 34 ); ?>px; }\r\n\t.editor-styles-wrapper .wp-block-pullquote blockquote { font-family:'<?php echo $general_font_family; ?>'; }\r\n\r\n\t.editor-styles-wrapper h1, .editor-styles-wrapper h2, .editor-styles-wrapper h3, .editor-styles-wrapper h4, .editor-styles-wrapper h5, .editor-styles-wrapper h6 {\r\n\t\tfont-family:'<?php echo $headings_font_family; ?>';\r\n\t\tline-height: <?php echo $udesign_options['headings_font_line_height']; ?>;\r\n\t\tfont-weight: <?php echo udesign_block_editor_parse_font_variants('headings', 'weight'); ?>;\r\n\t\tfont-style: <?php echo udesign_block_editor_parse_font_variants('headings', 'style'); ?>;\r\n\t}\r\n\t<?php // Overwrite Indivisual Headings. ?>\r\n\t<?php if ( isset($udesign_options['heading1_font_settings_enabled']) && $udesign_options['heading1_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h1 { font-family:'<?php echo $udesign_options['heading1_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading1', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading1', 'style'); ?>; font-size:<?php echo $udesign_options['heading1_font_size']; ?>em; line-height:<?php echo $udesign_options['heading1_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php if ( isset($udesign_options['heading2_font_settings_enabled']) && $udesign_options['heading2_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h2 { font-family:'<?php echo $udesign_options['heading2_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading2', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading2', 'style'); ?>; font-size:<?php echo $udesign_options['heading2_font_size']; ?>em; line-height:<?php echo $udesign_options['heading2_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php if ( isset($udesign_options['heading3_font_settings_enabled']) && $udesign_options['heading3_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h3 { font-family:'<?php echo $udesign_options['heading3_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading3', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading3', 'style'); ?>; font-size:<?php echo $udesign_options['heading3_font_size']; ?>em; line-height:<?php echo $udesign_options['heading3_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php if ( isset($udesign_options['heading4_font_settings_enabled']) && $udesign_options['heading4_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h4 { font-family:'<?php echo $udesign_options['heading4_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading4', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading4', 'style'); ?>; font-size:<?php echo $udesign_options['heading4_font_size']; ?>em; line-height:<?php echo $udesign_options['heading4_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php if ( isset($udesign_options['heading5_font_settings_enabled']) && $udesign_options['heading5_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h5 { font-family:'<?php echo $udesign_options['heading5_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading5', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading5', 'style'); ?>; font-size:<?php echo $udesign_options['heading5_font_size']; ?>em; line-height:<?php echo $udesign_options['heading5_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php if ( isset($udesign_options['heading6_font_settings_enabled']) && $udesign_options['heading6_font_settings_enabled'] == \"yes\" ) : ?>\r\n\t\t.editor-styles-wrapper h6 { font-family:'<?php echo $udesign_options['heading6_font_family']; ?>'; font-weight: <?php echo udesign_block_editor_parse_font_variants('heading6', 'weight'); ?>; font-style: <?php echo udesign_block_editor_parse_font_variants('heading6', 'style'); ?>; font-size:<?php echo $udesign_options['heading6_font_size']; ?>em; line-height:<?php echo $udesign_options['heading6_font_line_height']; ?>; }\r\n\t<?php endif; ?>\r\n\t<?php \r\n\t$editor_css = ob_get_clean();\r\n\t\r\n\treturn apply_filters( 'udesign_dynamic_block_editor_styles', $editor_css );\r\n}",
"public function removeBlockEditorCss(): self\n {\n static::stopIfAdminPage();\n\n add_action('wp_enqueue_scripts', static function () {\n wp_dequeue_style('wp-block-library');\n wp_dequeue_style('wp-block-library-theme');\n wp_dequeue_style('wc-block-style');\n });\n\n return $this;\n }",
"private function convertBlocksToCSS(){\n\t\tforeach($this->blocks as $block){\n\t\t\tif(!isset($block['contents']) || !$block['contents']) continue;\n\t\t\tforeach($block['names'] as $i=>$name){\n\t\t\t\tif($i) $this->file .= ', ';\n\t\t\t\t$this->file .= $name;\n\t\t\t}\n\t\t\t$this->file .= ' {' . PHP_EOL;\n\t\t\tforeach($block['contents'] as $i=>$content){\n\t\t\t\tif($i) $this->file .= PHP_EOL;\n\t\t\t\t$this->file .= \"\\t\".$content;\n\t\t\t}\n\t\t\t$this->file .= PHP_EOL .'}' . PHP_EOL;\n\t\t}\n\t}",
"function amp_editor_core_blocks() {\n\t$editor_blocks = new AMP_Editor_Blocks();\n\t$editor_blocks->init();\n}",
"public static function block_editor_assets() {\n\t\t$version = FrmAppHelper::plugin_version();\n\n\t\twp_register_script(\n\t\t\t'formidable-form-selector',\n\t\t\tFrmAppHelper::plugin_url() . '/js/formidable_blocks.js',\n\t\t\tarray( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor' ),\n\t\t\t$version,\n\t\t\ttrue\n\t\t);\n\n\t\t$icon = str_replace( 'dashicons-', '', apply_filters( 'frm_icon', 'svg' ) );\n\t\t$block_name = FrmAppHelper::get_menu_name();\n\t\tif ( $block_name === 'Formidable' ) {\n\t\t\t$block_name = 'Formidable Forms';\n\t\t}\n\n\t\t$script_vars = array(\n\t\t\t'forms' => self::get_forms_options(),\n\t\t\t'icon' => $icon,\n\t\t\t'name' => $block_name,\n\t\t);\n\n\t\twp_localize_script( 'formidable-form-selector', 'formidable_form_selector', $script_vars );\n\t\tif ( function_exists( 'wp_set_script_translations' ) ) {\n\t\t\twp_set_script_translations( 'formidable-form-selector', 'formidable' );\n\t\t}\n\n\t\twp_enqueue_style(\n\t\t\t'formidable_block-editor-css',\n\t\t\tFrmAppHelper::plugin_url() . '/css/frm_blocks.css',\n\t\t\tarray( 'wp-edit-blocks' ),\n\t\t\t$version\n\t\t);\n\t}",
"function gucci_block_editor_assets() {\n\twp_enqueue_style(\n\t\t'gucci-editor-styles',\n\t\tget_stylesheet_directory_uri() . \"/library/dist/css/block-styles.css\",\n\t\tarray(),\n\t\t'1.0'\n\t);\n}",
"function exodus_block_editor_head_styles() {\n\n\t// Colors.\n\t$main_color = ctfw_customization( 'main_color' );\n\t$link_color = ctfw_customization( 'link_color' );\n\n\t// Fonts.\n\t$heading_font_stack = ctfw_font_stack( ctfw_customization( 'heading_font' ), ctfw_google_fonts( 'heading_font' ) );\n\t$body_font_stack = ctfw_font_stack( ctfw_customization( 'body_font' ), ctfw_google_fonts( 'body_font' ) );\n\n?>\n<style type=\"text/css\">\n\n<?php echo exodus_block_editor_style_selectors( 'heading_font' ); ?> {\n\tfont-family: <?php echo $heading_font_stack; ?>;\n}\n\n<?php echo exodus_block_editor_style_selectors( 'body_font' ); ?> {\n\tfont-family: <?php echo $body_font_stack; ?>;\n}\n\n<?php echo exodus_block_editor_style_selectors( 'main_color' ); ?> {\n\tbackground-color: <?php echo $main_color; ?>;\n}\n\n<?php echo exodus_block_editor_style_selectors( 'main_color_border' ); ?> {\n\tborder-color: <?php echo $main_color; ?> !important;\n}\n\n<?php echo exodus_block_editor_style_selectors( 'link_color' ); ?> {\n\tcolor: <?php echo $link_color; ?>;\n}\n\n</style>\n<?php\n\n}",
"function wp_use_widgets_block_editor()\n {\n }",
"function genesis_sample_custom_gutenberg_admin_css() {\n\n\t$block_editor_settings = genesis_get_config( 'block-editor-settings' );\n\n\t$css = <<<CSS\n.ab-block-post-grid .ab-post-grid-items h2 a:hover,\n.block-editor__container .editor-block-list__block a {\n\tcolor: {$block_editor_settings['default-link-color']};\n}\n\n.editor-styles-wrapper .editor-rich-text .button,\n.editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-background) {\n\tbackground-color: {$block_editor_settings['default-button-bg']};\n\tcolor: {$block_editor_settings['default-button-color']};\n}\n\n.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link {\n\tcolor: {$block_editor_settings['default-button-bg']};\n}\n\n.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:focus,\n.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:hover {\n\tcolor: {$block_editor_settings['default-button-outline-hover']};\n}\nCSS;\n\n\twp_add_inline_style( 'genesis-sample-gutenberg-fonts', $css );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test find By Index | public function testFindByIndex()
{
$users = User::findByIndex('userAge', 24, 37);
$this->assertCount(3, $users);
foreach ($users as $user) {
$this->assertInstanceOf('sweelix\yii2\nosql\riak\ActiveRecord', $user);
}
} | [
"public function testIndexOf()\n {\n $this->assertEquals(1, $this->object->indexOf('456'));\n }",
"public function testIndexOf() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::indexOf($array, 4);\n\t\t$this->assertEquals(3, $result);\n\n\t\t// test not finding an element's index\n\t\t$result = _::indexOf($array, 6);\n\t\t$this->assertEquals(-1, $result);\n\t}",
"function searchIndex( $data, $method )\n\t{\n\t\tif( empty($method) )\n\t\t\treturn -1;\n\n\t\t//debug_print( 'size', $this->size() );\n\t\tfor( $i=0; $i<$this->count(); $i++ ) {\n\t\t\t$obj =& $this->Get($i);\n\t\t\t//debug_print( 'obj', $obj );\n\t\t\tif( method_exists($obj, $method) ) {\n\t\t\t\tif( $obj->$method()==$data )\n\t\t\t\t\treturn $i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"public function has($index);",
"function getByIndex($index)\n {\n }",
"public function testIndexOfSimple(): void\n {\n // Test simple array.\n $data = ['test1', 'test2', 'test3'];\n $this->assertSame(1, Arr::indexOf($data, 'test2'));\n }",
"function _findMatchIndex($pos,&$s,&$p,&$o,$ind,$off){\r\n\t\t$match=-1;\r\n\t\tif (!isset($this->indexArr[$ind][$pos])) {\r\n\t\t\treturn $match;}\r\n\t\t\tforeach($this->indexArr[$ind][$pos] as $key =>$value){\r\n\t\t\t\t$t=$this->triples[$value];\r\n\t\t\t\tif ($this->matchStatement($t,$s,$p,$o)){\r\n\t\t\t\t\tif($off <= $value){\r\n\t\t\t\t\t\t$match= $value;\r\n\t\t\t\t\t\treturn $match;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $match;\r\n\r\n\t}",
"public function shouldIndex();",
"public function testFindNextReturnsIndexOfFirstMatch()\n {\n $analyzer = $this->create(array('1', '2', '2'));\n $this->assertEquals(1, $analyzer->findNext('2', 0));\n }",
"public function testFind()\n {\n // Start of user code AssociativeArrayTest.testfind\n $associativeArray = new AssociativeArray('string');\n $associativeArray->set('foo', 'bar');\n $associativeArray->set('foo2', 'bar');\n $associativeArray->set('foo3', 'bar');\n\n $expectedResult = new AssociativeArrayFindResult();\n $expectedResult->setKey('foo');\n $expectedResult->setResult(true);\n \n $this->assertEquals($expectedResult, $associativeArray->find('bar'));\n \n $expectedResult = new AssociativeArrayFindResult(); \n $expectedResult->setResult(false);\n \n $this->assertEquals($expectedResult, $associativeArray->find('unknown'));\n // End of user code\n }",
"public function hasIndex($index);",
"public function hasItem($index);",
"function testAt($index)\r\n\t{\r\n\t\tif (!isset($this->tests[$index]))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn $this->tests[$index];\r\n\t}",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"abstract public function find($criterion);",
"function findFirstMatchOff($subject,$predicate, $object,$off) {\r\n\r\n\t\tif (\r\n\t\t(!is_a($subject, 'Resource') && $subject != NULL) ||\r\n\t\t(!is_a($predicate, 'Resource') && $predicate != NULL) ||\r\n\t\t(!is_a($object, 'Node') && $object != NULL)\r\n\t\t) {\r\n\t\t\t$errmsg = RDFAPI_ERROR . '(class: MemModel; method: find): Parameters must be subclasses of Node or NULL';\r\n\t\t\ttrigger_error($errmsg, E_USER_ERROR);\r\n\t\t}\r\n\r\n\t\t$match=-1;\r\n\t\t$ind=$this->indexed;\r\n\t\tif($subject == NULL && $predicate == NULL && $object == NULL)\r\n\t\t{\r\n\t\t\tforeach ($this->triples as $key => $statement)\r\n\t\t\t{\r\n\t\t\t\tif ($key >= $off)\r\n\t\t\t\t\treturn $key;\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\tswitch($ind){\r\n\t\t\tcase 1:\r\n\t\t\tif($subject!=NULL && $predicate != NULL && $object != NULL){\r\n\t\t\t\t$pos=$subject->getLabel().$predicate->getLabel().$object->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,1,$off);\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase 2:\r\n\t\t\tif($subject!=NULL && $predicate != NULL){\r\n\t\t\t\t$pos=$subject->getLabel().$predicate->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,2,$off);\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase 3:\r\n\t\t\tif($subject!=NULL && $object != NULL){\r\n\t\t\t\t$pos=$subject->getLabel().$object->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,3,$off);\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase 0:\r\n\t\t\tif($subject!= null){\r\n\t\t\t\t$pos=$subject->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,4,$off);\r\n\t\t\t}\r\n\t\t\tif($predicate!= null){\r\n\t\t\t\t$pos=$predicate->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,5,$off);\r\n\t\t\t}\r\n\t\t\tif($object!= null){\r\n\t\t\t\t$pos=$object->getLabel();\r\n\t\t\t\treturn $this->_findMatchIndex($pos,$subject,$predicate,$object,6,$off);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t// if no index: linear search\r\n\t\tforeach($this->triples as $key => $value){\r\n\t\t\tif ($this->matchStatement($value, $subject, $predicate, $object)){\r\n\t\t\t\tif($off<=$key){\r\n\t\t\t\t\t$match=$key;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $match;\r\n\t}",
"public function selectByIndex($index);",
"function get_row_by_index($index){\n\t\tif ($index>$this->numrows) return false;\n\t\telse{\n\t\t\tforeach ($this->res as $key => $val) {\n\t\t\t\t$this->row[$key]=$this->res[$key][$index];\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}",
"public function testObjSearch()\n {\n $data = [\n new Student('Alice'),\n new Student('Tom'),\n new Student('Jack'),\n ];\n $target = new Student('Tom');\n $this->assertNotSame(-1, LinearSearch::search($data, $target));\n $this->assertNotSame(-1, LinearSearch::search($data, new Student('xiaoLi')), \"没有找到哦\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update round status after round is cleared | public function clearRound() {
$connMgr = new ConnectionManager();
$pdo = $connMgr->getConnection();
$successfulBids = new StudentSectionDAO();
$roundDetails = $this->retrieveRoundDetail();
$round = $roundDetails->getRoundID();
if ($round == 1){
$addRound = 'roundID = 2, ';
$newStatus = 'roundStatus = "Not Started", ';
}elseif ($round == 2){
$addRound = ' ';
$newStatus = 'roundStatus = "Finished", ';
}
$sql = "update ADMIN_ROUND set {$addRound} {$newStatus} r{$round}End = CURRENT_TIMESTAMP";
$stmt = $pdo->prepare($sql);
$status = ($stmt->execute());
$stmt->closeCursor();
$pdo = null;
return $status;
} | [
"public function saveRound()\n {\n if (in_array(1, $this->values) == false) {\n $this->sumTotal += $this->sumRound;\n $this->initRound();\n }\n }",
"private function updateRoundCount() : void\n {\n $this->rounds = $this->matchDays->count();\n }",
"public function updateNumRound()\n {\n \t\t\tif($SeaId != SeaType::SEA_4)\n\t\t\t{\n $RId = 1 ;\n foreach($this->Monster as $RoundId => $arr)\n {\n if(empty($arr))\n {\n $RId++ ; \n }\n }\n\n \n $RId = $RId > count($this->Monster)?count($this->Monster): $RId ;\n \n if($this->RoundNum != $RId)\n {\n $this->RoundNum = $RId ;\n Zf_log::write_act_log(Controller::$uId,0,15,'nextRound',0,0,$this->SeaId,$RId);\n }\n}\n \n }",
"public function restoreRound($modelRound );",
"public function clearMatchesForRound(int $round) : void\n {\n /** @var MatchDay[] $toRemove */\n $toRemove = $this->matchDays->filter(function (MatchDay $matchDay) use ($round) {\n return $matchDay->getNumber() === $round;\n });\n foreach ($toRemove as $matchDays) {\n $matchDays->clearMatches();\n }\n $this->updateRoundCount();\n }",
"public function initRound()\n {\n $this->sumRound = null;\n $this->serie = array();\n }",
"public function finishAllRounds()\n {\n $this->load('games');\n foreach ($this->games as $game) {\n $game->rounds()->update(['status' => 'finished']);\n }\n }",
"public function decreaseRounds()\n\t{\n\t\t$this->attributes['round'] = $this->getRoundAttribute() - 1;\n\t}",
"public function updateroundstatus() {\n $sco = new Scores();\n $iroun = new interviewrounds();\n $ir = $iroun->get_ir($_POST['roundid']);\n $roun = new Rounds();\n $sco->update_round_status($ir[0]['id']);\n //send notification mail for the selected candidates\n $admnctrlr = new AdminController();\n $admnctrlr->notification_mail($_POST['checkedusers'],$_REQUEST['id']);\n }",
"protected function startRound(): void\n {\n $this->round = $this->user->getActiveRound();\n\n if (null === $this->round) {\n $this->startNewRound();\n }\n }",
"public function setRound(Round $round)\n {\n $this->round = $round;\n }",
"function onEndRound();",
"public function processRound($round)\n {\n $this->currentProcessedRound = $round;\n\n foreach ($round->ties as $tie) {\n $this->processTie($tie);\n }\n }",
"public function delete_round() {\n $delete = 1;\n $query = \"UPDATE `rounds` SET `soft_delete`= :soft_delete \" \n . \" WHERE `id` = :id\";\n $values = array(\n ':id' => $_POST['id'],\n ':soft_delete' => $delete\n );\n $this->query_execute($query, $values); \n }",
"public function IncreaseRounds(){\n $this->rounds++;\n }",
"public function resetCount()\n {\n $this->floorCount = 0;\n }",
"public function ajaxProcessEditRoundingSettings()\n {\n /** @var PayPalConfiguration $paypalConfiguration */\n $paypalConfiguration = $this->module->getService('ps_checkout.paypal.configuration');\n $paypalConfiguration->setRoundType(RoundingSettings::ROUND_ON_EACH_ITEM);\n $paypalConfiguration->setPriceRoundMode(RoundingSettings::ROUND_UP_AWAY_FROM_ZERO);\n\n $this->ajaxDie(json_encode(true));\n }",
"public function removeRound($round)\n {\n try {\n $this->getEntityManager()->remove($round);\n $this->getEntityManager()->flush();\n return true;\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n return false;\n }\n }",
"function endRound() {\n\n\t\t$this->console_text('End Round');\n\t\t$this->releaseEvent('onEndRound', null);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
try and find a logo (images are in the data directory) | function find_logo($party_name){
$return = false;
$logos_dir = dirname(__FILE__) . "/data/party_logos/";
for ($i=1; $i < 4; $i++) {
$test_file = $logos_dir . $party_name . '_' . $i . '.gif';
if (file_exists($test_file)){
$return = $test_file;
break;
}
}
return $return;
} | [
"function get_logo() {\n return File::exists('assets/images/logo-user.png')\n ? asset('assets/images/logo-user.png')\n : asset('assets/images/logo-default.png');\n }",
"function haLogo()\n {\n if (empty($this->url_logo)) {\n return false;\n }\n\n if (!file_exists(__DIR__ . \"/../../{$this->url_logo}\")) {\n Notifica::accoda('immagine logo inesistente', Notifica::TIPO_AVVERTENZA);\n return false;\n }\n\n return true;\n }",
"private function get_company_logo()\n {\n }",
"public function getLogoPath() {\n\t\t$matchingFiles = vBuilder\\Utils\\FileSystem::findFilesWithBaseName(\n\t\t\t\tFILES_DIR . '/logo',\n\t\t\t\tarray('jpg', 'png', 'gif', 'svg')\n\t\t);\n\n\t\tif(count($matchingFiles) == 0) return null;\n\t\tlist($logoFile) = $matchingFiles;\n\t\t\n\t\treturn $logoFile;\n\t}",
"function _fetchLogo()\n {\n $this->_fetchProperty(XML_FOAF_NS, 'logo', 'uri');\n }",
"public function testDefaultFinderImage(): void\n {\n $url = 'http://domains.tld/image.png';\n $finder = new DefaultFinder('', $url, [], []);\n $this->assertEquals($url, $finder->find());\n\n $url = 'http://domains.tld/image.JPG';\n $finder = new DefaultFinder('', $url, [], []);\n $this->assertEquals($url, $finder->find());\n\n $url = 'http://domains.tld/image.svg';\n $finder = new DefaultFinder('', $url, [], []);\n $this->assertEquals($url, $finder->find());\n }",
"protected function logoExists()\n {\n return Storage::exists($this->salon()->logo) && $this->salon()->logo != 'public/logos/default.png';\n }",
"public function getLogoPrincipal(){\n $imgPath = getcwd().'/public/'.$this->_logoPrincipal;\n if (is_file($imgPath)){ \n return '<img src=\"'.$this->_logoPrincipal.'\" \n \t\t\t\t\t\t\t style=\"border-radius: 10px; margin-left: 2px; margin-right: 10px;\" />';\n }\n else {\n return '<div style=\"background-color: #fafafa; border-radius: 10px; color: #666666; float: left; font-size: 12px; \n line-height: 18px; margin-left: 2px; margin-right: 10px; padding: 15px 5px; \n text-align: center; width: 120px;\">\n Logo não encontrada\n </div>';\n }\n }",
"function get_logo() : array {\n\t\treturn registry_get( 'logo' )->get_custom_logo();\n\t}",
"function test_no_takeaway_logo()\n\t{\n\t\t$result = $this->takeaways->getLogo($this->takeawayId);\n\t\t\n\t\tif ($result)\n\t\t\t$this->_assert_equals($result, 'images/nologo.gif');\n\t\telse\n\t\t\t$this->_fail();\n\t}",
"function load_admin_logo($logo)\n{\t\t\n\tif($logo != '' && file_exists('./'.$logo))\n\t\treturn asset_url().$logo;\n\telse\n\t\treturn asset_url().\"images/admin/logo.png\";\n}",
"private function validateLogo($logo)\n {\n // Check if logo image file does not exist. If yes, throw an exception.\n if (!file_exists($logo)) {\n throw new Exception('File does not exist.');\n }\n\n // Get the file extension\n $logoFileExtension = pathinfo($logo, PATHINFO_EXTENSION);\n\n // Validate the file extension\n if (!in_array($logoFileExtension, $this->allowedLogoExtensions)) {\n throw new Exception('The logo is not in PNG format.');\n }\n\n // Return the image (Validation success)\n return $logo;\n }",
"public function testGetLogo()\n {\n $this->assertEquals(\n self::$testLogo,\n $this->researchGroup->getLogo()\n );\n }",
"public function getFullLogo()\n {\n if(file_exists(Yii::getAlias(\"@webroot/images/targets/\".$this->name.\".png\")))\n {\n return '/images/targets/'.$this->name.'.png';\n }\n\n return self::DEFAULT_LOGO;\n }",
"public static function siteLogo()\n\t{\n\t\t$custom_logo_id = get_theme_mod( 'custom_logo' );\n\t\t$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );\n\t\t//print_r($image);\n\t\t//break;\n\t\treturn $image[0];\n\t}",
"function app_logo()\n {\n if (($model = Settings::instance('logo')) && $file = $model->getFirstMediaUrl('logo')) {\n return $file;\n }\n\n return 'https://ui-avatars.com/api/?name='.rawurldecode(config('app.name')).'&bold=true';\n }",
"function eatlases_get_organisation_logo($organisation_id) {\n\t$organisation = node_load($organisation_id);\n\tif ($organisation && property_exists($organisation, 'nid') && isset($organisation->field_logos[LANGUAGE_NONE])) {\n\t\t$linked_logos = array();\n\t\t$org_nid = $organisation->nid;\n\t\t$org_logos = $organisation->field_logos[LANGUAGE_NONE];\n\t\tif ($org_logos) {\n\t\t\t// Return the last logo:\n\t\t\t// Go through all logos, starting from the last one,\n\t\t\t// and return the first one that works.\n\t\t\tforeach (array_reverse($org_logos) as $delta => $org_logo) {\n\t\t\t\t$linked_logo = NULL;\n\t\t\t\tif (isset($org_logo['uri']) && file_exists($org_logo['uri'])) {\n\t\t\t\t\tif (module_exists('eatlas_media_frame_filter')) {\n\t\t\t\t\t\t$linked_logo = eatlas_media_frame_decorate(\n\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t'#item' => $org_logo\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'showMetadata' => false,\n\t\t\t\t\t\t\t\t'styleName' => 'm_logo',\n\t\t\t\t\t\t\t\t'media_style' => 'none'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\turl('node/' . $org_nid),\n\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\tFALSE\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$linked_logo = l('<img src=\"' . image_style_url('m_small', $org_logo['uri']) . '\" />', 'node/' . $org_nid, array('html' => TRUE));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($linked_logo) {\n\t\t\t\t\treturn $linked_logo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}",
"public function getLogoImg()\n {\n return $this->hasOne(File::className(), ['object_id' => 'id'])\n ->onCondition(['object_model' => self::className(), 'object_field' => 'logo']);\n }",
"public function getLogoImage()\n {\n return ($this->driver->photo) ? : $this->getDefaultLogo();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove unused admin bar items | function remove_unused_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu( 'wp-logo' );
$wp_admin_bar->remove_menu( 'about' );
$wp_admin_bar->remove_menu( 'wporg' );
$wp_admin_bar->remove_menu( 'documentation' );
$wp_admin_bar->remove_menu( 'support-forums' );
$wp_admin_bar->remove_menu( 'feedback' );
$wp_admin_bar->remove_menu( 'view-site' );
$wp_admin_bar->remove_menu( 'comments' );
$wp_admin_bar->remove_menu( 'updates' );
$wp_admin_bar->remove_menu( 'new-content' );
} | [
"public function remove_admin_bar_items() {\n\t\t\tglobal $wp_admin_bar;\n\n\t\t\tforeach ( $this->admin_bar as $ab_item ) {\n\t\t\t\t$wp_admin_bar->remove_node( $ab_item );\n\t\t\t}\n\n\t\t}",
"public function cleanAdminBar()\n\t{\n\t\tglobal $wp_admin_bar;\n\n\t\t$wp_admin_bar->remove_menu('wp-logo'); // Remove the WordPress logo\n\t\t$wp_admin_bar->remove_menu('about'); // Remove the about WordPress link\n\t\t$wp_admin_bar->remove_menu('wporg'); // Remove the about WordPress link\n\t\t$wp_admin_bar->remove_menu('documentation'); // Remove the WordPress documentation link\n\t\t$wp_admin_bar->remove_menu('support-forums'); // Remove the support forums link\n\t\t$wp_admin_bar->remove_menu('feedback'); // Remove the feedback link\n\t\t$wp_admin_bar->remove_menu('updates'); // Remove the updates link\n\t\t$wp_admin_bar->remove_menu('comments'); // Remove the comments link\n\t}",
"public function remove_admin_bar_items() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu(\"comments\");\n }",
"function remove_admin_bar() {\n\tshow_admin_bar(false);\n}",
"function clean_admin_bar() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('wp-logo');\n // $wp_admin_bar->remove_menu('customize');\n $wp_admin_bar->remove_menu('updates');\n $wp_admin_bar->remove_menu('comments');\n $wp_admin_bar->remove_menu('itsec_admin_bar_menu');\n $wp_admin_bar->remove_menu('wpseo-menu');\n}",
"function remove_admin_bar() {\n\n show_admin_bar( false );\n\n}",
"function th_remove_admin_bar_items()\n{\n global $wp_admin_bar;\n\n $wp_admin_bar->remove_menu('wp-logo');\n $wp_admin_bar->remove_menu('about');\n $wp_admin_bar->remove_menu('wporg');\n $wp_admin_bar->remove_menu('documentation');\n $wp_admin_bar->remove_menu('support-forums');\n $wp_admin_bar->remove_menu('feedback');\n //$wp_admin_bar->remove_menu('view-site');\n //$wp_admin_bar->remove_menu('updates');\n //$wp_admin_bar->remove_menu('my-account');\n //$wp_admin_bar->remove_menu('site-name');\n //$wp_admin_bar->remove_menu('my-sites');\n //$wp_admin_bar->remove_menu('get-shortlink');\n //$wp_admin_bar->remove_menu('edit');\n $wp_admin_bar->remove_menu('new-content');\n $wp_admin_bar->remove_menu('comments');\n //$wp_admin_bar->remove_menu('search');\n //$wp_admin_bar->remove_menu('my-account-with-avatar');\n //$wp_admin_bar->remove_menu('edit-profile');\n //$wp_admin_bar->remove_menu('logout');\n\n}",
"public function remove_unnecessary_link_admin_bar() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('wp-logo');\n $wp_admin_bar->remove_menu('about');\n $wp_admin_bar->remove_menu('wporg');\n $wp_admin_bar->remove_menu('documentation');\n $wp_admin_bar->remove_menu('support-forums');\n $wp_admin_bar->remove_menu('feedback');\n $wp_admin_bar->remove_menu('view-site');\n }",
"function lm_simplify_admin_bar() {\n\tglobal $wp_admin_bar;\n\n\tif ( !$wp_admin_bar || !method_exists( $wp_admin_bar, 'remove_node' ) ) {\n\t\treturn;\n\t}\n\n\t$wp_admin_bar->remove_node( 'wp-logo' );\n\t$wp_admin_bar->remove_node( 'comments' );\n\t$wp_admin_bar->remove_node( 'themes' );\n\t$wp_admin_bar->remove_node( 'customize' );\n}",
"function bv_remove_admin_bar_items() {\r\n\tglobal $wp_admin_bar;\r\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\r\n}",
"function m3_remove_admin_bar_items() {\r\n\tglobal $wp_admin_bar;\r\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\r\n\t$wp_admin_bar->remove_menu( 'new-media', 'new-content' );\r\n}",
"function be_admin_bar_items() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\n}",
"function remove_admin_menu_items() {\n /**\n * Check has user \"Show all admin menu items\" checked in their profile.\n */\n $allow_all_menu_items = get_user_option( '_meom_dodo_allow_all_menu_items', get_current_user_id() );\n\n if ( $allow_all_menu_items ) {\n return;\n }\n\n /**\n * Filters the hidden admin menu items.\n *\n * @param array $removed_admin_menu_items Default hidden admin menu items.\n */\n $removed_admin_menu_items =\n \\apply_filters(\n 'meom_dodo_removed_admin_menu_items',\n [\n 'plugins.php',\n 'edit.php?post_type=acf-field-group',\n 'edit-comments.php',\n 'themes.php',\n ]\n );\n\n foreach ( $removed_admin_menu_items as $removed_admin_menu_item ) {\n remove_menu_page( \\esc_attr( $removed_admin_menu_item ) );\n }\n\n // Add nav back as top level menu item.\n add_menu_page( \\esc_html__( 'Menus', 'meom-dodo' ), \\esc_html__( 'Menus', 'meom-dodo' ), 'manage_options', 'nav-menus.php', '', 'dashicons-menu', 25 );\n}",
"function remove_admin_bar() {\n if (!current_user_can('administrator') && !is_admin()) {\n show_admin_bar(FALSE);\n }\n }",
"function remove_admin_bar() {\n if (!current_user_can('administrator') && !is_admin()) {\n show_admin_bar(false);\n }\n }",
"function remove_admin_bar() {\nif (!current_user_can('administrator') && !is_admin()) {\n show_admin_bar(false);\n}\n}",
"function wce_admin_bar_render() {\r\nglobal $wp_admin_bar;\r\n $wp_admin_bar->remove_menu('wp-logo');\r\n $wp_admin_bar->remove_menu('updates');\r\n $wp_admin_bar->remove_menu('comments');\r\n $wp_admin_bar->remove_menu('new-content');\r\n\r\n}",
"function remove_admin_bar_except_admins()\n{\n if (!current_user_can('administrator') && !is_admin()) {\n show_admin_bar(false);\n }\n}",
"protected function removeToolbar()\n {\n add_filter('show_admin_bar', '__return_false');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array containing the compiled routing information based off of the provided resource objects. !!! WARNING !!! This will use the cached version of the table if available without checking for updates. It is the end users job to ensure that this cache file is kept updated. | public function getRoutingTable(array $resources)
{
if (($table = $this->cache->get("router"))) {
return $table;
}
$table = array(
"static" => array(),
"dynamic" => array()
);
foreach ($resources as $resourceName) {
$routes = $this->buildRoutingTableEntryForResource($resourceName);
$table["static"] += $routes["static"];
$table["dynamic"] += $routes["dynamic"];
}
return $table;
} | [
"public function buildRoutingTableEntryForResource($resourceName)\n {\n $table = array(\n \"static\" => array(),\n \"dynamic\" => array()\n );\n\n $urlTools = $this->urlTools;\n $reflection = new ReflectionClass($resourceName);\n\n foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {\n /** @var ReflectionMethod $method */\n $comment = $method->getDocComment();\n if (strpos($comment, \"@route\") === false) {\n continue;\n }\n\n $metaData = $this->parseAnnotations($comment);\n $compiled = $urlTools->compile($metaData->uri, $metaData->conditions);\n $terminated = $urlTools->terminate($metaData->uri);\n $type = \"dynamic\";\n\n // If the route does not have any regex parameters we can optimise\n // its dispatch by putting it into the static portion of the table.\n // Note that we do not use the compiled form because it means we\n // can do a direct check on the static table without needing to make\n // superfluous calls to UrlTools::terminate() in the matcher.\n if ($compiled === $terminated) {\n $type = \"static\";\n $compiled = $metaData->uri;\n }\n\n // Only create table entries where necessary to avoid bloating\n // the table.\n if (!isset($table[$type][$compiled])) {\n $table[$type][$compiled] = array();\n $table[$type][$compiled][\"_name\"] = $reflection->name;\n }\n\n // Ensure that the method will be invoked after all other middleware\n $metaData->middleware[] = $method->name;\n\n $table[$type][$compiled][$metaData->method] = $metaData->middleware;\n }\n\n return $table;\n }",
"private static function getRoutingTable() {\n\t\tif (!isset(self::$cachedMap)) {\n\t\t\tself::$cachedMap = [];\n\n\t\t\tforeach (self::$map as $name => $controller) {\n\t\t\t\tself::$cachedMap[$name] = $controller->toArray();\n\t\t\t}\n\n\t\t\tif (self::$saveCache) {\n\t\t\t\t// save routing table to cache, because tried to load it unsuccessfully\n\t\t\t\t$map = serialize(self::$cachedMap);\n\n\t\t\t\tif ($map) {\n\t\t\t\t\t$fileName = Server::getCacheDir() . DIRECTORY_SEPARATOR . self::CACHE_FILE_NAME;\n\t\t\t\t\tfile_put_contents($fileName, $map);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::$cachedMap;\n\t}",
"public function buildRouteTable()\n {\n $this->includeAllPhpFiles($this->realm_root_path);\n\n $route_handlers = $this->fetchAllDefinedConcreteClassesOfType('Groundhog\\Router\\RouteHandlerInterface');\n\n $routing_table = array();\n\n foreach ($route_handlers as $class_name) {\n\n $class_reflect = new \\ReflectionClass($class_name);\n\n $execute_method_reflect = $class_reflect->getMethod('execute');\n\n foreach ($this->extractRoutesFromMethodHeader($execute_method_reflect->getDocComment()) as $arr_method_route) {\n\n // Trim off any trailing slashes (TODO in the future, this will likely be modified to allow distinctions between with-trailing-slash and without)\n $arr_method_route['request_route'] = rtrim($arr_method_route['request_route'], '/');\n\n // Generate a regular expression that would match this extracted route\n list($route_regex, $arr_parameter_order) = $this->generateRegexFromRoute($arr_method_route['request_route']);\n\n $routing_table[] = new Route(\n $this->getRouteType($arr_method_route['request_route']),\n $arr_method_route['request_method'],\n $route_regex,\n $class_name,\n serialize($arr_parameter_order),\n $arr_method_route['request_route']\n );\n }\n }\n\n return $routing_table;\n }",
"private function generate_routing_arrays() {\n $this->context .= \"\\$routing = array(\\n\";\n $this->context .= \"\\t'GET' => array(\\n\";\n foreach ($this->routing['GET'] as $uri => $method_loc) {\n $this->context .= \"\\t\\t'|$uri|' => '$method_loc',\\n\";\n }\n $this->context .= \"\\t),\\n\";\n $this->context .= \"\\t'POST' => array(\\n\";\n foreach ($this->routing['POST'] as $uri => $method_loc) {\n $this->context .= \"\\t\\t'|$uri|' => '$method_loc',\\n\";\n }\n $this->context .= \"\\t)\\n\";\n $this->context .= \");\\n\\n\";\n }",
"public static function load_routing_table() {\n $file = CONFIG_PATH . \"Routes.php\";\n\n if (file_exists($file)) {\n require $file;\n if (!isset($routes)) {\n $routes = array();\n }\n } else {\n $routes = array();\n }\n\n return $routes;\n }",
"function _create_routing_table(){\n\n //Pull-in the registered routes in the routes file.\n $routes = _get_registered_route();\n\n //Process the routing table by passing in the registered routes\n $routing_table = _process_routing_table( $routes );\n\n return $routing_table;\n}",
"protected function generateRoutingData(): array\n\t{\n\t\t$parsedRoutes = [];\n\t\t$parser = new FR\\RouteParser\\Std();\n\t\t$dispatcherDataGenerator = new FR\\DataGenerator\\GroupCountBased();\n\t\tforeach ($this->routes as $routeName => $route)\n\t\t{\n\t\t\t$parsedRoute = $parser->parse($route->getPath());\n\t\t\tforeach ($route->getAllowedMethods() ?? ['*'] as $httpMethod)\n\t\t\t{\n\t\t\t\tforeach ($parsedRoute as $segments)\n\t\t\t\t{\n\t\t\t\t\t$dispatcherDataGenerator->addRoute($httpMethod, $segments, $routeName);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$parsedRoutes[$routeName] = $parsedRoute;\n\t\t}\n\t\treturn [$dispatcherDataGenerator->getData(), $parsedRoutes];\n\t}",
"public function getCacheableRoutes()\n {\n return serialize($this->getCacheableRouteContents());\n }",
"protected function readRoutes() {\n $cache = $this->getCache();\n\n $routes = $cache->get(self::CACHE_TYPE, self::CACHE_ID);\n if ($routes) {\n return $routes;\n }\n\n $routes = $this->io->getRoutes();\n\n $cache->set(self::CACHE_TYPE, self::CACHE_ID, $routes);\n\n return $routes;\n }",
"public function GetCompiledRoutes() {\n\n return $this->Compiled;\n }",
"function cacheable_dynamic_routes()\n {\n // Order by descending dynamic_route is important so that child routes\n // will be matched before attempting to match parent level routes\n $query = $this->db->select('id, dynamic_route')\n ->from($this->table)\n ->where('dynamic_route !=', 'NULL')\n ->order_by('dynamic_route', 'desc')\n ->get();\n\n return $query->result();\n }",
"private function populate_resource_info()\n\t\t{\n\n\t\t\t$resource_info = false;\n\n\t\t\t// Make sure we have a cache handler.\n\t\t\tif ( !self::$cache && Legato_Settings::get( 'resource', 'cache_schemas' ) )\n\t\t\t{\n\n\t\t\t\tself::$cache = new Legato_Cache( array( 'handler' => Legato_Settings::get( 'resource', 'cache_handler' ),\n\t\t\t\t\t 'namespace' => 'Legato_Resource',\n\t\t\t\t\t\t\t\t\t\t 'ttl' => Legato_Settings::get( 'resource', 'cache_ttl' ) ) );\n\n\t\t\t} // End if no cache handler.\n\n\t\t\tif ( Legato_Settings::get( 'resource', 'cache_schemas' ) )\n\t\t\t{\n\n\t\t\t\t// Get the cached resource info.\n\t\t\t\t$cached_info = self::$cache->get( $this->name );\n\t\t\t\tif ( $cached_info )\n\t\t\t\t\t$resource_info = unserialize( $cached_info );\n\n\t\t\t\t// Let's check the version info to make sure it matches,\n\t\t\t\t// if not delete the cached version and set it up to create a new one.\n\t\t\t\tif ( $resource_info['version'] != Legato_Settings::get( 'resource', 'version' ) )\n\t\t\t\t{\n\t\t\t\t\tself::$cache->delete( $this->name );\n\t\t\t\t\t$resource_info = false;\n\t\t\t\t}\n\n\t\t\t} // End if no cache handler.\n\n\t\t\tif ( !$resource_info )\n\t\t\t{\n\n\t\t\t\t$resource_info = array( 'tables' => array() );\n\n\t\t\t\t// Let's get the filename of the schema.\n\t\t\t\t$reflect = new ReflectionClass( $this->name );\n\t\t\t\t$filename = str_replace( '.class.php', '.schema.xml', $reflect->getFilename() );\n\n\t\t\t\t// Attempt to load the XML.\n\t\t\t\t$xml = simplexml_load_file( $filename );\n\n\t\t\t\t// Error occured while loading?\n\t\t\t\tif ( !$xml )\n\t\t\t\t{\n\t\t\t\t\tLegato_Debug_Debugger::add_item( 'An error occured while attempting to load the resource schema.' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Get the database connector.\n\t\t\t\t$resource_info['db'] = (string)$xml->db;\n\n\t\t\t\t// Get the database handle.\n\t\t\t\t$dbh = Legato_DB::get( $resource_info['db'] );\n\n\t\t\t\t// Loop through all the tables.\n\t\t\t\tforeach ( $xml->tables->table as $table )\n\t\t\t\t{\n\n\t\t\t\t\t$table_info = array();\n\n\t\t\t\t\t// Get the columns in the table.\n\t\t\t\t\t$query = 'SHOW COLUMNS FROM ' . (string)$table;\n\t\t\t\t\t$columns = $dbh->prepare( $query )->execute()->fetch_all_array();\n\n\t\t\t\t\t// Loop through each column and store it.\n\t\t\t\t\tforeach ( $columns as $column )\n\t\t\t\t\t{\n\n\t\t\t\t\t\t// If this is the primary key for this table, store it.\n\t\t\t\t\t\tif ( $column['Key'] == 'PRI' )\n\t\t\t\t\t\t\t$table_info['id'] = $column['Field'];\n\n\t\t\t\t\t\t// Store the field.\n\t\t\t\t\t\t$table_info['fields'][] = $column['Field'];\n\t\t\t\t\t\t$resource_info['fields'][$column['Field']] = (string)$table;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// If one was stored in the XML, overwrite with that ID.\n\t\t\t\t\tif ( (string)$table['id'] != '' )\n\t\t\t\t\t\t$table_info['id'] = (string)$table['id'];\n\n\t\t\t\t\t// Store the table information.\n\t\t\t\t\t$resource_info['tables'][(string)$table] = $table_info;\n\n\t\t\t\t} // Next table.\n\n\t\t\t\t// Store all the serialized fields.\n\t\t\t\tif ( $xml->serialized != '' )\n\t\t\t\t\tforeach ( $xml->serialized->field as $serialized_field )\n\t\t\t\t\t\t$resource_info['serialized'][(string)$serialized_field] = true;\n\n\t\t\t\t// Store all the deferred fields.\n\t\t\t\tif ( $xml->deferred != '' )\n\t\t\t\t\tforeach ( $xml->deferred->field as $deferred_field )\n\t\t\t\t\t\t$resource_info['deferred'][(string)$deferred_field] = true;\n\n\t\t\t\t// Store all the foreign keys.\n\t\t\t\tif ( $xml->foreign_keys != '' )\n\t\t\t\t{\n\t\t\t\t\tforeach ( $xml->foreign_keys->reference as $reference )\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ( $reference['key'] != '' )\n\t\t\t\t\t\t\t$key = (string)$reference['key'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$key = strtolower( preg_replace( '/([a-z])([A-Z])/', '$1_$2', (string)$reference ) . '_id' );\n\n\t\t\t\t\t\t$resource_info['foreign_keys'][$key] = (string)$reference;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Store all the sub-resources.\n\t\t\t\tif ( $xml->sub_resources != '' )\n\t\t\t\t{\n\t\t\t\t\tforeach ( $xml->sub_resources->sub_resource as $sub_resource )\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ( $sub_resource['key'] != '' )\n\t\t\t\t\t\t\t$key = (string)$sub_resource['key'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$key = strtolower( preg_replace( '/([a-z])([A-Z])/', '$1_$2', $this->name ) . '_id' );\n\n\t\t\t\t\t\t// Check for many-to-many relationship.\n\t\t\t\t\t\tif ( $sub_resource['lookup'] != '' )\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$lower_name = strtolower( preg_replace( '/([a-z])([A-Z])/', '$1_$2', $this->name ) );\n\t\t\t\t\t\t\t$lower_sub_name = strtolower( preg_replace( '/([a-z])([A-Z])/', '$1_$2', (string)$sub_resource ) );\n\n\t\t\t\t\t\t\t// Get the columns in the table.\n\t\t\t\t\t\t\t$query = 'SHOW COLUMNS FROM ' . $sub_resource['lookup'];\n\t\t\t\t\t\t\t$columns = $dbh->prepare( $query )->execute()->fetch_all_array();\n\n\t\t\t\t\t\t\t// Loop through each column and store it.\n\t\t\t\t\t\t\tforeach ( $columns as $column )\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$fields[] = $column['Field'];\n\n\t\t\t\t\t\t\t\t// Filter out any columns that aren't part of this sub-resource's data.\n\t\t\t\t\t\t\t\tif ( strpos( $column['Field'], $lower_name ) === 0 )\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t$fetch_fields[] = $column['Field'];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Store the lookup table information.\n\t\t\t\t\t\t\t$resource_info['many_to_many'][(string)$sub_resource] = array( 'name' => (string)$sub_resource['lookup'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id' => $lower_sub_name . '_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => $fields,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fetch_fields' => $fetch_fields,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'primary_keys' => array( $lower_name . '_id', $lower_sub_name . '_id' ) );\n\n\t\t\t\t\t\t} // End if many-to-many.\n\n\t\t\t\t\t\t$resource_info['sub_resources'][(string)$sub_resource] = $key;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Store the version.\n\t\t\t\t$resource_info['version'] = Legato_Settings::get( 'resource', 'version' );\n\n\t\t\t\t// Store the retrieved information in the cache.\n\t\t\t\tif ( Legato_Settings::get( 'resource', 'cache_schemas' ) )\n\t\t\t\t\tself::$cache->set( $this->name, serialize( $resource_info ) );\n\n\t\t\t} // End if not cached.\n\n\t\t\t// Add this resource's information to be managed.\n\t\t\t$this->info = $resource_info;\n\n\t\t}",
"protected function generateDeclaredRoutes()\n {\n $routes = \"array(\\n\";\n foreach ($this->getCollection()->all() as $routeInfo) {\n $route = $this->routeCompiler->compile($routeInfo);\n\n $name = (string)$route->getRoute();\n\n $properties = array(\n 'route' => $name,\n 'routeRequirements' => $route->getRouteRequirements(),\n 'parent' => $route->getParent(),\n 'options' => $route->getOptions()\n );\n\n $routes .= sprintf(\" %s => %s,\\n\", var_export($name, true), preg_replace(\"/\\n\\\\s*/\", '', var_export($properties, true)));\n }\n $routes .= ' )';\n\n return $routes;\n }",
"private function fetchRoutingTable()\n {\n $this->routes = $this->loadRoutingTable();\n\n if (!empty($this->routes)) {\n $this->traverseRouteListAndBuildMap();\n }\n\n return $this->routes;\n }",
"protected function getRoutes()\n {\n return json_decode(base64_decode($_ENV[\"PLATFORM_ROUTES\"]), true);\n }",
"function cacheable_dynamic_routes()\n {\n // Order by descending dynamic_route is important so that child routes\n // will be matched before attempting to match parent level routes\n $query = $this->db->select('id, dynamic_route')\n ->from('content_types')\n ->where('dynamic_route !=', 'NULL')\n ->order_by('dynamic_route', 'desc')\n ->get();\n\n return $query->result();\n }",
"public function getRestRoutes ()\n {\n $routes = array();\n foreach (self::$routes as $path => $data) {\n if ($data['rest'] !== false) {\n $routes[$path] = array(\n 'rest' => $data['rest'],\n 'path' => $data['path'],\n 'namespace' => $data['namespace'],\n 'controller' => $data['controller'],\n 'action' => $data['action']\n );\n }\n }\n \n return $routes;\n }",
"private function fetchDescriptors(string $resource) : array\n {\n if (!$this->cache) {\n return $this->findDescriptors($resource);\n }\n\n // some cache stores may have character restrictions for a key...\n $key = hash('md5', $resource);\n\n if (!$this->cache->has($key)) {\n $value = $this->findDescriptors($resource);\n\n // TTL should be set at the storage...\n $this->cache->set($key, $value);\n }\n\n return $this->cache->get($key);\n }",
"public static function &generateUrlData()\n {\n if (null === self::$kernel || null === self::$kernel->getContainer()) {\n // kernel not booted (properly)\n self::bootKernel();\n }\n $routes = self::$kernel->getContainer()->get('router')->getRouteCollection();\n $result = array();\n foreach ($routes as $name => $route) {\n // only use interesting urls, the rest is too much uninteresting data\n if (static::interestedInRoute($route)) {\n $infos = array('path' => $route->getPath(),\n 'methods' => $route->getMethods(),\n 'defaults' => $route->getDefaults(),\n );\n $result[$name] = $infos;\n }\n }\n ksort($result);\n\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stream large object values. NOTE: This feature is currently experimental. Generated from protobuf field .google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects stream_large_objects = 102; | public function getStreamLargeObjects()
{
return $this->readOneof(102);
} | [
"public function setStreamLargeObjects($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Datastream\\V1\\OracleSourceConfig\\StreamLargeObjects::class);\n $this->writeOneof(102, $var);\n\n return $this;\n }",
"public function getLargeObjects()\n {\n return $this->largeObjects;\n }",
"public function isLargeObject();",
"public function getDropLargeObjects()\n {\n return $this->readOneof(100);\n }",
"public function getObjects()\r\n {\r\n return $this->streamObjects;\r\n }",
"public function setAsCursor($cursor_retrieval_chunk_size) { \r\n $this->cursor_retrieval_chunk_size = $cursor_retrieval_chunk_size;\r\n }",
"public function GetMaxStreamSize(){}",
"function parseObjectObjStream($offset, $dictionary) {\n $filter = '';\n /**\n * Get the Filter value\n */\n preg_match('#/Filter/([[:alpha:][:digit:]]+)#', $dictionary, $matches);\n if (!@$matches[1]) {\n $filter = 'None';\n } else {\n $filter = $matches[1];\n }\n /**\n * Get the count of objects in this stream\n */\n preg_match('#/N ([[:digit:]]+)#', $dictionary, $matches);\n if (!@$matches[1]) {\n throw new Exception('Unable to read the object count for the object stream at offset ' . $offset);\n } else {\n $count = $matches[1];\n }\n preg_match('#/First ([[:digit:]]+)#', $dictionary, $matches);\n if (!@$matches[1]) {\n throw new Exception('Unable to read the offset of the first object in the stream at offset' . $offset);\n } else {\n $firstOffset = $matches[1];\n }\n /**\n * Fill the buffer with the content\n */\n $buffer = $this->getObjectContentStream($offset);\n /**\n * Is it filtered?\n */\n switch ($filter) {\n case 'None':\n /**\n * Not filtered\n */\n break;\n case 'FlateDecode':\n $objId = 0;\n $objType = '';\n $objOffset = '';\n $objGen = '';\n $w = array();\n $options = array();\n $tmpObject = array();\n /**\n * Filter: FlateDecode\n */\n $options = $this->getFlateDecodeOptions($dictionary);\n $buffer = $this->filterFlateDecode($buffer, $options);\n\n break;\n default:\n /**\n * @todo Add support for other filters\n */\n echo 'Filter: ' . $filter . \"<br>\\n\";\n echo htmlspecialchars($dictionary);\n throw new Exception('Filter ' . $filter . ' is not supported at this time.');\n break;\n }\n\n echo htmlspecialchars($buffer) . \"<br><br>\\n\";\n\n echo htmlspecialchars(substr($buffer, $firstOffset)) . \"<br><br>\\n\";\n }",
"public function toStream($stream, $offset = 0, $maxlen = 0)\n {\n\n }",
"public function setStreamNumbers($streamNumbers)\n {\n $this->_streamNumbers = $streamNumbers;\n }",
"public function setMaxStreamCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_stream_count = $var;\n\n return $this;\n }",
"public function setStream($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Bigquery\\Storage\\V1beta1\\Stream::class);\n $this->stream = $var;\n\n return $this;\n }",
"public function getStreamsForCycle() {\n $chunkSize = (int)Factory::getObject(Factory::TYPE_DATABASE, true)->getSetting(\"aggregator_chunk_size\", 5);\n $streams = $this->getModel()->select(array(\"stream_id\", \"stream\"), array());\n if(!$streams) {\n throw new Exception(\"No streams available\");\n }\n $chunkedStreams = array();\n $lowestCount = null;\n array_walk($streams, function ($value) use(&$chunkedStreams, $chunkSize, &$lowestCount) {\n if(empty($value[\"stream\"])) {\n $stream = array();\n } else {\n $stream = json_decode($value[\"stream\"], true);\n }\n\n $chunked = array_values(array_filter(array_chunk($stream, $chunkSize), function($value) use($chunkSize) {\n return count($value) === $chunkSize;\n }));\n\n if(count($chunked) < $lowestCount || $lowestCount === null) {\n $lowestCount = count($chunked);\n }\n\n $chunkedStreams[$value[\"stream_id\"]] = array(\"original\" => $stream, \"chunked\" => $chunked);\n });\n\n $chunkedStreams = $this->trimChunkedStreams($chunkedStreams, $lowestCount);\n return $chunkedStreams;\n }",
"public function setStream($stream);",
"public function setStreams($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Bigquery\\Storage\\V1beta1\\Stream::class);\n $this->streams = $arr;\n\n return $this;\n }",
"public function setMaxStreamDuration($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Compute\\V1\\Duration::class);\n $this->max_stream_duration = $var;\n\n return $this;\n }",
"public function setQueryStream($stream)\n {\n return $this->setOption('stream', $stream);\n }",
"public function setStreams($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\BigQuery\\Storage\\V1\\ReadStream::class);\n $this->streams = $arr;\n\n return $this;\n }",
"public static function GetAllStreams()\n {\n return self::GetAllRecordsFromTable(\"streams\"); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get AvardaCheckOutClient script path for Require.js. | public function getCheckOutClientScriptPath()
{
return $this->config->getCheckoutJsUrl();
} | [
"public function getClientScriptUrl() : string\n {\n $endpoints = new Endpoints();\n return $endpoints->getClientScriptUrl(PureClarity::getInstance()->getConfig('access_key'));\n }",
"static function frontend_script_src() {\n\t\t$scriptDir = basename(dirname(dirname(__DIR__))) . '/javascript';\n\t\treturn $scriptDir . '/googlemaps.js';\n\t}",
"public static function getScriptPath()\n {\n return realpath($_SERVER['argv'][0]);\n }",
"public function getScriptPath () {\n\t$data = $this->scriptPath;\n\t return $data;\n}",
"protected function getInstallScriptPath()\n {\n $contao1InstallScriptPath = $this->config['installationFolder'] . DIRECTORY_SEPARATOR . 'install.php';\n $contao2InstallScriptPath = $this->config['installationFolder'] . DIRECTORY_SEPARATOR . 'dev/shell/install.php';\n if (file_exists($contao2InstallScriptPath)) {\n return $contao2InstallScriptPath;\n }\n\n return $contao1InstallScriptPath;\n }",
"function getPathIncApp() { return ( isset (getCfg(\"paths\")['inc_app']) && getCfg(\"paths\")['inc_app'] ? getCfg(\"paths\")['inc_app'] : sixtythreeklabs_php_app_private_directory_location . sixtythreeklabs_php_app_name.\"/\" . \"inc/\" ) ; }",
"public function getCrawlerCliPath(){\n\t\t$phpPath \t\t= $this->crawlerObj->extensionSettings['phpPath'] . ' ';\n\t\t$pathToTypo3 \t= rtrim(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT'), '/');\n\t\t$pathToTypo3 \t.= rtrim(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/');\n\t\t$cliPart\t \t= '/typo3/cli_dispatch.phpsh crawler';\n\t\treturn $phpPath.$pathToTypo3.$cliPart;\n\t}",
"public function getViewScriptPath()\n {\n return realpath($this->getViewPath() . DIRECTORY_SEPARATOR . 'scripts');\n }",
"private function getAppScript() {\n\n\t\t// return get_template_directory_uri() . '/dist/' . $this->manifest['app.js'];\n\t\treturn get_home_url() . $this->manifest['app.js'];\n\t}",
"public function getScriptPath()\n { \n return $this->getUrlBase().$this->getPathFromString($_SERVER['SCRIPT_NAME']);\n }",
"public function getCompositeScriptPath()\n {\n if (null === $this->compositeScriptPath) {\n $this->compositeScriptPath = Console::getExecutable('composite');\n }\n\n return $this->compositeScriptPath;\n }",
"public static function getScriptPath()\n {\n if (isset($_SESSION['isInfoFilled'])) {\n return 'js/slider-setter.js';\n }\n\n if (isset($_SESSION['isAuth'])) {\n return 'js/info-form.js';\n }\n\n return 'js/login-form.js';\n }",
"public static function getServerAbsPath() {\r\n $path = System::getScriptAbsPath();\r\n $v_path = System::getScriptVirtualPath();\r\n return substr($path, 0, strlen($path) - strlen($v_path));\r\n }",
"public function getRequireJsUrl() : string\n {\n $asset = $this->_assetRepo->createAsset('requirejs/require.js');\n return $asset->getUrl();\n }",
"function getPathIncLib() { return ( isset (getCfg(\"paths\")['inc_lib']) && getCfg(\"paths\")['inc_lib'] ? getCfg(\"paths\")['inc_lib'] : sixtythreeklabs_php_app_private_directory_location . \"lib/\" ) ; }",
"public function getImportScriptPath()\n\t{\n\t\treturn realpath(dirname(__FILE__).'/../components/').'/import-script.php';\n\t}",
"public static function relative_client_helper_path() {\n // Get the paths to the client helper folder and php file folder as an\n // array of tokens.\n $clientHelperFolder = explode(DIRECTORY_SEPARATOR, dirname(realpath(__FILE__)));\n $currentPhpFileFolder = explode(DIRECTORY_SEPARATOR, dirname(realpath($_SERVER['SCRIPT_FILENAME'])));\n // Find the first part of the paths that is not the same.\n for ($i = 0; $i < min(count($currentPhpFileFolder), count($clientHelperFolder)); $i++) {\n if ($clientHelperFolder[$i] != $currentPhpFileFolder[$i]) {\n break;\n }\n }\n // Step back up the path to the point where the 2 paths differ.\n $path = str_repeat('../', count($currentPhpFileFolder) - $i);\n // Add back in the different part of the path to the client helper folder.\n for ($j = $i; $j < count($clientHelperFolder); $j++) {\n $path .= $clientHelperFolder[$j] . '/';\n }\n return $path;\n }",
"function getAddonPath()\n\t{\n\t\t//assert(isset($this->addonData['addon_key']));\n\t\treturn PEAR_ROOT_PATH . PEAR_SYSTEM_SOURCES . PEAR_ADDONS_DIRECTORY . $this->addonData['addon_key'] . '/';\n\t}",
"public static function getScriptPath()\n {\n if ( defined( 'WI_SCRIPT_PATH' ) )\n return WI_SCRIPT_PATH;\n\n $path = $_SERVER[ 'SCRIPT_FILENAME' ];\n $real = realpath( $path );\n if ( $real )\n $path = $real;\n $path = str_replace( '\\\\', '/', $path );\n\n return $path;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets Source Application. Represents information about the application used to generate a change. | public function setSourceApplication(?SourceApplication $sourceApplication): void
{
$this->sourceApplication = $sourceApplication;
} | [
"public function setApplication($value);",
"public function setApp(Application $app){\n \t$this->app = $app;\n }",
"public function setApplicationSource(string $newApplicationSource) {\n\t\t$newApplicationSource = trim ($newApplicationSource);\n\t\t$newApplicationSource = filter_var($newApplicationSource, FILTER_SANITIZE_STRING,\n\t\t\tFILTER_FLAG_NO_ENCODE_QUOTES);\n\t\tif(empty ($newApplicationSource) === true) {\n\t\t\tthrow (new \\InvalidArgumentException(\"Application Source is empty or secure\"));\n\t\t}\n\t\t//verify source will fit in the database\n\t\tif(strlen($newApplicationSource) > 1000) {\n\t\t\tthrow (new \\RangeException(\"Application source is to large\"));\n\t\t}\n\t\t//store the source\n\t\t$this->applicationSource = $newApplicationSource;\n\t}",
"function set_application($application)\r\n {\r\n $this->set_default_property(self :: PROPERTY_APPLICATION, $application);\r\n }",
"public function setApplication(Application $app)\n {\n $this->app = $app;\n }",
"public function setApp ($app) {\n\t\t$this->app = $app;\n\t}",
"function setApplicationName($value) {\n $this->application_name = $value;\n }",
"public static function setApplication(Application $application)\n\t{\n\t\tif(self::$application===null)\n\t\t{\n\t\t\tself::$application = $application;\n\t\t}\n\t}",
"protected function setAppId() {\n if ($app_id = $this->getConfigValue('cloud.appId')) {\n $this->appId = $app_id;\n }\n else {\n $this->say(\"<info>To generate an alias for the Acquia Cloud, BLT require's your Acquia Cloud application ID.</info>\");\n $this->say(\"<info>See https://docs.acquia.com/acquia-cloud/manage/applications/#obtaining-your-subscription-s-application-id</info>\");\n $this->appId = $this->askRequired('Please enter your Acquia Cloud application ID');\n $this->writeAppConfig($this->appId);\n }\n }",
"public function setApplicationCode($value) {\r\n $this->applicationCode = $value;\r\n }",
"public function set_source($sourceProject)\n\t{\n\t\t$this->sourceProject = $sourceProject;\n\t}",
"public function setApplicationName($app_name) \n\t{\n\t\t$this->application_name = $app_name;\n\t}",
"public function _set_app(Application\\Base $app)\n\t{\n\t\t$this->_app = $app;\n\t}",
"public function setApplicationInfo($application = 'wordpress', $language = 'en', $email = null, $username = null, $password = null, $title = null, $version = null, $content = 'no') {\r\n $this->_application = $this->checkApplication($application);\r\n $this->_appLang = $language;\r\n $this->_appEmail = $email;\r\n $this->_appUsername = $username;\r\n if ($password == null)\r\n $this->_appPass = $this->generatePassword();\r\n else \r\n $this->_appPass = $password;\r\n $this->_appTitle = $title;\r\n $this->_appVersion = $version;\r\n $this->_appContent = $content;\r\n }",
"public function setApplicationName(?string $applicationName): void\n {\n $this->applicationName['value'] = $applicationName;\n }",
"public function setAttributeSource(?AccessPackageResourceAttributeSource $value): void {\n $this->getBackingStore()->set('attributeSource', $value);\n }",
"public function setAsNextApplication();",
"protected function setApiSourceInfo() {\n $this->apiSourceInfo = pathinfo($this->api['source']);\n }",
"private function setAppOnContext()\n {\n if ($this->context instanceof KernelAwareContext) {\n $this->context->setApp($this->kernel);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 3 display the extra data in the order admin panel | function sls_display_order_data_in_admin( $order ){ ?>
<div class="order_data_column">
<h4><?php _e( 'Extra Details', 'woocommerce' ); ?></h4>
<?php
echo '<p><strong>' . __( 'Skill Rating: ' ) . ':</strong>' . get_post_meta( $order->id, '_skill_rating', true ) . '</p>';
echo '<p><strong>' . __( 'Gender: ' ) . ':</strong>' . get_post_meta( $order->id, '_player_gender', true ) . '</p>';
echo '<p><strong>' . __( 'Comments: ' ) . ':</strong>' . get_post_meta( $order->id, '_player_comments', true ) . '</p>';
echo '<p><strong>' . __( 'Career: ' ) . ':</strong>' . get_post_meta( $order->id, '_player_career', true ) . '</p>';
echo '<p><strong>' . __( 'Annual Meeting Volunteer Interest: ' ) . ':</strong>' . get_post_meta( $order->id, '_annual_mtg_volunteer', true ) . '</p>';
echo '<p><strong>' . __( 'Board Member Interest: ' ) . ':</strong>' . get_post_meta( $order->id, '_board_member', true ) . '</p>';
echo '<p><strong>' . __( 'Tennis Part Volunteer Interest: ' ) . ':</strong>' . get_post_meta( $order->id, '_party_volunteer', true ) . '</p>';
echo '<p><strong>' . __( 'Tournament Volunteer: ' ) . ':</strong>' . get_post_meta( $order->id, '_tournament_volunteer', true ) . '</p>';
echo '<p><strong>' . __( 'Skills/Hobbies: ' ) . ':</strong>' . get_post_meta( $order->id, '_skill_hobbies', true ) . '</p>';
echo '<p><strong>' . __( 'Birthdate: ' ) . ':</strong>' . get_post_meta( $order->id, '_player_birthday', true ) . '</p>';
echo '<p><strong>' . __( 'Email in Roster: ' ) . ':</strong>' . get_post_meta( $order->id, '_roster_email_show', true ) . '</p>';
?>
</div>
<?php } | [
"function admin_edit_order() {\n\t\t//\n\t}",
"function display_fields_for_order_details(){\r\n\r\n\t\t/**\r\n\t\t * Position 1 - Display inside order total after shipping method\r\n\t\t */\r\n\t\tadd_filter( 'woocommerce_get_order_item_totals', [$this, 'display_after_shipping_method'], 10, 2 );\r\n\r\n\t\t/**\r\n\t\t * Position 2 - Display after order total\r\n\t\t */\r\n\t\tadd_action( 'woocommerce_order_details_after_order_table', [$this,'display_after_order_details'] );\r\n\t\t\r\n\t}",
"public function adminViewOrderAction()\n {\n $this->checkAdmin();\n $id = intval($this->route['id']);\n $vars['admin'] = \"\";\n $productsInOrder = $this->model->productsInOrder($id); # array of inStock Ids\n $vars['order'] = $this->model->getOrderById($id);\n $vars['customer'] = $this->model->getCustomerByOrder($id);\n $vars['products'] = $this->model->getOrderProdustsByIds($productsInOrder);\n $this->view->render('Admin View Order ', $vars);\n }",
"public function orderDetails()\n {\n $params = $this->productService->getOrders($this->requestHelper);\n\n $this->renderView(['account', 'accountOrderDetails'], $params);\n }",
"public function track_add_order_from_edit()\n {\n }",
"public static function geoCart_initSteps_addOtherDetails()\n {\n //Possible enhancement: perhaps show final fee table on other detail page?\n return false;\n }",
"public function detailedUnfilledOrderList() {\n $this->page->orders = $this->model->getDeltagereWithWearOrders(null, null, true);\n $this->page->setTemplate('detailedOrderList');\n $this->page->registerLateLoadJS('weardetails.js');\n }",
"public function order_info_admin( $order ) {\n\n\t\tlist(\n\t\t\t$order_type,\n\t\t\t$order_location,\n\t\t\t$order_pickup_time,\n\t\t\t$order_delivery_address,\n\t\t\t) = self::get_order_info( $order->get_id() );\n\n\t\tif ( ! empty( $order_type ) ) {\n\t\t\techo \"<h3>Order Type</h3>\" . ucwords( $order_type );\n\t\t}\n\n\t\tif ( ! empty( $order_pickup_time ) ) {\n\t\t\techo \"<h3>Order Time</h3>$order_pickup_time\";\n\t\t}\n\n\t\tif ( ! empty( $order_delivery_address ) && strlen($order_delivery_address) > 4 ) {\n\t\t\techo \"<h3>Order Delivery Address</h3>$order_delivery_address\";\n\t\t}\n\n\t\tif ( ! empty( $order_location ) ) {\n\t\t\tif ( $order_location = get_post( $order_location ) ) {\n\n\t\t\t\t$order_location_meta = get_post_meta( $order_location->ID );\n\t\t\t\t$order_location_link = get_edit_post_link( $order_location->ID );\n\n\t\t\t\techo \"<h3>Order Location</h3>\";\n\t\t\t\techo \"<a href='$order_location_link'>$order_location->post_title</a><br />\";\n\t\t\t\techo $order_location_meta['wf_address_one'][0] . \"<br />\";\n\t\t\t\techo $order_location_meta['wf_city'][0] . \", \" . $order_location_meta['wf_state'][0] . \" \" . $order_location_meta['wf_zip'][0];\n\t\t\t}\n\n\t\t}\n\t}",
"public function display() {\n print_r($this->order);\n }",
"public function orderdetail(){\n\t\treturn parent::orderdetail();\n\t}",
"public function tista_rocket_admin_order_data( $order ){\n\t\t\t\n\t\t\tif( $order->payment_method != 'tista_rocket' )\n\t\t\t\treturn;\n\n\t\t\t$number = (get_post_meta($order->id, '_rocket_number', true)) ? get_post_meta($order->id, '_rocket_number', true) : '';\n\t\t\t$transaction = (get_post_meta($order->id, '_rocket_transaction', true)) ? get_post_meta($order->id, '_rocket_transaction', true) : '';\n\n\t\t\t?>\n\t\t\t<div class=\"form-field form-field-wide\">\n\t\t\t\t<img src='<?php echo plugins_url(\"images/rocket.png\", __FILE__); ?>' alt=\"rocket\">\t\n\t\t\t\t<table class=\"wp-list-table widefat fixed striped posts\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><strong><?php esc_html_e('Rocket Number', 'tista') ;?></strong></th>\n\t\t\t\t\t\t\t<td>: <?php echo esc_attr( $number );?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><strong><?php esc_html_e('Transaction ID', 'tista') ;?></strong></th>\n\t\t\t\t\t\t\t<td>: <?php echo esc_attr( $transaction );?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<?php \t\t\t\n\t\t}",
"public function admin_order() {\n\t\t$this->EmployeeAction->actionOrder();\n\t}",
"public static function order_preview_get_order_details($order)\n {\n }",
"function wc_display_custom_billing_fields_admin_order( $order ) {\r\n\twc_get_custom_fields_for_admin_order( $order, array( 'billing' ) );\r\n}",
"public function show_extra_shipping_fields( $order ) {\n\t\t$this->show_on_admin_order( $order, 'shipping' );\n\t}",
"function learn_press_order_details_table( $order_id ) {\r\n\t\tif ( !$order_id ) return;\r\n\t\tlearn_press_get_template( 'order/order-details.php', array(\r\n\t\t\t'order' => learn_press_get_order( $order_id )\r\n\t\t) );\r\n\t}",
"public function getExtraInfo(){\r\n\t\t$order = $this->getOrder();\r\n $quoteId = $order->getQuoteId();\r\n\t $additinalInfo = $this->additionalFields->findByField($quoteId,'quote_id');\r\n $resultData = $additinalInfo->getData();\r\n\t\treturn $resultData;\r\n }",
"function update_order_info($order){\n }",
"public function hookActionOrderDetail()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testControlCustomization method Tests the input method and passing custom options. | public function testControlCustomization() {
$this->getTableLocator()->get('Contacts', [
'className' => ContactsTable::class
]);
$this->Form->create([], ['context' => ['table' => 'Contacts']]);
$result = $this->Form->control('Contact.email', ['id' => 'custom']);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'custom', 'class'],
'Email',
'/label',
['input' => [
'type' => 'email', 'name' => 'Contact[email]',
'id' => 'custom', 'maxlength' => 255, 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Contact.email', [
'templates' => ['inputContainer' => '<div>{{content}}</div>']
]);
$expected = [
'<div',
'label' => ['for' => 'contact-email', 'class'],
'Email',
'/label',
['input' => [
'type' => 'email', 'name' => 'Contact[email]',
'id' => 'contact-email', 'maxlength' => 255, 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Contact.email', ['type' => 'text']);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'contact-email', 'class'],
'Email',
'/label',
['input' => [
'type' => 'text', 'name' => 'Contact[email]',
'id' => 'contact-email', 'maxlength' => '255', 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Contact.5.email', ['type' => 'text']);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'contact-5-email', 'class'],
'Email',
'/label',
['input' => [
'type' => 'text', 'name' => 'Contact[5][email]',
'id' => 'contact-5-email', 'maxlength' => '255', 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Contact.password');
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'contact-password', 'class'],
'Password',
'/label',
['input' => [
'type' => 'password', 'name' => 'Contact[password]',
'id' => 'contact-password', 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Contact.email', [
'type' => 'file', 'class' => 'textbox'
]);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'contact-email'],
'Email',
'/label',
['input' => [
'type' => 'file', 'name' => 'Contact[email]', 'class' => 'textbox form-control-file',
'id' => 'contact-email'
]],
'/div'
];
$this->assertHtml($expected, $result);
$entity = new Entity(['phone' => 'Hello & World > weird chars']);
$this->Form->create($entity, ['context' => ['table' => 'Contacts']]);
$result = $this->Form->control('phone');
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'phone', 'class'],
'Phone',
'/label',
['input' => [
'type' => 'tel', 'name' => 'phone',
'value' => 'Hello & World > weird chars',
'id' => 'phone', 'maxlength' => 255, 'class'
]],
'/div'
];
$this->assertHtml($expected, $result);
$this->Form->getView()->setRequest($this->Form->getView()->getRequest()->withData('Model.0.OtherModel.field', 'My value'));
$this->Form->create();
$result = $this->Form->control('Model.0.OtherModel.field', ['id' => 'myId']);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'myId', 'class'],
'Field',
'/label',
'input' => [
'type' => 'text', 'name' => 'Model[0][OtherModel][field]',
'value' => 'My value', 'id' => 'myId', 'class'
],
'/div'
];
$this->assertHtml($expected, $result);
$this->Form->getView()->setRequest($this->Form->getView()->getRequest()->withParsedBody([]));
$this->Form->create();
$entity->setError('field', 'Badness!');
$this->Form->create($entity, ['context' => ['table' => 'Contacts']]);
$result = $this->Form->control('field');
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'field', 'class'],
'Field',
'/label',
'input' => [
'type' => 'text', 'name' => 'field',
'id' => 'field', 'class' => 'is-invalid form-control'
],
['div' => ['class' => 'invalid-feedback']],
'Badness!',
'/div',
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('field', [
'templates' => [
'inputContainerError' => '{{content}}{{error}}',
'error' => '<span class="error-message">{{content}}</span>'
]
]);
$expected = [
'label' => ['for' => 'field', 'class'],
'Field',
'/label',
'input' => [
'type' => 'text', 'name' => 'field',
'id' => 'field', 'class' => 'is-invalid form-control'
],
['span' => ['class' => 'error-message']],
'Badness!',
'/span'
];
$this->assertHtml($expected, $result);
$entity->setError('field', ['minLength'], true);
$result = $this->Form->control('field', [
'error' => [
'minLength' => 'Le login doit contenir au moins 2 caractères',
'maxLength' => 'login too large'
]
]);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'field', 'class'],
'Field',
'/label',
'input' => ['type' => 'text', 'name' => 'field', 'id' => 'field', 'class' => 'is-invalid form-control'],
['div' => ['class' => 'invalid-feedback']],
'Le login doit contenir au moins 2 caractères',
'/div',
'/div'
];
$this->assertHtml($expected, $result);
$entity->setError('field', ['maxLength'], true);
$result = $this->Form->control('field', [
'error' => [
'minLength' => 'Le login doit contenir au moins 2 caractères',
'maxLength' => 'login too large',
]
]);
$expected = [
'div' => ['class' => 'form-group'],
'label' => ['for' => 'field', 'class'],
'Field',
'/label',
'input' => ['type' => 'text', 'name' => 'field', 'id' => 'field', 'class' => 'is-invalid form-control'],
['div' => ['class' => 'invalid-feedback']],
'login too large',
'/div',
'/div'
];
$this->assertHtml($expected, $result);
} | [
"#[@test]\n public function doOptions() {\n $this->assertHandlerForMethodTriggered('OPTIONS');\n }",
"public function testMeOptions()\n {\n\n }",
"public function testOptions() {\n $this->executeMethod('OPTIONS', FALSE);\n }",
"public function testOptionsMethod()\n {\n $client = $this->createClient();\n $crawler = $client->request('OPTIONS', '/test');\n $result = $client->getResponse()->getContent();\n $this->assertEquals('OPTIONS', $result);\n }",
"public function testOptionsMethodRoute(): void\n {\n $this->options('/options/request_action/test_request_action');\n $this->assertResponseSuccess();\n }",
"public function testGetUserOptions()\n\t{\n\t}",
"public function testIsAllowCustomMethod()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testGetDefaultOptionsFromGetMethod()\n {\n $app = $this->app;\n\n $type = ucwords($this->type);\n\n $complement = $this->complement;\n\n $this->assertSame(\n 'advanced-local-complement',\n $complement::AdvancedLocalComplement()->getOption('slug')\n );\n\n $this->assertSame(\n 'AdvancedLocalComplement\\\\Controller\\\\',\n $complement::AdvancedLocalComplement()->getOption('namespaces', 'controller')\n );\n\n $this->assertSame(\n $app::$type() . 'advanced-local-complement/src/template/layout/',\n $complement::AdvancedLocalComplement()->getOption('path', 'layout')\n );\n\n $this->assertSame(\n $app::$type() . 'advanced-local-complement/src/template/page/',\n $complement::AdvancedLocalComplement()->getOption('path', 'page')\n );\n }",
"protected function addTestOptions()\n {\n foreach (['test' => 'PHPUnit', 'pest' => 'Pest'] as $option => $name) {\n $this->getDefinition()->addOption(new InputOption(\n $option,\n null,\n InputOption::VALUE_NONE,\n \"Generate an accompanying {$name} test for the {$this->type}\"\n ));\n }\n }",
"public function testShowProductVariationOption()\n {\n }",
"public function testAllowCustomMethod()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"protected function adjust_test_testoptions(&$testoptions) {\n }",
"public function testProxyCoreV1OPTIONSNode()\n {\n\n }",
"public function testHttpMethodOptionsRequest()\n {\n //绑定了跨域组件的路由\n $this->app->get(\"/testOptions\", function () {\n return \"testOptions\";\n });\n\n\n //满足跨域中间件的写法\n $currentUri = $this->prepareUrlForRequest('/testOptions');\n $request = Illuminate\\Http\\Request::create($currentUri, 'OPTIONS');\n $this->app->bind('request',function () use($request){\n return $request;\n });\n $this->app->register(\\Uuu9\\Cors\\Middleware\\CorsServiceProvider::class);\n\n //用Options method 请求接口\n $server = $this->transformHeadersToServerVars([]);\n $response = $this->call('OPTIONS', '/testOptions', [], [], [], $server);\n\n //prometheus不记录\n $count = $this->getMetricValue('http_response_status_count', \"testRoute\");\n $this->assertEquals(0, $count);\n\n //lumen5.3有效\n //TODO::lumen5.4\n if (stripos($this->app->version(),'5.3.*')){\n $this->assertEquals(204, $response->getStatusCode());\n }\n }",
"private function testimonial_section_info_section( $wp_customize ) {\n \t// new pannel for testimonial section info section\n \t$wp_customize->add_section('best-it-testimonial-section-info-sections', array(\n 'title' => __('testimonial Section'),\n 'priority' => 2,\n 'description' => __('The testimonial section info section is only displayed testimonial Section the company', 'best-it'),\n ));\n // setting for testimonial section info setting\n \t$wp_customize->add_setting('best-it-testimonial-section-info-display', array(\n 'default' => 'No',\n 'sanitize_callback' => array( $this, 'sanitize_testimonial_section_display_custom_option' )\n ));\n // control for testimonial section info control\n $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'best-it-testimonial-section-info-control', array(\n 'label' => __('Display testimonial section?'),\n 'section' => 'best-it-testimonial-section-info-sections',\n 'settings' => 'best-it-testimonial-section-info-display',\n 'type' => 'select',\n 'choices' => array('No' => 'No', 'Yes' => 'Yes')\n )));\n\n // setting for testimonial section Title\n \t$wp_customize->add_setting('best-it-testimonial-section-title-display', array(\n 'default' => 'Welcome to Datasoft International LTD',\n 'sanitize_callback' => array( $this, 'sanitize_custom_testimonial_section_title_option' )\n ));\n // control for testimonial section Title\n $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'best-it-testimonial-section-title-control', array(\n 'label' => __('Input testimonial Section Title:'),\n 'section' => 'best-it-testimonial-section-info-sections',\n 'settings' => 'best-it-testimonial-section-title-display',\n 'type' => 'text',\n ))); \n\n\n // setting for testimonial section sub Title\n \t$wp_customize->add_setting('best-it-testimonial-section-deatils-display', array(\n 'default' => 'testimonial Section deatils',\n 'sanitize_callback' => array( $this, 'sanitize_custom_testimonial_section_deatils_option' )\n ));\n // control for testimonial section sub Title\n $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'best-it-testimonial-section-deatils-control', array(\n 'label' => __('Input testimonial Section deatils:'),\n 'section' => 'best-it-testimonial-section-info-sections',\n 'settings' => 'best-it-testimonial-section-deatils-display',\n 'type' => 'textarea',\n )));\n\n // setting for testimonial section background image\n $wp_customize->add_setting('testimonial_section_bg_image', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n ));\n\n // setting for Speatial section background image\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, ' \n testimonial_section_bg_image_control', array(\n 'label' => __( 'Testomonial Background image', 'theme-slug' ),\n 'settings' => 'testimonial_section_bg_image',\n 'section' => 'best-it-testimonial-section-info-sections',\n ))\n );\n }",
"public function testGetOptionStrategy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"protected abstract function _setupBriefOptions();",
"public function testPutSourceControlAction()\n {\n\n }",
"function ca_options_callback($input){\n\t\treturn $input;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a unique email authentication code. | public function generateUniqueEmailAuthenticationCode()
{
return $this->generateUnique( 'email_authentication_code' );
} | [
"protected function genAuthCode() {\n return md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));\n }",
"function randomCode(){\n\t\t$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\t\t$result = '';\n\t\tfor ($i = 0; $i < 40; $i++)\n\t\t\t$result .= $characters[mt_rand(0, 61)];\n\t\t\n\t\t$emailCode = $result;\n\t\treturn $emailCode;\n\t}",
"function hypothesis_mail_auth_code($userid) {\n $salt = 'hypothesis authentication for userid: ';\n // Do not change this, or all auth codes will need to be regenerated.\n\n return substr(md5($salt . $userid), 0, 10);\n}",
"public function generateAuthCode(){\n if ($this->id === null) {\n $this->authorization_code_id = 0;\n $this->save();\n $signerId = $this->id;\n } else {\n $signerId = $this->id;\n }\n\n // create auth code\n $authCode = AuthorizationCode::generateCode(6, date('YmdHis'));\n\n // delete previous auth codes\n AuthorizationCode::where('signer_id', $signerId)->delete();\n\n // generate a new auth code\n $newAuthorizationCode = new AuthorizationCode([\n 'signer_id' => $signerId,\n 'password' => bcrypt($authCode),\n 'expiration' => time() + (2 * 86400)\n ]);\n $newAuthorizationCode->save();\n $this->authorization_code_id = $newAuthorizationCode->id;\n\n if ($this->id != null) {\n $this->update();\n }\n\n // send out email\n Mail::to($this->email)->send(new SignatureRequest($this, $signerId, $authCode));\n }",
"private function generate_email_verification_key()\n {\n $key = randomNumber(6);\n return $key;\n }",
"function generate_email_activation_key()\r\n\t{\r\n\t\tdo\r\n\t\t{\r\n\t\t\t$this->email_activation_key = strtolower($this->generate_random_password(32));\r\n\t\t}\r\n\t\twhile(!$this->validates_uniqueness_of('email_activation_key'));\t\r\n\t\t\r\n\t\treturn $this->email_activation_key;\r\n\t}",
"protected function genAuthCode()\n {\n return $this->genAccessToken(); // let's reuse the same scheme for token generation\n }",
"function generate_registration_key($email='') {\n\t$uniq = uniqid();\n\t$hash = md5($uniq.$email);\n\treturn $hash;\n}",
"private function generate_code($email, $generated_time)\n {\n return sha1($email . $this->salt . $generated_time);\n\n }",
"private static function generateVerifyCode(): string\n {\n $code = '';\n\n for ($i = 0; $i < 4; $i++) {\n $code .= mt_rand(0, 9);\n }\n\n return $code;\n }",
"public function generateEmailToken()\n {\n $this->email_token = Yii::$app->security->generateRandomString() . '_' . time();\n }",
"protected function generateReminderCode(): string\n {\n return Str::random(32);\n }",
"public function generateTicketCode()\n {\n return uniqid($this->ID);\n }",
"protected function generateActivationCode(): string\n {\n return Str::random(32);\n }",
"private static function _genCode() {\n\t\t$alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$alpha_digits_len = strlen($alpha_digits) - 1;\n\n\t\t$code = '';\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"function encodeUserAuthCode(){\n\tglobal $USER;\n\t$pw=userIsEncryptedPW($USER['password'])?userDecryptPW($USER['password']):$USER['password'];\n\t$auth=array(\n\t\tstr_replace(':','',crypt($_SERVER['UNIQUE_HOST'],$USER['username'])),\n\t\tstr_replace(':','',crypt($USER['username'],$pw)),\n\t str_replace(':','',crypt($pw,$USER['username']))\n\t );\n\t$code=encodeBase64(implode(':',$auth));\n\t//echo \"PW:{$pw} [{$code}]<br>\\n\";\n\treturn $code;\n\t//generate a user auth code GUIDUsernamePasswordMM\n\t$raw='Wa6QI' .':'. $USER['username'] .':'. $pw;\n\t$string=encodeBase64($raw);\n\treturn $string;\n}",
"protected function generateAuthorizationCode()\n {\n $tokenLen = 40;\n if (function_exists('mcrypt_create_iv')) {\n $randomData = mcrypt_create_iv(100, MCRYPT_DEV_URANDOM);\n } elseif (function_exists('openssl_random_pseudo_bytes')) {\n $randomData = openssl_random_pseudo_bytes(100);\n } elseif (@file_exists('/dev/urandom')) { // Get 100 bytes of random data\n $randomData = file_get_contents('/dev/urandom', false, null, 0, 100) . uniqid(mt_rand(), true);\n } else {\n $randomData = mt_rand() . mt_rand() . mt_rand() . mt_rand() . microtime(true) . uniqid(mt_rand(), true);\n }\n return substr(hash('sha512', $randomData), 0, $tokenLen);\n }",
"function GenerateConfirmCode()\n\t{\n\t\tif ($this->confirmcode) {\n\t\t\treturn $this->confirmcode;\n\t\t}\n\n\t\t$code = md5(uniqid(rand(), true));\n\t\t$this->confirmcode = $code;\n\t\treturn $code;\n\t}",
"function generateEncodedActivationKey($email = '')\n {\n $encoded_activation_key = Security::hash($email, ACTIVATION_KEY_ENCODED_ALGORITHM);\n return $encoded_activation_key;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle rec candidate avar file | function handle_rec_candidate_avar_file($id){
if (isset($_FILES['cd_avar']['name']) && $_FILES['cd_avar']['name'] != '') {
hooks()->do_action('before_upload_contract_attachment', $id);
$path = RECRUITMENT_MODULE_UPLOAD_FOLDER .'/candidate/avartar/'. $id . '/';
// Get the temp file path
$tmpFilePath = $_FILES['cd_avar']['tmp_name'];
// Make sure we have a filepath
if (!empty($tmpFilePath) && $tmpFilePath != '') {
_maybe_create_upload_path($path);
$filename = unique_filename($path, $_FILES['cd_avar']['name']);
$newFilePath = $path . $filename;
// Upload the file into the company uploads dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {
$CI = & get_instance();
$attachment = [];
$attachment[] = [
'file_name' => $filename,
'filetype' => $_FILES['cd_avar']['type'],
];
$CI->misc_model->add_attachment_to_database($id, 'rec_cadidate_avar', $attachment);
return true;
}
}
}
return false;
} | [
"public function RiceviFile($fileSdIAccoglienza);",
"function loadfile($handle)\n\t\t{\n\t\tif (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))\n\t\t\treturn true;\n\n\t\tif (!isset($this->file[$handle]))\n\t\t\t{\n\t\t\t$this->halt(\"loadfile: $handle is not a valid handle.\");\n\t\t\treturn false;\n\t\t\t}\n\t\t$filename = $this->file[$handle];\n\n\t\t$str = implode(\"\", @file($filename));\n\t\tif (empty($str))\n\t\t\t{\n\t\t\t$this->halt(\"loadfile: Erreur pendant le chargement de $handle, $filename est vide ou n'existe pas.\");\n\t\t\treturn false;\n\t\t\t}\n\n\t\t$this->set_var($handle, $str);\n\t\t\n\t\treturn true;\n\t\t}",
"public function handles_file($record) {\n\n\t\t \treturn TRUE;\n\n\t\t }",
"abstract protected function readCandidatesData();",
"protected function processarHeaderArquivo($linha) {\n\t\t$vlinha = parent::processarHeaderArquivo($linha);\n\t\t\n\t\t//X = ALFANUMÉRICO 9 = NUMÉRICO V = VÍRGULA DECIMAL ASSUMIDA\n\t\t$vlinha[\"tipo_servico\"] = substr($linha, 12, 15); //LITERAL DE SERVIÇO - X Identificação por Extenso do Tipo de Serviço: \"COBRANCA\"\n\t\tunset($vlinha[\"complemento1\"]);\n\t\tunset($vlinha[\"dv_agencia_cedente\"]);\n\t\t$vlinha[\"complemento_registro\"] = substr($linha, 31, 2);//ZEROS - 9 COMPLEMENTO DE REGISTRO\n\t\t$vlinha[\"conta_cedente\"] = substr($linha, 33, 5); //CONTA - 9 Número da Conta Corrente onde está cadastrado o Convênio Líder do Cedente\n\t\t$vlinha[\"dac\"] = substr($linha, 38, 1); //DAC - 9 DÍGITO DE AUTO CONFERÊNCIA AG/CONTA EMPRESA\n\t\tunset($vlinha[\"dv_conta _cedente\"]);\n\t\t$vlinha[\"cod_banco\"] = substr($linha, 77, 3); //CÓDIGO DO BANCO - 9 NÚMERO DO BANCO NA CÂMARA DE COMPENSAÇÃO\n\t\t$vlinha[\"banco\"] = substr($linha, 80, 15); //NOME DO BANCO - X NOME POR EXTENSO DO BANCO COBRADOR\n\t\t$vlinha[\"densidade\"] = substr($linha, 101, 5); //DENSIDADE - 9 UNIDADE DA DENSIDADE \t\n\t\t$vlinha[\"uni_densidade\"] = substr($linha, 106, 3); //UNIDADE DE DENSID. - X DENSIDADE DE GRAVAÇÃO DO ARQUIVO \n\t\t$vlinha[\"num_seq_arquivo\"] = substr($linha, 109, 5); //Nº SEQ. ARQUIVO RET. - 9 NÚMERO SEQÜENCIAL DO ARQUIVO RETORNO \n\t\t$vlinha[\"data_credito\"] = $this->formataData(substr($linha, 114, 6)); //DATA DE CRÉDITO - 9 DATA DE CRÉDITO DOS LANÇAMENTOS\n\t\t$vlinha[\"uni_densidade\"] = substr($linha, 106, 3); //UNIDADE DE DENSID. - 9 DENSIDADE DE GRAVAÇÃO DO ARQUIVO \n\t\t\n\t\treturn $vlinha;\n\t}",
"private function ParseFile() {\r\n\t\t$this->ini_array = parse_ini_file($this->$results_file, true); //Load the results into a array //\r\n\t}",
"private function feelFile(){\n foreach($this->path as $path){\n $pathExplode = explode('/',$path);\n $ctrl = substr($pathExplode[5], 0,-4);\n if($ctrl == $this->controller){\n $this->file = $path;\n }\n }\n }",
"private function processarArquivo() {\n\n foreach ($this->oLayoutArquivo->getLines() as $oLinha) {\n\n if (empty($oLinha)) {\n continue;\n }\n\n if ($oLinha->codigo_do_registro == 1) {\n $this->validarArquivoConsignadoCaixa($oLinha);\n }\n\n if ($oLinha->codigo_do_registro != 2) {\n continue;\n }\n\n $oRegistro = $this->getDadosFinanciamento($oLinha);\n $this->oArquivoConsignado->adicionarRegistro($oRegistro);\n }\n }",
"function loadFile_Valvulas(){\r\n\t\t$this->load->model('record_Model');\r\n\t\t$tipo = $_FILES['archivo']['type'];\r\n\t\t$tamanio = $_FILES['archivo']['size'];\r\n\t\t$archivotmp = $_FILES['archivo']['tmp_name'];\r\n\r\n\t\t$lineas = file($archivotmp);\r\n\t\t$i = 0;\r\n\r\n\t\tforeach ($lineas as $linea_num => $linea) {\r\n\t\t\t\r\n\t\t\tif($i != 0){\r\n\t\t\t\t$datos = explode(\",\",$linea);\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t//\"id_val\" => trim($datos[0]),\r\n\t\t\t\t\t\"tipo_val\" => trim($datos[1]),\r\n\t\t\t\t\t//\"ubicacion_val\" => trim($datos[2]),\r\n\t\t\t\t\t\"latitud_val\" => trim($datos[3]),\r\n\t\t\t\t\t\"longitud_val\" => trim($datos[4]),\r\n\t\t\t\t\t\"entrada_val\" => trim($datos[5]),\r\n\t\t\t\t\t\"salida_val\" => trim($datos[6]),\r\n\t\t\t\t\t\"observaciones_val\" => trim($datos[7]),\r\n\t\t\t\t\t\"id_entrada_val\" => trim($datos[8]),\r\n\t\t\t\t\t\"id_salida_val\" => trim($datos[9]),\r\n\t\t\t\t\t\"id_dis_val\" => trim($datos[10])\r\n\t\t\t\t);\r\n\t\t\t\t$this->record_Model->write_valvula_csv($data);\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$this->session->set_flashdata('correcto', 'Los datos se cargaron correctamente');\r\n\t\tredirect(base_url().\"Gissat/ajustes\");\r\n\t}",
"function handle_rec_candidate_file($id){\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {\n\n hooks()->do_action('before_upload_contract_attachment', $id);\n $path = RECRUITMENT_MODULE_UPLOAD_FOLDER .'/candidate/files/'. $id . '/';\n // Get the temp file path\n $tmpFilePath = $_FILES['file']['tmp_name'];\n // Make sure we have a filepath\n if (!empty($tmpFilePath) && $tmpFilePath != '') {\n _maybe_create_upload_path($path);\n $filename = unique_filename($path, $_FILES['file']['name']);\n $newFilePath = $path . $filename;\n // Upload the file into the company uploads dir\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\n $CI = & get_instance();\n $attachment = [];\n $attachment[] = [\n 'file_name' => $filename,\n 'filetype' => $_FILES['file']['type'],\n ];\n $CI->misc_model->add_attachment_to_database($id, 'rec_cadidate_file', $attachment);\n\n return true;\n }\n }\n }\n return false;\n}",
"function complete_new_file_info( $fn ){\n\n // Retrieve file path\n $filepath = $this->get_file_info($fn)['filepath'];\n\n // Calculate MD5 sum\n $file_md5 = md5_file($filepath);\n //print $file_md5 . \"<br><br>\\n\";\n\n // Extract id3 tag data\n global $getID3;\n $fid3 = $getID3->analyze($filepath);\n //print_r($fid3['tags']);\n //print \"<br /><br />\";\n\n $filelength = \"\";\n if( isset($fid3['playtime_string']) ) {\n $filelength = $fid3['playtime_string'];\n }\n $filetitle = \"\";\n if( isset($fid3['tags']['id3v2']['title'][0]) ) {\n $filetitle = $fid3['tags']['id3v2']['title'][0];\n }\n $fileauthor = \"\";\n if( isset($fid3['tags']['id3v2']['artist'][0]) ) {\n $fileauthor = $fid3['tags']['id3v2']['artist'][0];\n }\n $audiotype = \"\";\n if( isset($fid3['tags']['id3v2']['genre'][0]) ) {\n $audiotype = $fid3['tags']['id3v2']['genre'][0];\n }\n $passage = \"\";\n if( isset($fid3['tags']['id3v2']['comment'][0]) ) {\n $passage = $fid3['tags']['id3v2']['comment'][0];\n }\n $series = \"\";\n if( isset($fid3['tags']['id3v2']['album'][0]) ) {\n $series = $fid3['tags']['id3v2']['album'][0];\n }\n $tracknumber = 0;\n if( isset($fid3['tags']['id3v2']['track_number'][0]) ) {\n $tracknumber = $fid3['tags']['id3v2']['track_number'][0];\n }\n //print $fileauthor . \" - \" . $series . \" - \" . $tracknumber . \" - \" . $filetitle . \" - \" . $filelength . \" - \" . $audiotype . \" - \" . $passage . \"<br />\\n\";\n\n $fid3 = null;\n\n // Prepare UPDATE statement to update file information in DB\n $update = \"UPDATE files SET md5_sign = :md5,\n length = :length,\n title = :title,\n series = :series,\n tracknumber = :tracknumber,\n audiotype = :audiotype,\n author = :author,\n passage = :passage,\n newfile = 0 WHERE\n filename = :filename\";\n\n $stmt = $this->pdo->prepare($update);\n\n // Bind parameters\n $stmt->bindParam(':md5', $file_md5);\n $stmt->bindParam(':length',$filelength);\n $stmt->bindParam(':title', $filetitle);\n $stmt->bindParam(':series', $series);\n $stmt->bindParam(':tracknumber', $tracknumber);\n $stmt->bindParam(':audiotype', $audiotype);\n $stmt->bindParam(':author', $fileauthor);\n $stmt->bindParam(':passage', $passage);\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n return;\n }",
"function readData($info){\n\n $file = file(\"/etc/floucapt/webConf.ini\") or die(writeDefault()); // Read data into webConf.ini or call writeDefault()\n\n $retour = \"\";\n if($info == \"name\"){ // Tab name\n $retour = $file[1];\n }\n elseif($info == \"adOne\"){ // Link of the first picture advertisement\n $retour = $file[2];\n }\n elseif($info == \"adOneL\"){ // Link first advertisement\n $retour = $file[3];\n }\n elseif($info == \"adTwo\"){ // Link of the second picture advertisement\n $retour = $file[4];\n }\n elseif($info == \"adTwoL\"){ // Link second advertisement\n $retour = $file[5];\n }\n elseif($info == \"adV\"){ // number in millisecond for advertisement visible\n $retour = $file[6];\n }\n elseif($info == \"adI\"){ // number in millisecond for repeat visible\n $retour = $file[7]; \n }\n elseif($info == \"about\"){ // About Text\n for( $i = 8; $i < count($file); $i++ ){ // Read all end data\n $retour .= $file[$i];\n }\n }\n return $retour; //return information\n}",
"public function processFile() {\n\n $ext = Utils::getFileExtension($this->inputFile); \n\n # composition: load the appropriate parser\n # get the tuple of dictionaries for all the users in the data file\n switch($ext){\n\n case \"csv\":\n echo(\"parsing the csv file\\n\");\n require_once(\"./modules/csv_parser.php\");\n $parser = new CsvParser($this->inputFile);\n break;\n\n case \"yml\":\n echo(\"parsing the yml file\\n\");\n require_once(\"./modules/yml_parser.php\");\n $parser = new YmlParser($this->inputFile);\n break;\n\n case \"xml\":\n echo(\"parsing the xml file\\n\");\n require_once(\"./modules/xml_parser.php\");\n $parser = new XmlParser($this->inputFile);\n break;\n\n default:\n echo(\"file type not supported\\n\");\n return null;\n }\n\n # read file contents \n $parser->parseFile();\n # process file contents based on certain criteria \n $parser->processFile();\n # return parsed value\n $this->data = $parser->getValue(); \n \n }",
"public function fasta_read($file,$path_input){\n\n $file_in = $path_input.$file;\n $file_ch = FCPATH.$file_in;\n $check = \"\";\n $myfile = fopen($file_ch,'r') or die (\"Unable to open file\");\n while(($lines = fgets($myfile)) !== false){\n \n $check = substr($lines,0,1);\n break;\n }\n fclose($myfile);\n if($check == '>'){\n return true;\n }else{ \n unlink($file);\n return false;\n }\n }",
"public function parseVariationStatus() {\n try {\n if ($this->getImport()->options['is_variable_product_enabled'] == 'xpath' && \"\" != $this->getImport()->options['single_variable_product_enabled']){\n $this->data['product_enabled'] = XmlImportParser::factory($this->getXml(), $this->getCompleteVariationsXPath(), $this->getImport()->options['single_variable_product_enabled'], $file)->parse(); $this->tmp_files[] = $file;\n }\n else{\n $this->countVariations && $this->data['product_enabled'] = array_fill(0, $this->countVariations, $this->getImport()->options['is_variable_product_enabled']);\n }\n }\n catch (\\Exception $e) {\n $this->log('<b>ERROR:</b> ' . $e->getMessage());\n }\n }",
"function ivr_filename($agi)\n{\n $res = 0;\n $variable = $agi->get_variable(\"IVR_FILENAME\");\n $IVR_FILENAME = $variable['data'];\n $data = explode(',', $IVR_FILENAME);\n #fIVRPhone,Flag,faddMoney,YPhone,fMoney,fTime,fPhone4\n $fIVRPhone = trim($data[0]);\n $Flag = trim($data[1]);\n $faddMoney = trim($data[2]);\n $YPhone = trim($data[3]);\n $fMoney = trim($data[4]);\n $fTime = trim($data[5]);\n $fPhone4 = trim($data[6]);\n /*\n $fIVRPhone = '18603712677';\n $Flag = '6';\n $faddMoney = '13.66';\n $YPhone = '18603712677';\n $fMoney = '200.55';\n $fTime = '2012121212121212';\n $fPhone4 = '2677';\n */\n\r\n play_balance(108.109);\r\n\n\n if ($Flag == '1')\n {\n $prompt = \"jfw_low_banlace\";\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '2') #$fMoney\n {\n #$fMoney\n $prompt = 'jfw_youhave';\n $agi->stream_file($prompt, '#');\n play_balance($agi, $fMoney);\n $prompt = 'jfw_thanks';\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '3')\n {\n $prompt = \"jfw_config_err\";\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '4')\n {\n $prompt = \"jfw_pay_ok\";\n $agi->stream_file($prompt, '#');\n play_balance($agi, $faddMoney);\n $prompt = \"jfw_pay_ok_hit1\";\n $agi->stream_file($prompt, '#');\n $agi->say_digits($YPhone);\n $prompt = \"jfw_pay_ok_hit2\";\n $agi->stream_file($prompt, '#');\n play_balance_cny($agi, $fMoney);\n\n }\n else if ($Flag == '5')\n {\n $prompt = \"jfw_pay_err5\";\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '6')\n {\n $prompt = \"jfw_pay_err6\";\n $agi->stream_file($prompt, '#');\n play_datetime($agi, $fTime);\n $prompt = \"jfw_pay_err6_1\";\n $agi->stream_file($prompt, '#');\n if ($fPhone4 == '') $fPhone4 = '0';\n $agi->say_digits($fPhone4);\n }\n else if ($Flag == '7')\n {\n $prompt = \"jfw_pay_err7\";\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '8')\n {\n $prompt = \"jfw_pay_err8\";\n $agi->stream_file($prompt, '#');\n }\n else if ($Flag == '9')\n {\n $prompt = \"jfw_pay_err9\";\n $agi->stream_file($prompt, '#');\n }\n else $res = 1;\n return $res;\n\n\n}",
"protected function processRecord(&$record)\n\t{\n\t\t// Record type: LOCAL FILE\n\t\tif ($record['type'] == self::RECORD_LOCAL_FILE) {\n\t\t\t$record += self::unpack(self::FORMAT_LOCAL_FILE, $this->read(26));\n\t\t\t$record['file_name'] = $this->read($record['file_name_length']);\n\t\t\tif ($record['extra_length'] > 0) {\n\t\t\t\t$this->processExtraFields($record);\n\t\t\t}\n\t\t\t$record['next_offset'] = $this->offset + $record['compressed_size'];\n\t\t\t$this->fileCount++;\n\n\t\t\t// Data Descriptor follows file data?\n\t\t\tif ($record['flags'] & self::FILE_DESCRIPTOR_USED) {\n\t\t\t\t$this->seek($record['next_offset']);\n\t\t\t\t$descr = self::unpack(self::FORMAT_DATA_DESCR, $this->read(16));\n\t\t\t\t$record['has_descriptor'] = true;\n\t\t\t\t$record['crc32'] = $descr['crc32'];\n\t\t\t\t$record['compressed_size'] = $descr['compressed_size'];\n\t\t\t\t$record['uncompressed_size'] = $descr['uncompressed_size'];\n\t\t\t\t$record['next_offset'] = $this->offset;\n\t\t\t}\n\t\t}\n\n\t\t// Record type: CENTRAL FILE\n\t\telseif ($record['type'] == self::RECORD_CENTRAL_FILE) {\n\t\t\t$record += self::unpack(self::FORMAT_CENTRAL_FILE, $this->read(42));\n\t\t\t$record['file_name'] = $this->read($record['file_name_length']);\n\t\t\tif ($record['extra_length'] > 0) {\n\t\t\t\t$this->processExtraFields($record);\n\t\t\t}\n\t\t\tif ($record['comment_length'] > 0) {\n\t\t\t\t$record['comment'] = $this->read($record['comment_length']);\n\t\t\t}\n\t\t\t$record['next_offset'] = $this->offset;\n\t\t}\n\n\t\t// Record type: END OF CENTRAL DIRECTORY\n\t\telseif ($record['type'] == self::RECORD_ENDCENTRAL) {\n\t\t\t$record += self::unpack(self::FORMAT_ENDCENTRAL, $this->read(18));\n\t\t\tif ($record['comment_length'] > 0) {\n\t\t\t\t$record['comment'] = $this->read($record['comment_length']);\n\t\t\t}\n\t\t\t$record['next_offset'] = $this->offset;\n\t\t\t$this->fileCount = $record['entries_disk'];\n\t\t}\n\n\t\t// Record type: ZIP64 END OF CENTRAL DIRECTORY\n\t\telseif ($record['type'] == self::RECORD_Z64_ENDCENTRAL) {\n\t\t\t$record += self::unpack(self::FORMAT_Z64_ENDCENTRAL, $this->read(50));\n\t\t\t$record['next_offset'] = $record['offset'] + self::int64($record['central_size'], $record['central_size_high']);\n\t\t\t$this->fileCount = self::int64($record['entries_disk'], $record['entries_disk_high']);\n\t\t}\n\n\t\t// Record type: ZIP64 END OF CENTRAL DIRECTORY LOCATOR\n\t\telseif ($record['type'] == self::RECORD_Z64_ENDCENTRAL_LOC) {\n\t\t\t$record += self::unpack(self::FORMAT_Z64_ENDCENTRAL_LOC, $this->read(16));\n\t\t\t$record['next_offset'] = $this->offset;\n\t\t}\n\n\t\t// Skip everything else\n\t\telse {\n\t\t\t$record['next_offset'] = $this->offset + 1;\n\t\t}\n\n\t\t// Process any version numbers (-> major.minor)\n\t\tif (isset($record['version_made_num'])) {\n\t\t\t$num = $record['version_made_num'];\n\t\t\t$record['made_version'] = floor($num / 10).'.'.($num % 10);\n\t\t}\n\t\tif (isset($record['version_need_num'])) {\n\t\t\t$num = $record['version_need_num'];\n\t\t\t$record['need_version'] = floor($num / 10).'.'.($num % 10);\n\t\t}\n\n\t\t// Process Host OS info\n\t\tif (isset($record['version_made_os'])) {\n\t\t\t$os = $record['version_made_os'];\n\t\t\t$record['made_host_os'] = isset($this->hostOSNames[$os]) ? $this->hostOSNames[$os] : 'Unknown';\n\t\t}\n\t\tif (isset($record['version_need_os'])) {\n\t\t\t$os = $record['version_need_os'];\n\t\t\t$record['need_host_os'] = isset($this->hostOSNames[$os]) ? $this->hostOSNames[$os] : 'Unknown';\n\t\t}\n\n\t\tif ($record['type'] == self::RECORD_LOCAL_FILE || $record['type'] == self::RECORD_CENTRAL_FILE) {\n\n\t\t\t// Is the file encrypted?\n\t\t\tif ($record['flags'] & self::FILE_ENCRYPTED) {\n\t\t\t\t$record['is_encrypted'] = true;\n\t\t\t}\n\n\t\t\t// Is the Central Directory encrypted (masking Local File values)?\n\t\t\tif ($record['flags'] & self::FILE_CDR_ENCRYPTED) {\n\t\t\t\t$this->isEncrypted = true;\n\t\t\t}\n\n\t\t\t// Is this a directory entry? (quick check)\n\t\t\tif ($record['file_name'][$record['file_name_length'] - 1] == '/') {\n\t\t\t\t$record['is_dir'] = true;\n\t\t\t}\n\n\t\t\t// Is UTF8 encoding used?\n\t\t\tif ($record['flags'] & self::FILE_EFS_UTF8) {\n\t\t\t\t$record['is_utf8'] = true;\n\t\t\t}\n\t\t}\n\t}",
"public function generarLocalidad()\n{\n $this->OpenFile();\n\n while(!feof($this->myfile)) {\n $this->linea = fgets($this->myfile); //fgets pasa una linea completa de un archivo (PILA.CSV) a una variable.\n \n $this->datos=explode(\"|\",$this->linea); //Explode devuelve palabra por palabra de lo guardado en$this->linea delimitado por | .\n \n $descripcion=$this->datos[15];\n \n \n $localidad = fopen(\"DAT/LOCALIDAD.DAT\", \"a+\") or die(\"No se puede abrir el archivo!\");\n \n $id_localidad=0;\n $this->found=0;\n \n if ( trim(file_get_contents('DAT/LOCALIDAD.DAT')) == false) //Valido si el archivo esta vacio.\n {\n $id_localidad=1;\n $this->found=0;\n }\n else // Si no esta vacio\n {\n \n while(!feof($localidad)) // Y Mientras no sea fin de archivo\n {\n $this->linea2 = fgets($localidad); //fgets pasa una linea completa de un archivo (ESCUELAS.DAT) a una variable.\n $this->datos2=explode(\"|\",$this->linea2); //Explode devuelve palabra por palabra de lo guardado en$this->linea2 delimitado por | .\n $id_localidad++;\n \n if (!empty($this->datos2[1])) //Valido que el nombre de la escuela no este vacia\n {\n if (strcmp($this->datos[15],$this->datos2[1])==0)//Comparo si el Nombre de la escuela existe en (ESCUELAS.DAT).\n {\n $this->found=1;\n break; // Si existe el registro finalizo la ejecucion.\n }\n }\n } \n }\n fclose($localidad); //Cierro ESCUELAS.DAT\n \n if ($this->found==0) //\n {\n $localidad = fopen(\"DAT/LOCALIDAD.DAT\", \"a+\") or die(\"No se puede abrir el archivo!\");\n $this->miregistro=$id_localidad.\"|\".$this->datos[15];\n \n fputs($localidad,$this->miregistro);\n // \n fclose($localidad);\n }\n \n \n \n }\n \n //CloseFile();\n \n \n echo \"Archivo Localidad OK\";\n echo\"<br>\";\n}",
"function validate_file($instructor, $filename, $filewithpath, $access) {\n $dynamic = '';\n if (is_dir($filewithpath)) {\n return array(False, False, 1, 1, 1, '', $dynamic);\n }\n $today = getdate();\n $open_year = $today['year'];\n $open_month = 1;\n $open_day = 1;\n $cat_file = $filename;\n if (True) {\n $cp = array_reverse(explode('.', basename($filewithpath)));\n if (count($cp) > 3 && is_numeric($cp[1]) && is_numeric($cp[2])) {\n $open_day = intval($cp[1]);\n $open_month = intval($cp[2]);\n $cat_file = $cp[3] . '.' . $cp[0];\n }\n }\n return array(True, True, $open_year, $open_month, $open_day, $cat_file, $dynamic);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
muestra la lista de rubros | function showRubros() {
// obtiene los rubros del modelo
$rubros = $this->model1->getAll();
// actualizo la vista
$this->view->showRubros($rubros);
//var_dump($rubros);
//die;
} | [
"private function getMagRubs() {\n\t\t\t//PDO\n\t\t\t$query = $this->pdo->prepare(\"SELECT id, titre, titreind, ordre, titreall FROM 2emag_rubriques ORDER BY id ASC\");\n\t\t\t$query->execute();\n\t\t\t//Création array\n\t\t\t$rubriques = array();\n\t\t\t//Boucle\n\t\t\twhile ($data = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$rubriques[] = array(\n\t\t\t\t\t'id' => $data['id'],\n\t\t\t\t\t'titre' => $data['titre'],\n\t\t\t\t\t'titreind' => $data['titreind'],\n\t\t\t\t\t'ordre' => $data['ordre'],\n\t\t\t\t\t'titreall' => $data['titreall'],\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Smarty\n\t\t\t$this->smarty->assign('rubriques', $rubriques);\n\t\t}",
"static public function \tctrListarRubros(){\n\n\t\t$respuesta = ModeloProductos::mdlListarRubros(\"Rubro\");\n\n\t\tforeach ($respuesta as $row => $item){\n\n\t\t\techo '<option value=\"'.$item[\"RubroID\"].'\">'.$item[\"Nombre\"].'</option>';\n\t\t}\n\n\t}",
"public function listaRelaciones();",
"function ciag_liste_grpauteurs_de_rubrique_par_heritage($id_rubrique){\n\t$grpauteurs = array();\n\t\n\tif ($id_rubrique = intval($id_rubrique)) {\n\n\t\t// rubriques ascendantes\n\t\t$result = sql_select(\"id_parent\", \"spip_rubriques\", \"id_rubrique=\".$id_rubrique, \"\", \"\");\n\t\tfor (;;) {\n\t\t\t$id_parent = '';\n\t\t\twhile ($row = sql_fetch($result)) {\n\t\t\t\t$id_parent = $row[\"id_parent\"];\n\t\t\t\t$grpauteurs = array_merge($grpauteurs, ciag_liste_grpauteurs_de_rubrique($id_parent));\t\n\t\t\t}\n\t\t\tif (!$id_parent) break;\n\t\t\t$result = sql_select(\"id_parent\", \"spip_rubriques\", \"id_rubrique=\".$id_parent, \"\", \"\");\n\t\t}\n\t}\n\t\n\treturn $grpauteurs;\n}",
"public function getAllSubRedlite();",
"public function listeRubrique(){\n\t\t\t\t\t $sql = \"SELECT * FROM rubrique\";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetchAll();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function listeSous_rubrique(){\n\t\t\t\t\t $sql = \"SELECT * FROM sous_rubrique\";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetchAll();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function ListarRepartidores()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT * FROM usuarios WHERE nivel = 'REPARTIDOR' and empresa = \" . $_SESSION[\"empresa\"] . \"\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}",
"public function get_all_recette_list()\n {\n $list_recette = Connector::prepare(\"SELECT * FROM recette INNER JOIN img ON recette.id_r = img.recetteid_r GROUP BY recette.id_r ORDER BY recette.id_r DESC\");\n return $list_recette;\n }",
"function afficher_rubriques($titre_table, $requete) {\n\tglobal $connect_id_auteur;\n\tglobal $spip_lang_rtl;\n\n\t$tranches = afficher_tranches_requete($requete, 2);\n\n\tif (strlen($tranches)) {\n\n\t\tif ($titre_table) echo \"<div style='height: 12px;'></div>\";\n\t\techo \"<div class='liste'>\";\n\t\t//debut_cadre_relief(\"rubrique-24.gif\");\n\n\t\tif ($titre_table) {\n\t\t\tbandeau_titre_boite2($titre_table, \"rubrique-24.gif\", \"#999999\", \"white\");\n\t\t}\n\t\techo \"<table width=100% cellpadding=3 cellspacing=0 border=0 background=''>\";\n\n\t\techo $tranches;\n\n\t\t$result = spip_query($requete);\n\n\t\t$table = '';\n\t\twhile ($row = spip_fetch_array($result)) {\n\t\t\t$vals = '';\n\n\t\t\t$id_rubrique = $row['id_rubrique'];\n\t\t\t$id_parent = $row['id_parent'];\n\t\t\t$tous_id[] = $id_rubrique;\n\t\t\t$titre = $row['titre'];\n\t\t\t\n\t\t\tif ($id_parent == 0) $puce = \"secteur-12.gif\";\n\t\t\telse $puce = \"rubrique-12.gif\";\n\n\t\t\t$s = \"<b><a href=\\\"naviguer.php3?id_rubrique=$id_rubrique\\\">\";\n\t\t\t$s .= http_img_pack($puce, '- ', \"border='0'\");\n\t\t\t$s .= typo($titre);\n\t\t\t$s .= \"</A></b>\";\n\t\t\t$vals[] = $s;\n\n\t\t\t$s = \"<div align=\\\"right\\\">\";\n\t\t\t$s .= \"</div>\";\n\t\t\t$vals[] = $s;\n\t\t\t$table[] = $vals;\n\t\t}\n\t\tspip_free_result($result);\n\n\t\t$largeurs = array('', '');\n\t\t$styles = array('arial2', 'arial2');\n\t\tafficher_liste($largeurs, $table, $styles);\n\n\t\techo \"</TABLE>\";\n\t\t//fin_cadre_relief();\n\t\techo \"</div>\";\n\t}\n\treturn $tous_id;\n}",
"function courtjus_objets_in_rubrique($id_rubrique) {\n\t// On va compter le nombre d'objet présent dans la rubrique\n\t$tables = courtjus_trouver_objet_rubrique();\n\n\t// on va compter le nombre d'objet qu'il y a dans la rubrique.\n\t$objets_in_rubrique = array();\n\n\t// On boucle sur tout les table qui pourrait être ratacher à une rubrique\n\tforeach ($tables as $table) {\n\t\t// Simplification des variables. On a besoin du titre pour trouver le num titre\n\t\tlist($table, $titre) = $table;\n\t\t// L'objet\n\t\t$objet = table_objet($table);\n\t\t// l'identifiant de l'objet\n\t\t$champs_id = id_table_objet($table);\n\t\t// Le champ qui contient la date\n\t\t$champ_date = objet_info($objet, 'date');\n\n\t\t// Les champs qui seront utilisé pour la requête.\n\t\t$champs = array(\n\t\t\t$champs_id,\n\t\t\t$titre,\n\t\t\t// Convertir la date de l'objet en timestamp, cela permettra une comparaison rapide\n\t\t\t'UNIX_TIMESTAMP('.$champ_date.') AS '.$champ_date\n\t\t);\n\n\t\t// Le where\n\t\t$where = array(\n\t\t\t'id_rubrique='.intval($id_rubrique),\n\t\t\t'statut='.sql_quote('publie')\n\t\t);\n\n\t\t// Est-ce qu'il faut prendre en compte la langue ?\n\t\tinclude_spip('formulaires/configurer_multilinguisme');\n\t\tif (table_supporte_trad($table)) {\n\t\t\t$where[] = 'lang='.sql_quote($GLOBALS['spip_lang']);\n\t\t}\n\n\t\t// On récupère les objets de la rubrique.\n\t\t$objets_rubrique = sql_allfetsel($champs, $table, $where);\n\n\t\t// On boucle sur les objets à l'intérique de la rubrique.\n\t\tforeach ($objets_rubrique as $objet_rubrique) {\n\n\t\t\t$num_titre = recuperer_numero($objet_rubrique['titre']);\n\n\t\t\t// On créer le tableau contenant les données de l'objet\n\t\t\t$objets_in_rubrique[] = array(\n\t\t\t\t'id_objet' => $objet_rubrique[$champs_id],\n\t\t\t\t'objet' => $objet,\n\t\t\t\t'num_titre' => $num_titre,\n\t\t\t\t'date' => $objet_rubrique[$champ_date]\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $objets_in_rubrique;\n}",
"public static function getLstRapport(){\n\t\t$query = MonPdo::getInstance()->query('SELECT * FROM rapport_visite');\n\t\treturn $query->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE, 'RapportVisite');\n\t}",
"public function getRubricas() {\n }",
"function cargarRamaDisponibles(){\n\t\t$data = array(); \n\t\t$q = $this->db->query(\"SELECT \n\t\t\t\t\t\t\t\te.enlaceTitulo as 'enlaceTitulo',\n\t\t\t\t\t\t\t\te.enlaceNombre as 'enlaceNombre',\n\t\t\t\t\t\t\t\te.paginaUrl\tas 'paginaUrl',\n\t\t\t\t\t\t\t\te.microFormatos as 'microFormatos',\n\t\t\t\t\t\t\t\te.ramaID as 'ramaID',\n\t\t\t\t\t\t\t\tr.ramaNombre as 'ramaNombre',\n\t\t\t\t\t\t\t\te.giros as 'menuTipo',\n\t\t\t\t\t\t\t\te.subMenu as 'subMenu',\n\t\t\t\t\t\t\t\te.enlaceID as 'enlaceID'\n\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t productos p\n\t\t\t\t\t\t\t LEFT JOIN enlaces e ON e.ramaID=p.ramaID\n\t\t\t\t\t\t\t LEFT JOIN ramas r ON r.ramaID=e.ramaID\n\t\t\t\t\t\t\t WHERE e.giros = 'rama'\n\t\t\t\t\t\t\t group by enlaceTitulo\n\t\t\t\t\t\t\t order by e.enlaceOrden\n\t\t\t\t\t\t\t\t\");\n\t\tif($q->num_rows() > 0) {\n\t\t\tforeach($q->result() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\t$q->free_result(); \t\n\t\t}\n\t\treturn $data;\n\t}",
"function cirr_tableau_rubriques_auteur() {\n\tif (isset($GLOBALS['visiteur_session']['id_auteur']) AND $GLOBALS['visiteur_session']['id_auteur'])\n\t\treturn liste_rubriques_auteur($GLOBALS['visiteur_session']['id_auteur']);\n\telse\n\t\treturn array(0);\n}",
"public function get_Rangos() {\n\n $sqlconsultaRangos = (\"SELECT R.id_rango_ventas, R.descripcion FROM rango_ventas R WHERE 1\");\n\n $resRangos = $this->db->query($sqlconsultaRangos);\n while ($filaR = $resRangos->fetch_row()) {\n $this->rango[] = $filaR;\n }\n\n $resRangos->close();\n //$this->db->close();\n\n return $this->rango;\n }",
"function getGroupes ( ) {\n // Récupération de la liste des groupes.\n $param['nomBase'] = cfg_db ;\n $param['aw'] = \" AND idapplication=\".IDAPPLICATION.\" ORDER BY nomgroupe ASC\" ;\n $req = new clResultQuery ;\n $res = $req -> Execute ( \"Fichier\", \"getGroupesApplication\", $param, \"ResultQuery\" ) ;\n // Formatage de cette liste pour l'insérer directement dans ModeliXe.\n for ( $i = 0 ; isset ( $res['idgroupe'][$i] ) ; $i++ ) { \n // Récupération de la liste des groupes.\n $param['idgroupe'] = $res['idgroupe'][$i] ;\n $req = new clResultQuery ;\n $ras = $req -> Execute ( \"Fichier\", \"getNombreActeurs\", $param, \"ResultQuery\" ) ;\n $tab[$res['idgroupe'][$i]] = $res['nomgroupe'][$i].\" (\".(isset($ras['nb'][0])?$ras['nb'][0]:0).\")\" ; \n }\n if ( is_array ( $tab ) )\n // On renvoie la liste.\n return $tab ;\n else return array ( ) ;\n }",
"public function getObjectList() {}",
"private function getListedRealtyObjects()\r\n {\r\n return $this->getNodeListFromRawData('immobilie');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the groupColumn according to name else null | public function getColumnByName($columnName)
{
$result = null;
foreach ($this->_groupColumns as $column) {
if ($column->getColumnName() == $columnName) {
$result = $column;
break;
}
}
return $result;
} | [
"public function getDataGroupByName($name) {\n\t\tforeach ($this->datas as $data) {\n\t\t\tif (($data instanceof DataGroup) && $data->getName() == $name) {\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function groupingColumn(){\n return $this->_groupingColumnIndex;\n }",
"public function getColumn($name)\n {\n return isset($this->columns[$name]) ? $this->columns[$name] : null;\n }",
"public function getColumnGroup(): ?string {\n $val = $this->getBackingStore()->get('columnGroup');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'columnGroup'\");\n }",
"public function UserColumn( $name ) {\r\n $fname = $this->event->UserColumn( $name );\r\n if ($fname && array_key_exists( $fname, $this->columns )) return $this->columns[$fname];\r\n return null;\r\n }",
"public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }",
"public function __get($name)\n {\n return (isset($this->columns[$name])) ? $this->columns[$name] : null;\n }",
"public function renderColumnGroup()\n {\n $requireColumnGroup = false;\n foreach ($this->columns as $column) {\n /* @var $column Column */\n if (!empty($column->options)) {\n $requireColumnGroup = true;\n break;\n }\n }\n if ($requireColumnGroup) {\n $cols = [];\n foreach ($this->columns as $column) {\n $cols[] = Html::tag('col', '', $column->options);\n }\n return Html::tag('colgroup', \"\\n\\t\" . implode(\"\\n\\t\", $cols) . \"\\n\");\n } else {\n return '';\n }\n }",
"public function getGroup($name) {\n\t\t$group = $this->options[$name];\n\t\treturn ($group instanceof FORM_SELECT_GROUP) ? $group : null;\n\t}",
"public function getGroupByName($name){\n\t\t$group = $this->db->select(\"SELECT * FROM \" . FW_DB_TABLE_GROUP . \" WHERE \" . FW_DB_TBL_GROUP_NAME . \" = :g_name\",\n\t\t\t\tarray(':g_name' => $name));\n\t\t\n\t\treturn $group;\n\t}",
"private function getColGroup($col)\n {\n if (!$this->hasGroupingRow()) {\n return null;\n }\n\n foreach ($this->getActiveWorksheetProperty('groupings') as $groupName => $groupInfo) {\n if ($col >= $groupInfo['start'] && $col <= $groupInfo['end']) {\n unset($groupInfo, $col);\n\n return $groupName;\n }\n }\n\n throw new Exception(sprintf(\n 'Error: Column %s of worksheet %s not captured by any column group',\n $col,\n $this->activeWorksheet\n ));\n }",
"protected function get_column_parameter($name)\r\n\t{\r\n\t\tif(array_key_exists($name, $this->fields))\r\n\t\t\treturn $this->fields[$name];\r\n\t\t\r\n\t\treturn '';\r\n\t}",
"public function getGroupByColumns()\r\n {\r\n return $this->groupByColumns;\r\n }",
"public function getColumnByName($name)\n {\n foreach($this->columns as $column){\n\t\t\tif($column->getName() == $name){\n\t\t\t\treturn $column;\n\t\t\t}\n\t\t}\n\t\tthrow new Blueberry_Grid_Exception(\n\t\t\t\"Unable to fetch column by name '\".$name.\"'.\"\n\t\t);\n }",
"public function getNameOfAttributeGroup(): ?string\n {\n return $this->nameOfAttributeGroup;\n }",
"public function getWhereGroup($name){\n\t\treturn $this->_where[$name];\n\t}",
"public function getFrontEndUserGroupColumnName() {}",
"public function groupBy($name){\n \t\t$this->groupClause .= \" GROUP BY \". $name;\n }",
"protected function getColumn(string $name)\n {\n // NOTE: It is not guaranteed that we will have only one element here. When adding decorators, the key will not\n // contain the column instance anymore but an array with column instance set at 0 indexes and the rest as decorators.\n // This is enough for fixing this issue right now. We can work on unifying decorator API in a separate PR.\n return is_array($this->columns[$name]) ? $this->columns[$name][0] : $this->columns[$name];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a callout panel | public static function callout($content, $htmlOptions = array())
{
ArrayHelper::addValue('class', Enum::PANEL_CALLOUT, $htmlOptions);
return static::panel($content, $htmlOptions);
} | [
"function wpex_footer_callout() {\n\tif ( wpex_has_callout() ) {\n\t\twpex_get_template_part( 'footer_callout' );\n\t}\n}",
"function wpcampus_print_2017_callout() {\n\t?>\n\t<div class=\"panel\" style=\"text-align:center;\">\n\t\t<h2>WPCampus 2017 Conference on July 14-15</h2>\n\t\t<p><a href=\"https://2017.wpcampus.org/\" style=\"color:inherit;\">WPCampus 2017</a> will take place July 14-15 on the campus of Canisius College in Buffalo, New York. <strong>Ticket sales have closed</strong> but, if you can't join us in person, all sessions will be live-streamed and made available online after the event. Gather with other WordPress users on your campus and create your own WPCampus experience!</p>\n\t\t<a class=\"button expand\" href=\"https://2017.wpcampus.org/\">Visit the WPCampus 2017 website</a>\n\t</div>\n\t<?php\n}",
"function wpcampus_print_events_callout() {\n\t?>\n\t<div class=\"panel\" style=\"text-align:center;\">\n\t\t<p><strong>WPCampus currently hosts one in-person and one virtual conference each year.</strong><br/>We just wrapped <a href=\"https://online.wpcampus.org/\">WPCampus Online 2018</a>. The session recordings are being uploaded. You can <a href=\"https://online.wpcampus.org/schedule/\">view them on the schedule</a>. Our next event will be WPCampus 2018 (in-person). Dates and location to be announced soon.</p>\n\t\t<a class=\"button expand\" style=\"text-decoration:underline;\" href=\"/conferences/\"><strong>Learn more about our conferences</strong></a>\n\t</div>\n\t<?php\n}",
"public function print_callout() {\n\t\t//$this->print_livestream_callout();\n\t\t//$this->print_audit_callout();\n\t}",
"function calloutshortcode( $atts ) {\n\t$a = shortcode_atts( array(\n\t\t'size' => 'onethird',\n\t\t'align' => 'right',\n\t\t'color' => ''\n\t), $atts );\n\n\treturn \"<div class='callout \".$a['size' ].\" \".$a['align'].\" \".$a['color'].\"'>\";\n}",
"public function generateHTML()\n\t{\n\t\t$this->defaultClasses['panel'] = array(\"panel\", \"panel-$this->titleColor\");\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$this->titleControls[\"dismiss\"] \t= $this->dismissButton;\n\t\t$this->titleControls[\"collapse\"] \t= $this->collapseButton;\n\t\t\n\t\t$titleControls = \"\";\n\t\tif (is_array($this->titleControls))\n\t\t{\n\t\t\t$titleControls = '<span id=\"'.$this->id.'-titleControl\" class=\"panel-titel-controls btn-group\">';\n\t\t\tforeach ($this->titleControls as $control)\n\t\t\t{\n\t\t\t\t$titleControls .= \" \".$control;\n\t\t\t}\n\t\t\t$titleControls .= '</span>';\n\t\t\t\n\t\t\tif ($titleControls != \"\"){\n\t\t\t\t$titleControls = $titleControls.' ';\n\t\t\t}\n\t\t}\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$draggable = ($this->draggable === true ? $this->cls_draggable : '') ;\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$panelHeading_cls \t= \"panel-heading\";\n\t\t$panelTitle_cls \t= \"panel-title\";\n\t\t$panelBody_cls\t\t= \"panel-body\";\n\t\t\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$title \t= '<div class=\"'.$panelHeading_cls.$draggable.'\"><label class=\"'.$panelTitle_cls.'\">'. $this->collapseButton . $this->panelTitle . $this->dismissButton.'</label>'. $titleControls .'</div>';\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$footer\t= '';\n\t\tif ($this->footer != \"\"){\n\t\t\t$footer = '<div class=\"panel-footer panel-'.$this->footerColor.'\">'.$this->footer.'</div>';\n\t\t}\n\t\t\n\t\t$com = '\n\t\t<div id=\"'.$this->id.'\" name=\"'.$this->name.'\" title=\"'.$this->title.'\" '.\n\t\t\t$this->getClassString('panel', true).' '.\n\t\t\t$this->getAttributesString().' '.\n\t\t\t$this->getStyleString().\n\t\t\t'>'.\n\t\t\t$title.'\n\t\t\t<div id=\"'.$this->id.'-body\" class=\"'.$panelBody_cls.' collapse in \">'.\n\t\t\t\t$this->content.'\n\t\t\t</div>\n\t\t\t<div class=\"clearfix\"></div>'.\n\t\t\t$footer.'\n\t\t</div>';\n\t\t\n\t\t// write2Debugfile(self::DEBUG_FILENAME, \"\\nHTML_Panel generated\\n\".$com);\n\t\treturn $com;\n\t}",
"function gen_panel($panel_name, $panel_icon, $panel_link, $panel_count, $panel_color)\n\t{\n\techo '<div class=\"col-lg-4 col-md-6\">';\n\t\techo '<div class=\"panel '.$panel_color.'\">';\n\t\t\techo '<div class=\"panel-heading\">';\n\t\t\t\techo '<div class=\"row\">';\n\t\t\t\t\techo '<div class=\"col-xs-3\">';\n\t\t\t\t\t\techo '<span class=\"huge-icon glyphicon '.$panel_icon.'\"></span>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t\techo '<div class=\"col-xs-9 text-right\">';\n\t\t\t\t\techo '<div><h1>'.$panel_count.'</h1></div>';\n\t\t\t\t\techo '<div>'.$panel_name.'</div>';\n\t\t\t\t\techo '</div>';\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\techo '<a href=\"'.$panel_link.'\">';\n\t\t\t\techo '<div class=\"panel-footer\">';\n\t\t\t\t\techo '<span class=\"pull-left\">View '.$panel_name.'</span>';\n\t\t\t\t\techo '<span class=\"pull-right glyphicon glyphicon-circle-arrow-right\"></span>';\n\t\t\t\t\techo '<div class=\"clearfix\"></div>';\n\t\t\t\techo '</div>';\n\t\t\techo '</a>';\n\t\techo '</div>';\n\techo '</div>';\n\t}",
"private function generatePresentation02()\n {\n $objPHPPresentation = new PhpPresentation();\n\n $objPHPPresentation->getDocumentProperties()\n ->setCreator('PHPOffice')\n ->setLastModifiedBy('PHPPresentation Team')\n ->setTitle('Sample 02 Title')\n ->setSubject('Sample 02 Subject')\n ->setDescription('Sample 02 Description')\n ->setKeywords('office 2007 openxml libreoffice odt php')\n ->setCategory('Sample Category');\n\n // master slide\n $masterSlides = $objPHPPresentation->getAllMasterSlides();\n /** @var Slide $objMaster */\n $objMaster = reset($masterSlides);\n\n $objShape = $objMaster->createRichTextShape();\n $objShape->setWidthAndHeight(270, 30)->setOffsetX(600)->setOffsetY(655);\n $objShape->createTextRun(\"Footer\")\n ->getFont()\n ->setName(\"Arial\")\n ->setSize(7);\n $objShape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);\n\n $objShape = $objMaster->createRichTextShape();\n $objShape->setWidthAndHeight(50, 30)->setOffsetX(870)->setOffsetY(655);\n $objShape->createTextRun(\"\")\n ->getFont()\n ->setName(\"Arial\")\n ->setSize(7);\n $objShape->setPlaceHolder(new Placeholder(Placeholder::PH_TYPE_SLIDENUM));\n\n // slide with placeholder\n $currentSlide = $objPHPPresentation->getActiveSlide();\n\n $objShape = $currentSlide->createRichTextShape();\n $objShape->setWidthAndHeight(50, 30)->setOffsetX(870)->setOffsetY(655);\n $objShape->createTextRun(\"\")\n ->getFont()\n ->setName(\"Arial\")\n ->setSize(7);\n $objShape->setPlaceHolder(new Placeholder(Placeholder::PH_TYPE_SLIDENUM));\n\n return $objPHPPresentation;\n }",
"public function buildPaneSummary();",
"function wpmu_pretty_callouts( $atts, $content = null ) {\n\t\n\t$atts = shortcode_atts( array(\n\t\t'align' => ''\n\t), $atts, 'pretty-callout' );\n\t\n\tob_start(); \n\t\n\techo '<aside class=\"pretty-callout ' . $atts['align'] . '\">' . $content . '</aside>';\t\n\t\t\n\treturn ob_get_clean();\n\t\n}",
"private function calendar()\n {\n $calendars = array_map(\n function( $item ){ return basename( $item, '.png' ); },\n array_values ( Kohana::list_files( 'images' . DIRECTORY_SEPARATOR . 'calendar', [ DOCROOT ] ) )\n );\n \n $m = date( 'm' );\n $y = date( 'Y' );\n\n $actual = array_search( sprintf( '%d_%s', $y, $m ), $calendars );\n\n $this->_page->content = View::factory( 'front/tplt/front_tplt_calendar',\n [\n 'actual' => $actual,\n 'months' => __( 'months' ),\n 'm' => $m,\n 'y' => $y,\n 'calendars' => $calendars\n ] );\n\n array_push( $this->styles, 'almafont', 'magnific-popup' );\n\n array_push( $this->scripts, 'magnific-popup', 'calendar' );\n }",
"public function drawCalendar(){\n\t$creator_id = $this->getUserID();\n \t$pageName = \"d3Calendar\";\n\tinclude_once SYSTEM_PATH.'/view/header.tpl';\n include_once SYSTEM_PATH.'/view/d3Calendar.tpl';\n include_once SYSTEM_PATH.'/view/footer.tpl';\n }",
"function build_callout($the_content)\r\n{\r\n global $starttag, $titletag, $closetag, $endtag;\r\n global $callout_options;\t\r\n\t\r\n\t$callout_style = $callout_options['callout_style'];\r\n $callout_title_style = $callout_options['callout_title_style'];\r\n $callout_body_style = $callout_options['callout_body_style'];\r\n\r\n\t$titlepos = strpos($the_content, $titletag, 0); \t// this could be false\r\n\t$closepos = strpos($the_content, $closetag, $titlepos); \t// this should not be false\r\n\tif ($closepos !== false)\r\n\t{\r\n\t\t$endpos = strpos($the_content, $endtag, $closepos);\r\n\t\tif (($titlepos !== false) && ($titlepos < $endpos))\r\n\t\t{\r\n\t\t\t$titlelen = $closepos - ($titlepos + strlen($titletag));\r\n\t\t\t$the_title = substr($the_content, $titlepos + strlen($titletag), $titlelen);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$the_title = 'No title';\r\n\t\t}\r\n\t\t$the_body = substr($the_content, $closepos + 1, $endpos - $closepos - 1);\r\n\r\n\t\t$the_callout = '<DIV style=\"'.$callout_style.'\"><DIV style=\"'.$callout_title_style.\r\n\t\t\t\t\t\t'\">'.$the_title.'</DIV><DIV style=\"'.$callout_body_style.\r\n\t\t\t\t\t\t'\">'.$the_body.'</DIV></DIV>';\r\n\r\n\t\treturn $the_callout;\r\n }\r\n\telse\t// error parsing tags.\r\n\t{\r\n\t\treturn $the_content;\r\n\t}\r\n}",
"public function Show_overlay_contact_code(){\n\t\techo ' \n\t\t <div class=\"apple_overlay\" id=\"contact\">\n\t\t\t\t<div class=\"overlay_vertical\">\n\t\t\t\t\t<div class=\"clear\"></div>';\n\t\t\t\t\t$this->Show_Contact();\n\t\techo '\n\t\t\t\t</div>\n\t\t </div>';\t\n\t}",
"function draw_edit_panel($_PanelName,$mid,$cid,&$c)\n{\n\n $editpanel = new popwin(\"Updating $_PanelName\",1,$mid,$cid);\n $editpanel->draw_head();\n $editpanel->draw_table_s();\n edit_Services($c->get_intype(),$c->get_service());\n echo \"<input type='hidden' name ='panel' value ='$_PanelName'>\";\n //Panel Location Field\n $c_data = array(\"text\",\"location\",$c->get_location(),\"\",\"style='text-transform:uppercase' maxlength='25'\");\n $editpanel->draw_content(\"<b>Location:\",$c_data);\n\n //PanelMouting Options\n $arr_builder = array(\n $c->get_mounting() =>$c->get_mounting(),\n 'Surface' => \"Surface\",\n 'Flush' => \"Flush\",\n );\n $editpanel->draw_selection(\"<center><b>Mounting:</center>\",'mounting',$arr_builder);\n\n //Main Breaker field\n $c_data = array(\"text\",\"breaker\",$c->get_breaker(),\"\",\"style='text-transform:uppercase' maxlength='10'\");\n $editpanel->draw_content(\"<b>Main Breaker:\",$c_data);\n\n //Main Lugs field\n $c_data = array(\"text\",\"lug\",$c->get_lugs(),\"\",\"style='text-transform:uppercase' maxlength='10'\");\n $editpanel->draw_content(\"<b>Main Lugs:\",$c_data);\n\n //Ground Bus field\n $arr_builder = array(\n $c->get_bus() => $c->get_bus(),\n 'Yes' => \"Yes\",\n 'No' => \"No\",\n );\n $editpanel->draw_selection(\"<center><b>Ground Bus:</center>\",'groundbus',$arr_builder);\n\n //Short Circuit Rating field\n $c_data = array(\"text\",\"rating\",$c->get_rating(),\"\",\"onkeypress='return event.charCode >= 0 && event.charCode <= 64'\");\n $editpanel->draw_content(\"<b>Short Circuit Rating:\",$c_data);\n\n //Note Field\n $c_data = array(\"long-text\",\"note\",$c->get_note(),\"\",\"style='text-transform:uppercase' maxlength='255'\");\n $editpanel->draw_content(\"<b>Note:\",$c_data);\n\n if($c->get_intype() ==3)\n {\n if($c->fuse == 1)\n {\n echo \"\n <tr><td><b><center>Switch and Fuse: </center></td>\n <td><center><select id = 2 name='fuse' style='width:175px;height:30px;'>\n <option value='1'>Yes</option>\n <option value='0'>No</option>\n </select></center></td></tr>\n \";\n }\n else\n {\n echo \"\n <tr><td><b><center>Switch and Fuse: </center></td>\n <td><center><select id = 2 name='fuse' style='width:175px;height:30px;'>\n <option value='0'>No</option>\n <option value='1'>Yes</option>\n </select></center></td></tr>\n \";\n }\n }\n else if($c->get_intype() ==4)\n {\n edittranp($c->transize,$c->secvol,$c->monitor);\n }\n\n\n $editpanel->draw_table_e();\n echo \"<input type='submit' name='updatepanel' value='updatepanel' class ='button'>\";\n $editpanel->draw_foot();\n\n\n}",
"function getFlagBannerPanel() {\n return '<div class=\"flag-banner\"></div>'; \n}",
"function drawIndexOutletManage() {\n $this->template->attach($this->resours);\n $this->template->draw('outlet/indexManageOutlet', true);\n }",
"public function viewAddSectionModal()\n {\n $this->render(\"backoffice/Section/view_add_section\", FALSE);\n }",
"public function Show_overlay_abuso(){\n\t\techo ' \n\t\t <div class=\"apple_overlay\" id=\"abuso\">\n\t\t\t\t<div class=\"overlay_vertical\">\n\t\t\t\t\t<div class=\"clear\"></div>';\n\t\t\t\t\t \t$this->Show_abuso();\n\t\techo '\n\t\t\t\t</div>\n\t\t </div>';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For owner to check if all the players have voted | function checkAllVoted($roomId){
$sql = "select count(t.PLAYER) from TEMP_ROOM_" .$roomId. " t where STATUS != 'V' and t.STATUS != 'D';";
$dataProcessor = new DataProcessor();
$res = $dataProcessor -> execute_dql($sql);
$count = $res -> fetch_row()[0];
$res -> free();
return $count;
} | [
"function hasVoted() {\n\t\treturn $this->voteHandler->hasVoted();\n\t}",
"function has_voted($user){\n\t\treturn in_array($user, get_voted_users()); \n\t}",
"public function hasAlreadyVotedById($voterId);",
"function canVote() {\n\t\treturn forge_check_perm('tracker', $this->getID(), 'vote');\n\t}",
"function has_user_voted($plan_id,$operator_id)\n\t {\n\n\t $query=$this->db->query(\"select * from xl_accountplanvote where plan_id='{$plan_id}' and operator_id='{$operator_id}'\");\n\n\t if ($query->num_rows()>0) {\n\t return TRUE;\n\t }\n\n\t return FALSE; \n\t }",
"public function userHasVoted()\n {\n global $_TABLES, $_USER;\n\n $voted = 0;\n if (empty($ip)) {\n $ip = $_SERVER['REAL_ADDR'];\n }\n $ip = DB_escapeString($this->ip);\n $uid = (int)$this->uid;\n $item_id = DB_escapeString($this->item_id);\n\n if ( $uid == 1 ) {\n $sql = \"SELECT id FROM {$_TABLES['rating_votes']}\n WHERE ip_address='$ip'\n AND item_id='$item_id'\";\n } else {\n $sql = \"SELECT id FROM {$_TABLES['rating_votes']}\n WHERE (uid=$uid OR ip_address='$ip')\n AND item_id='$item_id'\";\n }\n $checkResult = DB_query($sql);\n if (DB_numRows($checkResult) > 0) {\n $voted = 1;\n } else {\n $voted = 0;\n }\n return $voted;\n }",
"function IsUserVoted($PUBLIC_VOTE_ID)\n{\n\tglobal $USER, $APPLICATION;\n\t$PUBLIC_VOTE_ID = intval($PUBLIC_VOTE_ID);\n\n\tif ($PUBLIC_VOTE_ID <= 0)\n\t\treturn false;\n\n\t$res = CVote::GetByID($PUBLIC_VOTE_ID);\n\tif($res && ($arVote = $res->GetNext(true, false)))\n\t{\n\t\t$VOTE_USER_ID = intval($APPLICATION->get_cookie(\"VOTE_USER_ID\"));\n\t\t$res = CVote::UserAlreadyVote($arVote[\"ID\"], $VOTE_USER_ID, $arVote[\"UNIQUE_TYPE\"], $arVote[\"KEEP_IP_SEC\"], $USER->GetID());\n\t\treturn ($res != false);\n\t}\n\n\treturn false;\n}",
"function getVoters() {\n\t\tif ($this->voters !== false) {\n\t\t\treturn $this->voters;\n\t\t}\n\n\t\t$this->voters = array();\n\t\tif (($engine = RBACEngine::getInstance())\n\t\t\t&& ($voters = $engine->getUsersByAllowedAction('tracker', $this->getID(), 'vote'))\n\t\t\t&& (count($voters) > 0)) {\n\t\t\tforeach ($voters as $voter) {\n\t\t\t\t$voter_id = $voter->getID();\n\t\t\t\t$this->voters[$voter_id] = $voter_id;\n\t\t\t}\n\t\t}\n\t\treturn $this->voters;\n\t}",
"function hasVoted($user, $voting_id){\n\t\t$voted = false;\n\t\t$db_user = getUser($user);\n\t\tif(isset($db_user)){\n\t\t\t$voted = in_aray($voting_id, $db_user[\"voting\"]);\n\t\t}\n\n\treturn $voted;\n\t}",
"public function countVotes();",
"function isVoteAllowed($ip) {\n $sql = 'SELECT count(*) AS result FROM ' . sql_table('karma')\n . sprintf(\" WHERE itemid=%d AND ip='%s' LIMIT 1\", $this->itemid, sql_real_escape_string($ip));\n return ( intval(quickQuery($sql)) == 0 );\n }",
"private static function checkVotes($partyID,$votedOn,$type,$avatarID)\n {\n $party = new partyController($partyID);\n $voters = $party->getMembers();\n $total = count($voters);\n $votesFor = 0;\n $sixty = $total * 0.599;\n foreach ($voters as $player) {\n $currentPlayer = new avatarController($player);\n $playersVotes = $currentPlayer->getPartyVote();\n if ($type === \"accept\") {\n if ($playersVotes[$votedOn->getAvatarID()] == 1 || $currentPlayer->getAvatarID() === $avatarID) {\n $votesFor++;\n if ($votesFor > $sixty) {\n if ($votedOn->getPartyID() === $party->getPartyID()) {\n $shrineTeam = new shrineTeam();\n if (count($party->getMembers()) === $shrineTeam->getMinPlayers()) {\n return array(\"ALERT\" => 35, \"DATA\" => \"\".$votedOn->getAvatarID());\n }\n $shrineSolo = new shrineSolo();\n if (count($party->getMembers()) === $shrineSolo->getMinPlayers()) {\n return array(\"ALERT\" => 36, \"DATA\" => \"\".$votedOn->getAvatarID());\n }\n } else {\n $shrineTeam = new shrineTeam();\n if (count($party->getMembers()) === $shrineTeam->getMaxPlayers()) {\n return array(\"ALERT\" => 35, \"DATA\" => \"\".$votedOn->getAvatarID());\n }\n $shrineSolo = new shrineSolo();\n if (count($party->getMembers()) === $shrineSolo->getMaxPlayers()) {\n return array(\"ALERT\" => 36, \"DATA\" => \"\".$votedOn->getAvatarID());\n }\n }\n }\n }\n }\n }\n return array(\"SUCCESS\"=>true);\n }",
"function consult_the_voters() {\n \t\t\n \t\tif (!$this->in_power) {\n \t\t\t$this->in_opposition();\n \t\t\treturn;\n \t\t}\n\n \t\tif (!$this->pay('bank', 1000)) { /* referenda cost 1000 */\n \t\t\t $this->cant_pay(1000);\n \t\t\t return;\n \t\t}\n if ($this->referendum()) $this->approve_change(TRUE);\n else $this->disapprove_change();;\n \t}",
"public function hasVoted() {\n\t\treturn (bool) Cookie::get(self::COOKIE_PREFIX . $this->getPoll()->ID);\n\t}",
"function HasUserVoted($id = 0)\r\n{\r\n\tglobal $UNB;\r\n\tif (!$UNB['LoginUserID']) return false;\r\n\r\n\t// Clean parameters\r\n\t$id = intval($id);\r\n\r\n\tif (!$id) $id = $this->ID;\r\n\t$res = $this->db->FastQuery1st('PollUsers', 'VoteNum', 'Thread=' . $id . ' AND User=' . $UNB['LoginUserID']);\r\n\tif ($res === false) return false;\r\n\tif ($res == 0) return true;\r\n\treturn intval($res);\r\n}",
"function _d2d_server_check_whether_voted($did) {\n if (user_is_anonymous()) {\n return -1;\n }\n Global $user;\n $votes = db_select('votingapi_vote')\n ->fields('votingapi_vote')\n ->condition('entity_type', 'd2d_entity')\n ->condition('entity_id', $did)\n ->condition('value_type', 'points')\n ->condition('uid', $user->uid)\n ->execute()\n ->fetchAll(PDO::FETCH_ASSOC);\n if (count($votes) > 0) {\n return 1;\n }\n return 0;\n}",
"public function VotedPresentations()\n {\n return Member::currentUser()->getVotedPresentations();\n }",
"public function isVoted() {\n\t\t$cookie = Cookie::get('filmpoll_' . $this->ID);\n\t\t$session = Session::get('filmpoll_' . $this->ID);\n\t\tif($cookie || $session) {\n\t\t\tCookie::set('filmpoll_' . $this->ID, 1);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"function vote(VoteVO &$vote)\n {\n global $vgDB, $vgDBPrefix;\n\n // Check if user has voted before\n $sql =\"select voteID, choiceID from {$vgDBPrefix}vote where userID = ? and surveyID = ? and presentationID = ?\";\n $rs = $vgDB->Execute($sql, array($vote->getVoterID(), $vote->getSurveyID(), $vote->getPresentationID() ));\n\n if ($rs->RecordCount() >= $vote->getVotesAllowed() )\n {\n //user has more votes than allowed, remove previous vote\n $IDbyOldVote = $rs->fields['voteID'];\n $oldChoiceID = $rs->fields['choiceID'];\n \n $vgDB->Execute(\"update {$vgDBPrefix}vote set choiceID = ? where voteID = ?\",\n array($vote->getChoiceID(), $IDbyOldVote));\n $vgDB->Execute(\"update {$vgDBPrefix}vote_details set voteDate = ?, voteType = ? where voteID = ?\",\n array($vote->getVoteDate(), $vote->getVoteType(), $IDbyOldVote));\n \n //count down the choice.numvotes in previous choice\n $vgDB->Execute(\"update {$vgDBPrefix}choice SET numvotes = numvotes-1 WHERE surveyID = ? AND choiceID = ?\",\n array($vote->getSurveyID(), $oldChoiceID));\n }\n else\n {\n //add new vote\n $vgDB->Execute(\"insert into {$vgDBPrefix}vote (userID, pageID, surveyID, choiceID, presentationID) values(?,?,?,?,?)\",\n array($vote->getVoterID(), $vote->getPageID(), $vote->getSurveyID(), $vote->getChoiceID(),\n $vote->getPresentationID()));\n $voteid = intval($vgDB->Insert_ID());\n $vgDB->Execute(\"insert into {$vgDBPrefix}vote_details (voteID, voteDate, voteType, comments) values(?,?,?,?)\",\n array($voteid, $vote->getVoteDate(), $vote->getVoteType(), 'no comment'));\n }\n //update choice.numvotes field\n $vgDB->Execute(\"update {$vgDBPrefix}choice SET numvotes = numvotes+1 WHERE surveyID = ? AND choiceID = ?\",\n array($vote->getSurveyID(), $vote->getChoiceID()));\n \n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getting a app service provider | public function getAppProvider()
{
return $this->getProvider(app\Provider::class);
} | [
"public function provider(){\n if ( !is_null( $this->provider ) ){\n $classProvider = 'App\\Services\\\\'.$this->provider;\n return new $classProvider( $this->slimApp );\n }\n\n }",
"protected function provider()\n {\n if (empty($this->provider)) {\n $this->provider = new ServiceProvider($this->app());\n }\n\n return $this->provider;\n }",
"private function getProvider()\n {\n if (version_compare(app()->version(), '5.0', '<')) {\n $provider = '\\CodeZero\\Twitter\\ServiceProviders\\Laravel4';\n } else {\n $provider = '\\CodeZero\\Twitter\\ServiceProviders\\Laravel5';\n }\n\n return new $provider($this->app);\n }",
"public function getServiceProvider() {\n return $this->serviceProvider;\n }",
"protected function getAppService()\n {\n return new AppService($this->getInitialContext());\n }",
"public function getServiceProvider(): Provider\n {\n return $this->serviceProvider;\n }",
"protected function getApplicationService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Backend\\\\Http\\\\Application'] = \\TYPO3\\CMS\\Backend\\ServiceProvider::getApplication($this);\n }",
"function app(string $service = null)\n{\n if ($service == null) {\n return Application::getInstance();\n }\n return Application::getInstance()->get($service);\n}",
"protected function getApplication2Service()\n {\n return $this->services['TYPO3\\\\CMS\\\\Frontend\\\\Http\\\\Application'] = \\TYPO3\\CMS\\Frontend\\ServiceProvider::getApplication($this);\n }",
"abstract protected function getServiceProviderClass();",
"public function getProvider(ServiceProvider $provider)\n {\n return $provider;\n }",
"public function getServiceProviderClass()\n {\n return $this->get('provider.class');\n }",
"private function serviceProviders()\n {\n // $this->app->register('...\\...\\...');\n }",
"protected function getProvider()\n {\n $provider = version_compare(Application::VERSION, '5.0', '<')\n ? __NAMESPACE__.'\\Providers\\Laravel4'\n : __NAMESPACE__.'\\Providers\\Laravel5';\n\n return new $provider($this->app);\n }",
"function app($service = null)\n{\n if ($service) {\n return app()->resolve($service);\n }\n\n return Springy\\Core\\Application::sharedInstance();\n}",
"protected function getCommon_AppService()\n {\n $this->services['common.app'] = $instance = new \\Slim\\App($this->get('container'));\n\n $instance->add($this->get('common.middleware.contenttype'));\n\n return $instance;\n }",
"protected function getProvider()\n\t{\n\t\treturn $this->provider;\n\t}",
"abstract public function getApiProvider();",
"private function getApplicationService()\n {\n $service = new ApplicationService();\n $this->assertInstanceOf('\\CPCCore\\Application\\ApplicationService', $service);\n return $service;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Select2 Kategoria wydatku | public function s2_kategorie_wydatku()
{
$this->load->model("Wydatki_model", "wyd");
$this->wyd->kategorie_wydatku();
} | [
"public function select2Categories () {\r\n $categories = get_categories( array( 'hide_empty' => 0 ) );\r\n $catCount = 0;\r\n $categoriesData = '';\r\n foreach( $categories as $category ):\r\n $categoriesData[$catCount]['id'] = $category->term_id;\r\n $categoriesData[$catCount]['text'] = $category->name;\r\n $catCount++;\r\n endforeach;\r\n\r\n return array(\r\n 'categories' => $categoriesData,\r\n 'count' => $catCount\r\n );\r\n }",
"public function select_souscategorie(){\n $spathSQL= $this->GLOBALS_INI[\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATH_MODEL\"] . \"select_souscategorie.sql\";\n $this->resultat[\"devis_select_souscategorie\"]= $this->oBdd->getSelectDatas($spathSQL);\n }",
"public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }",
"public static function categoriesSelect() {\n\t\techo self::getCategoriesSelect();\n\t}",
"public function subcategorias() {\n\t\t\tif ( isset($_POST[\"padre\"])) {\n\t\t\t\t$equal = array (\"idPadre\"=>$this->input->post(\"padre\"));\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($_POST[\"subcate\"])) {\n\t\t\t\t$equal = array (\"id\"=>$this->input->post(\"subcate\"));\n\t\t\t}\n\n\t\t\t$result = $this->Backend_model->select(\"subcategorias\",NULL,$equal);\n\t\t\techo json_encode($result); // Se utiliza el resultado con jquery.\n\n\t}",
"function _select_cat($data) {\n\t\tglobal $mdbd;\n\n\t\t$this->default=''; // domyslnie nie zaznaczony jest zaden produkt\n\n\t\t$title=$data[0];$entries=array();$entr=array();\n\t\tfor ($i=1;$i<sizeof($data);$i++) {\n\t\t\t$entr[$i]=$this->_productsFromCat($data[$i]);\n\t\t} // end for\n\n\t\treset($entr);\n\t\tforeach ($entr as $e) {\n\t\t\twhile (list($id,$name) = each($e)) {\n\t\t\t\t$entries[$id]=$name;\n\t\t\t}\n\t\t} // end foreach\n\n\t\t$name=$this->_name($id,\"basket_cat\");\n\t\tif (! empty($entries)) {\n\t\t\t$this->forms->addSelect($name,$title,$entries,$this->default);\n\t\t\t// $this->forms1->addSelect($name,$title,$entries,$this->default);\n\t\t}\n\n\n\t\treturn(0);\n\t}",
"function categoria($productos) {\r\n $opciones = array(); \r\n foreach($productos->producto as $producto) {\r\n $opciones[] = $producto->categoria;\r\n }\r\n //eliminar los duplicados para mostrar el select con las opciones\r\n $opciones = array_unique($opciones);\r\n\r\n //crear las opciones del select sin repetidos\r\n for ($i=0; $i < count($opciones); $i++) { \r\n echo \"<option value='\" . $opciones[$i] . \"'>\" . ucwords($opciones[$i]) . \"</option>\";\r\n }\r\n }",
"public function mostrar_categorias(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_categoria\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['id']}'>{$row ['nombre']}</option>\"; \n }\n }",
"function getK2categories()\n\t{\n\n\t\t$db = JFactory::getDbo();\n\t\t$query = ' SELECT id as value, name as text ' .\n\t\t\t' FROM #__k2_categories ' .\n\t\t\t' ORDER BY name';\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadAssocList();;\n\t}",
"private function init_kategorien () {\n $res = rex_sql::factory()->setTable(rex::getTable('vhs_kategorie'))->select()->getArray();\n foreach ($res as $item) {\n $this->kategorien[$item['path']] = $item;\n }\n }",
"function obtenerCategorias(){\n\n \t\treturn $this->cuestionario['cuestionario']['categorias']['catego'];\n \t}",
"public function subcat_for_cat() \r\n {\r\n $this->load->model('subcategorias_model');\r\n if (isset($_POST['id_cat'])) \r\n {\r\n $id_cat = $this->input->post('id_cat');\r\n }\r\n else {\r\n $id_cat = 1;\r\n }\r\n $result = $this->subcategorias_model->all_by_cat($id_cat);\r\n foreach ($result as $row) \r\n {\r\n echo '<option value=\"'.$row['id_scat'].'\">'.$row['nombre_scat'].'</option>';\r\n } \r\n }",
"public function getAutocompleteCategoria()\n {\n $options = array(\n 'repository' => \"SistemaGuiasBundle:Categoria\",\n 'field' => \"id\",\n );\n $response = parent::getAutocompleteFormsMwsAction($options);\n\n return $response;\n }",
"function getCategorie()\n\t{\n\t\treturn array(\"Antipasti\",\"Primi Piatti\",\"Teppanyako e Tempure\",\"Uramaki\",\"Nigiri ed Onigiri\",\"Gunkan\",\"Temaki\",\"Hosomaki\",\"Sashimi\",\"Dessert\");\n\t}",
"function getOptCateg() {\n\t$obRequete = new clRequete(BASEXHAM, 'options', array() ,MYSQL_HOST, MYSQL_USER , MYSQL_PASS );\n\t$requete = \"SELECT DISTINCT o.categorie FROM options o WHERE idapplication=\" . IDAPPLICATION ;\n\t$tabResult = $obRequete->exec_requete($requete, 'tab');\n\treturn $tabResult;\n }",
"public function category_dropdown_list(){\n $sql = 'SELECT * FROM category ORDER BY id';\n foreach ($this->conn->query($sql) as $row) {\n echo '<option value=\"'.$row['catname'].'-'.$row['catid'].'\">'.$row['catname'].'</option>';\n }\n }",
"public function category() {\n $cats = Database::select(\"SELECT ca_name FROM categories\"); //categories\n $sub = Database::select(\"SELECT sub_name, ca_id FROM subcategories\"); //subcategories\n $subcategories = [];\n foreach ($sub as $s) {\n $ca_id = $s['ca_id'];\n $ca_name = Database::select(\"SELECT ca_name FROM categories WHERE ca_id = \\\"$ca_id\\\"\")[0]['ca_name'];\n $subcategories = array_merge($subcategories, [[\"sub_name\" => $s['sub_name'], \"ca_name\" => $ca_name]]);\n }\n require_once \"views/category.view.php\";\n }",
"public function categoria()\n\t{\n\t\t$this->cat = $this->get('id');\n\t\t$this->title = 'Gamecentral';\n\t\t$this->location = 'noticias';\n\n\t\t$noticias_total = new Noticia();\n\t\t$noticias_total->search_clause = \"1\";\n\t\t$noticias_total = $noticias_total->read('id');\n\t\t$this->total_noticias = count($noticias_total);\n\n\t\t$noticias = new Noticia();\n\t\t$noticias->search_clause = \"tipo_noticia = '\" . $this->cat . \"'\";\n\t\t$noticias->order_by = \" fecha_publicacion DESC\";\t\t\n\t\t$this->pagination = new pagination('Noticia',6,$noticias->search_clause);\n\t\t$noticias->limit = $this->pagination->limit;\n\t\t$this->noticias = $noticias->read('id, titulo_noticia, tipo_noticia, contenido_noticia, fecha, autor, imagen');\n\t\t$this->include_theme('index','listado');\n\t}",
"public function getCategories();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets Gets Public URL from Crn | public function publicUrlFromCrn($crn)
{
return $this->urlFromCrn($crn, 'Public');
} | [
"public function cdn_url();",
"public function getPublicUri (): string;",
"public function getExternalUrl();",
"public function getUrl($public_id) \n { \n \\Cloudinary::config(array( \n \"cloud_name\" => $this->cloud_name,\n \"api_key\" => $this->api_key,\n \"api_secret\" => $this->api_secret\n ));\n \n return cloudinary_url($public_id);\n }",
"public function getWebUrl(): string;",
"public function publicURL()\n {\n return $this->CDNURI();\n }",
"public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}",
"public function getSsrUrl(): string;",
"public function getPageUrl();",
"public function getPublicUrl()\n\t{\n\t\treturn $this->publicPath .'/'. $this->file->getName();\n\t}",
"public function getContentUrl();",
"public function getBFW_PRPC_URL();",
"public static function getUrl(){\n\t\t$url = \"http://hcm.imeeting.vn/bigbluebutton/\";\n\t\treturn $url; \n\t}",
"public function getPublicUrl()\n {\n $fileNameAndPath = str_replace(PATH_site, '', $this->getFileWithAbsolutePath());\n return '/' . ltrim($fileNameAndPath, '/');\n }",
"public function getRelativeRemoteUrl();",
"private function get_cdn_url() {\n\t\t$obfx_user_data = $this->get_api_data();\n\t\tif ( empty( $obfx_user_data ) ) {\n\t\t\treturn '';\n\t\t}\n\t\tif ( ! isset( $obfx_user_data['image_cdn']['key'] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn sprintf( '%s.i.optimole.com', strtolower( $obfx_user_data['image_cdn']['key'] ) );\n\n\t}",
"function getUrlVCard() {\n\t\t$url = $this->path. $this->url_vcard . urlencode($this->url);\n\t\treturn $url; \n }",
"public function getSourceUrl();",
"public function getURL()\n {\n return $this->uRL;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ordena a melhor review do jogo com id $id | public function actionTopreview($id) {
$model = new $this->modelClass;
$modelReview = new \app\modules\v1\models\Review;
$review = $modelReview::find()->where(['Id_jogo' => $id])->orderBy(['Score' => SORT_DESC])->all();
$jogo = $model::find()->where(['Id' => $id])->all();
/* var_dump($jogo == null);
exit; */
if ($jogo != null and $review != null)
//return['Jogo' => $jogo, 'Review' => $review];
return $review;
if ($review == null)
return null;
return['Nao foi possivel encontrar este jogo.'];
} | [
"function theRatingReview( $id )\r\n\t\t{\r\n\t\t\t$STH = $this->DBH->query('SELECT ratingReview from shdw_products WHERE id ='. $id ); \r\n\t\t\t# Get results by row\r\n\t\t\twhile( $row = $STH->fetch() )\r\n\t\t\t\t$this->ratingReview = $row['ratingReview'];\t\r\n\t\t\t\r\n\t\t\treturn $this->ratingReview;\r\n\t\t\t\r\n\t\t}",
"function review($id, $reviewer_id, $result_id, $comment, $submit = false){\n $review_status_id = REVIEW_REVIEWED;\n if (empty($submit) || strtolower($submit) == 'false') $review_status_id = REVIEW_REVIEWING;\n $result = $this->db->query(\"SELECT * FROM {$this->param['review_table']} WHERE id=$id\");\n $reviewRow = $result->fetch();\n // check if the item has been published\n $result = $this->db->query(\"SELECT * FROM {$this->param['item_table']} WHERE id=\".$reviewRow[$this->param['index_field']]);\n $itemRow = $result->fetch();\n if ($itemRow[$this->param['edit_status_id']] == EDIT_PUBLISHED){\n print_r(\"The Item has been PUBLISHED, can not review it now!!\");\n return EDIT_PUBLISHED;\n }\n \n $valuePair = array(\n $this->param['review_result_id']=>$result_id, \n $this->param['comment']=>$comment, \n $this->param['review_status_id']=>$review_status_id\n );\n//print_r($valuePair);\n $updatedRows = $this->db->update($this->param['review_table'], $valuePair, \"id=$id\");\n if ($updatedRows && $submit){\n $vp = array($this->param['edit_status_id']=>EDIT_REVIEW_REVIEWING, $this->param['review_accepted']=>0, $this->param['review_rejected']=>0);\n/*\n $tmpSql = \"SELECT \".$this->param['review_result_id'].\" as result, count(*) as count FROM \".$this->param['review_table'].\n \" WHERE \".$this->param['index_field'].\"=\".$reviewRow[$this->param['index_field']].\n \" GROUP BY \".$this->param['review_result_id'];\nprint_r($tmpSql); \n*/\n $result = $this->db->query(\"SELECT \".$this->param['review_result_id'].\" as result, count(*) as count FROM \".$this->param['review_table'].\n \" WHERE \".$this->param['index_field'].\"=\".$reviewRow[$this->param['index_field']].\n \" GROUP BY \".$this->param['review_result_id']);\n $reviewerCount = 0;\n while($row = $result->fetch()){\n//print_r($row); \n $reviewerCount ++;\n if ($row['result'] == REVIEW_RESULT_ACCEPT)\n $vp[$this->param['review_accepted']] = $row['count'];\n else if ($row['result'] == REVIEW_RESULT_REJECT)\n $vp[$this->param['review_rejected']] = $row['count'];\n } \n//print_r($vp); \n if ($reviewerCount == $vp[$this->param['review_accepted']] + $vp[$this->param['review_rejected']])\n $vp[$this->param['edit_status_id']] = EDIT_REVIEW_REVIEWED;\n $this->db->update($this->param['item_table'], $vp, \"id=\".$reviewRow[$this->param['index_field']]);\n }\n// print_r($updatedRows);\n return $updatedRows;\n }",
"function appthemes_get_review( $id ) {\n\treturn APP_Review_Factory::retrieve( $id );\n}",
"public function show_review() {\n $id = $_POST['r_id'];\n $review = $this->model->get_review_by_id($id);\n\n echo $review['text'];\n }",
"public function actionReview($id)\n {\n $model = $this->findModel($id);\n\n if('in-review' == $model->status){\n /* no changing of reviewer permitted when module is in-review */\n $enquirySpecialistsList[\"$model->reviewer_id\"] = User::findOne($model->reviewer_id)['name'];\n } else { \n /* get (id,name) as (key,value) array/list of enquiry specialists */\n $subQuery = AuthAssignment::find()->where((['item_name' => 'enquiryspecialist']))->all();\n $subQuery = ArrayHelper::map($subQuery,'user_id','user_id');\n $mainQuery = User::find()->where(['in', 'id', $subQuery])->all();\n $enquirySpecialistsList = ArrayHelper::map($mainQuery, 'id', 'name' ); \n } \n $model->enquirySpecialistsList = $enquirySpecialistsList; \n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->status = 'in-review';\n if($model->owner_id == Yii::$app->user->getId()){\n /* meaning review is submitted by module owner. So review_status has to be 'in-review'*/\n $model->review_status = 'in-review'; \n } \n\n if( ($model->reviewer_id == Yii::$app->user->getId()) and ('approved' == $model->review_status)){\n /* review is approved so ALSO change model status to approved (along with review status).*/\n $model->status = 'approved';\n } \n\n /* adding review comment to review_comment model */\n $modelComment = new ReviewComment();\n $modelComment->commenter_id = Yii::$app->user->getId();\n $modelComment->module_id = $model->id;\n $modelComment->comment = $model->reviewComment;\n $modelComment->review_status_before = $model->review_status;\n $modelComment->review_status_after = $model->review_status;\n $modelComment->save();\n\n $model->save(); \n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('review', [\n 'model' => $model,\n ]);\n }\n }",
"public function reviewAction() {\n $etd = $this->_helper->getFromFedora(\"pid\", \"etd\");\n if (!$this->_helper->access->allowedOnEtd(\"review\", $etd)) return false;\n\n $this->view->etd = $etd;\n $this->view->title = \"Manage : Review record information\";\n // still needs view script - same basic components as submission review,\n // links to accept or request changes\n }",
"function getSpecificReview($reviewId) {\n $db = acmeConnect();\n// $sql = 'SELECT * FROM reviews WHERE reviewId = :reviewId';\n $sql = 'SELECT reviews.reviewId, reviews.reviewText, reviews.reviewDate, inventory.invName, inventory.invId FROM reviews INNER JOIN inventory ON reviews.invId = inventory.invId WHERE reviewId = :reviewId';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':reviewId', $reviewId, PDO::PARAM_INT);\n $stmt->execute();\n $specReview = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $specReview; \n}",
"function getallreview($id) {\n $storeId = Mage::app()->getStore()->getId();\n return Mage::getModel('marketplace/sellerreview')\n ->getCollection()\n ->addFieldToFilter('status', 1)\n ->addFieldToFilter('store_id', $storeId)\n ->addFieldToFilter('seller_id', $id); \n }",
"public function getReview();",
"public function getReviewId();",
"public function reviewer_abstracts_by_id(){\n\t\t\tif($this->session->userdata(\"reviewerLoggedin\") == true){\n\t\t\t\t$abstractID = $this->uri->segment(4);\n\t\t\t\t$reviewerID = $this->session->userdata(\"id\");\n\t\t\t\t$conferenceID = $this->session->userdata(\"conferenceID\");\n\t\t\t\trequire_once(APPPATH.\"controllers/abstractc.php\");\n\t\t\t\t$a = new Abstractc();\n\t\t\t\t$q = $a->select_where(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"abstractID\",\n\t\t\t\t\t\t\"abstractTitle\",\n\t\t\t\t\t\t\"abstractContent\",\n\t\t\t\t\t\t\"abstractImageFolder\",\n\t\t\t\t\t\t\"active\",\n\t\t\t\t\t\t\"approved\"\n\t\t\t\t\t),\n\t\t\t\t\t\"abstractID = $abstractID AND conferenceID = $conferenceID AND (reviewer1 = $reviewerID OR reviewer2 = $reviewerID OR reviewer3 = $reviewerID)\",\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t\tif($q->num_rows() > 0){\n\t\t\t\t\t$aq = $q->result();\n\t\t\t\t\t$rq = $this->reviewers->select_where(array(\"reviewerFirstName\", \"reviewerLastName\"), array(\"reviewerID\" => $reviewerID));\n\t\t\t\t\t$reviewer = $rq->result();\n\t\t\t\t\trequire_once(APPPATH.\"controllers/comment.php\");\n\t\t\t\t\t$c = new comment();\n\t\t\t\t\trequire_once(APPPATH.\"controllers/score.php\");\n\t\t\t\t\t$s = new score();\n\t\t\t\t\t$cq = $c->select_where_reviewer(array(\"commentID\",\"commentContent\", \"commentType\", \"reviewerID\"), array(\"abstractID\" => $abstractID, \"reviewerID\" => $reviewerID));\n\t\t\t\t\t\tif(count($cq > 0)){\n\t\t\t\t\t\t\t$comments = $cq;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$comments = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t$sq = $s->select_where(array(\"scoreID\", \"score\", \"recommendation\"), array(\"abstractID\" => $abstractID, \"reviewerID\" => $reviewerID));\n\t\t\t\t\tif(count($sq) > 0){\n\t\t\t\t\t\t$scores = $sq;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$scores = array();\n\t\t\t\t\t}\n\t\t\t\t\t$result[] = array(\n\t\t\t\t\t\t\"abstractID\" => $abstractID,\n\t\t\t\t\t\t\"abstractTitle\" => $aq[0]->abstractTitle,\n\t\t\t\t\t\t\"abstractContent\" => $aq[0]->abstractContent,\n\t\t\t\t\t\t\"abstractImageFolder\" => base_url().$this->config->item(\"upload_path\").$aq[0]->abstractImageFolder,\n\t\t\t\t\t\t\"reviewerFirstName\" => $reviewer[0]->reviewerFirstName,\n\t\t\t\t\t\t\"reviewerLastName\" => $reviewer[0]->reviewerLastName,\n\t\t\t\t\t\t\"comments\" => $comments,\n\t\t\t\t\t\t\"scores\" => $scores\n\t\t\t\t\t);\n\t\t\t\t\techo json_encode($result);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array());\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function add_review($id, $review){\n\t\t\n\t\tsession_start();\n\t\t\n\t\t// detects if special characters that can be used in a SQL Injection is in the variable and if there are, removes them\n\t\t$regexp=\"^[A-Za-z\\s\\.\\!\\,0-9]+$\";\n\t\tif (!preg_match(\"/$regexp/\",$review)){\n\t\t\t$review = strip_tags($review);\n\t\t\t// adds a warning to the admins that this comment could possibly be an attempted attack on the site\n\t\t\t$review = $review . \" SQL injection attack may have been attempted\";\n\t\t}\n\t\t\n\t\t$conn = connect_db();\n\t\t\n\t\t$owner = $_SESSION['userdata'][0];\n\t\ttry{\n\t\t// inserts the reveiw data of the venue id, the review creator, the review, sets approved to 0 and sets the review date to the current server date and time.\n\t\t$query = \"INSERT INTO reviews (venueID, username, review, approved, reviewdate) VALUES (:venue, :owner, :review, :approved, Now())\";\n\n\t\t$query_prep = $conn->prepare($query);\n\t\t$query_prep->bindValue(\":venue\", $id, PDO::PARAM_STR);\n\t\t$query_prep->bindValue(\":owner\", $owner, PDO::PARAM_STR);\n\t\t$query_prep->bindValue(\":review\", $review, PDO::PARAM_STR);\n\t\t$query_prep->bindValue(\":approved\", FALSE, PDO::PARAM_STR);\n\t\t$query_prep->execute();\n\t\t\n\t\techo \"Your review has been submitted but you will need to wait for an Administrator to approve the review\";\n\t\t\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Connection failed: ' . $e->getMessage();\n\t\t}\n\t\t\n\t}",
"public function CountReviewsByIdTest()\n {\n $id = 184;\n $type = \"\";\n\n $data = $this->countReviewsById($id, $type);\n vd($data);\n }",
"public function getReviewById($id, $dbcon){\n $sql = \"SELECT * FROM customer_review where id = :id\";\n $pst = $dbcon->prepare($sql);\n $pst->bindParam(':id', $id);\n $pst->execute();\n return $pst->fetch(PDO::FETCH_OBJ);\n }",
"public function reviewPageAction() {\n $productid = $this->getRequest ()->getParam ( 'product' );\n /**\n * Get All review collection\n * \n * @var unknown\n */\n $review = Mage::getModel ( 'review/review' )->getResourceCollection ();\n $review->addStoreFilter ( Mage::app ()->getStore ()->getId () )->addStatusFilter ( Mage_Review_Model_Review::STATUS_APPROVED )->addEntityFilter ( 'product', $productid )->setDateOrder ()->addRateVotes ()->load ();\n $review = $review->getData ();\n $htmlValue = \"\";\n if (count ( $review )) {\n /**\n * Get review count.\n */\n $reviewCountCondition = count ( $review );\n for($i = 0; $i < $reviewCountCondition; $i ++) {\n $customerData = Mage::getModel ( 'airhotels/product' )->getCustomerPictureById ( $review [$i] [\"customer_id\"] );\n $htmlValue .= '<div id=\"reviewrapper\">';\n $htmlValue .= '<div class=\"review-product\">';\n $htmlValue .= '<ul>';\n $htmlValue .= ' <li>';\n $htmlValue .= ' <a class=\"customer_img\" href=\"' . Mage::helper ( 'airhotels/product' )->getprofilepage () . 'id/' . $review [$i] [\"customer_id\"] . '\" >';\n /**\n * Day wise $customerData blocked date details\n */\n if ($customerData [0] [\"imagename\"]) {\n $htmlValue .= '<img src=\"' . Mage::getBaseUrl ( 'media' ) . \"catalog/customer/thumbs/\" . $customerData [0] [\"imagename\"] . '\"; alt=\"\">';\n } else {\n $htmlValue .= ' <img src=\"' . Mage::getBaseUrl ( 'skin' ) . 'frontend/default/stylish/images/no_user.jpg' . '\" alt=\"\">';\n }\n $htmlValue .= '</a>';\n $htmlValue .= '<div class=\"review_content_wrapper\"><p class=\"nick_name\">' . $review [$i] [\"nickname\"] . '</p>';\n $htmlValue .= '<p class=\"reviews_title\">' . nl2br ( $review [$i] [\"title\"] ) . '</p>';\n $htmlValue .= '<p class=\"reviews_detail\">' . nl2br ( $review [$i] [\"detail\"] ) . '</p>';\n $htmlValue .= '<p class=\"reviews_created\">' . $review [$i] [\"nickname\"] . \", \" . date ( \"jS, F Y\", strtotime ( $review [$i] [\"created_at\"] ) ) . '</p>';\n $htmlValue .= '</div></li></ul></div></div>';\n }\n } else {\n /**\n * Display message in produt detail page\n * \n * @var unknown\n *\n * @return $htmlValue\n */\n $message = $this->__ ( 'There are no reviews yet for this product. Be the first to write a review' );\n $htmlValue = $htmlValue . $message;\n }\n /**\n * Set html response.\n */\n $this->getResponse ()->setBody ( $htmlValue );\n }",
"public function get_review_by_bookingid($id){\n\t\t\t//echo $id;die;\n\t\t\t$query = $this->db->get_where('user_reviews', array('review_id' => $id));\n\t\t\treturn $result = $query->row_array();\n\t\t}",
"public function GetById($id){\n $id = (int)$id;\n\n $book = $this->GetAllReviews(\"WHERE review_id = $id\");\n return $book[0];\n }",
"function m_reviewHelp() {\n\t\t$this->libFunc->obDb = $this->obDb;\n\t\t$seoTitle = $this->libFunc->m_getSeoTitle($this->request['id']);\n\t\t$this->obDb->query = \"SELECT COUNT(*) as cnt FROM \" . REVIEWHELP . \" WHERE iCustId_FK='\" . $_SESSION['userid'] . \"' AND iReviewId_FK='\" . $this->request['mode'] . \"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif ($rs[0]->cnt == 0) {\n\t\t\t$this->obDb->query = \"INSERT INTO \" . REVIEWHELP . \" (iCustId_FK,iReviewId_FK,iStatus) VALUES('\" . $_SESSION['userid'] . \"','\" . $this->request['mode'] . \"',1)\";\n\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\t$retUrl = $this->libFunc->m_safeUrl(SITE_URL . \"ecom/index.php?action=ecom.pdetails&mode=\" . $seoTitle);\n\t\t$this->libFunc->m_mosRedirect($retUrl);\n\t\texit;\n\t}",
"public function expReviewUpdate($id)\n {\n $expReviewDetails = DB::select(\"select pr.id, pr.review, pr.rating, pr.status, rd.reservation_date, rd.guest_name, rd.guest_email\n from product_reviews as pr inner join reservation_details as rd on rd.id = pr.reserv_id \n where pr.id = '$id'\");\n \n return view('admin.review.experience_review_update',[\"expReviewDetails\" => $expReviewDetails]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render PHP fatal error admin notice. | private static function render_php_fatal_error_admin_notice( WP_Post $post ) {
$error = get_post_meta( $post->ID, self::PHP_FATAL_ERROR_POST_META_KEY, true );
if ( empty( $error ) ) {
return;
}
$error_data = json_decode( $error, true );
if ( ! is_array( $error_data ) || ! isset( $error_data['message'], $error_data['file'], $error_data['line'] ) ) {
return;
}
?>
<div class="notice notice-error">
<p><?php echo AMP_Validation_Manager::get_validate_url_error_message( 'fatal_error_during_validation' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php if ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) : ?>
<blockquote>
<pre><?php echo esc_html( $error_data['message'] ); ?></pre>
</blockquote>
<p>
<?php esc_html_e( 'Location:', 'amp' ); ?>
<code><?php echo esc_html( sprintf( '%s:%d', $error_data['file'], $error_data['line'] ) ); ?></code>
</p>
<?php endif; ?>
</div>
<?php
} | [
"public static function fatalError()\n {\n http_response_code(500);\n $error = error_get_last();\n if($error[\"type\"] === E_ERROR)\n {\n extract(array(\n \"title\" => $error[\"message\"],\n \"file\" => $error[\"file\"],\n \"line\" => $error[\"line\"]\n ));\n ob_start();\n require $_SERVER[\"DOCUMENT_ROOT\"] . \"/public/janpa/error.php\";\n $render_view = ob_get_clean();\n echo $render_view;\n }\n die();\n }",
"public function renderErrorNotAdmin(): void;",
"function cf7pp_my_admin_notice()\n {\n echo '<div class=\"error\">\n\t\t\t<p>' . _e('<b> افزونه درگاه بانکی برای افزونه Contact Form 7 :</b> Contact Form 7 باید فعال باشد ', 'my-text-domain') . '</p>\n\t\t</div>\n\t\t';\n }",
"public function admin_notices() { ?>\n\t\t<?php if( empty( $this->_alertStr ) ) return; ?>\n\t\t<div class=\"updated fade fadeOut\">\n\t\t\t<?php echo $this->_alertStr; ?>\n\t\t</div>\n\t<?php }",
"private function InternalError(){\n $this->AddError(ERROR_HANDLER_SYSTEM, ERROR_HANDLER_ERROR, 0, \"Внутренний сбой обработки ошибок\");\n echo $this->FormMessage(false);\n exit;\n }",
"public function admin_notice_error()\n\t\t{\n\t\t\t$class = 'notice notice-error is-dismissible';\n\t\t\t$message = __('Your PHP have not installed the GD library . Please install the GD library to avoid some errors when using the REST API. ', 'wooconnector');\n\t\t\t$link = __('Install GD library', 'wooconnector');\n\t\t\tprintf('<div class=\"%1$s\"><p>%2$s<a href=\"http://php.net/manual/en/image.installation.php\">%3$s</a></p></div>', esc_attr($class), esc_html($message), esc_html($link));\n\t\t}",
"function acf_render_admin_notices()\n{\n}",
"public function admin_notices() {\n\t\t\tsettings_errors();\n\t\t}",
"public function set_error_hook() {\n\t\t/* translators: %1$s expands to Yoast SEO */\n\t\t$message = sprintf( __( 'Error creating %1$s export: ', 'wordpress-seo' ), 'Yoast SEO' ) . $this->error;\n\n\t\tprintf(\n\t\t\t'<div class=\"notice notice-error\"><p>%1$s</p></div>',\n\t\t\t$message\n\t\t);\n\t}",
"public function show_admin_notice() {\n\n if( $this->statusmESSAGE!=='Active'){\n $class = 'notice notice-error';\n \t$message = 'Invalid license. Response: ' . $this->statusmESSAGE;\n\n \tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', esc_attr( $class ), $message );\n }\n }",
"public function handleError($fatal) {\n\t\t\n\t\tif ($fatal) {\n\t\t\t\n\t\t\t$this->alertAdmin();\n\t\t\t\n\t\t\techo $this->generateFatalHTML();\n\t\t\t\n\t\t\texit; //End The Application.\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\techo $this->generateHTML();\n\t\t\t\n\t\t\texit; //End The Script\n\t\t\t\n\t\t}\n\t}",
"function notices() {\n\t\t?>\n\t\t<div class=\"notice error\">\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t__( '%sPlugin State Switcher%s could not load because of the following errors:', 'plugin-state-switcher' ),\n\t\t\t\t\t'<strong>',\n\t\t\t\t\t'</strong>'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<ul>\n\t\t\t\t<?php foreach ( $this->notices as $notice ) : ?>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<?php echo $notice; ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</ul>\n\t\t</div>\n\t\t<?php\n\t}",
"public function admin_notices() {\n\t\t$user = wp_get_current_user();\n\n\t\t// Return if the provider is not enabled.\n\t\tif ( ! in_array( __CLASS__, Two_Factor_Core::get_enabled_providers_for_user( $user->ID ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if we are not out of codes.\n\t\tif ( $this->is_available_for_user( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"error\">\n\t\t\t<p>\n\t\t\t\t<span><?php printf( // WPCS: XSS OK.\n\t\t\t\t\t__( 'Two-Factor: You are out of backup codes and need to <a href=\"%s\">regenerate!</a>', 'it-l10n-ithemes-security-pro' ),\n\t\t\t\t\tesc_url( get_edit_user_link( $user->ID ) . '#two-factor-backup-codes' )\n\t\t\t\t); ?><span>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}",
"function chipmunk_check_admin_notices() {\n\t$errors = chipmunk_check_requirements();\n\n\tif ( ! empty( $errors ) ) {\n\t\tforeach ( $errors as $error ) { ?>\n\t\t\t<div class=\"notice notice-error\">\n\t\t\t\t<p><?php echo $error; ?></p>\n\t\t\t</div>\n\t\t<?php }\n\t}\n}",
"public function admin_notices() {\n\t\tsettings_errors( $this->args['id'] );\n\t}",
"public function error()\n\t{\n\t\t$view = new Renderer('views/main/');\n\t\t$view->render('error.php');\n\t}",
"function upstream_admin_notices_errors()\n{\n $errors = get_transient('upstream_errors');\n\n if ( ! empty($errors)): ?>\n <div class=\"notice notice-error is-dismissible\">\n <p>\n <?php echo $errors; ?>\n </p>\n </div>\n <?php\n delete_transient('upstream_errors');\n endif;\n}",
"public static function action_admin_notices() {\r\n\t\tGFCommon::display_dismissible_message( false, 'site-wide' );\r\n\t}",
"function pilau_admin_notices() {\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds and displays a recette entity. | public function showAction(Recette $recette)
{
$deleteForm = $this->createDeleteForm($recette);
return $this->render('recetteclient/show.html.twig', array(
'recette' => $recette,
'delete_form' => $deleteForm->createView(),
));
} | [
"function action_show_entity_detail() {\n $rc = rcmail::get_instance();\n\n /** @var rcmail_output_html $output */\n $output = $rc->output;\n\n $type = $this->getInput(self::INPUT_ENTITY_TYPE, rcube_utils::INPUT_GET);\n\n switch ($type) {\n case self::ENTITY_FILTER:\n $title = $this->gettext('rubik_filter.title_filter_form');\n break;\n case self::ENTITY_VACATION:\n $title = $this->gettext('rubik_filter.title_vacation_form');\n break;\n case self::ENTITY_REPLY:\n $title = $this->gettext('rubik_filter.title_reply_form');\n break;\n default:\n $title = '';\n break;\n }\n\n $output->set_env('rubik_details_title', $title);\n\n $output->send('rubik_filter.rubik_entity_details');\n }",
"public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tournois = $em->getRepository('EntityBundle:Tournoi')->findAll();\n return $this->render('tournoi/show.html.twig', array(\n 'tournois' => $tournois,\n\n ));\n }",
"public function recette()\n {\n $this->render('recettes');\n }",
"public function showAction($id,$uid)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ProductionBundle:AffectationEtapeUtilisateur')->find($id);\n\n /*var_dump(count($entity));\n die('here');\n */\n\n $entities = $em->getRepository('ProductionBundle:AffectationEtapeUtilisateur')->findBy(array('idLigneBc' => $uid),array('idEtape' => 'DESC'));\n\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find AffectationEtapeUtilisateur entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ProductionBundle:AffectationEtapeUtilisateur:show.html.twig', array(\n 'entity' => $entity,\n 'entities' => $entities,\n 'idbc' =>$uid,\n 'id'=>$id,\n\n ));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('RocketSellerTwoPickBundle:Invitation')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Invitation entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('RocketSellerTwoPickBundle:Invitation:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function showAction(Reception $reception) {\n $deleteForm = $this->createDeleteForm($reception);\n $em = $this->getDoctrine()->getManager();\n\n $articleInterv = $em->getRepository('PressingBundle:ArticleIntervenant')->findBy(array('idReception' => $reception));\n\n $avance = $reception->getMontantVerse();\n $entreFi = $em->getRepository('PressingBundle:EntreFinance')->findBy(array('reception' => $reception));\n foreach ($entreFi as $entre) {\n $avance+= $entre->getMontant();\n }\n $reception->setMontantVerse($avance);\n\n return $this->render('reception/show.html.twig', array(\n 'reception' => $reception,\n 'delete_form' => $deleteForm->createView(),\n 'articleInterv' => array_reverse($articleInterv)\n ));\n }",
"public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n $id = $_GET['id'];\n $entity = $em->getRepository('BackendBundle:Bulto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Bulto entity.');\n }\n\n return $this->render('BackendBundle:Bulto:show.html.twig', array(\n 'entity' => $entity\n ));\n }",
"public function detailstacheAction() {\n\n\t\t$sessionmembre = new Zend_Session_Namespace('membre');\n\t\t//$this->_helper->layout->disableLayout();\n\t\t$this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n\t\tif (!isset($sessionmembre->code_membre)) {\n\t\t\t$this->_redirect('/');\n\t\t}\n\tif (!isset($sessionmembre->code_membre)) {$this->_redirect('/');}\nif($sessionmembre->confirmation_envoi != \"\"){$this->_redirect('/espacepersonnel/confirmation');}\n\n\t\t\t$id = (int)$this->_request->getParam('id');\n\t\t\tif ($id > 0) {\n\t\t$a = new Application_Model_EuTache();\n\t\t$ma = new Application_Model_EuTacheMapper();\n\t\t$ma->find($id, $a);\n\t\t$this->view->tache = $a;\n\t\t\t}\n\n\t}",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('BackendBundle:Requerimiento')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No existe el requerimiento solicitado.');\n }\n\n return $this->render('BackendBundle:Requerimiento:show.html.twig', array(\n 'entity' => $entity,\n ));\n }",
"public function showReceiveAction()\n {\n $user = $this->getUser(); // get current user\n\n if(!$user) {\n throw $this->createNotFoundException(\"User Not Found, You must authenticate first \");\n }\n\n // use grid\n $noteGrid = $this->container->getParameter('yit_notification.note_grid');\n\n if($noteGrid){\n\n // adding actions\n $tr = $this->get('translator');\n\n // Creates a simple grid based on your entity (ORM)\n $source = new Entity('YitNotificationBundle:NotificationStatus');\n\n // create query\n $entity = $source->getTableAlias();\n\n $source->manipulateQuery(\n function ($query) use ($entity, $user)\n {\n $query->andWhere($entity . '.toUser = ' . $user->getId());\n }\n );\n\n // Get a Grid instance\n $grid = $this->get('grid');\n\n // add checkbox with delete action\n $grid->addMassAction(new DeleteMassAction());\n\n $grid->setDefaultOrder('id', 'desc');\n\n $rowAction = new RowAction($tr->trans('delete', array(), 'note'), 'delete');\n\n $grid->addRowAction($rowAction);\n\n // Attach the source to the grid\n $grid->setSource($source);\n\n // adding exports\n $grid->addExport(new CSVExport('CSV', 'place_list'));\n\n $grid->addExport(new ExcelExport('Excel', 'place_list'));\n\n $grid->addExport(new PHPExcelPDFExport('PDF', 'place_list'));\n\n\n return $grid->getGridResponse('YitNotificationBundle:Main:showReceive.html.twig',\n array('noteGrid' => $noteGrid));\n }\n else {\n\n $em = $this->getDoctrine()->getManager(); //get entity manager\n\n // return all receives notes, or null\n $receives = $em->getRepository(self::ENTITY)->findAllReceiveByUserId($user->getId());\n\n // get pagination\n $paginator = $this->get('knp_paginator');\n\n //get count off notes in page\n $per_page = $this->container->getParameter('yit_notification.item_notes_page');\n\n //number of pages\n $pagination = $paginator->paginate($receives, $this->get('request')->query->get('page', 1), $per_page );\n\n //get note`s count, and set it in twig global\n $this->getNoteCount();\n\n $templates = $this->container->getParameter('yit_notification.templates.showReceive'); // get templates name\n return $this->render( $templates, array('receives' => $pagination));\n }\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CMSRepresentanteBundle:Representante')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Representante entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CMSRepresentanteBundle:Representante: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('AEDashBundle:Factures')->find($id);\n\n $entreprise = $entity->getEntreprise();\n $factureProduit = $em->getRepository('AEDashBundle:FactureProduit')->findOneByFactures($entity);\n\n if (!$entity) {\n throw $this->createNotFoundException('Entité Factures impossible à trouver.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AEDashBundle:Factures:show.html.twig', array(\n 'entity' => $entity,\n 'entreprise' => $entreprise,\n 'factureProduit' => $factureProduit,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Recibo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Recibo entity.');\n }\n\n return $this->render('BackendBundle:Recibo:show.html.twig', array(\n 'entity' => $entity,\n ));\n }",
"public function showAction()\n {\n $stmt = $this->getDoctrine()->getEntityManager()\n ->getConnection()\n ->prepare('SELECT * FROM V_NOTE');\n $stmt->execute();\n $result = $stmt->fetchAll();\n return $this->render('EspritUserBundle:EspNote:show.html.twig', array(\n 'result' => $result,\n ));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('RudakPartnerBundle:Partner')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Partner entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('RudakPartnerBundle:Partner:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function get_recette_object($id) {\n\n\t\t$query = $this->db->query(\"SELECT * FROM recette WHERE id_recette = ?\", array($id));\n\n\t\treturn $query->row();\n\n\t}",
"public function showAction($id)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('InventarioFrontBundle:Terceros')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Terceros entity.');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('InventarioFrontBundle:Terceros:show.html.twig', array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(), ));\r\n }",
"public function showAction(Factures $facture)\n {\n $em = $this->getDoctrine()->getManager();\n $img = $em->getRepository('CommandesBundle:Logos')->findOneBy(array('user' => $this->getUser()),array('id' => 'DESC'));\n $imgCachet = $em->getRepository('CommandesBundle:Cachets')->findOneBy(array('user' => $this->getUser()),array('id' => 'DESC'));\n\n\n $suivi = $em->getRepository('CommandesBundle:SuiviFacts')->findByFacture($facture);\n $ventes = $em->getRepository('CommandesBundle:Ventes')->findBy(array('factures'=>$facture));\n return $this->render('factures/show.html.twig', array(\n 'facture' => $facture,\n 'ventes' => $ventes,\n 'suivi' => $suivi,\n 'logo' => $img,\n 'cachets' =>$imgCachet,\n\n\n ));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EmisionesBundle:Agente')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Agente entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EmisionesBundle:Agente:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get request to fetch the users current signature | public function getSignature(Request $request) {
$user = $request->get('auth');
$userdata = UserHelper::getUserDataOrCreate($user->userId);
return response()->json(
[
'signature' => $userdata->signature,
'parsedSignature' => $userdata->getParsedSignature()
]
);
} | [
"private function get_signature()\n {\n }",
"public function getSignatureStatus(){\n $command = new Command($this->host, self::SIGNATURES_GET,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n return $command->getData(\"signature\");\n }",
"private function getSignature()\n {\n return hash(\"sha256\", $this->public_key . $this->secret_key . time());\n }",
"public function getRawSignedRequest()\r\r\n {\r\r\n return $this->getRawSignedRequestFromCookie();\r\r\n }",
"private function signature(){\n $this->params['api_sig'] = StileroFlickrSignature::getSignature($this->params, $this->Api);\n }",
"public function getSignature();",
"function sign()\n{\n\techo get_signature();\n}",
"public function getSignedRequest()\n {\n return $this->signedRequest;\n }",
"public function getSignature()\n {\n return $this->_get('gor_signature');\n }",
"public function getSignatureRequestKey();",
"protected function getSignedRequest()\n {\n return array('page' => array('id' => '467559170011758', 'liked' => true, 'admin' => true));\n // return $this->facebookApi->getSignedRequest();\n }",
"public function getSignAuthnRequest()\n {\n return $this->sign_authn_request;\n }",
"public function getServerSignature();",
"function getSignature()\n {\n return $this->signature;\n }",
"public function getApiSignature()\n {\n return $this->_config->apiSignature;\n }",
"protected function get_signature_image() {\n\t\treturn $this->get_meta_value( 'signature_image' );\n\t}",
"protected function getSignatureFromRequest()\n\t{\n\t\t$signature = $this->request->header($this->config['signature_header'], null);\n\n\t\tif (is_null($signature) || $signature === '') {\n\t\t\tthrow new AlexaVerificationException('Request signature verification failed: no signature present in header.');\n\t\t}\n\n\t\treturn base64_decode($signature);\n\t}",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature() {\n $headers = $this->getHeaders();\n foreach ($headers as $key => $value) {\n if (strtolower($key) === 'x-hub-signature') {\n return $value;\n }\n }\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to retrieve the service validating URL of the CAS server. | public function getServerServiceValidateURL()
{
phpCAS::traceBegin();
// the URL is build only when needed
if(empty($this->server['serviceValidateUrl']))
{
$this->server['serviceValidateUrl'] = $this->_getServerBaseURL() . 'validate';
}
// $url = $this->_buildQueryUrl($this->server['serviceValidateUrl'],
// 'service='.urlencode($this->getURL()));
phpCAS::traceEnd($this->server['serviceValidateUrl']);
return $this->server['serviceValidateUrl'];
} | [
"public function getServerServiceValidateURL()\n {\n phpCAS::traceBegin();\n // the URL is build only when needed\n if ( empty($this->_server['service_validate_url']) ) {\n switch ($this->getServerVersion()) {\n case CAS_VERSION_1_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'validate';\n break;\n case CAS_VERSION_2_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'serviceValidate';\n break;\n case CAS_VERSION_3_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'p3/serviceValidate';\n break;\n }\n }\n $url = $this->_buildQueryUrl(\n $this->_server['service_validate_url'],\n 'service='.urlencode($this->getURL())\n );\n phpCAS::traceEnd($url);\n return $url;\n }",
"public static function getServiceURL()\n {\n phpCAS::_validateProxyExists();\n return (self::$_PHPCAS_CLIENT->getURL());\n }",
"public function getCASServiceUrl()\n\t{\n\t\treturn $this->casServiceUrl;\n\t}",
"public function getServiceUrl()\n\t{\n\t\tif($this->casLocal != FALSE)\n\t\t\treturn $this->casLocal;\n\t\telse\n\t\t\treturn $this->serviceUrl;\n\t}",
"public static function getServiceURL() {\n\t\treturn self::$SERVICE_URL;\n\t}",
"public static function setServerServiceValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerServiceValidateURL($url);\t\t\n\t}",
"public function get_cas_rest_url()\n\t{\n\t\treturn $this->cas_rest_url;\n\t}",
"public function getServiceUrl()\n {\n return $this->service_url;\n }",
"public function getCASRestUrl()\n\t{\n\t\treturn $this->casRestUrl;\n\t}",
"public function getFileValidationUrlHttps() : string\n {\n return $this->fileValidationUrlHttps;\n }",
"public function getServiceUri() {\n $url = $this->settings->get('service_uri');\n return $url;\n }",
"function getValidationURL($ticket, $service)\n {\n $options = array(\n 'service' => $service,\n 'ticket' => $ticket,\n );\n if (isset($this->renew)) {\n $options['renew'] = 'true';\n }\n\n return $this->_buildCASURL('validate', $options);\n }",
"protected function getAuditsServiceUrl(): string\n {\n return $this->authenticator->getConfig()\n ->getServiceUrl(\n Config::AUDITS_SERVICE\n );\n }",
"abstract protected function getElisServiceUrl();",
"public function getServiceBaseUrl()\n {\n if (empty($this->_serviceBaseUrl)) {\n phpCAS::error(\"ServiceBaseUrl object is not initialized\");\n }\n return $this->_serviceBaseUrl;\n }",
"public static function serverURL()\n {\n $host = self::hostname();\n $url = '';\n if ( $host )\n {\n if ( self::isSSLNow() )\n {\n // https case\n $host = preg_replace( '/:\\d+$/', '', $host );\n\n $ini = eZINI::instance();\n $sslPort = $ini->variable( 'SiteSettings', 'SSLPort' );\n\n $sslPortString = ( $sslPort == eZSSLZone::DEFAULT_SSL_PORT ) ? '' : \":$sslPort\";\n $url = \"https://\" . $host . $sslPortString;\n }\n else\n {\n $url = \"http://\" . $host;\n }\n }\n return $url;\n }",
"public function getValidationUrl()\n {\n return $this->getUrl('*/*/validate', ['_current' => true]);\n }",
"function GetServerURL () {\n return ($this->sServerUrl);\n }",
"public static function getSolrServerUrl()\n {\n return self::getConfigData('solrbridge_general/solr/server_url');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accessor Get the Doctor Name | public function getDoctorNameAttribute()
{
// return $value;
return ['id' => $this->refered_by, 'name' => $this->user->name ?? null];
} | [
"public function getDoctorName(): string;",
"public function obtenerDoctor(){\n \t$doctor = (new Doctor)->find($this->doctor_id);\n \treturn $doctor->name;\n\n }",
"public function getDoctor() {\n if (isset($this->rSchedule) && isset($this->rSchedule->rDoctor)) {\n return $this->rSchedule->rDoctor->getFullname();\n }\n return '';\n }",
"public function getDirectorName()\n {\n return $this->director_name;\n }",
"public function getDistrictName(): string {\n\t\treturn ($this->districtName);\n\t}",
"public function getNomeCand()\n {\n return $this->nome_cand;\n }",
"public function getLegalName();",
"abstract public function getAccessorName() : string;",
"public function getAccessName();",
"public function name() : string\n {\n return $this->trophy->trophyName;\n }",
"public function getPdcMemberName()\n {\n return $this->pdc_member_name;\n }",
"public function getDirectorFullName()\n {\n return $this->lastName.' '.$this->firstName;\n }",
"public function getName() {\n $explodedName = explode( ' ', $this->privilege );\n return $explodedName[1];\n}",
"function duty_name()\n\t{\n\t\tif (isset($this->params['duty_name']))\n\t\t{\n\t\t\tif ((strlen($this->params['duty_name']) > 0) \n\t\t\t&& (strlen($this->params['duty_name']) <= 31))\n\t\t\t{\n\t\t\t\treturn \"<name>\" . $this->params['duty_name'] . \"</name>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error_messages[] .= ' Duty name must be up to 31 characters';\n\t\t\t}\n\t\t}\n\t}",
"public function getDirector(): string {\n return $this->director;\n }",
"public function getAccessName()\n {\n return $this->access_name;\n }",
"public function getDepartmentNameLegal();",
"public function getDoctorId()\n {\n return $this->doctor_id;\n }",
"public function getShortNameAttribute()\n {\n $faculty_name = str_replace(\"Faculty of \",\"\",$this->name);\n\n $words = explode(\" \", $faculty_name);\n \n $short_name = \"\";\n\n foreach ($words as $w) \n {\n $short_name .= $w[0];\n }\n\n return $short_name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the filter links to the view_edit screens to give the user a filter link. | public function add_filter_links()
{
} | [
"public function add_filter_link(array $views)\n {\n }",
"public function add_filter_url_to_filters() {\n\t\tforeach ($this->filters as &$filter) {\n\t\t\tif ($this->type=='list') {\n\t\t\t\t$filter['url'] = $this->reefine->create_url($this->reefine->get_filter_url($this->group_name,$filter['filter_value']));\n\t\t\t} else { // give url that will remove filter\n\t\t\t\t$filter['url'] = $this->reefine->create_url($this->reefine->get_filter_url($this->group_name));\n\t\t\t}\n\t\t}\n\t\t$this->clear_url = $this->reefine->create_url($this->reefine->get_filter_url($this->group_name,null));\n\t}",
"function actions_filters()\n\t\t{\n\t\t\tif(is_admin()){\n\t\t\t\tadd_action('admin_menu', array(&$this,'admin_menu_link'));\n\t\t\t\tadd_action('admin_head', array(&$this, 'admin_head'));\n\t\t\t}\n\t\t\telse\n\t\t\t\tadd_action('wp_head', array(&$this,'wp_head'));\n\t\t}",
"public function addFiltersToUrl()\n {\n }",
"public function _admin_filters()\n {\n }",
"protected function addFilters() {\n\n\t\t}",
"public function registerFilters()\n {\n add_filter(\n 'post_type_link',\n array( $this, 'replaceProductLink' ),\n 1,\n 2\n );\n add_filter(\n 'term_link',\n array( $this, 'replaceTermLink' ),\n 0,\n 3\n );\n add_filter( 'rewrite_rules_array', array( $this, 'addRewriteRules' ), 99 );\n }",
"private function action_filters() {\n\t\t\tadd_action( 'current_screen', array( $this, 'conditional_hooks' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\t\tadd_action( 'tve_after_db_migration', array( $this, 'insert_default_data' ), 10, 1 );\n\t\t\tadd_action( 'rest_api_init', array( $this, 'create_initial_rest_routes' ) );\n\n\t\t\tadd_filter( 'tve_dash_filter_features', array( $this, 'smart_site_feature' ) );\n\t\t\tadd_filter( 'tcb_inline_shortcodes', array( $this, 'smart_site_tcb_shortcodes' ), 10, 1 );\n\t\t\tadd_filter( 'tcb_dynamiclink_data', array( $this, 'smart_site_links_shortcodes' ) );\n\t\t\tadd_filter( 'tcb_content_allowed_shortcodes', array( $this, 'allowed_shotcodes' ) );\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue_scripts' ), 11 );\n\t\t}",
"public function report_filters_ui()\n\t{\n\t\t$filter = View::factory('reports/sharing_filter');\n\t\t$filter->sites = ORM::factory('sharing_site')\n\t\t\t\t\t->where('site_active', 1)\n\t\t\t\t\t->find_all();\n\t\t$filter->render(TRUE);\n\t}",
"public function addFilters()\n {\n }",
"function ShowFilterList() {}",
"private function register_actions_filters() {\n\t\tadd_action( 'widgets_init', array( &$this, 'register_widgets' ), 10, 0 );\n\t}",
"public function _report_filters_ui()\n\t{\n\t\t$filter = View::factory('actionable_filter');\n\t\t$filter->render(TRUE);\n\t}",
"public function filters()\n {\n\n add_filter(\n 'mce_external_plugins',\n array(&$this,'appendBtns')\n );\n\n add_filter(\n 'mce_buttons',\n array(&$this, 'registerButtons')\n );\n }",
"static function add_filters(): void {\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_group']);\r\n\r\n\t\tself::add_tab('Divisions');\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_divisions']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_name']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_notes']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_d_priority']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_roles']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_title']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_r_priority']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_voting']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_email']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_archival']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_aliases']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_alias']);\r\n\r\n\t\tself::add_tab('Layout');\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_show_emails']);\r\n\t}",
"public function makeEditFilterAction()\n {\n return $this->makeBaseUrl('path').'?page=editfilter';\n }",
"function GlobalFilterList()\n {\n parent::FilterList();\n $this->filters['AutoLoginFilter'] =& new AutoLoginFilter();\n $this->filters[\"MessageFilter\"] =& new MessageFilter();\n }",
"function hook_hosting_site_site_list_filters_alter(&$filters) {\n // Add a filter based on another module.\n if (in_array('other_filter', $filters, TRUE)) {\n $filters[] = 'my_filter';\n }\n}",
"static function add_filters(): void {\r\n add_action('acf/init', [__CLASS__, 'add_group']);\r\n add_action('acf/init', [__CLASS__, 'add_no_iss']);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DOWN /editar.php/materials/down Parametros por URL: Identificador del material | public function executeDown()
{
$material = MaterialPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($material);
$material->moveDown();
$material->save();
return $this->renderComponent('materials', 'list');
} | [
"public static function editMaterial()\n\t\t{\n\t\t\t$materialID = $_POST['material_id'];\n\n\n\t\t\t//GRAB MATERIAL INFO BASED ON MATERIAL ID LISTED ABOVE\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id', 'name','unit_price','current_price','min_price'];\n\t\t\t$stageDBO->SetJoin([\"[><]item\" => \"item_id\"]);\n\t\t\t$materials = $stageDBO->getRecords($arr, ['material_id' => $materialID] );\n\t\t\trequire_once('views/pages/editMaterial.php');\n\n\n\t\t}",
"public function executeEdit()\n {\n $this->material = MaterialPeer::retrieveByPk($this->getRequestParameter('id'));\n $this->forward404Unless($this->material);\n $this->langs = sfConfig::get('app_lang_array', array('es'));\n\n $this->default_sel = 'url';\n }",
"public function editMaterial()\n\t{\n\t\t$idMaterial = Input::only('id_material')['id_material'];\n\n\t\t//Se compruba que no sea nula la id\n\t\tif ( ! is_null($idMaterial) )\n\t\t{\n\t\t\t//Se trae el material de la base de datos\n\t\t\t$material = $this->materialRepo->find($idMaterial);\n\n\t\t\t//Se comprueba que el material no sea nulo y se ejecuta la función encargada de crear y editar materiales\n\t\t\tif( ! is_null($material) ) dd($this->baseEditCreateMaterial($material));\n\t\t}\n\n\t\t//Respuesta en caso de error\n\t\techo \"Debes pasar una id de material válida\";\n\t}",
"function edit($id_material)\n { \n // check if the material exists before trying to edit it\n $data['material'] = $this->Material_model->get_material($id_material);\n \n if(isset($data['material']['id_material']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'nome_material' => $this->input->post('nome_material'),\n\t\t\t\t\t'descricao_material' => $this->input->post('descricao_material'),\n\t\t\t\t\t'preco_material' => $this->input->post('preco_material'),\n );\n\n $this->Material_model->update_material($id_material,$params); \n redirect('material/index');\n }\n else\n {\n $data['_view'] = 'material/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The material you are trying to edit does not exist.');\n }",
"public function materialsDropdown()\n {\n $sql = \"SELECT `materials`.`material_id`,`materials`.`material_name`,`materials`.`material_grade`\n FROM `materials`\n\t\t\t\tWHERE `printing` = 1 AND `color` = 1\n ORDER BY `materials`.`material_name`;\";\n if($stmt = $this->_db->prepare($sql))\n {\n $stmt->execute();\n while($row = $stmt->fetch())\n {\n $ID = $row['material_id'];\n $NAME = $row['material_name'];\n $GRADE = $row['material_grade'];\n echo '<li><a id=\"'. $NAME .'\" onclick=\"selectMaterial(\\''. $ID .'\\',\\''. $NAME .'\\',\\''. $GRADE .'\\')\"><b>'. $NAME .'</b>  -  '. $GRADE .'</a></li>'; \n }\n $stmt->closeCursor();\n }\n else\n {\n echo '<li>Something went wrong.'. $db->errorInfo .'</li>'; \n }\n }",
"public function detailAction()\r\n {\r\n // Param\r\n $id = $this->_getParam('id');\r\n\r\n // Model\r\n $materialDb = new Model_DbTable_Material;\r\n $materialLinkDb = new Model_DbTable_MaterialLink;\r\n \r\n // Data\r\n $material = $materialDb->getAllWithDescById($id, $this->_languageId);\r\n $materialLink = $materialLinkDb->getAllById($id);\r\n\r\n // View\r\n $this->view->material = $material;\r\n $this->view->materialLink = $materialLink;\r\n }",
"public static function editCraft()\n\t\t{\n\t\t\t$craftID = $_POST['craft_id'];\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('craft');\n\t\t\t$arr = ['craft_id','item_id', 'name','current_price','min_price'];\n\t\t\t$stageDBO->SetJoin([\"[><]item\" => \"item_id\"]);\n\t\t\t$craft = $stageDBO->getRecords($arr, ['craft_id' => $craftID] );\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('craft_materials');\n\t\t\t$arr = ['material_id', 'name','unit_price'];\n\t\t\t$stageDBO->SetJoin([\"[><]material\" => \"material_id\", \"[><]item\" => \"item_id\"]);\n\t\t\t$materials = $stageDBO->getRecords($arr, ['craft_id' => $craftID] );\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id', 'name'];\n\t\t\t$stageDBO->SetJoin([\"[><]item\" => \"item_id\"]);\n\t\t\t$craftMaterials = $stageDBO->getRecords($arr);\n\n\n\t\t\trequire_once('views/pages/editCraft.php');\n\n\t\t}",
"public function addMaterial()\n\t{\n\t\tglobal $tree;\n\t\t\n\t\tif (strlen($_SESSION[\"link_new_type\"]) || !$this->material(true))\n\t\t{\n\t\t\tinclude_once(\"./Modules/SurveyQuestionPool/classes/class.ilMaterialExplorer.php\");\n\t\t\tswitch ($_POST[\"internalLinkType\"])\n\t\t\t{\n\t\t\t\tcase \"lm\":\n\t\t\t\t\t$_SESSION[\"link_new_type\"] = \"lm\";\n\t\t\t\t\t$_SESSION[\"search_link_type\"] = \"lm\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"glo\":\n\t\t\t\t\t$_SESSION[\"link_new_type\"] = \"glo\";\n\t\t\t\t\t$_SESSION[\"search_link_type\"] = \"glo\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"st\":\n\t\t\t\t\t$_SESSION[\"link_new_type\"] = \"lm\";\n\t\t\t\t\t$_SESSION[\"search_link_type\"] = \"st\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"pg\":\n\t\t\t\t\t$_SESSION[\"link_new_type\"] = \"lm\";\n\t\t\t\t\t$_SESSION[\"search_link_type\"] = \"pg\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tilUtil::sendInfo($this->lng->txt(\"select_object_to_link\"));\n\n\t\t\t$exp = new ilMaterialExplorer($this->ctrl->getLinkTarget($this, 'addMaterial'), get_class($this));\n\n\t\t\t// expand current path (if no specific node given)\n\t\t\tif(!$_GET[\"expand\"])\n\t\t\t{\n\t\t\t\t$path = $tree->getPathId($_GET[\"ref_id\"]);\n\t\t\t\t$exp->setForceOpenPath($path);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exp->setExpand($_GET[\"expand\"]);\n\t\t\t}\n\t\t\t$exp->setExpandTarget($this->ctrl->getLinkTarget($this,'addMaterial'));\n\t\t\t$exp->setTargetGet(\"ref_id\");\n\t\t\t$exp->setRefId($_GET[\"ref_id\"]);\n\t\t\t$exp->addFilter($_SESSION[\"link_new_type\"]);\n\t\t\t$exp->setSelectableType($_SESSION[\"link_new_type\"]);\n\n\t\t\t// build html-output\n\t\t\t$exp->setOutput(0);\n\n\t\t\t$this->tpl->addBlockFile(\"ADM_CONTENT\", \"explorer\", \"tpl.il_svy_qpl_explorer.html\", \"Modules/SurveyQuestionPool\");\n\t\t\t$this->tpl->setVariable(\"EXPLORER_TREE\",$exp->getOutput());\n\t\t\t$this->tpl->setVariable(\"BUTTON_CANCEL\",$this->lng->txt(\"cancel\"));\n\t\t\t$this->tpl->setVariable(\"FORMACTION\",$this->ctrl->getFormAction($this));\n\t\t}\n\t}",
"function byMaterials($params = array()) {\n \n if(!isset($params['materials'])){\n echo \"Materials required\";\n die();\n }\n \n $request = 'listings/materials/' . $params['materials'];\n $request .= parent::createURL($params, array('materials'));\n \n $result = parent::makeRequest($request);\n \n return $result;\n \n }",
"public function executeUpdateMaterials()\n {\n if (!$this->getRequestParameter('id'))\n {\n $material = new Material();\n }\n else\n {\n $material = MaterialPeer::retrieveByPk($this->getRequestParameter('id'));\n $this->forward404Unless($material);\n }\n $material->setMmId($this->getRequestParameter('mm', 0));\n $material->setDisplay($this->getRequestParameter('display', 0));\n $material->setMatTypeId($this->getRequestParameter('mat_type_id', 0));\n if ($material->isNew()) $material->setUrl($this->getRequestParameter('url', 0));\n\n $langs = sfConfig::get('app_lang_array', array('es'));\n foreach($langs as $lang){\n $material->setCulture($lang);\n $material->setName($this->getRequestParameter('name_' . $lang, ' '));\n }\n \n $material->save();\n\n return $this->renderComponent('serials', 'listMaterials'); \n }",
"public function getReferenciaMaterial()\n {\n return $this->referenciaMaterial;\n }",
"public function listing_material()\n {\n $this->auto_render = FALSE;\n\n if (!request::is_ajax())\n return FALSE;\n\n $v = new View('mapping/material');\n $v->material = file::listing_dir(DOCROOT . '../images/background/');\n $v->render(TRUE);\n }",
"public function reference_material(){\n\t\t\n\t\t/*check login by role after login*/\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('auth/login', 'refresh');\n\t\t}\n\t\telse if (!$this->ion_auth->is_admin()) // remove this elseif if you want to enable this for non-admins\n\t\t{\n\t\t\t// redirect them to the home page because they must be an administrator to view this\n\t\t\treturn show_error('You must be an administrator to view this page.');\n\t\t}\n\t\telse if(!$this->ion_auth->is_modules('LMS')){\n\t\t\t// Showing error because they must be LMS to view this\n\t\t\treturn show_error('You must be an administrator to view this page LMS.');\n\t\t}else{\n\t\t\t$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n\t\t\t$this->data['title'] = $this->lang->line('reference_material');\n\t\t\t\n\t\t\t$reference_material_list = $this->Common_model->select_info(\"lms_reference_material\");\n\t\t\t$this->data['reference_material_list'] = $reference_material_list;\n\t\t\t$this->_render_page('lms_admin/reference_material/index', $this->data);\n\t\t}\n\t\t \n\t}",
"function UnloadMaterial(\\raylib\\Material $material): void { }",
"function getMaterialsPath() \n\t{\n\t\treturn CLIENT_WEB_DIR . \"/survey/$this->obj_id/$this->id/materials/\";\n\t}",
"function assignMaterial()\n\t{\n\t\t$ilCtrl = $this->ctrl;\n\t\t$ilUser = $this->user;\n\t\t$lng = $this->lng;\n\t\t$tpl = $this->tpl;\n\t\t$ilTabs = $this->tabs;\n\t\t$ilSetting = $this->setting;\n\n\t\tif(!$ilSetting->get(\"disable_personal_workspace\"))\n\t\t{\n\t\t\tilUtil::sendInfo($lng->txt(\"skmg_ass_materials_from_workspace\").\" » <a href='ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace'>\".$lng->txt(\"personal_workspace\").\"</a>\");\n\t\t}\n\t\t\n\t\t$ilCtrl->saveParameter($this, \"skill_id\");\n\t\t$ilCtrl->saveParameter($this, \"level_id\");\n\t\t$ilCtrl->saveParameter($this, \"tref_id\");\n\t\t$ilCtrl->saveParameter($this, \"basic_skill_id\");\n\t\t\n\t\t$ilTabs->setBackTarget($lng->txt(\"back\"),\n\t\t\t$ilCtrl->getLinkTarget($this, \"assignMaterials\"));\n\n\n\t\tinclude_once(\"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php\");\n\t\t$exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, \"assignMaterial\", $this, \"selectMaterial\");\n\t\t$exp->setTypeWhiteList(array(\"blog\", \"wsrt\", \"wfld\", \"file\", \"tstv\", \"excv\"));\n\t\t$exp->setSelectableTypes(array(\"file\", \"tstv\", \"excv\"));\n\t\t$exp->setSelectMode(\"wsp_id\", true);\n\t\tif ($exp->handleCommand())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// fill template\n\t\t$mtpl = new ilTemplate(\"tpl.materials_selection.html\", true, true, \"Services/Skill\");\n\t\t$mtpl->setVariable(\"EXP\", $exp->getHTML());\n\t\t\n\t\t// toolbars\n\t\t$tb = new ilToolbarGUI();\n\t\t$tb->addFormButton($lng->txt(\"select\"),\n\t\t\t\"selectMaterial\");\n\t\t$tb->setFormAction($ilCtrl->getFormAction($this));\n\t\t$tb->setOpenFormTag(true);\n\t\t$tb->setCloseFormTag(false);\n\t\t$mtpl->setVariable(\"TOOLBAR1\", $tb->getHTML());\n\t\t$tb->setOpenFormTag(false);\n\t\t$tb->setCloseFormTag(true);\n\t\t$mtpl->setVariable(\"TOOLBAR2\", $tb->getHTML());\n\t\t\n\t\t$tpl->setContent($mtpl->get());\n\t}",
"function deattatchMaterialFromModule($materialID, $moduleID) {\r\n $conditions = array(\"ModuleID=$moduleID\", \"MaterialID=$materialID\");\r\n return dataDelete(\"modulematerialslink\", $conditions);\r\n}",
"public function executeDelete()\n {\n $material = MaterialPeer::retrieveByPk($this->getRequestParameter('id'));\n $this->forward404Unless($material);\n $material->delete();\n \n return $this->renderComponent('materials', 'list');\n }",
"public function editUrl();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the nb h chom part tech. | public function setNbHChomPartTech($nbHChomPartTech) {
$this->nbHChomPartTech = $nbHChomPartTech;
return $this;
} | [
"public function testSetNbHChomPartCp() {\n\n $obj = new Bulletins();\n\n $obj->setNbHChomPartCp(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHChomPartCp());\n }",
"public function testSetNbJChomPartCp() {\n\n $obj = new Bulletins();\n\n $obj->setNbJChomPartCp(10.092018);\n $this->assertEquals(10.092018, $obj->getNbJChomPartCp());\n }",
"public function setTechnology($tech) {\n $tech = Database::secureInput($tech);\n\n if (!is_string($tech) || strlen($tech) < 3 || strlen($tech) > 10) {\n throw new InvalidArgumentException(\"\\\"technology\\\" is no string or its length is invalid\");\n }\n\n $this->technology = $tech;\n }",
"function setJuniorHighSchool($txt)\n {\n $this->_junior_high_school = $txt ;\n }",
"public function setNbHChomPartCp(?float $nbHChomPartCp): Bulletins {\n $this->nbHChomPartCp = $nbHChomPartCp;\n return $this;\n }",
"public function setCellularTechnology($val)\n {\n $this->_propDict[\"cellularTechnology\"] = $val;\n return $this;\n }",
"public function actionFilterSetHosNum()\n\t{\n\t\t$this->setFilter('hos_num', $_POST['hos_num']);\n\t}",
"public function testSetNbHeureMens() {\n\n $obj = new AttestationCacm();\n\n $obj->setNbHeureMens(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHeureMens());\n }",
"public function setPart2()\n {\n }",
"public function testSetNbHConduite() {\n\n $obj = new Bulletins();\n\n $obj->setNbHConduite(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHConduite());\n }",
"public function _set66($66) {\n\t\t$this->_66 = $66;\n\t}",
"public function set_hp($_hp){\n $this->_hp = $_hp;\n return $this;\n }",
"public function testSetNbHCompl() {\n\n $obj = new HistoTransfPaie();\n\n $obj->setNbHCompl(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHCompl());\n }",
"public function setCh_Title($ch_title)\n {\n \t$this->ch_title = $ch_title;\n }",
"public function browserSet($browser)\r\n\t{\r\n\t\t$this->browser = $browser;\r\n\t\t\r\n\t\t//convert the browscap agent to the caniuse agent\r\n\t\tif (array_key_exists($browser->Browser,$this->agentMap))\r\n\t\t{\r\n\t\t\t$this->agent = $this->agentMap[$browser->Browser];\r\n\t\t}\r\n\r\n\t\t//do the version too\r\n\t\t$this->version = floatval($this->browser->Version);\r\n\t}",
"public function setSpecialty($value)\n {\n $this->specialty = $value;\n }",
"public function testSetCompteChargeHeuresActPart() {\n\n $obj = new Etablissements2();\n\n $obj->setCompteChargeHeuresActPart(\"compteChargeHeuresActPart\");\n $this->assertEquals(\"compteChargeHeuresActPart\", $obj->getCompteChargeHeuresActPart());\n }",
"public function setNbHt(?float $nbHt): ChargesPaie {\n $this->nbHt = $nbHt;\n return $this;\n }",
"public function setChannel($channel) {\n\t\t$this->hw_channel = $channel;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate the ranges instance variable with an array, with each element representing one range and consisting of a reference to the range entity, a list of restricted country ids permitted by this range, and the count of free permit numbers remaining within this range | private function populateRanges(array $rangeEntities)
{
$this->ranges = [];
foreach ($rangeEntities as $rangeEntity) {
$allocatedPermitsInRange = $this->getRepo('IrhpPermit')->getPermitCountByRange($rangeEntity->getId());
$permitsRemainingInRange = $rangeEntity->getSize() - $allocatedPermitsInRange;
if ($permitsRemainingInRange > 0) {
$this->ranges[] = [
self::ENTITY_KEY => $rangeEntity,
self::COUNTRY_IDS_KEY => $this->extractIdsFromEntities(
$rangeEntity->getCountrys()->getValues()
),
self::PERMITS_REMAINING_KEY => $permitsRemainingInRange
];
} elseif ($permitsRemainingInRange < 0) {
throw new RuntimeException(
'Assertion failed in method ' . __METHOD__ . ': $permitsRemainingInRange < 0'
);
}
}
} | [
"public function ranges()\n {\n return $this->ranges;\n }",
"protected function calculateRanges()\n {\n $this->ranges = array();\n\n foreach ($this->schema->getFields() as $field) {\n $min = INF;\n $max = 0;\n\n foreach ($this->nodes as $node) {\n if ($node->get($field) < $min) {\n $min = $node->get($field);\n }\n\n if ($node->get($field) > $max) {\n $max = $node->get($field);\n }\n }\n\n $this->ranges[$field] = array($min, $max);\n }\n }",
"public function ranges(): array\n {\n return $this->ranges ?? [];\n }",
"public function getRanges()\n {\n return $this->ranges;\n }",
"public function ranges()\n {\n return [];\n }",
"private function makeRanges()\n {\n if (isset($this->settings['campaigns']) && count($this->settings['campaigns'])) {\n foreach ($this->settings['campaigns'] as $key => $campaign) {\n $offset = 0;\n foreach ($campaign['variations'] as $vkey => $variation) {\n $limit = Bucketer::getLimit($variation['weight']);\n $max_range = $offset + $limit;\n $this->settings['campaigns'][$key]['variations'][$vkey]['min_range'] = $offset + 1;\n $this->settings['campaigns'][$key]['variations'][$vkey]['max_range'] = $max_range;\n $offset = $max_range;\n }\n }\n } else {\n self::addLog(Logger::ERROR, 'unable to fetch campaign data from settings in makeRanges function');\n throw new \\Exception();\n }\n }",
"public static function getAllRanges()\r\n\t{\r\n\t\tglobal $db;\r\n\r\n\t\t$ranges = array();\r\n\r\n\t\t$sql = ' SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, c.label, i.rowid as fk_expense_ik, r.active as range_active, c.active as cat_active';\r\n\t\t$sql.= ' FROM '.MAIN_DB_PREFIX.'c_exp_tax_range r';\r\n\t\t$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)';\r\n\t\t$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'expensereport_ik i ON (r.rowid = i.fk_range)';\r\n\t\t$sql.= ' WHERE r.entity IN (0, '. getEntity('').')';\r\n\t\t$sql.= ' ORDER BY r.fk_c_exp_tax_cat, r.range_ik';\r\n\r\n\t\tdol_syslog(get_called_class().'::getAllRanges sql='.$sql, LOG_DEBUG);\r\n\t\t$resql = $db->query($sql);\r\n\t\tif ($resql)\r\n\t\t{\r\n\t\t\twhile ($obj = $db->fetch_object($resql))\r\n\t\t\t{\r\n\t\t\t\t$ik = new ExpenseReportIk($db);\r\n\t\t\t\tif ($obj->fk_expense_ik > 0) $ik->fetch($obj->fk_expense_ik);\r\n\t\t\t\t$obj->ik = $ik;\r\n\r\n\t\t\t\tif (!isset($ranges[$obj->fk_c_exp_tax_cat])) $ranges[$obj->fk_c_exp_tax_cat] = array('label' => $obj->label, 'active' => $obj->cat_active, 'ranges' => array());\r\n\t\t\t\t$ranges[$obj->fk_c_exp_tax_cat]['ranges'][] = $obj;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdol_print_error($db);\r\n\t\t}\r\n\r\n\t\treturn $ranges;\r\n\t}",
"private function _get_range()\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate range array (faux object)\n\t\t// --------------------------------------\n\n\t\t$range = array(\n\t\t\t'start_date' => NULL,\n\t\t\t'start_time' => NULL,\n\t\t\t'end_date' => NULL,\n\t\t\t'end_time' => NULL\n\t\t);\n\n\t\t// --------------------------------------\n\t\t// Passed, Active and Upcoming\n\t\t// --------------------------------------\n\n\t\tforeach (array('passed', 'active', 'upcoming') AS $key)\n\t\t{\n\t\t\t$range[$key] = ! ($this->_get_param('show_'.$key) == 'no');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Get field IDs from param\n\t\t// --------------------------------------\n\n\t\t$range['fields'] = $this->_get_event_field_ids();\n\n\t\t// --------------------------------------\n\t\t// Site IDs\n\t\t// --------------------------------------\n\n\t\t$range['site_id'] = implode('|', ee()->TMPL->site_ids);\n\n\t\t// Return it\n\t\treturn $range;\n\t}",
"public function age_range()\n {\n if (empty($this->date_range)){\n return array(NULL, NULL);\n }\n if(empty($this->date_range->start) || empty($this->date_range->end)){\n return array($this->age(), $this->age());\n }\n\n $start_date = new DateRangeField($this->date_range->start, $this->date_range->start);\n $end_date = new DateRangeField($this->date_range->end, $this->date_range->end);\n $start_age = new DOBField(array('date_range' => $start_date));\n $start_age = $start_age->age();\n $end_age = new DOBField(array('date_range' => $end_date));\n $end_age = $end_age->age();\n\n return (array($end_age, $start_age));\n }",
"public function getAgeRanges()\n {\n return $this->age_ranges;\n }",
"function create_ranges($min, $max, $count_ranges)\n {\n if ($max < $min) return -1;\n\n $dist = ((float)$max - $min) / $count_ranges;\n\n $ranges = array();\n\n for ($i=0; $i<$count_ranges; $i++)\n {\n $ranges[] = array($min + ($dist * $i), $min + ($dist * ($i + 1)));\n }\n\n return $ranges;\n }",
"public function setRanges($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Photos\\Types\\DateRange::class);\n $this->ranges = $arr;\n\n return $this;\n }",
"public function createRange();",
"protected function determineRanges(){\n\t\t// Parse flexform settings\n\t\t$rangeSettings = explode(',', $this->settings['rangesArray']);\n\n\t\t$ranges = array();\n\t\tforeach($rangeSettings as $setting){\n\t\t\tswitch($setting){\n\t\t\t\tcase 'current':\n\t\t\t\t\t$ranges[\\CIC\\Cicevents\\Domain\\Repository\\EventRepository::RANGE_CURRENT] = 'Upcoming Events';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'thisMonth':\n\t\t\t\t\t$ranges[\\CIC\\Cicevents\\Domain\\Repository\\EventRepository::RANGE_THIS_MONTH] = 'This Month';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nextMonth':\n\t\t\t\t\t$ranges[\\CIC\\Cicevents\\Domain\\Repository\\EventRepository::RANGE_NEXT_MONTH] = 'Next Month';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nextThreeMonths':\n\t\t\t\t\t$ranges[\\CIC\\Cicevents\\Domain\\Repository\\EventRepository::RANGE_THREE_MONTHS] = 'Next Three Months';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'past':\n\t\t\t\t\t$ranges[\\CIC\\Cicevents\\Domain\\Repository\\EventRepository::RANGE_PAST] = 'Past Events';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn $ranges;\n\t}",
"public function getAbvRange();",
"public static function getRange() : array {\n\n\t\t\treturn static::$range;\n\t\t}",
"function _get_ranges(&$options)\n {\n // process Range: header if present\n if (isset($this->_SERVER['HTTP_RANGE'])) {\n\n // we only support standard \"bytes\" range specifications for now\n if (preg_match('/bytes\\s*=\\s*(.+)/', $this->_SERVER['HTTP_RANGE'], $matches)) {\n $options[\"ranges\"] = array();\n\n // ranges are comma separated\n foreach (explode(\",\", $matches[1]) as $range) {\n // ranges are either from-to pairs or just end positions\n list($start, $end) = explode(\"-\", $range);\n $options[\"ranges\"][] = ($start===\"\")\n ? array(\"last\"=>$end)\n : array(\"start\"=>$start, \"end\"=>$end);\n }\n }\n }\n }",
"protected function _getDateRange()\n {\n if (is_null($this->_dateRange)) {\n $this->_dateRange = array();\n $rules = $this->getAttributeObject()->getValidateRules();\n if (isset($rules[self::MIN_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MIN_DATE_RANGE_KEY] = $rules[self::MIN_DATE_RANGE_KEY];\n }\n if (isset($rules[self::MAX_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MAX_DATE_RANGE_KEY] = $rules[self::MAX_DATE_RANGE_KEY];\n }\n }\n return $this->_dateRange;\n }",
"public function getRange()\n {\n $start = $this->getStartIp()->asLong();\n $end = $this->getEndIp()->asLong();\n\n $range = array();\n for ($index = $start; $index <= $end; $index++) {\n $range[] = Address::fromFloat($index);\n }\n return $range;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Index Display tree page of all POI's. Accepts an optional ID for highlighting / expanding a given leaf. | public function index($id = null)
{
return $this->layout('pages.poi.index', array('id' => $id));
} | [
"public function treeAction($id) {\n //Obtain the routes for each document\n $pool = $this->get('sonata.admin.pool');\n $classes = $pool->getAdminClasses();\n $adminClasses = array();\n\n foreach ($classes as $class) {\n $instance = $this->get($class);\n $routeCollection = array();\n foreach ($instance->getRoutes()->getElements() as $code => $route) {\n $action = explode('.', $code);\n $routeCollection[end($action)] = sprintf('%s_%s', $instance->getBaseRouteName(), end($action));\n }\n array_push($adminClasses, array(\n 'label' => $instance->getLabel(),\n 'className' => $instance->getClass(),\n 'baseRoute' => $instance->getBaseRoutePattern(),\n 'routes' => $routeCollection));\n }\n\n return $this->render($this->template, array(\n 'id' => $id,\n 'admin_pool' => $this->container->get('sonata.admin.pool'),\n 'handlers' => $adminClasses\n ));\n }",
"public function getNodeIndexById( $id );",
"public function documentHistory($id)\n {\n if (ViewHelper::universalHasPermission(array(14)) == false) {\n return redirect('/')->with('messageSecondary', trans('documentForm.noPermission'));\n }\n $document = Document::find($id);\n $documentHistory = Document::where('document_group_id', $document->document_group_id)->orderBy('id', 'desc')->paginate(10, ['*'], 'dokument-historie');\n // $documentHistory = Document::where('document_group_id', $document->document_group_id)->whereIn('document_status_id', array(3,5))->orderBy('id', 'desc')->paginate(10, ['*'], 'dokument-historie');\n $documentHistoryTree = $this->document->generateTreeview($documentHistory, array('pageHistory' => true));\n // dd($documentHistory);\n return view('dokumente.historie', compact('document', 'documentHistory', 'documentHistoryTree'));\n }",
"function show_tree( $learn_pages, $parent_id, $level, $user_progress_pages, $user_logged, $pages_markers ) {\n\t$output = '';\n\n\tforeach ( $learn_pages as $page_parent_id => $page ) {\n\t\tif ( $page_parent_id == $parent_id ) {\n\n\t\t\tforeach ( $page as $page_id => $page_title ) {\n\t\t\t\t$total_markers = $pages_markers[ $page_id ]['total_markers'];\n\t\t\t\t$completed_markers = $pages_markers[ $page_id ]['completed_markers'];\n\n\t\t\t\t$real_progress = child_progress( $pages_markers, $page_id );\n\n\t\t\t\t$total_markers_out = $total_markers + $real_progress['total_markers'];\n\t\t\t\t$completed_markers_out = $completed_markers + $real_progress['completed_markers'];\n\t\t\t\t$current_progress = floor( ( $completed_markers_out / $total_markers_out ) * 10000 ) / 100;\n\t\t\t\tif ( ! $current_progress ) {\n\t\t\t\t\t$current_progress = 0;\n\t\t\t\t}\n\t\t\t\tif ( $current_progress == 100 ) {\n\t\t\t\t\t$class_completed = 'completed';\n\t\t\t\t} else {\n\t\t\t\t\t$class_completed = '';\n\t\t\t\t}\n\n\t\t\t\t$output .= '<div class=\"cl-learnnav-item level_' . $level . ' ' . $class_completed . '\" data-id=\"' . $page_id . '\"';\n\t\t\t\tif ( $user_logged ) {\n\t\t\t\t\t$output .= 'data-progress=\"' . $completed_markers . '/' . $total_markers . '\"';\n\t\t\t\t}\n\t\t\t\t$output .= '>' . \"\\n\";\n\t\t\t\t$output .= '<a class=\"cl-learnnav-item-anchor\" href=\"' . get_the_permalink( $page_id ) . '\">' . \"\\n\";\n\t\t\t\t$output .= $page_title . \"\\n\";\n\t\t\t\t$output .= '<span class=\"cl-learnnav-item-progress\">(' . $current_progress . '%)</span>' . \"\\n\";\n\t\t\t\t$output .= '</a>' . \"\\n\";\n\t\t\t\t$output .= show_tree( $learn_pages, $page_id, $level + 1, $user_progress_pages, $user_logged, $pages_markers );\n\t\t\t\t$output .= '</div>' . \"\\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $output;\n}",
"public function display_tree() { $this->style = 'tree'; }",
"public function _edit_tree()\n {\n if (get_option('wiki_enable_children') == '0') {\n warn_exit(do_lang_tempcode('INTERNAL_ERROR'));\n }\n\n $_title = get_screen_title('WIKI_EDIT_TREE');\n\n $_id = get_param_wiki_chain('id');\n $id = $_id[0];\n\n if (!has_category_access(get_member(), 'wiki_page', strval($id))) {\n access_denied('CATEGORY_ACCESS');\n }\n\n $child_links = post_param_string('children');\n\n $member = get_member();\n check_privilege('wiki_manage_tree', array('wiki_page', $id));\n\n $hide_posts = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'hide_posts', array('id' => $id));\n $page_title = $GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'title', array('id' => $id));\n if (get_option('wiki_enable_content_posts') == '0') {\n $hide_posts = 1;\n }\n\n if ((substr($child_links, -1, 1) != \"\\n\") && (strlen($child_links) > 0)) {\n $child_links .= \"\\n\";\n }\n $no_children = substr_count($child_links, \"\\n\");\n if ($no_children > 300) {\n warn_exit(do_lang_tempcode('TOO_MANY_WIKI_CHILDREN'));\n }\n $start = 0;\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id));\n require_code('seo2');\n for ($i = 0; $i < $no_children; $i++) {\n $length = strpos($child_links, \"\\n\", $start) - $start;\n $new_link = trim(substr($child_links, $start, $length));\n $start = $start + $length + 1;\n if ($new_link != '') {\n // Find ID and title\n $q_pos = strpos($new_link, '=');\n $child_id_on_start = (($q_pos !== false) && ($q_pos > 0) && (is_numeric(substr($new_link, 0, $q_pos))));\n\n if ($child_id_on_start) { // Existing\n $title = substr(substr($new_link, $q_pos + 1), 0, 255);\n $child_id = intval(substr($new_link, 0, $q_pos));\n if ($child_id == $id) {\n continue;\n }\n $title_id = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $child_id));\n if (is_null($title_id)) {\n attach_message(do_lang_tempcode('BROKEN_WIKI_CHILD_LINK', strval($child_id)), 'warn');\n continue;\n }\n if ($title == '') {\n $title = get_translated_text($title_id);\n } else {\n if (get_translated_text($title_id) != $title) {\n require_code('urls2');\n suggest_new_idmoniker_for('wiki', 'browse', strval($child_id), '', $title);\n $GLOBALS['SITE_DB']->query_update('wiki_pages', lang_remap('title', $title_id, $title), array('id' => $child_id), '', 1);\n }\n }\n } else { // New\n $title = substr($new_link, 0, 255);\n $child_id = wiki_add_page($title, '', '', $hide_posts, null, null, 0, '', '', null, false);\n\n require_code('permissions2');\n set_global_category_access('wiki_page', $child_id);\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $id, 'child_id' => $child_id), '', 1); // Just in case it was repeated\n $GLOBALS['SITE_DB']->query_insert('wiki_children', array('parent_id' => $id, 'child_id' => $child_id, 'the_order' => $i, 'title' => $title));\n\n require_code('notifications2');\n copy_notifications_to_new_child('wiki', strval($id), strval($child_id));\n }\n }\n\n log_it('WIKI_EDIT_TREE', strval($id), get_translated_text($page_title));\n\n // Show it worked / Refresh\n $url = get_param_string('redirect');\n return redirect_screen($_title, $url, do_lang_tempcode('SUCCESS'));\n }",
"function explore($id=null) {\n if (!$this->auth->is_auth($this->router->class, READ)) {\n redirect(\"errores/no_authorized\");\n }\n\n if( is_null($id) ){\n //buscamos las categorias\n $param['nodes']= $this->category->find_parents();\n $param['title']= lang('cat_list');\n }else{\n //buscamos la categoria enviada\n $param['parent']= $this->category->find( $id );\n\n //si no existe page 404\n if(!isset($param['parent']->id)){\n show_404();\n }\n //buscamos los nodos hijos del nodo padre\n $param['nodes']= $this->category->find_children($id);\n\n $param['title']= $param['parent']->name;\n\n }\n\n $param_header['title'] = lang('org_title');\n $this->load->view('includes/header', $param_header);\n\n $param_menu= array();\n if(isset($param['parent'])){\n $param_menu['back_btn'] = base_url(\"admin/category/explore/\".$param['parent']->id_parent);\n }\n\n $this->load->view('includes/menu-extended-'. strtolower(SUPERADMIN), $param_menu);\n\n $this->load->view('categories/list', $param);\n $this->load->view('includes/footer');\n }",
"public function actionIndex()\n {\n $tree = OrgClassification::getTreeViewHtmlForm();\n $orgClass = OrgClassification::find()->where(['parent_id' => null])->asArray()->all();\n return $this->render('index', [\n 'orgClass' => $orgClass,\n 'tree' => $tree,\n ]);\n }",
"public function display()\n {\n $this->display_tree($this->root);\n }",
"public function getIndex($id)\n {\n $item = Item::find($id);\n\n if (empty($item->has_iip)) {\n abort(404);\n }\n\n $itemImages = $item->images;\n $index = 0;\n if ($itemImages->count() <= 1 && !empty($item->related_work)) {\n $related_items = Item::related($item, \\LaravelLocalization::getCurrentLocale())->with('images')->get();\n\n $itemImages = collect();\n foreach ($related_items as $related_item) {\n if ($image = $related_item->images->first()) {\n $itemImages->push($image);\n }\n }\n\n $index = $itemImages->search(function (ItemImage $image) use ($item) {\n return $image->item->id == $item->id;\n });\n }\n\n $fullIIPImgURLs = $itemImages->map(function (ItemImage $itemImage) {\n return $itemImage->getDeepZoomUrl();\n });\n\n return view('zoom', [\n 'item' => $item,\n 'index' => $index,\n 'fullIIPImgURLs' => $fullIIPImgURLs,\n ]);\n }",
"public function generateTreeHTML(){\n\t\t\n\t\tif(count($this->ESMetadata['indexes'])>0){\n\t\t\t\n\t\t\t$treeHTML = \"<ul class=\\\"treeAction\\\">\";\n\t\t\tforeach($this->ESMetadata['indexes'] as $indexName => $metadata){\n\t\t\t\t\t\n\t\t\t\tif(strlen($indexName)>20){\n\t\t\t\t\t$indexNameDisplay = substr($indexName,0,20) . \"...\";\n\t\t\t\t}else{\n\t\t\t\t\t$indexNameDisplay = $indexName;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$treeHTML .= \"<li onClick=\\\"changeActiveIndex('$indexName')\\\" style=\\\"cursor:pointer;\\\">\";\n\t\t\t\t$treeHTML .= \"<i class=\\\"icon-minus-sign\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#tab1_$indexName\\\" id=\\\"{$indexName}_icon\\\" onClick=\\\"changeTreeIcon('{$indexName}','');\\\"></i>$indexNameDisplay\";\n\t\t\t\t$treeHTML .= \"<ul id=\\\"tab1_$indexName\\\" class=\\\"treeAction collapse in\\\">\";\n\t\t\t\t\n\t\t\t\tforeach($metadata['modules'] as $moduleName => $fields){\n\t\t\t\t\t$treeHTML .= \"<li id=\\\"{$indexName}_{$moduleName}\\\">\";\n\t\t\t\t\t$treeHTML .= \"<i id=\\\"{$indexName}_{$moduleName}_icon\\\" class=\\\"icon-plus-sign\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#{$indexName}_{$moduleName}_docs\\\" onClick=\\\"retrieveDocsByIndexAndType('{$indexName}','{$moduleName}');\\\"></i>\";\n\t\t\t\t\t$treeHTML .= \"$moduleName<div id=\\\"{$indexName}_{$moduleName}_child\\\"></div></li>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$treeHTML .= \"</ul></li>\";\n\t\t\t}\n\t\t\t$treeHTML .= \"</ul>\";\n\t\t\t\n\t\t\treturn \"<div id=\\\"treeHTML\\\">$treeHTML</div>\";\n\t\t}else{\n\t\t\t$this->logError(\"error\",\"empty_array\",\"ESMetadata is Empty, please check the settings entered.\");\n\t\t\treturn \"( empty )\";\n\t\t}\n\t}",
"protected function breadcrumbForIndex() \n {\n $breadcrumbTree = new ullVentoryBreadcrumbTree();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }",
"public function actionAreaTree()\n {\n $html = $this->renderPartial('tree', array(), true);\n Yii::app()->getClientScript()->renderBodyBegin($html);\n Yii::app()->getClientScript()->renderBodyEnd($html);\n echo $html;\n Yii::app()->end();\n }",
"public function getChildrenIndex();",
"function showHierarchy()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$this->setTabs();\n\t\t\n\t\t$ilCtrl->setParameter($this, \"backcmd\", \"showHierarchy\");\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t$form_gui = new ilChapterHierarchyFormGUI($this->content_object->getType(), $_GET[\"transl\"]);\n\t\t$form_gui->setFormAction($ilCtrl->getFormAction($this));\n\t\t$form_gui->setTitle($this->obj->getTitle());\n\t\t$form_gui->setIcon(ilUtil::getImagePath(\"icon_st.svg\"));\n\t\t$form_gui->setTree($this->tree);\n\t\t$form_gui->setCurrentTopNodeId($this->obj->getId());\n\t\t$form_gui->addMultiCommand($lng->txt(\"delete\"), \"delete\");\n\t\t$form_gui->addMultiCommand($lng->txt(\"cut\"), \"cutItems\");\n\t\t$form_gui->addMultiCommand($lng->txt(\"copy\"), \"copyItems\");\n\t\t$form_gui->addMultiCommand($lng->txt(\"cont_de_activate\"), \"activatePages\");\n\t\tif ($this->content_object->getLayoutPerPage())\n\t\t{\t\n\t\t\t$form_gui->addMultiCommand($lng->txt(\"cont_set_layout\"), \"setPageLayout\");\n\t\t}\n\t\t$form_gui->setDragIcon(ilUtil::getImagePath(\"icon_pg.svg\"));\n\t\t$form_gui->addCommand($lng->txt(\"cont_save_all_titles\"), \"saveAllTitles\");\n\t\t$form_gui->addHelpItem($lng->txt(\"cont_chapters_after_pages\"));\n\t\t$up_gui = ($this->content_object->getType() == \"dbk\")\n\t\t\t? \"ilobjdlbookgui\"\n\t\t\t: \"ilobjlearningmodulegui\";\n\t\t$ilCtrl->setParameterByClass($up_gui, \"active_node\", $this->obj->getId());\n\t\t$ilCtrl->setParameterByClass($up_gui, \"active_node\", \"\");\n\n\t\t$ctpl = new ilTemplate(\"tpl.chap_and_pages.html\", true, true, \"Modules/LearningModule\");\n\t\t$ctpl->setVariable(\"HIERARCHY_FORM\", $form_gui->getHTML());\n\t\t$ilCtrl->setParameter($this, \"obj_id\", $_GET[\"obj_id\"]);\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php\");\n\t\t$ml_head = ilObjContentObjectGUI::getMultiLangHeader($this->content_object->getId(), $this);\n\t\t\n\t\t$this->tpl->setContent($ml_head.$ctpl->get());\n\t}",
"protected function breadcrumbForIndex() \n {\n $breadcrumbTree = new ullCmsBreadcrumbTree();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }",
"function gvf_print_index_for_ham_menu( $permalink, $page, $index ) {\n\n if ( ! is_array( $index ) ) return; ?>\n\n <ul class=\"nav-items nav-items-first\">\n <?php foreach ( $index as $item ):\n gvf_get_index_items_recursive_ham_menu( $permalink, $page, $item );\n endforeach; ?>\n </ul>\n <?php\n}",
"public function getRenderedBranch($id = 1, $root = true){\n $query = \"\n SELECT\n `structure`.`id`,\n `structure`.`pid`,\n `structure_data`.`sort`,\n `structure_data`.`name`,\n `structure_data`.`path`,\n `structure_data`.`publish`\n FROM\n `structure`,\n `structure_data`\n WHERE\n `structure`.`pid` = \".$id.\" &&\n `structure`.`id` = `structure_data`.`id`\n ORDER BY\n `structure_data`.`sort` ASC\n \";\n $result = mysql_query($query);\n $array = array();\n $html = '';\n\n if(mysql_num_rows($result) > 0){\n $html .= '<ul>';\n };\n\n while($row = mysql_fetch_assoc($result)){\n if($row['publish'] == 1){\n $class = ' active';\n }else{\n $class = ' hided';\n };\n\n $html .= '<li id=\"item_'.$row['id'].'\" class=\"tree_item'.$class.'\" data-url=\"'.$row['path'].'\">';\n $html .= '<div class=\"item_container\"><div class=\"item_container_inner\">';\n $html .= '<a href=\"/admin/?option=structure&suboption=edit&id='.$row['id'].'\">'.$row['name'].'</a>';\n $html .= '</div></div>';\n if($root){\n $html .= $this->getRenderedBranch($row['id']);\n };\n $html .= '</li>';\n };\n\n if(mysql_num_rows($result) > 0){\n $html .= '</ul>';\n };\n\n return $html;\n }",
"function _listPages($id){\n global $ID;\n\n $pages = array();\n $base = dirname(wikiFN($ID));\n search($pages,$base,'search_allpages',array());\n $pages = array_reverse($pages);\n\n echo '<form class=\"plugin_nsexport__form' . $id . '\"\n action=\"'.DOKU_BASE.'lib/plugins/nsexport/export.php\"\n method=\"post\">';\n echo '<p><input type=\"submit\" id=\"do__export\" class=\"button\" value=\"'.$this->getLang('btn_export').'\" />';\n $ns = getNS($ID);\n if(!$ns) $ns = '*';\n printf($this->getLang('inns'), $ns);\n echo '</p>';\n\n echo '<ul>';\n $num = 0;\n $ns = getNS($ID). ':';\n foreach($pages as $page){\n $id = cleanID($ns . $page['id']);\n echo '<li><div class=\"li\"><input type=\"checkbox\" name=\"export[]\" '\n . 'id=\"page__'.++$num.'\" value=\"'.hsc($id).'\" '\n . 'checked=\"checked\" /> <label for=\"page__'.$num.'\">'\n . hsc($id) . '</label></div></li>';\n }\n echo '</ul>';\n echo '</form>';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use the query builder and the $joins to get a set of ILMSession based user events | protected function getIlmSessionEventsFor(int $id, DateTime $from, DateTime $to, array $joins): array
{
$qb = $this->_em->createQueryBuilder();
$what = 'c.id as courseId, s.id AS sessionId, school.id AS schoolId, ilm.id, ilm.dueDate, ' .
's.updatedAt, s.title, st.calendarColor, ' .
's.publishedAsTbd as sessionPublishedAsTbd, s.published as sessionPublished, ' .
's.attireRequired, s.equipmentRequired, s.supplemental, s.attendanceRequired, s.instructionalNotes, ' .
'c.publishedAsTbd as coursePublishedAsTbd, c.published as coursePublished, c.title as courseTitle,' .
'c.level as courseLevel, st.id as sessionTypeId, ' .
's.description AS sessionDescription, st.title AS sessionTypeTitle, c.externalId AS courseExternalId';
$qb->addSelect($what)->from('App\Entity\User', 'u');
foreach ($joins as $key => $statement) {
$qb->leftJoin($statement, $key);
}
$qb->leftJoin('ilm.session', 's');
$qb->leftJoin('s.course', 'c');
$qb->leftJoin('c.school', 'school');
$qb->leftJoin('s.sessionType', 'st');
$qb->where($qb->expr()->andX(
$qb->expr()->eq('u.id', ':user_id'),
$qb->expr()->between('ilm.dueDate', ':date_from', ':date_to')
));
$qb->setParameter('user_id', $id);
$qb->setParameter('date_from', $from, DoctrineType::DATETIME_MUTABLE);
$qb->setParameter('date_to', $to, DoctrineType::DATETIME_MUTABLE);
$results = $qb->getQuery()->getArrayResult();
return array_map(fn(CalendarEvent $event) => UserEvent::createFromCalendarEvent(
$id,
$event
), $this->createEventObjectsForIlmSessions($results));
} | [
"public function getUserEvents(): ActiveQueryInterface\n {\n return $this->hasMany(UserEvent::class, ['event_id' => 'event_id']);\n }",
"public function getUserevents()\n {\n return $this->hasMany(Userevent::className(), ['user_id' => 'id']);\n }",
"protected function getOfferingEventsFor(\n $id,\n DateTime $from,\n DateTime $to,\n array $joins\n ) {\n\n $qb = $this->_em->createQueryBuilder();\n $what = 'c.id as courseId, s.id AS sessionId, school.id AS schoolId, o.id, o.startDate, o.endDate, o.room, ' .\n 'o.url, o.updatedAt AS offeringUpdatedAt, s.updatedAt AS sessionUpdatedAt, s.title, st.calendarColor, ' .\n 's.publishedAsTbd as sessionPublishedAsTbd, s.published as sessionPublished, ' .\n 's.attireRequired, s.equipmentRequired, s.supplemental, s.attendanceRequired, s.instructionalNotes, ' .\n 'c.publishedAsTbd as coursePublishedAsTbd, c.published as coursePublished, c.title AS courseTitle, ' .\n 'c.level as courseLevel, st.id as sessionTypeId, ' .\n 's.description AS sessionDescription, st.title AS sessionTypeTitle, c.externalId AS courseExternalId';\n\n $qb->addSelect($what)->from('App\\Entity\\User', 'u');\n foreach ($joins as $key => $statement) {\n $qb->leftJoin($statement, $key);\n }\n $qb->leftJoin('o.session', 's');\n $qb->leftJoin('s.course', 'c');\n $qb->leftJoin('c.school', 'school');\n $qb->leftJoin('s.sessionType', 'st');\n\n $qb->andWhere($qb->expr()->eq('u.id', ':user_id'));\n $qb->andWhere($qb->expr()->orX(\n $qb->expr()->between('o.startDate', ':date_from', ':date_to'),\n $qb->expr()->andX(\n $qb->expr()->lte('o.startDate', ':date_from'),\n $qb->expr()->gte('o.endDate', ':date_from')\n )\n ));\n $qb->setParameter('user_id', $id);\n\n $qb->setParameter('date_from', $from, DoctrineType::DATETIME_MUTABLE);\n $qb->setParameter('date_to', $to, DoctrineType::DATETIME_MUTABLE);\n\n $results = $qb->getQuery()->getArrayResult();\n return $this->createEventObjectsForOfferings($results);\n }",
"public function events()\n {\n return $this->hasMany('App\\Event', 'user_id', 'id');\n }",
"public function select_user_events () {\n // Get the database connection if it's not the case yet\n $dbhandler = new SqliteDbHanlder (db_parser (_INI_DB_CONFIG_FILE,_SERVER_DIR));\n if (empty($dbhandler)) {\n echo 'Impossible to initiate communication with database </br>';\n return false;\n }\n // Look for events held by the event holder id in the events table\n $sql = 'SELECT * FROM events E LEFT OUTER JOIN event_holders EH \n \tON E.event_id = EH.event_id WHERE EH.user_id = :user_id';\n $query = $dbhandler->_db_connection->prepare($sql);\n if ($query) {\n $query->bindValue(':user_id', $this->_user_id, PDO::PARAM_INT);\n $query->execute();\n $events = array();\n $results = $query->fetchall();\n foreach ($results as $result_row) {\n try {\n // get event location\n $event_location = Location::get_location_from_id($result_row['event_location_id']);\n // get all languages spoken\n $languages = Language::select_languages_spoken ($result_row['event_id']); \n // get all event hosters\n $holders_ids = Event::select_holders_ids($result_row['event_id']);\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n if ((empty($languages)) || (empty($holders_ids)) || (empty($event_location)) ) {\n echo 'Impossible to retrieve datas for event ' . $result_row['event_id'];\n return false;\n }\n $parameters = array ('event_id' => intval($result_row['event_id']),\n \t\t\t\t'event_name' => html_entity_decode($result_row['event_name']), \n \t\t\t\t'event_location' => $event_location, \n \t\t\t\t'event_type' => html_entity_decode($result_row['event_type']), \n \t\t\t\t'event_starting_date' => html_entity_decode($result_row['event_starting_date']),\n \t\t \t'event_ending_date'=> html_entity_decode($result_row['event_ending_date']), \n \t\t \t'event_max_nb_participants' => intval($result_row['event_max_nb_of_participants']), \n \t\t \t'event_holders_ids' => $holders_ids, \n \t\t \t'event_description' => html_entity_decode( $result_row['event_description']),\n \t\t\t\t'event_languages' => $languages);\n // create new object event with input parameters\n \n //TODO add a try/catch here\n // create new object event with input parameters \n $event = new Event ($parameters);\n if (!empty($event)) {\n // create an array of event objects\n array_push ($events, $event);\n }\n else {\n echo 'The request to get events of user ' . $this->_user_id. 'failed';\n return false;\n }\n }\n // return the array of events objects;\n return $events;\n } else {\n echo \"The database request for selecting users in the\n\t\t\t'users'\ttable could not be prepared.<br/>\";\n return false;\n }\n }",
"private function getEventsFromDatabase(){\n $user=$this->user;\n \n $sql=\"SELECT * FROM \".$this->tableEvents.\"\n WHERE user_id=$user OR user_id=0\"; \n \n $result=$this->db->executeQuery($sql);\n \n while($filas=$result->fetchArray()){\n \t\n \t\n \t//die(var_dump(json_decode($filas['evt_data'])));\n \t\n $this->register($filas['evt_source'], $filas['evt_const'], json_decode($filas['evt_data']));\n ///$this->register($filas['evt_source'], $filas['evt_const'], $filas['evt_data']);\n }\n \n $this->clear();\n }",
"public function eventos() {\r\n\t\treturn $this->hasMany('Evento', 'usuario');\r\n\t}",
"function getJoinedMembers($conn, $event_id){\n $stmt = $conn->prepare('SELECT event_users.user_name, events.event_name, events.user_name AS creator, email\n FROM event_users INNER JOIN events\n ON event_users.event_id = events.event_id\n INNER JOIN users ON event_users.user_name = users.user_name\n WHERE event_users.event_id = ?');\n $stmt->bindValue(1,$event_id,PDO::PARAM_INT);\n $stmt->execute();\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $results;\n}",
"function getEvents() {\n\t$alluser = new Event();\n\t$alluser->getAllEvents();\n}",
"function getEventIds($userId) {\n return $this->find('list', array(\n 'conditions' => array('EventMember.user_id' => $userId),\n 'fields' => array('EventMember.event_id')\n ));\n }",
"public function getEventsBySessionId($sessionID) {\r\n if (!$sessionID) {\r\n return;\r\n }\r\n $sql = 'SELECT * FROM userEvents WHERE sessionID=?';\r\n $query = $this->conn->prepare($sql);\r\n $query->execute(array($sessionID));\r\n\r\n return $query->fetchAll();\r\n }",
"public function authEventLogs()\n {\n return $this->hasMany('App\\AuthEventLog');\n }",
"public static function my_events ($user = null) {\n \t$user = $user ? $user : \\User::val ('id');\n\n\t\treturn Registration::query ('distinct e.id, e.title, e.thumbnail')\n\t\t\t->from ('#prefix#event_registration r, #prefix#event e')\n\t\t\t->where ('r.event_id = e.id')\n\t\t\t->where ('r.user_id', $user)\n\t\t\t->where ('r.status > 0')\n\t\t\t->order ('r.ts', 'desc')\n\t\t\t->fetch_orig ();\n\t}",
"public function findEventsForUser($userId, \\DateTime $from, \\DateTime $to);",
"public function getUserLoginLog() : ActiveQuery\n {\n return $this->hasMany(UserLoginLog::class, ['user_id' => 'id']);\n }",
"public function getUsuarioEventos()\n {\n return $this->hasMany(UsuarioEvento::className(), ['idEvento' => 'idEvento']);\n }",
"public function fetchAllEvents();",
"public function users(): HasMany\n {\n return $this->hasMany(SessionUser::class);\n }",
"public function fetchEvents() \n {\n if(Auth::user()->isActivated() == false)\n return null;\n $partnerid = request()->partner_id;\n\n $start_date = date(\"Y-m-d\");\n $end_date = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));\n //$events = EventModel::whereBetween('event_start', '=', array($start_date, $end_date))->get();\n $events = EventModel::where('partner_id', '=', $partnerid)\n ->orderBy('event_start', 'desc')\n ->get();\n return $events;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ return columns hidden | public function get_hidden_columns(){
return array();
} | [
"public function get_hidden_columns()\n\t{\n\t\t\treturn array();\n\t}",
"public function get_hidden_columns(){\n\t\treturn array();\n\t}",
"public function get_hidden_columns()\r\n {\r\n return array();\r\n }",
"public function get_hidden_columns()\n\t{\n\t\treturn array();\n\t}",
"public function get_hidden_columns()\n {\n return array();\n }",
"public function get_hidden_columns() {\n\t\treturn array();\n\t}",
"function get_hidden_columns() {\n\t\t$hidden = array(\n\t\t\t'id',\n\t\t);\n\t\treturn $hidden;\n\t}",
"public function get_hidden_columns()\n\t{\n\t\t$screen = get_current_screen();\n\t\t$hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );\n\t\t\n\t\tif( $hidden === false )\n\t\t{\n\t\t\t$hidden = array(\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $hidden;\n\t}",
"function get_hidden_columns( ) {\r\n\t\t$columns = get_user_option( 'managesettings_page_' . MLACoreOptions::MLA_SETTINGS_SLUG . '-documentationcolumnshidden' );\r\n\r\n\t\tif ( is_array( $columns ) ) {\r\n\t\t\treturn $columns;\r\n\t\t}\r\n\r\n\t\treturn self::_default_hidden_columns();\r\n\t}",
"private static function _default_hidden_columns( ) {\r\n\t\treturn self::$default_hidden_columns;\r\n\t}",
"private function visibleColumns()\n {\n $login = $this->authentication->userLoggedIn();\n if($login)\n {\n return array_keys($this->visibility);\n }\n else\n {\n $result = array();\n foreach($this->visibility as $col => $visible)\n {\n if($visible)\n {\n $result[] = $col;\n }\n }\n return $result;\n }\n }",
"public function HideColumn()\n {\n $this->hiddenColumns = array_unique(func_get_args());\n }",
"function HideCol($col){}",
"public function hideAllColumns()\n {\n foreach ($this->objColumnArray as $objColumn) {\n $objColumn->Visible = false;\n }\n $this->blnModified = true;\n }",
"public function setColumnsHideable()\n\t{\n\t\t$this->can_hide_columns = true;\n\n\t\treturn $this;\n\t}",
"public function hidden(): Column\n {\n return $this->booleanAttribute('visible', false);\n }",
"public function hide_columns() {\n // Grab our current user.\n $user = wp_get_current_user();\n // Grab our form id.\n $form_id = absint( $_REQUEST['form_id'] );\n $hidden = isset( $_POST['hidden'] ) ? explode( ',', esc_html( $_POST['hidden'] ) ) : array();\n $hidden = array_filter( $hidden );\n update_user_option( $user->ID, 'manageedit-nf_subcolumnshidden-form-' . $form_id, $hidden, true );\n die();\n }",
"public function getVisibleColumns($gridId);",
"public function get_columns();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructs a ServerContainer from an array of server variables | public function __construct($arr){
$this->serverVars=$arr;
} | [
"public static function create(array $serverProperties);",
"public function injectServerVars(array $serverVars)\n {\n $this->serverVars = $serverVars;\n }",
"public static function collectServerVariables(array $variables): void\n {\n static::$serverVariables = array_merge(static::$serverVariables, (array)$variables);\n }",
"public function __construct() {\n $this->container = array(\n \"one\" => 1,\n \"two\" => 2,\n \"three\" => 3,\n );\n }",
"protected function __construct(array $servers){\n if (!$servers){\n #TODO: Raise an Exception\n }\n \n # Loop through all available memcached servers and connect\n # to each on of them.\n for ($i = 0, $n = count($servers); $i < $n; ++$i){\n \n # Yes, I know there is a OOP way to do that but using procedural function simply takes\n # less memory because the web server does not need to allocate memory\n # for each of the objects (connections)\n ( $con = memcache_pconnect(key($servers[$i]), current($servers[$i])) )&& \n $this->memcached_servers[] = $con;\n }\n \n $this->memcached_servers_count = count($this->memcached_servers);\n if (!$this->memcached_servers_count){\n $this->memcached_servers[0]=null;\n }\n }",
"public function __construct(array $entries)\n {\n foreach ($entries as $alias => $entry) {\n $this->container[$alias] = $entry;\n }\n }",
"public function __construct($servers) {\n $this->ring = array();\n $this->aliases = array();\n foreach ($servers as $alias => $options) {\n $this->instances[] = new Redis($options);\n if (is_string($alias)) {\n $this->aliases[$alias] = $this->instances[count($this->instances)-1];\n }\n for ($replica = 1; $replica <= $this->replicas; $replica++) {\n $this->ring[crc32(serialize($options).'-'.$replica)] = $this->instances[count($this->instances)-1];\n }\n }\n ksort($this->ring, SORT_NUMERIC);\n $this->nodes = array_keys($this->ring);\n }",
"public function pull(string ... $items): ContainerInterface\n {\n $container = new Container();\n\n foreach ( $items as $current ) {\n if ( $this->has($current) ) {\n $container->set($current, $this->get($current));\n }\n }\n\n return $container;\n }",
"public function getContainer(array $items = array())\n {\n $container = new GenericContainer($items);\n return $container;\n }",
"public function fromArrays(\n array $server,\n array $headers = [],\n array $cookie = [],\n array $get = [], /*?array*/ $post = null,\n array $files = [],\n $body = null\n ): ServerRequestInterface;",
"public function addServers($servers){}",
"public function setInitContainers(?array $value): void {\n $this->getBackingStore()->set('initContainers', $value);\n }",
"public function createContainerFromArray(array $structure): BaseContainerInterface;",
"public static function createFromServer(array $server)\n {\n $scheme = self::fetchServerScheme($server);\n $host = self::fetchServerHost($server);\n $port = self::fetchServerPort($server);\n $request = self::fetchServerRequestUri($server);\n\n return self::createFromUrl($scheme.$host.$port.$request);\n }",
"public function addServers($servers = '127.0.0.1:4730')\n {\n }",
"public function server(array $payload)\n {\n ksort($payload);\n\n $response = $this->api->getClient()->request('POST', 'servers', [\n 'json' => $payload,\n ]);\n\n return Server::createFromResponse($response, $this->api);\n }",
"public function createContainerFromArray(array $data): ContainerInterface;",
"public function setServer(array $server)\n\t{\n\t\t$this->_server = $server;\n\t}",
"public function setServers(?array $value): void {\n $this->getBackingStore()->set('servers', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Ajax form custom map icon via search query. | function gmw_ps_ajaxfmsgl_get_map_icons_via_query( $args, $gmw ) {
$icon_query = gmw_ps_gl_get_map_icons_via_query( $gmw );
if ( ! empty( $icon_query ) ) {
$args['db_fields'] .= ', ' . $icon_query;
}
return $args;
} | [
"function WPBikeRent_Theme_map_icon(){ \n\t\t$testlogo2 = 'img_map_logo';\n\t\techo $this->WPBikeRent_Theme_image_uploader_field( $testlogo2, get_option('img_map_logo') );\n\t}",
"public function search_icon_view() {\n\n\t\t\tget_template_part( 'views/site/search/search-icon' );\n\n\t\t}",
"function includeMapForm() {\r\n $this->pi_initPIflexForm();\r\n $map_search = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'map_search', 'options');\r\n $map_search_anchor = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'map_search_anchor', 'options');\r\n \r\n if ($map_search == 1) {\r\n return \"map.addControl(new google.maps.LocalSearch(), new GControlPosition(\".$map_search_anchor.\", new GSize(10,20)));\"; \r\n }\r\n \r\n else {\r\n \r\n }\r\n}",
"public abstract function setIcons();",
"public function setIconMap($icon_map) {\n $this->icon_map = $icon_map;\n return $this;\n }",
"public function BMLTPlugin_draw_map_search_form()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = '<div class=\"search_intro\" id=\"hidden_until_js\" style=\"display:none\">';\n $ret .= '<h1 class=\"banner_h1\">'.$this->process_text($this->my_current_language->local_GPS_banner).'</h1>';\n $ret .= '<h2 class=\"banner_h2\">'.$this->process_text($this->my_current_language->local_GPS_banner_subtext).'</h2>';\n $ret .= '<div class=\"link_one_line\"><a rel=\"nofollow\" accesskey=\"1\" href=\"'.htmlspecialchars($this->get_ajax_mobile_base_uri()).'?BMLTPlugin_mobile&do_search&bmlt_settings_id='.htmlspecialchars($this->my_http_vars['bmlt_settings_id']).((isset($this->my_http_vars['base_url']) && $this->my_http_vars['base_url']) ? '&base_url='.urlencode($this->my_http_vars['base_url']) : '').'\">'.$this->process_text($this->my_current_language->local_search_all).'</a></div>';\n $ret .= '<div class=\"link_one_line\"><a rel=\"nofollow\" accesskey=\"2\" href=\"'.htmlspecialchars($this->get_ajax_mobile_base_uri()).'?BMLTPlugin_mobile&do_search&qualifier=today&bmlt_settings_id='.htmlspecialchars($this->my_http_vars['bmlt_settings_id']).((isset($this->my_http_vars['base_url']) && $this->my_http_vars['base_url']) ? '&base_url='.urlencode($this->my_http_vars['base_url']) : '').'\">'.$this->process_text($this->my_current_language->local_search_today).'</a></div>';\n $ret .= '<div class=\"link_one_line\"><a rel=\"nofollow\" accesskey=\"3\" href=\"'.htmlspecialchars($this->get_ajax_mobile_base_uri()).'?BMLTPlugin_mobile&do_search&qualifier=tomorrow&bmlt_settings_id='.htmlspecialchars($this->my_http_vars['bmlt_settings_id']).((isset($this->my_http_vars['base_url']) && $this->my_http_vars['base_url']) ? '&base_url='.urlencode($this->my_http_vars['base_url']) : '').'\">'.$this->process_text($this->my_current_language->local_search_tomorrow).'</a></div>';\n $ret .= '<hr class=\"meeting_divider_hr\" />';\n $ret .= '</div>';\n \n return $ret;\n }",
"function gmw_ps_pt_set_map_icons_via_query( $clauses, $gmw ) {\r\n\r\n\tif ( ! empty( $gmw['map_markers']['usage'] ) ) {\r\n\t\t$usage = $gmw['map_markers']['usage'];\r\n\t} else {\r\n\t\t$usage = 'global';\r\n\t}\r\n\r\n\t// abort if not the right usage\r\n\tif ( ! in_array( $usage, array( 'global', 'per_post_type', 'per_post' ) ) ) {\r\n\t\treturn $clauses;\r\n\t}\r\n\r\n\tglobal $wpdb;\r\n\r\n\t// get icons url\r\n\t$icons = gmw_get_icons();\r\n\t$icons_url = $icons['pt_map_icons']['url'];\r\n\r\n\t// get default marker. If no icon provided or using the _default.png,\r\n\t// we than pass blank value, to use Google's default red marker.\r\n\tif ( ! empty( $gmw['map_markers']['default_marker'] ) && '_default.png' != $gmw['map_markers']['default_marker'] ) {\r\n\t\t$default_icon = $icons_url.$gmw['map_markers']['default_marker'];\r\n\t} else {\r\n\t\t$default_icon = GMW()->default_icons['location_icon_url'];\r\n\t}\r\n\r\n\t// if global icon.\r\n\tif ( $usage == 'global' ) {\r\n\r\n\t\t$clauses['fields'] .= $wpdb->prepare( \", %s as map_icon\", $default_icon );\r\n\r\n\t\treturn $clauses;\r\n\t} \r\n\r\n\t// if per post, get the icon from locations table\r\n\tif ( $usage == 'per_post' ) {\r\n\r\n\t\t$clauses['fields'] .= $wpdb->prepare( \", IF ( gmw_locations.map_icon IS NOT NULL AND gmw_locations.map_icon != '_default.png', CONCAT( %s, gmw_locations.map_icon ), %s ) as map_icon\", $icons_url, $default_icon );\r\n\r\n\t\treturn $clauses;\r\n\t}\r\n\r\n\t// if per post types icon\r\n\tif ( 'per_post_type' == $usage ) {\r\n\r\n\t\t// Get post types icon settings\r\n\t\t$post_types_icons = gmw_get_option( 'post_types_settings', 'post_types_icons', array() );\r\n\r\n\t\tif ( ! empty( $post_types_icons ) ) {\r\n\r\n\t\t\t$clauses['fields'] .= \", CASE {$wpdb->posts}.post_type \";\r\n\r\n\t\t\tforeach ( $post_types_icons as $post_type => $icon ) {\r\n\r\n\t\t\t\t// if custom icon exists, use it.\r\n\t\t\t\tif ( isset( $icon ) && $icon != '_default.png' ) {\r\n\r\n\t\t\t\t\t$icon = $icons_url.$icon;\r\n\r\n\t\t\t\t// otherwise, set to default icon\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$icon = $default_icon;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$clauses['fields'] .= $wpdb->prepare( \" WHEN %s THEN %s \", array( $post_type, $icon ) );\r\n\t\t\t}\r\n\r\n\t\t\t$clauses['fields'] .= $wpdb->prepare( \" ELSE %s END as map_icon \", $default_icon );\r\n\t\t}\r\n\t}\r\n\r\n\treturn $clauses;\r\n}",
"function gmw_ps_pt_map_icon( $map_icon, $post, $gmw ) {\r\n\r\n\t$pt_settings = gmw_get_options_group( 'post_types_settings' );\r\n\t$icons_data = gmw_get_icons();\r\n\t$icons_url = $icons_data['pt_map_icons']['url'];\r\n\t$form_field = ! empty( $gmw['map_markers'] ) ? $gmw['map_markers'] : array();\r\n\t$new_map_icon = $map_icon;\r\n\t$usage \t\t = isset( $form_field['usage'] ) ? $form_field['usage'] : 'global';\r\n\t$default_icon = isset( $form_field['default_marker'] ) ? $form_field['default_marker'] : '_default.png';\r\n\t\r\n\t// if showing same global map icon\r\n\tif ( $usage == 'global' ) {\r\n\t\t$new_map_icon = $default_icon;\r\n\t// per post map icon\r\n\t} elseif ( $usage == 'per_post' ) {\r\n\t\t$new_map_icon = ! empty( $post->map_icon ) ?$post->map_icon : $default_icon;\r\n\t// per post type map icons\r\n\t} elseif ( $usage == 'per_post_type' && ! empty( $pt_settings['post_types_icons'][$post->post_type] ) ) {\r\n\t\t$new_map_icon = $pt_settings['post_types_icons'][$post->post_type];\r\n\t// per category map icons\r\n\t} elseif ( $usage == 'per_category' && ! empty( $pt_settings['per_category_icons']['taxonomies'] ) ) {\t\r\n\r\n\t\treturn gmw_ps_pt_get_category_map_icon( $post->ID );\r\n\r\n\t//map icon as featured image\r\n\t} elseif ( $usage == 'image' ) {\r\n\r\n\t\tif ( has_post_thumbnail( $post->ID ) ) {\r\n\r\n\t\t\t$thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( 30, 30 ) );\r\n\t\t\t$new_map_icon = $thumb[0];\r\n\r\n\t\t} else {\r\n\t\t\t$new_map_icon = GMW_PS_URL.'/posts/assets/map-icons/_no_image.png';\r\n\t\t}\r\n\t} else {\r\n\t\t$new_map_icon = '_default.png';\r\n\t}\r\n\r\n\tif ( $usage != 'image' ) {\r\n\t\t$map_icon = ( empty( $new_map_icon ) || $new_map_icon == '_default.png' ) ? $map_icon : $icons_url.$new_map_icon;\r\n\t} else {\r\n\t\t$map_icon = $new_map_icon;\r\n\t}\r\n\r\n\treturn $map_icon;\r\n}",
"public function setPinpointIcon() {\n return $this->setIcon('<svg width=\"135\" height=\"214\" viewBox=\"0 0 135 214\" xmlns=\"http://www.w3.org/2000/svg\"><title>pinpoint</title><g fill=\"none\" fill-rule=\"nonzero\"><path d=\"M135 67.5C135 30.4 104.9 0 67.5 0 30.4 0 0 30.1 0 67.5c0 20.3 9.1 38.6 23.6 51l43.6 94.9 43.6-94.9c15.1-12.1 24.2-30.3 24.2-51z\" fill=\"#FCB341\"/><path d=\"M11.5 68.6c0 30.9 25.1 56.3 56.3 56.3V12.3c-30.9 0-56.3 25.3-56.3 56.3z\" fill=\"#45466D\"/><path d=\"M67.4 12.3v112.6c30.9 0 56.3-25.1 56.3-56.3 0-31-25.3-56.3-56.3-56.3z\" fill=\"#383754\"/></g></svg>');\n }",
"function ut_icon_map( $atts, $content = null ) {\n return '<i class=\"fa fa-map-marker\">' . do_shortcode($content) . '</i> ';\n}",
"function gmw_ps_fl_get_map_icons_via_query( $gmw ) {\n\n\tif ( false == ( $usage = $gmw['map_markers']['usage'] ) ) {\n\t\t$usage = 'global';\n\t}\n\n\t// abort if not the right usage\n\tif ( ! in_array( $usage, array( 'global', 'per_member' ) ) ) {\n\t\treturn false;\n\t}\n\n\tglobal $wpdb;\n\n\t// get icons url\n\t$icons = gmw_get_icons();\n\t$icons_url = $icons['fl_map_icons']['url'];\n\n\t// get default marker. If no icon provided or using the _default.png,\n\t// we than pass blank value, to use Google's default red marker.\n\tif ( ! empty( $gmw['map_markers']['default_marker'] ) && '_default.png' != $gmw['map_markers']['default_marker'] ) {\n\t\t$default_icon = $icons_url.$gmw['map_markers']['default_marker'];\n\t} else {\n\t\t$default_icon = GMW()->default_icons['location_icon_url'];\n\t}\n\n\t// if global icon.\n\tif ( 'global' === $usage ) {\n\t\treturn $wpdb->prepare( \"%s as map_icon\", $default_icon );\n\t}\n\n\t// if per post, get the icon from locations table\n\tif ( 'per_member' === $usage ) {\n\n\t\treturn $wpdb->prepare( \"IF ( gmw_locations.map_icon IS NOT NULL AND gmw_locations.map_icon != '_default.png', CONCAT( %s, gmw_locations.map_icon ), %s ) as map_icon\", $icons_url, $default_icon );\n\n\t}\n\n\treturn false;\n}",
"function csl_ajax_search() {\n $this->find_locations( 'search' );\n }",
"private function augment_settings_map_markers() {\n\n\t\t$related_to = 'map_end_icon,default_icons';\n\t\t$new_options[ 'default_icons' ] = array( 'related_to' => $related_to , 'type' => 'checkbox' );\n\n\t\t$this->attach_to_slp( $new_options , array( 'page'=> 'slp_experience','section' => 'map', 'group' => 'markers' ) );\n\t}",
"public function setIcon($icon);",
"function SetIcon(wxIcon $icon){}",
"public function mapIcons() {\n\n // page level styles\n $this->css['pages'][] = 'global/plugins/bower_components/map-icons/css/map-icons.css';\n\n // theme styles\n $this->css['themes'] = [\n 'admin/css/reset.css',\n 'admin/css/layout.css',\n 'admin/css/components.css',\n 'admin/css/plugins.css',\n 'admin/css/themes/laravel.theme.css' => ['id' => 'theme'],\n 'admin/css/custom.css',\n ];\n\n // page level plugins\n $this->js['additionalScripts'] = [\n 'http://maps.googleapis.com/maps/api/js?sensor=false'\n ];\n\n $this->js['plugins'] = [\n 'global/plugins/bower_components/map-icons/js/map-icons.min.js'\n ];\n\n // page level scripts\n $this->js['scripts'] = [\n 'admin/js/apps.js',\n 'admin/js/pages/blankon.maps.icon.js',\n 'admin/js/demo.js'\n ];\n\n // pass variable to view\n View::share('css', $this->css);\n View::share('js', $this->js);\n View::share('title', 'MAP ICONS | BLANKON - Fullpack Admin Theme');\n\n return view('component/map-icons');\n }",
"public function setIconName(?string $iconName): InfoboxInterface;",
"public function loadMarkerIcons()\n {\n foreach($this->markers as $marker)\n {\n if ($marker->getIcon() instanceof Radcodes_Lib_Google_Map_Icon)\n {\n $this->addIcon($marker->getIcon());\n }\n }\n }",
"public function slcr_add_new_icon_set_to_iconbox() { \n\t\t\t$icons_name = \"flaticon\";\n\t\t $param = WPBMap::getParam( 'vc_icon', 'type' );\n\t $param['value'][__( 'Custom Pack', 'moppers' )] = $icons_name;\n\t vc_update_shortcode_param( 'vc_icon', $param ); \n\t // list of icons that add \n\t add_filter( 'vc_iconpicker-type-flaticon', array( $this, 'slcr_add_icon_array' ), 15 ); \n\t add_action( 'vc_base_register_front_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n \t\tadd_action( 'vc_base_register_admin_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n\n \t\tadd_action( 'vc_backend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n \t\tadd_action( 'vc_frontend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a stream array of the connected Geospaces based on direction | private function get_connected_geospaces( $dir ) {
return $this->get_connected_geospaces_stream( $dir );
} | [
"private function get_connected_geospaces_stream( $dir ) {\n $post_type_name_plural = true;\n $post_type_name_sanitize = true;\n $sanitized_name = $this->get_post_type_name( $post_type_name_plural, $post_type_name_sanitize );\n $connection_type = $sanitized_name . '_to_' . $sanitized_name;\n $query = new \\WP_Query( [\n 'post_type' => static::$post_type,\n 'posts_per_page' => -1,\n 'connected_type' => $connection_type,\n 'connected_items' => $this->get_id(),\n 'connected_direction' => $dir,\n 'orderby' => 'title',\n 'order' => 'asc',\n ] );\n return Post::get_posts_from_query( $query );\n }",
"public function get_connected_states($state, $direction) {\n $result = array();\n $transitions = $this->get_adjacent_transitions($state, !$direction);\n foreach ($transitions as $tran) {\n if ($direction == 0) {\n $result[] = $tran->to;\n } else {\n $result[] = $tran->from;\n }\n }\n return $result;\n }",
"public function getDirections(){}",
"public function getIterator()\n {\n return new \\ArrayIterator($this->ships);\n }",
"public function getDestinationIslandRepo()\n {\n $island = $this->route->select('destination_island')->get();\n $route = [];\n foreach ($island as $key => $value) {\n if (!in_array($value, $route)) {\n $route[] = $value;\n }\n }\n return $route;\n }",
"public function getMapDestinations();",
"function getDestinations();",
"public function getOriginsAndDestinations()\n\t{\n\t\t$routes = array();\n\t\tself::$db->query(\"SELECT DISTINCT origin origin_id, state_name FROM routes r JOIN states s ON r.origin = s.id ORDER BY state_name \");\n\t\t$routes['origins'] = self::$db->fetchAll('obj');\n\n\t\tself::$db->query(\"SELECT DISTINCT destination destination_id, state_name FROM routes r JOIN states s ON r.destination = s.id ORDER BY state_name \");\n\t\t$routes['destinations'] = self::$db->fetchAll('obj');\n\t\treturn $routes;\n\t}",
"public function getStreams(): array;",
"public function getAllGeonodes() {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\t\t$qb->where(\"rel.geometryvalue IS NOT NULL\");\n\t\treturn $qb->getQuery()->getResult();\n\t}",
"public function getDistanceMap(): array\n {\n $ret = [];\n foreach ($this->vertex->getGraph()->getVertices() as $vertex) {\n try {\n $ret[$vertex->getId()] = $this->getDistance($vertex);\n } catch (OutOfBoundsException $ignore) {\n // ignore vertices that can not be reached\n }\n }\n\n return $ret;\n }",
"public function findAllOrigin(): array\n {\n $queryBuilder = $this\n ->getEntityManager()->createQueryBuilder()\n ->select('map')\n ->from(Map::class, 'map')\n ->Where('map.removed IS NULL')\n ->andWhere('map.origin IS NOT NULL')\n ->orderBy('map.name', 'ASC')\n ;\n\n return $queryBuilder->getQuery()->getResult();\n }",
"function get_visited_list() {\n return get_destinations(\"WHERE visited = TRUE\");\n}",
"public function getObjects()\r\n {\r\n return $this->streamObjects;\r\n }",
"public function get_connects_to(){\n return $this->connects_to[$this->current];\n }",
"public function getPlatformTopology(): array;",
"public function getDirections() {\n\t\t$list = [];\n\t\tif (in_array(self::SYNC_NONE, $this->arDirections)) {\n\t\t\t$list[] = [\n\t\t\t\t'id' => self::SYNC_NONE,\n\t\t\t\t'name' => Loc::getMessage('ACRIT_CRM_PLUGIN_DIRECTS_NONE'),\n\t\t\t];\n\t\t}\n\t\tif (in_array(self::SYNC_STOC, $this->arDirections)) {\n\t\t\t$list[] = [\n\t\t\t\t'id' => self::SYNC_STOC,\n\t\t\t\t'name' => Loc::getMessage('ACRIT_CRM_PLUGIN_DIRECTS_STOC'),\n\t\t\t];\n\t\t}\n\t\tif (in_array(self::SYNC_CTOS, $this->arDirections)) {\n\t\t\t$list[] = [\n\t\t\t\t'id' => self::SYNC_CTOS,\n\t\t\t\t'name' => Loc::getMessage('ACRIT_CRM_PLUGIN_DIRECTS_CTOS'),\n\t\t\t];\n\t\t}\n\t\tif (in_array(self::SYNC_ALL, $this->arDirections)) {\n\t\t\t$list[] = [\n\t\t\t\t'id' => self::SYNC_ALL,\n\t\t\t\t'name' => Loc::getMessage('ACRIT_CRM_PLUGIN_DIRECTS_ALL'),\n\t\t\t];\n\t\t}\n\t\treturn $list;\n\t}",
"static function getSpaceList() {\n $q = \"SELECT * FROM Space as s JOIN Location as l ON s.LocationID = l.LocationID ORDER BY s.LocationID ,s.SpaceID\";\n self::$db->query($q);\n self::$db->execute();\n return self::$db->resultSet();\n\n }",
"public function getDirections()\n {\n return $this->directions;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new explicitText | public function setExplicitText($explicitText)
{
$this->explicitText = $explicitText;
return $this;
} | [
"public function setText($text);",
"public function setText($text) {\n\t\t$this->text = htmlentities($text);\n\t}",
"public function setText($text)\n {\n $this->addText = true;\n $this->text = $text;\n }",
"public function set_text( $text ) {\n\t\t$this->text = addslashes( $text ); // is the addslashes necessary?\n\t}",
"public function setText($text) {\n $this->text = $text;\n }",
"public function setText($text)\n {\n $this->text = $text;\n }",
"public function set_text($text)\n {\n $this->entry->set_text($text);\n }",
"public function setPlainText($text)\n {\n $this->_plainText = $text . \"\"; //force it to be a string\n }",
"function set_text($text){\n\t\tif (!empty($text)){\n\t\t\t$this->mail_text = $text;\n\t\t}\n\t}",
"public function setText(string $text): void\n {\n $this->text = $text;\n $this->fontInfo = null;\n }",
"public function setText($text) {\n\t\t$this->text = $text;\n\t\t// Reset the rendered text. It will be filled again when the post\n\t\t// is rendered.\n\t\t$this->renderedText = '';\n\t}",
"public function setInitialText(string $text):void {\r\n\t\t$this->initialText = $text;\r\n\t}",
"public function setText($text)\n {\n $this->text = $this->message['text'] = $text;\n }",
"function SetText($text)\t\r\n\t{\r\n\t\t$this->TextHolder->Text = $text;\r\n\t\tif($this->TextHolder->ShowStatus == Component::Shown)\r\n\t\t\tClientScript::Queue($this->TextHolder, \"CKEDITOR.instances.{$this->TextHolder}.setData\", array($text));\r\n\t}",
"function setText($text_in) {\n $this->page_text .= $text_in;\n }",
"function setText($text)\r\n {\r\n $this->text = nl2br($text);\r\n $this->wordCount = str_word_count($text);\r\n }",
"protected function setText()\n\t{\n\t\t$this->text = implode(' ', $this->words);\n\t}",
"public function text($text)\n\t{\n\t\t$this->_contents .= $text;\n\t}",
"public function setText($text)\n {\n \t$this->CALL_TEXT = $this->_generate_text_to_say($text);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get corresponding divvit tag/tracker url | public function getDivvitUrl($type = '')
{
if ($type == 'tag') {
if (getenv('DIVVIT_TAG_URL') != '') {
return getenv('DIVVIT_TAG_URL');
} else {
return 'https://tag.divvit.com';
}
} else {
if (getenv('DIVVIT_TRACKING_URL') != '') {
return getenv('DIVVIT_TRACKING_URL');
} else {
return 'https://tracker.divvit.com';
}
}
} | [
"public function getTrackUrl();",
"public function get_tracking_url(){\n\t\treturn $this->v_tracking_url;\n\t}",
"public function getTrackingTag() {\n if (Mage::helper('peerius_smartrecs')->isTestMode()) {\n return '<script type=\"text/JavaScript\" src=\"//uat.peerius.com/tracker/peerius.page\" charset=\"UTF-8\"></script>';\n }\n return '<script type=\"text/JavaScript\" src=\"//'.$this->escapeHtml(Mage::getStoreConfig('peerius/general/client_name')).'.peerius.com/tracker/peerius.page\" charset=\"UTF-8\"></script>';\n }",
"public function get_tags_url() {\n\t\treturn $this->service_url . 'explore/tags/%s/';\n\t}",
"public function getUrl(){\n $this->logImpression();\n\n return \"/mms/visit/\" . $this->id;\n }",
"function getPageViewTrackingUrl($url)\n {\n return craft()->instantAnalytics->getPageViewTrackingUrl($url);\n }",
"public function getTrackingURL($label);",
"public function get_tags_url() {\n\t\t\treturn apply_filters( 'cherry_instagram_widget_get_tags_url', $this->service_url . 'explore/tags/%s/' );\n\t\t}",
"public function getTrackViewUrl()\n {\n return $this->trackViewUrl;\n }",
"public function getUrlAttribute()\n {\n $name = str_replace(\" \", \"-\", str_replace(\"#\", \"\", $this->name));\n return url(\"blog/tag/{$this->id}-\") . strtolower($name);\n }",
"protected function parseGadgetUrl() {\n if(preg_match('/^\\[(.*)\\]$/',$this->gadget_url,$match) > 0)\n $this->gadget_url = $match[1];\n else\n $this->gadget_url = path('html', 'global', 'gadgets', $this->gadget_url);\n }",
"public function getPageUrl();",
"function getTargetUrl();",
"public function getUrl()\n {\n return Yii::$app->urlManager->createUrl(['torrent/default/view', 'id' => $this->id, 'name' => $this->getUrlName()]);\n }",
"public function get_url() {\n return $this->get_place_details_field( 'url' );\n }",
"public function getTrackingLink() : string;",
"private function matomo_trackurl() {\n global $DB;\n $pageinfo = get_context_info_array($this->page->context->id);\n // Adds page title.\n $trackurl = \"'\";\n\n if ((isset($pageinfo[1]->category)) || (isset($pageinfo[1]->fullname)) || (isset($pageinfo[2]->name))) {\n // Adds course category name.\n if (isset($pageinfo[1]->category)) {\n if ($category = $DB->get_record('course_categories', array('id' => $pageinfo[1]->category))) {\n $cats = explode(\"/\", $category->path);\n foreach (array_filter($cats) as $cat) {\n if ($categorydepth = $DB->get_record(\"course_categories\", array(\"id\" => $cat))) {\n $trackurl .= $categorydepth->name . '/';\n }\n }\n }\n }\n\n // Adds course full name.\n if (isset($pageinfo[1]->fullname)) {\n if (isset($pageinfo[2]->name)) {\n $trackurl .= $pageinfo[1]->fullname . '/';\n } else if ($this->page->user_is_editing()) {\n $trackurl .= $pageinfo[1]->fullname . '/' . get_string('edit');\n } else {\n $trackurl .= $pageinfo[1]->fullname . '/' . get_string('view');\n }\n }\n\n // Adds activity name.\n if (isset($pageinfo[2]->name)) {\n $trackurl .= $pageinfo[2]->modname . '/' . $pageinfo[2]->name;\n }\n } else {\n $trackurl .= $this->page->title;\n }\n\n $trackurl .= \"'\";\n return $trackurl;\n }",
"public function getURL() {\n if (!empty($this->localInfo['url'])) return $this->localInfo['url'];\n return 'https://www.dokuwiki.org/'.($this->isTemplate() ? 'template' : 'plugin').':'.$this->getBase();\n }",
"public function getURL() {\n\t\t\tif (!empty($this->url_override)) return $this->url_override;\n\t\t\treturn get_entity_url($this->getGUID()); \n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bangladesh mobile number validation | function bangladesh_mobile_validation($mobile){
$regex = '/01[^1-4]\d{8}/';
if (preg_match($regex,$mobile)) {
return 1;
}else {
return 0;
}
} | [
"function checkMobileValidation($mobile){\r\r\n global $mycms,$cfg;\r\r\n if(substr($mobile, 0, 1)=='+'){\r\r\n $mobile = substr($mobile, 3);\r\r\n }\r\r\n //$mobile = $mycommoncms->getFieldValue($mobile);\r\r\n $mobileLen = strlen($mobile);\r\r\n $checkMobile = checkNumberValidation($mobile);\r\r\n if($mobileLen==10 && $checkMobile==1){\r\r\n return 1;\r\r\n }\r\r\n else {\r\r\n return 0;\r\r\n }\r\r\n\r\r\n }",
"function validate_mobile($input_mobile)\r\n{\r\n\tif (!preg_match(\"/^[2-9]{1}[0-9]{9}$/\",$input_mobile)) \r\n\t{\r\n \treturn false;\r\n }\r\n\telse\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}",
"function is_valid_mobile_number($mobile)\n {\n return preg_match('/^[0-9]{10}+$/', $mobile);\n }",
"function toValidateMobileNumber($mobile) {\n\n return $mobile ='+98' . substr($mobile , -10 , 10);\n }",
"function is_valid_mobile($mobile)\n{\n // This phone number has been passed before and fails Northstar validation.\n if ($mobile == '000-000-0000') {\n return false;\n }\n\n /**\n * Remove spaces and dashes and make sure there are at least 10 digits, e.g. \"787 249 13\" has\n * been passed and fails Northstar validation.\n */\n $mobile = preg_replace(\"/[\\s-]+/\", '', $mobile);\n\n return strlen($mobile) > 9;\n}",
"function correctMobileFormat($mobile) {\r\n $res = isset($mobile) && $mobile !== \"\";\r\n if ($res === TRUE) {\r\n /* Regular expression:\r\n * ^6 -> Starts with 6\r\n * [[:digit:]]{8} -> Eight more digits\r\n */\r\n $res = $res && preg_match('/^6[[:digit:]]{8}$/', $mobile);\r\n }\r\n return $res;\r\n}",
"private function checkphone() {\r\n\t\t$variable = \"phone\";\r\n\t\t$max = 20;\r\n\t\t$min = 6;\r\n\t\tif(!$this->checkIsnumber($this->$variable) or !$this->checkStrelenshorterthan($this->$variable, $max) or !$this->checkStrelenlongerthan($this->$variable, $min)) {\r\n\t\t\t$this->setAddResultRecord(\"Error: Phone number should not be more than $max and less than $min digits.<br>\");\r\n\t\t\t$this->validated = 0;\r\n\t\t}\r\n\t}",
"public static function validateMobile($mobile){\n return preg_match(\"/^[6789][0-9]{9}$/\",$mobile);\n }",
"function isValidPhoneNumnber($phone) {\n\t $phone = preg_replace(\"/[^0-9]/\", '', $phone);\n\t // #REQ49\n\t if (strlen($phone) >= 5) {\n\t\treturn 1;\n\t }\n\t return 0;\n }",
"function validate_phone_se($phone) {\n $result = false;\n\n //Remove bad characters\n $phone = strip_bad_characters($phone);\n //If there is a prefix replace this with 0\n $phone = str_replace('+46', '0', $phone);\n\n //Cellphone number 7 - 13 digits\n if (check_length_ge($phone, 7) && check_length_le($phone, 13)) {\n $array_of_chars = array('010', '070', '072', '073', '076');\n $result = check_substr_chars($phone, $array_of_chars, 0, 3);\n }\n return $result;\n}",
"function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}",
"function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}",
"public function testIsValidMobile()\n {\n $this->assertEquals(is_valid_mobile('212-254-2390'), true);\n $this->assertEquals(is_valid_mobile('000-000-0000'), false);\n $this->assertEquals(is_valid_mobile('787 249 13'), false);\n $this->assertEquals(is_valid_mobile('302367890'), false);\n }",
"public function mobileTelephoneNumber()\n {\n return $this->validateAlphaNumeric($this->struct['Personal']['MobileTelNumber'], func_get_args(), 16);\n }",
"function validPhone($phone){\n\n return is_numeric($phone) && (strlen($phone)>=0 && strlen($phone) <= 11);\n }",
"public function mobile_number($num) {\n \t$id = $this->uri->segment(4);\n \t$number = $this->admin_model->getMobileNumber($this->users,$id,$num);\n if ($number == $num) {\n $this->form_validation->set_message('mobile_number', 'The {field} field exists for one of the user.');\n return FALSE;\n }\n else {\n return TRUE;\n }\n }",
"public static function Validate_Mobile_Number($mobile_num)\t{\t\t$len=strlen($mobile_num);\t\tif(!is_numeric($mobile_num))\t\t{\t\t\treturn false;\t\t}\t\tif($len!=10)\t\t{\t\t\treturn false;\t\t}\t\t\t\t$first_digit=substr($mobile_num,0,1);\t\t\t\tif(substr_count($mobile_num, $first_digit)==10)\t\t{\t\t\t\treturn false;\t\t}\t\t\t\treturn true;\t}",
"function BH_validate_phone( $result, $tel ) {\r\n\r\n\t// return\r\n\treturn ! ( strlen( $tel ) < 9 );\r\n\r\n}",
"function phoneIsValid($str){\n return isNumeric($str) && hasLength($str, PHONE_LENGTH, PHONE_LENGTH);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the html to display a project's tags | function getTags($project) {
$str = "";
if ($project->tags) {
$str .= "<br /><h4 style='margin: 0'>Tags: </h4><p>";
$length = count($project->tags);
for ($i = 0; $i < $length; $i++) {
$tag_name = $project->tags[$i];
//only put comma if it's not the last tag
$end = $i+1 == $length ? "" : ", ";
$content = "<a class='entry-title' "
."href='/Flint/?controller=pages&action=tag&tag="
.$tag_name."'>".$tag_name."</a>";
$str .= $content.$end;
}
$str .= "</p>";
}
return $str;
} | [
"function getTags($project) {\n $str = \"\";\n if ($project->tags) {\n $str .= \"<br /><h2 style='margin: 0'>Tags: </h2><p>\";\n $length = count($project->tags);\n for ($i = 0; $i < $length; $i++) {\n $tag_name = $project->tags[$i];\n //only put comma if it's not the last tag\n $end = $i+1 == $length ? \"\" : \", \";\n $content = \"<a class='entry-title' \"\n .\"href='/Flint/?controller=pages&action=tag&tag=\"\n .$tag_name.\"'>\".$tag_name.\"</a>\";\n $str .= $content.$end;\n }\n $str .= \"</p>\";\n }\n return $str;\n }",
"static function getTagsHtml() {\n $api = self::getAPI();\n $tags = $api->getTopTags();\n\n $tags_li = \"<li class='tag active' data-tag=''>\".__(\"All\").\"</li>\";\n foreach ($tags as $tag) {\n $tags_li.= \"<li class='tag' data-tag='{$tag['key']}'>\".ucfirst($tag['tag']).\"</li>\";\n }\n\n return \"<ul class='plugins-tags'>{$tags_li}</ul>\";\n }",
"function GetTagsForProject($projId)\n {\n $ret = array();\n $sql = 'SELECT t.TAG_DESC, t.TAG_ID ' .\n ' FROM PROJECT_TAGS pt, TAGS t ' .\n ' WHERE pt.TAG_ID = t.TAG_ID ' .\n ' AND pt.PROJECT_ID = ' . $projId . \n ' ORDER BY t.TAG_DESC ASC ';\n\n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $ret[] = '<span class = \"tag\" ' . \n ' title = \"Click to filter posts by ' . $row['TAG_DESC'] . '.' .\n '\" onclick = \"markForm(' . $row['TAG_ID'] . '); submitForm();\"' . '>' . $row['TAG_DESC'] .\n '</span>';\n }\n \n return $ret;\n }",
"function gwp_get_project_tags()\n{\n $project_id = get_the_ID();\n $output = '';\n $project_tags = get_the_terms($project_id, 'project_tag');\n if (!empty($project_tags) && !is_wp_error($project_tags))\n {\n foreach ($project_tags as $project_tag)\n {\n $output .= '<a href=\"' . get_tag_link($project_tag->term_id) . '\" class=\"meta\"><span>' . $project_tag->slug . '</span></a>';\n }\n }\n echo $output;\n}",
"function displayProject($project) {\n $html = \"\n <div class='entry'>\n <h4>\n <a class='entry-title' \n href='/Flint/?controller=pages&action=project&pid=\"\n . $project->pid\n . \"'>\"\n . $project->pname .\"\n </a>\n </h4>\n <p>\"\n . $project->description . \"\n </p>\".getTags($project).\"\n </div>\n \";\n return $html;\n }",
"public function tag() {\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/model/project.php');\n $tag_name = $_GET['tag'];\n $tag_name = htmlspecialchars($tag_name, ENT_QUOTES, 'UTF-8');\n //log tag view\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/model/view_log.php');\n ViewLog::logTagView($_SESSION['username'], $tag_name);\n //get projects matching that tag\n $projects = Project::getProjectsByTagName($tag_name);\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/view/pages/tag_view.php');\n }",
"function git_get_tags($project)\n{\n\t$tags = array();\n\n\t$output = run_git($project, 'show-ref --tags');\n\tforeach ($output as $line) {\n\t\t$fullname = substr($line, 41);\n\t\t$tmp = explode('/', $fullname);\n\t\t$name = array_pop($tmp);\n\t\t$tags[] = array('h' => substr($line, 0, 40), 'fullname' => $fullname, 'name' => $name);\n\t}\n\treturn $tags;\n}",
"public function listPendingTags()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tags = $em->getRepository('AppBundle:Tag')->findAllPending();\n\n return $this->render('public/publicTag.html.twig', array(\n 'tags' => $tags,\n ));\n }",
"function ava_portfolio_tags() {\n\tglobal $post;\n\n\t$terms = wp_get_post_terms( $post->ID, 'portfolio_tag' );\n\n\tif ( ! empty( $terms ) && ! is_wp_error( $terms ) ){\n\t\techo '<div class=\"project-tags\">';\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\techo '<span>#' . esc_html( $term->name ) . '</span>';\n\t\t\t}\n\t\techo '</div>';\n\t}\n}",
"public function listTags()\n {\n $html = '';\n $tags = $this->query()\n ->execute();\n\n foreach ($tags as $tag) {\n $show = $this->url->create('forumdb/view/' . $tag->tag);\n $html .= '<a href=\"' . $show . '\">' . $tag->tag . '</a>, ';\n }\n\n return $html;\n }",
"public function tags()\n {\n return $this->client->get('/repositories/'.$this->name().'/tags');\n }",
"public function viewtagsAction()\n {\n $tagsHTML = $this->tags->listTags();\n\n $this->views->add('kmom03/page1', [\n 'content' => $tagsHTML,\n ],'main');\n }",
"public function get_tags_url() {\n\t\treturn $this->service_url . 'explore/tags/%s/';\n\t}",
"public function getRepoTags(){\n $this->_request( sprintf( $this->src_userRepoTags, $this->user, $this->repo ) );\n if( $this->responseCode != 200 ){\n echo 'GitHub server error...'; // e.g\n }\n return json_decode( $this->responseText );\n }",
"public function getTags();",
"function tagsCloud(){ \n\t$module_config = getModuleConfig(\"videos\");\n\t$module_channels = getModuleChannels($module_config['channels'], $_SESSION['user_canal']);\n\t$filter_videos = ($_SESSION['user_canal'] == 'admin' ? \"\" : \" AND (v.canal IN (\".$module_channels.\") OR v.canal='') \");\n\t?>\n\t<br />\n\t<div class=\"tags\">\n\t\t<h4>\n\t\t\t<span class=\"fa-stack fa-sx\">\n\t\t\t\t<span class=\"fa fa-circle fa-stack-2x\"></span>\n\t\t\t\t<span class=\"fa fa-tags fa-stack-1x fa-inverse\"></span>\n\t\t\t</span>\n\t\t\t<?php e_strTranslate(\"Tags\");?>\n\t\t</h4>\n\t\t<?php\n\t\t$videos = new videos();\n\t\t$tags = $videos->getTags($filter_videos); //print_r($tags);\n\t\t$diferencia = max($tags) - min($tags);\n\t\t$diferencia = ($diferencia != 0 ? $diferencia : 1);\n\t\tksort($tags);\n\t\tforeach(array_keys($tags) as $key){\n\t\t\t$valor_relativo = round((($tags[$key] - min($tags)) / $diferencia) * 10);\n\t\t\techo '<a href=\"videos?tag='.$key.'\" class=\"tag'.$valor_relativo.'\">'.$key.'</a> ';\n\t\t} ?>\n\t</div>\n <?php }",
"public function badgeCloud()\n\t{\n\t\t$html = '<ul class=\"tags badges\">';\n\t\tforeach ($this->tags() as $badge)\n\t\t{\n\t\t\tif ($badge->label == \"badge\" && $badge->tbl = 'citations')\n\t\t\t{\n\t\t\t\t$html .= '<li><a href=\"#\" class=\"tag\">' . stripslashes($badge->tag->tag) . '</a></li>';\n\t\t\t}\n\t\t}\n\n\t\t$html .= '</ul>';\n\n\t\treturn $html;\n\t}",
"function gtags_display_tags() {\n\n\t$gtags_dir_cloud = get_option('gtags_dir_cloud'); \n\t\n\tif ( $gtags_dir_cloud=='show' || $gtags_dir_cloud=='link' || !$gtags_dir_cloud ){\n\t\t$hide_tag_style = 'link' == $gtags_dir_cloud ? ' style=\"display:none;\" ' : '';\n\t\t\t\t\n\t\techo '<div id=\"gtags-top\">';\n\t\techo '\t<div id=\"gtags-top-cloud\" class=\"gtags\"'.$hide_tag_style.'>'. wp_generate_tag_cloud( gtags_make_tags(), gtags_cloud_args() ).'</div>';\n\t\t\n\t\tif ( $gtags_dir_cloud=='link' ) {\n\t\t\techo '\t<div id=\"gtags-toggle-top\"><a href=\"javascript:void(0);\">Afficher les catégories de projet</a></div>';\n\t\t}\n\t\t\n\t\techo '</div>';\n\t}\n}",
"public function projects()\n {\n $git = new \\Devtools\\Git();\n $git->user('seagoj');\n $list = $git->listRepos();\n if ($list) {\n print \"</div><div class='well span10'><h3>Current projects</h3>\\n\";\n print \"<ul>\";\n $count = 1;\n foreach ($list AS $repo) {\n $name = $git->get($repo, 'name');\n $url = $git->get($repo, 'svn_url');\n $description = $git->get($repo, 'description');\n if (substr($repo, strpos($repo, '/')+1, 9)=='cookbook-') {\n $link = $url.'/raw/master/recipes/default.rb';\n } else {\n $link = $url.'/raw/master/src/index.php';\n }\n \n // $file_headers = @get_headers($url);\n // if ($file_headers[0] != 'HTTP/1.1 404 Not Found') {\n // print '<div id=\"codesample'.$count.'\">'\n // .'<a class=\"sampleClose\">x</a>'\n // .'<div class=\"title\">Code Sample</div>'\n // .'<pre class=\"prettyprint\">'\n // .'<code class=\"language-php\">'.$code.\"</code></pre></div>\";\n // print \"<div class='project'><a id='sample\".$count++.\"' href='#'>\".strtoupper($name).\"</a>:\\t\".$description.\"</div>\";\n // } else {\n print \"<div class='project'><a id='sample\".$count++.\"' href='\".$url.\"'>\".strtoupper($name).\"</a>:\\t\".$description.\"</div>\";\n // }\n\n \n }\n print \"</ul>\";\n print \"</div>\"; \n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation salesStagesIdGetWithHttpInfo Spinen&39;s PHP ConnectWise Client for Sales API generated by Swagger Code Generator. | public function salesStagesIdGetWithHttpInfo($id)
{
// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException('Missing the required parameter $id when calling salesStagesIdGet');
}
// parse inputs
$resourcePath = "/sales/stages/{id}";
$httpBody = '';
$queryParams = [];
$headerParams = [];
$formParams = [];
$_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);
// path params
if ($id !== null) {
$resourcePath = str_replace(
"{" . "id" . "}",
$this->apiClient->getSerializer()->toPathValue($id),
$resourcePath
);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires HTTP basic authentication
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'GET',
$queryParams,
$httpBody,
$headerParams,
'\Spinen\ConnectWise\Clients\Sales\Model\OpportunityStage',
'/sales/stages/{id}'
);
return [$this->apiClient->getSerializer()->deserialize($response, '\Spinen\ConnectWise\Clients\Sales\Model\OpportunityStage', $httpHeader), $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Spinen\ConnectWise\Clients\Sales\Model\OpportunityStage', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 401:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Spinen\ConnectWise\Clients\Sales\Model\Error', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function defStagesGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20078[]';\n $request = $this->defStagesGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse20078[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function salesStagesIdPutWithHttpInfo($id, $stage)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling salesStagesIdPut');\n }\n // verify the required parameter 'stage' is set\n if ($stage === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $stage when calling salesStagesIdPut');\n }\n // parse inputs\n $resourcePath = \"/sales/stages/{id}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($stage)) {\n $_tempBody = $stage;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage',\n '/sales/stages/{id}'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getStageUsingGetWithHttpInfo($stage_id)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Stage';\n $request = $this->getStageUsingGetRequest($stage_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com\\hydrogen\\nucleus\\Model\\Stage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function salesStagesGetWithHttpInfo($conditions = null, $order_by = null, $childconditions = null, $customfieldconditions = null, $page = null, $page_size = null)\n {\n // parse inputs\n $resourcePath = \"/sales/stages\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);\n\n // query params\n if ($conditions !== null) {\n $queryParams['conditions'] = $this->apiClient->getSerializer()->toQueryValue($conditions);\n }\n // query params\n if ($order_by !== null) {\n $queryParams['orderBy'] = $this->apiClient->getSerializer()->toQueryValue($order_by);\n }\n // query params\n if ($childconditions !== null) {\n $queryParams['childconditions'] = $this->apiClient->getSerializer()->toQueryValue($childconditions);\n }\n // query params\n if ($customfieldconditions !== null) {\n $queryParams['customfieldconditions'] = $this->apiClient->getSerializer()->toQueryValue($customfieldconditions);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page);\n }\n // query params\n if ($page_size !== null) {\n $queryParams['pageSize'] = $this->apiClient->getSerializer()->toQueryValue($page_size);\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage[]',\n '/sales/stages'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage[]', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\OpportunityStage[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function get($id)\n {\n return $this->client->get(\"person_stages/$id.json\");\n }",
"public function salesActivitiesIdGetWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling salesActivitiesIdGet');\n }\n // parse inputs\n $resourcePath = \"/sales/activities/{id}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Activity',\n '/sales/activities/{id}'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Activity', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Activity', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Sales\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function responseSetsIdGetWithHttpInfo($id)\n {\n $returnType = '';\n $request = $this->responseSetsIdGetRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function getStage($id)\n {\n $this->validateDigit($id);\n $data = $this->http->get('/stages/' . $id);\n\n return $this->safeReturn($data);\n }",
"public function leadsSourcesGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20051';\n $request = $this->leadsSourcesGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse20051',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse401',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse403',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getAppByCandAndStageWithHttpInfo($id, $index)\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse2003';\n $request = $this->getAppByCandAndStageRequest($id, $index);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse2003',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function restWizardsGetWithHttpInfo()\n {\n $request = $this->restWizardsGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object[]' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function restStockmanagementWarehousesWarehouseIdManagementRacksRackIdShelvesShelfIdGetWithHttpInfo($warehouse_id, $rack_id, $shelf_id, $columns = null, $with = null)\n {\n $request = $this->restStockmanagementWarehousesWarehouseIdManagementRacksRackIdShelvesShelfIdGetRequest($warehouse_id, $rack_id, $shelf_id, $columns, $with);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Shelf' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Shelf', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Shelf';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Shelf',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getSaleUsingGetWithHttpInfo($sales_id)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Sale';\n $request = $this->getSaleUsingGetRequest($sales_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com\\hydrogen\\nucleus\\Model\\Sale',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function builderAssetUrlsDesignsIdGetWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling builderAssetUrlsDesignsIdGet');\n }\n // parse inputs\n $resourcePath = \"/BuilderAsset/urls/designs/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\InlineResponse200',\n '/BuilderAsset/urls/designs/{id}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse200', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse200', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function customersIdTeamsFkGetWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling customersIdTeamsFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling customersIdTeamsFkGet');\n }\n // parse inputs\n $resourcePath = \"/Customers/{id}/teams/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Team',\n '/Customers/{id}/teams/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Team', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Team', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function apiTeamsIdGetWithHttpInfo($id)\n {\n $returnType = '\\KimaiConsole\\Client\\Model\\TeamEntity';\n $request = $this->apiTeamsIdGetRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\KimaiConsole\\Client\\Model\\TeamEntity',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getStageById(int $id) : StageEntity\n {\n $query = $this->db->prepare('SELECT `id`, `title`, `order`, `deleted` FROM `stages` WHERE `id`=:id');\n\n $query->setFetchMode(\\PDO::FETCH_CLASS, 'Portal\\Entities\\StageEntity');\n $query->bindParam(':id', $id);\n $query->execute();\n return $query->fetch();\n }",
"public function defStagesGet()\n {\n list($response) = $this->defStagesGetWithHttpInfo();\n return $response;\n }",
"public function defContactstagesGetAsyncWithHttpInfo($language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20084[]';\n $request = $this->defContactstagesGetRequest($language);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if cropping is allowed. | protected function canCrop()
{
return !empty($this->crop);
} | [
"private function isCroppingNeeded()\n {\n if ($this->getRequest()->isCropping() && $this->getRequest()->cropRatio['ratio'] != $this->getSource()->getRatio()) {\n return true;\n } else {\n return false;\n }\n }",
"public function isCropped() {\r\n \r\n return (bool) $this->crop;\r\n }",
"protected function is_customizer_crop_action() {\n\t\t$header_crop = $this->maybe_process_on_action( 'custom-header-crop', true );\n\n\t\t$context = array( 'site-icon', 'custom_logo' );\n\t\t$image_crop = $this->maybe_process_on_action( 'crop-image', true, $context );\n\n\t\tif ( ! $header_crop && ! $image_crop ) {\n\t\t\t// Not doing a Customizer action\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function crop() {\n \tif ( ! $this->config['cropped'] || ($this->config['min_width'] <= 0 && $this->config['min_height'] <= 0) ) {\n\t\t\treturn false;\n\t\t}\n \t$filepath = $this->image['file_path'].DIRECTORY_SEPARATOR.$this->image['file'];\n \t$width = $this->image['dims']['width'];\n \t$height = $this->image['dims']['height'];\n \t$crop_width = $this->config['min_width'] <= 0 ? $width : $this->config['min_width'];\n \t$crop_height = $this->config['min_height'] <= 0 ? $height : $this->config['min_height'];\n \t$diff_x = $width - $crop_width;\n \t$diff_y = $height - $crop_height;\n \t\n \tif ($diff_x > 0 || $diff_y > 0) {\n\t \tif ($diff_x > $diff_y) {\n\t\t\t\t$this->scale(0, $crop_height);\n\t\t\t} else {\n\t\t\t\t$this->scale($crop_width, 0);\n\t\t\t}\n\t\t\t$this->reset_dims();\n\t\t\t$width = $this->image['dims']['width'];\n \t\t$height = $this->image['dims']['height'];\n\t \t$x_offset = round( ($width - $crop_width) / 2 );\n\t \t$y_offset = round( ($height - $crop_height) / 2 );\n\t \t$this->image($filepath, $crop_width, $crop_height, $crop_width, $crop_height, $x_offset, $y_offset);\n\t \t$this->reset_dims();\n\t\t}\n\t\treturn true;\n\t}",
"protected function auto_crop()\n\t{\n\t\t$result = FALSE;\n\t\t\n\t\tif( $this->config['auto_crop'] )\n\t\t{\n\t\t\t// Calculate the new image proportions\n\t\t\t$output_width = $this->width;\n\t\t\t$output_height = round($this->width / $this->config['auto_crop']);\n\t\t\t\t\n\t\t\t// Calculate difference in size from existing height to new height\n\t\t\t$scale_ratio = ( $this->height / $output_height );\n\t\t\t\t\n\t\t\tif( $scale_ratio < 1 )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// Set the crop width and height\n\t\t\t\t$this->crop_width = round( $this->width * $scale_ratio );\n\t\t\t\t$this->crop_height = $this->height;\n\t\t\t\n\t\t\t\t// Apply the scaling ratio to the crop_left\n\t\t\t\t$this->crop_top = round( ( $this->start_height - $this->crop_height ) / 2 );\n\n\t\t\t\t// Calculate height centre\n\t\t\t\t$this->crop_left = round( ( $this->start_width - $this->crop_width ) / 2 );\n\t\t\t\t\n\t\t\t\t$this->height = $output_height;\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$result = TRUE;\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t// Set the crop width and height\n\t\t\t\t$this->crop_width = $this->width;\n\t\t\t\t$this->crop_height = round( $this->height / $scale_ratio);\n\t\t\t\t\n\t\t\t\t// Apply the scaling ratio to the crop_left\n\t\t\t\t$this->crop_top = round( ( $this->start_height - $this->crop_height ) / 2 );\n\n\t\t\t\t// Calculate height centre\n\t\t\t\t$this->crop_left = round( ( $this->start_width - $this->crop_width ) / 2 );\n\t\t\t\t\n\t\t\t\t$this->height = $output_height;\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t// Set to defaults\n\t\t\t$this->crop_height = $this->height;\n\t\t\t$this->crop_width = $this->width;\n\t\t\t$this->crop_left = 0;\n\t\t\t$this->crop_top = 0;\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}\n\t\t\t\t\n\t\t// Check for legality of max resolution\n\t\tif( $this->config['max_resolution'] and $this->crop_width <= $this->config['max_resolution'] and $this->crop_height <= $this->config['max_resolution'] )\n\t\t{\n\t\t\t$this->legal = TRUE;\n\t\t}\n\t\telseif( !$this->config['max_resolution'] )\n\t\t{\n\t\t\t$this->legal = TRUE;\n\t\t}\n\t\t\n\t\t$cropped_image = $this->create_blank_image( $this->crop_width, $this->crop_height );\n\t\t\n\t\tif( $state = imagecopyresampled($cropped_image, $this->gd_image, 0, 0, $this->crop_left, $this->crop_top, $this->crop_width, $this->crop_height, $this->crop_width, $this->crop_height ) )\n\t\t{\n\t\t\timagedestroy( $this->gd_image );\n\t\t\n\t\t\t$this->gd_image = $cropped_image;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->width = imagesx( $this->gd_image );\n\t\t$this->height = imagesy( $this->gd_image );\n\t\t\n\t\t\n\t\treturn $state;\n\t}",
"function isImageCrop(){\n\t\tif($this->session->userdata('crop')==1){\n\t\t\techo 1;\n\t\t}else{\n\t\t\tUNLINK(FCPATH.'/userfiles/university_logo/'.$_POST['image_name']);\n\t\t\techo 0;\n\t\t}\n\t}",
"private function createCrops($fieldName) {\n if (!$imageConfig = $this->getImageConfig($fieldName)) {\n return false;\n }\n $this->loadImage($fieldName, 'editable');\n $this->loadImage($fieldName, 'original');\n\n foreach ($imageConfig['sizes'] as $size => $dims) {\n\n $this->createCropForSize($fieldName, $size);\n\n }\n\n return true;\n }",
"public function resizeAndCrop()\n {\n // check file extension\n switch ($this->imageMimetype) {\n case 'image/png':\n $original = imagecreatefrompng($this->sourceFile);\n break;\n case 'image/jpeg':\n $original = imagecreatefromjpeg($this->sourceFile);\n break;\n case 'image/gif':\n $original = imagecreatefromgif($this->sourceFile);\n break;\n default:\n return 'Unsupported format';\n }\n\n if (!$original) {\n return false;\n }\n // GET ORIGINAL IMAGE DIMENSIONS\n list($original_w, $original_h) = getimagesize($this->sourceFile);\n\n // RESIZE IMAGE AND PRESERVE PROPORTIONS\n $max_width_resize = $this->maxWidth;\n $max_height_resize = $this->maxHeight;\n if ($original_w > $original_h) {\n $max_height_ratio = $this->maxHeight / $original_h;\n $max_width_resize = (int)round($original_w * $max_height_ratio);\n } else {\n $max_width_ratio = $this->maxWidth / $original_w;\n $max_height_resize = (int)round($original_h * $max_width_ratio);\n }\n if ($max_width_resize < $this->maxWidth) {\n $max_height_ratio = $this->maxWidth / $max_width_resize;\n $max_height_resize = (int)round($this->maxHeight * $max_height_ratio);\n $max_width_resize = $this->maxWidth;\n }\n\n // CREATE THE PROPORTIONAL IMAGE RESOURCE\n $thumb = imagecreatetruecolor($max_width_resize, $max_height_resize);\n if (!imagecopyresampled($thumb, $original, 0, 0, 0, 0, $max_width_resize, $max_height_resize, $original_w, $original_h)) {\n return false;\n }\n // CREATE THE CENTERED CROPPED IMAGE TO THE SPECIFIED DIMENSIONS\n $final = imagecreatetruecolor($this->maxWidth, $this->maxHeight);\n\n $max_width_offset = 0;\n $max_height_offset = 0;\n if ($this->maxWidth < $max_width_resize) {\n $max_width_offset = (int)round(($max_width_resize - $this->maxWidth) / 2);\n } else {\n $max_height_offset = (int)round(($max_height_resize - $this->maxHeight) / 2);\n }\n\n if (!imagecopy($final, $thumb, 0, 0, $max_width_offset, $max_height_offset, $max_width_resize, $max_height_resize)) {\n return false;\n }\n // STORE THE FINAL IMAGE - WILL OVERWRITE $this->endFile\n if (!imagejpeg($final, $this->endFile, $this->jpgQuality)) {\n return false;\n }\n\n return true;\n }",
"public function isGrainCrop() : bool\n {\n return false;\n }",
"public function getCropOrPosition()\n\t{\n\t\tif (is_array($this->crop)) return $this->crop;\n\t\treturn $this->hasCrop();\n\t}",
"public function image_crop() {\n\t\treturn $this->image_process('crop');\n\t}",
"function crop_image($data){\n\n //Check to see if the file exists\n if(!file_exists($data['image'])) { return false; }\n\n //Get the file type\n //$end = end(explode('.', $data['image']));\n \n //Get the file type\n $info = getimagesize($data['image']);\n \n /*\n // Posible image types returned by getimagesize()\n $types = array(\n 1 => 'GIF',\n 2 => 'JPG',\n 3 => 'PNG',\n 4 => 'SWF',\n 5 => 'PSD',\n 6 => 'BMP',\n 7 => 'TIFF(intel byte order)',\n 8 => 'TIFF(motorola byte order)',\n 9 => 'JPC',\n 10 => 'JP2',\n 11 => 'JPX',\n 12 => 'JB2',\n 13 => 'SWC',\n 14 => 'IFF',\n 15 => 'WBMP',\n 16 => 'XBM'\n );\n */\n \n //Find the matching image type\n switch($info[2]) {\n \n //It is a GIF Image\n case 1:\n //If we successfully crop the gif\n if(crop_gif($data)) { return true; }\n break;\n \n \n //It is a JPEG Image\n case 2:\n //If we successfully crop the jpeg\n if(crop_jpeg($data)) { return true; }\n break;\n \n \n //It is a PNG Image\n case 3: \n //If we successfully crop the png\n if(crop_png($data)) { return true; }\n break;\n \n \n default:\n //If we don't support the type of image\n return false;\n }\n\n}",
"public function crop()\n {\n return call_user_func_array([$this->img(), 'crop'], func_get_args());\n }",
"public function getCropped(){\n return is_null($this->filename)? null:'crop_'.$this->filename;\n }",
"public function getCropRatios();",
"protected function canBeCut() : bool {}",
"function isClipEnabled()\n {\n return (config('clip') == true);\n }",
"public function crop()\n {\n // get the crop value\n $crop = $this->attributes['crop'] ?? false;\n\n if ($crop === false) {\n return false;\n }\n\n return Str::slug($crop);\n }",
"public function getCrop()\n {\n return $this->crop;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the "AttributeValueList" variable value. | public function setAttributeValueList($value)
{
return $this->set(self::REQUEST_ATTRIBUTE_VALUE_LIST, $value);
} | [
"public function setProductOptionAttributes(array $list)\n {\n $this->optionAttributes = $list;\n }",
"public function SetTagAttributeWhitelist ($list)\n\t{\n\t\t$this->_tagAttributeWhitelist = $list;\n\t}",
"public function setList($list = array())\n {\n if (!is_array($list)) {\n $list = ArrayUtils::iteratorToArray($list);\n }\n\n $this->list = $list;\n }",
"public function setList($list)\n {\n $this->list = $list;\n }",
"public function setAttributeDefinitions(AttributeDefinitionList $attributeDefinitions)\n {\n $this->attributeDefinitions = $attributeDefinitions;\n }",
"public function attrValueWhiteList(AttributeValue $attrValue)\n {\n $this->attrValueWhiteList[] = $attrValue;\n }",
"public function setAttributeListProperty($property)\n\t{\n\t\t$this->attributeListProperty = $property;\n\t}",
"function setList($list) {\n\t\t$this->list = $list;\n\t\t\n\t\t// For new records the api key can be inherited from the list\n\t\tif(empty($this->apiKey)) $this->apiKey = $list->apiKey;\n\t}",
"protected function _updateAttribute()\n {\n $name = $this->_getName();\n if (isset($this->_listDefinition[$name])) {\n $input = FALSE;\n switch ($this->_currentInput->getAttribute('type')) {\n case 'checkbox':\n $input = $this->_updateCheckboxAttribute($name);\n break;\n case 'radio':\n $input = $this->_updateRadioAttribute($name);\n break;\n case 'textarea':\n break;\n default:\n $input = $this->_updateInputAttribute($name);\n break;\n }\n if ($input) {\n foreach ($input as $key => $value) {\n @$this->_currentInput->setAttribute($key, $value);\n }\n if (isset($this->_valueList[$name]) &&\n $this->_currentInput->getAttribute('type') !== 'radio'\n ) {\n $value = $this->_valueList[$name];\n if (!is_array($value)) {\n $this->_currentInput->setAttribute('value', $value);\n }\n }\n }\n }\n }",
"public function appendAttrLists(\\Amp\\Validator\\AttrList $value)\n {\n return $this->append(self::ATTR_LISTS, $value);\n }",
"private function setAttributesFromArray(array $input): void\n {\n $this->attributes = is_null($attributes = ArrayAccess::getArray($input, 'attributes'))\n ? new AttributeList()\n : new AttributeList($attributes);\n }",
"public function attrValueBlackList(AttributeValue $attrValue)\n {\n $this->attrValueBlackList[] = $attrValue;\n }",
"function setAttributes(array $attributes);",
"public function setMultiple()\n {\n parent::setAttr(\"multiple\", \"multiple\");\n }",
"protected function addHtmlAttributeInList(string $htmlAttribute, $value): void\n {\n if ($htmlAttribute === 'data') {\n [$dataKey, $dataValue] = $value;\n $this->htmlAttributes[] = [$dataKey => $dataValue];\n } elseif (is_array($value)) {\n $this->htmlAttributes[] = [$htmlAttribute => sprintf(\n self::HTML_ATTRIBUTES_LIST[$htmlAttribute][0],\n implode(self::HTML_ATTRIBUTES_LIST[$htmlAttribute][1], $value)\n )];\n } elseif (is_bool($value)) {\n $this->htmlAttributes[] = [$htmlAttribute => var_export($value, true)];\n } else {\n $this->htmlAttributes[] = [$htmlAttribute => sprintf(\n self::HTML_ATTRIBUTES_LIST[$htmlAttribute], $value\n )];\n }\n }",
"protected function _getAttributeList()\n {\n if ($this->d3GetSet()->d3getLog() && $this->d3GetSet()->getFieldData('oxismodulelog')) {\n $this->d3GetSet()->d3getLog()->log(\n d3log::INFO,\n __CLASS__,\n __FUNCTION__,\n __LINE__,\n \"\",\n \"generating attribute list\"\n );\n }\n\n // calls database query execution\n $this->aSearchAttribList = $this->_d3GetSearchHandler()->getSearchAttributes($this->oRegularyArtList);\n }",
"public function setAddressList(AddressList $addressList)\n {\n $this->addressList = $addressList;\n }",
"protected function setFileList($file_list) {\n\n $this->file_list = $file_list;\n\n }",
"protected function initializeValues()\n {\n foreach ($this->buildAttributeList() as $name => $options) {\n $this->valueList[$name] = null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns fields within the given "import data type" by "include type" | public function get_import_fields_for($data_type, $include_type = 'all')
{
// if not a main key, reject
if ( ! in_array($data_type, $this->get_import_data_types()))
throw new \Exception();
// if including 'all' be sure to include both "required" and "available"
if ($include_type == 'all') {
$fields = array_merge(
$this->get_import_fields_for($data_type, 'required'),
$this->get_import_fields_for($data_type, 'available')
);
} else {
if ( ! array_key_exists($include_type . '_fields', $this->import_data_types[$data_type])) {
return [];
} else {
$fields = $this->import_data_types[$data_type][$include_type . '_fields'];
}
}
// create output array by iterating through fields and making sure nested arrays are flattened
$import_fields = [];
foreach ($fields as $key => $value) {
if (is_array($value)) {
$import_fields[] = $key;
} else {
$import_fields[] = $value;
}
}
return $import_fields;
} | [
"abstract protected function getIncludeFields();",
"function affwp_do_import_fields( $type ) {\n\t$fields = array();\n\n\tswitch( $type ) {\n\t\tcase 'affiliates':\n\t\t\t$fields = affwp_get_affiliate_import_fields();\n\t\t\tbreak;\n\n\t\tcase 'referrals':\n\t\t\t$fields = affwp_get_referral_import_fields();\n\t\t\tbreak;\n\n\t\tdefault: break;\n\t}\n\n\tif ( ! empty( $fields ) ) {\n\n\t\tforeach ( $fields as $key => $label ) {\n\t\t\t?>\n\t\t\t<tr>\n\t\t\t\t<td><?php echo esc_html( $label ); ?></td>\n\t\t\t\t<td>\n\t\t\t\t\t<select name=\"affwp-import-field[<?php echo esc_attr( $key ); ?>]\" class=\"affwp-import-csv-column\">\n\t\t\t\t\t\t<option value=\"\"><?php esc_html_e( '- Ignore this field -', 'affiliate-wp' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"affwp-import-preview-field\"><?php esc_html_e( '- Select field to preview data -', 'affiliate-wp' ); ?></td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}\n\n\t}\n\n}",
"public function getImportFields() {\n return array();\n }",
"protected function getIncludesFields(string $include) : array\n {\n $fields = $this->request->has('fields') && ! empty($this->request->input('fields')) ? explode(',', $this->request->input('fields')) : $this->defaultFields;\n foreach ($fields as $k =>$field) {\n if (strpos($field, $include.'.') === false) {\n unset($fields[$k]);\n continue;\n }\n $fields[$k] = str_replace($include.'.', '', $field);\n }\n\n return $fields;\n }",
"function getListOfFieldsByDataType($entity_name, $data_types, $with_pk=true)\n{\n $types = utf8_explode(',', $data_types);\n if ($entity_name != \"\") {\n global $entity;\n $actual_entity = $entity;\n //save it\n $entity = getEntity($entity_name);\n } else {\n $entity = getEntity(\"\");\n }\n $dfields = array();\n foreach($types as $t) {\n foreach($entity[\"fields\"] as $f) {\n if ($f[\"data_type\"] == $t) {\n if ($with_pk || ($entity[\"pk\"] != $f[\"name\"])) {\n $dfields[] = $f[\"name\"];\n }\n }\n }\n }\n \n if ($entity_name != \"\") {\n $entity = $actual_entity;\n }\n //set $entity back to what it was!\n return $dfields;\n}",
"function acf_prepare_fields_for_import( $fields = array() ) {\n}",
"function _wf_field_get_all_fields($entity_type=NULL, $bundle_name=NULL) {\n $fields = field_info_fields();\n $wf_fields = array();\n foreach ($fields as $field_name => $field_info) {\n if ($field_info['module'] == 'wf_field') {\n // filter by entity type\n if ( isset($entity_type) && !isset($bundle_name) ) {\n $include = isset($field_info['bundles'][$entity_type]);\n }\n // filter by entity type and bundle name \n elseif ( isset($entity_type) && isset($bundle_name) ) {\n $include = isset($field_info['bundles'][$entity_type]) && in_array($bundle_name, $field_info['bundles'][$entity_type]);\n }\n // otherwise include\n else {\n $include = true;\n }\n if ($include) {\n $wf_fields[$field_info['field_name']] = $field_info;\n }\n }\n }\n return $wf_fields;\n}",
"public function getDataWithTypeField() {}",
"public function getImportableFieldsOptions(): ImportableFieldsOptions;",
"function &getAllExtraFieldsByType($type, $rangeInfo = null) {\r\n\r\n\t\t$params = array($type);\t\t\r\n\t\t$result =& $this->retrieveRange(\r\n\t\t\t'SELECT * FROM extra_fields WHERE type = ?',\r\n\t\t\t\tcount($params)===1?array_shift($params):$params,\r\n\t\t\t\t$rangeInfo);\r\n\r\n\t\t$extraFields = new DAOResultFactory($result, $this, '_returnExtraFieldFromRow');\r\n\t\treturn $extraFields;\r\n\t}",
"function get_field_types()\n {\n }",
"function get_import_table_fields(){\n\t\t$returning_array = array();\n\t\t\n\t\tif( isset( $_SESSION['temp_storage'][ 'excel_import_table' ] ) && $_SESSION['temp_storage'][ 'excel_import_table' ] ){\n\t\t\t$function_name = $_SESSION['temp_storage'][ 'excel_import_table' ];\n\t\t\t\n\t\t\tif( function_exists( $function_name ) ){\n\t\t\t\t$untransformed_field_data = $function_name();\n\t\t\t\t\n\t\t\t\tforeach( $untransformed_field_data as $key => $value ){\n\t\t\t\t\t$returning_array[$key] = $value[ 'field_label' ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $returning_array;\n\t}",
"public function getImportSpec()\n {\n $singleton = DataObject::singleton($this->objectClass);\n\n // get database columns (fieldlabels include fieldname as a key)\n // using $$includerelations flag as false, so that it only contain $db fields\n $fields = (array)$singleton->fieldLabels(false);\n\n // Merge relations\n $relations = array_merge(\n $singleton->hasOne(),\n $singleton->hasMany(),\n $singleton->manyMany()\n );\n\n // Ensure description is string (e.g. many_many through)\n foreach ($relations as $name => $desc) {\n if (!is_string($desc)) {\n $relations[$name] = $name;\n }\n }\n\n return [\n 'fields' => $fields,\n 'relations' => $relations,\n ];\n }",
"public function getDbTypesByImportTypes(){\n $result=[];\n $dataServicesConfigByDbTypes=$this->getDataServicesConfigByDbTypes();\n if (!empty($dataServicesConfigByDbTypes)){\n foreach($dataServicesConfigByDbTypes as $dbType=>$dbTypeConfig){\n if (!empty($dbTypeConfig['supportedImportTypes'])){\n foreach($dbTypeConfig['supportedImportTypes'] as $importType){\n if (!isset($result[$importType])){\n $result[$importType]=[];\n }\n $result[$importType][]=$dbType;\n }\n }\n }\n }\n return $result;\n }",
"private function getImportMatchingData()\n {\n $file_path = $this->module->getImportFilePath();\n $fileReader = (new FileReader($file_path))->init();\n $headers = $fileReader->getHeaders();\n\n if (!$headers) {\n return false;\n }\n\n\n $products = $fileReader->getData(\n 0,\n 7,\n ImportHelper::getFileExt($file_path) === 'xml' ? 0 : 1\n );\n if (!$products) {\n return false;\n }\n\n return [\n 'header' => $headers,\n 'products' => $products\n ];\n }",
"public function getExtendedFieldTypes();",
"public function getImportAllowedTypes(){\n return isset($this->aImport['allowedTypes']) ? $this->aImport['allowedTypes'] : array();\n }",
"function fields() {\n\t\tforeach(glob(ALERTS_PLUGIN_DIR . 'lib/fields/*.php') as $field) {\n\t\t\t\tinclude($field);\n\t\t}\n\t}",
"abstract protected function getImportFileTypes(): array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get top rated word translation | public function getTopRatedTranslation($word)
{
if (($translations = $this->getTranslations($word))
&& isset($translations[0])
&& isset($translations[0]['value'])
) {
return $translations[0]['value'];
}
return null;
} | [
"public function getLatestText2()\n \t{\n \t\t$lastIndex = sizeof($this->statuses) - 2;\n \t\treturn ($this->statuses[$lastIndex]->text);\n \t}",
"public function getTranslation();",
"private function getMostUsedWords()\n {\n return unserialize(file_get_contents($this->getFilePath('mostUsedWords.txt')));\n }",
"private function getWord()\r\n {\r\n $words = \\Config::get('passworder.words');\r\n $word = $words[ mt_rand(0, ( count($words)-1 ) ) ];\r\n return $this->randomize($word);\r\n }",
"public function getBestLanguage()\n {\n }",
"public function getLatestText()\n \t{\n \t\t$lastIndex = sizeof($this->statuses) - 1;\n \t\treturn ($this->statuses[$lastIndex]->text);\n \t}",
"function getSlangSentiment( $word ) {\n\n\t\t//http://developer.dictionary.com/account/apikeys\n\t\t$apikey = \"t0851pyartj4wzhzbe643jabzsbrm04f1cl21jcsdv\";\n\t\t$definition = file_get_contents(\"http://api-pub.dictionary.com/v001?vid=$apikey&q=hey&type=define&site=slang\");\n\n\t\treturn $definition;\n\t}",
"public function word_russian() {\n // get a Russian word, return data\n return $this->russianWords[rand(0,count($this->russianWords) - 1)]; \n }",
"public function word() {\n\n\t\t$soundex = $this->snd[mt_rand(0, sizeof($this->snd)-1)];\n\t\t$bucket = $this->words[$soundex];\t\n\n\t\tif (sizeof($bucket) > 4) { // skip any small soundex groups\n\t\t\t$word = $bucket[mt_rand(0, sizeof($bucket)-1)];\n\t\t\treturn ucfirst($first);\n\t\t} else {\n\t\t\t$bucket = null;\n\t\t\treturn $this->word(); // try again\n\t\t}\n\t\t\n\t}",
"public function getCurrentTranslation();",
"public function getMostUsedLanguage(): ?string\n {\n $language = null;\n\n // only sort if language entries are present\n if (0 !== count($this->languageStats)) {\n $langStats = $this->languageStats;\n\n usort(\n $langStats,\n function (LanguageStat $a, LanguageStat $b) {\n // we compare using file count, not loc\n $aCount = $a->getFileCount();\n $bCount = $b->getFileCount();\n\n if ($aCount === $bCount) {\n return 0;\n }\n\n return ($aCount > $bCount) ? -1 : 1;\n }\n );\n\n $language = $langStats[0]->getLanguage();\n }\n\n return $language;\n }",
"function findMostUsedWord() {\n\n $text = trim(preg_replace('/ss+/i', '', $this->content));\n // only take alphabet characters, but keep the spaces and dashes tooF\n $text = strtolower(preg_replace('/[^a-zA-Z -]/', '', $text));\n\n preg_match_all('/\\b.*?\\b/i', $text, $machWords);\n $machWords = $machWords[0];\n $bl = $GLOBALS['appRoot'] . 'BlackListedWords.txt';\n\n $stopWords = file($bl, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\n foreach ($machWords as $key => $item) {\n if ($item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3) {\n unset($machWords[$key]);\n }\n }\n\n $word_count = str_word_count(implode(\" \", $machWords), 1);\n $frequency = array_count_values($word_count);\n arsort($frequency);\n\n $keywords = array_slice($frequency, 0);\n $this->mostUsedWord = key($keywords);\n }",
"function get_key_words($text, $amount) {\n \n global $most_common_english_words;\n \n //step 1 - get uppercase words from article (ignore words shorter than 4 characters)\n $most_important_words_arr = get_uppercase_words($text);\n //get uppercase words with count\n $most_important_words_with_count = get_arr_with_count($most_important_words_arr);\n \n //step 2 - create array from the text (remove spaces, commas and points)\n $article_arr = explode(\" \", str_replace(array(\"’\", PHP_EOL), \" \", str_replace(array('.', ',', '?'), \"\", $text)));\n\n //step 3 - remove array with most important uppercases from article_arr\n $article_arr = remove_matches($article_arr, $most_important_words_arr);\n\n //step 4 - remove all most common english words (e.g. like, have, almost, maybe, ...)\n $article_arr = remove_most_common_words($article_arr, $most_common_english_words);\n\n //step 5 - get words with their amount of occurrences (and only if the word is longer than 3 characters)\n $article_word_count = get_arr_with_count($article_arr);\n\n //step 6 - merge the count arrays\n $merged_count_arr = array_merge($most_important_words_with_count, $article_word_count);\n\n //step 7 - calculate importance based on number of occurrencies and whether or not starting with an uppercase\n $importance_weight_arr = get_words_with_importance($merged_count_arr);\n \n //step 8 - get the most important words in order of importance and limit the results to the given amount of key_words\n $top_words = get_top_words($importance_weight_arr, $amount);\n \n return $top_words;\n \n}",
"public function getLowerLimitSearchWord()\n {\n return LanguageTransliterate::getLowerLimitSearchWord();\n }",
"function get_computer_translated_phrases() {\n return $this->translated_phrases - $this->human_translated_phrases;\n }",
"function get_translate_string () {\n\t\t$this->_pot\t\t=\tnew PO();\n\t\t$this->generate_pot();\n\t\t$this->_pot->import_from_file(DEFAULT_LANGUAGE_PATH.'/engine.po',true );\n\t\treturn apply_filters( 'et_get_translate_string', $this->_pot->entries);\n\t}",
"protected function randomWord()\n {\n return $this->dictionary[mt_rand(0, count($this->dictionary) - 1)];\n }",
"public function getVoiceOver() {\n\t\t$tmp = $this->voiceOverConverted;\n\t\tksort( $tmp, SORT_STRING );\n\t\treturn $tmp;\n\t}",
"function get_translated_languages()\n{\n\tglobal $_TABLES;\n\n\n\t$query = \"SELECT DISTINCT `language_full_name` as language FROM {$_TABLES['translations']} WHERE 1\";\n\t$result = DB_query($query);\n\n\t$display = '';\n\n\twhile ($row = DB_fetchArray($result))\n\t{\n\t\t$translated = get_translation_percent($row['language']);\n\t\t$translated = round($translated, 2);\n\t\t$not_translated = 100 - $translated;\n\n\t\t$query = \"SELECT COUNT(`id`) as count FROM {$_TABLES['translations']} WHERE `language_full_name`='{$row['language']}'\";\n\t\t$result2 = DB_query($query);\n\t\t$count = DB_fetchArray($result2)['count'];\n\n\t\t$display .= \"<div class='index_language_graph'> <h3> {$row['language']} </h3>\n\t\t<div class='progress_bar'> <span class='translated' style='width: {$translated}%'> {$translated}% </span> \"\n\t\t. \"<span class='not_translated' style='width: {$not_translated}%'> {$not_translated}% </span> </div> </div>\n\t\t<span> Translated: {$count} </span>\";\n\t}\n\n\treturn $display;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a specified user can view a specific issue. | function otherUserCanViewIssue( $user, $issueID ) {
$query= "SELECT Level FROM issues WHERE ID = '$issueID'";
$result = mysql_query($query);
$value = mysql_fetch_array($result);
extract($value);
$query2 = "SELECT Creator FROM issues WHERE ID = '$issueID'";
$result2 = mysql_query($query2);
$value2 = mysql_fetch_array($result2);
extract($value2);
$userID = $_SESSION['userid'];
if($Level == 'A')
if($this->getUserAccessLevel($user) > 7 || $this->getUserAccessLevel($user) == 5)
return TRUE;
elseif($Creator == $userID)
return TRUE;
else
return FALSE;
elseif($Level == 'B')
return $this->getUserAccessLevel($user) > 3;
else
return FALSE;
} | [
"function can_view_issue($issueid,$userid = null) {\n\tif (Permission::is_manager()) {\n\t\treturn TRUE;\n\t}\n\t$user_groups = is_null($userid) ? $_SESSION['groups'] : user_groups($userid);\n\t$groups = issue_groups($issueid);\n\tforeach ($groups as $group) {\n\t\tif (in_array($group['gid'],$user_groups)) {\n\t\t\treturn TRUE;\n\t\t}\n\t}\n}",
"function userCanGetUserIssues( $userid ) {\r\n\t\treturn $this->userCanViewUser('',$userid);\r\n\t}",
"function canAccess($issue_id, $usr_id)\n {\n static $access;\n\n if (empty($issue_id)) {\n return true;\n }\n\n if (isset($access[$issue_id . \"-\" . $usr_id])) {\n return $access[$issue_id . \"-\" . $usr_id];\n }\n\n $details = self::getDetails($issue_id);\n if (empty($details)) {\n return true;\n }\n $usr_details = User::getDetails($usr_id);\n $usr_role = User::getRoleByUser($usr_id, $details['iss_prj_id']);\n $prj_id = self::getProjectID($issue_id);\n\n\n if (empty($usr_role)) {\n // check if they are even allowed to access the project\n $return = false;\n } elseif ((Customer::hasCustomerIntegration($details['iss_prj_id'])) && ($usr_role == User::getRoleID(\"Customer\")) &&\n ($details['iss_customer_id'] != $usr_details['usr_customer_id'])) {\n // check customer permissions\n $return = false;\n } elseif ($details['iss_private'] == 1) {\n // check if the issue is even private\n\n // check role, reporter, assigment and group\n if ($usr_role > User::getRoleID(\"Developer\")) {\n $return = true;\n } elseif ($details['iss_usr_id'] == $usr_id) {\n $return = true;\n } elseif (self::isAssignedToUser($issue_id, $usr_id)) {\n $return = true;\n } elseif ((!empty($details['iss_grp_id'])) && (!empty($usr_details['usr_grp_id'])) &&\n ($details['iss_grp_id'] == $usr_details['usr_grp_id'])) {\n $return = true;\n } elseif (Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id)) {\n $return = true;\n } else {\n $return = false;\n }\n } elseif ((Auth::getCurrentRole() == User::getRoleID(\"Reporter\")) && (Project::getSegregateReporters($prj_id)) &&\n ($details['iss_usr_id'] != $usr_id) && (!Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id))) {\n return false;\n } else {\n $return = true;\n }\n\n $access[$issue_id . \"-\" . $usr_id] = $return;\n return $return;\n }",
"function canView($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('use_time_reports');\n }",
"function user_can_view($user)\r\n {\r\n // Make sure a user is loaded\r\n if (!$user->is_user_loaded()) return false;\r\n // Login the current user, and check capabilities\r\n if (!$user->login()) return false;\r\n return has_capability('mod/assignment:view', get_context_instance(CONTEXT_MODULE, $this->cm->id));\r\n }",
"public function view(User $user, Ticket $ticket)\n {\n return $user->can('view tickets', $ticket);\n }",
"public function canSee($user_id)\n\t{\n\t\tif(!Precurio_Activity::isPrivate($this->type))\n\t\t\treturn true;//the activity is not private.\n\t\t//ok, it is a private activity, lets see if $user_id has access.\n\t\tswitch ($this->type)\n\t\t{\n\t\t\tcase Precurio_Activity::ADD_EVENT:\n\t\t\tcase Precurio_Activity::ADD_EVENT_PHOTO:\n\t\t\tcase Precurio_Activity::EDIT_EVENT:\t\n\t\t\t\t$event = Events::getEvent($this->activity_id);\n\t\t\t\tif($event == null)\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn $event->userIsInvited($user_id);\n\t\t\tcase Precurio_Activity::ADD_COMMENT:\n\t\t\t\t//the subject_id of a comment is always the activity on which the comment is made on\n\t\t\t\t$activity = self::getUserActivity($this->subject_id);\n\t\t\t\treturn $activity->canSee($user_id);\n\t\t\tcase Precurio_Activity::NEW_TASK:\n\t\t\tcase Precurio_Activity::EDIT_TASK:\n\t\t\tcase Precurio_Activity::COMPLETE_TASK:\n\t\t\tcase Precurio_Activity::FAILED_TASK:\n\t\t\t\t$task = Tasks::getTask($this->activity_id);\n\t\t\t\tif($task == null)\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn $task->canAccess($user_id);\n\t\t\tcase Precurio_Activity::NEW_CONTENT:\n\t\t\tcase Precurio_Activity::EDIT_CONTENT:\n\t\t\t\t$content = MyContents::getContent($this->activity_id);\n\t\t\t\tif($content == null)\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn $content->canAccess($user_id);\n\t\t\tcase Precurio_Activity::APPOINTMENT_ADDED:\n\t\t\t\treturn ($user_id == $this->user_id || $user_id == $this->subject_id);\n\t\t\tcase Precurio_Activity::RESET_PASSWORD:\n\t\t\t\treturn $user_id == $this->user_id;\n\t\t\t\tcase Precurio_Activity::NEW_USER:\n\t\t\t\treturn $user_id == $this->user_id;\n\t\t}\t\n\t\treturn false;//default is no access.\n\t}",
"public function view(User $user, Tickets $ticket): bool\n {\n return $ticket->isAuthoredBy($user);\n }",
"function checkAccess () {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) return true;\n else { return false; }\n }",
"public function viewTicket(User $user, Helpdesk $ticket): bool \n {\n return $user->id === $ticket->created_by || $user->hasRole('admin');\n }",
"public function view(User $user)\n {\n return $user->hasPermissionTo('experience_view');\n }",
"public function view(User $user, FieldObservation $fieldObservation)\n {\n return $fieldObservation->isAtLeastPartiallyOpenData() ||\n $user->hasAnyRole(['admin', 'curator']);\n }",
"public function permission() {\n Library::get(\"objects\");\n\n $viewable = Objects::permission($this->bug[\"Bug_ObjectID\"], \"bug.view\", $_SESSION['username'], $this->bug[\"Section_ID\"]);\n\n if (!$viewable) Path::redirect(Path::getclientfolder(\"bugs\", $this->path[2]));\n return true;\n }",
"public function publicAccess($user)\n {\n return User::findOrFail($user->id)->hasPermission('laralum::tickets.access-public');\n }",
"function isViewable()\n {\n \n if (sfContext::getInstance()->getUser()->hasCredential(\"viewallcontent\"))\n { \r\n \tsfContext::getInstance()->getLogger()->info(\"You have the fu, you can see me.\");\n \treturn true;\n } \n\n // Access to approved artork is for anyone\n if ($this->isApproved()) \n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is approved, so it is viewable\");\n \treturn true;\n }\n\n // Access to removed artwork is only for admin (returned true above)\n if ($this->isRemoved())\n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is removed, and cannot be seen\");\n \treturn false;\n }\n \n // also allow access to owner of artwork - unless they have removed it\n if (sfContext::getInstance()->getUser()->isAuthenticated()\n && $this->getUserId() == sfContext::getInstance()->getUser()->getGuardUser()->getId())\n {\n sfContext::getInstance()->getLogger()->info(\"You can see this artwork since you are the owner\");\n \treturn true;\n }\n\n sfContext::getInstance()->getLogger()->info(\"This artwork is not approved, and cannot be seen\");\n return false;\n }",
"public function access(User $user, SubmissionRequirement $requirement)\n {\n return $user->id === $requirement->submission->user_id;\n }",
"public function canView(IdentityInterface $user, Report $report)\n {\n if($this->isAdmin($user, $report)) {\n return true;\n } elseif($this->isCurator($user,$report)) {\n return true;\n } else {\n return false;\n }\n }",
"public function view(User $user, Unit $unit)\n {\n return ($user->id === $unit->user_id || $user->canOverride($unit->user));\n }",
"function canView(User $user) {\n \treturn $this->getParent() instanceof IAttachments && $this->getParent()->canView($user);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of compatibleChat | public function setCompatibleChat($compatibleChat)
{
$this->compatibleChat = $compatibleChat;
return $this;
} | [
"public function setChat(Up_Chat $value)\n {\n return $this->set(self::_CHAT, $value);\n }",
"public function setChat($val)\n {\n $this->_propDict[\"chat\"] = $val;\n return $this;\n }",
"protected function _set_chat()\n\t{\n\t\tif(empty($this->_user))\n\t\t{\n\t\t\t$chat_vars = array\n\t\t\t(\n\t\t\t\t'vi' => 'Visitor',\n\t\t\t\t'url' => $this->request->uri()\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$chat_vars = array\n\t\t\t(\n\t\t\t\t'url' => $this->request->uri(),\n\t\t\t\t'ip' => '' //initial question to visitor - left blank, but I imagine we can use this in the future\n\t\t\t);\n\t\t}\n\n\t\t//set chat view\n\t\t$this->_chat = \\Boldchat::factory(array('vars' => $chat_vars));\n\t}",
"public function setChatRoomData($value)\n {\n return $this->set(self::CHATROOMDATA, $value);\n }",
"public function setAllowMeetingChat(?MeetingChatMode $value): void {\n $this->getBackingStore()->set('allowMeetingChat', $value);\n }",
"public function setChatInfo($val)\n {\n $this->_propDict[\"chatInfo\"] = $val;\n return $this;\n }",
"protected function updateChatInfo()\n {\n $this->setChatConfig('info', $this->getContext()->getChat()->toJson(true));\n }",
"function client_set_chat_room($socket, $data)\n{\n $player = $socket->getPlayer();\n $group = $player->group;\n if (isset($player->chat_room)) {\n $player->chat_room->removePlayer($player);\n }\n if (($data === 'mod' && $group < 2) || ($data === 'admin' && ($group < 3 || $player->user_id === FRED))) {\n $data = 'none';\n $player->write('message`You lack the power to enter this room.');\n }\n if (is_obscene($data)) {\n $data = 'none';\n $player->write('message`Keep the room names clean, pretty please. :)');\n }\n if ($data !== 'none') {\n $chat_room = get_chat_room($data);\n $chat_room->addPlayer($player);\n }\n}",
"public function setChatInstance(AIML $chat)\n {\n $this->chat = $chat;\n }",
"function chat_save()\n\t{\n\t\t//-----------------------------------------\n\t\t// Load libby-do-dah\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( ROOT_PATH.'sources/action_admin/settings.php' );\n\t\t$adsettings = new ad_settings();\n\t\t$adsettings->ipsclass =& $this->ipsclass;\n\t\t\n\t\t$acc_number = $this->ipsclass->input['account_no'];\n\t\t\n\t\tif ( $acc_number == \"\" )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Sorry, that is not a valid AddOnChat account number\");\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), \"conf_key='chat_account_no'\" );\n\t\t\n\t\t$adsettings->setting_rebuildcache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Update this component\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( ROOT_PATH . 'sources/api/api_core.php' );\n\t\trequire_once( ROOT_PATH . 'sources/api/api_components.php' );\n\t\t\n\t\t$api = new api_components();\n\t\t$api->ipsclass =& $this->ipsclass;\n\t\t\n\t\t$fields = array( 'com_enabled' => 1,\n\t\t\t\t\t\t 'com_menu_data' => array( 0 => array( 'menu_text' => 'Chat Settings',\n\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t'menu_url' => 'code=chatsettings',\n\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t'menu_permbit' => 'edit' ) ) );\n\t\t\n\t\t$api->acp_component_update( 'chatsigma', $fields );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show config\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->chat04_config();\n\t}",
"public function setMeetingChatEnabled($val)\n {\n $this->_propDict[\"meetingChatEnabled\"] = $val;\n return $this;\n }",
"private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }",
"public function setAllowMeetingChat($val)\n {\n $this->_propDict[\"allowMeetingChat\"] = $val;\n return $this;\n }",
"public function registerChat(Chat $chat): bool;",
"public function __construct(\\Models\\Chat $chat = NULL) {\n $this->chat = $chat;\n }",
"private function _chatSave()\n\t{\n\t\t$acc_number = trim($this->request['account_no']);\n\t\t\n\t\tif ( $acc_number == \"\" )\n\t\t{\n\t\t\t$this->registry->output->showError( $this->lang->words['chat_invalid_key'], 1193 );\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Load libby-do-dah\n\t\t//-----------------------------------------\n\t\t\n\t\t$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/tools/settings.php', 'admin_core_tools_settings' );\n\t\t$settings = new $classToLoad();\n\t\t$settings->makeRegistryShortcuts( $this->registry );\n\t\t\n\t\t$settings->html\t\t\t= $this->registry->output->loadTemplate( 'cp_skin_tools', 'core' );\n\t\tipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_tools' ), 'core' );\n\t\t$settings->form_code\t= $settings->html->form_code = 'module=tools&section=settings';\n\t\t$settings->form_code_js\t= $settings->html->form_code_js = 'module=tools§ion=settings';\n\n\t\t$this->DB->update( 'core_sys_conf_settings', array( 'conf_value' => $acc_number ), \"conf_key='ipb_reg_number'\" );\n\n\t\t$settings->settingsRebuildCache();\n\n\t\t//-----------------------------------------\n\t\t// Show config\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->settings['ipb_reg_number']\t= $acc_number;\n\t\t\n\t\t$this->_chatConfig();\n\t}",
"public function updated(chat $chat)\n {\n //\n\n }",
"public function updated(Chat $chat)\n {\n //\n }",
"function acceptChat($chat_id){\n\t\treturn $this->sql->Update(\"chats\", array(\"accepted\"=>1), array(\"id\"=>$chat_id));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the quantity of subscription | public function quantity(Request $request,$name){
$user=$request->user();
$this->authorize('update', $user);
$this->validate($request,[
'quantity'=>'required|string',
]);
$subscription=$user->subscription($name);
if(!$subscription){
return back()->with('warning','Unknown subscription');
}
$subscription->updateQuantity($request->quantity);
return redirect()->route('user-billing-subs')->with('success','Subscription was successfully updated');
} | [
"public function updateQtyAction()\n {\n try {\n $invoice = $this->_initInvoice(true);\n \t$this->_changeInvoice($invoice);\n\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update item quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }",
"public function updateQuantity($id, $quantity);",
"public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }",
"public function testUpdateSubscription()\n {\n }",
"public function updateQty()\n {\n $this->getItemsBlock()->clickUpdateQty();\n $this->waitLoader();\n }",
"public function updateQtyAction()\n {\n try {\n $creditmemo = $this->_initCreditmemo(true);\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update the item\\'s quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }",
"public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function updateQuantity()\n {\n if ($this->crmSettings['sync'] === WC_Retailcrm_Base::YES) {\n $this->load_stocks();\n }\n }",
"public function testUpdateQty() {\n $requestData = [\n 'items' => [\n [\n 'qty' => '1',\n 'entity_id' => '19'\n ], [\n 'qty' => '1',\n 'entity_id' => '21'\n ], [\n 'qty' => '1',\n 'entity_id' => '22'\n ], [\n 'qty' => '1',\n 'entity_id' => '23'\n ], [\n 'qty' => '1',\n 'entity_id' => '25'\n ]\n ],\n 'order_id' => 'WP11513743849738'\n ];\n\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH . 'updateqty?',\n 'httpMethod' => RestRequest::HTTP_METHOD_POST,\n ]\n ];\n\n $results = $this->_webApiCall($serviceInfo, $requestData);\n \\Zend_Debug::dump($results);\n $this->assertNotNull($results);\n $this->assertGreaterThanOrEqual(\n '1',\n $results['total_count'],\n 'The results doesn\\'t have items.'\n );\n }",
"public function require_qty_update();",
"public function actionUpdateQty()\n {\n $return = ['sukses' => false];\n if (isset($_POST['pk'])) {\n $pk = $_POST['pk'];\n $value = $_POST['value'];\n if ($value > 0) {\n $returPembelianDetail = ReturPembelianDetail::model()->findByPk($pk);\n\n $returPembelianDetail->qty = $value;\n if ($returPembelianDetail->save()) {\n $return = ['sukses' => true];\n }\n }\n }\n $this->renderJSON($return);\n }",
"public function changeCartItemQuantityAction()\n {\n if (($data = \\System\\Helper::getJSONParameters()) !== false && $_SESSION['order_payment_status'] == 0) {\n $product = new \\Models\\Product();\n $result['errorcode'] = $product->changeCartItemQuantity($data['cart_item_id'], $data['number']); // ok\n $result['cart_count'] = $product->getProductsCountInCart();\n echo json_encode($result);\n } else {\n echo 0; // error\n }\n }",
"public function update_topproductquantity()\n {\n $product_id = mysqli_real_escape_string(GFHConfig::$link, $_POST['product_id']);\n $product_quantity = mysqli_real_escape_string(GFHConfig::$link, $_POST['product_quantity']);\n $pr = $this->getproduct($product_id);\n $prod = mysqli_fetch_array($pr);\n $amount = $prod['prod_price'];\n $sl = mysqli_query(GFHConfig::$link, \"INSERT INTO `purchase_inventory` SET `top_product_id`='$product_id',`quantity`='$product_quantity',`amount`='$amount'\");\n $sql = \"UPDATE `top_product` SET `quantity`='$product_quantity',`last_updated`=NOW() WHERE `prod_id`='$product_id'\";\n $result = mysqli_query(GFHConfig::$link, $sql);\n if ($result) {\n echo \"<script>window.location='manage-top-products.php?msg=Updated successfully';</script>\";\n } else {\n echo \"<script>window.location='manage-top-products.php?msg=Not Updated';</script>\";\n\n }\n }",
"public function setQuantity($quantity);",
"private function updateStock()\n {\n //On boucle dans le panier pour recuperer le produit qui est dans le panier\n foreach (Cart::content() as $item) {\n\n //On recupere l'id du produit dans le panier\n $produit = Produit::find($item->model->id);\n\n //On retire le nombre de la quantité qu'on as selectionner\n $produit->update([\n\n //on prend la qtité en BD on le soustrais par la qtité selectionné dans le panier\n 'quantite' => $produit->quantite - $item->qty\n\n ]);\n }\n }",
"public function addQty () {\r\n\t\t$cart = new MCart();\r\n\t\t$id = $this->input->post(\"id\"); //cart id here\r\n\t\t$qty = $this->input->post(\"quantity\");\r\n\t\t\r\n\t\t$affectedFields = array ('quantity'=>$qty);\r\n\t\t$where = array ('cart_id'=>$id);\r\n\r\n\t\tif ($cart->update1($where, $affectedFields) > 0) {\r\n\t\t\techo 'Sucess!';\r\n\t\t} else {\r\n\t\t\techo 'Failed!';\r\n\t\t}\r\n\t}",
"public function updateContainerQuantity_post(){\n $contID=$this->post('contID');\n $newQuan_liter=$this->post('newQuan');\n $result = $this->stock_model->updateContainerQuantity($contID,$newQuan_liter);\n if ($result === 0) {\n $this->response(\"person information could not be saved. Try again.\", 404);\n } else {\n $this->response(\"success\", 200);\n }\n }",
"public function test_update_quantity()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$basket->add_item($item);\n\n\t\t$basket->update_quantity($item->get_identifier(), 5);\n\t\t$basket_item = $basket->get_basket_item($item->get_identifier());\n\n\t\t$this->assertSame((int)$basket_item->quantity, 5);\n\t}",
"public function setQty($qty);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the vCard field name for the given Portable Contacts field/value, or null if there is no corresponding field. | private static function getVcardFieldName($fieldName, $fieldValue) {
$vCardFieldName = null;
if (isset(self::$_fieldNames[$fieldName])) {
$vCardFieldName = self::$_fieldNames[$fieldName];
} else if ($fieldName == 'ims' && isset($fieldValue->type) && isset(self::$_imFieldNamesByType[$fieldValue->type])) {
$vCardFieldName = self::$_imFieldNamesByType[$fieldValue->type];
} else {
// can do this to see all unrecognized fields in a quasi-legal output
//$vCardFieldName = "x-$fieldName";
}
return $vCardFieldName;
} | [
"public function field_name($num)\n {\n $this->check_connection();\n\n $info = $this->field_info_by_num($num);\n if (!$info) {\n return null;\n }\n\n return $info[\"name\"] ?? \"\";\n }",
"public function get_contact_name(){\n\t\treturn $this->v_contact_name;\n\t}",
"function get_field_name($field) {\n switch ($field) {\n case SM_ABOOK_FIELD_NICKNAME:\n return 'nickname';\n case SM_ABOOK_FIELD_FIRSTNAME:\n return 'firstname';\n case SM_ABOOK_FIELD_LASTNAME:\n return 'lastname';\n case SM_ABOOK_FIELD_EMAIL:\n return 'email';\n case SM_ABOOK_FIELD_LABEL:\n return 'label';\n default:\n return 'ERROR';\n }\n }",
"public function get_profile_contact_value($field_value, $field_data);",
"public function get_field_name();",
"public abstract function getFcsField($partnerField);",
"public function getContactName();",
"function getContactName($contact_id)\r\n{\r\n\tglobal $log;\r\n\t$log->debug(\"Entering getContactName(\".$contact_id.\") method ...\");\r\n\t$log->info(\"in getContactName \".$contact_id);\r\n\r\n\tglobal $adb, $current_user;\r\n\t$contact_name = '';\r\n\tif($contact_id != '')\r\n\t{\r\n \t$sql = \"select * from vtiger_contactdetails where contactid=?\";\r\n \t$result = $adb->mquery($sql, array($contact_id));\r\n \t$firstname = $adb->query_result($result,0,\"firstname\");\r\n \t$lastname = $adb->query_result($result,0,\"lastname\");\r\n \t$contact_name = $lastname;\r\n\t\t\t// Asha: Check added for ticket 4788\r\n\t\t\tif (getFieldVisibilityPermission(\"Contacts\", $current_user->id,'firstname') == '0') {\r\n\t\t\t\t$contact_name .= ' '.$firstname;\r\n\t\t\t}\r\n\t}\r\n\t$log->debug(\"Exiting getContactName method ...\");\r\n return $contact_name;\r\n}",
"function fieldDisplayName($field) {\n\t\tswitch($field) {\n\t\t\tcase 'currentimg':\n\t\t\t\treturn 'Current Image';\n\t\t\tcase 'imagerevision':\n\t\t\t\treturn 'Image Revision';\n\t\t\tcase 'nextimg':\n\t\t\t\treturn 'Next Image';\n\t\t\tcase 'ram':\n\t\t\t\treturn 'RAM';\n\t\t\tcase 'procnumber':\n\t\t\t\treturn 'Cores';\n\t\t\tcase 'procspeed':\n\t\t\t\treturn 'Processor speed';\n\t\t\tcase 'network':\n\t\t\t\treturn 'Network speed';\n\t\t\tcase 'IPaddress':\n\t\t\t\treturn 'Public IP Address';\n\t\t\tcase 'privateIPaddress':\n\t\t\t\treturn 'Private IP Address';\n\t\t\tcase 'eth0macaddress':\n\t\t\t\treturn 'Private MAC Address';\n\t\t\tcase 'eth1macaddress':\n\t\t\t\treturn 'Public MAC Address';\n\t\t\tcase 'vmhost':\n\t\t\t\treturn 'VM Host';\n\t\t\tcase 'provisioning':\n\t\t\t\treturn 'Provisioning Engine';\n\t\t\tcase 'predictivemodule':\n\t\t\t\treturn 'Predictive Loading Module';\n\t\t\tcase 'natenabled':\n\t\t\t\treturn 'Connect Using NAT';\n\t\t\tcase 'nathost':\n\t\t\t\treturn 'NAT Host';\n\t\t\tcase 'nathostenabled':\n\t\t\t\treturn 'Use as NAT Host';\n\t\t\tcase 'natpublicIPaddress':\n\t\t\t\treturn 'NAT Public IP Address';\n\t\t\tcase 'natinternalIPaddress':\n\t\t\t\treturn 'NAT Internal IP Address';\n\t\t}\n\t\treturn ucfirst($field);\n\t}",
"function fbs_pick_marc_field($entity, array $candidates) {\n foreach ($candidates as $candidate) {\n list($field, $subfield) = explode('.', $candidate);\n\n if ($field_value = fbs_get_marc_field($entity, $field, $subfield)) {\n return $field_value;\n }\n }\n return NULL;\n}",
"function bp_filter_get_profile_field( $field_name ) {\r\n\t\t\tglobal $field;\r\n\r\n\t\t\tif ( is_numeric( $field_name ) )\r\n\t\t\t\t$field_id = $field_name;\r\n\t\t\telse\r\n\t\t\t\t$field_id = xprofile_get_field_id_from_name( $field_name );\r\n\r\n\t\t\tif ( !$field_id )\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t$field = xprofile_get_field( $field_id );\r\n\r\n\t\t\treturn $field;\r\n\t\t}",
"public function field($field_id_or_external_id) {\n $key = is_int($field_id_or_external_id) ? 'field_id' : 'external_id';\n foreach ($this->fields as $field) {\n if ($field->{$key} == $field_id_or_external_id) {\n return $field;\n }\n }\n return null;\n }",
"function column_get_custom_field_name( $p_column ) {\n\tif( strncmp( $p_column, 'custom_', 7 ) === 0 ) {\n\t\treturn utf8_substr( $p_column, 7 );\n\t}\n\n\treturn null;\n}",
"abstract public function field_name($no);",
"private function getContactDataFieldByKey($keyName) {\n $entityContactDataFields = $this->getContactDataFields()->toArray();\n foreach ($entityContactDataFields as $entityContactDataField) {\n if ($entityContactDataField['key'] == $keyName) {\n return $entityContactDataField['value'];\n }\n }\n return NULL;\n }",
"function version_get_field( $p_version_id, $p_field_name ) {\n\t$t_row = version_cache_row( $p_version_id );\n\n\tif( isset( $t_row[$p_field_name] ) ) {\n\t\tswitch( $p_field_name ) {\n\t\t\tcase 'project_id':\n\t\t\t\treturn (int)$t_row[$p_field_name];\n\t\t\tdefault:\n\t\t\t\treturn $t_row[$p_field_name];\n\t\t}\n\t} else {\n\t\terror_parameters( $p_field_name );\n\t\ttrigger_error( ERROR_DB_FIELD_NOT_FOUND, WARNING );\n\t\treturn '';\n\t}\n}",
"protected function _getFieldFromRecordByCurrentRemoteAddress($field)\n {\n $record = $this->_getRecordForCurrentRemoteAddress();\n\n if (!$record) {\n return null;\n }\n\n if (!isset($record[$field])) {\n return null;\n }\n\n return $record[$field];\n }",
"public function getContactsFields() {\n\t\t$contactsfields = array(\t\n\t\t\t\t\t'salutationtype',\n\t\t\t\t\t'firstname', //set to 'Customer'\n\t\t\t\t\t'lastname',\n\t\t\t\t\t'phone',\n\t\t\t\t\t'otherphone',\n\t\t\t\t\t'fax',\n\t\t\t\t\t'email',\n\t\t\t\t\t'mailingstreet',\n\t\t\t\t\t'mailingcity',\n\t\t\t\t\t'mailingstate',\n\t\t\t\t\t'mailingzip',\n\t\t\t\t\t'mailingcountry',\n\t\t\t\t\t'otherstreet',\n\t\t\t\t\t'othercity',\n\t\t\t\t\t'otherstate',\n\t\t\t\t\t'otherzip',\n\t\t\t\t\t'othercountry',\n\t\t\t);\t//TO-DO: to handle vatid\n\t\treturn $contactsfields;\n\t}",
"function getContactName() {\n\t\treturn $this->getData('contactName');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
printStyles Compile the head script(js) sources to html `` elements. | public function printHeadScriptSrcs(){
return $this->printScriptsFromSource($this->view['headScriptSrcs']);
} | [
"function backend_scripts_print() {\r\n\t\trequire_once( WP_HOME_MNGT_BACKEND_TPL_DIR . 'js/header.js.php' );\r\n\t}",
"public function printStyles()\n {\n foreach($this->styles as $css) {\n echo '<link href=\"' . osc_apply_filter('style_url', $css) . '\" rel=\"stylesheet\" type=\"text/css\" />' . PHP_EOL;\n }\n }",
"function bunchy_render_head_scripts() {\n}",
"function bimber_render_head_scripts() {\n\n}",
"function _print_scripts()\n {\n }",
"public function print_elements()\n {\n if (isset($this->title))\n {\n echo (\" <title>{$this->title}</title>\\n\");\n }\n\n if ($this->jquery_enabled)\n {\n echo $this->jquery_inits;\n }\n\n if (!empty($this->prepend_script_head))\n {\n foreach ($this->prepend_script_head as $js_call)\n {\n echo $js_call;\n }\n }\n\n foreach ($this->script_head as $js_call)\n {\n echo $js_call;\n }\n\n foreach ($this->js_head as $js_call)\n {\n echo $js_call;\n }\n\n $this->print_jquery_statuses();\n\n foreach ($this->link_head as $link)\n {\n echo $link;\n }\n\n foreach ($this->meta_head as $meta)\n {\n echo $meta;\n }\n }",
"public function addHeadItems()\n\t{\n\t\t/* Ok, now a little hacky.. */\n\t\tif ( $this->registry->getClass('output')->isHTTPS )\n\t\t{\n\t\t\t$this->registry->getClass('output')->skin['set_css_inline'] = false;\n\t\t\t$this->settings['use_minify'] = 0;\n\t\t\t\n\t\t\tforeach( $this->registry->getClass('output')->skin['_cssGroupsArray'] as $position => $data )\n\t\t\t{\n\t\t\t\t/* Print only */\n\t\t\t\tif ( $this->_printOnly === true )\n\t\t\t\t{\n\t\t\t\t\tif ( $data['css_group'] != 'ipb_print' AND !preg_match( \"/media=['\\\"]print[\\\"']/i\", $this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\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$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] = 'media=\"screen,print\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ( $data['css_group'] == 'ipb_print' )\n\t\t\t\t{\n\t\t\t\t\t//$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] = 'media=\"print\"';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] = str_replace( 'http://', 'https://', $this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// CSS\n\t\t//-----------------------------------------\n\t\t\n\t\tforeach( $this->registry->getClass('output')->skin['_cssGroupsArray'] as $position => $data )\n\t\t{\n\t\t\t$name = $data['css_group'];\n\t\t\t\t\t\t\n\t\t\t/* Print only */\n\t\t\tif ( $this->_printOnly === true )\n\t\t\t{\n\t\t\t\tif ( $name != 'ipb_print' AND !preg_match( \"/media=['\\\"]print[\\\"']/i\", $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] = 'media=\"screen,print\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( $data['css_group'] == 'ipb_print' )\n\t\t\t{\n\t\t\t\t//$this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] = 'media=\"print\"';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Did we skip it? */\n\t\t\tif ( ! isset( $this->registry->getClass('output')->skin['_css'][ $name ] ) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Skip IE, print and lo-fi as it's hardcoded in the skin */\n\t\t\tif ( $name == 'ipb_ie' )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif( $this->settings['assume_css_written'] )\n\t\t\t{\n\t\t\t\t$_cssFile = $this->settings['css_base_url'] . 'style_css/' . $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css';\n\t\t\t\t$this->_css['import'][$_cssFile] = array( 'attributes' => $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'content' => $_cssFile );\n\t\t\t}\n\t\t\telse if ( ! SAFE_MODE_ON && $this->registry->getClass('output')->skin['set_css_inline'] AND @is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/'. $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css' ) )\n\t {\n\t\t\t\t$_cssFile = $this->settings['css_base_url'] . 'style_css/' . $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css';\n\t\t\t\t$this->_css['import'][$_cssFile] = array( 'attributes' => $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'content' => $_cssFile );\n\t }\n\t else\n\t {\n\t\t\t\t$this->_css['inline'][] = array( 'attributes' => $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'],\n\t\t\t\t\t\t\t\t\t\t\t\t 'content' => \"\\n/* CSS: \" . $name . \"*/\\n\" . $this->parseIPSTags( $this->registry->getClass('output')->skin['_css'][ $name ]['content'] ) );\n\t }\n\t\t}\n\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// RSS\n\t\t//-----------------------------------------\n\n\t\t$rssOutputCache\t= $this->cache->getCache('rss_output_cache');\n\n\t\tif( is_array( $rssOutputCache ) AND count( $rssOutputCache ) )\n\t\t{\n\t\t\tforeach( $rssOutputCache as $rssEntry )\n\t\t\t{\n\t\t\t\t$data\t= explode( ':|:', $rssEntry );\n\t\t\t\n\t\t\t\tif( $data[1] )\n\t\t\t\t{\n\t\t\t\t\t$this->output->addToDocumentHead( 'rss', array( 'title'\t=> $data[0], 'url' => $data[1] ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$memberCache\t= $this->memberData['_cache'];\n\n\t\tif( $this->memberData['member_id'] AND $memberCache['rc_rss_key'] )\n\t\t{\n\t\t\t$this->output->addToDocumentHead( 'rss', array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t=> $this->registry->class_localization->words['report_center_rss'], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'url'\t=> ipsRegistry::$settings['base_url'] . \"app=core&module=global&section=rss&type=core&member_id=\" . $this->memberData['member_id'] . '&rss_key=' . $memberCache['rc_rss_key'] \n\t\t\t\t\t\t\t\t\t\t\t)\t\t\t);\n\t }\n\t}",
"function printScripts()\n {\n\n // print scripts in queue\n if (is_array($this->scripts) && count($this->scripts)) {\n\n // print opening script tag\n echo \"\\n<script type='text/javascript'>\";\n\n // sort by priority and loop over\n uasort($this->scripts, array($this, 'sortByPriority'));\n foreach ($this->scripts as $handle => $script) {\n\n // skip scripts with used handles\n if (in_array($handle, $this->usedScriptHandles)) {\n continue;\n }\n\n // print script\n echo \"\\n\" . $script[0];\n\n // clean up\n $this->usedScriptHandles[] = $handle;\n unset($this->scripts[$handle]);\n }\n\n // print closing script tag\n echo \"\\n</script>\\n\";\n }\n }",
"function printHeaderJS() {\n\t\techo $this->getHeaderJS();\n\t}",
"function wp_print_head_scripts() {\n\tif ( ! did_action( 'wp_print_scripts' ) ) {\n\t\t/** This action is documented in wp-includes/functions.wp-scripts.php */\n\t\tdo_action( 'wp_print_scripts' );\n\t}\n\n\tglobal $wp_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\treturn array(); // No need to run if nothing is queued.\n\t}\n\treturn print_head_scripts();\n}",
"public static function displayJsHead(){\n\t\tif(self::$jsHead==='') return;\n\t\techo '<script type=\"text/javascript\">//<![CDATA[\n'.substr(self::$jsHead,0,-1).'\n//]]>\n</script>';\n\t}",
"function headerOutput($title, $styleSheetPath)\n{\n echo '<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">';\n //We iterate over the length of the passed array so we can echo out every stylesheet that is passed as an argument.\n for ($i = 0; $i < count($styleSheetPath); $i++) {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $styleSheetPath[$i] . '\">';\n }\n\n echo '<title>BBMS ADMIN - ' . $title . '</title>';\n\n //This function echo's out our java scripts.\n outputScripts();\n echo '</head>\n <body>';\n}",
"public function outputJavascriptInHeader()\n\t{\n\t\t$this->outputJavascriptCodeStart();\n\t\t$this->ouputJavascriptConfig();\n\t\t$this->outputJavascriptCodeEnd();\n\t}",
"function ozy_print_inline_script_style() {\n\tglobal $ozyHelper;\n\t\n\t$ozyHelper->set_footer_style(ozy_get_option('custom_css'));\n\tif($ozyHelper->footer_style) {\n\t\techo \"<style type=\\\"text/css\\\">\\r\\n\";\n\t\techo $ozyHelper->footer_style;\n\t\techo \"\\r\\n</style>\\r\\n\";\n\t}\n\n\t$ozyHelper->set_footer_script(ozy_get_option('custom_script'));\n\tif($ozyHelper->footer_script) {\n\t\techo \"<script type=\\\"text/javascript\\\">\\r\\n\";\n\t\techo $ozyHelper->footer_script;\n\t\techo \"\\r\\n</script>\\r\\n\";\n\t}\t\n}",
"public function on_wp_print_scripts(){ echo \"\\n\".self::TOP_JS_MARKER.\"\\n\"; }",
"protected function renderJavaScriptAndCss() {}",
"private function addCssAndJs() {\n\t\t$css = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n\t\t\tt3lib_extMgm::siteRelPath($this->extKey) . 'res/tx_' . $this->extKey . '_style.css\" />';\n\t\tif($GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]){\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] .= $css;\n\t\t} else {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = $css;\n\t\t}\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] .= '<script src=\"' . t3lib_extMgm::siteRelPath($this->extKey) . '/pi1/js/tx_' . $this->extKey . '_pi1.js\" /></script>';\n\t}",
"public function printScripts()\n\t{\n\t\techo $this->_javascripts;\n\t}",
"public function prepareHead() {\r\n // add jQuery\r\n if($this->cdn_jquery) {\r\n $this->addJS('//code.jquery.com/jquery-2.1.0.min.js', true);\r\n $this->addJS('//code.jquery.com/jquery-migrate-1.2.1.min.js', true);\r\n } else {\r\n $this->addJS(array('jquery-2.1.0.min', 'jquery-migrate-1.2.1.min'));\r\n }\r\n // add bootstrap\r\n if($this->cdn_bootstrap) {\r\n $this->addCSS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', true);\r\n $this->addJS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', true);\r\n } else {\r\n $this->addCSS('bootstrap.min');\r\n $this->addJS('bootstrap.min');\r\n }\r\n \r\n $this->addCSS(array('bootstrap-switch.min', 'spectrum'));\r\n $this->addJS(array('plugins'));\r\n \r\n // ace code editor\r\n $this->addJS('libs/ace/ace.js', true);\r\n \r\n $this->addCSS('style');\r\n $this->addJS('script');\r\n \r\n $this->smarty->assign(array(\r\n 'title' => $this->title,\r\n 'css_files' => $this->css_files,\r\n 'js_files' => $this->js_files,\r\n ));\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the tax group from the event. | protected function getTaxGroupFromEvent(ResourceEventInterface $event)
{
$resource = $event->getResource();
if (!$resource instanceof TaxGroupInterface) {
throw new InvalidArgumentException('Expected instance of ' . TaxGroupInterface::class);
}
return $resource;
} | [
"public function getTaxGroup() \n {\n return $this->taxGroup;\n }",
"public function getEventGroup()\n {\n return array_get($this->eventDetails(), 'group');\n }",
"public function getTaxes() {\n $qu = \"SELECT p.id_tax_rules_group as id_tax, p.name FROM `\" . _DB_PREFIX_ . \"tax_rules_group` p WHERE p.active = 1\";\n\n $res = Db::getInstance()->executeS($qu);\n $taxes = array('0' => $this->l('No Tax'));\n foreach ($res as $r) {\n $taxes[$r['id_tax']] = $r['name'];\n }\n return $taxes;\n }",
"public function getMeinPaketTaxGroup(Mage_Catalog_Model_Product $product) {\n\t\t$taxGroup = self::TAX_CLASS_STANDARD;\n\t\t\n\t\tif ($product->hasData ( 'tax_class_id' )) {\n\t\t\t$taxGroups = array (\n\t\t\t\t\t'0' => self::TAX_CLASS_FREE,\n\t\t\t\t\tMage::getStoreConfig ( 'meinpaket/taxrates/default_tax_rate' ) => self::TAX_CLASS_STANDARD,\n\t\t\t\t\tMage::getStoreConfig ( 'meinpaket/taxrates/reduced_tax_rate' ) => self::TAX_CLASS_REDUCED \n\t\t\t);\n\t\t\tif (array_key_exists ( $product->getTaxClassId (), $taxGroups )) {\n\t\t\t\t$taxGroup = $taxGroups [$product->getTaxClassId ()];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $taxGroup;\n\t}",
"function getEventGroupId()\n {\n return $this->__eventgroupid ;\n }",
"public function getTaxGroupsSelect()\n {\n try\n {\n //call getCompanyId method from UserRepository to get company id\n $company_id = $this->getCompanyId();\n\n //set tax groups array\n $groups_array = [];\n\n $groups = TaxGroup::select('id', 'name')->where('company_id', '=', $company_id)->where('deleted', '=', 'F')->get();\n\n //loop through all groups\n foreach ($groups as $group)\n {\n //add group to groups array\n $groups_array[$group->id] = $group->name;\n }\n\n return ['status' => 1, 'data' => $groups_array];\n }\n catch (Exception $e)\n {\n return ['status' => 0];\n }\n }",
"function getTaxGroupedByType() {\n if ($this->tax_grouped_by_type === false) {\n $this->tax_grouped_by_type = array();\n if (is_foreachable($this->getItems())) {\n foreach ($this->getItems() as $item) {\n\n if ($item->getFirstTaxRateId()) {\n if (!array_key_exists($item->getFirstTaxRateId(), $this->tax_grouped_by_type)) {\n $this->tax_grouped_by_type[$item->getFirstTaxRateId()] = array(\n 'id' => $item->getFirstTaxRateId(),\n 'name' => $item->getFirstTaxRate()->getName(),\n 'amount' => 0\n );\n } // if\n $this->tax_grouped_by_type[$item->getFirstTaxRateId()]['amount'] += $item->getFirstTax();\n } // if\n\n if ($this->getSecondTaxIsEnabled()) {\n if ($item->getSecondTaxRateId()) {\n if (!array_key_exists($item->getSecondTaxRateId(), $this->tax_grouped_by_type)) {\n $this->tax_grouped_by_type[$item->getSecondTaxRateId()] = array(\n 'id' => $item->getSecondTaxRateId(),\n 'name' => $item->getSecondTaxRate()->getName(),\n 'amount' => 0\n );\n } // if\n $this->tax_grouped_by_type[$item->getSecondTaxRateId()]['amount'] += $item->getSecondTax();\n } // if\n } // if\n } // foreach\n } // if\n } // if\n\n return $this->tax_grouped_by_type;\n }",
"public function getTaxGroups()\r\n {\r\n return $this->hasMany(TaxGroup::className(), [ 'id' => 'tax_group_id' ])\r\n ->viaTable('tax_group_to_category', [ 'category_id' => 'id' ]);\r\n }",
"public function trophyGroup() : TrophyGroup\n {\n return $this->trophyGroup;\n }",
"public function getFinancialEventGroupId()\n {\n return $this->_fields['FinancialEventGroupId']['FieldValue'];\n }",
"public function getTaxe()\n {\n return $this->taxe;\n }",
"public function getTimerGroup() {\n return $this->get('group')->value;\n }",
"public function getGroup()\n {\n return $this->readOneof(14);\n }",
"public function getRofTdfcGroup() {\n return $this->rofTdfcGroup;\n }",
"public function getResourceKey()\n {\n return 'tax_groups';\n }",
"public function get_group(){\n\t\treturn $this->_simpleVariation->get_group();\n\t}",
"public function getAttributeGroup()\n {\n return $this->attribute_group;\n }",
"public function getLineTax()\n\t{\n\t\treturn $this->getKeyValue('line_tax'); \n\n\t}",
"public function getMetaGroup()\n {\n return $this->attributes['meta_group'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Debuelve arreglo asociativo arrayOferta | public function getListaOferta(){
$tbOferta = new TbOferta();
$result = $tbOferta->resultOferta();
$count = 0;
while ($arrayOf = pg_fetch_assoc($result)) {
$this->arrayOferta[$count]['oferta_codigo'] = $arrayOf['oferta_codigo'];
$this->arrayOferta[$count]['empresa_codigo'] = $arrayOf['empresa_codigo'];
$this->arrayOferta[$count]['oferta_descripcion'] = $arrayOf['oferta_descripcion'];
$this->arrayOferta[$count]['estado_codigo'] = $arrayOf['estado_codigo'];
$this->arrayOferta[$count]['empresa_razonsocial'] = $arrayOf['empresa_razonsocial'];
$this->arrayOferta[$count]['estado_descripcion'] = $arrayOf['estado_descripcion'];
$count++;
}
return $this->arrayOferta;
} | [
"public function toArray() {}",
"private function getArrayCompras(){\n $data = file_get_contents(\"../../../assets/json/purchases-v2.json\");\n return $comprasCliente = json_decode($data, true);\n }",
"public function toArray()\n {\n /** @var integer $indice Índice do array para o contador de contatos */\n $indice = 0;\n \n /** @var array $contatos Contatos recuperados */\n $contatos = array();\n \n /** @var array $campos Campos do arquivo */\n $campos = array();\n \n foreach ($this->_file as $row) {\n preg_match('/(.+):(.+)?/i', $row, $campos);\n \n if (empty($campos[1]) && empty($campos[2])) {\n continue;\n }\n \n $chave = $campos[1];\n $valor = $campos[2];\n \n $contatos[$indice][$chave] = filter_var($valor, FILTER_SANITIZE_STRING);\n \n if ($chave == 'END') {\n $indice++;\n }\n }\n \n return $contatos;\n }",
"public function valoracionToArray(){\n\t\t\t$this->arrayValor = array(\n\t\t\t\t\"user\"=> $this->user,\n\t\t\t\t\"object\"=> $this->object,\n\t\t\t\t\"valor\"=>$this->valor\n\t\t\t\t);\n\t\t}",
"public static function getAllAsArray();",
"public function getArrayEstados()\n {\n $estados= $this->getEntityManager()\n ->createQuery('SELECT e.id, e.estado \n FROM SisproBundle:Estado e \n ORDER BY e.estado ASC')\n ->getResult();\n \n if (count($estados)==0) return array('0'=>'');\n \n $a=array('0'); $b=array('[Seleccione]');\n \n foreach ($estados as $fila)\n {\n array_push($a,$fila['id']);\n array_push($b,$fila['estado']);\n } \n $estados=array_combine($a,$b);\n //ksort($estados); \n return $estados;\n }",
"abstract public function getArray();",
"public function to_array_com_id(){\n return array(\"an\"=>$this->Id_Anuncio,\"ti\"=>$this->Titulo,\"de\"=>$this->Descricao,\"mo\"=>$this->Morada,\"em\"=>$this->Email,\"es\"=>$this->Estado,\"te\"=>$this->Telefone,\"co\"=>$this->Codigo_postal,\"wc\"=>$this->Wc,\"mob\"=>$this->Mobilia,\"ut\"=>$this->Utensilios,\"des\"=>$this->Despesas,\"ani\"=>$this->Animais,\"la\"=>$this->Latitude,\"lo\"=>$this->Longitude,\"pre\"=>$this->Preco,\"inte\"=>$this->Internet,\"ra\"=>$this->Rapariga,\"rap\"=>$this->Rapaz,\"di\"=>$this->Disponibilidade);\n}",
"public function paisToArray(){\n $this->paisArray = array(\n \"_id\" => $this->id,\n \"pais\" => $this->pais,\n \"info\" => $this->info,\n \"coordenadas\" => $this->coordenadad\n );\n }",
"function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"ordinal\"=>$this->ordinal,\n\t\t\t\"visible\"=>$this->visible,\n\t\t\t\"iconoov\"=>$this->iconoov,\n\t\t\t\"name\"=>$this->name,\n\t\t\t\"idov_refered\"=>$this->idov_refered,\n\t\t\t\"idresource_refered\"=>$this->idresource_refered,\n\t\t\t\"type\"=>$this->type\n\t\t);\n\t\treturn $arr;\n\t}",
"function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idusuario\"=>$this->idusuario,\n\t\t\t\"fechaModificacion\"=>$this->fechaModificacion,\n\t\t\t\"tipo\"=>$this->tipo,\n\t\t\t\"idov\"=>$this->idov\n\t\t);\n\t\treturn $arr;\n\t}",
"function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"orden\"=>$this->orden,\n\t\t\t\"lang\"=>$this->lang,\n\t\t\t\"atributo\"=>$this->atributo,\n\t\t\t\"valor\"=>$this->valor,\n\t\t\t\"grupo\"=>$this->grupo,\n\t\t\t\"formato\"=>$this->formato,\n\t\t\t\"tipo\"=>$this->tipo,\n\t\t\t\"etiqueta\"=>$this->etiqueta\n\t\t);\n\t\treturn $arr;\n\t}",
"function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idusuario\"=>$this->idusuario,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"tipoPermiso\"=>$this->tipoPermiso\n\t\t);\n\t\treturn $arr;\n\t}",
"function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }",
"public function getArrayMesoregioes() {\n\t\t$query = \"Select \" . \"c.nome AS nomemesorregiao \" . \"FROM mesorregiao c INNER JOIN emergencia e \" . \"ON (st_intersects(c.the_geom, st_transform(st_setsrid(e.location, 97483), 4326))) \" . \"LEFT JOIN country s \" . \"ON s.id=c.country_id \" . \"WHERE e.id = :id \" . \"AND c.country_id=:country;\";\n\t\t\n\t\t$res = Yii::$app->db->createCommand ( $query )->bindValue ( ':id', $this->id )->bindValue ( ':country', $this->owner->instituicao->pais )->queryAll ();\n\t\t\n\t\treturn $res;\n\t}",
"public function getPlainArray()\n {\n }",
"function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"idseccion\"=>$this->idseccion,\n\t\t\t\"idrecurso\"=>$this->idrecurso,\n\t\t\t\"value\"=>$this->value\n\t\t);\n\t\treturn $arr;\n\t}",
"function loadEtapas() {\r\n\t\tif(!$this->id) return array(\"success\" => false);\r\n\t\t//seleciona IDs de todos as etapas relacionadas a esta obra\r\n\t\t$etapasTipoID = Etapa::getEtapaPorEmpreend($this->id);// print_r($etapasTipoID);\r\n\t\t//se houver IDs retornados\r\n\t\tif(count($etapasTipoID)) {\r\n\t\t\t//pra cada ID, le os dados da etapa\r\n\t\t\tforeach ($etapasTipoID as $e) {\r\n\t\t\t\t$etapa = new Etapa(0, $this->id, 0, $e['id']);\r\n\t\t\t\t$load = $etapa->load();\r\n\t\t\t\tif($load['success']){\r\n\t\t\t\t\t//adiciona a etapa lida a array de etapas\r\n\t\t\t\t\t$etapas[] = $etapa;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn $load;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//atribui as etapas lidas a obra\r\n\t\t\t$this->etapa = $etapas;\r\n\t\t} else {\r\n\t\t\treturn array('success' => false);\r\n\t\t}\r\n\t\t\r\n\t}",
"abstract public function convertArray();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display lists from shortcode [mmc_display_lists] | public static function shortcodeDisplayLists($atts, $content = null, $code = '') {
if (is_feed())
return '';
self::displayLists();
} | [
"static public function show_list( $atts ) {\n\t\n\t\tself::$listAtts = shortcode_atts( self::$listDefaultAtts, self::fix_bool_atts( $atts ) );\n\t\t\n\t\t$places = self::string_to_array( get_option( 'travelmap_data' ) );\n\t\n\t\t// Filter out only the destinations that are supposed to be shown\n\t\t$places = self::filter_places( $places, self::$listAtts['first'], self::$listAtts['last'] );\n\t\t\n\t\tif ( ! is_array( $places ) )\n\t\t\treturn;\n\t\t\t\n\t\t// Reverse order id reverse attr is set\n\t\tif ( true === self::$mapAtts['reverse'] ) {\n\t\t\t$places = array_reverse( $places );\n\t\t}\n\t\t\n\t\t// Set format of dates in list\n\t\t$dateFormat = ( false !== self::$listAtts['dateformat'] ) ? self::$listAtts['dateformat'] : get_option( 'date_format' );\n\t\t$showDateCol = self::are_there_dates( $places );\n\t\t\n\t\tob_start();\n\t\tinclude 'inc/template-list.php';\n\t\treturn ob_get_clean();\n\t}",
"function renderList() {\n\t\t$content = '';\n\t\tforeach($this->lists as $list) {\n\t\t\t$content .= $this->cObj->stdWrap($list['name'], $this->conf['listConf.'][$this->listLayout.'.']['nameWrap.']);\n\t\t\tif(!empty($list['description'])) {\n\t\t\t\t$content .= $this->cObj->stdWrap($list['description'], $this->conf['listConf.'][$this->listLayout.'.']['descriptionWrap.']);\n\t\t\t}\n\t\t}\n\t\t$content = $this->cObj->stdWrap($content, $this->conf['listConf.'][$this->listLayout.'.']['listWrap.']);\n\t\treturn $content;\n\t}",
"public function show_list();",
"public function listDisplayElements();",
"function DisplayFeatureList() {\n\t\t\tglobal $smarty;\n\t\t\tglobal $base_path;\n\t\t\tglobal $filters;\n\t\t\tglobal $module_path;\n\t\t\tglobal $module_prefix;\n\t\t\tglobal $currentPageUrl;\n\t\t\t$sql = \"select * from {$this->table} \";\n\t\t\t$sql .= \" where published = 1 and featured =1 \";\n\t\t\t$sql .= \" order by order_num desc \";\n\t\t\t$items = db_get_rows( $sql );\n\t\t\t$smarty->assign( 'itemList', $items );\n\t\t\t$smarty->assign( 'listName', $this->listName );\n\t\t\t$smarty->assign( 'itemName', $this->itemName );\n\t\t\t$smarty->assign( 'pluralName', $this->pluralName );\n\t\t\t$smarty->assign( 'module_web_path', $this->module_web_path );\n\t\t\t$templateFile = $this->moduleFolder . 'templates/list.tpl';\n\t\t\t$smarty->display( \"file:\" . $templateFile );\n\t\t}",
"function sc_feed_list($atts = array())\n{\n\t$feed_url = isset( $atts['url'] ) ? $atts['url'] : null;\n\t$item_num = isset( $atts['num'] ) && intval($atts['num'] ) > 0 ? intval( $atts['item_num'] ) : 5;\n\t$empty_txt = isset( $atts['empty'] ) ? $atts['empty'] : '';\n\n\tif( !is_null( $feed_url )) {\n\t\t$rss = fetch_feed( $feed_url );\n\n\t\tif( !is_wp_error( $rss )) {\n\t\t\t$item_max = $rss->get_item_quantity( $item_num );\n\t\t\t$items = $rss->get_items( 0, $item_max );\n\t\t\tob_start(); ?>\n\t\t\t<ul class=\"feed-list\">\n\t\t\t<?\n\t\t\tif( count( $items ) == 0 ):\n\t\t\t\tif( $empty_text != '' ):?>\n\t\t\t\t<p><?php echo $empty_txt; ?></p>\n\t\t\t<?endif;\n\t\t\telse:\n\t\t\t\tforeach( $items as $item ): ?>\n\t\t\t\t<li><a href=\"<?php echo $item->get_link(); ?>\"><?php echo $item->get_title(); ?> »</a></li>\n\t\t\t<? endforeach;\n\t\t\tendif; ?>\n\t\t\t</ul><?\n\t\t\treturn ob_get_clean();\n\t\t}\n\t}\n}",
"function displayList() {\n\t\t$this->fetchCurrValue('PIDeventDisplay', '0', 'sDEF', 1);\n\t\t$this->fetchCurrValue('listStartTime', time(), 'sDEF', 1);\n\t\t$this->fetchCurrValue('listStartTime', $this->conf['currTime'], 'sDEF', 1);\n\t\t$this->fetchCurrValue('hideViewSelection', '0', 'sDEF');\n\t\t$this->fetchCurrValue('PIDsingleDayDisplay', '0', 'sDEF');\n\t\t$this->fetchCurrValue('PIDweekDisplay', '0', 'sDEF');\n\t\t$this->fetchCurrValue('PIDmonthDisplay', '0', 'sDEF');\n\t\t$this->fetchCurrValue('listEntryCount', 5, 'sDEF', 1);\n\t\t$this->fetchCurrValue('PIDallEventsDisplay', 0, 'sDEF', 1);\n\n\t\t$this->conf['showMultiDayOnlyOnce'] = 1;\n\n\t\t$this->listTemplateCode = $this->cObj->getSubpart($this->templateCode, '###LIST_VIEW###');\n\t\t$this->itemTemplateCode = $this->cObj->getSubpart($this->listTemplateCode, '###ITEM###');\n\n\t\t$markerArray = array();\n\t\t$subpartsArray = array();\n\n\t\t$markerArray['###VIEW_TITLE###'] = $this->pi_getLL('titleListView');\n\t\t$markerArray['###CATEGORY_TITLE###'] = $this->getCategorySelection();\n\t\t$entries = $this->getUpcomingEventsArray($this->conf['listStartTime']);\n\t\t/************\n\t\t * Changed Rendering of item list - START - Sept., 9th 2014\n\t\t ************/ \n\t\t// $subpartsArray['###ITEM###'] = $this->listTable($entries);\n\n\t\t$swing = $this->listTable($entries);\n\t\t$subpartsArray['###ITEM###'] = $swing[0];\n\t\t$firstEventTime = $swing[1];\n\t\t$nextEventTime = $swing[2];\n\t\t// $markerArray['###VIEW_LIST###'] = $this->getViewSelection($this->conf['listStartTime'],'l');\n\t\t$markerArray['###VIEW_LIST###'] = $this->getViewSelection($firstEventTime,'l');\n\n\t\t$markerArray['###ALL_EVENTS###'] = $this->conf['PIDallEventsDisplay'] ? $this->pi_linkTP($this->pi_getLL('allEvents'), array(), $this->caching, $this->conf['PIDallEventsDisplay']) : '';\n\n\t\t$mvars = array();\n\t\t$mvars['year']=strftime('%Y', $nextEventTime);\n\t\t$mvars['month']= strftime('%m', $nextEventTime);\n\t\t$mvars['day']= strftime('%d', $nextEventTime);\n\t\t//\tif ($nextEventTime == 0 OR ($this->conf['PIDallEventsDisplay'] ? $this->pi_linkTP($this->pi_getLL('allEvents'), array(), $this->caching, $this->conf['PIDallEventsDisplay']) : '') == '') {\n\t\tif ($nextEventTime == 0) {\n\t $markerArray['###NEXTLIST###'] = '';\n\t\t} else {\n\t\t\t$markerArray['###NEXTLIST###'] = $this->pi_linkTP_keepPIvars($this->pi_getLL('next'), $mvars, $this->caching);\n\t\t}\n\t\t/************\n\t\t * Changed Rendering of item list - END - Sept., 9th 2014\n\t\t ************/ \n\n\t\t$markerArray['###SUBMIT_EVENT###'] = ''; // That's where we will build the FE_Edit\n\n\t\t$out = $this->cObj->substituteMarkerArrayCached($this->listTemplateCode, $markerArray, $subpartsArray, array());\n\t\tif ($this->conf['showTooltips'] == 1) {\n\t\t\t$out .= $this->tooltip;\n\t\t}\n\n\t\treturn $out;\n\t}",
"function theme_micro_add_list($variables) {\n $content = $variables['content'];\n $output = '';\n\n if ($content) {\n $output = '<dl class=\"micro-type-list\">';\n foreach ($content as $item) {\n $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';\n $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';\n }\n $output .= '</dl>';\n }\n else {\n $output = '<p>' . t('You have not created any micro types yet. Go to the <a href=\"@create-micro\">micro type creation page</a> to add a new micro type.', array('@create-micro' => url('admin/structure/micro/add'))) . '</p>';\n }\n return $output;\n}",
"function prebuilt_lists_list() {\n //TODO: Query Database to select all in list table. Issue # 6\n //TODO: Add pagination for lots of lists. Issue #7\n \n $query = db_select('prebuilt_lists')\n ->extend('PagerDefault')\n ->orderBy('list_id')\n ->fields('name', 'description', 'path')\n ->limit(10);\n \n $result = $query->execute();\n \n foreach($result as $row) {\n $rows[] = array(\n l($row->name, $row->path),\n 'description' => $row->description,\n l('Edit', $row->path . '/edit'),\n l('Delete', $row->path . '/delete'),\n );\n }\n \n $header = array('Name', 'Description', 'Edit', 'Delete');\n \n $output = theme('table', array('header' => $header, 'rows' => $rows)) . theme('pager');\n \n return $output;\n}",
"public function multiListCommand()\n {\n Show::multiList([\n 'list0' => [\n 'value in the list 0',\n 'key' => 'value in the list 0',\n 'key1' => 'value1 in the list 0',\n 'key2' => 'value2 in the list 0',\n ],\n 'list1' => [\n 'key' => 'value in the list 1',\n 'key1' => 'value1 in the list 1',\n 'key2' => 'value2 in the list 1',\n 'value in the list 1',\n ],\n 'list2' => [\n 'key' => 'value in the list 2',\n 'value in the list 2',\n 'key1' => 'value1 in the list 2',\n 'key2' => 'value2 in the list 2',\n ],\n ]);\n }",
"function display_lists() {\n\t\tglobal $mysqli;\n\t\t$query = $mysqli->prepare(\"SELECT `name`,`cellphone`,`homephone` FROM `listings` WHERE `userID`=? ORDER BY `lastname`\");\n\t\t$query->bind_param(\"i\", $userID);\n\t\t$userID = $this->userID;\n\t\t$query->execute();\n\t\t$query->bind_result($name, $cellphone, $homephone);\n\t\t$count=1;\n\t\twhile($query->fetch()) {\n\t\t\techo '<tr><td width=\"40\"><img src=\"'.SITE_URL.'/images/check_box.gif\"></td><td width=\"700\" align=\"left\">'.$name.' - '.($homephone ? ($cellphone ? \"Home Phone: $homephone -\" : \"Home Phone: $homephone\") : null).'\n\t\t\t'.($cellphone ? \"Cell Phone: $cellphone\" : null).'</td></tr>';\n\t\t\t$count++;\n\t\t}\n\t\n\t}",
"function station_shortcode_get_playlists_for_show($atts) {\n\t$attr = shortcode_atts( array(\n\t\t\t'show' => '',\n\t\t\t'limit' => -1\n\t), $atts );\n\n\t$show = $attr['show'];\n\t$limit = $attr['limit'];\n\n\t//don't return anything if we don't have a show\n\tif($show == '') {\n\t\treturn false;\n\t}\n\n\t$args = array(\n\t\t\t'numberposts' => $limit,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'post_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'post_type' => 'playlist',\n\t\t\t'post_status' => 'publish',\n\t\t\t'meta_key' => 'playlist_show_id',\n\t\t\t'meta_value' => $show\n\t);\n\n\t$playlists = get_posts($args);\n\n\t$output = '';\n\n\t$output .= '<div id=\"myplaylist-playlistlinks\">';\n\t$output .= '<ul class=\"myplaylist-linklist\">';\n\tforeach($playlists as $playlist) {\n\t\t$output .= '<li><a href=\"';\n\t\t$output .= get_permalink($playlist->ID);\n\t\t$output .= '\">'.$playlist->post_title.'</a></li>';\n\t}\n\t$output .= '</ul>';\n\n\t$playlist_archive = get_post_type_archive_link('playlist');\n\t$params = array( 'show_id' => $show );\n\t$playlist_archive = add_query_arg( $params, $playlist_archive );\n\n\t$output .= '<a href=\"'.$playlist_archive.'\">'.__('More Playlists', 'radio-station').'</a>';\n\n\t$output .= '</div>';\n\n\treturn $output;\n}",
"private function initDisplayList()\n {\n $lDisplayList = $this->conf_view[ 'displayList.' ];\n if ( !is_array( $lDisplayList ) )\n {\n $lDisplayList = $this->pObj->conf[ 'displayList.' ];\n }\n $this->lDisplayList = $lDisplayList;\n return $lDisplayList;\n }",
"function zozo_listitem_shortcode( $atts, $content = null ) {\n\n\t$atts = extract(shortcode_atts(\n\n\t\t\tarray(\n\n\t\t\t\t'icon' \t\t\t \t=> '',\n\n\t\t\t\t'iconcolor' \t \t=> '',\n\n\t\t\t\t'iconbgcolor' \t \t=> '',\n\n\t\t\t\t'icontype' \t \t=> '',\n\n\t\t\t\t'listinline' \t \t=> '',\n\n\t\t\t\t'animation_type' \t=> '',\n\n\t\t\t\t'animation_delay'\t=> '',\n\n\t\t\t), $atts));\n\n\t\t\t\n\n\tstatic $zozo_list_id = 1;\n\n\t$output = $extra_class = $icon_class = $icon_styles = $animation_class = $extra_data = '';\n\n\t\n\n\tif( $icon != '' ) {\n\n\t\t$icon_class = sprintf( 'fa-%s', $icon );\n\n\t\t$icon_styles = 'font-family: FontAwesome;';\n\n\t\t$extra_class = ' icon';\n\n\t}\n\n\t\n\n\tif( $iconcolor != '' ) {\n\n\t\t$icon_styles .= sprintf( 'color:%s;', $iconcolor );\n\n\t}\n\n\t\n\n\tif( $icontype != 'none' ) {\n\n\t\t$icon_styles .= sprintf( 'background-color:%s;', $iconbgcolor );\n\n\t\t$extra_class .= sprintf( ' %s', $icontype );\n\n\t}\n\n\t\n\n\tif( $animation_type != '' && $animation_type != 'none' ) {\n\n\t\t$animation_class = ' animated';\n\n\t\t$extra_data = ' data-animation=\"'.$animation_type.'\"';\n\n\t}\n\n\t\n\n\tif( $animation_delay != '' && $animation_type != 'none' ) {\n\n\t\t$extra_data .= ' data-animation-delay=\"'.$animation_delay.'\"';\n\n\t}\n\n\t\n\n\tif( $listinline == 'yes' ) {\n\n\t\t$extra_class .= ' list-inline';\n\n\t}\n\n\t\n\n\tif( $icon != '' ) {\t\n\n\t\t$output .= \"<style type='text/css'>#zozo-list-item-{$zozo_list_id} li:before{ {$icon_styles} };</style>\";\n\n\t}\n\n\t\n\n\t$output .= str_replace('<ul>', '<ul id=\"zozo-list-item-'.$zozo_list_id.'\" class=\"zozo-listitem'. $extra_class . $animation_class .'\"'.$extra_data.'>', $content);\n\n\tif( $icon_class != '' ) {\n\n\t\t$output = str_replace('<li>', '<li class=\"'.$icon_class.'\">', $output);\n\n\t} else {\n\n\t\t$output = str_replace('<li>', '<li><span class=\"custom-icon\"></span>', $output);\n\n\t}\n\n\t\n\n\t$zozo_list_id++;\n\n\t\n\n\treturn $output;\n\n}",
"function cosmo_set_list_posts_shortcode() {\n\t\t$cosmo_list_posts_config = array(\n\t\t\t\t'no_preview' => true,\n\t\t\t\t'params' => array(\n\t\t\t\t\t\t'post_type' => array(\n\t\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t\t'label' => __('Post type', 'flotheme'),\n\t\t\t\t\t\t\t\t'desc' => __('Select the post type you want to be displayed', 'flotheme'),\n\t\t\t\t\t\t\t\t'options' => cosmo_get_post_types_hc()\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'number_posts' => array(\n\t\t\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'label' => __('Number of posts', 'flotheme'),\n\t\t\t\t\t\t\t\t'desc' => 'Number of posts.',\n\t\t\t\t\t\t\t\t'hide_default' => false,\n\t\t\t\t\t\t\t\t'class' => ' nr_of_posts'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t\t'label' => __('Show pagination', 'flotheme'),\n\t\t\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t\t'0' => __('No', 'flotheme'),\n\t\t\t\t\t\t\t\t\t\t'1' => __('Yes', 'flotheme'),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\n\t\t\t\t),\n\t\t\t\t'shortcode' => '[flo_list_posts\n\t\t\t\t\t\t\t\t\tpost_type=\"{{post_type}}\" \n\t\t\t\t\t\t\t\t\tnumber_posts=\"{{number_posts}}\"\n\t\t\t\t\t\t\t\t\tpagination=\"{{pagination}}\"\n\t\t\t \t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t[/flo_list_posts]',\n\t\t\t\t'popup_title' => __('Insert List Posts Shortcode', 'flotheme')\n\t\t);\n\t\treturn $cosmo_list_posts_config;\n\t}",
"function btm_iconlist_sc( $atts, $content = null ) {\n\t\textract(shortcode_atts(array(\n\t\t\t// no atts\n\t\t), $atts));\n\t\treturn \"<ul class='iconlist'>\" . do_shortcode( $content ) . \"</ul>\";\n\t}",
"function DisplayFeatureList(){\n global $smarty;\n global $base_path;\n global $filters;\n global $module_path;\n global $module_prefix; \n global $currentPageUrl;\n \n $sql = \"select * from {$this->table} \"; \n $sql .= \" where published = 1 and featured =1 \";\n $sql .= \" order by order_num desc \"; \n $items = db_get_rows($sql); \n $smarty->assign('itemList', $items); \n $smarty->assign('listName', $this->listName);\n $smarty->assign('itemName', $this->itemName);\n $smarty->assign('pluralName', $this->pluralName); \n $smarty->assign('module_web_path', $this->module_web_path); \n $templateFile = $this->moduleFolder . 'templates/list.tpl';\n $smarty->display(\"file:\" . $templateFile); \n \n }",
"public function list_items()\n\t{ \n\t $views[]\t\t\t\t\t\t\t\t\t\t\t= \"site_list\";\n $data['title'] = lang('list_title');\n $this->data['action'] = \"list\";\n \n $this->data['flexigrid']['cols'] = $this->site_mod->get_flexigrid_cols();\n $this->data['flexigrid']['base_url'] = $this->data['base_url'];\n $this->data['flexigrid']['export_limit'] = $this->export_limit;\n $this->data['flexigrid']['delete_limit'] = $this->delete_limit;\n $this->data['flexigrid']['sortname'] = 'name';\n \n view_load($views,$this->data);\n\t}",
"function station_shortcode_list_shows($atts) {\r\n\textract( shortcode_atts( array(\r\n\t\t\t'genre' => ''\r\n\t), $atts ) );\r\n\r\n\t//grab the published shows\r\n\t$args = array(\r\n\t\t\t'numberposts' => -1,\r\n\t\t\t'offset' => 0,\r\n\t\t\t'orderby' => 'title',\r\n\t\t\t'order' => 'ASC',\r\n\t\t\t'post_type' => 'show',\r\n\t\t\t'post_status' => 'publish',\r\n\t\t\t'meta_query' => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'key' => 'show_active',\r\n\t\t\t\t\t\t\t'value' => 'on',\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\t);\r\n\r\n\tif($genre != '') {\r\n\t\t$args['genres'] = $genre;\r\n\t}\r\n\r\n\t$shows = get_posts($args);\r\n\r\n\t//if there are no shows saved, return nothing\r\n\tif(!$shows) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t$output = '';\r\n\r\n\t$output .= '<div id=\"station-show-list\">';\r\n\t$output .= '<ul>';\r\n\tforeach($shows as $show) {\r\n\t\t$output .= '<li>';\r\n\t\t$output .= '<a href=\"'.get_permalink($show->ID).'\">'.get_the_title($show->ID).'</a>';\r\n\t\t$output .= '</li>';\r\n\t}\r\n\t$output .= '</ul>';\r\n\t$output .= '</div>';\r\n\treturn $output;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===== create function for setting html content type, to be ref'd in the email compilation functions | function set_html_content_type() { return 'text/html'; } | [
"public function set_mail_content_type() {\n return 'text/html';\n }",
"function buddyboss_force_html_email( $content_type ) {\n\t$content_type = 'text/html';\n\treturn $content_type;\n}",
"function wpmm_change_mail_content_type($content_type) {\r\n\treturn 'text/html';\r\n}",
"function swsctp_change_mail_content_type() {\n\treturn \"text/html\";\n}",
"public function mail_content_type()\n {\n return \"text/html\";\n }",
"public function setHtmlContentType()\n {\n return 'text/html';\n }",
"function pemi_email_content_type() {\n return 'text/html';\n}",
"public static function set_html_email() {\r\n\t\treturn 'text/html';\r\n\t}",
"static function wp_mail_content_type()\n {\n return 'text/html';\n }",
"public function set_content_type($content_type = 'text/html'){\n\t\t$this->headers['Content-Type'] = $content_type;\n\t}",
"function cleanyeti_create_contenttype() {\n $content = \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"\";\n $content .= get_bloginfo('html_type'); \n $content .= \"; charset=\";\n $content .= get_bloginfo('charset');\n $content .= \"\\\" />\";\n $content .= \"\\n\";\n $content .=\"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\" />\";\n $content .= \"\\n\";\n echo apply_filters('cleanyeti_create_contenttype', $content);\n}",
"public function setHtmlType(string $type): self;",
"function o2_create_contenttype() {\n $content = \"\\t\";\n $content .= \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"\";\n $content .= get_bloginfo('html_type'); \n $content .= \"; charset=\";\n $content .= get_bloginfo('charset');\n $content .= \"\\\" />\";\n $content .= \"\\n\\n\";\n echo apply_filters('o2_create_contenttype', $content);\n}",
"public function getHTMLType();",
"public function get_content_type() {\n\n\t\tif ( ! $this->content_type && $this->html ) {\n\t\t\t$this->content_type = apply_filters( 'wpforms_email_default_content_type', 'text/html', $this );\n\t\t} elseif ( ! $this->html ) {\n\t\t\t$this->content_type = 'text/plain';\n\t\t}\n\n\t\treturn apply_filters( 'wpforms_email_content_type', $this->content_type, $this );\n\t}",
"function mime_types( $mime_types ) {\n\t\t$mime_types['text/html'] = array(\n\t\t\t'title' => __( 'HTML' ),\n\t\t\t'fetch_callback' => array( $this, 'fetch_html' ),\n\t\t\t'display_callback' => array( $this, 'display_html' ),\n\t\t);\n\n\t\treturn $mime_types;\n\t}",
"function http_set_content_type($content_type)\n\t{\n\t\t$this->http_content_type = $content_type;\n\t}",
"public function setContentType($content_type) {}",
"public function setContentType($val){ return $this->setHeader('Content-Type',$val); }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
metodo set de la id del poi de la clase diariPoi | function setIdPoi($idPoi) {
$this->idPoi = $idPoi;
} | [
"function setId_poi($id_poi) {\n $this->id_poi = $id_poi;\n }",
"function getIdPoi() {\n return $this->idPoi;\n }",
"function setIdPessoa( $idPessoa ) {\n $this->idPessoa = $idPessoa;\n }",
"function __construct($idDiario, $idPoi) {\n $this->idDiario = $idDiario;\n $this->idPoi = $idPoi;\n }",
"function setId($n){\n $this->id = $n;\n }",
"public function setId($value) { $this->id = $value;}",
"function setId_cargo($iid_cargo)\n {\n // si es sacd, cambio a la clase ActividadCargoSacd\n if ($iid_cargo == 35) {\n\n }\n $this->iid_cargo = $iid_cargo;\n }",
"public function setId($value) { $this->_id = $value; }",
"public function setIdnombre($p_idnombre){\r\n\t$this->idnombre=$p_idnombre;\r\n}",
"function setId_orbix($iid_orbix = '')\n {\n $this->iid_orbix = $iid_orbix;\n }",
"public function setIdgenero($p_idgenero){\r\n\t$this->idgenero=$p_idgenero;\r\n}",
"function set_id($id){\n $this->id->value = $id;\n }",
"public function setIdhistorico($idhistorico){\n $this->idhistorico = $idhistorico;\n }",
"function setId_asignatura($iid_asignatura = '')\n {\n $this->iid_asignatura = $iid_asignatura;\n }",
"function setId_asignatura($iid_asignatura)\n {\n $this->iid_asignatura = $iid_asignatura;\n }",
"function setId_tipo_proceso($iid_tipo_proceso = '')\n {\n $this->iid_tipo_proceso = $iid_tipo_proceso;\n }",
"function set_idObjeto( $idObjeto ) {\n // sets the value of idObjeto\n $this->idObjeto = $idObjeto;\n }",
"function setId_direccion($iid_direccion)\n {\n $this->iid_direccion = $iid_direccion;\n }",
"public function setIdFolio( $idFolio ){\n\t\t$this->idFolio = $idFolio;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a server variable by its' key. | public function getServerVariable(string $key): mixed; | [
"public function getServerVariable(string $key): mixed\n {\n return $this->serverVariables[$key];\n }",
"public function get($key) {\n\t $keyStr = $this->db->quote($key);\n\t $rows=$this->db->query(\"select varValue from FLX_VARS where sessionID=\\\"$this->sessionID\\\" and varKey=$keyStr\");\n\t foreach ($rows as $row) {\n\t\t return $row['varValue'];\n }\n\t\t\n\t}",
"public function getServerValue($key)\n {\n $key = strtolower($key);\n $server = $this->getServer();\n $return = null;\n if (isset($server[$key])) {\n $return = $server[$key];\n }\n unset($server);\n return $return;\n }",
"function getShibVar($key) {\n\t$key2 = \"SHIB_\" . strtoupper($key);\n\t$val = '';\n\tif(isset($_SERVER[$key]) && ! empty($_SERVER[$key]))\n\t\treturn $_SERVER[$key];\n\telseif(isset($_SERVER[$key2]) && ! empty($_SERVER[$key2]))\n\t\treturn $_SERVER[$key2];\n}",
"public static function get($key){\r\n return self::has($key) ? $_SERVER[$key] : null;\r\n }",
"public function serverParam($key)\n {\n if (array_key_exists($key, $_SERVER)) {\n return $_SERVER[$key];\n }\n }",
"function server($key)\n{\n\tif (isset($_SERVER[$key]))\n\t\treturn $_SERVER[$key];\n\t\n\treturn NULL;\n}",
"function __get($var){\n if(!in_array($var, $this->nameToKey)){\n $this->refreshMemoryVarList();\n }\n return shm_get_var($this->id, array_search($var, $this->nameToKey));\n }",
"public function getServerValue($key)\n {\n if (array_key_exists($key, $_SERVER) === true) {\n return $_SERVER[$key];\n }\n\n return null;\n }",
"function get($key)\n{\n\treturn System::request()->get($key);\n}",
"function shm_get_var($shm_identifier, $variable_key)\n{\n}",
"public function get($key)\n {\n $key = $this->nameSpace . \"_\" . $key;\n return apc_fetch($key);\n }",
"public function route_var($key){\n return $this->route_variables[$key];\n }",
"static function get(string $key): ?string\n {\n return isset($_SERVER[$key]) ? (string) $_SERVER[$key] : null;\n }",
"public static function fetch($key)\n\t{\n\t\treturn $_SESSION[ $key ];\n\t}",
"public function get($key){\n return $this->auth[$key];\n }",
"public function server($key , $default = null)\n {\n return array_get($_SERVER , $key , $default);\n }",
"public static function get($key) \n {\n return static::value($key, $_GET);\n }",
"public function getViewVarValue($key) {\n\t\treturn $this->_View->getVar($key);\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of CSS URIs. | public function get_css()
{
// Return all of the CSS URIs in an array
return array_keys($this->_css);
} | [
"public function getCssUrlArray(): array {\n\t\treturn static::BASE_CSS_URL + [\n\t\t\t\t'?' => $this->_getQuery(),\n\t\t\t];\n\t}",
"public function getCss() {\n $arr = [];\n foreach ($this->css as $css) {\n if (preg_match(\"/^([a-z]+\\:)?\\/\\//i\", $css))\n $arr[] = $css;\n else\n $arr[] = fileUrl(\"library/\".$this->name.\"/\".$css);\n }\n return $arr;\n }",
"public function getCssHrefs()\n\t{\n\t\t$absBase = $this->getAbsoluteBase();\n\t\t$relBase = $this->getRelativeBase();\n\t\t\n\t\t$hrefs = array();\n\t\t$linkElems = $this->doc->getElementsByTagName('link');\n\t\tforeach ($linkElems as $linkElem)\n\t\t{\n\t\t\t// Check if this is a stylesheet\n\t\t\tif ($linkElem->getAttribute('rel') == 'stylesheet')\n\t\t\t{\n\t\t\t\t$href = trim($linkElem->getAttribute('href'));\n\t\t\t\tif (!empty($href))\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('|^[^/]*//|AD', $href))\n\t\t\t\t\t{}\n\t\t\t\t\telse if ($href[0] == '?' || $href[0] == '#')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp = $this->getCurrentUrl();\n\t\t\t\t\t\tif (($pos = strpos($tmp, $href[0])) !== false)\n\t\t\t\t\t\t\t$tmp = substr($tmp, 0, $pos);\n\t\t\t\t\t\t$href = $tmp . $href;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($href[0] == '/')\n\t\t\t\t\t\t$href = $absBase . $href;\n\t\t\t\t\telse\n\t\t\t\t\t\t$href = $relBase . '/' . $href;\n\t\t\t\t\t\n\t\t\t\t\tif (!in_array($href, $hrefs))\n\t\t\t\t\t\t$hrefs[] = $href;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $hrefs;\n\t}",
"public function CssList() {\n\t\t$result = array();\n\t\tif (!empty($this->metadata->css)) {\n\t\t\t$aux = explode(\",\",$this->metadata->css);\n\t\t\tif (count($aux) > 0) {\n\t\t\t\tforeach($aux as $key => $value) {\n\t\t\t\t\tif (preg_match(\"/\\.css$/im\",$value)) {\n\t\t\t\t\t\t$aux[$key] = preg_replace(\"/\\.css$/im\",\"\",$value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result = $aux;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"private function getRelativeCoreStyleUrls(): array\n {\n $urls = [];\n foreach (\\H5PCore::$styles as $style) {\n $urls[] = $this->h5pPublicFolderUrl . $this->h5pCorePublicFolderName . '/' . $style . $this->getCacheBuster();\n }\n return $urls;\n }",
"public function getCssList()\n\t{\n\n\t\t$this->_css = array();\n\n\t\tforeach (new ivFilterIteratorDot(new DirectoryIterator($this->getAbsolutePath())) as $item) {\n\t\t\tif (strtolower(ivFilepath::suffix($item->getFilename()))=='css') {\n\t\t\t\t$this->_css[] = $item->getFilename();\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_css;\n\t}",
"public function getAllCssAssets(): array\n {\n return $this->css_files;\n }",
"public function stylesheets(): array\n {\n return $this->stylesheets;\n }",
"private function getRelativeEditorStyleUrls(): array\n {\n $urls = [];\n foreach (\\H5peditor::$styles as $style) {\n $urls[] = $this->h5pPublicFolderUrl . $this->h5pEditorPublicFolderName . '/' . $style . $this->getCacheBuster();\n }\n return $urls;\n }",
"public function getCSSFiles() {\n\t\treturn array();\n\t}",
"public function getCssSources(){ }",
"function get_the_css_urls() {\n\n md_get_the_css_urls();\n \n }",
"public function cssUrls(){\n\n $files = $this->cssFiles;\n $sources = $this->cssSources;\n $scripts = array( );\n $urls = array( );\n\n foreach($files as $file)\n $scripts[ $file ] = file_get_contents( HOME . $file );\n\n foreach( $sources as $source => $contents )\n $scripts[ $source ] = $contents;\n\n foreach( $scripts as $cache_file => $content ){\n\n $cache_file = md5( $cache_file );\n\n /**\n * check if diagnostic mode is enabled\n * and if so do not compress data\n */\n if( $this->diagnosticMode == 1 ){\n\n\t /**\n \t * makes the SITEURL constant available\n \t * in CSS so that files etc can\n \t * be loaded properly\n\t */\n \t $content = str_replace( '%SITEURL%', SITEURL, $content );\n\n cache( $cache_file, $content, 'CSS' );\n\t\t\t}\n elseif( !cache_exists( $cache_file, 'CSS' ) ){\n\n \t /**\n\t * makes the SITEURL constant available\n \t * in CSS so that files etc can\n \t * be loaded properly\n \t */\n\t $content = str_replace( '%SITEURL%', SITEURL, $content );\n\n \t/**\n \t * remove comments\n \t */\n\t $content = preg_replace( '!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $content );\n\n \t/**\n \t * remove spaces, tabs etc\n \t */\n\t $content = str_replace( array( \"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' ' ), '', $content );\n\n cache( $cache_file, $content, 'CSS');\n }\n\n $url = SITEURL . '_inc/css/css.php?' . $cache_file;\n\n array_push( $urls, $url );\n\n }\n\n\t\treturn $urls;\n\n }",
"public function getCssFiles() : array {}",
"public function test_get_urls_from_stylesheet_provider() {\n return [\n // Empty string.\n [\"\", 0],\n // URLs that should be retrieved.\n [\"background:url(/theme/image.php/_s/boost/core/1581292565/t/expanded)\", 1],\n [\"background:url('/theme/image.php/_s/boost/core/1581292565/t/expanded')\", 1],\n [\"src:url(\\\"/theme/font.php/boost/core/1581292565/fontawesome-webfont.eot?#iefix&v=4.7.0\\\")\", 1],\n [\"background-image:url(pix/vline-rtl.gif)\", 1],\n // URLs that should not be retrieved.\n [\"background-image:url(data:image/gif;base64,R0lGODlhYADIAP=)\", 0],\n [\"background-image:url('data:image/gif;base64,R0lGODlhYADIAP=')\", 0],\n [\"background-image:url(\\\"data:image/svg+xml;charset=utf8,%3Csvg xmlns=\\'http://www.w3.org/2000/svg\\'\\\")\", 0],\n // Combination of URLs used above.\n [\"background-image:url(pix/vline-rtl.gif) background:url(/theme/image.php/_s/boost/core/158/t/expanded)\", 2],\n [\"background-image:url(data:image/gif;base64,R0lG=)src:url(\\\"/theme/font.php/fontawesome-webfont.eot\\\")\", 1],\n ];\n }",
"public function getCSSIELinks() { return $this->_CSSIELink; }",
"public static function getStylesheets()\n {\n return self::$_css;\n }",
"public static function parseUrlsFromCSS($content) {\n\t\tif (!is_string($content) || empty($content)) {\n\t\t\treturn array();\n\t\t}\n\t\tpreg_match_all('~\\bbackground(-image)?\\s*:(.*?)\\(\\s*(\\'|\")?(?<image>.*?)\\3?\\s*\\)~i', $content, $matches);\n\t\tif (empty($matches['image'])) {\n\t\t\treturn array();\n\t\t}\n\t\t$urls = $matches['image'];\n\t\t// clean out all URLs which are not valid URLs (ending in image ext)\n\t\t$exts = array('gif', 'png', 'jpg', 'jpeg');\n\t\tforeach (array_keys($urls) as $i) {\n\t\t\t// prep \"bad\" URLs\n\t\t\t$url = trim(trim(trim($urls[$i]), '\"\\''));\n\t\t\t$url = str_replace('#', '?', $url);\n\t\t\tif (strpos($url, '?')!==false) {\n\t\t\t\t// remove the \"?\" and everything after\n\t\t\t\t$parts = explode('?', $url);\n\t\t\t\t$url = array_shift($parts);\n\t\t\t}\n\t\t\t// get the ext\n\t\t\t$parts = explode('.', $url);\n\t\t\t$ext = array_pop($parts);\n\t\t\tif (count($parts) < 1 || !in_array($ext, $exts)) {\n\t\t\t\tunset($urls[$i]);\n\t\t\t}\n\t\t}\n\t\t// return just the urls, simplified\n\t\treturn array_values(array_unique($urls));\n\t}",
"function extractCssUrls($text)\n {\n $urls = array();\n\n $url_pattern = '(([^\\\\\\\\\\'\", \\(\\)]*(\\\\\\\\.)?)+)';\n $urlfunc_pattern = 'url\\(\\s*[\\'\"]?' . $url_pattern . '[\\'\"]?\\s*\\)';\n $pattern = '/(' .\n '(@import\\s*[\\'\"]' . $url_pattern . '[\\'\"])' .\n '|(@import\\s*' . $urlfunc_pattern . ')' .\n '|(' . $urlfunc_pattern . ')' . ')/iu';\n\n if (!preg_match_all($pattern, $text, $matches)) {\n return $urls;\n }\n\n // @import '...'\n // @import \"...\"\n foreach ($matches[3] as $match) {\n if (!empty($match)) {\n $urls['import'][] = preg_replace('/\\\\\\\\(.)/u', '\\\\1', $match);\n }\n }\n\n // @import url(...)\n // @import url('...')\n // @import url(\"...\")\n foreach ($matches[7] as $match) {\n if (!empty($match)) {\n $urls['import'][] = preg_replace('/\\\\\\\\(.)/u', '\\\\1', $match);\n }\n }\n\n // url(...)\n // url('...')\n // url(\"...\")\n foreach ($matches[11] as $match) {\n if (!empty($match)) {\n $urls['property'][] = preg_replace('/\\\\\\\\(.)/u', '\\\\1', $match);\n }\n }\n\n return $urls;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associate the cart item with the given rowId with the given model. | public function associate($rowId, $model)
{
if (
is_string($model) === true &&
class_exists($model) === false
) {
throw new UnknownModelException("The supplied model {$model} does not exist.");
}
$cartItem = $this->get($rowId);
$cartItem->associate($model);
$content = $this->getContent();
$content->put($cartItem->rowId, $cartItem);
$this->session->put($this->instance, $this->toArray());
} | [
"public function associate($rowId, $model)\n {\n if (is_string($model) AND !class_exists($model)) {\n throw new UnknownModelException(\"The supplied model {$model} does not exist.\");\n }\n\n $cartItem = $this->get($rowId);\n\n $cartItem->associate($model);\n\n $content = $this->getContent();\n\n $content->put($cartItem->rowId, $cartItem);\n\n $this->putSession('content', $content);\n }",
"public function associate($rowId, $model)\n {\n if (is_string($model) && !class_exists($model)) {\n throw new UnknownModelException(\"The supplied model {$model} does not exist.\");\n }\n\n $cartItem = $this->get($rowId);\n\n $cartItem->associate($model);\n\n $content = $this->getContent();\n\n $content->put($cartItem->rowId, $cartItem);\n\n $this->putSession('content', $content);\n }",
"public function moveToCart($rowId)\n {\n $item = Cart::instance('saveforlater')->get($rowId);\n Cart::instance('saveforlater')->remove($rowId);\n Cart::instance('cart')->add($item->id,$item->name,1,$item->price)->associate('App\\Models\\Product');\n $this->emitTo('cart-count-component','refreshComponent');\n }",
"public function associate($model): CartItem;",
"public function associate($model): CartItem\n {\n $this->associatedModel = is_string($model) ? $model : get_class($model);\n\n return $this;\n }",
"public function addCrmProductRow(int $id, int $productId, float $price, float $quantity, string $xmlId): void\n\t{\n\t\t$this->crmProductRows[$id] = new Item($id, $productId, $price, $quantity, $xmlId);\n\t}",
"public function updateCartItem($id, $CartItemData);",
"public function addCartId($cart_id);",
"public function update($rowId, $qty)\n {\n $cartItem = $this->get($rowId);\n\n $this->fireEvent('updating', $cartItem);\n\n if ($qty instanceof Buyable) {\n $cartItem->updateFromBuyable($qty);\n }\n elseif (is_array($qty)) {\n $cartItem->updateFromArray($qty);\n }\n else {\n $cartItem->qty = $qty;\n }\n\n $content = $this->getContent();\n\n if ($rowId !== $cartItem->rowId) {\n $content->pull($rowId);\n\n if ($content->has($cartItem->rowId)) {\n $existingCartItem = $this->get($cartItem->rowId);\n $cartItem->setQuantity($existingCartItem->qty + $cartItem->qty);\n }\n }\n\n if ($cartItem->qty <= 0) {\n $this->remove($cartItem->rowId);\n\n return $cartItem->rowId;\n }\n else {\n $content->put($cartItem->rowId, $cartItem);\n }\n\n $this->fireEvent('updated', $cartItem);\n\n $this->putSession('content', $content);\n\n return $cartItem;\n }",
"public function associate_order_item_to_cart_item( $item_id, $values, $cart_item_key ) {\n\t\t$this->cart_item_to_order_item[ $cart_item_key ] = $item_id;\n\t}",
"public function fetchItemProduct(Model $model)\n {\n $model->product = $this->mapper->find($model->product_id, $this->product);\n }",
"public function addOneToCart() {\n $idProduct = Tools::getValue('id_product');\n $idProductAttribute = Tools::getValue('id_product_attribute');\n $qty = Tools::getValue('qty');\n \n $this->updateProductInCart($idProduct, $idProductAttribute, $qty);\n\n $this->indexFullListProduct();\n }",
"function insert_database_item_to_cart($item_id = 0)\r\n\t{\r\n\t\t$this->load->model('demo_cart_model');\r\n\t\t\r\n\t\t$this->demo_cart_model->demo_insert_database_item_to_cart($item_id);\r\n\t\t\r\n\t\tredirect('standard_library/view_cart');\t\t\r\n\t}",
"public function updateCartItem($id, $CartItemData) {\n $CartItem = ItemCart::find($id);\n $CartItem->model_type = $CartItemData->model_type;\n $CartItem->model_id = $CartItemData->model_id;\n $CartItem->name = $CartItemData->name;\n $CartItem->price = $CartItemData->price;\n $CartItem->image = $CartItemData->image;\n $CartItem->quantity = $CartItem->quantity;\n $CartItem->update();\n }",
"protected function associateExisting($model)\n {\n // Get existing embedded documents.\n $records = $this->getEmbedded();\n\n $primaryKey = $this->related->getKeyName();\n\n $key = $model->getKey();\n\n // Replace the document in the parent model.\n foreach ($records as &$record)\n {\n if ($record[$primaryKey] == $key)\n {\n $record = $model->getAttributes();\n break;\n }\n }\n\n $this->setEmbedded($records);\n }",
"public function addCartItem()\r\n\t\t{\r\n\t\t\tif(isset($_GET['pid'])) {\r\n\t\t\t\r\n\t\t\t\t$product_id = $_GET['pid'];\r\n\t\t\t\t\r\n\t\t\t\t//check that product ID is valid number\r\n\t\t\t\tif(!is_numeric($product_id)) {\r\n\t\t\t\t\techo \"Invalid product ID\";\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$productData = $this->store_m->getSingleProduct($product_id);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $product_id,\r\n\t\t\t\t\t'qty' => '1',\r\n\t\t\t\t\t'price' => $productData['0']['price'],\r\n\t\t\t\t\t'name' => $productData['0']['name'],\r\n\t\t\t\t\t'options' => array('sku' => $productData['0']['code'], 'photo' => $productData['0']['photo'])\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$this->cart->insert($data);\r\n\t\t\t\tredirect('store', 'refresh');\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo \"No Product Found.\";\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}",
"public function save(ItemCart $itemCart) {\r\n $userId = $itemCart->getUser()->getId(); \r\n $itemId = $itemCart->getItem()->getId();\r\n $exist = $this->existItemCart($userId, $itemId);\r\n $itemCartData = array(\r\n 'qte' => $itemCart->getQte()\r\n );\r\n if($exist)\r\n $this->getDb()->update('line_cart', $itemCartData, array('item_id' => $itemId, 'user_id' => $userId));\r\n else {\r\n $itemCartData['user_id']= $userId;\r\n $itemCartData['item_id']= $itemId;\r\n $this->getDb()->insert('line_cart', $itemCartData);\r\n }\r\n \r\n }",
"public function switchToSaveForLater($rowID)\n {\n $item = Cart::get($rowID);\n\n Cart::remove($rowID);\n\n $duplicates = Cart::instance('saveForLater')->search(function ($cartItem, $rowId) use ($rowID) {\n dd($rowId);\n return $rowId === $rowID;\n });\n\n if ($duplicates->isNotEmpty()) {\n return redirect()->route('cart.index')->with('success_message', 'Item is already Saved For Later!');\n }\n\n Cart::instance('saveForLater')->add($item->id, $item->name, 1, $item->price)\n ->associate(Product::class);\n\n return redirect()->route('cart.index')->with('success_message', 'Item has been Saved For Later!');\n }",
"public function actionPlusCartItem($id)\n {\n $item = $this->findOrderItemModel($id);\n $item->count += 1;\n $item->save();\n \n return $this->redirect(['/cart']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Total time spent on all queries and connections | public function time () {
$time = 0;
/**
* @var DB\_Abstract $c
*/
foreach ($this->connections[self::CONNECTIONS_MASTER] as $c) {
$time += $c->connecting_time() + $c->time();
}
foreach ($this->connections[self::CONNECTIONS_MIRROR] as $c) {
$time += $c->connecting_time() + $c->time();
}
return $time;
} | [
"function time_queries () {\n\t\t$t_count = count( $this->queries_array );\n\t\t$t_total = 0;\n\t\tfor ( $i = 0; $i < $t_count; $i++ ) {\n\t\t\t$t_total += $this->queries_array[$i][1];\n\t\t}\n\t\treturn $t_total;\n\t}",
"public static function totalQueryTime()\n\t\t{\n\t\t\treturn self::$totalQueryTime;\n\t\t}",
"public function getTime()\n {\n $time = 0;\n foreach ($this->getQueries() as $query) {\n $time += $query['time'];\n }\n\n return $time;\n }",
"public function currentExecutionTime()\n\t{\n\t\t$time = 0;\n\t\tforeach ($this->log->getQueries() as $query)\n\t\t{\n\t\t\t// time is array key 2 in this numerically indexed array\n\t\t\t$time += $query[2];\n\t\t}\n\t\treturn $time;\n\t}",
"function total_queries()\n\t{\n\t\treturn $this->query_count;\n\t}",
"public function getTotalQueries();",
"public function getTotalQueries() : int\n {\n return 1;\n }",
"public function total_queries()\n\t{\n\t\treturn $this->query_count;\n\t}",
"public function getQueryExecutionTime()\n\t{\n\t\treturn round($this->_executionTime * 1000, 3);\n\t}",
"public function bench(){\n\t\t// http://54.72.119.149/bench/50000/nocache/1\n\t\t// http://54.72.119.149/bench/50000/memcached/1\n\t\t// http://54.72.119.149/bench/50000/memcached/10\n\n\t\tif(isset($this->request->params['type'])){\n\t\t\t$type = $this->request->params['type'];\n\t\t} else {\n\t\t\t$type = 'nocache';\n\t\t}\n\n\t\tif(isset($this->request->params['iterations'])){\n\t\t\t$iterations = $this->request->params['iterations'];\n\t\t} else {\n\t\t\t$iterations = 1000;\n\t\t}\n\n\t\tif(isset($this->request->params['cacheduration'])){\n\t\t\t$cacheduration = $this->request->params['cacheduration'];\n\t\t\tcache::config('defaultcache', array('duration' => $cacheduration));\n\t\t}\n\n\t\t$startTime = microtime(true);\n\t\tfor($i=0; $i<=$iterations; $i++){\n\t\t\tif($type == 'nocache'){\n\t\t\t\t$output = $this->Patient->find('all');\n\t\t\t} elseif($type == 'memcached'){\n\t\t\t\t$output = $this->Patient->find('all', array(\n\t\t\t\t\t'cache' => 'patient_all',\n\t\t\t\t\t'cacheConfig' => 'defaultcache',\n\t\t\t\t\t// 'cacheDebug' => true\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\t$endTime = microtime(true);\n\n\t\t$timeElapsed = ($endTime - $startTime);\n\t\t$avgTimePerQueryMS = ($timeElapsed / $iterations) * 1000;\n\t\t$queryLog = $this->Patient->getDataSource()->getLog();\n\n\t\tpr($iterations . ' queries took ' . $timeElapsed. ' sec');\n\t\tpr('Query average: ' . $avgTimePerQueryMS . ' ms');\n\t\tpr('Queries ran on DB: '. $queryLog['count']);\n\t}",
"public function getTotalQueries()\n\t{\n\t\treturn (int) static::$queries->count();\n\t}",
"public function getNumQueries() {\n\t\t$n = 0;\n\t\tforeach($this->connections as $c) {\n\t\t\t$n += $c->getNumQueries();\n\t\t}\n\t\treturn $n;\n\t}",
"public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }",
"private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }",
"function _timeStats() {\n\t\t$out = 'Time taken by tests (in seconds): ' . $this->_timeDuration . \"\\n\";\n\t\tif (function_exists('memory_get_peak_usage')) {\n\t\t\t$out .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . \"\\n\";\n\t\t}\n\t\treturn $out;\n\t}",
"public function getTime()\n {\n if (!$this->getRequestcount()) return 0;\n \n $time = 0;\n\n foreach ($this->data['calls'] as $request) {\n $time += $request->time;\n }\n\n return $time;\n }",
"public function getTotalTime(){\n if(!$this->benchMode){\n return false;\n }\n return $this->lastTime - $this->initTime;\n }",
"public function slowLogTime()\n {\n return $this->repository->get('sql_logger.slow_queries.min_exec_time');\n }",
"public function querytime(){\n\t\tif(!$this->_querytime)\n\t\t\t$this->_querytime = $this->_querytime_end - $this->_querytime_start;\n\t\treturn $this->_querytime;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the application registration form. | public function showRegistrationForm()
{
// return view('auth.register');
} | [
"public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }",
"public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('auth.register');\n }",
"public function showRegistrationForm()\n\t{\n\t\treturn view('auth.register');\n\t}",
"public function showRegistrationForm()\n {\n // if registration is closed, deny access\n if (!config('backpack.base.registration_open')) {\n abort(403, trans('backpack::base.registration_closed'));\n }\n\n $this->data['title'] = trans('backpack::base.register'); // set the page title\n\n return view('backpack::auth.register', $this->data);\n }",
"public function showRegistrationForm()\n {\n // if registration is closed, deny access\n if (! config('backpack.base.registration_open')) {\n abort(403, trans('backpack::base.registration_closed'));\n }\n\n $this->data['title'] = trans('backpack::base.register'); // set the page title\n\n return view('backpack.auth.register', $this->data);\n }",
"public function showRegistrationForm()\n {\n return view('admin.auth.register');\n }",
"public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }",
"public function registerForm() {\n print $this->render(registerForm);\n }",
"public function showRegistrationForm()\n {\n $info=setting('info');\n\n return view('auth.patient.register',compact('info'));\n }",
"public function showRegistrationForm()\n {\n if (!empty($_SESSION['LoginStatus']))\n header('Location: /account');\n else\n View::renderTemplate('register.html');\n }",
"public function registerFormAction()\n {\n $this->templater->show($this->controllName, 'RegisterForm', null);\n }",
"private function showPageRegistration()\n {\n if ($this->mesaj) {\n echo $this->mesaj . \"<br/><br/>\";\n }\n\n echo '<h2>Registration</h2>';\n\n echo '<form method=\"post\" action=\"' . $_SERVER['SCRIPT_NAME'] . '?action=register\" name=\"registerform\">';\n echo '<label for=\"login_input_username\">Username (only letters and numbers, 2 to 64 characters)</label>';\n echo '<input id=\"login_input_username\" type=\"text\" pattern=\"[a-zA-Z0-9]{2,64}\" name=\"user_name\" required />';\n echo '<label for=\"login_input_email\">User\\'s email</label>';\n echo '<input id=\"login_input_email\" type=\"email\" name=\"user_email\" required />';\n echo '<label for=\"login_input_password_new\">Password (min. 6 characters)</label>';\n echo '<input id=\"login_input_password_new\" class=\"login_input\" type=\"password\" name=\"user_password_new\" pattern=\".{6,}\" required autocomplete=\"off\" />';\n echo '<label for=\"login_input_password_repeat\">Repeat password</label>';\n echo '<input id=\"login_input_password_repeat\" class=\"login_input\" type=\"password\" name=\"user_password_repeat\" pattern=\".{6,}\" required autocomplete=\"off\" />';\n echo '<input type=\"submit\" name=\"register\" value=\"Register\" />';\n echo '</form>';\n\n echo '<a href=\"' . $_SERVER['SCRIPT_NAME'] . '\">Homepage</a>';\n }",
"public function showAdminRegisterForm()\n {\n return view('admin.register');\n }",
"protected function showRegistrationView()\n {\n return view('auth.register');\n }",
"public function indexAction() {\n\t\t$form = $this->_getRegistrationForm();\n\t\t$this->view->form = $form;\n\t}",
"private function register(){\n $this->setTitle(\"Registrace\");\n $this->setHeader(\"Registrace\");\n $this->setPageContent($this->regForm());\n }",
"private function showPageRegistration()\n {\n if ($this->feedback) {\n echo $this->feedback . \"<br/><br/>\";\n }\n echo '<div class=\"container\"><div class=\"row\"><div class=\"col-md-6 col-md-offset-3 text-center\">';\n\n echo '<h2>Registrar usuario</h2>';\n\n echo '<form method=\"post\" action=\"' . $_SERVER['SCRIPT_NAME'] . '?action=register\" name=\"registerform\" class=\"form-custom2\">';\n echo '<div class=\"form-group\">';\n echo '<label for=\"login_input_username\">Username (solo letras y numeros, de 2 a 64 caracteres)</label>';\n echo '<input id=\"login_input_username\" type=\"text\" class=\"form-control\" pattern=\"[a-zA-Z0-9]{2,64}\" name=\"user_name\" required />';\n echo '</div>';\n echo '<div class=\"form-group\">';\n echo '<label for=\"login_input_email\">Correo electronico (El de la empresa xfa :))</label>';\n echo '<input id=\"login_input_email\" type=\"email\" class=\"form-control\" name=\"user_email\" required />';\n echo '</div>';\n echo '<div class=\"form-group\">';\n echo '<label for=\"login_input_password_new\">Password (min. 6 caracteres)</label>';\n echo '<input id=\"login_input_password_new\" class=\"login_input form-control\" type=\"password\" name=\"user_password_new\" pattern=\".{6,}\" required autocomplete=\"off\" />';\n echo '</div>';\n echo '<div class=\"form-group\">';\n echo '<label for=\"login_input_password_repeat\">Repetir password</label>';\n echo '<input id=\"login_input_password_repeat\" class=\"login_input form-control\" type=\"password\" name=\"user_password_repeat\" pattern=\".{6,}\" required autocomplete=\"off\" />';\n echo '</div>';\n echo '<div class=\"form-group\">';\n echo '<input type=\"submit\" name=\"register\" class=\"btn btn-success\" value=\"Registrar\" />';\n echo '</div>';\n echo '</form>';\n\n echo '<a href=\"' . $_SERVER['SCRIPT_NAME'] . '\"><i class=\"fa fa-home\"></i> Home</a>';\n\n echo '</div></div></div>';\n }",
"public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'MyGallery';\n $view->heading = 'Registration';\n $view->display();\n }",
"public function showPassangerRegistrationForm()\n {\n return view('passangers.register');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get cource by courseID | function get_cource($courseID)
{
return $this->db->get_where('cource',array('courseID'=>$courseID))->row_array();
} | [
"function getCourse($id) {\n $st = $this->pdo->prepare('SELECT * FROM courses WHERE id=:id');\n $st->bindParam(':id', $id);\n $st->execute();\n return $st->fetch();\n }",
"function get_course($course_id)\n {\n return $this->db->get_where('course',array('course_id'=>$course_id))->row_array();\n }",
"public function retrieveCourseByID($course_id){\n $conn_manager = new ConnectionManager();\n $pdo = $conn_manager->getConnection();\n \n $sql = \"select * from course where course_id=:course_id\";\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":course_id\",$course_id,PDO::PARAM_STR);\n $stmt->execute();\n \n $course = null;\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n if($row = $stmt->fetch()){\n $course = new Course($row[\"course_id\"],$row[\"course_name\"],$row[\"description\"] );\n }\n \n $stmt = null;\n $pdo = null;\n return $course;\n }",
"function getOneCourseById($id) {\n\t\t$SQL=\"SELECT * FROM courses WHERE id = '$id'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t\t$result = array();\n\t\t$count = 0;\n\n\t\twhile($rs = $this->db->nextRecord())\n\t\t{\n\t\t\t$course = new Course();\n\t\t\t$course->setId($rs['id']);\n\t\t\t$course->setCourse_name($rs['course_name']);\n\t\t\t$course->setCode($rs['code']);\n\t\t\t$course->setSection_name($rs['section_name']);\n\t\t\t$course->setIs_deleted($rs['is_deleted']);\n\t\t\t$course->setCreated_at($rs['created_at']);\n\t\t\t$course->setUpdated_at($rs['updated_at']);\n\t\t\t$result[$count++] = $course;\n\t\t}\n\n\t\t$this->db->closeRs();\n\t\tif(count($result) > 0 ){\n\t\t\treturn $result[0];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getCourse() {\n \treturn $this->apcSession->getCourseLookupSession()->getCourse($this->getCourseId());\n\t}",
"function getCourseById($courseId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Course.name, Course.description, Course.difficulty, Course.popularity, Course.author, Course.creationDate, Course.image, Category.name AS category \n\t\tFROM Course INNER JOIN Category ON Course.CategoryId=Category.id\n\t\tWHERE Course.id='\". $courseId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_COURSE_BY_ID\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}",
"public function getCourse()\n {\n return Course::where('slug', $this->courseSlug())\n ->first();\n }",
"public static function LoadById($course_id)\n {\n \t$result = &get_instance()->db->get_where(\"Courses\", array(\"course_id\" => $course_id));\n \t$result = $result->result();\n \treturn count($result) != 0 ? Courses_model::LoadWithData($result[0]) : null;\n }",
"function get_course_from_crn($course_rn, $semester_id)\n{\n\tglobal $conn;\n\t$stmt = $conn->prepare('SELECT tbl_courses.course_code, course_name\n\t\tFROM tbl_classes, tbl_courses WHERE course_rn = :crn AND\n\t\tsemester_id = :semester AND tbl_classes.course_code = tbl_courses.course_code');\n\t$stmt->bindValue(':crn', $course_rn);\n\t$stmt->bindValue(':semester', $semester_id);\n\treturn execute_fetch_one($stmt);\n}",
"public function get_by_cou_and_cat($id=NULL, $course_id){\n if( $id!=NULL){ \n $category = $this->get_by(array(\n 'category_id' => $id,\n 'course_id' => $course_id,\n ), false);\n return($category);\n }\n return false; \n }",
"public function getCourseById($id) {\n\n $this->db->select('*');\n $this->db->from('courses');\n $this->db->where('id', $id);\n $quary_result=$this->db->get();\n $result=$quary_result->row();\n return $result;\n }",
"function moodle_get_course($clsid) {\n global $CURMAN;\n\n return $CURMAN->db->get_field(CLSMDLTABLE, 'moodlecourseid', 'classid', $clsid);\n}",
"function course_load($cid) {\n\tglobal $db;\n\t$courses = $db->array_load('COURSE','Course_ID',$cid);\n\tsort($courses);\n\treturn isset($courses[0]) ? $courses[0] : null;\n}",
"function get_course()\r\n {\r\n return $this->course;\r\n }",
"public function getCourseId ()\n {\n return $this->course_id;\n }",
"protected function load_course() {\n global $DB;\n\n $this->_course = $DB->get_record('course', array('id' => $this->_cm->course), '*', MUST_EXIST);\n }",
"function tadc_courses_from_tadc_course_id($courseId)\n{\n global $DB;\n $tadc_cfg = get_config('tadc');\n $courseId = str_replace('%COURSE_CODE%', $courseId, $tadc_cfg->course_code_regex);\n $rel = ($tadc_cfg->course_code_regex === '%COURSE_CODE%' ? '=' : 'REGEXP');\n return $DB->get_records_select('course', $tadc_cfg->course_code_field . \" $rel ?\", array($courseId));\n}",
"protected function magic_get_course() {\n if (is_null($this->_course)) {\n $this->load_course();\n }\n return $this->_course;\n }",
"public function getCourseInfo($ic_id){\r\n \r\n $this->query = \"SELECT scr.ic_id,\r\n icr.ic_id,\r\n icr.course_overview,\r\n icr.course_type,\r\n icr.IDNUMBER,\r\n e.LASTNAME, e.FIRSTNAME,\r\n e.IDNUMBER, \r\n c.course_id,\r\n c.course_desc\r\n FROM studentcourserecord scr\r\n INNER JOIN instructorcourserecord icr\r\n ON scr.ic_id=?\r\n AND icr.ic_id=scr.ic_id\r\n INNER JOIN course c\r\n ON c.course_id=icr.course_id\r\n INNER JOIN employees e\r\n ON e.IDNUMBER=icr.IDNUMBER\";\r\n\r\n return $this->db_connector->select($this->query,array($ic_id))->fetch();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fin de metodo Obtener el ultimo codigo del tipo tratamiento | public function obtenerUltimoCodigoTipoTratamiento() {
$resultado = mysqli_query($this->connection, "select max(idTipoTratamiento) as ultimoCodigoTipoTratamiento from tbtipotratamiento ");
$ultimoCodigoTipoTratamiento = 0;
while ($filaTemporal = mysqli_fetch_array($resultado)) {
$ultimoCodigoTipoTratamiento = $filaTemporal['ultimoCodigoTipoTratamiento'];
}
return $ultimoCodigoTipoTratamiento;
} | [
"public function obtenerUltimoCodigoTipoResiduo(){\n //Insertar provincia se invoca al metodo en datos\n $this->tipoResiduoAccesoDatos->conectar();\n $resultado = $this->tipoResiduoAccesoDatos->obtenerUltimoCodigoTipoResiduo();\n $this->tipoResiduoAccesoDatos->cerrarConexion();\n return $resultado;\n }",
"public function getCod();",
"public function obtenerUltimoCodigoGestor(){\n //Insertar provincia se invoca al metodo en datos\n $this->gestorAccesoDatos->conectar();\n $resultado = $this->gestorAccesoDatos->obtenerUltimoCodigoGestor();\n $this->gestorAccesoDatos->cerrarConexion();\n return $resultado;\n }",
"public function CodigoPedido()\r\n\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli=$objetoBD->cadenaConexion();\r\n\r\n $consulta=\"SELECT max(ped_id) as maximo FROM pedidos \";\r\n $resultado=$mysqli->query($consulta);\r\n\r\n $maximo=\"\";\r\n while($fila=mysqli_fetch_object($resultado)){\r\n\r\n $maximo=$fila->maximo;\r\n\r\n\r\n }\r\n return $maximo+1;\r\n\r\n }",
"function getId_tipo_enc()\n {\n if (!isset($this->iid_tipo_enc) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_tipo_enc;\n }",
"public function generarCodDetalle(){\r\n $pdo = Database::connect();\r\n $sql = 'select max(COD_DET_FACT) as cod from tab_fac_det_facturas';\r\n $consulta = $pdo->prepare($sql);\r\n $consulta->execute();\r\n $res = $consulta->fetch(PDO::FETCH_ASSOC);\r\n $nuevoCod = '';\r\n if ($res['cod'] == NULL) {\r\n $nuevoCod = 'DET-00001';\r\n } else {\r\n $rest = ((substr($res['cod'], -5)) + 1) . ''; // Separacion de la parte numerica DET-00023 --> 23\r\n // Ciclo que completa el codigo segun lo retornado para completar los 9 caracteres \r\n // DET-000 --> 67, DET-00 --> 786\r\n if ($rest > 1 && $rest <= 9) {\r\n $nuevoCod = 'DET-0000' . $rest;\r\n } else {\r\n if ($rest >= 10 && $rest <= 99) {\r\n $nuevoCod = 'DET-000' . $rest;\r\n } else {\r\n if ($rest >= 100 && $rest <= 999) {\r\n $nuevoCod = 'DET-00' . $rest;\r\n } else {\r\n if($rest >= 1000 && $rest <= 9999){\r\n $nuevoCod = 'DET-0' . $rest;\r\n }else{\r\n $nuevoCod = 'DET-' . $rest;\r\n }\r\n \r\n }\r\n }\r\n }\r\n }\r\n Database::disconnect();\r\n return $nuevoCod; // RETORNO DEL NUEVO CODIGO DE DETALLE FACTURA\r\n }",
"public function getCodigoContratoGerenciaProyecto(){\n\t\t$codigo = 'SNC';\n\t\t$codigo .= '-'.str_pad($this->idContratoGerencia['referencia']->idContrato['referencia']->nroContrato['valor'], 3, '0', STR_PAD_LEFT);\n\t\t$codigo .= '-'.str_pad($this->nroContratoGerenciaProyecto['valor'], 4, '0', STR_PAD_LEFT);\n\t\t$codigo .= '-'.substr(str_replace('-', '', convertDateEsToDb($this->fechaInicio['valor'])), -6);\n\t\treturn $codigo;\n\t}",
"public function getCodClinica()\n {\n $this->setTabelaIntermediaria(\"tClinicaMedico\");\n $this->setRelacionamento(\"tClinica\");\n return $this->getModel()->getValor(\"codClinica\");\n }",
"public function getCodIntegracao()\n\t{\n\t\treturn $this->cod_integracao;\n\t}",
"public function getCodRepresentante()\n {\n return $this->codRepresentante;\n }",
"public function obtenerCodigo(){\n\t\t\treturn $this->codigo;\n\n\t\t}",
"public function getCodciu(){\n\t\treturn $this->codciu;\n\t}",
"public function generarCodigo($numero_serie)\n {\n // contrimos la caena para contar la longitud\n $cadena = \"\" . '' . $numero_serie;\n //econtramos la longitus\n $longitud_indice = strlen($cadena);\n //restamos los caracteres del incide a la longitud de caracteres cero\n $indice = substr(\"0000000000\", $longitud_indice);\n //concatenamos el indice y el valor del id para obtener el codigo de la orden\n $codigo_orden = $indice . '' . $cadena;\n return $codigo_orden;\n\n }",
"public function getCodClinica()\n {\n $this->setTabelaIntermediaria(\"tClinicaPaciente\");\n $this->setRelacionamento(\"tClinica\");\n return $this->getModel()->getValor(\"codClinica\");\n }",
"public function getCod_tipo_entidad()\n {\n return $this->cod_tipo_entidad;\n }",
"public function getCod_aut()\n {\n return $this->cod_aut;\n }",
"public function getCodTipoProblema()\n {\n return $this->cod_tipo_problema;\n }",
"public function getCod_atributo()\n {\n return $this->cod_atributo;\n }",
"public function getCod_tipo_cliente()\n {\n return $this->cod_tipo_cliente;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a commodity to the basket. | public function add(Commodity $commodity, $quantity = 1)
{
if (!is_numeric($quantity))
{
throw new InvalidArgumentException("Quantity must be numerical.");
}
// The following is a powerful language construct called
// "The terninary operator".
// Use existing CommodityStore or create a new one with 0
// quantity. (If quantity isn't 0, then you'll have 1 extra later.
$store = isset($this->commoditiesQueue[$commodity->name])
? $this->commoditiesQueue[$commodity->name]
: new CommodityStore($commodity, 0);
$store->quantity += $quantity;
$this->commoditiesQueue[$commodity->name] = $store;
} | [
"public function add(): void\n {\n $qty = $this->currentQty + (int) $this->qty;\n\n if ($qty < 1) {\n return;\n }\n\n basket()->add($this->productId, $qty);\n $this->qty = 1;\n $this->emit('basketUpdated');\n }",
"public function add(): void\n {\n $qty = $this->currentQty + $this->qty;\n\n if ($qty < 1) {\n return;\n }\n\n basket()->add($this->productId, $qty);\n\n $this->qty =1;\n \n $this->emit('basketUpdated');\n }",
"public function addProductToBasket($productid, $quantity);",
"public function add($fruit) {\r\n \r\n // We get the number of $fruit in the basket\r\n // +1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty + 1;\r\n }",
"public function addOneToCart() {\n $idProduct = Tools::getValue('id_product');\n $idProductAttribute = Tools::getValue('id_product_attribute');\n $qty = Tools::getValue('qty');\n \n $this->updateProductInCart($idProduct, $idProductAttribute, $qty);\n\n $this->indexFullListProduct();\n }",
"public function add(PhysicalQuantity $quantity);",
"public function addAction() {\n $this->layout('layout/json');\n\n # Get Data of Item that should be added\n $iItemID = $_REQUEST['shop_item_id'];\n $sItemType = $_REQUEST['shop_item_type'];\n $fItemAmount = $_REQUEST['shop_item_amount'];\n $fCustomPrice = $_REQUEST['shop_item_customprice'];\n $sItemComment = $_REQUEST['shop_item_comment'];\n $sShopSessionID = $_REQUEST['shop_session_id'];\n $iRefID = isset($_REQUEST['shop_item_ref_idfs']) ? (int)$_REQUEST['shop_item_ref_idfs'] : 0;\n $sRefType = isset($_REQUEST['shop_item_ref_type']) ? $_REQUEST['shop_item_ref_type'] : 'none';\n\n # Check if there is already an open basket for this session\n $oBasket = false;\n try {\n $oBasketExists = $this->tryToGetBasket($sShopSessionID);\n if(is_object($oBasketExists)) {\n if ($oBasketExists->shop_session_id != $sShopSessionID) {\n throw new \\RuntimeException('Not really the same basket...');\n }\n # yes there is\n $oBasket = $oBasketExists;\n var_dump($oBasket);\n } else {\n throw new \\RuntimeException('Not valid basket');\n }\n } catch(\\RuntimeException $e) {\n # there is no basket - lets create one\n\n # Get State Tag\n $oStateTag = CoreEntityController::$aCoreTables['core-tag']->select(['tag_key' => 'state']);\n if(count($oStateTag) > 0) {\n $oStateTag = $oStateTag->current();\n\n # Get Basket \"new\" Entity State Tag\n $oNewState = CoreEntityController::$aCoreTables['core-entity-tag']->select([\n 'entity_form_idfs' => 'basket-single',\n 'tag_idfs' => $oStateTag->Tag_ID,\n 'tag_key' => 'new',\n ]);\n\n # only proceed of we have state tag present\n if(count($oNewState) > 0) {\n $oNewState = $oNewState->current();\n\n # Generate new open basket\n $oBasket = $this->oTableGateway->generateNew();\n $aBasketData = [\n 'state_idfs' => $oNewState->Entitytag_ID,\n 'job_idfs' => 0,\n 'contact_idfs' => 0,\n 'deliverymethod_idfs' => 0,\n 'paymentmethod_idfs' => 0,\n 'label' => 'New Basket',\n 'comment' => '',\n 'payment_id' => '',\n 'payment_session_id' => '',\n 'shop_session_id' => $sShopSessionID,\n 'created_by' => 1,\n 'created_date' => date('Y-m-d H:i:s',time()),\n 'modified_by' => 1,\n 'modified_date' => date('Y-m-d H:i:s',time()),\n ];\n\n $oBasket->exchangeArray($aBasketData);\n\n # Save Basket to DB\n $iBasketID = $this->oTableGateway->saveSingle($oBasket);\n $oBasket = $this->oTableGateway->getSingle($iBasketID);\n }\n }\n }\n\n # Only proceed if basket is present\n if($oBasket) {\n $oBasketPosTbl = CoreEntityController::$oServiceManager->get(PositionTable::class);\n # if there is no comment - check if we already have to same article in basket\n $bGenNewPos = true;\n if($sItemComment == '') {\n $oSameInBasket = $oBasketPosTbl->fetchAll(false,[\n 'basket_idfs' => $oBasket->getID(),\n 'article_idfs' => $iItemID,\n 'comment' => '',\n 'ref_idfs' => $iRefID,\n 'ref_type' => $sRefType,\n ]);\n if(count($oSameInBasket) > 0) {\n $bGenNewPos = false;\n foreach($oSameInBasket as $oSame) {\n $iNewAmount = $oSame->amount+(float)$fItemAmount;\n $oBasketPosTbl->updateAttribute('amount',$iNewAmount,'Position_ID',$oSame->getID());\n\n $this->addBasketStep($oBasket,'basket_updatepos','Update Amount +'.$fItemAmount.' for position '.$oSame->getID(),'Before '.$oSame->amount);\n break;\n }\n\n }\n }\n $sStepLabel = 'Add '.$fItemAmount.' article';\n if($bGenNewPos) {\n switch($sItemType) {\n case 'variant':\n case 'event':\n case 'article':\n try {\n $oArticleTbl = CoreEntityController::$oServiceManager->get(ArticleTable::class);\n $oVariantTbl = CoreEntityController::$oServiceManager->get(VariantTable::class);\n if($fCustomPrice == 0) {\n $oVar = $oVariantTbl->getSingle($iItemID);\n if(is_object($oVar)) {\n $fCustomPrice = $oVar->price;\n }\n $oBaseArt = $oArticleTbl->getSingle($oVar->article_idfs);\n $sStepLabel .= ' '.$oBaseArt->getLabel().': '.$oVar->getLabel();\n }\n } catch(\\RuntimeException $e) {\n # error loading tables\n }\n break;\n default:\n break;\n }\n # generate new basket position\n $oPos = $oBasketPosTbl->generateNew();\n $aPosData = [\n 'basket_idfs' => $oBasket->getID(),\n 'article_idfs' => $iItemID,\n 'article_type' => $sItemType,\n 'ref_idfs' => $iRefID,\n 'ref_type' => $sRefType,\n 'amount' => (float)$fItemAmount,\n 'price' => (float)$fCustomPrice,\n 'comment' => $sItemComment,\n 'created_by' => 1,\n 'created_date' => date('Y-m-d H:i:s', time()),\n 'modified_by' => 1,\n 'modified_date' => date('Y-m-d H:i:s', time()),\n ];\n\n # save to database\n $oPos->exchangeArray($aPosData);\n $oBasketPosTbl->saveSingle($oPos);\n\n $this->addBasketStep($oBasket,'basket_additem',$sStepLabel,$sItemComment);\n }\n }\n\n # json response for api\n $aResponse = ['state'=>'success','message'=> $fItemAmount.' items added to basket','oBasket'=>$oBasket];\n echo json_encode($aResponse);\n\n return false;\n }",
"public function addBasket(Entity\\BasketInterface $basket);",
"public function addStock(int $productId, int $additionalStock)\r\n {\r\n $this->stock[$productId] += $additionalStock;\r\n }",
"public function addQuantity($quantity);",
"public function add( $item_id, $quantity = 1, array $data = NULL );",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function addToCart(): void\n {\n Cart::add($this->product->id, $this->product->name, $this->product->getRawOriginal('unit_price'), $this->quantity);\n $this->emit('productAddedToCart');\n }",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function add(Price $other);",
"public function add(SellableInterface $sellable, $unitPrice, $quantity = 1);",
"private function addToCart() {\n\t}",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n\n $cart->addProduct($product, $params);\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n //tobihille: CHANGE:\n // if IE and error > redirect to cart to show messages\n // user can go back in browser after reading message\n // if we don't do this, user does not get message \"quantity not sufficent\"\n $option_enabled = Mage::getStoreConfig('system/aoe_static/redirect_ie_cart_on_error');\n if ( stripos(Mage::app()->getRequest()->getServer('HTTP_USER_AGENT'), 'Trident') !== false &&\n !empty($option_enabled)\n )\n {\n $this->getResponse()->setRedirect( Mage::helper('checkout/cart')->getCartUrl() );\n }\n else\n {\n $this->getResponse()->setRedirect($url);\n }\n //tobihille: ENDCHANGE\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function testAddBadQty()\n {\n $row = $this->cart->add(1, 'foo', 0, 100.00);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns number of days since a given date | function days_since($date)
{
$ret = 0;
$ts1 = strtotime($date);
$ts2 = time();
if ($ts1 > $ts2)
{
list($ts1,$ts2) = array($ts2,$ts1);
/*
$tmp = $ts1;
$ts1 = $ts2;
$ts2 = $tmp;
*/
}
$Yd = date('Y',$ts2) - date('Y',$ts1);
if ($Yd == 0)
{
// dates are both in the same year
$ret = date('z', $ts2) - date('z', $ts1);
}
else
{
$ret = date('z',strtotime(sprintf('%d-12-31',date('Y',$ts1)))) - date('z', $ts1);
for ($y = date('Y',$ts1) + 1; $y < date('Y',$ts2); $y++)
{
$ret += date('z',strtotime(sprintf('%d-12-31',$y))) + 1;
}
$ret += date('z', $ts2) + 1;
}
return $ret;
} | [
"private function days_diff_from_now($date)\n {\n $now = time();\n $date_time = strtotime($date);\n $date_diff = $now - $date_time;\n\n return round($date_diff / (60 * 60 * 24));\n }",
"public function countDays()\n {\n return intval($this->start_date->diff($this->end_date)->format('%a')) + 1;\n }",
"function days_passed(){\n\t\t \t$prevDate = new DateTime(get_field($this->counter_date_column, $this->post_id));// Previous date\n\t\t \t$currDate = new DateTime(\"now\");\t\t// Today's date\n\t\t \t$interval = $currDate->diff($prevDate); // What's the difference between the two dates?\n\t\t\treturn (int) $interval->format(\"d\");\t// Format the date as only the number of days.\n\t\t}",
"public function CountDate($date) {\n\t\t$today = strtotime('today');\n\t\t$date = strtotime($date);\n\t\t$history = ($today - $date)/(60*60*24);\n\t\t\n\t\treturn $history;\n\t}",
"public function calculateDays(): int\n {\n $result = 0;\n $start = intval($this->_datefrom->getTimestamp());\n $end = intval($this->_dateto->getTimestamp());\n $diffinsecs = 0;\n if ($end > $start) {\n $diffinsecs = $end-$start;\n } else {\n $diffinsecs = $start-$end;\n }\n if (!empty($this->_restype)) {\n return intval($this::convertResult($diffinsecs));\n } else {\n return intval($diffinsecs/CmpDateConfig::SECSINDAY);\n }\n }",
"private function calculateDaysUntilXday(DateTime $date): int\n {\n return $this->dateDiffInDays($date, self::REAL_X_DAY);\n }",
"public function differenceInDays(): int\n {\n $this->ensureTravelDateIsSet();\n\n $days = $this->travel->y*365 + $this->travel->m* 31 + $this->travel->d;\n\n return $this->travel->invert ? $days : -$days;\n }",
"public function diff($date) {\n\t\t$diff = $this->castTo('Gregorian')->toDate()->\n\t\t\tdiff($date->castTo('Gregorian')->toDate());\n\t\treturn $diff->days;\n\t}",
"public static function dateToDays($date)\n {\n $dateOne = new \\DateTime();\n $dateOne->setDate(0, 0, 0);\n $dateTwo = new \\DateTime($date);\n $diff = $dateTwo->diff($dateOne);\n return $diff->days;\n }",
"function getHowManyDaysAgo($date)\n{\n $now = Carbon::now();\n $date = Carbon::createFromFormat('Y-m-d', $date);\n $diff = $now->diff($date);\n $days_ago = $diff->days;\n return $days_ago;\n}",
"public static function daysPassed($date1, $date2)\n\t{\n\t\t$timestamp1 = strtotime($date1);\n\t\t$timestamp2 = strtotime($date2);\n\t\t$datediff = $timestamp1 - $timestamp2;\n\t\treturn floor($datediff/(60*60*24));\n }",
"public function amountOfDays(): int\n {\n // as \\DateInterval is created by \\DateTime::diff() it is an int,\n // but psalm doesn't know this, so we cast it to silence it\n // see https://www.php.net/manual/en/class.dateinterval.php#dateinterval.props.days\n return ((int) $this->end->handle()->diff($this->start->handle())->days) + 1;\n }",
"public function amountOfDays(): int;",
"function getDifferenceDays($previousDate)\n{\n\t$date = date('Y-m-d');\t\t\t// get today's date\t\n\n\t$dateDiff = abs((strtotime($date)) - (strtotime($previousDate)));\n\t$diffDays = $dateDiff/86400; // 86400 seconds in one day\n\t$diffDays = intval($diffDays);\n\t\n\treturn $diffDays;\n}",
"public static function getNbDaysBetweenDates($date1, $date2) \n {\n $s = strtotime($date2)-strtotime($date1);\n $d = intval($s/86400)+1; \n return \"$d\";\n }",
"public function getDaysDiff() {\n $today = date('Y-m-d');\n $day1 = new DateTime($this->targetDate);\n $day2 = new DateTime($today);\n $diff = $day1->diff($day2);\n return $diff->days;\n }",
"private function countDays() {\n if($this->isValidCookieDates()) {\n $startDate = $this->frDateToEn($this->get('session')->get('startDate'));\n $endDate = $this->frDateToEn($this->get('session')->get('endDate'));\n\n return $endDate->diff($startDate)->format(\"%a\") + 1;\n }\n return null;\n }",
"private function getDaysSinceEpoch()\n {\n $DAY_IN_SECONDS = 24 * 60 * 60;\n\n return round(time() / $DAY_IN_SECONDS);\n }",
"protected function calc_days_since($arg) {\n\n\t\t$d= date(\"Y-m-d\");\n\n\t\t//work backwards from today, making sure each day is present\n\t\t$dn= 0;\n\t\t$n= count($this->datetimes['day'])-1;\n\t\twhile ($n>=0 and $dn < 30) {\n\t\t\tif ($d==$this->datetimes['day'][$n]) {\n\t\t\t\tif ($arg=='float' and isset($this->datapoints['durfloat']->day_data[$n]) and $this->datapoints['durfloat']->day_data[$n]) break;\n\t\t\t\t$n--;\n\t\t\t}\n\t\t\t$d= date(\"Y-m-d\", strtotime(\"$d -1 day\"));\n\t\t\t$dn++;\n\t\t}\n\n\t\treturn $dn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
example usage: $s_ids = implodeIds( array(1, 2, 5) ); return string '|1||2||5|' | function implodeIds($a_ids) {
if (!is_array($a_ids) || count($a_ids) == 0) {
return "";
}
return "|" . join("||", $a_ids) . "|";
} | [
"public function getIdsAsString()\n {\n $array = $this->getIds();\n\n return implode(',', $array);\n }",
"protected function buildIdList(array $ids)\n\t{\n\t\tsort($ids);\n\t\treturn implode(',', $ids);\n\t}",
"private function _getIdsString()\n {\n $ids_string = \"''\";\n if(count($this->_products[\"ids\"]) == 1)\n {\n $ids_string = \"'{$this->_products[\"ids\"][0]}'\";\n }\n elseif(count($this->_products[\"ids\"]) > 1)\n {\n $ids_string = \"['\";\n $ids_string .= implode(\"','\", $this->_products[\"ids\"]);\n $ids_string .= \"']\";\n }\n return $ids_string;\n }",
"public function getIdsString(){\n\t\treturn implode(',', $this->getMenuitemIds());\n\t}",
"private function quoteIds(array $ids): string\n {\n $connection = $this->connection;\n\n return implode(',', array_map(function($id) use ($connection) {\n return $connection->quote((int)$id, ParameterType::INTEGER);\n }, $ids));\n }",
"public function getIdsString()\n {\n return implode(',', $this->getCategoryIds());\n }",
"function mk_negative_user_ids($ids) {\n $new_array = array();\n foreach ($ids as $id) {\n $new_array[] = \"-$id\";\n }\n return implode(',',$new_array);\n}",
"function implode(/*.string.*/ $glue, /*. array[]string .*/ $pieces){}",
"function join($sep='') {\n return STD\\str(implode(STD\\str($sep), array_map('strval', $this->_items)));\n}",
"public function implodeIntegerArray($array, $glue);",
"function convert_ids_to_name($ids)\n {\n \tif (empty($ids)) return '';\n\n \tif (is_string($ids)) $ids = explode(',', $ids);\n\n foreach ($ids as $key => $id) {\n $genres[] = $this->get_full_name_string($id);\n }\n\n/*\n \t$query= $this->db->select('name')\n \t->where_in('id', $ids)\n \t->get($this->_table);\n\n \t$genres = array();\n \tif ($query->num_rows())\n \t{\n \t\tforeach ($query->result() as $key => $value) {\n \t\t\t//$genres[] = $value->name;\n var_dump($value);\n $genres[] = $this->get_full_name_string($value->id);\n \t\t}\n \t}\t\n*/\n \treturn implode('; ', $genres);\n }",
"function implode_all($glue, $array)\n{\n for ($i = 0; $i < count($array); $i++)\n {\n if (is_array($array[$i]))\n {\n $array[$i] = implode_all($glue, $array[$i]);\n }\n }\n\n return (string) implode($glue, $array);\n}",
"public function import_group_ids_string()\n\t{\n\t\t// Get vendors as array\n\t\t$vendors = $this->_vendors_array('all');\n\t\t\n\t\t// Prep empty string for return\n\t\t$string\t\t\t= '';\n\t\t$line_count\t\t= 0;\n\n\t\tforeach ($vendors as $vendor)\n\t\t{\n\t\t\t// Unite multiples with OR\n\t\t\tif ($line_count > 0)\n\t\t\t{\n\t\t\t\t$string .= ' OR ';\n\t\t\t}\n\t\t\t\n\t\t\t// Add to string\n\t\t\t$string .= \"`import_group_id`='\".$vendor->import_group_id.\"'\";\n\t\t\t\n\t\t\t// Line count\n\t\t\t$line_count++;\n\t\t}\n\t\t\n\t\t// Return\n\t\treturn $string;\n\t}",
"public function get_concat_id(): string\n {\n return str_replace(',', ',\\',\\',', $this->id);\n }",
"function bubblecast_get_cat_ids_str(&$categories) {\n if (!is_array($categories)) {\n return '';\n }\n return join($categories, ',');\n}",
"public function convertMeToString($glue,$arr){\n return implode($glue , $arr);\n}",
"public function implode(...$values)\n {\n \n if (count($values) === 1) {\n return implode($values[0], $this->items);\n } \n if ($values[0] == 'keys') {\n return implode($values[1], $this->keys());\n } \n if ($values[0] === 'values') {\n return implode($values[1], $this->values());\n }\n }",
"public function transform($array)\n {\n if (false === is_array($array) && !$array instanceof \\Traversable) {\n return '';\n }\n\n $ids = [];\n\n /** @var Object $el */\n foreach ($array as $el) {\n $ids[] = $el->getId();\n }\n\n return implode(',', $ids);\n }",
"function convertArrayToCommaseparatedString($inputArray) {\n\t\t$result = '';\n\n\t\tforeach ($inputArray as $uid) {\n\t\t\t$result .= ', ' . $uid;\n\t\t}\n\n\t\treturn trim($result, ',');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional value is zero or positive float. | public static function isOptionalZeroPositiveFloat($value)
{
/* No additional validations when the value is null. */
if (null === $value) {
return true;
}
return self::isRequiredZeroPositiveFloat($value);
} | [
"public function getFloatValue(): ?float;",
"function float_or_null($f) {\n return $f === null ? null : (float) $f;\n}",
"public function testOptFiniteFloatWithDefault3()\n {\n // When value and default is null an exception must be thrown.\n $this->expectException(InvalidCastException::class);\n Cast::toOptFloat(null, -1.0 * INF);\n }",
"public function asFloat() {}",
"public function validFloats() {}",
"function f( $value )\n{\n if ( $value instanceof Charcoal_Float ){\n return $value;\n }\n return $value !== NULL ? new Charcoal_Float( $value ) : Charcoal_Float::defaultValue();\n}",
"public function isRequiredZeroPositiveFloat($value, $suppressException = true);",
"public static function float();",
"public static function float(?string $valueType = null);",
"public function float()\n {\n return (float) $this->value ? 1 : 0;\n }",
"function proveFloat(mixed $potential): Option\n{\n return Option::fromNullable(is_float($potential) ? $potential : null);\n}",
"function asFloat(mixed $subject): Option\n{\n return Option::fromNullable(filter_var($subject, FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE));\n}",
"public static function aFloat($value)\n {\n return (is_float($value))?:false;\n }",
"function o_isFloat($value) {\n\t\t\treturn Obj::singleton()->isFloat($value);\n\t\t}",
"public function __invoke() \n {\n \n return (float)$this->floatValue;\n \n }",
"public function allowFloats() {\n return $this->allowFloat;\n }",
"protected function validateAddErrorNoFloat () {\n\t\t$min = $this->min === NULL \n\t\t\t? (defined('PHP_FLOAT_MIN') ? PHP_FLOAT_MIN : floatval('-1.79e308'))\n\t\t\t: (string) $this->min;\n\t\t$max = $this->max === NULL \n\t\t\t? (defined('PHP_FLOAT_MAX') ? PHP_FLOAT_MAX : floatval('1.79e308'))\n\t\t\t: (string) $this->max;\n\t\t$this->field->AddValidationError(\n\t\t\tstatic::GetErrorMessage(self::ERROR_FLOAT, [$min, $max])\n\t\t);\n\t}",
"public function parse_float_field($value)\n {\n }",
"function float(): Parser\n{\n return\n atLeastOne(digitChar())\n ->append(\n optional(\n char('.')\n ->append(atLeastOne(digitChar()))\n )\n )->label('float');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ count county member in duration of project execution | function count_county_member_in_project($project, $county) {
$this->db->where('project', $project);
$this->db->where('county', $county);
$this->db->where('year', date("Y")-1911);
return $this->db->get('member')->num_rows();
} | [
"public function countProjects();",
"public function getProjectCollaboratorCount()\n {\n // TODO: Apply functional programming\n\n $counter = 0;\n\n /** @var \\App\\Models\\Translations\\Project $project */\n foreach ($this->projects as $project) {\n $counter += $project->members()->count();\n }\n\n return $counter;\n }",
"function get_userprojectcount($uid,$userroleid){\n\tglobal $DB;\n\t$count = 0;\n\t$rolename = get_atalrolenamebyid($userroleid);\n\t$atalvariables = get_atalvariables();\n\t$projectcat = $atalvariables['project_categoryid'];\n\tif($rolename=='mentor'){\n\t\t$sql=\"SELECT count(c.id) as cnt FROM {user} u JOIN {user_enrolments} ue ON u.id=ue.userid JOIN {enrol} e ON ue.enrolid=e.id \n\t\tJOIN {course} c ON e.courseid=c.id WHERE e.enrol='manual' AND u.id='\".$uid.\"' AND c.startdate>0 AND c.category=$projectcat AND ue.status=1\";\n\t\t$data = $DB->get_records_sql($sql);\n\t\tforeach($data as $key){\n\t\t\t$count = $key->cnt;\n\t\t}\n\t} elseif($rolename=='student'){\n\t\t$sql=\"SELECT count(c.id) as cnt FROM {user} u JOIN {user_enrolments} ue ON u.id=ue.userid JOIN {enrol} e ON ue.enrolid=e.id \n\t\tJOIN {course} c ON e.courseid=c.id WHERE e.enrol='manual' AND u.id='\".$uid.\"' AND c.startdate>0 AND c.category=$projectcat\";\n\t\t$data = $DB->get_records_sql($sql);\n\t\tforeach($data as $key){\n\t\t\t$count = $key->cnt;\n\t\t}\n\t} else{\n\t\t//incharge\n\t\t$sql=\"SELECT count(c.id) as cnt FROM {course} c JOIN (SELECT schoolid FROM {user_school} WHERE userid = \".$uid.\") as s ON c.idnumber=s.schoolid \n\t\tAND c.startdate>0 AND c.category=$projectcat\";\n\t\t$data = $DB->get_records_sql($sql);\n\t\tforeach($data as $key){\n\t\t\t$count = $key->cnt;\n\t\t}\n\t}\n\treturn $count;\n}",
"function the_hrb_user_completed_projects_count( $user = '', $args = array(), $before = '', $after = '' ) {\n\t$projects = get_the_hrb_user_related_completed_projects( $user, $args );\n\n\t$count = 0;\n\n\tif ( $projects ) {\n\t\t$count = $projects->post_count;\n\t}\n\n\techo $before . $count . $after;\n}",
"public function getProjectCount()\n {\n return $this->project_count;\n }",
"public function getTotalTaskCount();",
"public function countMembers()\n\t{\n\t\t#init\t\t\n\t\t$stats\t\t= $this->cache->getCache('ibEco_stats');\n\t\t$ecoPoints \t= $this->settings['eco_general_pts_field'];\n\t\t$ptsDB\t\t= ( $ecoPoints == 'eco_points' ) ? 'pc' : 'm';\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t#get count\n\t\t$max\t= $this->DB->buildAndFetch( array(\n\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'COUNT( m.member_id ) as memCount',\n\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'where' \t=> $ptsDB.'.'.$ecoPoints.' > 0 OR pc.eco_worth > 0 OR pc.eco_welfare > 0',\n\t\t\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'from'\t=> array( 'pfields_content' => 'pc' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where'\t=> 'm.member_id=pc.member_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\t\t);\t\t\t\t\t\t\t\t\t\t\n\t\treturn $max['memCount'];\n\t}",
"public function countCanceledMembers(){\r\n \r\n $dbs = $this->getDB()->prepare\r\n ('select * from memberstatus where StatusCode = \"C\"');\r\n $dbs->execute();\r\n $countCanceled = $dbs->rowCount();\r\n \r\n return $countCanceled;\r\n }",
"function rcp_count_all_members() {\n\t$counts = array(\n\t\t'active' \t=> rcp_count_members('', 'active'),\n\t\t'pending' \t=> rcp_count_members('', 'pending'),\n\t\t'expired' \t=> rcp_count_members('', 'expired'),\n\t\t'cancelled' => rcp_count_members('', 'cancelled'),\n\t\t'free' \t\t=> rcp_count_members('', 'free')\n\t);\n\treturn $counts;\n}",
"public function getTotalCompleted(){\n\n $profiles = UserProfile::where('gender', '<>', '')\n ->where('gender', '<>', 'none')\n ->where('city', '<>', '')\n ->where('skill', '<>', '')\n ->where('skill', '<>', 'none')\n ->where('racquet', '<>', '')\n ->where('racquet', '<>', 'none')\n ->where('dominant_hand', '<>', '')\n ->where('dominant_hand', '<>', 'none')\n ->where('bio', '<>', '')\n ->get();\n\n $cnt=0; \n foreach ($profiles as $profile) {\n\n if ($profile->is_avatar_unique){\n $cnt++;\n } \n }\n\n return $cnt;\n }",
"public function getCoverageCount();",
"public function getCompletedCount();",
"public function getEventMemberCount() {\n return($this->eventMemberCount);\n }",
"function getjobCateCount(){\n$collection = $GLOBALS['db']->job_category;\nreturn $collection->count();\n}",
"function project_count() {\n return count($this->projects);\n }",
"public function getNumContriForFaculty () {\n $this->FacultyUpload = getInstance('FacultyUpload');\n\n $facultyId = $this->request->get('faculty_id') ?? null;\n\n $data = $this->FacultyUpload->getDataForCoordinator($facultyId);\n\n if (!empty($data)) responseToClient('Get number of contributions for faculty success', true, $data);\n responseToClient('No contribution found for faculty');\n }",
"function team_members_total() {\n \n // Get codeigniter object instance\n $CI = get_instance();\n \n // Load Team Model\n $CI->load->model('team');\n \n // Count total number of team's members and return\n return $CI->team->get_members($CI->user_id);\n \n }",
"public function getTotalCasesInDept(){\n $dept = $this->dept;\n $users = User::where(['department' => $dept->id])->select('users.id')->get();\n $sum = 0;\n foreach($users as $user){\n $numberOfCasesIntaken = LegalCase::where(['staff' => $user->id])->count();\n $sum += $numberOfCasesIntaken;\n }\n return $sum;\n }",
"public function getTotalOccupiedLots() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the collPressGroups collection. By default this just sets the collPressGroups collection to an empty array (like clearcollPressGroups()); however, you may wish to override this method in your stub class to provide setting appropriate to your application for example, setting the initial array to the values stored in database. | public function initPressGroups($overrideExisting = true)
{
if (null !== $this->collPressGroups && !$overrideExisting) {
return;
}
$this->collPressGroups = new PropelObjectCollection();
$this->collPressGroups->setModel('PressGroup');
} | [
"public function initPressGroups()\n {\n $this->collPressGroups = new PropelObjectCollection();\n $this->collPressGroups->setModel('PressGroup');\n }",
"public function initGroups()\n {\n $collectionClassName = EventAudienceTableMap::getTableMap()->getCollectionClassName();\n\n $this->collGroups = new $collectionClassName;\n $this->collGroupsPartial = true;\n $this->collGroups->setModel('\\ChurchCRM\\Group');\n }",
"public function initGroupss()\n\t{\n\t\t$this->collGroupss = array();\n\t}",
"public function clearPressGroups()\n {\n $this->collPressGroups = null; // important to set this to null since that means it is uninitialized\n $this->collPressGroupsPartial = null;\n\n return $this;\n }",
"public function initCampaignContactGroups()\n\t{\n\t\t$this->collCampaignContactGroups = array();\n\t}",
"public function clearGroups()\n {\n $this->collGroups = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function initWpmodules()\n\t{\n\t\t$this->collWpmodules = array();\n\t}",
"protected function _loadGroups()\n {\n $this->_groups = array();\n $this->_groupsCount = 0;\n foreach ($this->getGroupCollection() as $group) {\n $this->_groups[$group->getId()] = $group;\n $this->_groupIds[$group->getId()] = $group->getId();\n if ($this->getDefaultGroupId() == $group->getId()) {\n $this->_defaultGroup = $group;\n }\n $this->_groupsCount ++;\n }\n }",
"public function initGrupos()\n {\n $collectionClassName = MiembrosGrupoTableMap::getTableMap()->getCollectionClassName();\n\n $this->collGrupos = new $collectionClassName;\n $this->collGruposPartial = true;\n $this->collGrupos->setModel('\\Grupo');\n }",
"function MyMod_SubActions_Groups_Init()\n {\n $subaction=$this->CGI_GET(\"SubAction\");\n\n $agroups=array();\n foreach (array_keys($this->ItemDataSGroups) as $group)\n {\n if (!empty($this->ItemDataSGroups[ $group ][ \"SubAction\" ]))\n {\n if ($this->ItemDataSGroups[ $group ][ \"SubAction\" ]==$subaction)\n {\n $agroups[ $group ]=$this->ItemDataSGroups[ $group ];\n }\n \n unset($this->ItemDataSGroups[ $group ]);\n }\n }\n\n foreach (array_keys($agroups) as $group)\n {\n $this->ItemDataSGroups[ $group ]=$agroups[ $group ];\n }\n }",
"public function initUserGroups($overrideExisting = true)\n {\n if (null !== $this->collUserGroups && !$overrideExisting) {\n return;\n }\n $this->collUserGroups = new ObjectCollection();\n $this->collUserGroups->setModel('\\Models\\UserGroup');\n }",
"public function initGrupos()\n {\n $collectionClassName = UsuarioGruposTableMap::getTableMap()->getCollectionClassName();\n\n $this->collGrupos = new $collectionClassName;\n $this->collGruposPartial = true;\n $this->collGrupos->setModel('\\Grupo');\n }",
"public function initUserGroups() {}",
"function initGroups() {\n $root = createGroup('COMPANY_ROOT');\n $germany = createGroup('Germany', $root);\n createGroup('Office Berlin', $germany);\n createGroup('Office Dresden', $germany);\n \n $uk = createGroup('UK', $root);\n createGroup('Office London', $uk);\n createGroup('Office Edinburgh', $uk);\n}",
"private function initActionGroups()\n {\n $actionGroupParser = ObjectManagerFactory::getObjectManager()->create(ActionGroupDataParser::class);\n $parsedActionGroups = $actionGroupParser->readActionGroupData();\n\n $actionGroupObjectExtractor = new ActionGroupObjectExtractor();\n\n foreach ($parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT] as\n $actionGroupName => $actionGroupData) {\n if (!is_array($actionGroupData)) {\n continue;\n }\n\n $this->actionGroups[$actionGroupName] =\n $actionGroupObjectExtractor->extractActionGroup($actionGroupData);\n }\n }",
"public function clearPressGroupContacts()\n {\n $this->collPressGroupContacts = null; // important to set this to null since that means it is uninitialized\n $this->collPressGroupContactsPartial = null;\n\n return $this;\n }",
"public function initAclGroupss($overrideExisting = true)\n {\n if (null !== $this->collAclGroupss && !$overrideExisting) {\n return;\n }\n $this->collAclGroupss = new PropelObjectCollection();\n $this->collAclGroupss->setModel('AclGroups');\n }",
"public static function getNormalizeCollectionGroups(): array;",
"function init_groups() {\n\tif (!HYPEGALLERY_GROUP_ALBUMS) {\n\t\treturn;\n\t}\n\tadd_group_tool_option('albums', elgg_echo('gallery:groupoption:enable'), true);\n\telgg_extend_view('groups/tool_latest', 'framework/gallery/group_module');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists the property types for a particular ad type | public function property_types($type)
{
return $this->daftAPI->property_types([
'api_key' => $this->api_key,
'ad_type' => $type
]);
} | [
"public static function getPropertyTypesList()\n {\n $query = BalooContext::getInstance()->getPDO()->prepare('\n SELECT _PROP.id AS id, _PROP.name AS name, _PROP.format AS format\n FROM '.BalooModel::tableEntityFieldInfo().' AS _PROP\n ');\n $query->execute();\n\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"function wp_listings_get_property_types($post_id = null) {\n\n\tif ( null == $post_id ) {\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n\t}\n\n\t$listing_property_types = wp_get_object_terms($post_id, 'property-types');\n\n\tif ( empty($listing_property_types) || is_wp_error($listing_property_types) ) {\n\t\treturn;\n\t}\n\n\tforeach($listing_property_types as $type) {\n\t\treturn $type->name;\n\t}\n}",
"public function getProperties( $type );",
"public function getPropertyTypesForIframe($ad_type,$property_type)\n {\n $type = null;\n \n switch($ad_type)\n {\n case \"sale\":\n switch($property_type)\n {\n case \"house\":\n $type = 1;\n break;\n case \"apartment\":\n $type = 2;\n break;\n case \"duplex\":\n $type = 3;\n break;\n case \"bungalow\":\n $type = 4;\n break;\n case \"site\":\n $type = 5;\n break;\n }\n break;\n case \"rental\":\n switch($property_type)\n {\n case \"apartment\":\n $type = 1;\n break;\n case \"house\":\n $type = 2;\n break;\n case \"studio\":\n $type = 3;\n break;\n case \"flat\":\n $type = 4;\n break;\n }\n break;\n case \"new_development\":\n switch($property_type)\n {\n case \"house\":\n $type = 1;\n break;\n case \"apartment\":\n $type = 2;\n break;\n case \"duplex\":\n $type = 3;\n break;\n case \"bungalow\":\n $type = 4;\n break;\n }\n break;\n }\n \n return $type;\n }",
"protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }",
"public function getEntityTypePropertyList()\n {\n $query = BalooContext::getInstance()->getPDO()->prepare('\n SELECT _FIELD.name AS name, _FIELD.custom AS iscustom, _PROP.name AS type, _PROP.format AS format\n FROM '.BalooModel::tableEntityField().' AS _FIELD\n INNER JOIN '.BalooModel::tableEntityType().' AS _TYPE\n ON _TYPE.id=_FIELD.'.BalooModel::tableEntityType().'_id\n INNER JOIN '.BalooModel::tableEntityFieldInfo().' AS _PROP\n ON _PROP.id=_FIELD.'.BalooModel::tableEntityFieldInfo().'_id\n WHERE _TYPE.id='.$this->id);\n $query->execute();\n\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"function getPropertyNamesByType($propertyType) {\n\t\t$metadataSchema =& $this->getMetadataSchema();\n\t\treturn $metadataSchema->getPropertyNamesByType($propertyType);\n\t}",
"function getPropertyNamesByType($propertyType) {\n\t\tassert(in_array($propertyType, MetadataProperty::getSupportedTypes()));\n\n\t\t$propertyNames = array();\n\t\tforeach($this->_properties as $property) {\n\t\t\t$allowedPropertyTypes = $property->getAllowedTypes();\n\t\t\tif (isset($allowedPropertyTypes[$propertyType])) {\n\t\t\t\t$propertyNames[] = $property->getName();\n\t\t\t}\n\t\t}\n\n\t\treturn $propertyNames;\n\t}",
"public function test_form_getPropertyTypes() {\n $propertyTypes = MMFormHelper::getPropertyTypes();\n\n $this->assertCount(3, $propertyTypes);\n\n $this->assertContains('-- Select --', $propertyTypes);\n $this->assertContains('Apartment', $propertyTypes);\n $this->assertContains('Shop', $propertyTypes);\n\n $this->assertArrayHasKey('apartment', $propertyTypes);\n $this->assertArrayHasKey('shop', $propertyTypes);\n unset($propertyTypes);\n }",
"function hook_search_api_item_type_info() {\n // Copied from search_api_search_api_item_type_info().\n $types = array();\n\n foreach (entity_get_property_info() as $type => $property_info) {\n if ($info = entity_get_info($type)) {\n $types[$type] = array(\n 'name' => $info['label'],\n 'datasource controller' => 'SearchApiEntityDataSourceController',\n 'entity_type' => $type,\n );\n }\n }\n\n return $types;\n}",
"public function listArticleTypes() {\n\t\treturn $this->article_type->all()->pluck('name', 'id')->all();\n\t}",
"public function getObjectTypeList();",
"protected function getPropertyTypeAttributes()\n {\n return array_merge(\n $this->getCommonAttributes(),\n array(\n 'multiple' => array('values' => array('*', 'mul', 'multiple'), 'variant' => true),\n 'queryops' => array('values' => array('qop', 'queryops'), 'variant' => true), // Needs special handling !\n 'nofulltext' => array('values' => array('nof', 'nofulltext'), 'variant' => true),\n 'noqueryorder' => array('values' => array('nqord', 'noqueryorder'), 'variant' => true),\n )\n );\n }",
"public function getPropertyType()\n {\n return $this->property_type;\n }",
"public function get_object_types();",
"public function getDatatypeProperties()\n {\n $this->params[\"type\"] = \"dataproperty\";\n }",
"public function getTypes()\n {\n return $this->get('Types');\n }",
"function listeo_core_get_listing_types(){\n\t $options = array(\n \t'apartments' => __( 'Apartments', 'listeo_core' ),\n\t\t\t'houses' \t => __( 'Houses', 'listeo_core' ),\n\t\t\t'commercial' => __( 'Commercial', 'listeo_core' ),\n\t\t\t'garages' \t => __( 'Garages', 'listeo_core' ),\n\t\t\t'lots' \t\t => __( 'Lots', 'listeo_core' ),\n );\n\treturn apply_filters('listeo_core_get_listing_types',$options);\n}",
"public function getPropertyType(): string\n\t{\n\t\treturn $this->propertyType;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display page excerpt. Prints the correct excerpt on a per page basis. If on the WooCommerce shop page then the products result count is be displayed instead of the page excerpt. Also, if on a single product then no excerpt will be output. | function tecscan_page_excerpt() {
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
woocommerce_result_count();
} elseif ( is_home() ) {
$id = get_option( 'page_for_posts' );
if ( has_excerpt( $id ) ) {
printf( '<p itemprop="description">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( is_search() ) {
$id = get_page_by_path( 'search' );
if ( has_excerpt( $id ) ) {
printf( '<p itemprop="description">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( is_404() ) {
$id = get_page_by_path( 'error' );
if ( has_excerpt( $id ) ) {
printf( '<p itemprop="description">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( ( is_single() || is_singular() ) && ! is_singular( 'product' ) && has_excerpt() ) {
if ( has_excerpt() ) {
printf( '<p itemprop="description">%s</p>', do_shortcode( get_the_excerpt() ) );
}
}
} | [
"function studio_page_excerpt() {\n\n\tif ( class_exists( 'WooCommerce' ) && is_shop() ) {\n\n\t\twoocommerce_result_count();\n\n\t} elseif ( is_home() ) {\n\n\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( get_option( 'page_for_posts' ) ) ) );\n\n\t} elseif ( is_search() ) {\n\n\t\t$id = get_page_by_path( 'search' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\n\t\t}\n\n\t} elseif ( is_404() ) {\n\n\t\t$id = get_page_by_path( 'error' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\n\t\t}\n\n\t} elseif ( ( is_single() || is_singular() ) && ! is_singular( 'product' ) && has_excerpt() ) {\n\n\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt() ) );\n\n\t}\n}",
"function lalita_show_excerpt() {\n\t\t// Get current post\n\t\tglobal $post;\n\n\t\t// Get Customizer settings\n\t\t$lalita_settings = wp_parse_args(\n\t\t\tget_option( 'lalita_settings', array() ),\n\t\t\tlalita_get_defaults()\n\t\t);\n\n\t\t// Check to see if the more tag is being used\n\t\t$more_tag = apply_filters( 'lalita_more_tag', strpos( $post->post_content, '<!--more-->' ) );\n\n\t\t// Check the post format\n\t\t$format = ( false !== get_post_format() ) ? get_post_format() : 'standard';\n\n\t\t// Get the excerpt setting from the Customizer\n\t\t$show_excerpt = ( 'excerpt' == $lalita_settings['post_content'] ) ? true : false;\n\n\t\t// If the more tag is found, show the full content\n\t\t$show_excerpt = ( $more_tag ) ? false : $show_excerpt;\n\n\t\t// If we're on a search results page, show the excerpt\n\t\t$show_excerpt = ( is_search() ) ? true : $show_excerpt;\n\n\t\t// Return our value\n\t\treturn apply_filters( 'lalita_show_excerpt', $show_excerpt );\n\t}",
"function wpv_woocommerce_catalog_excerpt() {\n\t\tglobal $post;\n\n\t\tif ( ! $post->post_excerpt ) return;\n\n\t\t$excerpt_length = apply_filters( 'wpv_woocommerce_catalog_excerpt_length', 60 );\n\n\t\t$excerpt = explode( \"\\n\", wordwrap( $post->post_excerpt, $excerpt_length ) );\n\t\tif (count( $excerpt ) > 1)\n\t\t\t$excerpt[0] .= '...';\n\t\t$excerpt = $excerpt[0];\n\t\t?>\n\n\t\t<?php\n\t}",
"public function the_excerpt() {\n\t\techo wp_kses_post( apply_filters( 'the_excerpt', $this->get_excerpt() ) );\n\t}",
"public static function output() {\r\n the_excerpt();\r\n }",
"function twentig_support_page_excerpt() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}",
"public static function output() {\n the_excerpt();\n }",
"public static function output() {\n\t the_excerpt();\n\t }",
"public function add_page_excerpts() {\n\t\tadd_post_type_support( 'page', 'excerpt' );\n\t}",
"public function add_page_excerpts() {\n add_post_type_support( 'page', 'excerpt' );\n }",
"function wpsc_showing_products_page() {\n\t\n\tglobal $wpsc_query;\n\t\n\t$output = $wpsc_query->page_count;\n\t$current_page = wpsc_current_page();\n\t\n\treturn $current_page . ' of ' . $output;\n\t\n}",
"public function getExcerpt();",
"public function hgr_xtnd_getPostExcerpt() {\n\t\t\t$content = apply_filters('the_excerpt', get_the_excerpt());\n\t\t\t/*\n\t\t\t\tOutput return\n\t\t\t*/\n\t\t\treturn $content;\n\t\t}",
"function show_excerpt($post) {\r\n extract($this->get_defaults($this->shortcode_atts));\r\n $output = '';\r\n\r\n if ( $more_link ) {\r\n $excerptlink = $before_link . '<a href=\"' . $more_link . '\" ' . $target . '>' . $excerpt_more . '</a>';\r\n } else {\r\n $excerptlink = $excerpt_more;\r\n }\r\n\r\n if ( $show_thumbnail and has_post_thumbnail($post->ID) ) {\r\n $output.= '<span class=\"' . $thumbnail_class . '\"><a href=\"' . get_permalink($post->ID) . '\" ' . $target . '>' . get_the_post_thumbnail($post->ID, $thumbnail_size) . '</a></span>';\r\n }\r\n\r\n if ( $excerpt_tag ) {\r\n $output.= '<' . $excerpt_tag . ' class=\"' . $excerpt_class . '\">';\r\n }\r\n\r\n if ( !$excerpt = get_post_meta($post->ID, 'epl-text', true) ) {\r\n $excerpt = $this->trim_excerpt($post->post_content, $excerpt_length, $excerptlink);\r\n }\r\n\r\n $output.= apply_filters('the_excerpt', $excerpt);\r\n\r\n if ( $excerpt_tag ) {\r\n $output.= '</' . $excerpt_tag . '>';\r\n }\r\n\r\n return $output;\r\n }",
"function wpsc_showing_products_page() {\n\t_wpsc_deprecated_function( __FUNCTION__, '3.8' );\n\n\tglobal $wpsc_query;\n\n\t$output = $wpsc_query->page_count;\n\t$current_page = wpsc_current_page();\n\n\treturn $current_page . ' of ' . $output;\n\n}",
"public static function template_products_per_page()\n {\n wc_get_template('products-per-page.php', array(), '', plugin_dir_path(__FILE__) . 'templates/');\n }",
"public function testSearchExcerptField() {\n $assertSession = $this->assertSession();\n\n $path = '/search-api-test-excerpt-field';\n $this->drupalGet($path);\n foreach ($this->ids as $itemId) {\n $assertSession->pageTextContains(\"Item $itemId test excerpt\");\n }\n\n // Visiting the same page a second time retrieves the rendered node from\n // cache, not using the updated test excerpt template.\n $stateKey = 'search_api_test_excerpt_field';\n \\Drupal::state()->set($stateKey, 'test--{{item_id}}--excerpt');\n $this->drupalGet($path);\n foreach ($this->ids as $itemId) {\n $assertSession->pageTextContains(\"Item $itemId test excerpt\");\n $assertSession->pageTextNotContains(\"test--$itemId--excerpt\");\n }\n\n // Changing the GET parameters does skip the render cache for the nodes.\n $this->drupalGet($path, ['query' => ['foo' => 'bar']]);\n foreach ($this->ids as $itemId) {\n $assertSession->pageTextContains(\"test--$itemId--excerpt\");\n $assertSession->pageTextNotContains(\"Item $itemId test excerpt\");\n }\n }",
"function o2_use_excerpt() {\n $display = TRUE;\n $display = apply_filters('o2_use_excerpt', $display);\n return $display;\n}",
"function woocommerce_template_single_excerpt() {\n\t\tglobal $post, $product;\n\n\t\t$short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );\n\n\t\tif ( ! $short_description ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$class = '';\n\t\t$rating_count = $product->get_rating_count();\n\t\tif ( ! wc_review_ratings_enabled() || $rating_count < 1 ) {\n\t\t\t$class = 'no-rating';\n\t\t}\n\t\t?>\n\t\t<div class=\"<?php echo trim(implode(' ', ['woocommerce-product-details__short-description', $class]));?>\"><?php echo overcome_html($short_description); // WPCS: XSS ok. \n\t\t?></div>\n\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enabled Grand Total in Place Order Button | protected function _isEnabledGrandTotal()
{
return Mage::helper('onestepcheckout/config')->showGrandTotal();
} | [
"function qode_startit_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = qode_startit_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'startit' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc_shipping'\n\t\t\t)\n\t\t));\n\n\t\tprint $update_totals_button;\n\n\t}",
"function anggarantotal()\n\t{\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_app->view_ordering('tbl_anggarantotal','id','ASC');\n\t\t$this->template->load('administrator/template','administrator/mod_anggarantotal/anggarantotal',$data);\n\t}",
"function goodwish_edge_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = goodwish_edge_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'goodwish' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc_shipping'\n\t\t\t),\n\t\t\t'type' => 'solid-dark'\n\t\t));\n\n\t\techo goodwish_edge_get_module_part($update_totals_button);\n\n\t}",
"function wc_cart_totals_order_total_html()\n {\n }",
"protected function get_order_total()\n {\n }",
"public function render_checkout_place_order_text() {\n\n\t\t\tglobal $woocommerce;\n\t\t\t$cart_total_with_symbol = '';\n\n\t\t\tif ( isset( $woocommerce->cart->total ) && astra_get_option( 'checkout-modern-checkout-button-price' ) ) {\n\t\t\t\t$cart_total = $woocommerce->cart->total;\n\t\t\t\t$cart_total_with_symbol = ' ' . get_woocommerce_currency_symbol() . $cart_total;\n\t\t\t}\n\n\t\t\treturn astra_get_option( 'checkout-place-order-text' ) . $cart_total_with_symbol;\n\t\t}",
"function woo_custom_order_button_text() {\n return __( 'Place order (please wait for order to be placed)', 'woocommerce' ); \n}",
"function admin_edit_order() {\n\t\t//\n\t}",
"function libero_mikado_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = libero_mikado_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'custom_class'\t=> 'mkd-update-totals',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'libero' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc_shipping'\n\t\t\t),\n\t\t\t'size'\t\t\t=> 'large',\n\t\t\t'icon_pack'\t\t=> 'simple_line_icons',\n\t\t\t'simple_line_icons'\t=> 'icon-plus',\n\t\t));\n\n\t\tprint $update_totals_button;\n\n\t}",
"public function display_submit_order(){\n\t\tif(\t$this->cart->total_items > 0 ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_cart_submit_order.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . 'wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_cart_submit_order.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_cart_submit_order.php' );\n\t\t}\n\t}",
"function communityservice_single_variation_add_to_cart_button() {\n\t\tcs_get_template( 'single-task/add-to-cart/variation-add-to-cart-button.php' );\n\t}",
"function action_woocommerce_order_item_add_action_buttons( $order )\r\n{\r\n echo '<form><button type=\"button\" onclick=\"document.getElementById(\\'PS_GET_License\\').value = 1;document.post.submit();\" class=\"button generate-items\">' . __( 'Accept And Set Order On License Bank !', 'hungred' ) . '</button>';\r\n // indicate its taopix order generator button\r\n echo '<input type=\"hidden\" value=\"0\" id=\"PS_GET_License\" name=\"PS_GET_License\" />';\r\n //\r\n \r\n echo '<button type=\"button\" onclick=\"document.getElementById(\\'PS_Email_License\\').value = 1;document.post.submit();\" class=\"button generate-items\">' . __( ' Email Licenses To Customer!', 'hungred' ) . '</button>';\r\n // indicate its taopix order generator button\r\n echo '<input type=\"hidden\" value=\"0\" id=\"PS_Email_License\" name=\"PS_Email_License\" />';\r\n}",
"private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }",
"function display_fields_for_order_details(){\r\n\r\n\t\t/**\r\n\t\t * Position 1 - Display inside order total after shipping method\r\n\t\t */\r\n\t\tadd_filter( 'woocommerce_get_order_item_totals', [$this, 'display_after_shipping_method'], 10, 2 );\r\n\r\n\t\t/**\r\n\t\t * Position 2 - Display after order total\r\n\t\t */\r\n\t\tadd_action( 'woocommerce_order_details_after_order_table', [$this,'display_after_order_details'] );\r\n\t\t\r\n\t}",
"private function addTotalAmount(){\t\t\n\t\t$element = 'totalAmount';\n\t\t$this->addElement('text', $element, array(\n\t\t 'label' => 'totalAmountToPay',\t\t \n\t\t 'readonly' => true\t\t \n\t\t));\t\t\n\t\t$this->addDecoratorAndGroup( $element, true );\t\t\n\t\t$this->getElement($element)->setValue( number_format($this->getSum(),2) );\n\t}",
"protected function insertOrdersTotal() {\n\t\t//echo print_m($this->o['orderTotal']);\n\t\tforeach ($this->o['orderTotal'] as $key => &$entry) {\n\t\t\t$entry['orders_id'] = $this->cur['OrderID'];\n\t\t\tif (defined($entry['title'])) {\n\t\t\t\t$entry['title'] = constant($entry['title']);\n\t\t\t}\n\t\t\t$entry['text'] = $this->simplePrice->setPrice($entry['value'])->format();\n\t\t\t$this->insert(TABLE_ORDERS_TOTAL, $entry);\n\t\t}\n\n\t\t// Gambio specific \"Kleinunternehmer Regelung\"\n\t\tif (defined('MAGNA_GAMBIO_PLUGIN_GM_TAX_FREE_STATUS') && MAGNA_GAMBIO_PLUGIN_GM_TAX_FREE_STATUS) {\n\t\t\t$this->insert(TABLE_ORDERS_TOTAL, array(\n\t\t\t\t'orders_id' => $this->cur['OrderID'],\n\t\t\t\t'title' => MODULE_ORDER_TOTAL_GM_TAX_FREE_TEXT,\n\t\t\t\t'class' => 'ot_gm_tax_free',\n\t\t\t\t'sort_order' => MODULE_ORDER_TOTAL_GM_TAX_FREE_SORT_ORDER\n\t\t\t));\n\t\t}\n\t\t// echo 'DELETE FROM '.TABLE_ORDERS_TOTAL.' WHERE orders_id=\"'.$this->cur['OrderID'].'\";'.\"\\n\\n\";\t\n\t}",
"function uc_line_item_total($op, $arg1) {\n switch ($op) {\n case 'display':\n $lines[] = array(\n 'id' => 'total',\n 'title' => t('Total'),\n 'amount' => uc_order_get_total($arg1),\n );\n return $lines;\n }\n}",
"function theme_ac_commerce_quantity_plusminus_link($variables) {\n switch ($variables['way']) {\n case COMMERCE_EXTRA_QUANTITY_DECREASE:\n $text = '-';\n $class = 'quantity-minus';\n $js_callback = \"Drupal.commerce_extra_quantity_quantity('#\" . $variables['quantity_input_element'] . \"', \" . $variables['way'] . \")\";\n break;\n case COMMERCE_EXTRA_QUANTITY_INCREASE:\n $text = '+';\n $class = 'quantity-up';\n $js_callback = \"Drupal.commerce_extra_quantity_quantity('#\" . $variables['quantity_input_element'] . \"', \" . $variables['way'] . \")\";\n break;\n }\n if ($variables['quantity'] <= 1) {\n $class .= ' disabled';\n }\n $options = array(\n 'attributes' => array('class' => 'button', 'onclick' => $js_callback . '; return false;'),\n 'html' => FALSE,\n );\n $element = array(\n '#theme' => 'link',\n '#text' => $text,\n '#path' => current_path(),\n '#options' => $options,\n );\n return render($element);\n}",
"function wc_veruspay_display_crypto_address_in_admin( $order ) {\n\tglobal $wc_veruspay_global;\n\t$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;\n\t$wc_veruspay_payment_method = $order->get_payment_method();\n\tif ( $wc_veruspay_payment_method == $wc_veruspay_global['id'] ){\n\t\t$wc_veruspay_order_status = get_post_meta( $order_id, '_wc_veruspay_status', TRUE );\n\t\tif ( $wc_veruspay_order_status == 'noaddress' ) {\n\t\t\tforeach ( $order->get_items() as $item_key => $item_values) { \n\t\t\t\t$wc_veruspay_stock = get_post_meta( $item_values['variation_id'], '_manage_stock', TRUE ); \n\t\t\t}\n\t\t\tupdate_post_meta( $order_id, '_wc_veruspay_status', sanitize_text_field( 'cancelled' ) );\n\t\t\t$order->update_status( 'cancelled', __( 'Missing Payment Address', 'woocommerce') );\n\t\t\theader(\"Refresh:0\");\n\t\t}\n\t\telse {\n\t\t\tif ( $order->has_status( 'processing' ) ) {\n\t\t\t\t$wc_veruspay_payment_status = 'Received';\n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_paid', TRUE );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$wc_veruspay_payment_status = 'Pending'; \n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_price', TRUE ); \n\t\t\t}\n\t\t\t$wc_veruspay_address = get_post_meta( $order_id, '_wc_veruspay_address', TRUE );\n\t\t\t$_chain_up = strtoupper( get_post_meta( $order_id, '_wc_veruspay_coin', TRUE ) );\n\t\t\t$_chain_lo = strtolower( $_chain_up );\n\t\t\techo '<style>.wc-order-totals-items{height:3rem!important}.wc-order-totals-items:after{content: \"' . $_chain_up . ' ' . $wc_veruspay_payment_status . ': ' . $wc_veruspay_price . '\"!important;position:relative;font-size:1rem;font-weight:bold;color:#007bff!important;top:0;float:right;width:200px;height:30px;}</style>';\n\t\t\techo '<p><strong>'.__( $_chain_up . ' Price', 'woocommerce' ).':</strong>' . $wc_veruspay_price . ' with exchange rate of ' . get_post_meta( $order_id, '_wc_veruspay_rate', TRUE ) . '</p>';\n\t\t\tif ( substr($wc_veruspay_address, 0, 2) !== 'zs' ) {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> <a target=\"_BLANK\" href=\"' . $wc_veruspay_global['chain_dtls'][$_chain_lo]['address'] . $wc_veruspay_address . '\">' . $wc_veruspay_address . '</a></p>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> '.$wc_veruspay_address.'</p';\n\t\t\t}\n\t\t}\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update a page POST (orchestra)/resources/cello.pages/view/(:id) | public function post_view($id = null)
{
$input = Input::all();
$slug = ! empty($input['slug']) ? $input['slug'] : '';
$input['slug'] = Str::slug($slug, '-');
$page_id = $id ?: '0';
$rules = array(
'title' => 'required',
'slug' => array(
'required',
'min:2',
'match:/[a-z0-9\-]+/',
"unique:cello_pages,slug,{$page_id}",
),
'content' => 'required',
'status' => 'required',
);
$m = Messages::make();
$v = Validator::make($input, $rules);
if ($v->fails())
{
return Redirect::to(handles('orchestra::resources/cello.pages/view/'.$id))
->with_input()
->with_errors($v);
}
$type = 'update';
$page = Page::find($id);
if (is_null($page))
{
$type = 'create';
$page = new Page(array(
'user_id' => Auth::user()->id,
));
}
$page->title = $input['title'];
$page->content = $input['content'];
$page->status = $input['status'];
$page->slug = $input['slug'];
$page->save();
$m->add('success', __("cello::response.pages.{$type}", array(
'name' => $page->title,
)));
return Redirect::to(handles('orchestra::resources/cello.pages'))
->with('message', $m->serialize());
} | [
"public function editpage($id) {\n $existing_page = ORM::factory(\"static_page\", $id);\n $view = new Admin_View(\"admin.html\");\n $view->page_title = t(\"Edit page\");\n $view->content = new View(\"admin_pages_new.html\");\n $view->content->form = $this->get_edit_page_form($existing_page);\n print $view;\n }",
"public function update_page() {\n if (!Visitor::current()->group->can(\"edit_page\"))\n show_403(__(\"Access Denied\"), __(\"You do not have sufficient privileges to edit pages.\"));\n\n if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()->secure_hashkey)\n show_403(__(\"Access Denied\"), __(\"Invalid security key.\"));\n\n if (empty($_POST['title']) and empty($_POST['slug']))\n error(__(\"Error\"), __(\"Title and slug cannot be blank.\"));\n\n $page = new Page($_POST['id']);\n\n if ($page->no_results)\n Flash::warning(__(\"Page not found.\"), \"/admin/?action=manage_pages\");\n\n $page->update($_POST['title'], $_POST['body'], null, $_POST['parent_id'], !empty($_POST['public']), !empty($_POST['show_in_list']), $page->list_order, null, $_POST['slug']);\n\n if (!isset($_POST['ajax']))\n Flash::notice(_f(\"Page updated. <a href=\\\"%s\\\">View Page →</a>\",\n array($page->url())),\n \"/admin/?action=manage_pages\");\n }",
"public function action_edit()\n {\n // Get slug\n $slug = \\avalon\\http\\Router::$params['slug'];\n\n $this->title(l('edit'));\n\n // Fetch the page from the database\n $page = $this->project->wiki_pages->where('slug', $slug)->exec()->fetch();\n\n // Check if the form has been submitted\n if (Request::method() == 'post') {\n // Update the page information\n $page->set(array(\n 'title' => Request::post('title'),\n 'slug' => Request::post('slug'),\n 'project_id' => $this->project->id\n ));\n\n if (Request::post('body') != $page->revision->content) {\n $page->revision = new WikiRevision(array(\n 'wiki_page_id' => $page->id,\n 'revision' => $page->revision->revision + 1,\n 'content' => Request::post('body'),\n 'user_id' => $this->user->id\n ));\n }\n\n // Save and redirect\n if ($page->save()) {\n // Update revision\n $page->revision->save();\n $page->revision_id = $page->revision->id;\n $page->save();\n\n // Insert timeline event\n $timeline = new Timeline(array(\n 'project_id' => $this->project->id,\n 'owner_id' => $page->id,\n 'action' => 'wiki_page_edited',\n 'user_id' => $this->user->id\n ));\n $timeline->save();\n\n if ($this->is_api) {\n return \\API::response(1, array('page' => $page));\n } else {\n Request::redirectTo($page->href());\n }\n }\n }\n\n View::set('page', $page);\n }",
"public function updatepage()\n {\n if(isset($_POST['draft'])){\n $draft = \"no\";\n $id_page = $this->request->getParameter(\"id\");\n $title = $this->request->getParameter(\"title\");\n $slug = $_POST['slug'];\n $content = $this->request->getParameter(\"content\");\n $delimiter = '-';\n $slug = $this->slugify($title, $delimiter);\n $this->page->changePage($title, $slug, $content, $draft, $id_page);\n $this->message->pageUpdated();\n }\n else {\n $id_page = $this->request->getParameter(\"id\");\n $draft = \"yes\";\n $title = $this->request->getParameter(\"title\");\n $slug = $_POST['slug'];\n $content = $this->request->getParameter(\"content\");\n $delimiter = '-';\n $slug = $this->slugify($title, $delimiter);\n $this->page->changePage($title, $slug, $content, $draft, $id_page);\n $this->message->pageUpdated();\n }\n }",
"public function actionUpdate($id = null)\n {\n if ($id === null) {\n $model = new Page();\n $model->display_title = true;\n } else {\n $model = $this->findModel($id);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', Module::t('SAVE_SUCCESS'));\n return $this->redirect(['update', 'id' => $model->id]);\n }\n \n $module = Yii::$app->getModule('pages');\n \n return $this->render($id === null ? 'create' : 'update', [\n 'model' => $model,\n 'module' => $module,\n ]);\n }",
"public function updatePage($page, array $data);",
"public function updatePage(PageContract $page, $data);",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('BerkmanAtlasViewerBundle:Page')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Page entity.');\n }\n\n $editForm = $this->createForm(new PageType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BerkmanAtlasViewerBundle:Page:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AdminAdminBundle:Page')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Page entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AdminAdminBundle:Page:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView()\n ));\n }",
"public function updated(Page $page)\n {\n //\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SettingContentBundle:Page')->find($id);\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Page entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SettingContentBundle:Page:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function updatePage($id, $data)\n\t{\n\t\t//find page\n\t\t$row = $this->find($id)->current();\n\t\tif($row)\n\t\t{\n\t\t\t//clear any cached records that are tagged to this page\n\t\t\t$cache = Zend_Registry::get('cache');\n\t\t\t$tag = \"page_\".$id;\n\t\t\t$cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array($tag));\n\t\t\t\n\t\t\t//update the columns\n\t\t\t$row->name = $data['name'];\n\t\t\t$row->parent_id = $data['parent_id'];\n\t\t\t$row->save();\n\t\t\t\n\t\t\t//unset the data pages data, leaving only \n\t\t\t//the data for the content_nodes table\n\t\t\tunset($data['id']);\n\t\t\tunset($data['name']);\n\t\t\tunset($data['parent_id']);\n\t\t\t\n\t\t\t//now loop thru the rest of the data \n\t\t\t//and set it on the content_nodes table\n\t\t\tif(count($data) > 0)\n\t\t\t{\n\t\t\t\t$contentNodeModel = new Model_ContentNode();\n\t\t\t\tforeach($data as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\t$contentNodeModel->setNode($id, $k, $v);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Zend_Exception('Could not open the page to update!');\n\t\t\t}\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t Yii::$app->session->setFlash('pageTypeID',$model->pageTypeID);\n\t Yii::$app->session['pageID'] = $model->pageID;\n\t Yii::$app->session->setFlash('success', 'Page has been successfully updated.');\n return $this->redirect(['page/#'. $model->pageTypeID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function update($page, array $data);",
"public function pages_edit($id)\n\t{\n\t\t$where = [\n\t\t\t'halaman_id' => $id\n\t\t];\n\n\t\t$data['title'] = 'Edit Halaman';\n\t\t$data['halaman'] = $this->m_data->edit_data($where, 'halaman')->result();\n\t\t$this->load->view('dashboard/v_header', $data);\n\t\t$this->load->view('dashboard/v_pages_edit', $data);\n\t\t$this->load->view('dashboard/v_footer');\n\t}",
"public function savePage() {\n $pageId = $this->request->getParameter(\"id\");\n $title = $this->request->getParameter(\"title\");\n if($this->request->existsParameter(\"content\")) {\n $content = $this->request->getParameter(\"content\");\n }\n else {\n $content = '';\n }\n \n $this->page->update($title, $content, $pageId);\n $this->redirect('admin','editPage/'.$pageId);\n\n }",
"public function getUpdatePage($id)\n\t{\n\t\t$aktiv = 'sok';\n\t\t\n\t\treturn View::make('data_edit')\n\t\t->with('title', 'Rediger måling/oppgave')\n\t\t->with('data', Routine::find($id))\n\t\t->with('aktiv', $aktiv)\n\t\t->with('emp', Emp::lists('user_name', 'id'));\n\t}",
"public function actionEdit($type = null, $id = null)\n {\n $this->adminOnly();\n\n $page = $this->findPageById($id);\n\n if ($page === null) {\n $page = Yii::createObject($this->getPageClassName());\n $page->type = $type;\n $page->content->container = $this->contentContainer;\n }\n\n $page->content->visibility = \\humhub\\modules\\content\\models\\Content::VISIBILITY_PUBLIC;\n\n if ($page->load(Yii::$app->request->post()) && $page->save()) {\n if ($page->type == Container::TYPE_MARKDOWN) {\n \\humhub\\modules\\file\\models\\File::attachPrecreated($page, Yii::$app->request->post('fileUploaderHiddenGuidField'));\n }\n\n return $this->redirect($this->contentContainer->createUrl('list'));\n }\n\n return $this->render('@custom_pages/views/common/edit', [\n 'page' => $page,\n 'sguid' => $this->space->guid,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }",
"public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test 8. PUT request create new object. | public function testPutCreate() {
global $testTripId1;
$this->assertEquals(0, $this->countTestRows());
$data = array('tripId'=>$testTripId1,
'created'=>'2015-10-01',
'updated'=>'2015-10-02',
'name'=>'Test Trip',
'description'=>'Test Description',
'bannerImg'=>'test-01.png',
'startDate'=>'2015-09-01',
'endDate'=>'2015-09-30',
'active'=>'Y',
'deleted'=>'Y',
'hash'=>'forced hash');
$result = putApi('putTrip.php', $data);
$this->assertEquals(RESPONSE_SUCCESS, $result['resultCode']);
$this->assertEquals(1, $this->countTestRows());
$object = new Trip($testTripId1);
$this->assertEquals($testTripId1, $object->getTripId());
// Created and updated fields can NOT be set by the PUT command;
// the automatic values are set, not the ones passed
$this->assertNotNull($object->getCreated());
$this->assertNotEquals('', $object->getCreated());
$this->assertNotEquals('2015-10-01', $object->getCreated());
$this->assertNotNull($object->getUpdated());
$this->assertNotEquals('', $object->getUpdated());
$this->assertNotEquals('2015-10-02', $object->getUpdated());
$this->assertEquals("Test Trip", $object->getName());
$this->assertEquals("Test Description", $object->getDescription());
$this->assertEquals("test-01.png", $object->getBannerImg());
$this->assertEquals("2015-09-01", $object->getStartDate());
$this->assertEquals("2015-09-30", $object->getEndDate());
$this->assertEquals("Y", $object->getActive());
$this->assertEquals("Y", $object->getDeleted());
// Hash field can NOT be set by the PUT command; the hash is
// computed automatically
$this->assertNotNull($object->getHash());
$this->assertNotEquals('', $object->getHash());
$this->assertNotEquals('forced hash', $object->getHash());
} | [
"function testPut() {\n\n $request = new HTTP\\Request('PUT', '/file2', [], 'hello');\n\n $response = $this->request($request);\n\n $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Full response body:' . $response->getBodyAsString());\n\n $this->assertEquals(\n 'hello',\n $this->server->tree->getNodeForPath('file2')->get()\n );\n\n $this->assertEquals(\n [\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => ['\"' . md5('hello') . '\"']\n ],\n $response->getHeaders()\n );\n\n }",
"public function testOrganizationIdResourcePut()\n {\n }",
"function testPutExisting() {\n\n $request = new HTTP\\Request('PUT', '/file1', [], 'bar');\n\n $response = $this->request($request);\n\n $this->assertEquals(204, $response->getStatus());\n\n $this->assertEquals(\n 'bar',\n $this->server->tree->getNodeForPath('file1')->get()\n );\n\n $this->assertEquals(\n [\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => ['\"' . md5('bar') . '\"']\n ],\n $response->getHeaders()\n );\n\n }",
"public function testPut()\n\t {\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/HTTPclientResponder.php\",\n\t\t array(\"param\" => \"value\"),\n\t\t array(\"HTTPclientTest-headers\" => \"value\"),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'value'\", $page);\n\t\t$this->assertContains(\"POST: param = 'value'\", $page);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/HTTPclientResponder.php\",\n\t\t array(\"\" => \"<xml>\"),\n\t\t array(\"HTTPclientTest-headers\" => \"value\"),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'value'\", $page);\n\t\t$this->assertContains(\"Request body: <xml>\", $page);\n\n\t\t$this->object->setRequest(\n\t\t \"HTTPclientResponder.php\",\n\t\t array(\"param\" => array(\"one\", \"two\")),\n\t\t array(\"HTTPclientTest-headers\" => array(\"one\", \"one\"))\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'one'\", $page);\n\t\t$this->assertRegExp(\"/POST: param =.*('one'|'two')/\", $page);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/nonexistentResponder.php\",\n\t\t array(\"param\" => array(\"one\", \"two\")),\n\t\t array(\"HTTPclientTest-headers\" => array(\"one\", \"two\")),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(404, $lastcode);\n\t }",
"public function testPutDocument()\n {\n }",
"function test_it_executes_a_put_route()\n {\n $request = new WP_REST_Request('PUT', $this->resource_route);\n $data = $this->rest->dispatch($request)->get_data();\n $this->assertEquals(['success' => true], $data);\n }",
"public function testWebhookPut()\n {\n $this->webhook->put();\n $this->assertObjectHasAttribute('request', $this->webhook);\n\n // The webhook request object.\n $request = $this->webhook->getRequest();\n $this->assertNotNull($request);\n $this->assertInstanceOf(\"\\Guzzle\\Http\\Message\\EntityEnclosingRequest\", $request);\n $this->assertEquals($request->getMethod(), \"PUT\");\n }",
"public function put(){}",
"public function testUpdateCompanyUsingPUT()\n {\n }",
"public function testResponsibleAPIRequestPUTJson(): void\n {\n $header = new headers\\header;\n\n $_SERVER['REQUEST_METHOD'] = 'PUT';\n $_SERVER['CONTENT_TYPE'] = 'application/json';\n $_GET['query'] = ['a' =>'b', 'foo' => 'bar'];\n $_POST['someData'] = ['a' =>'b', 'foo' => 'bar'];\n\n $responsible = new responsible($this->options, false);\n $responsible->setOption('route', '/mock/123456789');\n $responsible->run();\n\n $this->headers->requestMethod();\n $method = $this->headers->getMethod();\n $payloadBody = $this->headers->getBody();\n\n $this->assertEquals('put', $method->method);\n\n $expected = array_merge($_GET, $_POST);\n $this->assertEquals($expected, $payloadBody);\n }",
"public function testPutProperty()\n {\n }",
"public function testHttpPutPersistenceItemData()\n {\n }",
"public function testUpdateClientUsingPut()\n {\n }",
"public function testCreateOrUpdate(){\n // Todo\n }",
"public function put()\n {\n }",
"public function putAction()\n {\n\n $this->setHeader();\n\n $modelName = $this->getDefaultModel(true);\n\n $request = $this->getRestRequest();\n\n $dataSet = $request->getParams(true);\n\n if (!is_array($dataSet)) {\n $dataSet = array($dataSet);\n }\n\n foreach ($dataSet as $data) {\n\n $result = new RestResponseResult($this->getRestRequest()->getMethod());\n\n $result->setModel($modelName);\n\n if (!isset($data['id'])) {\n\n } else {\n\n $genericModel = $this->getDefaultModel();\n $model = $genericModel->findFirst(\"id = \" . $data['id']);\n\n foreach ($data as $field => $value) {\n\n if ($field == 'id') {\n continue;\n }\n\n\n if (!isset($model->$field)) {\n $result->setCode(\"400\");\n $result->setStatus('bad put request');\n $result->setResult(\n [\"Field $field is not exists in $modelName model\"]\n );\n continue(2);\n } else {\n $model->$field = $value;\n }\n }\n\n if ($model->save()) {\n $result->setCode(\"200\");\n $result->setStatus('updated');\n $result->setResult($model->dump());\n } else {\n $result->setCode(\"400\");\n $result->setStatus('bad put request');\n $result->setResult($model->getMessages());\n }\n\n }\n $this->getRestResponse()->addResult($result);\n }\n\n echo $this->getRestResponse();\n// die();\n }",
"public function putRequest()\n\t{\n\n\t}",
"public function test_update()\n {\n // add a record\n $blog = Blog::factory()->create();\n\n // create new record template \n $newBlog = Blog::factory()->make()->getAttributes();\n\n // request\n $response = $this->putJson('api/blogs/' . $blog->id, $newBlog);\n\n // assert response\n $response->assertStatus(200);\n $response->assertJson([\n 'id' => $blog->id,\n 'title' => $newBlog['title'],\n 'body' => $newBlog['body'],\n ]);\n\n // assert database with will create data.\n $this->assertDatabaseHas('blogs', $newBlog);\n }",
"#[@test]\n public function doPut() {\n $this->assertHandlerForMethodTriggered('PUT');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the name of the xml root node. | protected function getRootNodeName()
{
return static::ROOT_NODE;
} | [
"protected function getRootNodeName()\n {\n \treturn static::ROOT_NODE;\n }",
"public function getRootNodeName() {\n\t\treturn $this->rootNodeName;\n\t}",
"protected function get_root_element() {\n\n\t\treturn self::ROOT_XML_ELEMENT;\n\t}",
"public function getRootNode()\n {\n return self::ROOT;\n }",
"public function getRootName(){\n\t\t\n\t\treturn $this->root_folder_name;\n\t}",
"public function name() {\r\n return $this->node->nodeName;\r\n }",
"public function root(): string\n {\n return $this->root;\n }",
"public function getRootModuleName()\n {\n return $this->rootModule ? $this->rootModule->getName() : null;\n }",
"protected function rootNamespace(): string\n {\n return $this->preset->rootNamespace();\n }",
"public function getCurrentNodeName()\n {\n return $this->getNodeNameByIndex($this->currentNode);\n }",
"function name() {\n\t\tif (!empty($this->namespace)) {\n\t\t\t$_this =& XmlManager::getInstance();\n\t\t\tif (!isset($_this->options['verifyNs']) || !$_this->options['verifyNs'] || in_array($this->namespace, array_keys($_this->namespaces))) {\n\t\t\t\treturn $this->namespace . ':' . $this->name;\n\t\t\t}\n\t\t}\n\t\treturn $this->name;\n\t}",
"public function rootNamespace() :string\n {\n return $this->rootNamespace;\n }",
"public function getRootNode()\n {\n return $this->getNode('/');\n }",
"public function getBaseNodeName()\n {\n return $this->fusionValue('baseNodeName');\n }",
"public function setRootNodeName( $name ) {\n\t\t$this->rootNodeName = $name;\n\t}",
"public function tagname()\n {\n return $this->_node->nodeName;\n }",
"public function getName() {\n\t\treturn $this->nodeData->getName();\n\t}",
"public function getLocalName() : string\n {\n return $this->localName;\n }",
"function getLocalName() {\n\t\treturn $this->e->localName;\n//\t\treturn $this->e->tagName;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getStoreItemAsync Get a single store item | public function getStoreItemAsync($id)
{
return $this->getStoreItemAsyncWithHttpInfo($id)->then(function ($response) {
return $response[0];
});
} | [
"public function getStoreAsync($options)\n {\n return $this->getStoreAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function get($id, $storeId = null);",
"public function getSellItem()\n {\n return $this->get(self::_SELL_ITEM);\n }",
"public function getSaleItem();",
"public function get($stockItemId);",
"public function get(string $sku)\n {\n return $this->request(\n 'getInventoryItem',\n 'GET',\n \"inventory_item/$sku\",\n null,\n [],\n []\n );\n }",
"function findItem($itemId): Item;",
"public function findItem(string $sku): ?CartItem;",
"public function getStoreInfo();",
"public function getItem()\n {\n return $this->item;\n }",
"function GetItem() {\r\n\t\treturn new Item($this->item);\r\n\t}",
"function lookup_store($site_name, $store_name) {\n $ret = get_store_list($site_name);\n if (!$ret->success) return $ret;\n foreach ($ret->stores as $store) {\n if ($store_name == $store->name) {\n $ret->store = $store;\n return $ret;\n }\n }\n $ret->success = false;\n $ret->message = \"no such store\";\n return $ret;\n}",
"public function getItem(): CmsItemInterface;",
"public function getStoreAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\StoreResponse';\n $request = $this->getStoreRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"private static function LoadUserStore(string $store_name)\n {\n return \\App\\User::find(Auth::id())->EtsyStoresAll->where('name', $store_name)->first();\n }",
"public function getExchangeItem($key);",
"public function getItem()\n {\n return parent::getValue('item');\n }",
"public function getById($id) {\n\n $sql = \"SELECT * FROM store WHERE id = {$id}\";\n\n return $this->query($sql);\n }",
"public function showItem($id)\n {\n $item = Items::where('id', $id)->first();\n if ($item) {\n return $item;\n } else {\n return response()->json([\n 'message' => 'Item not found',\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a message from a channel. Permissions that may be checked: Channel.PostMessage, Channel.PostMessagesInThreads | public function deleteMessage(array $data): void
{
$uri = 'chats/messages/delete-message';
$required = [
'channel' => self::TYPE_STRING,
'id' => self::TYPE_STRING,
];
$this->throwIfInvalid($required, $data);
$this->client->post($this->buildUrl($uri), $data);
} | [
"function deleteDirectMessage($message_id) {\n\t\t\t$params['message_id'] = $message_id;\n\t\t\treturn $this->methodCall('/messages/message/'.$message_id.'/delete.json', 'post', $params);\n\t\t}",
"public function deleteMessage()\n {\n }",
"public function testDeleteMessage()\n {\n $config = new Configuration();\n// $config->setHost(\"http://127.0.0.1:8080\");\n $apiInstance = new DaDaPushMessageApi(\n // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n // This is optional, `GuzzleHttp\\Client` will be used as default.\n new \\GuzzleHttp\\Client(),\n $config\n );\n\n $channel_token = 'ctb3lwO6AeiZOwqZgp8BE8980FdNgp0cp6MCf';\n $message_id=227845;\n $result = $apiInstance->deleteMessage($message_id, $channel_token);\n print_r($result);\n self::assertTrue($result->getCode()==0);\n }",
"public function delete() {\r\n\t\tImperator::getDatabaseManager()->getChatTable()->deleteMessage($this);\r\n\t}",
"public function deleteMessage()\n {\n // need to delete the message from the server?\n if (!$this->info['ema_leave_copy']) {\n imap_delete($this->mbox, $this->num);\n } else {\n // mark the message as already read\n imap_setflag_full($this->mbox, $this->num, '\\\\Seen');\n }\n }",
"public function deleteMessage(Zend_Queue_Message $message)\n {\n \treturn $this->_pheanstalk->delete($message->handle);\n }",
"protected function deleteMessage( $message ) {\n\t\tPendingDatabase::get()\n\t\t\t->deleteMessage( $message );\n\t}",
"public function messageDeleteEndpoint() {\n\t\t$this->jsonContentType();\n\t\t$this->verifyXhrRequest();\n\t\t$this->verifyCheckSum();\n\n\t\t$response = array();\n\t\ttry {\n\t\t\t$this->checkIpNotKicked();\n\t\t\t$this->checkChatOpen();\n\t\t\t$this->checkUserAuthentication();\n\t\t\t$this->checkUserRight('delete_message');\n\t\t\t$this->checkPostParams(array('channelId', 'messageId'));\n\n $channelId = trim($this->getPostParam('channelId'));\n\t\t\t$messageId = trim($this->getPostParam('messageId'));\n\t\t\t$channel = $this->channelsDAO->get($channelId);\n\n\t\t\t$this->checkChannel($channel);\n\t\t\t$this->checkChannelAuthorization($channel);\n\n\t\t\t$this->messagesService->deleteById($messageId);\n\t\t\t$this->actions->publishAction('deleteMessage', array('id' => $messageId, 'channel' => $channel->getName()));\n\n\t\t\t$response['result'] = 'OK';\n\t\t} catch (WiseChatUnauthorizedAccessException $exception) {\n\t\t\t$response['error'] = $exception->getMessage();\n\t\t\t$this->sendUnauthorizedStatus();\n\t\t} catch (Exception $exception) {\n\t\t\t$response['error'] = $exception->getMessage();\n\t\t\t$this->sendBadRequestStatus();\n\t\t}\n\n\t\techo json_encode($response);\n\t\tdie();\n\t}",
"public function delete()\n {\n if (! $this->canDelete) {\n return;\n }\n\n $this->channel->delete();\n\n $this->notify(\n 'Channel successfully deleted.',\n 'hub.channels.index'\n );\n }",
"public function deleteMessage(Zend_Queue_Message $message) {\n $headers = (4 === func_num_args()) ? (array) func_get_arg(3) : array();\n $this->connect();\n $frame = $this->getDeleteFrame($message, $headers);\n $this->getStompClient()->send($frame);\n\n return true;\n }",
"public function delete()\n {\n $db = $_SESSION[\"database\"];\n $db->delete(\"ChatMessage\", \"MessageID = '$this->id'\");\n }",
"public function delete($throw = true)\n {\n if ($this->_connected) {\n if ($this->getQueue()->getAdapter()->isSupported('deleteMessage')) {\n $this->getQueue()->deleteMessage($this);\n }\n } elseif ($throw) {\n throw new Core_Queue_Exception('Disconnected from queue. Cannot delete message from queue.');\n }\n }",
"public function deleted(ChatMessage $chatMessage)\n {\n //\n }",
"public function testDeleteMessage()\n {\n $this->markTestIncomplete(\n 'Test of \"deleteMessage\" method has not been implemented yet.'\n );\n }",
"public function delete() {\n\t\t$message = $this->discussion->message(['id' => $this->request->id]);\n\n\t\tif ($this->discussion->pull_message($message)) {\n\t\t\treturn $this->render(['head' => true, 'status' => 204]);\n\t\t}\n\n\t\treturn $this->render(['head' => true, 'status' => 400]);\n\t}",
"public function deleting(ContactMessage $contact)\n {\n //\n }",
"public function delete(object $message, string $path): bool;",
"public function testDeleteMessage()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function deleteMessage(Zend_Queue_Message $message)\n {\n if ($this->getAdapter()->isSupported('deleteMessage')) {\n return $this->getAdapter()->deleteMessage($message);\n }\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Terse exception handler Sends only simplified exception message in plain text | public function handlerTerse($exception)
{
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error', true, 500);
header('Content-type: text/plain; charset=UTF-8');
}
echo sprintf('Bad Moss: %s ( %s at line:%s )', $exception->getMessage(), $exception->getFile(), $exception->getLine());
} | [
"public function handlerVerbose(\\Exception $exception)\n {\n if (!headers_sent()) {\n header('HTTP/1.1 500 Internal Server Error', true, 500);\n header('Content-type: text/html; charset=UTF-8');\n }\n\n echo sprintf(\n '<!DOCTYPE html>\n <html>\n <head>\n <title>Bad Moss: %1$s - %2$s - %3$s:%4$u</title>\n <style>\n body, code { font: medium/1.5em monospace; }\n\n div:nth-child(4) { position: fixed; right: 0.5em; top: 0.5em; width: 100%; padding: 0.25em 1em; }\n div:nth-child(4) a { text-decoration: none; padding: 0.25em 0.75em; color: #ffe; background: #8c3; border-radius: 1em; }\n\n table { width: auto; border-collapse: collapse; overflow: hidden; }\n\n td { vertical-align: top; }\n td:nth-child(1) { position: relative; width: 3em; padding: 0 0.5em 0 0; text-align: right; color: #999; border-right: 1px solid #999; z-index: 1; }\n td:nth-child(2) { position: relative; padding: 0 0 0 0.5em; z-index: 2; }\n\n td, td span { white-space: nowrap; }\n td span#mark { position: relative; font-weight: bold; color: #f00; }\n td span#mark:after { content: \\'.\\'; position: absolute; top: -0.2em; left: -2em; width: 10000em; background: #f00; opacity: 0.25; }\n </style>\n </head>\n <body>\n <h1>Bad Moss: %1$s - "%2$s"</h1>\n\n <div>\n <h2 id=\"trace\">Trace</h2>\n %6$s\n </div>\n <div>\n <h2 id=\"listing\">File: %3$s:%4$u</h2>\n %5$s\n </div>\n <div>\n <a href=\"#trace\">Trace</a>\n <a href=\"#listing\">Listing</a>\n <a href=\"#mark\">Error line</a>\n </div>\n </body>\n </html>',\n get_class($exception),\n $exception->getMessage(),\n $exception->getFile(),\n $exception->getLine(),\n $this->lineNumbers('<br />', highlight_file($exception->getFile(), true), $exception->getLine()),\n $this->prettyCode($exception->getTrace())\n );\n }",
"public function exceptionMessage(): string {}",
"function myExceptionHandler($exception) {\r\n echo \"Simplate: Uncaught exception: <p>\" . $exception->getMessage() . \"</p><pre>\" . $exception->getTraceAsString(), \"</pre>\";\r\n}",
"function exceptionHandler($e) {\r\n\techo \"<div style=\\\"padding: 20px; margin-bottom: 10px; font-family: monospace; font-size: 16px; border: 2px solid #FF0000; background :#FFCC00; white-space: pre;\\\">\";\r\n\techo '<strong>Uncaught ' . get_class($e) . '</strong> (' . $e->getCode() . \")\\n\\n\";\r\n\techo \"<strong>Location</strong>: \" . $e->getFile() . \" line \" . $e->getLine() . \"\\n\";\r\n\techo \"<strong> Message</strong>: \" . htmlentities($e->getMessage()) . \"\\n\";\r\n\techo \"<strong> Stack</strong>:\\n<div style=\\\"padding: 5px 0px 0px 50px\\\">\" . htmlentities($e->getTraceAsString ()) . \"</div>\";\r\n\techo \"</div>\";\r\n}",
"public function format(\\Exception $e);",
"public function exceptionMessage(): string;",
"private function _enqueue_exception_message()\n {\n $this->_set_view('generic', array(\n 'p' => $this->exception_message,\n 'id' => 'error',\n ));\n }",
"function uncaught_exception_handler($e)\n{\n ob_end_clean(); //dump out remaining buffered text\n $vars['message']=$e;\n die(View::do_fetch(APP_PATH.'errors/exception_uncaught.php',$vars));\n}",
"function debug_exception_handler($ex) {\n if (php_sapi_name() == 'cli') {\n echo \"Error (code:\".$ex->getCode().\") :\".$ex->getMessage().\"\\n at line \".$ex->getLine().\" in file \".$ex->getFile().\"\\n\";\n echo $ex->getTraceAsString().\"\\n\";\n } else {\n echo \"<p style='font-family:helvetica,sans-serif'>\\n\";\n echo \"<b>Error :</b>\".$ex->getMessage().\"<br />\\n\";\n echo \"<b>Code :</b>\".$ex->getCode().\"<br />\\n\";\n echo \"<b>File :</b>\".$ex->getFile().\"<br />\\n\";\n echo \"<b>Line :</b>\".$ex->getLine().\"</p>\\n\";\n echo \"<div style='font-family:garamond'>\".nl2br(htmlspecialchars($ex->getTraceAsString())).\"</div>\\n\";\n }\n exit -1;\n}",
"public function render(\\Throwable $exception): FlattenException;",
"protected function send_error($ex=null) {\n $this->send_headers();\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.\"\\n\";\n $xml .= '<EXCEPTION class=\"'.get_class($ex).'\">'.\"\\n\";\n $xml .= '<MESSAGE>'.htmlentities($ex->getMessage(), ENT_COMPAT, 'UTF-8').'</MESSAGE>'.\"\\n\";\n if (debugging() and isset($ex->debuginfo)) {\n $xml .= '<DEBUGINFO>'.htmlentities($ex->debuginfo, ENT_COMPAT, 'UTF-8').'</DEBUGINFO>'.\"\\n\";\n }\n $xml .= '</EXCEPTION>'.\"\\n\";\n echo $xml;\n }",
"abstract protected function echoExceptionWeb(\\Exception $exception);",
"public function renderForConsole(Exception $e);",
"function posib_exception_handler( Exception $oPosibException ) {\n\t$oPosibException->render();\n\tdie();\n}",
"function unhandled_exception_handler($exception) {\n print 'Unhandled Exception: ' . $exception->getMessage() . $eol\n . $space . $space\n . str_replace(PHP_EOL,\n $eol . $space . $space,\n $exception->getTraceAsString());\n}",
"function exception_handler(Exception $e)\n{\n echo \"<pre>\";\n echo 'Uncaught exception ' . $e->getMessage() . ' in ' . $e->getFile() . ' line, ' . $e->getLine() . \"\\n\";\n echo $e->getTraceAsString() . \"</pre>\";\n}",
"public static function handler(Exception $e)\n {\n try {\n\n if (Request::$current !== NULL\n && Request::current()->is_ajax() === TRUE\n && Kohana::$environment !== Kohana::PRODUCTION) {\n header('Content-Type: text/plain; charset='.Kohana::$charset, TRUE, 500);\n self::_print($e);\n }\n\n if (Kohana::$environment === Kohana::PRODUCTION && ! self::$custom_view_file)\n Kohana_Kohana_Exception::$error_view = self::get_view_file($e);\n elseif (self::$custom_view_file)\n Kohana_Kohana_Exception::$error_view = self::$custom_view_file;\n\n parent::handler($e);\n\n } catch(Exception $e) {\n /**\n * Things are going *really* badly for us, We now have no choice\n * but to bail. Hard.\n */\n // Clean the output buffer if one exists\n ob_get_level() AND ob_clean();\n\n // Set the Status code to 500, and Content-Type to text/plain.\n header('Content-Type: text/plain; charset='.Kohana::$charset, TRUE, 500);\n\n echo Kohana_Exception::text($e);\n\n exit(1);\n }\n }",
"function debug_exception_handler($ex) {\n//\tLogger::log('[EXCEPTION] error:'.$ex->getMessage().', code: '.$ex->getCode().', file:'.$ex->getFile().', line:'.$ex->getLine());\n//\theader(\"Location:/404\");\n\n if (php_sapi_name() == 'cli') {\n echo \"Error (code:\".$ex->getCode().\") :\".$ex->getMessage().\"\\n at line \".$ex->getLine().\" in file \".$ex->getFile().\"\\n\";\n echo $ex->getTraceAsString().\"\\n\";\n } else {\n echo \"<p style='font-family:helvetica,sans-serif'>\\n\";\n echo \"<b>Error :</b>\".$ex->getMessage().\"<br />\\n\";\n echo \"<b>Code :</b>\".$ex->getCode().\"<br />\\n\";\n echo \"<b>File :</b>\".$ex->getFile().\"<br />\\n\";\n echo \"<b>Line :</b>\".$ex->getLine().\"</p>\\n\";\n echo \"<div style='font-family:garamond'>\".nl2br(htmlspecialchars($ex->getTraceAsString())).\"</div>\\n\";\n }\n\n exit -1;\n}",
"public function testExceptionMessageCoercion(): void\n {\n Configure::write('debug', false);\n $exception = new MissingActionException('Secret info not to be leaked');\n $ExceptionRenderer = new WebExceptionRenderer($exception);\n\n $this->assertInstanceOf(\n 'Cake\\Controller\\ErrorController',\n $ExceptionRenderer->__debugInfo()['controller']\n );\n $this->assertEquals($exception, $ExceptionRenderer->__debugInfo()['error']);\n\n $result = (string)$ExceptionRenderer->render()->getBody();\n\n $this->assertSame('error400', $ExceptionRenderer->__debugInfo()['template']);\n $this->assertStringContainsString('Not Found', $result);\n $this->assertStringNotContainsString('Secret info not to be leaked', $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should assert that each top level subdirectory has the current directory instance as parent. | public function testParentSubDirectories()
{
$subDirectories = [
new Directory('foo'),
new Directory('bar')
];
$collection = new DirectoryCollection;
foreach ($subDirectories as $directory) {
$collection->push($directory);
}
$directory = new Directory('foo', $collection);
$subDirectories = $directory->getSubDirectories()->all();
foreach ($subDirectories as $subDirectory) {
$this->assertEquals(
$directory,
$subDirectory->getParent()
);
}
} | [
"public function testWithParentDirectoryParts()\n {\n self::assertSame('/foo/baz/', UrlPath::parse('/foo/bar/../baz/')->__toString());\n self::assertSame('/baz/', UrlPath::parse('/foo/bar/../../baz/')->__toString());\n self::assertSame('foo/bar/', UrlPath::parse('foo/bar/baz/..')->__toString());\n self::assertSame('foo/bar/file', UrlPath::parse('foo/bar/baz/../file')->__toString());\n }",
"public function testGettingDirectoriesWithRecursion()\n {\n $this->assertEquals([\n __DIR__ . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'subdirectory',\n __DIR__ . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'subdirectory' . DIRECTORY_SEPARATOR . 'subdirectory'\n ], $this->fileSystem->getDirectories(__DIR__ . DIRECTORY_SEPARATOR . 'files', true));\n }",
"public function testGettingDirectoriesWithoutRecursion()\n {\n $this->assertEquals(\n [__DIR__ . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'subdirectory'],\n $this->fileSystem->getDirectories(__DIR__ . DIRECTORY_SEPARATOR . 'files')\n );\n }",
"public function ensureParentDirectories($path) {}",
"public function testDir() {\n\t\t$dirs = array(\n\t\t\t'folderA',\n\t\t\t'/folderA',\n\t\t\t'folderA/',\n\t\t\t'//folderA',\n\t\t\t'folderA//',\n\t\t\t' folderA ',\n\t\t\t'/folderB/../folderA/',\n\t\t\t'/folderA/../folderB/../folderA/',\n\t\t\t'/folderB/././../folderA/../folderB/./../folderA',\n\t\t);\n\t\t$expected = '/folderA/';\n\t\t\n\t\tforeach($dirs as $dir) {\n\t\t\t$x = $this->_getX($dir);\n\t\t\t$this->assertEqual($x->getDirPath(false), $expected);\n\t\t}\n\t\t\n\t\t// directory paths above root\n\t\t$dirs = array(\n\t\t\t'/../'\n\t\t);\n\t\t$expected = '/';\n\t\t\n\t\tforeach($dirs as $dir) {\n\t\t\t$x = $this->_getX($dir);\n\t\t\t$this->assertEqual($x->getDirPath(false), $expected);\n\t\t}\n\t\t\n\t\t// accessing a non-existant directory throws exception\n\t\t$this->expectException('Exception');\n\t\t$x = $this->_getX('/non-existant-dir/');\n\t\t\n\t}",
"public function testGetRootFolderName()\n {\n $parent = $this->objFromFixture('Page', 'parentpage');\n $child = $this->objFromFixture('Page', 'subpage');\n\n //test if fixtures are set up properly\n $this->assertEquals($parent->ID, $child->ParentID, 'subpage should be a child of parentpage');\n\n $this->assertStringEndsWith(\n $child->RootFolder()->Name . '/',\n $child->getRootFolderName(),\n 'FolderName should be at the end of getRootFolderName()'\n );\n\n $root = Config::inst()->get(RootFolder::class, 'folder_root');\n $this->assertStringStartsWith(\n $root . '/' . $parent->RootFolder()->Name,\n $child->getRootFolderName(),\n 'Parents FolderName should be at the beginning of getRootFolderName()'\n );\n\n $this->assertStringStartsWith(\n ASSETS_DIR,\n $child->getRootFolderName(false),\n 'ASSETS_DIR should be at the beginning of getRootFolderName(false)'\n );\n }",
"public function testCreateWithEmptySubdirectories()\n {\n $directory = new Directory('foo');\n $this->assertEmpty($directory->getSubDirectories()->all());\n }",
"public function test_subdir_of_another() {\n\t\tglobal $gc_filesystem;\n\t\t$fs = $gc_filesystem;\n\t\t$fs->init(\n\t\t\t'\n\t\t\t/gc.example.com/index.php\n\t\t\t/gc.example.com/gechiui/\n\t\t\t/gc.example.com/gechiui/gc-includes/\n\t\t\t/gc.example.com/gechiui/index.php\n\t\t\t/gc-includes/\n\t\t\t/index.php\n\t\t'\n\t\t);\n\n\t\t$path = $fs->abspath( '/var/www/example.com/gc.example.com/gechiui/' );\n\t\t$this->assertSame( '/gc.example.com/gechiui/', $path );\n\n\t\t$path = $fs->abspath( '/var/www/example.com/' );\n\t\t$this->assertSame( '/', $path );\n\n\t}",
"public function testGetParentDirectory()\n {\n\n $this->assertSame(\n $this->ParentDirectory,\n $this->object->getParentDirectory(),\n 'Fails if function not defined, value not retained, or value not'\n . ' returned'\n );\n\n }",
"public function testCreateWithEmptySubdirectories()\n {\n $directory = $this->factory->create('foo');\n $this->assertEmpty($directory->getSubDirectories()->all());\n }",
"public function testPathNoForwardSlash(): void\n {\n self::assertSame($this->subPath, Directory::path('sub/path'));\n }",
"public function testPath(): void\n {\n self::assertSame($this->subPath, Directory::path($this->subPath));\n }",
"public function testFolder() {\n\t\t$parent =& $this->object->folder();\n\t\t$this->assertInstanceOf('titon\\io\\Folder', $parent);\n\t\t$this->assertEquals(APP_TEMP, $parent->path());\n\t}",
"public function testFilesChildren()\n {\n }",
"public function testBaseDir()\n {\n $this->doTestBaseDirOrRelativePaths(true);\n }",
"public function parentSubDirAndSuffix()\n {\n $finder = new ClassFinder;\n $finder->setRootDirectory(__DIR__ . '/Fixtures/Bundle');\n $finder->setRootNamespace(__NAMESPACE__ . '\\\\Fixtures\\\\Bundle');\n $this->assertSameArrayContents([\n 'Darsyn\\\\ClassFinder\\\\Tests\\\\Fixtures\\\\Bundle\\\\Controllers\\\\SecondaryController',\n 'Darsyn\\\\ClassFinder\\\\Tests\\\\Fixtures\\\\Bundle\\\\Controllers\\\\DefaultController',\n ], $finder->findClasses(\n 'Controllers',\n 'Controller',\n 'Darsyn\\\\ClassFinder\\\\Tests\\\\Fixtures\\\\ControllerInterface'\n ));\n }",
"public function testFoldersGetByParentId()\n {\n }",
"public function testFolder() {\n\t\t$parent =& $this->object->folder();\n\t\t$this->assertInstanceOf('titon\\io\\Folder', $parent);\n\t\t$this->assertEquals(APP_TEMP . 'io/', $parent->path());\n\t}",
"public function testGetParent(): void\n {\n $this->url = UrlBuilder::createFromUrl('/users/:userId/comments/:commentId')\n ->addParams([\n 'userId' => 10,\n 'commentId' => 1\n ]);\n\n self::assertEquals(self::PATH_USER_COMMENTS, $this->url->getParent()->getRelativePath());\n self::assertEquals('/users/10', $this->url->getParent(2)->getRelativePath());\n self::assertEquals('/users', $this->url->getParent(3)->getRelativePath());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check vardefs for module | protected function checkVardefs($module, $object, $stock = false, $status = HealthCheckScannerMeta::STUDIO_MB_BWC)
{
$custom = '';
if ($status == HealthCheckScannerMeta::CUSTOM) {
$custom = 'Custom';
}
if ($module == 'DynamicFields') {
// this one is an odd one
return true;
}
$this->log("Checking vardefs for $module");
VardefManager::loadVardef($module, $object);
if (empty($GLOBALS['dictionary'][$object]['fields'])) {
$this->log("Failed to load vardefs for $module:$object");
return true;
}
$seed = BeanFactory::getBean($module);
if (empty($seed)) {
$this->log("Failed to instantiate bean for $module, not checking vardefs");
return true;
}
$fieldDefs = $GLOBALS['dictionary'][$object]['fields'];
// get names of 'stock' fields, that are defined in original vardefs.php
$stockFields = $this->loadFromFile("modules/$module/vardefs.php", 'dictionary');
$stockFields = (!empty($stockFields[$seed->object_name]) && is_array($stockFields[$seed->object_name]['fields'])) ?
array_keys($stockFields[$seed->object_name]['fields']) : array();
foreach ($fieldDefs as $key => $value) {
if (!empty($this->bad_vardefs[$module]) && in_array($key, $this->bad_vardefs[$module])) {
continue;
}
if (empty($value['name']) || $key != $value['name']) {
$nameValue = (!empty($value['name'])) ? $value['name'] : '';
$this->updateStatus("badVardefsKey", $key, $nameValue, $module);
continue;
}
// Check "name" field type, @see CRYS-130
if ($key == 'name' && $value['type'] != 'name') {
// Assume those types are valid, cause they used in stock modules
$validNameTypes = array('id', 'fullname', 'varchar');
if (!in_array($value['type'], $validNameTypes)) {
$this->updateStatus('badVardefsName', $value['type'], $module);
continue;
}
}
if ($key == 'team_name') {
if (empty($value['module'])) {
$this->updateStatus("badVardefsRelate", $key, $module);
}
// this field is really weird, let's leave it alone for now
continue;
}
if (!empty($value['function']['returns']) && // there is function in vardefs
$value['function']['returns'] == 'html' && // that returns html
!isset($this->templateFields[$key]) && // and field isn't in white-list
(!$stock || !in_array(
$key,
$stockFields
)) // and it is non-stock module or it is stock module but field is non-stock
) {
$this->updateStatus("vardefHtmlFunctionName" . $custom, $value['function']['name'], $module, $key);
}
if (!empty($value['type'])) {
switch ($value['type']) {
case 'date' :
case 'datetime' :
case 'time' :
if (!empty($value['display_default']) && preg_match('/^\-.+\-$/', $value['display_default'])) {
$this->updateStatus('vardefIncorrectDisplayDefault', $key, $module);
}
break;
case 'enum':
case 'multienum':
if (!empty($value['function']['returns']) && $value['function']['returns'] == 'html') {
// found html functional field
$this->updateStatus("vardefHtmlFunction" . $custom, $key);
}
// Check option-list multienum fields
if ($value['type'] == 'multienum'
&& !empty($value['options'])
&& !empty($GLOBALS['app_list_strings'][$value['options']])
) {
$optionKeys = array_keys($GLOBALS['app_list_strings'][$value['options']]);
// Strip all valid characters in dropdown keys - a-zA-Z0-9. and spaces
$result = preg_replace('/[\w\d\s\.]/', '', $optionKeys);
// Get unique chars
$result = count_chars(implode('', $result), 3);
if ($result) {
$this->updateStatus("badVardefsMultienum", $value['name'], $value['options'], $result, $module);
}
}
break;
case 'link':
$seed->load_relationship($key);
if (empty($seed->$key)) {
$this->updateStatus("badVardefsLink", $key, $module);
}
break;
case 'relate':
if (!empty($value['link'])) {
$lname = $value['link'];
if (empty($fieldDefs[$lname])) {
;
$this->updateStatus("badVardefsKey", $key, $lname, $module);
break;
}
$seed->load_relationship($lname);
if (empty($seed->$lname)) {
$this->updateStatus("badVardefsRelate", $key, $module);
break;
}
$relatedModuleName = $seed->$lname->getRelatedModuleName();
if (empty($relatedModuleName)) {
break;
}
$relatedBean = BeanFactory::newBean($relatedModuleName);
if (empty($relatedBean)) {
break;
}
}
if ((empty($value['link_type']) || $value['link_type'] != 'relationship_info') &&
empty($value['module'])) {
$this->updateStatus("badVardefsRelate", $key, $module);
}
break;
}
}
if (empty($value['source']) || $value['source'] == 'db' || $value['source'] == 'custom_fields') {
// check fields
if (isset($value['fields'])) {
$this->checkFields($key, $value['fields'], $fieldDefs, $custom, $module);
}
// check db_concat_fields
if (isset($value['db_concat_fields'])) {
$this->checkFields($key, $value['db_concat_fields'], $fieldDefs, $custom, $module);
}
// check sort_on
if (!empty($value['sort_on'])) {
if (is_array($value['sort_on'])) {
$sort = $value['sort_on'];
} else {
$sort = array($value['sort_on']);
}
$this->checkFields($key, $sort, $fieldDefs, $custom, $module);
}
}
}
// check if we have any type changes for vardefs, BR-1427
$this->checkVardefTypeChange($module, $object);
} | [
"protected function checkVardefs($module, $object)\n {\n if(empty($GLOBALS['dictionary'][$object]['fields'])) {\n $this->log(\"Failed to load vardefs for $module:$object\");\n return true;\n }\n $status = true;\n $dictionary = array();\n if (is_file('modules/' . $module . '/vardefs.php')) {\n include FileLoader::validateFilePath('modules/' . $module . '/vardefs.php');\n }\n\n foreach($GLOBALS['dictionary'][$object]['fields'] as $key => $value) {\n if(empty($value['name']) || $key != $value['name']) {\n if (empty($dictionary[$object]['fields'][$key]) || $dictionary[$object]['fields'][$key] != $value) {\n $this->log(\"Bad vardefs - key $key, name {$value['name']}\");\n $status = false;\n }\n }\n\n // Check \"name\" field type, @see CRYS-130\n if ($key == 'name' && $value['type'] != 'name') {\n\n // Assume those types are valid too, cause they used in stock modules for \"name\" field\n $validNameTypes = array('id', 'fullname', 'varchar');\n if (!in_array($value['type'], $validNameTypes)) {\n $this->log(\"Bad vardefs - 'name' field type is invalid '{$value['type']}', module - '$module'\");\n $status = false;\n }\n }\n\n if(!empty($value['type']) && ($value['type'] == 'enum' || $value['type'] == 'multienum')\n && !empty($value['function']['returns']) && $value['function']['returns'] == 'html'\n ) {\n // found html functional enum\n $this->log(\"Vardef $key has HTML function\");\n $status = false;\n }\n }\n\n return $status;\n }",
"public function hasModuleVar($moduleVar);",
"protected function checkVardefTypeChange($module, $object)\n {\n if (!file_exists(\"modules/$module/vardefs.php\")) {\n // can't find original vardefs, don't mess with it\n return;\n }\n $full_vardefs = $GLOBALS['dictionary'][$object];\n unset($GLOBALS['dictionary'][$object]);\n global $dictionary;\n include \"modules/$module/vardefs.php\";\n // load only original vardefs\n if (!empty($GLOBALS['dictionary'][$object])) {\n $original_vardefs = $GLOBALS['dictionary'][$object];\n } else {\n return;\n }\n // return vardefs back to old state\n $GLOBALS['dictionary'][$object] = $full_vardefs;\n $original_vardefs['fields'] = (is_array($original_vardefs['fields'])) ? $original_vardefs['fields'] : array();\n foreach ($original_vardefs['fields'] as $name => $def) {\n if (empty($def['type']) || empty($def['name'])) {\n continue;\n }\n if (!empty($def['source']) && $def['source'] != 'db') {\n continue;\n }\n $real_type = $this->db->getFieldType($full_vardefs['fields'][$name]);\n $original_type = $this->db->getFieldType($def);\n if (empty($real_type)) {\n // If we can't find the type, this is some serious breakage\n $this->updateStatus(\"fieldTypeMissing\", $module, $name);\n continue;\n }\n if (!in_array($real_type, $this->blob_types)) {\n // Per ENGRD-263, we are only interested in changes to blob type\n continue;\n }\n if (!in_array($original_type, $this->blob_types)) {\n // We have changed from non-blob type to blob type, not good\n $this->updateStatus(\"typeChange\", $module, $name, $original_type, $real_type);\n }\n }\n }",
"public function loadVardefs() {\n\t\t$dir = str_replace('_','/',$class = get_class($this));\n\t\t$defs = SugarAutoLoader::existingCustomOne(\"modules/Connectors/connectors/sources/{$dir}/vardefs.php\");\n\t\tif(!empty($defs)) {\n\t\t\trequire $defs;\n\t\t}\n\n\t\t$this->_field_defs = !empty($dictionary[$class]['fields']) ? $dictionary[$class]['fields'] : array();\n \t}",
"public function validateModule()\n {\n }",
"public function checkDefsLoaded() {\r\n return isset(Proj4php::$defs[$this->srsCode]) && !empty(Proj4php::$defs[$this->srsCode]);\r\n }",
"function variable_list_module($module) {\n $list = array();\n foreach (variable_get_info() as $name => $variable) {\n if ($variable['module'] == $module) {\n $list[$name] = $variable;\n }\n }\n return $list;\n}",
"function get_defined_vars()\n{\n}",
"function CheckModule($name)\n{\n\tglobal $modules;\n\n\tif (array_key_exists($name, $modules)) {\n\t\tforeach ($modules[$name]['javascript'] as $name_file) {\n\t\t\tif (!file_exists('javascript/' . $name_file))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ($modules[$name]['php'] as $name_file) {\n\t\t\tif (!file_exists('includes/' . $name_file))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}\n\telse\n\t\treturn FALSE;\n}",
"private function verifyModules() {\n\t\t\n\t\tif(!$this->getGD()) {\n\t\t\t$this->error = true;\n\t\t\t$this->message = \"GD is disabled\";\n\t\t\texit();\n\t\t}\n\t}",
"public function isValidModule($module);",
"function drupal_check_module($module) {\n // Include install file\n $install = drupal_get_install_files(array($module));\n if (isset($install[$module])) {\n require_once DRUPAL_ROOT . '/' . $install[$module]->filename; \n\n // Check requirements\n $requirements = module_invoke($module, 'requirements', 'install');\n if (is_array($requirements) && drupal_requirements_severity($requirements) == REQUIREMENT_ERROR) {\n // Print any error messages\n foreach ($requirements as $requirement) {\n if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {\n $message = $requirement['description'];\n if (isset($requirement['value']) && $requirement['value']) {\n $message .= ' ('. t('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')';\n }\n drupal_set_message($message, 'error');\n }\n }\n return FALSE;\n }\n }\n return TRUE;\n}",
"function module_exists($module) {\n $list = module_list();\n return isset($list[$module]);\n}",
"private function variableCheck()\n {\n\n }",
"protected function checkRequiredModules()\n\t{}",
"function module_exist($name) {\n $list = module_list();\n return isset($list[$name]) ? 1 : 0;\n}",
"public function has_variables() {\n $bundled_items = $this->get_bundled_items();\n foreach ( $bundled_items as $bundled_item ) {\n if ( $bundled_item->has_variables() ) {\n return true;\n }\n }\n\n return false;\n }",
"protected function isVardefFile($file)\n {\n if ($this->isVardefsFileNameOrDir($file)) {\n return true;\n }\n \n // check manifest file\n if (isset($this->installdefs['vardefs'])) {\n foreach ($this->installdefs['vardefs'] as $pack) {\n $pack['from'] = str_replace('<basepath>', '', $pack['from']);\n if ($pack['from'] == str_replace($this->baseDir, '', $file)) {\n return true;\n }\n }\n }\n\n // check distination\n if (isset($this->installdefs['copy'])) {\n foreach ($this->installdefs['copy'] as $pack) {\n $pack['from'] = str_replace('<basepath>', '', $pack['from']);\n if ($pack['from'] == str_replace($this->baseDir, '', $file)) {\n // check target file or dir\n if (isset($pack['to'])) {\n return $this->isVardefsFileNameOrDir($pack['to']);\n }\n }\n }\n }\n\n return false;\n }",
"static private function CheckModuleList ()\n {\n foreach ( self::$ModuleList as $module )\n {\n self::CheckModuleDependencies($module['name']);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save context & attributes to database | protected function save()
{
if (($id =& $this->id) !== null)
throw new SystemException('Cannot save existent context!');
// save to database
$id = self::EMPTY_CONTEXT_ID;
if ($attributes = $this->attributes)
{
$snapshot = self::getSnapshot($attributes);
$query = array(
'limit' => 1,
'select' => array('ID'),
'filter' => array('=SNAPSHOT' => $snapshot),
);
if ($row = Internals\ContextTable::getList($query)->fetch())
{
$id = (int) $row['ID'];
}
else
{
try
{
$result = Internals\ContextTable::add(array('SNAPSHOT' => $snapshot));
if ($result->isSuccess())
{
$id = $result->getId();
foreach ($attributes as $attribute)
{
// TODO resetContext if not success and return null!!!
$result = Internals\ContextAttributeTable::add(array(
'CONTEXT_ID' => $id,
'NAME' => $attribute['NAME'],
'VALUE' => $attribute['VALUE'],
));
}
}
else
{
throw new DB\SqlQueryException();
}
}
catch (DB\SqlQueryException $e)
{
if ($row = Internals\ContextTable::getList($query)->fetch())
{
$id = (int) $row['ID'];
}
}
}
}
} | [
"private function __saveAttributes()\n {\n if (empty($this->attributes)) return;\n foreach ($this->attributes as $attr) {\n if (!$attr->getContent()->getId() || $attr->getContent()->getChanged()) {\n\t\t\t\tif (!$attr->getContent()->getProduct_id()) \n\t\t\t\t\t$attr->getContent()->setProduct_id($this->id);\n\t\t\t\t$attr->save(true);\n }\n }\n }",
"public function saveToDb()\n\t{\n\t\t$this->saveQuestionSequence();\n\t\t$this->saveNewlyCheckedQuestion();\n\t}",
"public function save()\n {\n $properties = array();\n $getFuncs = $this->getAccessorFunctions();\n\n foreach ($getFuncs as $mysqlColumnName => $callback)\n {\n /* @var $callback Callback */\n $property = $callback();\n $properties[$mysqlColumnName] = $property;\n }\n\n if (!isset($this->m_id) || $this->m_id == null)\n {\n $createdObject = $this->getTableHandler()->create($properties);\n $this->m_id = $createdObject->get_id();\n }\n else\n {\n $this->getTableHandler()->update($this->m_id, $properties);\n }\n }",
"public function save()\n {\n if ($this->isLoaded()) {\n $baseModel = $this->getModel();\n $assocModel = $this->getObject();\n $fkName = $this->getFkName();\n $pkName = $this->getPkName();\n\n // save associated object\n $assocModel->save();\n $baseModel->writeAttribute($fkName, $assocModel->$pkName);\n }\n }",
"public function save() {\n $this->loadFields();\n $this->saveObject(__CLASS__);\n }",
"public function save() {\n // Get db fields for this object\n $vars = $this->getDbFields();\n\n // Prepare save query\n\t\t$save_query = \"UPDATE \" . static::$tableName . \" SET \";\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$save_query .= $key . \"='$value', \";\n\t\t}\n $save_query = substr($save_query, 0, strlen($save_query) - 2)\n . \" \" . $this->genPrimaryKeyWhereClause(); \n \n // Execute save query\n self::$database->query($save_query);\n }",
"public function saveToDB()\n {\n }",
"public function save() {\n\t\tself::getEntityManager()->persist($this);\n\t}",
"public function saveContext() {\n\t\treturn $this->wire('fieldgroups')->saveContext($this); \n\t}",
"public function save()\n {\n // Updates the database\n if ($this->update() == 0) {\n // If no object was updated insert a new one\n $this->insert();\n }\n }",
"public function save()\n\t{\n\t\tparent::save();\n\t\tif (true || $this->getUpdateRoles())\n\t\t\t$this->saveRelation('roles');\n\n return;\n\t\t//if ($this->getUpdateOrderStates())\n\t\t//\t$this->saveRelation('orderstates');\n\n if ($this->getUpdateRelatedDefs())\n\t\t\t$this->saveRelationSymetric('relateddefs');\n\t}",
"public function save() {\n if(!$this->id) {\n $this->create();\n } else {\n $this->update();\n }\n }",
"public function save() {\n $this->entity->save();\n }",
"public function save() {\n if (!isset($this->id)) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function save()\n {\n $adminId = $this->saveAdminUser();\n $this->saveAdminUserRole($adminId);\n }",
"public function save() {\r\n\t\t$data = array();\r\n\t\t$data['tx_falmam_state'][$this->uid] = array(\r\n\t\t\t'connector_name' => $this->connectorName,\r\n\t\t\t'config_hash' => $this->configHash,\r\n\t\t\t'event_id' => $this->eventId,\r\n\t\t\t'sync_id' => $this->syncId,\r\n\t\t\t'sync_offset' => $this->syncOffset,\r\n\t\t\t'notified' => $this->notified\r\n\t\t);\r\n\r\n \t\tif ($this->uid == 'NEW') {\r\n\t\t\t$data['tx_falmam_state'][$this->uid]['pid'] = $this->pid;\r\n \t\t}\r\n\r\n\t\t$this->dataHandler->start($data, array());\r\n\t\t$result = $this->dataHandler->process_datamap();\r\n\r\n\t\tif ($this->uid == 'NEW') {\r\n\t\t\t$this->uid = $this->dataHandler->substNEWwithIDs[$this->uid];\r\n\t\t}\r\n\t}",
"public function saveEntity();",
"public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }",
"function save() {\t\r\n\t\t//get names and values of all attributes\r\n\t\t$pairs = $this->_getPairs();\t\t\r\n\t\t//the sql statment to save the transaction\r\n\t\t$sql = '';\r\n\t\t//this is a new transaction\r\n\t\tif($this->transactionID == 0) {\r\n\t\t\t$fields = implode(',', array_keys($pairs));\r\n\t\t\t$values = implode(\"','\", array_values($pairs));\r\n\t\t\t$sql = 'INSERT INTO ' . TRANSACTION_TABLE . '(' . $fields . ') VALUES(\\'' .$values . '\\')';\r\n\t\t}\r\n\t\telse {\r\n\t\t\r\n\t\t\t$sql .= 'UPDATE ' . TRANSACTION_TABLE . ' SET ';\r\n\t\t\tforeach($pairs as $key=>$val) {\r\n\t\t\t\t$sql .= \"$key='$val', \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$sql = rtrim($sql, ', ') . ' WHERE transactionID = ' . $this->transactionID;\r\n\t\t}\r\n\t\tmysql_query($sql);\r\n\t\tprint mysql_error();\r\n\t\tprint \"<br>$sql<br>\";\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of 'iMasterCount' property | public function getIMasterCount()
{
return $this->get(self::IMASTERCOUNT);
} | [
"public function getMasterCount(){\r\n $master_counter = 0;\r\n if(!is_null($this->masterd_decks)){\r\n $master_counter = count($this->getMasteredDecks());\r\n }else{\r\n $sql = \"SELECT COUNT(*) FROM \".Master::getDbTableName().\" WHERE member = \".$this->getId();\r\n $req = $this->db->query($sql);\r\n $master_counter = $req->fetchColumn();\r\n }\r\n return $master_counter;\r\n }",
"public function get_masterCounter(){\n if ($this->masterCounter === Null){\n myPear_db()->transaction('start');\n $this->_adjust_masterCounter(True);\n myPear_db()->transaction('end');\n }\n return $this->masterCounter;\n }",
"private function _adjust_masterCounter(){\n\n try {\n \n // Walk thru the database and find the maximum value of the record ID\n $primary_keys = array();\n myPear_db()->tableNotEmpty('reset');\n foreach(myPear_db()->get_primaryKeys() as $table=>$keys){\n\tif (myPear_db()->tableNotEmpty($table)) $primary_keys[$table] = $keys;\n }\n \n $maxID = 1;\n if (!empty($primary_keys)){\n\t$q = $this->query(\"SELECT \".join(', ',array_values($primary_keys)).\" FROM \".join(', ',array_keys($primary_keys)));\n\twhile($r = myPear_db()->next_record($q)){\n\t $maxID = max(array_merge(array($maxID),array_values($r)));\n\t}\n }\n \n // Now read the \"maximum record ID\" as it is kept in the master record.\n $q = $this->query(\"SELECT master_value FROM zzz_master \".bMasterClass_where);\n if (!myPear_db()->num_rows($q)){\n\t$this->query(\"INSERT INTO zzz_master SET \".join(',',array(\"master_object='masterCount'\",\n\t\t\t\t\t\t\t\t \"master_value = $maxID\")));\n\t$q = $this->query(\"SELECT master_value FROM zzz_master \" . bMasterClass_where);\n }\n $r = myPear_db()->next_record($q);\n $this->masterCounter = $r['master_value'];\n \n //\n // Check the database counter\n // This value must be less-then-OR-equal-to $maxID\n if ($maxID > $this->masterCounter){\n\t// The max record_ID is higher then the masterCounter saved in the database.\n\t// Presumably the records were updated by another process,\n\t// update masterCounter in the database\n\t$this->dbg('init',\"maxID=$maxID\");\n\tif (!empty($this->masterCounter)){\n\t $msg = \"non-zero this->masterCounter < maxID: $this->masterCounter < \".($maxID+1);\n\t MSG::WARNING_T($msg);\n\t // b_debug::report_bug($msg);\n\t} \n\tMSG::WARNING_T(\"set $this->masterCounter -> \".($maxID+1),$this);\n\t$this->masterCounter = $maxID;\n\t$this->_update_masterCounter();\n }elseif($maxID == $this->masterCounter) {\n\t// The counter stays unchanged, good.\n }elseif(cnf_dev || cnf_CLI){\n\t// Something is wrong, the counter value in the database \n\t// is smaller then the the previous value\n\t$msg = \"??? maxID = $maxID, but \\$this->masterCounter = $this->masterCounter\";\n\tMSG::WARNING_T($msg,$this);\n\tMSG::DEBUG($msg);\n }\n }catch (Exception $e) {\n b_debug::internalError(x('pre',$e->xdebug_message));\n }\n }",
"public function getMastersCount($type = self::TYPE_ALL)\n {\n $count = $this->_getCount($type, self::REP_MASTER);\n return $count;\n }",
"private function countByMaster(){\r\n\t\t\t$this -> db -> sql =\"select count(*) as total from usr_class where relationship=1 and class_Id in (select class_Id from usr_class where uid='\".$this -> urlarr[6].\"' and relationship=3) \";\r\n\t\t\t$this -> db -> Queryone();\r\n\t\t\t$this -> b[\"count\"] = $this -> db -> rs;\r\n\t\t\t$this -> b[\"sc\"] = 200;\r\n\t\t}",
"public function getCoreCount()\n {\n return $this->core_count;\n }",
"public function reserve_masterCounter(){\n \n try {\n if ($this->init()){\n\t// Adjust the master counter\n\tmyPear_db()->transaction('start');\n\t$this->_adjust_masterCounter();\n\t$this->_update_masterCounter();\n\tmyPear_db()->transaction('end');\n }\n }catch(Exception $e){\n b_debug::internalError(x('pre',$e->xdebug_message));\n }\n $this->dbg('reserve');\n return $this->masterCounter;\n }",
"function get_all_usermaster_count()\n {\n $this->db->from('usermaster');\n return $this->db->count_all_results();\n }",
"public function getCnt()\n {\n\n return $this->cnt;\n }",
"public function getPhysicalCoreCount()\n {\n return $this->physical_core_count;\n }",
"public function count(){\n return $this->_count;\n }",
"function counter()\r\n {\r\n return $this->Counter;\r\n }",
"public function getMasterRankAttribute(): ?int\n {\n if ($this->m_nJob > 16 && $this->m_nJob < 24) {\n if ($this->m_nLevel >= 110) {\n return 6;\n } elseif ($this->m_nLevel >= 100) {\n return 5;\n } elseif ($this->m_nLevel >= 100) {\n return 4;\n } elseif ($this->m_nLevel >= 100) {\n return 3;\n } elseif ($this->m_nLevel >= 100) {\n return 2;\n } elseif ($this->m_nLevel >= 60) {\n return 1;\n }\n }\n return null;\n }",
"public function getPopularSlaveCount()\n {\n $sql = 'SELECT COUNT(uid) FROM slave_user';\n return $this->_rdb->fetchOne($sql);\n }",
"public function getChildSpanCountValue()\n {\n return $this->readWrapperValue(\"child_span_count\");\n }",
"public function getCounter()\n {\n return $this->_counter;\n }",
"function get_master_id() {\r\n\t\t$query = \"SELECT max(enrich_id) AS master_id FROM enrichment WHERE enrich_creator='\".$_SESSION[SESSION_USERID].\"'\";\r\n\t\t$result = $this->db->query($query);\r\n\t\tif($result->num_rows()){\r\n\t\t\t$data=$result->row();\r\n\t\t\t$master_id=$data->master_id;\r\n\t\t\treturn $master_id;\r\n\t\t}else{\r\n\t\t\treturn '0';\r\n\t\t}\r\n\t}",
"public function getMasterTrackingNumber() {\r\n return inship_fedexship_get($this->handle, 54 );\r\n }",
"public function getVisibleCoreCount()\n {\n return isset($this->visible_core_count) ? $this->visible_core_count : 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor Instantiate the internal priority queue | public function __construct()
{
$this->queue = new PriorityQueue;
} | [
"public function __construct()\n {\n $this->queue = new SplPriorityQueue();\n }",
"public function __construct() {\n $this->sortingAlgorithm = $this->makeSortingAlgorithm();\n $this->items = [];\n $this->extractFlags = PriorityQueueInterface::EXTRACT_FLAG_DATA;\n $this->iterationMode = PriorityQueueInterface::ITERATION_MODE_DELETE;\n $this->count = 0;\n $this->i = 0;\n }",
"public function __construct()\n {\n /** @psalm-var PriorityQueue<StorageInterface, int> */\n $this->storageChain = new PriorityQueue();\n }",
"public function __construct()\n {\n $this -> queue = [];\n $this -> valuesUsed = [];\n $this -> index = 0;\n $this -> top = 0;\n $this -> bottom = 0;\n }",
"public function __construct($queue);",
"public function __construct()\n {\n $this->queue = array();\n $this->id = 0;\n }",
"public function __construct() {\n\t\t/**\n\t\t * Fires before class is initialized.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_before_construct' );\n\n\t\t// Set paths\n\t\t$this->path = rtrim( plugin_dir_path( __FILE__ ), '/' );\n\t\t$this->url_path = rtrim( plugin_dir_url( __FILE__ ), '/' );\n\n\t\t// Set basename\n\t\t$this->basename = plugin_basename( __FILE__ );\n\n\t\t// Load translations\n\t\tload_plugin_textdomain( 'post-to-queue', false, dirname( $this->basename ) . '/languages' );\n\n\t\t// Set interval\n\t\t$this->interval = $this->interval();\n\n\t\t// Set status name\n\t\t$this->status = $this->status();\n\n\t\t// Set admin loading statuses\n\t\t/**\n\t\t * Filter whether admin class should be loaded.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param bool $show_admin Whether admin class should be loaded. Default true.\n\t\t */\n\t\t$this->show_admin = apply_filters( 'ptq_show_admin', true );\n\t\t/**\n\t\t * Filter whether reorder class should be loaded.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param bool $show_admin Wwhether reorder class should be loaded. Default true.\n\t\t */\n\t\t$this->show_reorder = apply_filters( 'ptq_show_reorder', true );\n\n\t\t// Register main hooks\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'wp_loaded' ), 2 );\n\n\t\t// Add PTQ cron interval\n\t\tadd_filter( 'cron_schedules', array( $this, 'add_interval' ) );\n\n\t\t/**\n\t\t * Fires after class is initialized.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_after_construct' );\n\t}",
"public function __construct() {\n\t\t\t// Get the queue\n\t\t\t$this->queue = Queue::getQueue();\n\t\t\t// Now process\n\t\t\t$this->process();\n\t\t}",
"public function __construct() {\n # Get the queue\n $this->queue = Queue::getQueue();\n # Now process\n $this->process();\n }",
"public function __construct(){\n $this->minHeap = array();\n }",
"public function __construct() {\n # Get the queue\n $this->queue = Queue::getQueue();\n # Now process\n $this->process();\n }",
"protected static function initQueue()\n {\n if (! self::$queue instanceof \\SplPriorityQueue) {\n self::$queue = new \\SplPriorityQueue();\n foreach (self::$defaultExceptionHandlers as $handler => $priority) {\n self::$queue->insert($handler, $priority);\n }\n }\n }",
"public function __construct(array $queuePlacement = array())\n {\n $this\n ->setQueuePlacement($queuePlacement);\n }",
"public function __construct() {\n // Create an empty array that for the items of the stack\n $this -> stack = array();\n }",
"function __construct($k) {\n\n $this->front=-1;\n $this->rear=-1;\n $this->queue=[];\n $this->maxsize=$k;\n\n\n\n\n }",
"public function setupPriorityQueue(string $name, int $priority): void;",
"public function __construct()\n\t\t\t{\n\t\t\t\t$this->m_pools = array();\n\t\t\t}",
"public function getPriorityQueueHelper() {\n if (isset(self::$Instances[__FUNCTION__])) {\n return self::$Instances[__FUNCTION__];\n }\n\n return self::$Instances[__FUNCTION__] = new PriorityQueue($this->container);\n }",
"function __construct()\n\t{\n\t\t$this->head = null;\n\t\t$this->tail = null;\n\t\t$this->size = 0;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For getting hospital id of the current user Returns hospital id | function get_hospital_id(){
return $_SESSION['hospital_id'];
} | [
"public function get_user_hospital_id($user_id){\n\t\tglobal $con;\n\t\t$result=array();\n\t\t$hospital=0;\n\t\t$query=\"SELECT hospital_id FROM system_users WHERE user_id='$user_id' LIMIT 1\";\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$hospital=$value['hospital_id'];\n\t\t}\n\t\treturn $hospital;\n\t}",
"public function get_doctor_hospital_id($user_id){\n\t\tglobal $con;\n\t\t$result=array();\n\t\t$hospital=0;\n\t\t$query=\"SELECT hospital_id FROM doctors WHERE doctor_id='$user_id' LIMIT 1\";\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$hospital=$value['hospital_id'];\n\t\t}\n\t\treturn $hospital;\n\t}",
"public function gethospitalUidFrom()\n {\n return $this->hospitaluidfrom;\n }",
"public function get_user_id();",
"public function getIduser()\n {\n return $this->iduser;\n }",
"private function getHospitalByUserId($id)\n {\n $hospital = DB::table('hospital_user')\n ->where('user_id', $id)\n ->first();\n\n if ($hospital) {\n $hospitalId = $hospital->hospital_id;\n return Hospital::findOrFail($hospitalId);\n }\n\n return false;\n }",
"public function getMyId() {\n return $this->session->userdata('user_id');\n }",
"private function get_user_id() {\n if (!$this->userinfo) $this->userinfo = wp_get_current_user();\n\n return $this->userinfo && isset($this->userinfo->ID) && $this->userinfo->ID > 0 ?\n $this->userinfo->ID :\n $_SERVER[\"REMOTE_ADDR\"];\n }",
"public function getId_user(){\n return $this->id_user;\n }",
"function user_id(){\n\t\treturn $_SESSION['user']['id'];\n\t}",
"public function getId_user()\n {\n return $this->id_user;\n }",
"function getFirstId(){\r\n\t\tif ($_SESSION[medico] == \"1\"){\r\n\t $sql \t= \"select hos_id from hospital where med_id = \".$_SESSION[\"med_id\"].\" order by hos_nome limit 1\";\r\n\t\t\t$rs\t\t= Db::sql($sql, \"Hospital::getFirstId()\");\r\n\t\t\t$r = mysql_fetch_assoc($rs);\r\n\t\t\treturn $r[\"hos_id\"];\r\n\t\t} else {\r\n\t\t\treturn $_SESSION[hos_id];\r\n\t\t}\r\n\t}",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}",
"protected static function getUserId()\n {\n if (admin()) {\n return admin()->id;\n } elseif (user()) {\n return user()->id;\n }\n\n return 0;\n }",
"public function getId(){\n return self::getUserId();\n }",
"public function getPatientId() : Uuid {\n\treturn($this->patientId);\n\n\t//this outside of class\n\t//$patient->getPatientId();\n}",
"public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}",
"public function get_id_user()\n {\n return $this->_id_user;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AIM : To verify restore checkpoints are properly set after a restore | public function test_checkpoint_after_restore() {
// EXPECTED RESULT : Restore is successful
zbase_setup::reset_servers_and_backupfiles(TEST_HOST_1, TEST_HOST_2);
flushctl_commands::set_flushctl_parameters(TEST_HOST_1, "chk_max_items", 100);
$this->assertTrue(Data_generation::add_keys(200, 100, 1, 10),"Failed adding keys");
zbase_backup_setup::start_backup_daemon(TEST_HOST_2);
$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), "Failed to upload the backup files to Storage Server");
$this->assertTrue(Data_generation::add_keys(100, 100, 201, 10),"Failed adding keys");
$this->assertTrue(Data_generation::add_keys(200, 100, 301, 10),"Failed adding keys");
$this->assertTrue(Data_generation::add_keys(200, 100, 501, 10),"Failed adding keys");
zbase_backup_setup::restart_backup_daemon(TEST_HOST_2);
$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), "Failed to upload the backup files to Storage Server");
$checkpoint_stats = stats_functions::get_checkpoint_stats(TEST_HOST_2);
zbase_setup::reset_zbase_servers(array(TEST_HOST_1, TEST_HOST_2));
$status = mb_restore_commands::restore_server(TEST_HOST_2);
$this->assertTrue(strpos($status,"Restore completed successfully")>0,"Restore not completed");
$raw_stats= stats_functions::get_stats_array(TEST_HOST_2, "restore");
$restore_stats = $raw_stats["ep_restore"];
$this->assertEquals($checkpoint_stats["last_closed_checkpoint_id"], $restore_stats["restore_checkpoint"], "Restore checkpoint not updated after restore");
} | [
"public function test_checkpoint_after_restore() {\n // EXPECTED RESULT : Restore is successful\n zbase_setup::reset_servers_and_backupfiles(TEST_HOST_1, TEST_HOST_2);\n flushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n $this->assertTrue(Data_generation::add_keys(200, 100, 1, 10),\"Failed adding keys\");\n zbase_backup_setup::start_backup_daemon(TEST_HOST_2);\n $this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n $this->assertTrue(Data_generation::add_keys(200, 100, 201, 10),\"Failed adding keys\");\n zbase_backup_setup::restart_backup_daemon(TEST_HOST_2);\n $this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n $this->assertTrue(Data_generation::add_keys(200, 100, 401, 10),\"Failed adding keys\");\n zbase_backup_setup::restart_backup_daemon(TEST_HOST_2);\n $this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\t$checkpoint_stats = stats_functions::get_checkpoint_stats(TEST_HOST_2);\n zbase_setup::reset_zbase_servers(array(TEST_HOST_1, TEST_HOST_2));\n $status = mb_restore_commands::restore_server(TEST_HOST_2);\n $this->assertTrue(strpos($status,\"Restore completed successfully\")>0,\"Restore not completed\");\n\t\t$raw_stats= stats_functions::get_raw_stats(TEST_HOST_2, \"restore\");\n\n\t}",
"protected function beforeRestore() {}",
"public function testShouldBeAbleToSetCheckpointAndForgetAllPreviousStatesOfAMachine()\n\t {\n\t\t$stateMachine = new StateMachine();\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"1\\\" index=\\\"1\\\">First</item><item id=\\\"2\\\">Second</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"1\\\" index=\\\"1\\\">First</item><item id=\\\"2\\\">Second</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"4\\\">Fourth</item></listofitems>\"\n\t\t);\n\t\t$stateMachine->addState(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\"\n\t\t);\n\n\t\t$this->assertXmlStringEqualsXmlString(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\",\n\t\t $stateMachine->getCurrentState()\n\t\t);\n\n\t\t$stateMachine->checkPoint(2);\n\t\t$this->assertXmlStringEqualsXmlString(\n\t\t \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><listofitems><item id=\\\"2\\\">second</item><item id=\\\"3\\\">Third</item></listofitems>\",\n\t\t $stateMachine->getState($stateMachine->getFirstIndex())\n\t\t);\n\n\t\t$stateMachine->checkPoint(4);\n\t\t$this->assertXmlStringEqualsXmlString(\n\t\t \"<?xml version=\\\"1.0\\\" ?><listofitems><item id=\\\"4\\\">Fourth</item></listofitems>\",\n\t\t $stateMachine->getState($stateMachine->getFirstIndex())\n\t\t);\n\t }",
"private function assertRestoredSiteStatus(): void\n {\n $this->assertTrue(is_file(Path::join($this->restorePath, 'composer.json')));\n $this->assertTrue(is_file(Path::join($this->restorePath, 'sut', 'sites', 'dev', 'settings.php')));\n $this->assertTrue(is_file(Path::join($this->restorePath, 'sut', 'sites', 'dev', 'settings.local.php')));\n\n $this->drush(\n 'status',\n [],\n ['format' => 'json'],\n null,\n Path::join($this->restorePath, 'sut')\n );\n $restoredSiteStatus = json_decode($this->getOutput(), true);\n $this->assertEquals('Connected', $restoredSiteStatus['db-status']);\n $this->assertEquals(Path::join($this->restorePath, 'sut'), $restoredSiteStatus['root']);\n $this->assertEquals($this->fixtureDatabaseSettings['db-name'], $restoredSiteStatus['db-name']);\n }",
"public function afterRestore() : bool\n\t{\n\t\treturn true;\n\t}",
"protected function afterRestore() {}",
"public function testRestoreNodes()\n {\n }",
"public function testResumeCheck()\n {\n if($this->hm->resumeCheck($this->uuid)) {\n $this->assertTrue(true);\n }\n }",
"public function testGetCheckpoint()\n {\n $this->manager->setCheckpoint('Sulu Structure', 'Foobar', 50);\n $this->manager->setCheckpoint('Doctrine ORM Entity', 'BarFoo', 100);\n\n $this->assertEquals(50, $this->manager->getCheckpoint('Sulu Structure', 'Foobar'));\n }",
"public function checkpoint()\n {\n $walData = $this->wal->read();\n foreach ($walData as $lineData) {\n $this->storage->setValue(key($lineData), current($lineData));\n }\n $this->storage->flush();\n $this->wal->clean();\n }",
"function can_restore() {\n return @$this->type['restore'];\n }",
"public function test_Backfill_from_Restore(){\n\t\t// EXPECTED RESULT : Restore is successful\n\t\tzbase_setup::reset_servers_and_backupfiles(TEST_HOST_1, TEST_HOST_2);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n\t\t$this->assertTrue(Data_generation::add_keys(200, 100, 1, 10),\"Failed adding keys\");\n\t\tzbase_backup_setup::start_backup_daemon(TEST_HOST_2);\n\t\t$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\t$this->assertTrue(Data_generation::add_keys(200, 100, 201, 10),\"Failed adding keys\");\n\t\tzbase_backup_setup::restart_backup_daemon(TEST_HOST_2);\n\t\t$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\t$this->assertTrue(Data_generation::add_keys(200, 100, 401, 10),\"Failed adding keys\");\n\t\tzbase_backup_setup::restart_backup_daemon(TEST_HOST_2);\n\t\t$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\tzbase_setup::reset_zbase_servers(array(TEST_HOST_1, TEST_HOST_2));\n\t\t// Restore\n\t\t$status = mb_restore_commands::restore_server(TEST_HOST_2);\n\t\t$this->assertTrue(strpos($status,\"Restore completed successfully\")>0);\n\t\t// Backfill based backup\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_2, \"chk_max_items\", 100);\n\t\t$this->assertTrue(Data_generation::add_keys(100, 100,601, 10),\"Failed adding keys\");\n\t\tvbucketmigrator_function::attach_vbucketmigrator(TEST_HOST_1,TEST_HOST_2);\n\t\t//\t\ttap_commands::register_backup_tap_name(TEST_HOST_2);\n\t\tstorage_server_setup::clear_storage_server();\n\t\tzbase_backup_setup::stop_backup_daemon(TEST_HOST_2);\n\t\tzbase_setup::memcached_service(TEST_HOST_2, \"restart\"); \n\t\ttap_commands::register_backup_tap_name(TEST_HOST_2); \n\t\tzbase_backup_setup::start_backup_daemon_full(TEST_HOST_2);\n\t\tsleep(10);\n\t\t// Restore\n\t\tzbase_setup::reset_zbase_servers(array(TEST_HOST_1, TEST_HOST_2));\n\t\t$status = mb_restore_commands::restore_server(TEST_HOST_2);\n\t\t$this->assertTrue(strpos($status,\"Restore completed successfully\")>0,\"Restore not completed\");\n\t\t//Verifying count of keys\n\t\t$count = stats_functions::get_all_stats(TEST_HOST_2, \"curr_items\");\n\t\t$this->assertEquals($count, 700, \"Number of restored keys not equal to number of keys in backups\");\n\t}",
"public function saveCheckpoint()\n {\n /* @var \\Db\\Entity\\EntityAbstract $entity */\n foreach ($this->resources as $entity) {\n /* @var \\Db\\Model\\ModelAbstract $model */\n foreach ($entity->models() as $model) {\n $model->checkpoint();\n }\n }\n }",
"public function restored(Checklists $checklists)\n {\n //\n }",
"protected function isRestoring()\n {\n return $this->option('restore') == 'true';\n }",
"public function test_Double_Backup_Single_Checkpoint() {\n\t\t#EXPECTED RESULT //Data to be split over two backups\n\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1, TEST_HOST_2);\n\t\tbackup_tools_functions::clear_temp_backup_data(TEST_HOST_2);\n\t\tbackup_tools_functions::set_backup_type(TEST_HOST_2, \"incr\");\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 50000);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_period\", 60);\n\t\t//Pump in 250000 keys with chk_max_items set to 5000 so that only 1 checkpoint is there and it is closed\n\t\t$this->assertTrue(Data_generation::add_keys( 1500, 50000, 1, 10240),\"Failed adding keys\");\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_period\", 60);\n\t\tsleep(60);\n\t\tbackup_tools_functions::set_backup_const(TEST_HOST_2, \"SPLIT_SIZE\", 10);\n\t\tsleep(5);\n\t\tbackup_tools_functions::run_backup_script(TEST_HOST_2);\n\t\t$slave_closed_chkpoint = stats_functions::get_checkpoint_stats(TEST_HOST_2, \"last_closed_checkpoint_id\");\n\t\t$count_slave = stats_functions::get_all_stats(TEST_HOST_2, \"curr_items\");\n\t\t$count_backup = zbase_function::sqlite_cpoint_count(TEST_HOST_2, TEMP_OUTPUT_FILE_0);\n\t\t$count_backup += zbase_function::sqlite_cpoint_count(TEST_HOST_2, TEMP_OUTPUT_FILE_1);\t\t\n\t\t$this->assertEquals($count_backup, $count_slave, \"Key_count_mismatch in backup\");\n\t\t$chk_point_backup = zbase_function::sqlite_chkpoint_count(TEST_HOST_2, TEMP_OUTPUT_FILE_1);\n\t\t$this->assertEquals($chk_point_backup, $slave_closed_chkpoint, \"Checkpoint_mismatch in backup\");\n\t}",
"public function testGetRestoreBackupOperations()\n {\n\n }",
"public function test_Single_Backup_2_Chkpoints() {\n\t\t#EXPECTED RESULT // All keys and checkpoint information are correctly placed in the backup\n\n\t\t//Initialise the two machines\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1, TEST_HOST_2);\n\t\tbackup_tools_functions::clear_temp_backup_data(TEST_HOST_2);\n\t\tbackup_tools_functions::set_backup_type(TEST_HOST_2, \"full\");\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 5000);\n\t\t//Pump in 10000 keys with chk_max_items set to 5000 so that only 2 checkpoint are there and they are closed\n\t\t$this->assertTrue(Data_generation::add_keys( 10000, 5000, 1),\"Failed adding keys\");\n\t\tbackup_tools_functions::run_backup_script(TEST_HOST_2);\n\t\t//Check if key count on slave and backup are the same\n\t\t$count_slave = stats_functions::get_all_stats(TEST_HOST_2, \"curr_items\");\n\t\t$count_backup = zbase_function::sqlite_cpoint_count(TEST_HOST_2, TEMP_OUTPUT_FILE_0);\n\t\t$this->assertEquals($count_slave, $count_backup, \"Key_count_mismatch in backup\");\n\t\t//Check if last closed checkpoint on slave and backup are the same\n\t\t$chk_point_master = stats_functions::get_checkpoint_stats(TEST_HOST_2, \"last_closed_checkpoint_id\");\n\t\t$chk_point_backup = zbase_function::sqlite_chkpoint_count(TEST_HOST_2, TEMP_OUTPUT_FILE_0);\n\t\t$this->assertEquals($chk_point_master, $chk_point_backup, \"Checkpoint_mismatch in backup\");\n\n\t}",
"public function testNewBaselining(): void\n {\n Queue::fake();\n $baseline = \\factory(Snapshot::class)->create();\n \\factory(Checkpoint::class)->create([\n 'snapshot_id' => $baseline->id,\n 'name' => 'an existing image',\n 'approval_status' => Checkpoint::APPROVAL_STATUS_APPROVED,\n ]);\n\n $snapshot = \\factory(Snapshot::class)->create(['baseline' => $baseline->id]);\n \\factory(Checkpoint::class)->create([\n 'snapshot_id' => $snapshot->id,\n 'name' => 'new image',\n 'baseline_url' => null,\n ]);\n\n $snapshot->triggerCheckpointBaselining();\n\n $expectedCheckpoints = ['an existing image', 'new image'];\n $expectedCheckpoints = \\array_flip($expectedCheckpoints);\n Queue::assertPushed(FindCheckpointBaseline::class, static function ($job) use (&$expectedCheckpoints): ?bool {\n if (isset($expectedCheckpoints[$job->checkpoint->name])) {\n unset($expectedCheckpoints[$job->checkpoint->name]);\n\n return true;\n }\n });\n\n $this->assertCount(0, $expectedCheckpoints);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get details for this tip | public function getTipDetails() {
return new Foursquare_TipDetails_output(Temboo_Results::getSubItemByKey(Temboo_Results::getSubArrayByKey(json_decode($this->get('Response'), true), "response"), "tip"));
} | [
"public function getTip() {\n return $this->get(self::TIP);\n }",
"public function getTips();",
"function InfoTips()\n\t{\n\t\treturn $this->infotips;\n\t}",
"public function getTip() {\n\t\treturn new Foursquare_Tip_output(Temboo_Results::getSubItemByKey($this->base, \"tip\"));\n\t}",
"public function getDetailInfo() {\n return $this->get(self::DETAIL_INFO);\n }",
"public function getDetails()\n\t{\n\t\treturn $this->details; \n\n\t}",
"public function getDetails()\r\n {\r\n return $this->details;\r\n }",
"public function getTips() {\n\t\t$listEntries = Temboo_Results::getSubItemByKey(Temboo_Results::getSubArrayByKey(Temboo_Results::getSubArrayByKey(json_decode($this->get('Response'), true), \"response\"), \"tips\"), \"items\");\n\t\t$resultArray = array();\n\t\tif(!is_null($listEntries)) {\n\t\t\tforeach ($listEntries as $entry) {\n\t\t \tarray_push($resultArray, new Foursquare_Tip_output($entry));\n\t\t\t}\n\t\t}\n\t\treturn $resultArray;\n\t}",
"public function getInfo()\n {\n return $this->getProperty('info');\n }",
"function getDetail()\n {\n return $this->getTraceAsString();\n }",
"public function getDetailsLine()\n {\n return $this->getStringValue(\n $this->xdata->getString('details')\n );\n }",
"public function getTipus()\n {\n return $this->tipus;\n }",
"function getTeaser()\n {\n \treturn $this->getDescription();\n }",
"public function detail() : string\n {\n return $this->pluck('trophyDetail');\n }",
"function getDetail() {\r\r\n\t\treturn $this->detail;\r\r\n\t}",
"public function getDetail(): string\n {\n return $this->detail; \n }",
"function getToolTipText() {\r\n return $this->_tooltiptext;\r\n }",
"public function getTooltip()\n\t{\n\t\treturn $this->tooltip; \n\n\t}",
"public function getInfo();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Example: If $originalqs = array("a" => "A", "b" => "B", "c" => "C"), $indexes_inherited = array("a", "b") and $extra_array = array("d" => "D", "b" => "Z"), then qs_array_prepare($originalqs, $indexes_inherited, $extra_array) would return array("a" => "A", "b" => "Z", "d" => "D"). | function qs_array_prepare($originalqs, $indexes_inherited, $extra_array = array()) {
$ret = array();
foreach($indexes_inherited as $index) {
if (isset($originalqs[$index]))
$ret[$index] = $originalqs[$index];
}
return $extra_array + $ret;
} | [
"protected static function ArrayQueryHelper(&$strOrderBy, $strLimit, &$strLimitPrefix, &$strLimitSuffix, &$strExpandSelect, &$strExpandFrom, $objExpansionMap, &$objDatabase) {\n\t\t\t// Get the Database\n\t\t\t$objDatabase = QApplication::$Database[1];\n\n\t\t\t// Setup OrderBy and Limit Information (if applicable)\n\t\t\t$strOrderBy = $objDatabase->SqlSortByVariable($strOrderBy);\n\t\t\t$strLimitPrefix = $objDatabase->SqlLimitVariablePrefix($strLimit);\n\t\t\t$strLimitSuffix = $objDatabase->SqlLimitVariableSuffix($strLimit);\n\n\t\t\t// Setup QueryExpansion (if applicable)\n\t\t\tif ($objExpansionMap) {\n\t\t\t\t$objQueryExpansion = new QQueryExpansion('Variable', 'variable', $objExpansionMap);\n\t\t\t\t$strExpandSelect = $objQueryExpansion->GetSelectSql();\n\t\t\t\t$strExpandFrom = $objQueryExpansion->GetFromSql();\n\t\t\t} else {\n\t\t\t\t$strExpandSelect = null;\n\t\t\t\t$strExpandFrom = null;\n\t\t\t}\n\t\t}",
"abstract protected function _buildQueryParamsArray();",
"public static function reIndex() {\r\n $fields = func_get_args();\r\n $array = array_shift($fields);\r\n $array = (array) $array;\r\n \r\n $R = array();\r\n foreach ($array as $obj) {\r\n $target =& $R;\r\n \r\n foreach ($fields as $field) {\r\n if (! array_key_exists($field, $obj)) die(\"reIndex: array doesn't have requested field\\n\");\r\n \r\n $nextkey = $obj[$field];\r\n $target =& $target[$nextkey];\r\n }\r\n $target = $obj;\r\n }\r\n return $R;\r\n }",
"public static function reIndex() {\n $fields = func_get_args();\n $array = array_shift($fields);\n $array = (array) $array;\n\n $R = array();\n foreach ($array as $obj) {\n $target =& $R;\n\n foreach ($fields as $field) {\n if (! array_key_exists($field, $obj)) die(\"reIndex: array doesn't have requested field\\n\");\n\n $nextkey = $obj[$field];\n $target =& $target[$nextkey];\n }\n $target = $obj;\n }\n return $R;\n }",
"public static function reIndex() {\n $fields = func_get_args();\n $array = array_shift($fields);\n $array = (array) $array;\n \n $R = array();\n foreach ($array as $obj) {\n $target =& $R;\n \n foreach ($fields as $field) {\n if (! array_key_exists($field, $obj)) die(\"reIndex: array doesn't have requested field\\n\");\n \n $nextkey = $obj[$field];\n $target =& $target[$nextkey];\n }\n $target = $obj;\n }\n return $R;\n }",
"static function query_vars( $public_qv ) {\n\t\treturn array_merge( $public_qv, self::get_custom_qv() );\n\t}",
"function expand_options_array( $_arr_input = array() , $_prefix = '', $_single_scalar_key = 'other_style' ){\n\t\n\t$_arr_ret = array();\n\t\n\t# single scalar value is accepted as well; transformed into array\n\tif( ! is_array($_arr_input) AND strlen($_arr_input)>0 ){\n\t\t$_arr_input\t= array($_single_scalar_key => $_arr_input);\n\t}\n\t\n\tif( is_array($_arr_input)\tAND ( sizeof($_arr_input) > 0\t) ){\n\t\tforeach( $_arr_input as $_key => $_val ){\n\t\t\tif(\tis_int( $_key )\t){\n\t\t\t\tif( substr($_val,1) <> \"_\" ) $_val = \"_\". $_val;\n\t\t\t\t$_arr_ret[$_prefix.$_val] = true;\t# make the value a key\n\t\t\t} else {\n\t\t\t\tif( substr($_key,1) <> \"_\" ) $_key = \"_\". $_key;\n\t\t\t\t$_arr_ret[$_prefix.$_key] = $_val;\t# unchanged\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\t\n\n\treturn $_arr_ret; \t\t\n\t\n}",
"public function prepareForIndexing();",
"public static function normalizeQueryString($qs) {\n \n }",
"function get_preserved_options_queries($state_data, $temp_tables, $intent = '')\n {\n global $wpdb;\n\n $form_data = $this->form_data->getFormData();\n $keep_active_plugins = $form_data['keep_active_plugins'] === '1';\n $sql = '';\n $sitemeta_table_name = '';\n $options_table_names = array();\n\n $temp_prefix = isset($state_data['temp_prefix']) ? $state_data['temp_prefix'] : $this->props->temp_prefix;\n $table_prefix = isset($state_data['prefix']) ? $state_data['prefix'] : $wpdb->base_prefix;\n $prefix = esc_sql($temp_prefix . $table_prefix);\n\n foreach ($temp_tables as $temp_table) {\n $table = $wpdb->base_prefix . str_replace($prefix, '', $temp_table);\n\n // Get sitemeta table\n if (is_multisite() && $this->table_helper->table_is('sitemeta', $table)) {\n $sitemeta_table_name = $temp_table;\n }\n\n // Get array of options tables\n if ($this->table_helper->table_is('options', $table)) {\n $options_table_names[] = $temp_table;\n }\n }\n\n // Return if multisite but sitemeta and option tables not in migration scope\n if (is_multisite() && true === empty($sitemeta_table_name) && true === empty($options_table_names)) {\n return $sql;\n }\n\n // Return if options tables not in migration scope for non-multisite.\n if (!is_multisite() && true === empty($options_table_names)) {\n return $sql;\n }\n\n $preserved_options = array(\n 'wpmdb_settings',\n 'wpmdb_error_log',\n 'wpmdb_schema_version',\n 'upload_path',\n 'upload_url_path',\n 'blog_public',\n 'wpmdb_migration_options',\n 'wpmdb_migration_state',\n 'wpmdb_remote_response',\n 'wpmdb_recent_migrations',\n 'wpmdb_saved_profiles',\n 'wpmdb_remote_migration_state',\n );\n\n $preserved_sitemeta_options = $preserved_options;\n\n if ($keep_active_plugins) {\n $preserved_options[] = 'active_plugins';\n $preserved_sitemeta_options[] = 'active_sitewide_plugins';\n }\n\n if (is_multisite()) {\n // Get preserved data in site meta table if being replaced.\n if (!empty($sitemeta_table_name)) {\n $table = $wpdb->base_prefix . str_replace($prefix, '', $sitemeta_table_name);\n\n $preserved_migration_state_options = $wpdb->get_results(\n \"SELECT `meta_key` FROM `{$table}` WHERE `meta_key` LIKE '\" . MigrationState::OPTION_PREFIX . \"%'\",\n OBJECT_K\n );\n\n if (!empty($preserved_migration_state_options)) {\n $preserved_sitemeta_options = array_merge($preserved_sitemeta_options, array_keys($preserved_migration_state_options));\n }\n\n $preserved_sitemeta_options = apply_filters('wpmdb_preserved_sitemeta_options', $preserved_sitemeta_options, $intent);\n $preserved_sitemeta_options_escaped = esc_sql($preserved_sitemeta_options);\n\n $preserved_sitemeta_options_data = $wpdb->get_results(\n sprintf(\n \"SELECT * FROM `{$table}` WHERE `meta_key` IN ('%s')\",\n implode(\"','\", $preserved_sitemeta_options_escaped)\n ),\n ARRAY_A\n );\n\n $preserved_sitemeta_options_data = apply_filters('wpmdb_preserved_sitemeta_options_data', $preserved_sitemeta_options_data, $intent);\n\n // Create preserved data queries for site meta table\n foreach ($preserved_sitemeta_options_data as $option) {\n $sql .= $wpdb->prepare(\"DELETE FROM `{$sitemeta_table_name}` WHERE `meta_key` = %s;\\n\", $option['meta_key']);\n $sql .= $wpdb->prepare(\n \"INSERT INTO `{$sitemeta_table_name}` ( `meta_id`, `site_id`, `meta_key`, `meta_value` ) VALUES ( NULL , %s, %s, %s );\\n\",\n $option['site_id'],\n $option['meta_key'],\n $option['meta_value']\n );\n }\n }\n } else {\n $preserved_migration_state_options = $wpdb->get_results(\n \"SELECT `option_name` FROM `{$wpdb->options}` WHERE `option_name` LIKE '\" . MigrationState::OPTION_PREFIX . \"%'\",\n OBJECT_K\n );\n\n if (!empty($preserved_migration_state_options)) {\n $preserved_options = array_merge($preserved_options, array_keys($preserved_migration_state_options));\n }\n }\n\n // Get preserved data in options tables if being replaced.\n if (!empty($options_table_names)) {\n $preserved_options = apply_filters('wpmdb_preserved_options', $preserved_options, $intent);\n $preserved_options_escaped = esc_sql($preserved_options);\n\n $preserved_options_data = array();\n\n // Get preserved data in options tables\n foreach ($options_table_names as $option_table) {\n $table = $wpdb->base_prefix . str_replace($prefix, '', $option_table);\n\n $preserved_options_data[$option_table] = $wpdb->get_results(\n sprintf(\n \"SELECT * FROM `{$table}` WHERE `option_name` IN ('%s')\",\n implode(\"','\", $preserved_options_escaped)\n ),\n ARRAY_A\n );\n }\n\n $preserved_options_data = apply_filters('wpmdb_preserved_options_data', $preserved_options_data, $intent);\n\n // Create preserved data queries for options tables\n foreach ($preserved_options_data as $key => $value) {\n if (false === empty($value)) {\n foreach ($value as $option) {\n $sql .= $wpdb->prepare(\n \"DELETE FROM `{$key}` WHERE `option_name` = %s;\\n\",\n $option['option_name']\n );\n\n $sql .= $wpdb->prepare(\n \"INSERT INTO `{$key}` ( `option_id`, `option_name`, `option_value`, `autoload` ) VALUES ( NULL , %s, %s, %s );\\n\",\n $option['option_name'],\n $option['option_value'],\n $option['autoload']\n );\n }\n }\n }\n }\n\n return $sql;\n }",
"private function prepareQueryAndParams()\n {\n $where = null;\n $sqlParameters = array();\n\n // Select by id\n if($this->parameters['id']) {\n $where .= ' AND id = ?';\n $sqlParameters[] = $this->parameters['id'];\n }\n\n // Select by acronym\n if($this->parameters['acronym']) {\n $where .= ' AND acronym LIKE ?';\n $sqlParameters[] = $this->parameters['acronym'];\n }\n\n // Select by name\n if($this->parameters['name']) {\n $where .= ' AND name LIKE ?';\n $sqlParameters[] = $this->parameters['name'];\n }\n\n // Pagination\n if($this->parameters['hits'] && $this->parameters['page']) {\n $this->limit = \" LIMIT {$this->parameters['hits']} OFFSET \" . (($this->parameters['page'] - 1) * $this->parameters['hits']);\n }\n\n if (empty($sqlParameters)) {\n $query = array('where' => $where, 'params' => null);\n } else {\n $query = array('where' => $where, 'params' => $sqlParameters);\n }\n\n return $query;\n }",
"function extractArguments($startIndex, $endIndex, &$args) {\n\t\t$newArgs = array();\n\t\t\n\t\tfor ($i = $startIndex; $i <= $endIndex; $i ++) {\n\t\t\t$newArgs[$i - $startIndex] =& $args[$i];\n\t\t}\n\t\t\n\t\treturn $newArgs;\n\t}",
"private function prepareSearchUserQuery()\n {\n $sqlOrig = $this->sqlOrig;\n $query = $this->prepareQueryAndParams();\n $where = $query['where'];\n $where = $where ? \" WHERE 1 {$where}\" : null;\n $sql = $sqlOrig . $where . $this->sort . $this->limit;\n\n return array('sql' => $sql, 'params' => $query['params']);\n }",
"function query_vars($qvars){\n\t\t\tforeach ($this->customVars as $var){\n\t\t\t\t$qvars[] = $var;\n\t\t\t}\n\t\t\treturn $qvars;\n\t\t}",
"function extract_sql($wheres) {\n $tables = \"\";\n $where = \"\";\n\n if (is_string($wheres))\n return array('', $wheres);\n\n foreach ($wheres as $wpart => $set) {\n if (is_array($set)) {\n list($newtable, $newwhere) = extract_sql($set);\n $newwhere .= \" AND \" . $wpart;\n } else {\n $newtable = $set;\n $newwhere = $wpart;\n }\n\n if (!empty($newtable)) {\n if (empty($tables))\n\t$tables = $newtable;\n else\n\t$tables .= \", \" . $newtable;\n }\n\n if (!is_int($newwhere)) {\n if (empty($where))\n\t$where = $newwhere;\n else\n\t$where .= \" AND \" . $newwhere;\n }\n }\n\n return array($tables, $where);\n}",
"public function prepare_SELECTqueryArray(array $queryParts, array $input_parameters = [])\n {\n return new PreparedStatement();\n }",
"function add_query_vars($aVars) {\n $vars = array('q'); //custom query attributes\n $aVars = array_merge( $aVars, $vars ); // combine terms into proper structure\n return $aVars; // spit it out\n}",
"function pre_prepare_data(Array $data, $omitId = null) {\r\n $retstr = '';\r\n $retarr = array();\r\n foreach ($data as $key => $value) {\r\n if ($omitId && ($key == 'id')) continue;\r\n $key = unCamelCase($key);\r\n $retstr .= \" `$key` = :$key AND \";\r\n $retarr[$key] = $value;\r\n }\r\n $retstr .= \" 1 = 1 \";\r\n return array('queryString' => $retstr, 'paramArr' => $retarr);\r\n}",
"function exec_SELECT_queryArray(array $parts)\n\t{\n//\t\t\t\t' FROM '.$parts['FROM'].\n//\t\t\t\t' WHERE '.$parts['WHERE'].\n//\t\t\t\t' GROUP BY '.$parts['GROUPBY'].\n//\t\t\t\t' ORDER BY '.$parts['ORDERBY'];\n\t\treturn $this->exec_SELECTquery($parts['SELECT'], $parts['FROM'],\n\t\t\t$parts['WHERE'], $parts['GROUPBY'], $parts['ORDERBY']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that is called after a test was executed. Unsets the http client mock and the test RmvApi instance. | protected function tearDown()
{
unset($this->httpClientMock);
unset($this->rmvApi);
} | [
"public function tearDown()\n {\n $this->api = null;\n }",
"protected function _after()\n {\n unset($this->api);\n\n // Clear any mocks etc\n Test::clean();\n }",
"public function tearDown()\n {\n parent::tearDown();\n $client = ClientBuilder::create($this->getTestApiKey())->build();\n\n try {\n $client->getEngine($this->getTestEngineName());\n $client->deleteEngine($this->getTestEngineName());\n } catch (\\Elastic\\OpenApi\\Codegen\\Exception\\NotFoundException $e) {\n ;\n }\n }",
"public function tearDown() {\n parent::tearDown();\n $this->client->logout();\n }",
"protected function tearDown(): void\n {\n unset($this->responseFactory);\n unset($this->fixture);\n parent::tearDown();\n }",
"public static function unsetHttpClient(): void\n {\n self::$httpClient = null;\n self::$requestFactory = null;\n }",
"public function reset() {\n\t\trequire_once 'Zend/Registry.php';\n\t\tZend_Registry::_unsetInstance();\n\n\t\trequire_once 'Celsus/Auth.php';\n\t\tCelsus_Auth::getInstance()->clearIdentity();\n\t\tCelsus_Auth::resetAuthAdapter();\n\n\t\t$_SESSION = array();\r\n\t\t$_COOKIE = array();\n\n\t\t// Undo the mocking set up by the test.\n\t\t$this->_mock()->reset();\n\n\t\t$this->_integration()->reset();\n\n\t\t// Reset the request and response objects.\r\n\t\t$this->resetRequest()->resetResponse();\r\n\t\tZend_Session::$_unitTestEnabled = true;\n\t}",
"public function tearDown() {\n $this->backend = null;\n }",
"public function tearDown() {\n\t\tparent::tearDown();\n\t\t$this->stopHttpHalting();\n\t\t$this->stopHttpMocking();\n\t\tself::$error_log->clear();\n\t\t$this->assertEmpty( self::$error_log->get() );\n\t\tdelete_transient( WPA0_JWKS_CACHE_TRANSIENT_NAME );\n\t}",
"private function resetRestClient()\n {\n $this->restClient->getConfig()->clear();\n }",
"public function tearDown() {\n\t\t$this->adminSearchRepository = NULL;\n\t}",
"protected function tearDown(): void\n {\n Container::$globalInstance = null;\n }",
"public function resetApi() {\n\t\t$this->_response = false;\n\t\t$this->_next_link = false;\n\t\t$this->_previous_link = false;\n\t\t$this->_status_code = false;\n\t\t$this->_curl_handle = null;\n\t\t}",
"public static function tearDownAfterClass() {\n parent::tearDownAfterClass();\n $pid = static::getMockcoursePid();\n shell_exec(\"kill -9 \".$pid);\n static::$_client = null;\n }",
"public function tearDown()\n {\n $this->classMocker->disable();\n $this->classMocker = null;\n }",
"public static function clearHttpClient()\n {\n self::$httpClient = null;\n }",
"public static function tearDownAfterClass()\n {\n static::$riak->getApi()->closeConnection();\n static::$riak = null;\n }",
"public function tearDown(): void\n {\n $this->verboseHandlerMock = null;\n Rollbar::destroy();\n parent::tearDown();\n }",
"public function reset(): ApiClient\n {\n $this->internalRequest = new InternalRequest($this->baseUrl, 'GET');\n $this->request = null;\n\t$this->response = null;\n\n $this->profiler = false;\n\n $this->hasPerformedRequest = false;\n $this->kernel->shutdown();\n $this->kernel->boot();\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Vector scaling f w = | public static function scale($f, $v) {
if (is_numeric($f) && Math_VectorOp::isVector($v)) {
$arr = array();
$n = $v->size();
for ($i = 0; $i < $n; $i++) {
$arr[$i] = $v->get($i) * $f;
}
return new Math_Vector($arr);
} else {
throw new InvalidArgumentException("Requires a numeric factor and a Math_Vector object");
}
} | [
"static function scaleVec(&$v, &$val)\r\n {\r\n return [\r\n $v[0] * $val[0],\r\n $v[1] * $val[1]\r\n ];\r\n }",
"public function scale(Vec3 $scale) : void {}",
"abstract public function scale($w, $h);",
"function block_recblock_scaling_unit_normalization($vector){\n\t$vectornorm = [];\n\t$vlength = block_recblock_get_vector_length($vector);\n\n\tfor($i=0;$i<count($vector);$i++){\n\t\t$z = $vector[$i] / $vlength;\n\t\tarray_push($vectornorm,$z);\n\t}\n\n\treturn $vectornorm;\n}",
"function scaleTo($x, $y){}",
"public function scale($scale, $normalizeFlag){}",
"public function scale() { return $this->_m_scale; }",
"public function getScale();",
"public static function scale(vec3 $v, float $s) : vec3 {\n $v2 = clone $v;\n $v2->x *= $s;\n $v2->y *= $s;\n $v2->z *= $s;\n return $v2;\n }",
"static function normalize(&$v)\r\n {\r\n $d = sqrt( $v[0]*$v[0] + $v[1]*$v[1] );\r\n if($d==0) return $v;\r\n return [\r\n $v[0] / $d,\r\n $v[1] / $d\r\n ];\r\n }",
"function normalize()\n\t\t{\n\t\t\t$m = $this->magnitude();\n\t\t\t$res = new Vector(array('dest' => new Vertex(array(\n\t\t\t\t'x' => $this->_x / $m,\n\t\t\t\t'y' => $this->_y / $m,\n\t\t\t\t'z' => $this->_z / $m\n\t\t\t))));\n\t\t\treturn ($res);\n\t\t}",
"function scale($xScale, $yScale) {}",
"function vectorProduct(Point $v): float { return Pos::vectorProduct($this->coords, $v->coords); }",
"public function getScaleMatrix(){}",
"public function getScaling()\n {\n return $this->scaling;\n }",
"function scalePoint($v, $sx, $sy=-1000){\n\n // Check n replace SY\n if ($sy==-1000) $sy=$sx;\n \n return array(\n\t \"lat\"=>($v->get_lat() * $sx),\n\t \"lon\"=>($v->get_lon() * $sy)\n\t );\n}",
"public function getScaled()\n {\n return $this->scaled;\n }",
"public function getScale() : float\n\t{\n\t\treturn (float) $this->get( 'swpost.scale', 1 ) ?: 1;\n\t}",
"public static function normalize(GL\\Math\\Vec2|GL\\Math\\Vec3|GL\\Math\\Vec4 $vec) : GL\\Math\\Vec2|GL\\Math\\Vec3|GL\\Math\\Vec4 {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return if Item is Kit | public function is_kit() {
return $this->kit == 'Y';
} | [
"public function has_item(){\n $args = func_get_args();\n $counter = $this->get_counter('item_disabled');\n $item = empty($counter) ? $this->get_info('robot_item') : '';\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"public function has_item(){\n $args = func_get_args();\n $item = $this->get_info('robot_item');\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"public function hasDisneyItem() {\n\t\t\n\t\t$has_disney_item = false;\n\n\t\tforeach($this->items() as $item) {\n\t\t\tif($item->clientProduct()->software_code == 'MOD'){\n\t\t\t\t$has_disney_item = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $has_disney_item;\n\t}",
"private function inItem()\n\t{\n\t\tif($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif(in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif($this->version == 'ATOM 1')\n\t\t{\n\t\t\tif(in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"private function inItem()\n\t{\n\t\tif ($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif (in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t} elseif ($this->version == 'ATOM 1') {\n\t\t\tif (in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"private function is_kernel_item($item) {\r\n $lr0 = $item->item();\r\n $result = false;\r\n if ($lr0->position() == 0 ) {\r\n $fst = $this->g->starting_lr1_item()->item();;\r\n if ($fst->is_same($lr0)) {\r\n $result = true;\r\n }\r\n } else {\r\n $result = true;\r\n }\r\n return $result;\r\n }",
"function is_item( $value ) {\n if (! $value instanceof Item ) {\n return false;\n }\n \n if ( $value->item_exists() ) {\n return true;\n } else {\n return false;\n }\n}",
"public function hasItemType(): bool\n {\n return $this->itemTypeAttr !== NULL;\n }",
"public function isSetItem()\n {\n return (empty($this->item)) ? false : true;\n }",
"public function hasItemLevel()\n {\n return $this->item_level !== null;\n }",
"private function itemContainsABuyable(array $item)\n {\n return isset($item['product']) && $item['product'] instanceof Buyable;\n }",
"public function has_item($item_token){\n if (empty($this->player_items) || empty($item_token)){ return false; }\n elseif (in_array($item_token, $this->player_items)){ return true; }\n else { return false; }\n }",
"public function IsThisCartHasOffer():bool\n {\n if(in_array('Shoes', $this->cart->items) ||\n in_array('T-shirt', $this->cart->items) &&\n $this->cart->productCount['T-shirt'] >= 2 ){\n return true;\n }\n return false;\n }",
"public function hasItem($name);",
"public function isWeapon(Item $item)\n {\n return true;\n }",
"public function canUseOnItems(): bool {\n return $this->value === self::USE_ON_ITEMS;\n }",
"function es_botonera_en_barra_item()\n\t{\n\t\treturn isset($this->_info_ci['botonera_barra_item']) && $this->_info_ci['botonera_barra_item']; \n\t}",
"public function playerHasQuestItem(Character $character): bool {\n $inventory = Inventory::where('character_id', $character->id)->first();\n $item = Item::where('effect', ItemEffectsValue::FACTION_POINTS)->first();\n\n if (is_null($item)) {\n return false;\n }\n\n return !is_null(InventorySlot::where('inventory_id', $inventory->id)->where('item_id', $item->id)->first());\n }",
"public function getIsBlockPlanterItem()\n {\n return $this->isBlockPlanterItem;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new FinanceAdvertiserBillTerm model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new FinanceAdvertiserBillTerm();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->bill_id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new Bill();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Bank();\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->b_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new TaKibBR();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'IDPemda' => $model->IDPemda, 'Kd_Id' => $model->Kd_Id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Bankbook();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->bankbook_entry_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new StationBill();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function createbillAction(){\n\t\t$form = new Financial_Form_CreateBill();\n\t\t$this->view->form = $form;\n\t \n\t\tif ( $this->getRequest()->isPost() and $form->isValid($this->getRequest()->getParams()) ){\n\t \n\t\t\t$formValues = $form->getValues();\n\t\t\t$formValues['unitId'] = $this->_getParam( 'unitId' );\t\t\t\n\n\t\t\t/*\n\t\t\t * array\n\t\t\t 'accountLinkId' => string '1' (length=1)\n\t\t\t 'originalAmountDue' => string '100.11' (length=6)\n\t\t\t 'dueDate' => string '2009-01-01' (length=10)\n\t\t\t string '5' (length=1)\n\t\t\t */\n\n\t\t\t$bill = new Financial_Model_Bill();\n\t\t\t$bill->createBill( $formValues );\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new BonanzaPayment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new BalanceAmount();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Tbadvocates();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Dbf();\n\n if ($model->load(Yii::$app->request->post()) && $model->save() && $model->processDbf()) {\n return $this->redirect(['index']);\n //return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Balance();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Billertransactions();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->REQUESTID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SalesFaktur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_faktur]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new Bet();\n\n /* if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->bet_id]);\n } else { */\n return $this->render('index', [\n 'model' => $model,\n ]);\n// }\n }",
"public function actionCreate()\n {\n $model = new Orderrate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new BudgetTransfer();\n $model->dep_id = Yii::$app->user->identity->id;\n $model->user_id = Yii::$app->user->identity->id;\n $model->source_ip = Yii::$app->request->userIP;\n $model->status = \"pending\" ;\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $rowf=(new \\yii\\db\\Query())\n ->select('*')\n ->from('budget_head_status') \n ->where(['year'=>$model->year, 'dep_id'=> $model->dep_id, 'bh_name' => $model->from_bh])\n ->all();\n $bal = $rowf[0]['bh_balance'];\n \n if( $bal < (float)$model->amount){\n return $this->refresh();\n }\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new FinanceFpa();\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n $model->fpa_value = Money::toDbPercentage($model->fpa_value);\n if ($model->fpa_value < 0 || $model->fpa_value > 10000) {\n throw new \\Exception();\n }\n if (!$model->save()) {\n throw new \\Exception();\n }\n\n $user = Yii::$app->user->identity->username;\n $year = Yii::$app->session[\"working_year\"];\n Yii::info('User ' . $user . ' working in year ' . $year . ' created new VAT level.', 'financial');\n\n Yii::$app->session->addFlash('success', Module::t('modules/finance/app', \"The item was created successfully.\"));\n return $this->redirect(['index']);\n } catch (\\Exception $exc) {\n Yii::$app->session->addFlash('danger', Module::t('modules/finance/app', \"Failure in creating the requested item.\"));\n return $this->redirect(['index']);\n }\n } else {\n return $this->render('create', ['model' => $model]);\n }\n }",
"public function create_price_term()\r\n\t{\r\n\t\t$data['price_term_name']=$this->input->post('price_term_name');\r\n\t\t$data['price_term'] = $this->input->post('price_term');\r\n\t $data['created_on'] = date('Y-m-d H:i:s');\r\n\t $data['created_by'] = $_SESSION['admindata']['user_id'];\r\n\r\n\t $result = $this->PriceTerms_model->create_price_term($data);\r\n\t if($result)\r\n\t {\r\n\t \t$this->session->set_flashdata('qstage_success', 'Price Term has been added successfully.');\r\n \t\tredirect('/PriceTerms');\r\n\t }\r\n\t else\r\n\t {\r\n\t \t$this->session->set_flashdata('qstage_err', 'Something Went Wrong.');\r\n \t\tredirect('/PriceTerms');\r\n\t }\r\n\t}",
"public function actionCreate()\n {\n $model = new CustomAsset();\n $model_sum =new CustomAssetSum();\n $model_line = new CustomAssetLine();\n $model->purchase_date = date('Y-m-d');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->saveBoiler($model_sum,$model_line,$model);\n Yii::$app->session->setFlash('success', \"Boiler Created!\");\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'model_sum'=>$model_sum,\n 'model_line'=>$model_line,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ wp_enqueue_style( 'foundation_menu', foundation_get_base_module_url() . '/menu/menu.css', foundation_menu_get_style_deps(), FOUNDATION_VERSION ); | function foundation_menu_init() {
wp_enqueue_script(
'foundation_menu',
foundation_get_base_module_url() . '/menu/menu.js',
array( 'jquery' ),
FOUNDATION_VERSION,
true
);
} | [
"function enqueue_foundation() {\n\t// wp_enqueue_style( 'foundation', get_template_directory_uri() . '/css/foundation.min.css' );\n\n\twp_enqueue_style( 'compressed', get_template_directory_uri() . '/css/compressed.css' );\n}",
"public function dahz_menu_styles() {\n if( is_customize_preview() ) return;\n $token = 'dahz';\n\n wp_register_style( $token . '-menu', esc_url( DF_CORE_CSS_DIR . 'menu.css' ), array(), DF_VERSION );\n wp_enqueue_style( $token . '-menu' );\n }",
"function jet_menu_zerif_styles() {\n\twp_enqueue_style(\n\t\t'jet-menu-zerif',\n\t\tjet_menu()->get_theme_url( 'assets/css/style.css' ),\n\t\tarray(),\n\t\tjet_menu()->get_version()\n\t);\n}",
"function gc_responsive_menu() {\n \twp_enqueue_script( 'genesischild-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );\n \t$output = array(\n \t\t'mainMenu' => __( 'Menu', 'genesischild' ),\n \t\t'subMenu' => __( 'Menu', 'genesischild' ),\n \t);\n \twp_localize_script( 'genesischild-responsive-menu', 'genesisSampleL10n', $output );\n \twp_enqueue_style( 'genesischildcss' , get_stylesheet_directory_uri() . '/css/responsive-menu.css', array(), '2.4.2', 'all' );\n\n\n }",
"function wp_admin_fluency_clickmenus() {\n\tglobal $userdata;\n\twp_enqueue_style('fluency-clickmenus',WP_PLUGIN_URL . '/' . plugin_basename(dirname(__FILE__)) . '/resources/click-menus.css.php'.($userdata->admin_color == 'classic' ? '?classic=true' : ''), $deps = array(), $ver = FLUENCY_VERSION, $media = 'all' );\n}",
"function tp_menu_header() {\n\t\t\tif ( basename( $_SERVER['PHP_SELF'] ) == \"nav-menus.php\" ) {\n\t\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t\t\twp_enqueue_style( 'tp-mega-menu-backend', TP_FRAMEWORK_LIBS_URI . 'megamenu/css/backend.css' );\n\t\t\t\twp_enqueue_style( 'tp-mega-menu-frontend', TP_FRAMEWORK_LIBS_URI . 'megamenu/css/tp-mega-menu.css' );\n\t\t\t\twp_enqueue_style( 'tp-font-awesome', TP_THEME_FRAMEWORK_URI . 'css/font-awesome.min.css' );\n\t\t\t\twp_enqueue_script( 'tp-mega-menu-js', TP_FRAMEWORK_LIBS_URI . 'megamenu/js/tp-mega-menu.js', array(\n\t\t\t\t\t'jquery',\n\t\t\t\t\t'jquery-ui-sortable'\n\t\t\t\t), false, true );\n\t\t\t\twp_enqueue_script( 'wp-color-picker' );\n\t\t\t}\n\t\t\tadd_thickbox();\n\t\t}",
"function artjetfly_style() {\n\t// wp_enqueue_style( 'slick-theme-style', get_template_directory_uri() . '/assets/css/slick-theme.css' );\n\twp_enqueue_style( 'magnific-style', get_template_directory_uri() . '/assets/css/magnific-popup.css' );\n\twp_enqueue_style( 'fancybox-style', get_template_directory_uri() . '/assets/css/jquery.fancybox.min.css' );\n\twp_enqueue_style( 'hamburgers.min-style', get_template_directory_uri() . '/assets/css/hamburgers.min.css' );\n\twp_enqueue_style( 'mmenu-style', get_template_directory_uri() . '/assets/libs/mmenu-light-master/dist/mmenu-light.css' );\n\twp_enqueue_style( 'main-style', get_stylesheet_uri() );\n\n}",
"public function load_admin_menu_assets() {\n\t\twp_enqueue_style( 'admin-menu-css' );\n\t\twp_enqueue_script( 'admin-menu-js' );\n\t}",
"function js_menu() {\n\twp_enqueue_script( 'menu-responsive', get_bloginfo( 'stylesheet_directory' ) . '/js/menu.js', array( 'jquery' ), '1.0.0' );\n\t/*wp_register_script( 'spk_menu_responsive', get_bloginfo( 'stylesheet_directory' ) . '/js/menu.js', null, null, true );\n\twp_enqueue_style( 'spk_menu_responsive' );*/\n //wp_enqueue_style( 'dashicons' );\n}",
"function mytheme_scripts() {\n\twp_enqueue_style( 'dashicons' );\n}",
"function sp_enqueue_script() {\n wp_enqueue_script('sample-sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-menu.js', array('jquery'), '1.0.0');\n}",
"function off_canvas_menu() {\n \twp_enqueue_style( 'mobile-css', plugin_dir_url( __FILE__ ) . 'css/style.css', array(), null );\n \twp_enqueue_script( 'mobile-script', plugin_dir_url( __FILE__ ) . 'js/mobile.js', array( 'jquery' ), '1.0', true );\n }",
"function uberMenu_register_theme_styles(){\n\tubermenu_registerStylePreset( 'theme-default-styles', 'Theme Default Style', get_stylesheet_directory_uri().'/assets/css/ubermenu.lite.css' );\n}",
"function sm_scripts() {\r\n\t\twp_enqueue_style( 'dashicons' );\r\n\t}",
"function burger_menu() {\r\n \r\n wp_enqueue_script( 'open_burger-menu', get_stylesheet_directory_uri() . '/scripts/burger-menu.js', array( 'jquery' ) );\r\n\r\n \r\n}",
"function trMod_init_styles() \n{\n\twp_register_style( 'trMod_style' , trMod_PLUGIN_URL . 'css/training-modules-style.css' );\n\t//wp_register_style( 'reveal_style', trMod_PLUGIN_URL . 'css/reveal.css' );\n\t//wp_enqueue_style( 'trMod_admin_style' );\n}",
"function modernize_it(){\n wp_register_script( 'modernizr', get_template_directory_uri() . '/foundation/javascripts/modernizr.foundation.js', array(), false, true); \n wp_enqueue_script( 'modernizr' );\n}",
"function voa_top_content_admin_menu_loader() {\n add_filter(\"admin_head\", \"voa_top_content_admin_menu_css\" );\n add_menu_page(\"Homepage Layout\", \"Homepage Layout\", \"edit_posts\", \"voa-homepage-layout\", \"voa_top_content_admin_menu\", \"dashicons-schedule\" );\n add_submenu_page(\"voa-homepage-layout\", \"Configure\", \"Configure\", \"edit_posts\", \"voa-homepage-config\", \"voa_top_content_admin_config_menu\");\n}",
"function cf_admin_style()\n{\n wp_enqueue_style('cf-admin-styles', get_template_directory_uri() . '/app/carbon-fields/cf-admin.css');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add_theme_location Set another location for themes to be looked in | public function add_theme_location( $location ) {
$this->_theme_locations[] = $location;
} | [
"public function add_theme_location( $location )\n\t{\n\t\t$this->_theme_locations[] = $location;\n\t}",
"function cybershop_elementor_locations( $elementor_theme_manager ) {\n $elementor_theme_manager->register_all_core_location();\n}",
"abstract protected function registerThemeLayouts();",
"function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n\t\t$addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n \t'template' => 'templates',\n //'css' => 'templates/css',\n 'js' => 'js',\n ))->setParent($l);\n\t}",
"private function set_locations(): void {\n\n\t\t$this->location_list = [];\n\n\t\t/**\n\t\t * Add code to manage plugins if needed.\n\t\t */\n\t\tif ( ! function_exists( 'get_plugins' ) ) {\n\t\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t}\n\n\t\t/**\n\t\t * Get current theme. We propose to use Parent or Child theme if it exists.\n\t\t *\n\t\t * We check the theme and add it to the selection list if it contains the right sub-directory used\n\t\t * to save json files then set information.\n\t\t */\n\n\t\t$theme = wp_get_theme();\n\t\t$parent = $theme->get( 'Template' );\n\t\t$name = $theme->get( 'Name' );\n\n\t\t// Child theme or parent ?\n\t\t$child = ( ! empty( $parent ) );\n\n\t\t//Child theme\n\t\tif ( $child && is_dir( $path = get_stylesheet_directory() . '/' . $this->json_dir ) ) {\n\t\t\t$label = 'Theme: ' . $name . ' (child)';\n\t\t\t$this->location_list [ $label ] = [\n\t\t\t\t'type' => 'child',\n\t\t\t\t'value' => $path,\n\t\t\t\t'name' => $label\n\t\t\t];\n\t\t}\n\n\t\t//Parent or single theme\n\t\tif ( is_dir( $path = get_template_directory() . '/' . $this->json_dir ) ) {\n\t\t\t$label = 'Theme: ' . $name . ( ( $child ) ? ' (parent)' : '' );\n\t\t\t$this->location_list [ $label ] = [\n\t\t\t\t'type' => ( $child ) ? 'parent' : 'theme',\n\t\t\t\t'value' => $path,\n\t\t\t\t'name' => $label\n\t\t\t];\n\t\t}\n\n\t\t/**\n\t\t * Get all plugins\n\t\t *\n\t\t * For each active one, we check if there is the right sub-directory used\n\t\t * to save json files the set information.\n\t\t */\n\n\t\t$plugins = get_plugins();\n\t\tforeach ( $plugins as $uri => $plugin_data ) {\n\t\t\tif ( is_plugin_active( $uri ) ) {\n\t\t\t\t$json_location = '/' . explode( '/', $uri )[0] . '/' . $this->json_dir;\n\t\t\t\tif ( is_dir( $path = WP_PLUGIN_DIR . $json_location ) ) {\n\t\t\t\t\t$label = 'Plugin: ' . $plugin_data['Title'];\n\t\t\t\t\t$this->location_list [ $label ] = [\n\t\t\t\t\t\t'type' => 'plugin',\n\t\t\t\t\t\t'value' => $path,\n\t\t\t\t\t\t'name' => $label\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// We can also remove existing location or add any others.\n\t\t$this->location_list = apply_filters( 'ajlm/manage-json-location', $this->location_list );\n\t}",
"protected function _update_theme_paths()\n {\n // Store a whole heap of template locations\n $this->_template_locations = array(\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/modules/' . $this->_module .'/layouts/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/modules/' . $this->_module .'/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/layouts/',\n $this->CI->config->item('smarty.theme_path') . $this->_theme_name . '/views/',\n APPPATH . 'modules/' . $this->_module . '/views/layouts/',\n APPPATH . 'modules/' . $this->_module . '/views/',\n APPPATH . 'views/layouts/',\n APPPATH . 'views/',\n \tPRIVATEPATH. 'modules/' . $this->_module .'/template/',\n \tPRIVATEPATH.'templates/'\n );\n\n // Will add paths into Smarty for \"smarter\" inheritance and inclusion\n $this->_add_paths();\n }",
"public function registerThemePath()\n\t{\n\t\t$path = $this->app['path.base'].'/themes';\n\n\t\t$this->app['theme.path'] = realpath($path);\n\t}",
"abstract protected function _set_theme();",
"public function add_theme_support() {\n\t}",
"function install_theme_information() {}",
"public function addTheme($theme) {\n\t\t$themePath = 'APP/views/themed/' . $theme . '/webroot';\n\n\t\t$viewPaths = App::path('views');\n\t\tforeach ($viewPaths as $viewPath) {\n\t\t\t$path = $viewPath . 'themed' . DS . $theme . DS . 'webroot';\n\t\t\tif (is_dir($path)) {\n\t\t\t\t$themePath = $path;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tforeach (array_reverse($this->settings['searchPaths']) as $searchPath) {\n\t\t\tarray_unshift(\n\t\t\t\t$this->settings['searchPaths'],\n\t\t\t\tstr_replace('WEBROOT', $themePath, $searchPath)\n\t\t\t);\n\t\t}\n\t}",
"function child_theme_setup2() {\n}",
"protected function addRegisteredLocation($theme, $parent)\n {\n if (! is_null($parent)) {\n $parentLocation = $this->path('resources/views');\n app('view.finder')->prependLocation($parentLocation);\n }\n\n $themeLocation = $this->path('resources/views');\n app('view.finder')->prependLocation($themeLocation);\n }",
"function bp_register_theme_directory() {\n\tdo_action( 'bp_register_theme_directory' );\n}",
"function _maybe_update_themes() {}",
"function _manually_load_child_theme() {\n\t//echo \"LOADING Theme\";\n\n\treturn dirname( dirname( __FILE__ ) ) ; // . '/functions.php';\n}",
"protected function afterThemeHook(){}",
"public function register_theme_directory() {\n\t\tif ( ! ajan_do_register_theme_directory() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregister_theme_directory( $this->old_themes_dir );\n\t}",
"function register_theme_directory($directory)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the function to set the Temp Request Register | public function settmpReg(){
# Register Product ID
if($this->isPropertySet("ProTmpID", "V"))
$_SESSION['ProTmpID'] = $this->getProperty("ProTmpID");
} | [
"public function setReqRes()\n {\n $this->request = new Request();\n $this->setVars();\n $this->request->setParams($this->vars);\n $this->response = new Response();\n }",
"function setReqValue(){\n\t\tif (!$this->hasAttribute('i')){\n\t\t $varname=\"tmodule_\" . $this->name;\n\t\t\t$this->_value=$_REQUEST[$varname];\n\t\t}\t\t\n\t}",
"private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n }",
"private function get_new_request_token() {\n\t\t\t$requestToken = $this->fetch_new_token();\t\t\n\t}",
"function createTempuser()\n\t{\n\t\t// check dataArr for current username, password, password_again\n\t\tif ( ! trim( $this->dataArr[ 'username' ] ) )\n\t\t{\n\t\t\t// microsecond difference\n\t\t\t$tempuser\t\t\t= uniqid( 'visitor_' );\n\t\t\t$temppass\t\t\t= uniqid( '' );\n\n\t\t\t$this->dataArr[ 'username' ]\t\t= $tempuser;\n\n\t\t\t// create password from unique id, 6 char\n\t\t\t// create unique username from email\n\t\t\t$this->dataArr[ 'password' ]\t\t= $temppass;\n\t\t\t$this->dataArr[ 'password_again' ]\t= $temppass;\n\t\t}\n\n\t\tif ( ! trim( $this->dataArr[ 'endtime' ] ) )\n\t\t{\n\t\t\t// set endtime about x days later per\n\t\t\t// $this->conf[ 'tempuserTimelimit' ]\n\t\t\t$now\t\t\t\t= time();\n\t\t\t$later\t\t\t\t= $now\n\t\t\t\t\t\t\t\t\t+ ( $this->conf[ 'tempuserTimelimit' ]\n\t\t\t\t\t\t\t\t\t\t* 24 * 60 * 60 \n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t$this->dataArr[ 'endtime' ]\t= $later;\n\t\t}\n\t}",
"protected function _prepareRegisterToken(){\r\n\r\n $payment = $this->_service->getPayment();\r\n $helper = $this->_getHelper();\r\n $cards = Mage::getModel('realex/realex_source_cards');\r\n $transactionReference = $this->_service->getTransactionReference();\r\n\r\n\r\n $request = array(\r\n 'attributes' => array(\r\n 'timestamp' => $helper->getTimestamp(),\r\n 'type' => 'card-new'\r\n ),\r\n 'merchantid' => array('value' => $helper->getConfigData('realex','vendor')),\r\n 'orderid' => array('value' => $transactionReference . '-card')\r\n );\r\n\r\n $card = array(\r\n\r\n 'ref' => array('value' => $helper->getCardReference($cards->getGatewayCardType($payment->getCcType()))),\r\n 'payerref' => array('value' => $this->_payerRef),\r\n 'number'=>array('value' => ($this->_service->getMd('card_number')?$this->_service->getMd('card_number'):$payment->getCcNumber())),\r\n 'expdate' =>array('value' => $helper->getCreditCardDate($payment)),\r\n 'chname' => array('value' => ($helper->ss($payment->getCcOwner(),100))),\r\n 'type' => array('value' => $cards->getGatewayCardType($payment->getCcType())),\r\n );\r\n\r\n if($payment->getCcSsIssue()){\r\n $card['issueno'] = array('value' => $payment->getCcSsIssue());\r\n }\r\n\r\n $request['card'] = $card;\r\n\r\n $sha1hash = array(\r\n $request['attributes']['timestamp'] ,\r\n $request['merchantid']['value'],\r\n $request['orderid']['value'],\r\n '',\r\n '',\r\n $this->_payerRef,\r\n $request['card']['chname']['value'],\r\n $request['card']['number']['value']\r\n );\r\n\r\n $request['sha1hash'] = array('value' => $helper->generateSha1Hash($helper->getConfigData('realex','secret'),$sha1hash));\r\n\r\n $this->_message->setData(array('request'=>$request));\r\n return $this;\r\n\r\n\r\n }",
"public function register_resend_otp_post() {\n\n $registered_id = !empty($this->post_data['registered_id']) ? $this->post_data['registered_id'] : \"\";\n\n try {\n if (\n empty($registered_id)\n ) {\n $this->bad_request();\n exit;\n }\n\n $user_data = $this->User_model->get_user_temp_details_by_id($registered_id);\n\n if (\n (!empty($user_data) && count($user_data) > 0)\n ) {\n\n if (!empty($user_data['temp_auth_resend_timestamp']) && (strtotime($user_data['temp_auth_resend_timestamp']) + RESEND_OTP_NEXT_TIME) >= time()) {\n $wating_time = (strtotime($user_data['temp_auth_resend_timestamp']) + RESEND_OTP_NEXT_TIME) - time();\n $this->my_response['status'] = false;\n $this->my_response['message'] = sprintf(lang(\"otp_resend_time_limit\"), $wating_time);\n $this->send_response();\n }\n\n if ($user_data['temp_auth_resend_count'] >= RESEND_OTP_LIMIT) {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang(\"otp_resend_limit_reach\");\n $this->send_response();\n }\n\n\n $otp = getUniqueToken(6, 'numeric');\n $message = sprintf(OTP_MESSAGE, $otp);\n $send_otp = array(\n 'phone_number' => DEFAULT_COUNTRY_CODE . $user_data['temp_user_phone_number'],\n 'message' => $message,\n );\n $sening_sms = send_message_by_vibgyortel($send_otp);\n //$sening_sms = TRUE;\n\n if ($sening_sms) {\n\n $auth_update_data = array(\n 'temp_auth_code' => $otp,\n 'temp_auth_otp_expiry_time' => date('Y-m-d H:i:s', strtotime(OTP_EXPIRE_TOKEN_TIME, strtotime($this->utc_time_formated))),\n \"temp_auth_attempt_count\" => 0,\n \"temp_auth_resend_timestamp\" => date(\"Y-m-d H:i:s\"),\n \"temp_auth_resend_count\" => $user_data['temp_auth_resend_count'] + 1\n );\n\n $this->Common_model->update(TBL_USER_TEMP, $auth_update_data, array('temp_user_id' => $registered_id));\n\n $this->my_response['status'] = true;\n $this->my_response['message'] = lang(\"otp_sent_to_mobile\");\n $this->send_response();\n } else {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang(\"sms_otp_send_fail\");\n $this->send_response();\n }\n } else {\n $this->my_response['status'] = false;\n $this->my_response['message'] = lang(\"user_detail_not_found\");\n $this->send_response();\n }\n } catch (Exception $e) {\n $this->error = $e->getMessage();\n $this->store_error();\n }\n }",
"public function setCSRFToken()\n {\n $this->session['CSRFToken'] = sha1(microtime());\n }",
"public static function start_request() {\n $data = self::data();\n if(!$data->get('request_id')) {\n $usage = getrusage();\n\n /* Capture current memory usage */\n self::$at_start['memory_usage'] = memory_get_usage();\n\n /* Capture CPU usage information */\n self::$at_start['cpu_user'] = $usage[\"ru_utime.tv_sec\"]*1e6 + $usage[\"ru_utime.tv_usec\"]; \t\n self::$at_start['cpu_system'] = $usage[\"ru_stime.tv_sec\"]*1e6 + $usage[\"ru_stime.tv_usec\"];\n $data->set('request_id', sha1(posix_getpid() . '-' . get_server_ip() . '-' . microtime(true)));\n\n register_shutdown_function(array('Instrumentation','end_request'));\n }\n }",
"public function set_request_token()\n\t{\n\t\t$this->request_token = $this->sdk->getRequestToken( $this->redirect_uri );\n\t}",
"public function registerForm(){\n $this->nonce=Nonce::getNonce();\n }",
"function setTmpVar() {\r\n $this->tmpName = JPSpan_getTmpVar();\r\n }",
"public static function Lock_Request_Processing() {\n\t//--\n\tself::$RequestProcessed = true; // this will lock the Request processing\n\t//--\n\tSmartFrameworkRegistry::lockRequestVar(); // this will lock the request registry\n\t//--\n}",
"private function setToken()\r\n {\r\n $this->token = $this->response->data->sl_token;\r\n\r\n $this->setTokenExpiryDate();\r\n }",
"private function Set_Request()\n\t\t{\n\t\ttry\n\t\t\t{\n\t\t\t$_SESSION[\"request\"][\"host\"]=$_SERVER[\"HTTP_HOST\"];\n\t\t\t$_SESSION[\"request\"][\"uri\"]=$_SERVER[\"REQUEST_URI\"];\n\t\t\t$_SESSION[\"request\"][\"serverport\"]=$_SERVER[\"SERVER_PORT\"];\n\t\t\t$_SESSION[\"request\"][\"protocol\"]=$_SERVER[\"SERVER_PROTOCOL\"];\n\t\t\t$_SESSION[\"request\"][\"method\"]=$_SERVER[\"REQUEST_METHOD\"];\n\t\t\t$_SESSION[\"request\"][\"query\"]=$_SERVER[\"QUERY_STRING\"];\n\t\t\t$_SESSION[\"request\"][\"userport\"]=$_SERVER[\"REMOTE_PORT\"];\n\t\t\t$_SESSION[\"request\"][\"referrer\"]=isset($_SERVER[\"HTTP_REFERER\"])?$_SERVER[\"HTTP_REFERER\"]:'';\n\t\t\t}\n\t\tcatch (Error $e)\n\t\t\t{\n\t\t\t$e->Error();\n\t\t\t}\n\t\t}",
"static function _set_csrf_token() {\n\n\t\tself::$name = Config::get('config','csrf_name');\n\t\tself::$expired_at = Config::get('config','csrf_time');\n\n\t\tself::$_hash = self::_csrf_hash();\n\n\t\tif(!isset($_SESSION[self::$name])) {\n\t\t\tself::_generate_new_hash();\n\t\t} else {\n\t\t\tif($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t\tself::_generate_new_hash();\n\t\t\t}\n\t\t}\n\t}",
"public static function setRequest($request){}",
"public function setTempLocation( $temp_location ){\r\n \r\n $this->temp_location = $temp_location;\r\n \r\n }",
"private function setHttpRequest()\n {\n $this->http_request = new HttpRequest();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter: Set the locale to en_US. Some translated strings in the wcpt plugin are used here for comparison and matching. To ensure that the matching happens correctly, we need need to prevent these strings from being converted to a different locale. | public function set_locale_to_en_US() {
return 'en_US';
} | [
"private function set_locale() {\n\n if (function_exists('determine_locale')) {\n $locale = determine_locale();\n } else {\n // @todo Remove when start supporting WP 5.0 or later.\n $locale = is_admin() ? get_user_locale() : get_locale();\n }\n $locale = apply_filters('plugin_locale', $locale, 'wp-jobsearch');\n unload_textdomain('wp-jobsearch');\n load_textdomain('wp-jobsearch', WP_LANG_DIR . '/plugins/wp-jobsearch-' . $locale . '.mo');\n load_plugin_textdomain('wp-jobsearch', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages');\n }",
"function filter_locale($locale)\n {\n $Config = &Vicuna :: Config();\n $vicuna_language = $Config -> get_option('vicuna-language');\n if (!empty($vicuna_language) && $vicuna_language !== 'default') $locale = $vicuna_language;\n return $locale;\n }",
"public function filter_wpseo_locale($locale){\n\t\t \n\t\t\treturn $locale;\n\t\t}",
"function locale_filter($ret)\n{\n global $LOCALE_FILTER_CACHE;\n if ($LOCALE_FILTER_CACHE === null) {\n make_locale_filter();\n }\n foreach ($LOCALE_FILTER_CACHE as $filter) {\n if (count($filter) == 2) {\n $ret = str_replace($filter[0], $filter[1], $ret);\n }\n }\n return $ret;\n}",
"function setCorrectLocale(){\n global $conf;\n global $lang;\n\n $enc = strtoupper($lang['encoding']);\n foreach ($lang['locales'] as $loc){\n //try locale\n if(@setlocale(LC_ALL,$loc)) return;\n //try loceale with encoding\n if(@setlocale(LC_ALL,\"$loc.$enc\")) return;\n }\n //still here? try to set from environment\n @setlocale(LC_ALL,\"\");\n}",
"function wc_switch_to_site_locale()\n {\n }",
"private function set_locale() {\n\n\t\t$plugin_i18n = new Wp_Rest_Filter_i18n();\n\n\t\t$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n\n\t}",
"function make_locale_filter()\n{\n global $LOCALE_FILTER_CACHE;\n $LOCALE_FILTER_CACHE = explode(',', trim(do_lang('locale_subst')));\n foreach ($LOCALE_FILTER_CACHE as $i => $filter) {\n if ($filter == '') {\n unset($LOCALE_FILTER_CACHE[$i]);\n } else {\n $LOCALE_FILTER_CACHE[$i] = explode('=', $filter);\n }\n }\n}",
"public static function canonicalize($locale){}",
"private function setLocale()\n {\n add_action('plugins_loaded', array(new I18N(), 'loadPluginTextdomain'));\n }",
"private function adjustLocale()\n {\n if (request()->hasCookie('lang')) {\n $this->setLocale(Crypt::decrypt(request()->cookie('lang')));\n } else {\n request()->header('accept-language') ? $this->setLocale(substr(request()->header('accept-language'), 0, 2)) : null;\n }\n }",
"public function testLocale1(){\n\t\t$filter = new Filter();\n\t\t$this->assertEquals($filter->applyFilter('?ab_CD#', 'locale'), 'ab_CD');\n\t}",
"public static function setup_locale()\n {\n // TODO: make this configurable\n setlocale(LC_ALL, \"en_US.UTF-8\");\n }",
"function wc_restore_locale()\n {\n }",
"public function testGetLocale()\n {\n $response = $this->translator->getLocale();\n\n $this->assertEquals('en_US', $response);\n }",
"public function localize($lang = null);",
"private function set_locale() {\n\n\t\t$plugin_i18n = new Predic_Simple_Backup_i18n();\n\t\t$plugin_i18n->set_domain( $this->plugin_name );\n\n\t\tadd_action( 'plugins_loaded', array( $plugin_i18n, 'load_plugin_textdomain' ) );\n\n\t}",
"public function ignoreLocale($val)\n {\n $this->ignore_locale = $val;\n }",
"public function getLocale() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |