query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Filters list $list using callable function $func | function filter($list, callable $func)
{
$map = function ($func, $items) use (&$map) {
if ($items === null) {
return null;
} else {
$curr = car($items);
$rest = $map($func, cdr($items));
// filter
return $func($curr) ? cons($curr, $rest) : $rest;
}
};
return $map($func, $list);
} | [
"function filter(\\Closure $f) {\r\n return new ListM(array_values(array_filter($this->list, $f)));\r\n }",
"abstract public function filter(callable $func);",
"function every($list, callable $func): bool\n{\n [$filterCount, $valCount] = fold(\n function ($acc, $val) use ($func) {\n [$fst, $snd] = $acc;\n $fst = $fst + 1;\n\n $snd += $func($val) ? 1 : 0;\n\n return [$fst, $snd];\n },\n $list,\n [0, 0]\n );\n\n return equals($filterCount, $valCount);\n}",
"public function filter()\n {\n return $this->list->filter(...func_get_args());\n }",
"public function filter(callable $func): self\n {\n $iterator = new \\ArrayIterator();\n foreach ($this->iterator as $item) {\n $func($item) && $iterator[] = $item;\n }\n\n return $this->update($iterator);\n }",
"public function applyFilterToList(ListBuilderInterface $listBuilder);",
"function any($list, callable $func): bool\n{\n return fold(\n function (bool $valid, $entry) use ($func) {\n if ($func($entry)) {\n return true;\n }\n\n return $valid;\n },\n $list,\n false\n );\n}",
"function map($list, $func)\n{\n $result = array();\n if($list !== null && $list !== false)\n {\n if(!is_array($list)) $list = array($list);\n foreach($list as $key => $item)\n {\n $v = $func($item, $key);\n if($v !== null)\n $result[] = $v;\n }\n }\n return($result);\n}",
"function applyFilter($field, $value, $list) {\n\t\t$rc = array();\n\t\tsettype($value, 'string');\n\t\tforeach ($list AS $record) {\n\t\t\t$v = $record[$field];\n\t\t\tsettype($v, 'string');\n\t\t\tif ($value === $v) $rc[] = $record;\n\t\t}\n\t\treturn $rc;\n\t}",
"function appthemes_wp_list_filter( $list, $args = array(), $operator = 'AND', $match = false ) {\n\tif ( ! is_array( $list ) ) {\n\t\treturn array();\n\t}\n\n\tif ( empty( $args ) ) {\n\t\treturn $list;\n\t}\n\n\t$operator = strtoupper( $operator );\n\t$count = count( $args );\n\t$filtered = array();\n\n\tforeach ( $list as $key => $obj ) {\n\t\t$to_match = (array) $obj;\n\t\t$matched = 0;\n\t\tforeach ( $args as $m_key => $m_value ) {\n\t\t\tif ( array_key_exists( $m_key, $to_match ) && ( ( ! $match && in_array( $m_value, (array) $to_match[ $m_key ] ) ) || ( $match && preg_match( \"#{$m_value}#i\", $to_match[ $m_key ] ) ) ) ) {\n\t\t\t\t$matched++;\n\t\t\t}\n\t\t}\n\n\t\tif ( ( 'AND' === $operator && $matched === $count )\n\t\t || ( 'OR' === $operator && $matched > 0 )\n\t\t || ( 'NOT' === $operator && 0 === $matched ) ) {\n\t\t\t$filtered[ $key ] = $obj;\n\t\t}\n\t}\n\n\treturn $filtered;\n}",
"function wp_filter_object_list($list, $args = array(), $operator = 'and', $field = \\false)\n{\n}",
"function filter(callable $fn, $coll)\n{\n $result = [];\n\n foreach ($coll as $key => $value) {\n if ($fn($value, $key)) {\n $result[$key] = $value;\n }\n }\n\n return $result;\n}",
"public static function walk($list, $callable) {\n foreach ($list as $key => $item) {\n call_user_func_array($callable, array($item, $key));\n }\n }",
"function filter_fresh(callable $fn, iterable $coll): array\n{\n return array_values(filter($fn, $coll));\n}",
"private function mapAndFilter(array $collection, Closure $function) {\n return array_values(\n array_filter(\n array_map(\n $function,\n $collection\n )\n )\n );\n }",
"protected function _filterNode($nodeList, $filter) {}",
"function map($list, callable $func)\n{\n checkList($list);\n if (isEmpty($list)) {\n return l();\n }\n\n $newElement = $func(head($list));\n\n return cons($newElement, map(tail($list), $func));\n}",
"public static function apply ($list, $fn)\n\t{\n\t\tif ($list->length == 1)\n\t\t{\n\t\t\t$list = $list->get(0);\n\n\t\t\tif (\\Rose\\typeOf($list) == 'Rose\\Arry')\n\t\t\t{\n\t\t\t\t$output = new Arry();\n\t\n\t\t\t\tfor ($i = 0; $i < $list->length(); $i++)\n\t\t\t\t\t$output->push( $fn ($list->get($i)) );\n\t\t\t}\n\t\t\telse if (\\Rose\\typeOf($list) == 'Rose\\Map')\n\t\t\t{\n\t\t\t\t$output = new Map();\n\t\n\t\t\t\tforeach ($list->__nativeArray as $name => $value)\n\t\t\t\t\t$output->set($name, $fn ($value));\n\t\t\t}\n\t\t\telse\n\t\t\t\t$output = $fn ($list);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_output = new Arry();\n\n\t\t\t$list->forEach(function($list) use (&$_output, &$fn)\n\t\t\t{\n\t\t\t\tif (\\Rose\\typeOf($list) == 'Rose\\Arry')\n\t\t\t\t{\n\t\t\t\t\t$output = new Arry();\n\t\t\n\t\t\t\t\tfor ($i = 0; $i < $list->length(); $i++)\n\t\t\t\t\t\t$output->push( $fn ($list->get($i)) );\n\t\t\t\t}\n\t\t\t\telse if (\\Rose\\typeOf($list) == 'Rose\\Map')\n\t\t\t\t{\n\t\t\t\t\t$output = new Map();\n\t\t\n\t\t\t\t\tforeach ($list->__nativeArray as $name => $value)\n\t\t\t\t\t\t$output->set($name, $fn ($value));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$output = $fn ($list);\n\n\t\t\t\t$_output->push($output);\n\t\t\t});\n\n\t\t\t$output = $_output;\n\t\t}\n\n\t\treturn $output;\n\t}",
"function filter($iterable, $lambda) {\n $out = array();\n foreach ($iterable as $v) if ($lambda($v)) $out[] = $v;\n return $out;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update reviewer rank per user Called by updateVoteHelpfulCount method and by admin maintenance functions | function updateUserRank($userIds)
{
$Config = Configure::read('JreviewsSystem.Config');
is_array($userIds) or $userIds = (array) $userIds;
foreach ( $userIds as $userId )
{
if ( ! $userId = (int) $userId ) continue;
# get user ranks info
$query = "
SELECT
COUNT(*) AS reviews
,SUM(vote_helpful) votes_helpful
,SUM(vote_total) AS votes_total
FROM
#__jreviews_comments
WHERE
userid = $userId
AND published = 1
".( $Config->editor_rank_exclude ? "AND author = 0" : "" )
; # Notice that COUNT(*) considered faster than COUNT(column)
$user = $this->query($query, 'loadObject');
empty($user->votes_total) and $user->votes_total = 0;
$user->votes_percent_helpful = $user->votes_total ? $user->votes_helpful / $user->votes_total : 0;
# insert the info into users table, without rank calculation
$query = "
REPLACE
#__jreviews_reviewer_ranks
SET
user_id = $userId
,reviews = $user->reviews
,votes_percent_helpful = $user->votes_percent_helpful
,votes_total = $user->votes_total
";
if(!$this->query($query) ) {
return false;
}
# demote everyone that is below this user's ranking
$query = "
UPDATE
#__jreviews_reviewer_ranks
SET
rank = rank + 1
WHERE
reviews < $user->reviews
OR
reviews = $user->reviews AND votes_percent_helpful < $user->votes_percent_helpful
OR
reviews = $user->reviews AND votes_percent_helpful = $user->votes_percent_helpful AND votes_total < $user->votes_total
";
if(!$this->query($query)) {
return false;
}
# update the user's current rank
$query = "
SELECT
COUNT(*)
FROM
#__jreviews_reviewer_ranks
WHERE
user_id != $userId
AND
(
reviews > $user->reviews
OR
reviews = $user->reviews AND votes_percent_helpful > $user->votes_percent_helpful
OR
reviews = $user->reviews AND votes_percent_helpful = $user->votes_percent_helpful AND votes_total >= $user->votes_total
)
";
$rank = $this->query($query, 'loadResult') + 1;
$query = "UPDATE #__jreviews_reviewer_ranks SET rank = $rank WHERE user_id = $userId";
if(!$this->query($query)) {
return false;
}
}
return true;
} | [
"function updateUserRank() {\n $id = $_POST['id'];\n $userRank = $_POST['rank'];\n $rank = $this->M_Users->getUserRank($id);\n if ($GLOBALS['config']['uel'][$rank][$_SESSION['auth']['accesslevel']] && $GLOBALS['config']['uel'][$userRank][$_SESSION['auth']['accesslevel']]) {\n return $this->M_Users->updateUserRank($id, $userRank);\n } else {\n return 'Insuficent permisions to perform action.';\n }\n }",
"public function \tUpdateRanking() {\n\n\t\t\t$this->updateRankingTable();\n\t\t\t$this->updateGlobalRankingTable();\n\t\t\t$this->updatePodium();\n\t\t}",
"function update_rank_user($request)\n\t{\n\t // print_r();die;\n\t\t$id = $request['matchid'] = $request;\t\t\n\t//\tprint_r($id);die;\n\t\t$resp = $this->Webservice_model->get_team_record_by_rank($id);\n\t//\techo $this->db->last_query();die;\n\t\t$i = 1;\t\t\t\t\n\t\tforeach ($resp as $key) \n\t\t{\t\n\t\t\t$this->Webservice_model->update_rankby_points($key->id, $i);\n\t\t$i++;}\n\t}",
"public static function updateRank() {\n\t\tglobal $database;\n\t\t$sql = \"SET @r=0; \";\n\t\t$database->query($sql);\n\t\t$sql = \"UPDATE groups SET ranking= (@r:= @r+1) ORDER BY averageGrade DESC;\";\n\t\t$database->query($sql);\n\t}",
"function updateRanks() {\n $db = database();\n $statement = $db->prepare(\"SELECT * FROM `total` ORDER BY `score` DESC\");\n $statement->execute();\n\n $rank = 0;\n while ($info = $statement->fetchObject()) {\n changeVal($info->userid, \"rank\", ++$rank);\n }\n}",
"function svc_updateRank($uuid, $rank){\n\tglobal $db;\n\t$query = \"UPDATE user_ranking \n\tSET rank_current = '$rank', \n\trank_season_high = CASE WHEN rank_placements<2 THEN GREATEST(rank_season_high, rank_current) ELSE rank_season_high END, \n\trank_career_high = CASE WHEN rank_placements<2 THEN GREATEST(rank_career_high, rank_current) ELSE rank_career_high END, \n\trank_initial = CASE WHEN rank_placements>=1 THEN '$rank' ELSE rank_initial END, \n\trank_placements = GREATEST(0, rank_placements-1) \n\tWHERE uuid='$uuid'\";\n\t//case is <2 because if placements is 1, then it will go to 0 and the member will place. If 0, it will not decrement\n\n\tif (mysqli_query($db, $query)){\n\t\twriteLog(INFO, \"User ID \".$uuid.\" rank was updated to \".$rank.\" in database.\");\n\t\treturn true;\n\t}\n\telse {\n\t\twriteLog(SEVERE, \"updateRank procedure failed! userid=\".$uuid.\", new rank=\".$rank);\n\t\twriteLog(SEVERE, \"Query: \".$query);\n\t\twriteLog(SEVERE, \"MySQL Error: \".mysqli_error($db));\n\t\treturn false;\n\t}\n}",
"function fixRank() {\n\t\tif ( !empty ( $this->data['rank'] )) { \n\t\t\t$competing_item = checkRank($this->section, $this->id, $this->data['rank']); \n\t\t\t$rank = $this->data['rank'];\n\t\t\twhile ( !empty ( $competing_item )) {\n\t\t\t\t$newrank = $rank + 1; \t\t\n\t\t\t\tchangeRank($this->section, $competing_item, $newrank);\n\t\t\t\t$_SESSION['message'][] = 'Changed rank of ' . type($this->section) . ' ' . $competing_item. ' to ' . $newrank;\n\t\t\t\t$id = $competing_item;\n\t\t\t\t$rank = $newrank; \n\t\t\t\t$competing_item = checkRank($this->section, $id, $rank);\n\t\t\t}\n\t\t}\n\t}",
"public function user_update_rank ($authid, $rank)\n\t\t{\n\t\t$this->sql->update ($authid, array ('rank' => (int) $rank), $this->db_users, 'authid');\n\t\t}",
"public function userRanked($user);",
"public function updateRanking(\n Administrator $admin,\n $rankingID,\n $score\n );",
"function bbps_create_user_ranking_meta($user_id){\n$rankings = get_option('_bbps_reply_count');\n\n\t\t$meta = array(\n\t\t\t'post_count' => '0', \n\t\t\t'current_ranking' => ''\n\t\t);\n\t\n\t\n\tupdate_user_meta( $user_id, '_bbps_rank_info', $meta);\n}",
"public static function updatePointsAfterRank($isRecruiter, $member_id, $points_for_rank){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\t//regular user\n\t\tif ($isRecruiter == 0){\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_users SET current_amount = current_amount + :points_for_rank, \n\t\t\ttotal_amount_ever = total_amount_ever + :points_for_rank WHERE user_id = :member_id\";\n\t\t}\n\t\t//recruiter\n\t\telse {\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_recruiters SET current_amount = current_amount + :points_for_rank, \n\t\t\ttotal_amount_ever = total_amount_ever + :points_for_rank WHERE recruiter_id = :member_id\";\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t//prepare query\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':points_for_rank', $points_for_rank);\n\t\t\t$query_statement->bindValue(':member_id', $member_id);\n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t}\n\t\t\t\n\t\tcatch (PDOException $ex) {\n\t\t$error_message = $ex->getMessage();\n\t\t$result = array('error_message' => $error_message);\n\t\treturn $result;\n\t\t}\n\t\t\n\t\t//no errors, return null\n\t\treturn null; \n\t\t\n\t}",
"function editRank($id_user, $id_rank)\n{\n\t$link = connect();\n\t$query = 'UPDATE users set id_rank = ? WHERE id_user = ?';\n\t$result = mysqli_prepare($link, $query);\n\tmysqli_stmt_bind_param($result, \"ss\", $id_rank, $id_user);\n\tmysqli_stmt_execute($result);\n\n\tmysqli_close($link);\n\treturn $result;\n}",
"public function updateRank($prid, $rank) {\n $exec = DB::table('preferences')\n ->where('prid', '=', $prid)\n ->update(array('rank' => $rank));\n }",
"public function internalRoster_edit_rank(Request $request)\n {\n $request->validate([\n 'rank' => ['required', 'string', 'max:30']\n ]);\n\n $user = User::find($request->route('user'));\n\n if($this->constants['rank_level'][$user->rank] < $this->constants['rank_level'][$request['rank']]) {\n $user->notify(new Promotion($request['rank']));\n }\n\n $user->rank = $request['rank'];\n $user->save();\n\n return;\n }",
"function update_rankby_points($id , $rank)\n {\n $this->db->where('id',$id);\n $this->db->update('leaderboard',array('rank' =>$rank));\n }",
"function updateRanks(){\n\t$table = \"ARTISTS\";\n\t$qry = \"SELECT ART_USERID,ART_POINTS FROM $table\";\n\t$resultArtists = mysql_query($qry);\n\twhile($artist = mysql_fetch_assoc($resultArtists)){\n\t\t$qry = \"UPDATE $table SET RNK_RANKID = \". getRankID($artist['ART_POINTS']) .\" WHERE ART_USERID = \". $artist['ART_USERID'] .\" AND RNK_RANKID < \". getRankID($artist['ART_POINTS']);\n\t\t$result = mysql_query($qry);\n\t}\n}",
"public function setRank($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->rank !== $v || $v === 1) {\n\t\t\t$this->rank = $v;\n\t\t\t$this->modifiedColumns[] = PerfilPeer::RANK;\n\t\t}\n\n\t}",
"function go_update_ranks ( $user_id = null, $total_points = null, $output = false ) {\n\tif ( empty( $user_id ) ) {\n\t\t$user_id = get_current_user_id();\n\t}\n\n\t/**\n\t * Passed to go_set_rank() to determine whether to add or remove badges. The default assumes\n\t * that the user is leveling up. This gets modified below, when the user is down-leveling.\n\t */\n\t$is_level_up = true;\n\t$ranks = get_option( 'go_ranks' );\n\t$name_array = $ranks['name'];\n\t$points_array = $ranks['points'];\n\t$badges_array = $ranks['badges'];\n\t$new_rank = '';\n\t$current_points = 0;\n\n\tif ( empty( $ranks ) ) {\n\t\terror_log(\n\t\t\t\"Game On Error: the go_ranks option is empty in \".\n\t\t\t\"go_update_ranks() in go_ranks.php! \".\n\t\t\t\"Ranks have to be provided in the settings page\"\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( null !== $total_points && $total_points >= 0 ) {\n\t\t$current_points = $total_points;\n\t} else {\n\t\t$current_points = go_return_points( $user_id );\n\t}\n\t$user_rank = go_get_rank( $user_id );\n\t$current_rank = $user_rank['current_rank'];\n\t$current_rank_points = $user_rank['current_rank_points'];\n\t$next_rank = $user_rank['next_rank'];\n\t$next_rank_points = $user_rank['next_rank_points'];\n\n\t/*\n\t * Here we search for the index of the current rank by point threshold,\n\t * which should be unique (it's not guaranteed to be unique).\n\t */\n\t$current_rank_index = array_search( $current_rank_points, $points_array );\n\n\t// the current rank's badge id, used when the user is at the minimum rank already\n\t$current_rank_badge_id = $badges_array[ $current_rank_index ];\n\n\t$min_rank_points = (int) $points_array[ 0 ];\n\t$is_min_rank = go_user_at_min_rank( $user_id, $min_rank_points, $current_rank_points );\n\n\t/*\n\t * Here we are referring to last element manually,\n\t * since we don't want to modify\n\t * the arrays with the array_pop function.\n\t */\n\t$max_rank_index = count( $name_array ) - 1;\n\t$max_rank_points = (int) $points_array[ $max_rank_index ];\n\t$is_max_rank = go_user_at_max_rank( $user_id, $max_rank_points, $current_rank_points );\n\t\n\t/*\n\t * If the user's current points are greater than or equal\n\t * to the current max rank's points, we'll handle things\n\t * slightly differently than normal.\n\t */\n\tif ( $current_points >= $max_rank_points ) {\n\t\tif ( ! $is_max_rank ) {\n\t\t\t\n\t\t\t// ...set the user's rank to the max rank\n\t\t\t$new_rank = go_set_rank( $user_id, $max_rank_index, $ranks, $is_level_up );\n\t\t}\n\t} else {\n\n\t\t// we don't want to enter this block when the user is at the max rank, because in that\n\t\t// case the user's current points will always be greater than the next rank's points\n\t\tif ( $current_points > $next_rank_points && ! $is_max_rank ) {\n\n\t\t\t/*\n\t\t\t * We can safely start the loop at the index immediately after the\n\t\t\t * current rank's index in the $points_array array. This is because\n\t\t\t * we already know that the current rank is not the max rank, so there\n\t\t\t * will be at least one iteration of the loop.\n\t\t\t */\n\t\t\tfor ( $i = $current_rank_index + 1; $i < count( $points_array ); $i++ ) {\n\t\t\t\t\n\t\t\t\t// this reflects the points required to reach the rank at the current index\n\t\t\t\t$rank_point_threshold = $points_array[ $i ];\n\n\t\t\t\t// this checks if the user's points fall under the rank at the current index\n\t\t\t\tif ( $current_points < $rank_point_threshold ) {\n\n\t\t\t\t\t// ...set the user's rank to the rank at the current index\n\t\t\t\t\t$new_rank = go_set_rank( $user_id, $i - 1, $ranks, $is_level_up );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// end-if current points are greater than the next rank's point threshold (up-leveling)\n\t\t} else if ( $current_points < $current_rank_points ) {\n\t\t\t$is_level_up = false;\n\n\t\t\tif ( $current_points > 0 ) {\n\n\t\t\t\t// loop through to find rank lower than the current one\n\t\t\t\tfor ( $x = $current_rank_index - 1; $x >= 0; $x-- ) {\n\n\t\t\t\t\t// this reflects the points required to reach the rank at the current index\n\t\t\t\t\t$rank_point_threshold = $points_array[ $x ];\n\n\t\t\t\t\t// this checks that the rank threshold at the current index falls under the user's points\n\t\t\t\t\tif ( $current_points > $rank_point_threshold ) {\n\n\t\t\t\t\t\t// ...set the user's rank to the rank at the current index,\n\t\t\t\t\t\t// and remove an badges assigned to the current rank\n\t\t\t\t\t\t$new_rank = go_set_rank( $user_id, $x, $ranks, $is_level_up, $current_rank_index );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// if the user isn't already at the minimum rank...\n\t\t\t\tif ( ! $is_min_rank ) {\n\n\t\t\t\t\t// ...set the user's rank to the minimum rank,\n\t\t\t\t\t// and remove any badges assigned to the current rank\n\t\t\t\t\t$new_rank = go_set_rank( $user_id, 0, $ranks, $is_level_up, $current_rank_index );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// end-if current points are less than the current rank's point threshold (down-leveling)\n\t\t} else if ( $is_min_rank ) {\n\t\t\tgo_award_badge(\n\t\t\t\tarray(\n\t\t\t\t\t'id' \t\t=> $current_rank_badge_id,\n\t\t\t\t\t'repeat' \t=> false,\n\t\t\t\t\t'uid' \t\t=> $user_id\n\t\t\t\t)\n\t\t\t);\n\t\t// end-if user is already at the minimum rank (generally new users)\n\t\t}\n\n\t// end-if current points are less than the max rank's point threshold\n\t}\n\n\tif ( ! empty( $new_rank ) ) {\n\t\tif ( $output ) {\n\t\t\techo $new_rank;\n\t\t} else {\n\t\t\treturn $new_rank;\n\t\t}\n\t} else {\n\t\treturn null;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing edit method of CronController. | public function it_can_render_edit_screen()
{
$cron = factory(Cron::class)->create();
$response = $this->get('task-scheduler/crons/edit/' . $cron->id);
$response->assertStatus(200);
$response->assertViewHas( 'cron' );
$cron = $response->original->getData()['cron'];
$this->assertInstanceOf('Smeechos\TaskScheduler\Models\Cron', $cron);
$response->assertSeeInOrder(['Edit Cron', 'Cron Expression', 'Description of Expression']);
} | [
"public function testEdit()\n {\n $task = Task::factory()->create();\n\n $response = $this->actingAs($this->user)\n ->get(route('tasks.edit', ['task' => $task]));\n $response->assertOk();\n }",
"public function editAction() {\n\t\t$id = $this->getRequest()->getParam('id', null);\n \t$config = Mage::getModel('aoe_scheduler/configuration');\n\t\t$model = $this->getRequest()->getParam('model', $config->getModel());\n \t$model = str_replace('-', '/',$model);\n\t\tif ($id) {\n \t\t$config = $config->loadByCode($id);\n\t\t\t\n\t\t\tif (!$config->getId()) {\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('aoe_scheduler')->__('Crontab does not exist'));\n\t\t\t\t$this->_redirect('*/*/');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t} else {\n $config->setModel($model);\n }\t\t\t\t\t\t\n\t\tMage::register('config', $config);\t\t\t\n\t\t\n\t\t// set entered data if was error when we do save\n\t\t$data = Mage::getSingleton('adminhtml/session')->getPageData(true);\n\t\tif (!empty($data)) {\n\t\t\t$config->addData($data);\n\t\t}\n\n\t\t$this->_initAction();\n\t\t$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n\t\t$this->_addContent($this->getLayout()->createBlock('aoe_scheduler/adminhtml_cron_edit'));\n $this->_addLeft($this->getLayout()->createBlock('aoe_scheduler/adminhtml_cron_edit_tabs'));\n\t\t\n\t\t$this->renderLayout();\n\t}",
"public function testEditSave()\n {\n $this->loadDataFixtures();\n\n // edit command\n $crawler = $this->callFormUrlValues(\n 'POST',\n '/command-scheduler/detail/commands/edit/1',\n array(\n 'scheduled_command[name]' => \"edited one\"\n )\n );\n\n // now we are on list, assert there are toggle buttons\n $this->assertEquals(NUMBER_COMMANDS_TOTAL, $crawler->filter('a[href^=\"/command-scheduler/action/toggle/command\"]')->count());\n\n // assert the command was changed\n $this->assertEquals(\"edited one\", trim($crawler->filter('td')->eq(1)->text()));\n }",
"public function test_edit_entry() {\n $this->resetAfterTest(true);\n $entryid = $this->create_entry();\n $entrydata = tool_sumitnegi\\api::get($entryid);\n $entrydata->completed = 1;\n $entrydata->name = \"Test Entry 001 V.1\";\n $entrydata->description = 'Dummy Description V.1';\n $entrydata->timemodified = time();\n tool_sumitnegi\\api::update($entrydata);\n $updatedentry = tool_sumitnegi\\api::get($entrydata->id);\n $this->assertEquals('Test Entry 001 V.1', $updatedentry->name, 'Name is not updated');\n $this->assertEquals(1, $updatedentry->completed, 'Completion is not updated');\n $this->assertEquals($entrydata->timemodified, $updatedentry->timemodified, 'Entry modification time is not updated');\n $this->assertEquals('Dummy Description V.1', $updatedentry->description);\n }",
"public function testEdit()\n {\n // init\n $this->defineDebuggerAgent();\n $Test = new \\Test();\n $data = new \\SetterGetter();\n\n // the test\n $r = $Test->Edit(1, $data);\n\n // assets\n $this->assertFalse($r);\n }",
"public function testEdit()\n {\n $city = \\App\\City::first();\n\n $this->actingAs( \\App\\User::first() )\n ->visit('/city/'.$city->id.'/edit')\n ->see('Update City / District Information')\n ->type('Chittagong', 'name')\n ->select(2, 'state_id')\n ->select(true, 'status')\n ->press('Update Now')\n ->seePageIs('/city/'.$city->id.'/edit')\n ->see('Updated!');\n }",
"public function testEdit()\n {\n $this->seed(\\LanguageLinesTableSeeder::class);\n\n $languageline = LanguageLine::firstOrFail();\n\n $admin = User::Role('Administrator')->firstOrFail();\n\n $response = $this->actingAs($admin)->ajax('get', 'admin/languagelines/' . $languageline->id . '/edit');\n $response->assertStatus(200)\n ->assertViewIs('admin.languagelines.edit');\n }",
"public function editCron() {\n\t\tif(!check($this->_id)) throw new Exception(lang('error_4'));\n\t\tif(!check($this->_name)) throw new Exception(lang('error_4'));\n\t\tif(!check($this->_file)) throw new Exception(lang('error_4'));\n\t\tif(!check($this->_repeat)) throw new Exception(lang('error_4'));\n\t\t\n\t\tif(!$this->_cronExists($this->_file)) throw new Exception(lang('error_158'));\n\t\tif(!$this->_cronFileExists($this->_file)) throw new Exception(lang('error_151'));\n\t\t\n\t\t$description = check($this->_description) ? $this->_description : '';\n\t\t\n\t\t$insertData = array(\n\t\t\t'name' => $this->_name,\n\t\t\t'desc' => $description,\n\t\t\t'file' => $this->_file,\n\t\t\t'repeat' => $this->_repeat,\n\t\t\t'id' => $this->_id\n\t\t);\n\t\t\n\t\t$query = \"UPDATE \"._WE_CRON_.\" SET `cron_name` = :name, `cron_description` = :desc, `cron_file` = :file, `cron_repeat` = :repeat WHERE `cron_id` = :id\";\n\t\t\n\t\t$result = $this->db->query($query, $insertData);\n\t\tif(!$result) throw new Exception(lang('error_159'));\n\t}",
"public function testEdit()\n {\n $this->actingAs($this->user)\n ->visit($this->project->getSlug())\n ->type('Join the dark side.', 'comment_body')\n ->press('submit-comment')\n ->press('comment-edit')\n ->see('Edit Comment')\n ->see('Join the dark side.')\n ->type('No join the light side.', 'comment_body')\n ->press('submit-comment')\n ->seePageIs($this->project->getSlug())\n ->seeInDatabase('project_comments', ['comment_body' => 'No join the light side.'])\n ->dontSeeInDatabase('project_comments', ['comment_body' => 'Join the dark side.'])\n ->see('No join the light side.');\n\n //Delete comment\n $this->project->comments()->delete();\n }",
"public function testEditSave(): void\n {\n // DataFixtures create 4 records\n $this->databaseTool->loadFixtures([LoadScheduledCommandData::class]);\n\n $crawler = $this->client->request('GET', '/command-scheduler/detail/edit/1');\n $buttonCrawlerNode = $crawler->selectButton('Save');\n $form = $buttonCrawlerNode->form();\n\n $form->get('command_scheduler_detail[name]')->setValue('edited one');\n $form->get('command_scheduler_detail[cronExpression]')->setValue('* * * * *');\n $crawler = $this->client->submit($form);\n\n $this->assertEquals(5, $crawler->filterXPath('//a[contains(@href, \"/command-scheduler/action/toggle/\")]')->count());\n $this->assertEquals('edited one', trim($crawler->filter('td')->eq(1)->text()));\n }",
"public function testEdit() {\n\t\t$result = $this->StatReportApiLog->edit('statreportapilog-1', null);\n\t\t$expected = $this->StatReportApiLog->read(null, 'statreportapilog-1');\n\t\t$this->assertEqual($result['StatReportApiLog'], $expected['StatReportApiLog']);\n\t\t// put invalidated data here\n\t\t$data = $this->record;\n\t\t$result = $this->StatReportApiLog->edit('statreportapilog-1', $data);\n\t\t$this->assertTrue($result);\n\t\t$result = $this->StatReportApiLog->read(null, 'statreportapilog-1');\n\t\t// put record specific asserts here for example\n\t\t// $this->assertEqual($result['StatReportApiLog']['name'], $data['StatReportApiLog']['name']);\n\t\ttry {\n\t\t\t$this->StatReportApiLog->edit('wrong_id', $data);\n\t\t\t$this->assertTrue(false, 'Expected Exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->assertTrue(true, 'Correct Exception Thrown');\n\t\t}\n\t}",
"public function testEndPointEditTask()\n {\n $response = $this->get('/api/tasks/1/edit');\n $response->assertStatus(200);\n }",
"public function testEdit() {\n\t\t$result = $this->Contact->edit('contact-1', null);\n\n\t\t$expected = $this->Contact->read(null, 'contact-1');\n\t\t$this->assertEqual($result['Contact'], $expected['Contact']);\n\n\t\t// put invalidated data here\n\t\t$data = $this->record;\n\t\t//$data['Contact']['title'] = null;\n\n\t\t$result = $this->Contact->edit('contact-1', $data);\n\t\t$this->assertEqual($result, $data);\n\n\t\t$data = $this->record;\n\n\t\t$result = $this->Contact->edit('contact-1', $data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->Contact->read(null, 'contact-1');\n\n\t\t// put record specific asserts here for example\n\t\t// $this->assertEqual($result['Contact']['title'], $data['Contact']['title']);\n\n\t\ttry {\n\t\t\t$this->Contact->edit('wrong_id', $data);\n\t\t\t$this->fail('No exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t}",
"public function testEditActionCanBeAccessed()\n {\n $this->dispatch('/venue/edit');\n $this->assertResponseStatusCode(200);\n }",
"public function testEdit() {\n\t\t$result = $this->InvoicesNote->edit('invoicesnote-1', null);\n\n\t\t$expected = $this->InvoicesNote->read(null, 'invoicesnote-1');\n\t\t$this->assertEqual($result['InvoicesNote'], $expected['InvoicesNote']);\n\n\t\t// put invalidated data here\n\t\t$data = $this->record;\n\t\t//$data['InvoicesNote']['title'] = null;\n\n\t\t$result = $this->InvoicesNote->edit('invoicesnote-1', $data);\n\t\t$this->assertEqual($result, $data);\n\n\t\t$data = $this->record;\n\n\t\t$result = $this->InvoicesNote->edit('invoicesnote-1', $data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->InvoicesNote->read(null, 'invoicesnote-1');\n\n\t\t// put record specific asserts here for example\n\t\t// $this->assertEqual($result['InvoicesNote']['title'], $data['InvoicesNote']['title']);\n\n\t\ttry {\n\t\t\t$this->InvoicesNote->edit('wrong_id', $data);\n\t\t\t$this->fail('No exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t}",
"public function testTaskEditByAdmin()\n {\n $client = $this->useAdmin();\n $crawler = $client->request('GET', '/tasks/1/edit');\n $form = $crawler->filter('button[type=\"submit\"]')->form();\n $form['task[title]'] = 'test';\n $form['task[content]'] = 'test admin';\n $client->submit($form);\n $crawler = $client->followRedirect();\n static::assertEquals(1, $crawler->filter(\n 'html:contains(\"modifiée\")')->count());\n }",
"public function testEdit()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t// On clique sur le lien entreprise de test\n\t\t$crawler = $client->request('GET', '/clients');\n\t\t$link = $crawler->filter('.bloc__title a:contains(\"Entreprise de test\")')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('h1:contains(\"Entreprise de test\")')->count());\n\n\t\t// On clique sur le bouton modifier\n\t\t$link = $crawler->filter('.btn--edit')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('.breadcrumb:contains(\"Modifier\")')->count()); \n\n\t\t// On modifie le métier\n\t\t$form = $crawler->selectButton('Enregistrer')->form();\n\t\t$form['flyd_dashboardbundle_client[job]'] \t= 'Job de test modifié ' . rand(1,4);\n\t\t$crawler = $client->submit($form);\t\n\n\n\t\t//On vérifie que ça a marché\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Client bien enregistré.\")')->count());\n\n\t}",
"public function testEditAction()\n {\n // create review record for change 1\n $this->createChange();\n Review::createFromChange('1')->save();\n\n $postData = new Parameters(array('state' => 'approved', 'testStatus' => 'pass'));\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch and check output\n $this->dispatch('/reviews/2');\n $result = $this->getResult();\n $review = $result->getVariable('review');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $result);\n $this->assertSame(true, $result->getVariable('isValid'));\n $this->assertSame('approved', $review['state']);\n $this->assertSame('pass', $review['testStatus']);\n }",
"public function testEditCourse() {\n $test_course = DB::run(\"SELECT * FROM courses WHERE name LIKE 'test course'\")->fetch(PDO::FETCH_ASSOC);\n $test_course_id = $test_course['course_id'];\n $this->assertEquals(\"test course\", $test_course['name']);\n editCourse($test_course_id, \"edited course\");\n $test_course = DB::run(\"SELECT * FROM courses WHERE course_id = ?\", [$test_course_id])->fetch(PDO::FETCH_ASSOC);\n $this->assertEquals(\"edited course\", $test_course['name']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for postWebchatGuestConversationMemberMessages Send a message in a chat conversation.. | public function testPostWebchatGuestConversationMemberMessages()
{
} | [
"public function testPostWebchatGuestConversationMemberTyping()\n {\n }",
"public function testChatPostMessage()\n {\n }",
"public function testGetWebchatGuestConversationMediarequest()\n {\n }",
"public function testPostConversationsCallParticipants()\n {\n }",
"public function testGetWebchatGuestConversationMessage()\n {\n }",
"public function testPostConversationsCall()\n {\n }",
"public function testPostConversationsEmailMessages()\n {\n }",
"public function testPostConversationParticipantCallbacks()\n {\n }",
"public function testPostConversationsMessageMessagesBulk()\n {\n }",
"public function testPostConversationParticipantDigits()\n {\n }",
"public function testPostConversationsEmailInboundmessages()\n {\n }",
"public function testPatchWebchatGuestConversationMediarequest()\n {\n }",
"public function testPostConversationsCallbacks()\n {\n }",
"public function testPostConversationsEmails()\n {\n }",
"public function testDeleteWebchatGuestConversationMember()\n {\n }",
"public function testPostConversationsCallParticipantConsult()\n {\n }",
"public function testPostVoicemailMessages()\n {\n }",
"public function testPostConversationsChatParticipantReplace()\n {\n }",
"public function testPostConversationsCallParticipantMonitor()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the actual restoration process in a sandbox folder | public function testRestore(){
$application = new Application();
$application->add(new Commands\RestoreBackup());
$command = $application->find('backup:restore');
$commandTester = new CommandTester($command);
//Working
$s = __DIR__.'/data/restore/';
$b = __DIR__.'/data/restore/library.dash.backup.1452166466';
$arguments = array(
'command' => $command->getName(),
'dbpath' => $s,
'backup' => $b
);
$ssize = filesize($s.'library.dash');
$commandTester->execute($arguments);
$rsize = filesize($s.'library.dash');
//Just assert the file size is no longer 0 and the import is bigger than the old size, which we know to be true by our setup
$this->assertRegExp('/Restored backup/',$commandTester->getDisplay());
$this->assertNotEquals(0,$rsize);
$this->assertGreaterThan($ssize,$rsize);
} | [
"public function est_Verify_Lock_File_Delted_after_Killing(){\n\t\t// EXEPCTED RESULT : In each case, verify that the .lock file is removed\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(1000, 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(1000, 100, 1001, 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$pid = pcntl_fork();\n\t\tif($pid == -1){\n\t\t\tdie('could not fork');\n\t\t}\n\t\telse if($pid){\t\t//parent\n\t\t\t// Run the restore script and verify lock file is deleted\\\n\t\t\tlog_function::debug_log(\"Parent running restore script\");\n\t\t\t$status = mb_restore_commands::restore_server(TEST_HOST_2);\n\t\t\t$lock_file = storage_server_functions::list_incremental_backups(STORAGE_SERVER_1, \"lock*\");\n\t\t\t$this->assertEquals(strcmp($lock_file[0] , \"\") ,0 ,\"Lock file not deleted and still exists\");\n\t\t}\n\t\telse{\t\t\t\t//child\n\t\t\t//kill the restore process\n\t\t\tsleep(4);\n\t\t\tlog_function::debug_log(\"Child killing restore script\");\n\t\t\t$lock_file = storage_server_functions::list_incremental_backups(STORAGE_SERVER_1, \"lock*\");\n\t\t\t$hostname = general_function::get_hostname(TEST_HOST_2);\n\t\t\t$this->assertEquals(strcmp($lock_file[0] , \"/var/www/html/zbase_backup/\".GAME_ID.\"/\".$hostname.\"/\".ZBASE_CLOUD.\"/incremental/.lock-\".$hostname) , 0 , \"Lock file put, but has a different name\" );\n\t\t\t$cmd = \"sudo killall -9 python26\";\n\t\t\tremote_function::remote_execution(TEST_HOST_2 , $cmd);\n\t\t\texit();\n\t\t}\n\n\t}",
"public function testGetRestoreBackupOperations()\n {\n\n }",
"public function testBmsBackupRestore()\n {\n }",
"public function testArchiveRestore($dump_dest) {\n $restore_dest = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'restore';\n $options = array(\n 'yes' => NULL,\n 'destination' => $restore_dest,\n );\n $this->drush('archive-restore', array($dump_dest), $options);\n $original_codebase = drush_dir_md5($this->webroot());\n $restored_codebase = drush_dir_md5($restore_dest);\n $this->assertEquals($original_codebase, $restored_codebase);\n }",
"public function testRestoreFileDoesNotOverwriteExistingInRoot() {\n\t\t$userFolder = \\OC::$server->getUserFolder();\n\t\t$file = $userFolder->newFile('file1.txt');\n\t\t$file->putContent('foo');\n\n\t\t$this->assertTrue($userFolder->nodeExists('file1.txt'));\n\n\t\t$file->delete();\n\n\t\t$this->assertFalse($userFolder->nodeExists('file1.txt'));\n\n\t\t$filesInTrash = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime');\n\t\t$this->assertCount(1, $filesInTrash);\n\n\t\t/** @var FileInfo */\n\t\t$trashedFile = $filesInTrash[0];\n\n\t\t// create another file\n\t\t$file = $userFolder->newFile('file1.txt');\n\t\t$file->putContent('bar');\n\n\t\t$this->assertTrue(\n\t\t\tTrashbin::restore(\n\t\t\t\t'file1.txt.d' . $trashedFile->getMtime(),\n\t\t\t\t$trashedFile->getName(),\n\t\t\t\t$trashedFile->getMtime()\n\t\t\t)\n\t\t);\n\n\t\t/** @var File $anotherFile */\n\t\t$anotherFile = $userFolder->get('file1.txt');\n\t\t$this->assertEquals('bar', $anotherFile->getContent());\n\n\t\t/** @var File $restoredFile */\n\t\t$restoredFile = $userFolder->get('file1 (restored).txt');\n\t\t$this->assertEquals('foo', $restoredFile->getContent());\n\t}",
"function testSaveRenditions() {\n $this->assertFalse(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/vw_golf.jpg'));\n $this->assertFalse(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/resultlist.jpg'));\n $this->assertFalse(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/detailpage.jpg'));\n\n $asset = $this->storage->save('IMAGE', array('_' => array('file' => $this->testfile)));\n $this->assertTrue(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/vw_golf.jpg'),\n 'Original file was not written to file system.');\n $this->assertTrue(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/resultlist.jpg'),\n '\"resultlist\" rendition was not written to file system.');\n $this->assertTrue(file_exists(self::$BUCKET . '09/096dfa489bc3f21df56eded2143843f135ae967e/detailpage.jpg'),\n '\"detailpage\" rendition was not written to file system.');\n $this->assertTrue(file_exists(binarypool_config::getRoot() . $asset),\n 'Asset file was not written to file system.');\n }",
"public function testRestoreBackupWithFileSucceeds()\n {\n $this->environment->id = 'env_id';\n $test_filename = 'test.tar.gz';\n\n $this->backups->expects($this->once())\n ->method('getBackupByFileName')\n ->with($test_filename)\n ->willReturn($this->backup);\n $this->expectConfirmation();\n\n $this->backup->expects($this->once())\n ->method('restore')\n ->willReturn($this->workflow);\n\n $this->logger->expects($this->once())\n ->method('log')\n ->with(\n $this->equalTo('notice'),\n $this->equalTo('Restored the backup to {env}.'),\n $this->equalTo(['env' => $this->environment->id,])\n );\n\n $out = $this->command->restoreBackup(\"mysite.{$this->environment->id}\", ['file' => $test_filename,]);\n $this->assertNull($out);\n }",
"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 }",
"function RestoreTest($id)\n{\n global $userIsBot;\n $ret = false;\n if (!$userIsBot && ValidateTestId($id)) {\n $testPath = './' . GetTestPath($id);\n // Only trigger a restore if the directory for the test doesn't exist\n if (!is_file(\"$testPath/testinfo.ini\")) {\n $archive_dir = GetSetting('archive_dir');\n $archive_s3_url = GetSetting('archive_s3_url');\n $archive_s3_server = GetSetting('archive_s3_server');\n if (($archive_dir && strlen($archive_dir)) ||\n ($archive_s3_url && strlen($archive_s3_url)) ||\n ($archive_s3_server && strlen($archive_s3_server))) {\n $restore = false;\n $testInfo = GetTestInfo($id);\n if (!$testInfo)\n $restore = true;\n\n if( $restore )\n $ret = RestoreArchive($id);\n else\n $ret = true;\n } else {\n $ret = true;\n }\n }\n }\n\n return $ret;\n}",
"public function testRestoreTransaction()\r\n {\r\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 testDeleteReplenishmentProcessFile()\n {\n }",
"public function testDeleteManageScheduledPlansFile()\n {\n }",
"public function testDeleteBackup()\n {\n\n }",
"public function testDeletePackingPlanFile()\n {\n }",
"public function test_Restore_from_Backfill_based_backup(){\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\t// Backfill based backup\n\t\tstorage_server_setup::clear_storage_server();\n\t\tzbase_backup_setup::stop_backup_daemon(TEST_HOST_2);\n\t\tzbase_backup_setup::start_backup_daemon_full(TEST_HOST_2);\n\t\tsleep(10);\t\t\t\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, 600, \"Number of restored keys not equal to number of keys in backups\");\t\n\t}",
"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(100, 100, 201, 10),\"Failed adding keys\");\n $this->assertTrue(Data_generation::add_keys(200, 100, 301, 10),\"Failed adding keys\");\n $this->assertTrue(Data_generation::add_keys(200, 100, 501, 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 $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 $raw_stats= stats_functions::get_stats_array(TEST_HOST_2, \"restore\");\n\t\t$restore_stats = $raw_stats[\"ep_restore\"];\n\t\t$this->assertEquals($checkpoint_stats[\"last_closed_checkpoint_id\"], $restore_stats[\"restore_checkpoint\"], \"Restore checkpoint not updated after restore\");\n }",
"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}",
"public function testDeleteReceivingProcessFile()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects the tag slug and loads the appropriate method | public function tag()
{
$_slug = preg_replace( '#' . app_setting( 'url', 'shop' ) . 'tag/?#', '', uri_string() );
if ( $_slug ) :
$this->_tag_single( $_slug );
else :
$this->_tag_index();
endif;
} | [
"abstract protected function parsingTag();",
"function mozilla_map_tags( $tag ) {\n\t$term_obj = get_term_by( 'slug', $tag, 'post_tag' );\n\tif ( is_object( $term_obj ) && ! empty( $term_obj ) && isset( $term_obj->slug ) && strlen( $term_obj->slug ) > 0 ) {\n\t\tif ( false !== stripos( $term_obj->slug, '_' ) ) {\n\t\t\t$term_obj->slug = substr( $term_obj->slug, 0, stripos( $term_obj->slug, '_' ) );\n\t\t};\n\t\treturn $term_obj->slug;\n\t}\n\treturn '';\n}",
"private static function _post_tag_slugs() {\r\n\t\t$usp_tag_slugs = self::_get_plugin_option('usp_tag_slugs');\r\n\t\tif ( empty( $usp_tag_slugs ) ) {\r\n\t\t\t$usp_tag_slugs = self::$_default_settings['usp_tag_slugs'];\r\n\t\t}\r\n\r\n\t\tif ( empty( $usp_tag_slugs ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset( self::$usp_values['usp_post_data']['id'] ) ) {\r\n\t\t\t$post_id = self::$usp_values['usp_post_data']['id'];\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$usp_tag_slugs = explode( ',', $usp_tag_slugs );\r\n\t\t//error_log( __LINE__ . \" MLAUSPNovoMapExample::_post_tag_slugs usp_tag_slugs = \" . var_export( $usp_tag_slugs, true ), 0 );\r\n\t\t$term_taxonomy_ids = wp_set_object_terms( $post_id, $usp_tag_slugs, 'post_tag', true );\r\n\t\t//error_log( __LINE__ . \" MLAUSPNovoMapExample::_post_tag_slugs term_taxonomy_ids = \" . var_export( $term_taxonomy_ids, true ), 0 );\r\n\t}",
"private function _parseTag($tag)\n { \n// return nothing if the tag is disabled\n if(isset($tag['attributes']->disabled) === true && $tag['attributes']->disabled === 'true')\n {\n return '';\n }\n \n $tag_data = false;\n $caching_tag = isset($tag['attributes']->cache) && $tag['attributes']->cache === 'false' ? false : true;\n if($this->_options['cache_tags'] === true && $caching_tag === true)\n {\n if($this->_options['custom_cache_tag_class'] !== false)\n {\n $tag_data = call_user_func_array(array($this->_options['custom_cache_tag_class'], 'getCache'), array($tag));\n }\n else \n {\n $cache_file = $this->_options['cache_directory'].md5(serialize($tag));\n if(is_file($cache_file) === true)\n {\n $tag_data = file_get_contents($cache_file);\n }\n }\n if($tag_data)\n {\n $tag['cached'] = true;\n return $tag_data;\n }\n } \n \n// look for and load tag function file\n $tag_func_name = ucwords(str_replace(array('_', '-'), ' ', $tag['name']));\n $tag_func_name = strtolower(substr($tag_func_name, 0, 1)).substr($tag_func_name, 1);\n $func_name = str_replace(' ', '', $this->_options['tag_callback_prefix'].$tag_func_name);\n $tag_data = '';\n $collect_tag = false;\n $tag_order = false;\n if(function_exists($func_name) === false)\n {\n $has_resource = false;\n if(is_array($this->_options['tag_directory']) === false)\n {\n $this->_options['tag_directory'] = array($this->_options['tag_directory']);\n }\n foreach ($this->_options['tag_directory'] as $directory)\n {\n $tag_file = rtrim($directory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$tag['name'].DIRECTORY_SEPARATOR.'tag.php';\n if(is_file($tag_file) === true)\n {\n if(isset(self::$_required[$tag['name']]) === false)\n {\n self::$_required[$tag['name']] = true;\n $collect = false;\n if(function_exists($func_name) === false)\n {\n include_once $tag_file;\n }\n self::$_tags_to_collect[$tag['name']] = $collect;\n if(function_exists($func_name) === false)\n {\n return self::throwError($tag['name'], 'tag resource \"'.$directory.DIRECTORY_SEPARATOR.'tag.php\" found but callback \"'.$func_name.'\" wasn\\'t.');\n }\n $has_resource = true;\n }\n }\n }\n if($has_resource === false)\n {\n return self::throwError($tag['name'], 'tag resource not found.');\n } \n }\n \n// do we have to collect this tag for parsing at a later point\n if(self::$_tags_to_collect[$tag['name']] !== false)\n {\n if(isset(self::$tag_collections[$tag['name']]) === false)\n {\n self::$tag_collections[$tag['name']] = array();\n }\n $tag['collected'] = true;\n $index = array_push(self::$tag_collections[$tag['name']], $tag)-1;\n if($tag_order !== false)\n {\n if(isset(self::$_tag_order[$block['name']]) === false)\n {\n self::$_tag_order[$block['name']] = array();\n }\n self::$_tag_order[$block['name']] = $tag_order;\n }\n return self::$tag_collections[$tag['name']][$index]['tag'] = '------@@%'.self::$_instance.'-'.$tag['name'].'-'.$index.'-'.uniqid(time().'-').'%@@------';\n }\n \n// excecute the tag callback\n if($this->_options['tag_global_callback'] !== false)\n {\n $tag_data = trim(call_user_func($this->_options['tag_global_callback'], 'tag', $func_name, $tag));\n }\n else\n {\n $tag_data = trim(call_user_func($func_name, $tag));\n }\n \n// this is where we sniff for buried tags within the returned content\n if(empty($tag_data) === false)\n {\n if($this->_options['sniff_for_buried_tags'] === true && strpos($tag_data, self::$tag_open.$this->_options['tag_name'].':') !== false)\n {\n// we have the possibility of buried tags so lets parse\n// but first make sure the output isn't echoed out\n $old_echo_value = $this->_options['echo_output'];\n $this->_options['echo_output'] = false; \n// parse the tag_data \n $tag_data = $this->parse($tag_data, false, true);\n// restore the echo_output value back to what it was originally\n $this->_options['echo_output'] = $old_echo_value;\n }\n \n if($this->_options['cache_tags'] === true && $caching_tag === true)\n {\n if($this->_options['custom_cache_tag_class'] !== false)\n {\n call_user_func_array(array($this->_options['custom_cache_tag_class'], 'cache'), array($tag, $tag_data));\n }\n else\n {\n file_put_contents($this->_options['cache_directory'].md5(serialize($tag)), $tag_data, LOCK_EX);\n }\n }\n }\n return $tag_data;\n }",
"private static function parseParametrizedTag(string $tag) \n {\n $className = PS_AnnotationParser::loadClass($tag);\n if ($className != '') \n {\n \n return ReflectionClass($className).newInstance($className, PS_AnnotationParser::listParameters($tag));\n }\n }",
"public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->name);\n }\n }",
"public function get_tag();",
"public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nom);\n }\n }",
"public function initializeSlug(){\n \n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->prenom.' '.$this->nom);\n }\n }",
"function ml_slug_tag_field() {\n\tml_slug_field('ml_slug_tag', 'Tag prepended for tag URLs. Default is tag.');\n}",
"public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nom . ' ' . $this->prenom);\n }\n }",
"private static function loadClass($tag) \n\t{\n\t\t$className = PS_AnnotationParser::getJustTagName($tag);\n\t\tif (PS_AnnotationClassLoader::loadClass($className)) \n {\n return $className; \n }\n \n return '';\n\t}",
"public function loadBySlug(string $slug): Tag\n\t{\n\t\treturn Tag::withCount('services')\n\t\t\t->where(compact('slug'))\n\t\t\t->first();\n\t}",
"public function tag( $slug ) {\n\t\t$data[\"tagInfo\"] = SM::getCache( 'tag_' . $slug, function () use ( $slug ) {\n\t\t\treturn Tag::with( \"blogs\" )\n\t\t\t ->where( \"slug\", $slug )\n\t\t\t ->where( 'status', 1 )\n\t\t\t ->first();\n\t\t} );\n\t\tif ( count( $data[\"tagInfo\"] ) > 0 ) {\n\t\t\t$page = \\request()->input( 'page', 0 );\n\t\t\t$key = 'tagBlogs_' . $data[\"tagInfo\"]->id . '_' . $page;\n\t\t\t$data[\"blogs\"] = SM::getCache( $key, function () use ( $data ) {\n\n\t\t\t\t$blog_posts_per_page = SM::smGetThemeOption(\n\t\t\t\t\t\"blog_posts_per_page\",\n\t\t\t\t\tconfig( \"constant.smFrontPagination\" )\n\t\t\t\t);\n\n\t\t\t\treturn $data[\"tagInfo\"]->blogs()\n\t\t\t\t ->where( \"status\", 1 )\n\t\t\t\t ->paginate( $blog_posts_per_page );\n\t\t\t}, [ 'tagBlogs' ] );\n\t\t\t$data['key'] = $key;\n\t\t\t$data['seo_title'] = $data['tagInfo']->seo_title;\n\t\t\t$data[\"meta_key\"] = $data[\"tagInfo\"]->meta_key;\n\t\t\t$data[\"meta_description\"] = $data[\"tagInfo\"]->meta_description;\n\t\t\t$data[\"image\"] = $data[\"tagInfo\"]->image != '' ? asset( SM::sm_get_the_src( $data[\"tagInfo\"]->image, 750, 560 ) ) : '';\n\n\t\t\treturn view( 'page.tag', $data );\n\t\t} else {\n\t\t\treturn abort( 404 );\n\t\t}\n\t}",
"function set_url_tag($tag){\n $this->url->tag->tagType = $tag;\n }",
"public function initializeSlug()\n {\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nom);\n }\n }",
"public function initializeSlug()\n {\n //if (empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->title);\n //}\n }",
"function koken_site_autoloader($class_name)\n\t\t\t{\n\t\t\t\tinclude \"tags/$class_name.php\";\n\t\t\t}",
"public function initializeSlug() {\n if(empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nom . ' ' . $this->prenom);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function MyMod_Handle_Files_Table, Parameter list: $path,$table=array(),$prencells=0 Creates table listing files with subdirs. | function MyMod_Handle_Files_Table($path,$table=array(),$prencells=0)
{
return
array_merge
(
$this->MyMod_Handle_Files_Subdir_Rows($path),
$this->MyMod_Handle_Files_Subdirs_Table($path,$prencells),
$this->MyMod_Handle_Files_Path_Table($path,$prencells)
);
} | [
"function MyMod_Handle_Files_Path_Table($path,$prencells)\n {\n $files=$this->DirFiles($path);\n sort($files);\n\n if (count($files)==0) { return; }\n\n $table=array();\n array_push\n (\n $table,\n $this->MyMod_Handle_File_Title_Row($path,$prencells)\n );\n\n $comps=preg_split('/\\//',$path);\n foreach ($files as $file)\n {\n array_push($table,$this->MyMod_Handle_File_Row($file,$prencells));\n }\n \n\n return $table;\n }",
"function MyMod_Handle_Files_Subdirs_Table($path,$prencells=0)\n {\n $subdirs=$this->DirSubdirs($path);\n sort($subdirs);\n\n $table=array();\n foreach ($subdirs as $subdir)\n {\n $table=array_merge($table,$this->MyMod_Handle_Files_Subdir_Rows($subdir));\n\n\n $includetree=$this->GetPOST(\"Include_\".$subdir);\n if ($includetree==1)\n {\n $table=$this->MyMod_Handle_Files_Table($path.\"/\".basename($subdir),$table,$prencells++);\n }\n }\n \n\n return $table;\n }",
"function MyDir_Files_Table($path,$files=array(),$table=array())\n { \n if (empty($files))\n {\n $files=$this->Dir_Files($path);\n sort($files);\n }\n\n $titles=array();\n if (!empty($files))\n {\n $titles=\n $this->Html_Table_Head_Rows\n (\n $this->MyDirs_Title_Rows() \n );\n }\n\n return\n array_merge\n (\n $this->MyDir_Rows($path),\n array\n (\n array\n (\n \"\",\n $this->HTML_Table\n (\n \"\",\n $this->MyFiles_Table($files)\n ),\n ),\n ),\n $titles\n );\n }",
"function fileTable($array, $tableName = 'File Category') {\n\t$html = '';\n\t$counter = 1;\n\t\n\t// loop through array\n\tforeach ($array as $item) : if ($item) :\n\t\t\t\t\n\t\t//variable creation\n\t\t\n\t\t$fileName \t\t= ucwords($item['fileTitle']);\n\t\t$fileSlug \t\t= pageSlug($item['fileTitle']);\n\t\t$fileDate \t\t= $item['fileModDate'];\n\t\t$fileType \t\t= $item['fileMemeType'];\n\t\t$fileDesc \t\t= $item['fileDescription'];\n\t\t$fileURL\t\t= $item['fileURL'];\n\t\t$isFileAllowed \t= $item['isFileAllowed'];\n\n\t\t// html\n\t\tif ($isFileAllowed == true) : // var is set from outside this function. Default is true\n\t\t\t\n\t\t\t// print file's parent category name\n\t\t\tif ($counter == 1) :\n\t\t\t\t$html .=\t\"<tr><th colspan=\\\"5\\\" >{$tableName}</th></tr>\";\n\t\t\t\t$counter++;\n\t\t\tendif; \n\n\t\t\t// print file html\n\t\t\t$html .= \t\"<tr class=\\\"file-{$fileSlug}\\\">\";\n\t\t\t$html .= \t\t\"<td>{$fileName}</td>\";\n\t\t\t$html .= \t\t\"<td>{$fileDate}</td>\";\n\t\t\t$html .= \t\t\"<td>{$fileType}</td>\";\n\t\t\t$html .= \t\t\"<td>{$fileDesc}</td>\";\n\t\t\t$html .= \t\t\"<td><a href=\\\"{$fileURL}\\\" title=\\\"{$fileName}\\\" download>Download</a></td>\";\n\t\t\t$html .= \t\"</tr>\";\n\t\t\t\n\t\tendif;\n\t\n\tendif; endforeach;\n\t\n\t\t\t\t\n\treturn $html; // return our html now that it's ready\n}",
"private function _update_files_table()\n\t{\n\t\t$field = array(\n\t\t\t'caption'\t=> array(\n\t\t\t\t'type'\t\t=> 'text'\n\t\t\t)\n\t\t);\n\n\t\tee()->smartforge->add_column('files', $field);\n\t}",
"function fileInfo_table(){\n\t\t\n\t\t$output = '';\n\t\t$output .= $this ->build_html_table_top();\n\t\t\n\t\t$filesDetails = $this ->filesDetails;\n\t\t\n\t\t$i =0;\n\t\t\n\t\twhile ($i < count($filesDetails)){\n\t\t\t\n\t\t\t$output .= $this ->build_table_row_html($filesDetails[$i][\"name\"],$filesDetails[$i][\"title\"],$filesDetails[$i][\"datelastmodified\"]);\n\t\t\t$i ++;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t$output .= $this ->build_html_table_bottom();\n\t\t\n\t\treturn $output;\n\t\t\n\t}",
"function get_files ($db,$table,$id,$columnid,$format=1,$thumbtype='small') {\n $tableid=get_cell($db,'tableoftables','id','tablename',$table);\n $r=$db->Execute(\"SELECT id,filename,title,mime,type,size FROM files WHERE tablesfk=$tableid AND ftableid=$id AND ftablecolumnid='$columnid'\");\n if ($r && !$r->EOF) {\n $i=0;\n $sid=SID;\n while (!$r->EOF) {\n $filesid=$files[$i]['id']=$r->fields('id');\n $filesname=$files[$i]['name']=$r->fields('filename');\n $filestitle=$files[$i]['title']=$r->fields('title');\n $mime=$files[$i]['mime']=$r->fields('mime');\n $filestype=$files[$i]['type']=$r->fields('type');\n $filesize=$files[$i]['size']=nice_bytes($r->fields('size'));\n // if this is an image, we'll send the thumbnail\n $rb=$db->Execute(\"SELECT id FROM images WHERE id='$filesid'\");\n if ($rb->fields(0)) {\n $text=\"<img src=showfile.php?id=$filesid&type=$thumbtype&$sid alt='Image'>\";\n } \n\t elseif ($format==1) {\n if (strlen($filestitle) > 0)\n $text=$filestitle;\n else\n $text=$filesname;\n }\n\t elseif ($format==2)\n\t $text=\"file_$i\";\n\t else\n\t $text=$filesname;\n $icon=\"icons/$filestype.jpg\";\n if (@is_readable($icon)) {\n $text=\"<img src='$icon' alt='$filestype File'>\";\n // display the filename in tooltip only when there is an icon and javascript is enabled\n if ($_SESSION['javascript_enabled']) {\n $tip_width=strlen($filesname);\n $files[$i]['link']=\"<a href='showfile.php?id=$filesid&$sid' onmouseover=\\\"this.T_WIDTH=$tip_width;return escape('$filesname')\\\">$text</a>\\n\";\n } else {\n $files[$i]['link']=\"<a href='showfile.php?id=$filesid&$sid'>$text</a>\\n\";\n }\n } else {\n $files[$i]['link']=\"<a href='showfile.php?id=$filesid&$sid'>$text</a>\\n\";\n }\n $r->MoveNext();\n $i++;\n }\n return $files;\n }\n}",
"function directoryScan($dir){\n\t\t// going to use these\n\t\tglobal $folder_icon;\n\n\t\t// start our table\n\t\techo \"<tbody>\";\n\n\t\t// for each file in the scan_dir directory\n\t\tforeach(scandir($dir) as $file){\n\t\t\tif($file == \".\" || $file == \"..\") continue;\n\n\t\t\t// file path and extension for the current file\n\t\t\t$path = $dir . \"/\" . $file;\n\t\t\t$extension = pathinfo($path, PATHINFO_EXTENSION);\n\t\t\t$folder = is_dir($path);\n\n\t\t\t$class = $folder ? \"folder\" : \"\";\n\t\t\t$icon = $folder ? $folder_icon : \"\";\n\n\t\t\t// spit out all the informaiton\n\t\t\techo \"<tr>\";\n\t\t\techo \"\t<th class='\". $class .\"'>\";\n\t\t\techo \"\t\t<img src='\". $icon .\"' />\";\n\t\t\techo \"\t\t<p>\". $file .\"</p>\";\n\t\t\techo \"\t</th>\";\n\n\t\t\t// if this is a directory, spit it out too\n\t\t\tif($folder){\n\t\t\t\techo \"<td class=''>\";\n\t\t\t\techo \"\t<table>\";\n\t\t\t\tdirectoryScan($path);\n\t\t\t\techo \"\t</table>\";\n\t\t\t\techo \"</td>\";\n\t\t\t}\n\n\t\t\t// close it off\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\t// end our table\n\t\techo \"</tbody>\";\n\t}",
"function build_file_list($file_directory, $web_directory, $level = 0) {\n\t$handle=opendir($file_directory);\n\t// loop through the files in the directory generating a list of files \n\t$i=0;\n\twhile (false!==($file = readdir($handle))) { \n\t\t$extension = strrchr(strtolower($file),'.');\n\t\tif ($file != \".\" && $file != \"..\") {\n\t\t\tif (file_exists($file_directory.$file) && !is_file($file_directory.$file)) {\n\t\t\t\t$type = 'folder';\n\t\t\t} else {\n\t\t\t\t$type = 'file';\n\t\t\t}\n\t\t\t$padding = $level*22;\n\t\t\techo \"<tr>\";\n\t\t\tif ($type == 'folder') {\n\t\t\t\techo \"\t<td style=\\\"border-bottom: 1px solid #eeeeee;\\\" width=\\\"50\\\"> </td>\";\n\t\t\t} else if ($extension == '.htm' || $extension == '.html' || $extension == '.php') {\n\t\t\t\techo \"\t<td style=\\\"border-bottom: 1px solid #eeeeee\\\" width=\\\"50\\\"><input type=\\\"radio\\\" value=\\\"$file_directory$file\\\" name=\\\"working_file\\\"></td>\";\n\t\t\t}\n\t\t\tif ($type == 'folder') {\n\t\t\t\techo \" <td style=\\\"border-bottom: 1px solid #eeeeee;\\\">\n\t\t\t\t\t<div style=\\\"margin-left:\".$padding.\"px; cursor: pointer: cursor: hand\\\"><img id=\\\"\".$level.\"_$i\\\" onclick=\\\"clickHandler(this)\\\" src=\\\"closed.gif\\\" width=\\\"16\\\" height=\\\"16\\\" align=\\\"absmiddle\\\" alt=\\\"\\\"><img src=\\\"\".WP_WEB_DIRECTORY.\"images/folder.gif\\\" width=\\\"22\\\" height=\\\"22\\\" align=\\\"absmiddle\\\" alt=\\\"\\\">$file</div>\n\t\t\t\t</td>\";\n\t\t\t} else {\n\t\t\t\techo \"\t<td style=\\\"border-bottom: 1px solid #eeeeee\\\">\n\t\t\t\t\t<div style=\\\"margin-left:\".($padding+16).\"px\\\"><img src=\\\"\".WP_WEB_DIRECTORY.\"images/htm_icon.gif\\\" width=\\\"22\\\" height=\\\"22\\\" align=\\\"absmiddle\\\" alt=\\\"\\\">$file</div>\n\t\t\t\t</td>\";\n\t\t\t}\n\t\t\techo \"\n\t\t\t</tr>\"; \n\t\t\tif ($type == 'folder') {\n\t\t\t\techo \"<tr id=\\\"d_\".$level.\"_$i\\\" style=\\\"display:none\\\"><td colspan=\\\"2\\\">\";\n\t\t\t\techo \"<table width=\\\"100%\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n\t\t\t\tbuild_file_list($file_directory.$file.'/', $web_directory.$file.'/', $level + 1) ;\n\t\t\t\techo \"</table></td></tr>\";\n\t\t\t}\n\t\t\t$i ++;\n\t\t} \n\t} \n\tclosedir($handle); \n}",
"function table_files_in_storage(){\n\n $files_set = find_all_files();\n\n $table = \"<table>\";\n $table .= \"<tr>\";\n $table .= \"<th>File Name</th><th>Size</th><th>Upload date</th><td> </td>\";\n $table .= \"</tr>\";\n while ($file = mysqli_fetch_assoc($files_set)){\n $table .= \"<tr>\";\n $table .= \"<td>\".htmlentities($file[\"name\"]).\"</td>\";\n $table .= \"<td>\".htmlentities($file[\"size\"]).\"</td>\";\n $table .= \"<td>\".htmlentities($file[\"date\"]).\"</td>\";\n $table .= \"<td><a class='delete' href='delete.php?id=\".urlencode($file[\"id\"]).\"'></a>\n <a class='download' href='download.php?id=\".urlencode($file[\"id\"]).\"'></a></td>\";\n $table .= \"</tr>\";\n }\n $table .= \"</table>\";\n\n return $table;\n}",
"public function hierarchies($table, $path)\n\t{\n\t\t$this->isEmpty($table);\n\n\t\t$repository = $this->repository;\n\n\t\t$this->parseFile($path, function($row) use ($table, $repository)\n\t\t{\n\t\t\t$insert = array(\n\t\t\t\t'parent_id' => $row[0],\n\t\t\t\t'child_id' => $row[1],\n\t\t\t\t'type' => $row[2],\n\t\t\t);\n\n\t\t\t$repository->insert($table, $insert);\n\t\t});\n\t}",
"private function createTableFilesList()\n {\n $filesTable = $this->filesTableName;\n $query = \"CREATE TABLE `$filesTable` (\n id INT(11) NOT NULL AUTO_INCREMENT,\n original_name CHAR(250) NOT NULL,\n file_name CHAR(250) NOT NULL,\n creation_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY(id)\n )\n ;\";\n\n $db = $this->db;\n $selCreateQuery = $db->prepare($query);\n\n return $selCreateQuery->execute();\n }",
"function _makeFileTable($orgList) {\n\t\tCgn::loadLibrary('Form::Lib_Cgn_Form');\n\t\t$list = new Cgn_Mvc_TableModel();\n\t\t$table = new Cgn_Mvc_TableView($list);\n\t\t$table->attribs['width']='600';\n\t\t$table->attribs['border']='0';\n\n\t\t$table->_model->headers = array('File Name');\n\n\t\tforeach ($orgList as $_org) {\n\t\t\t$table->_model->data[] = array(\n\t\t\t\tcgn_applink(\n\t\t\t\t $_org->get('link_text'),\n\t\t\t\t 'crmtech', 'file', 'edit', \n\t\t\t\t array('id'=>$_org->get('crm_file_id')),\n\t\t\t\t 'https'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $table;\n\t}",
"protected static function _setupFilesTable()\n {\n if (!isset(static::$_filesTable)) {\n static::$_filesTable = TableRegistry::get('files');\n }\n\n return static::$_filesTable;\n }",
"protected static function loadSingleExtTablesFiles() {}",
"function get_table($filename) { \n $array = explode(\"_\", $filename);\n return $array[0];\n}",
"function file_dir ($dfolder, $nb)\n{\n\tglobal $num, $lang_plugin_FileMove, $CONFIG;\n\t$files = [];\n\t$n = 0;\n\t$ignore = array(\n\t\t'.',\n\t\t'..',\n\t\t'edit',\n\t\t'index.html',\n\t\t'Thumbs.db',\n\t\t'.DS_Store',\n\t\t'no_FTP-uploads_into_this_folder!.txt',\n\t\t'index.php'\n\t\t);\n\tif ($dir = @opendir($dfolder)) {\n\t\twhile ($file = readdir($dir)) {\n\t\t\tif (in_array($file, $ignore)) continue;\n\t\t\tif (is_file($dfolder.'/'.$file)) {\n\t\t\t\tif (notAltImg($file)) {\n\t\t\t\t\t$files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\tif ($n < $nb) {\n\t\t\t\techo '<td><input type=\"checkbox\" class=\"fm-fchkb\" name=\"file_name[]\" value=\"'.$file.'\" />'.extension($file).$file.'</td>';\n\t\t\t\t$n++;\n\t\t\t\tif ($n == $nb) {\n\t\t\t\t\techo '</tr><tr class=\"fm-frow\">';\n\t\t\t\t\t$n = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($n) {\n\t\t\techo str_repeat('<td></td>', $nb-$n);\n\t\t\techo '</tr><tr class=\"fm-frow\">';\n\t\t}\n\t}\n}",
"function set_file_info_table($fileInfo)\n { \n $it = new InfoTable('File Upload Summary', 400) ; \n\n $lines = file($fileInfo['tmp_name']) ; \n\n $it->add_row('Filename', $fileInfo['name']) ; \n $it->add_row('Temporary Filename', $fileInfo['tmp_name']) ; \n $it->add_row('File Size', filesize($fileInfo['tmp_name'])) ; \n $it->add_row('Lines', count($lines)) ; \n\n unset($lines) ; \n\n $this->__fileInfoTable = &$it ; \n }",
"abstract function list_tables();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the urls for the status filter links on the edit pages. | public function set_status_filter_urls( $views ) {
if ( $this->on_custom_landing_admin_page() ) {
$this->current_views = $this->get_current_views();
return $this->current_views;
}
return $views;
} | [
"private function set_urls() {\r\n\t\t\t$this->admin_url = esc_url( add_query_arg( array( 'page' => $this->plugin_slug ), admin_url( 'options-general.php' ) ) );\r\n\t\t\t$this->manage_url = esc_url( add_query_arg( array( 'screen' => 'manage_controls' ), $this->admin_url ) );\r\n\t\t\t$this->advanced_url = esc_url( add_query_arg( array( 'screen' => 'advanced' ), $this->admin_url ) );\r\n\t\t\t$this->create_url = esc_url( add_query_arg( array( 'screen' => 'edit_controls', 'action' => 'create' ), $this->admin_url ) );\r\n\t\t}",
"public function add_filter_links()\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}",
"private function set_urls() {\n\t\t\t$this->admin_url = esc_url( add_query_arg( array( 'page' => $this->plugin_slug ), admin_url( 'themes.php' ) ) );\n\t\t\t$this->manage_url = esc_url( add_query_arg( array( 'screen' => 'manage_sidebars' ), $this->admin_url ) );\n\t\t\t$this->advanced_url = esc_url( add_query_arg( array( 'screen' => 'advanced' ), $this->admin_url ) );\n\t\t\t$this->create_url = esc_url( add_query_arg( array( 'action' => 'create' ), $this->admin_url ) );\n\t\t}",
"public function addFiltersToUrl()\n {\n }",
"public function set_url() {\n global $PAGE, $CFG;\n if (isset($this->page)) {\n $PAGE->set_url($CFG->wwwroot . '/mod/socialwiki/search.php?pageid=' . $this->page->id . '&id=' . $PAGE->cm->id);\n } else {\n $PAGE->set_url($CFG->wwwroot . '/mod/socialwiki/search.php?id=' . $PAGE->cm->id);\n }\n }",
"private function general_ui_url_controls() {\n\t\t$new_options[ 'url_allow_address' ] = array( 'type' => 'checkbox' , 'default' => '0' );\n\t\t$this->attach_to_slp( $new_options , array( 'page' => 'slp_general' , 'section' => 'user_interface' , 'group' => 'url_control' ) );\n\t}",
"private function loadURLs() {\r\n $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\tforeach ($this->_url as $scriptname => $modes)\r\n\t{\r\n\t\t$this->url[$scriptname] = $modes[$status];\r\n\t}\r\n }",
"protected function set_url_this_edit($val){ $this->input ['edit_url'] = $val ; }",
"function filter_url($filter = array()) {\n\t\tforeach ($filter as $patern ) {\n\t\t\n\t\t\tif ( strpos($this->url_in, $patern) !== FALSE ) {\n\t\t\t\n\t\t\t\tunset($this->get_vars);\n\t\t\t\t$this->url = $this->url_in;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}",
"private function set_url(){\n try{\n $url_uri = $this->Uri . \"?\";\n $url_pos = strpos( $url_uri, \"?\" );\n $url_site = substr( $url_uri, 0, $url_pos );\n $urls = explode( \"/\", $url_site );\n array_shift( $urls );\n\t\t\t$newUrls = array();\n foreach($urls as $key => $value){\n\t\t\t\tif(!empty($value)){\n\t\t\t\t\t$newUrls[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->Urls = $newUrls;\n }catch(Exception $e){\n\t\t\tthrow $e;\n\t\t}\t\n }",
"private function makeURLs() {\r\n \r\n $this->url = new Url(sprintf(\"%s/%s\", $this->Category->url, $this->slug));\r\n \r\n $status = [\r\n \"implemented\" => Ideas::STATUS_IMPLEMENTED,\r\n \"declined\" => Ideas::STATUS_NO,\r\n \"inprogress\" => Ideas::STATUS_INPROGRESS,\r\n \"active\" => Ideas::STATUS_ACTIVE,\r\n \"underconsideration\" => Ideas::STATUS_UNDERCONSIDERATION,\r\n \"active\" => Ideas::STATUS_ACTIVE,\r\n \"duplicate\" => Ideas::STATUS_DUPLICATE,\r\n ];\r\n \r\n foreach ($status as $key => $val) {\r\n $this->url->$key = sprintf(\"%s?id=%d&mode=idea.setstatus&status_id=%d\", $this->Module->url, $this->id, $val); \r\n }\r\n \r\n $this->url->vote = sprintf(\"%s?mode=idea.vote&id=%d\", $this->Module->url, $this->id);\r\n $this->url->creatediscussion = sprintf(\"%s?mode=idea.discuss&id=%d\", $this->Module->url, $this->id);\r\n $this->url->edit = sprintf(\"%s?mode=idea.add&id=%d\", $this->Module->url, $this->id);\r\n \r\n if (filter_var($this->redmine_id, FILTER_VALIDATE_INT)) {\r\n $this->url->redmine = sprintf(\"http://redmine.railpage.org/redmine/issues/%d\", $this->redmine_id); \r\n }\r\n \r\n }",
"public function set_url() {\n global $PAGE, $CFG;\n $PAGE->set_url($CFG->wwwroot . '/mod/socialwiki/admin.php', array('pageid' => $this->page->id));\n }",
"function add_filter_options( ) {\n\n\t\tglobal $typenow;\n\t\t\n\t\tif ('page' !== $typenow ) return;\n\t\tif ( !$this->pages_screen ) return;\n\t\t\t\n\t\t$updater = $this->get_updater;\n\t\t$statuz = $this->get_statuz;\n\t\t\t\n\t\t$selected_user = ( isset( $_GET[ $updater ] ) && !empty( $_GET[ $updater ] ) && get_user_by( 'slug' , $_GET[$updater ] ) ) ? \n\t\t\t$_GET[ $updater ] : \n\t\t\t0 ;\n\t\t\t\t\n\t\t$selected_status = ( isset( $_GET[$statuz] ) && \n\t\t\t!empty( $_GET[$statuz] ) &&\n\t\t\tarray_key_exists( $_GET[$statuz] , $this->statuses ) ) ? \n\t\t\t\t$_GET[$statuz] :\n\t\t\t\t0 ;\n\t\n\t\t\n\t\t// Add Updater (Users) Dropdown to Filter Options section\n\t\t$this->wp_dropdown_updaters( );\n\t\t\n\t\t// Add Status Dropdown to Filter Options section\n\t\t$this->wp_dropdown_status( array(\n\t\t\t'selected'\t\t\t=> $selected_status ,\n\t\t));\n\t}",
"function updateLinks($old, $new) {\n\t\tif(class_exists('Subsite')) Subsite::disable_subsite_filter(true);\n\t\n\t\t$pages = $this->owner->BackLinkTracking();\n\n\t\t$summary = \"\";\n\t\tif($pages) {\n\t\t\tforeach($pages as $page) $page->rewriteFileURL($old,$new);\n\t\t}\n\t\t\n\t\tif(class_exists('Subsite')) Subsite::disable_subsite_filter(false);\n\t}",
"private function set_url() {\n $this->set_url_host();\n $this->set_url_request();\n $this->set_url_actual_request();\n $this->set_url_children();\n $this->set_url_get_parameters();\n\t $this->set_url_post_parameters();\n $this->set_url_complete();\n }",
"public function enableSettingsLink()\n {\n add_filter('plugin_action_links_' . $this->name . '/' . $this->name . '.php', array($this, 'addSettingsLink'));\n }",
"private function setFilter(): void\n {\n $this->filter['language'] = $this->getRequest()->query->get('language', []);\n if (empty($this->filter['language'])) {\n $this->filter['language'] = BL::getWorkingLanguage();\n }\n $this->filter['application'] = $this->getRequest()->query->get('application');\n $this->filter['module'] = $this->getRequest()->query->get('module');\n $this->filter['type'] = $this->getRequest()->query->get('type', '');\n if ($this->filter['type'] === '') {\n $this->filter['type'] = null;\n }\n $this->filter['name'] = $this->getRequest()->query->get('name');\n $this->filter['value'] = $this->getRequest()->query->get('value');\n\n $ids = $this->getRequest()->query->get('ids', '');\n if ($ids === '') {\n $ids = [];\n } else {\n $ids = explode('|', $ids);\n }\n $this->filter['ids'] = $ids;\n\n foreach ($this->filter['ids'] as $id) {\n // someone is messing with the url, clear ids\n if (!is_numeric($id)) {\n $this->filter['ids'] = [];\n break;\n }\n }\n }",
"public function setUrls($urls=[]);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PHP_INT_MAX is far larger than the greatest id so far and thus does not represent a valid account. | public function testGetAccountByIdWithInvalidNumericId()
{
$this->expectExceptionMessage('Failed to fetch account with given id');
self::$instagram->getAccountById(PHP_INT_MAX);
} | [
"function testMaxID()\n\t{\n\t\t$max = 0;\n\t\t$max = maxID();\n\t\tif($max > 0)\n\t\t{\n\t\t\techo \"17) PASS! It fetched a new max!</br>\";\n\t\t\t$max2 = maxID();\n\t\t\tif($max2 == $max)\n\t\t\t{\n\t\t\t\techo \"18) PASS! It consistently fetches a maximum!</br>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"18) FAIL! It gets a new max when it shouldn't</br>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"17) FAIL! It didn't fetch a positive number\";\n\t\t}\n\t}",
"private function checkId() {\n\t\tif (is_null($this->data['id'])) {\n\t\t\t// Create a new id\n\t\t\t$result = $this->db->query(\"SELECT MAX(id) FROM abstract_affiliation\");\n\t\t\tlist($prevId) = $result->fetch_array();\n\t\t\t$this->data['id'] = $prevId + 1;\n\t\t\t$result->free();\n\t\t}\n\t}",
"public function testGetInvalidAccessByAccessId() {\n\t\t//grab a user id that exceeds the maximum allowable profile id\n\t\t$access = Access::getAccessByAccessId($this->getPDO(), TimeCrunchersTest::INVALID_KEY);\n\t\t$this->assertNull($access);\n\t}",
"public function generate_account_no();",
"public function testIdId_returnsFalse_ifNumberIsGreaterThanDatatypeMax()\n\t{\n\t\treturn $this->assertFalse(Num::isId(999, 'tiny'));\n\t}",
"function invalid_id($id)\n{\n\treturn isset($id) && $id < 0;\n}",
"function getNextId() {\n global $db, $dbname;\n \n $query = \"SELECT `id` FROM {$dbname}.`users`;\";\n $statement = $db->prepare($query);\n $result = $statement->execute();\n \n $max = -1;\n \n //- Find the highest ID number.\n while ($row = $statement->fetch()) {\n if ($max < $row['id'])\n $max = hexdec($row['id']);\n }\n \n $max++;\n \n //- Return the next hex number.\n return str_pad(dechex($max), 8, '0', STR_PAD_LEFT);\n }",
"public function getBankAccountNumber()\n {\n // generate a random number, this will be the account number\n $accountNumber = $this->prependNumber(rand(1, 100000000) . '0');\n\n // because it is a random number, it may be a valid account number\n $remains = $this->checkDigit($accountNumber);\n if ($remains === 0) {\n return $accountNumber;\n }\n\n // number is invalid, increase so it is valid.\n return $this->recalculateToValidOutcome($accountNumber, $remains);\n }",
"function getMaxIdBoletosCertificados(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public function testIsId_returnsTrue_ifNumberIsPositiveIntegerBelowDatatypeMaxUnsignedValue()\n\t{\n\t\treturn $this->assertTrue(Num::isId(1, 'tiny'));\n\t}",
"public function testIdMaxLengthValid()\n {\n $value = \"\";\n for ($i = 0; $i < $this->max_valid_strlen; $i++) {\n $value .= $this->first_char;\n }\n $this->airplane->id = $value;\n $this->assertLessThanOrEqual($this->max_valid_strlen, strlen($this->airplane->id));\n }",
"public function create($min = 1, $max = 9999999)\n {\n // generates random account number\n $random = rand($min, $max);\n $number = $random;\n $exist = array();\n\n // reads already existing accounts\n foreach( $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('accounts') )->fetchAll() as $account)\n {\n $exist[] = $account['id'];\n }\n\n // finds unused number\n while(true)\n {\n // unused - found\n if( !in_array($number, $exist) )\n {\n break;\n }\n\n // used - next one\n $number++;\n\n // we need to re-set\n if($number > $max)\n {\n $number = $min;\n }\n\n // we checked all possibilities\n if($number == $random)\n {\n throw new Exception('No free account number are available.');\n }\n }\n\n // saves blank account info\n $this->data['id'] = $number;\n $this->data['blocked'] = true;\n\n $this->db->query('INSERT INTO ' . $this->db->tableName('accounts') . ' (' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ') VALUES (' . $number . ', \\'\\', \\'\\', 1)');\n\n return $number;\n }",
"function get_max_student_id()\n\t{\n\t\t$max_u_id\t=\t'';\n\t\tglobal \t\t\t$con2;\n\t\t\n\t\t$query = \"SELECT MAX(id) AS C FROM `users_accounts` WHERE `user_type` = 2\";\n\t\t\n\t\t$result \t=\tmysqli_query($con2, $query);\n\t\t$row \t\t=\tmysqli_fetch_object($result);\n\t\t\t\t\n\t\tif ($row->C > 0)\n\t\t{\n\t\t\t$max_u_id\t=\t$row->C;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$max_u_id\t=\t0;\n\t\t}\n\t\treturn $max_u_id;\n\t}",
"public function testConvertAccountIdToIntWithAccount()\n {\n $this->setExpectedException('Exception');\n \t\n Tinebase_Model_User::convertUserIdToInt( $this->objects['noIdAccount'] );\n \n }",
"function ValidUserId($id)\n {\n global $db;\n\n $val = $db->x->GetOne('SELECT user_id FROM {users} WHERE user_id = ?', null, intval($id));\n\n return intval($val);\n }",
"public function getAccountID();",
"public function test_cannot_show_account_with_invalid_id()\n {\n // use a transaction id that doesn't exist\n $mock_account_id = 10;\n\n $response = $this->getJson('/api/accounts'.'/'.$mock_account_id .'/');\n \n $response->assertStatus(400);\n \n }",
"abstract public function getLimitForInt(): int;",
"public function isValidId($id) {\n\t\treturn is_numeric($id) && $id >= 0 && $id <= 199;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if getObjectUsers() with a several users works | public function testGetObjectUsersMultiple()
{
$uid = $this->addUser();
$uid2 = $this->addUser();
$uid3 = $this->addUser();
$users = $this->us->getObjectUsers();
$this->assertEquals(3, count($users));
$this->assertInstanceOf('SemanticScuttle_Model_User', reset($users));
} | [
"public function hasUsers();",
"function is_authorized_for_all_objects($userid = 0)\n{\n if ($userid == 0 && isset($_SESSION[\"user_id\"])) {\n $userid = $_SESSION[\"user_id\"];\n }\n\n // Admins can do everything\n if (is_admin($userid)) {\n return true;\n }\n\n // Some other users can see everything\n $authallobjects = get_user_meta($userid, \"authorized_for_all_objects\");\n if ($authallobjects == 1) {\n return true;\n }\n\n return false;\n}",
"public function testGetObjectUsersSingle()\n {\n $uid = $this->addUser();\n $users = $this->us->getObjectUsers();\n $this->assertEquals(1, count($users));\n $this->assertInstanceOf('SemanticScuttle_Model_User', reset($users));\n }",
"public function is_multi_users() {\n\t\t\treturn is_array( $this->get_data( 'user_id' ) );\n\t\t}",
"public function test_get_users_in_context() {\n $component = 'search_simpledb';\n\n // Ensure both users are found for both contexts.\n $expected = [$this->u1->id, $this->u2->id];\n sort($expected);\n\n // User 1.\n $userlist = new \\core_privacy\\local\\request\\userlist($this->c1context, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(2, $userlist);\n\n $actual = $userlist->get_userids();\n sort($actual);\n $this->assertEquals($expected, $actual);\n\n // User 2.\n $userlist = new \\core_privacy\\local\\request\\userlist($this->c2context, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(2, $userlist);\n\n $actual = $userlist->get_userids();\n sort($actual);\n $this->assertEquals($expected, $actual);\n }",
"public function testGetUsersByIds()\n {\n $result = self::$accountApi->users(null, [self::$USER_GET_ID, self::$USER_UPDATE_ID]);\n\n self::assertCount(2, $result['users']);\n self::assertValidAccountUser($result['users'][0]);\n self::assertValidAccountUser($result['users'][1]);\n }",
"private function doAnyUsersExist()\n {\n $account_dir = $file_path = $this->grav['locator']->findResource('account://');\n $user_check = glob($account_dir . '/*.yaml');\n\n // If no users found, stop here !!!\n return $user_check == false || count((array)$user_check) == 0 ? false : true;\n }",
"function aiosc_is_user($object) {\n if($object === false || empty($object) || $object == null) return false;\n if(is_a($object,'aiosc_User') && is_numeric($object->ID) && $object->ID > 0 && $object->wpUser != '' && $object->has_aiosc_role()) return true;\n return false;\n}",
"function userExists(&$a_user_obj)\n\t{\n\t\t//$data = $a_user_obj->getiLincData();\n\n\t\tinclude_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');\n\t\t$ilinc_user = new ilObjiLincUser($a_user_obj);\n\t\t\n\t\tif (!$ilinc_user->id and !$ilinc_user->login)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function hasUsers()\n {\n return !$this->users->isEmpty();\n }",
"public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n $course = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n // Enrol user into course.\n $this->getDataGenerator()->enrol_user($user->id, $course->id, null, 'manual');\n\n // The list of users within the course context should contain user.\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }",
"function checkUserAutority() {\r\n include \"/home/cypress/www/htdocs/fear-the-end-secrets/sqlConnect.php\";\r\n $projectManager = new ProjectManager($db);\r\n $memberManager = new MemberManager($db);\r\n $project = $projectManager->getProjectById($_GET['id']);\r\n $isDeveloper = false;\r\n $userArrayOnProject = $memberManager->getMembreByProject($project->getId());\r\n for ($i = 0; $i < count($userArrayOnProject); $i++) {\r\n if ($_SESSION['loggedUserObject'] != null && ($userArrayOnProject[$i]->getId() == unserialize($_SESSION['loggedUserObject'])->getId()) && ($userArrayOnProject[$i]->getFunction() == \"Developer\")) {\r\n $isDeveloper = true;\r\n }\r\n }\r\n\r\n $res = false;\r\n if (($_SESSION['loggedUserObject'] != null && unserialize($_SESSION['loggedUserObject'])->getId() == $project->getFk_auteur()) || $isDeveloper) {\r\n $res = true;\r\n } else {\r\n $res = false;\r\n }\r\n return $res;\r\n}",
"public function testGetUsers()\n {\n $response = $this->Klout->getUsers($this->Users);\n\n $this->assertTrue($response->status === 200);\n $this->assertObjectHasAttribute('users', $response);\n $this->assertEquals(count($response->users), count($this->Users));\n $this->assertSame($response->users[0]->twitter_screen_name, $this->Users[0]);\n }",
"function getUsersWithUserRights() {\n\n $userRightsUsers = array();\n $allUsers = REDCap::getUsers();\n foreach($allUsers as $cnt => $user) {\n $rights = REDCap::getUserRights($user);\n if ($rights[$user][\"user_rights\"] == 1) {\n $userRightsUsers[] = $user;\n }\n }\n\n return $userRightsUsers;\n\n}",
"public function checkUsersProfileOnApplane($filter)\n { \n $users = $this->getAllLocalUsers($filter); \n }",
"private function associateUsers()\n {\n $users = $this->getUsers()->all();\n\n if (empty($users)) {\n return true;\n }\n\n $success = true;\n $currentAssociations = UserAssociation::find()\n ->elementId($this->getId() ?: false)\n ->indexBy('userId')\n ->all();\n\n foreach ($users as $user) {\n if (null === ($association = ArrayHelper::remove($currentAssociations, $user->getId()))) {\n $association = (new UserAssociation())\n ->setUser($user)\n ->setElement($this);\n }\n\n if (!$association->save()) {\n $success = false;\n }\n }\n\n if (!$success) {\n $this->addError('targets', 'Unable to associate users.');\n }\n\n return $success;\n }",
"public function getAccountsWithUsers();",
"public function testGetMembersAdmin() {\n $arr = Circle::get_members($this->circleid1, 0, $this->con);\n $hasUser1 = false;\n $hasUser3 = false;\n for ($i = 0; $i < sizeof($arr); $i++) {\n if ($arr[$i] == $this->user1->get_id()) {\n $hasUser1 = true;\n }\n if ($arr[$i] == $this->user3->get_id()) {\n $hasUser3 = true;\n }\n }\n $this->assertTrue($hasUser1);\n $this->assertTrue($hasUser3);\n }",
"public function test_get_users_in_context() {\n $this->resetAfterTest(true);\n $this->setAdminUser();\n $this->scorm_setup_test_scenario_data();\n $component = 'mod_scorm';\n\n $userlist = new \\core_privacy\\local\\request\\userlist($this->context, $component);\n provider::get_users_in_context($userlist);\n\n // Students 1 and 2 have attempts in the SCORM context, student 0 does not.\n $this->assertCount(2, $userlist);\n\n $expected = [$this->student1->id, $this->student2->id];\n $actual = $userlist->get_userids();\n sort($expected);\n sort($actual);\n $this->assertEquals($expected, $actual);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory method for the verify email form | public function VerifyEmailForm() {
return new VerifyEmailForm(
$this,
'VerifyEmailForm',
new FieldList(
new EmailField('Email', _t('Member.EMAIL', 'Email'))
),
new FieldList(
new FormAction(
'verifyEmail',
_t('EmailVerifiedMember.BUTTONSEND', 'Send me the verify email link')
)
),
false
);
} | [
"public function validEmailValidDataProvider() {}",
"public function getChangeEmailForm();",
"public function verifyEmailPage()\n\t{\n\t\treturn view('platform.verify-email');\n\t}",
"public function createVerification($recipient);",
"public function verifyemail() {\n\n\treturn $this->owner->customise(new ArrayData(array(\n 'Title' => _t('EmailVerifiedMember.VERIFYEMAILHEADER', 'Verify your email'),\n 'Content' =>\n '<p>' . _t('EmailVerifiedMember.VERIFYBEFORELOGON','You need to verify the link in the email we sent you before you can log on.') . '</p>' .\n\t\t'<p>' . _t('EmailVerifiedMember.USEFORMBELOW','Use the form below if you would like us to resend the link.') . '</p>',\n 'Form' => $this->owner->VerifyEmailForm(),\n\t)))->renderWith(array('Security_verifyemail', 'Security', $this->owner->stat('template_main'), $this->owner->stat('template')));\n }",
"public function verifyEmail()\n {\n $data = $this->setData(\"Sổ tay 56\", null);\n return view('user.verifyemail', $data);\n }",
"public function validEmailInvalidDataProvider() {}",
"public function testCreateUserCredentialsEmail()\n {\n }",
"public function hook_check_email() {\n $this->check_email();\n }",
"private function verify_email()\n\t{\n\t\t$this->load->library('form_validation');\n\n\t\t// field name, error message, validation rules\n\t\t$this->form_validation->set_rules('email_address', 'Email Address', 'trim|required|valid_email');\n\n\t\t// validation\n\t\tif($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->session->keep_flashdata('fb_user');\n\t\t\t// error ajax handle\n\t\t\theader('HTTP/1.1 400 Validation error');\n\t\t\theader('Content-Type: application/json; charset=UTF-8');\n\t\t\tdie(json_encode(array(\n\t\t\t\t\t'errors'\t=> array(\n\t\t\t\t\t\t\t'email_address' => form_error('email_address')\n\t\t\t\t\t)\n\t\t\t)));\n\t\t}\n\t}",
"public function create()\n {\n $this->sesClient->verifyEmailIdentity(\n [\n 'EmailAddress' => $this->identity->getIdentity(),\n ]\n );\n }",
"public function showEmailVerificationForm()\n {\n if (Session::has('email')) {\n Session::put('email', Session::get('email'));\n Session::put('verification_code', Session::get('verification_code'));\n return view('pages.guest.email-verification');\n }\n return redirect()->to('sign.up');\n }",
"public function verifyEmail()\n {\n $this->autoRender = false;\n $this->request->trustProxy = true;\n $data = $this->request->getQuery();\n if (isset($data['key']) && isset($data['xyz'])) {\n $response = $this->GameweeveApi->user_verify($data);\n if ($response->result >= 0) {\n $this->Flash->success(__('Your email has been verified thank you'));\n //TODO: If User not Logged we should redirect to Login?\n } else {\n $this->Flash->error(__('We found an error validating your email: {0}', $response->result));\n }\n } else {\n $this->Flash->error(__('Missing key parameter'));\n }\n return $this->redirect($this->referer());\n }",
"public function validateEmailAction()\n {\n // Disable template renderer and automatic json renderer\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n $this->Front()->Plugins()->Json()->setRenderer(false);\n\n $email = $this->Request()->getParam('value');\n\n /** @var \\Shopware\\Components\\Validator\\EmailValidatorInterface $emailValidator */\n $emailValidator = $this->container->get('validator.email');\n if ($emailValidator->isValid($email)) {\n $this->Response()->setContent(1);\n } else {\n $this->Response()->setContent('');\n }\n }",
"public function testRegistrationEmailWrongFormat(): void { }",
"public function testEmailConfirmPost()\n {\n }",
"public function testEmailVerificationNewEmailAlreadyInUse(): void { }",
"function users_validate_email_address()\n{\n}",
"public function getEmailForConfirmation();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the menu_block depth option. | public function testMenuBlockDepth() {
// Add new menu block.
$block_id = 'main';
$this->drupalPostForm('admin/structure/block/add/menu_block:main', [
'id' => $block_id,
'settings[label]' => 'Main navigation',
'settings[label_display]' => FALSE,
'settings[level]' => 1,
'settings[depth]' => 1,
'settings[expand]' => TRUE,
'region' => 'primary_menu',
], 'Save block');
// Check if the parent menu item is visible, but the child menu items not.
$this->drupalGet('<front>');
$this->assertSession()->pageTextContains('parent menu item');
$this->assertSession()->pageTextNotContains('child-1 menu item');
$this->assertSession()->pageTextNotContains('child-1-1 menu item');
$this->assertSession()->pageTextNotContains('child-2 menu item');
$this->drupalPostForm('admin/structure/block/manage/' . $block_id, [
'settings[depth]' => 2,
], 'Save block');
// Check if the menu items of level 2 are visible, but not the parent menu
// item.
$this->drupalGet('menu-block-test/hierarchy/parent');
$this->assertSession()->pageTextContains('parent menu item');
$this->assertSession()->pageTextContains('child-1 menu item');
$this->assertSession()->pageTextContains('child-2 menu item');
$this->assertSession()->pageTextNotContains('child-1-1 menu item');
$this->drupalPostForm('admin/structure/block/manage/' . $block_id, [
'settings[depth]' => 0,
], 'Save block');
// Check if the menu items of level 2 are visible, but not the parent menu
// item.
$this->drupalGet('<front>');
$this->assertSession()->pageTextContains('parent menu item');
$this->assertSession()->pageTextContains('child-1 menu item');
$this->assertSession()->pageTextContains('child-2 menu item');
$this->assertSession()->pageTextContains('child-1-1 menu item');
} | [
"public function testConfigLevelDepth() {\n // Helper function to generate a configured block instance.\n $place_block = function ($level, $depth) {\n return $this->blockManager->createInstance('system_menu_block:' . $this->menu->id(), [\n 'region' => 'footer',\n 'id' => 'machinename',\n 'theme' => 'stark',\n 'level' => $level,\n 'depth' => $depth,\n ]);\n };\n\n // All the different block instances we're going to test.\n $blocks = [\n 'all' => $place_block(1, 0),\n 'level_1_only' => $place_block(1, 1),\n 'level_2_only' => $place_block(2, 1),\n 'level_3_only' => $place_block(3, 1),\n 'level_1_and_beyond' => $place_block(1, 0),\n 'level_2_and_beyond' => $place_block(2, 0),\n 'level_3_and_beyond' => $place_block(3, 0),\n ];\n\n // Scenario 1: test all block instances when there's no active trail.\n $no_active_trail_expectations = [];\n $no_active_trail_expectations['all'] = [\n 'test.example1' => [],\n 'test.example2' => [],\n 'test.example5' => [\n 'test.example7' => [],\n ],\n 'test.example6' => [],\n 'test.example8' => [],\n ];\n $no_active_trail_expectations['level_1_only'] = [\n 'test.example1' => [],\n 'test.example2' => [],\n 'test.example5' => [],\n 'test.example6' => [],\n 'test.example8' => [],\n ];\n $no_active_trail_expectations['level_2_only'] = [];\n $no_active_trail_expectations['level_3_only'] = [];\n $no_active_trail_expectations['level_1_and_beyond'] = $no_active_trail_expectations['all'];\n $no_active_trail_expectations['level_2_and_beyond'] = $no_active_trail_expectations['level_2_only'];\n $no_active_trail_expectations['level_3_and_beyond'] = [];\n foreach ($blocks as $id => $block) {\n $block_build = $block->build();\n $items = $block_build['#items'] ?? [];\n $this->assertSame($no_active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), new FormattableMarkup('Menu block %id with no active trail renders the expected tree.', ['%id' => $id]));\n }\n\n // Scenario 2: test all block instances when there's an active trail.\n $route = $this->container->get('router.route_provider')->getRouteByName('example3');\n $request = new Request();\n $request->attributes->set(RouteObjectInterface::ROUTE_NAME, 'example3');\n $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, $route);\n $this->container->get('request_stack')->push($request);\n // \\Drupal\\Core\\Menu\\MenuActiveTrail uses the cache collector pattern, which\n // includes static caching. Since this second scenario simulates a second\n // request, we must also simulate it for the MenuActiveTrail service, by\n // clearing the cache collector's static cache.\n \\Drupal::service('menu.active_trail')->clear();\n\n $active_trail_expectations = [];\n $active_trail_expectations['all'] = [\n 'test.example1' => [],\n 'test.example2' => [\n 'test.example3' => [\n 'test.example4' => [],\n ],\n ],\n 'test.example5' => [\n 'test.example7' => [],\n ],\n 'test.example6' => [],\n 'test.example8' => [],\n ];\n $active_trail_expectations['level_1_only'] = [\n 'test.example1' => [],\n 'test.example2' => [],\n 'test.example5' => [],\n 'test.example6' => [],\n 'test.example8' => [],\n ];\n $active_trail_expectations['level_2_only'] = [\n 'test.example3' => [],\n ];\n $active_trail_expectations['level_3_only'] = [\n 'test.example4' => [],\n ];\n $active_trail_expectations['level_1_and_beyond'] = $active_trail_expectations['all'];\n $active_trail_expectations['level_2_and_beyond'] = [\n 'test.example3' => [\n 'test.example4' => [],\n ],\n ];\n $active_trail_expectations['level_3_and_beyond'] = $active_trail_expectations['level_3_only'];\n foreach ($blocks as $id => $block) {\n $block_build = $block->build();\n $items = $block_build['#items'] ?? [];\n $this->assertSame($active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), new FormattableMarkup('Menu block %id with an active trail renders the expected tree.', ['%id' => $id]));\n }\n }",
"public function testMenuDepthSetting() {\n $this->drupalGet('/admin/config/user-interface/responsive-menu');\n $this->getSession()->getPage()->selectFieldOption('horizontal_depth', '1');\n $this->getSession()->getPage()->pressButton('Save configuration');\n $this->drupalGet('/node/1');\n $horizontal_menu = $this->getSession()->getPage()->findById('horizontal-menu');\n $link = $horizontal_menu->findLink('A sibling on the second level');\n $this->assertTrue(empty($link), 'A second level link was found even though the menu depth was set to 1.');\n }",
"public function testMenuBlockLevel() {\n // Add new menu block.\n $block_id = 'main';\n $this->drupalPostForm('admin/structure/block/add/menu_block:main', [\n 'id' => $block_id,\n 'settings[label]' => 'Main navigation',\n 'settings[label_display]' => FALSE,\n 'settings[level]' => 1,\n 'region' => 'primary_menu',\n ], 'Save block');\n\n // Check if the parent menu item is visible, but the child menu items not.\n $this->drupalGet('<front>');\n $this->assertSession()->pageTextContains('parent menu item');\n $this->assertSession()->pageTextNotContains('child-1 menu item');\n $this->assertSession()->pageTextNotContains('child-1-1 menu item');\n $this->assertSession()->pageTextNotContains('child-2 menu item');\n\n $this->drupalPostForm('admin/structure/block/manage/' . $block_id, [\n 'settings[level]' => 2,\n ], 'Save block');\n\n // Check if the menu items of level 2 are visible, but not the parent menu\n // item.\n $this->drupalGet('menu-block-test/hierarchy/parent');\n $this->assertSession()->pageTextContains('child-1 menu item');\n $this->assertSession()->pageTextContains('child-2 menu item');\n $this->assertSession()->pageTextNotContains('parent menu item');\n $this->assertSession()->pageTextNotContains('child-1-1 menu item');\n }",
"function test_default_navigation_depth() {\n\t\tresponsive_setup_constants();\n\n\t\t$this->assertTrue( defined( 'BU_NAVIGATION_SUPPORTED_DEPTH' ) );\n\t\t$this->assertEquals( 1, BU_NAVIGATION_SUPPORTED_DEPTH );\n\t}",
"public function test_show_wp_block_in_menu() {\n\t\tFunctions\\stubTranslationFunctions();\n\n\t\t$args = [];\n\t\t$expected_args = [\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_position' => 24,\n\t\t\t'menu_icon' => 'dashicons-screenoptions',\n\t\t];\n\t\t\n\t\t$actual_args = Testee\\show_wp_block_in_menu( $args, 'wp_block' );\n\t\t\n\t\tforeach ( $expected_args as $key => $value ) {\n\t\t\t$this->assertArrayHasKey( $key, $actual_args );\n\t\t\t$this->assertSame( $value, $actual_args[ $key ] );\n\t\t}\n\t}",
"function check_test_tree(lime_test $t, ioMenuItem $menu)\n{\n $t->info('### Running checks on the integrity of the test tree.');\n $t->is(count($menu), 2, 'count(rt) returns 2 children');\n $t->is(count($menu['Parent 1']), 3, 'count(pt1) returns 3 children');\n $t->is(count($menu['Parent 2']), 1, 'count(pt2) returns 1 child');\n $t->is(count($menu['Parent 2']['Child 4']), 1, 'count(ch4) returns 1 child');\n $t->is_deeply($menu['Parent 2']['Child 4']['Grandchild 1']->getName(), 'Grandchild 1', 'gc1 has the name \"Grandchild 1\"');\n}",
"function main_menu_limit_depth( $hook ) {\n\n if ( $hook != 'nav-menus.php' ) return;\n\n wp_add_inline_script( 'nav-menu', 'jQuery(document).ready(function(){ var selected_menu_id = jQuery(\"#select-menu-to-edit option:selected\").prop(\"value\"); if (\"2\" === selected_menu_id ) { wpNavMenu.options.globalMaxDepth = 0; } });', 'after' );\n\n}",
"function thesaasx_menu_depth_limit( $hook ) {\n\tif ( $hook != 'nav-menus.php' ) return;\n\n\t// override default value right after 'nav-menu' JS\n\twp_add_inline_script( 'nav-menu', 'wpNavMenu.options.globalMaxDepth = 2;', 'after' );\n}",
"function bulmawp_limit_depth( $hook ) {\n\tif( $hook != 'nav-menus.php' ) {\n\t\treturn;\n\t}\n\twp_add_inline_script( 'nav-menu', 'wpNavMenu.options.globalMaxDepth = 1;', 'after' );\n}",
"function limit_nav_menu_depth( $hook ) {\n\tif ( 'nav-menus.php' === $hook ) {\n\t\twp_add_inline_script( 'nav-menu', 'wpNavMenu.options.globalMaxDepth = 1;', 'after' );\n\t}\n}",
"abstract function is_block_level();",
"function depth($level);",
"public function test_admin_menu_show_in_menu_false() {\n\t\t$post_type_obj = (object) [\n\t\t\t'show_in_menu' => false,\n\t\t];\n\n\t\tFunctions\\expect( 'get_post_type_object' )\n\t\t\t->with( 'wp_block' )\n\t\t\t->andReturn( $post_type_obj );\n\n\t\t$this->assertFalse( Testee\\admin_menu() );\n\t}",
"public function testGetProductDepth() {\n $this->assertGreaterThan(0, $this->parser->depth());\n }",
"public function test_admin_menu() {\n\t\tglobal $menu, $submenu, $_wp_last_object_menu;\n\n\t\t// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited\n\t\t$menu = [];\n\n\t\t$submenu = [];\n\n\t\t$_wp_last_object_menu = 19;\n\t\t// phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited\n\n\t\t$post_type_obj = (object) [\n\t\t\t'cap' => (object) [\n\t\t\t\t'edit_posts' => 'edit_wp_block',\n\t\t\t\t'create_posts' => 'create_wp_block',\n\t\t\t],\n\t\t\t'labels' => (object) [\n\t\t\t\t'menu_name' => 'Blocks',\n\t\t\t\t'add_new' => 'Add New Block',\n\t\t\t\t'all_items' => 'All Blocks',\n\t\t\t],\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_position' => 20,\n\t\t\t'menu_icon' => 'dashicons-fake-icon',\n\t\t];\n\n\t\t$fake_taxonomy_obj = (object) [ 'show_ui' => false ];\n\n\t\t$cat_taxonomy_obj = (object) [\n\t\t\t'cap' => (object) [\n\t\t\t\t'manage_terms' => 'manage_category',\n\t\t\t],\n\t\t\t'labels' => (object) [\n\t\t\t\t'menu_name' => 'Categories',\n\t\t\t],\n\t\t\t'name' => 'category',\n\t\t\t'object_type' => [ 'post', 'wp_block' ],\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t];\n\n\t\tFunctions\\stubEscapeFunctions();\n\n\t\tFunctions\\expect( 'get_post_type_object' )\n\t\t\t->with( 'wp_block' )\n\t\t\t->andReturn( $post_type_obj );\n\n\t\tFunctions\\expect( 'sanitize_html_class' )\n\t\t\t->with( 'wp_block' )\n\t\t\t->andReturn( 'wp_block' );\n\n\t\tFunctions\\expect( 'get_taxonomies' )\n\t\t\t->with( [], 'objects' )\n\t\t\t->andReturn( [\n\t\t\t\t$cat_taxonomy_obj,\n\t\t\t\t$fake_taxonomy_obj,\n\t\t\t] );\n\n\n\t\tTestee\\admin_menu();\n\n\t\t$expected_menu = [\n\t\t\t20 => [\n\t\t\t\t'Blocks',\n\t\t\t\t'edit_wp_block',\n\t\t\t\t'edit.php?post_type=wp_block',\n\t\t\t\t'',\n\t\t\t\t'menu-top menu-icon-wp_block',\n\t\t\t\t'menu-posts-wp_block',\n\t\t\t\t'dashicons-fake-icon',\n\t\t\t]\n\t\t];\n\n\t\t$expected_submenu = [\n\t\t\t'edit.php?post_type=wp_block' => [\n\t\t\t\t5 => [\n\t\t\t\t\t0 => 'All Blocks',\n\t\t\t\t\t1 => 'edit_wp_block',\n\t\t\t\t\t2 => 'edit.php?post_type=wp_block',\n\t\t\t\t],\n\t\t\t\t10 => [\n\t\t\t\t\t0 => 'Add New Block',\n\t\t\t\t\t1 => 'create_wp_block',\n\t\t\t\t\t2 => 'post-new.php?post_type=wp_block',\n\t\t\t\t],\n\t\t\t\t15 => [\n\t\t\t\t\t0 => 'Categories',\n\t\t\t\t\t1 => 'manage_category',\n\t\t\t\t\t2 => 'edit-tags.php?taxonomy=category&post_type=wp_block',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->assertSame( $expected_menu, $menu );\n\t\t$this->assertSame( $expected_submenu, $submenu );\n\t}",
"public function testGetDepth() {\n $this->assertEquals(1.5, $this->entity->getDepth());\n }",
"public function isDisplayedInMenu();",
"public function getMenuDepth(int $id): int;",
"public function testCompileBlockGrandChildNested()\n {\n $result = $this->smarty->fetch('test_block_grandchild_nested.tpl');\n $this->assertContains('child title with -grandchild content- here', $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finishes the last steps of the Core Bootstrap. | protected function finishCoreBootstrap() {} | [
"public function finish() {\n $installModule = new File(__DIR__ . '/../../../../');\n $installModule->delete();\n\n $installScript = new File($installModule->getParent()->getParent(), 'install.php');\n if ($installScript->exists() && $installScript->isWritable()) {\n $installScript->delete();\n }\n\n $zibo = Zibo::getInstance();\n $request = $zibo->getRequest();\n $response = $zibo->getResponse();\n\n $response->setRedirect($request->getBaseUrl());\n }",
"protected function after_bootstrap() {}",
"public function finishInstallation()\n\t{\n\t\tSystemInfo::first()->setPhase('install', 2);\n\t}",
"public function afterBoot()\n\t{\n\t}",
"function final_step()\n\t{\n\t\tglobal $umil;\n\n\t\t$umil->cache_purge();\n\t\t$umil->cache_purge('auth');\n\t\tset_config('board_disable', 0);\n\t\tset_config('board_disable_msg', '');\n\n\t\t// Finished!\n\t\ttrigger_error('DATABASE_CLEANER_SUCCESS');\n\t}",
"public static function finish()\n {\n return;\n }",
"public function finish() {}",
"private function bootstrap(): void {\n $this->comment('Removing environment_detector file');\n\n $this->removeEnv();\n\n $this->comment('Finished environment_detector file');\n\n $this->comment('Restoring App.php');\n\n $this->restoreApp();\n\n $this->comment('Finished restoring App.php');\n }",
"function bootstrap() {\n\tprepare_bootstrap();\n\t$state = initialize_bootstrap_state();\n\n\tforeach ( get_bootstrap_steps() as $step ) {\n\t\t/** @var \\EE\\Bootstrap\\BootstrapStep $step_instance */\n\t\t$step_instance = new $step();\n\t\t$state = $step_instance->process( $state );\n\t}\n}",
"public function after_run(){}",
"protected function _afterRun()\n {\n // execute plugins before run\n foreach (self::$_plugins as $plugin) {\n \t/* @var $plugin Wacow_Application_Plugin_Abstract */\n \t$plugin->afterRun();\n }\n }",
"public function import_finished() {\n\n\t\tif ( is_callable( 'Better_Framework::factory' ) ) {\n\t\t\t// Clear CSS caches\n\t\t\tBetter_Framework::factory( 'custom-css-fe' )->clear_cache( 'all' );\n\t\t}\n\n\t\tdo_action( 'better-framework/product-pages/install-demo/import-finished', $this->demo_id, $this );\n\t}",
"public function finalize() {\n $this->log('== Finalizing the exporter job ==');\n $this->set_timestamp_last();\n $this->job_success('Done!');\n }",
"protected function onFinishSetup()\n {\n }",
"public function onWorkflowFinished()\n\t{\n\t\treturn;\n\t}",
"public function finish() {\n\t\t$this->activeWorkflowActivity->finish();\n\t}",
"protected function after_run() {\n\t}",
"public function afterEntryPoint()\n {\n if ($this->initialized) {\n return;\n }\n\n DotbMetric_Helper::run(false);\n $this->initialized = true;\n }",
"private static function _runBootstrap()\n {\n include ROOT.D.'app'.D.'core'.D.'base'.D.'Bootstrap.php';\n new Bootstrap();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Escapes a table name for a query. | public function escape_table($table)
{
return $this->driver->escape_table($table);
} | [
"public function escapeAndQuoteTable($table)\n {\n return \"`{$table}`\";\n }",
"public function get_table_name_escaped() {\r\n\t\treturn $this->get_table_driver()->escape_database_entity($this->get_table_name(), IDBDriver::TABLE);\r\n\t}",
"public function quoteTableName($tableName);",
"function _escape_table($table)\n\t{\n\t\tif (stristr($table, '.'))\n\t\t{\n\t\t\t$table = preg_replace(\"/\\./\", \"`.`\", $table);\n\t\t}\n\t\t\n\t\treturn $table;\n\t}",
"public function quote_ident($table_name){\n $table_name=str_replace(\"`\",\"\",$table_name); #mysql names should'nt contain ` !\n return '`'.$table_name.'`';\n }",
"public function quoteTableName($table) \n {\n return $this->quoteBacktick($table);\n }",
"protected function escapeTable($table) {\n return preg_replace('/[^A-Za-z0-9_.]+/', '', $table);\n }",
"function getTableQuote($table) {\n\treturn \"`\" . $table . \"`\";\n}",
"public function quoteTable($table)\n {\n // Identifiers are escaped by repeating them\n $escapedIdentifier = $this->identifier.$this->identifier;\n\n if (is_array($table)) {\n list($table, $alias) = $table;\n $alias = str_replace($this->identifier, $escapedIdentifier, $alias);\n }\n\n if ($table instanceof DatabaseQuery) {\n // Create a sub-query\n $table = '('.$table->compile($this).')';\n } elseif ($table instanceof DatabaseExpression) {\n // Compile the expression\n $table = $table->compile($this);\n } else {\n // Convert to a string\n $table = (string) $table;\n $table = str_replace($this->identifier, $escapedIdentifier, $table);\n\n if (strpos($table, '.') !== false) {\n $parts = explode('.', $table);\n\n if ($prefix = $this->tablePrefix()) {\n // Get the offset of the table name, last part\n $offset = count($parts) - 1;\n // Add the table prefix to the table name\n $parts[$offset] = $prefix.$parts[$offset];\n }\n\n foreach ($parts as & $part) {\n // Quote each of the parts\n $part = $this->identifier.$part.$this->identifier;\n }\n\n $table = implode('.', $parts);\n } else {\n // Add the table prefix\n $table = $this->identifier.$this->tablePrefix().$table.$this->identifier;\n }\n }\n\n if (isset($alias)) {\n // Attach table prefix to alias\n $table .= ' AS '.$this->identifier.$this->tablePrefix().$alias.$this->identifier;\n }\n\n return $table;\n }",
"public function quoteTable($name)\n {\n $name = trim((string)$name,'`');\n if(strpos($name, \"`\") !== false) {\n throw new DbException(\"table name must not contain any charcter `, {$name} is given\");\n }\n else {\n return \"`$name`\";\n }\n }",
"public function quoteTableName( $name );",
"public function table_simple_name($table, $escaped=false);",
"private function escapeTableOrColumnName($tablename) {\r\n\t\treturn str_replace(' ', '', str_replace(';', '', str_replace('\\'', '', $tablename)));\r\n\t}",
"public function quoteTable($table) : string\n {\n // Identifiers are escaped by repeating them\n $escaped_identifier = $this->_identifier.$this->_identifier;\n\n if (is_array($table))\n {\n [$table, $alias] = $table;\n $alias = str_replace($this->_identifier, $escaped_identifier, $alias);\n }\n\n if ($table instanceof Query)\n {\n // Create a sub-query\n $table = '('.$table->compile($this).')';\n }\n elseif ($table instanceof Expression)\n {\n // Compile the expression\n $table = $table->compile($this);\n }\n else\n {\n // Convert to a string\n $table = (string)$table;\n\n $table = str_replace($this->_identifier, $escaped_identifier, $table);\n\n if (strpos($table, '.') !== FALSE)\n {\n $parts = explode('.', $table);\n\n if ($prefix = $this->tablePrefix())\n {\n // Get the offset of the table name, last part\n $offset = count($parts)-1;\n\n // Add the table prefix to the table name\n $parts[$offset] = $prefix.$parts[$offset];\n }\n\n foreach ($parts as & $part)\n {\n // Quote each of the parts\n $part = $this->_identifier.$part.$this->_identifier;\n }\n\n unset($part);\n\n $table = implode('.', $parts);\n }\n else\n {\n // Add the table prefix\n $table = $this->_identifier.$this->tablePrefix() . $table . $this->_identifier;\n }\n }\n\n if (isset($alias))\n {\n // Attach table prefix to alias\n $table .= ' AS '.$this->_identifier.$this->tablePrefix() . $alias . $this->_identifier;\n }\n\n return $table;\n }",
"public function escapeTable($table) {\n\t\t$table = (string) trim($table); \n\t\tif(ctype_alnum($table)) return $table; \n\t\tif(ctype_alnum(str_replace('_', '', $table))) return $table;\n\t\treturn preg_replace('/[^_a-zA-Z0-9]/', '_', $table);\n\t}",
"public static function wrap_table_name($table_name){\n if (strstr($table_name, '`')){ return $table_name; }\n elseif (strstr($table_name, '.')){ return '`'.implode('`.`', explode('.', $table_name)).'`'; }\n else { return '`'.$table_name.'`'; }\n }",
"public function quoteTableName($name)\n\t{\n\t\treturn parent::quoteTableName($name, \"'\", \"'\");\n\t}",
"public function get_table_name_escaped() {\n\t\treturn $this->table->get_table_name_escaped();\n\t}",
"function Sql_Table_Name_Qualify($table=\"\")\n {\n if (empty($table)) { $table=$this->SqlTableName(); }\n $type=$this->DB_Dialect();\n \n $res=$table;\n if ($type==\"mysql\")\n {\n $res=\"`\".$table.\"`\";\n }\n elseif ($type==\"pgsql\" && preg_match('/[A-Z]/',$table))\n {\n $res='\"'.$table.'\"';\n }\n\n return $res;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the requested user Sets cache['users'][user_id] | function get_user($user_id) {
$this->clear_cached_data();
if (isset($this->cache['users'][$user_id]))
return ($this->cache['users'][$user_id]);
return (null);
} | [
"function user_get($username, $query = array()) {\n \t $cache_key = 'user_get_' . md5(serialize(array($username, $query)));\n \t if ( FALSE === ( $results = $this->_get_cache($cache_key) ) ) {\n \t $o = $this->Praized->user();\n \t \t$results = $o->get($username, $query);\n $this->_set_cache($cache_key, $results);\n \t }\n \t return $results;\n \t}",
"public function getUser(){\n return User::findByID($this->user_id); // user_id from remembered_logins table\n }",
"function user_cache_row( $p_user_id, $p_trigger_errors=true) {\n\t\tglobal $g_cache_user;\n\n\t\t$c_user_id = db_prepare_int( $p_user_id );\n\n\t\t$t_user_table = config_get( 'mantis_user_table' );\n\n\t\tif ( isset ( $g_cache_user[$c_user_id] ) ) {\n\t\t\treturn $g_cache_user[$c_user_id];\n\t\t}\n\n\t\t$query = \"SELECT user_id as id, user_username as username, user_email as email, user_password as password, date_created, last_visit, enabled, protected, access_level, login_count, cookie_string\n\t\t\t\t FROM $t_user_table\n\t\t\t\t WHERE user_id='$c_user_id'\";\n\t\t\n\t\t$result = db_query( $query );\n\n\t\tif ( 0 == db_num_rows( $result ) ) {\n\t\t\tif ( $p_trigger_errors ) {\n\t\t\t\ttrigger_error( ERROR_USER_NOT_FOUND, ERROR );\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$row = db_fetch_array( $result );\n\n\t\t$g_cache_user[$c_user_id] = $row;\n\n\t\treturn $row;\n\t}",
"function getuserById($id_user);",
"public function getCachedUsers()\n {\n return $this->cacheResults('users.all', function() {\n return User::protectAdmins()->get();\n });\n }",
"function update_user_caches($user) {\n\twp_cache_add($user->ID, $user, 'users');\n\twp_cache_add($user->user_login, $user->ID, 'userlogins');\n\twp_cache_add($user->user_email, $user->ID, 'useremail');\n\twp_cache_add($user->user_nicename, $user->ID, 'userslugs');\n}",
"function wcs_get_cached_user_subscription_ids( $user_id = 0 ) {\n\t$user_id = absint( $user_id );\n\tif ( 0 === $user_id ) {\n\t\t$user_id = get_current_user_id();\n\t}\n\n\t// If the user ID is still zero, bail early.\n\tif ( 0 === $user_id ) {\n\t\treturn apply_filters( 'wcs_get_cached_users_subscription_ids', array(), $user_id );\n\t}\n\n\t$subscription_ids = WC_Subscriptions::$cache->cache_and_get(\n\t\t\"wcs_user_subscriptions_{$user_id}\",\n\t\t'wcs_get_users_subscription_ids',\n\t\tarray( $user_id )\n\t);\n\n\treturn apply_filters( 'wcs_get_cached_users_subscription_ids', $subscription_ids, $user_id );\n}",
"function zoom_get_user_id($required = true) {\n global $USER;\n\n $cache = cache::make('mod_zoom', 'zoomid');\n if (!($zoomuserid = $cache->get($USER->id))) {\n $zoomuserid = false;\n $service = new mod_zoom_webservice();\n try {\n $zoomuser = $service->get_user(zoom_get_api_identifier($USER));\n if ($zoomuser !== false && isset($zoomuser->id) && ($zoomuser->id !== false)) {\n $zoomuserid = $zoomuser->id;\n $cache->set($USER->id, $zoomuserid);\n }\n } catch (moodle_exception $error) {\n if ($required) {\n throw $error;\n }\n }\n }\n\n return $zoomuserid;\n}",
"function bp_core_get_core_userdata( $user_id ) {\r\n\tif ( empty( $user_id ) )\r\n\t\treturn false;\r\n\r\n\tif ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) {\r\n\t\t$userdata = BP_Core_User::get_core_userdata( $user_id );\r\n\t\twp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' );\r\n\t}\r\n\treturn apply_filters( 'bp_core_get_core_userdata', $userdata );\r\n}",
"function getUser($id) {\n\n\t\treturn User::find($id);\n\n\t}",
"static public function get($key) {\n\t\t$user_cache = self::getUserCache();\n\t\treturn $user_cache->get($key);\n\t}",
"public function getUserById($id){\n return User::where('id', $id)->get()->first();\n }",
"public function getUserById($id)\n {\n return $this->user->find($id);\n }",
"public function cacheFetchIdentity()\n {\n return apcu_fetch('use_identity_' . $this->idUser);\n }",
"public function getUserById($id);",
"public function userShopCache()\n {\n if(!Cache::get('shop')){\n $this->usersCache();\n }\n $id = null;\n foreach($this->userRelationCache('feedings') as $feed){\n $id = $feed->name;\n };\n\n $shop = $this->shopCache();\n return $shop->filter(function($shop) use($id) {\n return (int)$shop->id === (int)$id;\n });\n }",
"public function getUserByID( $userId ){\n\t\t$result = $this->_db->query(\"SELECT * FROM \".TABLE_USERS_INFO.\" WHERE user_id='$userId' \" );\n\t\t$user_info = $result->fetch_assoc();\n \t\t$result = $this->_db->query(\"SELECT * FROM \".TABLE_USERS.\" WHERE user_id='$userId' \");\n \t\t$user_log = $result->fetch_assoc();\n\t\t\n\t\treturn $user_info;\n\t}",
"function fetch_userinfo(&$userid, $option = 0)\n{\n\tglobal $DB_site, $usercache, $vboptions, $vbphrase, $bbuserinfo, $permissions, $_USEROPTIONS, $phrasegroups, $usergroupcache;\n\n\t// Use bitwise to set $option table // see fetch_userinfo() in the getinfo section of member.php if you are confused\n\t// 1 - Join the reputationlevel table to get the user's reputation description\n\t// 2 - Get avatar\n\t// 4 - Process user's online location\n\t// 8 - Join the customprofilpic table to get the userid just to check if we have a picture\n\t// 16 - Join the administrator table to get various admin options\n\t// and so on.\n\n\tif ($userid == $bbuserinfo['userid'] AND $option != 0 AND isset($usercache[\"$userid\"]))\n\t{\n\t\t// clear the cache if we are looking at ourself and need to add one of the JOINS to our information.\n\t\tunset($usercache[\"$userid\"]);\n\t}\n\n\t$userid = intval($userid);\n\n\t// return the cached result if it exists\n\tif (isset($usercache[\"$userid\"]))\n\t{\n\t\treturn $usercache[\"$userid\"];\n\t}\n\n\t// no cache available - query the user\n\tif (!isset($vbphrase))\n\t{\n\t\t$DB_site->reporterror = 0;\n\t}\n\t$user = $DB_site->query_first(\"\n\t\tSELECT \" .\n\t\tiif(($option & 16), ' administrator.*, ') . \"\n\t\tuserfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,\n\t\tIF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid\" .\n\t\tiif(($option & 1) AND $vboptions['reputationenable'] == 1, ', level') .\n\t\tiif(($option & 2) AND $vboptions['avatarenabled'], ', avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline').\n\t\tiif(($option & 8), ', customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline') .\n\t\tiif(!isset($vbphrase), fetch_language_fields_sql(), '') . \"\n\t\tFROM \" . TABLE_PREFIX . \"user AS user\n\t\tLEFT JOIN \" . TABLE_PREFIX . \"userfield AS userfield ON (user.userid = userfield.userid)\n\t\tLEFT JOIN \" . TABLE_PREFIX . \"usertextfield AS usertextfield ON (usertextfield.userid = user.userid) \" .\n\t\tiif(($option & 1) AND $vboptions['reputationenable'] == 1, \"LEFT JOIN \" . TABLE_PREFIX . \"reputationlevel AS reputationlevel ON (user.reputationlevelid = reputationlevel.reputationlevelid) \").\n\t\tiif(($option & 2) AND $vboptions['avatarenabled'], \"LEFT JOIN \" . TABLE_PREFIX . \"avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN \" . TABLE_PREFIX . \"customavatar AS customavatar ON (customavatar.userid = user.userid) \") .\n\t\tiif(($option & 8), \"LEFT JOIN \" . TABLE_PREFIX . \"customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) \") .\n\t\tiif(($option & 16), \"LEFT JOIN \" . TABLE_PREFIX . \"administrator AS administrator ON (administrator.userid = user.userid) \") .\n\t\tiif(!isset($vbphrase), \"INNER JOIN \" . TABLE_PREFIX . \"language AS language ON (language.languageid = IF(user.languageid = 0, \" . intval($vboptions['languageid']) . \", user.languageid)) \").\"\n\t\tWHERE user.userid = $userid\n\t\");\n\tif (!isset($vbphrase))\n\t{\n\t\t$DB_site->reporterror = 1;\n\t}\n\n\tif (!$user)\n\t{\n\t\treturn array();\n\t}\n\n\t// decipher 'options' bitfield\n\t$user['options'] = intval($user['options']);\n\tforeach($_USEROPTIONS AS $optionname => $optionval)\n\t{\n\t\t$user[\"$optionname\"] = iif($user['options'] & $optionval, 1, 0);\n\t\tDEVDEBUG(\"$optionname = $user[$optionname]\");\n\t}\n\n\t// make a username variable that is safe to pass through URL links\n\t$user['urlusername'] = urlencode(unhtmlspecialchars($user['username']));\n\n\t// make a username variable that is surrounded by their display group markup\n\t$user['musername'] = fetch_musername($user);\n\n\t// get the user's real styleid (not the cookie value)\n\t$user['realstyleid'] = $user['styleid'];\n\n\tif ($option & 4)\n\t{ // Process Location info for this user\n\t\trequire_once('./includes/functions_online.php');\n\t\t$user = fetch_user_location_array($user);\n\t}\n\n\t$usercache[\"$userid\"] = $user;\n\treturn $usercache[\"$userid\"];\n}",
"function getUserData($userToGet, $mode = \"ID\") {\r\n\tglobal $db;\r\n\t// throw an exception if the user does not exist\r\n\tif(!userExists($userToGet,$mode)) {\r\n\t\tthrow new Exception(\"ERROR! getUserData() called on a non-existant user. Please use userExists() before calling getUserData()\");\r\n\t}\r\n\t\r\n\t// call the proper function of the database\r\n\t$user = $db->select(\"user\",array(\"*\"),\"User$mode=:user$mode\",array(\"user$mode\" => $userToGet));\r\n\t\r\n\t// return the first user to match\r\n\treturn $user[0];\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the max of elements is reached. | public function maxed(): bool
{
return ($this->count()==static::$max);
} | [
"function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function beyondLimit()\n {\n return ! is_null($this->limit) && $this->failedCount() >= $this->limit;\n }",
"public function hasLimit();",
"public function hasLimit(): bool;",
"public function hasMaximum(): bool\n {\n return $this->field_maximum !== null;\n }",
"public function isLimitReached(): bool\n\t{\n\t\treturn false;\n\t}",
"protected function _isLimitsReached() \n {\n return $this->_processedTasks > $this->_itemsLimit || microtime(true) > $this->_startTime + $this->_timeLimit;\n }",
"public function isSetMax()\n {\n return !is_null($this->_fields['Max']['FieldValue']);\n }",
"private function check_max()\r\n {\r\n $this->maxcounter--;\r\n if($this->maxcounter <= 0){\r\n $this->maxpics_nr = $this->get_max();\r\n $this->maxcounter = self::REFRESDELAY;\r\n }\r\n return $this->maxpics_nr;\r\n \r\n }",
"protected function hasArgumentMaximum()\n {\n return !empty($this->arguments['max']);\n }",
"public function canFitItems(Array $items){\n if($this->max > 0){\n // max defined - check if the item cout plus the new items will go over the limit\n return ($this->getItemsCount() + count($items)) <= $this->max;\n }else{\n // no max defined so items will always fit\n return true;\n }\n }",
"function _compareItemAndBuyMaxLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function notifCountHasReachedMax() {\n\t\tif ( $this->getLocalNotificationCount() >= self::MAX_BADGE_COUNT ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasMaxResults();",
"function check() {\n $current = $this->current;\n $current['time'] = time();\n $current['process'] = time() - $this->start;\n foreach ($this->limit as $key => $value) {\n if (isset($current[$key]) && $current[$key] > $value) {\n return FALSE;\n }\n }\n return !empty($this->workers);\n }",
"public function getMaxElements(): int\n {\n return $this->changesetMaximumElements;\n }",
"private function isAtCapacity(): bool\n {\n $count = count($this);\n $max = config(\"groups.max_users\");\n\n if ($max <= 0 || $max == false) {\n return false;\n }\n\n return $count >= $max;\n }",
"public function testValidateMax()\n {\n $max = 3;\n $test = array(\n 1, 2, 3,\n );\n foreach ($test as $val) {\n $this->assertTrue($this->_filter->validateMax($val, $max));\n }\n }",
"public function isMaxedOut()\n {\n return false; // stub\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Service that modify the relationship between the authenticated user and the target post in a social network. | public function modifyPostRelationship($social, $postId, $reblogKey, $action) {
$connector = $this->getSocialApi($social);
return $connector->modifyPostRelationship($postId, $reblogKey, $action);
} | [
"private function updateSocialFields()\n {\n $networks = [\n 'facebook',\n 'google',\n 'instagram',\n 'linkedin',\n 'twitter',\n 'youtube',\n ];\n\n $urls = [];\n\n foreach ($networks as $network) {\n $url = get_field('organization_' . $network . '_url',\n $this->source);\n\n if ($url) {\n $urls[] = $url;\n }\n }\n\n if ($urls) {\n $this->set('sameAs', $urls);\n }\n }",
"public function update_relationships() {\n\n $this->user_group_model->update_relationships();\n\n }",
"public function update_social_media()\n {\n $user_id = user()->id;\n $data = array(\n 'facebook_url' => $this->input->post('facebook_url', true),\n 'twitter_url' => $this->input->post('twitter_url', true),\n 'instagram_url' => $this->input->post('instagram_url', true),\n 'pinterest_url' => $this->input->post('pinterest_url', true),\n 'linkedin_url' => $this->input->post('linkedin_url', true),\n 'vk_url' => $this->input->post('vk_url', true),\n 'youtube_url' => $this->input->post('youtube_url', true)\n );\n\n $this->db->where('id', $user_id);\n return $this->db->update('users', $data);\n }",
"public function repostedBy()\n {\n return $this->hasMany('App\\Post', 'repost_id')\n ->with('user');\n }",
"protected function _postSaveRelated()\n {\n }",
"public function shareFromWallAction()\n {\n \t\n \t$prms = $this->getRequest()->getParams();\n \t\n $zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$privacy = $prms['privacysett'];\n \t\n \t$old_text = isset($prms['old_text'])?$prms['old_text']:NULL;\n \t$new_text = $zend_filter_obj->filter($prms['new_text']);\n // $from_user = $prms['from_user'];\n \n $wallpost_id = $prms['wallpost_id'];//parent wallpost.\n $post_update_type = $prms['post_update_type'];\n \n \n $parent_wallpost_obj = \\Extended\\wall_post::getRowObject($wallpost_id);\n if( ! $parent_wallpost_obj )\n {\n \t//Wallpost Doesnot exist.\n \techo Zend_Json::encode( 2 );\n \tdie;\n }\t\n \n \t$to_user = Auth_UserAdapter::getIdentity()->getId();\n \t\n \t$em = \\Zend_Registry::get('em');\n \t\n \t$owner_of_original_wallpost_obj = $parent_wallpost_obj->getwall_postsFrom_user();\n\n \t switch ( $privacy )\n \t {\n \t \tcase 1:\n \t \t\t$privacy = \\Extended\\wall_post::VISIBILITY_CRITERIA_PUBLIC;\n \t \t\tbreak;\n \t \n \t \tcase 2:\n \t \t\t$privacy = \\Extended\\wall_post::VISIBILITY_CRITERIA_LINKS;\n \t \t\tbreak;\n \t \n \t \tcase 3:\n \t \t\t$privacy = \\Extended\\wall_post::VISIBILITY_CRITERIA_LINKS_OF_LINKS;\n \t \t\tbreak;\n \t }\n \t \n\t\tif( $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_LINK || $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_LINK )\n\t\t{\n\t\t\t$result = \\Extended\\wall_post::post_url(\n\t\t\t\t\t$new_text,\n\t\t\t\t\t$parent_wallpost_obj->getLink_data(),\n\t\t\t\t\t$privacy, \n\t\t\t\t\t$to_user, \n\t\t\t\t\t$to_user,\n\t\t\t\t\t$owner_of_original_wallpost_obj->getId(),\n\t\t\t\t\t\\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_LINK,\n\t\t\t\t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n\t\t\t\t\tnull,\n\t\t\t\t\t\\Extended\\wall_post::WALL_TYPE_PROFESSIONAL,\n\t\t\t\t\tnull,\n\t\t\t\t\t$parent_wallpost_obj->getId()\n\t\t\t\t);\n\t\t}\n\t\telse if( $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_LINK || $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_PROFILE_LINK )\n\t\t{\n\t\t\t$result = \\Extended\\wall_post::post_url(\n\t\t\t\t\t$new_text,\n\t\t\t\t\t$parent_wallpost_obj->getLink_data(),\n\t\t\t\t\t$privacy,\n\t\t\t\t\t$to_user,\n\t\t\t\t\t$to_user,\n\t\t\t\t\t$owner_of_original_wallpost_obj->getId(),\n\t\t\t\t\t\\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_PROFILE_LINK,\n\t\t\t\t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n\t\t\t\t\tnull,\n\t\t\t\t\t\\Extended\\wall_post::WALL_TYPE_PROFESSIONAL,\n\t\t\t\t\tnull,\n\t\t\t\t\t$parent_wallpost_obj->getId()\n\t\t\t);\n\t\t}\n \telse if( $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_TEXT || $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_TEXT )\n \t{\t\n \t\t\n \t \t$result = \\Extended\\wall_post::post_text(\n\t \t \t\t$new_text, \n\t \t \t\t$privacy, \n\t \t \t\t$to_user,\n\t \t \t\t$to_user,\n\t \t \t\t$owner_of_original_wallpost_obj->getId(), \n\t \t \t\t\\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_TEXT,\n\t \t \t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n\t \t \t\tnull,\n\t \t \t\t\\Extended\\wall_post::WALL_TYPE_PROFESSIONAL,\n \t \t\t\tnull,\n \t \t\t\t$parent_wallpost_obj->getId()\n \t \t\t);\n \t}\n \t\n \t$udpateShareCount = \\Extended\\wall_post::shareCountIncreament($wallpost_id);\n \t$addNewShare = \\Extended\\share::addShareInfo($to_user, $wallpost_id);\n \n \t \n \t if( $result )\n \t {\n \t\n \t \t\n \t \t$new_wallpost_obj = \\Extended\\wall_post::getRowObject( $result['wallpost_id'] );\n \t \t$temp_r = array();\n \t \t$temp_r['wallpost_id'] = $result['wallpost_id'];\n \t \t\n \t \tif( $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_LINK || $post_update_type == \\Extended\\wall_post::POST_UPDATE_TYPE_SHARED_PROFILE_LINK ):\n \t \t$link_data = Zend_Json::decode( $new_wallpost_obj->getLink_data() );\n \t \t$shared_profile_user_id = $link_data['shared_profile_user_id'];\n \t \t\n \t \t$shared_profile_user_obj = \\Extended\\ilook_user::getRowObject( $shared_profile_user_id );\n \t \t\n \t \tswitch ( $shared_profile_user_obj->getGender() ) {\n \t \t\tcase 1:\n \t \t\t\t$him = \"him\";\n \t \t\t\tbreak;\n \t \t\tcase 2:\n \t \t\t\t$him = \"her\";\n \t \t\t\tbreak;\n \t \t\t\t\t\n \t \t\tdefault:\n \t \t\t\t$him = \"him\";\n \t \t\t\tbreak;\n \t \t}\n \t \t\n \t \t$temp_r['link_data']['url_title'] = $shared_profile_user_obj->getFirstname().\" \".$shared_profile_user_obj->getLastname();\n \t \t$temp_r['link_data']['url_content'] = \"Check out \".$temp_r['link_data']['url_title'].\"'s professional Profile and Connect with \".$him.\" on iLook.\";\n \t \t$temp_r['link_data']['image_src'] = \\Helper_common::getUserProfessionalPhoto( $shared_profile_user_obj->getId(), 2 );\n \t \t\n \t \telse:\n \t \t$temp_r['link_data'] = Zend_Json::decode( $new_wallpost_obj->getLink_data() );\n \t \tendif;\n \t \t\n \t \t$temp_r['user_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t \t$temp_r['fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n \t \t$temp_r['lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n \t \t$temp_r['user_type'] = Auth_UserAdapter::getIdentity()->getUser_type();\n \t \t$temp_r['user_image'] = Helper_common::getUserProfessionalPhoto($temp_r['user_id'], 3);\n \t \t$temp_r['gender'] = Auth_UserAdapter::getIdentity()->getGender();\n \t \t$temp_r['wall_post_text'] = $new_text;\n \t \t$temp_r['is_url'] = $this->getRequest()->getParam(\"is_url\");\n \t \t// Data related root user i.e user of original wallpost from where sharing initiated. From_user = from_user of original post.\n \t \t$temp_r['from_user_fullname'] = $owner_of_original_wallpost_obj->getFirstname().' '.$owner_of_original_wallpost_obj->getLastname();\n \t \t$temp_r['from_user_image'] = Helper_common::getUserProfessionalPhoto($owner_of_original_wallpost_obj->getId(), 3);\n \t \t$temp_r['from_user_id'] = $owner_of_original_wallpost_obj->getId();\n \t \t$temp_r['from_user_user_type'] = $owner_of_original_wallpost_obj->getUser_type();\n \t \t$temp_r['from_user_is_deleted'] =$owner_of_original_wallpost_obj->getDeleted_at()?1:0;\n \t \t$temp_r['from_user_wall_text'] = $parent_wallpost_obj->getWall_post_text();\n \t \t$temp_r['from_user_wall_text'] = $parent_wallpost_obj->getWall_post_text();\n \t \t$temp_r['from_user_wallpost_created_at'] = \\Helper_common::nicetime( $parent_wallpost_obj->getCreated_at()->format(\"Y-m-d H:i:s\") );\n \t \t//----------------------------------------------------------------------------------\n \t \t\n // \t \t$temp_r['from_user_post_created_at'] = \\Helper_common::nicetime( $parent_wallpost_obj()->getCreated_at()->format(\"Y-m-d H:i:s\") );\n \t \n \t \t$temp_r['url_data'] = \"\";\n \t \t$temp_r['created_at'] = $result['created_at'];\n \t \t$temp_r['privacy'] = $privacy;\n \t \t$temp_r['is_ok_comment_share_pannel_visible'] = \\Helper_common::is_ok_comment_share_pannel_visible( $privacy, Auth_UserAdapter::getIdentity()->getId(), array(Auth_UserAdapter::getIdentity()->getId()), Auth_UserAdapter::getIdentity()->getId() );\n \t \t$temp_r['sharers_string']['string'] = \\Helper_common::getSharerStringforPost($result['wallpost_id'],Auth_UserAdapter::getIdentity()->getId());\n \t \t$temp_r['sharers_string']['shared_from_wallpost_exist'] = true;\n \t \n \t \techo Zend_Json::encode( $temp_r );\n \t }\n \t else\n \t {\n \t \techo Zend_Json::encode( 0 );\n \t } \n \t die;\n }",
"public function modifyUserRelationship($social, $id, $userId, $action) {\n $connector = $this->getSocialApi($social);\n return $connector->modifyUserRelationship($id, $userId, $action);\n }",
"public function relationshipsupdateAction()\n\t{\n\t\t$params = $this->getRequest()->getPost();\n\t\tif(!isset($params['to']) || empty($params['to'])) {\n\t\t\t$this->_forward('error', 'api', null, array(\n\t\t\t\t'code' => 'RequiredError',\n\t\t\t\t'message' => 'Not all parameters given. This method requires: to.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\n\t\t$identifier = $this->getIdentifier();\n\t\t$store = $this->getProfileStore();\n\t\t$to = $this->escape($params['to'], 'uri');\n\n\t\t// delete old triples\n\t\t$query = $this->_queryPrefix .\n\t\t\t'DELETE FROM {' .\n\t\t\t\t'<' . $identifier . '> ?any1 <' . $to . '> .' .\n\t\t\t\t'<' . $to . '> ?any2 ?any3 .' .\n\t\t\t'}';\n\t\t$store->query($query);\n\t\tif($errors = $store->getErrors()) {\n\t\t\t$this->forwardTripleStoreError($errors);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// try to load the provided profile\n\t\t$toId = $this->loadUri($to, false);\n\t\tif($toId)\n\t\t\t$to = $toId;\n\n\t\t$insertQuery = $this->_queryPrefix .\n\t\t\t'INSERT INTO <' . $identifier . '> {' .\n\t\t\t\t'<' . $identifier . '> foaf:knows <' . $to . '> .';\n\t\t\n\t\t// add relationships\n\t\t$rels = 'knows';\n\t\tforeach($params as $key => $value) {\n\t\t\tif($key != 'knows' && \n\t\t\t\t$key != 'seealso' && \n\t\t\t\t$key != 'to' &&\n\t\t\t\tisset($this->_relationships[$key])) {\n\n\t\t\t\t$rels .= ',' . $key;\n\n\t\t\t\t$insertQuery .= '<' . $identifier . '> <' . $this->_relationships[$key] . '> <' . $to . '> .';\n\t\t\t}\n\t\t}\n\n\t\t// store some basic values in our profile\n\t\t// in order to accelerate browsing\n\t\t$loadProperties = array('name', 'nick', 'img', 'depiction', 'family_name', 'givenname', 'mbox', 'mbox_sha1sum');\n\t\tif($toId) {\n\t\t\t$browserStore = $this->getBrowserStore();\n\t\t\t$query = $this->_queryPrefix .\n\t\t\t\t'SELECT ?type';\n\t\t\tforeach($loadProperties as $p)\n\t\t\t\t$query .= ' ?' . $p;\n\t\t\t$query .= ' WHERE {' .\n\t\t\t\t'<' . $to . '> rdf:type ?type . ';\n\t\t\tforeach($loadProperties as $p) {\n\t\t\t\t$query .= 'OPTIONAL { <' . $to . '> <' . $this->_properties[$p][0] . '> ?' . $p . ' . } ';\n\t\t\t}\n\t\t\t$query .= ' }';\n\n\t\t\t$row = $browserStore->query($query, 'row');\n\t\t\tif(!$store->getErrors() && $row) {\n\t\t\t\tforeach($loadProperties as $p) {\n\t\t\t\t\tif(isset($row[$p]) && !empty($row[$p])) {\n\t\t\t\t\t\t$insertQuery .= '<' . $to . '> <' . $this->_properties[$p][0] . '> ';\n\t\t\t\t\t\tswitch($this->_properties[$p][1]) {\n\t\t\t\t\t\t\tcase 'uri':\n\t\t\t\t\t\t\t\t$insertQuery .= '<' . $this->escape($row[$p], 'uri') . '>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'literal':\n\t\t\t\t\t\t\t\t$insertQuery .= '\"' . $this->escape($row[$p], 'literal') . '\"';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$insertQuery .= ' . ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$insertQuery .= '}';\n\n\t\t$store->query($insertQuery);\n\t\tif($errors = $store->getErrors()) {\n\t\t\t$this->forwardTripleStoreError($errors);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$relationships = $this->getRelationships($identifier, $store);\n\t\tif($relationships === false)\n\t\t\treturn;\n\n\t\t// clean profile cache\n\t\t$cache = $this->getCache();\n\t\t$cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('profile'));\n\n\t\t$this->outputXml('<result>' . $relationships . '</result>');\n\t}",
"public function share_link_post()\n\t{\n\t\tlog_message('debug', 'Network/share_link_post');\n\t\tlog_message('debug', 'Network/share_link_post:: [1] userId='.extract_id($this->post('userId')));\n\t\t\n\t\t$result = $this->_network->add_share_link(\n\t\t\textract_id($this->post('userId'))\n\t\t);\n\t\t\n\t\tlog_message('debug', 'Network/share_link_post:: [2] result='.json_encode($result));\n\t\t$this->response($result);\n\t}",
"public function user(){\n // this post belongs to the user\n return $this->belongsTo('App\\User');\n }",
"public function updateSocialLinks()\n {\n $user = auth()->user();\n\n $url_facebook = strpos($this->request->facebook, 'http') !== 0 ? \"http://\" . $this->request->facebook : $this->request->facebook;\n $url_twitter = strpos($this->request->twitter, 'http') !== 0 ? \"http://\" . $this->request->twitter : $this->request->twitter;\n $url_linkedin = strpos($this->request->linkedin, 'http') !== 0 ? \"http://\" . $this->request->linkedin : $this->request->linkedin;\n $url_instagram = strpos($this->request->instagram, 'http') !== 0 ? \"http://\" . $this->request->instagram : $this->request->instagram;\n\n if (filter_var($url_facebook, FILTER_VALIDATE_URL)) {\n $user->facebook = $this->request->facebook;\n } else {\n return sendResponse(\"Please enter a valid url for facebook.\", true, 404);\n }\n if (filter_var($url_twitter, FILTER_VALIDATE_URL)) {\n $user->twitter = $this->request->twitter;\n } else {\n return sendResponse(\"Please enter a valid url for twitter.\", true, 404);\n }\n if (filter_var($url_linkedin, FILTER_VALIDATE_URL)) {\n $user->linkedin = $this->request->linkedin;\n } else {\n return sendResponse(\"Please enter a valid url for linkedin.\", true, 404);\n }\n if (filter_var($url_instagram, FILTER_VALIDATE_URL)) {\n $user->instagram = $this->request->instagram;\n } else {\n return sendResponse(\"Please enter a valid url for instagram.\", true, 404);\n }\n\n $user->save();\n\n return new UserResource($user);\n }",
"function save_publicized_facebook_account( $submit_post, $post_id, $service_name, $connection ) {\n\t\t$connection_meta = $this->get_connection_meta( $connection );\n\t\tif ( 'facebook' == $service_name && isset( $connection_meta['connection_data']['meta']['facebook_profile'] ) && $submit_post ) {\n\t\t\t$publicize_facebook_user = get_post_meta( $post_id, '_publicize_facebook_user' );\n\t\t\tif ( empty( $publicize_facebook_user ) || 0 != $connection_meta['connection_data']['user_id'] ) {\n\t\t\t\tupdate_post_meta( $post_id, '_publicize_facebook_user', $this->get_profile_link( 'facebook', $connection ) );\n\t\t\t}\n\t\t}\n\t}",
"abstract public function followUser( $user );",
"public function user(){\n //the relation is that this post belongs to one user\n return $this->belongsTo('App\\User');\n }",
"public function addPostToBlogInTheMiddle() {}",
"function update_reverse_relationships( $name, $to, $from ) {\n\t\t$from = $this->get_post_objects( $from );\n\t\t$to = $this->get_post_object( $to );\n\n\n\t\t$relationship = $this->get_relationship( $name );\n\n\t\t// Validate connections\n\t\t$error = $this->validate_relationship( $relationship );\n\t\tif( $error !== true ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$error = $this->validate_relationship_connections( $relationship, $from, $to );\n\t\tif( $error !== true ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t// Get the existing posts\n\t\t$existing_connections = json_decode( get_post_meta( $to->ID, '_reverse__'.$relationship->name, true ) );\n\t\tif( !is_array( $existing_connections ) ) {\n\t\t\t$existing_connections = array();\n\t\t}\n\n\n\t\t// Add all\n\t\tforeach ( $from as $f ) {\n\t\t\t// Found out if the connection already exists\n\t\t\t$key = array_search( $f->ID, $existing_connections );\n\n\t\t\tif( $key === false ) {\n\t\t\t\t// A new connection\n\t\t\t\tadd_post_meta( $f->ID, $relationship->name, $to->ID, false );\n\t\t\t} else {\n\t\t\t\tunset( $existing_connections[ $key ] ); // Remove it to because the remaining we know to remove\n\t\t\t}\n\t\t}\n\n\t\t// Delete existing connections that are not kept\n\t\tforeach( $existing_connections as $id ) {\n\t\t\tdelete_post_meta( $id, $relationship->name, $to->ID );\n\t\t}\n\t}",
"public function socials()\n {\n return $this->hasMany(SocialPost::class);\n }",
"function atwork_user_relationships_request_relationship_direct_link($variables) {\n $relate_to = $variables['relate_to'];\n $relationship_type = $variables['relationship_type'];\n //safety, revert to a generic link\n if (!isset($relationship_type)) {\n return theme('user_relationships_request_relationship_link', array('relate_to' => $relate_to));\n }\n return l(\n t(\"Follow\", array('%name' => format_username($relate_to)) + user_relationships_type_translations($relationship_type)),\n \"relationship/{$relate_to->uid}/request/{$relationship_type->rtid}\",\n array(\n 'query' => drupal_get_destination(),\n 'html' => TRUE,\n 'attributes' => array('class' => array('user_relationships_popup_link')),\n )\n );\n}",
"function follow($user, ActivitySourceInterface $subject);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Begin decryption of a new ciphertext No data has been provided, yet, so this function can't do anything. | public function begin() : string
{
if (!is_null($this->_iv)) {
throw new \Exception(
'Decryption already in progress'
);
}
$this->_creds::$eventprocessor->addOrIncrement(
new Event([
'api_key' => $this->_creds->getPapi(),
'dataset_name' => $this->_dataset->name,
'dataset_group_name' => $this->_dataset->group_name,
'action' => EventProcessor::EVENT_TYPE_DECRYPT,
'dataset_type' => $this->_dataset->type,
'key_number' => 0,
])
);
$this->_iv = '';
return '';
} | [
"function decrypt($ciphertext)\n {\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 7) & 0xFFFFFFF8, chr(0));\n }\n\n if ( CRYPT_DES_MODE == CRYPT_DES_MODE_MCRYPT ) {\n if ($this->dechanged) {\n mcrypt_generic_init($this->demcrypt, $this->keys, $this->decryptIV);\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->keys, \"\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n $this->dechanged = false;\n }\n\n if ($this->mode != 'ncfb' || !$this->continuousBuffer) {\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n } else {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 8 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 8) {\n $cb = substr($ciphertext, $i, $len - $len % 8);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -8);\n $len%= 8;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n return $plaintext;\n }\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->keys, $this->decryptIV);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n if (!is_array($this->keys)) {\n $this->keys = $this->_prepareKey(\"\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n if ($this->use_inline_crypt) {\n $inline = $this->inline_crypt;\n return $inline('decrypt', $this, $ciphertext);\n }\n\n $buffer = &$this->debuffer;\n $continuousBuffer = $this->continuousBuffer;\n $plaintext = '';\n switch ($this->mode) {\n case CRYPT_DES_MODE_ECB:\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $plaintext.= $this->_processBlock(substr($ciphertext, $i, 8), CRYPT_DES_DECRYPT);\n }\n break;\n case CRYPT_DES_MODE_CBC:\n $xor = $this->decryptIV;\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $block = substr($ciphertext, $i, 8);\n $plaintext.= $this->_processBlock($block, CRYPT_DES_DECRYPT) ^ $xor;\n $xor = $block;\n }\n if ($this->continuousBuffer) {\n $this->decryptIV = $xor;\n }\n break;\n case CRYPT_DES_MODE_CTR:\n $xor = $this->decryptIV;\n if (strlen($buffer['ciphertext'])) {\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $block = substr($ciphertext, $i, 8);\n if (strlen($block) > strlen($buffer['ciphertext'])) {\n $buffer['ciphertext'].= $this->_processBlock($this->_generate_xor($xor), CRYPT_DES_ENCRYPT);\n }\n $key = $this->_string_shift($buffer['ciphertext']);\n $plaintext.= $block ^ $key;\n }\n } else {\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $block = substr($ciphertext, $i, 8);\n $key = $this->_processBlock($this->_generate_xor($xor), CRYPT_DES_ENCRYPT);\n $plaintext.= $block ^ $key;\n }\n }\n if ($this->continuousBuffer) {\n $this->decryptIV = $xor;\n if ($start = strlen($ciphertext) % 8) {\n $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext'];\n }\n }\n break;\n case CRYPT_DES_MODE_CFB:\n if ($this->continuousBuffer) {\n $iv = &$this->decryptIV;\n $pos = &$buffer['pos'];\n } else {\n $iv = $this->decryptIV;\n $pos = 0;\n }\n $len = strlen($ciphertext);\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 8 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n while ($len >= 8) {\n $iv = $this->_processBlock($iv, CRYPT_DES_ENCRYPT);\n $cb = substr($ciphertext, $i, 8);\n $plaintext.= $iv ^ $cb;\n $iv = $cb;\n $len-= 8;\n $i+= 8;\n }\n if ($len) {\n $iv = $this->_processBlock($iv, CRYPT_DES_ENCRYPT);\n $plaintext.= $iv ^ substr($ciphertext, $i);\n $iv = substr_replace($iv, substr($ciphertext, $i), 0, $len);\n $pos = $len;\n }\n return $plaintext;\n case CRYPT_DES_MODE_OFB:\n $xor = $this->decryptIV;\n if (strlen($buffer['xor'])) {\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $block = substr($ciphertext, $i, 8);\n if (strlen($block) > strlen($buffer['xor'])) {\n $xor = $this->_processBlock($xor, CRYPT_DES_ENCRYPT);\n $buffer['xor'].= $xor;\n }\n $key = $this->_string_shift($buffer['xor']);\n $plaintext.= $block ^ $key;\n }\n } else {\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\n $xor = $this->_processBlock($xor, CRYPT_DES_ENCRYPT);\n $plaintext.= substr($ciphertext, $i, 8) ^ $xor;\n }\n $key = $xor;\n }\n if ($this->continuousBuffer) {\n $this->decryptIV = $xor;\n if ($start = strlen($ciphertext) % 8) {\n $buffer['xor'] = substr($key, $start) . $buffer['xor'];\n }\n }\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }",
"abstract public function decrypt($data);",
"function decrypt($ciphertext)\r\n {\r\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\r\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\r\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 7) & 0xFFFFFFF8, chr(0));\r\n\r\n if ( CRYPT_DES_MODE == CRYPT_DES_MODE_MCRYPT ) {\r\n $td = mcrypt_module_open(MCRYPT_DES, $this->mcrypt[0], $this->mode, $this->mcrypt[1]);\r\n mcrypt_generic_init($td, $this->keys, $this->decryptIV);\r\n\r\n $plaintext = mdecrypt_generic($td, $ciphertext);\r\n\r\n mcrypt_generic_deinit($td);\r\n mcrypt_module_close($td);\r\n\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = substr($ciphertext, -8);\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }\r\n\r\n if (!is_array($this->keys)) {\r\n $this->keys = $this->_prepareKey(\"\\0\\0\\0\\0\\0\\0\\0\\0\");\r\n }\r\n\r\n $plaintext = '';\r\n switch ($this->mode) {\r\n case CRYPT_DES_MODE_ECB:\r\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\r\n $plaintext.= $this->_processBlock(substr($ciphertext, $i, 8), CRYPT_DES_DECRYPT);\r\n }\r\n break;\r\n case CRYPT_DES_MODE_CBC:\r\n $xor = $this->decryptIV;\r\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\r\n $block = substr($ciphertext, $i, 8);\r\n $plaintext.= $this->_processBlock($block, CRYPT_DES_DECRYPT) ^ $xor;\r\n $xor = $block;\r\n }\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = $xor;\r\n }\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }",
"function decrypt($ciphertext)\n {\n if ( CRYPT_TWOFISH_MODE == CRYPT_TWOFISH_MODE_MCRYPT ) {\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, strlen($ciphertext) + (16 - strlen($ciphertext) % 16) % 16, chr(0));\n }\n\n if ($this->dechanged) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n $this->dechanged = false;\n }\n\n if ($this->mode != 'ncfb' || !$this->continuousBuffer) {\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n } else {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 16 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 16) {\n $cb = substr($ciphertext, $i, $len - $len % 16);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -16);\n $len%= 16;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n return $plaintext;\n }\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n if (empty($this->K)) {\n $this->setKey($this->key);\n }\n\n $inline = $this->inline_crypt;\n return $inline('decrypt', $this, $ciphertext);\n }",
"public function decrypt($data);",
"protected function _decrypt() {}",
"public function decrypt() \r\n {\r\n //TODO: Implement decrypt method\r\n }",
"public function decrypt($text, $key=null){ }",
"public function decrypt();",
"public function finalizeDecryption();",
"function decrypt($ciphertext)\n {\n $ciphertext = strtolower($ciphertext);\n $plaintext = \"\";\n \n for ( $i = 0; $i < strlen($ciphertext); $i++ )\n {\n $x = $this->alphabet->indexOf($ciphertext[$i]);\n $decodedIndex = mod(($x - $this->shift), $this->alphabet->sizeOf());\n $plaintext = $plaintext . ($this->alphabet->get($decodedIndex)[0]);\n }\n return $plaintext;\n }",
"public function decryptAndVerify($ciphertext, $tag, $cek, $additional, $iv);",
"final public function decryptString($ciphertext = null, $aad = null) {}",
"public static function decrypt($ciphertext, $key)\n {\n self::runtimeTest();\n\n // Extract the HMAC from the front of the ciphertext.\n if (self::ourStrlen($ciphertext) <= self::MAC_BYTE_SIZE) {\n throw new Ex\\InvalidCiphertextException(\n \"Ciphertext is too short.\"\n );\n }\n $hmac = self::ourSubstr($ciphertext, 0, self::MAC_BYTE_SIZE);\n if ($hmac === FALSE) {\n throw new Ex\\CannotPerformOperationException();\n }\n $ciphertext = self::ourSubstr($ciphertext, self::MAC_BYTE_SIZE);\n if ($ciphertext === FALSE) {\n throw new Ex\\CannotPerformOperationException();\n }\n\n // Regenerate the same authentication sub-key.\n $akey = self::HKDF(self::HASH_FUNCTION, $key, self::KEY_BYTE_SIZE, self::AUTHENTICATION_INFO);\n\n if (self::verifyHMAC($hmac, $ciphertext, $akey)) {\n // Regenerate the same encryption sub-key.\n $keysize = self::KEY_BYTE_SIZE;\n $ekey = self::HKDF(self::HASH_FUNCTION, $key, $keysize, self::ENCRYPTION_INFO);\n\n // Extract the initialization vector from the ciphertext.\n self::EnsureFunctionExists(\"openssl_cipher_iv_length\");\n $ivsize = \\openssl_cipher_iv_length(self::CIPHER_METHOD);\n if ($ivsize === FALSE || $ivsize <= 0) {\n throw new Ex\\CannotPerformOperationException(\n \"Could not get the IV length from OpenSSL\"\n );\n }\n if (self::ourStrlen($ciphertext) <= $ivsize) {\n throw new Ex\\InvalidCiphertextException(\n \"Ciphertext is too short.\"\n );\n }\n $iv = self::ourSubstr($ciphertext, 0, $ivsize);\n if ($iv === FALSE) {\n throw new Ex\\CannotPerformOperationException();\n }\n $ciphertext = self::ourSubstr($ciphertext, $ivsize);\n if ($ciphertext === FALSE) {\n throw new Ex\\CannotPerformOperationException();\n }\n\n $plaintext = self::plainDecrypt($ciphertext, $ekey, $iv);\n\n return $plaintext;\n } else {\n /**\n * We throw an exception instead of returning FALSE because we want\n * a script that doesn't handle this condition to CRASH, instead\n * of thinking the ciphertext decrypted to the value FALSE.\n */\n throw new Ex\\InvalidCiphertextException(\n \"Integrity check failed.\"\n );\n }\n }",
"public function legacyDecrypt($data,$key=null,$cipher='des')\n\t{\n\t\tif (!$key)\n\t\t{\n\t\t\t$key=Yii::app()->getGlobalState(self::STATE_ENCRYPTION_KEY);\n\t\t\tif(!$key)\n\t\t\t\tthrow new CException(Yii::t('yii','No encryption key specified.'));\n\t\t\t$key = md5($key);\n\t\t}\n\n\t\tif(extension_loaded('mcrypt'))\n\t\t{\n\t\t\tif(is_array($cipher))\n\t\t\t\t$module=@call_user_func_array('mcrypt_module_open',$cipher);\n\t\t\telse\n\t\t\t\t$module=@mcrypt_module_open($cipher,'', MCRYPT_MODE_CBC,'');\n\n\t\t\tif($module===false)\n\t\t\t\tthrow new CException(Yii::t('yii','Failed to initialize the mcrypt module.'));\n\t\t}\n\t\telse\n\t\t\tthrow new CException(Yii::t('yii','CSecurityManager requires PHP mcrypt extension to be loaded in order to use data encryption feature.'));\n\n\t\t$derivedKey=$this->substr($key,0,@mcrypt_enc_get_key_size($module));\n\t\t$ivSize=@mcrypt_enc_get_iv_size($module);\n\t\t$iv=$this->substr($data,0,$ivSize);\n\t\t@mcrypt_generic_init($module,$derivedKey,$iv);\n\t\t$decrypted=@mdecrypt_generic($module,$this->substr($data,$ivSize,$this->strlen($data)));\n\t\t@mcrypt_generic_deinit($module);\n\t\t@mcrypt_module_close($module);\n\t\treturn rtrim($decrypted,\"\\0\");\n\t}",
"public function legacyDecrypt($data,$key=null,$cipher='des')\n\t{\n\t\tif (!$key)\n\t\t{\n\t\t\t$key=Yii::app()->getGlobalState(self::STATE_ENCRYPTION_KEY);\n\t\t\tif(!$key)\n\t\t\t\tthrow new CException(Yii::t('yii','No encryption key specified.'));\n\t\t\t$key = md5($key);\n\t\t}\n\n\t\tif(extension_loaded('mcrypt'))\n\t\t{\n\t\t\tif(is_array($cipher))\n\t\t\t\t$module=@call_user_func_array('mcrypt_module_open',$cipher);\n\t\t\telse\n\t\t\t\t$module=@mcrypt_module_open($cipher,'', MCRYPT_MODE_CBC,'');\n\n\t\t\tif($module===false)\n\t\t\t\tthrow new CException(Yii::t('yii','Failed to initialize the mcrypt module.'));\n\t\t}\n\t\telse\n\t\t\tthrow new CException(Yii::t('yii','CSecurityManager requires PHP mcrypt extension to be loaded in order to use data encryption feature.'));\n\n\t\t$derivedKey=$this->substr($key,0,mcrypt_enc_get_key_size($module));\n\t\t$ivSize=mcrypt_enc_get_iv_size($module);\n\t\t$iv=$this->substr($data,0,$ivSize);\n\t\tmcrypt_generic_init($module,$derivedKey,$iv);\n\t\t$decrypted=mdecrypt_generic($module,$this->substr($data,$ivSize,$this->strlen($data)));\n\t\tmcrypt_generic_deinit($module);\n\t\tmcrypt_module_close($module);\n\t\treturn rtrim($decrypted,\"\\0\");\n\t}",
"public function decrypt($data, Key $key);",
"function unencryptData_old ($key, $in_data, $in_iv) {\n\n$alg = MCRYPT_BLOWFISH;\n$mode = MCRYPT_MODE_CBC;\n\n$decoded = mcrypt_decrypt($alg,$key,base64_decode($in_data),$mode,$in_iv);\nreturn $decoded;\n}",
"public function layeredDecryptData($cipherData, $oneTimePad = '');"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Locks the user for Yii::$app>user>lockExpiration seconds. | public function lock()
{
return Yii::$app->user->lockUser($this);
} | [
"public function lock()\n {\n if (\\Access::active())\n {\n \\Access::user()->fill(['locked' => true])->save();\n }\n }",
"public function lock($user)\n {\n $this->users->updateById((string) $user->getIdentifier(), [\n $user->getLockedAttributeName() => true,\n $user->getLockExpiresAtAttributeName() => date('Y-m-d H:i:s', ImmutableDateTime::addMinutes(new \\DateTimeImmutable(), static::getLockTimeoutInMinutes())->getTimestamp()),\n $user->getLoginAttemptsAttributeName() => 0,\n ]);\n }",
"protected function lockAction()\n {\n $this->changeStatusAction\n ->setAccess($this, Access::CAN_LOCK)\n ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__,[], [],\n ['status' => 'lock'])\n ->endAfterExecution();\n }",
"function lock() {\n if (!$this->active_object->can_have_comments) {\n $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());\n } // if\n \n if (!$this->active_object->canChangeLockedState($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $this->executeOnActiveObject('lock', array($this->logged_user), \n lang(':type \":name\" has been locked', array('type' => $this->active_object->getVerboseType(), 'name' => $this->active_object->getName())), \n lang('Failed to lock :type \":name\"', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n }",
"public function lockUser($userId, $time = 0)\n {\n if ($this->_base) {\n $this->_base->lockUser($userId, $time);\n return;\n }\n\n if ($this->hasCapability('lock')) {\n $GLOBALS['registry']->callAppMethod($this->_app, 'authLockUser', array('args' => array($userId, $time)));\n } else {\n parent::lockUser($userId, $time);\n }\n }",
"public function lockInactiveUsers()\n {\n $daysInSeconds = $this->days * 60 * 60 * 24;\n \n $userManager = new UserManager();\n \n $locked = 0;\n \n // get all not locked users\n $users = $userManager->getLockedUsers(false);\n foreach ($users as $user) {\n // lock all users where the time difference between now and the last login\n // is greater than X days\n if ($user->getLastLogin() and time() - $user->getLastLogin() >= $daysInSeconds) {\n $user->setLocked(true);\n $user->save();\n $locked ++;\n }\n }\n return $locked;\n }",
"public function accountTemporarilyLocked()\n {\n if (($this->getLastLoginAttempt('U') +\n sfConfig::get('app_sf_easy_auth_lockout_duration')) > time())\n {\n if ($this->getFailedLogins() >= sfConfig::get('app_sf_easy_auth_login_attempt_threshold'))\n {\n return true;\n }\n }\n\n return false;\n }",
"public function uac_auth_lock();",
"public function assignLock( $user, $lockToken );",
"private function accountLock()\n {\n if(in_array($this->router->method, array(\"logout\", \"accountLocked\"))) {\n return;\n }\n redirect(base_url().\"account-locked\");\n die();\n }",
"function lock ()\n {\n $id = $this->_id;\n if (!$id)\n\t die_traced ('No session.');\n\n $this->_db->update ($this->_table, 'is_locked=1', \"id=$id\");\n }",
"protected function lock() {\n\t\tupdate_option( $this->lock_option_name, '1' );\n\t}",
"public function getUserLockAction()\n {\n $this->authorize();\n\n $datas = UserSerialization::serializeUserFullLesss($this->getUser()->getLocks());\n\n return $this->view(array('locked' => $datas), Codes::HTTP_OK);\n }",
"private function release_locked_account()\n\t{\n\t\t$this->db->update($this->table_user, \n\t\t\t['login_try' => 0, 'account_locked_until' => null], \n\t\t\t['login_try >' => 0, 'account_locked_until <' => date('Y-m-d H:i:s')]\n\t\t);\n\t}",
"public function autoUnlockAccount($username) {\r\n $flag = false;\r\n $criteria = new CDbCriteria();\r\n $criteria->condition='email = :username or username = :username'; \r\n $criteria->params=array(':username'=>$username);\r\n $user=Users::model()->find($criteria);\r\n if ($user == null) return $flag;\r\n $comments = \"if the account is locked attempt to unlocked it\\n\";\r\n $comments .= \"if the there is not failed attempt in the last 15 minutes.\\n\";\r\n if ($user->locked) {\r\n $now=strtotime(date('Y-m-d H:m:s'));\r\n $failed_attempt_at = strtotime($user->failed_attempt_at);\r\n $span = $now - $failed_attempt_at;\r\n if ($span > 60) {\r\n $min = (int)($span/60);\r\n if ($min > 15) {\r\n $user->setAttributes(array(\r\n 'locked' => false,\r\n 'failed_attempt' => 0,\r\n 'modified_at' => new CDbExpression('NOW()'),\r\n ));\r\n $flag = $user->save(false);\r\n }\r\n } \r\n }\r\n return $flag;\r\n }",
"private function dbLockUser($userid)\t\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$q = \"UPDATE equfw.musers SET status=\".USER_LOCKED.\" where upper(userid)='{$userid}';\";\r\n\t\treturn $db->query($q);\r\n\t}",
"public function lock() {\n $this->locked = TRUE;\n $this->_allow_locked_save = TRUE;\n $this->save();\n }",
"protected function openLock() {\r\n\t\t\t// for a certain period of time.\r\n\t\t\techo \"Lock open.\\n\";\r\n\t\t}",
"public function ownsLock( $user, $lockToken );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The installed option is guaranteed to exist, so we try to get that | public function test_getSingle()
{
$option = Options::get( 'installed' );
$this->assert_equal( '1', $option, 'Could not retrieve single option.' );
$option = Options::get( null ); // null is not a valid name
$this->assert_equal( null, $option, 'Unset option should return null.' );
} | [
"private function get_option()\n {\n }",
"public function getOption();",
"public function getOption()\n {\n }",
"function getOption($option){\n //$args = $this->parseArgs();\n //return $args['options'][$option];\n }",
"public function hasOption();",
"function ae_get_option( $option ) {\n\t$r = get_option( $option );\n\tif ( $r ) {\n\t\treturn $r;\n\t} else {\n\t\treturn array_values(array_filter(ae_settings(), function( $v ) use ( $option ) {\n\t\t\treturn $v['name'] === $option;\n\t\t}))[0]['default'];\n\t}\n}",
"public function getOption()\r\n {\r\n return $this->option;\r\n }",
"function get_option($option) {\n\t\t$options = get_option('lepress-settings');\n \treturn $options ? $options[$option] : false;\n\t}",
"abstract protected function get_option_key();",
"protected function getEnvironmentOption()\n {\n\n }",
"public static function getInstallMode(): ?string\n {\n return self::getOption('installMode');\n }",
"public function existOption($name);",
"public function loadOption()\n {\n return $this->instantPurchase->getOption(\n $this->storeManager->getStore(),\n $this->customerSession->getCustomer()\n );\n }",
"public function getUninterpretedOption() {}",
"public function getProductOption();",
"protected function get_option_name() {}",
"function startup_get_option( $key = '' ) {\n\treturn cmb2_get_option( startup_admin()->key, $key );\n}",
"function oqp_get_option_or_default($option_name=false){\r\n\t//from DB\r\n\t$option=oqp_get_option($option_name);\r\n\t\r\n\t//from defaults\r\n\tif(!$option){\r\n\t\t$option=oqp_get_default_settings($option_name);\r\n\t}\r\n\r\n\treturn $option;\r\n}",
"function get_option($name)\n{\n global $options;\n return $options[$name] ?? null;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get 'created by' column name | public function getCreatedByColumn()
{
return defined('static::CREATED_BY') ?
static::CREATED_BY : UserstampNames::baseColumnName(UserstampNames::CREATED);
} | [
"public function getCreatedByColumn()\n {\n return defined('static::CREATED_BY') ? static::CREATED_BY : 'created_by';\n }",
"protected function getCreatedByColumn()\n {\n return 'created_by';\n }",
"public function getCreatorColumn()\n {\n return defined('static::CREATOR_COLUMN') ? static::CREATOR_COLUMN : 'created_by';\n }",
"public function getCreatedByIdColumn()\n {\n return property_exists($this, 'CREATED_BY_ID') ? static::CREATED_BY_ID : 'created_by_id';\n }",
"public function getCreatedByColumn() {\n return static::CREATED_BY;\n }",
"public function getCreationDateColumnName() {}",
"public function getCreatedAtColumn(): string\n\t{\n\t\treturn property_exists($this, 'createdAtColumn') ? $this->createdAtColumn : 'created_at';\n\t}",
"public function getUpdatedByColumn()\n {\n return defined('static::UPDATED_BY') ?\n static::UPDATED_BY : UserstampNames::baseColumnName(UserstampNames::UPDATED);\n }",
"function getCreatedByName() {\n return $this->getFieldValue('created_by_name');\n }",
"public function getCreatedByColumn()\n {\n return $this->pivotParent->getCreatedByColumn();\n }",
"private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }",
"public function getCreatedAtColumn()\n {\n return property_exists($this, 'CREATED_AT') ? static::CREATED_AT : 'created_at';\n }",
"public function getUpdatedByColumn()\n {\n return defined('static::UPDATED_BY_COLUMN') ? static::UPDATED_BY_COLUMN : 'updated_by';\n }",
"public function getCreatedAtColumn()\n {\n return $this->createdField;\n }",
"public function createdAt(): string\n {\n return $this->createdColumn;\n }",
"public function getCreatedAtColumn()\n {\n return $this->createdAtColumn;\n }",
"public function getDestroyerColumn()\n {\n return defined('static::DESTROYER_COLUMN') ? static::DESTROYER_COLUMN : 'deleted_by';\n }",
"public function column_name();",
"public function getCreatedTimestampColumnName(): ?string {\n\n return $this->created_timestamp_column_name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a sfGuardUser object by username and is_active flag. | public function retrieveByUsername($username, $isActive = true) {
$query = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')
->where('u.username = ?', $username)
->addWhere('u.is_active = ?', $isActive)
;
return $query->fetchOne();
} | [
"public function retrieveByUsername($username, $isActive = true)\n {\n $query = Doctrine::getTable('sfGuardUser')->createQuery('u')\n ->where('u.username = ?', $username)\n ->addWhere('u.is_active = ?', $isActive)\n ;\n\n return $query->fetchOne();\n }",
"public function retrieveByUsername($username, $isActive = true)\n {\n $query = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')\n ->where('u.username = ?', $username)\n ->addWhere('u.is_active = ?', $isActive)\n ;\n\n return $query->fetchOne();\n }",
"public function retrieveByUsernameOrEmailAddress($username, $isActive = true)\n {\n $query = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')\n ->where('u.username = ? OR u.email_address = ?', array($username, $username))\n ->addWhere('u.is_active = ?', $isActive)\n ;\n\n return $query->fetchOne();\n }",
"public function getsfGuardUser()\n {\n if ($sfGuardUser = sfGuardUserPeer::retrieveByPK($this->getCreatedBy()))\n {\n return $sfGuardUser;\n }\n else\n {\n // anonymous\n $sfGuardUser = new sfGuardUser();\n $sfGuardUser->setId(0);\n $sfGuardUser->setUsername('anonymous');\n\n return $sfGuardUser;\n }\n }",
"public function retrieveByUsername($username, $isActive = true)\n {\n // Define query.\n $query = Doctrine_Core::getTable('klUser')->createQuery('u')\n ->where('u.username = ?', $username)\n ->addWhere('u.is_active = ?', (int) $isActive);\n \n return $query->fetchOne();\n }",
"public function getsfGuardUserObject()\n {\n $q = Doctrine_Query::create()\n\t ->from('sfGuardUser sgu')\n\t ->where('sgu.id = ?', $this->getUserId()); \n\n\t return $q->fetchOne();\t\t \t \n }",
"public function getUserByUsername($username);",
"public function getUserByUsername(string $username);",
"public function retrieveUserByUsername($username);",
"public static function findActiveByUsername($username)\n {\n return static::findOne(['email' => $username, 'is_active' => 1]);\n }",
"public function getActiveUser() {\n\t\tif (isset($_SESSION['auth'][$this->getConfig('session_user')]) && !empty($_SESSION['auth'][$this->getConfig('session_user')])) {\n\t\t\tif (!isset($this->userObj)) {\n\t\t\t\t$userTable = Doctrine::getTable($this->getConfig('models.user'));\n\t\t\t\t$user_id = $_SESSION['auth'][$this->getConfig('session_user')][$this->getConfig('fields.user.id')];\n\t\t\t\t$this->userObj = &$userTable->find($user_id);\n\t\t\t}\n\t\t\treturn $this->userObj;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public static function fetchUserByUsername($username);",
"public function retrieveByUsernameOrEmailAddress($username, $isActive = true)\n {\n // Define query.\n $query = Doctrine_Core::getTable('klUser')->createQuery('u')\n ->where('u.username = ? OR u.email_address = ?', array($username, $username))\n ->addWhere('u.is_active = ?', $isActive);\n\n return $query->fetchOne();\n }",
"public function getGuardUser() {\n if (!$this->user && $id = $this->getAttribute('user_id', null, 'sfGuardSecurityUser')) {\n $this->user = Doctrine_Core::getTable('sfGuardUser')->find($id);\n\n if (!$this->user) {\n // the user does not exist anymore in the database\n $this->signOut();\n\n throw new sfException('The user does not exist anymore in the database.');\n }\n }\n\n return $this->user;\n }",
"public static function findByUsername($username) \n {\n return static::findOne(['nome' => $username, 'attivo' => self::STATUS_ACTIVE]);\n }",
"public function retrieveUser(array $params, $is_active = 1)\n {\n //print_r($params);\n $query = $this->createQuery('user');\n\n foreach ($params as $col => $val) {\n $query->addWhere(sprintf('%s.%s = ?', $query->getRootAlias(), $col), $val);\n }\n\n if (!is_null($is_active)) {\n $query->addWhere($query->getRootAlias() . '.is_active = ?', $is_active);\n }\n\n return $query->fetchOne();\n }",
"public function findUserByUsername($username);",
"function findUserByUsername($username);",
"static function findByUser($username)\n {\n $stmt = self::$app->db->prepare(self::FIND_BY_NAME);\n $stmt->bindParam(1, $username);\n $stmt->execute();\n $row = $stmt->fetch();\n\n if($row == false) {\n return null;\n }\n\n return User::makeFromSql($row);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates: total number of items ($order['quantity']) total order value ($order['orderValue']) total GST value ($order['orderGSTValue']) and returns in array $order | public function calculateFinancesForOrder() {
$items = $_SESSION['cart'];
$orderValue = 0;
$quantity = 0;
foreach ($items as $item) {
extract($item);
$subtotal = $sizePrice * $orderProdQty;
$orderValue = $orderValue + $subtotal;
$quantity = $quantity + $orderProdQty;
}
$order['quantity'] = $quantity;
$order['orderValue'] = $orderValue;
$order['orderGSTValue'] = ($_SESSION['shipping'] + $order['orderValue']) * .15;
return $order;
} | [
"function orderQuantity($order) {\n $orderlines = $order->orderlines;\n\n foreach($orderlines as $key => $value) {\n $sum += $orderlines[$key]->quantity;\n }\n return $sum;\n}",
"public function getAmountValues($order): array {\n $subtotalIva = 0;\n $subtotalIva0 = 0;\n $iva = 0;\n $items = $order->getItems();\n $shippingTax = $order->getBaseShippingTaxAmount();\n $shippingAmount = $order->getBaseShippingAmount();\n foreach ($items as $item) {\n if($item->getBaseTaxAmount() > 0) {\n $subtotalIva += $item->getRowTotal();\n $iva += $item->getBaseTaxAmount();\n } else {\n $subtotalIva0 += $item->getRowTotal();\n }\n }\n\n if ($shippingTax > 0) {\n $subtotalIva += $shippingAmount;\n $iva += $shippingTax;\n } else {\n $subtotalIva0 += $shippingAmount;\n }\n\n $subtotalIva = round( floatval( $subtotalIva ), 2 );\n $subtotalIva0 = round( floatval( $subtotalIva0 ), 2 );\n $iva = round( floatval( $iva ), 2 );\n\n return array(\n \"subtotalIva\" => $subtotalIva,\n \"subtotalIva0\" => $subtotalIva0,\n \"iva\" => $iva\n );\n }",
"public function getAmounts($order)\n {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n // \n $query->select('amount_excl_tax AS excl_tax, amount_incl_tax AS incl_tax,'.\n 'final_amount_excl_tax AS final_excl_tax, final_amount_incl_tax final_incl_tax')\n\t ->from('#__ketshop_order')\n ->where('id='.(int)$order->id);\n $db->setQuery($query);\n\n return $db->loadObject();\n }",
"function get_order_total_history($db, $user_name, $orderid){\n $order = get_order_details($db, $user_name, $orderid);\n \n $order_total = 0;\n $item_total = 0;\n $quantity = 0;\n $price = 0;\n \n foreach($order as $item) {\n $game = get_game_info($item['upc'], get_inventory($db));\n $price = $game['price'];\n $quantity = $item['quantity'];\n \n $item_total = calc_item_total($game, $item);\n \n $order_total += $item_total;\n }\n return $order_total;\n}",
"public function buildTotals(OrderInterface $order);",
"function uc_line_items_calculate($order) {\n $total = 0;\n\n $context = array(\n 'revision' => 'altered',\n 'type' => 'line_item',\n 'subject' => array(\n 'order' => $order,\n ),\n );\n\n if (isset($order->line_items) && is_array($order->line_items)) {\n foreach ($order->line_items as $item) {\n $context['subject']['line_item'] = $item;\n if (_line_item_data($item['type'], 'calculated') == TRUE) {\n $total += uc_price($item['amount'], $context);\n }\n }\n }\n\n return $total;\n}",
"function orderTotal($argOrderID) {\n\n $arrSubTotal = $this->getArrayResult(\"SELECT sum(ItemSubTotal+AttributePrice) as TotalPrice FROM \" . TABLE_ORDER_ITEMS . \" WHERE fkOrderID ='\" . $argOrderID . \"'\");\n $arrShippingTotal = $this->getArrayResult(\"SELECT sum(ShippingPrice) as TotalPrice FROM \" . TABLE_ORDER_ITEMS . \" WHERE fkOrderID ='\" . $argOrderID . \"'\");\n $arrDiscountTotal = $this->getArrayResult(\"SELECT sum(DiscountPrice) as TotalPrice FROM \" . TABLE_ORDER_ITEMS . \" WHERE fkOrderID ='\" . $argOrderID . \"'\");\n\n $arrSubTotalPoints = $this->getArrayResult(\"SELECT sum(ItemSubTotal) as TotalPrice FROM \" . TABLE_ORDER_ITEMS . \" WHERE fkOrderID ='\" . $argOrderID . \"'\");\n\n $arrRows = array(\n 'sub-total' => $arrSubTotal[0]['TotalPrice'],\n 'shipping' => $arrShippingTotal[0]['TotalPrice'],\n 'coupon' => $arrDiscountTotal[0]['TotalPrice'],\n 'OrderTotalPoints' => $arrSubTotalPoints[0]['TotalPrice']\n );\n\n\n return $arrRows;\n }",
"public function calculate_order_total(){\r\n $this->order_total = 0;\r\n foreach($this->items as $item){\r\n $this->order_total += $this->getItemSubTotal($item);\r\n }\r\n $this->sales_tax_amount = ($this->order_total * $this->sales_tax);\r\n return $this->order_total + $this->sales_tax_amount;\r\n }",
"public function getOrderTotalData()\n {\n return array();\n }",
"public function getAmountArray_by_orderCountryAndGmtsitem(){\n\t\t$Amount=$this->_setAmount($this->_By_orderCountryAndGmtsitem);\n\t\treturn $Amount;\n\t}",
"function getSystemStatsTotalOrders() {\n $cacheKey = sprintf('system_stats_%s', 'getSystemStatsTotalOrders');\n $value = Cache::get($cacheKey);\n\n if($value) {\n return $value;\n }\n\n $appr = Order::count();\n $al = AltOrder::count();\n $docuvault = DocuvaultOrder::count();\n\n $value = [\n 'Appraisals' => $appr,\n 'MarkItValue' => $al,\n 'DocuVault' => $docuvault,\n ];\n\n $value['Total'] = array_sum($value);\n Cache::add($cacheKey, $value, SYSTEM_STATS_CACHE_TIME);\n return $value;\n}",
"public function order_amount()\n\t{\n\t\t$subtotal = (float) 0.00;\n\t\t\n\t\tforeach($this->order_details as $item)\n\t\t{\n\t\t\t$subtotal += $item->price;\n\t\t}\n\t\t\n\t\treturn (float) $subtotal;\n\t}",
"protected function _getTotals(){\n try {\n $totals = $this->_orderCreateModel->getQuote()->getTotals();\n }catch (\\Exception $e){\n print_r($e);\n }\n $totalsResult = array();\n foreach ($totals as $total) {\n $totalsResult[] = $total->getData();\n }\n return $totalsResult;\n }",
"private function getVariantQuantities(OrderInterface $order)\n {\n $variants = array();\n $quantities = array();\n\n foreach ($order->getItems() as $item) {\n $variant = $item->getVariant();\n\n if (!in_array($variant, $variants)) {\n $variants[] = $variant;\n }\n\n $index = array_search($variant, $variants);\n $quantities[$index] = isset($quantities[$index]) ? $quantities[$index] + $item->getQuantity() : $item->getQuantity();\n }\n\n return array($variants, $quantities);\n }",
"public function getOrderTotalData()\n {\n return array(\n 'can_display_total_due' => true,\n 'can_display_total_paid' => true,\n 'can_display_total_refunded' => true,\n );\n }",
"protected function get_order_total()\n {\n }",
"public function build_array($orders ) {\n\t\t$this->load->model('currencies_model');\n\t\tif(count($orders) > 0) {\n\t\t\t$i = 0;\n\t\t\t$item_array = array();\n\t\t\t\n\t\t\t// Loop through each order.\n\t\t\tforeach($orders as $order) {\n\t\t\t\t// Extract product hash/quantities.\n\t\t\t\t$items = $order['items'];\n\t\t\t\t$items = explode(\":\", $items);\n\t\t\t\t$j = 0;\n\t\t\t\t\n\t\t\t\t$price_b = 0.00000000;\n\t\t\t\t$price_l = 0.00000000;\n\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t// Load each item & quantity.\n\t\t\t\t\t$array = explode(\"-\", $item);\n\t\t\t\t\t$item_info = $this->items_model->get($array[0]);\n\t\t\t\t\t$quantity = $array[1];\n\t\t\t\t\t\n\t\t\t\t\t// If the item no longer exists, display a message.\n\t\t\t\t\tif($item_info == FALSE) {\n\t\t\t\t\t\t$message = \"Item \";\n\t\t\t\t\t\t$message .= (strtolower($this->current_user->user_role) == 'vendor') ? 'has been removed' : 'was removed, contact your vendor' ;\n\t\t\t\t\t\t$item_array[$j] = array('hash' => 'removed',\n\t\t\t\t\t\t\t\t\t\t\t\t'name' => $message);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove the vendor array, reduces the size of responses.\n\t\t\t\t\t\tunset($item_info['vendor']);\n\t\t\t\t\t\t$item_array[$j] = $item_info;\n\n\t\t\t\t\t\t// Convert from whatever currency the item's price is in\n\t\t\t\t\t\t// to bitcoin, and add this up. Convert to local currency later.\n\t\t\t\t\t\t$price_b_tmp = $item_info['price']/$item_info['currency']['rate'];\n\t\t\t\t\t\t$price_b += $price_b_tmp*$quantity;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$item_array[$j++]['quantity'] = $quantity;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Determine the progress message. Contains a status update\n\t\t\t\t// for the order, and lets the user progress to the next step.\n\t\t\t\tswitch($order['progress']) {\n\t\t\t\t\tcase '0':\t\n\t\t\t\t\t\t$buyer_progress_message = '<input type=\"submit\" class=\"btn btn-mini\" name=\"recount['.$order['id'].']\" value=\"Update\" /> <input type=\"submit\" class=\"btn btn-mini\" name=\"place_order['.$order['id'].']\" value=\"Proceed with Order\" />';\n\t\t\t\t\t\t$vendor_progress_message = '';\n\t\t\t\t\t\t// no vendor progress message\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '1':\n\t\t\t\t\t\t$buyer_progress_message = 'Awaiting vendor response.'; \n\t\t\t\t\t\t$vendor_progress_message = \"<input type='submit' name='dispatch[{$order['id']}]' value='Dispatch' class='btn btn-mini' /> <input type='submit' name='finalize_early[{$order['id']}]' value='Finalize Early' class='btn btn-mini' />\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '2':\n\t\t\t\t\t\t$buyer_progress_message = 'Must finalize early.<br /><input type=\"submit\" class=\"btn btn-mini\" name=\"cancel['.$order['id'].']\" value=\"Cancel\" /> <input type=\"submit\" class=\"btn btn-mini\" name=\"finalize['.$order['id'].']\" value=\"Finalize Early\" /> ';\n\t\t\t\t\t\t$vendor_progress_message = \"Awaiting early finalization. <input type='submit' name='cancel[{$order['id']}]' value='Cancel' class='btn btn-mini'/>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '3':\n\t\t\t\t\t\t$buyer_progress_message = \"Awaiting dispatch.<br />\".anchor('order/dispute/'.$order['id'], 'Dispute', 'class=\"btn btn-mini\"');\t\n\t\t\t\t\t\t$vendor_progress_message = \"<input type='submit' name='dispatch[{$order['id']}]' value='Confirm Dispatch' class='btn btn-mini' />\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '4':\n\t\t\t\t\t\t$buyer_progress_message = \"Item has been dispatched.<br /><input type=\\\"submit\\\" class=\\\"btn btn-mini\\\" name=\\\"finalize[{$order['id']}]\\\" value='\".(($order['finalized'] == '0') ? 'Finalize' : 'Received').\"' /> \".anchor('order/dispute/'.$order['id'], 'Dispute', 'class=\"btn btn-mini\"');\t\n\t\t\t\t\t\t$vendor_progress_message= \"Awaiting \".(($order['finalized'] == '0') ? 'finalization' : 'delivery').\" \".anchor('orders/dispute/'.$order['id'], 'Dispute', 'class=\"btn btn-mini\"'); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '5':\n\t\t\t\t\t\t$buyer_progress_message = \"Disputed transaction.<br />\".anchor('order/dispute/'.$order['id'], 'View', 'class=\"btn btn-mini\"');\n\t\t\t\t\t\t$vendor_progress_message = \"Disputed transaction.<br />\".anchor('orders/dispute/'.$order['id'], 'View', 'class=\"btn btn-mini\"');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '6':\n\t\t\t\t\t\t$buyer_progress_message = \"Item received. Pending confirmation.\";\n\t\t\t\t\t\t$vendor_progress_message = \"Item received. Pending confirmation.\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '7':\n\t\t\t\t\t\t$buyer_progress_message = \"Purchase complete.\";\n\t\t\t\t\t\t$vendor_progress_message = \"Order complete.\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$currency = $this->currencies_model->get($order['currency']);\n\t\t\t\t\n\t\t\t\t$price = ($currency !== '0') ? $order['price']/$currency['rate'] : $order['price'];\n\t\t\t\t\n\t\t\t\t// Load the users local currency.\n\t\t\t\t$local_currency = $this->currencies_model->get($this->current_user->currency['id']);\n\t\t\t\t// Convert the order's price into the users own currency.\n\t\t\t\t$price_l = ($order['price']*$local_currency['rate']);\n\t\t\t\t$price_l = ($this->current_user->currency['id'] !== '0') ? round($price_l, '2', PHP_ROUND_HALF_UP) : round($price_l, '8', PHP_ROUND_HALF_UP);\n\n\t\t\t\t$tmp = array('id' => $order['id'],\n\t\t\t\t\t\t\t\t\t'vendor' => $this->accounts_model->get(array('user_hash' => $order['vendor_hash'])),\n\t\t\t\t\t\t\t\t\t'buyer' => $this->accounts_model->get(array('id' => $order['buyer_id'])),\n\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t'price_b' => (float)round($price_b, 8, PHP_ROUND_HALF_UP),\n\t\t\t\t\t\t\t\t\t'price_l' => $price_l,\n\t\t\t\t\t\t\t\t\t'fees' => $order['fees'],\n\t\t\t\t\t\t\t\t\t'currency' => $currency,\n\t\t\t\t\t\t\t\t\t'time' => $order['time'],\n\t\t\t\t\t\t\t\t\t'time_f' => $this->general->format_time($order['time']),\n\t\t\t\t\t\t\t\t\t'created_time_f' => $this->general->format_time($order['created_time']),\n\t\t\t\t\t\t\t\t\t'items' => $item_array,\n\t\t\t\t\t\t\t\t\t'finalized' => $order['finalized'],\n\t\t\t\t\t\t\t\t\t'disputed' => $order['disputed'],\n\t\t\t\t\t\t\t\t\t'vendor_selected_escrow' => $order['selected_escrow'],\n\t\t\t\t\t\t\t\t\t'progress' => $order['progress'],\n\t\t\t\t\t\t\t\t\t'progress_message' => ($this->current_user->user_role == 'Vendor') ? $vendor_progress_message : $buyer_progress_message);\n\t\t\t\t\n\t\t\t\tif($order['dispatched_time'] !== '') {\n\t\t\t\t\t$tmp['dispatched_time'] = $order['dispatched_time'];\n\t\t\t\t}\n\t\t\t\tif($order['disputed_time'] !== '') {\n\t\t\t\t\t$tmp['disputed_time'] = $order['disputed_time'];\n\t\t\t\t}\n\t\t\t\tif($order['selected_payment_type_time'] !== '') {\n\t\t\t\t\t$tmp['selected_payment_type_time'] = $order['selected_payment_type_time'];\n\t\t\t\t}\n\t\t\t\tif($order['finalized_time'] !== '') {\n\t\t\t\t\t$tmp['finalized_time'] = $order['finalized_time'];\n\t\t\t\t}\n\t\t\t\tif($order['received_time'] !== '') {\n\t\t\t\t\t$tmp['received_time'] = $order['received_time'];\n\t\t\t\t}\n\t\t\t\t$orders[$i++] = $tmp;\n\t\t\t\tunset($item_array);\n\t\t\t\tunset($tmp);\n\t\t\t}\n\t\t\treturn $orders;\n\t\t\t\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function calcQtd(){\r\n try{\r\n\r\n $this->_qtdOrders = count($this->_result);\r\n\r\n foreach ($this->_result as $item=>$key){\r\n $this->_qtdProd = $this->_qtdProd + $key->quantity;\r\n }\r\n\r\n }catch (Exception $e){\r\n echo $e->getMessage();\r\n }\r\n }",
"protected function calculateOrder(){\n $amount=0;\n foreach($this->existing_ordered_products as $product){\n $amount +=$product['price'] * $product['quantity'] - $product['price'] * $product['quantity'] * $product['discount']/100;\n }\n return $amount;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses a output parameter and adds it to the IoMapping. | public static function parseOutputParameterElement(Element $outputParameterElement, IoMapping $ioMapping): void
{
$nameAttribute = $outputParameterElement->attribute("name");
if (empty($nameAttribute)) {
throw new BpmnParseException("Missing attribute 'name' for outputParameter");
}
$valueProvider = self::parseNestedParamValueProvider($outputParameterElement);
// add parameter
$ioMapping->addOutputParameter(new OutputParameter($nameAttribute, $valueProvider));
} | [
"public static function parseOutputParameters(Element $inputOutputElement, IoMapping $ioMapping): void\n {\n $outputParameters = $inputOutputElement->elementsNS(BpmnParser::BPMN_EXTENSIONS_NS, \"outputParameter\");\n foreach ($outputParameters as $outputParameterElement) {\n self::parseOutputParameterElement($outputParameterElement, $ioMapping);\n }\n }",
"public function add_output_parameter(string $p_param_name, $p_param_value) {\n $this->out_params[$p_param_name] = $p_param_value;\n }",
"public function addOutput($name, $output);",
"public function registerOutParameter($paramIndex, $sqlType, $maxLength = null);",
"public function addOutput(string $key, $value) : void;",
"abstract public function set_output();",
"public function recordOutputReferenceParamName(string $parameter_name): void;",
"abstract protected function parseOutput(string $output): PluginOutputModel;",
"public function registerOutput($output)\n\t{\n\t\t// Check for output resolving\n\t\tif (is_string($output))\n\t\t{\n\t\t\t$output = $this->resolveOutput($output);\n\t\t}\n\n\t\tif ( ! $output instanceof OutputInterface)\n\t\t{\n\t\t\tthrow new InvalidAgumentException('Argument 1 of '.__FUNCTION__.' must be an instance of FuelPHP\\Profiling\\OutputInterface');\n\t\t}\n\n\t\t$outputClass = get_class($output);\n\t\t$this->output[$outputClass] = $output;\n\n\t\treturn $this;\n\t}",
"public function testAddInputOutput()\n {\n $arrayUid = $this->testAddTask();\n try {\n\n\n $inputOutputAttr = new InputOutputAttributes();\n $inputOutputAttr->setInputParameters(['some_key']);\n $inputOutputAttr->setOutputParameters(['some_key_1']);\n $result = $this->apiInstance->addInputOutput(\n $arrayUid['process_uid'],\n $arrayUid['task_uid'],\n new InputOutputCreateItem(\n [\n 'data' => new InputOutput(['attributes' => $inputOutputAttr])\n ]\n )\n );\n\n $this->assertNotNull($result->getData()->getId());\n $this->assertEquals($inputOutputAttr->getInputParameters(), $result->getData()->getAttributes()->getInputParameters());\n $this->assertEquals($inputOutputAttr->getOutputParameters(), $result->getData()->getAttributes()->getOutputParameters());\n //print_r($result->getData());\n $arrayUid['inputoutput_uid'] = $result->getData()->getId();\n return $arrayUid;\n\n } catch (ApiException $e) {\n $this->dumpError($e, __METHOD__);\n }\n\n\n }",
"public function addOutputPoint(OutputPointInterface $point);",
"public function walkInputParameter($inputParam);",
"public abstract function process_output_data(flcOutputData $p_output_data);",
"public function setOutputType($otName)\n\t{\n\t\t$this->outputType = $otName;\n\t}",
"private function _loadOutputFormats()\n {\n foreach (AcceptedOutputs::$outputs as $output) {\n $format = new \\outputFormatObj($output[\"driver\"], $output[\"name\"]);\n foreach ($output as $key => $value) {\n if ($key != \"formatoptions\") {\n $format->set($key, $value);\n } else {\n foreach ($value as $options) {\n $option = explode(\"=\", $options);\n $format->setOption($option[0], $option[1]);\n }\n }\n }\n $this->map_obj->appendOutputFormat($format);\n }\n }",
"protected function mapParameter($parameter) {\n\t\tswitch ($parameter) {\n\t\t\tcase 'ip' :\n\t\t\t\treturn $this->getParameter ( 'ip', $_SERVER ['REMOTE_ADDR'] );\n\t\t\t\tbreak;\n\t\t\tcase 'event' :\n\t\t\t\treturn $this->getParameter ( 'event', 'none' );\n\t\t\t\tbreak;\n\t\t\tcase 'compact' :\n\t\t\t\treturn $this->getParameter ( 'compact', false );\n\t\t\t\tbreak;\n\t\t\tcase 'numwant' :\n\t\t\t\t$numWant = $this->getParameter ( 'numwant', 30 );\n\t\t\t\treturn $numWant < 30 ? $numWant : 30;\n\t\t\t\tbreak;\n\t\t\tcase 'passkey' :\n\t\t\t\treturn $this->getParameter ( 'passkey', '' );\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\treturn parent::mapParameter ( $parameter );\n\t\t}\n\t}",
"private function readParameter($value, $parameters, $output)\n\t{\n\t\t//check if the arrayKey exists and replace the callSyntax with the value\n\t\t\tif(isset($parameters[trim($value)])){\t\t\t\n\t\t\t\t$replace = $parameters[trim($value)];\n\t\t\t\t$pattern = '/{{'.$value.'}}/';\n\t\t\t\tif(is_string($replace)){\n\t\t\t\t\t$output = preg_replace($pattern,$replace,$output);\n\t\t\t\t}elseif(is_object($replace)){\n\t\t\t\t\t//throw Exception\n\t\t\t\t\t\tdie(\"object to string convertation\");\n\t\t\t\t}else{\n\t\t\t\t\t$output = preg_replace($pattern,$value,$output);\n\t\t\t\t}\n\t\t\t}\n\t\treturn $output;\n\t}",
"public function setOutput($var)\n\t{\n\t\tGPBUtil::checkUint32($var);\n\t\t$this->output = $var;\n\n\t\treturn $this;\n\t}",
"public function setOutput($val) {\n $this->_output = $val;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add minimum order quantity custom field to variable products on product edit screen. Custom fields are added per variation, not to the parent variable product. | public function addVariableProductMinimumOrderQuantityCustomField ( $loop , $variation_data , $variation , $registeredCustomRoles ) {
global $woocommerce, $post;
// Get the variable product data manually
// Don't rely on the variation data woocommerce supplied
// There is a logic change introduced on 2.3 series where they only send variation data (or variation meta)
// That is built in to woocommerce, so all custom variation meta added to a variable product don't get passed along
$variable_product_meta = get_post_meta( $variation->ID ); ?>
<tr>
<td colspan="2">
<?php
echo '<hr>';
echo '<h4 style="margin:0; padding:0; font-size:14px;">' . __( 'Wholesale Minimum Order Quantity' , 'woocommerce-wholesale-prices-premium' ) . '</h4>';
echo '<p style="margin:0; padding:0;">' . __( "Minimum number of items to be purchased in order to avail this product's wholesale price.<br/>Only applies to wholesale users." , 'woocommerce-wholesale-prices-premium' ) . '</p>';
?>
</td>
</tr>
<?php foreach ( $registeredCustomRoles as $roleKey => $role ) { ?>
<tr>
<td colspan="2">
<?php woocommerce_wp_text_input(
array(
'id' => $roleKey . '_wholesale_minimum_order_quantity[' . $loop . ']',
'label' => __( $role['roleName'] , 'woocommerce-wholesale-prices-premium' ),
'placeholder' => '',
'desc_tip' => 'true',
'description' => __( 'Only applies to users with the role of "' . $role['roleName'] . '"' , 'woocommerce-wholesale-prices-premium' ),
'value' => isset( $variable_product_meta[ $roleKey . '_wholesale_minimum_order_quantity' ][ 0 ] ) ? $variable_product_meta[ $roleKey . '_wholesale_minimum_order_quantity' ][ 0 ] : ''
)
); ?>
</td>
</tr>
<?php }
} | [
"function wc_qty_add_product_field() {\n\techo '<div class=\"options_group\">';\n\twoocommerce_wp_text_input( \n\t\tarray( \n\t\t\t'id' => '_wc_min_qty_product', \n\t\t\t'label' => __( 'Minimum Quantity', 'woocommerce-max-quantity' ), \n\t\t\t'placeholder' => '',\n\t\t\t'desc_tip' => 'true',\n\t\t\t'description' => __( 'Optional. Set a minimum quantity limit allowed per order. Enter a number, 1 or greater.', 'woocommerce-max-quantity' ) \n\t\t)\n\t);\n\techo '</div>';\n\techo '<div class=\"options_group\">';\n\twoocommerce_wp_text_input( \n\t\tarray( \n\t\t\t'id' => '_wc_max_qty_product', \n\t\t\t'label' => __( 'Maximum Quantity', 'woocommerce-max-quantity' ), \n\t\t\t'placeholder' => '',\n\t\t\t'desc_tip' => 'true',\n\t\t\t'description' => __( 'Optional. Set a maximum quantity limit allowed per order. Enter a number, 1 or greater.', 'woocommerce-max-quantity' ) \n\t\t)\n\t);\n\techo '</div>';\t\n}",
"function wc_qty_add_product_field() {\n\n\techo '<div class=\"options_group\">';\n\twoocommerce_wp_text_input( \n\t\tarray( \n\t\t\t'id' => '_wc_min_qty_product', \n\t\t\t'label' => __( 'Minimum Quantity', 'woocommerce-max-quantity' ), \n\t\t\t'placeholder' => '',\n\t\t\t'desc_tip' => 'true',\n\t\t\t'description' => __( 'Optional. Set a minimum quantity limit allowed per order. Enter a number, 1 or greater.', 'woocommerce-max-quantity' ) \n\t\t)\n\t);\n\techo '</div>';\n\n\techo '<div class=\"options_group\">';\n\twoocommerce_wp_text_input( \n\t\tarray( \n\t\t\t'id' => '_wc_max_qty_product', \n\t\t\t'label' => __( 'Maximum Quantity', 'woocommerce-max-quantity' ), \n\t\t\t'placeholder' => '',\n\t\t\t'desc_tip' => 'true',\n\t\t\t'description' => __( 'Optional. Set a maximum quantity limit allowed per order. Enter a number, 1 or greater.', 'woocommerce-max-quantity' ) \n\t\t)\n\t);\n\techo '</div>';\t\n}",
"public function add_minimum_order_quantity_fields() {\n\n $registered_wholesale_roles = $this->_wwpp_wholesale_roles->getAllRegisteredWholesaleRoles();\n global $woocommerce, $post; ?>\n\n <div class=\"wholesale-minium-order-quantity-options-group options-group options_group\">\n\n <header>\n <h3 style=\"padding-bottom: 10px;\"><?php _e( 'Wholesale Minimum Order Quantity' , 'woocommerce-wholesale-prices-premium' ); ?></h3>\n <p style=\"margin:0; padding:0 12px; line-height: 16px; font-style: italic; font-size: 13px;\"><?php _e( \"Minimum number of items to be purchased in order to avail this product's wholesale price.<br/>Only applies to wholesale users.\" , 'woocommerce-wholesale-prices-premium' ); ?></p>\n </header>\n\n <?php foreach ( $registered_wholesale_roles as $role_key => $role ) {\n\n woocommerce_wp_text_input( array(\n 'id' => $role_key . '_wholesale_minimum_order_quantity',\n 'class' => $role_key . '_wholesale_minimum_order_quantity wholesale_minimum_order_quantity short',\n 'label' => $role[ 'roleName' ],\n 'placeholder' => '',\n 'desc_tip' => 'true',\n 'description' => sprintf( __( 'Only applies to users with the role of \"%1$s\"' , 'woocommerce-wholesale-prices-premium' ) , $role[ 'roleName' ] ),\n 'data_type' => 'decimal'\n ) );\n\n } ?>\n\n </div><!--.options_group-->\n\n <?php\n\n }",
"public function saveVariableProductMinimumOrderQuantityCustomField ( $post_id , $registeredCustomRoles ) {\r\n\r\n global $_POST;\r\n\r\n if ( isset( $_POST[ 'variable_sku' ] ) ) {\r\n\r\n $variable_post_id = $_POST[ 'variable_post_id' ];\r\n $max_loop = max( array_keys( $variable_post_id ) );\r\n\r\n foreach ( $registeredCustomRoles as $roleKey => $role ) {\r\n\r\n $wholesaleMOQ = $_POST[ $roleKey . '_wholesale_minimum_order_quantity' ];\r\n\r\n for ( $i = 0; $i <= $max_loop; $i++ ){\r\n\r\n if ( !isset( $variable_post_id[ $i ] ) )\r\n continue;\r\n\r\n $variation_id = (int) $variable_post_id[ $i ];\r\n\r\n if ( isset( $wholesaleMOQ[ $i ] ) ) {\r\n\r\n $wholesaleMOQ[ $i ] = trim( esc_attr( $wholesaleMOQ[ $i ] ) );\r\n\r\n if ( !empty( $wholesaleMOQ[ $i ] ) ) {\r\n\r\n if( !is_numeric( $wholesaleMOQ[ $i ] ) )\r\n $wholesaleMOQ[ $i ] = '';\r\n elseif( $wholesaleMOQ[ $i ] < 0 )\r\n $wholesaleMOQ[ $i ] = 0;\r\n else\r\n $wholesaleMOQ[ $i ] = wc_format_decimal( $wholesaleMOQ[ $i ] );\r\n\r\n $wholesaleMOQ[ $i ] = round( $wholesaleMOQ[ $i ] );\r\n\r\n }\r\n\r\n $wholesaleMOQ[ $i ] = wc_clean( apply_filters( 'wwpp_filter_before_save_wholesale_minimum_order_quantity' , $wholesaleMOQ[ $i ] , $roleKey , $variation_id , 'variation' ) );\r\n update_post_meta( $variation_id , $roleKey . '_wholesale_minimum_order_quantity' , $wholesaleMOQ[ $i ] );\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }",
"private function _add_wholesale_minimum_order_quantity_field_on_quick_edit_screen( $field_title , $field_name , $place_holder = \"\" ) {\n ?>\n\n <label class=\"alignleft\" style=\"width: 100%;\">\n <div class=\"title\"><?php echo $field_title; ?></div>\n <input type=\"text\" name=\"<?php echo $field_name; ?>\" class=\"text wholesale_minimum_order_quantity wc_input_decimal\" placeholder=\"<?php echo $place_holder; ?>\" value=\"\">\n </label>\n\n <?php\n }",
"function ovr_woocommerce_quantity_input_args( $args, $product ) {\r\n\tif($product->id == 95547 || $product->id == 65021){\r\n\t\t$args['min_value'] = 1;\r\n\t\t$args['max_value'] = 1;\r\n\t}\r\n\r\n\treturn $args;\r\n}",
"function add_quantity($product) {\n $quantity = $product['products_quantity'];\n $this->add_if_not_empty('g:quantity', $quantity);\n }",
"public function setMinQty($minQty);",
"function custom_woocommerce_quantity_input_args( $args ) {\nif ( is_singular( 'product' ) ) {\n $args['input_value'] = 0;\n}\nreturn $args;\n}",
"public function set_order_quantity_attribute_values( $args , $product ) {\n\n if ( is_null( $product ) )\n $product = $GLOBALS[ 'product' ];\n \n $user_wholesale_role = $this->_wwpp_wholesale_roles->getUserWholesaleRole();\n $filtered_args = $args;\n\n // Make sure its not on cart and checkout page\n if ( !empty( $user_wholesale_role ) && !is_cart() && !is_checkout() ) {\n\n // No need for variable product, we don't need it be applied on a price range\n // We need it to be applied per variation for variable products\n\n $product_id = WWP_Helper_Functions::wwp_get_product_id( $product );\n $product_type = WWP_Helper_Functions::wwp_get_product_type( $product ); \n\n if ( $product_id && $product_type !== \"variable\" ) {\n\n $price_arr = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop_v2( $product_id , $user_wholesale_role );\n $wholesale_price = $price_arr[ 'wholesale_price' ];\n \n if ( $wholesale_price ) {\n\n $minimum_order_qty = get_post_meta( $product_id , $user_wholesale_role[ 0 ] . \"_wholesale_minimum_order_quantity\" , true );\n\n if ( $minimum_order_qty ) {\n\n // Have minimum order quty\n $filtered_args[ 'input_value' ] = $minimum_order_qty;\n $filtered_args[ 'min_value' ] = 1;\n\n $order_qty_step = get_post_meta( $product_id , $user_wholesale_role[ 0 ] . \"_wholesale_order_quantity_step\" , true );\n\n if ( $order_qty_step ) {\n\n /**\n * Step will require min qty to be set. If step is set, but min is not, step will be voided.\n * \n * Ok explanation as to why doing this.\n * \n * HTML 5 have this behavior for number fields.\n * -> If step value is greater or equal than input value, it will base off of min value\n * ----> Ex. min : 1 , value : 10 , step : 10 , if you click up arrow key once, the value becomes 11, not 20, coz 1 ( min ) + 10 ( step ) = 11\n * -> If step value is less than the input value, it will base off of input value\n * ----> Ex. min : 1 , value : 10 , step : 9 , if you click up arrow key once, the value becomes 19, not 10, coz 10 ( input value ) + 9 ( step ) = 19\n * \n * So to resolve this unexpected behavior, we either set min as blank or value of zero.\n * Setting min as blank will allow them to order quantity less than and equal zero. ( but ordering qty less than zero will not add item to cart ).\n * Setting min as zero allows them to order quantity with value of zero ( but it will only add 1 qty of this product to cart, this is similar to shop page, where you can add item without specifying the qty ).\n * Setting the min to the min we set however will solve this issue.\n * \n * Setting value of min to zero or blank will still not allow them to order lower than min qty anyways, that is not within the step multiplier.\n * \n * So setting step will prevent wholesale customers from buying lower than min qty.\n */\n\n $filtered_args[ 'step' ] = $order_qty_step;\n $filtered_args[ 'min_value' ] = $minimum_order_qty;\n\n }\n\n }\n\n }\n\n }\n\n }\n\n return apply_filters( 'wwpp_filter_set_product_quantity_value_to_minimum_order_quantity' , $filtered_args , $args , $product , $user_wholesale_role );\n \n }",
"function wc_qty_input_args( $args, $product ) {\n\t\n\t$product_id = $product->get_parent_id() ? $product->get_parent_id() : $product->get_id();\n\t\n\t$product_min = wc_get_product_min_limit( $product_id );\n\t$product_max = wc_get_product_max_limit( $product_id );\t\n\n\tif ( ! empty( $product_min ) ) {\n\t\t// min is empty\n\t\tif ( false !== $product_min ) {\n\t\t\t$args['min_value'] = $product_min;\n\t\t}\n\t}\n\n\tif ( ! empty( $product_max ) ) {\n\t\t// max is empty\n\t\tif ( false !== $product_max ) {\n\t\t\t$args['max_value'] = $product_max;\n\t\t}\n\t}\n\n\tif ( $product->managing_stock() && ! $product->backorders_allowed() ) {\n\t\t$stock = $product->get_stock_quantity();\n\n\t\t$args['max_value'] = min( $stock, $args['max_value'] );\t\n\t}\n\n\treturn $args;\n}",
"public function getMinQuantity();",
"public function display_product_quantity_input( $default ){\n\t\tif( $this->min_purchase_quantity > 0 ){ $default = $this->min_purchase_quantity; }\n\t\t\n\t\techo \"<input type=\\\"number\\\" value=\\\"\" . $default . \"\\\" name=\\\"product_quantity\\\" id=\\\"product_quantity_\" . $this->model_number . \"\\\" class=\\\"product_quantity_input\\\" />\";\n\t}",
"public function minQuantity()\n {\n if($this->infoModel && $this->infoModel->quantity < 1)\n $this->addError('info', Yii::t('theme', 'Product is not available anymore.'));\n }",
"function wc_qty_save_product_field( $post_id ) {\n\t$val_min = trim( get_post_meta( $post_id, '_wc_min_qty_product', true ) );\n\t$new_min = sanitize_text_field( $_POST['_wc_min_qty_product'] );\n\t$val_max = trim( get_post_meta( $post_id, '_wc_max_qty_product', true ) );\n\t$new_max = sanitize_text_field( $_POST['_wc_max_qty_product'] );\n\t\n\tif ( $val_min != $new_min ) {\n\t\tupdate_post_meta( $post_id, '_wc_min_qty_product', $new_min );\n\t}\n\tif ( $val_max != $new_max ) {\n\t\tupdate_post_meta( $post_id, '_wc_max_qty_product', $new_max );\n\t}\n}",
"public function getMinQty();",
"public function getMinimumQuantity();",
"function etheme_woocommerce_before_add_to_cart_quantity($style='') {\n $element_option = ( $style != '' ) ? $style : Kirki::get_option( 'product_quantity_style_et-desktop' );\n $element_option = apply_filters('product_quantity_style', $element_option);\n $ghost = is_customize_preview() && $element_option == 'none';\n // start of wrapper to make quantity correct showing ?>\n <div class=\"quantity-wrapper type-<?php echo $element_option; ?>\">\n <?php if ( $element_option != 'none' || $ghost ) : ?>\n <span class=\"minus et-icon et_b-icon <?php echo ($ghost) ? 'none' : ''; ?>\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\".7em\" height=\".7em\" viewBox=\"0 0 24 24\">\n <path d=\"M23.52 11.4h-23.040c-0.264 0-0.48 0.216-0.48 0.48v0.24c0 0.264 0.216 0.48 0.48 0.48h23.040c0.264 0 0.48-0.216 0.48-0.48v-0.24c0-0.264-0.216-0.48-0.48-0.48z\"></path>\n </svg>\n </span>\n <?php endif;\n unset($element_option);\n }",
"function ib_change_qty_available_variation_args( $data, $product, $variation ) {\n\n\tif ( ! ( is_cart() || is_product() ) ) {\n\t\treturn $data;\n\t}\n\n\t$data['max_qty'] = 9;\n\t$args['max_value'] = 9;\n\n\treturn $data;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test data created with Python scipy.spatial.distance.jensenshannon distance.jensenshannon(p, q) | public function dataProviderForJensenShannon(): array
{
return [
[
[0.4, 0.6],
[0.5, 0.5],
0.07112938864483229,
],
[
[0.1, 0.2, 0.2, 0.2, 0.2, 0.1],
[0.0, 0.1, 0.4, 0.4, 0.1, 0.0],
0.346820456568833
],
[
[0.25, 0.5, 0.25],
[0.5, 0.3, 0.2],
0.18778369857844396,
],
[
[0.5, 0.3, 0.2],
[0.25, 0.5, 0.25],
0.18778369857844396,
],
];
} | [
"public function testJHashDistribution()\n {\n $counts = [0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0, 7=>0, 8=>0, 9=>0];\n $i = 0;\n $max = 2000000;\n while ($i<$max) {\n $shard = jchash($i, 10);\n $counts[$shard]++;\n $i++;\n }\n $expected = $max/10;\n $delta= .001;\n foreach ($counts as $key => $count) {\n $this->assertTrue((($count/$expected)-1) < $delta);\n }\n }",
"function QDSimilarityVector($queryFinal,$TfIdf,$tokeIndex,$qVector,$N){\r\n\t$QDsimilarity = array_fill(1,$N,0);\r\n\tfor($i=0;$i<count($queryFinal);$i++){\r\n\t\t$token = $TfIdf[$queryFinal[$i]];\r\n\t\t//find document index and add the partial values from dot product\r\n\t\tforeach($token as $key => $value){\r\n\t\t\tif($key > 0 && $key<=$N){\r\n\t\t\t\t$QDsimilarity[$key] = $QDsimilarity[$key]+$value*$qVector[$tokeIndex[$queryFinal[$i]]];\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn $QDsimilarity;\r\n}",
"public static function ephem (\n $date,\n $what,\n $params=[\n 'compute-houses' => false, \n ],\n ) {\n // \n // build argument list, depending on this function's arguments\n //\n $args = '';\n // date time\n [$day, $time] = explode(' ', $date);\n $tmp = explode('-', $day);\n $sweDay = $tmp[2] . '.' . $tmp[1] . '.' . $tmp[0];\n $args .= ' -b' . $sweDay . ' -ut' . $time; // ex -b15.12.2016 -ut14:19:55\n // planets\n $args .= ' -p'; // ex -p023C1456789FGIHABmt\n foreach($what as $planet){\n $args .= Swetest::MATCH_ARG_PLANETS[$planet];\n }\n // houses\n if($params['compute-houses']){\n $domificationSystem = Swetest::MATCH_ARG_DOMIFICATION[$params['domification-system']];\n $args .= ' -house' . $params['lg'] . ',' . $params['lat'] . ',' . $domificationSystem; // ex -house12.05,49.50,P\n }\n // ephemeris dir\n $args .= ' -edir' . Swetest::$SWEDIR;\n // output\n $args .= ' -head'; // no header\n $args .= ' -fPl'; // echo name and longitude\n //\n // execute swiss ephem\n //\n $cmd = self::$SWEBIN . $args;\n exec($cmd, $output);\n//echo \"\\n\"; print_r(self::$SWEBIN . $args); echo \"\\n\";\n//echo \"\\n<pre>\"; print_r($output); echo \"</pre>\\n\";\n //\n // Parse the output and fill returned array\n //\n $res = [\n ];\n // pattern for a line containing one coordinate\n $p1 = '/^(.*?)(-?\\d+\\.\\d+)\\s*$/';\n foreach($output as $line){\n preg_match($p1, $line, $matches);\n if(count($matches) == 3){\n $code = trim($matches[1]);\n if(isset(Swetest::MATCH_OUTPUT_PLANETS[$code])){\n $object = Swetest::MATCH_OUTPUT_PLANETS[$code];\n $res[$object] = $matches[2];\n }\n else if(isset(Swetest::MATCH_OUTPUT_HOUSES[$code])){\n $object = Swetest::MATCH_OUTPUT_HOUSES[$code];\n $res[$object] = $matches[2];\n }\n }\n }\n return $res;\n }",
"private function splice_site_distance() {\n $this->record_progress(\n \"Step 5: Computing splice site distances\");\n\n $path_new_input = $this->path_new_input;\n $path_intronic = ($this->working_directory_path).\"/intronic\";\n $path_intronic_borders = \n ($this->working_directory_path).\"/intronic_borders\";\n $path_ss_dist = $this->path_ss_dist;\n\n $read_new_input = fopen($path_new_input, \"r\");\n $write_intronic = fopen($path_intronic, \"w\");\n\n while (! feof($read_new_input)) {\n $line_new_input = fgets($read_new_input);\n $line_new_input = str_replace(\"\\n\", \"\", $line_new_input);\n $line_array = explode(\"\\t\", $line_new_input);\n $distance = 0;\n $splice_site = \"_\";\n if (count($line_array) > 24) {\n $chromosome = $line_array[0];\n $mutant_loc = intval($line_array[5]);\n $start_loc = intval($line_array[9]);\n $end_loc = intval($line_array[10]);\n $strand = $line_array[14];\n $variant_type = $line_array[23];\n $left_dist = $mutant_loc - $start_loc + 1;\n $right_dist = $end_loc - $start_loc + 1;\n if ($variant_type == \"intronic_variant\") {\n // For intronic variants, records positions to a file to\n // be processed to find the corresponding exons.\n $left_exon_end_loc = $start_loc - 1;\n $right_exon_start_loc = $end_loc + 1;\n $left_line = $chromosome.\"\\t\".($left_exon_end_loc - 1).\n \"\\t\".$left_exon_end_loc.\"\\t\".$mutant_loc.\"\\n\";\n fwrite($write_intronic, $left_line);\n $right_line = $chromosome.\"\\t\".$right_exon_start_loc.\n \"\\t\".($right_exon_start_loc + 1).\"\\t\".$mutant_loc.\"\\n\";\n fwrite($write_intronic, $right_line);\n\n }\n }\n }\n\n fclose($read_new_input);\n fclose($write_intronic);\n\n exec(\"bedtools intersect -wao\\\n -a '$path_intronic'\\\n -b /var/www/html/spliceman_beta/genome_data/reformatted_coding_exons.txt\\\n > '$path_intronic_borders'\",\n $bedtools_array,\n $return);\n \n if ($return) {\n if (count($bedtools_array) - 1 == 0) {\n $this->pipeline_error(\n \"Your file did not have any mutations that we were able \n to process. Is your file correctly formatted with one \n line per mutation?\");\n }\n $this->pipeline_error(\n \"Error in pipeline, please contact administrator and provide \n step 5\");\n }\n\n $read_new_input = fopen($path_new_input, \"r\");\n $read_intronic_borders = fopen($path_intronic_borders, \"r\");\n $write_ss_dist = fopen($path_ss_dist, \"w\");\n\n if (feof($read_intronic_borders)) {\n $line_intronic_borders = \"\";\n } else {\n $line_intronic_borders = fgets($read_intronic_borders);\n }\n\n while (! feof($read_new_input)) {\n $line_new_input = fgets($read_new_input);\n $line_new_input = str_replace(\"\\n\", \"\", $line_new_input);\n $array_new_input = explode(\"\\t\", $line_new_input);\n if (count($array_new_input) > 24) {\n $chromosome = $array_new_input[0];\n $mutant_loc = intval($array_new_input[5]);\n $start_loc = intval($array_new_input[9]);\n $end_loc = intval($array_new_input[10]);\n $strand = $array_new_input[14];\n $variant_type = $array_new_input[23];\n $left_dist = $mutant_loc - $start_loc + 1;\n $right_dist = $end_loc - $start_loc + 1;\n if ($variant_type == \"exonic_variant\") {\n // For exonic variants, calculates the distance and writes\n // it to an intermediate file.\n if ($left_dist <= $right_dist) {\n $distance = $left_dist;\n $splice_site = ($strand == \"+\" ? \"5'\" : \"3'\");\n } else {\n $distance = $right_dist;\n $splice_site = ($strand == \"+\" ? \"3'\" : \"5'\");\n }\n } else {\n // If an intron, iterates through the border data to find\n // an exon that borders it. Then, computes the distance\n // between\n $found = false;\n while ((! $found) and (! feof($read_intronic_borders))) {\n $array_intronic_borders = \n explode(\"\\t\", $line_intronic_borders);\n if ($start_loc - 1 == $array_intronic_borders[2]) {\n $distance = $left_dist;\n $splice_site = ($strand == \"+\" ? \"5'\" : \"3'\");\n $found = true;\n } elseif ($end_loc + 1 == $array_intronic_borders[1]) {\n $distance = $right_dist;\n $splice_site = ($strand == \"+\" ? \"3'\" : \"5'\");\n $found = false;\n } else {\n if (feof($read_intronic_borders)) {\n $line_intronic_borders = \"\";\n } else {\n $line_intronic_borders = fgets($read_intronic_borders);\n }\n }\n }\n }\n array_push($array_new_input, $distance);\n array_push($array_new_input, $splice_site);\n $new_line = implode(\"\\t\", $array_new_input).\"\\n\";\n fwrite($write_ss_dist, $new_line);\n }\n }\n fclose($read_new_input);\n fclose($read_intronic_borders);\n fclose($write_ss_dist);\n }",
"public function dataProviderForCosineSimilarity(): array\n {\n return [\n [\n [1, 2, 3],\n [3, 2, 1],\n 0.7142857142857143,\n ],\n [\n [1, 0, 0],\n [0, 1, 0],\n 0,\n ],\n [\n [1, 0, 0],\n [0, 0, 1],\n 0,\n ],\n [\n [1, 0, 0],\n [1, 0, 0],\n 1,\n ],\n [\n [100, 0, 0],\n [0, 1, 0],\n 0,\n ],\n [\n [1, 1, 0],\n [0, 1, 0],\n 0.7071067811865475,\n ],\n [\n [1, 1, 1],\n [1, 1, 1],\n 1,\n ],\n [\n [2, 2, 2],\n [2, 2, 2],\n 1,\n ],\n [\n [1, 1, 1],\n [2, 2, 2],\n 1,\n ],\n [\n [56, 26, 83],\n [11, 82, 95],\n 0.8159342590749833,\n ],\n [\n [-1, 1, 0],\n [0, 1, -1],\n 0.5,\n ],\n [\n [23, 41, 33],\n [31, 56, 21],\n 0.9567820320723087,\n ],\n ];\n }",
"function qnorm($p, $mu, $sigma)\n{\n if ($p < 0 || $p > 1)\n {\n echo \"The probality p must be bigger than 0 and smaller than 1\";\n }\n if ($sigma < 0)\n {\n echo \"The standard deviation $sigma must be positive\";\n }\n\n if ($p == 0)\n {\n return -Infinity;\n }\n if ($p == 1)\n {\n return Infinity;\n }\n if ($sigma == 0)\n {\n return $mu;\n }\n\n $q = $p - 0.5;\n\n /*-- use AS 241 --- */\n /* double ppnd16_(double *p, long *ifault)*/\n /* ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3\n\n Produces the normal deviate Z corresponding to a given lower\n tail area of P; Z is accurate to about 1 part in 10**16.\n */\n if (abs($q) <= .425)\n {/* 0.075 <= $p <= 0.925 */\n $r = .180625 - $q * $q;\n $val =\n $q * ((((((($r * 2509.0809287301226727 +\n 33430.575583588128105) * $r + 67265.770927008700853) * $r +\n 45921.953931549871457) * $r + 13731.693765509461125) * $r +\n 1971.5909503065514427) * $r + 133.14166789178437745) * $r +\n 3.387132872796366608)\n / ((((((($r * 5226.495278852854561 +\n 28729.085735721942674) * $r + 39307.89580009271061) * $r +\n 21213.794301586595867) * $r + 5394.1960214247511077) * $r +\n 687.1870074920579083) * $r + 42.313330701600911252) * $r + 1);\n }\n else\n { /* closer than 0.075 from {0,1} boundary */\n\n /* $r = min($p, 1-$p) < 0.075 */\n if ($q > 0)\n $r = 1 - $p;\n else\n $r = $p;\n\n $r = sqrt(-log($r));\n /* $r = sqrt(-log($r)) <==> min($p, 1-$p) = exp( - $r^2 ) */\n\n if ($r <= 5)\n { /* <==> min($p,1-$p) >= exp(-25) ~= 1.3888e-11 */\n $r += -1.6;\n $val = ((((((($r * 7.7454501427834140764e-4 +\n .0227238449892691845833) * $r + .24178072517745061177) *\n $r + 1.27045825245236838258) * $r +\n 3.64784832476320460504) * $r + 5.7694972214606914055) *\n $r + 4.6303378461565452959) * $r +\n 1.42343711074968357734)\n / ((((((($r *\n 1.05075007164441684324e-9 + 5.475938084995344946e-4) *\n $r + .0151986665636164571966) * $r +\n .14810397642748007459) * $r + .68976733498510000455) *\n $r + 1.6763848301838038494) * $r +\n 2.05319162663775882187) * $r + 1);\n }\n else\n { /* very close to 0 or 1 */\n $r += -5;\n $val = ((((((($r * 2.01033439929228813265e-7 +\n 2.71155556874348757815e-5) * $r +\n .0012426609473880784386) * $r + .026532189526576123093) *\n $r + .29656057182850489123) * $r +\n 1.7848265399172913358) * $r + 5.4637849111641143699) *\n $r + 6.6579046435011037772)\n / ((((((($r *\n 2.04426310338993978564e-15 + 1.4215117583164458887e-7) *\n $r + 1.8463183175100546818e-5) * $r +\n 7.868691311456132591e-4) * $r + .0148753612908506148525)\n * $r + .13692988092273580531) * $r +\n .59983220655588793769) * $r + 1);\n }\n\n if ($q < 0.0)\n {\n $val = -$val;\n }\n }\n\n return $mu + $sigma * $val;\n}",
"function jaccard(array $a, array $b): float\n{\n return 1 - Similarity\\kumarHassebrook($a, $b);\n}",
"public function dataProviderForSVD(): array\n {\n return [\n [\n [\n [1, 0, 0, 0, 2],\n [0, 0, 3, 0, 0],\n [0, 0, 0, 0, 0],\n [0, 2, 0, 0, 0],\n ],\n [ // Technically, the order of the diagonal elements can be in any order\n 'S' => [\n [3, 0, 0, 0, 0],\n [0, sqrt(5), 0, 0, 0],\n [0, 0, 2, 0, 0],\n [0, 0, 0, 0, 0],\n ],\n ],\n ],\n [\n [\n [8, -6, 2],\n [-6, 7, -4],\n [2, -4, -3],\n ],\n [\n 'S' => [\n [14.528807, 0, 0],\n [0, 4.404176, 0],\n [0, 0, 1.875369],\n ],\n ],\n ],\n [\n [\n [1, 2],\n [3, 4],\n [5, 6],\n ],\n [\n 'S' => [\n [9.52551809, 0],\n [0, 0.51430058],\n [0, 0],\n ],\n ],\n ],\n [\n [[3]],\n [\n 'S' => [[3]],\n ],\n ],\n [\n [[0]],\n [\n 'S' => [[0]],\n ],\n ],\n [\n [[1]],\n [\n 'S' => [[1]],\n ],\n ],\n [\n [\n [1, 2, 3],\n [4, 5, 6],\n [7, 8, 9],\n ],\n [\n 'S' => [\n [1.684810e+01, 0, 0],\n [0, 1.068370e+00, 0],\n [0, 0, 4.418425e-16],\n ],\n ],\n ],\n [\n [\n [2, 2, 2],\n [2, 2, 2],\n [2, 2, 2],\n ],\n [\n 'S' => [\n [6, 0, 0],\n [0, 0, 0],\n [0, 0, 0],\n ],\n ],\n ],\n [\n [\n [-2, -2, -2],\n [-2, -2, -2],\n [-2, -2, -2],\n ],\n [\n 'S' => [\n [6, 0, 0],\n [0, 0, 0],\n [0, 0, 0],\n ],\n ],\n ],\n [\n [\n [1, 2, 3],\n [0, 4, 5],\n [0, 0, 6],\n ],\n [\n 'S' => [\n [9.0125424, 0, 0],\n [0, 2.9974695, 0],\n [0, 0, 0.8884012],\n ],\n ],\n ],\n [\n [\n [1, 0, 0],\n [2, 3, 0],\n [4, 5, 6],\n ],\n [\n 'S' => [\n [9.2000960, 0, 0],\n [0, 2.3843001, 0],\n [0, 0, 0.8205768],\n ],\n ],\n ],\n // Singular\n [\n [\n [1, 0],\n [0, 0],\n ],\n [\n 'S' => [\n [1, 0],\n [0, 0],\n ],\n ],\n ],\n // Singular\n [\n [\n [1, 0, 1],\n [0, 1, -1],\n [0, 0, 0],\n ],\n [\n 'S' => [\n [1.732051, 0, 0],\n [0, 1.000000, 0],\n [0, 0, 0.0],\n ],\n ],\n ],\n // Idempotent\n [\n [\n [1, 0, 0],\n [0, 0, 0],\n [0, 0, 1],\n ],\n [\n 'S' => [\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 0],\n ],\n ],\n ],\n // Idempotent\n [\n [\n [2, -2, -4],\n [-1, 3, 4],\n [1, -2, -3],\n ],\n [\n 'S' => [\n [7.937254, 0, 0],\n [0, 1, 0],\n [0, 0, 2.198569e-17],\n ],\n ],\n ],\n // Floating point\n [\n [\n [2.5, 6.3, 9.1],\n [-1.4, 3.0, 4.45],\n [1.01, 8.5, -3.334],\n ],\n [\n 'S' => [\n [12.786005, 0, 0],\n [0, 8.663327, 0],\n [0, 0, 2.315812],\n ],\n ],\n ],\n ];\n }",
"function clustering($data, $centroid){ \r\n\r\n // echo \"<br><br>\";\r\n // echo\"Centroid<br>\";\r\n // print_r(json_encode($centroid));\r\n // echo \"<br><br>\";\r\n\r\n\r\n // Menghutung jarak setiap data mapel siswa dengan centroid yang telah ditentukan -\r\n // lalu jarak tersebut di simpan kedalan variable $jarak_centroid.\r\n foreach($data as $row_m_data => $m_data){ \r\n foreach($centroid as $row_m_centroid => $m_centroid){\r\n // mendefinisikan jarak awal seelum perhitungan setiap data = 0\r\n // agar tidak terjadi salah perhitungan pada looping berikutnya.\r\n $jarak_centroid[$row_m_data][$row_m_centroid] = 0.0;\r\n $jarak = 0.0;\r\n // echo \"sqrt(\";\r\n foreach($m_centroid as $row_single_centroid => $single_centroid){\r\n $single_data = $m_data[$row_single_centroid];\r\n $jarak += pow(($single_data - $single_centroid), 2);\r\n // echo\"(($single_data - $single_centroid)^ 2) [$jarak] + \";\r\n }\r\n // echo \")\";\r\n $hasil = round(sqrt($jarak),2);\r\n $jarak_centroid[$row_m_data][$row_m_centroid] = $hasil;\r\n // echo \"= \" . $hasil. \"<br>\";\r\n }\r\n // echo\"<br><br>\";\r\n }\r\n\r\n // Setelah melakukan perhitungan jarak, maka ditentukan lah jarak terdekat dari - \r\n // setiap data dengan setiap centroid.\r\n // jarak rata rata data dari setiap nilai siswa yang paling dekat dengan centroid -\r\n // yang ada akan di simpan ke dalam var new_centroid lalu di kembalikan kedalam\r\n // variable yang memanggil fungsi clustering().\r\n foreach($jarak_centroid as $m_jarak){ // Menghitung jarak terdekat\r\n $nearest_cluster[] = array_search(min($m_jarak), $m_jarak);\r\n }\r\n\r\n // echo \"<br><br>\";\r\n // echo\"new centroid<br>\";\r\n // print_r(json_encode($new_centroid));\r\n // echo \"<br><br>\";\r\n\r\n return $nearest_cluster;\r\n}",
"public function calculate_fitness(){\n\t\t//empty fitness array\t\t\n\t\t$this->fitness = array();\n\t\t$this->types = array(0,0,0,0);\n\t\t$best_fitness = 0;\n\t\t\n\t\tmysql_connect(\"localhost\",$this->username,$this->password);\n\t\t@mysql_select_db($this->database) or die( \"Unable to select database\");\n\t\t\n\t\t//First, we fetch all the offsprings,\n\t\tforeach($this->indivs as $key=>$indiv){\t\t\t\n\t\t\t\n\t\t\t$query = \"SELECT * from $this->table\".\"_antigate\".\" where geno_id=$key\";\n\t\t\t$result = mysql_query($query);\n\t\t\tif (!$result) {\n\t\t\t echo \"Could not successfully run query 12 ($query) from DB: \" . mysql_error();\n\t\t\t exit;\n\t\t\t}\n\t\t\t\n\t\t\t$acc_fitness = array();\n\t\t\t$acc_answer = array();\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\n\t\t\t\t//first, add the user study info to our indivs\n\t\t\t\t$indiv->addAnswers($row['captcha_text'], $row['mturk_answer'], $row['antigate_answer']);\n\t\t\t\t\n\t\t\t\t//first element is Mturk, second element is antigate\n\t\t\t\t$tmp_arr = array();\n\t\t\t\tarray_push($tmp_arr, strtolower($row['mturk_answer']), strtolower($row['antigate_answer']), strtolower($row['captcha_text']));\n\t\t\t\tarray_push($acc_answer, $tmp_arr);\n\t\t\t\t\n\t\t\t\t$fit = levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"antigate_answer\"]));\n\t\t\t\tarray_push($acc_fitness, $fit);\n\t\t\t\t\n\t\t\t\t//record the diff types of answers we get\n\t\t\t\tif (levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"]))== 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) ==0 ){\n\t\t\t\t\t$this->types[0]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) > 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) ==0 ){\n\t\t\t\t\t$this->types[1]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) == 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) > 0 ){\n\t\t\t\t\t$this->types[2]++;\n\t\t\t\t}elseif(levenshtein(strtolower($row[\"mturk_answer\"]), strtolower($row[\"captcha_text\"])) > 0 &&\n\t\t\t\t\tlevenshtein(strtolower($row[\"antigate_answer\"]), strtolower($row[\"captcha_text\"])) > 0 ){\n\t\t\t\t\t$this->types[3]++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$average_fit = array_sum($acc_fitness)/sizeof($acc_fitness);\n\t\t\t$consistency = 1 + levenshtein($acc_answer[0][0], $acc_answer[1][0]) +\n\t\t\t\t\t\t\tlevenshtein($acc_answer[0][1], $acc_answer[1][1]);\n\t\t\t\n\t\t\t$ease_factor = 1.0;\n\t\t\tif ((levenshtein($acc_answer[0][0], $acc_answer[0][2])==0 &&\n\t\t\t\tlevenshtein($acc_answer[1][0], $acc_answer[1][2])==0) ||\n\t\t\t\t(levenshtein($acc_answer[0][1], $acc_answer[0][2])==0 &&\n\t\t\t\tlevenshtein($acc_answer[1][1], $acc_answer[1][2])==0)){\n\t\t\t\t$ease_factor = 1.2;\n\t\t\t}\n\t\t\t\n\t\t\t$hard_factor = 1.0;\n\t\t\tif ((levenshtein($acc_answer[0][0], $acc_answer[0][2])>0 &&\n\t\t\t\tlevenshtein($acc_answer[1][0], $acc_answer[1][2])>0) ||\n\t\t\t\t(levenshtein($acc_answer[0][1], $acc_answer[0][2])>0 &&\n\t\t\t\tlevenshtein($acc_answer[1][1], $acc_answer[1][2])>0)){\n\t\t\t\t$hard_factor = 0.6;\n\t\t\t}\n\t\t\t\n\t\t\t$cur_fitness = ($average_fit/$consistency) * $ease_factor * $hard_factor;\n\t\t\t\n\t\t\t$best_fitness = ($cur_fitness > $best_fitness) ? $cur_fitness : $best_fitness;\n\t\t\n\t\t\tarray_push($this->fitness, $cur_fitness);\n\t\t\t\n\t\t\t\n\t\t\t//echo \"Trial #1: Mturk answer: \".(string)$acc_answer[0][0].\", Antigate answer: \".(string)$acc_answer[0][1].\", Text:\".(string)$acc_answer[0][2].\"\\n\";\n\t\t\t//echo \"Trial #2: Mturk answer: \".(string)$acc_answer[1][0].\", Antigate answer: \".(string)$acc_answer[1][1].\", Text: \".(string)$acc_answer[1][2].\"\\n\";\n\t\t\t//echo \"Ease factor is $ease_factor, hard factor is $hard_factor, average fit is $average_fit, consistency is $consistency, fit is $cur_fitness\\n\\n\\n\";\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->average_fit = array_sum($this->fitness)/ sizeof($this->fitness);\n\t\t$this->max_fit = $best_fitness;\n\t\t\n\t\t//after fitness is calculated, we want to clean the table with user data\n\t\t$query = \"TRUNCATE $this->table\".\"_antigate\";\n\t\t$results = mysql_query($query);\n\t\tif (!$results){\n\t\t\tdie('Invalid query 9: ' . mysql_error());\n\t\t}\n\t\tmysql_close();\n\t\t\n\t\t\n\t}",
"function gmp_hamdist($a, $b) {}",
"function stats_rand_gen_chisquare($df)\n{\n}",
"function gen_128()\r\n{\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $a = rand(1,9);\r\n $c = rand(2,9);\r\n $b = rand(1,$c-1);\r\n $d = rand(1,12);\r\n reduce($b,$c,12);\r\n rand_switch_sign($d,3);\r\n $numerator = $a * $c - $b;\r\n $denominator = $d * $c;\r\n if ($numerator < 0 && $denominator < 0)\r\n {\r\n $numerator = $numerator * (-1);\r\n $denominator = $denominator * (-1);\r\n }\r\n else if ($numerator > 0 && $denominator < 0)\r\n {\r\n $numerator = $numerator * (-1);\r\n $denominator = $denominator * (-1);\r\n }\r\n reduce($numerator,$denominator,175);\r\n if ($numerator == 0)\r\n {\r\n $numerator = \"no solution\";\r\n $denominator = 1;\r\n }\r\n if ($d < 0)\r\n {\r\n $RHS = \"-\";\r\n $d = $d * (-1);\r\n }\r\n else\r\n {\r\n $RHS = \"+\";\r\n }\r\n $question = $a.\"/x\".\"=\".$b.\"/(\".$c.\"x)\".$RHS.$d;\r\n if($denominator!=1)\r\n $numerator=$numerator.\"/\".$denominator;\r\n $answer = array($question,$numerator,1,0,0,0);\r\n return $answer;\r\n}",
"function dsigmaNew($varLoc,$piLoc){\n\t$resPath=fopen(\"C:/vhosts/pfe/result/dsigma.txt\",\"w\");\n\t$varMax=maxMatrix($varLoc);\n\t$piMax=maxMatrix($piLoc);\n\t$dif=1000;\n\t$result = array(-1,-1);\n\t$maxLine=nbLine($varLoc);\t\n\t$maxCol=nbCharacter($varLoc);\t\n\t$openVar=fopen($varLoc,\"r\") or exit (\"Cant access to varMatrix\");\n\t$openPi=fopen($piLoc,\"r\") or exit (\"Cant access to piMatrix\");\n\t\n\tfor ($i=0;$i<$maxLine;$i++){\n\t\t$dataVar=trim(fgets($openVar,5000));\n\t\t$dataPi=trim(fgets($openPi,5000));\n\t\t$elementsPi=explode(\" \",$dataPi);\n\t\t$elementsVar=explode(\" \",$dataVar);\n\t\tfor ($j=0;$j<$maxCol;$j++){\t\t\t\n\t\t\tif (($elementsPi[$j] >= $piMax)&&($elementsVar[$j] >= $varMax)){\n\t\t\t\tfwrite($resPath,$i.\" \".($j+2).\"\\n\");\n\t\t\t\tif (($elementsVar[$j]-$varMax)<$dif){\n\t\t\t\t\t$result = array ($i,$j+2);\n\t\t\t\t\t$dif=$elementsVar[$j]-$varMax;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n//\techo \"final: $result[0], $result[1] <br />\";\n\treturn $result;\n}",
"public function testdis(){\r\n\t\techo round($this->getDistance(28.5549868, 77.084482999, 28.6526756, 77.1931225, \"K\")) . \" Kilometers<br>\";\r\n\t\t//echo $this->getDistance(32.9697, -96.80322, 29.46786, -98.53506, \"N\") . \" Nautical Miles<br>\";\r\n\t}",
"function spoints( $long, $lat, $meters, $n, $offset = 0 ) {\n\t# constant to convert to radians\n\t$RAD = pi() / 180.0;\n\t# Mean Radius of Earth, meters\n\t$MR = 6378.1 * 1000.0;\n\t$offsetRadians = $offset * $RAD;\n\t# compute longitude degrees (in radians) at given latitude\n\t$r = ( $meters / ($MR * cos($lat * $RAD)) );\n\n\t$vec = toCart( $long * $RAD, $lat * $RAD );\n\t$pt = toCart( $long * $RAD + $r, $lat * $RAD );\n\t$pts = array();\n\n\tfor( $i = 0; $i < $n; $i++ ) {\n\t\t$pts[] = toEarth( rotPoint($vec, $pt, $offsetRadians + (2.0 * pi() / $n) * $i) );\n\t}\n\n\t# connect to starting point exactly\n\t# not sure if required, but seems to help when\n\t# the polygon is not filled\n\t$pts[] = $pts[0];\n\treturn $pts;\n}",
"public function knn($debug=false){\n\t\t$cluster = $this->cluster_final;\n\t\t$sentimen = $this->use['sentimen'];\n\t\t$pusat = $this->pusat;\n\t\t$bobot = $this->bobot;\n\n\n\t\t$positif = 0;\n\t\t$negatif = 0;\n\t\tforeach($this->cluster_final as $c){\n\t\t\tif($c <> 0){\n\t\t\t\tif($sentimen[$c] == 1){\n\t\t\t\t\t$positif++;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$negatif++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($debug){\n\t\t\techo \"\n\t\t\t<span class='label label-success'>Data positif : $positif</span>\n\t\t\t<span class='label label-danger'>Data negatif : $negatif</span>\n\t\t\t<br>\n\t\t\t\";\n\t\t}\n\n\t\t//jalan tengah\n\t\t//kalau selisih data positif dan negatif tidak lebih dari 6.66%, maka KNN baru dijalankan untuk mencari tetangga terdekat\n\t\t//selebihnya, sentimen kebanyakan dalam sebuah cluster seharusnya sudah mewakili.\n\t\t$total_coba = $positif + $negatif;\n\t\t$selisih_coba = abs($positif - $negatif);\n\t\tif($selisih_coba < ($total_coba / 15)){\n\n\t\t\t//Metode K-NN ditentukan di baris ini.\n\t\t\t$jarak = array();\n\t\t\tforeach($cluster as $c){\n\t\t\t\t//jadikan data uji sebagai pusat data\n\t\t\t\tif($c == 0){\n\t\t\t\t\t$pusat = $bobot[$c];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$jarak[$c] = abs($pusat-$bobot[$c]);\n\t\t\t\tif($debug)\n\t\t\t\t\techo \"Jarak <strong>K-$c</strong> ke pusat data = \".$pusat.\" - \".$bobot[$c].\" = <strong>\".$jarak[$c].\"</strong><br>\";\n\t\t\t}\n\n\t\t\tif(count($jarak) > 0){\n\t\t\t\t//nggak ada data apapun di cluster tersebut\n\t\t\t\t$jarak_min = array_keys($jarak, min($jarak));\n\t\t\t\t$hasil = $sentimen[$jarak_min[0]];\n\n\t\t\t\tif($hasil==0)\n\t\t\t\t\t$cl = \"danger\";\n\t\t\t\telse\n\t\t\t\t\t$cl = \"success\";\n\n\t\t\t\t$dbug_text = \"Sentimen ditentukan berdasarkan jarak terdekat yaitu di <span class='label label-$cl'>K-\".$jarak_min[0].\"</span><br>\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$hasil = -1;\n\t\t\t\t$dbug_text = \"Tidak ada data apapun yang dapat dijadikan dasar penentuan sentimen.\";\n\t\t\t}\n\n\t\t}\n\t\telse{\n\t\t\tif($positif > $negatif)\n\t\t\t\t$hasil = 1;\n\t\t\telse\n\t\t\t\t$hasil = 0;\n\n\t\t\tif($positif == 0 and $negatif == 0){\n\t\t\t\t$hasil = -1;\n\t\t\t}\n\t\t\t$dbug_text = \"Metode KNN tidak dijalankan karena mengikuti sentimen terbanyak di cluster tersebut\";\n\t\t}\n\n\n\t\tif($debug){\n\t\t\techo $dbug_text;\n\t\t}\n\t\treturn intval($hasil);\n\t}",
"function cosim($q, $d){\n\t\n\t$arrQ = $q->A;\n\t$arrD = $d->A;\n\t//cari dot(Q,D)\n\t$dot = 0;\n\tfor($i=0;$i<count($arrQ[0]);$i++)\n\t{\n\t\t$dot = ($arrQ[0][$i] * $arrD[0][$i]) + $dot;\n\t}\n\t\n\t//echo $dot.\"<br>\";\n\t//cari ||d1||\n\t$abxQ=0;\n\tfor($i=0;$i<count($arrQ[0]);$i++)\n\t{\n\t\t$abxQ = ($arrQ[0][$i] * $arrQ[0][$i]) + $abxQ;\n\t}\n\t$sqAbxQ = sqrt($abxQ);\n\t//echo $sqAbxQ.\"<br>\";\n\t$abxD=0;\n\tfor($i=0;$i<count($arrD[0]);$i++)\n\t{\n\t\t$abxD = ($arrD[0][$i] * $arrD[0][$i]) + $abxD;\n\t}\n\t$sqAbxD = sqrt($abxD);\n\t\n\t//echo $sqAbxQ.\"<br>\";\n\t$cosim = $dot / ($sqAbxQ*$sqAbxD);\n\treturn $cosim;\n\t\n\n}",
"public function test_distance_from_reykjavik_london() {\n\n\t\t$p1 = self::factory()->post->create( array( \n\t\t\t'post_title' => 'London',\n\t\t) );\n\t\tadd_post_meta( $p1, 'my_lat', '51.509865' );\n\t\tadd_post_meta( $p1, 'my_lng', '-0.118092' );\n\n\t\t$args = array(\n\t\t \t'post_type' => 'post', \n\t\t \t'posts_per_page' => 10,\n\t\t \t'ignore_sticky_posts' => true,\n\t\t \t'orderby' => array( 'title' => 'DESC' ),\t\t \n\t\t\t'geo_query' => array(\n\t\t\t\t'lat' => 64.128288, // Latitude point\n\t\t \t\t'lng' => -21.827774, // Longitude point\n\t\t \t'lat_meta_key' => 'my_lat', // Meta-key for the latitude data\n\t\t \t'lng_meta_key' => 'my_lng', // Meta-key for the longitude data \n\t\t \t'radius' => 5000, // Find locations within a given radius (km)\n\t\t \t'order' => 'DESC', // Order by distance\n\t\t \t'distance_unit' => 111.045, // Default distance unit (km per degree). Use 69.0 for statute miles per degree.\n\t\t \t'context' => '\\\\Birgir\\\\Geo\\\\GeoQueryHaversine', // Default implementation, you can use your own here instead.\n \t\t),\n\t\t);\n\t\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertSame( 1, count( $query->posts ) );\n\t\t$this->assertSame( 'London', $query->posts[0]->post_title );\n\t\t$this->assertSame( 1881 , (int) $query->posts[0]->distance_value );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns if we should disable the cleanup which happens after forking | public function getDisableForkCleanup() : bool {
return $this->_disableForkCleanup;
} | [
"public static function isForked(): bool { }",
"public function OnEndForking();",
"function isforkSupported()\n{\n if (isPcntlForkAllowed()) {\n if (pcntlForkTest()->Left()) {\n return true;\n }\n }\n return false;\n}",
"public function isFork(): bool\n {\n return $this->isFork;\n }",
"public function isShutdown() {}",
"private function _cleanup() {\n\t\t@fclose($this->stdin);\n\t\t@fclose($this->stdout);\n\t\t@fclose($this->stderr);\n\t\t@proc_terminate($this->process, 15); // 15 = SIGTERM / request shutdown\n\t\tusleep(300 * 1000); // 300ms\n\t\t@proc_terminate($this->process, 9); // 9 = SIGKILL / terminate\n\t\t@proc_close($this->process);\n\t}",
"private function havePcntlFork()\n\t{\n\t\t$return = false;\n\t\t\n\t\tif(function_exists('pcntl_fork'))\n\t\t{\n\t\t\t$return = true;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}",
"public function __destruct()\n {\n $this->cleanSemiShutdown();\n }",
"public function isShutdown(){}",
"function wait_for_kids(){\n global $active_kids;\n \n $pid = pcntl_waitpid(-1,$status);\n if($pid == -1){ \n # This shouldn't ever happen...\n die(\"ERROR: There was a serious forking error.\\n\\n\");\n } else { \n # A child exited, so remove it from the list of running children.\n unset($active_kids[$pid]);\n }\n return(1);\n}",
"protected function childCleanup() {\n }",
"public static function checkIfChildRunning()\n {\n foreach (static::$_pidMap as $worker_id => $worker_pid_array) {\n foreach ($worker_pid_array as $pid => $worker_pid) {\n if (!\\posix_kill($pid, 0)) {\n unset(static::$_pidMap[$worker_id][$pid]);\n }\n }\n }\n }",
"public function isTerminated() {}",
"public function shutdown()\n {\n $this->worker->log('No child to kill');\n }",
"public function shutdown()\n {\n $this->worker->logger->log(LogLevel::INFO, 'No child to kill.');\n }",
"public static function checkIfChildRunning()\n {\n foreach (static::$pidMap as $workerId => $workerPidArray) {\n foreach ($workerPidArray as $pid => $workerPid) {\n if (!\\posix_kill($pid, 0)) {\n unset(static::$pidMap[$workerId][$pid]);\n }\n }\n }\n }",
"public static function checkIfChildRunning()\n {\n foreach (static::$pidMap as $workerId => $workerPidArray) {\n foreach ($workerPidArray as $pid => $workerPid) {\n if (!posix_kill($pid, 0)) {\n unset(static::$pidMap[$workerId][$pid]);\n }\n }\n\n }\n }",
"abstract public function clearParentResourcesAfterFork();",
"protected function shouldRemoveBackgroundJob(): bool {\n\t\treturn $this->config->getSystemValueBool('has_internet_connection', true) === false ||\n\t\t\t$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') === '' ||\n\t\t\t$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') !== 'yes' ||\n\t\t\t$this->retries >= 5;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implementation of object_comments helper | function smarty_function_object_comments($params, &$smarty) {
AngieApplication::useWidget('select_attachments', FILE_UPLOADER_FRAMEWORK);
$object = array_required_var($params, 'object', true, 'IComments');
$user = array_required_var($params, 'user', true, 'IUser');
if(empty($params['id'])) {
$params['id'] = HTML::uniqueId('object_comments');
} // if
if(isset($params['class']) && $params['class']) {
$params['class'] .= ' object_comments';
} else {
$params['class'] = 'object_comments';
} // if
$interface = array_var($params, 'interface', AngieApplication::getPreferedInterface(), true);
// Default, web interface
if($interface == AngieApplication::INTERFACE_DEFAULT) {
AngieApplication::useWidget('object_comments', COMMENTS_FRAMEWORK);
$count = (integer) array_var($params, 'count', 5, true); // Number of recent comment that need to be loaded initially
$min_last_visit = new DateTimeValue(time() - 2592000); // 30 days...
$last_visit = $user->getLastVisitOn(true);
if($last_visit->getTimestamp() < $min_last_visit->getTimestamp()) {
$last_visit = $min_last_visit;
} // if
$total_comments = $object->comments()->count($user);
$new_comments_count = $total_comments ? $object->comments()->countSinceVisit($user, $last_visit) : 0;
if($new_comments_count && $count < $new_comments_count) {
$count = $new_comments_count + 1;
} // if
$options = array(
'total_comments' => $total_comments,
'comments_url' => $object->comments()->getUrl(),
'user_id' => $user->getId(),
'user_email' => $user->getEmail(),
);
$subscribers = $object->subscriptions()->get();
$options['object'] = array(
'id' => $object->getId(),
'class' => get_class($object),
'verbose_type' => $object->getVerboseType(false, $user->getLanguage()),
'verbose_type_lowercase' => $object->getVerboseType(true, $user->getLanguage()),
'permissions' => array('can_comment' => $object->comments()->canComment($user)),
'event_names' => array('updated' => $object->getUpdatedEventName(), 'deleted' => $object->getDeletedEventName()),
'is_locked' => $object->getIsLocked(),
'is_completed' => $object instanceof IComplete && $object->getCompletedOn() instanceof DateValue,
'subscribers' => $subscribers ? JSON::valueToMap($subscribers) : null,
'urls' => array(
'subscriptions' => $object->subscriptions()->getSubscriptionsUrl()
)
);
$current_request = $smarty->getVariable('request')->value;
$options['event_scope'] = $current_request->getEventScope();
if ($object instanceof ILabel) {
$options['object']['label']['id'] = $object->getLabelId();
} // if
if ($object instanceof ICategory) {
$options['object']['category']['id'] = $object->getCategoryId();
} // if
$options['comments'] = Comments::findForWidget($object, $user, 0 , 500);
if(empty($params['load_timestamp'])) {
$params['load_timestamp'] = time();
} // if
$result = HTML::openTag('div', $params);
$view = $smarty->createTemplate(get_view_path('_object_comment_form_row', null, COMMENTS_FRAMEWORK));
$view->assign(array(
'comment_parent' => $object,
'comment' => $object->comments()->newComment(),
'comments_id' => $params['id'],
'comment_data' => array(
'body' => null
),
'user' => $user,
));
$result .= $view->fetch();
return $result . '</div><script type="text/javascript">$("#' . $params['id'] . '").objectComments(' . JSON::encode($options) . ');</script>';
// Phone interface
} elseif($interface == AngieApplication::INTERFACE_PHONE) {
AngieApplication::useHelper('image_url', ENVIRONMENT_FRAMEWORK);
$options = array(
'comments' => array()
);
if($object->comments()->get($user)) {
foreach($object->comments()->get($user) as $comment) {
$options['comments'][] = $comment->describe($user, true, $interface);
} // if
} // if
$result = HTML::openTag('div', $params);
if(is_foreachable($options['comments'])) {
$result .= '<ul data-role="listview" data-inset="true" data-dividertheme="j" data-theme="p">
<li data-role="list-divider"><img src="' . smarty_function_image_url(array(
'name' => 'icons/listviews/navigate.png',
'module' => COMMENTS_FRAMEWORK,
'interface' => AngieApplication::INTERFACE_PHONE
), $smarty) . '" class="divider_icon" alt="">' . lang('Comments') . '</li>';
AngieApplication::useHelper('datetime', GLOBALIZATION_FRAMEWORK, 'modifier');
foreach($options['comments'] as $comment) {
$result .= '<li>
<img class="ui-li-icon" src=' . $comment['created_by']['avatar']['large'] . ' alt=""/>
<p class="comment_details ui-li-desc">By <a class="ui-link" href="' . $comment['created_by']['permalink'] . '">' . $comment['created_by']['short_display_name'] . '</a> on ' . smarty_modifier_datetime($comment['created_on']) . '</p>
<div class="comment_overflow ui-li-desc">' . nl2br($comment['body']) . '</div>';
if(is_foreachable($comment['attachments'])) {
foreach($comment['attachments'] as $attachment) {
$result .= '<div class="comment_attachment"><a href="' . $attachment['urls']['view'] . '" target="_blank"><img src="' . $attachment['preview']['icons']['large'] . '" /><span class="filename">' . $attachment['name'] . '</span></a></div>';
} // forech
} // if
$result .= '</li>';
} // foreach
$result .= '</ul>';
} // if
return $result . '</div><script type="text/javascript">$("div.comment_overflow").find("p img").css("max-width", "100%"); // fit comment images to screen</script>';
// Print interface
} elseif ($interface == AngieApplication::INTERFACE_PRINTER) {
$comments = $object->comments()->get($user);
AngieApplication::useHelper('date', GLOBALIZATION_FRAMEWORK, 'modifier');
AngieApplication::useHelper('object_attachments',ATTACHMENTS_FRAMEWORK);
if (is_foreachable($comments)) {
$result = '<div class="object_comments"><h2 class="comments_title">' . lang('Comments') . '</h2>';
$result .= '<table cellspacing="0">';
foreach ($comments as $comment) {
$result .= '<tr>';
$result .= '<td class="comment_avatar"><img src="' . $comment->getCreatedBy()->avatar()->getUrl(IUserAvatarImplementation::SIZE_BIG) . '"></td>';
$result .= '<td class="comment_body">';
$result .= '<div class="comment">';
$result .= '<img class="comment_background" src="' . AngieApplication::getImageUrl('layout/comment-background.png', COMMENTS_FRAMEWORK, AngieApplication::INTERFACE_PRINTER) . '" />';
$result .= '<div class="comment_details"><span class="comment_author">' . $comment->getCreatedBy()->getName(true) . '</span><span class="comment_date date">' . smarty_modifier_date($comment->getCreatedOn()) . '</span></div>';
$result .= '<div class="comment_body">' . HTML::toRichText($comment->getBody(), AngieApplication::INTERFACE_PRINTER) . smarty_function_object_attachments(array('object' => $comment, 'interface' => $interface, 'user' => $user), $smarty) . '</div>';
$result .= '</div>';
$result .= '</td>';
$result .= '</tr>';
}//foreach
$result.= '</table></div>';
} // if
return $result;
// Other interfaces
} else {
$options = array('comments' => null);
$comments = $object->comments()->get($user);
if($comments) {
$options['comments'] = array();
foreach($comments as $comment) {
$options['comments'][] = $comment->describe($user, true, $interface);
} // foreach
} // if
return HTML::openTag('div', $params) . '</div><script type="text/javascript">$("#' . $params['id'] . '").objectComments(' . JSON::encode($options, $user) . ');</script></div>';
} // if
} | [
"public function getCommentFor($oid)\n {\n }",
"public function comments() {\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('comments', 'core'));\n }",
"public function comments()\r\n\t{\r\n\t\treturn new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('comments', 'core'));\r\n\t}",
"public function comments()\n {\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('comments', 'core'));\n }",
"public function getComments();",
"public function isCommentable();",
"function create_comment($content) {}",
"public function fetchComments();",
"public function comments() {\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('comments', 'core'));\n }",
"public function comment ($comment) {}",
"private function requireComments () {\n // Comments\n $this->tieInDatabase (new\n A (Array (static::$objComment)));\n }",
"public function isComment() {}",
"public function isComment()\n {\n }",
"public function createComment ($data) {}",
"public function getCommentsForObject(Doctrine_Record $object, Doctrine_Query $q = null)\n {\n return $this->getCommentsForModelAndId(get_class($object), $object->getId(), $q);\n }",
"public function loadComments($object, $type = 'page')\n\t{\n\t\tif(db_parameter('COMMENTS_SYSTEM') == \"disqus\") \n\t\t{ \n\t\t\tapp('veer')->loadedComponents['comments_disqus'] = viewx('components.disqus', array(\"identifier\" => $type.$object->id));\n\t\t} \n\t\t\n\t\telse \n\t\t{\n\t\t\t$object->load('comments');\n\t\t\t\n\t\t\tapp('veer')->loadedComponents['comments_own'] = $object->comments->toArray();\n\t\t}\n\t}",
"private function getClassComment()\n {\n $comments = array();\n array_push($comments, 'This class stands for ' . $this->getPackagedName() . ' originally named ' . $this->getName());\n if ($this->getDocumentation() != '')\n array_push($comments, 'Documentation : ' . $this->getDocumentation());\n $this->addMetaComment($comments, false, true);\n if ($this->getInheritance() != '') {\n $inheritedModel = self::getModelByName($this->getInheritance());\n /**\n * A virtual struct exists only to store meta informations about itself\n * So don't add meta informations about a valid struct\n */\n if ($inheritedModel && !$inheritedModel->getIsStruct()) {\n $inheritedModel->addMetaComment($comments, false, false);\n }\n }\n array_push($comments, '@package ' . Generator::getPackageName());\n if (count($this->getDocSubPackages())) {\n array_push($comments, '@subpackage ' . implode(',', $this->getDocSubPackages()));\n }\n if (count(Generator::instance()->getOptionAddComments())) {\n foreach (Generator::instance()->getOptionAddComments() as $tagName => $tagValue) {\n array_push($comments, \"@$tagName $tagValue\");\n }\n }\n return $comments;\n }",
"function Studiorum_Side_Comments()\n\t{\n\n\t\t$Studiorum_Side_Comments = new Studiorum_Side_Comments;\n\n\t}",
"public function testCommentsList()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ setters Reads data from patients.json Updates data in stats/kidneycancer.json Is the function that sets historical points in the areachart To be called periodically | function annotate_meta_update_annotations ($current_annotations) {
$file = $_GLOBALS['config_global_webroot'] . "../data/stats/kidneycancer.json";
if (($stats = json_decode(file_get_contents($file))) != FALSE) {
while ((getdate()[0]*1000 - $stats->updated) >= 86400000) {
$new_time = $stats->updated + 86400000;
$new_status = new stdObject();
$new_status->month = getdate($new_time/1000)["mon"];
$new_status->day = getdate($new_time/1000)["mday"];
$new_status->etime = getdate($new_time/1000)[0]*1000;
$new_status->unannotated_images = $current_annotations["unannotated"];
$new_status->pending_annotations = $current_annotations["pending"];
$new_status->validated_annotations = $current_annotations["valid"];
$new_status->flagged_annotations = $current_annotations["flagged"];
array_push($stats->totals->progress, $new_status);
$stats->updated = $new_time;
}
file_put_contents($file,json_encode($stats));
}
else {
//echo "DAFUQ";
}
} | [
"public function sensorRecentReadings($sensorId, $datapoint)\n {\n $sensorDetail = Device::where('unique_id', '=', floatval($sensorId))->first();\n foreach($sensorDetail->data_points as $data_point){\n if($data_point['point'] == $datapoint){\n $minT = $data_point['minT'];\n $maxT = $data_point['maxT'];\n }\n }\n $reading = 0;\n //date_default_timezone_set(\"Europe/London\");\n $date = new DateTime(date(\"Y-m-d\"));\n $sensordataToday = array();\n $today = str_replace(\"+\",\".000+\", $date->format(DateTime::ATOM));\n $this_record = MongoSensorData::where('sensor_id', '=', floatval($sensorId))\n ->where('recordDay', '=', new DateTime($today))->first();\n\n if($this_record){\n $sensorDs = $this_record->dataSamples;\n for (end($sensorDs); key($sensorDs)!==null; prev($sensorDs)){\n $sensordata = current($sensorDs);\n // ...\n if(isset($sensordata[$datapoint])){\n $reading = $sensordata[$datapoint];\n //var_dump($reading);\n\n if($sensordata[$datapoint.'-minV'] == 1 || $sensordata[$datapoint.'-maxV'] == 1){\n $status = 'danger';\n }\n elseif($sensordata[$datapoint.'-minV'] == -1 || $sensordata[$datapoint.'-maxV'] == -1){\n $status = 'warning';\n }\n else{\n $status = 'success';\n }\n\n $min_T = $sensordata[$datapoint.'-minT'];\n $max_T = $sensordata[$datapoint.'-maxT'];\n }\n else{\n $reading = 0;\n $status = 'danger';\n $min_T = 0;\n $max_T = 0;\n }\n //var_dump($status);\n array_push($sensordataToday,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensorId,\n 'dateTime' => $sensordata['recordDate']->toDateTime()->format('Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => $status,\n 'min_threshold' => $min_T,\n 'max_threshold' => $max_T,\n 'n_min_violation' => 0,\n 'n_max_violation' => 0,\n\n )\n );\n\n if(key($sensorDs) == count($sensorDs) - 10)\n break;\n }\n }\n else{\n\n array_push($sensordataToday,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensorId,\n 'dateTime' => date('Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => 'danger',\n 'min_threshold' => isset($minT) ? $minT : 0,\n 'max_threshold' => isset($maxT) ? $maxT : 0,\n 'n_min_violation' => 0,\n 'n_max_violation' => 0,\n\n )\n );\n }\n\n\n\n\n\n\n\n $sensordataRecents = array();\n\n $sensorDRs = MongoSensorData::where('sensor_id', '=', floatval($sensorId))\n ->orderBy('recordDay', 'DESC')->take(10)->get();\n\n\n foreach($sensorDRs as $sensordata){\n $reading = $sensordata->$datapoint['average'];\n if($reading < $minT || $reading > $maxT){\n $status = 'danger';\n }\n elseif($reading == $minT || $reading == $maxT){\n $status = 'warning';\n }\n else{\n $status = 'success';\n }\n //var_dump(date_format(new DateTime($sensordata->recordDay), 'd-m-Y H:i:s'));\n //var_dump($sensordata->maxTime);\n //var_dump(date_format($sensordata->recordDay->toDateTime(), 'Y-m-d'));\n array_push($sensordataRecents,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensordata->sensorId,\n 'dateTime' => date_format($sensordata->recordDay->toDateTime(), 'Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => $status,\n 'min_threshold' => $minT,\n 'max_threshold' => $maxT,\n 'n_min_violation' => $sensordata->$datapoint['n-minV'],\n 'n_max_violation' => $sensordata->$datapoint['n-maxV'],\n )\n );\n //var_dump($sensordataRecents);\n\n }\n\n\n\n\n return response()->json(['today' => $sensordataToday, 'recents' => $sensordataRecents, 'reading' => $reading]);\n }",
"private function calculateAndPopulateData(): void\n {\n $manager = new AlgorithmManager;\n\n $this->algorithm = $manager->getFor($this->data->rater->data()->ageGroup, $this->data->meetings);\n\n // INFO: Get the expected treatment response (etr) for each meeting.\n $flattenMeeting = $this->algorithm->flattenMeeting;\n $maxMeetings = $this->algorithm->maxMeetings;\n $centeredAt20 = $this->data->firstRating->data()->score - 20;\n $interceptMean = $this->algorithm->interceptMean + ($this->algorithm->intake * $centeredAt20);\n $linearMean = $this->algorithm->linearMean + ($this->algorithm->linearByIntake * $centeredAt20);\n $quadraticMean = $this->algorithm->quadraticMean + ($this->algorithm->quadraticByIntake * $centeredAt20);\n $cubicMean = $this->algorithm->cubicMean + ($this->algorithm->cubicByIntake * $centeredAt20);\n $intercept = 1;\n\n // INFO: Make sure that the entire etr is always presented.\n if ($this->data->meetings < $maxMeetings) {\n $this->data->meetings = $maxMeetings;\n }\n\n // INFO: Add the intake session.\n $value = $this->data->firstRating->data()->score;\n $this->data->values[] = $value;\n $this->data->valuesAsString[] = number_format($value, 1);\n\n // INFO: Add the remaining values.\n for ($i = 1; $i < $this->data->meetings; $i++) {\n $meeting = $i;\n\n if ($meeting >= $flattenMeeting) {\n $meeting = $flattenMeeting;\n }\n\n $linear\t= $meeting;\n $quadratic = $linear * $linear;\n $cubic = $linear * $linear * $linear;\n $value = ($interceptMean * $intercept) + ($linearMean * $linear) + ($quadraticMean * $quadratic) + ($cubicMean * $cubic);\n\n $roundedValue = round($value, 1, PHP_ROUND_HALF_UP);\n $this->data->values[] = $roundedValue;\n $this->data->valuesAsString[] = number_format($roundedValue, 1);\n }\n }",
"public abstract function getNewMonitoringData();",
"function update_data(){\n\t\t//read from storage and populate our data container //\n\t\t$this->read_data();\n\t\t\n\t\t//read from data storage and provide a filter to extend/add datas //\n\t\t$json = apply_filters( \"abbey_author_profile_json_data\", $this->data );\n\n\t\t//if the data have been modified, update the storage //\n\t\tif( !$this->is_equal( $json, $this->data ) ) $this->add_data( $json );\n\t\t\n\t\t$this->data = $json; //update our data container with the most recent version //\n\n\t\treturn $this;\n\t\t\n\t}",
"public function immunizations_chart()\n {\n $this->layout = \"blank\";\n $this->loadModel(\"EncounterPointOfCare\");\n $patient_id = (isset($this->params['named']['patient_id'])) ? $this->params['named']['patient_id'] : \"\";\n\t\t$this->loadModel('PatientDemographic');\n\t\t$patient_info = $this->PatientDemographic->find('first', array(\n\t\t\t'fields' => 'dob', 'conditions' => array('patient_id' => $patient_id, 'dob !=' => ''), 'recursive' => -1\n\t\t));\n\t\tif(empty($patient_info)) \n\t\t\texit('Patient\\'s DOB should not be Empty');\n\t\t$dob_timestamp = __date(\"Y-m-d\",strtotime($patient_info['PatientDemographic']['dob']));\n\t\t$month_intervals = array(\n\t\t\t1 => array('month' => 'birth', 'label' => 'Birth'),\n\t\t\t2 => array('month' => array(1, 2), 'label' => '1 month'),\n\t\t\t3 => array('month' => array(2, 3), 'label' => '2 months'),\n\t\t\t4 => array('month' => array(4, 5), 'label' => '4 months'),\n\t\t\t5 => array('month' => array(6, 7), 'label' => '6 months'),\n\t\t\t6 => array('month' => array(12, 13), 'label' => '12 months'),\n\t\t\t7 => array('month' => array(15, 16), 'label' => '15 months'),\n\t\t\t8 => array('month' => array(18, 19), 'label' => '18 months'),\n\t\t\t9 => array('month' => array(19, 24), 'label' => '19-23 months'),\n\t\t\t10 => array('month' => array(24, 48), 'label' => '2-3 years'),\n\t\t\t11 => array('month' => array(48, 84), 'label' => '4-6 years'),\n\t\t\t12 => array('month' => array(84, 132), 'label' => '7-10 years'),\n\t\t\t13 => array('month' => array(132, 156), 'label' => '11-12 years'),\n\t\t\t14 => array('month' => array(156, 228), 'label' => '13-18 years'),\n\t\t);\n\t\tforeach($month_intervals as $key=>$month_interval)\n\t\t{\t\n\t\t\tif($month_interval['month']=='birth') {\n\t\t\t\t$month_intervals[$key]['schedule_time'] = __date(\"Y-m-d\", strtotime($dob_timestamp . \"+1 week\"));\n\t\t\t}\n\t\t\telse if(is_array($month_interval['month'])) {\n\t\t\t\t$month_intervals[$key]['schedule_time'][0] = __date(\"Y-m-d\", strtotime($dob_timestamp . \"+{$month_interval['month'][0]} month\"));\n\t\t\t\t$month_intervals[$key]['schedule_time'][1] = __date(\"Y-m-d\", strtotime($dob_timestamp . \"+{$month_interval['month'][1]} month\"));\n\t\t\t}\n\t\t}\n\t\t//pr($month_intervals);\n\t\t$immunizations = array(\n\t\tarray('label' => 'Hepatitis B', 'cvx_code' => array('08', 42, 43, 44, 45, 51, 104, 110), 'columns' => array(1, 2, 3, 5, 6, 7, 8, 12, 13, 14), 'highlight1' => array(2, 3, 5, 6, 7, 8,13), 'highlight2' => array(), 'highlight3' => array(14)),\n\t\tarray('label' => 'Rotavirus', 'cvx_code' => array(116, 119), 'columns' => array(3, 4, 5), 'highlight1' => array(), 'highlight2' => array(), 'highlight3' => array()),\n\t\tarray('label' => 'Diphtheria, Tetanus, Pertussis', 'cvx_code' => array(20, 50, 106, 110, 120, 130, 115), 'columns' => array(3, 4, 5, 7, 8, 11, 13, 14), 'highlight1' => array(7, 8, 11, 13), 'highlight2' => array(), 'highlight3' => array(14)),\n\t\tarray('label' => 'Haemophilus influenzae type b', 'cvx_code' => array(17, 46, 47, 48, 49), 'columns' => array(3, 4, 5, 6, 7), 'highlight1' => array(6, 7), 'highlight2' => array(), 'highlight3' => array()),\n\t\tarray('label' => 'Pneumococcal', 'cvx_code' => array(100, 133), 'columns' => array(3, 4, 5, 6, 7, 10, 11, 12, 13, 14), 'highlight1' => array(6, 7), 'highlight2' => array(10, 11), 'highlight3' => array()),\n\t\tarray('label' => 'Inactivated Poliovirus', 'cvx_code' => array(10, 110, 120, 130), 'columns' => array(3, 4, 5, 6, 7, 8, 11, 12, 13, 14), 'highlight1' => array(5,6,7,8,11), 'highlight2' => array(), 'highlight3' => array()),\n\t\tarray('label' => 'Influenza', 'cvx_code' => array(144, 140, 141, 16, 111, 135, 88), 'columns' => array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14), 'highlight1' => array(5,6,7,8,9,10,11,12,13,14), 'highlight2' => array(), 'highlight3' => array()),\n\t\tarray('label' => 'Measles, Mumps, Rubella', 'cvx_code' => array('03', '05', '06', '07'), 'columns' => array(6, 7, 11, 12, 13, 14), 'highlight1' => array(6,7,11), 'highlight2' => array(), 'highlight3' => array(12,13,14)),\n\t\tarray('label' => 'Varicella', 'cvx_code' => array(21), 'columns' => array(6, 7, 11, 12, 13, 14), 'highlight1' => array(6,7,11), 'highlight2' => array(), 'highlight3' => array(12,13,14)),\n\t\tarray('label' => 'Hepatitis A', 'cvx_code' => array(52, 83, 84, 85, 104), 'columns' => array(6, 7, 8, 9, 10, 11, 12, 13, 14), 'highlight1' => array(6,7,8,9), 'highlight2' => array(10, 11, 12, 13,14), 'highlight3' => array()),\n\t\tarray('label' => 'Meningococcal', 'cvx_code' => array(32, 114, 136), 'columns' => array(10, 11, 12, 13, 14), 'highlight1' => array(13), 'highlight2' => array(10, 11, 12), 'highlight3' => array(14)),\n\t\tarray('label' => 'Human Papillomavirus', 'cvx_code' => array(62, 118), 'columns' => array(13, 14), 'highlight1' => array(13), 'highlight2' => array(), 'highlight3' => array(14)),\n\t\t);\n\t\t$chart\t= array();\n\t\tforeach($immunizations as $immunization) {\t \n\t\t\t$data = $this->EncounterPointOfCare->getPatientImmu($patient_id, $immunization['cvx_code']);\n\t\t\t$dates = Set::extract('n/EncounterPointOfCare/vaccine_date_performed', $data); //pr($dates);\n\t\t\t$tmpChart = array();\n\t\t\tforeach($month_intervals as $key=>$month_interval) { \n\t\t\t\tif(in_array($key, $immunization['columns'])) {\n\t\t\t\t\tforeach($dates as $date) {\n\t\t\t\t\t\t$date1 = new DateTime($date);\n\t\t\t\t\t\tif($month_interval['month']=='birth') { \n\t\t\t\t\t\t\t$date2 = new DateTime($month_interval['schedule_time']);\n\t\t\t\t\t\t\t$interval = $date1->diff($date2);\n\t\t\t\t\t\t\tif($interval->y==0 && $interval->m==0 && $interval->d<=7) {\n\t\t\t\t\t\t\t\t$tmpChart[$key] = 'Valid';//pr($interval);\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(is_array($month_interval['month'])) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$firstDate1 = strtotime($month_interval['schedule_time'][0]);\n\t\t\t\t\t\t\t$firstDate2 = strtotime($month_interval['schedule_time'][1]);\n\t\t\t\t\t\t\t$checkDate = strtotime($date);\n\t\t\t\t\t\t\tif($checkDate >= $firstDate1 && $checkDate < $firstDate2) {\n\t\t\t\t\t\t\t\t$tmpChart[$key] = 'Valid';\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tif(!isset($tmpChart[$key])) {\n\t\t\t\t\t\t$tmpChart[$key] = 'Missing';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$tmpChart[$key] = 'blank';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$chart[] = array('label' => $immunization['label'], 'data' => $tmpChart, 'highlight1' => $immunization['highlight1'], 'highlight2' => $immunization['highlight2'], 'highlight3' => $immunization['highlight3']);\n\t\t}\n\t\t//pr($chart);\n\t\t$this->Set(compact('month_intervals', 'chart'));\n\t}",
"public function refreshData() {\n $clanData = APIFetcher::getClanDetails($this->clanId);\n $parser = new InfoParser($clanData);\n\n $this->clanInfo = $parser->getClanInfo();\n\n $this->clanMembers = array();\n $this->playerCount = $parser->getPlayerCount();\n for ($x = 0; $x < $this->playerCount; $x++) {\n array_push($this->clanMembers, $parser->getPlayer($x));\n }\n\n foreach ($this->clanMembers as $member) {\n array_push($this->clanMembersName, $member->name);\n }\n }",
"function charts()\n\t{\n\n\t\t$this->set('lfmlisteners',$this->Session->read('lfmlisteners'));\n\t\t$this->set('dt',$this->Session->read('dt'));\n\t\t\n\t}",
"protected function createStats()\n {\n $key = date('d/m/Y à h:i');\n foreach ($this->data as $k => $data) {\n $memory = 0;\n $peakMemory = 0;\n $cpuTime = 0;\n $waitTime = 0;\n\n foreach ($data as $method => $values) {\n $memory += $values['mu'];\n $peakMemory += $values['pmu'];\n $cpuTime += $values['cpu'];\n $waitTime += $values['wt'];\n }\n\n $this->stats[$k][$key] = array(\n 'date' => $key,\n 'memory' => $memory,\n 'peak_memory' => $peakMemory,\n 'cpu' => $cpuTime,\n 'wait' => $waitTime\n );\n }\n }",
"private function updateData() {\n if (!$this->tomorrowAvailable && ($this->db->isUpdatedWithin(REFRESH_RATE) === false)) {\n $data = file_get_contents(NORDPOOL_URL);\n $npData = json_decode($data);\n $npData = $npData->data;\n\n /* fetched data has 7 days of data available. Go it through and\n update any missing data points to the database */\n for ($i = 0; $i <= 7; $i++) {\n for ($hour = 0; $hour <= 23; $hour++) {\n $day = $npData->Rows[$hour]->Columns[$i]->Name;\n $price = $npData->Rows[$hour]->Columns[$i]->Value;\n $this->db->addValue($day, $hour, $price);\n }\n }\n // Update \"latest update\" field in the database\n $this->db->touchDatabase();\n }\n }",
"protected function createStats()\n {\n $key = date('d/m/Y à h:i');\n foreach ($this->data as $k => $data) {\n $this->stats[$k][$key] = array(\n 'date' => $key,\n 'count' => sizeof($data),\n );\n }\n }",
"protected function define_datapoints() {\n\n\t\t$defns= array();\n\t\t$order= 1;\n\n\t\t//note that anytime you make changes to the registers sampled you need to run\n\t\t//the check db ui to ensure database tables are in synch\n\n\n\t\t### THE LESS CHANGEABLE DEVICE STATS\n\t\t//these will only change occasionally, when cc is swapped, firmware upgraded etc\n\t\t//so we'll store them daily and call it good\n\n\t\t$defns['classic']= array(\n\t\t\t'name'=> \"Classic Unit Type\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'LSB([4101])',\n\t\t\t'comment'=> '(int) Classic 150=150,Classic 200=200, Classic 250=250, Classic 250KS=251',\n\t\t\t'priority'=> 3,\n\t\t\t'unit'=> '',\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['rev']= array(\n\t\t\t'name'=> \"Classic PCB Revision\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'MSB([4101])',\n\t\t\t'comment'=> '(int) 1-3',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['firmdate']= array(\n\t\t\t'name'=> \"Firmware Date\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> false, //lets stick to rev\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> \"'[4102]'.'-'.MSB([4103]).'-'.LSB([4103])\",\n\t\t\t'comment'=> '(isodate) year-month-day',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['firmver']= array(\n\t\t\t'name'=> \"Firmware Version\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> \"[16387]\", // \"BITS([16385],15,12).'.'.BITS([16385],11,8).'.'.BITS([16385],7,4)\",\n\t\t\t'comment'=> '',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['plifetime']= array(\n\t\t\t'name'=> \"Lifetime kWh\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '(([4127] << 16) + [4126])/ 10',\n\t\t\t'comment'=> '(decimal) kilowatt hours since new',\n\t\t\t'unit'=> 'kWh',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['uptime']= array(\n\t\t\t'name'=> \"Uptime\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'round((([4350]<< 16) + [4349])/60/60/24,2)',\n\t\t\t'comment'=> '(decimal) uptime in days, 2dp',\n\t\t\t'unit'=> 'days',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t#### REALTIME STATS OF INTEREST\n\n\t\t//CHARGE STAGE\n\t\t//the register is an integer, but not quite in linear order\n\t\t//hence we have 2 derived versions, one in english and one in linear order\n\t\t//Raw: 0=Resting,3=Absorb,4=BulkMppt,5=Float,6=FloatMppt,7=Equalize,10=HyperVoc,18=EqMppt\n\n\t\t$defns['stageword']= array(\n\t\t\t'name'=> \"Charge Stage\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'translate_stage',\n\t\t\t'argument'=> 'word',\n\t\t\t'comment'=> '(string) in english',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 1,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['stagelin']= array(\n\t\t\t'name'=> \"Charge Stage Lin\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'translate_stage',\n\t\t\t'argument'=> 'linear',\n\t\t\t'comment'=> '(int) in sequence',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 1,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['state']= array(\n\t\t\t'name'=> \"Charge Stage Raw\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'MSB([4120])',\n\t\t\t'comment'=> '(int)',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 4,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t//FLAGS\n\t\t//to save cluttering the db we will store the raw flag (in base10)\n\t\t//and include as many derived flag values as we need/want\n\t\t$defns['infoflags']= array(\n\t\t\t'name'=> \"Info Flags\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '(([4131] << 16) + [4130])',\n\t\t\t'comment'=> '(int) decimal rendition of hex flags',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 4,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//temp for netowrk fix\n\t\t$defns['debug5']= array(\n\t\t\t'name'=> \"Debug5\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '(([4387] << 16) + [4386])',\n\t\t\t'comment'=> '(int) decimal rendition of hex flags',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 4,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//TEMPS\n\t\t//the most interesting of which is tbat\n\t\t//also present are tfet and tpcb\n\t\t//we will assume that tfet is a good enough proxy for cc temp\n\n\t\t$defns['tbat']= array(\n\t\t\t'name'=> \"Battery Temp\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4132]/10',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> '°C',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['tcc']= array(\n\t\t\t'name'=> \"FET Temp\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4133]/10',\n\t\t\t'comment'=> '(decimal) fet',\n\t\t\t'unit'=> '°C',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['tcc2']= array(\n\t\t\t'name'=> \"PCB Temp\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> false, //ignored for now\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4134]/10',\n\t\t\t'comment'=> '(decimal) pcb',\n\t\t\t'priority'=> 2,\n\t\t\t'unit'=> '°C',\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t//VOLTS AND AMPS\n\t\t//pv volts and amps, battery volts and amps, and pout\n\t\t//theres one level of redundancy there, and, problematically they dont agree\n\t\t//but for now we will store them all, until someone can shed some light on this\n\t\t//just for kicks well track the pin/pout efficiency\n\n\t\t$defns['pout']= array(\n\t\t\t'name'=> \"Output Power\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4119]',\n\t\t\t'comment'=> '(int)',\n\t\t\t'unit'=> 'W',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['vout']= array(\n\t\t\t'name'=> \"Output Voltage\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4115]/10',\n\t\t\t'comment'=> '(decimal) cc output voltage at controller',\n\t\t\t'unit'=> 'V',\n\t\t\t'priority'=> 1,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['iout']= array(\n\t\t\t'name'=> \"Output Current\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4117]/10',\n\t\t\t'comment'=> '(decimal) cc output current',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//whizbang figures\n\t\t$defns['ibatraw']= array(\n\t\t\t'name'=> \"Whizbang Current Raw\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4371]',\n\t\t\t'comment'=> '(signed int) bat current',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['ibat']= array(\n\t\t\t'name'=> \"Whizbang Current\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'BITS([4371],15) ? (65536-[4371])/-10 : [4371]/10',\n\t\t\t'comment'=> '(decimal) +/- battery current, 1dp',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['soc']= array(\n\t\t\t'name'=> \"State of Charge\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4373]',\n\t\t\t'comment'=> '(int) battery SOC (0dp)',\n\t\t\t'unit'=> '%',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t$defns['iabsbat']= array(\n\t\t\t'name'=> \"Battery Current Abs\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'iabsbat',\n\t\t\t'comment'=> '(decimal) signless battery current',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['ichgbat']= array(\n\t\t\t'name'=> \"Battery Current Charge\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'ichgbat',\n\t\t\t'comment'=> '(decimal) signless battery current',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['idisbat']= array(\n\t\t\t'name'=> \"Battery Current Discharge\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'idisbat',\n\t\t\t'comment'=> '(decimal) signless battery current',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['batstate']= array(\n\t\t\t'name'=> \"Battery Current State\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'batstate',\n\t\t\t'comment'=> '(string) Charging/Discharging',\n\t\t\t'unit'=> '',\n\t\t\t'priority'=> 3,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['iload']= array(\n\t\t\t'name'=> \"Load Current\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'iload',\n\t\t\t'comment'=> '(decimal) load current, 1dp',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['pload']= array(\n\t\t\t'name'=> \"Load Power\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_load_data',\n\t\t\t'argument'=> 'pload',\n\t\t\t'comment'=> '(int)',\n\t\t\t'unit'=> 'W',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//pv array figures\n\t\t$defns['vpv']= array(\n\t\t\t'name'=> \"PV Voltage\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4116]/10',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'V',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['ipv']= array(\n\t\t\t'name'=> \"PV Current\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4121]/10',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['eff']= array(\n\t\t\t'name'=> \"Efficiency\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'calc_efficiency',\n\t\t\t'argument'=> 'cc',\n\t\t\t'comment'=> '(decimal) pin cf pout',\n\t\t\t'unit'=> '%',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t//DAY TO DATE\n\t\t//the classic tracks float time, and energy today\n\t\t//note that ftoday and ptoday will be garbage if the classic clock is wrong\n\t\t//we will add absorb time, bulk time, our own float time\n\t\t//we will also derive kWh in all three states.\n\t\t//for our derived versions well use the prefix dur for duration\n\n\n\t\t$defns['ftoday']= array(\n\t\t\t'name'=> \"Float Time Today\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4138]/3600',\n\t\t\t'comment'=> '(decimal) register seconds, converted to hours',\n\t\t\t'unit'=> 'hrs',\n\t\t\t'priority'=> 4,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['ptoday']= array(\n\t\t\t'name'=> \"kWh Today\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> '[4118]/10',\n\t\t\t'comment'=> '(decimal) ',\n\t\t\t'unit'=> 'kWh',\n\t\t\t'priority'=> 4,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['lastfloat']= array(\n\t\t\t'name'=> \"Days Since Float\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_days_since',\n\t\t\t'argument'=> 'float',\n\t\t\t'comment'=> '(int) days',\n\t\t\t'unit'=> 'days',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['durbulk']= array(\n\t\t\t'name'=> \"Time in bulk\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_duration',\n\t\t\t'argument'=> 'bulk',\n\t\t\t'comment'=> '(decimal) hours',\n\t\t\t'unit'=> 'hrs',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['durabsorb']= array(\n\t\t\t'name'=> \"Time in absorb\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_duration',\n\t\t\t'argument'=> 'absorb',\n\t\t\t'comment'=> '(decimal) hours',\n\t\t\t'unit'=> 'hrs',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['durfloat']= array(\n\t\t\t'name'=> \"Time in float\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_duration',\n\t\t\t'argument'=> 'float',\n\t\t\t'comment'=> '(decimal) hours, computed',\n\t\t\t'unit'=> 'hrs',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['whtotal']= array(\n\t\t\t'name'=> \"Wh total\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_sum',\n\t\t\t'argument'=> 'pout/total',\n\t\t\t'comment'=> '(decimal) ',\n\t\t\t'unit'=> 'Wh',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['whbulk']= array(\n\t\t\t'name'=> \"Wh in bulk\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> false,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_sum',\n\t\t\t'argument'=> 'pout/bulk',\n\t\t\t'comment'=> '(decimal) ',\n\t\t\t'unit'=> 'Wh',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['whabsorb']= array(\n\t\t\t'name'=> \"Wh in absorb\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_sum',\n\t\t\t'argument'=> 'pout/absorb',\n\t\t\t'comment'=> '(decimal) ',\n\t\t\t'unit'=> 'Wh',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['whfloat']= array(\n\t\t\t'name'=> \"Wh in float\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_sum',\n\t\t\t'argument'=> 'pout/float',\n\t\t\t'comment'=> '(decimal) ',\n\t\t\t'unit'=> 'Wh',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//WBjr dailys\n\t\t$defns['whload']= array(\n\t\t\t'name'=> \"Wh Load\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_wbjr_deriv',\n\t\t\t'argument'=> 'whload',\n\t\t\t'comment'=> '(decimal) load power, 0dp',\n\t\t\t'unit'=> 'Wh',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['ahcharge']= array(\n\t\t\t'name'=> \"Charge Amp Hrs\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_wbjr_deriv',\n\t\t\t'argument'=> 'ahcharge',\n\t\t\t'comment'=> '(decimal) amp hours into battery today, 1dp',\n\t\t\t'unit'=> 'Ah',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['ahdischarge']= array(\n\t\t\t'name'=> \"Discharge Amp Hrs\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_wbjr_deriv',\n\t\t\t'argument'=> 'ahdischarge',\n\t\t\t'comment'=> '(decimal) amp hours out of battery today, 1dp',\n\t\t\t'unit'=> 'Ah',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t//and the classics net amp hour counter.\n\t\t//its not really cear yet how this works, assuming it resets upon float\n\t\t//(4365,4366) WbJr. unsigned 32 bits Amp-Hours Positive Only Low,High\n\t\t//(4367,4368) WbJr. signed 32 bits Amp-Hours Negative Only Low,High\n\t\t//(4369 4370) WbJr. signed 32 bits Amp-Hours Positive AND Negative Low,High\n\t\t// '(([4370] << 16) + [4369])',\n\t\t//new localapp says net = -21 Ah\n\t\t//classic reads\n\t\t//4365 574 =dec 574\n\t\t//4366 0\n\t\t//4367 64941 =dec 595\n\t\t//4368 65535\n\t\t//4369 65515 =dec 21\n\t\t//4370 65535 =an entire byte for just the sign?\n\t\t//...then later net = 1 Ah\n\t\t//4369 1\n\t\t//4370 0\n\n\n\t\t//\t\t\t'argument'=> 'BITS([4371],15) ? (65536-[4371])/10 : [4371]/-10',\n\n\n\n\n\t\t$defns['ahnet']= array(\n\t\t\t'name'=> \"Whizbang Net Ah\",\n\t\t\t'type'=> 'sampled',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'periodic',\n\t\t\t'method'=> 'get_register',\n\t\t\t'argument'=> 'BITS([4369],15) ? -(65536-[4369]) : [4369]',\n\t\t\t'comment'=> '(decimal) 0dp',\n\t\t\t'unit'=> 'Ah',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\n\t\t//DAILY PEAKS AND DIPS\n\t\t//primarily we are interested in peak pout, peak iout, vbat high and low.\n\t\t//but im sure others will surface\n\n\t\t$defns['maxpout']= array(\n\t\t\t'name'=> \"Max power output\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_max',\n\t\t\t'argument'=> 'pout',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'W',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['maxiout']= array(\n\t\t\t'name'=> \"Max current output\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_max',\n\t\t\t'argument'=> 'iout',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'A',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['maxvbat']= array(\n\t\t\t'name'=> \"Max battery voltage\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_max',\n\t\t\t'argument'=> 'vout',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'V',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\t$defns['minvbat']= array(\n\t\t\t'name'=> \"Min battery voltage\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_min',\n\t\t\t'argument'=> 'vout',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> 'V',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['restvbat']= array(\n\t\t\t'name'=> \"Rest battery voltage\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_rest_voltage',\n\t\t\t'argument'=> '05:00', // time of day consistently prior to day time loads kicking in, and before sun comes up\n\t\t\t'comment'=> '(decimal) highest vbat between 0430 and 0500',\n\t\t\t'unit'=> 'V',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['minsoc']= array(\n\t\t\t'name'=> \"Min SOC\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_min',\n\t\t\t'argument'=> 'soc',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> '%',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\t\t$defns['maxsoc']= array(\n\t\t\t'name'=> \"Max SOC\",\n\t\t\t'type'=> 'derived',\n\t\t\t'store'=> true,\n\t\t\t'interval'=> 'day',\n\t\t\t'method'=> 'calc_daily_max',\n\t\t\t'argument'=> 'soc',\n\t\t\t'comment'=> '(decimal)',\n\t\t\t'unit'=> '%',\n\t\t\t'priority'=> 2,\n\t\t\t'order'=> $order++,\n\t\t);\n\n\t\treturn $defns;\n\t}",
"protected function getData()\n\t{\n\t\t// Get the data\n\t\t$this->data = $this->fillDates($this->startDate, $this->endDate, 'report_date', $this->hourly);\n\n\t\t// If there is no data, show empty\n\t\tif(empty($this->data)){\n\t\t\t// 0 everything\n\t\t\t$min_latency = '0';\n\t\t\t$max_latency = '0';\n\t\t\t$avg_latency = '0';\n\n\t\t\t// Set the start date as today\n\t\t\t$start = strtotime(date('Y-m-d')) * 1000;;\n\n\t\t}else{\n\t\t\t// Go through the data and add the latency\n\t\t\tforeach ($this->data as $data) {\n\t\t\t\t$min_latency[] = $data['min_latency'];\n\t\t\t\t$max_latency[] = $data['max_latency'];\n\t\t\t\t$avg_latency[] = $data['avg_latency'];\n\t\t\t}\n\n\t\t\t// Turn the array into a csv\n\t\t\t$min_latency = implode(\",\", $min_latency);\n\t\t\t$max_latency = implode(\",\", $max_latency);\n\t\t\t$avg_latency = implode(\",\", $avg_latency);\n\n\t\t\t$start = strtotime($this->startDate) * 1000;\n\t\t}\n\n\t\t$maxLatency = 120;\n\n\t\t$graph_interval = 3600000;\n\n\t\t// labels to be translated and passed into the chart\n\t\t$good = trans('admin.good');\n\t\t$reasonable = trans('admin.reasonable');\n\t\t$unacceptable = trans('admin.unacceptable');\n\t\t$latency_milliseconds = trans('admin.latency-in-milliseconds');\n\t\t$min_latency_label = trans('admin.min-latency');\n\t\t$avg_latency_label = trans('admin.avg-latency');\n\t\t$max_latency_label = trans('admin.max-latency');\n\n\t\t// TODO: pass three colours in and think about branding here!!\n\t\t$colours = array('#00adef', '#002433', '#79d0f2', '#daebf2', '#8899aa', '#333333', '#DDDDBB', '#DDCCAA', '#ADB7D8', '#7994F2', '#0079A8', '#3F4E7F', '#005566', '#004966');\n\n\t\techo <<<EOT\n\t{\n\t\t\"chart\": {\n\t\t\t\"spacingBottom\": 0,\n\t\t\t\"spacingTop\": 20,\n\t\t\t\"spacingLeft\": 0,\n\t\t\t\"spacingRight\": 0,\n\t\n\t\t\t\"width\": null,\n\t\t\t\"height\": null,\n\t\t\t\n\t\t\t\"zoomType\": \"x\",\n\t\t\t\"backgroundColor\": \"white\" },\n\t\t\"exporting\": { \"enabled\": false },\n\t\t\"title\": {\n\t\t\t\"text\": \"\" },\n\t\t\"xAxis\": {\n\t\t\t\"type\": \"datetime\",\n\t\t\t\"labels\": {\n\t\t\t\t\"overflow\": \"justify\",\n\t\t\t\t\"style\": {\"color\": \"white\"}\n\t\t\t},\n\t\t\t\"dateTimeLabelFormats\": {\n\t\t\t\t\"Hour\": \"%e %b\" },\n\t\t\t\"title\": {\n\t\t\t\t }\n\t\t},\n\t\t\"yAxis\": {\n\t\t\t\"title\": {\n\t\t\t\t\"text\": \"$latency_milliseconds\" ,\n\t\t\t\t\"style\": {\"color\": \"white\"}\n\t\t\t\t},\n\t\t\t\"valueSuffix\": \" Ms\",\n\t\t\t\"minorGridLineWidth\": \"0\",\n\t\t\t\"gridLineWidth\": \"0\",\n\t\t\t\"minPadding\": 0.05,\n\t\t\t\"maxPadding\": 0.10,\n\t\t\t\"startOnTick\": false,\n\t\t\t\"endOnTick\": false,\n\t\t\t\"min\": 0,\n\t\t\t\"max\": $maxLatency,\n\t\t\t\"labels\": {\n\t\t\t\t\"overflow\": \"justify\",\n\t\t\t\t\"style\": {\"color\": \"white\"}\n\t\t\t},\n\t\t\t\"plotBands\": [{\n\t\t\t\t\"from\": \"0\",\n\t\t\t\t\"to\": \"50\",\n\t\t\t\t\"color\": \"#eefaee\",\n\t\t\t\t\"label\": {\n\t\t\t\t\t\"text\": \"$good\",\n\t\t\t\t\t\"style\": {\"color\": \"#484471\"}\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\t\"from\": \"50\",\n\t\t\t\t\"to\": \"100\",\n\t\t\t\t\"color\": \"#fafaee\",\n\t\t\t\t\"label\": {\n\t\t\t\t\t\"text\": \"$reasonable\",\n\t\t\t\t\t\"style\": {\"color\": \"#484471\"}\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\t\"from\": 100,\n\t\t\t\t\"to\": 150,\n\t\t\t\t\"color\": \"#faeeee\",\n\t\t\t\t\"label\": {\n\t\t\t\t\t\"text\": \"$unacceptable\",\n\t\t\t\t\t\"style\": {\"color\": \"#484471\"}\n\t\t\t\t}\n\t\t\t}]\n\t\t},\n\t\t\"tooltip\": {\n\t\t\t\"shared\": true,\n\t\t\t\"xDateFormat\": \"%e %b %Y\" },\n\t\t\"legend\": {\n\t\t\t\"itemStyle\": {\n\t\t\t\t\"color\": \"white\",\n\t\t\t\t\"font-weight\":\"normal\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\"plotOptions\": {\n\t\t\t\"areaspline\": {\n\t\t\t\t\"lineWidth\": 1,\n\t\t\t\t\"marker\": { \"enabled\": false },\n\t\t\t\t\"shadow\": false,\n\t\t\t\t\"states\": { \"hover\": { \"lineWidth\": 1 } },\n\t\t\t\t\"threshold\": 0,\n\t\t\t\t\"pointInterval\": $graph_interval,\n\t\t\t\t\"pointStart\": $start,\n\t\t\t\t\"tooltip\": {\n\t\t\t\t\t\"valueSuffix\": \" Ms\" } } },\n\t\t\"series\": [{\n\t\t\t\"type\": \"areaspline\",\n\t\t\t\"name\": \"$min_latency_label\",\n\t\t\t\"data\": [$min_latency],\n\t\t\t\"color\": \"$colours[0]\",\n\t\t\t\"fillColor\": {\n\t\t\t\t\"linearGradient\": { \"x1\": 0, \"y1\": 0, \"x2\": 0, \"y2\": 1},\n\t\t\t\t\"stops\": [\n\t\t\t\t\t[0, \"$colours[0]\"],\n\t\t\t\t\t[1, \"$colours[3]\"] ] },\n\t\t\t\"zIndex\": 3\n\t\t}, {\n\t\t\t\"type\": \"areaspline\",\n\t\t\t\"name\": \"$avg_latency_label\",\n\t\t\t\"data\": [ $avg_latency ],\n\t\t\t\"color\": \"$colours[1]\",\n\t\t\t\"fillColor\": {\n\t\t\t\t\"linearGradient\": { \"x1\": 0, \"y1\": 0, \"x2\": 0, \"y2\": 1},\n\t\t\t\t\"stops\": [\n\t\t\t\t\t[0, \"$colours[1]\"],\n\t\t\t\t\t[1, \"$colours[4]\"] ] },\n\t\t\t\"zIndex\": 2\n\t\t}, {\n\t\t\t\"type\": \"areaspline\",\n\t\t\t\"name\": \"$max_latency_label\",\n\t\t\t\"data\": [ $max_latency ],\n\t\t\t\"color\": \"$colours[2]\",\n\t\t\t\"fillColor\": {\n\t\t\t\t\"linearGradient\": { \"x1\": 0, \"y1\": 0, \"x2\": 0, \"y2\": 1},\n\t\t\t\t\"stops\": [\n\t\t\t\t\t[0, \"$colours[2]\"],\n\t\t\t\t\t[1, \"$colours[5]\"] ] },\n\t\t\t\"zIndex\": 1 }],\n\t\t\"credits\": { \"enabled\": false } }\nEOT;\n\t\texit;\n\n\t}",
"private function setInitialValues()\n {\n // Practice\n $this->data['practice'] = $this->meditation_record->get('meditation_practice_id');\n \n // Preparation\n $this->data['sections'][0] = array(\n 'name' => 'Preparation',\n 'timed' => true,\n 'times' => 'short',\n 'time' => 1,\n 'counted' => false,\n 'counts' => null,\n 'count' => null\n );\n \n // Meditation\n $this->data['sections'][1] = array(\n 'name' => 'Meditation',\n 'timed' => true,\n 'times' => 'long',\n 'counted' => false,\n 'counts' => null,\n 'count' => null\n );\n \n $duration = floor( $this->meditation_record->get('duration') );\n \n if ( $duration ) {\n if ( $duration > 240 ) {\n $duration = 240;\n }\n else if ( $duration > 120 && $duration % 15 != 0 ) {\n $duration = 15 * ( floor( $duration / 15 ) + 1 );\n }\n else if ( $duration % 5 != 0 ) {\n $duration = 5 * ( floor( $duration / 5 ) + 1 );\n }\n $this->data['sections'][1]['time'] = $duration;\n } else {\n $this->data['sections'][1]['time'] = 5;\n }\n\n // Cool Down\n $this->data['sections'][2] = array(\n 'name' => 'Cool Down',\n 'timed' => true,\n 'times' => 'medium',\n 'time' => 1,\n 'counted' => false,\n 'counts' => null,\n 'count' => null\n );\n \n // Gong\n $this->data['gong'] = 'all';\n }",
"function update(){\n for($idx=0;$idx<12;$idx+=1){\n $historyData=$this->miner->mine(array_map( function($x){return $x['stock_id']; } , json_decode(stockCandidate::all(),true)));\n foreach($historyData as $e){\n $stockHistory = new StockHistory();\n $this->latestDataAry[$e->stock_id] = $e;\n foreach($e as $key => $value){\n $stockHistory->$key =$e->$key;\n }\n $stockHistory->save();\n \n }\n sleep(5);\n }\n\n \n\n }",
"public function testUpdateMeasurement()\n {\n }",
"public function setData()\n {\n $this->data = array_merge([\n\n 'active' => $this->active,\n\n 'visit' => $this->visit,\n\n 'patient' => $this->visit->patients,\n\n 'admission' => is_module_enabled('Inpatient') ? $this->visit->admission : false,\n\n ], (Array) $this->getEvaluation()->data($this->visit));\n }",
"public function performance()\n\t{\n\t\t//\tGet checklist\n\t\t$checklist = Checklist::find(Checklist::idByName('SPI-RT Checklist'));\n\t\t//\tAdd scorable sections to array\n\t\t$categories = array();\n\t\tforeach ($checklist->sections as $section){\n\t\t\tif($section->isScorable())\n\t\t\t\tarray_push($categories, $section);\n\t\t}\n\t\t//\tChart title\n\t\t$title = '';\n\t\t//\tGet counties\n\t\t$counties = $checklist->countiesWithData();\n\t\t//\tGet all sub-counties\n\t\t$subCounties = array();\n\t\tif(Auth::user()->hasRole('County Lab Coordinator'))\n\t\t\t$subCounties = County::find(Auth::user()->tier->tier)->subCounties->lists('name', 'id');\n\t\t//\tGet all facilities\n\t\t$facilities = array();\n\t\tif(Auth::user()->hasRole('Sub-County Lab Coordinator'))\n\t\t\t$facilities = SubCounty::find(Auth::user()->tier->tier)->facilities->lists('name', 'id');\n\t\t$sdps = array();\n $sdp =NULL;\n\t\t$site = NULL;\n\t\t$sub_county = NULL;\n\t\t$jimbo = NULL;\n\t\t$from = Input::get('from');\n\t\tif(!$from)\n\t\t\t$from = date('Y-m-01');\n\t\t$to = Input::get('to');\n\t\tif(!$to)\n\t\t\t$to = date('Y-m-d');\n\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\t\t$months = json_decode(self::getMonths($from, $to));\n\t\t//\tGet facility\n\t\t//$facility = Facility::find(2);\n\t\tif(Input::get('sdp'))\n\t\t{\n\t\t\t$sdp = Input::get('sdp');\n\t\t}\n\t\tif(Input::get('facility'))\n\t\t{\n\t\t\t$site = Input::get('facility');\n\t\t $sdps = Facility::find($site)->points($checklist->id, $site);\n\t\t}\n\t\tif(Input::get('sub_county'))\n\t\t{\n\t\t\t$sub_county = Input::get('sub_county');\n\t\t\t$facilities = SubCounty::find($sub_county)->facilities->lists('name', 'id');\n\t\t}\n\t\tif(Input::get('county'))\n\t\t{\n\t\t\t$jimbo = Input::get('county');\n\t\t\t$subCounties = County::find($jimbo)->subCounties->lists('name', 'id');\n\t\t}\n\t\t//\tUpdate chart title\n\t\t$variables = $this->sdpsTitleN($checklist->id, $jimbo, $sub_county, $site, $sdp, $from, $toPlusOne);\n\t\t$title = $variables['title'];\n\t\t$ssdps = $variables['sdps'];\n\t\t$chart = \"{\n\n\t chart: {\n\t polar: true,\n\t type: 'line'\n\t },\n\n\t title: {\n\t text: 'SPI-RT Scores Comparison for $title',\n\t x: -80\n\t },\t \n\t\t subtitle: {\n\t\t text:\"; \n\t\t if($from==$to)\n\t\t \t$chart.=\"'\".trans('messages.for-the-year').' '.date('Y').\"'\";\n\t\t else\n\t\t \t$chart.=\"'\".trans('messages.from').' '.$from.' '.trans('messages.to').' '.$to.\"'\";\n\t\t $chart.=\"},\n\t pane: {\n\t size: '80%'\n\t },\n\n\t xAxis: {\n\t categories: [\";\n \tforeach ($categories as $category) \n \t{\n \t\t$chart.=\"'\".$category->label.\"',\";\n \t}\n\t $chart.=\"],\n\t tickmarkPlacement: 'on',\n\t lineWidth: 0\n\t },\n\n\t yAxis: {\n\t gridLineInterpolation: 'polygon',\n\t lineWidth: 0,\n\t min: 0\n\t },\n\t credits: {\n\t\t\t enabled: false\n\t\t\t},\n\t tooltip: {\n\t shared: true,\n\t pointFormat: '<span style=\\\"color:{series.color}\\\">{series.name}</span>: <b>{point.y} %</b><br/>',\n\t },\n\n\t legend: {\n\t align: 'right',\n\t verticalAlign: 'top',\n\t y: 70,\n\t layout: 'vertical'\n\t },\n\t colors: ['#1F77B4', '#FF7F0E', '#2CA02C', '#D62728', '#9467BD', '#8C564B', '#E377C2', '#7F7F7F', '#BCBD22', '#17BECF', '#00ff00', '#00ff00'],\n\t series: [\";\n\t $counter = count($months);\n\t foreach ($months as $month)\n \t\t{\n \t\t\t$chart.=\"{name: \".\"'\".$month->label.' '.$month->annum.\"', data: [\";\n \t\t\t$cats = count($categories);\n \t\t\tforeach ($categories as $category)\n \t\t\t{\n \t\t\t\t\t$chart.=$category->spider($sdp, $site, $sub_county, $jimbo, NULL, NULL, $month->annum, $month->months);\n \t\t\t\t\tif($cats==1)\n\t\t\t\t\t\t$chart.=\"\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$chart.=\",\";\n\t \t\t\t$cats--;\n \t\t\t\t}\n \t\t\t\t$chart.=\"], pointPlacement: 'on'}\";\n \t\t\tif($counter==1)\n\t\t\t\t\t$chart.=\"\";\n\t\t\t\telse\n\t\t\t\t\t$chart.=\",\";\n \t\t\t$counter--;\n \t\t}\n\t \t\t$chart.=\"]\n\t }\";\n\t return view('report.spirt.section', compact('checklist', 'chart', 'counties', 'subCounties', 'facilities', 'categories', 'data', 'title', 'from', 'to', 'jimbo', 'sub_county', 'site','sdps', 'sdp'));\n\t}",
"function get_player_career_stats($pid){\n\t\n\t$data_array = get_player_data($pid);\n\t\t\n\tif(!empty($data_array)){\n\t\tforeach ($data_array as $get){\n\t\t\t$pointsarray[] = $get['points'];\n\t\t\t$yeararray[] = $get['year'];\n\t\t\t$gamearray[] = $get['win_loss'];\n\t\t\t$passyardsarray[] = $get['pass_yds'];\n $passtdarray[] = $get['pass_td'];\n $passintarray[] = $get['pass_int'];\n $rushydsarray[] = $get['rush_yds'];\n $rushtdarray[] = $get['rush_td'];\n $recydsarray[] = $get['rec_yds'];\n $rectdarray[] = $get['rec_td'];\n $xpmarray[] = $get['xpm'];\n $xpaarray[] = $get['xpa'];\n $fgmarray[] = $get['fgm'];\n $fgaarray[] = $get['fga'];\n\t\t}\n\t\t\n\t\tforeach ($data_array as $key => $value){\n\t\t\t$sort_flat[$value['year']][] = $value['points'];\n\t\t\t$pointscum[$key] = $value['cum_points'];\n $winscum[$key] = $value['cum_wins'];\n\n\t\t}\n\t\t\n\t\tforeach ($sort_flat as $key => $value){\n\t\t\t$new_sort_flat[$key] = array_sum($value);\n\t\t\t$new_sort_flat_games[$key] = count($value);\n\t\t\t$new_sort_flat_ppg[$key] = array_sum($value) / count($value);\n\t\t\t$seasonrank[$key] = get_player_season_rank ($pid, $key);\n $pvqflat = get_player_pvqs($pid);\n\t\t}\n\n\t\tforeach($pointscum as $key => $value):\n// if($value >= 500 && $value <= 999):\n// $finalpointscum[$key] = 500;\n// endif;\n if($value >= 1000 && $value <= 1499):\n $finalpointscum[$key] = 1000;\n endif;\n if($value >= 1500 && $value <= 1999):\n $finalpointscum[$key] = 1500;\n endif;\n if($value >= 2000 && $value <= 2499):\n $finalpointscum[$key] = 2000;\n endif;\n if($value >= 2500 && $value <= 2999):\n $finalpointscum[$key] = 2500;\n endif;\n if($value > 3000):\n $finalpointscum[$key] = 3000;\n endif;\n endforeach;\n if($finalpointscum):\n $ptscum = array_unique($finalpointscum);\n endif;\n\n foreach($winscum as $key => $value):\n if($value >= 50 && $value <= 99):\n $finalwcum[$key] = 50;\n endif;\n if($value >= 100 && $value <= 149):\n $finalwcum[$key] = 100;\n endif;\n if($value >= 150 && $value <= 199):\n $finalwcum[$key] = 150;\n endif;\n if($value > 200):\n $finalwcum[$key] = 200;\n endif;\n endforeach;\n if($finalwcum):\n $wcum = array_unique($finalwcum);\n endif;\n\t\t\n\t\t$indyears = array_unique($yeararray);\n\t\t\n\t\t$points = array_sum($pointsarray);\n\t\t$games = count($data_array);\n\t\t$seasons = count($indyears);\n\t\t$ppg = round(($points / $games), 1);\n\t\t$high = max($pointsarray);\n\t\t$low = min($pointsarray);\n\t\t$wins = array_sum($gamearray);\n\t\t$loss = $games - $wins; \n\t\t$highseapts = max($new_sort_flat);\t\t\n\t\t$maxseason = array_keys($new_sort_flat, max($new_sort_flat));\n $passingyds = array_sum($passyardsarray);\n $passingtds = array_sum($passtdarray);\n $passingint = array_sum($passintarray);\n $rushyrds = array_sum($rushydsarray);\n $rushtds = array_sum($rushtdarray);\n $recyds = array_sum($recydsarray);\n $rectds = array_sum($rectdarray);\n $xpm = array_sum($xpmarray);\n $xpa = array_sum($xpaarray);\n $fgm = array_sum($fgmarray);\n $fga = array_sum($fgaarray);\n\t\t\n\t\t$justchamps = get_just_champions();\n\t\t$playoffsplayer = playerplayoffs($pid);\n\t\t\n\t\tif(!empty($playoffsplayer)){\n\t\t\tforeach($playoffsplayer as $key => $value){\n\t\t\t\tif ($value['week'] == '16'){\n\t\t\t\t\t$pb_apps[$value['year']] = $value['team'];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get Posse Bowl Wins \n\t\tforeach ($justchamps as $key => $possebowls){\n\t\t\tif ($possebowls == $pb_apps[$key]){\n\t\t\t\t$pbwins[$key] = $possebowls;\n\t\t\t\t$pbwins_index[$key] = 1;\n\t\t\t}\n\t\t}\n\t\t$lastseason = end($indyears);\n\t\t$checkseason = date(\"Y\") - $lastseason;\n\t\tif($checkseason <= 3){\n\t\t\t$activepl = 1;\n\t\t} else {\n\t\t\t$activepl = 0;\n\t\t}\n\n\t\t$carrer_stats = array(\n\t\t\t'pid' => $pid,\n\t\t\t'active' => $activepl,\n\t\t\t'games' => $games,\n\t\t\t'points' => $points,\n\t\t\t'ppg' => $ppg,\n\t\t\t'seasons' => $seasons,\n\t\t\t'high' => $high,\n\t\t\t'low' => $low,\n\t\t\t'wins' => $wins,\n\t\t\t'loss' => $loss,\n\t\t\t'highseasonpts' => $highseapts,\n\t\t\t'highseason' => $maxseason[0],\n\t\t\t'years' => $indyears,\n\t\t\t'yeartotal' => $new_sort_flat,\n\t\t\t'gamesbyseason' => $new_sort_flat_games,\n\t\t\t'ppgbyseason' => $new_sort_flat_ppg,\n\t\t\t'seasonrank' => $seasonrank,\n\t\t\t'pvqbyseason' => $pvqflat,\n 'numbersseason' => get_numbers_by_season($pid),\n 'pointsmilestone' => $ptscum,\n\t\t\t'winmilestone' => $wcum,\n\t\t\t//'avgpvq' => array_sum($pvqflat)/count($pvqflat),\n\t\t\t'possebowlwins' => $pbwins_index,\n 'careerposrank' => get_player_career_rank($pid),\n 'passingyards' => $passingyds,\n 'passingtds' => $passingtds,\n 'passingint' => $passingint,\n 'rushyrds' => $rushyrds,\n 'rushtds' => $rushtds,\n 'recyrds' => $recyds,\n 'rectds' => $rectds,\n 'xpm' => $xpm,\n 'xpa' => $xpa,\n 'fgm' => $fgm,\n 'fga' => $fga\n\t\t);\n\t\t\n\t\treturn $carrer_stats;\n\t}\n}",
"public function quick_visit_encounter($patient_id='')\n\t{\n\t\t$this->loadModel('UserGroup');\n $isProvider = $this->UserGroup->isProvider($this);\n\t\t$this->Set('isProvider', $isProvider);\n\t\tif($isProvider===false)// if current user is not a provider no need to continue\n\t\t\treturn;\n\t\n\t\tif(empty($patient_id)) \n\t\t{\n\t\t\t$patient_id = $this->params['named']['patient_id'];\n\t\t\tif(empty($patient_id))\n\t\t\t\texit;\n\t\t\t$this->layout = \"empty\";\n\t\t\t$this->loadModel(\"PatientDemographic\");\n\t\t\t$item = $this->PatientDemographic->find('first', array('conditions' => array('PatientDemographic.patient_id' => $patient_id),'recursive' => -1));\n $this->set(\"demographic_info\", $item['PatientDemographic']);\n\t\t}\t\n\t\t\n\t\t$this->loadModel('ScheduleCalendar');\n $locations = $this->PracticeLocation->find('list', array('order' => 'PracticeLocation.location_name','fields' => 'PracticeLocation.location_name')); // get list of practice locations\n\t\t$patient_last_schedule_location = $this->ScheduleCalendar->find('first', array('conditions' => array('patient_id' => $patient_id), 'fields' => array('location'), 'order' => array('date desc', 'starttime desc'), 'recursive' => -1));\n $this->Set(compact('locations', 'patient_last_schedule_location'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the removal of user list columns if applicable to this role / page | static function filter_remove_users_columns( $columns ) {
return self::remove_page_columns( 'users', $columns );
} | [
"function remove_user_fields()\n{\n // Instance config\n $instances = Module::getInstances(__FILE__);\n foreach ($instances as $instance) {\n // Instance config\n $config = Instance::getConfig($instance);\n $config = Instance::setDefaults(Util::toArray('all'), $config);\n // Instance roles\n $roles = Instance::getRoles($instance);\n $roles = Instance::setDefaults(Util::toArray('all'), $roles);\n $roles = Alias::addUserRoles($roles);\n\n // Run instance\n foreach ($roles as $role) {\n if (current_user_can($role)) {\n // Removals\n // Personal Options\n if (in_array('options', $config) || in_array('all', $config)) {\n array_push($config, 'option-title', 'option-editor', 'option-schemes', 'option-shortcuts', 'option-toolbar');\n }\n if (in_array('option-title', $config)) {\n echo '<style>#your-profile h2:first-of-type {display: none};</style>';\n }\n if (in_array('option-editor', $config)) {\n echo '<style>#your-profile tr.user-rich-editing-wrap {display: none};</style>';\n }\n if (in_array('option-schemes', $config)) {\n remove_action('admin_color_scheme_picker', 'admin_color_scheme_picker');\n }\n if (in_array('option-shortcuts', $config)) {\n echo '<style>#your-profile tr.user-comment-shortcuts-wrap {display: none};</style>';\n }\n if (in_array('option-toolbar', $config)) {\n echo '<style>#your-profile tr.user-admin-bar-front-wrap {display: none};</style>';\n }\n // Names\n // Don't allow removal of name-username (required field from WP)\n if (in_array('names', $config) || in_array('all', $config)) {\n array_push($config, 'name-first', 'name-last', 'name-nickname', 'name-display');\n }\n if (in_array('name-first', $config)) {\n echo '<style>#your-profile tr.user-first-name-wrap {display: none};</style>';\n echo '<style>#createuser .form-table .form-field:nth-child(3) {display:none};</style>';\n }\n if (in_array('name-last', $config)) {\n echo '<style>#your-profile tr.user-last-name-wrap {display: none};</style>';\n echo '<style>#createuser .form-table .form-field:nth-child(4) {display:none};</style>';\n }\n if (in_array('name-nickname', $config)) {\n echo '<style>#your-profile tr.user-nickname-wrap {display: none};</style>';\n }\n if (in_array('name-display', $config)) {\n echo '<style>#your-profile tr.user-display-name-wrap {display: none};</style>';\n }\n // Contact Information\n // Don't allow removal of contact-email (required field from WP)\n if (in_array('contact', $config) || in_array('all', $config)) {\n array_push($config, 'contact-web');\n }\n if (in_array('contact-web', $config)) {\n echo '<style>#your-profile tr.user-url-wrap {display: none};</style>';\n echo '<style>#createuser .form-table .form-field:nth-child(5) {display:none};</style>';\n }\n // About\n if (in_array('about', $config) || in_array('all', $config)) {\n array_push($config, 'about-bio', 'about-profile');\n }\n if (in_array('about-bio', $config)) {\n echo '<style>#your-profile h2:nth-of-type(4) {display: none};</style>';\n }\n if (in_array('about-profile', $config)) {\n echo '<style>#your-profile .form-table:nth-of-type(4) {display: none};</style>';\n }\n // Account Management\n // Don't allow removal of reset-password and user-sessions.\n }\n }\n }\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 }",
"function un_list(){\r\n\t\tglobal $wpdb;\r\n\t\t$table = $wpdb->prefix.'users';\r\n\t\t$args = array(\r\n\t\t\t'blog_id' => $GLOBALS['blog_id'],\r\n\t\t\t'role' => '',\r\n\t\t\t'meta_key' => 'approval_status',\r\n\t\t\t'meta_value' => 'pending',\r\n\t\t\t'meta_compare' => '=',\r\n\t\t\t'meta_query' => array(),\r\n\t\t\t'include' => array(),\r\n\t\t\t'exclude' => array(),\r\n\t\t\t'orderby' => 'user_registered',\r\n\t\t\t'order' => 'ASC',\r\n\t\t\t'offset' => '',\r\n\t\t\t'search' => '',\r\n\t\t\t'number' => '',\r\n\t\t\t'count_total' => false,\r\n\t\t\t'fields' => 'all_with_meta',\r\n\t\t\t//'fields' => 'all',\r\n\t\t\t'who' => ''\r\n\t\t); \r\n\t\t$users = get_users( $args );\r\n\t\t\r\n\t}",
"function events_remove_admin_columns( $columns ) {\n\n if ( isset( $columns['event_terms'] ) )\n unset( $columns['event_terms'] );\n\n return $columns;\n\n }",
"function create_manage_user_category_user_column( $columns ) {\n\n\tunset( $columns['posts'] );\n\n\t$columns['users'] = __( 'Users' );\n\n\treturn $columns;\n}",
"public static function remove_pages_list_columns( $columns ) {\n unset( $columns['author'] );\n unset( $columns['comments'] );\n unset( $columns['date'] );\n\n return $columns;\n }",
"function astro_custom_pages_columns( $columns ) {\n\t\tunset(\n\t\t\t// $columns['author'],\n\t\t\t$columns['comments']\n\t\t);\n\t\treturn $columns;\n\t}",
"function bpdpt_remove_group_column() {\n\tif ( bp_is_user() && bp_is_current_action( BP_DOCS_PERSONAL_SLUG ) ) {\n\t\tremove_filter( 'bp_docs_loop_additional_th', array( buddypress()->bp_docs->groups_integration, 'groups_th' ), 5 );\n\t\tremove_filter( 'bp_docs_loop_additional_td', array( buddypress()->bp_docs->groups_integration, 'groups_td' ), 5 );\n\t}\n}",
"function makeUserSidebar($list)\n{\n\tglobal $role;\n\n\t$result = \"\n\t<table id='users_side'>\n\t\t<tbody>\";\n\tif(!empty($list['id']))\n\t{\n\t\t$roleName = $role->getRoleName($list['permission_group_fk']);\n\t\t$name = $list['first_name'] . \" \" . $list['last_name'];\n\t\t$result = \"\n\t\t\t<tr>\n\t\t\t\t<td><a href='?page=usermanager&action=view&userid={$list['id']}' title='View'>{$name}</a></td>\n\t\t\t\t<td>\n\t\t\t\t\t<button class='btn btn-mini' onclick='window.location=\\\"?page=usermanager&action=view&userid={$list['id']}\\\"'>EDIT</button>\n\t\t\t\t\t<button class='btn btn-mini btn-danger' onclick='confirmation({$list['id']},\\\"{$name}\\\");'>DELETE</button>\n\t\t\t\t</td>\n\t\t\t</tr>\\n\";\n\t}\n\telse\n\t{\n\t\tforeach ($list as $key => $value) {\n\t\t\t$name = $value['first_name'] . \" \" . $value['last_name'];\n\t\t\t$result .= \"\n\t\t\t<tr>\n\t\t\t\t<td><a href='?page=usermanager&action=view&userid={$value['id']}' title='View'>{$name}</a></td>\n\t\t\t\t<td>\n\t\t\t\t\t<button class='btn btn-mini' onclick='window.location=\\\"?page=usermanager&action=view&userid={$value['id']}\\\"'>EDIT</button>\n\t\t\t\t\t<button class='btn btn-mini btn-danger' onclick='confirmation({$value['id']},\\\"{$name}\\\");'>DELETE</button>\n\t\t\t\t</td>\n\t\t\t</tr>\\n\";\n\t\t}\n\t}\n\t$result .= \"</table>\\n\";\n\t$result .= '<script type=\"text/javascript\">\n\t//<![CDATA[\n\tjQuery(document).ready(function($) {\n\t\t$(\"#users_side\").flexigrid({\n\t\t\tcolModel : [\n\t\t\t\t{display: \"Name\", name: \"first_name\", width : 154, sortable : true, align: \"left\"},\n\t\t\t\t{display: \"Action\", width : 120, align: \"center\"}\n\t\t\t],\n\t\t\tsortname: \"first_name\",\n\t\t\tsortorder: \"asc\",\n\t\t\ttitle: \"Users\",\n\t\t\tshowTableToggleBtn: true,\n\t\t\twidth: 300\n\t\t});\n\t});\n\t//]]>\n\t</script>';\n\treturn $result;\n}",
"public function role_bulk_remove() {\n\n\t\t// Bail if we ain't got users.\n\t\tif ( empty( $_REQUEST['users'] ) )\n\t\t\treturn;\n\n\t\t// Figure out if we have a role selected.\n\t\tif ( ! empty( $_REQUEST['members-remove-role-top'] ) && ! empty( $_REQUEST['members-remove-role-submit-top'] ) )\n\t\t\t$role = members_sanitize_role( $_REQUEST['members-remove-role-top'] );\n\n\t\telseif ( ! empty( $_REQUEST['members-remove-role-bottom'] ) && ! empty( $_REQUEST['members-remove-role-submit-bottom'] ) )\n\t\t\t$role = members_sanitize_role( $_REQUEST['members-remove-role-bottom'] );\n\n\t\t// Get only editable roles.\n\t\t$editable_roles = members_get_editable_roles();\n\n\t\t// If we don't have a role or the role is not editable, bail.\n\t\tif ( empty( $role ) || ! in_array( $role, $editable_roles ) )\n\t\t\treturn;\n\n\t\t// Validate our nonce.\n\t\tcheck_admin_referer( 'members-bulk-users', 'members-bulk-users-nonce' );\n\n\t\t// If the current user cannot promote users, bail.\n\t\tif ( ! current_user_can( 'promote_users' ) )\n\t\t\treturn;\n\n\t\t// Get the current user.\n\t\t$current_user = wp_get_current_user();\n\n\t\t$m_role = members_get_role( $role );\n\n\t\t$update = 'members-role-removed';\n\n\t\t// Loop through the users and remove the role if possible.\n\t\tforeach ( (array) $_REQUEST['users'] as $user_id ) {\n\n\t\t\t$user_id = absint( $user_id );\n\n\t\t\t// If the user doesn't already belong to the blog, bail.\n\t\t\tif ( is_multisite() && ! is_user_member_of_blog( $user_id ) ) {\n\n\t\t\t\twp_die(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'<h1>%s</h1> <p>%s</p>',\n\t\t\t\t\t\tesc_html__( 'Whoah, partner!', 'members' ),\n\t\t\t\t\t\tesc_html__( 'One of the selected users is not a member of this site.', 'members' )\n\t\t\t\t\t),\n\t\t\t\t\t403\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check that the current user can promote this specific user.\n\t\t\tif ( ! current_user_can( 'promote_user', $user_id ) )\n\t\t\t\tcontinue;\n\n\t\t\t$is_current_user = $user_id == $current_user->ID;\n\t\t\t$role_can_promote = in_array( 'promote_users', $m_role->granted_caps );\n\t\t\t$can_manage_network = is_multisite() && current_user_can( 'manage_network_users' );\n\n\t\t\t// If the removed role has the `promote_users` cap and user is removing it from themselves.\n\t\t\tif ( $is_current_user && $role_can_promote && ! $can_manage_network ) {\n\n\t\t\t\t$can_remove = false;\n\n\t\t\t\t// Loop through the current user's roles.\n\t\t\t\tforeach ( $current_user->roles as $_r ) {\n\n\t\t\t\t\t// If the current user has another role that can promote users, it's\n\t\t\t\t\t// safe to remove the role. Else, the current user needs to keep\n\t\t\t\t\t// the role.\n\t\t\t\t\tif ( $role !== $_r && in_array( 'promote_users', members_get_role( $_r )->granted_caps ) ) {\n\n\t\t\t\t\t\t$can_remove = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! $can_remove ) {\n\t\t\t\t\t$update = 'members-error-remove-admin';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get the user object.\n\t\t\t$user = new \\WP_User( $user_id );\n\n\t\t\t// If the user has the role, remove it.\n\t\t\tif ( in_array( $role, $user->roles ) )\n\t\t\t\t$user->remove_role( $role );\n\t\t}\n\n\t\t// Redirect to the users screen.\n\t\twp_redirect( add_query_arg( 'update', $update, 'users.php' ) );\n\t}",
"function mrpu_add_roles_column($columns)\n{\n\t$old_posts = isset($columns['posts']) ? $columns['posts'] : false;\n\tunset($columns['role'], $columns['posts']);\n\t$columns['mrpu_roles'] = __('Roles', 'multiple-roles-per-user');\n\tif ($old_posts) {\n\t\t$columns['posts'] = $old_posts;\n\t}\n\n\treturn $columns;\n}",
"function uc_student_columns( $columns ) {\n\tunset( $columns['title'] );\n\t$columns['name'] = __( 'Name', UPTOWNCODE_PLUGIN_NAME );\n\t$columns['school_year'] = __( 'School Year', UPTOWNCODE_PLUGIN_NAME );\n\t$columns['grade'] = __( 'Grade', UPTOWNCODE_PLUGIN_NAME );\n\t$columns['school'] = __( 'School', UPTOWNCODE_PLUGIN_NAME );\n\t$columns['teacher'] = __( 'Teacher', UPTOWNCODE_PLUGIN_NAME );\n\treturn $columns;\n}",
"function toggle_detail_list_select_columns($table):Array {\n\n // Check if the table has list_table_visible_columns not empty\n $detail_list_table_visible_columns = $this->feature_model_detail_list_table_visible_columns($table);\n \n //Table lookup tables\n $lookup_tables = $this->CI->grants->lookup_tables($table);\n \n\n $get_all_table_fields = $this->CI->grants_model->get_all_table_fields($table);\n\n // Replace the list visible columns if the current controller is approval\n //$list_visible_columns = array();\n \n $model = $this->CI->grants->load_detail_model($table); \n \n // Removing approval_id field in the select fields\n if( $this->CI->controller == 'approval'){\n if(is_array($detail_list_table_visible_columns) && \n count($detail_list_table_visible_columns) > 0){\n array_unshift($detail_list_table_visible_columns,$this->CI->grants->primary_key_field($table));\n\n //$detail_list_table_visible_columns = $list_visible_columns;\n }\n \n }\n\n //print_r($list_visible_columns);exit;\n \n // Unset history fields\n foreach ($get_all_table_fields as $get_all_table_field) {\n \n //Unset foreign keys columns, created_by and last_modified_by columns\n \n if( substr($get_all_table_field,0,3) == 'fk_' ||\n $this->CI->grants->is_history_tracking_field($table,$get_all_table_field,'created_by') ||\n $this->CI->grants->is_history_tracking_field($table,$get_all_table_field,'last_modified_by') ||\n $this->CI->grants->is_history_tracking_field($table,$get_all_table_field,'deleted_at')\n ){ \n unset($get_all_table_fields[array_search($get_all_table_field,$get_all_table_fields)]);\n }\n \n \n }\n \n \n $visible_columns = $get_all_table_fields;\n\n \n if(is_array($detail_list_table_visible_columns) && count($detail_list_table_visible_columns) > 0 ){\n $visible_columns = $detail_list_table_visible_columns;\n //print_r($visible_columns);exit;\n }else{\n if(is_array($lookup_tables) && count($lookup_tables) > 0 ){\n foreach ($lookup_tables as $lookup_table) {\n \n \n $lookup_table_columns = $this->CI->grants_model->get_all_table_fields($lookup_table);\n \n foreach ($lookup_table_columns as $lookup_table_column) {\n // Only include the name field of the look up table in the select columns\n if($this->CI->grants->is_name_field($lookup_table,$lookup_table_column)){\n array_push($visible_columns,$lookup_table.'_id');\n array_push($visible_columns,$lookup_table_column);\n }\n \n }\n }\n }\n }\n //print_r($detail_list_table_visible_columns);exit;\n return $this->access->control_column_visibility($table,$visible_columns,'read');\n \n }",
"public function voffice_remove_roles() {\n //For development purposes only\n //remove_role( 'vp' );\n //remove_role( 'dm' );\n }",
"function headache_remove_roles(): void\n{\n remove_role('author');\n remove_role('contributor');\n remove_role('subscriber');\n}",
"public function set_hidden_columns() {\n\n\t\t$this->init_pages();\n\n\t\tforeach( $this->field_pages as $post_type => $pages ){\n\n\t\t\tforeach( $pages as $page => $label ){\n\t\t\t\t$hidden = array( 'output', 'output_as', 'output_show_label', 'origin', 'post_id' );\n\t\t\t\t$option_key = \"manage{$post_type}_page_{$page}columnshidden\";\n\t\t\t\t$current_option_value = get_user_option( $option_key );\n\n\t\t\t\tif( $current_option_value && ! empty( $current_option_value ) ){\n\n\t\t\t\t\t// Remove empty array values\n\t\t\t\t\t$current_option_value = array_filter( $current_option_value );\n\n\t\t\t\t\t// Merge and Remove any Duplicate Values\n\t\t\t\t\t$hidden = array_unique( array_merge( $current_option_value, $hidden ) );\n\t\t\t\t}\n\n\t\t\t\tupdate_user_option( get_current_user_id(), $option_key, $hidden, TRUE );\n\t\t\t}\n\n\t\t}\n\n\n\t}",
"public function admin_listing() {\n $this->layout = 'admin';\n $this->set('PAGE_TITLE', 'Admin: Users');\n $this->Paginator->settings = array('limit' => 10, 'conditions' => array('User.role_id !=' => 1));\n $all_users = $this->Paginator->paginate('User');\n $this->set('user_data', $all_users);\n }",
"function apply_field_security() {\r\n\t\tglobal $current_user, $currentModule;\r\n\r\n\t\trequire_once('include/utils/UserInfoUtil.php');\r\n\t\tforeach($this->column_fields as $fieldname=>$fieldvalue) {\r\n\t\t$reset_value = false;\r\n\t\t\tif (getFieldVisibilityPermission($currentModule, $current_user->id, $fieldname) != '0')\r\n\t\t\t\t$reset_value = true;\r\n\r\n\t\t\tif ($fieldname == \"record_id\" || $fieldname == \"record_module\")\r\n\t\t\t\t$reset_value = false;\r\n\r\n\t\t\t/*\r\n\t\t\t\tif (isset($this->additional_column_fields) && in_array($fieldname, $this->additional_column_fields) == true)\r\n\t\t\t\t\t$reset_value = false;\r\n\t\t\t */\r\n\r\n\t\t\tif ($reset_value == true)\r\n\t\t\t\t$this->column_fields[$fieldname] = \"\";\r\n\t\t}\r\n\t}",
"public static function removeCustomUserRoles()\n {\n $roles = array('resource_admin');\n foreach ($roles as $role) {\n if (get_role($role)) {\n remove_role($role);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getting the images for the given $item | private function get_item_images() {
$restrict_sitemap_featured_img = isset( $this->options['restrict_sitemap_featured_img'] ) ? $this->options['restrict_sitemap_featured_img'] : false;
if ( ! $restrict_sitemap_featured_img && preg_match_all( '/<img [^>]+>/', $this->item->post_content, $matches ) ) {
$this->get_images_from_content( $matches );
}
// Also check if the featured image value is set.
$post_thumbnail_id = get_post_thumbnail_id( $this->item->ID );
if ( '' !== $post_thumbnail_id ) {
$this->get_item_featured_image( $post_thumbnail_id );
}
} | [
"private function get_item_images() {\n\t\t$this->output .= new WPSEO_News_Sitemap_Images( $this->item, $this->options );\n\t}",
"private function parse_item_images() {\n\t\t$this->get_item_images();\n\n\t\tif ( ! empty( $this->images ) ) {\n\t\t\tforeach ( $this->images as $src => $img ) {\n\t\t\t\t$this->parse_item_image( $src, $img );\n\t\t\t}\n\t\t}\n\t}",
"public static function getItemImages()\n\t\t{\n\t\t\tinclude_once(\"resources/php/ItemDisplayInfoArray.php\");\n\t\t\tforeach($arrItemImages as $key => $val)\n\t\t\t{\n\t\t\t\twow::$arrItemImages[$key] = $val;\n\t\t\t}\n\t\t}",
"function wpra_get_item_itunes_images($item)\n{\n $tags = $item->get_item_tags(Wpra_Rss_Namespace::ITUNES,'image');\n\n if (!is_array($tags) || empty($tags)) {\n return [];\n }\n\n $images = [];\n foreach ($tags as $tag) {\n if (empty($tag['attribs']) || empty($tag['attribs'][''])) {\n continue;\n }\n\n $attribs = $tag['attribs'][''];\n\n if (!empty($attribs['href'])) {\n $images[] = $attribs['href'];\n }\n }\n\n return $images;\n}",
"public function getItemImages(): array\n {\n $images = array();\n\n if ($this->getSavedVariable('itempic')) {\n // Save main item image\n $images['itempic'] = $this->getSavedVariable('itempic');\n }\n\n for ($i = 2; $i < 7; $i++) {\n $picture = 'itempic' . $i;\n if (empty($images['itempic'])) {\n $picIndex = 'itempic';\n } else {\n $picIndex = $picture;\n }\n\n if ($this->getSavedVariable($picture)) {\n $images[$picIndex] = $this->getSavedVariable($picture);\n }\n }\n\n return $images;\n }",
"abstract public function getImages();",
"public function images() {\n\n return $this->hasMany(ItemImage::class, 'item_id');\n }",
"function wpra_get_item_enclosure_images($item)\n{\n $enclosure = $item->get_enclosure();\n\n // Stop if item has no enclosure\n if (is_null($enclosure)) {\n return [];\n }\n\n // Get all the thumbnails from the enclosure\n $thumbnails = (array) $enclosure->get_thumbnails();\n\n return $thumbnails;\n}",
"public function getImageItem()\n {\n return $this->imageItem;\n }",
"function get_item_photos($item_id)\r\n\t{\r\n\t\tglobal $conn;\r\n\t\t$result = $conn->prepare(\"SELECT * FROM item_photos WHERE item_id=:item_id\");\r\n\t\t$result->execute(array('item_id'=>$item_id));\r\n\t\t$names = array();\r\n\t\twhile($row = $result->fetch())\r\n\t\t{\r\n\t\t\t$names[] = $row;\r\n\t\t}\r\n\t\treturn $names;\r\n\t}",
"public function getImages();",
"public function getItem_image()\n {\n return $this->item_image;\n }",
"public function getImages() ;",
"public function images()\n {\n \treturn $this->hasMany(ItemImage::class);\n }",
"function item_image($imageType = null, $props = array(), $index = 0, $item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n $imageFile = $item->getFile($index);\n $fileMarkup = new Omeka_View_Helper_FileMarkup;\n return $fileMarkup->image_tag($imageFile, $props, $imageType);\n}",
"function getItemsFromImgs() { \n global $link;\n $sql = 'SELECT id, id_goods, img_path FROM imgs ORDER BY id';\n\n if (!$result = mysqli_query($link, $sql)) {\n return false;\n } else {\n $items = mysqli_fetch_all($result, MYSQLI_ASSOC);\n //$items = mysqli_fetch_assoc($result); \n \n mysqli_free_result($result);\n return $items;\n }\n }",
"public function getImages()\n {\n if($this->is_real_image == 1) {\n return \\DB::table('stock_images')\n ->where(['type' => 'stock', 'related_id' => $this->id])\n ->get(['path AS url', 'path', 'width', 'height']);\n } else {\n return \\DB::table('stock_images')\n ->where(['type' => 'derivative', 'related_id' => $this->derivative_id])\n ->get(['path AS url', 'path', 'width', 'height'])\n ->map(function ($image) {\n $image->url = url($image->path);\n return $image;\n });\n }\n\n }",
"function get_images() \t{\n\t \t\treturn $this->getImages();\n\t \t}",
"public function getImagesByItemURL (S $objItemURL, S $objSQLCondition = NULL) {\n // Return\n return $this->getImagesByItemId ($this->getItemByURL ($objItemURL,\n static::$objItemId), $objSQLCondition);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply a where clause on multiple document tags. | public function whereTags(array $tags) : QueryBuilder; | [
"function findDocumentsByTags($tags) {\n \t\t$docs = array();\n\t\tforeach ($tags as $tag) {\n\t\t\t$tmp = $this->find('all', array(\n\t\t \t\t'conditions' => array(\n\t\t\t\t\t'Tag.tag' => $tag,\n\t\t \t\t), \n\t\t \t\t'recursive' => -1, \n\t\t \t\t'fields' => array('Tag.id_documento')\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$hola = array();\t\t\t\n\t\t\tforeach($tmp as $t) {\n\t\t \t\t$hola[] = $t['Tag']['id_documento'];\n\t\t\t}\n\t\t\t$docs[] = $hola;\t \n\t }\n\t if(count($docs) > 0) {\n\t \t$res = $docs[0];\n\t \tfor ($i = 1; $i < count($docs); $i++) {\n\t \t\t$res = array_intersect($res, $docs[$i]);\n\t \t}\n\t } else {\n\t \t$res = $this->find('all', array(\n\t \t\t'fields' => 'DISTINCT Tag.id_documento',\n\t \t\t'recursive' => -1\n\t \t\t)\n\t \t);\n\t }\t \n\n\t return $res;\n\t}",
"public function scopeWhereTags($query)\n {\n $tags = join(\" \", params_as_array(func_get_args(), 1));\n $query->whereRaw(\"MATCH (tags) AGAINST (? IN BOOLEAN MODE)\" , $tags);\n return $query;\n }",
"function where() {\n\t\t$conditions = $this->_getArguments(func_get_args());\n\t\tforeach($conditions as $cond) {\n\t\t\tif(is_string($cond))\n\t\t\t\tif(!in_array($cond,$this->conditions)) $this->conditions[] = $cond;\n\t\t}\n\t}",
"public function filterByAndTags($tags)\n {\n $tagArr = explode(\"%\", $tags);\n $res = null;\n foreach ($tagArr as $value) {\n if ($res == null) {\n $res = Tag::find($value)->resources;\n } else {\n $res = $res->intersect(Tag::find($value)->resources);\n }\n }\n dd($res);\n }",
"function get_by_multiple($where) {\n \n }",
"public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}",
"public function findAllWithTags();",
"public function findPetsByTags(string[] $tags);",
"public function getTagsSearchCondition();",
"public function where() {\r\n\t\t\t$this->where = func_get_args();\r\n\t\t}",
"public function scopeTags($query, array $tags)\n {\n $query->where(function($q) use ($tags) {\n foreach($tags as $tag) {\n $q->orWhereJsonContains('tags', $tag);\n }\n });\n }",
"public static function findWhere(...$where): array;",
"public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }",
"abstract public function whereall();",
"public function findTagBy(array $criteria);",
"private function buildTagQuery( array $tags,$condition ) {\n \n if( sizeof( $tags ) == 0 ) {\n \n throw new \\Exception(\"There are no value in the given array\");\n \n }\n \n $separator = self::ORQUERYVALUE;\n $querySql = \"\";\n $tagNumber = sizeof($tags);\n \n $querys = array();\n \n foreach($tags as $tag) {\n \n $querys[] = \"tag.name = '\".$tag.\"'\";\n \n }\n \n $querySql .= \"(\".implode(\" \".$separator.\" \",$querys).\")\";\n \n if($condition == \"all\") {\n \n $querySql .= $this->addGroupBy($tagNumber);\n \n }\n \n return $querySql;\n \n }",
"public function whereIn();",
"private function createWhereClauseForMultipleKeywords($keywords) {\n $whereClause = \"\";\n foreach ($keywords as $keyword) {\n $whereClause .= \"OR ik.keyword_name = '$keyword' \";\n }\n return substr($whereClause, 3);\n }",
"public function getIdsMatchingTags($tags = []);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of date_upd | public function getDate_upd()
{
return $this->date_upd;
} | [
"public function getDateUpd()\n {\n return $this->date_upd;\n }",
"public function getUpdDate()\n {\n return $this->upd_date;\n }",
"public function getDateUpdate()\n {\n return $this->date_update;\n }",
"public function get_date_update()\n\t{\n\t\treturn $this->date_update;\n\t}",
"public function getUpdDatetime()\n {\n return $this->upd_datetime;\n }",
"public function getUpdateDate()\n {\n return $this->update_date;\n }",
"public function getDateUpdated() {\n\t\treturn date ( date_format, strtotime ( $this->dateUpdated ) );\n\t}",
"public function dateUpdate()\n {\n return $this->_dateUpdate;\n }",
"public function getDateUpdated()\n {\n return $this->date_updated;\n }",
"function getUpdatedOn() {\n return $this->getFieldValue('updated_on');\n }",
"public function getUpdated_date()\n {\n return $this->updated_date;\n }",
"public function getUpdateDate()\r\n {\r\n return $this->updateDate;\r\n }",
"public function dateUpdated()\r\n\t{\r\n\t\treturn $this->timestamp('date_updated', true);\r\n\t}",
"public function getUpdateDate()\n {\n return $this->updateDate;\n }",
"function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}",
"public function getDateUpdated()\n {\n return $this->dateUpdated;\n }",
"function _lookupUpdateDate($a_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$q = \"SELECT * FROM note WHERE id = \".\n\t\t\t$ilDB->quote((int) $this->getId(), \"integer\");\n\t\t$set = $ilDB->query($q);\n\t\t$note_rec = $ilDB->fetchAssoc($set);\n\n\t\treturn $note_rec[\"update_date\"];\n\t}",
"public function getUpdatedDate()\n {\n return $this->updated_date;\n }",
"public function lastUpdateDate();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to edit a Historia entity. | private function createEditForm(Historia $entity)
{
$form = $this->createForm(new HistoriaType(), $entity, array(
'action' => $this->generateUrl('historias_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
//$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
} | [
"private function createEditForm(EHistoriaSalud $entity)\n {\n $form = $this->createForm(new EHistoriaSaludType(true), $entity, array(\n 'action' => $this->generateUrl('historiasalud_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr'=>array('class'=>'btn btn-success')));\n\n return $form;\n }",
"private function createEditForm(TipoHistorico $entity)\n {\n $form = $this->createForm(new TipoHistoricoType(), $entity, array(\n 'action' => $this->generateUrl('tipohistorico_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(HistorialPersonaUsuario $entity)\n {\n $form = $this->createForm(new HistorialPersonaUsuarioType(), $entity, array(\n 'action' => $this->generateUrl('historialpersonausuario_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('actions', 'form_actions', [\n 'buttons' => [\n 'submit' => ['type' => 'submit', 'options' => ['label' => ' Guardar', 'attr' => array('icon' => 'ok')]],\n 'delete' => ['type' => 'submit', 'options' => ['label' => ' Eliminar', 'attr' => array('icon' => 'remove', 'class' => 'btn-danger')]],\n ]\n ]);\n\n return $form;\n }",
"private function createEditForm(Hoja $entity)\n {\n $form = $this->createForm(new HojaType(), $entity, array(\n 'action' => $this->generateUrl('hoja_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array('class' => 'box-body')\n ));\n\n $form->add(\n 'submit',\n 'submit',\n array(\n 'label' => 'Actualizar',\n 'attr' => array('class' => 'btn btn-primary pull-right'),\n )\n );\n\n return $form;\n }",
"private function createEditForm(Oficina $entity)\n \n {\n\n \n $form = $this->createForm(new OficinaType($entity->getPersonaIdJefe()), $entity, array(\n 'action' => $this->generateUrl('oficina_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n \n \n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }",
"private function createEditForm(Hijo $entity)\n {\n $form = $this->createForm(new HijoType(), $entity, array(\n 'action' => $this->generateUrl('hijos_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Horario $entity)\n {\n $form = $this->createForm(new HorarioType(), $entity, array(\n 'action' => $this->generateUrl('horario_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Academico $entity)\n {\n $securityContext = $this->container->get('security.context');\n\n $form = $this->createForm(new AcademicoType($securityContext), $entity, array(\n 'action' => $this->generateUrl('academico_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Prestamo $entity)\n {\n $form = $this->createForm(new PrestamoType(), $entity, array(\n 'action' => $this->generateUrl('prestamo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }",
"private function createEditForm(Raza $entity)\n {\n $form = $this->createForm(new RazaType(), $entity, array(\n 'action' => $this->generateUrl('raza_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n\n return $form;\n }",
"private function createEditForm(StatoPratica $entity) {\n $form = $this->createForm(new StatoPraticaType(), $entity, array(\n 'action' => $this->generateUrl('claims_stato_pratica_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update', 'attr' => array('class' => 'btn')));\n\n return $form;\n }",
"private function createEditForm(EFamilia $entity) {\n $form = $this->createForm(new EFamiliaType(), $entity, array(\n 'action' => $this->generateUrl('familia_update', array('id' => $entity->getId())),\n 'method' => 'post',\n ));\n\n return $form;\n }",
"private function createEditForm(Bitacora $entity)\n {\n $form = $this->createForm(new BitacoraType(), $entity, array(\n 'action' => $this->generateUrl('admin_bitacora_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Envio $entity)\r\n {\r\n $form = $this->createForm(new EnvioType(), $entity, array(\r\n 'action' => $this->generateUrl('envios_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n 'em'=>$this->getDoctrine()->getManager(),\r\n ));\r\n\r\n //$form->add('submit', 'submit', array('label' => 'Update'));\r\n\r\n return $form;\r\n }",
"private function createEditForm(EnvaseRetiro $entity)\n {\n $form = $this->createForm(new EnvaseRetiroType(), $entity, array(\n 'action' => $this->generateUrl('envase_retiro_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Oficina $entity)\n {\n $form = $this->createForm(new OficinaType(), $entity, array(\n 'action' => $this->generateUrl('oficina_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar'));\n\n return $form;\n }",
"private function createEditForm(LogonHistory $entity) {\n $form = $this->createForm(new LogonHistoryType(), $entity, array(\n 'action' => $this->generateUrl('logonhistory_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }",
"private function createEditForm(Ingreso $entity)\n {\n $form = $this->createForm(new IngresoType(), $entity, array(\n 'action' => $this->generateUrl('ingreso_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar'));\n\n return $form;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SCENARIO: Given I have a correctly populated WeatherItem entity AND I call modelToEntity on the WeatherItemModelAdapter THEN I except a properly hydrated WeatherItem entity to be returned. | public function testAdapterWillConvertEntityToModel(): void
{
$entity = $this->getDataHelper()->getWeatherItem();
$adapter = new WeatherItemModelAdapter();
$model = $adapter->entityToModel($entity);
$this->assertEquals($entity->getId()->getUuid()->toString(), $model->id);
$this->assertEquals($entity->getCreatedAt()->getTimestamp(), $model->created_at->timestamp);
$this->assertEquals($entity->getUpdatedAt()->getTimestamp(), $model->updated_at->timestamp);
$this->assertEquals($entity->getType(), $model->type);
$this->assertEquals($entity->getLocationId()->getUuid()->toString(), $model->location_id);
$this->assertEquals($entity->getDescription()->toString(), $model->description);
$this->assertEquals($entity->getTemperature()->getValue(), $model->temperature);
$this->assertEquals($entity->getWindSpeed()->getValue(), $model->wind_speed);
$this->assertEquals($entity->getWeatherIcon()->toString(), $model->icon);
} | [
"public function testHydrateEntityPopulatesEntity()\n\t{\n\t\t$entityId = 1;\n\t\t$entityTitle = 'GOTO considered harmful';\n\t\t$entityBody = 'goto sucks';\n\n\t\t$databaseRow = array(\n\t\t\t'id' => $entityId,\n\t\t\t'title' => $entityTitle,\n\t\t\t'body' => $entityBody,\n\t\t);\n\n\t\t$entity = new Fake_Entity;\n\t\t$entity->hydrateEntity($databaseRow);\n\n\t\t$this->assertEquals($entityId, $entity->id);\n\t\t$this->assertEquals($entityTitle, $entity->title);\n\t\t$this->assertEquals($entityBody, $entity->body);\n\t}",
"public function testLaunchConvertWithoutSettingEntityMapping()\n {\n $converter = new RowToEntityConverter();\n $converter->convert(new Row()); \n }",
"public function testTransformMethodWhenItemIsInstanceOfEloquent()\n\t{\n\t\t$mock = $this->getMockBuilder('\\Laravel\\Database\\Eloquent\\Model')\n\t\t\t\t\t->disableOriginalConstructor()\n\t\t\t\t\t->setMethods(array('to_array'))\n\t\t\t\t\t->getMock();\n\n\t\t$mock->expects($this->once())\n\t\t\t->method('to_array')\n\t\t\t->will($this->returnValue('foobar'));\n\n\t\t$stub = new TemplateStub;\n\t\t$this->assertEquals('foobar', $stub->transform($mock));\n\t}",
"public function testHydratedState()\n\t{\n\t\t$entity = new Fake_Entity;\n\n\t\t$this->assertFalse($entity->hasState(Entity::STATE_HYDRATED));\n\n\t\t$entity->hydrateEntity(array(\n\t\t\t'id' => 1,\n\t\t\t'title' => 'test',\n\t\t\t'body' => 'The Quick Brown Fox',\n\t\t));\n\n\t\t$this->assertTrue($entity->hasState(Entity::STATE_HYDRATED));\n\t}",
"public function testGetItemModelCar()\n {\n $modelName = 'Panamera';\n\n $em = $this->getModule('Doctrine2')->em;\n\n $car = $em->getRepository('CarBundle:Car')->getItemModelCar($modelName, 'Panamera');\n\n $this->assertNotEmpty($car);\n $this->assertNotNull($car);\n\n $this->assertEquals($modelName, 'Panamera');\n\n $car = $em->getRepository('CarBundle:Car')->getItemModelCar($modelName, '911');\n\n $this->assertNull($car);\n $this->assertEmpty($car);\n }",
"public function testEntity()\n {\n $expected = 'entity';\n self::assertEquals($this->data, $this->data->setEntity($expected));\n self::assertEquals($expected, $this->data->getEntity());\n }",
"public function testExtractEntity()\n {\n $service = new ExtractorService($this->getSerializer(), $this->getTransformer());\n $entity = $this->createEntity($this->testData);\n $result = $service->extractEntity($entity, 'foo');\n\n $this->assertEquals($this->testData, $result);\n }",
"public function test_prepare_item() {\n\t}",
"public function testItemCreateWithoutBrandId()\n {\n $this->expectExceptionMessage('A brand id is required to save item');\n\n $data = [\n 'status' => Item::STATUS_DRAFT,\n 'part_number' => str_random(12),\n 'brand_id' => str_random(4)\n ];\n\n $item = new Item();\n $item->status = $data['status'];\n $item->part_number = $data['part_number'];\n $item->save();\n }",
"public function testHydrateEntity()\n {\n $transformer = $this->getTransformerMock();\n\n $transformer->expects($this->once())\n ->method('transformHydrateData')\n ->will($this->returnValue($this->testData));\n\n $service = new HydratorService(\n SerializerBuilder::create()->build(),\n $transformer\n );\n\n $this->assertEquals(\n $this->createEntity($this->testData),\n $service->hydrateEntity($this->testData, 'MJanssen\\Assets\\Entity\\Test')\n );\n }",
"public function itShouldNotChangeTheModelDirectly()\n {\n // Arrange...\n $fruit = $this->createTestModel();\n\n // Act...\n $fruit->adjust( [\n 'price' => 20\n ] );\n\n // Assert...\n $this->assertEquals( $fruit->name, 'Mango' );\n $this->assertEquals( $fruit->price, 10 );\n\n $this->seeInDatabase( 'fruits', [\n 'name' => 'Mango',\n 'price' => 10\n ] );\n }",
"public function testExIconItem() {\n $entity = EntityTest::create();\n $value = 'module-icon';\n $title = $this->randomString();\n\n // Verify entity creation.\n $entity->name->value = $this->randomMachineName();\n $entity->field_icon = $value;\n $entity->field_icon_with_title = $value;\n $entity->field_icon_with_title->title = $title;\n $entity->save();\n\n // Verify entity has been created properly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n\n $this->assertTrue($entity->field_icon instanceof FieldItemListInterface, 'Field implements interface.');\n $this->assertTrue($entity->field_icon[0] instanceof FieldItemInterface, 'Field item implements interface.');\n $this->assertEqual($entity->field_icon->value, $value);\n $this->assertEqual($entity->field_icon[0]->value, $value);\n\n $this->assertTrue($entity->field_icon_with_title instanceof FieldItemListInterface, 'Field implements interface.');\n $this->assertTrue($entity->field_icon_with_title[0] instanceof FieldItemInterface, 'Field item implements interface.');\n $this->assertEqual($entity->field_icon_with_title->value, $value);\n $this->assertEqual($entity->field_icon_with_title[0]->value, $value);\n $this->assertEqual($entity->field_icon_with_title->title, $title);\n $this->assertEqual($entity->field_icon_with_title[0]->title, $title);\n\n // Verify changing the icon value.\n $new_value = 'module-icon-no-title';\n $entity->field_icon->value = $new_value;\n $this->assertEqual($entity->field_icon->value, $new_value);\n\n // Verify changing the title value.\n $new_title = $this->randomString();\n $entity->field_icon_with_title->title = $new_title;\n $this->assertEqual($entity->field_icon_with_title->title, $new_title);\n\n // Read changed entity and assert changed values.\n $entity->save();\n $entity = EntityTest::load($id);\n $this->assertEqual($entity->field_icon->value, $new_value);\n $this->assertEqual($entity->field_icon_with_title->title, $new_title);\n\n // Test sample item generation.\n $entity = EntityTest::create();\n $entity->field_icon->generateSampleItems();\n $entity->field_icon_with_title->generateSampleItems();\n $this->entityValidateAndSave($entity);\n }",
"public function testRefreshingNullEntity()\n {\n $this->expectException(OrmException::class);\n $this->dataMapper->refreshEntity($this->entity1->getId());\n }",
"public function testExportItem()\n {\n $writer = $this->getMockForAbstractClass(\n \\Magento\\ImportExport\\Model\\Export\\Adapter\\AbstractAdapter::class,\n [],\n '',\n false,\n false,\n true,\n ['writeRow']\n );\n\n $writer->expects(\n $this->once()\n )->method(\n 'writeRow'\n )->will(\n $this->returnCallback([$this, 'validateWriteRow'])\n );\n\n $this->_model->setWriter($writer);\n $this->_model->setParameters([]);\n\n $arguments = $this->_objectManager->getConstructArguments(\\Magento\\Framework\\Model\\AbstractModel::class);\n $arguments['data'] = $this->_addressData;\n $item = $this->getMockForAbstractClass(\\Magento\\Framework\\Model\\AbstractModel::class, $arguments);\n $this->_model->exportItem($item);\n }",
"public function testExistenceOfNotImplementedModelWithEntityDefinition()\n {\n $result = Factory::modelExists(\"DemoEntity\");\n $this->assertTrue($result);\n }",
"public function testWithDataModelPresent() {\n\t\t\n\t\t$data = array(\n\t\t\t$this->test_model => array(\n\t\t\t\t'id' => 1,\n\t\t\t\t'name' => 'Name'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->ApiResource->forModel($this->test_model);\n\t\t\n\t\t$test = $this->ApiResource->withData($data);\n\t\t\n\t\t$this->assertEqual($test, $this->ApiResource);\n\t\t\n\t\t$this->assertEqual($this->ApiResource->_data, $data);\n\t\t\n\t}",
"protected function _getEntityAdapter()\n {\n if (!$this->_entityAdapter) {\n $validTypes = Mage_ImportExport_Model_Config::getModels(self::CONFIG_KEY_ENTITIES);\n\n if (isset($validTypes[$this->getEntity()])) {\n try {\n $this->_entityAdapter = Mage::getModel($validTypes[$this->getEntity()]['model']);\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::throwException(\n Mage::helper('importexport')->__('Invalid entity model')\n );\n }\n if (! $this->_entityAdapter instanceof Mage_ImportExport_Model_Export_Entity_Abstract) {\n Mage::throwException(\n Mage::helper('importexport')->__('Entity adapter obejct must be an instance of Mage_ImportExport_Model_Export_Entity_Abstract')\n );\n }\n } else {\n Mage::throwException(Mage::helper('importexport')->__('Invalid entity'));\n }\n // check for entity codes integrity\n if ($this->getEntity() != $this->_entityAdapter->getEntityTypeCode()) {\n Mage::throwException(\n Mage::helper('importexport')->__('Input entity code is not equal to entity adapter code')\n );\n }\n $this->_entityAdapter->setParameters($this->getData());\n }\n return $this->_entityAdapter;\n }",
"public function testCustomerTransformerCanGetEntity()\n {\n $customer = mockery::mock(Customer::class);\n\n $transformer = new CustomerTransformer();\n $transformer->setCustomer($customer);\n\n $this->assertInstanceOf(Entity::class, $transformer->getEntity());\n }",
"protected function _getEntityAdapter()\n {\n if (!$this->_entityAdapter) {\n $validTypes = Mage_ImportExport_Model_Config::getModels(self::CONFIG_KEY_ENTITIES);\n\n if (isset($validTypes[$this->getEntity()])) {\n try {\n $this->_entityAdapter = Mage::getModel($validTypes[$this->getEntity()]['model']);\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::throwException(\n Mage::helper('importexport')->__('Invalid entity model')\n );\n }\n if (!($this->_entityAdapter instanceof Mage_ImportExport_Model_Import_Entity_Abstract)) {\n Mage::throwException(\n Mage::helper('importexport')->__('Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract')\n );\n }\n } else {\n Mage::throwException(Mage::helper('importexport')->__('Invalid entity'));\n }\n // check for entity codes integrity\n if ($this->getEntity() != $this->_entityAdapter->getEntityTypeCode()) {\n Mage::throwException(\n Mage::helper('importexport')->__('Input entity code is not equal to entity adapter code')\n );\n }\n $this->_entityAdapter->setParameters($this->getData());\n }\n return $this->_entityAdapter;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grabs content models related to the collection specified in the configuration settings of this module. | function __getContentModels() {
global $our_content_models;
module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'CollectionClass');
$options = array();
$collectionHelper = new CollectionClass();
//defined in fedora_repository admin config
$default_collection = variable_get('fedora_content_model_collection_pid','islandora:ContentModelCollection');
$results = $collectionHelper->getRelatedItems( $default_collection, null, null );
if (empty($results)) {
return NULL;
}
$items = new SimpleXMLElement( $results );
if ( count( $items->results->result ) > 0 ) {
foreach ( $items->results->result as $res ) {
$child_pid = substr( $res->object['uri'], strpos($res->object['uri'],'/')+1 );
if (in_array($child_pid, $our_content_models)):
if ( ( $cm = ContentModel::loadFromModel( $child_pid ) ) !== false) {
$options[$child_pid] = $child_pid;
}
endif;
}
}
return $options;
} | [
"public function getGridModelsCollection()\n {\n if (!$this->hasData('grid_models_collection')) {\n if (($moduleName = $this->_getData('module_name'))\n && ($controllerName = $this->_getData('controller_name'))) {\n /** @var $collection BL_CustomGrid_Model_Mysql4_Grid_Collection */\n $collection = Mage::getResourceModel('customgrid/grid_collection');\n \n $collection->addFieldToFilter('module_name', $moduleName)\n ->addFieldToFilter('controller_name', $controllerName)\n ->load();\n \n $this->setData('grid_models_collection', $collection);\n }\n }\n return $this->_getData('grid_models_collection');\n }",
"abstract protected function getCollectionsConfigurations();",
"public static function models()\n {\n return self::fetch(\"models\");\n }",
"protected function getExternalModelRelatedModels(): Collection\n {\n return $this;\n }",
"protected function findAllDemoContentCollection() : void {\n if (isset($this->collections)) {\n return;\n }\n\n $this->collections = [];\n $discovery = new YamlDiscovery('tide_demo_content', $this->moduleHandler->getModuleDirectories());\n $definitions = $discovery->findAll();\n foreach ($definitions as $module_name => $collections) {\n foreach ($collections as $name => $collection) {\n $collection_name = $module_name . ':' . $name;\n $collection['module'] = $module_name;\n $collection += [\n 'weight' => 0,\n 'dependencies' => [\n 'modules' => [],\n 'collections' => [],\n ],\n 'content' => [],\n ];\n $collection['dependencies']['modules'] = $collection['dependencies']['modules'] ?? [];\n $collection['dependencies']['collections'] = $collection['dependencies']['collections'] ?? [];\n\n // Only use items satisfying theirs module dependencies.\n if ($this->checkModulesEnabled($collection['dependencies']['modules'])) {\n $this->collections[$collection_name] = $collection;\n }\n else {\n $this->messenger->addMessage($this->t('Ignored %name as it does not meet its module dependencies.', ['%name' => $collection_name]));\n }\n }\n }\n\n // Allows other modules to exclude unwanted collections.\n $ignored_collections = $this->moduleHandler->invokeAll('tide_demo_content_collection_ignore', [$this->collections]);\n if (!empty($ignored_collections)) {\n foreach ($ignored_collections as $ignored_collection) {\n unset($this->collections[$ignored_collection]);\n }\n }\n\n // Filter out all items not meeting theirs collection dependencies.\n foreach ($this->collections as $collection_name => &$collection) {\n $missing_dependencies = $this->checkMissingCollections($collection['dependencies']['collections']);\n if (!empty($missing_dependencies)) {\n unset($this->collections[$collection_name]);\n $this->messenger->addMessage($this->t('Ignored %name as its required collection %collection is missing.', [\n '%name' => $collection_name,\n '%collection' => reset($missing_dependencies),\n ]));\n }\n }\n }",
"function umkcdora_retrieve_content_model_mappings() {\n $module_path = drupal_get_path('module', 'umkcdora');\n $content_models = array(\n 'umkc:bookCModel' => array(\n 'label' => t('UMKC Book Content Model'),\n 'mappings' => array('islandora:bookCModel' => 'islandora:bookCModel'),\n 'form' => array(\n 'UMKC Book Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_book_association' => array(\n 'content_model' => 'umkc:bookCModel',\n 'form_name' => 'UMKC Book Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:graphicsCModel' => array(\n 'label' => t('UMKC Graphics Content Model'),\n 'mappings' => array('islandora:sp_large_image_cmodel' => 'islandora:sp_large_image_cmodel'),\n 'form' => array(\n 'UMKC Graphics Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_graphics_association' => array(\n 'content_model' => 'umkc:graphicsCModel',\n 'form_name' => 'UMKC Graphics Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:manuscriptsCModel' => array(\n 'label' => t('UMKC Manuscripts Content Model'),\n 'mappings' => array(\n 'islandora:sp_large_image_cmodel' => 'islandora:sp_large_image_cmodel',\n 'islandora:bookCModel' => 'islandora:bookCModel',\n ),\n 'form' => array(\n 'UMKC Manuscripts Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_manuscripts_association' => array(\n 'content_model' => 'umkc:manuscriptsCModel',\n 'form_name' => 'UMKC Manuscripts Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:mapsandatlasesCModel' => array(\n 'label' => t('UMKC Maps and Atlases Content Model'),\n 'mappings' => array(\n 'islandora:sp_large_image_cmodel' => 'islandora:sp_large_image_cmodel',\n 'islandora:bookCModel' => 'islandora:bookCModel',\n ),\n 'form' => array(\n 'UMKC Maps and Atlases Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_maps_and_atlases_association' => array(\n 'content_model' => 'umkc:mapsandatlasesCModel',\n 'form_name' => 'UMKC Maps and Atlases Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:newslettersCModel' => array(\n 'label' => t('UMKC Newsletters Content Model'),\n 'mappings' => array('islandora:newspaperCModel' => 'islandora:newspaperCModel'),\n 'form' => array(\n 'UMKC Newsletters Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_newsletters_association' => array(\n 'content_model' => 'umkc:newslettersCModel',\n 'form_name' => 'UMKC Newsletters Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:newspapersCModel' => array(\n 'label' => t('UMKC Newspapers Content Model'),\n 'mappings' => array('islandora:newspaperCModel' => 'islandora:newspaperCModel'),\n 'form' => array(\n 'UMKC Newspapers Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_newspapers_association' => array(\n 'content_model' => 'umkc:newspapersCModel',\n 'form_name' => 'UMKC Newspapers Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:pamphletsCModel' => array(\n 'label' => t('UMKC Pamphlets Content Model'),\n 'mappings' => array('islandora:bookCModel' => 'islandora:bookCModel'),\n 'form' => array(\n 'UMKC Pamphlets Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_pamphlets_association' => array(\n 'content_model' => 'umkc:pamphletsCModel',\n 'form_name' => 'UMKC Pamphlets Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:photographsCModel' => array(\n 'label' => t('UMKC Photographs Content Model'),\n 'mappings' => array('islandora:sp_large_image_cmodel' => 'islandora:sp_large_image_cmodel'),\n 'form' => array(\n 'UMKC Photographs Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_photographs_association' => array(\n 'content_model' => 'umkc:photographsCModel',\n 'form_name' => 'UMKC Photographs Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:postersCModel' => array(\n 'label' => t('UMKC Posters Content Model'),\n 'mappings' => array('islandora:sp_large_image_cmodel' => 'islandora:sp_large_image_cmodel'),\n 'form' => array(\n 'UMKC Posters Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_posters_association' => array(\n 'content_model' => 'umkc:postersCModel',\n 'form_name' => 'UMKC Posters Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:scrapbooksCModel' => array(\n 'label' => t('UMKC Scrapbooks Content Model'),\n 'mappings' => array('islandora:bookCModel' => 'islandora:bookCModel'),\n 'form' => array(\n 'UMKC Scrapbooks Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_scrapbooks_association' => array(\n 'content_model' => 'umkc:scrapbooksCModel',\n 'form_name' => 'UMKC Scrapbooks Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:sheetmusicCModel' => array(\n 'label' => t('UMKC Sheet Music Content Model'),\n 'mappings' => array('islandora:bookCModel' => 'islandora:bookCModel'),\n 'form' => array(\n 'UMKC Sheet Music Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_sheet_music_association' => array(\n 'content_model' => 'umkc:sheetmusicCModel',\n 'form_name' => 'UMKC Sheet Music Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:soundCModel' => array(\n 'label' => t('UMKC Sound Recordings Content Model'),\n 'mappings' => array('islandora:sp-audioCModel' => 'islandora:sp-audioCModel'),\n 'form' => array(\n 'UMKC Sound Recordings Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_sound_recordings_association' => array(\n 'content_model' => 'umkc:soundCModel',\n 'form_name' => 'UMKC Sound Recordings Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:videoCModel' => array(\n 'label' => t('UMKC Video Recordings Content Model'),\n 'mappings' => array('islandora:sp_videoCModel' => 'islandora:sp_videoCModel'),\n 'form' => array(\n 'UMKC Video Recordings Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_video_recordings_association' => array(\n 'content_model' => 'umkc:videoCModel',\n 'form_name' => 'UMKC Video Recordings Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n 'umkc:yearbooksCModel' => array(\n 'label' => t('UMKC Yearbooks Content Model'),\n 'mappings' => array('islandora:bookCModel' => 'islandora:bookCModel'),\n 'form' => array(\n 'UMKC Yearbooks Form' => array(\n 'form_file' => \"$module_path/xml/placeholder_form.xml\",\n ),\n ),\n 'association' => array(\n 'umkc_yearbooks_association' => array(\n 'content_model' => 'umkc:yearbooksCModel',\n 'form_name' => 'UMKC Yearbooks Form',\n 'dsid' => 'MODS',\n 'title_field' => array('titleInfo', 'title'),\n 'transform' => 'mods_to_dc.xsl',\n 'self_transform' => 'cleanup_mods.xsl',\n 'template' => FALSE,\n ),\n ),\n ),\n );\n return $content_models;\n}",
"public function getModels();",
"public function getCollections() ;",
"public function loadCollectionsFromStore() {\r\n $collectionsDescriptions = $this->context->dbDriver->get(RestoDatabaseDriver::COLLECTIONS_DESCRIPTIONS);\r\n foreach (array_keys($collectionsDescriptions) as $key) {\r\n $collection = new RestoCollection($key, $this->context, $this->user);\r\n $collection->model = RestoUtil::instantiate($collectionsDescriptions[$key]['model'], array($collection->context, $collection->user));\r\n $collection->osDescription = $collectionsDescriptions[$key]['osDescription'];\r\n $collection->status = $collectionsDescriptions[$key]['status'];\r\n $collection->license = $collectionsDescriptions[$key]['license'];\r\n $collection->propertiesMapping = $collectionsDescriptions[$key]['propertiesMapping'];\r\n $this->add($collection);\r\n }\r\n return $this;\r\n }",
"protected function _getModelCollection()\n\t{\n\t\t$modelClass = $this->_modelClassName;\n\t\t$collectionName = $modelClass::getCollectionName();\n\t\t$connectionName = $modelClass::getConnectionName();\n\t\tif( !empty( $connectionName ) ){\n\t\t\t$database = self::$_database[ $connectionName ]; \n\t\t} else {\n\t\t\t$database = reset( self::$_database );\n\t\t}\n\t\treturn $database->$collectionName;\t\t\n\t}",
"public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }",
"protected function getModelCollection()\n {\n $modelClass = $this->modelClassName;\n $collectionName = $modelClass::getCollectionName();\n $connectionName = $modelClass::getConnectionName();\n if (!empty($connectionName)) {\n $database = self::$database[ $connectionName ];\n } else {\n $database = reset(self::$database);\n }\n\n return $database->$collectionName;\n }",
"public function getManagedModels() {\n\t\tif($this->managedModels !== null) {\n\t\t\treturn $this->managedModels;\n\t\t}\n\n\t\tif($this->stat('managed_models')) {\n\t\t\t$result = parent::getManagedModels();\n\t\t} else {\n\t\t\t$classes = ClassInfo::subclassesFor('AdvancedReport');\n\t\t\t$result = array();\n\n\t\t\tarray_shift($classes);\n\n\t\t\tforeach($classes as $class) {\n\t\t\t\t$result[$class] = array('title' => singleton($class)->singular_name());\n\t\t\t}\n\t\t}\n\n\t\treturn $this->managedModels = $result;\n\t}",
"public function load_contents_by_category() {\n \n // Get contents\n (new MidrubBaseAdminCollectionFrontendHelpers\\Contents)->load_contents_by_category();\n \n }",
"public function populateModels()\n {\n }",
"public function getPluginCollections();",
"public abstract function getDesignCollectionManager();",
"public static function all()\n {\n return static::$models;\n }",
"public function get($collection);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a collection of AssignmentFile objects related by a onetomany relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection. | public function setAssignmentFiles(PropelCollection $assignmentFiles, PropelPDO $con = null)
{
$assignmentFilesToDelete = $this->getAssignmentFiles(new Criteria(), $con)->diff($assignmentFiles);
$this->assignmentFilesScheduledForDeletion = unserialize(serialize($assignmentFilesToDelete));
foreach ($assignmentFilesToDelete as $assignmentFileRemoved) {
$assignmentFileRemoved->setAssignment(null);
}
$this->collAssignmentFiles = null;
foreach ($assignmentFiles as $assignmentFile) {
$this->addAssignmentFile($assignmentFile);
}
$this->collAssignmentFiles = $assignmentFiles;
$this->collAssignmentFilesPartial = false;
return $this;
} | [
"public function setFiles(PropelCollection $files, PropelPDO $con = null)\n {\n $this->filesScheduledForDeletion = $this->getFiles(new Criteria(), $con)->diff($files);\n\n foreach ($this->filesScheduledForDeletion as $fileRemoved) {\n $fileRemoved->setAuthor(null);\n }\n\n $this->collFiles = null;\n foreach ($files as $file) {\n $this->addFile($file);\n }\n\n $this->collFiles = $files;\n $this->collFilesPartial = false;\n }",
"public function setFiles(PropelCollection $files, PropelPDO $con = null)\n {\n $filesToDelete = $this->getFiles(new Criteria(), $con)->diff($files);\n\n\n $this->filesScheduledForDeletion = $filesToDelete;\n\n foreach ($filesToDelete as $fileRemoved) {\n $fileRemoved->setPropelcommit(null);\n }\n\n $this->collFiles = null;\n foreach ($files as $file) {\n $this->addFile($file);\n }\n\n $this->collFiles = $files;\n $this->collFilesPartial = false;\n\n return $this;\n }",
"public function setFiles(PropelCollection $files, PropelPDO $con = null)\n {\n $filesToDelete = $this->getFiles(new Criteria(), $con)->diff($files);\n\n\n $this->filesScheduledForDeletion = $filesToDelete;\n\n foreach ($filesToDelete as $fileRemoved) {\n $fileRemoved->setFileCat(null);\n }\n\n $this->collFiles = null;\n foreach ($files as $file) {\n $this->addFile($file);\n }\n\n $this->collFiles = $files;\n $this->collFilesPartial = false;\n\n return $this;\n }",
"public function setStudentAssignmentFiles(PropelCollection $studentAssignmentFiles, PropelPDO $con = null)\n {\n $studentAssignmentFilesToDelete = $this->getStudentAssignmentFiles(new Criteria(), $con)->diff($studentAssignmentFiles);\n\n $this->studentAssignmentFilesScheduledForDeletion = unserialize(serialize($studentAssignmentFilesToDelete));\n\n foreach ($studentAssignmentFilesToDelete as $studentAssignmentFileRemoved) {\n $studentAssignmentFileRemoved->setFile(null);\n }\n\n $this->collStudentAssignmentFiles = null;\n foreach ($studentAssignmentFiles as $studentAssignmentFile) {\n $this->addStudentAssignmentFile($studentAssignmentFile);\n }\n\n $this->collStudentAssignmentFiles = $studentAssignmentFiles;\n $this->collStudentAssignmentFilesPartial = false;\n\n return $this;\n }",
"public function setFiles(Collection $files, ConnectionInterface $con = null)\n {\n /** @var ChildFile[] $filesToDelete */\n $filesToDelete = $this->getFiles(new Criteria(), $con)->diff($files);\n\n\n $this->filesScheduledForDeletion = $filesToDelete;\n\n foreach ($filesToDelete as $fileRemoved) {\n $fileRemoved->setNote(null);\n }\n\n $this->collFiles = null;\n foreach ($files as $file) {\n $this->addFile($file);\n }\n\n $this->collFiles = $files;\n $this->collFilesPartial = false;\n\n return $this;\n }",
"function saveAttachments($files, $assignment) {\n foreach ($files as $file) {\n $this->saveAttachment($file, $assignment);\n }\n }",
"public function touchOwners()\n {\n foreach ($this->getTouchedRelations() as $relation) {\n $this->$relation()->touch();\n\n if ($this->$relation instanceof self) {\n $this->$relation->fireModelEvent('saved', false);\n\n $this->$relation->touchOwners();\n } elseif ($this->$relation instanceof Collection) {\n $this->$relation->each->touchOwners();\n }\n }\n }",
"public function setAttendances(PropelCollection $attendances, PropelPDO $con = null)\n {\n $attendancesToDelete = $this->getAttendances(new Criteria(), $con)->diff($attendances);\n\n $this->attendancesScheduledForDeletion = unserialize(serialize($attendancesToDelete));\n\n foreach ($attendancesToDelete as $attendanceRemoved) {\n $attendanceRemoved->setCourse(null);\n }\n\n $this->collAttendances = null;\n foreach ($attendances as $attendance) {\n $this->addAttendance($attendance);\n }\n\n $this->collAttendances = $attendances;\n $this->collAttendancesPartial = false;\n\n return $this;\n }",
"public function initFiles()\n {\n $this->collFiles = new PropelObjectCollection();\n $this->collFiles->setModel('File');\n }",
"public function setOOEntrys(PropelCollection $oOEntrys, PropelPDO $con = null)\n\t{\n\t\t$this->oOEntrysScheduledForDeletion = $this->getOOEntrys(new Criteria(), $con)->diff($oOEntrys);\n\n\t\tforeach ($oOEntrys as $oOEntry) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($oOEntry->isNew()) {\n\t\t\t\t$oOEntry->setUser($this);\n\t\t\t}\n\t\t\t$this->addOOEntry($oOEntry);\n\t\t}\n\n\t\t$this->collOOEntrys = $oOEntrys;\n\t}",
"public function setAssignments(PropelCollection $assignments, PropelPDO $con = null)\n {\n $assignmentsToDelete = $this->getAssignments(new Criteria(), $con)->diff($assignments);\n\n $this->assignmentsScheduledForDeletion = unserialize(serialize($assignmentsToDelete));\n\n foreach ($assignmentsToDelete as $assignmentRemoved) {\n $assignmentRemoved->setCourse(null);\n }\n\n $this->collAssignments = null;\n foreach ($assignments as $assignment) {\n $this->addAssignment($assignment);\n }\n\n $this->collAssignments = $assignments;\n $this->collAssignmentsPartial = false;\n\n return $this;\n }",
"public function setAssignments(PropelCollection $assignments, PropelPDO $con = null)\n {\n $this->clearAssignments();\n $currentAssignments = $this->getAssignments();\n\n $this->assignmentsScheduledForDeletion = $currentAssignments->diff($assignments);\n\n foreach ($assignments as $assignment) {\n if (!$currentAssignments->contains($assignment)) {\n $this->doAddAssignment($assignment);\n }\n }\n\n $this->collAssignments = $assignments;\n\n return $this;\n }",
"public function updateOwners()\n {\n foreach ($this->attributes as $attr) {\n Mediafile::removeOwner($this->owner->primaryKey, $this->name, $attr);\n\n if ($mediafile = $this->loadModel(['url' => $this->owner->$attr])) {\n $mediafile->addOwner($this->owner->primaryKey, $this->name, $attr);\n }\n }\n }",
"public function initAssignments()\n {\n $this->collAssignments = new PropelObjectCollection();\n $this->collAssignments->setModel('Assignment');\n }",
"public function setFotos(Collection $fotos, ConnectionInterface $con = null)\n {\n /** @var ChildFoto[] $fotosToDelete */\n $fotosToDelete = $this->getFotos(new Criteria(), $con)->diff($fotos);\n\n\n $this->fotosScheduledForDeletion = $fotosToDelete;\n\n foreach ($fotosToDelete as $fotoRemoved) {\n $fotoRemoved->setPengguna(null);\n }\n\n $this->collFotos = null;\n foreach ($fotos as $foto) {\n $this->addFoto($foto);\n }\n\n $this->collFotos = $fotos;\n $this->collFotosPartial = false;\n\n return $this;\n }",
"public function setProjectEntrys(PropelCollection $projectEntrys, PropelPDO $con = null)\n\t{\n\t\t$this->projectEntrysScheduledForDeletion = $this->getProjectEntrys(new Criteria(), $con)->diff($projectEntrys);\n\n\t\tforeach ($projectEntrys as $projectEntry) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($projectEntry->isNew()) {\n\t\t\t\t$projectEntry->setTeam($this);\n\t\t\t}\n\t\t\t$this->addProjectEntry($projectEntry);\n\t\t}\n\n\t\t$this->collProjectEntrys = $projectEntrys;\n\t}",
"public function initAssignmentFiles($overrideExisting = true)\n {\n if (null !== $this->collAssignmentFiles && !$overrideExisting) {\n return;\n }\n $this->collAssignmentFiles = new PropelObjectCollection();\n $this->collAssignmentFiles->setModel('AssignmentFile');\n }",
"public function afterSaveUpdateRelatedModels() {\n $model_fret = FretRefType::model()->findAll();\n foreach($model_fret as $fret){\n $criteria = new CDbCriteria();\n $criteria->compare($fret->fret_model_fixr_id_field,$this->fixr_id);\n $ref_model = new $fret->fret_model;\n foreach($ref_model->findAll($criteria) as $ref){\n $ref->save();\n }\n }\n \n }",
"private function ormCascadeUpdate()\n {\n foreach ($this->orm['relations'] as $class => $relDetail)\n {\t \n\t // Make sure the related object is available. It should always be.\n\t if (!isset($this->$class))\n\t {\n\t continue;\n\t }\n\t \n\t // $ref will be a pointer to the related object.\t \n\t $ref = $this->$class;\n\n\t if ($ref->isDirty())\n\t {\n\t $ref->ormUpdate(); \n\t }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the list of the facebook pages of the user | public function getPages(){
$pages = array();
if(!empty($this->session)){
$request = new FacebookRequest($this->session, 'GET', '/me/accounts?fields=name,access_token,perms');
$pageList = $request->execute()->getGraphObject()->asArray();
if(!empty($pageList['data'])){
foreach ($pageList['data'] as $page) {
$pages[$page->id] = $page->name;
}
}else{
$pages[] = "No facebook pages have been found! Please click on the facebook login button!";
}
}else{
$pages[] = "No facebook pages have been found! Please click on the facebook refresh button or the ReAuthorize button!";
}
return $pages;
} | [
"function getUserPages($user_id = \"me\")\r\n {\r\n $graph_url = '';\r\n $FD = getInstance();\r\n \t$graph_url = \"https://graph.facebook.com/$user_id/accounts?access_token=\" . $FD->Session->get_data('FB_TOKEN');\r\n\t $res = @json_decode(file_get_contents($graph_url));\r\n\t\tif($res)\r\n return $res->data;\r\n \r\n return array();\r\n }",
"public function getUserPages()\n\t{\n\t\t$users_pages = array();\n\t\tif (!$this->fb) {\n\t\t\treturn array();\n\t\t}\n\t\t$accounts = (new FacebookRequest(\n\t\t\t$this->fb, 'GET', '/me/accounts'\n\t\t))->execute()->getGraphObject(GraphUser::className());\n\t\tif ($accounts = $accounts->asArray()) {\n\t\t\tforeach ($accounts['data'] as $account) {\n\t\t\t\tif ($account->category != 'Application') {\n\t\t\t\t\tif (!empty($account->id) && !empty($account->name)) {\n\t\t\t\t\t\t$account->twitterid = '';\n\t\t\t\t\t\t$users_pages[$account->id] = $account;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->log('invalid account: ' . print_r($account, true), 'badaccounts');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs = $this->db->query(\"SELECT * from selective_status_users where fbuid IN ('\" . implode(\"', '\", array_keys($users_pages)) . \"')\");\n\t\t\twhile ($rs && $row = $rs->fetch()) {\n\t\t\t\t$users_pages[$row['fbuid']]->twitterid = $row['twitterid'];\n\t\t\t}\n\t\t}\n\t\treturn $users_pages;\n\t}",
"public function wpw_auto_poster_fb_get_pages_tokens() {\r\n\r\n $fb_app_id = isset($_GET['wpw_fb_app_id']) ? $_GET['wpw_fb_app_id'] : '';\r\n\r\n // Load facebook class\r\n $facebook = $this->wpw_auto_poster_load_facebook($fb_app_id);\r\n\r\n // Check facebook class is exis or not\r\n if (!$facebook)\r\n return false;\r\n\r\n try {\r\n $ret = $this->facebook->api('/' . $_SESSION['wpweb_fb_user_id'] . '/accounts/');\r\n } catch (Exception $e) {\r\n return false;\r\n }\r\n\r\n return $ret;\r\n }",
"public function getPageList()\n {\n $companyNetwork = $this->repo->token(CompanyNetwork::FACEBOOK);\n if (empty($companyNetwork)) {\n throw new NetworkNotExistException(\"Company not connected to facebook network.\");\n }\n $this->facebook = $this->setAdapter($companyNetwork->token, 'facebook');\n $appsecretProof = hash_hmac('sha256', 'access_token', config('hybridauth.providers.Facebook.keys.secret'));\n $response = $this->facebook->apiRequest($this->facebookAPIURL.'me/accounts?fields=name,picture,access_token,category,id', $appsecretProof, 'GET');\n\n return json_decode(json_encode($response), true);\n }",
"public function index()\n {\n return FacebookLogin::with('user')->paginate(25);\n }",
"private function getFacebookPageLikes(){\n $pageID = $this->container->getParameter('facebook_page_id');\n $base_url = \"https://graph.facebook.com/\";\n $access_token = \"CAACEdEose0cBAPjsvVz4m7woCUaePQczZCswNhIC4yHGUZCnMG6Pxu9ZAcPHnVQHPEx2WnntUPxqlgFfGHhKFQMBPY7keej5bVHcARbsY8KIXrSM7cJstbZA4NROLNDjcQ1A0ceombbSEJRDklYssZBw7MERMYhGpPBMxFD93fBxcDqZA92KBEAI60eKl8SSBzW1ZCpCRoetRVMAz8KVCu9\";\n $url = $base_url . $pageID . '?access_token=' . $access_token;\n return $this->getFromJson($url, \"likes\");\n }",
"public function getPages();",
"protected function getPagesByUsers() {\n\t\t\t// SELECT username, COUNT(pages.uid) as count FROM be_users INNER JOIN pages ON ( be_users.uid = pages.cruser_id) WHERE 1 GROUP BY be_users.uid ORDER BY username\n\t\t\treturn array();\n\t\t}",
"public function getPagesList(): array;",
"public function getFacebook_page()\n\t{\n\t\tif( !is_null($this->sFacebook_page) )\n\t\t{\n\t\t\tif( $this->sFacebook_page==='' )\n\t\t\t{\n\t\t\t\t return NULL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t return $this->sFacebook_page;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->hydrateFromBDD(array('facebook_page'));\n\t\t\t$this->callHydrateFromBDDOnGet++;\n\t\t\tif($this->callHydrateFromBDDOnGet>10)\n\t\t\t{\n\t\t\t\techo \"<br />WARNING : trop d'appel en base depuis l'accesseur \". __CLASS__ .\"::\". __FUNCTION__ .\"\";\n\t\t\t}\n\t\t\treturn $this->sFacebook_page;\n\t\t}\n\t}",
"public function load_account_pages() {\n \n // Get selected account\n $account = $this->CI->ads_account_model->get_account($this->CI->user_id, 'facebook');\n \n if ( $account ) {\n \n // Get all pages\n $account_pages = json_decode(get(MIDRUB_ADS_FACEBOOK_GRAPH_URL . 'me/accounts?fields=connected_instagram_account{ig_id,username},name,picture,access_token&limit=1000&access_token=' . $account[0]->token), true);\n\n if ( isset($account_pages['data'][0]) ) {\n\n $connected_instagram = json_decode(get(MIDRUB_ADS_FACEBOOK_GRAPH_URL . $account_pages['data'][0]['id'] . '/instagram_accounts?fields=id,username,profile_pic&access_token=' . $account_pages['data'][0]['access_token']), true);\n\n $data = array(\n 'success' => TRUE,\n 'account_pages' => $account_pages,\n 'connected_instagram' => $connected_instagram,\n 'words' => array(\n 'identity' => $this->CI->lang->line('identity'),\n 'your_facebook_page_represents_business' => $this->CI->lang->line('your_facebook_page_represents_business'),\n 'instagram_below_connected_facebook' => $this->CI->lang->line('instagram_below_connected_facebook'),\n 'search_for_pages' => $this->CI->lang->line('search_for_pages'),\n 'search_for_accounts' => $this->CI->lang->line('search_for_accounts'),\n )\n );\n\n echo json_encode($data);\n exit();\n \n }\n \n }\n \n $data = array(\n 'success' => FALSE,\n );\n\n echo json_encode($data);\n \n }",
"public function facebookPage() {\r\n\tif (!($this->_cache->test('facebookCounts'))) {\r\n\t$data = $this->curl($this->_url);\r\n\t$this->_cache->save($data);\r\n\t} else {\r\n\t$data = $this->_cache->load('facebookCounts');\r\n\t}\r\n\treturn $this->buildHtml($data);\r\n\t}",
"public function actionGetFacebookFeeds() {\n Yii::app()->user->SiteSessions;\n $feeds = array();\n $json_res = Yii::app()->curl\n ->setOption(CURLOPT_HTTPHEADER, array('Content-type: application/json'))\n ->post(\"https://www.facebook.com/feeds/page.php?id=175377742595349&format=json\", array());\n $json_arr = CJSON::decode($json_res);\n if (!empty($json_arr['entries'])) {\n $feeds = array_slice($json_arr['entries'], 0, 5);\n }\n\n $this->renderPartial(\"//site/_facebook_feeds\", array(\"feeds\" => $feeds));\n }",
"function smartbot_check_fb_pages($userId, $userToken, $url)\n{\n $newurl = '';\n $data = smartbot_get_url($url);\n $result = json_decode($data, true);\n if (isset($result)) {\n foreach ($result[\"data\"] as $thisPage) {\n smartbot_check_page($thisPage, $userId);\n }\n //do we maybe have more then 100 results? lets see if Next is there\n if ($result[\"paging\"][\"next\"] != \"\") {\n $newurl = $result[\"paging\"][\"next\"];\n if ($newurl != \"\") {\n smartbot_check_fb_pages($userId, $userToken, $newurl);//we are going into the loop again...with this new url\n }\n }\n }\n}",
"public function getUsersLikedPages($schema)\n {\n $response = $this->sendRequest($schema, $this->prepareQuery($schema));\n\n if($response == $schema['object']['error']){\n\n $this->result = $response;\n\n $this->setResponse($schema);\n }else{\n\n $this->result = json_decode($response, true);\n\n $this->pagination($schema);\n\n $this->setResponse($schema);\n }\n }",
"static public function _wpp_fb_page( $posts ){\n global $wp_query, $wp_properties;\n\n if(\n !isset( $wp_query->query_vars[ self::query_var ] )\n || !isset( $wp_properties['configuration']['feature_settings']['facebook_tabs']['canvases'][$wp_query->query_vars[ self::query_var ]] )\n ) {\n return $posts;\n }\n \n $current_canvas = $wp_properties['configuration']['feature_settings']['facebook_tabs']['canvases'][$wp_query->query_vars[ self::query_var ]];\n\n //** check if user is requesting our fb_tabs page */\n if( !empty( $current_canvas['page'] ) ){\n\n $post = get_post($current_canvas['page']);\n\n $posts = NULL;\n $posts[] = $post;\n\n $wp_query->is_page = true;\n $wp_query->is_singular = true;\n $wp_query->is_home = false;\n $wp_query->is_archive = false;\n $wp_query->is_category = false;\n unset($wp_query->query[\"error\"]);\n $wp_query->query_vars[\"error\"]=\"\";\n $wp_query->is_404 = false;\n }\n\n return $posts;\n }",
"public function getAllPages(): array;",
"private function getPages()\n\t{\n\t\tself::$pages = $this->getAllTree(array('id', 'url', 'path', 'publish'));\n\t}",
"public function getPageUris();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the kernelExtensionAllowedTeamIdentifiers property value. All kernel extensions validly signed by the team identifiers in this list will be allowed to load. | public function getKernelExtensionAllowedTeamIdentifiers(): ?array {
$val = $this->getBackingStore()->get('kernelExtensionAllowedTeamIdentifiers');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, 'string');
/** @var array<string>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'kernelExtensionAllowedTeamIdentifiers'");
} | [
"public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }",
"public function getAllowedExtensions()\n {\n return $this->getValidator()->getAllowedExtensions();\n }",
"public function getAllowedTeams()\n {\n return $this->options()\n ->where('option_key', 'team_count')\n ->first()\n ->option_value;\n }",
"public static function getBlockedExtensions(): array\n {\n return rex_addon::get('mediapool')->getProperty('blocked_extensions');\n }",
"public function getAllowedRequestExtensions()\n {\n return $this->allowed_request_extensions;\n }",
"static public function getAllowedExtensions()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('extention')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->extention;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"protected function getAllowedExtensions()\n {\n $result = [];\n foreach (array_keys($this->fileHelper->getAllMineTypes()) as $option) {\n $result[] = substr($option, 1);\n }\n return $result;\n }",
"public function getTeamKeysIdentifier()\n {\n if (is_null($this->team_keys_identifier))\n {\n $this->team_keys_identifier = 'team keys';\n if (!empty($this->data['pssh']) and !empty($this->data['pssh']['team_keys_identifier']))\n {\n $this->team_keys_identifier = $this->data['pssh']['team_keys_identifier'];\n }\n }\n return $this->team_keys_identifier;\n }",
"private function getExcludedExtensions(): array\n {\n if (Arr::exists(config('responsive-image-craft.extensions_filters_rules', []), $this->getFileExtension())) {\n return Arr::get(config('responsive-image-craft.extensions_filters_rules', []), $this->getFileExtension());\n }\n\n return [];\n }",
"public function getAllowedFileExtensions() {\n\t\treturn $this->allowedFileExtensions;\n\t}",
"public static function getUsedExtensionList()\n {\n $app = Application::getFacadeApplication();\n $db = $app->make('database')->connection();\n $stm = $db->executeQuery(\"select distinct fvExtension from FileVersions where fvIsApproved = 1 and fvExtension is not null and fvExtension <> ''\");\n $extensions = [];\n while ($row = $stm->fetch()) {\n $extensions[] = $row['fvExtension'];\n }\n\n return $extensions;\n }",
"protected function teamIds()\n {\n return $this->agent->teams->pluck('id');\n }",
"public function getAllowedFileExtension() {\n\t\treturn $this->allowedExtensions;\n\t}",
"public function getTeamIdsAttribute()\n {\n return $this->teams->pluck('id')->toArray();\n }",
"public static function getRequiredExtensions()\n {\n return static::$required_extensions;\n }",
"public function getAllowedExtensions()\n {\n return $this->allowed_file_types;\n }",
"public function getVideoProvider()\n {\n if (isset($this->bundleConfig['video_provider'])) {\n return array_keys($this->bundleConfig['video_provider']);\n }\n }",
"function get_banned_email_extensions()\n{\n // $banned = array();\n // $banned = explode(' ', Settings::get('banned_email_extensions'));\n // return $banned;\n return Settings::get('banned_email_extensions');\n}",
"public function getWebImageExtensions()\n {\n return $this->scopeConfig->getValue(self::XML_PATH_WEB_IMAGE_EXTENSIONS, 'store') ?: [];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for deleteUserCredentialsTotp Delete TwoFactor Credential. | public function testDeleteUserCredentialsTotp()
{
} | [
"public function testDeleteUserCredentialsApi3()\n {\n }",
"public function testDeleteUserCredentialsOidc()\n {\n }",
"public function testDeleteUserCredentialsLdap()\n {\n }",
"public function testDeletingCredential()\n {\n $collection = new CredentialCollection(1, 369);\n $credential = new Credential(321, CredentialTypes::LOGIN, 1, 844, Token::create());\n $collection->registerStorage(CredentialTypes::LOGIN, new CredentialStorage());\n $collection->add($credential);\n $this->assertTrue($credential->isActive());\n $collection->delete(new Response(), CredentialTypes::LOGIN);\n $this->assertFalse($collection->has(CredentialTypes::LOGIN));\n $this->assertFalse($credential->isActive());\n }",
"public function testCreateUserCredentialsTotp()\n {\n }",
"public function testEraseCredentials() : void\n {\n // INIT\n //-----\n\n // Create the user\n $user = new User();\n\n // TEST\n //-----\n $this->assertNull($user->eraseCredentials());\n }",
"public function testEraseCreds()\n {\n $user = new User();\n $user->setPlainPassword('blah');\n $user->eraseCredentials();\n\n Assert::assertNull($user->getPlainPassword());\n }",
"public function testDeleteUserCredentialsEmail()\n {\n }",
"public function testforgottenPassDeleted() {\n $customer = $this->getRandomCustomer();\n $email = $customer->getEmail();\n $customer->delete();\n $this->assertEquals(2, $customer->forgottenPass($email));\n }",
"public function testDeleteUserCredentialsEmbed()\n {\n }",
"public function testUserSSOTokenDelete()\n {\n }",
"function test_credentials()\r\n\t{\r\n\t\tself::makeHtmlLogTitleStartCheck(__METHOD__);\r\n\t\t\r\n\t\t$htmlIsCorrect = test::htmlIsCorrect();\r\n\t\t$htmlIsFalse = test::htmlIsFalse();\r\n\t\t\r\n\t\t$username = 'schf';\r\n\t\t$id = '1231233123123';\r\n\t\t$pubKey = 'TEST-24533456453-4g5h5345h-54h45h-45-6456-TEST';\r\n\t\t$userid = _plugin_utility::getUseridFromUsername($username);\r\n\t\techo 'Check: saveCredentials: $username = '.$username.' and $id = '.$id.' and $pubKey = '.$pubKey.' <br />';\r\n\t\t_plugin_utility::saveCredentials($username, $id, $pubKey);\r\n\t\t$rs = _plugin_utility::getCredentials($userid, $id, $pubKey);\r\n\t\t//INSERT INTO PUBLICKEYS (USERID,KEYVALUE) VALUES ('2', '23452345-346745856-673434');\r\n\t\techo 'Result via getCredentials:<br />';\r\n\t\tvar_dump($rs[0]);\r\n\t\t$checkCredentialFound = $rs[0] ? $htmlIsCorrect : $htmlIsFalse ;\r\n\t\techo '<br />only the first result is shown... but result is '.$checkCredentialFound;\r\n\t\techo '<br />';\r\n\t\r\n\t\t_plugin_utility::deleteCredentials($userid, $id, $pubKey);\r\n\t\t$rs = _plugin_utility::getCredentials($userid, $id, $pubKey);\r\n\r\n\t\tif($rs){\r\n\t\t\techo 'Still got some credentials after deleteCredentials , this is: '.$htmlIsFalse.'<br />';\r\n\t\t}else{\r\n\t\t\techo 'Nothing found after deleteCredentials , this is: '.$htmlIsCorrect.'<br />';\r\n\t\t}\r\n\t\ttest::htmlLineBreak();\r\n\t}",
"public function testDeleteUserCredentialsLookerOpenid()\n {\n }",
"public function testDeleteAccount()\r\n {\r\n }",
"public function delete(TwoFactorAuthenticatableContract $user);",
"public function testDeleteUserCredentialsSaml()\n {\n }",
"public function testDeleteUserAccount()\n {\n $user = $this->prepareSession();\n\n $response = $this->call('POST', self::URI_DELETE_ACCOUNT, [\n '_token' => csrf_token(),\n 'password' => self::PASSWORD,\n ]);\n\n $response->assertStatus(302);\n $response->assertRedirect('/');\n $response->assertSessionHas('notification-success');\n\n $this->assertUserDeleted(true, $user);\n }",
"public function testUserByUserLoginDelete()\n {\n }",
"public function eraseCredentials() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION IS USE TO get total sold coins | function sold_coin()
{
$this->db->select_sum('total_coins');
$this->db->from(DB_PREFIX.'user_config');
$query = $this->db->get();
if($query->num_rows() > 0)
{
return $query->row_array();
}
else
{
return 0;
}
} | [
"function CalcTotalMoney()\n{\n\tglobal $money;\n\n\twhile ($money['copper'] > 100) {\n\t\t$money['silver']++;\n\t\t$money['copper'] = $money['copper'] - 100;\n\t}\n\twhile ($money['silver'] > 100) {\n\t\t$money['gold']++;\n\t\t$money['silver'] = $money['silver'] - 100;\n\t}\n\treturn $money;\n}",
"public function totalBought(): int\n {\n return $this->operations()\n ->buy()\n ->get()\n ->reduce(function ($carry, $operation) {\n return $carry + ($operation->price * $operation->quantity);\n }, 0);\n }",
"public function getTotal()\n {\n return $this->coinsRepository->getTotalAmount($this->customerSession->getId());\n }",
"public static function getEstimatedMoney() {\n $serviceClients = ServiceClient::where('active', '=', 1)->get();\n $total = 0;\n foreach($serviceClients as $srvC){\n $service = Service::find($srvC->fk_service);\n $total += $service->price;\n }\n return $total;\n }",
"public function getAmountInCents();",
"public function getSumOfCostOfAllItemsPayPalBasket()\n {\n }",
"function coin_to_usd($book, $qty, $action) \n{ \n $cnt = 0; // current bid/ask we are looking at\n $total = 0; // total price\n $whats_left = $qty; // how many bitcoins are left to buy/sell \n \n if($action == 'sell') {\n $book_data = $book->bids; \n } else if($action == 'buy') {\n $book_data = $book->asks;\n }\n \n while($whats_left > 0) {\n \n if ($whats_left >= $book_data[$cnt][QTY]){ // need another bid\n \n $total += $book_data[$cnt][QTY] * $book_data[$cnt][BID];\n $whats_left = $whats_left - $book_data[$cnt][QTY];\n \n } else { // no more bids needed\n \n $total += $whats_left * $book_data[$cnt][BID];\n $whats_left = 0;\n }\n \n $cnt++;\n }\n \n return $total + $total * COMMISSION;\n}",
"public function totalEarned() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Return' || $record->transactionType == 'Sold')\n $total += $record->cost;\n\n return $total;\n }",
"function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}",
"function getCartTotalPrice(){\n //call 'getUserFullCart()' to fetch add to cart data\n $cartArray=getUserFullCart();\n\n // Total cart price //\n $totalCartPrice=0;\n foreach($cartArray as $list){\n $totalCartPrice=$totalCartPrice+($list['qty']*$list['price']);\n }\n // ================ //\n return $totalCartPrice;\n }",
"public function getCartTotals();",
"public function getCoins(): int {\r\n return $this->coins;\r\n }",
"public function recalculateTotalPrice();",
"public function calculateTotalCost() {\n\n $total = 0;\n\n foreach($this->items as $item) {\n $total = bcadd($total,$item->calculateCost(),4);\n }\n\n return $total;\n\n }",
"function calculateBitcoinAmount()\n{\n if (isset($_GET['euro'])) {\n $euro = (int)$_GET['euro']; //Dit blokje code (if-statement) kun je laten staan.\n }\n\n /************************************************************ Bijv. ***********************************************************************/\n /* Als de huidigeprijs van 1 hele bitcoin 5000,- kost en jij betaalt 1000,- euro. Dan krijg je 1/5 oftewel 0,2 bitcoin. \n * Om dit te bereken moet je je koopbedrag delen door de huidigeprijs. Aantal gekochte bicoin = koopbedrag/huidigePrijs; = (1000/5000=0,2). \n */\n\n $prijs = getBitcoinPrice();\n $bedrag = $euro; \n $aantalGekochteBicoin = $bedrag / $prijs; //This is the formule of the bitcoin that you get after you buy it for any amount of money. \n\n return [$prijs,$bedrag,$aantalGekochteBicoin]; // The final result that will returned after calculation.\n\n}",
"protected function getTotalPrice(){\n\t\t$price = 0;\n\n\t\tforeach($this->order->orderitems as $orderitem){\n\t\t\t$price += $orderitem->price;\n\t\t};\n\t\t\n\t\treturn $price;\n\t}",
"public function calcTotalCash(){\n\n return $this->cashNotes['50']*50 + $this->cashNotes['20']*20;\n }",
"function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}",
"public function totalSpent() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Purchase')\n $total += $record->amount;\n\n return $total;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of expiresIn | public function getExpiresIn()
{
return $this->expiresIn;
} | [
"public function getExpiresIn()\n {\n return $this->expires_in;\n }",
"public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }",
"public function expiresAfter() : int\n {\n return $this->expiresAfter;\n }",
"public function getExpiration(): int\n {\n return $this->expire;\n }",
"public function getExpirationTime( );",
"function getExpiryTime() {\n return( $this->getResponseValue(\"expiry_time\") );\n }",
"public function getExpiration()\n { \n return $this->expiration;\n }",
"public function cache_expiration() {\n\t\treturn $this->expires;\n\t}",
"public function getExpires()\n {\n return $this->get('Expires');\n }",
"public function getYahooExpiresIn()\n {\n return $this->yahooExpiresIn;\n }",
"public function getExpires()\n {\n return $this->expires;\n }",
"public function getAuthExpireTime()\n {\n $value = $this->get(self::AUTHEXPIRETIME);\n return $value === null ? (integer)$value : $value;\n }",
"public function getAzureExpiresIn()\n {\n return $this->azureExpiresIn;\n }",
"public function getExpirationMs()\n {\n return $this->expiration_ms;\n }",
"public function getExpires()\n {\n if ($this->lifetime === null) {\n return null;\n }\n\n return time() + $this->lifetime;\n }",
"private function expireTime()\n {\n return time() + Config::get('jwt.expiry'); // in seconds\n }",
"function get_expiration()\n\t{\n\t\treturn $this->cache_expiration;\n\t}",
"public function getVkontakteExpiresIn()\n {\n return $this->vkontakteExpiresIn;\n }",
"public function getExpireTime()\n {\n return $this->get(self::_EXPIRE_TIME);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the cum tranche csi. | public function setCumTrancheCsi($cumTrancheCsi) {
$this->cumTrancheCsi = $cumTrancheCsi;
return $this;
} | [
"public function getCumTrancheC() {\n return $this->cumTrancheC;\n }",
"public function setCumBaseTrCCaisse1($cumBaseTrCCaisse1) {\n $this->cumBaseTrCCaisse1 = $cumBaseTrCCaisse1;\n return $this;\n }",
"public function setCumTotSi($cumTotSi) {\n $this->cumTotSi = $cumTotSi;\n return $this;\n }",
"public function setCumBaseSs($cumBaseSs) {\n $this->cumBaseSs = $cumBaseSs;\n return $this;\n }",
"public function setCumBaseTrACaisse1($cumBaseTrACaisse1) {\n $this->cumBaseTrACaisse1 = $cumBaseTrACaisse1;\n return $this;\n }",
"public function setCumCpPris($cumCpPris) {\n $this->cumCpPris = $cumCpPris;\n return $this;\n }",
"public function setCumBrutAl($cumBrutAl) {\n $this->cumBrutAl = $cumBrutAl;\n return $this;\n }",
"public function setCumTrACaisse3($cumTrACaisse3) {\n $this->cumTrACaisse3 = $cumTrACaisse3;\n return $this;\n }",
"public function setCumMtCpPris($cumMtCpPris) {\n $this->cumMtCpPris = $cumMtCpPris;\n return $this;\n }",
"public function setCumBrutCaisse1($cumBrutCaisse1) {\n $this->cumBrutCaisse1 = $cumBrutCaisse1;\n return $this;\n }",
"public function setCumBaseTrCCaisse3($cumBaseTrCCaisse3) {\n $this->cumBaseTrCCaisse3 = $cumBaseTrCCaisse3;\n return $this;\n }",
"public function setCumNetImpos($cumNetImpos) {\n $this->cumNetImpos = $cumNetImpos;\n return $this;\n }",
"public function getCumBaseTrC() {\n return $this->cumBaseTrC;\n }",
"public function setCumMtCpPris1($cumMtCpPris1) {\n $this->cumMtCpPris1 = $cumMtCpPris1;\n return $this;\n }",
"public function getCumTrancheAsi() {\n return $this->cumTrancheAsi;\n }",
"public function setCumProvCp($cumProvCp) {\n $this->cumProvCp = $cumProvCp;\n return $this;\n }",
"public function getCumTrACaisse1() {\n return $this->cumTrACaisse1;\n }",
"public function setCumTrCCaisse1(?float $cumTrCCaisse1): Bulletins {\n $this->cumTrCCaisse1 = $cumTrCCaisse1;\n return $this;\n }",
"public function setCumBaseTrACaisse2($cumBaseTrACaisse2) {\n $this->cumBaseTrACaisse2 = $cumBaseTrACaisse2;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of fecha_inicio | public function setFecha_inicio($fecha_inicio)
{
include '../config/Database.php';
$this->fecha_inicio = $db->real_escape_string($fecha_inicio);
//return $this;
} | [
"public function setFecha_ini($fecha_ini){\n $this->fecha_ini = $fecha_ini;\n }",
"function set_fechaIngreso( $fechaIngreso ) {\n // sets the value of fechaIngreso\n $this->fechaIngreso = $fechaIngreso;\n }",
"function setFecha($fecha) {\r\n\t\t$this->fecha = $fecha;\r\n }",
"public function setFecha($fecha){\n \t$this->fecha = $fecha;\n\t}",
"public function setDtInicio($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->dt_inicio !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->dt_inicio !== null && $tmpDt = new DateTime($this->dt_inicio)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->dt_inicio = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = TbcursoversaoPeer::DT_INICIO;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}",
"public function setDtInicioFila($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->dt_inicio_fila !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->dt_inicio_fila !== null && $tmpDt = new DateTime($this->dt_inicio_fila)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->dt_inicio_fila = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = TbperiodoPeer::DT_INICIO_FILA;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}",
"public function setFecha_inicio_joven($fecha_inicio_joven) {\n $this->fecha_inicio_joven = $fecha_inicio_joven;\n }",
"public function getFechaInicio()\r\n {\r\n return $this->FechaInicio;\r\n }",
"public function setFecha_ini($fecha_ini)\n {\n $this->fecha_ini = $fecha_ini;\n\n return $this;\n }",
"public function getFechaInicio()\r\n {\r\n return $this->fechaInicio;\r\n }",
"public function setFecha_vigencia_inicio($fecha_vigencia_inicio)\n {\n $this->fecha_vigencia_inicio = $fecha_vigencia_inicio;\n }",
"public function getFechaInicio()\n {\n return $this->fechaInicio;\n }",
"public function setFecha_reinicio($fecha_reinicio){\n $this->fecha_reinicio = $fecha_reinicio;\n }",
"public function setDataInicioFat(\\DateTime $dataInicioFat)\n {\n $this->dataInicioFat = $dataInicioFat;\n return $this;\n }",
"public function setDtInicioCadastro($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->dt_inicio_cadastro !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->dt_inicio_cadastro !== null && $tmpDt = new DateTime($this->dt_inicio_cadastro)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->dt_inicio_cadastro = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = TbperiodoPeer::DT_INICIO_CADASTRO;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}",
"public function setDtInicioAjusteFila($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->dt_inicio_ajuste_fila !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->dt_inicio_ajuste_fila !== null && $tmpDt = new DateTime($this->dt_inicio_ajuste_fila)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->dt_inicio_ajuste_fila = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = TbperiodoPeer::DT_INICIO_AJUSTE_FILA;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}",
"public function setDataInicioFaturamento(\\DateTime $dataInicioFaturamento)\n {\n $this->dataInicioFaturamento = $dataInicioFaturamento;\n return $this;\n }",
"public function setHoraInicio( $horaInicio ) {\n $this->horaInicio = $horaInicio;\n }",
"public function getFechaInicio( ){\n\t\treturn $this->fechaInicio;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the Appointment based on its ID. | public function findById(int $id): AppointmentEntity
{
return AppointmentEntity::fromResponse(
$this->client->get("Appointments/$id")
);
} | [
"public function fetchAppointmentById($id);",
"public function get_appointment($id) {\n return $this->appointments->get_child_by_id($id);\n }",
"public function find($id)\n {\n foreach ($this->findAll() as $application) {\n if ($id == $application->getId()) {\n return $application;\n }\n }\n\n return null;\n }",
"public function getAppointment($appointmentId) {\n $this->getAppointments();\n foreach ($this->appointments as $appointment) {\n if ($appointment->getId() === $appointmentId) {\n return $appointment;\n }\n }\n return NULL;\n }",
"public function find($id) {\n return $this->booking->findOrFail($id);\n }",
"public function findAppointments($ownerId);",
"public function findAllAppointmentByUser($id)\r\n {\r\n //SQL statement\r\n $stmt = $this->conn->prepare(\"SELECT * FROM \" . $this->table . \" WHERE UserID=? AND Checked_IN = ?\");\r\n //Query excuted\r\n $stmt->execute([$id, 0]);\r\n $Appointments = [];\r\n while ($row = $stmt->fetch()) {\r\n //While loop to collect all results and store them in a Appointment Object\r\n $Appointment = new Appointment($row[\"AppointmentID\"], $row[\"UserID\"], $row[\"Date\"], $row[\"Time\"], $row[\"Reason\"], $row[\"Checked_IN\"]);\r\n $Appointments[] = $Appointment;\r\n }\r\n return $Appointments;\r\n }",
"public function getAppointmentDetailsForTimeOffWithID($id = 0)\n\t\t{\n\t\t\t// error_log(\"looking up timeoff details for \" . $id . \"\\n\", 3, JPATH_ROOT.DS.\"logs\".DS.\"salonbook.log\");\n\t\t\t\n\t\t\t// Load the data\n\t\t\tif ( $id > 0 )\n\t\t\t{\n\t\t\t\t$db = JFactory::getDBO();\n\t\t\t\t\n\t\t\t\t$appointmentQuery = \"SELECT A.*, concat(STYLIST.firstname,' ',STYLIST.lastname) as stylistName, U.name, STYLIST.firstname, U.email, STYLIST.calendarLogin, STYLIST.calendarPassword FROM `#__salonbook_appointments` A join `#__users` U ON A.user = U.id join `#__salonbook_users` STYLIST on A.stylist = STYLIST.user_id WHERE A.id = $id\";\n\t\t\t\t$db->setQuery( $appointmentQuery );\n\t\t\t\t\n\t\t\t\t// error_log(\"QUERY \" . $appointmentQuery . \"\\n\", 3, JPATH_ROOT.DS.\"logs\".DS.\"salonbook.log\");\n\t\t\t\t\n\t\t\t\t$this->_appointmentData = $db->loadAssocList();\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $this->_appointmentData;\n\t\t}",
"public static function get_meeting_by_id( $id ) {\n\t\tglobal $kyssdb;\n\n\t\tif ( ! is_numeric( $id ) )\n\t\t\treturn false;\n\t\t$id = intval( $id );\n\n\t\tif ( $id < 1 )\n\t\t\treturn false;\n\n\t\tif ( ! $meeting = $kyssdb->query(\n\t\t\t\"SELECT * \n\t\t\tFROM {$kyssdb->riunioni} INNER JOIN {$kyssdb->eventi} \n\t\t\t\tON {$kyssdb->riunioni}.ID = {$kyssdb->eventi}.ID\n\t\t\tWHERE {$kyssdb->eventi}.ID = {$id}\"\n\t\t) )\n\t\t\treturn false;\n\n\t\tif ( $meeting->num_rows == 0 )\n\t\t\treturn new KYSS_Error( 'meeting_not_found', 'Meeting not found', array( 'ID' => $id ) );\n\n\t\t$meeting = $meeting->fetch_object( 'KYSS_Meeting' );\n\n\t\treturn $meeting;\n\t}",
"public function find($id) {\n return $this->bookingItems->find($id);\n }",
"public function getAppointment($appointmentId){\n return $this->appointmentModel->getAppointment($appointmentId);\n }",
"public function findApiObject($id)\n {\n $event = $this->eventApi->find($id);\n\n if($event) {\n return $event;\n }\n\n return false;\n }",
"public function find($id) {\n\t\treturn $this->employee->info()->filterById($id)->first();\n\t}",
"public function find($id) {\n return $this->bookingMechanic->find($id);\n }",
"public function findBookingById($id);",
"public function getOne($id)\n {\n return $this->api->request('GET', '/apps/'.$id, [\n 'Authorization' => 'Basic '.$this->api->getConfig()->getUserAuthKey(),\n ]);\n }",
"public function find(ApplicationId $id): ApplicationModelContract;",
"protected function findModel($id)\n {\n if (($model = Appointments::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find($id): Schedule;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create entity log | protected function createEntityLog($entity)
{
$who = !empty($this->get('security.token_storage')->getToken())?$this->get('security.token_storage')->getToken()->getUser():'Anonymous';
if (method_exists($entity, 'setCreatedBy')) {
$entity->setCreatedBy($who);
}
return $entity;
} | [
"public function createSingleLog(){\n\n }",
"public function dataCreationLog()\n {\n $this->objectcreatelogger->log($this->logLevel, $this->logMessage, ['detail' => $this->logDetail]);\n }",
"public function createLogs($obj){\n\t\treturn;\n\t}",
"function createLog() : Log\n {\n return new FileLog();\n }",
"protected function createLogFile() {}",
"public function testLogTemplate() {\n $entity = EntityTest::create([\n 'name' => 'Camelids',\n 'type' => 'bar',\n ]);\n $entity->save();\n\n $log = Log::load(1);\n $this->assertNotNull($log);\n $view = $this->container->get('entity_type.manager')->getViewBuilder($log->getEntityTypeId())->view($log);\n $this->render($view);\n $this->assertText(\"{$entity->label()} was created.\");\n }",
"private function log()\n {\n /*\n * Commented out due to lack of DB\n try {\n \\Ad\\System\\Mail::create(array(\n 'customer_id' => $this->customer_id,\n 'reference' => $this->reference,\n 'to_email' => $this->to_email,\n 'to_name' => $this->to_name,\n 'from_email' => $this->from_email,\n 'subject' => $this->_mailer->Subject,\n 'body' => $this->_mailer->Body,\n 'token' => $this->token,\n 'status' => 'sent',\n 'created_by' => \\Forge\\Auth::user()->user_id\n //'created_by' => 1\n ));\n } catch (\\Exception $e) {\n // ?\n }\n */\n }",
"public static function createEntity();",
"public function logEntity(ContentEntityInterface $entity = NULL, string $action) {\n $this->deleteLoggedEntity($entity->uuid());\n\n $json = [];\n if ($action !== 'delete') {\n $json = $this->gatsbyInstantPreview->getJson($entity);\n }\n\n $json['id'] = $entity->uuid();\n $json['action'] = $action;\n\n $log_entry = [\n 'entity_uuid' => $entity->uuid(),\n 'title' => $entity->label(),\n 'entity' => $entity->getEntityTypeId(),\n 'bundle' => $entity->bundle(),\n 'action' => $action,\n 'json' => json_encode($json),\n ];\n\n $log = $this->entityTypeManager->getStorage('gatsby_log_entity')\n ->create($log_entry);\n $log->save();\n }",
"function create_log_entry ($email=null) {\n\n //actual log entry is stored here\n $log_entry = \"\";\n\n //variables used to cycle prepare array information for $log_entry\n $info_log_prepared = \"\";\n $count = 0;\n\n //determine if log was successful\n $log_result = false;\n\n //prepare values in info_array for $log_entry\n if (count($this->info_array)>0) {\n reset($this->info_array);\n do {\n if ($count>0) $info_log_prepared .= \"&\";\n $info_log_prepared .= key($this->info_array).\"=\".$this->info_array[key($this->info_array)];\n $count++;\n } while (next($this->info_array));\n }\n\n $log_entry = \"[\".$this->date.\"] \\\"\".$this->message.\"\\\" [\".$this->location.\"] [\".$info_log_prepared.\"]\\n\";\n if ($this->debug_level>0) printf(\"\\nLOG_ENTRY: %s <br>\\n\",$log_entry);\n return $log_entry;\n }",
"public function writeToLog()\n {\n $modx = evolutionCMS();\n\n if ($this->entry['internalKey'] == \"\") {\n $modx->webAlertAndQuit(\"Logging error: internalKey not set.\");\n }\n if (empty($this->entry['action'])) {\n $modx->webAlertAndQuit(\"Logging error: action not set.\");\n }\n if ($this->entry['msg'] == \"\") {\n $this->entry['msg'] = self::getAction($this->entry['action'], $this->entry['itemId']);\n if ($this->entry['msg'] == \"\") {\n $modx->webAlertAndQuit(\"Logging error: couldn't find message to write to log.\");\n }\n }\n\n $fields['timestamp'] = time();\n $fields['internalKey'] = $this->entry['internalKey'];\n $fields['username'] = $this->entry['username'];\n $fields['action'] = $this->entry['action'];\n $fields['itemid'] = $this->entry['itemId'];\n $fields['itemname'] = $this->entry['itemName'];\n $fields['message'] = $this->entry['msg'];\n $fields['ip'] = $this->getUserIP();\n $fields['useragent'] = $_SERVER['HTTP_USER_AGENT'];\n\n $insert_id = ManagerLog::query()->create($fields)->getKey();\n if (!$insert_id) {\n $modx->getService('ExceptionHandler')\n ->messageQuit(\n \"Logging error: couldn't save log to table! Error code: \" . $modx->getDatabase()->getLastError()\n );\n } else {\n $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->getConfig('manager_log_limit') : 3000;\n $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->getConfig('manager_log_trim') : 100;\n if (($insert_id % $trim) === 0) {\n $modx->rotate_log('manager_log', $limit, $trim);\n }\n }\n }",
"protected function dumpCreateEntity($entity)\n {\n $migrationHelper = $this->migrationHelper;\n $migrationEntityReferenceHelper = $this->migrationEntityReferenceHelper;\n\n $migration = $migrationHelper->generateMigration(self::ACTION_CREATE, $entity);\n\n //on creation we create a migration entity reference\n $reference = $migration->getReference();\n\n $migrationEntityReferenceHelper->createMigrationEntityReference($entity, $reference);\n $this->createMigrationVersion($migration);\n\n $this->dumpMigration($migration);\n }",
"public function createEntity();",
"function makeApiLog($data)\r\n {\r\n $log = new \\App\\Repositories\\Activity\\API\\Log;\r\n $log->add($data);\r\n }",
"abstract protected function insertLogRecord($om, $log);",
"public function createLogModel(Request $request)\n {\n user_can(['audit_create']);\n\n $logModelData = [];\n\n $logModelData['fqn'] = '\\App\\Modules\\\\' . $request->get('fqn');\n\n $logModel = LogModel::create($logModelData);\n\n return response()->json([\n 'message' => 'Se creò el item con èxito!',\n 'data' => $logModel,\n ], 201);\n }",
"public function created(Log $log)\n {\n //\n }",
"public function create_log($log_array = array())\n\t{\n\n\t\tif(is_array($log_array['pid'])){\n\t\t\t\tforeach($log_array['pid'] as $id){\n\t\t\t\t\t$insert_array = array(\n\t\t\t\t\t\t'pid'\t\t\t=> $id,\n\t\t\t\t\t\t'module'\t\t=> $log_array['module'],\n\t\t\t\t\t\t'action'\t\t=> $log_array['action'],\n\t\t\t\t\t\t'table'\t\t\t=> $log_array['table'],\n\t\t\t\t\t\t'comments'\t\t=> $log_array['comments'],\n\t\t\t\t\t\t'uid'\t\t\t=> $this->session->userdata['profile_data']['0']['custID'],\n\t\t\t\t\t\t'created_on'\t=> $this->config->item('global_datetime'),\n\t\t\t\t\t\t'ip_address'\t=> $this->config->item('ip_address')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif($insert_array) return $this->db->insert_batch('activity_log',$insert_array);\n\t\t}\n\t\telse{\n\t\t\t$insert_array = array(\n\t\t\t\t'uid'\t\t\t=> $this->session->userdata['profile_data']['0']['custID'],\n\t\t\t\t'created_on'\t=> $this->config->item('global_datetime'),\n\t\t\t\t'ip_address'\t=> $this->config->item('ip_address')\n\t\t\t);\n\t\t\t$insert_array = array_merge($log_array,$insert_array);\n\t\t\treturn $this->db->insert('activity_log',$insert_array);\n\t\t}\n\t}",
"public function putLogs();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert the new phone and make it inactive | function setPhone($phoneNum) {
$query = "INSERT INTO phones (phonenumber, active, name) VALUES ('" . $phoneNum . "', 0, 'Unknown') ";
$result = runQuery($query);
} | [
"public function saveUserPhone()\n {\n $qry = \"update customer_registration set cust_phone1='\" . prepareStringForMySQL($this->cust_phone1) . \"' where id=\" . $this->id . \"\";\n dbAbstract::Update($qry);\n $this->saveToSession();\n }",
"public function changePhonenumber()\n {\n echo \"ENTER new Phone Number \\n\";\n $num = UtilityAdd::moblieNumber();\n $data = file_get_contents('address.json');\n $json_arr = json_decode($data, true);\n $json_arr[$this->index][\"address\"][\"PhoneNumber\"] = $num;\n file_put_contents('address.json', json_encode($json_arr));\n }",
"public function addNewPhone()\n {\n $titre = 'New Phone';\n $this->render('achat','achatPhone', compact('titre'));\n }",
"function addPhone($phone, $phoneType ) {\n \n $db = dbconnect();\n $stmt = $db->prepare(\"INSERT INTO phone SET phone = :phone, phonetype = :phonetype, logged = now(), lastupdated = now()\");\n $binds = array(\n \":phone\" => $phone,\n \":phonetype\" => $phoneType,\n );\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) {\n return true;\n }\n \n return false;\n}",
"public function insert_or_update_phone_info()\n\t{\n\t\t$attr = array(\n\t\t\t'field_name' => 'phone',\n\t\t\t'value' => $this->input->post('phone')\n\t\t);\n\n\n\t\t$result = $this->get_phone_info();\n\t\tif($result){\n\t\t\t$this->db->where('field_name', 'phone');\n\t\t\t$this->db->update('template', $attr);\n\n\t\t\tif($this->db->affected_rows()){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t$insert = $this->db->insert('template', $attr);\n\n\t\tif($insert): return TRUE; else: return FALSE; endif;\n\t}",
"private function registerTelephone() {\n\t\ttry {\n\t\t\tif(!empty($this->contactRow['PhoneCountry1']) && !empty($this->contactRow['PhoneArea1']) && !empty($this->contactRow['PhoneNumber1'])) civicrm_api3('Phone','Create', array('contact_id' => $this->contactIdentifier, 'phone' => \"+\".$this->contactRow['PhoneCountry1'].$this->contactRow['PhoneArea1'].$this->contactRow['PhoneNumber1'], 'location_type_id' => 1, 'is_primary' => 1, 'phone_type_id' => 1));\n\t\t\tif(!empty($this->contactRow['PhoneCountry2']) && !empty($this->contactRow['PhoneArea2']) && !empty($this->contactRow['PhoneNumber2'])) civicrm_api3('Phone','Create', array('contact_id' => $this->contactIdentifier, 'phone' => \"+\".$this->contactRow['PhoneCountry2'].$this->contactRow['PhoneArea2'].$this->contactRow['PhoneNumber2'], 'location_type_id' => 1, 'phone_type_id' => 1));\n\t\t\tif(!empty($this->contactRow['MobileCountry1']) && !empty($this->contactRow['MobileArea1']) && !empty($this->contactRow['MobileNumber1'])) civicrm_api3('Phone','Create', array('contact_id' => $this->contactIdentifier, 'phone' => \"+\".$this->contactRow['MobileCountry1'].$this->contactRow['MobileArea1'].$this->contactRow['MobileNumber1'], 'location_type_id' => 1, 'phone_type_id' => 2));\n\t\t\tif(!empty($this->contactRow['MobileCountry2']) && !empty($this->contactRow['MobileArea2']) && !empty($this->contactRow['MobileNumber2'])) civicrm_api3('Phone','Create', array('contact_id' => $this->contactIdentifier, 'phone' => \"+\".$this->contactRow['MobileCountry2'].$this->contactRow['MobileArea2'].$this->contactRow['MobileNumber2'], 'location_type_id' => 1, 'phone_type_id' => 2));\t\t\n\t\t\tif(!empty($this->contactRow['FaxNumber1'])) civicrm_api3('Phone','Create', array('contact_id' => $this->contactIdentifier, 'phone' => \"+\".$this->contactRow['FaxCountry1'].$this->contactRow['FaxArea1'].$this->contactRow['FaxNumber1'], 'location_type_id' => 1, 'phone_type_id' => 3));\t\t\n\t\t} catch (Exception $e) {\n\t\t\techo \"E-mail registration failed for contact \".$this->contactIdentifier.\"\\r\\n\";\n\t\t\techo $e;\n\t\t}\n\t}",
"public static function modifierTelephone(){\n $utilisateur = $_SESSION['utilisateurConnecter'];\n $utilisateurConnecter = $_SESSION['utilisateurConnecter'];\n if(isset($_REQUEST['edit'])){\n try{\n ModelTelephone::modifierTelephone($_REQUEST['idTelephone']);\n $_SESSION['utilisateurConnecter'] = ModelGestionUtilisateur::rechercheUtilisateur($utilisateur->email);\n $utilisateur = $_SESSION['utilisateurConnecter'];\n $vueConfirmation[] = \"Le numéro de téléphone à bien été ajouter.\";\n } catch(PDOException $ex){;\n $vueErreur[] = $ex;\n } catch(Exception $e){\n $vueErreur[]=$e->getMessage();\n }\n }\n require_once('vue/pages/profil.php');\n }",
"public function SavePhone() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstPhoneType) $this->objPhone->PhoneTypeId = $this->lstPhoneType->SelectedValue;\n\t\t\t\tif ($this->lstAddress) $this->objPhone->AddressId = $this->lstAddress->SelectedValue;\n\t\t\t\tif ($this->lstPerson) $this->objPhone->PersonId = $this->lstPerson->SelectedValue;\n\t\t\t\tif ($this->lstMobileProvider) $this->objPhone->MobileProviderId = $this->lstMobileProvider->SelectedValue;\n\t\t\t\tif ($this->txtNumber) $this->objPhone->Number = $this->txtNumber->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Phone object\n\t\t\t\t$this->objPhone->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function setNewPhone($value)\n {\n return $this->set('NewPhone', $value);\n }",
"public function editPhoneNumber() {\n // Check user to be logged in\n $this->_checkIfUserIsLoggedIn();\n\n // Get new phone number\n $this->_getPhoneNumber();\n\n // Validate new phone number\n $this->_validatePhoneNumber();\n\n // Update phone number\n $this->_updatePhoneNumber();\n }",
"function setPhone($newPhone){\n //check if the phone number is numeric\n if(is_numeric($newPhone)) {\n $this->phone = $newPhone;\n }\n //if not set to default, 0000000000\n $this->phone = \"0000000000\";\n }",
"function setPhone($new_phone)\n {\n $this->schoolPhone = $new_phone;\n }",
"function setPhone($p){\r\n $this->phone = $p; \r\n }",
"public function creating(Phone $phone)\n {\n // something\n }",
"public function setPhone(){\r\n\t\t$CPhone = ClientPhone::model() -> findByAttributes(array('mangoTalker' => $this -> mangoTalker), array('with' => 'phone'));\r\n\t\tif ($CPhone) {\r\n\t\t\t$this -> phone = $CPhone -> phone;\r\n\t\t\t$this -> i = $this -> phone -> i;\r\n\t\t}\r\n\t}",
"public function deletePhone()\n {\n $this->forceFill([\n 'phone' => null,\n ])->save();\n \n }",
"function actionAddPhoneToName(){\r\n $id = $_POST['id'];\r\n// $tel = (string)$_POST['tel'];\r\n// $tel = '+'.substr($tel,1);\r\n\r\n $phone = '+'.substr($_POST['phone'],1);\r\n $previd = $_POST['previd'];\r\n $phone = str_replace('/\\D/g','',$phone);\r\n $res = Clients::getClientById($id);\r\n if($res['phone2']=='') $pole = 'phone2';\r\n elseif($res['phone3']=='') $pole = 'phone3';\r\n $res2 = Clients::updateParam($id,$pole,$phone);\r\n if($res2){\r\n $res3 = Clients::delClientById($previd);\r\n }\r\n echo $res3;\r\n// echo $phone;\r\n return true;\r\n }",
"public function setInactive()\n {\n $this->isActive = false;\n $this->save(); // make sure the record is saved\n }",
"function markProfileInvalid($mobile='')\n{\n\tif($mobile=='')\n\t\treturn;\n\t$mobileno =substr($mobile,-10,10);\n $sql=\"SELECT PROFILEID FROM newjs.JPROFILE WHERE PHONE_MOB IN('$mobileno','0$mobileno','$mobile') ORDER BY 'LAST_LOGIN_DT' desc limit 1\";\n $res=mysql_query_decide($sql) or logError($sql);\n if(mysql_num_rows($res)){\n $row=mysql_fetch_array($res);\n $profileid=$row['PROFILEID'];\n\t\tphoneUpdateProcess($profileid,'','','I','SMS');\n }\n\t//SEND_MOBSMS($profileid,$mobile,'I');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows to filter range data by applying a query with the given operator. | protected function applyFilter($operator, $fieldData, $data)
{
switch ($operator) {
case Operators::IS_EMPTY:
$this->qb->field($fieldData)->equals(null);
break;
default:
throw new \Exception(
sprintf(
'Operator %s not supported by range attribute filter',
$operator
)
);
}
} | [
"public function setQueryOperator($operator);",
"private function applyQuery( $query, $attribute, $operator, $comparator = 'and' )\n\t{\n\t\t// check if operator is a range query\n\t\tif( $operator instanceof RangeQuery )\n\t\t{\n\t\t\t// iterate the values and apply to the query for each seperate operator\n\t\t\tforeach( $operator->getValues() as $value )\n\t\t\t{\n\t\t\t\t$this->applyQuery($query, $attribute, $value, $operator->isAllSameOperator('=')? 'or': 'and');\n\t\t\t}\n\n\t\t\t// stop executing\n\t\t\treturn $query;\n\t\t}\n\n\t\t// get the value and method\n\t\t$value = $operator->getValue();\n\t\t$method = $operator->getMethod();\n\n\t\t// check if the value is null\n\t\tif( is_null($value) )\n\t\t{\n\t\t\t// check if the method or operator is an inverter\n\t\t\tif( $operator->isNot() )\n\t\t\t{\n\t\t\t\t// applying whereNotNull\n\t\t\t\treturn $query->whereNotNull($attribute, $comparator);\n\t\t\t}\n\t\t\t\n\t\t\t// applying whereNull\n\t\t\treturn $query->whereNull($attribute, $comparator);\n\t\t}\n\n\t\t// check if the method is LIKE\n\t\tif( $method == 'LIKE' )\n\t\t{\n\t\t\t// add % to the value\n\t\t\t$value = '%'. str_replace(' ', '%', $value) .'%';\n\t\t}\n\n\t\t// applying query\n\t\treturn $query->where($attribute, $method, $value, $comparator);\n\t}",
"private function buildHalfBoundedRangeCondition($operator, $operands)\n {\n if (!isset($operands[0], $operands[1])) {\n throw new InvalidArgumentException(\"Operator '$operator' requires two operands.\");\n }\n\n list($column, $value) = $operands;\n if ($this->db->dslVersion < 7) {\n if ($column === '_id') {\n $column = '_uid';\n }\n }\n\n $range_operator = null;\n\n if (in_array($operator, ['gte', '>='])) {\n $range_operator = 'gte';\n } elseif (in_array($operator, ['lte', '<='])) {\n $range_operator = 'lte';\n } elseif (in_array($operator, ['gt', '>'])) {\n $range_operator = 'gt';\n } elseif (in_array($operator, ['lt', '<'])) {\n $range_operator = 'lt';\n }\n\n if ($range_operator === null) {\n throw new InvalidArgumentException(\"Operator '$operator' is not implemented.\");\n }\n\n $filter = [\n 'range' => [\n $column => [\n $range_operator => $value\n ]\n ]\n ];\n\n return $filter;\n }",
"public function setWhereOperator($operator) {\n\n $this->whereOperator = $operator;\n\n return $this;\n }",
"public function setOperator($operator) {\n if (count($this->filters) > 0) {\n $filter = $this->filters[count($this->filters) - 1];\n $filter->setOperator($operator);\n }\n return $this;\n }",
"protected function _applyRange()\n {\n $interval = $this->getInterval();\n\n if (!$interval) {\n return $this;\n }\n\n list($from, $to) = $interval;\n if ($from === '' && $to === '') {\n return $this;\n }\n\n $field = $this->_getFilterField();\n $limits = array();\n if (!empty($from)) {\n $limits['gte'] = $from;\n }\n if (!empty($to)) {\n $limits['lte'] = $to;\n }\n\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $query->addFilter('range', array($this->_getFilterField() => $limits), $this->_getFilterField());\n\n return $this;\n }",
"protected function filterAllowedOperations(&$query)\n {\n switch ( $this->operation ) {\n case 'in':\n if ( is_array($this->value) ) {\n $query->whereIn($this->field_name, $this->value);\n }\n break;\n case 'not in':\n if ( is_array($this->value) ) {\n $query->whereNotIn($this->field_name, $this->value);\n }\n break;\n case 'like':\n if ( is_string($this->value) ) {\n $searchString = Str::lower($this->value);\n $query->whereRaw(\"LOWER($this->field_name) like '%$searchString%'\");\n }\n break;\n case 'search':\n if ( is_array($this->value) ) {\n foreach ( $this->value as $searchString ) {\n $searchString = Str::lower($searchString);\n $query->orWhereRaw(\"LOWER($this->field_name) like '%$searchString%'\");\n }\n }\n break;\n case 'scope':\n call_user_func_array(\n [ $query, $this->value ],\n is_array($this->operationParameters) ? $this->operationParameters : [ $this->operationParameters ]\n );\n break;\n default:\n $query->where($this->field_name, $this->operation, $this->getDateValue($this->value));\n\n }\n }",
"public function setOperator($var)\n {\n GPBUtil::checkEnum($var, \\Keboola\\StorageDriver\\Command\\Table\\ImportExportShared\\TableWhereFilter\\Operator::class);\n $this->operator = $var;\n\n return $this;\n }",
"protected function operator($operator, $value)\n {\n $this->wrapEqualityCriteria();\n\n if ($this->currentField) {\n $this->filters[$this->currentField][$operator] = $value;\n } else {\n $this->filters[$operator] = $value;\n }\n\n return $this;\n }",
"public function setOperator($operator)\n {\n if (!in_array($operator, array('=', 'LIKE', '<=', '<', '>=', '>'))) {\n // TODO: need custom mutli lang exception\n throw new Exception('Invalid field operator');\n }\n\n $this->operator = $operator;\n }",
"abstract public function mapConditionOperator($operator);",
"private function queryOperator($op)\n {\n switch ($op = trim($op)) {\n case 'CONTAINS':\n return 'LIKE';\n break;\n case '<':\n case '>':\n case '=':\n case 'OR':\n case 'AND':\n return $op;\n break;\n default:\n throw new Exception('Wrong or missing operator, allowed only CONTAINS, <, >, =, OR, AND');\n break;\n }\n }",
"public function findByOperator(Operator $operator)\n {\n return $this->createQueryBuilder('i')\n ->join('i.user', 'u', 'WITH', 'u.operator = :operator')\n ->andWhere('i.dateEnd IS NULL')\n ->setParameter('operator', $operator)\n ->getQuery()\n ->getResult();\n }",
"public function betweenWhere($expr, $minimum, $maximum, $useOrWhere=null);",
"protected function _applyPriceRange()\n {\n $interval = $this->getInterval();\n\n if (!$interval) {\n return $this;\n }\n\n list($from, $to) = $interval;\n if ($from === '' && $to === '') {\n return $this;\n }\n\n $field = $this->_getFilterField();\n $limits = array();\n if (!empty($from)) {\n $limits['gte'] = $from;\n }\n if (!empty($to)) {\n $limits['lte'] = $to;\n }\n\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $query->addFilter('range', array($this->_getFilterField() => $limits), $this->_getFilterField());\n\n return $this;\n }",
"public function orWhereDate($column, $operator, $value = null)\n {\n }",
"public function setOp($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Firestore\\V1\\StructuredQuery\\FieldFilter\\Operator::class);\n $this->op = $var;\n\n return $this;\n }",
"public function where($column, $value, $operator = '=', $or = false);",
"public function andWhere($column, $operator = '', $value = '');"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the given record on the database with the blobdata | public abstract function updateOn( $blobData, $keyValue ); | [
"function dbi_update_blob ( $table, $column, $key, $data ) \n\t{\n\t\tassert ( '! empty ( $table )' );\n\t\tassert ( '! empty ( $column )' );\n\t\tassert ( '! empty ( $key )' );\n\t\tassert ( '! empty ( $data )' );\n\t\t\n\t\tif ( strcmp ( $GLOBALS[\"db_type\"], \"mysql\" ) == 0 ) {\n\t\tif ( function_exists ( \"mysql_real_escape_string\" ) )\n\t\t return $this->dbi_execute ( \"UPDATE $table SET $column = '\" .\n\t\t mysql_real_escape_string ( $data ) .\n\t\t \"' WHERE $key\" );\n\t\telse {\n\t\t return $this->dbi_execute ( \"UPDATE $table SET $column = '\" .\n\t\t addslashes ( $data ) .\n\t\t \"' WHERE $key\" );\n\t\t}\n\t\t} else if ( strcmp ( $GLOBALS[\"db_type\"], \"sqlite\" ) == 0 ) {\n\t\treturn $this->dbi_execute ( \"UPDATE $table SET $column = '\" .\n\t\t sqlite_udf_encode_binary ( $data ) .\n\t\t \"' WHERE $key\" );\n\t\t} else if ( strcmp ( $GLOBALS[\"db_type\"], \"mssql\" ) == 0 ) {\n\t\treturn $this->dbi_execute ( \"UPDATE $table SET $column = 0x\" .\n\t\t bin2hex( $data ) . \n\t\t \" WHERE $key\" );\n\t\t} else if ( strcmp ( $GLOBALS[\"db_type\"], \"postgresql\" ) == 0 ) {\n\t\treturn $this->dbi_execute ( \"UPDATE $table SET $column = '\" .\n\t\t pg_escape_bytea ( $data ) .\n\t\t \"' WHERE $key\" );\n\t\t} else {\n\t\t// TODO!\n\t\tdie_miserable_death ( \"Unfortunately, there is no implementation \" .\n\t\t \"for dbi_update_blob for your database (\" . $GLOBALS[\"db_type\"] . \")\" );\n\t\t}\n\t}",
"function updateBlob($id, $filePath, $mime) {\n\n $blob = fopen($filePath, 'rb');\n\n $sql = \"UPDATE Files\n SET mime = :mime,\n data = :data\n WHERE id = :id;\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->bindParam(':mime', $mime);\n $stmt->bindParam(':data', $blob, PDO::PARAM_LOB);\n $stmt->bindParam(':id', $id);\n\n return $stmt->execute();\n}",
"public function update($record);",
"function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') {\n\t\treturn $this->Execute(\"UPDATE $table SET $column=? WHERE $where\",array($val)) != false;\n\t}",
"function update($record)\n {\n\t// convert object to associative array, if needed\n\tif (is_object($record))\n\t{\n\t $data = get_object_vars($record);\n\t} else\n\t{\n\t $data = $record;\n\t}\n\t// update the DB table appropriately\n\t$key = $data[$this->_keyField];\n\t$this->db->where($this->_keyField, $key);\n\t$object = $this->db->update($this->_tableName, $data);\n }",
"function update() {\n\t\treset($this->data);\n\t\twhile(list($key,$val)=each($this->data)){\n\t\t\tif($key != $this->idKey) {\n\t\t\t\tif($val === NULL || $val == '') {\n\t\t\t\t\t$my_sql[] = $key . \" = NULL\";\n\t\t\t\t} else {\n //dump($val, 'val');\n if(in_array($key, $this->binaryFields)) {\n //if(strpos($val, \"'\"))\n // raiseError(\"invalid character in binary field data\");\n $my_sql[] = $key . \" = '\". addslashes($val) . \"'\";\n } else {\n $my_sql[] = $key . \" = '\" . sotf_Utils::magicQuotes($val) . \"'\";\n }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$my_sql = implode(\", \", $my_sql);\n\n //execute the query\n $res = $this->db->query(\"UPDATE \" . $this->tablename . \" SET \" . $my_sql . \" WHERE \" . $this->idKey . \"='\" . $this->id . \"' \");\n \n //if the query is dead, stop executio, output error\n if(DB::isError($res)){\n raiseError($res);\n }\n\t}",
"public function updateRecord($formData)\n {\n }",
"function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\t{\n\t\t\t$this->_data[$key] = $record;\n\t\t\t$this->store();\n\t\t}\n\t}",
"public function updateSingleRecord($formData)\n {\n }",
"public function updateRecord()\n {\n #$response = $request->execute();\n }",
"public function update(){\n\n if(!empty($_POST)){\n $record_id = $_POST['record_id']; \n unset($_POST['record_id']);\n\n $this->record_obj\n ->ready()\n ->update($_POST)\n ->where([\n 'record_id' => $record_id\n ])\n ->go();\n }\n }",
"function updateObjectDB () {\n\t\t$this->prepareValues();\n\t\t$database = mamboDatabase::getInstance();\n\t\t$database->doSQL($this->updateSQL());\n\t}",
"function setBlob($prop_name,$prop_value){\n $this->changed = true;\n $this->data[$prop_name] = db_Wrap::escape_bytea($prop_value);\n }",
"public function update($record) {\n self::$debug[] = ['update' => $record];\n $id = $record->fields['Id'];\n if (!empty($id)) {\n $url = \"/services/data/v27.0/sobjects/\" . $record->type . \"/\" . $id;\n unset($record->fields['Id']);\n $content = json_encode($record->fields);\n $response = $this->apiCall($url, ['content' => $content, 'encoding' => 'json', 'method' => 'PATCH', 'is_full_url' => FALSE]);\n \n if( $response['status'] == 204 ){\n return TRUE;\n }\n foreach($response['response']['errors'] as $error){\n throw new SfException($error->message);\n }\n }\n throw new SfException('Id is missing');\n }",
"function update_record($table, $dataobject) {\n\n global $db, $CFG;\n\n if (! isset($dataobject->ident) ) {\n return false;\n }\n\n static $table_columns;\n \n // Determine all the fields in the table\n if (is_array($table_columns) && array_key_exists($table,$table_columns)) {\n $columns = $table_columns[$table];\n } else {\n if (!$columns = $db->MetaColumns($CFG->prefix . $table)) {\n return false;\n }\n $table_columns[$table] = $columns;\n }\n\n $data = (array)$dataobject;\n $ddd = array();\n\n if (defined('ELGG_PERFDB')) { global $PERF ; $PERF->dbqueries++; };\n\n // Pull out data matching these fields\n foreach ($columns as $column) {\n if ($column->name <> 'ident' and isset($data[$column->name]) ) {\n $ddd[$column->name] = $data[$column->name];\n }\n }\n\n // Construct SQL queries\n $numddd = count($ddd);\n $count = 0;\n $update = '';\n\n foreach ($ddd as $key => $value) {\n $count++;\n $update .= $key .' = ?'; \n if ($count < $numddd) {\n $update .= ', ';\n }\n }\n\n $stmt = $db->Prepare('UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE ident = \\''. $dataobject->ident .'\\'');\n if ($rs = $db->Execute($stmt,$ddd)) {\n elggcache_delete($table, \"ident_\" . $dataobject->ident);\n return true;\n } else {\n if (isset($CFG->debug) and $CFG->debug > 7) {\n notify($db->ErrorMsg() .'<br /><br />UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE ident = \\''. $dataobject->ident .'\\'');\n }\n if (!empty($CFG->dblogerror)) {\n $debug = debug_backtrace();\n foreach ($debug as $d) {\n if (strpos($d['file'],'datalib') === false) {\n error_log(\"SQL \".$db->ErrorMsg().\" in {$d['file']} on line {$d['line']}. STATEMENT: UPDATE $CFG->prefix$table SET $update WHERE ident = '$dataobject->ident'\");\n break;\n }\n }\n }\n return false;\n }\n}",
"function updateRecord($table,$record,$pkfield,$pk){\n\t\t\t$pk = filter_var($pk,FILTER_SANITIZE_STRING);\n\t\t\t//get the book from the database\n\t\t\t$query = \"update $table set \";\n\t\t\t$i=0;\n\t\t\t$qms=\"\";\n\t\t\t$fieldset = \"\";\n\t\t\tforeach ($record as $key => $value){\n\t\t\t\t//echo \"<br>record=\".$value;\n\t\t\t\tif ($i==0)\n\t\t\t\t\t$qms = $qms.\" $key=?\";\n\t\t\t\telse\n\t\t\t\t\t$qms = $qms.\", $key=?\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$query .= $qms.\" WHERE $pkfield = ?\";\n\n\t\t\t//echo \"<br>query = $query\";\n\n\t\t\t//create the pdo object\n\t\t\t$pdo = getPDO();\n\t\t\t//create the statement\n\t\t\t$stmt = $pdo->prepare($query);\n\n\t\t\t//bind the fields\n\t\t\t$i=0;\n\t\t\t//echo \"<br>Binding parameters...\";\n\t\t\tforeach($record as $key => $field){\n\t\t\t\t$i++;\n\t\t\t\t$stmt->bindParam($i,$record[$key]);\n\t\t\t\t//echo \"<br>$i -> $record[$key]\";\n\t\t\t}\n\t\t\t//bind the pk\n\t\t\t$i++;\n\t\t\t$stmt->bindParam($i,$pk);\n\t\t\t//echo \"binding pk: $i -> $pk\";\n\t\t\t//execute the query\n\t\t\ttry{\n\t\t\t\t$stmt->execute();\n\t\t\t}\n\t\t\tcatch(PDOException $e){\n\t\t\t\techo \"<br>Error saving data...\";\n\t\t\t\tprint_r($stmt->errorInfo());\n\t\t\t\t$rowcount = 0;\n\t\t\t\treturn $rowcount;\n\t\t\t}\n\t\t\t$rowcount = $stmt->rowCount();\n\t\t\t//echo \"<br>rowcount = $rowcount\";\n\t\t\treturn $rowcount;\n\t\t}",
"public function updateRecord($recordId=NULL, array $recordInfo);",
"public function updateRecord(string $tableName, $keyValue, array $data): int;",
"public function updateOneEntity (int $key,$data) : void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The belongsToMany suppliers relationship. | public function suppliers()
{
return $this->belongsToMany('App\Inventory\Models\Supplier', 'inventory_suppliers', 'inventory_id')->withTimestamps();
} | [
"public function suppliers()\n {\n return $this->hasMany(Supplier::class);\n }",
"public function suppliers()\n {\n return $this->hasMany(Supplier::class);\n }",
"public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'user_id');\n }",
"public function suppliers()\n {\n return $this->belongsToMany('pierresilva\\Inventory\\Models\\Supplier', 'inventory_suppliers', 'inventory_id')->withTimestamps();\n }",
"public function suppliers()\n {\n return $this->morphedByMany(App\\Supplier::class, 'taggable');\n }",
"public function suppliers()\n\t{\n\t\treturn $this->hasManyThrough('App\\Supplier','App\\Store');\n\t}",
"public function supplier() {\n return $this->belongsToMany( 'Supplier', 'merchants_suppliers_link', 'merchant_id', 'supplier_id' );\n }",
"public function supplier() {\n //return $this->hasMany('App\\Supplier'); // one to hasMany\n return $this->belongsToMany('App\\Supplier');\n }",
"public function supplierCategories()\n {\n return $this->belongsToMany(\n SupplierCategory::class,\n SupplierCategoryPivot::class,\n SupplierCategoryPivot::COLUMN_SUPPLIER_ID,\n SupplierCategoryPivot::COLUMN_SUPPLIER_CATEGORY_ID,\n )->withTimestamps();\n }",
"public function supplierEmployees()\n {\n return $this->hasMany('SupplierEmployee');\n }",
"public function allSuppliers()\n {\n return $this->supplier->all();\n }",
"public function getSuppliers()\n {\n $dbm = ErpDbManager::getInstance();\n $mapper = $dbm->getRepository(Supplier::class);\n return $mapper->findByItem($this);\n }",
"public function getAllSuppliers(){\n \treturn $query = Supplier::find(['in', 'id', array_keys(self::CategoryOptions($this->id))]);\n }",
"public function supplier(){\n return $this->belongTo('App\\Model\\Users\\Supplier','id','id_supplier');\n }",
"public function supplierproductSupplier()\n {\n return $this->belongsTo(Supplier::class, 'supply_id','id');\n }",
"public function benchmark_suppliers() {\n\t\treturn $this->hasMany(M502BenchmarkSupplier::class, 'bench_cd')\n\t\t\t->where(M502BenchmarkSupplier::getTableName().'.del_flg', config('constant.flg.no'));\n\t}",
"public function getSupplierIdsAttribute()\n {\n return $this->suppliers->pluck('id');\n }",
"public function groups()\n {\n return $this->belongsToMany(SupplierGroup::class);\n }",
"public function contacts()\n {\n return $this->hasMany('App\\Models\\SupplierContact');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default callback used when invoking WP_Customize_Control::active(). Subclasses can override this with their specific logic, or they may provide an 'active_callback' argument to the constructor. | public function active_callback()
{
} | [
"final public function active() {\n\t\t$control = $this;\n\t\t$active = call_user_func( $this->active_callback, $this );\n\n\t\t/**\n\t\t * Filter response of WP_Customize_Control::active().\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param bool $active Whether the Customizer control is active.\n\t\t * @param WP_Customize_Control $control WP_Customize_Control instance.\n\t\t */\n\t\t$active = apply_filters( 'customize_control_active', $active, $control );\n\n\t\treturn $active;\n\t}",
"public function active_callback()\n {\n }",
"public function advanced_options_active_callback() {\n\t\treturn get_theme_mod( 'neve_advanced_layout_options', false );\n\t}",
"function active(){\n $args = func_get_args();\n if (count($args) == 0) return $this->_active;\n $this->_active = $args[0];\n $this->attribute('class', (($this->_active)? 'ui-btn-active':''));\n return $this;\n }",
"public function reactivate_callback() {\n\n // First, make sure the method exists\n if ( ! method_exists( $this, 'callback' ) ) {\n return;\n }\n\n // Remove front end display of shortcode\n remove_shortcode( $this->config['handle'] );\n\n // Activate back end display of shortcode\n add_shortcode( $this->config['handle'], array( $this, 'callback' ) );\n\n }",
"function hook_activate() {\r\n $this->update_options(array_merge($this->get_default_options(), $this->get_options()));\r\n }",
"public function plugin_activate()\r\n {\r\n }",
"public function on_activate_plugin() {\n\t\n\t}",
"public function plugin_activate() { }",
"public function plugin_activate() {\n \n }",
"function dynamicnews_slider_activated_callback( $control ) {\n\n\t// Check if Slider is turned on\n\tif ( $control->manager->get_setting( 'dynamicnews_theme_options[slider_activated_front_page]' )->value() == 1 ) :\n\t\treturn true;\n\telseif ( $control->manager->get_setting( 'dynamicnews_theme_options[slider_activated_blog]' )->value() == 1 ) :\n\t\treturn true;\n\telse :\n\t\treturn false;\n\tendif;\n\n}",
"function _custom_background_cb()\n {\n }",
"public function setActive();",
"public function junos_active() {\r\n $this->active_element->set_attribute(\"active\",\"active\");\r\n }",
"public function enableCallback()\n {\n $this->cb_view = $this->add('View');\n $this->cb = $this->cb_view->add('CallbackLater');\n\n $this->cb->set(function () {\n if ($this->cb->triggered && $this->fx) {\n $this->fx[0]($this->cb_view);\n }\n $this->app->terminate($this->cb_view->renderJSON());\n });\n }",
"public function setActive() {\n $this->_active = true;\n }",
"public function plugin_activate() {\r\n\t\tupdate_option( $this->options_name, $this->options);\r\n\t}",
"public function set_callback() {\n require_once( 'template-options-page.php' );\n }",
"function _custom_background_cb() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
force update all addons function | public function force_Update_Active_addons(Request $request){
$shop = Auth::user();
$this->fetchInitialData();
$this->get_theme_refresh_internal();
if(isset($shop->is_beta_tester) && $shop->is_beta_tester == 1 ){
$StoreThemes = StoreThemes::where('user_id', $shop->id)->where('status', 1)->get();
}else{
$StoreThemes = StoreThemes::where('user_id', $shop->id)->where('status', 1)->where('is_beta_theme','!=',1)->orWhere('is_beta_theme', NULL)->get();
}
if(!isset($StoreThemes) || empty($StoreThemes)){
$StoreThemes = StoreThemes::where('user_id', $shop->id)->where('status', 1)->get();
}
no_addon_activate($StoreThemes, $shop);
if( count( $StoreThemes ) > 0 ){
// save last activity in shop
$shop->lastactivity = new DateTime();
$shop->save();
$allAddons = AddOns::where('user_id', $shop->id)->where('status', 1)->get();
foreach ( $StoreThemes as $skey=>$sval ){
if(isset($shop->is_beta_tester) && $shop->is_beta_tester == 1 ){
$StoreTheme = StoreThemes::where('user_id', $shop->id)->where('shopify_theme_id', $sval->shopify_theme_id)->where('status', 1)->get();
}else{
$StoreTheme = StoreThemes::where('user_id', $shop->id)->where('shopify_theme_id', $sval->shopify_theme_id)->where('status', 1)->where('is_beta_theme','!=',1)->get();
}
if($StoreTheme){
$checkaddon = 0;
$update_addon= 1;
foreach ($allAddons as $key => $mltaddons) {
$this->deactive_addons($shop,$StoreTheme,$mltaddons->global_id, $checkaddon, $update_addon);
}
sleep(5);
foreach ($allAddons as $key => $mltaddons) {
logger('add loop begins');
logger('$mltaddons->global_id: ' . $mltaddons->global_id);
logger('$sval->shopify_theme_id: ' . $sval->shopify_theme_id);
logger('$key: ' . $key );
$this->active_addons($mltaddons->global_id, $sval->shopify_theme_id, $update_addon, $key);
}
}
}
}
$shop->is_updated_addon = 1;
$shop->save();
$request->session()->flash('status', 'Debutify Theme Manager Updated');
$request->session()->flash('addons-updated', 'Addons Updated');
return redirect()->route('theme_addons');
} | [
"public function maybe_refresh_addons() {\n\n if ( ! $this->is_refreshing_addons() ) {\n return;\n }\n\n if ( ! $this->refresh_addons_action() ) {\n return;\n }\n\n if ( ! $this->base->get_license_key() ) {\n return;\n }\n\n $this->get_addons_data( $this->base->get_license_key() );\n\n }",
"function do_undismiss_core_update()\n {\n }",
"public function testUpdateAddonVersion()\n {\n }",
"function do_undismiss_core_update() {}",
"function monsterinsights_maybe_refresh_addons() {\n if ( ! monsterinsights_is_addons_page() ) {\n return;\n }\n\n\n if ( ! monsterinsights_is_refreshing_addons() ) {\n return;\n }\n\n if ( ! monsterinsights_refresh_addons_action() ) {\n return;\n }\n\n monsterinsights_get_addons_data( monsterinsights_get_license_key() );\n\n}",
"protected function updateAfterInstall() {}",
"function _maybe_update_core()\n{\n}",
"protected function refreshAddOnsList()\r\n {\r\n\r\n // Absolute path to addOns directory\r\n $addOnsDirectory = Yii::getAlias('@addons');\r\n\r\n // Each sub-directory name is an addOn id\r\n $addOns = FileHelper::scandir($addOnsDirectory);\r\n\r\n $installedAddOns = ArrayHelper::map(Addon::find()->select(['id','id'])->asArray()->all(), 'id', 'id');\r\n $newAddOns = array_diff($addOns, $installedAddOns);\r\n $removedAddOns = array_diff($installedAddOns, $addOns);\r\n\r\n // Install new addOns\r\n SetupHelper::install($newAddOns);\r\n\r\n // Update addOns versions\r\n SetupHelper::update($installedAddOns);\r\n\r\n // Uninstall removed addOns\r\n SetupHelper::uninstall($removedAddOns);\r\n\r\n }",
"public function rebuildAddOnCaches()\n {\n $options = XenForo_Application::getOptions();\n if ($options->addoninstaller_supress_cache_rebuild)\n {\n $options->set('addoninstaller_cache_rebuild_required', true);\n $this->getModelFromCache('XenForo_Model_CodeEvent')->rebuildEventListenerCache();\n $this->getModelFromCache('XenForo_Model_Option')->rebuildOptionCache();\n return;\n }\n if ($options->addoninstaller_faster_install)\n {\n $this->getModelFromCache('XenForo_Model_CodeEvent')->rebuildEventListenerCache();\n\n $this->getModelFromCache('XenForo_Model_Cron')->updateMinimumNextRunTime();\n\n $this->getModelFromCache('XenForo_Model_Option')->rebuildOptionCache();\n\n $this->getModelFromCache('XenForo_Model_RoutePrefix')->rebuildRoutePrefixCache();\n\n $this->getModelFromCache('XenForo_Model_StyleProperty')->rebuildPropertyCacheForAllStyles();\n\n $this->getModelFromCache('XenForo_Model_BbCode')->rebuildBbCodeCache();\n\n $this->getModelFromCache('XenForo_Model_ContentType')->rebuildContentTypeCache();\n\n $this->getModelFromCache('XenForo_Model_AdminSearch')->rebuildSearchTypesCache();\n\n $this->getModelFromCache('XenForo_Model_BbCode')->updateBbCodeParseCacheVersion();\n\n $this->getModelFromCache('XenForo_Model_Option')->updateOption('jsLastUpdate', XenForo_Application::$time);\n\n $atomicData = array(\n 'execute' => array(),\n );\n\n if ($this->getPermissionsHash() != AddOnInstaller_Tools::getPermissionsHash())\n {\n $atomicData['execute'][] = array('Permission', array());\n }\n $atomicData['execute'][] = array('Phrase', array());\n\n $changedTemplates = AddOnInstaller_Tools::getDataForRebuild();\n\n foreach ($changedTemplates AS $info)\n {\n foreach ($info['classes'] AS $class)\n {\n $atomicData['execute'][] = [$class, $info['data']];\n }\n }\n\n XenForo_Application::defer('Atomic', $atomicData, 'addonRebuild', true);\n return;\n }\n\n parent::rebuildAddOnCaches();\n }",
"public function enable_update() {\n\t\tif ( $this->has_extensions() ) {\n\t\t\tadd_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_updates' ) );\n\t\t\tadd_filter( 'plugins_api', array( $this, 'get_info' ), 10, 3 );\n\t\t}\n\t}",
"function _maybe_update_core()\n {\n }",
"protected function force_all_updates() {\n\t\treturn isset($_GET[AELIA_CS_ARG_FORCE_ALL_UPDATES]) && ($_GET[AELIA_CS_ARG_FORCE_ALL_UPDATES] == 'go') && is_admin() && current_user_can('manage_options');\n\t}",
"public function updateExtList() {}",
"function upgrade_all(){\n $upgrade = new moduleinstaller();\n //$upgrade->upgradeAll();\n $modules = $upgrade->getModules();\n\n foreach($modules as $val){\n // testing if this is working\n $options = array ('module' => $val['module_name']);\n $upgrade = new moduleinstaller($options);\n $upgrade->upgrade();\n\n //update_ini_file($options);\n common::echoMessage($upgrade->confirm);\n }\n}",
"public function updateSettings()\n {\n\n }",
"function core_auto_updates_settings()\n {\n }",
"public function _updatePreferences()\n {\n Legacy_ModuleInstallUtils::smartUpdateAllOfPreferences($this->_mTargetXoopsModule, $this->mLog);\n }",
"public static function updateCore()\r\n {\r\n if (!current_user_can('activate_plugins')) {\r\n return false;\r\n }\r\n\r\n Rootd_Installer::update();\r\n }",
"function production_ready_action()\n{\n $alias = wf_var('WF_ALIAS');\n //turn off update module\n drush_log('module - \"update\" ' . ((drush_invoke_process($alias, \"dis\", array('update')) ? ' WAS ' : ' WAS NOT')) . ' disabled', 'ok');\n\n //turn off messages\n set_action('error_level', 0);\n\n //regular tune up\n tune_up_action();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
print_r(alphabet_position('The sunset sets at twelve o\' clock.')); | function alphabet_position_advanced(string $s): string
{
return implode(' ', array_filter(array_map(function ($x) {
return array_search($x, str_split('_abcdefghijklmnopqrstuvwxyz'));
}, str_split(strtolower($s)))));
} | [
"function positionInAlphabet($letter) {\n return ord(strtolower($letter)) - 96;\n}",
"function alphabet_position(string $s): string\n{\n $alphabets = ['A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13, 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26];\n $res = [];\n for ($i = 0; $i < strlen($s); $i++) {\n $v = $s[$i];\n $k = strtoupper($v);\n if (isset($alphabets[$k]))\n $res[] = $alphabets[$k];\n }\n return implode(' ', $res);\n}",
"function alphabet_position($char) {\r\n\t$asc = ord($char);\r\n\r\n\tif ($asc >= 65 and $asc <= 90) {\r\n\t\treturn $asc - 65;\r\n\t}\r\n\telse if ($asc >= 97 and $asc <= 122) {\r\n\t\treturn $asc - 71;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}",
"public function getStartingCharacter(): string;",
"function checkLetter($word, $position='first') { \n \n if($position == 'first') { \n $letter = $word[0];\n }\n else\n {\n $letter = substr($word, -1);\n }\n \n return $letter;\n}",
"public function testEntireAlphabetWord() : void\n {\n $word = 'abcdefghijklmnopqrstuvwxyz';\n $this->assertEquals(87, score($word));\n }",
"function alphabet_soup($string) {\n\n\t}",
"public function testAt()\n {\n $this->assertEquals('Б', Str::at('БГДЖИЛЁ', 0));\n $this->assertEquals('Д', Str::at('БГДЖИЛЁ', 2));\n $this->assertEquals('Ё', Str::at('БГДЖИЛЁ', 6));\n }",
"function getAsciiOffset($a) {\n\t$lowercaseOffset = 97;\n\t$capitalOffset = 65;\n\n\tif (strlen($a)>1) {\t//input strings should only be 1 character long\n\t\treturn -1;\n\t}\n\telse if(ord($a[0])>=65 && ord($a[0])<=90) {\t//65-90 are capital ACSII values\n\t\treturn $capitalOffset;\n\t}\n\telse if(ord($a[0])>=97 && ord($a[0])<=122) {\t//97-122 are lowercase ASCII values\n\t\treturn $lowercaseOffset;\n\t}\n\telse {\t//error\n\t\treturn 0;\n\t}\n}",
"function charAt($str, $pos) {\r\n\r\n$pos = ($pos - 1); //Offset\r\nreturn (substr($str, $pos, 1)) ? substr($str, $pos, 1) : -1;\r\n\r\n}",
"function getAlphabet()\n {\n \treturn $this->alphabet;\n }",
"function atbash($input_array) {\n global $upper_alphabet, $lower_alphabet;\n $output = '';\n foreach ($input_array as $input_letter) {\n if (preg_match('/[A-Z]/', $input_letter)) {\n for ($i = 0; $i < 26; $i++) {\n if ($upper_alphabet[$i] == $input_letter) \n\t $output .= $upper_alphabet[25 - $i];\n }\n } elseif (preg_match('/[a-z]/', $input_letter)) {\n for ($i = 0; $i < 26; $i++) {\n if ($lower_alphabet[$i] == $input_letter) \n\t $output .= $lower_alphabet[25 - $i];\n }\n } else {\n $output .= $input_letter;\n }\n }\n return $output;\n}",
"function CharLeft(){}",
"public function test_get_letter_representation_of_number()\n {\n $expected = 'A';\n $actual = NumToLettersConverter::$nums[1];\n $this->assertEquals($expected, $actual);\n }",
"public function offsetInCharacterIterationBasicallyWorks()\n {\n $iterator = new TextIterator('This is a test string. Let\\'s iterate it by character...', TextIterator::CHARACTER);\n foreach ($iterator as $currentCharacter) {\n if ($currentCharacter === 'L') {\n break;\n }\n }\n self::assertEquals($iterator->offset(), 23, 'Wrong offset returned in character iteration.');\n }",
"public function strposWorksWithLatinCharacters()\n {\n $testString = 'Feugiat tincidunt duo id, 23 quam delenit vocibus nam eu';\n self::assertEquals(8, strpos($testString, 'tincidunt'), 'strpos() did not return the correct position for a latin character string.');\n }",
"function Letters() {\r\n extract($GLOBALS);\r\n if (!file_exists($system.\"/index\")) {\r\n if (is_dir($system)) {\r\n kill('system index (list of games) not found');\r\n } else {\r\n kill('system directory not found');\r\n }\r\n }\r\n $alphabet = array(\"All\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\");\r\n echo('<table align=\"center\" cellpadding=\"2\" cellspacing=\"2\" border=\"0\" style=\"width:552; text-align:center; margin-left:auto; margin-right:auto;\">');\r\n echo('<tr><td> </td></tr>');\r\n echo('<tr><td> </td></tr>');\r\n echo('<tr>'.\"\\n\");\r\n for ($i=0;$i<count($alphabet);$i++) {\r\n echo('<td style=\"'.$style[\"letter_background\"].'\"><div style=\"font-size:12pt; text-align:center\">');\r\n echo('<a href=\"'.$thisfilename.'?category='.$category.'&system='.$system.'&letter='.strtolower($alphabet[$i]).'\">');\r\n if (strtolower($alphabet[$i])==$letter) { echo('<u>'); }\r\n echo($alphabet[$i]);\r\n if (strtolower($alphabet[$i])==$letter) { echo('</u>'); }\r\n echo('</a></div></td>'.\"\\n\");\r\n }\r\n echo('</tr></table>');\r\n}",
"function playPass($s, $n) {\n $distance = $n % 26;\n $result = \"\";\n\n foreach (str_split(strtolower($s)) as $key => $char) {\n if (preg_match('/[a-z]/', $char)) {\n if ($key % 2 == 0) {\n $result .= strtoupper(chr(97 + (ord($char) - 97 + $distance) % 26));\n } else {\n $result .= chr(97 + (ord($char) - 97 + $distance) % 26);\n }\n } else if (preg_match('/[0-9]/', $char)) {\n $result .= abs($char - 9);\n } else {\n $result .= $char;\n }\n }\n return strrev($result);\n}",
"function _hangman_char_positions_in_word($char, $word) {\n $found = array();\n $offset = 0;\n while(($at = stripos($word, $char, $offset)) !== false) {\n $found[] = $at + 1;\n $offset = $at + 1;\n }\n return $found;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of _nb_velos | public function get_nb_velos()
{
return $this->_nb_velos;
} | [
"public function get_velos()\r\n {\r\n return $this->_velos;\r\n }",
"public function getNumVoie() {\n return $this->numVoie;\n }",
"public function get_nb_eleve()\n {\n return $this->nb_eleve;\n }",
"function getVeloDispo(){\n $stations=getStationsList();\n $velo=array();\n $j=0;\n for($i=0;$i<count($stations);$i++){\n $velo[$i]=$stations[$i][\"nbvelosdispo\"];\n $j=$j+1;\n }\n \n return $velo;\n }",
"public function countV_facture(){\n\t\t\t\t\t return count($this->listeV_facture());\n\t\t\t\t\t }",
"public function getId_velo()\r\n {\r\n return $this->id_velo;\r\n }",
"public function getNbEnigmesValides()\n {\n $cpt = 0;\n foreach ($this->enigmes as $e) {\n if ($e->getValide() == true)\n $cpt++;\n }\n return $cpt;\n }",
"public function getStock_velo()\r\n {\r\n return $this->stock_velo;\r\n }",
"public function getVectorsCount()\n {\n return $this->vectors_count;\n }",
"public function getNbBulValidesFact() {\n return $this->nbBulValidesFact;\n }",
"public function getNumPlanets(){\n\t\treturn $this->numPlanets;\n\t}",
"public function getNbViews()\n {\n return $this->nb_views;\n }",
"public function getNumeroVias() {\n return $this->iNumeroVias;\n }",
"public function getVitesseMax(): int\n {\n return $this->vitesseMax;\n }",
"public function countV_famille(){\n\t\t\t\t\t return count($this->listeV_famille());\n\t\t\t\t\t }",
"public function getNViews()\r\n {\r\n return $this->nViews;\r\n }",
"public function getQtdVezes()\n {\n return $this->qtd_vezes;\n }",
"public function getNbTrajetCovoitureur() {\n\n //rcupération du nombre de trajet pour le covoitureur\n $nb_trajet = Doctrine_Core::getTable('Trajet')->getCovoitureurTrajetNb($this->getIdUtilisateur());\n\n return $nb_trajet;\n\n }",
"public function getNumOpe()\n {\n return $this->numOpe;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save Highscores Array to CSV File | private function saveHighscores() {
$file = fopen('scores.csv', 'w');
fputcsv($file, $this->highscores);
fclose($file);
} | [
"private function write_csv($array)\n {\n \t$handle = fopen($this->filename, 'w');\n\t\tforeach ($array as $value) {\n\t\t\tfputcsv($handle, $value); \n\t\t}\n\t\tfclose($handle);\n\t}",
"private function writeCSV($array)\n {\n $handle = fopen($this->filename, 'w');\n\n foreach($array as $row) {\n fputcsv($handle, $row);\n }\n\n fclose($handle);\n\n }",
"private function write_csv($array)\n {\n $handle = fopen($this->filename, 'w');\n foreach ($array as $key => $row) {\n fputcsv($handle, $row);\n }\n fclose($handle);\n }",
"public function writeScore($scores) \n {\n foreach($scores as $date => $score) {\n $line = $this->formatter->format(array($date, $score['id'], $score['likes']));\n fwrite($this->handlers['DAILYTOP'], $line);\n }\n }",
"private function write_csv($array)\n {\n if (is_writable($this->filename)) \n { \n $handle = fopen($this->filename, 'w');\n foreach ($array as $key=>$entry) \n {\n fputcsv($handle, $entry);\n }\n fclose($handle);\n }\n return $array;\n }",
"private function write_csv($array)\n {\n $handle = fopen($this->filename, 'w+');\n foreach ($array as $content) {\n fputcsv($handle, $content);\n }\n fclose($handle);\n }",
"private function write_csv($array) {\n $handle = fopen($this->filename, 'w');\n\n foreach ($array as $row) \n {\n fputcsv($handle, $row);\n\n }\n\n fclose($handle);\n return $array;\n }",
"function create_scores(){\n\t$scores = array(\n\t\t\t\tarray(\"name\" => \"Jordan\", \"score\" => 1000000),\n\t\t\t\tarray(\"name\" => \"Donyatsu\", \"score\" => 900000),\n\t\t\t\tarray(\"name\" => \"Baum\", \"score\" => 850000)\n\t\t\t\t);\n\tfile_put_contents('highscores.json', json_encode($scores));\n}",
"private function writeCSV($array) {\n $handle = fopen($this->filename, 'w');\n foreach ($array as $fields) {\n fputcsv($handle, $fields);\n }\n fclose($handle);\n }",
"private function _saveAnswers()\n {\n $answers = array();\n\n $answers[] = date(\"Y-m-d H:i:s O\");\n\n if ($this->_savePartial) {\n $answers[] = $this->_magic;\n $answers[] = $this->page;\n };\n for ($i = 1; $i <= $this->_answer; $i++) {\n $answers[] = (isset($_REQUEST['a'][$i]) ? $_REQUEST['a'][$i] : '');\n };\n\n if (($fp = fopen($this->_filename, 'a')) !== false) {\n fputcsv($fp, $answers);\n fclose($fp);\n } else {\n echo \"<p><b>Error:</b> Saving failed!</p>\\n\";\n };\n }",
"public static function timesArrayToCsv($arr){\n $csv = '';\n for($i=0; $i<6; $i++){\n $csv .= $arr[$i].',';\n }\n $csv .= $arr[6];\n return $csv;\n }",
"function array2csv(array &$array)\n{\n if(count($array) == 0) \n {\n return null;\n }\n ob_start();\n $df = fopen(\"php://output\", 'w');\n fputcsv($df, array_keys(reset($array)));\n \n foreach($array AS $row) \n {\n fputcsv($df, $row);\n }\n fclose($df);\n return ob_get_clean();\n}",
"public static function arrayToCsv($data);",
"public function __construct() {\n\t\t\t$this->highscores = array();\n\t\t\tif (($file = fopen(\"scores.csv\", \"r\")) !== FALSE) {\n\t\t\t while (($data = fgetcsv($file, 1000, \",\")) !== FALSE) {\n\t\t\t for ($i=0; $i < sizeof($data); $i++) {\n\t\t\t array_push($this->highscores, $data[$i]);\n\t\t\t }\n\t\t\t }\n\t\t\t fclose($file);\n\t\t\t}\n\t\t}",
"public function writeStatsInCsv(): void\n {\n if ($this->isNotActivated()) {\n return;\n }\n\n $statFile = fopen($this->getFileName(), 'w');\n\n if (!$statFile) {\n return;\n }\n\n fputcsv($statFile, [\n 'Time (seconds)',\n 'Test Class',\n 'Test Method',\n '# Dirty Tables',\n 'Dirty Tables',\n ]);\n\n foreach ($this->statistics as $stat) {\n fputcsv($statFile, $stat);\n }\n\n fclose($statFile);\n }",
"private function toCommaDelimiter() : void\n {\n //Open file pointer.\n $fp = fopen($this->path_destination, 'w');\n\n foreach ($this->rawData as $key => $item) {\n fputcsv($fp, $item);\n }\n\n //Finally, close the file pointer.\n fclose($fp);\n\n echo \"--> Saving $this->path_destination <br />\";\n }",
"public function output_to_csv($richsubmissions) {\n global $CFG, $DB;\n\n require_once($CFG->libdir.'/csvlib.class.php');\n\n if ($this->formdata->downloadtype == SURVEYPRO_DOWNLOADCSV) {\n $csvexport = new \\csv_export_writer('comma');\n } else {\n $csvexport = new \\csv_export_writer('tab');\n }\n\n $csvexport->filename = $this->get_export_filename('csv');\n\n // Get headers and placeholders.\n list($headerlabels, $placeholders) = $this->export_get_output_headers();\n $csvexport->add_data($headerlabels);\n\n $currentsubmissionid = 0;\n foreach ($richsubmissions as $richsubmission) {\n if ($currentsubmissionid != $richsubmission->submissionid) {\n if (!empty($currentsubmissionid)) { // New richsubmissionid, stop managing old record.\n // Write old record.\n $csvexport->add_data($recordtoexport);\n }\n\n // Update the reference.\n $currentsubmissionid = $richsubmission->submissionid;\n\n // Begin a new record.\n $recordtoexport = $this->export_begin_newrecord($richsubmission, $placeholders);\n }\n\n $this->export_populate_currentrecord($richsubmission, $recordtoexport);\n }\n $richsubmissions->close();\n\n $csvexport->add_data($recordtoexport);\n $csvexport->download_file();\n die();\n }",
"function backup_lesson_high_scores($bf, $preferences, $lessonid) {\n global $CFG;\n\n $status = true;\n\n $highscores = get_records(\"lesson_high_scores\", \"lessonid\", $lessonid);\n\n //If there is highscores\n if ($highscores) {\n //Write start tag\n $status =fwrite ($bf,start_tag(\"HIGHSCORES\",4,true));\n //Iterate over each highscore\n foreach ($highscores as $highscore) {\n //Start highscore\n $status =fwrite ($bf,start_tag(\"HIGHSCORE\",5,true));\n //Print highscore contents\n fwrite ($bf,full_tag(\"USERID\",6,false,$highscore->userid));\n fwrite ($bf,full_tag(\"GRADEID\",6,false,$highscore->gradeid));\n fwrite ($bf,full_tag(\"NICKNAME\",6,false,$highscore->nickname));\n //End highscore\n $status =fwrite ($bf,end_tag(\"HIGHSCORE\",5,true));\n }\n //Write end tag\n $status =fwrite ($bf,end_tag(\"HIGHSCORES\",4,true));\n }\n return $status;\n }",
"public function writeToCsv(): void {\n\t\t// create string for the csv.\n\t\t$csv_line = $this->id;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->name;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->model;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->type;\n\t\t$csv_line .= self::CSV_SEPARATOR . $this->price;\n\n\t\t// open file csv for write line\n\t\t$csv_file = fopen(INSTRUMENTS_CSV_FILE, \"w\");\n\n\t\t// write on csv\n\t\tfputcsv($csv_file, array($csv_line));\n\n\t\t// close file csv\n\t\tfclose($csv_file);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the workProfileDataSharingType property value. Android For Work cross profile data sharing type. | public function setWorkProfileDataSharingType(?AndroidForWorkCrossProfileDataSharingType $value): void {
$this->getBackingStore()->set('workProfileDataSharingType', $value);
} | [
"public function setShareType($shareType);",
"public function getShareType()\n {\n return $this->shareType;\n }",
"public function getShareType() {\n return $this->shareType;\n }",
"public function setShareType($shareType)\n {\n $this->shareType = $shareType;\n return $this;\n }",
"public function getSharingType() \n {\n return $this->_sharingType; \n }",
"public function setSocialType($type, $value)\n {\n if(!empty($this->social)){\n $c = json_decode($this->social, true);\n }\n $c[$type] = $value;\n $this->social = json_encode($c);\n }",
"public function setShareAPNSData($val)\n {\n $this->_propDict[\"shareAPNSData\"] = $val;\n return $this;\n }",
"public function setCampaignDataSharingEnabled($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\BoolValue::class);\n $this->campaign_data_sharing_enabled = $var;\n\n return $this;\n }",
"public function setDataType( $data_type){\n $this->data_type = $data_type;\n }",
"public function setEnrollmentProfile(?AndroidDeviceOwnerEnrollmentProfileType $value): void {\n $this->getBackingStore()->set('enrollmentProfile', $value);\n }",
"public function setProvisioningType(?CloudPcProvisioningType $value): void {\n $this->getBackingStore()->set('provisioningType', $value);\n }",
"public function setCampaignDataSharingEnabledValue($var)\n {\n $this->writeWrapperValue(\"campaign_data_sharing_enabled\", $var);\n return $this;}",
"public function setActivityType(?string $value): void {\n $this->getBackingStore()->set('activityType', $value);\n }",
"public function set_data_type($data_type) {\n\t\t$this->data_type = $data_type;\n\t}",
"public function setWorkProfileBluetoothEnableContactSharing($val)\n {\n $this->_propDict[\"workProfileBluetoothEnableContactSharing\"] = boolval($val);\n return $this;\n }",
"public function setShareUserExperienceAnalyticsData($val)\n {\n $this->_propDict[\"shareUserExperienceAnalyticsData\"] = $val;\n return $this;\n }",
"public function setCodeShare($codeShare = null)\n {\n // validation for constraint: string\n if (!is_null($codeShare) && !is_string($codeShare)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($codeShare)), __LINE__);\n }\n if (is_null($codeShare) || (is_array($codeShare) && empty($codeShare))) {\n unset($this->CodeShare);\n } else {\n $this->CodeShare = $codeShare;\n }\n return $this;\n }",
"public function setPolicyType(?DeviceManagementAutopilotPolicyType $value): void {\n $this->getBackingStore()->set('policyType', $value);\n }",
"public function setActivityType($value)\n {\n return $this->setProperty(\"ActivityType\", $value, true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Description:: receives the data of each technique card, makes it into HTML and sends to the client's browser Attributes: $con: connection from the server_config.php file Precondition: must be called by the client (techniques.php web page) Postcondition retrieve the content of the techniques_landing table uses $factCount to identify the required action: 1 = initial execution, which initiates the creation of all the cards + retrieves content from the factContent() function 2, 4, 5 = continue retrieving content from the factContent() function 3 = add the div that contains 'd2 a' to initiate show/hide text for short/long text (only when more than 2 facts displayed) 5 = close 'd2 a' to indicate the end of it. Also add a button if $techn_target has a button content in the db & reset $factCount to 1 Return: $technContent: sends HTML code back to the client (techniques.php) | function retrieveTechniques($con) {
$get_techn = "SELECT techn_id, techn_img, techn_title, techn_ico, techn_fact, techn_target, tech_downl FROM techniques_landing";
$techn_data = $con -> query($get_techn);
$technContent = '';
$factCount = 1;
if ($techn_data->num_rows > 0) {
while($row = $techn_data->fetch_assoc()) {
$techn_id = $row['techn_id'];
$techn_img = $row['techn_img'];
$techn_title = $row['techn_title'];
$techn_ico = $row['techn_ico'];
$techn_fact = $row['techn_fact'];
$techn_target = $row['techn_target'];
$tech_downl = $row['tech_downl'];
if ($factCount == 1) {
$technContent = $technContent .
'<div class="item" style="background-color: white;">'.
'<div class="wrap" style="box-shadow: 0px 10px 30px -4px rgba(0, 0, 0, 0.15);">'.
'<div class="techniques img d-flex align-items-center justify-content-center" style="background-image: url('.$techn_img.');"></div>'.
'<div class="text text-center px-4 t_">'.
'<h3>'.$techn_title.'</h3>'.
'<div class="services-wrap">';
$technContent = $technContent . factContent($techn_ico, $techn_fact);
} else if ($factCount == 2 || $factCount == 4 || $factCount == 5) {
$technContent = $technContent . factContent($techn_ico, $techn_fact);
} else { // $factCount == 3
$technContent = $technContent . '<div class="d2"><a>';
$technContent = $technContent . factContent($techn_ico, $techn_fact);
}
if ($factCount < 5) {
$factCount++;
} else { // $factCount == 5
$technContent = $technContent . '</a></div></div>';
if ($techn_target != '') {
$technContent = $technContent .
'<div class="d-flex justify-content-center">'.
'<div class="container">'.
'<div style="position: absolute; bottom: 42px; left: 0; right: 0;">'.
'<button class="btn '.$techn_target.' btn-primary location-button" type="button" data-toggle="modal" style="margin-right:10px;" data-target="#'.$techn_target.'">'.
'<i class="fa fa-book" aria-hidden="true"></i> Read more'.
'</button>'.
'<a href="'.$tech_downl.'" class="btn btn-primary location-button">'.
'<i class="fa fa-download" aria-hidden="true"></i> Download'.
'</a>'.
'</div>'.
'</div>'.
'</div>';
}
$technContent = $technContent .
'</div>'.
'</div>'.
'</div>';
$factCount = 1;
}
}
}
return $technContent;
} | [
"function help_new_dispense() {\n?>\n<h4>New dispense record</h4>\n<ul>\n<li>If a frame was dispensed, specify using the <b>Frame</b> input field</li>\n<li>Give the full detail of the lens(es) dispensed e.g.<br/>\n <b>OD: +000 +000 Axis 180</b>\n<br/> <b>OS: -000 -000 Axis 180</b>\n</li>\n<li>All accessories should be recorded in the <b>Accessories</b> field</li>\n<li>The amount charged should be entered in the <b>Amount</b> field</li>\n<li>Amount deposited should be entered in the <b>Deposit</b> field</li>\n<li>If any balance is to be paid, it should be entered in the <b>Balance</b> field. The total sum of the patient's debt is to be recorded in the patient's profile. Go back and select <b>Edit profile</b> to update that information. This field is for this dispense <b>only</b></li>\n<li>The appointed date for the patient to receive the dispensed item(s) should be entered in the <b>Due date</b> field</li>\n<li>The status field should be field as follows:<br/>\n<b>Pending:</b> if the items ordered by the patient are yet to be prepared by you<br/>\n<b>Prepared:</b> if the items are ready for collection but the patient has not come to pick them up<br/>\n<b>Dispensed:</b> if the items have been collected by the patient. This is the final state of all items\n</li>\n<li>For some reasons, the items may not be prepared and dispensed at the same branch. Therefore, it is important that you fill where the items were prepared and dispensed appropriately and also include the date(s)</li>\n<li>If you have any comment regarding the dispense record, use the <b>Comment</b> box. This is extremely important if the stock dispensed is different from what was prescribed or ordered. For example, if 000 +250 was dispensed <b>instead</b> of 000 +275</li>\n</ul>\n<div class='text'></div>\n<?php\n}",
"function deckTables($tcg, $deckA = '', $deckB = '', $deckC = '', $deckD = '') {\n\n // quick config\n $deckTables_pathos = \"./path/to/tcg/cards/\"; // path to your tcg cards. EZ\n\n $deckStacks = array($deckA, $deckB, $deckC, $deckD);\n $deckStacksClean = array($deckA, $deckB, $deckC, $deckD);\n $j = 0;\n\n for($i = 0; $i < sizeof($deckStacksClean); $i++) {\n\t if($deckStacksClean[$i] == '') { //do nothing\n\t } else {\n\t\t $deckStacksClean[$i] = substr($deckStacksClean[$i], 0, -2);\n\t\t // echo $deckStacksClean[$i];\n\t }\n }\n\n\n ?>\n\t\t <tr>\n\t\t\t <?php foreach($deckStacksClean as $deck) {\n // if the value is empty, display a filler image.\n\t\t\t\t\tif($deck === '') { ?>\n \n\t\t\t\t\t\t<td><img src=\"<?php echo $deckTables_pathos . $tcg . \"/filler.png\"; ?>\" title=\"...\"></td>\n\t\t <?php } else { ?>\n\t\t\t <td><a onclick=\"on('<?php echo $deck;?>')\"><img src=\"<?php echo '' . $deckTables_pathos . $tcg . \"/\" . $deckStacks[$j]; ?>.png\" title=\"<?php echo $deck;?>\"></td>\n\t\t\t <div id=\"show-<?php echo $deck;?>\" class=\"overlay\" onclick=\"off('<?php echo $deck;?>')\">\n\t\t\t\t<div id=\"magi-window\"><?php show_collecting($tcg,'',$deck) ?></div>\n\t\t\t</div>\n\t\t <?php } // if...else\n\n\t\t $j++;\n\t } //foreach ?>\n</tr>\n<tr>\n <?php\n \n\t foreach($deckStacksClean as $deck) {\n\t\t if($deck === '') {\n ?>\n\t\t\t <td> </td>\n\t <?php } else { ?>\n\t\t\t <td><?php \n // show the deckname and its worth, how much is collected!\n show_colworth($tcg, $deck); ?></td>\n\t <?php } // if...else\n } // foreach\n ?>\n</tr>\n\n<?php\n\n $j = 0;\n\n}",
"public function theoryDetails_post()\n\t{\n\t\t$theory_id = $this->post('theory_id');\n\t\t$course_id = $this->post('course_id');\n\t\t$this->getData('theoryDetails', [$theory_id, $course_id]);\n\t}",
"function include_advisors_text()\n{\n $objSrcUser = &$GLOBALS[\"objSrcUser\"];\n\n $show = 'population';\n if (isset($_GET['show'])) { $show = $_GET['show']; }\n\n echo get_advisor_links($show);\n\n switch($show)\n {\n case 'population':\n\n?>\n <!-- <div id=\"textMedium\">\n <p><b>The population advisor</b> greets you humbly:<br />Leader, no lands have ever before seen such great care that you show us. Please allow me to kiss your feet.</p>\n </div> -->\n <div id=\"columns\">\n <!-- Start left column -->\n <div id=\"leftcolumn\">\n <h2>Population</h2>\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=build\">Construction</a>\n </div>\n <?=get_housing_table($objSrcUser); ?><br />\n <?=get_population_table($objSrcUser); ?>\n <?=get_guide_link($objSrcUser, 'advisor_population'); ?>\n </div>\n <!-- end left column -->\n\n <!-- start right column -->\n <div id=\"rightcolumn\">\n <h2>Citizens</h2>\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=mystic\">Mystics</a>\n </div>\n <?=get_citizen_table($objSrcUser); ?>\n </div>\n <!-- End of the right column-->\n </div>\n <!-- end of 2 column layout -->\n\n<?php\n\n break; // end case population\n case 'resources':\n\n?>\n <!-- <div id=\"textMedium\">\n <p><b>The resource advisor</b> greets you humbly:<br />Leader, no lands have ever before seen such great care that you show us. Please allow me to kiss your feet.</p>\n </div> -->\n <div id=\"columns\">\n <!-- Start left column -->\n <div id=\"leftcolumn\">\n <h2>Production</h2>\n <?=get_income_table($objSrcUser); ?><br /><br />\n <?=get_wood_table($objSrcUser); ?>\n\n <h2>Resources</h2>\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=market&action=sell\">Sell Goods</a>\n </div>\n <?=get_goods_table($objSrcUser); ?>\n </div>\n <!-- end left column -->\n\n <!-- start right column -->\n <div id=\"rightcolumn\">\n <h2> </h2>\n <?=get_food_table($objSrcUser); ?><br /><br />\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=research\">Invest</a>\n </div>\n <?=get_research_table($objSrcUser); ?>\n\n <h2> </h2>\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=advisors&show=build\">Infrastructure</a>\n </div>\n <?=get_building_output_table($objSrcUser); ?>\n </div>\n <!-- end right column -->\n </div>\n <!-- end of 2 column layout -->\n<?php\n\n break; // end case resources\n case 'military':\n\n include_once(\"inc/functions/tribe.php\");\n\n?>\n <!-- <div id=\"textMedium\">\n <p><b>Your general</b> greets you humbly:<br />Leader, no lands have ever before seen such great care that you show us. Please allow me to kiss your feet.</p>\n </div> -->\n <br />\n <!-- Start 2 column layout -->\n <div id=\"columns\">\n <!-- Start left column -->\n <div id=\"leftcolumn\">\n <?=get_offence_table($objSrcUser); ?>\n </div>\n <!-- end left column -->\n\n <!-- start right column -->\n <div id=\"rightcolumn\">\n <?=get_defence_table($objSrcUser); ?>\n </div>\n <!-- end right column -->\n </div>\n <div class=\"clear\"><hr /></div>\n <!-- end of 2 column layout -->\n <br />\n <div class=\"tableLinkMedium\">\n <a href=\"main.php?cat=game&page=army\">Military Training</a>\n </div>\n <?=get_military_training_table($objSrcUser); ?>\n <br />\n <div class=\"tableLinkMedium\">\n <a href=\"main.php?cat=game&page=invade\">Invasion</a>\n </div>\n <?=get_military_returning_table($objSrcUser); ?>\n <?=get_guide_link($objSrcUser, 'advisor_military', 'textMedium'); ?>\n <br />\n<?php\n\n break; // end case military\n case 'actions':\n\n?>\n <!-- <div id=\"textMedium\">\n <p><b>The advisor</b> greets you humbly:<br />Leader, no lands have ever before seen such great care that you show us. Please allow me to kiss your feet.</p>\n </div> -->\n <br />\n <div id=\"columns\">\n <!-- Start left column -->\n <div id=\"leftcolumn\">\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=mystic\">Mystics</a>\n </div>\n <?=get_effecting_spells_table($objSrcUser); ?>\n <?=get_guide_link($objSrcUser, 'advisor_actions'); ?>\n </div>\n <!-- end left column -->\n\n <!-- start right column -->\n <div id=\"rightcolumn\">\n <div class=\"tableLinkSmall\">\n <a href=\"main.php?cat=game&page=thievery\">Thievery</a>\n </div>\n <?=get_effecting_ops_table($objSrcUser); ?>\n </div>\n <!-- end right column -->\n </div>\n <div class=\"clear\"><hr /></div>\n <!-- end of 2 column layout -->\n<?php\n\n break; // end case actions\n case 'build':\n\n?>\n <!-- <div id=\"textMedium\">\n <p><b>The tribe architect</b> greets you humbly:<br />Leader, no lands have ever before seen such great care that you show us. Please allow me to kiss your feet.</p>\n </div> -->\n <br />\n <div class=\"tableLinkMedium\">\n <a href=\"main.php?cat=game&page=explore\">Exploration</a> ::\n <a href=\"main.php?cat=game&page=build\">Construction</a>\n </div>\n <?=get_construction_table($objSrcUser); ?>\n <?=get_guide_link($objSrcUser, 'advisor_build', 'textMedium'); ?>\n<?php\n\n break; // end case build\n\n }\n}",
"function show_lesson_contents()\n\t{\n\t\tglobal $fc_db, $fc_db_struct, $lang, $template;\n\t\t\n# First of all we need to check variables same as build_questions()\n#################################\n# Set lesson to choose words from\n\t\tif ( isset( $_POST['lesson'] ) )\n\t\t{\n\t\t\t$lesson = $_POST['lesson'];\n\t\t}\n\t\telse\n\t\t{\n# FIXMELATER Should add correct exception here\n\t\t\techo '<h1>' . $lang['NO_LESSON_SELECTED'] . '</h1>';\n\t\t\tdie( '<script language=javascript>window.onload = setTimeout(function() { window.location=\"?mode=index\"; }, 1000);</script>' );\n\t\t}\n\t\t\n\t\tif ( is_array( $lesson ) )\n\t\t{\n\t\t\t$sql_select_lesson = ' AND (';\n\t\t\t\n\t\t\t$i = 0;\n\t\t\tforeach ( $lesson as $val )\n\t\t\t{\n\t\t\t\tif ( $i > 0 ) \n\t\t\t\t{\n\t\t\t\t\t$sql_select_lesson .= ' OR';\n\t\t\t\t}\n\t\t\t\t$sql_select_lesson .= ' l.`' . $fc_db_struct[FC_LESSONS_TABLE]['id'] . '` = \\'' . $val . '\\'';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql_select_lesson .= ' )';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$sql_select_lesson = ' AND l.`' . $fc_db_struct[FC_LESSONS_TABLE]['id'] . '` = \\'' . $lesson . '\\'';\n\t\t}\n###############################\n# Set part of speech if defined\n\t\t$sql_select_part_of_speech = '';\n\t\tif ( isset( $_POST['part_of_speech'] ) && is_array( $_POST['part_of_speech'] ) )\n\t\t{\n\t\t\t$part_of_speech = $_POST['part_of_speech'];\n\t\t\n\t\t\t$sql_select_part_of_speech .= ' AND (';\n\t\t\t\n\t\t\t$i = 0;\n\t\t\tforeach ( $part_of_speech as $val )\n\t\t\t{\n\t\t\t\tif ( $i > 0 ) \n\t\t\t\t{\n\t\t\t\t\t$sql_select_part_of_speech .= ' OR';\n\t\t\t\t}\n\t\t\t\t$sql_select_part_of_speech .= ' w.`' . $fc_db_struct[FC_WORDS_TABLE]['part_of_speech'] . '` = \\'' . mysql_escape_string( $val ) . '\\'';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql_select_part_of_speech .= ' )';\n\t\t}\n\n#####################\n# Should switch on language for translation here\n\t\t$test_language = ( isset( $_POST['test_language'] ) ) ? mysql_escape_string( $_POST['test_language'] ) : $config_fc['test']['default_test_language'];\n\n\t\t$sql =\t'SELECT'\n\t\t\t.\t' w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '` AS id'\n\t\t\t.\t', w.`' . $fc_db_struct[FC_WORDS_TABLE]['heb'] . '` AS heb'\n\t\t\t.\t', GROUP_CONCAT( DISTINCT r.`' . $fc_db_struct[FC_WORDS_RUS_TABLE]['rus'] . '`'\n\t\t\t.\t' ORDER BY c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['priority'] . '` DESC SEPARATOR \\', \\' ) AS translation'\n\t\t\t.\t' FROM `' . FC_WORDS_TABLE . '` AS w'\n\t\t\t.\t' LEFT JOIN `' . FC_LESSONS_TABLE . '` AS l'\n\t\t\t.\t' ON l.`' . $fc_db_struct[FC_LESSONS_TABLE]['word_id'] . '` = w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' LEFT JOIN `' . FC_HEB_RUS_TABLE . '` AS c'\n\t\t\t.\t' ON c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['heb_id'] . '` = w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' LEFT JOIN `' . FC_WORDS_RUS_TABLE . '` AS r'\n\t\t\t.\t' ON r.`' . $fc_db_struct[FC_WORDS_RUS_TABLE]['id'] . '` = c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['rus_id'] . '`'\n\t\t\t.\t' WHERE 1'\n\t\t\t.\t$sql_select_lesson\n\t\t\t.\t$sql_select_part_of_speech\n\t\t\t.\t' GROUP BY w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' ORDER BY w.`' . $fc_db_struct[FC_WORDS_TABLE]['part_of_speech'] . '` DESC'\n\t\t\t.\t', w.`' . $fc_db_struct[FC_WORDS_TABLE]['heb'] . '`'\n\t\t\t.\t';';\n\n\t\tif ( $GLOBALS['debug_all'] == true ) echo '<br>' . $sql;\n\t\t$this->record_debug( 'Called show_contents() with SQL: ' . $sql );\n\n\t\t$result = $fc_db->query($sql);\n\n\t\t\n\t\tif ( mysql_num_rows( $result ) > 0 )\n\t\t{\n\t\t\t$template->assign_var( 'CURRENT_TEST_CONTENTS', $lang['CURRENT_TEST_CONTENTS'] );\n\t\t\t\n\t\t\t$i = 0;\n\t\t\twhile ( $row = $fc_db->fetch_assoc( $result ) ) \n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$current_bg_color = ( $i % 2 == 0 )\t? 'answer_tr_light' : 'answer_tr_dark';\n\t\t\t\t$template->assign_block_vars( 'test_contents', array(\n\t\t\t\t\t\t'HEBREW' => $row['heb'],\n\t\t\t\t\t\t'TRANSLATION' => $row['translation'],\n\t\t\t\t\t\t'TR_CLASS' => $current_bg_color,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# No words selected.\n\t\t}\n\t}",
"function forumHtmlInterface($data)\n{\n\tglobal $langNoPosts, $langMore, $langSender, $urlServer;\n\n\t$content = \"\";\n\n\tif($numOfLessons = count($data) > 0) {\n\t\t$content .= <<<fCont\n <div class=\"datacontainer\">\n <ul class=\"datalist\">\nfCont;\n\t\t$numOfLessons = count($data);\n\t\tfor ($i=0; $i <$numOfLessons; $i++) {\n\t\t\t$content .= \"\\n <li class='category'>\".$data[$i][0].\"</li>\";\n\t\t\t$iterator = count($data[$i][2][0]);\n\t\t\tfor ($j=0; $j < $iterator; $j++){\n\t\t\t\t$url = $urlServer.\"index.php?perso=5&c=\".$data[$i][1].\"&t=\".$data[$i][2][0][$j][2].\"&f=\".$data[$i][2][0][$j][0].\"&s=\".$data[$i][2][0][$j][4];\n $data[$i][2][0][$j][8] = ellipsize($data[$i][2][0][$j][8], 150,\n \"... <strong><span class='announce_date'>$langMore</span></strong>\");\n\t\t\t\t$content .= \"\\n <li><a class='square_bullet' href='$url'><strong class='title_pos'>\".$data[$i][2][0][$j][3].\" (\".nice_format(date(\"Y-m-d\", strtotime($data[$i][2][0][$j][5]))).\")</strong></a><p class='content_pos'>\".$data[$i][2][0][$j][8].\"<br /><cite class='content_pos'>\".$data[$i][2][0][$j][6].\" \".$data[$i][2][0][$j][7].\"</cite></p></li>\";\n\t\t\t}\n\t\t\t//if ($i+1 <$numOfLessons) $content .= \"<br>\";\n\t\t}\n\t\t$content .= \"</ul></div>\";\n\t} else {\n\t\t$content .= \"<p>$langNoPosts</p>\";\n\t}\n\n\treturn $content;\n}",
"function make_ui_card($options, $generic_content, $cardtype)\r\n {\r\n\r\n if ($this->card[$this->number_of_cards-1][\"type\"] == HAW_HDML_DISPLAY)\r\n {\r\n // current card is display card\r\n\r\n // ==> make an entry/choice card out of it\r\n $this->card[$this->number_of_cards-1][\"type\"] = $cardtype;\r\n\r\n // append options to the already existing ones\r\n if (!isset($this->card[$this->number_of_cards-1][\"options\"]))\r\n $this->card[$this->number_of_cards-1][\"options\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards-1][\"options\"] .= $options;\r\n\r\n // append received content to the already existing one\r\n if (!isset($this->card[$this->number_of_cards-1][\"display_content\"]))\r\n $this->card[$this->number_of_cards-1][\"display_content\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards-1][\"display_content\"] .= $generic_content;\r\n }\r\n else\r\n {\r\n // current card is already entry or choice card\r\n // ==> create new entry/choice card\r\n // ==> link current card to this new entry/choice card\r\n\r\n $this->card[$this->number_of_cards][\"type\"] = $cardtype;\r\n\r\n $cardname = sprintf(\" name=\\\"%d\\\"\", $this->number_of_cards+1);\r\n\r\n if (!isset($this->card[$this->number_of_cards][\"options\"]))\r\n $this->card[$this->number_of_cards][\"options\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards][\"options\"] .= $cardname;\r\n\r\n if ($this->title)\r\n $this->card[$this->number_of_cards][\"options\"] .= \" title=\\\"$this->title\\\"\";\r\n\r\n $this->card[$this->number_of_cards][\"options\"] .= $options;\r\n\r\n $this->card[$this->number_of_cards][\"display_content\"] = $generic_content;\r\n\r\n $action = sprintf(\"<action type=\\\"accept\\\" task=\\\"go\\\" dest=\\\"#%d\\\">\\n\",\r\n $this->number_of_cards+1);\r\n $this->card[$this->number_of_cards-1][\"action\"] = $action;\r\n\r\n $this->number_of_cards++;\r\n }\r\n }",
"function getDetailsIdea ( $idIdea ) {\n include \"classInnovativeIdea.php\";\n $MyIdea = new innovativeIdea ();\n $outHTML =\"\";\n $data = json_decode ( $MyIdea->getIdeaDetails ( $idIdea ) );\n $outHTML .= \"<dl class='dl-horizontal'>\";\n foreach ( $data as $field ) {\n $outHTML .= \"<dt>Title:</dt>\";\n $outHTML .= \"<dd>\" . setCharSetHTML ( $field->title ) . \"</dd>\";\n $outHTML .= \"<dt>Author:</dt>\";\n $outHTML .= \"<dd>\" . setCharSetHTML ( $field->author ) . \"</dd>\";\n $outHTML .= \"<dt>Email:</dt>\";\n $outHTML .= \"<dd><a href='mailto:\" . $MyIdea->getMail ( $field->author ) . \"'>\"\n . $MyIdea->getMail ( $field->author ) .\"</a></dd>\";\n $outHTML .= \"<dt>Date:</dt>\";\n $outHTML .= \"<dd>\" . setCharSetHTML ( $field->date ) . \"</dd>\";\n $outHTML .= \"<dt>Tags:</dt><dd>\";\n foreach ( $field->tags as $tag ) {\n $outHTML .= setCharSetHTML ( $tag );\n }\n\n $outHTML .= \"<dt>Price:</dt>\";\n $outHTML .= \"<dd>\" . setCharSetHTML ( $field->sold->price ) . \" €</dd>\";\n $outHTML .= \"</dd>\";\n $outHTML .= \"</dl>\";\n $outHTML .= \"<p>\". setCharSetHTML ( $field->description ) .\"</p>\";\n\n\n if ( $field->sold->flag == 1){\n $outHTML .=\n \"<a href='./mainpanel.php?action=6?ididea=\" . $field->ididea . \"' class='btn btn-primary btn-sm'>\"\n . \"<span class='glyphicon glyphicon-shopping-cart'></span> Buy idea</a>\";\n }else{\n if ( $field->sold->flag == 0){\n $outHTML .=\n \"<a href='../controller/controllerSellIdea.php?ididea=\" . $field->ididea . \"' class='btn btn-default btn-sm' disabled>\"\n . \"<span class='glyphicon glyphicon-euro'></span> Not for sale</a>\";\n }else{\n $outHTML .=\n \"<a href='../controller/controllerDetailsIdea.php?ididea=\" . $field->ididea . \"' class='btn btn-default btn-sm' disabled>\"\n . \"<span class='glyphicon glyphicon-shopping-cart'></span> Sold</a>\";\n }\n\n }\n }\n return $outHTML;\n }",
"function show_detailed_teststand($ID) {\n\n $query = \"SELECT * FROM daf.teststand where ID = '\" . $ID . \"'\";\n $teststand = mysql_query($query);\n\n if (! $teststand) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($teststand); // should only be one row\n $num_fields = mysql_num_fields($teststand);\n\n echo '<table class=\"fullwidth\">';\n echo \"<caption class=\\\"cap1\\\"><div>Teststand</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($teststand, $i);\n $fieldindex[$fieldname] = $i;\n }\n \n $teststand_row = mysql_fetch_row($teststand);\n /* $ScenarioID = $scenario_row[$fieldindex['ID']]; */\n\n for ($i = 0; $i < $num_fields; $i++) {\n echo '<tr>';\n echo '<th class=\"fullwidth\">' . mysql_field_name($teststand, $i) . '</th>';\n echo '<td>' . $teststand_row[$i] . '</td>';\n echo '</tr>';\n echo \"\\n\";\n }\n echo '</table>';\n \n show_all_hosts($ID, \"fullwidth\");\n \n /* $query = \"SELECT ID, Name, Type, Model, Serial, Hostselectorvalue, Teststandprimary, Comments, Agentstatus, Agentstatusdate FROM daf.host WHERE host.TeststandID = '\" . $ID . \"'\";\n \n $testcase = mysql_query($query);\n\n if (! $testcase) die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<form action=\"index.php\" method=\"post\">' . \"\\n\";\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Hosts</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n echo '<th>' . $fieldname . '</th>';\n $fieldindex[$fieldname] = $i; \n }\n echo \"</tr>\\n\";\n \n $idindex = $fieldindex['ID'];\n $nameindex = $fieldindex['Name'];\n \n for ($i= 0; $i < $num_rows; $i++) {\n \n $testcase_row = mysql_fetch_row($testcase);\n echo '<tr>';\n for ($j = 0; $j < $num_fields; $j++) { \n if ($j == $nameindex) {\n echo \"<td class=td_smd><a href=index.php?action=show&object=host&ID=$testcase_row[$idindex]>$testcase_row[$j]</a></td>\"; \n } else { \n echo '<td>' . $testcase_row[$j] . '</td>';\n }\n } \n echo \"</tr>\\n\";\n \n }\n\n echo '</table>'; */\n \n show_detailed_child_objects(\"teststand\", $ID, 1);\n \n}",
"function displayhtml()\n {\n global $DB;\n\n $content = '';\n\n $associateParentID = $DB->get_record('msm_compositor', array('id' => $this->compid))->parent_id;\n\n $associateParenttable = $DB->get_record('msm_compositor', array('id' => $associateParentID))->table_id;\n\n $associateParentTablename = $DB->get_record('msm_table_collection', array('id' => $associateParenttable))->tablename;\n\n // Definition/Theorem and Comment linked to associates needs to be processed differently due to them having different views in display\n if ($associateParentTablename == 'msm_def')\n {\n if ($this->description != 'Quiz')\n {\n if (!empty($this->childs))\n {\n $content .= \"<li class='defminibutton' id='defminibutton-\" . $this->infos[0]->compid . \"' onmouseover='infoopen(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n $content .= \"<div class='refcontent' id='refcontent-\" . $this->infos[0]->compid . \"' style='display:none;'>\";\n foreach ($this->childs as $child)\n {\n $content .= $child->displayhtml();\n }\n $content .= \"</div>\";\n }\n else\n {\n $content .= \"<li class='defminibutton' id='defminibutton-\" . $this->infos[0]->compid . \"' onmouseover='popup(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n }\n\n $patterns = array();\n $replacements = array();\n $patterns[0] = \"/<p.*?>/\";\n $patterns[1] = \"/<\\/p>/\";\n $patterns[2] = \"/<span.*?>/\";\n $patterns[3] = \"/<\\/span>/\";\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n $replacements[2] = \"\";\n $replacements[3] = \"\";\n\n $modifiedCaption = preg_replace($patterns, $replacements, $this->infos[0]->caption);\n $caption = htmlentities($modifiedCaption);\n\n if (($caption === null) || (strlen(trim($caption)) == 0))\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\">';\n }\n else\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\" title=\"' . $caption . '\">';\n }\n\n $content .= $this->displayContent($this->infos[0], $this->infos[0]->info_content);\n $content .= \"</div>\";\n }\n }\n\n if ($associateParentTablename == 'msm_theorem')\n {\n if ($this->description != 'Quiz')\n {\n if (!empty($this->childs))\n {\n// $content .= \"<li class='minibutton' id='minibutton-\" . $this->infos[0]->compid . \"' onmouseover='infoopen(\" . $this->infos[0]->compid . \")' onclick='showRightpage(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<li class='minibutton' id='minibutton-\" . $this->infos[0]->compid . \"' onmouseover='infoopen(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n $content .= \"<div class='refcontent' id='refcontent-\" . $this->infos[0]->compid . \"' style='display:none;'>\";\n foreach ($this->childs as $child)\n {\n $content .= $child->displayhtml();\n }\n $content .= \"</div>\";\n }\n else\n {\n $content .= \"<li class='minibutton' id='minibutton-\" . $this->infos[0]->compid . \"' onmouseover='popup(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n }\n\n $patterns = array();\n $replacements = array();\n $patterns[0] = \"/<p.*?>/\";\n $patterns[1] = \"/<\\/p>/\";\n $patterns[2] = \"/<span.*?>/\";\n $patterns[3] = \"/<\\/span>/\";\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n $replacements[2] = \"\";\n $replacements[3] = \"\";\n\n $modifiedCaption = preg_replace($patterns, $replacements, $this->infos[0]->caption);\n $caption = htmlentities($modifiedCaption);\n\n if (($caption === null) || (strlen(trim($caption)) == 0))\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\">';\n }\n else\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\" title=\"' . $caption . '\">';\n }\n\n $content .= $this->displayContent($this->infos[0], $this->infos[0]->info_content);\n $content .= \"</div>\";\n }\n }\n\n if ($associateParentTablename == 'msm_comment')\n {\n if (!empty($this->childs))\n {\n// $content .= \"<li class='commentminibutton' id='commentminibutton-\" . $this->infos[0]->compid . \"' onmouseover='infoopen(\" . $this->infos[0]->compid . \")' onclick='showRightpage(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<li class='commentminibutton' id='commentminibutton-\" . $this->infos[0]->compid . \"' onmouseover='infoopen(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n $content .= \"<div class='refcontent' id='refcontent-\" . $this->infos[0]->compid . \"' style='display:none;'>\";\n foreach ($this->childs as $child)\n {\n $content .= $child->displayhtml();\n }\n $content .= \"</div>\";\n }\n else\n {\n $content .= \"<li class='commentminibutton' id='commentminibutton-\" . $this->infos[0]->compid . \"' onmouseover='popup(\" . $this->infos[0]->compid . \")'>\";\n $content .= \"<span style='cursor:pointer'>\";\n $content .= $this->description;\n $content .= \"</span>\";\n $content .= \"</li>\";\n }\n\n $patterns = array();\n $replacements = array();\n $patterns[0] = \"/<p.*?>/\";\n $patterns[1] = \"/<\\/p>/\";\n $patterns[2] = \"/<span.*?>/\";\n $patterns[3] = \"/<\\/span>/\";\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n $replacements[2] = \"\";\n $replacements[3] = \"\";\n\n $modifiedCaption = preg_replace($patterns, $replacements, $this->infos[0]->caption);\n $caption = htmlentities($modifiedCaption);\n\n if (($caption === null) || (strlen(trim($caption)) == 0))\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\">';\n }\n else\n {\n $content .= '<div id=\"dialog-' . $this->infos[0]->compid . '\" class=\"dialogs\" title=\"' . $caption . '\">';\n }\n $content .= $this->displayContent($this->infos[0], $this->infos[0]->info_content);\n $content .= \"</div>\";\n }\n\n return $content;\n }",
"public function RenderPage() {\n\t$ht = NULL;\n\t$idDept = $this->GetKeyValue();\n\t\n\t$tInfo = $this->TitleInfoQuery();\n\t//$rs = $tInfo->SQL_forDeptPage_wTitleInfo($idDept,TRUE);\n\t$ht = $tInfo->RenderImages_forDept($idDept);\n\n\treturn $ht;\n\t\n\t// 2018-02-17 old version\n\t\n\t$arData = $tInfo->StatsArray_forDept($idDept);\n\t$rsImg = $this->ImageInfoQuery()->GetRecords_forThumbs_forDept($this->GetKeyValue());\n\t$arData = $rsImg->Collate_byTitle($arData);\n\t$rcTitle = $tInfo->SpawnRecordset();\n\t$rcTitle->sql = $rsImg->sql;\t// for debugging\n\t$arRes = $rcTitle->RenderTitleResults($arData);\n\n\t//$cntAct = count($arRes['act']['text']);\n\t$cntAct = count($arData['active']);\n\t$cntRet = count($arData['retired']);\n\t\n\tif (($cntAct + $cntRet) == 0) {\n\t $ht = '<span class=main>This department appears to be disused. (How did you get here?)</span>';\n\t} else {\n\t\n\t $ht = '';\n\t $oGlob = vcGlobalsApp::Me();\n\t if ($cntAct > 0) {\n\t\t$sHdr = $cntAct.' Available Title'.fcString::Pluralize($cntAct);\n\t\t$sContent = \n\t\t '<table class=\"catalog-summary\"><tr><td>'\n\t\t .$arRes['act']['text']\n\t\t .'</td></tr></table>'\n\t\t .$arRes['act']['imgs']\n\t\t ;\n\t\t$oSection = new vcHideableSection('hide-available',$sHdr,$sContent);\n\t\t$ht .= $oSection->Render();\n\t \n\t /* 2018-02-14 the old way\n\t\t$wsArrow = $oGlob->GetWebSpec_DownPointer();\n\t\t$htArrow = \"<img src='$wsArrow' alt='↓ (down arrow)'>\";\n\t\t$sTitle = $cntAct.' Available Title'.fcString::Pluralize($cntAct);\n\t\t$oHdr = new fcSectionHeader($htArrow.' '.$sTitle);\n\t\t$ht .= $oHdr->Render()\n\t\t .'<table class=\"catalog-summary\"><tr><td>'\n\t\t .$arRes['act']['text']\n\t\t .'</td></tr></table>'\n\t\t .$arRes['act']['imgs']\n\t\t ;\n\t */\n\t }\n\t if ($cntRet > 0) {\n\t\t$sHdr = $cntRet.' Unavailable Title'.fcString::Pluralize($cntRet);\n\t\t$oSection = new vcHideableSection('show-retired',$sHdr,$arRes['ret']);\n\t\t$oSection->SetDefaultHide(TRUE);\n\t\t$ht .= $oSection->Render();\n\t \n\t /* 2018-02-14 should be redundant now\n\t\t$oFormIn = fcHTTP::Request();\n\t\t$sHdr = $cntRet.' Unavailable Title'.fcString::Pluralize($cntRet);\n\t\t\n\t\t$doRet = $oFormIn->KeyExists('ret');\n\t\tif ($doRet) {\n\t\t $url = './';\n\t\t $sPopup = 'hide unavailable titles';\n\t\t $wsArrow = $oGlob->GetWebSpec_DownPointer();\n\t\t $htAlt = '↓ (down arrow)';\n\t\t $htRet = $arRes['ret'];\n\t\t} else {\n\t\t $url = '?ret';\n\t\t $sPopup = 'show unavailable titles';\n\t\t $wsArrow = $oGlob->GetWebSpec_RightPointer();\n\t\t $htAlt = '→ (right arrow)';\n\t\t $htRet = '';\n\t\t}\n\t\t$sTitle = $cntRet.' Unavailable Title'.fcString::Pluralize($cntRet);\n\t\t$htArrow = \"<img src='$wsArrow' alt='$htAlt' title='$sPopup'>\";\n\t\t\n\t\t$oHdr = new fcSectionHeader(\"<a href='$url'>$htArrow</a> $sTitle\");\n\t\t$ht .= $oHdr->Render().$htRet;\n\t */\n\t }\n\t}\n\treturn $ht;\n }",
"function Show_Adverts($title,$advert_arr)\n {\n global $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$special_include;\n $HTML_Content = '';\n\t\t\t\t$HTML_normaltop_outer = '<div class=\"'.CONTAINER_CLASS.'\"><div class=\"\">';\n\t\t\t\t$HTML_normalbottom_outer = '</div></div>';\n\t\t\t\t$HTML_flashtop_outer \t= '<div class=\"flash_mid_con\">';\n\t\t\t\t\n\t\t\t\t$HTML_flashbottom_outer\t = '</div>';\n\t\t\t\t\t\t\t\t\t\t\n if (count($advert_arr))\n {\n foreach ($advert_arr as $d=>$k)\n {\n\t\t\t\t\t\tif ($k['advert_id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active \t= $k['advert_activateperiodchange'];\n\t\t\t\t\t\t\tif($active==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$proceed\t= validate_component_dates($k['advert_displaystartdate'],$k['advert_displayenddate']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$proceed\t= true;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$proceed = false;\t\t\n if($proceed)\n {\n if ($title and $k['advert_type']!='TXT' and $k['advert_type']!='IMG' and $k['advert_type']!='ROTATE')\n {\n $HTML_Content = '\n <div classs=\"advert_mid_header\">'.\n $title.'\n </div>';\n } \n switch ($k['advert_type'])\n {\n case 'IMG': // Case if advert is of type image upload \n $path = url_root_image('adverts/'.$k['advert_source'],1);\n $link = $k['advert_link'];\n if ($link!='')\n {\n $HTML_Content .= '<a href=\"'.$link.'\" title=\"'.stripslashes($k['advert_title']).'\" target=\"'.$k['advert_target'].'\">';\n }\n $HTML_Content .='<img src=\"'.$path.'\" alt=\"'.stripslashes($k['advert_title']).'\" title=\"'.stripslashes($k['advert_title']).'\" styel=\"border:0;\" />';\n if ($link!='')\n {\n $HTML_Content .='</a>';\n }\n break;\n case 'SWF': // case if advert is of type flash\n $path = url_root_image('adverts/'.$k['advert_source'],1);\n $link = $k['advert_link'];\n $HTML_Content .= '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"552\" height=\"280\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<param name=\"movie\" value='.$path.' >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<param name=\"quality\" value=\"high\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<param name=\"BGCOLOR\" value=\"#D6D8CB\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<param name=\"wmode\" value=\"transparent\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<embed src='.$path.' type=application/x-shockwave-flash width=552 height=280 wmode=\"transparent\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>';\n\t\t\t\t\t\t\t\tbreak;\n case 'PATH': // case if image url is given as advert\n $path = $k['advert_source'];\n $link = $k['advert_link'];\n if ($link!='')\n {\n $HTML_Content .= '<a href=\"'.$link.'\" title=\"'.stripslashes($k['advert_title']).'\" target=\"'.$k['advert_target'].'\">'; \n }\n $HTML_Content .= '<img src=\"'.$path.'\" alt=\"'.stripslashes($k['advert_title']).'\" title=\"'.$title.'\" border=\"0\" />';\n if ($link!='')\n {\n $HTML_Content .= '</a>';\n }\n break;\n case 'TXT': // case if html is set as advert\n $path = $k['advert_source'];\n $HTML_Content .= stripslash_normal($path);\n break;\n case 'ROTATE1': // case if ad rotate images are set\n $advert_ul_id = uniqid('advert_');\n // get the list of rotating images\n $sql_rotate = \"SELECT rotate_image,rotate_link, rotate_alttext \n FROM \n advert_rotate \n WHERE \n adverts_advert_id = \".$k['advert_id'].\" \n ORDER BY \n rotate_order ASC\";\n $ret_rotate = $db->query($sql_rotate);\n if($db->num_rows($ret_rotate))\n {\n \n $HTML_Content .= '<section id=\"slider\" class=\"carousel-wrap\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"slider-carousel\" class=\"carousel slide\" data-ride=\"carousel\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"carousel-inner\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cnt=0;\n while ($row_rotate = $db->fetch_array($ret_rotate))\n {\n if($row_rotate['rotate_alttext']!='')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$alt_text = $row_rotate['rotate_alttext']; \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$alt_text = $k['advert_title']; \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$link = trim($row_rotate['rotate_link']);\n $link_start = $link_end = '';\n if($link!='')\n {\n $link_start = '<a href=\"'.$link.'\" title=\"'.stripslashes($k['advert_title']).'\">';\n $link_end = '</a>';\n }\n if($cnt==0)\n {\n\t\t\t\t\t\t\t\t\t\t\t\t$cls = 'item active';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t $cls = 'item';\n\t\t\t\t\t\t\t\t\t\t\t}\n \t\n\t\t\t\t\t\t\t\t\t\t\t$HTML_Content .= '<div class=\"'.$cls.'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'.$link_start.'<img src=\"'.url_root_image('adverts/rotate/'.$row_rotate['rotate_image'],1).'\" alt=\"'.stripslashes($alt_text).'\" title=\"'.stripslashes($alt_text).'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-default get\">'.stripslashes($alt_text).'</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t </div>';\n $cnt++;\n }\n $HTML_Content .='</div>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<a href=\"#slider-carousel\" class=\"left control-carousel hidden-xs\" data-slide=\"prev\">\n\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-angle-left\"></i>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t<a href=\"#slider-carousel\" class=\"right control-carousel hidden-xs\" data-slide=\"next\">\n\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-angle-right\"></i>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\t\t\t\t\t\n\t\t\t\t</div>\n\t\t</div>\n\t</section>';\n }\n break;\n case 'ROTATE': // case if ad rotate images are set\n $advert_ul_id = uniqid('advert_');\n // get the list of rotating images\n $sql_rotate = \"SELECT rotate_image,rotate_link, rotate_alttext \n FROM \n advert_rotate \n WHERE \n adverts_advert_id = \".$k['advert_id'].\" \n ORDER BY \n rotate_order ASC\";\n $ret_rotate = $db->query($sql_rotate);\n if($db->num_rows($ret_rotate))\n {\n \n\t\t\t\t\t\t\t\t\t$HTML_Content .= ' <header id=\"myCarousel\" class=\"carousel slide\">\n\t\t\t\t\t\t\t\t\t<!-- Indicators -->\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t<!-- Wrapper for Slides -->\n\t\t\t\t\t\t\t\t\t<div class=\"carousel-inner\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$cnt=0;\n\t\t\t\t\t\t\t\t\t$HTML_indicator ='';\n\t\t\t\t\t\t\t\t\twhile ($row_rotate = $db->fetch_array($ret_rotate))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($cnt==0)\n\t\t\t\t\t\t\t\t\t\t$class_active = 'class=\"active\"';\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$class_active = '';\n\t\t\t\t\t\t\t\t\t\t$HTML_indicator .= '<li data-target=\"#myCarousel\" data-slide-to=\"'.$cnt.'\" '.$class_active.' ></li>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($row_rotate['rotate_alttext']!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$alt_text = $row_rotate['rotate_alttext']; \n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$alt_text = $k['advert_title']; \n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$link = trim($row_rotate['rotate_link']);\n\t\t\t\t\t\t\t\t\t\t$link_start = $link_end = '';\n\t\t\t\t\t\t\t\t\t\tif($link!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$link_start = '<a href=\"'.$link.'\" title=\"'.stripslashes($k['advert_title']).'\">';\n\t\t\t\t\t\t\t\t\t\t\t$link_end = '</a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif($cnt==0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$cls = 'item active';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t $cls = 'item';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$HTML_Content .= '<div class=\"'.$cls.'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"fill\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t'.$link_start.'<img src=\"'.url_root_image('adverts/rotate/'.$row_rotate['rotate_image'],1).'\" alt=\"'.stripslashes($alt_text).'\" title=\"'.stripslashes($alt_text).'\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"carousel-caption\">\n\t\t\t\t\t\t\t\t\t<h2>'.stripslashes($alt_text).'</h2>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t </div>';\n\t\t\t\t\t\t\t\t\t\t$cnt++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif($HTML_indicator!='')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$HTML_Content .='\n\t\t\t\t\t\t\t\t\t<div class=\"owl_hideA\" id=\"owl_hideA\"> \n\t\t\t\t\t\t\t\t\t<ol class=\"carousel-indicators\">'.$HTML_indicator.'</ol></div>';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t$HTML_Content .=' </div>\n\n\t\t\t\t\t\t\t\t\t<!-- Controls -->\n\t\t\t\t\t\t\t\t\t<a class=\"left carousel-control\" href=\"#myCarousel\" data-slide=\"prev\">\n\t\t\t\t\t\t\t\t\t<span class=\"icon-prev\"></span>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<a class=\"right carousel-control\" href=\"#myCarousel\" data-slide=\"next\">\n\t\t\t\t\t\t\t\t\t<span class=\"icon-next\"></span>\n\t\t\t\t\t\t\t\t\t</a>\n\n\t\t\t\t\t\t\t\t\t</header>';\n }\n ?>\n <script>\n\t\t\t\t\t\t\t\t $( document ).ready(function() {\n $('#myCarousel').carousel({\n\t\t\t\t\t\t\t\t\t interval: 7000,\n\t\t\t\t\t\t\t\t\t cycle: true\n\t\t\t\t\t\t\t\t\t}); \n\t\t\t\t\t\t\t\t});\n </script> <?php\n break;\n };\n // HTML Follows \n\t\t\t\t\t\t\tif($advert_arr[0]['special_include'] == true)\n\t\t\t\t\t\t\t\techo $HTML_Content;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\tif($k['advert_type']!='SWF' and $k['advert_type']!='ROTATE')\n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\techo $HTML_normaltop_outer; \n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\techo $HTML_flashtop_outer;\n \t\techo $HTML_Content;\n\t\t\t\t\t\t\t\tif($k['advert_type']!='SWF' and $k['advert_type']!='ROTATE')\n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\techo $HTML_normalbottom_outer; \n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\techo $HTML_flashbottom_outer;\n\t\t\t\t\t\t\t}\n }\n else\n {\n\t\t\t\t\t\t\tif($k['advert_id'])\n\t removefrom_Display_Settings($k['advert_id'],'mod_adverts');\n }\n }\n }\n }",
"function occasions_list_overview_all($atts = array()){\n \n $ocassions_obj = new Ocassions();\n $dealerId = get_option(\"at_dealer_id\");\n $filertObj = new Filter();\n $layout_mode = get_option(\"at_overview_layoutmode\");\n\n $url_param = $_SERVER['REQUEST_URI'];\n $url_param = explode('/',$url_param);\n (int)$url_param[3];\n\n if(isset($url_param[3]) && is_numeric($url_param[3]) && $url_param[3] != \"\"){\n\n $template = get_option(\"at_details_view_mode\");\n $dealerId = explode(',', $dealerId);\n $dealerIds = '';\n if(is_array($dealerId)){\n foreach($dealerId as $id){\n $dealerIds .= '&filter%5BdealerId%5D='.$id.'';\n }\n }else{\n $dealerIds .= '&filter%5BdealerId%5D='.$dealerId.'';\n }\n \n $ocassion = $ocassions_obj->connection_to_api('advertenties','?pageNumber=1&pageSize=25&filter%5BadvertentieId%5D='.$url_param[3].''.$dealerIds);\n $ocassion = $ocassion->items[0];\n \n $description_text = $ocassion->mededelingen;\n\n if($template == \"at_details_view_list\"){\n require_once (plugin_dir_path(__FILE__).\"views/autotrack-details-onepage.php\");\n }else{\n require_once (plugin_dir_path(__FILE__).\"views/autotrack-details-tabs.php\");\n }\n\n }else{\n\n \n if (!empty($atts)){\n\n $all_occasions = $filertObj->get_all_occasions($dealerId,$ocassions_obj,$atts['count']);\n \n $occassions_total = $all_occasions->pageSize;\n\n }else{\n\n $all_occasions = $filertObj->get_all_occasions($dealerId,$ocassions_obj,'100000000');\n $occassions_total = $all_occasions->total;\n }\n\n if($layout_mode == \"at_layout_overview_table\"){\n \n require_once (plugin_dir_path(__FILE__).\"views/overview-grid.php\");\n }else{\n \n require_once (plugin_dir_path(__FILE__).\"views/overview-list.php\");\n }\n\n }\n\n }",
"function show_detailed_testcase($ID) {\n\n $query = \"SELECT * FROM daf.testcase where ID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Testcase</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n $fieldindex[$fieldname] = $i;\n }\n \n $testcase_row = mysql_fetch_row($testcase);\n /* $ScenarioID = $scenario_row[$fieldindex['ID']]; */\n\n for ($i = 0; $i < $num_fields; $i++) {\n echo '<tr>';\n echo '<th>' . mysql_field_name($testcase, $i) . '</th>';\n echo '<td>' . $testcase_row[$i] . '</td>';\n echo '</tr>';\n echo \"\\n\";\n }\n echo '</table>';\n \n $query = \"SELECT DISTINCT scenario.ID, scenario.Name, action.Stepnumber FROM daf.action INNER JOIN daf.scenario ON action.ScenarioID = scenario.ID WHERE action.TestcaseID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<form action=\"index.php\" method=\"post\">' . \"\\n\";\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Scenarios</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n echo '<th>' . $fieldname . '</th>';\n $fieldindex[$fieldname] = $i; \n }\n echo \"</tr>\\n\";\n \n $idindex = $fieldindex['ID'];\n $nameindex = $fieldindex['Name'];\n \n for ($i= 0; $i < $num_rows; $i++) {\n \n $testcase_row = mysql_fetch_row($testcase);\n echo '<tr>';\n for ($j = 0; $j < $num_fields; $j++) { \n if ($j == $nameindex) {\n echo \"<td class=td_smd><a href=index.php?action=show&object=scenario&ID=$testcase_row[$idindex]>$testcase_row[$j]</a></td>\"; \n } else { \n echo '<td>' . $testcase_row[$j] . '</td>';\n }\n } \n echo \"</tr>\\n\";\n \n }\n \n echo \"</tr>\\n\";\n echo '</table>'; \n \n}",
"function faq_redisplay_postdata()\n\t{\n\t\t$this->content->template['faq_data'][0][0]['question'] = $this->nobr($this->checked->faq_question);\n\t\t// die Antwort wiederherstellen\n\t\t$this->content->template['faq_data'][0][0]['answer'] = $this->checked->faq_answer;\n\t\t// Frontend-Freigabe checkbox wiederherstellen\n\t\t$this->content->template['checkedrel'] = $this->checked->faq_release == \"j\" ? \"checked='checked'\" : \"\";\n\t\t// Kategoriedaten holen und Auswahl(en) wiederherstellen (nicht bei Reset)\n\t\tif (count($this->checked->faq_cat_id) AND !isset($this->checked->submit[1])) {\n\t\t\tforeach ($this->checked->faq_cat_id as $key) { $catid[$key]['cat_id'] = $key; }\n\t\t}\n\t\telse {\n\t\t\t$catid = array();\n\t\t}\n\t\t$this->fetchAllCategories($catid, \"\"); // In jedem Fall, auch, wenn keine Kategorie ausgew�hlt wurde (= Fehler)\n\t}",
"function toon_advertenties(){\n\t\t$return = '';\n\t\t/*\n\t\t * De template ophalen\n\t\t */\n\t\t$template = file_get_contents($this->advertentie_template);\n\t\t$arr_template = explode('<--break-->',$template);\n\t\t$header = $arr_template[0];\n\t\t$content = $arr_template[1];\n\t\t$footer = $arr_template[2];\n\t\t\n\t\t$return .= $header;\n\t\t\n\t\t/*\n\t\t * De advertenties ophalen\n\t\t */\n\t\t$limit = $this->advertentie_max;\n\n\t\t$this->select_db();\n\t\t$query_rs_advertenties = sprintf(\"SELECT * FROM cms_advertenties WHERE status=1 ORDER BY RAND() LIMIT $limit\");\n\t\t$rs_advertenties = mysql_query($query_rs_advertenties,$this->conn);\n\t\t$row_rs_advertenties = mysql_fetch_assoc($rs_advertenties);\n\t\t$totalRows_rs_advertenties = mysql_num_rows($rs_advertenties);\n\t\t$display = ' style=\"display:none;\"';\n\t\tif($totalRows_rs_advertenties > 0){\n\t\t\tdo {\n\t\t\t\t$afbeelding = ($row_rs_advertenties['afbeelding'] != '') ? '<img src=\"/inc/photo.php?file='.$row_rs_advertenties['afbeelding'].'&width=100\" class=\"advertentie_afbeelding\" alt=\"'.$row_rs_advertenties['afbeelding'].'\" />' : '';\n\t\t\t\t$tmp = str_replace('[afbeelding]',$afbeelding,$content);\n\t\t\t\t$tmp = str_replace('[titel]',$row_rs_advertenties['titel'],$tmp);\n\t\t\t\t$tmp = str_replace('[tekst]',nl2br($row_rs_advertenties['tekst']),$tmp);\n\t\t\t\t$tmp = str_replace('[bedrijfsnaam]',$row_rs_advertenties['bedrijfsnaam'],$tmp);\n\t\t\t\t$straat = $row_rs_advertenties['straat'];\n\t\t\t\t$straat_display = (trim($straat) == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[straat]',$straat,$tmp);\n\t\t\t\t$tmp = str_replace('[straat_display]',$straat_display,$tmp);\n\t\t\t\t$postcode = $row_rs_advertenties['postcode'];\n\t\t\t\t$plaats = $row_rs_advertenties['plaats'];\n\t\t\t\t$postcode_display = (trim($postcode) == '' && trim($plaats) == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[postcode_display]',$postcode_display,$tmp);\n\t\t\t\t$tmp = str_replace('[postcode]',$postcode,$tmp);\n\t\t\t\t$tmp = str_replace('[plaats]',$plaats,$tmp);\n\t\t\t\t$telefoon = $row_rs_advertenties['telefoon'];\n\t\t\t\t$telefoon_display = (trim($telefoon) == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[telefoon]',$telefoon,$tmp);\n\t\t\t\t$tmp = str_replace('[telefoon_display]',$telefoon_display,$tmp);\n\t\t\t\t$fax = $row_rs_advertenties['fax'];\n\t\t\t\t$fax_display = (trim($fax) == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[fax]',$fax,$tmp);\n\t\t\t\t$tmp = str_replace('[fax_display]',$fax_display,$tmp);\n\t\t\t\t$email = (trim($row_rs_advertenties['email']) == '') ? '' : '<a href=\"mailto:'.trim($row_rs_advertenties['email']).'\">'.trim($row_rs_advertenties['email']).'</a>' ;\n\t\t\t\t$email_display = ($email == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[email]',$email,$tmp);\n\t\t\t\t$tmp = str_replace('[email_display]',$email_display,$tmp);\n\t\t\t\t$www = (trim($row_rs_advertenties['www']) == '') ? '' : '<a href=\"http://'.trim($row_rs_advertenties['www']).'\" target=\"_blank\">'.trim($row_rs_advertenties['www']).'</a>';\n\t\t\t\t$www_display = ($www == '') ? $display : '';\n\t\t\t\t$tmp = str_replace('[www]',$www,$tmp);\n\t\t\t\t$tmp = str_replace('[www_display]',$www_display,$tmp);\n\t\t\t\t$return .= $tmp;\n\t\t\t} while(($row_rs_advertenties = mysql_fetch_assoc($rs_advertenties))!=false);\n\t\t} else {\n\t\t\t$return .= 'Er zijnh elaas nog geen advertenties geplaatst';\n\t\t}\n\t\tmysql_free_result($rs_advertenties);\n\t\t$return .= $footer;\n\t\t\n\t\t\n\t\treturn $return;\n\t}",
"function on_cap_load_manuscripts ()\n{\n $html = array ();\n $html[] = \"<div>\";\n ob_start ();\n $table = new Witness_List_Table ($_REQUEST['corresp']);\n // $table->set_pagination_args ($this->pagination_args);\n $table->prepare_items ();\n $table->display ();\n $html[] = ob_get_contents ();\n ob_end_clean ();\n $html[] = \"</div>\";\n\n send_json (true, '', $html);\n}",
"private function printOneCIF($id,$title, $description, $path, $URL)\r\n {\r\n ?>\r\n <!--Div for CIF and title + text inside-->\r\n <?php echo ('<a class=\"cif-detail-link\" href=\"'.$path.'cifDetail.php?id='.$id.'\">');?>\r\n <div class=\"cif\">\r\n <h4 class=\"cif-title\">\r\n <?php\r\n echo $title;\r\n ?>\r\n </h4>\r\n <p class=\"cif-description\">\r\n <?php\r\n //Write only the first 380 character of the cif\r\n echo substr($description, 0, 380).'...';\r\n ?>\r\n </p>\r\n <?php\r\n if(isset($_SESSION['namPseudo'])) {\r\n ?>\r\n <!--Dropdown evaluate-->\r\n <div class=\"cif-bottom\">\r\n <ul class=\"ul-dropdown\">\r\n <li class=\"dropdown\">\r\n <a data-toggle=\"dropdown\" class=\"evaluate-link\" role=\"link\">Evaluer <span\r\n class=\"glyphicon glyphicon-star-empty\"></span></a>\r\n\r\n <div class=\"dropdown-menu\">\r\n <form class=\"form\" method=\"post\" action=\"<?php echo $path.'addComment.php'; ?>\" accept-charset=\"UTF-8\">\r\n <div class=\"form-group\">\r\n <textarea class=\"form-control\" name=\"comment\" rows=\"4\" placeholder=\"Commentaire\"></textarea>\r\n </div>\r\n <div class=\"form-group\" id=\"div-evaluate\">\r\n <input type=\"radio\" name=\"evaluation\" value=\"1\" checked> <span\r\n class=\"glyphicon glyphicon-star\"></span><br/>\r\n <input type=\"radio\" name=\"evaluation\" value=\"2\"> <span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><br/>\r\n <input type=\"radio\" name=\"evaluation\" value=\"3\"> <span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><br/>\r\n <input type=\"radio\" name=\"evaluation\" value=\"4\"> <span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><br/>\r\n <input type=\"radio\" name=\"evaluation\" value=\"5\"> <span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><span\r\n class=\"glyphicon glyphicon-star\"></span><br/>\r\n\r\n <input name=\"idCif\" type=\"hidden\" value=\"<?php echo $id; ?>\">\r\n <input name=\"URL\" type=\"hidden\" value=\"<?php echo $URL; ?>\">\r\n </div>\r\n <div class=\"form-group\">\r\n <button type=\"submit\" class=\"btn btn-primary btn-block\">Soumettre</button>\r\n </div>\r\n </form>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n <!--Dropdown evaluate-->\r\n <?php\r\n }\r\n ?>\r\n </div>\r\n </a>\r\n <?php\r\n\r\n }",
"function main(){\n include_once '../config.php';\n include_once '../connect.php';\n include_once '../authenticate.php';\n\n $roomOptions = getOptions($conn,'room', 'Rooms');\n $machineName = getOptions($conn, 'machine_name', 'Machines');\n $statusOptions = getOptions($conn, 'status', 'Status');\n $requestedByOptions = getOptions($conn, 'requested_by', 'Requested By');\n $assignedTechOptions = getOptions($conn, 'assigned_tech', 'Assigned Tech');\n $listOfAdmins = getAdmins($conn);\n $testOutput = \"\";\n if (isset($_POST['fromRow']) && $_POST['fromRow'] != null){\n $fromRow = $_POST['fromRow'];\n }\n else{\n $fromRow = 0;\n }\n $rowStep = 10;\n\n $totalRows = getTotalRows($conn,$isAdmin,$uid);\n $tablePageMessage = \"Showing: \" . $fromRow . \" to \" . ($fromRow + $rowStep) . \" out of: \" . $totalRows;\n\n $tableInfo = getTableheader($isAdmin);\n $sql = getSQLQuery($isAdmin,$fromRow, $rowStep,$uid);\n $testOutput = $testOutput . $sql;\n //fill the table with ALL information.\n $sqlPrepared = $conn->prepare($sql);\n $sqlPrepared->execute(); //should be in a try/catch, but in this scenario it isnt required.\n $height = 1;\n $i = 0; //initialize i. Normally i wouldnt have to do this here, but in the case that the user searches something with no results $i still needs to be initalized to tell <p id=colCount> how many columns there are\n //While there are rows left in the SQL\n while($row = $sqlPrepared->fetch(PDO::FETCH_NUM)) {\n $tableInfo = $tableInfo . \"<tr>\";\n $i = 0;\n for ($j = 0; $j < sizeof($row); $j++){\n $value = $row[$j];\n $ticketid = $row[0];\n if($i == 4){\n $tableInfo = $tableInfo . \"<td class='ticketCommentCell'> <a id=forumLink class='nav-link' href='./messagePage.php?ticket_id=$ticketid'>Click To See Forum </a>\";\n }\n else{\n $tableInfo = $tableInfo . \"<td class='ticketCell'>\";\n }\n //Admin can change the values for Status, Assigned Tech\n if ($isAdmin == true && $i == 10){ \n $tableInfo = $tableInfo . \n \"\n <select class='ticketInput' type='text' name='value\" . $i . \"a\" . $height . \"'>\n <option value='$value'>$value</option>\n $listOfAdmins \n </select>\n </td>\";\n }\n elseif(($isAdmin && $i == 1) || ($isAdmin && $i == 2)){ //machine name and room are now editable by admins.\n $tableInfo = $tableInfo . \"<input type='text' name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n elseif($i == 4){ //comments\n $displayValue = explode(\" \",$value);\n $tableInfo = $tableInfo . $displayValue[0] . \"<br>\" . $displayValue[1];\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Supervisor information.\n elseif (($isAdmin && $i == 9) || (!$isAdmin && $i == 7)){\n $displayValue = explode(\" \",$value);\n //displayValue[0] = supervisor name. (a name, or null)\n //displayValue[1] = supervisor code. (a code or null)\n $tableInfo = $tableInfo . $displayValue[0] . \"<br>\" . $displayValue[1];\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Admin can change the value for closed using a drop box, if closed == null\n elseif ($isAdmin == true && $i == 3){\n if($value == 'Unassigned'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='Unassigned'>Unassigned</option>\n <option value='In Progress'>In Progress</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }\n elseif($value == 'In Progress'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='In Progress'>In Progress</option>\n <option value='Unassigned'>Unassigned</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }\n elseif($value == 'Closed'){\n $tableInfo = $tableInfo .\n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='Closed'>Closed</option>\n <option value='In Progress'>In Progress</option>\n <option value='Unassigned'>Unassigned</option>\n </select></td>\";\n }\n else{ \n $tableInfo = $tableInfo . \n \"<select name='value\" . $i . \"a\" . $height . \"'>\n <option value='$value'>Your Value:$value Please choose one of the below options</option>\n <option value='Unassigned'>Unassigned</option>\n <option value='In Progress'>In Progress</option>\n <option value='Closed'>Closed</option>\n </select></td>\";\n }//end else\n }//end elseif admin, status, 'closed'\n elseif($isAdmin == true && $i == 11){ //invoice link\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'>\n <a id=invoiceLink class=nav-link href='./invoicePage.php?ticket_id=$ticketid'>Invoice</a> </td>\";\n }\n //closed time (for both admin and user)\n elseif($i == 6){ \n if ($row[3] == 'Closed'){ //row[3] = status. (only show closed date value when its closed)\n $tableInfo = $tableInfo . $value;\n }\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }\n //Else: The column cannot be edited. It should display a value and have a hidden input of the value aswell so \n // The information can be used in a $_POST for saving changes.\n else{\n $tableInfo = $tableInfo . \"$value \";\n $tableInfo = $tableInfo . \"<input type=hidden name='value\" . $i . \"a\" . $height . \"' value='$value'></td>\";\n }//end isAdmin, editable column\n $i = $i + 1;\n }//end fore loop\n $height = $height + 1;\n $tableInfo = $tableInfo . \"</tr>\";\n }//End While (There is a row to fetch)\n \n $tableInfo = $tableInfo . \"</table>\";\n $tableHeightOutput = $height;\n $colCountOutput = $i;\n\n echo json_encode(\n array(\n \"tableInfo\" => $tableInfo,\n \"roomOptions\" => $roomOptions,\n \"machineOptions\" => $machineName,\n \"statusOptions\" => $statusOptions,\n \"requestedByOptions\" => $requestedByOptions,\n \"assignedTechOptions\" => $assignedTechOptions,\n \"tableHeight\" => $tableHeightOutput,\n \"colCount\" => $colCountOutput,\n \"fromRow\" => $fromRow,\n \"tablePageMessage\" => $tablePageMessage,\n \"totalRows\" => $totalRows,\n \"testOutput\" => $testOutput\n )\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a text customizer attribute and returns its resource name. | private static function createTextCustomizerAttribute(
GoogleAdsClient $googleAdsClient,
int $customerId,
string $customizerName
) {
// Creates a text customizer attribute. The customizer attribute name is
// arbitrary and will be used as a placeholder in the ad text fields.
$textAttribute = new CustomizerAttribute([
'name' => $customizerName,
'type' => CustomizerAttributeType::TEXT
]);
// Creates a customizer attribute operation for creating a customizer attribute.
$customizerAttributeOperation = new CustomizerAttributeOperation();
$customizerAttributeOperation->setCreate($textAttribute);
// Issues a mutate request to add the customizer attribute.
$customizerAttributeServiceClient = $googleAdsClient->getCustomizerAttributeServiceClient();
$response = $customizerAttributeServiceClient->mutateCustomizerAttributes(
MutateCustomizerAttributesRequest::build($customerId, [$customizerAttributeOperation])
);
$customizerAttributeResourceName = $response->getResults()[0]->getResourceName();
printf(
"Added text customizer attribute with resource name '%s'.%s",
$customizerAttributeResourceName,
PHP_EOL
);
return $customizerAttributeResourceName;
} | [
"function customizer_text($wp_customize) {\r\n $wp_customize->add_setting('your_theme_text');\r\n $wp_customize->add_control( 'your_theme_text',\r\n array(\r\n 'label' => 'Text Setting',\r\n 'section' => 'sections',\r\n 'settings' => 'your_theme_text',\r\n ) );\r\n}",
"private static function createPriceCustomizerAttribute(\n GoogleAdsClient $googleAdsClient,\n int $customerId,\n string $customizerName\n ) {\n // Creates a price customizer attribute. The customizer attribute name is\n // arbitrary and will be used as a placeholder in the ad text fields.\n $priceAttribute = new CustomizerAttribute([\n 'name' => $customizerName,\n 'type' => CustomizerAttributeType::PRICE\n ]);\n\n // Creates a customizer attribute operation for creating a customizer attribute.\n $customizerAttributeOperation = new CustomizerAttributeOperation();\n $customizerAttributeOperation->setCreate($priceAttribute);\n\n // Issues a mutate request to add the customizer attribute.\n $customizerAttributeServiceClient = $googleAdsClient->getCustomizerAttributeServiceClient();\n $response = $customizerAttributeServiceClient->mutateCustomizerAttributes(\n MutateCustomizerAttributesRequest::build($customerId, [$customizerAttributeOperation])\n );\n\n $customizerAttributeResourceName = $response->getResults()[0]->getResourceName();\n printf(\n \"Added price customizer attribute with resource name '%s'.%s\",\n $customizerAttributeResourceName,\n PHP_EOL\n );\n\n return $customizerAttributeResourceName;\n }",
"public function getAttributeName()\n\t{\n\t\treturn 'CustomAttribute';\n\t}",
"public static function forCustomerCustomizer(\n $customerId,\n $customizerAttributeId\n ): string {\n return CustomerCustomizerServiceClient::customerCustomizerName(\n $customerId,\n $customizerAttributeId\n );\n }",
"public function txtSuffix_Create($strControlId = null) {\n\t\t\t$this->txtSuffix = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtSuffix->Name = QApplication::Translate('Suffix');\n\t\t\t$this->txtSuffix->Text = $this->objPerson->Suffix;\n\t\t\t$this->txtSuffix->MaxLength = Person::SuffixMaxLength;\n\t\t\treturn $this->txtSuffix;\n\t\t}",
"function genTextBox( $name, $initialValue )\n\t{\n \techo '<textarea name=\"' . $name . '\" class=\"groupBBS fbFont\">' .\n\t $initialValue . '</textarea>';\n\t}",
"function textarea_attr(string $textarea_name, array $textarea): string\n{\n $attributes = [\n 'name' => $textarea_name,\n ] + ($textarea['extras']['attr'] ?? []);\n\n return html_attr($attributes);\n}",
"public function getCampaignCustomizer()\n {\n return $this->campaign_customizer;\n }",
"public function txtName_Create($strControlId = null) {\n\t\t\t$this->txtName = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtName->Name = QApplication::Translate('Name');\n\t\t\t$this->txtName->Text = $this->objScorecard->Name;\n\t\t\t$this->txtName->TextMode = QTextMode::MultiLine;\n\t\t\treturn $this->txtName;\n\t\t}",
"public static function customizer( $wp_customize )\n\t{\n\t\t\n\t\t// List of skins registered with AI.\n\t\t//\n\t\t$skins = array(\n\t\t\t'lightning' => __( 'Electrify' ),\n\t\t\t'cappy' => __( 'Mecha' ),\n\t\t\t'kitty' => __( 'Blue' ),\n\t\t\t'modern' => __( 'Yosemite' ),\n\t\t\t'edge' => __( 'Edge' ),\n\t\t);\n\t\t\n\t\t// Skins setting\n\t\t//\n\t\t$wp_customize->add_setting(\n\t\t\t'ai_theme',\n\t\t\tarray(\n\t\t\t\t'default' => 'lightning',\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Skins control\n\t\t//\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'ai_theme',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Skin' ),\n\t\t\t\t\t'section' => 'colors',\n\t\t\t\t\t'settings' => 'ai_theme',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'choices' => $skins,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Copyright setting\n\t\t//\n\t\t$wp_customize->add_setting(\n\t\t\t'copyright',\n\t\t\tarray(\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Copyright control\n\t\t//\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'copyright',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Copyright text' ),\n\t\t\t\t\t'section' => 'title_tagline',\n\t\t\t\t\t'settings' => 'copyright',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Default featured image section\n\t\t//\n\t\t$wp_customize->add_section( 'default_post_thumbnail', array(\n\t\t\t'title' => __( 'Featured Images' ),\n\t\t\t'priority' => 85,\n\t\t));\n\t\t\n\t\t// Default featured image setting\n\t\t//\n\t\t$wp_customize->add_setting(\n\t\t\t'default_post_thumbnail',\n\t\t\tarray(\n\t\t\t\t'default' => self::$dir_abs . '/images/welding.jpg',\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Default featured image control\n\t\t//\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Image_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'default_post_thumbnail',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Default Featured Image' ),\n\t\t\t\t\t'section' => 'default_post_thumbnail',\n\t\t\t\t\t'setting' => 'default_post_thumbnail',\n\t\t\t\t\t'priority' => 30,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t}",
"public function txtName_Create($strControlId = null) {\n\t\t\t$this->txtName = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtName->Name = QApplication::Translate('Name');\n\t\t\t$this->txtName->Text = $this->objPraises->Name;\n\t\t\t$this->txtName->MaxLength = Praises::NameMaxLength;\n\t\t\treturn $this->txtName;\n\t\t}",
"public function txtName_Create($strControlId = null) {\n\t\t\t$this->txtName = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtName->Name = QApplication::Translate('Name');\n\t\t\t$this->txtName->Text = $this->objVersionkcoin->Name;\n\t\t\t$this->txtName->Required = true;\n\t\t\t$this->txtName->MaxLength = Versionkcoin::NameMaxLength;\n\t\t\treturn $this->txtName;\n\t\t}",
"public function getName() {\n return \"text\".$this->hashCode();\n }",
"private function build_attribute_name(): object {\n $attributename = $this->get_attribute_by_name('Name');\n $datasourcedomain = $this->get_data_source('Domain Name and URL Details');\n\n $attribute = (object)[\n 'objectTypeAttributeId' => $attributename->id,\n \"objectAttributeValues\" => [\n (object)[\n \"value\" => $datasourcedomain->data->domainname,\n ],\n ],\n ];\n\n return $attribute;\n }",
"protected function create_attributes()\n {\n $attr = '';\n if (!empty($this->attr)) {\n foreach ($this->attr as $name => $value) {\n $attr .= ' ' . $name . '=\"' . $value . '\"';\n }\n }\n\n return $attr;\n }",
"protected function getTextareaAttributes() {\n\t\t$dimensions = $this->getTextareaDimensions();\n\n\t\t$height = ceil($dimensions['rows']) * self::TEXTAREA_CSS_HEIGHT_FACTOR;\n\n\t\treturn sprintf(\n\t\t\t'cols=\"%s\" rows=\"%s\" wrap=\"%s\" style=\"%s\" onchange=\"%s\" ',\n\t\t\t$dimensions['cols'],\n\t\t\t$dimensions['rows'],\n\t\t\t'off',\n\t\t\t'width: 97%; height: ' . $height . 'px',\n\t\t\t$this->textareaOnChangeFunction\n\t\t);\n\t}",
"public function txtGender_Create($strControlId = null) {\n\t\t\t$this->txtGender = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtGender->Name = QApplication::Translate('Gender');\n\t\t\t$this->txtGender->Text = $this->objGroupRegistrations->Gender;\n\t\t\t$this->txtGender->MaxLength = GroupRegistrations::GenderMaxLength;\n\t\t\treturn $this->txtGender;\n\t\t}",
"public function txtConsumoMixto_Create($strControlId = null) {\n\t\t\t$this->txtConsumoMixto = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtConsumoMixto->Name = QApplication::Translate('Consumo Mixto');\n\t\t\t$this->txtConsumoMixto->Text = $this->objFichas->ConsumoMixto;\n\t\t\t$this->txtConsumoMixto->MaxLength = Fichas::ConsumoMixtoMaxLength;\n\t\t\treturn $this->txtConsumoMixto;\n\t\t}",
"public function getNameAttribute()\n {\n $components = explode('-', $this->id);\n if (array_key_exists($components[1], config('terms'))) {\n return config('terms')[$components[1]].' '.$components[0];\n } else {\n return str_replace('_', ' ', title_case($components[1])).' '.$components[0];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the collColetaPesquisas collection. By default this just sets the collColetaPesquisas collection to an empty array (like clearcollColetaPesquisas()); 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 initColetaPesquisas($overrideExisting = true)
{
if (null !== $this->collColetaPesquisas && !$overrideExisting) {
return;
}
$this->collColetaPesquisas = new PropelObjectCollection();
$this->collColetaPesquisas->setModel('ColetaPesquisa');
} | [
"public function clearPesquisas()\n\t{\n\t\t$this->collPesquisas = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function getColetaPesquisas($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collColetaPesquisas || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collColetaPesquisas) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initColetaPesquisas();\n\t\t\t} else {\n\t\t\t\t$collColetaPesquisas = ColetaPesquisaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByPesquisa($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collColetaPesquisas;\n\t\t\t\t}\n\t\t\t\t$this->collColetaPesquisas = $collColetaPesquisas;\n\t\t\t}\n\t\t}\n\t\treturn $this->collColetaPesquisas;\n\t}",
"public function setCargoPesquisas(PropelCollection $cargoPesquisas, PropelPDO $con = null)\n\t{\n\t\t$this->cargoPesquisasScheduledForDeletion = $this->getCargoPesquisas(new Criteria(), $con)->diff($cargoPesquisas);\n\n\t\tforeach ($cargoPesquisas as $cargoPesquisa) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($cargoPesquisa->isNew()) {\n\t\t\t\t$cargoPesquisa->setPesquisa($this);\n\t\t\t}\n\t\t\t$this->addCargoPesquisa($cargoPesquisa);\n\t\t}\n\n\t\t$this->collCargoPesquisas = $cargoPesquisas;\n\t}",
"public function initTbdisciplinacorequisitoss()\n\t{\n\t\t$this->collTbdisciplinacorequisitoss = array();\n\t}",
"public function initCasos()\n\t{\n\t\t$this->collCasos = new PropelObjectCollection();\n\t\t$this->collCasos->setModel('Caso');\n\t}",
"public function getColetaPesquisas($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collColetaPesquisas || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collColetaPesquisas) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initColetaPesquisas();\n\t\t\t} else {\n\t\t\t\t$collColetaPesquisas = ColetaPesquisaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByUsuario($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collColetaPesquisas;\n\t\t\t\t}\n\t\t\t\t$this->collColetaPesquisas = $collColetaPesquisas;\n\t\t\t}\n\t\t}\n\t\treturn $this->collColetaPesquisas;\n\t}",
"public function initTbdisciplinarequisitoss()\n\t{\n\t\t$this->collTbdisciplinarequisitoss = array();\n\t}",
"public function initCertificadoCupoms()\n\t{\n\t\t$this->collCertificadoCupoms = array();\n\t}",
"public function getCargoPesquisas($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collCargoPesquisas || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collCargoPesquisas) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initCargoPesquisas();\n\t\t\t} else {\n\t\t\t\t$collCargoPesquisas = CargoPesquisaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByPesquisa($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collCargoPesquisas;\n\t\t\t\t}\n\t\t\t\t$this->collCargoPesquisas = $collCargoPesquisas;\n\t\t\t}\n\t\t}\n\t\treturn $this->collCargoPesquisas;\n\t}",
"public function getCargoPesquisas($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collCargoPesquisas || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collCargoPesquisas) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initCargoPesquisas();\n\t\t\t} else {\n\t\t\t\t$collCargoPesquisas = CargoPesquisaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByCargo($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collCargoPesquisas;\n\t\t\t\t}\n\t\t\t\t$this->collCargoPesquisas = $collCargoPesquisas;\n\t\t\t}\n\t\t}\n\t\treturn $this->collCargoPesquisas;\n\t}",
"public function initC006tEvidenciasRelatedByCoRegistra()\n\t{\n\t\t$this->collC006tEvidenciasRelatedByCoRegistra = array();\n\t}",
"public function initOptionalCourses()\n {\n $this->collOptionalCourses = new PropelObjectCollection();\n $this->collOptionalCourses->setModel('Course');\n }",
"public function initVpoRequestCargos()\n\t{\n\t\t$this->collVpoRequestCargos = array();\n\t}",
"public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}",
"public function initPettyCashs()\n\t{\n\t\t$this->collPettyCashs = array();\n\t}",
"public function initProspectAtendimentos()\n\t{\n\t\t$this->collProspectAtendimentos = array();\n\t}",
"public function initClientes()\n\t{\n\t\t$this->collClientes = new PropelObjectCollection();\n\t\t$this->collClientes->setModel('Cliente');\n\t}",
"public function clearParceiroComissionamentos()\n\t{\n\t\t$this->collParceiroComissionamentos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function initTbprofessortickets()\n\t{\n\t\t$this->collTbprofessortickets = array();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
include(dirname( __FILE__, 1 ).'/mannanetworkmain.php'); | function mannanetwork_func( $atts ){
include('mannanetwork-main.php');
return "";
} | [
"function moodle_page_handler(){\n\tinclude elgg_get_plugins_path() . 'moodle/pages/moodle/main.php';\n}",
"protected function _includeFile()\n {\n include func_get_arg(0);\n }",
"public function loadPHP() {\r\n\t\tif($this->config->main_php != \"\" && file_exists($this->folder.'/'.$this->config->main_php)){\r\n\t\t\tinclude($this->folder.'/'.$this->config->main_php);\r\n\t\t}\r\n\t\telse echo 'FATAL Error in Extension: Main php file not found!';\r\n\t}",
"function load_php_file($file)\n{\n\tinclude_once join_path(SITE_ROOT_DIR, $file);\n}",
"function bpmp_load() {\n\tinclude( dirname( __FILE__ ) . '/bp-mega-populate.php' );\n}",
"function homeCMS(){\n require_once('view/homeCMS.php');\n }",
"function mfs_mailbox_inbox() {\r\n\tinclude_once( 'inbox.php' );\r\n}",
"function chopslider_tb_page() {\n include_once dirname( __FILE__ ) . \"/transition-builder/chopslider-transition-builder.php\";\n}",
"public function doWebWeb(){\n include IA_ROOT . '/addons/sm_shop/init.php';\n }",
"function pl_admin_include( $file ) {\n\n // include it\n return include_once( dirname(__FILE__).'/admin/'.$file );\n}",
"public function require_files() {\n\t\n\t\trequire_once 'class-frontend.php';\n\t\trequire_once 'class-schedule.php';\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-news.php\");\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-user.php\");\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-team.php\");\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-inbox.php\");\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-league.php\");\n\t\trequire_once(dirname(__FILE__) . \"/objects/class-tournament.php\");\n\t\t\n\t}",
"function init_modbus()\n{\n require_once dirname(__FILE__) . '/../phpmodbus-master/Phpmodbus/ModbusMaster.php';\n}",
"function tffaq_questions() {\r\n\trequire_once('tffaq-questions.php');\r\n}",
"function include_script($url, $return = false)\n{\n require_once __DIR__ . \"/..{$url}\";\n}",
"protected static function loadIncludes(){\n\t\trequire_once(DIR_FRAMEWORK . 'web_tester.php');\n\t\trequire_once(DIR_FRAMEWORK . 'unit_tester.php');\n\t\trequire_once(dirname(__FILE__) .DS. 'SeleniumTestCase.php');\n\t}",
"public function demo_importer() {\n\t\tinclude_once dirname( __FILE__ ) . '/admin/views/html-admin-page-importer.php';\n\t}",
"function chopslider_manage_page() {\n include_once dirname( __FILE__ ) . \"/chopslider-admin-manage.php\";\n}",
"function mosLoadAdminModule( $name, $params=NULL ) {\r\n\tglobal $task;\r\n\tglobal $database, $my;\r\n\r\n\t$name = str_replace( '/', '', $name );\r\n\t$name = str_replace( '\\\\', '', $name );\r\n\t$path = site_path.\"/iadmin/modules/ima$name.php\";\r\n\tif (file_exists( $path )) {\r\n\t\trequire $path;\r\n\t}\r\n}",
"public function core($file)\n {\n\t\t//echo self::$base_path.'/luser/src/'.$file .'.php';\n if (file_exists( self::$framework . DIRECTORY_SEPARATOR . $file . '.php')) {\n require self::$framework . DIRECTORY_SEPARATOR . $file . '.php';\n\t\t\t\t //echo \"success load ->\".self::$framework . DIRECTORY_SEPARATOR . $file . '.php'.\"<br>\";\n } \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation gETVoidsVoidId Retrieve a void | public function gETVoidsVoidId($void_id)
{
list($response) = $this->gETVoidsVoidIdWithHttpInfo($void_id);
return $response;
} | [
"public function expectVoidReturnType();",
"public function gETVoidsVoidIdAsync($void_id)\n {\n return $this->gETVoidsVoidIdAsyncWithHttpInfo($void_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function gETVoids()\n {\n $this->gETVoidsWithHttpInfo();\n }",
"public function gETVoidsVoidIdAsyncWithHttpInfo($void_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Void';\n $request = $this->gETVoidsVoidIdRequest($void_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function toVoid() { # :: a -> Void\n return new Void;\n }",
"function getVoidReason() {\n\t\treturn $this->m_voidReason;\n\t}",
"public function testIsVoidable()\n {\n $this->stubRequest(\n 'POST',\n '/payouts/' . self::TEST_ID . '/void',\n [],\n [],\n [\n 'id' => self::TEST_ID\n ]\n );\n\n $result = Payouts::void(self::TEST_ID);\n\n $this->assertEquals($result['id'], self::TEST_ID);\n }",
"public function pATCHVoidsVoidIdRequest($void_id, $void_update)\n {\n // verify the required parameter 'void_id' is set\n if ($void_id === null || (is_array($void_id) && count($void_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $void_id when calling pATCHVoidsVoidId'\n );\n }\n // verify the required parameter 'void_update' is set\n if ($void_update === null || (is_array($void_update) && count($void_update) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $void_update when calling pATCHVoidsVoidId'\n );\n }\n\n $resourcePath = '/voids/{voidId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($void_id !== null) {\n $resourcePath = str_replace(\n '{' . 'voidId' . '}',\n ObjectSerializer::toPathValue($void_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n ['application/vnd.api+json']\n );\n }\n\n // for model (json/xml)\n if (isset($void_update)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($void_update));\n } else {\n $httpBody = $void_update;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function gETVoidIdReferenceAuthorizationWithHttpInfo($void_id)\n {\n $request = $this->gETVoidIdReferenceAuthorizationRequest($void_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 (int) $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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function testIsVoidableThrowApiException()\n {\n $this->expectException(\\Xendit\\Exceptions\\ApiException::class);\n\n Payouts::void(self::TEST_ID);\n }",
"public function testPaymentVoid() {\n $payment = $this->createEntity('commerce_payment', [\n 'payment_gateway' => $this->paymentGateway->id(),\n 'order_id' => $this->order->id(),\n 'amount' => new Price('10', 'USD'),\n ]);\n $this->paymentGateway->getPlugin()->createPayment($payment);\n\n $this->drupalGet($this->paymentUri . '/' . $payment->id() . '/operation/void');\n $this->assertSession()->pageTextContains('Are you sure you want to void the 10 USD payment?');\n $this->getSession()->getPage()->pressButton('Void');\n $this->assertSession()->addressEquals($this->paymentUri);\n $this->assertSession()->pageTextContains('Voided');\n\n \\Drupal::entityTypeManager()->getStorage('commerce_payment')->resetCache([$payment->id()]);\n $payment = Payment::load($payment->id());\n $this->assertEquals($payment->getState()->getLabel(), 'Voided');\n }",
"public function getCanVoidFlag();",
"public function pATCHVoidsVoidIdAsync($void_id, $void_update)\n {\n return $this->pATCHVoidsVoidIdAsyncWithHttpInfo($void_id, $void_update)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function dELETEVoidsVoidIdAsync($void_id)\n {\n return $this->dELETEVoidsVoidIdAsyncWithHttpInfo($void_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function privateMethodWithVoidReturn(): void\n {\n return;\n }",
"public function isVoid()\n {\n return $this->is(self::VOID_TYPE);\n }",
"public function isVoid()\n {\n return static::STATUS_VOID == $this->getStatus();\n }",
"public function testBuildCreditCardVoid()\n {\n $config = new SinglePayConfig();\n $config->setServiceConfig(self::$testConfig);\n\n $card = new Card();\n $card->setToken('test-token')\n ->setName('TEST')\n ->setNumber('8696969')\n ->setExpiryMonth('09')\n ->setExpiryYear('18')\n ->setCvv('200');\n\n $data = new SinglePayData();\n $data->setOrderAmount('10.00')\n ->setCard($card);\n\n $creditCardVoid = ExpressFactory::buildCreditCardVoid($config, $data);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Method\\CreditCardVoid', $creditCardVoid);\n $this->assertInternalType('array', $creditCardVoid->extendedParameters);\n $this->assertEquals('PaymentAccount', $creditCardVoid->extendedParameters[0]->Key);\n }",
"public function processVoid(): void\n {\n $isVoid = $this->transaction->getTxnType() === TransactionInterface::TYPE_VOID;\n if ($isVoid && $this->config->getValue('order_status_voided') === 'canceled') {\n $this->orderManagement->cancel($this->order->getEntityId());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate new prefix to honeypot if it's older than 30 minutes | function air_helper_login_honeypot_form() {
$prefix = get_option( 'air_helper_login_honeypot' );
if ( ! $prefix || $prefix['generated'] < strtotime( '-30 minutes' ) ) {
$prefix = air_helper_login_honeypot_reset_prefix();
} ?>
<p id="air_lh_name_field" class="air_lh_name_field">
<label for="air_lh_name"><?php echo esc_html( 'Append three letters to this input', 'air-helper' ); ?></label><br />
<input type="text" name="air_lh_name" id="air_lh_name" class="input" value="<?php echo esc_attr( $prefix['prefix'] ); ?>" size="20" autocomplete="off" />
</p>
<script type="text/javascript">
var text = document.getElementById('air_lh_name');
text.value += '<?php echo esc_attr( wp_generate_password( 3, false ) ); ?>';
document.getElementById('air_lh_name_field').style.display = 'none';
</script>
<?php } | [
"protected static function prefix()\n {\n\n return substr(self::$token, 0, config('mix-auth.prefix_length'));\n }",
"private function _generatePrefix()\n {\n $str = null;\n $range = range('a', 'z');\n for($i = 0; $i != 4; $i++) {\n $c = rand(0, 23);\n $str .= $range[$c];\n }\n\n if (array_key_exists($str, $this->_prefix)) {\n $str = $this->_generatePrefix();\n } else {\n $this->_prefix[$str] = $str;\n }\n\n return $str;\n }",
"public function generateUsername($prefix='') {\n \t\t$username = $prefix;\n\t\t$possible = \"123467890\";\n\t\t$maxlength = strlen($possible);\n\t $length = 7; // 888-888\n\t\t$i = 0; \n\t while ($i < $length) {\n\t \tif ($i != 3){ \n\t\t\t\t$char = substr($possible, mt_rand(0, $maxlength-1), 1);\n\t\t $username .= $char;\n\t \t} else $username .= \"-\";\n\t\t\t$i++;\n\t }\n\t \n\t // TODO: check if unique\n\t \n\t\treturn $username;\n\t}",
"protected function _generateName()\n {\n if ( false === $this->_nameGenerated ) {\n $this->_name = md5( sprintf( 'TIMEOUTTIMER:%s', uniqid() ) );\n $this->_nameGenerated = true;\n }\n }",
"function renewApcPrefix();",
"protected function generateReminderCode(): string\n {\n return Str::random(32);\n }",
"function yt_site_change_nonce_hourly( $nonce_life ) {\n return 60*60;\n}",
"private function generate_webhook_key() {\n\t\t$this->options['webhook_key'] = md5( time() );\n\t\t$this->mangopayWCMain->options['webhook_key'] = $this->options['webhook_key'];\n\t\tupdate_option ( mangopayWCConfig::OPTION_KEY, $this->options );\n\t}",
"public function generateName($name){\n $time = date('h');\n\n if($time >7 && $time < 10){\n return \"Добро утро, господин \".$name;\n }else if($time >= 10 && $time< 17){\n return \"Добър ден, господин \".$name;\n }\n return \"Добър вечер, господин \".$name;\n }",
"private static function makeReceiptId($prefix = '')\n {\n return $prefix . uniqid();\n }",
"public function generateToken()\n {\n return uniqid(\"reminder_\");\n }",
"private function _getTokenValidPeriod()\r\n {\r\n return '30 minute';\r\n }",
"function generate_prefix($oid){\n\t\t$params = JComponentHelper::getParams( 'com_ewallet' );\n\t\t/*##############################################################*/\n\t\t// Lets make a random char for this order\n\t\t//take order prefix set by admin\n\t\t$order_prefix=(string)$params->get('order_prefix');\n\t\t$order_prefix=substr($order_prefix,0,5);//string length should not be more than 5\n\t\t//take separator set by admin\n\t\t$separator=(string)$params->get('separator');\n\t\t$prefix=$order_prefix.$separator;\n\t\t//check if we have to add random number to order id\n\t\t$use_random_orderid=(int)$params->get('random_orderid');\n\t\tif($use_random_orderid)\n\t\t{\n\t\t\t$random_numer=$this->_random(5);\n\t\t\t$prefix.=$random_numer.$separator;\n\t\t\t//this length shud be such that it matches the column lenth of primary key\n\t\t\t//it is used to add pading\n\t\t\t$len=(23-5-2-5);//order_id_column_field_length - prefix_length - no_of_underscores - length_of_random number\n\t\t}else{\n\t\t\t//this length shud be such that it matches the column lenth of primary key\n\t\t\t//it is used to add pading\n\t\t\t$len=(23-5-2);//order_id_column_field_length - prefix_length - no_of_underscores\n\t\t}\n\t\t/*##############################################################*/\n\n\t\t$maxlen=23-strlen($prefix)-strlen($oid);\n\t\t$padding_count=(int)$params->get('padding_count');\n\t\t//use padding length set by admin only if it is les than allowed(calculate) length\n\t\tif($padding_count>$maxlen){\n\t\t\t$padding_count=$maxlen;\n\t\t}\n\t\t$append='';\n\t\tif(strlen((string)$oid)<=$len)\n\t\t{\n\t\t\tfor($z=0;$z<$padding_count;$z++){\n\t\t\t\t$append.='0';\n\t\t\t}\n\t\t\t//$append=$append.$oid;\n\t\t}\n\t\t$prefix .= $append;\n\n\treturn $prefix;\n\t}",
"protected function generateHash():string \n\t{\n return sprintf('$%s$%02d$%s$', $this->prefix, $this->cust, $this->generateSalt());\n\t}",
"private function generateCachePrefix(): string\n {\n // phpcs:ignore Magento2.Functions.DiscouragedFunction\n return substr(\\hash('sha256', dirname(__DIR__, 6)), 0, 3) . '_';\n }",
"public function genShortUniqueTrackingTag()\n {\n return substr(md5(uniqid(rand(), true)), -8);\n }",
"protected function generateCampaign(): string\n {\n return uniqid();\n }",
"public static function generateExpiringRandomKey()\n {\n return Yii::$app->getSecurity()->generateRandomKey() . '_' . time();\n }",
"function twentyseventeen_unique_id( $prefix = '' ) {\n\tstatic $id_counter = 0;\n\tif ( function_exists( 'wp_unique_id' ) ) {\n\t\treturn wp_unique_id( $prefix );\n\t}\n\treturn $prefix . (string) ++$id_counter;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the SyColorCodes ids and names | public function colorCodesIDName() {
$sql = "select id, name from bk_color_codes";
$SyColorCodes = $this->runRequest($sql);
return $SyColorCodes->fetchAll();
} | [
"public function colorCodesName(){\n\t\t\t\n\t\t$sql = \"select name from sy_color_codes\";\n\t\t$SyColorCodes = $this->runRequest($sql);\n\t\treturn $SyColorCodes->fetchAll();\n\t}",
"function csstoolsexp_color_names()\n{\n return array(\n 'indianred' => '#CD5C5C', 'lightcoral' => '#F08080',\n 'salmon' => '#FA8072', 'darksalmon' => '#E9967A',\n 'lightsalmon' => '#FFA07A', 'crimson' => '#DC143C',\n 'red' => '#FF0000', 'firebrick' => '#B22222',\n 'darkred' => '#8B0000', 'pink' => '#FFC0CB',\n 'lightpink' => '#FFB6C1', 'hotpink' => '#FF69B4',\n 'deeppink' => '#FF1493', 'mediumvioletred' => '#C71585',\n 'palevioletred' => '#DB7093', 'lightsalmon' => '#FFA07A',\n 'coral' => '#FF7F50', 'tomato' => '#FF6347',\n 'orangered' => '#FF4500', 'darkorange' => '#FF8C00',\n 'orange' => '#FFA500', 'gold' => '#FFD700',\n 'yellow' => '#FFFF00', 'lightyellow' => '#FFFFE0',\n 'lemonchiffon' => '#FFFACD', 'lightgoldenrodyellow' => '#FAFAD2',\n 'papayawhip' => '#FFEFD5', 'moccasin' => '#FFE4B5',\n 'peachpuff' => '#FFDAB9', 'palegoldenrod' => '#EEE8AA',\n 'khaki' => '#F0E68C', 'darkkhaki' => '#BDB76B',\n 'lavender' => '#E6E6FA', 'thistle' => '#D8BFD8',\n 'plum' => '#DDA0DD', 'violet' => '#EE82EE',\n 'orchid' => '#DA70D6', 'fuchsia' => '#FF00FF',\n 'magenta' => '#FF00FF', 'mediumorchid' => '#BA55D3',\n 'mediumpurple' => '#9370DB', 'blueviolet' => '#8A2BE2',\n 'darkviolet' => '#9400D3', 'darkorchid' => '#9932CC',\n 'darkmagenta' => '#8B008B', 'purple' => '#800080',\n 'indigo' => '#4B0082', 'slateblue' => '#6A5ACD',\n 'darkslateblue' => '#483D8B', 'mediumslateblue' => '#7B68EE',\n 'greenyellow' => '#ADFF2F', 'chartreuse' => '#7FFF00',\n 'lawngreen' => '#7CFC00', 'lime' => '#00FF00',\n 'limegreen' => '#32CD32', 'palegreen' => '#98FB98',\n 'lightgreen' => '#90EE90', 'mediumspringgreen' => '#00FA9A',\n 'springgreen' => '#00FF7F', 'mediumseagreen' => '#3CB371',\n 'seagreen' => '#2E8B57', 'forestgreen' => '#228B22',\n 'green' => '#008000', 'darkgreen' => '#006400',\n 'yellowgreen' => '#9ACD32', 'olivedrab' => '#6B8E23',\n 'olive' => '#808000', 'darkolivegreen' => '#556B2F',\n 'mediumaquamarine' => '#66CDAA', 'darkseagreen' => '#8FBC8F',\n 'lightseagreen' => '#20B2AA', 'darkcyan' => '#008B8B',\n 'teal' => '#008080', 'aqua' => '#00FFFF',\n 'cyan' => '#00FFFF', 'lightcyan' => '#E0FFFF',\n 'paleturquoise' => '#AFEEEE', 'aquamarine' => '#7FFFD4',\n 'turquoise' => '#40E0D0', 'mediumturquoise' => '#48D1CC',\n 'darkturquoise' => '#00CED1', 'cadetblue' => '#5F9EA0',\n 'steelblue' => '#4682B4', 'lightsteelblue' => '#B0C4DE',\n 'powderblue' => '#B0E0E6', 'lightblue' => '#ADD8E6',\n 'skyblue' => '#87CEEB', 'lightskyblue' => '#87CEFA',\n 'deepskyblue' => '#00BFFF', 'dodgerblue' => '#1E90FF',\n 'cornflowerblue' => '#6495ED', 'mediumslateblue' => '#7B68EE',\n 'royalblue' => '#4169E1', 'blue' => '#0000FF',\n 'mediumblue' => '#0000CD', 'darkblue' => '#00008B',\n 'navy' => '#000080', 'midnightblue' => '#191970',\n 'cornsilk' => '#FFF8DC', 'blanchedalmond' => '#FFEBCD',\n 'bisque' => '#FFE4C4', 'navajowhite' => '#FFDEAD',\n 'wheat' => '#F5DEB3', 'burlywood' => '#DEB887',\n 'tan' => '#D2B48C', 'rosybrown' => '#BC8F8F',\n 'sandybrown' => '#F4A460', 'goldenrod' => '#DAA520',\n 'darkgoldenrod' => '#B8860B', 'peru' => '#CD853F',\n 'chocolate' => '#D2691E', 'saddlebrown' => '#8B4513',\n 'sienna' => '#A0522D', 'brown' => '#A52A2A',\n 'maroon' => '#800000', 'white' => '#FFFFFF',\n 'snow' => '#FFFAFA', 'honeydew' => '#F0FFF0',\n 'mintcream' => '#F5FFFA', 'azure' => '#F0FFFF',\n 'aliceblue' => '#F0F8FF', 'ghostwhite' => '#F8F8FF',\n 'whitesmoke' => '#F5F5F5', 'seashell' => '#FFF5EE',\n 'beige' => '#F5F5DC', 'oldlace' => '#FDF5E6',\n 'floralwhite' => '#FFFAF0', 'ivory' => '#FFFFF0',\n 'antiquewhite' => '#FAEBD7', 'linen' => '#FAF0E6',\n 'lavenderblush' => '#FFF0F5', 'mistyrose' => '#FFE4E1',\n 'gainsboro' => '#DCDCDC', 'lightgrey' => '#D3D3D3',\n 'silver' => '#C0C0C0', 'darkgray' => '#A9A9A9',\n 'gray' => '#808080', 'dimgray' => '#696969',\n 'lightslategray' => '#778899', 'slategray' => '#708090',\n 'darkslategray' => '#2F4F4F', 'black' => '#000000',\n );\n}",
"public function getColorCode($id){\n\t\t\t\n\t\t$sql = \"SELECT * FROM sy_color_codes WHERE id=?\";\n\t\t$user = $this->runRequest($sql, array($id));\n\t\treturn $user->fetch();\n\t}",
"public function getColorCode();",
"function getColors()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$set = $ilDB->query(\"SELECT * FROM style_color WHERE \".\n\t\t\t\"style_id = \".$ilDB->quote($this->getId(), \"integer\").\" \".\n\t\t\t\"ORDER BY color_name\");\n\t\t\n\t\t$colors = array();\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t$colors[] = array(\n\t\t\t\t\"name\" => $rec[\"color_name\"],\n\t\t\t\t\"code\" => $rec[\"color_code\"]\n\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn $colors;\n\t}",
"function color_names()\r\n{\r\n\treturn array_keys(color_config());\r\n}",
"public function getColorCodeName($id){\n\t\t$sql = \"select name from sy_color_codes where id=?\";\n\t\t$SyColorCode = $this->runRequest($sql, array($id));\n\t\tif ($SyColorCode->rowCount() == 1){\n\t\t\t$tmp = $SyColorCode->fetch();\n\t\t\treturn $tmp[0]; // get the first line of the result\n\t\t}\n\t\telse{\n\t\t\treturn \"\";\t\n\t\t}\n\t}",
"public function getColorCode() : string\n\t{\n\t\treturn $this->colorCode;\n\t}",
"public static function getColorNamesAvailable()\n {\n return array_keys(self::$colorScheme);\n }",
"public function getStyleCodes(): array\n {\n return $this->m_stylecode;\n }",
"public function getColors()\n {\n $colors = array();\n foreach ($this->declarations as $declaration) {\n foreach (preg_split(\"/[\\s]+/\", $declaration['value']) as $word) {\n if (isset($word[0]) && $word[0] === \"#\") {\n $matches = array();\n if (preg_match(\"/^#([0-9A-F]+)/\", strtoupper($word), $matches) === 1) {\n $rgb = $matches[1];\n if (strlen($rgb) === 3) {\n $colors[] = \"#\".$rgb[0].$rgb[0].$rgb[1].$rgb[1].$rgb[2].$rgb[2];\n } else {\n $colors[] = \"#{$rgb}\";\n }\n }\n }\n }\n }\n return $colors;\n }",
"public function colorList(){\n $colors = $this->getAll();\n $options = [];\n foreach($colors as $color){\n $options[$color->color_name] = $color->id;\n } \n return $options;\n }",
"public function getAlternateColorSpace() {}",
"public function getColorCodeValue($id){\n\t\t$sql = \"select color from sy_color_codes where id=?\";\n\t\t$SyColorCode = $this->runRequest($sql, array($id));\n\t\tif ($SyColorCode->rowCount() == 1){\n\t\t\t$tmp = $SyColorCode->fetch();\n \t\treturn $tmp[0]; // get the first line of the result\n\t\t}\n \telse{\n\t\t\treturn \"aaaaaa\";\n\t\t\t}\n\t\t}",
"public function getColorCodeValue($id){\n\t\t$sql = \"select color from sy_color_codes where id=?\";\n\t\t$SyColorCode = $this->runRequest($sql, array($id));\n\t\tif ($SyColorCode->rowCount() == 1){\n\t\t\t$tmp = $SyColorCode->fetch();\n \t\treturn $tmp[0]; // get the first line of the result\n\t\t}\n \telse{\n\t\t\treturn \"aaaaaa\";\n\t\t}\n\t}",
"function getStyleCodes()\n {\n return $this->m_stylecode;\n }",
"public function getColorSpace() {}",
"public function colorKeys()\n {\n return array_keys($this->allColorSchemes());\n }",
"public function getColorScheme();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "constructTriples" $ANTLR start "triplesSameSubject" Sparql10.g:278:1: triplesSameSubject : ( varOrTerm propertyListNotEmpty | triplesNode propertyList ); | public function triplesSameSubject(){
try {
// Sparql10.g:279:3: ( varOrTerm propertyListNotEmpty | triplesNode propertyList )
$alt40=2;
$LA40 = $this->input->LA(1);
if($this->getToken('TRUE')== $LA40||$this->getToken('FALSE')== $LA40||$this->getToken('IRI_REF')== $LA40||$this->getToken('PNAME_NS')== $LA40||$this->getToken('PNAME_LN')== $LA40||$this->getToken('VAR1')== $LA40||$this->getToken('VAR2')== $LA40||$this->getToken('INTEGER')== $LA40||$this->getToken('DECIMAL')== $LA40||$this->getToken('DOUBLE')== $LA40||$this->getToken('INTEGER_POSITIVE')== $LA40||$this->getToken('DECIMAL_POSITIVE')== $LA40||$this->getToken('DOUBLE_POSITIVE')== $LA40||$this->getToken('INTEGER_NEGATIVE')== $LA40||$this->getToken('DECIMAL_NEGATIVE')== $LA40||$this->getToken('DOUBLE_NEGATIVE')== $LA40||$this->getToken('STRING_LITERAL1')== $LA40||$this->getToken('STRING_LITERAL2')== $LA40||$this->getToken('STRING_LITERAL_LONG1')== $LA40||$this->getToken('STRING_LITERAL_LONG2')== $LA40||$this->getToken('BLANK_NODE_LABEL')== $LA40)
{
$alt40=1;
}
else if($this->getToken('OPEN_SQUARE_BRACE')== $LA40)
{
$LA40_2 = $this->input->LA(2);
if ( ($LA40_2==$this->getToken('A')||$LA40_2==$this->getToken('IRI_REF')||$LA40_2==$this->getToken('PNAME_NS')||$LA40_2==$this->getToken('PNAME_LN')||($LA40_2>=$this->getToken('VAR1') && $LA40_2<=$this->getToken('VAR2'))) ) {
$alt40=2;
}
else if ( ($LA40_2==$this->getToken('WS')||$LA40_2==$this->getToken('CLOSE_SQUARE_BRACE')) ) {
$alt40=1;
}
else {
$nvae = new NoViableAltException("", 40, 2, $this->input);
throw $nvae;
}
}
else if($this->getToken('OPEN_BRACE')== $LA40)
{
$LA40_3 = $this->input->LA(2);
if ( ($LA40_3==$this->getToken('WS')||$LA40_3==$this->getToken('CLOSE_BRACE')) ) {
$alt40=1;
}
else if ( (($LA40_3>=$this->getToken('TRUE') && $LA40_3<=$this->getToken('FALSE'))||$LA40_3==$this->getToken('IRI_REF')||$LA40_3==$this->getToken('PNAME_NS')||$LA40_3==$this->getToken('PNAME_LN')||($LA40_3>=$this->getToken('VAR1') && $LA40_3<=$this->getToken('VAR2'))||$LA40_3==$this->getToken('INTEGER')||$LA40_3==$this->getToken('DECIMAL')||$LA40_3==$this->getToken('DOUBLE')||($LA40_3>=$this->getToken('INTEGER_POSITIVE') && $LA40_3<=$this->getToken('DOUBLE_NEGATIVE'))||($LA40_3>=$this->getToken('STRING_LITERAL1') && $LA40_3<=$this->getToken('STRING_LITERAL_LONG2'))||$LA40_3==$this->getToken('BLANK_NODE_LABEL')||$LA40_3==$this->getToken('OPEN_BRACE')||$LA40_3==$this->getToken('OPEN_SQUARE_BRACE')) ) {
$alt40=2;
}
else {
$nvae = new NoViableAltException("", 40, 3, $this->input);
throw $nvae;
}
}
else{
$nvae =
new NoViableAltException("", 40, 0, $this->input);
throw $nvae;
}
switch ($alt40) {
case 1 :
// Sparql10.g:280:3: varOrTerm propertyListNotEmpty
{
$this->pushFollow(self::$FOLLOW_varOrTerm_in_triplesSameSubject1044);
$this->varOrTerm();
$this->state->_fsp--;
$this->pushFollow(self::$FOLLOW_propertyListNotEmpty_in_triplesSameSubject1046);
$this->propertyListNotEmpty();
$this->state->_fsp--;
}
break;
case 2 :
// Sparql10.g:281:5: triplesNode propertyList
{
$this->pushFollow(self::$FOLLOW_triplesNode_in_triplesSameSubject1052);
$this->triplesNode();
$this->state->_fsp--;
$this->pushFollow(self::$FOLLOW_propertyList_in_triplesSameSubject1054);
$this->propertyList();
$this->state->_fsp--;
}
break;
}
}
catch (RecognitionException $re) {
$this->reportError($re);
$this->recover($this->input,$re);
}
catch(Exception $e) {
throw $e;
}
return ;
} | [
"public function triplesSameSubjectPath(){\n try {\n // Sparql11update.g:188:3: ( varOrTerm propertyListNotEmptyPath | triplesNode propertyListPath ) \n $alt34=2;\n $LA34 = $this->input->LA(1);\n if($this->getToken('TRUE')== $LA34||$this->getToken('FALSE')== $LA34||$this->getToken('IRI_REF')== $LA34||$this->getToken('PNAME_NS')== $LA34||$this->getToken('PNAME_LN')== $LA34||$this->getToken('VAR1')== $LA34||$this->getToken('VAR2')== $LA34||$this->getToken('INTEGER')== $LA34||$this->getToken('DECIMAL')== $LA34||$this->getToken('DOUBLE')== $LA34||$this->getToken('INTEGER_POSITIVE')== $LA34||$this->getToken('DECIMAL_POSITIVE')== $LA34||$this->getToken('DOUBLE_POSITIVE')== $LA34||$this->getToken('INTEGER_NEGATIVE')== $LA34||$this->getToken('DECIMAL_NEGATIVE')== $LA34||$this->getToken('DOUBLE_NEGATIVE')== $LA34||$this->getToken('STRING_LITERAL1')== $LA34||$this->getToken('STRING_LITERAL2')== $LA34||$this->getToken('STRING_LITERAL_LONG1')== $LA34||$this->getToken('STRING_LITERAL_LONG2')== $LA34||$this->getToken('BLANK_NODE_LABEL')== $LA34)\n {\n $alt34=1;\n }\n else if($this->getToken('OPEN_SQUARE_BRACE')== $LA34)\n {\n $LA34_2 = $this->input->LA(2);\n\n if ( ($LA34_2==$this->getToken('A')||$LA34_2==$this->getToken('IRI_REF')||$LA34_2==$this->getToken('PNAME_NS')||$LA34_2==$this->getToken('PNAME_LN')||($LA34_2>=$this->getToken('VAR1') && $LA34_2<=$this->getToken('VAR2'))) ) {\n $alt34=2;\n }\n else if ( ($LA34_2==$this->getToken('WS')||$LA34_2==$this->getToken('CLOSE_SQUARE_BRACE')) ) {\n $alt34=1;\n }\n else {\n $nvae = new NoViableAltException(\"\", 34, 2, $this->input);\n\n throw $nvae;\n }\n }\n else if($this->getToken('OPEN_BRACE')== $LA34)\n {\n $LA34_3 = $this->input->LA(2);\n\n if ( ($LA34_3==$this->getToken('WS')||$LA34_3==$this->getToken('CLOSE_BRACE')) ) {\n $alt34=1;\n }\n else if ( (($LA34_3>=$this->getToken('TRUE') && $LA34_3<=$this->getToken('FALSE'))||$LA34_3==$this->getToken('IRI_REF')||$LA34_3==$this->getToken('PNAME_NS')||$LA34_3==$this->getToken('PNAME_LN')||($LA34_3>=$this->getToken('VAR1') && $LA34_3<=$this->getToken('VAR2'))||$LA34_3==$this->getToken('INTEGER')||$LA34_3==$this->getToken('DECIMAL')||$LA34_3==$this->getToken('DOUBLE')||($LA34_3>=$this->getToken('INTEGER_POSITIVE') && $LA34_3<=$this->getToken('DOUBLE_NEGATIVE'))||($LA34_3>=$this->getToken('STRING_LITERAL1') && $LA34_3<=$this->getToken('STRING_LITERAL_LONG2'))||$LA34_3==$this->getToken('BLANK_NODE_LABEL')||$LA34_3==$this->getToken('OPEN_BRACE')||$LA34_3==$this->getToken('OPEN_SQUARE_BRACE')) ) {\n $alt34=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 34, 3, $this->input);\n\n throw $nvae;\n }\n }\n else{\n $nvae =\n new NoViableAltException(\"\", 34, 0, $this->input);\n\n throw $nvae;\n }\n\n switch ($alt34) {\n case 1 :\n // Sparql11update.g:189:3: varOrTerm propertyListNotEmptyPath \n {\n $this->pushFollow(self::$FOLLOW_varOrTerm_in_triplesSameSubjectPath737);\n $this->gErfurt_Sparql_Parser_Sparql11_Update->varOrTerm();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_propertyListNotEmptyPath_in_triplesSameSubjectPath739);\n $this->propertyListNotEmptyPath();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11update.g:190:5: triplesNode propertyListPath \n {\n $this->pushFollow(self::$FOLLOW_triplesNode_in_triplesSameSubjectPath745);\n $this->gErfurt_Sparql_Parser_Sparql11_Update->triplesNode();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_propertyListPath_in_triplesSameSubjectPath747);\n $this->propertyListPath();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"function triples2string() {\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">';\n\t\tforeach ($this->triples as $s => $po) {\n\t\t\t# Start with subject.\n\t\t\t$xml .= \"\\n<rdf:Description\";\n\t\t\tif ('_:' == substr($s, 0, 2))\n\t\t\t\t$xml .= ' rdf:nodeID=\"' . htmlspecialchars(substr($s,2)) . '\"';\n\t\t\telse\n\t\t\t\t$xml .= ' rdf:about=\"' . htmlspecialchars($s) . '\"';\n\t\t\t$xml .= \">\";\n\t\t\t# Loop through predicate/object pairs.\n\t\t\tforeach($po as $x) {\n\t\t\t\tlist($p, $o) = $x;\n\t\t\t\t# Output predicate.\n\t\t\t\t$nsuri = RDFUtil::guessNamespace($p);\n\t\t\t\t$local = RDFUtil::guessName($p);\n\t\t\t\tif ('http://www.w3.org/1999/02/22-rdf-syntax-ns#' != $nsuri)\n\t\t\t\t\t$xml .= \"\\n <ns:\" . $local . ' xmlns:ns=\"' . $nsuri . '\"';\n\t\t\t\telse\n\t\t\t\t\t$xml .= \"\\n <rdf:\" . $local;\n\t\t\t\t# Output object.\n\t\t\t\tif (is_array($o)) {\n\t\t\t\t\tif ('' != $o[1])\n\t\t\t\t\t\t$xml .= ' xml:lang=\"' . htmlspecialchars($o[1]) . '\"';\n\t\t\t\t\tif ('http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral' == $o[2])\n\t\t\t\t\t\t$xml .= ' rdf:parseType=\"Literal\">' . str_replace('\\\"', '\"', $o[0]);\n\t\t\t\t\telse if ('' != $o[2])\n\t\t\t\t\t\t$xml .= ' rdf:datatype=\"' . htmlspecialchars($o[2]) . '\">' . $o[0];\n\t\t\t\t\telse\n\t\t\t\t\t\t$xml .= '>' . htmlspecialchars($o[0]);\n\t\t\t\t\tif ('http://www.w3.org/1999/02/22-rdf-syntax-ns#' != $nsuri)\n\t\t\t\t\t\t$xml .= '</ns:' . $local;\n\t\t\t\t\telse\n\t\t\t\t\t\t$xml .= '</rdf:' . $local;\n\t\t\t\t} else if ('_:' == substr($o, 0, 2))\n\t\t\t\t\t$xml .= ' rdf:nodeID=\"' . htmlspecialchars(substr($o, 2)) . '\"/';\n\t\t\t\telse\n\t\t\t\t\t$xml .= ' rdf:resource=\"' . htmlspecialchars($o) . '\"/';\n\t\t\t\t$xml.=\">\";\n\t\t\t};\n\t\t\t$xml.=\"\\n</rdf:Description>\";\n\t\t}\n\t\t$xml.=\"\\n</rdf:RDF>\";\n\t\treturn $xml;\n\t}",
"function toNTriples() {\r\n\t\t//init\r\n\t\tif(is_null($this->ntriple)){\r\n\t\t\t$this->ntriple = self::_toNTriplesHelper(\r\n\t\t\t\t$this->subject->toNTriples() ,\r\n $this->predicate->toNTriples() ,\r\n $this->object->toNTriples()\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $this->ntriple;\r\n\r\n }",
"public function distinctSubject() {\n if (is_object(static::bySchoolLevelClassAndSubject($this->id, $this->school, $this->level, $this->class, $this->subject)))\n $this->addError('subject', 'This subject already exists for this class');\n }",
"public function testTripodSaveChangesAddsLiteralTripleUsingEmptyOldGraph()\n {\n $oG = new MongoGraph();\n $nG = new MongoGraph();\n $nG->add_graph($oG);\n $nG->add_literal_triple('http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA', $nG->qname_to_uri('searchterms:title'), 'TEST TITLE');\n\n $this->tripod->saveChanges($oG, $nG,\"http://talisaspire.com/\", 'my changes');\n $uG = $this->tripod->describeResource('http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA');\n $this->assertHasLiteralTriple($uG, 'http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA', $nG->qname_to_uri('searchterms:title'), 'TEST TITLE');\n }",
"public function testTripodSaveChangesAddsLiteralTripleUsingEmptyOldGraph()\n {\n $oG = new \\Tripod\\Mongo\\MongoGraph();\n $nG = new \\Tripod\\Mongo\\MongoGraph();\n $nG->add_graph($oG);\n $nG->add_literal_triple('http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA', $nG->qname_to_uri('searchterms:title'), 'TEST TITLE');\n\n $this->tripod->saveChanges($oG, $nG,\"http://talisaspire.com/\", 'my changes');\n $uG = $this->tripod->describeResource('http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA');\n $this->assertHasLiteralTriple($uG, 'http://talisaspire.com/resources/3SplCtWGPqEyXcDiyhHQpA', $nG->qname_to_uri('searchterms:title'), 'TEST TITLE');\n }",
"protected function setSubjects() {\n $subj = array();\n foreach ($this->formulas as $formula) {\n $subj[$formula->getSubject()] = 1;\n }\n $this->subjects = array_keys($subj);\n }",
"protected function parseTriplePattern(&$pattern)\r\n {\r\n $trp = array();\r\n $prev = false;\r\n $prevPred = false;\r\n $cont = true;\r\n $sub = \"\";\r\n $pre = \"\";\r\n $tmp = \"\";\r\n $tmpPred = \"\";\r\n $obj = \"\";\r\n do {\r\n//echo strtolower(current($this->tokens)) . \"\\n\";\r\n switch (strtolower(current($this->tokens))) {\r\n case false:\r\n $cont = false;\r\n $pattern->open = false;\r\n break;\r\n case \"filter\":\r\n $this->parseConstraint($pattern,false);\r\n $this->_fastForward();\r\n break;\r\n case \"optional\":\r\n $this->_fastForward();\r\n $this->parseGraphPattern($pattern->getId(),false);\r\n $cont = false;\r\n break;\r\n case \"union\":\r\n $this->_fastForward();\r\n $this->parseGraphPattern(\r\n false, $this->tmp, false, false, false, $pattern->getId()\r\n );\r\n break;\r\n case \";\":\r\n $prev = true;\r\n $this->_fastForward();\r\n break;\r\n case \".\":\r\n $prev = false;\r\n $this->_fastForward();\r\n break;\r\n case \"graph\":\r\n $this->parseGraph();\r\n break;\r\n case \",\":\r\n $prev = true;\r\n $prevPred = true;\r\n $this->_fastForward();\r\n break;\r\n case \"}\":\r\n $prev = false;\r\n $pattern->open = false;\r\n $cont = false;\r\n break;\r\n case '{':\r\n //subpatterns opens\r\n $this->parseGraphPattern(\r\n false, false, false, false, false, $pattern->getId()\r\n );\r\n break;\r\n case \"[\":\r\n $prev = true;\r\n $tmp = $this->parseNode($this->query->getBlanknodeLabel());\r\n $this->_fastForward();\r\n break;\r\n case \"]\":\r\n $prev = true;\r\n $this->_fastForward();\r\n break;\r\n case \"(\":\r\n $prev = true;\r\n $tmp = $this->parseCollection($trp);\r\n $this->_fastForward();\r\n break;\r\n case false:\r\n $cont = false;\r\n $pattern->open = false;\r\n break;\r\n default:\r\n if ($prev) {\r\n $sub = $tmp;\r\n } else {\r\n $sub = $this->parseNode();\r\n $this->_fastForward();\r\n $tmp = $sub;\r\n }\r\n if ($prevPred) {\r\n $pre = $tmpPred;\r\n } else {\r\n $pre = $this->parseNode();\r\n $this->_fastForward();\r\n $tmpPred = $pre;\r\n }\r\n if (current($this->tokens)==\"[\") {\r\n $tmp = $this->parseNode($this->query->getBlanknodeLabel());\r\n $prev = true;\r\n $obj = $tmp;\r\n } else if (current($this->tokens)==\"(\") {\r\n $obj = $this->parseCollection($trp);\r\n } else {\r\n $obj = $this->parseNode();\r\n }\r\n $trp[] = new QueryTriple($sub,$pre,$obj);\r\n $this->_fastForward();\r\n break;\r\n\r\n }\r\n } while ($cont);\r\n\r\n if (count($trp) > 0) {\r\n $pattern->addTriplePatterns($trp);\r\n }\r\n }",
"public function buildTriple(array $rdfPhpStatements, $callback)\n {\n foreach ($rdfPhpStatements as $currentSubject => $predicates) {\n foreach ($predicates as $currentPredicate => $objects) {\n foreach ($objects as $currentObject) {\n // TODO: blank nodes\n $resource = '<' . trim($currentSubject) . '>';\n $property = '<' . trim($currentPredicate) . '>';\n\n if ($currentObject['type'] == 'uri') {\n $value = '<' . $currentObject['value'] . '>';\n } else {\n $value = $this->buildLiteralString(\n $currentObject['value'],\n array_key_exists('datatype', $currentObject) ? $currentObject['datatype'] : null,\n array_key_exists('lang', $currentObject) ? $currentObject['lang'] : null\n );\n }\n\n // add triple\n $callback(sprintf('%s %s %s .%s', $resource, $property, $value, PHP_EOL));\n }\n }\n }\n }",
"function triplemap_depvars($tmap)\n{\n //using path: $tmap rml:logicalSource/rmlx:sourceTemplate $tpl (sourceTemplate)\n //$tmap rml:subjectMap/rr:template $tpl\n //$tmap rml:subjectMap/rml:reference $ref\n //$tmap rml:predicateObjectMap/rml:predicateMap/rr:template $tpl\n //$tmap rml:predicateObjectMap/rml:predicateMap/rml:reference $ref\n //$tmap rml:predicateObjectMap/rml:objectMap/rr:template $tpl\n //$tmap rml:predicateObjectMap/rml:objectMap/rml:reference $ref\n $result = array();\n $ls = $tmap->get(\"rml:logicalSource\");\n if($ls)\n {\n $tpl = $ls->get(\"rmlx:sourceTemplate\");\n if($tpl)\n {\n $result = array_merge($result, extract_vars($tpl->getValue()));\n }\n }\n \n $tm = $tmap->get(\"rr:subjectMap\");\n if($tm)\n $result = array_merge($result, termmap_inputvars($tm));\n foreach($tmap->all(\"rr:predicateObjectMap\") as $k => $pomap)\n {\n $tm = $tmap->get(\"rr:predicateMap\");\n if($tm)\n $result = array_merge($result, termmap_inputvars($tm));\n $tm = $tmap->get(\"rr:objectMap\");\n if($tm)\n $result = array_merge($result, termmap_inputvars($tm));\n }\n return array_unique($result);\n}",
"protected function _parseTriplePattern(&$pattern)\n {\n $trp = array();\n $prev = false;\n $prevPred = false;\n $cont = true;\n $needsDot = false;\n $dotAllowed = true;\n $sub = '';\n $pre = '';\n $tmp = '';\n $tmpPred = '';\n $obj = '';\n \n do {\n switch (strtolower(current($this->_tokens))) {\n case false:\n $cont = false;\n $pattern->open = false;\n break;\n case 'filter':\n $this->_parseConstraint($pattern, false);\n \n if (strtolower(current($this->_tokens)) !== 'filter' && \n strtolower(current($this->_tokens)) !== 'optional') {\n \n $this->_fastForward();\n }\n \n $needsDot = false;\n break;\n case 'optional':\n $needsDot = false;\n $this->_fastForward();\n $this->_parseGraphPattern($pattern->getId(), false);\n break;\n case 'union':\n $this->_fastForward();\n $this->_parseGraphPattern(false, $this->_tmp, false, false, false, $pattern->getId());\n break;\n case ';':\n // Check whether the previous token is a dot too, for this is not allowed.\n $this->_rewind();\n if (current($this->_tokens) === '.') {\n throw new Erfurt_Sparql_ParserException('A semicolon must not follow a dot directly.', -1,\n key($this->_tokens));\n }\n $this->_fastForward();\n \n $prev = true;\n $needsDot = false;\n $this->_fastForward();\n break;\n case '.':\n if ($dotAllowed === false) {\n throw new Erfurt_Sparql_ParserException('A dot is not allowed here.', -1, key($this->_tokens));\n }\n \n // Check whether the previous token is a dot too, for this is not allowed.\n $this->_rewind();\n if (current($this->_tokens) === '.') {\n throw new Erfurt_Sparql_ParserException('A dot may not follow a dot directly.', -1,\n key($this->_tokens));\n }\n $this->_fastForward();\n \n $prev = false;\n $needsDot = false;\n $this->_fastForward();\n break;\n case 'graph':\n $this->_parseGraph();\n break;\n case ',':\n throw new Erfurt_Sparql_ParserException('A comma is not allowed directly after a triple.', -1,\n key($this->_tokens));\n \n $prev = true;\n $prevPred = true;\n $this->_fastForward();\n break;\n case '}':\n $prev = false;\n $pattern->open = false;\n $cont = false;\n $this->_dissallowBlankNodes();\n break;\n case '{':\n //subpatterns opens\n $this->_parseGraphPattern(false, false, false, false, false, $pattern->getId());\n $needsDot = false;\n break;\n case \"[\":\n $needsDot = false;\n $prev = true;\n $tmp = $this->_parseNode($this->_query->getBlanknodeLabel());\n $this->_fastForward();\n break;\n case \"]\":\n $needsDot = false;\n $dotAllowed = false;\n $prev = true;\n $this->_fastForward();\n break;\n case \"(\":\n $prev = true;\n $tmp = $this->_parseCollection($trp);\n $this->_fastForward();\n break;\n case false:\n $cont = false;\n $pattern->open = false;\n break;\n default:\n if ($needsDot === true) {\n throw new Erfurt_Sparql_ParserException('Two triple pattern need to be seperated by a dot. In Query: '.htmlentities($this->_query), -1,\n key($this->_tokens));\n }\n \n $dotAllowed = false;\n \n if ($prev) {\n $sub = $tmp;\n } else {\n $sub = $this->_parseNode();\n $this->_fastForward();\n $tmp = $sub;\n }\n if ($prevPred) {\n $pre = $tmpPred;\n } else {\n // Predicates may not be blank nodes.\n if ((current($this->_tokens) === '[') || (substr(current($this->_tokens), 0, 2) === '_:')) {\n throw new Erfurt_Sparql_ParserException('Predicates may not be blank nodes.', -1,\n key($this->_tokens));\n }\n\n $pre = $this->_parseNode();\n $this->_fastForward();\n $tmpPred = $pre;\n }\n\n if (current($this->_tokens) === '[') {\n $tmp = $this->_parseNode($this->_query->getBlanknodeLabel());\n $prev = true;\n $obj = $tmp;\n \n $trp[] = new Erfurt_Sparql_QueryTriple($sub, $pre, $obj);\n $dotAllowed = true;\n $this->_fastForward();\n continue;\n } else if (current($this->_tokens) === '(') {\n $obj = $this->_parseCollection($trp);\n } else {\n $obj = $this->_parseNode();\n }\n \n $trp[] = new Erfurt_Sparql_QueryTriple($sub, $pre, $obj);\n $dotAllowed = true;\n $needsDot = true;\n $this->_fastForward();\n break;\n }\n } while ($cont);\n\n if (count($trp) > 0) {\n $pattern->addTriplePatterns($trp);\n }\n }",
"function match($triple,array $s = NULL,array $p = NULL,array $o = NULL, $s_type = NULL, $o_type = NULL, $o_datatype = NULL, $o_lang = NULL) {\r\n\t\tif (isset ( $triple ['s'] ) && isset ( $triple ['p'] ) && isset ( $triple ['o'] )) {\r\n\t\t\t$sm = false;\r\n\t\t\tif ($s == NULL) {\r\n\t\t\t\t$sm = true;\r\n\t\t\t} else if ($s != NULL) {\r\n\t\t\t\tforeach( $s as $si){\r\n\t\t\t\t\tif ($triple ['s'] == $si) {\r\n\t\t\t\t\t\t$sm = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$sm) return false;\r\n\t\t\t} else if ($s_type != NULL) {\r\n\t\t\t\tif ($triple ['s_type'] == $s_type) {\r\n\t\t\t\t\t$sm = true;\r\n\t\t\t\t} else\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$pm = false;\r\n\t\t\tif ($p == NULL) {\r\n\t\t\t\t$pm = true;\r\n\t\t\t} else if ($p != NULL) {\r\n\t\t\t\tforeach( $p as $pi){\r\n\t\t\t\t\tif ($triple ['p'] == $pi) {\r\n\t\t\t\t\t\t$pm = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$pm)\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$omv = false;\r\n\t\t\t$omt = false;\r\n\t\t\t$omd = false;\r\n\t\t\t$oml = false;\r\n\t\t\tif ($o == NULL) {\r\n\t\t\t\t$omv = true;\r\n\t\t\t} else {\r\n\t\t\t\tforeach($o as $oi){\r\n\t\t\t\t\tif ($triple ['o'] == $oi) {\r\n\t\t\t\t\t\t$omv = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$omv)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t\tif ($o_type == NULL) {\r\n\t\t\t\t$omt = true;\r\n\t\t\t} else if ($triple ['o_type'] == $o_type) {\r\n\t\t\t\t$omt = true;\r\n\t\t\t} else\r\n\t\t\treturn false;\r\n\t\t\tif ($o_datatype == NULL) {\r\n\t\t\t\t$omd = true;\r\n\t\t\t} else {\r\n\t\t\t\t$o_datatype = $this->arc->expandPName ( $o_datatype );\r\n\t\t\t\tif ($triple ['o_datatype'] == $o_datatype) {\r\n\t\t\t\t\t$omd = true;\r\n\t\t\t\t} else\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ($o_lang == NULL) {\r\n\t\t\t\t$oml = true;\r\n\t\t\t} else if ($triple ['o_lang'] == $o_lang) {\r\n\t\t\t\t$oml = true;\r\n\t\t\t} else\r\n\t\t\treturn false;\r\n\r\n\t\t\t$om = ($omv && $omt && $omd && $oml);\r\n\r\n\t\t\tif ($sm && $pm && $om) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function testRuleSame(): void {\r\n\r\n //Should pass\r\n $validator = new Validator(['field' => 'test', 'field2' => 'test']);\r\n $validator -> field('field') -> same('field2');\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n\r\n //Should fail\r\n foreach(['testing', '', 'tes', ' test ', 0, null, true] as $data) {\r\n\r\n $validator = new Validator(['field' => $data, 'field2' => 'test']);\r\n $validator -> field('field') -> same('field2');\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> same('field2');\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }",
"public function loadTriplesAbout($subject,Array $triples,$storeName,$podName,$context=null,$allowableTypes=null)\n {\n $context = ($context==null) ? \\Tripod\\Config::getInstance()->getDefaultContextAlias() : $this->labeller->uri_to_alias($context);\n if (array_key_exists($podName, $this->collections)) {\n $collection = $this->collections[$podName];\n } else {\n $m = new Client(\n \\Tripod\\Config::getInstance()->getConnStr($storeName),\n [],\n ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']]\n );\n $collection = $m->selectDatabase($storeName)->selectCollection($podName);\n }\n\n $graph = new MongoGraph();\n foreach ($triples as $triple)\n {\n $triple = rtrim($triple);\n\n $parts = preg_split(\"/\\s/\",$triple);\n $subject = trim($parts[0],'><');\n $predicate = trim($parts[1],'><');\n $object = $this->extract_object($parts);\n\n if ($this->isUri($object))\n {\n $graph->add_resource_triple($subject,$predicate,$object);\n }\n else\n {\n $graph->add_literal_triple($subject,$predicate,$object);\n }\n }\n if ($allowableTypes!=null && is_array($allowableTypes))\n {\n $types = $graph->get_resource_triple_values($subject,\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\");\n if ($types==null || empty($types))\n {\n return;\n }\n else\n {\n foreach ($types as $type)\n {\n if (in_array($type,$allowableTypes))\n {\n $this->saveCBD($subject,$graph,$collection,$context);\n return;\n }\n }\n return;\n }\n }\n $this->saveCBD($subject,$graph,$collection,$context);\n }",
"protected function parseSubject()\n {\n $c = $this->peek();\n if ($c == '(') {\n $this->subject = $this->parseCollection();\n } elseif ($c == '[') {\n $this->subject = $this->parseImplicitBlank();\n } else {\n $value = $this->parseValue();\n\n if ($value['type'] == 'uri' or $value['type'] == 'bnode') {\n $this->subject = $value;\n } else {\n throw new Exception(\n \"Turtle Parse Error: illegal subject type: \".$value['type'],\n $this->line,\n $this->column\n );\n }\n }\n }",
"public function toArcTriples()\n\t{\n\t\t$arcTriples = array();\n\t\tforeach( $this->allSubjects() as $s )\n\t\t{\n\t\t\tforeach( $s->toArcTriples( false ) as $t )\n\t\t\t{\n\t\t\t\t$arcTriples []= $t;\n\t\t\t}\n\t\t}\n\t\treturn $arcTriples;\n\t}",
"function create_triple($subject,$predicate,$object){\n if(is_numeric($object)){\n // If numeric, don't use double quotes\n $safe_object = addslashes($object);\n } elseif(is_uri($object)) {\n // If URI, use lt & gt signs\n $safe_object = '<'.$object.'>';\n } else {\n // If other (string) use double quotes\n $safe_object = '\"'.addslashes($object).'\"';\n }\n return \"<$subject> <$predicate> $safe_object.\";\n}",
"protected function assertTripleValue($subject, $predicate, $expected_value) {\n $subject = SparqlArg::uri($subject);\n $predicate = SparqlArg::uri($predicate);\n\n $query = <<<SelectQuery\nSELECT ?object WHERE {\n $subject $predicate ?object\n}\nSelectQuery;\n\n $result = $this->sparql->query($query);\n $this->assertCount(1, $result, 'Expected a single result, but got ' . $result->count());\n $this->assertEquals($expected_value, (string) $result[0]->object);\n }",
"public function linktripleAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n $this->_helper->layout->disableLayout();\n\n if ($this->_request->isPost()) {\n\n $post = $this->_request->getPost();\n\n if (isset($post['predicate'])\n && isset($post['object']))\n {\n // everything fine\n } else {\n // necessarry parameters are missing\n $this->_response->setHeader(http_response_code(500));\n return;\n }\n\n $predicate = urldecode($post['predicate']);\n $object = urldecode($post['object']);\n $subject = urldecode($post['subject']);\n if($subject == null){\n $subject = (string)$this->_owApp->selectedResource;\n }\n if (Erfurt_Uri::check($predicate) && Erfurt_Uri::check($object)) {\n $this->_owApp->selectedModel->addStatement(\n $subject,\n $predicate,\n array('value' => $object, 'type' => 'uri')\n );\n $this->_response->setHeader(http_response_code(200));\n return;\n } else {\n // data contains no valid URIs\n $this->_response->setHeader(http_response_code(500));\n return;\n }\n } else {\n // no post request\n $this->_response->setHeader(http_response_code(500));\n return;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gets the public 'easyadmin.router' shared service. | protected function getEasyadmin_RouterService()
{
return $this->services['easyadmin.router'] = new \EasyCorp\Bundle\EasyAdminBundle\Router\EasyAdminRouter(${($_ = isset($this->services['easyadmin.config.manager']) ? $this->services['easyadmin.config.manager'] : $this->getEasyadmin_Config_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['router']) ? $this->services['router'] : $this->getRouterService()) && false ?: '_'}, ${($_ = isset($this->services['property_accessor']) ? $this->services['property_accessor'] : $this->getPropertyAccessorService()) && false ?: '_'}, ${($_ = isset($this->services['request_stack']) ? $this->services['request_stack'] : $this->services['request_stack'] = new \Symfony\Component\HttpFoundation\RequestStack()) && false ?: '_'});
} | [
"protected function getEasyadmin_RouterService()\n {\n return $this->services['easyadmin.router'] = new \\EasyCorp\\Bundle\\EasyAdminBundle\\Router\\EasyAdminRouter(${($_ = isset($this->services['easyadmin.config.manager']) ? $this->services['easyadmin.config.manager'] : $this->getEasyadmin_Config_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['Symfony\\\\Component\\\\Routing\\\\RouterInterface']) ? $this->services['Symfony\\\\Component\\\\Routing\\\\RouterInterface'] : $this->getRouterInterfaceService()) && false ?: '_'}, ${($_ = isset($this->services['property_accessor']) ? $this->services['property_accessor'] : $this->getPropertyAccessorService()) && false ?: '_'}, ${($_ = isset($this->services['request_stack']) ? $this->services['request_stack'] : ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())) && false ?: '_'});\n }",
"public function router()\n {\n if (!$this->router) {\n $this->router = Pi::engine()->application()->getRouter();\n }\n return $this->router;\n }",
"protected function getRouterService()\n {\n return $this->get('router.real');\n }",
"protected function getRouterService()\n {\n return $this->get('symfony_cmf_routing_extra.router');\n }",
"protected function getRouterService()\n {\n return $this->services['router'] = new \\Symfony\\Component\\Routing\\Router($this->get('router.loader'), '', array('cache_dir' => 'D:\\\\Git\\\\WellCommerce\\\\var', 'generator_cache_class' => 'WellCommerceUrlGenerator', 'matcher_cache_class' => 'WellCommerceUrlMatcher'));\n }",
"protected function _getRouter() {\n\t\treturn new Router;\n\t}",
"public function getRouter()\n {\n if (null === $this->router_inst ){\n Pfw_Loader::loadClass('Pfw_Controller_Router_Standard');\n $this->router_inst = new Pfw_Controller_Router_Standard();\n }\n return $this->router_inst;\n }",
"public static function sharedRouter(){\n if(static::$sharedRouter == NULL){\n static::$sharedRouter = new PCRouter();\n }\n return static::$sharedRouter;\n }",
"protected function getApiPlatform_RouterService()\n {\n return $this->privates['api_platform.router'] = new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\Router(($this->services['router'] ?? $this->getRouterService()));\n }",
"public function getRouter()\n {\n if ($this->router === null) $this->router = new Net\\Router();\n return $this->router;\n }",
"public function getRouter()\n {\n return $this->router;\n }",
"private function __loadRouter()\n {\n return new Router();\n }",
"function mdtb_get_router()\n{\n /** introduced with the Slim rewrite of the recent Shaarli */\n $newShaarliRouter = 'Shaarli\\Legacy\\LegacyRouter';\n /** original router class of old Shaarlies */\n $oldShaarliRouter = 'Shaarli\\Router';\n\n if (class_exists($newShaarliRouter)) {\n return $newShaarliRouter;\n }\n\n return $oldShaarliRouter;\n}",
"public static function getInstance() : Router{\n if ( !isset(self::$instance) ) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n\n return self::$instance;\n }",
"public function getRouter() {\n if (isset(self::$objects['router'])) {\n return self::$objects['router'];\n }\n \n return self::$objects['router'] = new Router($this->getRouteCollection(), $this->getSettings());\n }",
"function init()\n {\n $router = new Router();\n return $router;\n }",
"public static function getInstance() {\n if (!self::$instance) {\n self::$instance = new Router;\n }\n\n return self::$instance;\n }",
"public function getRouter()\n {\n if (null == $this->_router) {\n $this->setRouter();\n }\n\n return $this->_router;\n }",
"private function createRouter()\n {\n return new Router();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the saved syncing actions | public static function clear_saved_actions() {
delete_option( 'extendable-aggregator-queued-actions-' . static::$name );
} | [
"public function ClearActions() {\t\t\r\n\t\t$this->actions = array_slice($this->actions, 0, 0); \r\n\t}",
"public function reset()\n {\n if ($this->getAdd() || $this->getRemove()) {\n $this->clearSaved();\n }\n $this->clearAdd();\n $this->clearRemove();\n }",
"protected static function resetDeferredActions()\n {\n delete_option(self::$PLUGIN_SLUG . '_pending_activation_actions');\n }",
"public function resetOperations(){\n foreach ($this->operations as $operation) {\n $operation->setTmpAccount(null);\n }\n $this->operations->clear();\n }",
"function clear() {\n\t\t\tunset($cmd_chain_array);\n\t\t\t$this->cmd_chain_array = array();\n\t\t}",
"public static function clear_queued_actions()\n {\n }",
"public function clearAllSavedCards(){\r\n foreach($this->getCards() as $card) {\r\n $card->delete();\r\n }\r\n }",
"public function clearTeamsTransfersHistory()\n\t{\n\t\t$this->teamsTransfersHistory = array();\n\t}",
"public function clearStored()\n\t{\n\t\t$this->withExclusive = array();\n\t\t$this->overall = array();\n\t}",
"public function clearChanged();",
"public function flushCacheAction(){\n Appcaching::removeActionCache($this->playid,$this->actionid);\n $this->reloadData();\n }",
"public static function clearAll() {\n $instance = self::getInstance();\n $instance::$store = array();\n }",
"public function can_remove_all_applied_actions_using_the_clear_actions_method()\n {\n $cart = $this->initCart();\n $item = $cart->addItem([\n 'id' => 123,\n 'title' => 'Example title',\n ]);\n\n $item->applyAction(['id' => 1, 'title' => 'Demo action 1']);\n $item->applyAction(['id' => 2, 'title' => 'Demo action 2']);\n\n $this->assertEquals(2, $item->countActions());\n $item->clearActions();\n $this->assertEquals(0, $item->countActions());\n }",
"public function clear() {\n\t\t$this->commands = array();\n\t\t$this->error = false;\n\t}",
"final public function ClearChanges() {\n foreach($this->EntityManagers as $EntityManager) {\n $EntityManager->ClearChanges();\n }\n $this->PendingChanges->Reset();\n }",
"protected function resetStatuses()\n {\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_READY));\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_BUSY));\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_FAILED));\n }",
"public function removeAllActions();",
"function reset(){\n\t\t$this->__columns = array();\n\t\t$this->__actions = array();\n\t}",
"public function clearMassActions()\n {\n $this->_massActions = array();\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable postgis on this database. Will create the extension in the database. | public function enablePostgis()
{
return $this->addCommand('enablePostgis');
} | [
"public function enablePostgisIfNotExists()\n {\n return $this->connection->statement(\n $this->grammar->compileEnablePostgisIfNotExists()\n );\n }",
"public function compileEnablePostgis(Blueprint $blueprint, Fluent $command) {\n\t\treturn 'CREATE EXTENSION postgis';\n\t}",
"public function disablePostgisIfExists()\n {\n return $this->connection->statement(\n $this->grammar->compileDisablePostgisIfExists()\n );\n }",
"function postgis_connect() {\r\n\tglobal $postgis_host, $postgis_port, $postgis_dbname, $postgis_user, $postgis_pass;\r\n\t$pg_connect_string = \"host=$postgis_host port=$postgis_port dbname=$postgis_dbname \r\n\tuser=$postgis_user password=$postgis_pass\";\r\n\treturn pg_connect($pg_connect_string);\r\n}",
"public function activateExtensions() {\n\n Database::query('CREATE EXTENSION hstore;');\n Database::query('CREATE EXTENSION \"uuid-ossp\";');\n\t\t\n\t\t$query = '\n\t\t\tcreate schema shard_1;\n\t\t\tcreate sequence shard_1.global_id_sequence;\n\t\t\t\n\t\t\tCREATE OR REPLACE FUNCTION shard_1.id_generator(OUT result bigint) AS $$\n\t\t\tDECLARE\n\t\t\t our_epoch bigint := 1314220021721;\n\t\t\t seq_id bigint;\n\t\t\t now_millis bigint;\n\t\t\t -- the id of this DB shard, must be set for each\n\t\t\t -- schema shard you have - you could pass this as a parameter too\n\t\t\t shard_id int := 1;\n\t\t\tBEGIN\n\t\t\t SELECT nextval(\\'shard_1.global_id_sequence\\') % 1024 INTO seq_id;\n\t\t\t\n\t\t\t SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO now_millis;\n\t\t\t result := (now_millis - our_epoch) << 23;\n\t\t\t result := result | (shard_id << 10);\n\t\t\t result := result | (seq_id);\n\t\t\tEND;\n\t\t\t$$ LANGUAGE PLPGSQL;\n\t\t\t\n\t\t\tselect shard_1.id_generator();\n\t\t';\n\t\t\n\t\tDatabase::query($query);\n }",
"public function compileDisablePostgis(Blueprint $blueprint, Fluent $command) {\n\t\treturn 'DROP EXTENSION postgis';\n\t}",
"protected function isDbalEnabled() {}",
"public function databaseLayerEnabled(): bool\n {\n // Globally\n $enableDbLayer = Config::get('cms.database_templates', false);\n\n // Locally\n if (!$enableDbLayer) {\n $enableDbLayer = $this->getConfigValue('database', false);\n }\n\n return $enableDbLayer && App::hasDatabase();\n }",
"private function postgisColumnList() {\n static $columns;\n\n if (!is_array($columns)) {\n $tables = $columns = array();\n\n // Query for all available geometry columns.\n $res = db_query(\"SELECT s.nspname AS schema,\n c.relname AS table,\n a.attname AS column\n FROM pg_catalog.pg_attribute a\n INNER JOIN pg_catalog.pg_class c ON a.attrelid = c.oid\n INNER JOIN pg_catalog.pg_namespace s ON c.relnamespace = s.oid\n WHERE pg_catalog.format_type(a.atttypid, a.atttypmod) = 'geometry'\n AND c.relname != 'geometry_dump'\n ORDER BY s.nspname, c.relname, a.attnum\");\n\n while ($row = db_fetch_array($res)) {\n $table = $row['table'];\n $column = $row['column'];\n\n // Gather constraints on this table.\n if (!isset($tables[$table])) {\n $tables[$table] = array();\n\n $res2 = db_query(\"SELECT pg_catalog.pg_get_constraintdef(r.oid, true)\n FROM pg_catalog.pg_constraint r\n LEFT JOIN pg_catalog.pg_class c ON r.conrelid = c.oid\n WHERE c.relname = '%s' AND r.contype = 'c'\", $table);\n while ($constraint = db_result($res2)) {\n $tables[$table][] = $constraint;\n }\n }\n\n foreach ($tables[$table] as $c) {\n // Dimension: \"CHECK (ndims(the_geom) = 2)\"\n if (strpos($c, \"ndims($column)\")) {\n $row['geo_dimension'] = preg_replace('/\\D/', '', $c);\n }\n\n // GeometryType: CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL)\"\n elseif (strpos($c, \"geometrytype($column)\")) {\n $row['geometry_type'] = preg_replace('/.*\\'(\\w+)\\'.*/', '$1', $c);\n $row['geo_type'] = constant('GEO_TYPE_'. $row['geometry_type']);\n }\n\n // SRID: \"CHECK (srid(the_geom) = 26915)\"\n elseif (strpos($c, \"srid($column)\")) {\n $row['srid'] = preg_replace('/\\D/', '', $c);\n }\n }\n\n $columns[] = $row;\n }\n }\n return $columns;\n }",
"function db_is_pgsql() {\n\t\t$t_db_type = DB_TYPE;\n\n\t\tswitch( $t_db_type ) {\n\t\t\tcase 'postgres':\n\t\t\t// case 'postgres64': - 20060523\n\t\t\tcase 'postgres7':\n\t\t\tcase 'pgsql':\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isPostgres()\n {\n return $this->_type_db === self::PGSQL;\n }",
"public function testGeometries()\n {\n /** @var Connection $db */\n /** @var Registry $doctrine */\n /** @var PostgreSQL|Geographic $driver */\n $container = self::$container;\n $doctrine = $container->get(\"doctrine\");\n $features = $container->get(\"features\");\n $connectionName = $this->configuration['connection'];\n $db = $doctrine->getConnection($connectionName);\n $schemaName = 'public';\n\n foreach (array(\n self::WKT_POINT,\n self::WKT_POLYGON,\n self::WKT_LINESTRING,\n self::WKT_MULTIPOINT,\n self::WKT_MULTILINESTRING,\n self::WKT_MULTIPOLYGON,\n self::WKT_GEOMETRYCOLLECTION,\n ) as $wkt) {\n\n $type = FeatureType::getWktType($wkt);\n $wkt = preg_replace('/,\\s+/s', ',', $wkt);\n $tableName = \"test_\" . strtolower($type);\n $srid = 4326;\n $geomFieldName = 'geom';\n $uniqueIdField = 'id';\n $featureType = new FeatureType($container, array(\n 'connection' => $connectionName,\n 'table' => $tableName,\n 'srid' => $srid,\n 'geomField' => $geomFieldName\n ));\n $driver = $featureType->getDriver();\n $feature = new Feature(array(\n 'geometry' => $wkt,\n 'properties' => array()\n ), $srid, $uniqueIdField, $geomFieldName);\n\n $driver->createTable($tableName, $uniqueIdField, true);\n //$db->exec(\"DELETE FROM \" . $tableName);\n $featureType->addGeometryColumn($tableName, $type, $srid, $geomFieldName);\n\n for ($i = 0; $i < 10; $i++) {\n $savedFeature = $featureType->save($feature);\n $feature->setId(null);\n $this->assertEquals($savedFeature->getGeom(), $wkt);\n }\n\n if(self::REMOVE_TEST_TABLES){\n $driver->dropTable($tableName);\n }\n }\n }",
"public static function useDbReplicate()\n {\n self::$_useDbReplicate = true;\n }",
"function register_gutenberg_extension() {\n\t\t// TODO: The `gutenberg/available-extensions` endpoint currently doesn't accept a post ID,\n\t\t// so we cannot pass one to `$this->current_user_can_access_publicize_data()`.\n\n\t\tif ( $this->current_user_can_access_publicize_data() ) {\n\t\t\tJetpack_Gutenberg::set_extension_available( 'jetpack/publicize' );\n\t\t} else {\n\t\t\tJetpack_Gutenberg::set_extension_unavailable( 'jetpack/publicize', 'unauthorized' );\n\n\t\t}\n\t}",
"public static function useDbReplicate(){\n self::$_useDbReplicate = true;\n }",
"protected function getDbal_Extractor_Extractors_PostgresExtractorService()\n {\n return new \\phpbb\\db\\extractor\\postgres_extractor('./../', ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn.driver']) ? $this->services['dbal.conn.driver'] : $this->get('dbal.conn.driver', 1)) && false ?: '_'});\n }",
"function verif_active_dbase() {\n if (!function_exists(\"dbase_open\")) {\n echo \"<center><p class=grand>ATTENTION : PHP n'est pas configuré pour gérer les fichiers GEP (dbf).\n <br />L'extension d_base n'est pas active. Adressez-vous à l'administrateur du serveur pour corriger le problème.</p></center></body></html>\";\n die();\n }\n}",
"public function registerDatabase()\n {\n if ($this->ensureEventsManager($this->db)) {\n $this->db->getEventsManager()->attach('db', AdapterPlugin::getInstance($this->getProfiler()));\n\n return true;\n }\n\n return false;\n }",
"protected function setupExtensions()\n {\n if (config('admin.extension_driver') == 'database' && ! \\Schema::hasTable('artificer_extensions')) {\n $path = __DIR__.'/../../migrations/';\n\n if (str_contains($path, base_path().'/')) {\n $path = str_replace(base_path().'/', '', $path);\n }\n\n $migrator = app('ArtificerMigrator');\n $migrator->path($path);\n\n \\Artisan::call('artificer:migrate', ['--path' => $path]);\n }\n\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a db_type, based on an IP address. | function get_db_type_by_ip($db_ip)
{
if (($db_ip == '207.92.85.60') || ($db_ip == 'titan.yesco.com')) //Titan (MS SQL)
return 'mssql';
else if ($db_ip == '207.92.85.253') //AS400 (I-Series)
return 'iseries';
else if ($db_ip == '207.92.85.69') //Everest (MySQL)
return 'mysql';
else
return ''; //Not a Workbench database server.
} | [
"public function dbType();",
"function get_ip_type($address)\n{\n global $config;\n\n list($ip, $bits) = explode('/', trim($address)); // Remove subnet/mask if exist\n\n $ip_version = get_ip_version($ip);\n switch ($ip_version)\n {\n case 4:\n\n // Detect IPv4 broadcast\n if (strlen($bits))\n {\n $ip_parse = Net_IPv4::parseAddress($address);\n if ($ip == $ip_parse->broadcast && $ip_parse->bitmask < 31) // Do not set /31 and /32 as broadcast!\n {\n $ip_type = 'broadcast';\n break;\n }\n }\n\n // no break here!\n case 6:\n\n $ip_type = ($ip_version == 4) ? 'unicast': 'reserved'; // Default for any valid address\n foreach ($config['ip_types'] as $type => $entry)\n {\n if (isset($entry['networks']) && match_network($ip, $entry['networks'], TRUE))\n {\n // Stop loop if IP founded in networks\n $ip_type = $type;\n break;\n }\n \n }\n break;\n\n default:\n // Not valid IP address\n return FALSE;\n }\n\n return $ip_type;\n}",
"public static function getGeoIPDatabaseTypeFromFilename($filename)\n {\n foreach (self::$dbNames as $key => $names) {\n foreach ($names as $name) {\n if ($name === $filename) {\n return $key;\n }\n }\n }\n return false;\n }",
"function getZoneTypeByIp($ip) {\n if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return 'AAAA';\n }\n return 'A'; \n }",
"function fn_ip_from_db($ip)\n{\n // Empty or not encoded IP\n if (empty($ip) || strpos($ip, '.') !== false || strpos($ip, ':') !== false) {\n return $ip;\n }\n\n return inet_ntop(hex2bin($ip)); // phpcs:ignore\n}",
"private function getDBType() {\n\t\treturn $this->dbtype;\n\t}",
"function db_type () {\n\t\treturn $this->db_type;\n\t}",
"static function DatabaseTypeToInternalType($database_type){\n\t\tif(preg_match(\"/^(numeric|double precision)/\",$database_type)){\n\t\t\treturn \"float\";\n\t\t}\n\n\t\tif(preg_match(\"/^(integer|bigint|smallint)/\",$database_type)){\n\t\t\treturn \"integer\";\n\t\t}\n\n\t\tif(preg_match(\"/^timestamp/\",$database_type)){\n\t\t\treturn \"timestamp\";\n\t\t}\n\n\t\tif(preg_match(\"/^bool/\",$database_type)){\n\t\t\treturn \"boolean\";\n\t\t}\n\n\t\treturn \"string\";\n\t}",
"function getType()\n\t{\n\t\treturn $this->db_type;\n\t}",
"private function getDatabaseType($type) {\r\n switch($type) {\r\n case 'bool':\r\n return 'NUMBER';\r\n case 'int':\r\n return 'NUMBER';\r\n case 'string':\r\n return 'NVARCHAR2';\r\n default: // Unknown data types cannot be handled correctly\r\n throw new Exception('Database column type \\''.$type.'\\' is not known to the persistence adapter.');\r\n }\r\n }",
"function NpcTypeFromName($DbName)\n{\n global $NPCTypeArray;\n foreach ($NPCTypeArray as $key => $type) {\n $KeyCount = substr_count($DbName, $key);\n $StringLength = strlen($DbName);\n $KeyLength = strlen($key);\n if ($KeyCount > 0 && substr($DbName, 0, $KeyLength) == $key) {\n return $type;\n }\n }\n\n return \"Normal\";\n}",
"public function addrtype() {\n\t\treturn $this->addrtype;\n\t}",
"protected function _openDb($type) {\n\t\treturn geoip_open($type, GEOIP_STANDARD);\n\t}",
"function dbDataType($type){\n\t\t$values = array(\n\t\t\t'unsigned integer'=>'BIGINT'\n\t\t);\n\t\tif(isset($values[$type])) return $values[$type];\n\t\telse return '';\n\t}",
"public function getCountryFromDb($ip_address)\r\n {\r\n //Check the IP version\r\n if (filter_var($ip_address,FILTER_VALIDATE_IP)) {\r\n\r\n $dbname = \"ip2location_db1\";\r\n\r\n //Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer\r\n $ip_address = ip2long($ip_address);\r\n\r\n } elseif(filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\r\n\r\n $dbname = \"ip2location_db1_ipv6\";\r\n\r\n //Convert IP address to its corresponding 32–bit decimal number\r\n $ip_address = $this->ipAddressToIpNumber($ip_address);\r\n\r\n } else {\r\n return false;\r\n }\r\n \r\n $CI =&get_instance();\r\n\r\n $CI->db->where('ip_from <=', $ip_address);\r\n $CI->db->where('ip_to >=', $ip_address);\r\n $res = $CI->db->get($dbname);\r\n\r\n if ($res && $res->num_rows() > 0) {\r\n $row = $res->row();\r\n if ($row->country_name && $row->country_name !== '-') {\r\n $country_name = $row->country_name;\r\n $country_name = $this->checkIpResult($country_name);\r\n return $country_name;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }",
"public function getDBType() {\r\n\t\treturn get_class($this);\r\n\t}",
"private function getAddressType(string $address)\n {\n \tforeach(AddressesTypes::all() as $Type)\n \t\tif( CryptoValidation::make(strtoupper($Type->abb))->validate($address) )\n \t\t\treturn $Type;\n }",
"public static function getIpClass($ip_address)\n {\n $proper_address = ip2long($ip_address);\n\n if ($proper_address < 2147483648) {\n $class = 'A';\n }elseif ($proper_address < 3221225472) {\n $class = 'B';\n }elseif ($proper_address < 3758096384) {\n $class = 'C';\n }elseif ($proper_address < 4026531840) {\n $class = 'D';\n }else {\n $class = 'E';\n }\n \n return $class;\n }",
"private static function dbType( $dsn ) {\n\t\tif ( 0 === strpos( $dsn, 'mysql' ) ) {\n\t\t\treturn 'mysql';\n\t\t} elseif ( 0 === strpos( $dsn, 'postgres' ) ) {\n\t\t\treturn 'postgres';\n\t\t} elseif ( 0 === strpos( $dsn, 'sqlite' ) ) {\n\t\t\treturn 'sqlite';\n\t\t}\n\t\treturn 'other';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of countryId. | public function getCountryId()
{
return $this->countryId;
} | [
"public function getCountryId();",
"public function getCountryId()\n {\n return $this->country_id;\n }",
"public function getCountryId()\n {\n\n return $this->country_id;\n }",
"public function get_id_country()\n\t{\n\t\treturn $this->id_country;\n\t}",
"public function get_id_country() {\n\t\n\t\t\treturn $this->id_country;\n\t\t}",
"public function getIdCountry()\n {\n return $this->idCountry;\n }",
"public function getCountryId()\n\t{\n\t\tif(!isset($this->countryId) || $this->countryId === null)\n\t\t{\n\t\t\t$this->countryId = $this->getXml()->getElementsByTagName('RefereeCountryId')->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->countryId;\n\t}",
"public function entityCountryId()\r\n {\r\n return $this->getCountry()->id;\r\n }",
"function getCountryID() {\n\t\treturn $this->_CountryID;\n\t}",
"public function entityCountryId();",
"public function entityCountryId()\n {\n if ($this->getEventVenue() === null || $this->getEventVenue()->getType() != \"simple\") return \"\";\n return $this->getEventVenue()->getCity()->getState()->getCountry()->id;\n }",
"public static function getCountryId()\n {\n return isset(Yii::app()->session['country_id'])? Yii::app()->session['country_id']:FALSE;\n }",
"function getCountryPaypalId($varCountryId = 0) {\n $varCustomerWhere = \"fkCountryID IN (0,\" . $varCountryId . \")\";\n $arrClms = array('EmailId');\n $varOrderBy = \"fkCountryID DESC\";\n $arrList = $this->select(TABLE_PAYPAL, $arrClms, $varCustomerWhere, $varOrderBy);\n return $arrList['0']['EmailId'];\n }",
"public function GetCountry($country)\r\n {\r\n $query = $this->db->query(\"SELECT DISTINCT * FROM \" . DB_PREFIX . \"country WHERE name = '\" . $this->db->escape($country). \"'\");\r\n foreach ($query->rows as $result)\r\n {\r\n return $result['country_id'];\r\n }\r\n }",
"public function entityCountryId()\n {\n return null;\n }",
"public function entityCountryId()\r\n {\r\n return null;\r\n }",
"public function getEstimateCountryId()\n {\n return $this->getAddress()->getCountryId();\n }",
"protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}",
"public static function getCountryID()\n {\n if (class_exists('CFactory'))\n {\n JFactory::getLanguage()->load('com_community.country', JPATH_SITE, 'en-GB', true);\n $profileCountry = CFactory::getUser()->getInfo('FIELD_COUNTRY');\n\n $country = JText::_($profileCountry);\n return self::findCountryID($country);\n }\n else // for testing purposes\n {\n $country = \"Universal\";\n return self::findCountryID($country);\n // TODO: return 0 once testing is complete.\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Location publications of a single user. | public function getLocationPublications($user)
{
return $this->getByCategoryType('Location', $user);
} | [
"public function getUserLocations()\n {\n return LocationUtility::getUserLocations();\n }",
"public static function getUsersLocations($bCheckPublished = true) {\n\n// $userModel = \\Models\\User::loadCurrent();\n// $userModel->assureLocation();\n \n if (self::$_userLocations === null && self::$_userLocationsWithCheck === null) {\n\n self::$_userLocations = array();\n self::$_userLocationsWithCheck = array();\n\n global $user;\n $uid = $user->uid;\n\n $user = user_load($uid);\n $groupField = GojiraSettings::CONTENT_TYPE_GROUP_FIELD;\n $groupField = $user->$groupField;\n\n if (isset($groupField[LANGUAGE_NONE]) && isset($groupField[LANGUAGE_NONE][0]) && isset($groupField[LANGUAGE_NONE][0]['nid'])) {\n $gid = $groupField[LANGUAGE_NONE][0]['nid'];\n } else {\n $gid = 0;\n }\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', GojiraSettings::CONTENT_TYPE_LOCATION)\n ->fieldCondition('field_gojira_group', 'nid', $gid, '=');\n\n $result = $query->execute();\n\n if (isset($result['node'])) {\n foreach ($result['node'] as $node) {\n $oNode = node_load($node->nid);\n self::$_userLocations[$node->nid] = $oNode;\n if ($oNode->status == 1) {\n self::$_userLocationsWithCheck[$node->nid] = $oNode;\n }\n }\n }\n }\n\n if ($bCheckPublished) {\n return self::$_userLocationsWithCheck;\n }\n return self::$_userLocations;\n }",
"public function getUserLocation()\n {\n return $this->user_location;\n }",
"private function getUserGrantedLocations()\n {\n return Auth::user()->userLocations()->pluck('id');\n }",
"public function showLocationsOwnedByUser()\n {\n if(Auth::check())\n {\n $ids = UserPlaceOwnershipClaim::select('place_id')\n ->distinct()\n ->where('requester_user_id',Auth::id())\n ->get()\n ->pluck('place_id')\n ->toArray();\n\n return Place::whereIn('id',$ids)\n ->select('id','name')\n ->get();\n }\n else\n {\n return [];\n }\n }",
"function user_locations() {\n\treturn User_Locations_Setup::instance();\n}",
"public function locations()\n {\n return $this->hasMany('App\\Location', 'user_id');\n }",
"function GetSearchLocationList($id_user, $is_preferred = true) {\n\tglobal $config, $dbconn;\n\t$strSQL = \"SELECT lt.id, lt.id_country, lt.id_region, lt.id_city, lt.is_primary, \".\n\t\t\t \"country.name AS country_name, region.name AS region_name, city.name AS city_name \".\n\t\t\t \"FROM \".SEARCH_LOCATION_TABLE.\" lt \".\n\t\t\t \"LEFT JOIN \".COUNTRY_TABLE.\" country ON country.id=lt.id_country \".\n\t\t\t \"LEFT JOIN \".REGION_TABLE.\" region ON region.id=lt.id_region \".\n\t\t\t \"LEFT JOIN \".CITY_TABLE.\" city ON city.id=lt.id_city \".\n\t\t\t \"WHERE lt.id_user = '\".$id_user.\"' AND lt.is_preferred='$is_preferred' ORDER BY \".(($is_preferred) ? \"lt.is_primary\" : \"lt.id\").\" DESC\";\n\t$rs = $dbconn->Execute($strSQL);\n\t$locations = array();\n\tif ($rs->RowCount() > 0) {\n\t\twhile (!$rs->EOF) {\n\t\t\t$locations[] = $rs->GetRowAssoc( false );\n\t\t\t$rs->MoveNext();\n\t\t}\n\t}\n\treturn $locations;\n}",
"private function getRoleHasLocationAccess(User $user)\n {\n return $user\n ->roles()\n ->with('countries')\n ->whereHas('permissions', function ($query){\n $query->where('name', 'locations.list');\n })\n ->get();\n }",
"public function peopleGetPublicPhotos($user_id)\r\n\t\t{\r\n\t\t\treturn $this->people_service->getPublicPhotos($user_id);\r\n\t\t}",
"public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }",
"public function user() {\n $r = $this->call(\"user\");\n // add latitudes and longitudes, and extract best guess\n if (isset($r->user->location_hierarchy)) {\n $r->user->best_guess = NULL;\n foreach ($r->user->location_hierarchy as &$loc) {\n\t$c = $loc->geometry->coordinates;\n\tswitch ($loc->geometry->type) {\n\tcase 'Box': // DEPRECATED\n\t $loc->bbox = $c;\n\t $loc->longitude = ($c[0][0] + $c[1][0]) / 2;\n\t $loc->latitude = ($c[0][1] + $c[1][1]) / 2;\n\t $loc->geotype = 'box';\n\t break;\n\tcase 'Polygon':\n\t $loc->bbox = $bbox = $loc->geometry->bbox;\n\t $loc->longitude = ($bbox[0][0] + $bbox[1][0]) / 2;\n\t $loc->latitude = ($bbox[0][1] + $bbox[1][1]) / 2;\n\t $loc->geotype = 'box';\n\t break;\n\tcase 'Point':\n\t list($loc->longitude, $loc->latitude) = $c;\n\t $loc->geotype = 'point';\n\t break;\n\t}\n\tif ($loc->best_guess) $r->user->best_guess = $loc; // add shortcut to get 'best guess' loc\n\tunset($loc);\n }\n }\n \n return $r;\n }",
"public function getLocations();",
"function get_all_user_locations()\n {\n\n \t//$time_min = time() - (2.5 * 60);\n \t$time_min = time() - (60 * 60 * 24);\n \t$time_min = new MongoDate($time_min);\n\n \t$obj_list = $this->mongo_db->select(array('_id','last_location_longitude', 'last_location_latitude'))\n \t->where_gte('last_api_time', $time_min)\n \t->get($this->get_collection_name());\n\n \treturn $obj_list;\n\n }",
"public function users()\n {\n return $this->morphedByMany('App\\User', 'locationable');\n }",
"function get_user_positions($user) {\n\t$schedules = get_user_schedules($user);\n\t$positions = array();\n\tforeach($schedules as $schedule) {\n\t\tforeach($schedule[\"s_assignments\"] as $assignment) {\n\t\t\tif (isset($positions[$assignment[\"pa_p_id\"]])) $positions[$assignment[\"pa_p_id\"]]+=.25;\n\t\t\telse $positions[$assignment[\"pa_p_id\"]] = .25;\n\t\t}\n\t}\n\treturn $positions;\n}",
"public function getLocations()\n {\n return $this->locations;\n }",
"public function users()\r\n {\r\n return $this->belongsToMany(User::class, 'location_user');\r\n }",
"public function location() {\n return new LocationCollection($this->playerData['location']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns instance of MySQL repository. | private function _getMySQLRepository($params = null) {
$repository = $this->getProvider()->get('PM\Profiler\Monitor\Repository\MySQL');
/* @var $repository \PM\Profiler\Monitor\Repository\MySQL */
$repository->setMeasureId($params[HttpKeys::MEASURE_ID]);
$helper = $this->getProvider()->get('PM\Profiler\Monitor\Helper\State');
/* @var $helper \PM\Profiler\Monitor\Helper\State */
$repository->attach($helper);
return $repository;
} | [
"public static function databaseRepository()\n {\n return static::$databaseRepository ?: static::$databaseRepository = DatabaseRepositoryFactory::make(static::databaseConnection());\n }",
"public static function getInstance()\n {\n \tif (!self::$instance)\n \t{\n \t\tself::$instance = new MySQLDriver();\n \t}\n \treturn self::$instance;\n }",
"protected function getRepository() {\n if(empty($this->repository)) {\n try {\n $pdo = new PDO(PDO_DSN, DB_USER, DB_PASS);\n $this->repository = new UserRepository($pdo);\n } catch (PDOException $e) {\n $this->errorMessages[] = 'Connection failed: ' . $e->getMessage();\n }\n }\n\n return $this->repository;\n }",
"public static function getInstance() {\n if (!self::$repository) {\n self::$repository = new self();\n }\n\n return self::$repository;\n }",
"public static function repository()\n {\n return (new self)->getDataRepository();\n }",
"private static function db() {\n static $mysql_conn = null;\n\n // Load the DAO Object and pull the connection\n if ($mysql_conn == null) {\n $nyss_conn = new CRM_Core_DAO();\n $mysql_conn = $nyss_conn->getDatabaseConnection()->connection;\n }\n return $mysql_conn;\n }",
"public function createMysqlInstance() {\n return R1soft_MysqlInstance::create( $this, func_get_args() );\n }",
"public function getRepositoryManager();",
"public function getRepository();",
"public function repo()\n\t{\n\t\trequire_once __DIR__ . DS . 'repo.php';\n\t\tif (!isset($this->_repo))\n\t\t{\n\t\t\t$this->_repo = new Repo($this, 'local');\n\t\t}\n\n\t\treturn $this->_repo;\n\t}",
"private function getRepositoryInstance()\r\n {\r\n if (class_exists($this->request->getRepository()))\r\n {\r\n Debug::add(\"debug::repository\", \"Repository örneği oluşturuluyor.\");\r\n $name = $this->request->getRepository();\r\n return new $name;\r\n }\r\n }",
"public function repository()\n {\n return $this->repository;\n }",
"function getRepository($id = 'default')\n{\n \\Sledgehammer\\deprecated('Sledgehammer\\getRepository() is deprecated in favor of Repository::instance()');\n\n return Repository::instance($id);\n}",
"protected function createRepository()\n {\n return Repository::getNewDefaultRepository($this);\n }",
"protected function getRepository()\n {\n return $this->get('doctrine_mongodb')->getManager()->getRepository('App:User');\n }",
"public function getRepository()\n {\n return $this->_repository;\n }",
"protected function getQueryBuilder() : MySQLQueryBuilder\n {\n return new MySQLQueryBuilder();\n }",
"public function getDb() {\r\n $driver = 'Db' . ucfirst($this->__dbconfig['driver']);\r\n $db = new $driver($this->__dbconfig);\r\n return $db;\r\n }",
"protected function getRepository()\n {\n return new $this->repositoryType($this->resourceType);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Request Handling Performs request validation, creates a service object based on the requested api version and assigns request handling to the service object. If the request is processed successfully the service object will return a response, which will be passed back to the requesting application. If the request fails or is invalid an exception will be thrown and an error response will be returned instead. | function handleApiRequest()
{
try
{
// get the app id and token if one was passed in
$appId = isset($_POST['app_id']) ? $_POST['app_id'] : NULL;
$token = isset($_POST['token']) ? $_POST['token'] : NULL;
// get namespace, class, method if one was passed in
$namespace = isset($_REQUEST['namespace']) ? $_REQUEST['namespace'] : NULL;
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : NULL;
$method = isset($_REQUEST['method']) ? $_REQUEST['method'] : NULL;
// create service object that will handle this request
$serviceObj = new Service();
// get our list of endpoints that are valid and pass to our service object
$access = include API_ROOT_DIR . '/config/access_whitelist.php';
$serviceObj->setAccessWhitelist($access);
// run check to see if the requesting app, token and requested endpoint & method are valid
$serviceObj->validate($appId, $token, $namespace, $class);
// try to handle the api request
$response = $serviceObj->load($namespace, $class, $method, $_POST);
if (is_array($response))
{
// convert response to json and echo it
$response = json_encode($response);
header('Content-Type: application/json');
echo $response;
}
else
{
// something unexpected happened, handle here
}
}
catch (Exception $exception)
{
// our request failed so set our status to false
$response['status'] = false;
// we do not return a valid token on failed requests
$response['token'] = Auth::generateDummyToken(array('uid' => 0));
// set our error message and code to return
$response['payload']['error'] = array(
'message' => $exception->getMessage(),
'code' => $exception->getCode()
);
// encode our response as json and send it
$response = json_encode($response);
header('Content-Type: application/json');
echo $response;
}
} | [
"public function processAPI() {\n \tif (method_exists($this, $this->endpoint)) {\n \t\t\treturn $this->_response($this->validateAndApplyFunction($this->endpoint, $this->args)); \n \t \t \t}\n return $this->_response($this->{'invalidEndpoint'}(), 404);\n \t}",
"function processRequest() {\n $object = new $this->endpoint();\n $this->response = \n $this->formatResponse( $object->REST($this->method, $this->args) );\n }",
"private function handle_v1_rest_api_request()\n {\n }",
"public function handleRequest() {\r\n\t\ttry {\r\n\t\t\t$response = null;\r\n\t\t\t$method = isset($this->request[\"f\"]) ? $this->request[\"f\"] : null;\r\n\t\t\t\r\n\t\t\tif ($method && method_exists($this->handler, $method)) {\r\n\t\t\t\t$fct = new ReflectionMethod($this->handler, $method);\r\n\t\t\t\t\r\n\t\t\t\t$params = isset($this->request[\"params\"]) ? $this->request[\"params\"] : array();\r\n\t\t\t\tif ($fct->getNumberOfRequiredParameters() == count($params))\r\n\t\t\t\t\t$response = call_user_func_array(array($this->handler, $method), $params);\r\n\t\t\t}\r\n\t\t\tif ($response) return json_encode(array(\"r\" => $response));\r\n\t\t\telse return \"{}\";\r\n\t\t} catch(Exception $e) {\r\n\t\t\terror_log($e);\r\n\t\t\treturn \"{}\";\r\n\t\t}\r\n\t}",
"public function run_service()\n\t{\n\t\t// Check the request is allowed\n\t\tif ($this->_is_api_request_allowed())\n\t\t{\n\t\t\t// Route the API task\n\t\t\t$this->_route_api_task();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set the response to \"ACCESS DENIED\"\n\t\t\t$this->set_response($this->get_error_msg(006));\n\n\t\t\t// Terminate execution\n\t\t\treturn;\n\t\t}\n\t}",
"private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t\n\t\t//call appropriate function for the action provided\n\t\t// $lti_id = $this->request->lti_id;\n\t\t// $user_id = $this->request->user_id;\n\n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t//error_log(\"hello has been sent through\");\n\t\t\t\tbreak;\n\t\t\tcase \"getAppSettings\":\n\t\t\t\terror_log(\"getAppSettings has been sent through\");\n\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t//error_log($data->lti_id);\n\t\t\t\t$this->getAppSettings($data->lti_id);\n\t\t\t\tbreak;\n\t\t\tcase \"setAppSettings\":\n\t\t\t\terror_log(\"setAppSettings has been sent through\");\n\n\t\t\t\t$request = $this->request;\n\t\t\t\t$app_settings = json_decode($request->app_settings, true);\n\n\t\t\t\t$this->setAppSettings($request->lti_id, $app_settings);\n\t\t\t\tbreak;\n\t\t\tcase \"getUserState\":\n\t\t\t\terror_log(\"getUserState has been sent through\");\n\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t//error_log($data->lti_id);\n\t\t\t\t$this->getUserState($data->lti_id, $data->user_id);\n\t\t\t\tbreak;\n\t\t\tcase \"setUserState\":\n\t\t\t\t//error_log(\"setUserState has been sent through\");\n\t\t\t\tbreak;\n\t\t\tcase \"formSubmit\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->formSubmit($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"getAllEntries\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t$this->getAllEntries($data->lti_id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\t}",
"protected function getOroOrganization_Form_Handler_ApiService()\n {\n if (!isset($this->scopedServices['request'])) {\n throw new InactiveScopeException('oro_organization.form.handler.api', 'request');\n }\n\n return $this->services['oro_organization.form.handler.api'] = $this->scopedServices['request']['oro_organization.form.handler.api'] = new \\Oro\\Bundle\\OrganizationBundle\\Form\\Handler\\BusinessUnitHandler($this->get('oro_organization.form.business_unit.api'), $this->get('request'), $this->get('doctrine.orm.default_entity_manager'));\n }",
"public function handleRequest() {\n // Make sure the action parameter exists\n $action = $this->getFromBody('action');\n\n // Call the correct handler based on the action\n switch ($action) {\n\n case 'createReservation':\n $this->handleCreateEquipmentReservation();\n\n case 'cancelReservation':\n $this->handleEquipmentCancelReservation();\n\n case 'checkoutEquipment':\n $this->handleCreateEquipmentCheckout();\n\n case 'returnEquipment':\n $this->handleReturnEquipmentCheckout();\n\n case 'updateDeadlineText':\n $this->handleUpdateDeadlineText();\n\n case 'assignEquipmentFees':\n $this->handleAssignEquipmentFees();\n\n case 'payEquipmentFees':\n $this->handlePayEquipmentFees();\n\n case 'approveEquipmentFees':\n $this->handleApproveEquipmentFees();\n\n case 'rejectEquipmentFees':\n $this->handleRejectEquipmentFees();\n \n case 'equipmentModalHandout':\n $this->handleEquipmentModalHandout();\n\n \n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on project resource'));\n }\n }",
"protected function getOroCalendar_CalendarEvent_Form_Handler_ApiService()\n {\n if (!isset($this->scopedServices['request'])) {\n throw new InactiveScopeException('oro_calendar.calendar_event.form.handler.api', 'request');\n }\n\n return $this->services['oro_calendar.calendar_event.form.handler.api'] = $this->scopedServices['request']['oro_calendar.calendar_event.form.handler.api'] = new \\Oro\\Bundle\\CalendarBundle\\Form\\Handler\\CalendarEventHandler($this->get('oro_calendar.calendar_event.form.api'), $this->get('request'), $this->get('doctrine.orm.default_entity_manager'));\n }",
"public function handle_api_requests()\n {\n }",
"public function processRequest(Request $request) {\n\t\t$this->request = $request;\n\n\t\t$this->lastOperationResult = NULL;\n\t\t$this->lastCatchedException = NULL;\n\n\t\t$settings = $this->configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);\n\t\t$serverOptions = array('soap_version' => SOAP_1_2, 'encoding' => 'UTF-8');\n\t\t$soapServer = new \\SoapServer((string)$request->getWsdlUri(), $serverOptions);\n\t\t$serviceObject = $this->objectManager->get($request->getServiceObjectName());\n\t\t$serviceWrapper = $this->objectManager->get('TYPO3\\CMS\\Soap\\ServiceWrapper', $serviceObject);\n\t\t$serviceWrapper->injectSettings($settings);\n\t\t$serviceWrapper->setRequest($request);\n\t\t$soapServer->setObject($serviceWrapper);\n\n\t\t$soapServer->handle($request->getBody());\n\t\tif ($serviceWrapper->getCatchedException() !== NULL) {\n\t\t\t$this->lastCatchedException = $serviceWrapper->getCatchedException();\n\t\t\tthrow $serviceWrapper->getCatchedException();\n\t\t}\n\n\t\t$this->lastOperationResult = $serviceWrapper->getLastOperationResult();\n\t}",
"public function process(RequestInterface $request, RequestHandlerInterface $handler): ResponseInterface;",
"abstract public function handleRequest();",
"public function processRequest()\n\t{\n\t\tif (empty($this->input)) {\n\t\t\ttrigger_error(\"No request input to process\", E_USER_NOTICE);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Create a new request object if needed or forced\n\t\tif (empty($this->request) || $this->persist === false) {\n\t\t\n\t\t\tif ($this->debug) {\n\t\t\t\tcecho(\"Client ({$this->ID}) ... processing request\\n\");\n\t\t\t\tcecho(chrule().\"\\n\");\n\t\t\t\tcecho($this->input);\n\t\t\t\tcecho(\"\\n\\n\".chrule().\"\\n\");\n\t\t\t}\n\n\t\t\t// Initialize the new request object\n\t\t\tif (!$this->startRequest()) {return false;}\n\n\t\t\t// Create an access logger for the request\n\t\t\t$this->logger = MHTTPD_Logger::factory('access')->addRequest($this->request);\n\t\t\t\n\t\t} else {\n\n\t\t\t// Re-use the current request object\n\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... re-processing request\\n\");}\n\t\t\t$this->reprocessing = true;\n\t\t}\n\n\t\t// Check if the header block is a valid size\n\t\tif (strlen($this->input) > MHTTPD_Message::getMaxHeaderBlockSize()) {\n\t\t\t$this->sendError(413, 'The request header block is larger than: '\n\t\t\t\t.MHTTPD_Message::getMaxHeaderBlockSize().' bytes'\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Get a new queue of loaded request handlers\n\t\t$handlers = MHTTPD::getHandlersQueue();\n\n\t\t// Call each request handler in the configured order\n\t\twhile ($handlers->valid()) {\n\t\t\t\n\t\t\t// Force reauthorizaton of the request?\n\t\t\tif ($this->reauthorize) {\n\t\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... reauthorization needed\\n\");}\t\t\n\t\t\t\t$handlers->requeue('auth');\n\t\t\t}\n\t\t\t\n\t\t\t// Get the handler info\n\t\t\t$handler = $handlers->current();\n\t\t\t$type = $handlers->key();\n\t\t\t\n\t\t\t// Skip handlers marked for single use\n\t\t\tif ($this->reprocessing && $handler->useOnce() && !$this->reauthorize) {\n\t\t\t\t$handlers->next();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// Initialize the handler\n\t\t\t$this->handler = array('type' => $type);\n\t\t\t$handler->init($this);\n\t\t\t$handler->debug = $this->debug;\n\t\t\t\n\t\t\t// Set the persistence of the current request object\n\t\t\t$this->persist = $handler->persist();\n\t\t\t\n\t\t\t// Does the current handler match the request?\n\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... trying handler: $type\\n\");}\n\t\t\tif (!$handler->matches()) {$handlers->next(); continue;}\n\t\t\t$handler->addCount('match');\n\t\t\t\n\t\t\t// Try to execute the matching handler\n\t\t\tif ($handler->execute()) {\n\t\t\t\t\t\n\t\t\t\t$handler->addCount('success');\n\t\t\t\t\n\t\t\t\t// Should handler processing stop here?\n\t\t\t\tif ($handler->isFinal()) {\n\t\t\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... handler finished, is final: $type\\n\");}\n\t\t\t\t\treturn $handler->getResult();\n\t\t\t\t}\n\n\t\t\t} elseif ($handler->skipped()) {\n\t\t\t\n\t\t\t\t// The handler has an error, but can be skipped\n\t\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... handler skipped ($type): {$handler->getError()}\\n\");}\n\t\t\t\t$handler->addCount('error');\n\n\t\t\t} else {\n\t\t\t\n\t\t\t\t// The handler has a non-recoverable error, stop processing here\n\t\t\t\tif ($this->debug) {cecho(\"Client ({$this->ID}) ... handler ($type) failed: {$handler->getError()}\\n\");}\n\t\t\t\tif (!$this->hasResponse()) {\n\t\t\t\t\t$this->sendError(500, \"Request handler ($type) failed, can't be skipped (Error: {$handler->getError()})\");\n\t\t\t\t}\n\t\t\t\t$handler->addCount('error');\n\t\t\t\treturn $handler->getResult();\n\t\t\t}\n\t\t\t\n\t\t\t// Call the next handler\n\t\t\t$handlers->next();\n\t\t}\n\n\t\t// No handler matches, so send an internal server error\n\t\t$this->sendError(500, 'No handler is available to process this request.');\n\t\treturn false;\t\t\t\t\n\t}",
"public function handle_rest_api_requests()\n {\n }",
"public function processAPI() {\n if (method_exists($this, $this->endpoint)) {\n return $this->_response($this->{$this->endpoint}($this->args));\n }\n\n return $this->_response(\"No Endpoint: $this->endpoint\", 404);\n }",
"public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404); // If the method not exist with in this class, response would be \"Page not found\".\n }",
"public function processRequest();",
"public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('Error code 404, Page not found',404); // If the method not exist with in this class, response would be \"Page not found\".\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts that a string does not match a given format string. | protected function assertStringNotMatchesFormat($format, $string, $message = '') {
return self::fail('@TODO: assertStringNotMatchesFormat compatibility method is not implemented. ' . $message);
} | [
"final public static function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void\n {\n static::assertThat(\n $string,\n new LogicalNot(\n new StringMatchesFormatDescription($format),\n ),\n $message,\n );\n }",
"function assertStringNotMatchesFormat($format, $string, $message = '')\n{\n return call_user_func_array(\n 'PHPUnit_Framework_Assert::assertStringNotMatchesFormat',\n func_get_args()\n );\n}",
"public function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = \"\") {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringNotMatchesFormatFile', func_get_args()));\n }",
"protected function assertStringNotMatchesFormatFile($formatFile, $string, $message = '') {\n\t\treturn self::fail('@TODO: assertStringNotMatchesFormatFile compatibility method is not implemented. ' . $message);\n\t}",
"static function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function assertStringNotMatchesFormatFile($formatFile, $string, $message = \"\") {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringNotMatchesFormatFile', func_get_args()));\n }",
"public function testAssertStringNotContainsString() {\n\t\tself::assertStringNotContainsString( 'Foo', 'foobar' );\n\t}",
"public function testInvalidStrings(): void\n {\n $values = [\n 'alwayz',\n '_hourly',\n 'Daily',\n 'wEekly',\n 'mönthly ',\n ' yearly ',\n 'never ',\n 'rofl',\n 'yesterday',\n ];\n\n foreach ($values as $value) {\n $this->assertFalse($this->validator->isValid($value));\n $messages = $this->validator->getMessages();\n $this->assertStringContainsString('is not a valid', current($messages));\n }\n }",
"public function testStringInvalid($value) {\n\t\tPreconditions::requireString($value, '$value');\n\t}",
"public static function assertIsNotString($actual, string $message = ''): \\void {}",
"public function testAssertIsNotString() {\n\t\t$this->assertIsNotString( false );\n\t}",
"public function testNotString()\n {\n $values = array(\n 1, 1.4, null, new stdClass(), true, false\n );\n\n foreach ($values as $value) {\n $this->assertSame(false, $this->_validator->isValid($value));\n }\n }",
"final public static function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = ''): void\n {\n static::assertThat(\n $string,\n new LogicalNot(\n new RegularExpression($pattern),\n ),\n $message,\n );\n }",
"public function testNotStrings(): void\n {\n $values = [\n 1,\n 1.4,\n null,\n new stdClass(),\n true,\n false,\n ];\n\n foreach ($values as $value) {\n $this->assertFalse($this->validator->isValid($value));\n $messages = $this->validator->getMessages();\n $this->assertStringContainsString('String expected', current($messages));\n }\n }",
"public static function assertDoesNotMatchRegularExpression( $pattern, $string, $message = '' ) {\n\t\tstatic::assertNotRegExp( $pattern, $string, $message );\n\t}",
"public static function assertIsNotString( $actual, $message = '' ) {\n\t\tstatic::assertNotInternalType( 'string', $actual, $message );\n\t}",
"public function testInvalid(): void\n {\n $validator = new RegexValidator('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i');\n $result = $validator->validate('foo-bar-baz');\n\n $this->assertFalse($result->isValid());\n }",
"public function testStringIsNotJson(): void\n {\n $value = 'something';\n\n $this->assertFalse(Str::isJsonFormatted($value));\n }",
"protected function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '')\n {\n TestCase::assertDoesNotMatchRegularExpression($pattern, $string, $message);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a list of the firstname element values, but stop after the first one. | public function testFetchFirstnameStop () {
$inputFile = __DIR__ ."/data/simpleTest1.xml";
$reader = new XMLReaderReg();
$reader->open($inputFile);
$firstName = [];
$reader->process([
'(.*/firstname)' => function ($data) use (&$firstName, $reader): void {
$firstName[] = $data;
$reader->flagToStop();
}
]);
$reader->close();
$this->assertEquals ($firstName, ["John"]);
} | [
"public function getFirstNames() {\n\t\treturn empty( $this->container['first_names'] ) ? null : $this->container['first_names'];\n\t}",
"public function getFirstname()\n {\n return $this->getGivenNames();\n }",
"public function getFirstNameUsers()\n {\n return $this->firstNameUsers;\n }",
"public function getFirstName()\n {\n $breadcrumbs = $this->getNames();\n return array_shift($breadcrumbs);\n }",
"public function getFirstname() {\n return $this->getValue('firstname');\n }",
"public function firstName() {\n $parser = $this->init();\n $email = $parser->getMessageBody('html');\n $nameString = strstr($email, 'firstName');\n $infoArr = explode('=', $nameString);\n $firstName = explode('&', $infoArr[1]);\n\n return [\n '#type' => 'markup',\n '#markup' => $this->t($firstName[0]),\n ];\n }",
"public function extractFirstList(): array\n {\n $result = [];\n\n for ($i = 0; $i < $this->size; $i++) {\n $result[] = $this->firstElements[$i];\n }\n\n return $result;\n }",
"public function getInitials()\n\t{\n\t\t$first = strtoupper(substr($this->first_name, 0, 1));\n\t\t$last = strtoupper(substr($this->last_name, 0, 1));\n\n\t\treturn $first . $last;\n\t}",
"public function getFirstAndLastNameFromEmail()\n {\n $exploded_full_name = explode(' ', str_replace(['.', '-', '_'], [' ', ' ', ' '], substr($this->getEmail(), 0, strpos($this->getEmail(), '@'))));\n\n if (count($exploded_full_name) === 1) {\n $first_name = mb_strtoupper(mb_substr($exploded_full_name[0], 0, 1)) . mb_substr($exploded_full_name[0], 1);\n $last_name = '';\n } else {\n $full_name = [];\n\n foreach ($exploded_full_name as $k) {\n $full_name[] = mb_strtoupper(mb_substr($k, 0, 1)) . mb_substr($k, 1);\n }\n\n $first_name = array_shift($full_name);\n $last_name = implode(' ', $full_name);\n }\n\n return [$first_name, $last_name];\n }",
"public function first_name()\n\t{\n\t\tif ( $this->name_parser->getName() !== $this->profile->name ) \n\t\t{\n\t\t\t$this->name_parser->setName($this->profile->name);\n\t\t}\n\t\treturn($this->name_parser->getFirst());\n\t}",
"function Names_get_surnames()\n{\n global $g_table_prefix;\n\n // first name\n $query = mysql_query(\"\n SELECT surname\n FROM {$g_table_prefix}surnames\n \");\n\n $names = array();\n while ($name = mysql_fetch_assoc($query))\n $names[] = $name['surname'];\n\n return $names;\n}",
"static function retrieveByFirstName($value) {\n\t\treturn Guest::retrieveByColumn('first_name', $value);\n\t}",
"public function getFirstName()\n {\n //Parse the name and set it\n $namePieces = preg_split(\"/\\s/\", $this->name);\n return $namePieces[0];\n }",
"function getFirstname()\n\t{\n\t\t$this->uid = $this->getUser();\n\t\t$ret = self::getAttribute($this->uid, 'givenname');\n\t\treturn $ret[0];\n\t}",
"function getInitials($firstname)\r\n\t{\r\n\t\t$initials = '';\r\n\t\t$name = explode(' ', $firstname);\r\n\t\tforeach ($name as $part)\r\n\t\t{\r\n\t\t\t$size = utf8_strlen($part);\r\n\t\t\tif (($part{($size-1)} == \".\") && ($size < 4))\r\n\t\t\t\t$initials .= $part;\r\n\t\t\telseif (preg_match(\"/([A-Z])/\", $part, $firstChar))\r\n\t\t\t\t$initials .= $firstChar[0].\". \";\r\n\t\t}\r\n\t\treturn utf8_trim($initials);\r\n\t}",
"public function getFromFirstname(): string\n {\n if ($firstname = $this->getConfigValue(self::XML_PATH_FROM_FIRSTNAME)) {\n return $firstname;\n } else {\n return '';\n }\n }",
"public function getFirstname() {\n $firstname = $this->userdetails['firstname'];\n return $firstname;\n }",
"public function getInitials()\n {\n return strtoupper(substr($this->getFirstname(), 0, 1) . substr($this->getLastname(), 0, 1));\n }",
"function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo InsertarPerfilesCompartidos> ingresa en la tabla permisos_item los perfiles que tienen un determinado item compartido utiliza el metodo insertar de esta misma clase | public function insertarPerfilesCompartidos($datosVisibilidad, $idModulo, $idItem, $datosPerfiles) {
if ($datosVisibilidad == "privado") {//verifico si el item es privado, en caso de serlo ingreso los perfiles con los cuales se debe compartir
foreach ($datosPerfiles as $idPerfil => $valor) {
//$sql->depurar = true;
$this->insertar($idPerfil, $idModulo, $idItem);
}//fin del foreach
} else {//si viene publico se comparte con el perfil 99
$idPerfil = 99;
//$sql->depurar = true;
$this->insertar($idPerfil, $idModulo, $idItem);
}//fin del if
return true;
} | [
"function asignarAccesoPerfiles($perfiles){\n\t\t\n\t\t\t$insert=\"insert into s_metodos_perfiles values \";\n\t\t\t$i=0;\n\t\t\tforeach ($perfiles as $key => $idPerfil) {\n\t\t\t\tif($i>0)$insert.=\",\";\n\t\t\t\t$insert.=\"(null,$this->id_metodo,$idPerfil)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$delete = \"delete from s_metodos_perfiles where id_metodo=$this->id_metodo\";\n\t\t\t$this->bd->ejecutarQuery($delete);\n\t\t\t$this->bd->ejecutarQuery($insert);\n\t\t\treturn array('ejecutado'=>1);\n\t}",
"function asociarPerfiles ($perfiles) {\n\n $insert = \"insert into s_usuarios_perfiles (id_usuario_perfil, id_usuario, id_perfil) values \";\n $i = 0;\n foreach ($perfiles as $key => $idPerfil) {\n\n if ($i > 0)\n $insert .= \",\";\n\n $insert .= \"(null,$this->id_usuario,$idPerfil)\";\n $i++;\n }\n\n $delete = \"delete from s_usuarios_perfiles where id_usuario=$this->id_usuario;\";\n\n $this->bd->ejecutarQuery($delete . $insert, 2);\n\n return ['ejecutado' => 1];\n }",
"public function modificarPerfilesCompartidosPA($datosVisibilidad, $idModulo, $idItem, $datosPerfiles) {\n\n\n if ($datosVisibilidad == \"privado\") {//verifico si el item es privado, en caso de serlo ingreso los perfiles con los cuales se debe compartir\n //$sql->depurar = true;\n if (!($this->eliminarPA($idItem, $idModulo))) {\n return false;\n } else {\n foreach ($datosPerfiles as $idPerfil => $valor) {\n //$sql->depurar = true;\n $this->insertarPA($idPerfil, $idModulo, $idItem);\n }//fin del foreach\n }\n } else {//si viene publico se comparte con el perfil 99 y solo se ingresa un registro a la BD\n $idPerfil = 99;\n\n //primero elimino todos los permisos que hayan para determinado item en la tabla\n //permisos item\n if (!($this->eliminarPA($idItem, $idModulo))) {\n return false;\n } else {\n //luego inserto los nuevos permisos\n $this->insertarPA($idPerfil, $idModulo, $idItem);\n }\n }//fin del if datosVisibilidad = privado\n\n return true;\n }",
"public function insertarPA($idPerfil, $idModulo, $idItem) {\n global $sql, $configuracion;\n\n\n $datos = array(\n \"id_modulo\" => $idModulo,\n \"id_item\" => $idItem,\n \"id_perfil\" => $idPerfil\n );\n\n $sql->guardarBitacora = false;\n $consulta = $sql->insertar(\"permisos_adicion_item\", $datos);\n\n\n if ($consulta) {\n\n return $sql->ultimoId;\n } else {\n\n return NULL;\n }//fin del if\n }",
"function opcion__compilar_perfiles()\n {\n $param = $this->get_parametros();\n $id = isset($param[\"-p\"]) ? $param[\"-p\"] : $this->get_id_proyecto_actual(true);\n\n try {\n $proyecto = $this->get_proyecto($id);\n $path = $proyecto->get_dir_generales_compilados();\n if (!\\file_exists($path) || !\\is_writable($path)) {\n $this->consola->error('ATENCION!!: Considere ejecutar el comando compilar para abarcar todos los metadatos'. PHP_EOL);\n throw new toba_error('No existe o no es accesible la carpeta de metadatos compilados!!'. PHP_EOL);\n }\n toba_manejador_archivos::crear_arbol_directorios($path);\n $proyecto->compilar_metadatos_generales_grupos_acceso(true);\n } catch ( toba_error $e ) {\n\t\t$this->consola->error( \"PROYECTO $id: Ha ocurrido un error durante la compilacion:\\n\".$e->getMessage());\n exit(-1);\n }\n }",
"public function adicionarItemDeProcesso($iCodprocItem, $oItemAcordo = null) {\n\n $oDaoLiclicitem = db_utils::getDao(\"pcprocitem\");\n $sSqlDadosItem = $oDaoLiclicitem->sql_query_soljulg($iCodprocItem);\n $rsDadosItem = $oDaoLiclicitem->sql_record($sSqlDadosItem);\n if (!$rsDadosItem) {\n throw new DBException(\"Erro ao pesquisar os dados do itens do processo de compras\");\n }\n if ($oDaoLiclicitem->numrows == 1) {\n\n $oItemLicitacao = db_utils::fieldsMemory($rsDadosItem, 0);\n $oItem = new AcordoItem();\n $oItem->setCodigoPosicao($this->getCodigo());\n $oItem->setMaterial(new MaterialCompras($oItemLicitacao->pc01_codmater));\n $oItem->setElemento($oItemLicitacao->pc18_codele);\n $oItem->setQuantidade($oItemLicitacao->pc23_quant);\n $oItem->setUnidade($oItemLicitacao->pc17_unid);\n\n if ($oItemLicitacao->pc17_unid == '') {\n $oItem->setUnidade(1);\n }\n\n $oItem->setValorUnitario($oItemLicitacao->pc23_vlrun);\n $oItem->setOrigem($oItemLicitacao->pc81_codprocitem, 1);\n $oItem->setValorTotal($oItemLicitacao->pc23_quant*$oItemLicitacao->pc23_vlrun);\n $oItem->setResumo($oItemLicitacao->pc11_resum);\n\n /**\n * pesquisamos as dotacoes do item\n */\n $oDaoDotacoesItem = db_utils::getDao(\"pcdotac\");\n $sSqlDotacoes = $oDaoDotacoesItem->sql_query_dotreserva($oItemLicitacao->pc11_codigo,\n null,\n null,\n \"pcdotac.*, orcreserva.*\");\n $rsDotacoes = db_query($sSqlDotacoes);\n if (!$rsDotacoes) {\n throw new DBException(\"Erro ao pesquisar as dotações do itens {$iCodprocItem} do processo de compras\");\n }\n\n $aDotacoes = db_utils::getCollectionByRecord($rsDotacoes);\n foreach ($aDotacoes as $oDotacaoItem) {\n\n\n $oDotacao = new stdClass();\n $nDiferenca = 0;\n if ($oDotacaoItem->o80_valor > 0) {\n $nDiferenca = (($oDotacaoItem->pc13_valor / ($oItemLicitacao->pc11_vlrun * $oItemLicitacao->pc11_quant)) * $oItem->getValorTotal()) - $oDotacaoItem->o80_valor;\n }\n $oDotacao->valor = $oDotacaoItem->pc13_valor+($nDiferenca);\n $oDotacao->ano = $oDotacaoItem->pc13_anousu;\n $oDotacao->dotacao = $oDotacaoItem->pc13_coddot;\n $oDotacao->quantidade = $oDotacaoItem->pc13_quant;\n $oItem->adicionarDotacoes($oDotacao);\n\n /**\n * Deletamos as reservas da solicitacao\n */\n if ($oDotacaoItem->o80_codres != '') {\n\n $oDaoOrcReservaSol = db_utils::getDao(\"orcreservasol\");\n $oDaoOrcReservaSol->excluir(null,\"o82_codres = {$oDotacaoItem->o80_codres}\");\n\n $oDaoOrcReserva = db_utils::getDao(\"orcreserva\");\n $oDaoOrcReserva->excluir($oDotacaoItem->o80_codres);\n }\n }\n\n $oItem->setTipoControle($oItemAcordo->iFormaControle);\n\n $aPeriodos = array();\n $oPeriodos = new stdClass();\n $oPeriodos->dtDataInicial = $oItemAcordo->dtInicial;\n $oPeriodos->dtDataFinal = $oItemAcordo->dtFinal;\n $oPeriodos->ac41_sequencial = '';\n $aPeriodos[] = $oPeriodos;\n\n $oItem->setPeriodos($aPeriodos);\n\n $oAcordo = new Acordo($this->iAcordo);\n\n $lPeriodoComercial = false;\n if ($oAcordo->getPeriodoComercial()) {\n $lPeriodoComercial = true;\n }\n\n $oItem->setPeriodosExecucao($this->iAcordo, $lPeriodoComercial);\n\n $oItem->setCodigoPosicao($this->getCodigo());\n $oItem->save();\n $this->adicionarItens($oItem);\n }\n }",
"function guardarNuevoItemMod2( $iditem, $idmod, $cantidad=0 )\n{\n global $BD;\n //consulta SQL que obtiene precio de un item\n $cons = 'SELECT * FROM con_item WHERE item_id = ' . $iditem ;\n $BD->query( $cons );\n $reg = $BD->getNext();\n $precio = $reg['precio_unit']; \n \n //codigo SQL para insertar registro en la base de datos\n $cons = \"INSERT INTO con_item_modulo ( modulo, item, cantidad, precio ) \"\n\t\t. \" VALUES ( {$idmod}, {$iditem}, {$cantidad}, $precio)\"; \n \n if ( $BD->query($cons) ) {\n //obtiene ID de ultimo registro ITEM_MODULO\n $sql = 'SELECT MAX(id_it_mod) AS id FROM con_item_modulo ' ; \n $BD->query( $sql ); \n $reg = $BD->getNext();\n $id_it_mod = $reg['id']; \n //Obtiene valores de \n $sql = \" SELECT precio , unidad FROM con_item_modulo INNER JOIN con_item ON item_id=item\n WHERE id_it_mod = $id_it_mod\" ; \n $BD->query( $sql ); \n $reg = $BD->getNext();\n $unidad = $reg['unidad']; \n $precio = $reg['precio']; \n //Codigo sql para inserta registro en avance de obra \n $sql = \"INSERT INTO con_avance_fisico ( unidad , programado , ejecutado , precio , idim ) \"\n\t\t. \" VALUES ( '{$unidad}', 0 , 0, $precio , {$id_it_mod})\"; \n $BD->query( $sql ); \n $sql = \"INSERT INTO con_avance_financiero ( programado , ejecutado , saldo , idim ) \"\n\t\t. \" VALUES ( 0 , 0, 0 , {$id_it_mod})\"; \n $BD->query( $sql ); \n \n\tregistrarMensaje(\"Se ha añadido el item al módulo correctamente.\");\n } else {\n \tregistrarError(\"No se ha podido registrar el item:<br />{$BD->error}\");\n } \n}",
"function insertar_recibidos($nro_orden,$items,$id_proveedor)\r\n{global $db,$_ses_user;\r\n $items_nuevos=array();\r\n $db->StartTrans();\r\n $tam_items=sizeof($items);\r\n\r\n\r\n for($i=0;$i<$tam_items;$i++)\r\n {\r\n\r\n $cant=$items[$i]['cantidad'];\r\n if($cant==\"\")\r\n $cant=0;\r\n else\r\n {\r\n $id_fila=$items[$i]['id_fila'];\r\n $id_deposito=$items[$i]['id_deposito'];\r\n $observaciones=$items[$i]['observaciones'];\r\n $items_nuevos[$i]['cantidad']=$cant;\r\n\r\n //controlamos cuantos recibidos y entregados tiene esta fila. Solo se hace la reserva\r\n //si hay mas recibidos que entregados, o hay igual numero de ambos.\r\n $query=\"select sum (cantidad)as cantidad,id_recibido,ent_rec,id_deposito\r\n from recibidos where id_fila=$id_fila\r\n group by id_recibido,ent_rec,id_deposito\r\n order by ent_rec desc\";\r\n $datos_ent_rec=sql($query ,\"<br>Error al traer ent_rec (insertar_recibidos) de la fila $id_fila\") or fin_pagina();\r\n\r\n //esto supone que solo se puede recibir o entregar en un mismo Stock\r\n $entregas=$recepciones=0;\r\n while(!$datos_ent_rec->EOF)\r\n {\r\n if($datos_ent_rec->fields[\"ent_rec\"]==0)\r\n $entregas+=$datos_ent_rec->fields[\"cantidad\"];\r\n elseif ($datos_ent_rec->fields[\"ent_rec\"]==1)\r\n $recepciones+=$datos_ent_rec->fields[\"cantidad\"];\r\n else\r\n die(\"Error interno: la entrada de recepcion no tiene valor en ent_rec\");\r\n\r\n $datos_ent_rec->MoveNext();\r\n }\r\n\r\n if($items[$i]['id_recibido']==\"\")\r\n {//insert\r\n $query=\"select nextval('recibidos_id_recibido_seq') as id_recibido\";\r\n $id_rec=$db->Execute($query) or die($db->ErrorMsg().\"<br>Error al traer la secuencia del recibido\");\r\n $items_nuevos[$i]['id_recibido']=$id_rec->fields['id_recibido'];\r\n $query=\"insert into recibidos(id_recibido,id_fila,id_deposito,cantidad,observaciones,ent_rec)\r\n values(\".$id_rec->fields['id_recibido'].\",$id_fila,$id_deposito,$cant,$observaciones,1)\";\r\n }\r\n else\r\n {//update\r\n $query=\"update recibidos set observaciones=$observaciones,cantidad=cantidad+$cant\r\n where id_recibido=\".$items[$i]['id_recibido'];\r\n $items_nuevos[$i]['id_recibido']=$items[$i]['id_recibido'];\r\n }\r\n sql($query,\"<br>Error al insertar/actualizar los recibidos de \".$items_nuevos[$i]['id_recibido'].\"<br>\") or fin_pagina();\r\n\r\n /**********************************************************************************\r\n Hacemos la reserva de los productos recibidos, poninendo en cada caso para que se\r\n reservan esos productos, solo en el caso de que la OC este asociada a Licitacion,\r\n Presupuesto, Sev Tec o RMA.\r\n\r\n Se reservan solo si la cantidad de recibidos es mayor que la de entregados, y\r\n en ese caso la cantidad que se reserva es recibidos-entregados\r\n ***********************************************************************************/\r\n //vemos el tipo de la OC\r\n $query=\"select id_licitacion,es_presupuesto,nrocaso,orden_prod from orden_de_compra\r\n where nro_orden=$nro_orden\";\r\n $tipo_oc=sql($query,\"<br>Error al consultar el tipo de la OC(insertar_recibidos)<br>\") or fin_pagina();\r\n\r\n if($tipo_oc->fields[\"id_licitacion\"]!=\"\" && $tipo_oc->fields[\"es_presupuesto\"]!=1)\r\n {$tipo_reserva=\"la Licitación \".$tipo_oc->fields[\"id_licitacion\"];\r\n $clave_id=\"Licitación\";\r\n }\r\n elseif($tipo_oc->fields[\"id_licitacion\"]!=\"\" && $tipo_oc->fields[\"es_presupuesto\"]==1)\r\n {$tipo_reserva=\"el Presupuesto \".$tipo_oc->fields[\"id_licitacion\"];\r\n $clave_id=\"Presupuesto\";\r\n }\r\n elseif($tipo_oc->fields[\"nrocaso\"]!=\"\")\r\n {$tipo_reserva=\"el C.A.S. de Servicio Técnico Nº \".$tipo_oc->fields[\"nrocaso\"];\r\n $clave_id=\"C.A.S.\";\r\n }\r\n elseif($tipo_oc->fields[\"orden_prod\"]!=\"\")\r\n {$tipo_reserva=\"el RMA con Orden de Producción Nº \".$tipo_oc->fields[\"orden_prod\"];\r\n $clave_id=\"RMA\";\r\n }\r\n else\r\n $tipo_reserva=\"\";\r\n\r\n if(($recepciones-$entregas)<0)\r\n $cant=$recepciones+$cant-$entregas;\r\n //$cant=$cant-$entregas;\r\n //echo\"<br>$recepciones - $entregas<br>\";\r\n //die(\"la cantidad es $cant\");\r\n\r\n if($tipo_reserva!=\"\" && $cant>0)\r\n {$fecha_modif=date(\"Y-m-d H:i:s\",mktime());\r\n\r\n $obs=\"Productos recibidos para $tipo_reserva mediante la OC Nº $nro_orden\";\r\n //traemos el id de producto para la fila $id_fila\r\n $query=\"select id_producto,precio_unitario from fila where id_fila=$id_fila\";\r\n $prod_id=sql($query,\"<br>Error al traer el id del producto de la fila (incertar_recibidos)<br>\");\r\n $precio=$prod_id->fields[\"precio_unitario\"];\r\n\r\n //dependiendo de si hay cambios de productos o no, es el id_producto que usamos. Si la funcion devuelve -1, usamos\r\n //el id de producto original, guardado en la fila. Sino, usamos aquel que devuelve la funcion.\r\n $id_aux_prod=ultimo_cambio_producto($id_fila);\r\n if($id_aux_prod==-1)\r\n $id_prod=$prod_id->fields[\"id_producto\"];\r\n else\r\n $id_prod=$id_aux_prod;\r\n\r\n //obtenemos el id_reservado para este producto, si existe\r\n $query=\"select id_reservado from reservados\r\n where id_producto=$id_prod and id_proveedor=$id_proveedor and id_deposito=$id_deposito\";\r\n $reser=sql($query,\"<br>Error al traer el id de reservado\") or fin_pagina();\r\n $id_reservado=$reser->fields[\"id_reservado\"];\r\n\r\n if($id_reservado)//si hay id_reservado, actualizamos la entrada de ese reservado\r\n {$reserva=\"update reservados set\r\n \t cantidad_total_reservada=cantidad_total_reservada+$cant\r\n \t where\r\n \t id_reservado=$id_reservado\";\r\n }\r\n else //sino insetamos dicha entrada\r\n {//en este caso revisamos la tabla stock para ver si la correspondiente entrada esta\r\n //cargada en esa tabla, sino la insertamos.\r\n $query=\"select id_deposito,id_producto,id_proveedor from stock\r\n where id_producto=$id_prod and id_proveedor=$id_proveedor and id_deposito=$id_deposito\";\r\n $cargado_stock=sql($query,\"<br>Error al tarer datos de stock (insertar_recibidos)<br>\") or fin_pagina();\r\n if($cargado_stock->RecordCount()==0)\r\n {//si no esta cargada la entrada correspondiente en ese stock, lo cargamos\r\n $fecha_modif=date(\"Y-m-d H:i:s\",mktime());\r\n $sql=\"insert into stock(id_producto,id_deposito,id_proveedor,cant_disp,comentario,last_user,last_modif)\r\n \t values($id_prod,$id_deposito,$id_proveedor,0,'$obs','\".$_ses_user['login'].\"','$fecha_modif')\";\r\n }\r\n else\r\n {\r\n $sql=\"update stock set \";\r\n\t $sql.=\" comentario='$obs' \";\r\n\t $sql.=\" where \";\r\n\t $sql.=\"id_producto=$id_prod \";\r\n\t $sql.=\" AND id_deposito=$id_deposito \";\r\n\t $sql.=\" AND id_proveedor=$id_proveedor\";\r\n }\r\n //primero busco si tiene precio ese producto\r\n //con ese proveedor\r\n\t $sql_precios=\" select id_producto from precios\r\n\t where id_producto=$id_prod and id_proveedor=$id_proveedor \";\r\n\t $result=sql($sql_precios,\"<br>Error al buscar precios del producto/proveedor<br>\") or fin_pagina();\r\n\t $cant_precios=$result->recordcount();\r\n\t if ($cant_precios==0)\r\n\t insertar_precio($id_prod,$id_proveedor,$precio);\r\n\r\n\t sql($sql,\"<br>Error al insertar/actualizar en stock (insertar_recibidos)<br>$sql\") or fin_pagina();\r\n\r\n\t $query=\"select nextval('reservados_id_reservado_seq') as id_reservado\";\r\n\t $id_res=sql($query,\"<br>Error al tarer secuencia de reservado(insertar_recibidos)<br>\") or fin_pagina();\r\n\t $id_reservado=$id_res->fields[\"id_reservado\"];\r\n\t $reserva=\"insert into reservados(id_reservado,id_producto,id_deposito,id_proveedor,cantidad_total_reservada)\r\n \t values($id_reservado,$id_prod,$id_deposito,$id_proveedor,$cant)\";\r\n }//del else de if($id_reservado)\r\n\r\n //insertamos o acutalizamos la entrada de la tabla reservados\r\n sql($reserva,\"<br>Error al insertar/actualizar reservados (insertar_recibidos)<br>\") or fin_pagina();\r\n\r\n //insertamos o actualizamos el detalle de reserva\r\n \t $query=\"select id_detalle_reserva from detalle_reserva where id_fila=$id_fila and id_reservado=$id_reservado\";\r\n \t $det_res=sql($query,\"<br>Error al traer detalle de la reserva (insertar_recibidos)\");\r\n\r\n\t //si no hay ningun detalle de reserva, lo insertamos, sino lo acualizamos\r\n\t if($det_res->fields[\"id_detalle_reserva\"]==\"\")\r\n \t { //traemos el id del tipo de reserva, para poder insertarlo\r\n\t $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo ilike '%$clave_id%'\";\r\n\t $tipo_reserv=sql($query,\"<br>Error al traer el id del tipo de reserva(insertar_recibidos)<br>\") or fin_pagina();\r\n $id_tipo_reserva=$tipo_reserv->fields[\"id_tipo_reserva\"];\r\n\r\n\t\t//insertamos el detalle de reserva\r\n\t $query=\"insert into detalle_reserva (id_reservado,id_fila,cantidad_reservada,fecha_reserva,usuario_reserva,id_tipo_reserva)\r\n\t values ($id_reservado,$id_fila,$cant,'$fecha_modif','\".$_ses_user['name'].\"',$id_tipo_reserva)\";\r\n\t }\r\n\t else\r\n\t { $query=\"update detalle_reserva set cantidad_reservada=cantidad_reservada+$cant\r\n\t where id_fila=$id_fila and id_reservado=$id_reservado\";\r\n\t }\r\n//A VECES NO GUARDA EL DETALLE DE RESERVA (CUANDO GUARDO PARA UN STOCK SI ANTES SE HABIA RECIBIDO EM OTRO)\r\n\t sql($query,\"<br>Error al insertar/actualizar detalle de reserva(insertar_recibidos)<bR>\") or fin_pagina();\r\n\r\n\t //registramos en el historial el incremento del stock reservado\r\n $query=\"select nextval('control_stock_id_control_stock_seq') as id_control_stock\";\r\n $id_control_stock=sql($query,\"<br>Error al traer la secuencia de control de stock (insertar_recibidos)<br>\") or fin_pagina();\r\n\r\n $query=\"insert into control_stock(id_control_stock,fecha_modif,usuario,comentario,estado)\r\n values(\".$id_control_stock->fields['id_control_stock'].\",'$fecha_modif','OC Nº $nro_orden','$obs','oc_rec')\";\r\n\t sql($query,\"<br>Error al insertar en control_stock(insertar_recibidos)<br>\") or fin_pagina();\r\n\r\n\t $query=\"insert into descuento (id_deposito,id_producto,id_proveedor,id_control_stock,cant_desc)\r\n\t values($id_deposito,$id_prod,$id_proveedor,\".$id_control_stock->fields['id_control_stock'].\",$cant)\";\r\n\t sql($query,\"<br>Error al insertar en descuento(insertar_recibidos)<br>\") or fin_pagina();\r\n\r\n\t $query=\"insert into log_stock(id_control_stock,usuario,fecha,tipo)\r\n\t values (\".$id_control_stock->fields['id_control_stock'].\",'\".$_ses_user['name'].\"','$fecha_modif','$obs')\";\r\n\t sql($query,\"<br>Error al insertar en log_stock(insertar_recibidos)<br>\") or fin_pagina();\r\n }//de if($tipo_reserva!=\"\")\r\n }//del else de $cant==\"\"\r\n }//de for($i=0;$i<$tam_items;$i++)\r\n\r\n $db->CompleteTrans();\r\n return $items_nuevos;\r\n}",
"public function crearFromItem(Item $producto){\n $bodegas=Bodega::model()->findAll();\n if(is_array($bodegas)){\n foreach($bodegas as $key =>$value){\n $crit=self::setCriterio($producto->id,$value->id);\n $item_bodega=Itembodega::model()->find($crit);\n if($item_bodega==null){\n $relacion=new ItemBodega;\n $relacion->setScenario('ínsert');\n $relacion->idbodega=$value->id;\n $relacion->iditem=$producto->id;\n $relacion->stock=0;\n $relacion->stockcomprometido=0;\n $relacion->stockporllegar=0;\n $relacion->stockcomprometido=0;\n $relacion->idempresa=$this->empresa_id;\n $relacion->save();\n }\n }\n }\n }",
"public function inserir_item($p,$id_pedido){\n\t\t\n\t\tunset($this->fields);\n\t\tunset($this->values);\n\t\t$this->table = 'vsites_pedido_item';\n \n\t\t$data = date('Y-m-d H:m:s'); \n\t\t$servicosDAO = new ServicoDAO();\n\t\t$servicocampos = $servicosDAO->listaCamposSite($p->id_servico);\n\n\t\t#gera o numero da ordem\n\t\t$contaordem = $this->contaOrdens($id_pedido);\n\t\t$ordem = (int)($contaordem->total)+1;\n\t\t\n\t\t\n\t\t$this->fields = array();\n\t\t$this->values = array();\n\t\t$this->fields[]='controle_cliente';\n\t\t$this->fields[]='data_atividade';\n\t\t$this->fields[]='id_atividade';\n\t\t$this->fields[]='id_status';\n\t\t$this->fields[]='urgente';\n\t\t$this->fields[]='ordem';\n\t\t$this->fields[]='id_pedido';\n\t\t$this->fields[]='data';\n\t\t$this->fields[]='id_usuario';\n\t\t$this->fields[]='id_servico';\n\t\t$this->fields[]='valor';\n\t\t$this->fields[]='dias';\n\t\t$this->fields[]='obs';\n\t\t$this->fields[]='id_servico_var';\n\t\t$this->fields[]='id_servico_departamento';\n\t\t$this->fields[]='duplicidade';\n\t\t\n\t\t$this->values['controle_cliente']=$p->controle_cliente;\n\t\t$this->values['data_atividade']=$data;\n\t\t$this->values['id_atividade']='0';\n\t\t$this->values['id_status']='0';\n\t\t$this->values['urgente']=$p->urgente;\n\t\t$this->values['ordem']=$ordem;\n\t\t$this->values['id_pedido']=$id_pedido;\n\t\t$this->values['data']=$data;\n\t\t$this->values['id_usuario']=$p->id_usuario;\n\t\t$this->values['id_servico']=$p->id_servico;\n\t\t$this->values['valor']=$p->valor;\n\t\t$this->values['dias']=$p->dias;\n\t\t$this->values['obs']=$p->obs;\n\t\t$this->values['id_servico_var']=$p->id_servico_var;\n\t\t$this->values['id_servico_departamento']=$p->id_servico_departamento;\n\t\t$this->values['duplicidade']=$p->duplicidade;\n\n\t\tforeach($servicocampos as $servicocampo){\n\t\t\t$this->fields[]=$servicocampo->campo;\n\t\t\t$this->values[$servicocampo->campo]=$p->{$servicocampo->campo};\n\t\t}\n\t\t\n\t\t$id_pedido_item = $this->insert();\n\n\t\t$atividadeDAO = new AtividadeDAO();\n\t\t$atividade = $atividadeDAO->inserir('172','',$p->id_usuario,$id_pedido_item);\n\t\treturn $ordem;\n\t}",
"public static function guarda_solo_proforma_extra($temporada, $depto, $login, $proforma, $id_insertar)\r\n {\r\n\r\n $sql = \"UPDATE plc_plan_compra_color_3\r\n SET proforma = '\" . $proforma . \"',\r\n estado = 18\r\n WHERE cod_temporada = $temporada\r\n AND dep_depto = '\" . $depto . \"'\r\n AND id_color3 = $id_insertar\r\n \";\r\n\r\n // Almacenar TXT (Agregado antes del $data para hacer traza en el caso de haber error, considerar que si la ruta del archivo no existe el código no va pasar al $data)\r\n if (!file_exists('../archivos/log_querys/' . $login)) {\r\n mkdir('../archivos/log_querys/' . $login, 0775, true);\r\n }\r\n $stamp = date(\"Y-m-d_H-i-s\");\r\n $rand = rand(1, 999);\r\n $content = $sql;\r\n $fp = fopen(\"../archivos/log_querys/\" . $login . \"/GRILLA2-ACTSOLOPROFORMAEXTRA--\" . $login . \"-\" . $stamp . \" R\" . $rand . \".txt\", \"wb\");\r\n fwrite($fp, $content);\r\n fclose($fp);\r\n\r\n $data = \\database::getInstancia()->getConsulta($sql);\r\n //return $data;\r\n\r\n // Si puede actualizar ejecuto la otra consulta\r\n if ($data) {\r\n\r\n\r\n $sql = \"INSERT INTO plc_plan_compra_oc (cod_temporada,dep_depto,niv_jer1,cod_jer1,niv_jer2,cod_jer2,item,cod_sublin,cod_estilo,des_estilo,vent_emb,proforma,archivo,id_color3, estado_oc,estilo_pmm)\r\n SELECT\r\n C.COD_TEMPORADA,\r\n C.DEP_DEPTO,\r\n 0 NJ1,\r\n 0 CJ1,\r\n 0 NJ2,\r\n C.COD_JER2,\r\n 0 ITEM,\r\n C.COD_SUBLIN,\r\n 0 COD_ESTILO,\r\n C.DES_ESTILO,\r\n C.VENTANA_LLEGADA,\r\n '\" . $proforma . \"',\r\n 'Cargado..' ARCHIVO,\r\n C.ID_COLOR3,\r\n '' Estado_oc,\r\n '' estilo_pmm\r\n FROM PLC_PLAN_COMPRA_COLOR_3 C\r\n LEFT JOIN PLC_PLAN_COMPRA_OC O ON C.COD_TEMPORADA = O.COD_TEMPORADA\r\n AND C.DEP_DEPTO = O.DEP_DEPTO AND C.ID_COLOR3 = O.ID_COLOR3\r\n WHERE C.COD_TEMPORADA = $temporada AND C.DEP_DEPTO = '\" . $depto . \"'\r\n AND C.ID_COLOR3 IN ($id_insertar)\r\n \";\r\n\r\n // Almacenar TXT (Agregado antes del $data para hacer traza en el caso de haber error, considerar que si la ruta del archivo no existe el código no va pasar al $data)\r\n if (!file_exists('../archivos/log_querys/' . $login)) {\r\n mkdir('../archivos/log_querys/' . $login, 0775, true);\r\n }\r\n $stamp = date(\"Y-m-d_H-i-s\");\r\n $rand = rand(1, 999);\r\n $content = $sql;\r\n $fp = fopen(\"../archivos/log_querys/\" . $login . \"/GRILLA2-ACTSOLOPROFORMAEXTRAPLAN_COMPRA_OC_--\" . $login . \"-\" . $stamp . \" R\" . $rand . \".txt\", \"wb\");\r\n fwrite($fp, $content);\r\n fclose($fp);\r\n\r\n $data = \\database::getInstancia()->getConsulta($sql);\r\n //return $data;\r\n\r\n if ($data) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n\r\n\r\n } else {\r\n return 0;\r\n }\r\n\r\n }",
"private function insereListaApresentacao() {\n // Apaga caso já exista\n $listas = ListaCompra::where('consumidor_id', 3)->get();\n\n if($listas->count() > 0) {\n foreach($listas as $lista) {\n $compras = Compra::where('lista_compra_id', $lista->id)->get();\n\n foreach ($compras as $compra)\n $compra->delete();\n\n $lista->delete();\n }\n }\n\n // Insere lista\n $listaID = ListaCompra::create(\n [\n 'data_lista' => date('Y-m-d', strtotime('now')),\n 'consumidor_id' => 3,\n 'recomendada' => 1,\n 'confirmada' => 0\n ]\n )->id;\n\n // Insere 9 compras na lista\n $compras = [];\n $compras[] = ['quantidade' => 2, 'produtoID' => 2, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 3, 'produtoID' => 3, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 4, 'produtoID' => 4, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 2, 'produtoID' => 5, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 1, 'produtoID' => 6, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 8, 'produtoID' => 7, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 9, 'produtoID' => 8, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 5, 'produtoID' => 9, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 7, 'produtoID' => 10, 'listaID' => $listaID];\n\n foreach($compras as $compra) {\n Compra::create(\n [\n 'quantidade' => $compra['quantidade'],\n 'produto_id' => $compra['produtoID'],\n 'lista_compra_id' => $compra['listaID']\n ]\n )->save();\n }\n }",
"public function addPartesPessoa(array $partePessoa, array $dataDocumento, array $dataProcesso){\n \n $userNs = new Zend_Session_Namespace('userNs');\n \n foreach($partePessoa as $dados){ \n $value = explode(\"-\",$dados);\n $dataParteProcDoc = array( \"PAPD_ID_DOCUMENTO\" => $dataDocumento['DOCM_ID_DOCUMENTO'],\n \"PAPD_CD_MATRICULA_INCLUSAO\" => $userNs->matricula,\n \"PAPD_ID_TP_PARTE\" => $value[2], // 1-parte, 3-vista\n \"PAPD_ID_PROCESSO_DIGITAL\" => $dataProcesso['PRDI_ID_PROCESSO_DIGITAL'],\n \"PAPD_CD_MATRICULA_INTERESSADO\" => $value[0],\n \"PAPD_DH_INCLUSAO\" => new Zend_Db_Expr('SYSDATE'),\n \"PAPD_ID_PESSOA_FISICA\" => $value[1] //id da parte do TRF\n );\n \n if( isset($dataDocumento[\"replicaVistas\"]) && $dataDocumento[\"replicaVistas\"] == 'S' \n && $dataDocumento[\"DOCM_ID_CONFIDENCIALIDADE\"] != '0'){\n $this->replicaVista($dataParteProcDoc);\n }\n \n $rowSadTbPapdParteProcDoc = $this->createRow($dataParteProcDoc);\n $rowSadTbPapdParteProcDoc->save(); \n }\n // Zend_debug::dump($dataParteProcDoc, 'partes pessoa'); //exit;\n }",
"private function carregarItensOrigemProcessoDeCompras() {\n\n $sWhere = implode(\" and \", array(\n 'ac16_origem = ' . Acordo::ORIGEM_PROCESSO_COMPRAS,\n \"ac26_acordoposicaotipo = \" . AcordoPosicao::TIPO_INCLUSAO,\n \"ac16_dataassinatura >= '2016-05-02'\",\n \"(ac58_acordo is null or ac58_data >= '{$this->oCabecalho->getDataGeracao()->getDate()}')\",\n \"pc24_pontuacao = 1\",\n \"ac16_instit = {$this->oCabecalho->getInstituicao()->getCodigo()}\",\n ));\n\n $oDaoItemProcesso = new cl_solicitemvinculo();\n $sSqlBuscaItens = $oDaoItemProcesso->sql_query_item_licitacon(implode(', ', self::$aCampos), $sWhere);\n $rsBuscaItens = db_query($sSqlBuscaItens);\n if (!$rsBuscaItens) {\n throw new DBException(\"Não foi possível carregar os itens do acordo incluso com origem Processo de Compras.\");\n }\n\n $iTotalRegistros = pg_num_rows($rsBuscaItens);\n for ($iRow = 0; $iRow < $iTotalRegistros; $iRow++) {\n\n $oStdInformacao = db_utils::fieldsMemory($rsBuscaItens, $iRow);\n $this->adicionarItem(self::criarObjetoImpressao($oStdInformacao));\n }\n }",
"function insert_one_pdf($id, $type) {\r\n global $db_connection, $copia, $basedir2;\r\n $sql2 = \"SELECT * FROM PREPRINTS WHERE id_pubblicazione='\" . $id . \"'\";\r\n $query2 = mysqli_query($db_connection, $sql2) or die(mysqli_error());\r\n $row = mysqli_fetch_array($query2);\r\n unlink($copia . $row['Filename']);\r\n if ($handle = opendir($basedir2)) {\r\n $i = 0;\r\n while ((false !== ($file = readdir($handle)))) {\r\n if ($file != '.' && $file != '..' && $file != 'index.php') {\r\n $sql = \"UPDATE PREPRINTS SET Filename='\" . $file . \"', checked='1' WHERE id_pubblicazione='\" . $id . \"'\";\r\n $query = mysqli_query($db_connection, $sql) or die(mysqli_error());\r\n $i++;\r\n copy($basedir2 . $file, $copia . $file);\r\n unlink($basedir2 . $file);\r\n }\r\n }\r\n #chiusura della directory...\r\n closedir($handle);\r\n }\r\n}",
"public function inserir($item) {\n $conexao = getDatabaseConnection();\n $statement = $conexao->prepare(\"INSERT INTO tbl_sobre_nos (titulo, imagem, texto, ativo) VALUES (?, ?, ?, ?)\");\n $statement->bind_param(\"sssi\", $item->titulo, $item->imagem, $item->texto, $item->ativo);\n $statement->execute();\n $id = $statement->insert_id;\n $statement->close();\n $conexao->close();\n return $id;\n }",
"public function buscarItemPorIdDoItem(Item_Proposta $item, $sentido) \n {\n \t\n \t$this->load->model(\"Tarifario/Factory/concrete_factory\");\n \t$this->load->model(\"Tarifario/Factory/concrete_importacao_factory\");\n \t$this->load->model(\"Tarifario/Factory/concrete_exportacao_factory\");\n \t$this->load->model(\"Tarifario/Factory/factory\");\n \t$this->load->model(\"Propostas/item_proposta\");\n \t$this->load->model(\"Propostas/status_item\");\n \t$this->load->model(\"Taxas/item_proposta_taxa_model\");\n \t\n \t$id_item = $item->getId();\n \t\n \tif( is_null($id_item) || $id_item == \"0\" || $id_item == \"\" )\n \t{\n \t\tthrow new InvalidArgumentException(\"Nenhum id foi atribuido ao item da proposta para realizar a busca!\");\n \t}\t\n \t\n \t/** Encontra o na base de dados baseado no id do item **/ \t \t\n \t$this->db->\n \t\t\tselect(\"id_item_proposta, id_tarifario_pricing, numero_proposta,\n \t\t mercadoria, pp, cc, imo, peso, cubagem, volumes, observacao_cliente,\n \t\t observacao_interna, id_status_item, data_inicial, validade\")->\n \t from(\"CLIENTES.itens_proposta\")->\n \t where(\"itens_proposta.id_item_proposta\",$item->getId());\n \t \n \t$rs = $this->db->get();\n\n \t$linhas = $rs->num_rows();\n \t\n \tif( $linhas < 1 )\n \t{\n \t\tthrow new OutOfBoundsException(\"Nenhum Item Encontrado! \" . $item->getId());\n \t}\t\n \t\n \t$item_encontrado = $rs->row();\n \t \t \t\n \t/** Cria os objetos de tarifario necessários baseado no tipode proposta **/\n \t$factory = new Concrete_Factory();\n \t \n \t$concrete_factory = Factory::factory($sentido);\n \t\n \t$tarifario = $factory->CreateTarifarioObject($concrete_factory);\n \t$tarifario_model = $factory->CreateTarifarioModel($concrete_factory);\n \t \n \t$tarifario->setId((int) $item_encontrado->id_tarifario_pricing);\n \t\n \t$tarifario = $tarifario_model->findById($tarifario,\"A\",new DateTime($item_encontrado->data_inicial), new DateTime($item_encontrado->validade) );\n \t/**\n if( $_SESSION['matriz'][4] == \"CPD\" )\n {\n pr($tarifario);\n } \n **/\n\n if( ! $tarifario instanceof Tarifario )\n {\n throw new RunTimeException(\"Não foi possivel encontrar o tarifário para este item\", 1); \n } \n\n \t$item = new Item_Proposta($tarifario);\n \t \n \t$data_inicial = new DateTime($item_encontrado->data_inicial);\n \t$validade = new DateTime($item_encontrado->validade);\n \t \n \t$item->setId((int) $item_encontrado->id_item_proposta);\n \t$item->setNumero($item_encontrado->numero_proposta);\n \t$item->setMercadoria($item_encontrado->mercadoria);\n \t$item->setPp($item_encontrado->pp);\n \t$item->setCc($item_encontrado->cc);\n $item->setImo($item_encontrado->imo);\n \t$item->setPeso($item_encontrado->peso);\n \t$item->setCubagem($item_encontrado->cubagem);\n \t$item->setVolumes($item_encontrado->volumes);\n \t$item->setInicio($data_inicial);\n \t$item->setValidade($validade);\n \t$item->setObservacaoCliente($item_encontrado->observacao_cliente);\n \t$item->setObservacaoInterna($item_encontrado->observacao_interna);\n \t\n \t/** Define o status do item **/\n \t$status = new Status_Item();\n \t$status->findById((int)$item_encontrado->id_status_item); \n \t$item->setStatus($status);\n \t \t \t \n \t$item_proposta_taxa_model = new Item_Proposta_Taxa_Model();\n \t\n \t$item_proposta_taxa_model->buscaTaxasDoItemDaProposta($item); \n\n \treturn $item;\n }",
"function InsereFotosInsert($idproduto, $files){\n $cont = 1;\n $caminhoCriar = $_SERVER['DOCUMENT_ROOT'] . AuxCaminhoFotoProduto . $idproduto;\n $caminho = \"arq/produtos/$idproduto\";\n \n\t\t\tmkdir($caminhoCriar, 0755);\n foreach($files as $file){\n #Pega extensão da imagem\n preg_match(\"/\\.(gif|png|jpg|jpeg){1}$/i\", $file[\"name\"], $ext);\n $caminhoMover = \"/$idproduto - $cont\" . \".\" . $ext[1];\n move_uploaded_file($file[\"tmp_name\"], $caminhoCriar.$caminhoMover);\n $Sql = \"INSERT INTO t_imagens_produto (idproduto, caminho, ordem) VALUES ('$idproduto', '\".$caminho.$caminhoMover.\"', '$cont')\";\n parent::Execute($Sql);\n $cont++;\n }\n }",
"public function insertpruemarc(){\n $stmt=$this->objPDO->prepare(\"INSERT INTO sisanatom.marcador_prueba(prueba,marcador,cantidad)values(:prueba,:marcador,:cantidad)\");\n $stmt->execute(array('prueba'=>$this->prueba,\n 'marcador'=>$this->marcador,\n 'cantidad'=>$this->cantidad));\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the company name if set in options; otherwise returns the site name | function pxls_get_company_name() {
global $PXLS_Options;
$companyname = '';
if ( isset( $PXLS_Options['pxls_company_name'] ) ) {
$companyname = $PXLS_Options['pxls_company_name'];
if ( '' == $companyname ) {
$companyname = get_bloginfo( 'name' );
}
}
return $companyname;
} | [
"protected static function getCompanyName()\n {\n return \\XLite\\Core\\Config::getInstance()->Company->company_name;\n }",
"function si_get_company_name() {\n\t\t$address = si_get_doc_address();\n\t\t$name = ( isset( $address['name'] ) ) ? $address['name'] : get_bloginfo( 'name' );\n\t\treturn apply_filters( 'si_get_company_name', $name );\n\t}",
"protected function getOpenGraphSiteName()\n {\n return \\XLite\\Core\\Config::getInstance()->Company->company_name;\n }",
"function site_name() {\r\n return \\query\\main::get_option( 'sitename' );\r\n}",
"public function getCompanyName();",
"function si_company_name() {\n\t\techo apply_filters( 'si_company_name', si_get_company_name() );\n\t}",
"protected static function getCompanyName(): string\n {\n try {\n $Conf = QUI::getPackage('quiqqer/erp')->getConfig();\n $company = $Conf->get('company', 'name');\n } catch (Exception $Exception) {\n QUI\\System\\Log::writeException($Exception);\n\n return '';\n }\n\n if (empty($company)) {\n return '';\n }\n\n return $company;\n }",
"function woocommerce_pip_print_company_name() {\n\t if (get_option('woocommerce_pip_company_name') != '') {\n\t return get_option('woocommerce_pip_company_name') . '<br />';\n\t }\n\t}",
"public function getCompanyName()\n {\n return $this->company_name;\n }",
"public function getCompany_name () {\n\t$preValue = $this->preGetValue(\"company_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->company_name;\n\treturn $data;\n}",
"function getCompanyName() {\n \t$company = $this->getCompany();\n \treturn instance_of($company, 'Company') ? $company->getName() : lang('-- Unknown --');\n }",
"public function getCompanyName()\n {\n return $this->companyName;\n }",
"public function showCompany(){\r\n\t return Mage::helper('vendorsquote')->getConfig('account_detail_company');\r\n\t}",
"public function getCompanyName()\n {\n return isset($this->CompanyName) ? $this->CompanyName : null;\n }",
"public function getCompanyWebsite()\n {\n\n return $this->company_website;\n }",
"function site_name()\n {\n return config_item('site_name');\n }",
"public function getSiteName();",
"public static function companyName()\n {\n return static::randomElement(static::$companies);\n }",
"public function get_site_name()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Procedure to fix XSD known location paths for CFDI and TFD | public function fixKnownSchemaLocationsXsdUrls()
{
$xsiLocations = $this->obtainXsiSchemaLocations();
$schemasFixer = SchemaLocationsXsdUrlsFixer::createWithKnownSatUrls();
foreach ($xsiLocations as $attribute) {
$schemasFixer->fixSchemaLocationAttribute($attribute);
}
} | [
"public function removeIncompleteSchemaLocations()\n {\n foreach ($this->obtainXsiSchemaLocations() as $attribute) {\n $attribute->nodeValue = $this->removeIncompleteSchemaLocationPrivate($attribute->nodeValue);\n }\n }",
"public function removeNonSatNSschemaLocations()\n {\n $schemaLocations = $this->obtainXsiSchemaLocations();\n foreach ($schemaLocations as $attribute) {\n $this->removeNonSatNSschemaLocation($attribute);\n }\n }",
"function parseXSD(){\n \n\t\t $xml = new DOMDocument();\n\t\t $xml->loadXML($this->xsdString);\n\t\t $xpath = new DOMXPath($xml);\n\t\t foreach($this->nameSpaces as $prefix => $uri){\n\t\t\t\t$xpath->registerNamespace($prefix, $uri); //get those namespaces registered!\n\t\t }\n\t\t \n\t\t $this->doRefElement = false;\n\t\t $this->doneElementTypes = array();\n\t\t $schema = $this->extractSchema($xpath, $xml, \"recordType\", self::cowNSprefix.\":\".\"record\");\n\t\t //$schema = $this->extractSchema($xpath, $xml, \"cowItemType\", \"cowItem\");\n\t\t \n\t\t $this->schema = $schema;\n\t}",
"private function generaSchemaLocation()\n {\n // Agrega atributo de location\n $atribute = $this->xml->createAttribute('xsi:schemaLocation');\n $atribute->value = $this->schemaLocation;\n $this->cfdiElement->appendChild($atribute);\n }",
"protected function _getFileXsd()\n {\n return $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd');\n }",
"public function theXmlSitemapShouldBeValid() {\n $this->theXmlFeedShouldBeValidAccordingToTheXsd(__DIR__ . '/../../schemas/xsd/sitemap.xsd');\n }",
"protected function _getKnownInvalidXml()\n {\n return __DIR__ . '/_files/invalid_webapi.xml';\n }",
"function namespace_fix($xmlString){\n\t\n\t//$goodNamespaceURI = \"http://opencontext.org/schema/space_schema_v1.xsd\";\n\t$goodNamespaceURI = self::OC_namespaceURI;\n\t\n\t$old_namespaceURIs = array(\"http://about.opencontext.org/schema/space_schema_v1.xsd\",\n\t\t\t\t \"http://www.opencontext.org/database/schema/space_schema_v1.xsd\");\n\t\n\tforeach($old_namespaceURIs as $oldNamespace){\n\t $xmlString = str_replace($oldNamespace, $goodNamespaceURI, $xmlString);\n\t}\n\t\n\treturn $xmlString;\n }",
"protected function _getFileXsd()\n {\n $urnResolver = new \\Magento\\Framework\\Config\\Dom\\UrnResolver();\n return $urnResolver->getRealPath('urn:magento:module:Magento_Webapi:etc/webapi.xsd');\n }",
"public function getXsdValidationBasePath()\n {\n return false;\n }",
"function _absolutePathHandler()\r\n {\r\n $this->_owner->_nodeSet = array(&$this->_owner->_dom);\r\n $this->_QName = false;\r\n $this->_shortSyntaxHandler();\r\n }",
"protected function _getKnownInvalidXml()\n {\n return __DIR__ . '/_files/search_engine/invalid.xml';\n }",
"public function getXsdValidationBasePath()\n {\n }",
"protected function _getKnownInvalidXml()\n {\n return __DIR__ . '/_files/invalid_persistent.xml';\n }",
"public function getPathCadenaOriginal(){\n return __DIR__.'/../../../../../sat/xslt/cadenaoriginal_3_3.xslt';\n }",
"protected function validateVsXsd()\n {\n // ----- this is where the XML is validated first as a xml and then against it's own xsd\n set_error_handler(array($this, 'CustomHandleErrors')); // set a specific error handler for the loadXML function, to have control of the error\n $this->requestXmlObject = $aDomDocument = new DOMDocument;\n $aDomDocument->loadXML($this->inputdata, LIBXML_PARSEHUGE); // load the xml, allowing big XMLs as well\n\n $validation = 1;\n if ($this->xsdRequestFilepath && $this->xsdRequestFilename) {\n if (file_exists($this->xsdRequestFilepath . $this->xsdRequestFilename)) {\n $validation = $aDomDocument->schemaValidate ($this->xsdRequestFilepath . $this->xsdRequestFilename);\n } else {\n NackResponseHandler::HandleRequest($this->requestXmlObject, 500, \"Internal Xsd Data not available, Contact Admin\");\n }\n\n } else {\n NackResponseHandler::HandleRequest($this->requestXmlObject, 500, \"Internal Xsd Data not properly defined, Contact Admin\");\n }\n restore_error_handler(); // return error handler to default\n\n if ($validation) {\n return $aDomDocument;\n } else {\n NackResponseHandler::HandleRequest($this->requestXmlObject, 400, \"Bad Request, not recognizable xml format\");\n }\n }",
"protected function _getKnownValidXml()\n {\n return __DIR__ . '/_files/valid.xml';\n }",
"function getXsdValidationBasePath()\n {\n }",
"public function getXsdValidationBasePath()\n {\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a sample feed with up to 12 published products. | function get_sample_product_feed() {
ob_start();
// get up to 12 published posts that are products
$args = [
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => 12,
'fields' => 'ids',
];
$post_ids = get_posts( $args );
$items = [];
foreach ( $post_ids as $post_id ) {
$woo_product = new WC_Facebook_Product( $post_id );
$product_data = $woo_product->prepare_product();
$feed_item = [
'title' => strip_tags( $product_data['name'] ),
'availability' => $woo_product->is_in_stock() ? 'in stock' :
'out of stock',
'description' => strip_tags( $product_data['description'] ),
'id' => $product_data['retailer_id'],
'image_link' => $product_data['image_url'],
'brand' => strip_tags( WC_Facebookcommerce_Utils::get_store_name() ),
'link' => $product_data['url'],
'price' => $product_data['price'] . ' ' . get_woocommerce_currency(),
];
array_push( $items, $feed_item );
}
// https://codex.wordpress.org/Function_Reference/wp_reset_postdata
wp_reset_postdata();
ob_end_clean();
return json_encode( [ $items ] );
} | [
"public function getProductsFeed()\n {\n $product_id = $this->getRequest()->getQuery('product_id');\n $stores = array();\n $storeCollection = Mage::getModel('core/store')->getCollection();\n\n if (empty($product_id)) {\n\n $offset = $this->getRequest()->getQuery('offset');\n\n if ($offset == null) {\n echo '{\n \"success\": false,\n \"data\": {\n \"error_code\": \"QW-4003\",\n \"error\": \"Offset not set.\"\n }\n }'\n ;\n exit;\n }\n\n $limit = $this->getRequest()->getQuery('limit');\n\n if ($limit == null) {\n echo '{\n \"success\": false,\n \"data\": {\n \"error_code\": \"QW-4004\",\n \"error\": \"Limit not set.\"\n }\n }'\n ;\n exit;\n }\n //Magento uses pages and not offset amount. We calculate the page based on the limit and offset provided\n if ($offset == 0) {\n $page = 1;\n } else {\n $page = ($offset / $limit) + 1;\n }\n\n $store = Mage::app()->getStore();\n $store_id = $store->getId();\n $productslist = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('status', 1)->addAttributeToFilter('visibility', 4)->setPage($page, $limit)->addStoreFilter($store_id);\n $json = array();\n\n foreach ($productslist as $theproduct) {\n $productId = $theproduct->getId();\n $product = Mage::getModel('catalog/product')->load($productId);\n $maincat = $subcats = '';\n $cats = $product->getCategoryIds();\n $category_ids = array();\n\n foreach ($cats as $category_id) {\n $_cat = Mage::getModel('catalog/category')->load($category_id);\n if ($_cat->getIsActive()) {\n $category_ids[] = $category_id;\n }\n }\n\n $product_data = array();\n $product_data['product_id'] = $productId;\n $parentIds = null;\n if ($product->getTypeId() == \"simple\") {\n $parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId()); // check for grouped product\n if (!$parentIds)\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()); //check for config product\n }\n\n /* if (!empty($parentIds)) {\n $product_data['parent_product_id'] = $parentIds[0];\n } else {\n $product_data['parent_product_id'] = null;\n } */\n $product_data['product_name'] = $product->getName();\n $product_data['sku_number'] = $product->getSku();\n $product_data['created'] = date(\"Y-m-d H:i:s\", Mage::getModel(\"core/date\")->timestamp($product->getCreatedAt()));\n $product_data['updated'] = date(\"Y-m-d H:i:s\", Mage::getModel(\"core/date\")->timestamp($product->getUpdatedAt()));\n\n if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL) {\n $product_data['downloadable'] = true;\n } else {\n $product_data['downloadable'] = false;\n }\n\n if ($product->getGtin()) {\n $product_data['gtin'] = $product->getGtin();\n $product_data['unique_identifier'] = true;\n } else {\n $product_data['gtin'] = null;\n $product_data['unique_identifier'] = false;\n }\n\n $product_data['mpn'] = $product->getMpn();\n $product_data['brand'] = $product->getBrand();\n $product_data['weight'] = $product->getWeight();\n $product_data['weight_unit'] = 'kg';\n if ($maincat) {\n $product_data['primary_category'] = $maincat;\n }\n $product_data['category_ids'] = $category_ids;\n $product_data['product_url'] = $product->getProductUrl();\n $product_data['product_image_urls'] = array();\n\n if ($product->getImage()) {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n $mainimage->main = true;\n $product_data['product_image_urls'][] = $mainimage;\n }\n\n foreach ($product->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $product_data['product_image_urls'][] = $subimage;\n }\n\n //$product_data['ProductImageURL'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($productId);\n $product_data['short_product_description'][$language] = (substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getShortDescription()), 0)) ? substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getShortDescription()), 0) : \"No short description available\";\n $product_data['long_product_description'][$language] = (substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getDescription()), 0)) ? substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getDescription()), 0) : \"No description available\";\n }\n $product_data['sale_price'] = number_format((float) $product->getFinalPrice(), 2, '.', '');\n $product_data['retail_price'] = number_format((float) $product->getPrice(), 2, '.', '');\n\n if ($product->getMspCashback()) {\n $product_data['cashback'] = $product->getMspCashback();\n }\n //$product_data['UniversalProductCode'] = $product->getData('upc'); //need variable\n /**\n * Get product tax rule\n * */\n $taxRules = Mage::getModel('tax/sales_order_tax')->getCollection();\n $taxCalculation = Mage::getModel('tax/calculation');\n $request = $taxCalculation->getRateRequest(null, null, null, $store);\n $tax_rule = new stdclass();\n $rules = array();\n\n $collection = Mage::getModel('tax/calculation_rule')->getCollection();\n if ($collection->getSize()) {\n $collection->addCustomerTaxClassesToResult()->addProductTaxClassesToResult()->addRatesToResult();\n }\n if ($collection->getSize()) {\n foreach ($collection as $rule) {\n $rule_data = $rule->getData();\n if (in_array($product->getTaxClassId(), $rule_data['product_tax_classes'])) {\n foreach ($rule_data['tax_rates'] as $key => $rate_id) {\n $rate = Mage::getSingleton('tax/calculation_rate')->load($rate_id);\n $rate_info = $rate->getData();\n $rules[$rate_info['tax_country_id']] = $rate_info['rate'];\n $tax_rule->name = $rule_data['code'];\n }\n }\n }\n };\n\n $tax_rule->id = $product->getTaxClassId();\n $tax_rule->rules = $rules;\n $product_data['tax'] = $tax_rule;\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n $product_data['stock'] = (INT) $stockItem->getQty();\n\n $meta_data = array();\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($productId);\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n if ($productdata->getMetaTitle() && $productdata->getMetaKeyword() && $productdata->getMetaDescription()) {\n $meta_data['title'][$language] = $productdata->getMetaTitle();\n $meta_data['keyword'][$language] = $productdata->getMetaKeyword();\n $meta_data['description'][$language] = $productdata->getMetaDescription();\n }\n }\n\n if (!empty($meta_data)) {\n $product_data['metadata'] = $meta_data;\n }\n\n $attr = array();\n $attributes = $product->getAttributes();\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_condition = $product->getAttributeText($attribute->getAttributeCode());\n $_coditionDefault = $product->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($product);\n $attribute = Mage::getModel('eav/entity_attribute')->load($attribute->getAttributeId());\n $langlabels = $attribute->getStoreLabels();\n\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attr[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attr[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n\n if (!empty($attr)) {\n $product_data['attributes'] = $attr;\n }\n if ($product->isConfigurable()) {\n $variants = array();\n /*\n * GET product variant (options) and add them as variants\n */\n $collection = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);\n $childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product->getId());\n if ($collection) {\n $processed = array();\n foreach ($collection as $childproduct) {\n if (!in_array($childproduct->getId(), $processed)) {\n\n $product_child = Mage::getModel('catalog/product')->load($childproduct->getId());\n $variant = new stdclass();\n\n $variant->product_id = $childproduct->getId();\n $processed[] = $childproduct->getId();\n $variant->sku_number = $childproduct->getSku();\n if ($childproduct->getGtin()) {\n $variant->gtin = $childproduct->getGtin();\n $variant->unique_identifier = true;\n } else {\n $variant->gtin = null;\n $variant->unique_identifier = false;\n }\n $product_data['mpn'] = $childproduct->getMpn();\n if ($childproduct->getImage()) {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $childproduct->getImage();\n $mainimage->main = true;\n $variant->product_image_urls = array();\n $variant->product_image_urls[] = $mainimage;\n }\n $childimages = $childproduct->getMediaGalleryImages();\n if (!empty($childimages)) {\n foreach ($childproduct->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $variant->product_image_urls[] = $subimage;\n }\n }\n\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($childproduct->getId());\n $variant->stock = (INT) $stockItem->getQty();\n $variant->sale_price = number_format((float) $product->getFinalPrice(), 2, '.', '');\n $variant->retail_price = number_format((float) $product->getPrice(), 2, '.', '');\n $variant->weight = $product_child->getWeight();\n $variant->weight_unit = 'kg';\n\n if ($product_child->getMspCashback()) {\n $variant->cashback = $product_child->getMspCashback();\n }\n\n $attrchild = array();\n $attributes = $childproduct->getAttributes();\n //print_r($attributes);exit;\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_coditionDefault = $childproduct->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($childproduct);\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attrchild)) {\n $variant->attributes = $attrchild;\n }\n $variants[] = $variant;\n }\n }\n } else {\n $processed = array();\n\n foreach ($childIds[0] as $key => $childid) {\n $childproduct = Mage::getModel('catalog/product')->load($childid);\n\n if (!in_array($childproduct->getId(), $processed)) {\n $variant = new stdclass();\n $variant->product_id = $childproduct->getId();\n $processed[] = $childproduct->getId();\n $variant->sku_number = $childproduct->getSku();\n if ($childproduct->getGtin()) {\n $variant->gtin = $childproduct->getGtin();\n $variant->unique_identifier = true;\n } else {\n $variant->gtin = null;\n $variant->unique_identifier = false;\n }\n $product_data['mpn'] = $childproduct->getMpn();\n\n if ($childproduct->getImage() && $childproduct->getImage() != 'no_selection') {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $childproduct->getImage();\n $mainimage->main = true;\n $variant->product_image_urls = array();\n $variant->product_image_urls[] = $mainimage;\n }\n $childimages = $childproduct->getMediaGalleryImages();\n if (!empty($childimages)) {\n foreach ($childproduct->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $variant->product_image_urls[] = $subimage;\n }\n }\n\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($childproduct->getId());\n $variant->stock = (INT) $stockItem->getQty();\n $variant->sale_price = number_format((float) $product->getFinalPrice(), 2, '.', '');\n $variant->retail_price = number_format((float) $product->getPrice(), 2, '.', '');\n $variant->weight = $childproduct->getWeight();\n $variant->weight_unit = 'kg';\n\n if ($childproduct->getMspCashback()) {\n $variant->cashback = $childproduct->getMspCashback();\n }\n\n $attrchild = array();\n $attributes = $childproduct->getAttributes();\n //print_r($attributes);exit;\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_coditionDefault = $childproduct->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($childproduct);\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attrchild)) {\n $variant->attributes = $attrchild;\n }\n $variants[] = $variant;\n }\n }\n }\n $product_data['variants'] = $variants;\n } elseif ($product->getTypeId() == \"grouped\") {\n $variants = array();\n /*\n * GET product variant (options) and add them as variants\n */\n\n $collection = Mage::getModel('catalog/product_type_grouped')->getAssociatedProductCollection($product);\n\n $processed = array();\n $prices = array();\n foreach ($collection as $childproduct) {\n\n if (!in_array($childproduct->getId(), $processed)) {\n\n $product_child = Mage::getModel('catalog/product')->load($childproduct->getId());\n\n $variant = new stdclass();\n $variant->product_id = $product_child->getId();\n $processed[] = $product_child->getId();\n $variant->sku_number = $product_child->getSku();\n if ($product_child->getGtin()) {\n $variant->gtin = $product_child->getGtin();\n $variant->unique_identifier = true;\n } else {\n $variant->gtin = null;\n $variant->unique_identifier = false;\n }\n $product_data['mpn'] = $product_child->getMpn();\n\n if ($product_child->getImage() && $product_child->getImage() != 'no_selection') {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product_child->getImage();\n $mainimage->main = true;\n $variant->product_image_urls = array();\n $variant->product_image_urls[] = $mainimage;\n }\n\n $childimages = $product_child->getMediaGalleryImages();\n if (!empty($childimages)) {\n foreach ($product_child->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $variant->product_image_urls[] = $subimage;\n }\n }\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_child->getId());\n $variant->stock = (INT) $stockItem->getQty();\n $variant->sale_price = number_format((float) $product_child->getFinalPrice(), 2, '.', '');\n $variant->retail_price = number_format((float) $product_child->getPrice(), 2, '.', '');\n $variant->weight = $product_child->getWeight();\n $variant->weight_unit = 'kg';\n if ($product_child->getMspCashback()) {\n $variant->cashback = $product_child->getMspCashback();\n }\n\n\n\n $prices[] = $variant->sale_price;\n\n $attrchild = array();\n $attributes = $product_child->getAttributes();\n //print_r($attributes);exit;\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_coditionDefault = $product_child->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($product_child);\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attrchild)) {\n $variant->attributes = $attrchild;\n }\n $variants[] = $variant;\n }\n }\n\n /**\n * Get child product tax rule. We need to set this as the main product is of type grouped and does not have this value.\n * */\n $taxRules = Mage::getModel('tax/sales_order_tax')->getCollection();\n $taxCalculation = Mage::getModel('tax/calculation');\n $request = $taxCalculation->getRateRequest(null, null, null, $store);\n $tax_rule = new stdclass();\n $rules = array();\n\n $collection = Mage::getModel('tax/calculation_rule')->getCollection();\n if ($collection->getSize()) {\n $collection->addCustomerTaxClassesToResult()->addProductTaxClassesToResult()->addRatesToResult();\n }\n if ($collection->getSize()) {\n foreach ($collection as $rule) {\n $rule_data = $rule->getData();\n if (in_array($product_child->getTaxClassId(), $rule_data['product_tax_classes'])) {\n foreach ($rule_data['tax_rates'] as $key => $rate_id) {\n $rate = Mage::getSingleton('tax/calculation_rate')->load($rate_id);\n $rate_info = $rate->getData();\n $rules[$rate_info['tax_country_id']] = $rate_info['rate'];\n $tax_rule->name = $rule_data['code'];\n }\n }\n }\n };\n\n $tax_rule->id = $product_child->getTaxClassId();\n $tax_rule->rules = $rules;\n $product_data['tax'] = $tax_rule;\n\n\n $product_data['from_price'] = min($prices);\n $product_data['variants'] = $variants;\n }\n\n $options = $product->getOptions();\n\n if (!empty($options)) {\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($productId);\n foreach ($productdata->getOptions() as $value) {\n if (is_object($value)) {\n $optionobjects = $value->getValues();\n $values = array();\n foreach ($optionobjects as $options) {\n $data = $options->getData();\n $optiondata = new stdclass();\n $optiondata->id = $data['option_type_id'];\n $optiondata->label = $data['title'];\n $optiondata->pricing = $data['price'];\n $optiondata->price_type = $data['price_type'];\n $values[] = $optiondata;\n if (!empty($data['option_type_id'])) {\n $product_data['options']['global_options'][$language][$value->getTitle()] = array(\n 'id' => $data['option_id'],\n 'type' => 'custom',\n //'label' => $value->getTitle(),\n 'values' => $values\n );\n }\n }\n }\n }\n }\n }\n if ($product->getName() != null && $product->getTypeId() != \"bundle\" && $product->getTypeId() != \"downloadable\") {\n $json[] = $product_data;\n }\n }\n } elseif (!empty($product_id)) {\n $stores = array();\n $storeCollection = Mage::getModel('core/store')->getCollection();\n\n $json = array();\n $product = Mage::getModel('catalog/product')->load($product_id);\n\n if ($product->getTypeId() == \"bundle\" || $product->getTypeId() == \"downloadable\") {\n echo '{\n \"success\": false,\n \"data\": {\n \"error_code\": \"QW-4005\",\n \"error\": \"Product type not supported.\"\n }\n }'\n ;\n exit;\n }\n\n $maincat = $subcats = '';\n $cats = $product->getCategoryIds();\n $category_ids = array();\n foreach ($cats as $category_id) {\n $_cat = Mage::getModel('catalog/category')->load($category_id);\n if ($_cat->getIsActive()) {\n $category_ids[] = $category_id;\n }\n }\n\n $product_data = array();\n $product_data['product_id'] = $product_id;\n $parentIds = null;\n if ($product->getTypeId() == \"simple\") {\n $parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId()); // check for grouped product\n if (!$parentIds)\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()); //check for config product\n }\n\n /* if (!empty($parentIds)) {\n $product_data['parent_product_id'] = $parentIds[0];\n } else {\n $product_data['parent_product_id'] = null;\n } */\n $product_data['product_name'] = $product->getName();\n $product_data['sku_number'] = $product->getSku();\n $product_data['created'] = date(\"Y-m-d H:i:s\", Mage::getModel(\"core/date\")->timestamp($product->getCreatedAt()));\n $product_data['updated'] = date(\"Y-m-d H:i:s\", Mage::getModel(\"core/date\")->timestamp($product->getUpdatedAt()));\n\n if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL) {\n $product_data['downloadable'] = true;\n } else {\n $product_data['downloadable'] = false;\n }\n\n if ($product->getGtin()) {\n $product_data['gtin'] = $product->getGtin();\n $product_data['unique_identifier'] = true;\n } else {\n $product_data['gtin'] = null;\n $product_data['unique_identifier'] = false;\n }\n\n $product_data['mpn'] = $product->getMpn();\n $product_data['brand'] = $product->getBrand();\n $product_data['weight'] = $product->getWeight();\n $product_data['weight_unit'] = 'kg';\n $product_data['category_ids'] = $category_ids;\n $product_data['product_url'] = $product->getProductUrl();\n $product_data['product_image_urls'] = array();\n\n if ($product->getImage()) {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n $mainimage->main = true;\n $product_data['product_image_urls'][] = $mainimage;\n }\n\n foreach ($product->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $product_data['product_image_urls'][] = $subimage;\n }\n\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($product_id);\n $product_data['short_product_description'][$language] = (substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getShortDescription()), 0)) ? substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getShortDescription()), 0) : \"No short description available\";\n $product_data['long_product_description'][$language] = (substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getDescription()), 0)) ? substr(iconv(\"UTF-8\", \"UTF-8//IGNORE\", $productdata->getDescription()), 0) : \"No description available\";\n }\n\n $product_data['sale_price'] = number_format((float) $product->getFinalPrice(), 2, '.', '');\n $product_data['retail_price'] = number_format((float) $product->getPrice(), 2, '.', '');\n\n if ($product->getMspCashback()) {\n $product_data['cashback'] = $product->getMspCashback();\n }\n\n\n //$product_data['UniversalProductCode'] = $product->getData('upc'); //need variable\n\n /**\n * Get product tax rule\n * */\n $taxRules = Mage::getModel('tax/sales_order_tax')->getCollection();\n $taxCalculation = Mage::getModel('tax/calculation');\n $request = $taxCalculation->getRateRequest(null, null, null, $store);\n $tax_rule = new stdclass();\n $rules = array();\n\n $collection = Mage::getModel('tax/calculation_rule')->getCollection();\n if ($collection->getSize()) {\n $collection->addCustomerTaxClassesToResult()->addProductTaxClassesToResult()->addRatesToResult();\n }\n if ($collection->getSize()) {\n foreach ($collection as $rule) {\n $rule_data = $rule->getData();\n if (in_array($product->getTaxClassId(), $rule_data['product_tax_classes'])) {\n foreach ($rule_data['tax_rates'] as $key => $rate_id) {\n $rate = Mage::getSingleton('tax/calculation_rate')->load($rate_id);\n $rate_info = $rate->getData();\n $rules[$rate_info['tax_country_id']] = $rate_info['rate'];\n $tax_rule->name = $rule_data['code'];\n }\n }\n }\n };\n\n $tax_rule->id = $product->getTaxClassId();\n $tax_rule->rules = $rules;\n $product_data['tax'] = $tax_rule;\n\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id);\n $product_data['stock'] = (INT) $stockItem->getQty();\n\n $meta_data = array();\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($product_id);\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n if ($productdata->getMetaTitle() && $productdata->getMetaKeyword() && $productdata->getMetaDescription()) {\n $meta_data['title'][$language] = $productdata->getMetaTitle();\n $meta_data['keyword'][$language] = $productdata->getMetaKeyword();\n $meta_data['description'][$language] = $productdata->getMetaDescription();\n }\n }\n\n if (!empty($meta_data)) {\n $product_data['metadata'] = $meta_data;\n }\n $attr = array();\n $attributes = $product->getAttributes();\n\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_condition = $product->getAttributeText($attribute->getAttributeCode());\n $_coditionDefault = $product->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($product);\n $attribute = Mage::getModel('eav/entity_attribute')->load($attribute->getAttributeId());\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attr[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attr[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attr)) {\n $product_data['attributes'] = $attr;\n }\n\n if ($product->isConfigurable()) {\n $variants = array();\n /*\n * GET product variant (options) and add them as variants\n */\n $collection = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);\n\n $processed = array();\n\n foreach ($collection as $childproduct) {\n\n if (!in_array($childproduct->getId(), $processed)) {\n\n $product_child = Mage::getModel('catalog/product')->load($childproduct->getId());\n\n\n $variant = new stdclass();\n $variant->product_id = $childproduct->getId();\n $processed[] = $childproduct->getId();\n $variant->sku_number = $childproduct->getSku();\n if ($childproduct->getGtin()) {\n $variant->gtin = $childproduct->getGtin();\n $variant->unique_identifier = true;\n } else {\n $variant->gtin = null;\n $variant->unique_identifier = false;\n }\n $product_data['mpn'] = $childproduct->getMpn();\n\n if ($childproduct->getImage() && $childproduct->getImage() != 'no_selection') {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $childproduct->getImage();\n $mainimage->main = true;\n $variant->product_image_urls = array();\n $variant->product_image_urls[] = $mainimage;\n }\n\n $childimages = $childproduct->getMediaGalleryImages();\n if (!empty($childimages)) {\n foreach ($childproduct->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $variant->product_image_urls[] = $subimage;\n }\n }\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($childproduct->getId());\n $variant->stock = (INT) $stockItem->getQty();\n $variant->sale_price = number_format((float) $childproduct->getFinalPrice(), 2, '.', '');\n $variant->retail_price = number_format((float) $childproduct->getPrice(), 2, '.', '');\n $variant->weight = $product_child->getWeight();\n $variant->weight_unit = 'kg';\n\n if ($product_child->getMspCashback()) {\n $variant->cashback = $product_child->getMspCashback();\n }\n\n\n $attrchild = array();\n $attributes = $childproduct->getAttributes();\n //print_r($attributes);exit;\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_coditionDefault = $childproduct->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($childproduct);\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attrchild)) {\n $variant->attributes = $attrchild;\n }\n $variants[] = $variant;\n }\n }\n $product_data['variants'] = $variants;\n } elseif ($product->getTypeId() == \"grouped\") {\n $variants = array();\n /*\n * GET product variant (options) and add them as variants\n */\n\n $collection = Mage::getModel('catalog/product_type_grouped')->getAssociatedProductCollection($product);\n\n $processed = array();\n $prices = array();\n foreach ($collection as $childproduct) {\n\n if (!in_array($childproduct->getId(), $processed)) {\n\n $product_child = Mage::getModel('catalog/product')->load($childproduct->getId());\n\n $variant = new stdclass();\n $variant->product_id = $product_child->getId();\n $processed[] = $product_child->getId();\n $variant->sku_number = $product_child->getSku();\n if ($product_child->getGtin()) {\n $variant->gtin = $product_child->getGtin();\n $variant->unique_identifier = true;\n } else {\n $variant->gtin = null;\n $variant->unique_identifier = false;\n }\n $product_data['mpn'] = $product_child->getMpn();\n\n if ($product_child->getImage() && $product_child->getImage() != 'no_selection') {\n $mainimage = new stdclass();\n $mainimage->url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product_child->getImage();\n $mainimage->main = true;\n $variant->product_image_urls = array();\n $variant->product_image_urls[] = $mainimage;\n }\n\n $childimages = $product_child->getMediaGalleryImages();\n if (!empty($childimages)) {\n foreach ($product_child->getMediaGalleryImages() as $image) {\n $subimage = new stdclass();\n $subimage->url = $image->getUrl();\n $subimage->main = false;\n $variant->product_image_urls[] = $subimage;\n }\n }\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_child->getId());\n $variant->stock = (INT) $stockItem->getQty();\n $variant->sale_price = number_format((float) $product_child->getFinalPrice(), 2, '.', '');\n $variant->retail_price = number_format((float) $product_child->getPrice(), 2, '.', '');\n $variant->weight = $product_child->getWeight();\n $variant->weight_unit = 'kg';\n if ($product_child->getMspCashback()) {\n $variant->cashback = $product_child->getMspCashback();\n }\n\n\n\n $prices[] = $variant->sale_price;\n\n $attrchild = array();\n $attributes = $product_child->getAttributes();\n //print_r($attributes);exit;\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n Mage::app()->setCurrentStore($store_id);\n $language = Mage::getStoreConfig('general/locale/code', $store_id);\n foreach ($attributes as $attribute) {\n if ($attribute->getIsVisibleOnFront()) {\n $_coditionDefault = $product_child->getResource()->getAttribute($attribute->getAttributeCode())->setStoreId($store_id)->getFrontend()->getValue($product_child);\n $langlabels = $attribute->getStoreLabels();\n if (isset($langlabels[$store_id]) && $_coditionDefault != NULL) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $langlabels[$store_id], 'value' => $_coditionDefault);\n } elseif ($_coditionDefault) {\n $attrchild[$attribute->getAttributeCode()][$language] = array('label' => $attribute->getFrontendLabel(), 'value' => $_coditionDefault);\n }\n }\n }\n }\n if (!empty($attrchild)) {\n $variant->attributes = $attrchild;\n }\n $variants[] = $variant;\n }\n }\n\n /**\n * Get child product tax rule. We need to set this as the main product is of type grouped and does not have this value.\n * */\n $taxRules = Mage::getModel('tax/sales_order_tax')->getCollection();\n $taxCalculation = Mage::getModel('tax/calculation');\n $request = $taxCalculation->getRateRequest(null, null, null, $store);\n $tax_rule = new stdclass();\n $rules = array();\n\n $collection = Mage::getModel('tax/calculation_rule')->getCollection();\n if ($collection->getSize()) {\n $collection->addCustomerTaxClassesToResult()->addProductTaxClassesToResult()->addRatesToResult();\n }\n if ($collection->getSize()) {\n foreach ($collection as $rule) {\n $rule_data = $rule->getData();\n if (in_array($product_child->getTaxClassId(), $rule_data['product_tax_classes'])) {\n foreach ($rule_data['tax_rates'] as $key => $rate_id) {\n $rate = Mage::getSingleton('tax/calculation_rate')->load($rate_id);\n $rate_info = $rate->getData();\n $rules[$rate_info['tax_country_id']] = $rate_info['rate'];\n $tax_rule->name = $rule_data['code'];\n }\n }\n }\n };\n\n $tax_rule->id = $product_child->getTaxClassId();\n $tax_rule->rules = $rules;\n $product_data['tax'] = $tax_rule;\n\n\n $product_data['from_price'] = min($prices);\n $product_data['variants'] = $variants;\n }\n\n\n $options = $product->getOptions();\n\n if (!empty($options)) {\n foreach ($storeCollection as $store) {\n $store_id = $store->getId();\n $language = Mage::getStoreConfig('general/locale/code', $store->getId());\n $productdata = Mage::getModel('catalog/product')->setStoreId($store_id)->load($product_id);\n foreach ($productdata->getOptions() as $value) {\n if (is_object($value)) {\n $optionobjects = $value->getValues();\n $values = array();\n foreach ($optionobjects as $options) {\n $data = $options->getData();\n $optiondata = new stdclass();\n $optiondata->id = $data['option_type_id'];\n $optiondata->label = $data['title'];\n $optiondata->pricing = $data['price'];\n $optiondata->price_type = $data['price_type'];\n $values[] = $optiondata;\n\n if (!empty($data['option_type_id'])) {\n $product_data['options']['global_options'][$language][$value->getTitle()] = array(\n 'id' => $data['option_id'],\n 'type' => 'custom',\n //'label' => $value->getTitle(),\n 'values' => $values\n );\n }\n }\n }\n }\n }\n }\n if ($product->getName() != null) {\n $json[] = $product_data;\n }\n }\n return json_encode($json);\n }",
"public function runProductFeed(){\n\t\t$feed\t=\tMage::helper('ordergroove/product_feed');\n\t\t$result\t=\t$feed->generate(TRUE);\n\t}",
"function google_products_feed() {\r\n $this->load->model('utils/api_model');\r\n $data['items'] = $this->api_model->getProductsData();\r\n $rss = $this->api_model->formatGoogleProductsXml($data['items']);\r\n echo $rss;\r\n }",
"public function createProductFeed() {\n\t\t$config = Mage::helper('pepperjam_network/config');\n\n\t\tif (!$config->isProductFeedEnabled()) {\n\t\t\tMage::log(Mage::helper('pepperjam_network')->__('Product feed disabled'), Zend_Log::NOTICE);\n\t\t\treturn;\n\t\t}\n\n\t\t$helper = Mage::helper('pepperjam_network');\n\t\tforeach ($helper->getAllProgramIds() as $programId) {\n\t\t\t$store = $helper->getStoreForProgramId($programId);\n\t\t\tMage::log(\n\t\t\t\tsprintf(static::PRODUCT_LOG_MESSAGE, $programId, $store->getName()),\n\t\t\t\tZend_Log::INFO\n\t\t\t);\n\n\t\t\tMage::getModel('pepperjam_network/feed_product', array(\n\t\t\t\t'store' => $store,\n\t\t\t))->generateFeed();\n\t\t}\n\t}",
"public function api_featured_products()\n {\n $products = Product::where('category_id', '=',651)->inRandomOrder()->with('images')->take(10)->get();\n return response($products, 200);\n }",
"public function getProductsFirst()\n {\n $products = Product::where('featured',true)->take(6)->get();\n return $products;\n }",
"public function loadLatestProducts()\n {\n $products = $this->createQueryBuilder('p')\n ->join('p.image', 'i')\n ->addSelect('i')\n ->where('p.isActive = :isactive')\n ->andWhere('p.new = :new')\n ->setParameter(':isactive', true)\n ->setParameter(':new', 'new')\n ->getQuery()\n ->getArrayResult();\n shuffle($products);\n return array_slice($products, 0, 7, true);\n }",
"public function getProducts()\n {\n $page = request('page',1);\n\n return Cache::tags(['featured-products'])->rememberForever('featured-page-' . $page, function() {\n\n // Get paginated data\n $products = Product\n ::with([\n 'store',\n 'store.logo',\n 'mainImage' => function(MorphMany $query) {\n $query->where('collection_name', 'main-image');\n },\n 'images' => function(MorphMany $query) {\n $query->where('collection_name', 'images');\n }\n ])\n ->orderBy('name')\n ->paginate(self::PAGESIZE);\n\n // Transform data into preferred format\n $productToTileTransformer = new ProductTileTransformer();\n\n $updated = $products->getCollection()->map(function($product) use($productToTileTransformer) {\n return $productToTileTransformer->transform($product);\n });\n\n // Save transformations\n $products->setCollection($updated);\n\n return $products;\n });\n }",
"protected function getProducts()\n {\n /**\n * Search provider being taken trough container. This is src/Product/SearchProvider class\n */\n $searchProvider = $this->getContainer()->get('invertus.training.product.search_provider');\n\n $context = new ProductSearchContext($this->context);\n\n $query = new ProductSearchQuery();\n\n $query\n ->setResultsPerPage(20)\n ->setPage(1)\n ;\n\n /**\n * We get product list using context and query\n * Context is simply required for context of page like language\n * Query tells what sort of list we went to provider. Query might contain idCategory,\n * idManufacturer and so but it only matters if searchProvider takes them into account\n */\n $result = $searchProvider->runQuery(\n $context,\n $query\n );\n\n /**\n * Assemble is required to assemble product data and add missing properties\n */\n $assembler = new ProductAssembler($this->context);\n\n /**\n * Presentation settings hold settings that might affect how to dispaly products\n * Example: if Catalog mode is on you shouldn't display add to cart.\n */\n $presenterFactory = new ProductPresenterFactory($this->context);\n $presentationSettings = $presenterFactory->getPresentationSettings();\n\n /**\n * Present is responsible for presenting additional data like images links etc,\n */\n $presenter = new ProductListingPresenter(\n new ImageRetriever(\n $this->context->link\n ),\n $this->context->link,\n new PriceFormatter(),\n new ProductColorsRetriever(),\n $this->context->getTranslator()\n );\n\n $products_for_template = [];\n\n foreach ($result->getProducts() as $rawProduct) {\n $products_for_template[] = $presenter->present(\n $presentationSettings,\n $assembler->assembleProduct($rawProduct),\n $this->context->language\n );\n }\n\n return $products_for_template;\n }",
"public function getProductsForHotBlock()\n {\n return $this->em->getRepository('entities\\Product')->findBy(array(), array('created' => 'ASC'), 12, 0);\n }",
"public function getLatestProducts(){\r\n\r\n $collection = $this->_productCollectionFactory->create();\r\n\r\n $collection = $this->_addProductAttributesAndPrices(\r\n $collection\r\n )->addStoreFilter()\r\n ->addAttributeToSort('entity_id', 'desc')\r\n ->setPageSize($this->_limit)->setCurPage(1);\r\n $collection = $this->findProductByCatgoryIds($collection);\r\n $collection->getSelect()->group('e.entity_id');\r\n\r\n return $collection;\r\n }",
"function getProductPosts()\n{\n $args = array(\n 'post_type' => 'product',\n 'posts_per_page' => -1,\n );\n\n $products_array = get_posts($args);\n\n return $products_array;\n}",
"public function getnewproducts()\n\t{\n\t\t\n\t\t$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n\t\t$_rootcatID = Mage::app($this->storeId)->getStore()->getRootCategoryId();\n\n\t\t$_productCollection = Mage::getResourceModel('catalog/product_collection')\n\t\t\t\t->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')\n\t\t\t\t->addAttributeToFilter('category_id', array('in' => $_rootcatID))\n\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t->addAttributeToFilter('status',array('eq'=>1))\n\t\t\t\t->setPageSize (5)\n\t\t\t\t->addAttributeToFilter('visibility',array('eq'=>4))\n\t\t\t\t->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))\n\t\t\t\t->addAttributeToFilter('news_to_date', array('or'=> array(\n\t\t\t\t\t\t\t0 => array('date' => true, 'from' => $todayDate),\n\t\t\t\t\t\t\t1 => array('is' => new Zend_Db_Expr('null')))\n\t\t\t\t\t\t\t), 'left')\n\t\t\t\t->setStoreId($this->storeId)\n\t\t\t\t;\n\n\n\t\t\t$now = date('Y-m-d');\n\t\t\t$newsFrom= substr($_productCollection->getData('news_from_date'),0,10);\n\t\t\t$newsTo= substr($_productCollection->getData('news_to_date'),0,10);\n\n\t\t\tMage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($_productCollection);\n\t\t\t\n\t\t\tif(!$_productCollection->count()):\n\t\t\t\t\treturn $new_productlist = array ();\n\t\t\telse:\n\t\t\t\tif ($now>=$newsFrom && $now<=$newsTo)$i=0;\n\t\t\t\t \n\t\t\t$new_productlist = array ();\n\t\t\t$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();\n\t\t\t$currentCurrency = $this->currency;\n\t\t\tforeach ( $_productCollection as $product ) {\n\t\t\t\t\n\t\t\t\t\t$product = Mage::getModel ( 'catalog/product' )->load ( $product ['entity_id'] );\n\t\t\t\t\t\n\t\t\t\t\t$rating = Mage::getModel('rating/rating')->getEntitySummary($product->getId());\n\t\t\t\t\t$rating_final = ($rating->getSum()/$rating->getCount())/20;\n\n\t\t\t\tif($product->getTypeId() == \"configurable\")\n\t\t\t\t\t$qty = Mage::helper('connector')->getProductStockInfoById($product->getId());\n\t\t\t\telse\n\t\t\t\t\t$qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId())->getQty();\n\n\n\t\t\t\t$new_productlist [] = array (\n\t\t\t\t\t\t'entity_id' => $product->getId (),\n\t\t\t\t\t\t'sku' => $product->getSku (),\n\t\t\t\t\t\t'name' => $product->getName (),\n\t\t\t\t\t\t'news_from_date' => $product->getNewsFromDate (),\n\t\t\t\t\t\t'news_to_date' => $product->getNewsToDate (),\n\t\t\t\t\t\t'special_from_date' => $product->getSpecialFromDate (),\n\t\t\t\t\t\t'special_to_date' => $product->getSpecialToDate (),\n\t\t\t\t\t\t'image_url' => Mage::helper('connector')-> Imageresize($product->getImage(),'product','300','300'),\n\t\t\t\t\t\t'url_key' => $product->getProductUrl (),\n\t\t\t\t\t\t'regular_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( $product->getPrice (), $baseCurrency, $currentCurrency ), 2, '.', '' ),\n\t\t\t\t\t\t'final_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( \n\t\t\t\t\t\t\tMage::helper('tax')->getPrice($product, $product->getFinalPrice(), \n\t\t\t\t\t\t\ttrue, null, null, null, null, false),\n\t\t\t\t\t\t\t$baseCurrency, $currentCurrency ), 2, '.', '' ),\n\t\t\t\t\t\t'symbol'=>Mage::helper('connector')->getCurrencysymbolByCode($this->currency),\n\t\t\t\t\t\t'qty'=>$qty,\n\t\t\t\t\t\t'product_type'=>$product->getTypeId(),\n\t\t\t\t\t\t//'rating' => $rating_final,\n\t\t\t\t\t\t'wishlist' => Mage::helper('connector')->check_wishlist($product->getId ()),\n\t\t\t\t\t\t'specialprice'=>number_format (Mage::helper('connector')->getSpecialPriceProduct($product->getId ()), 2, '.', '' ),\n\t\t\t\t);\n\t\t\t}\n\t\n\t\t\treturn $new_productlist;\n\t\t\t\n\t\tendif;\n\n\t}",
"public function getTopNewProducts() {\n\n\t\t$scope = ['products.*'];\n\n\t\treturn $this->getProductsForFilter($scope);\n\t}",
"private function getNewProducts()\r\n\t{\r\n\t\tif (!Configuration::get('FIELD_NEWPSL_NBR'))\r\n\t\t\treturn;\r\n\t\t$newProducts = false;\r\n\t\tif (Configuration::get('PS_NB_DAYS_NEW_PRODUCT'))\r\n\t\t\t$newProducts = Product::getNewProducts((int) $this->context->language->id, 0, (int)Configuration::get('FIELD_NEWPSL_NBR'),null,'id_product');\r\n\t\tif (!$newProducts && Configuration::get('FIELD_NEWPSL_DISPLAY'))\r\n\t\t\treturn;\t\t\t\t\t\t\t\t\r\n\t\t$assembler = new ProductAssembler($this->context);\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n $products_for_template = [];\r\n\t\tif(is_array($newProducts)){\r\n foreach ($newProducts as $rawProduct) {\r\n $products_for_template[] = $presenter->present(\r\n $presentationSettings,\r\n $assembler->assembleProduct($rawProduct),\r\n $this->context->language\r\n );\r\n\t\t\t\r\n \t}\r\n\t\t}\r\n\t\treturn $products_for_template;\r\n\t}",
"public function getOfferProductsForHomePage()\n {\n return Product::where('offer', 1)\n ->orderBy('created_at', 'desc')\n ->take(5)\n ->get();\n }",
"protected function fetchProducts()\n {\n $response = $this->client->request('GET', '', ['headers' => $this->headers]);\n return $this->convertResponseToObject($response);\n }",
"public function getProducts();",
"function getFeaturedProducts(){\n\tglobal $objSmarty;\n\t$selQry=\"select * from product where feature='1' order by rand() limit 8\";\n\t$resultSet =$this->ExecuteQuery($selQry, \"select\");\n\t$num_rows=$this->ExecuteQuery($selQry,\"norows\");\n\tif($num_rows > 0){\n\t\t$objSmarty->assign(\"featuredProducts\",$resultSet);\n\t}else{\n\t\t$selectProducts=\"select * from product order by rand() limit 8\";\n\t\t$resultProducts =$this->ExecuteQuery($selectProducts, \"select\");\n\t\t$objSmarty->assign(\"featuredProducts\",$resultProducts);\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a column class for this table section. | public function addColClass($colName, $class) {
$this->colAttributes->nameAddClass($colName, $class);
return $this;
} | [
"function addColumnNameAsClass()\n\t{\n\t\tif(!empty($this->ajaxColumns))\n\t\t{\n\t\t\tforeach($this->ajaxColumns as $key => &$column)\n\t\t\t{\n\t\t\t\t$class = '';\n\t\t\t\tif(!empty($column['class']))\n\t\t\t\t{\n\t\t\t\t\t$class = $column['class'] . ' ';\n\t\t\t\t}\n\t\t\t\t$class .= $key;\n\t\t\t\t$column = array_merge($column, compact('class'));\n\t\t\t}\n\t\t}\n\n\t}",
"public function get_column_class_attr() {\n\t\treturn 'thead tr th.column-' . $this->column->get_name();\n\t}",
"public function addColClass($colName, $class) {\n $this->colClasses[$colName][] = $class;\n return $this;\n }",
"public function addColClass($colName, $class) {\n $this->colClasses[$colName][] = $class;\n }",
"function setColClass($col, $class)\n {\n $this->m_colclass[$col] = $class;\n }",
"function column_class($cols) { global $der_framework;\n return $this->classes[$cols];\n }",
"public static function post_type_classes_columns () : void\n {\n add_filter(\"manage_classes_posts_columns\", function ($columns) {\n return [\n \"cb\" => $columns[\"cb\"],\n \"thumbnail\" => __(\"Thumbnail\", \"ahana\"),\n \"title\" => $columns[\"title\"],\n \"categories\" => __(\"Categories\", \"ahana\"),\n \"trainer\" => __(\"Trainer\", \"ahana\"),\n \"date\" => $columns[\"date\"]\n ];\n });\n\n add_filter(\"manage_classes_posts_custom_column\", function ($column, $postId) {\n switch ($column) {\n case \"thumbnail\":\n the_post_thumbnail(\"admin_column_thumbnail\", $postId);\n break;\n case \"trainer\":\n echo self::set_column(\"classes\", $postId, \"trainer\");\n break;\n case \"categories\":\n echo self::set_column(\"classes\", $postId, \"category\");\n break;\n\n default:\n break;\n }\n }, 10, 2);\n }",
"function organics_woocommerce_loop_shop_columns_class($class) {\n\t\tglobal $woocommerce_loop;\n\t\tif (is_product()) {\n\t\t\tif (!empty($woocommerce_loop['columns']))\n\t\t\t$class[] = ' column-1_'.esc_attr($woocommerce_loop['columns']);\n\t\t} else if (!is_product() && !is_cart() && !is_checkout() && !is_account_page()) {\n\t\t\t$ccc_add = in_array(organics_get_custom_option('body_style'), array('fullwide', 'fullscreen')) ? 1 : 0;\n\t\t\t$ccc = organics_get_custom_option('shop_loop_columns');\n\t\t\t$ccc = $ccc > 0 ? $ccc : (organics_param_is_off(organics_get_custom_option('show_sidebar_main')) ? 3+$ccc_add : 2+$ccc_add);\n\t\t\t$class[] = ' column-1_'.esc_attr($ccc);\n\t\t}\n\t\treturn $class;\n\t}",
"public function addTableClass($class)\n {\n $class = is_array($class) ? implode(' ', $class) : $class;\n $currentClass = Arr::get(array_change_key_case($this->tableAttributes), 'class');\n\n $classes = preg_split('#\\s+#', $currentClass . ' ' . $class, null, PREG_SPLIT_NO_EMPTY);\n $class = implode(' ', array_unique($classes));\n\n return $this->setTableAttribute('class', $class);\n }",
"function attachCustomColumnsToClass( $column, $postId ){\n if( method_exists( $this->attached_class, 'column_' . $column ) ) {\n echo $this->attached_class->{'column_' . $column}($postId);;\n } elseif( method_exists( $this->attached_class, 'column_default' ) ){\n echo $this->attached_class->column_default($postId, $column);\n }\n }",
"function green_woocommerce_loop_shop_columns_class($class) {\n\t\tif (!is_product() && !is_cart() && !is_checkout() && !is_account_page()) {\n\t\t\t$ccc_add = in_array(green_get_custom_option('body_style'), array('fullwide', 'fullscreen')) ? 1 : 0;\n\t\t\t$class[] = ' column-1_'.(green_sc_param_is_off(green_get_custom_option('show_sidebar_main')) ? 3+$ccc_add : 3+$ccc_add);\n\t\t}\n\t\treturn $class;\n\t}",
"function addColumn($columnName, $dataType, $extraStuff = \"\", $primaryKey = false) {\n $this->columns[] = new DbColumn($columnName, $dataType, $extraStuff, $primaryKey);\n }",
"function autoparts_woocommerce_loop_shop_columns_class($classes, $class='', $cat='') {\n\t\tglobal $woocommerce_loop;\n\t\tif (is_product()) {\n\t\t\tif (!empty($woocommerce_loop['columns'])) {\n\t\t\t\t$classes[] = ' column-1_'.esc_attr($woocommerce_loop['columns']);\n\t\t\t}\n\t\t} else if (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {\n\t\t\t$classes[] = ' column-1_'.esc_attr(max(2, min(4, autoparts_get_theme_option('blog_columns'))));\n\t\t}\n\t\treturn $classes;\n\t}",
"public function addColClasses(array $colClasses) {\n foreach ($colClasses as $colName => $class) {\n $this->colClasses[$colName][] = $class;\n }\n return $this;\n }",
"function crypton_blog_woocommerce_loop_shop_columns_class($classes, $class='', $cat='') {\n\t\tglobal $woocommerce_loop;\n\t\tif (is_product()) {\n\t\t\tif (!empty($woocommerce_loop['columns'])) {\n\t\t\t\t$classes[] = ' column-1_'.esc_attr($woocommerce_loop['columns']);\n\t\t\t}\n\t\t} else if (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {\n\t\t\t$classes[] = ' column-1_'.esc_attr(max(2, min(4, crypton_blog_get_theme_option('blog_columns'))));\n\t\t}\n\t\treturn $classes;\n\t}",
"public function getFieldColClass() {\n return \"col-sm-\" . ($this->layout == 'Vertical' ? 12 : 12 - $this->labelWidth);\n }",
"public function addColumn() {\n\t\t\tif ($this->strQueryType == self::SELECT_QUERY) {\n\t\t\t\t$strColumnMethod = 'addSelectColumn';\n\t\t\t} else {\n\t\t\t\t$strColumnMethod = 'addAlterColumn';\n\t\t\t}\n\t\t\t\n\t\t\t$arrFunctionArgs = func_get_args();\n\t\t\tcall_user_func_array(array($this, $strColumnMethod), $arrFunctionArgs);\n\t\t}",
"function setColumnClasses($columnClasses)\n {\n $this->_columnClasses = $columnClasses;\n }",
"public static function addColumns();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for Grade section Teachers Information | function Grade_Section_Teacher($Grade_id,$Section_id)
{
$Model_Obj = new Student_Information();
$Teachers = $Model_Obj->Grade_Section_Teach($Grade_id,$Section_id);
//var_dump( $Teachers ); exit;
$Data = array();
if( !empty($Teachers) )
{
if( count( $Teachers ) == 2 )
{
if( $Teachers[0]->Gender == 'F' )
$Img_Type = 'female';
else
$Img_Type = 'male';
$Tchr_one_name = $Teachers[0]->Teacher_Name?$Teachers[0]->Teacher_Name:'';
//$Tchr_one_image = $Teachers[0]->Image_ID?$Teachers[0]->Image_ID:$Img_Type;
$Tchr_one_image = $this->getStaff_Pic($Teachers[0]->Image_ID, $Teachers[0]->Gender );
$Tchr_one_StaffID = $Teachers[0]->StaffID?$Teachers[0]->StaffID:0;
$Tchr_one_User_Id = $Teachers[0]->User_Id?$Teachers[0]->User_Id:0;
if( $Teachers[1]->Gender == 'F' )
$Img_Type2 = 'female';
else
$Img_Type2 = 'male';
$Tchr_Two_name = $Teachers[1]->Teacher_Name?$Teachers[1]->Teacher_Name:'';
//$Tchr_Two_image = $Teachers[1]->Image_ID?$Teachers[1]->Image_ID:$Img_Type2;
$Tchr_Two_image = $this->getStaff_Pic($Teachers[1]->Image_ID, $Teachers[1]->Gender );
$Tchr_Two_StaffID = $Teachers[1]->StaffID?$Teachers[1]->StaffID:0;
$Tchr_Two_User_Id = $Teachers[1]->User_Id?$Teachers[1]->User_Id:0;
}else
{
if( $Teachers[0]->Gender == 'F' )
$Img_Type = 'female';
else
$Img_Type = 'male';
$Tchr_one_name = $Teachers[0]->Teacher_Name?$Teachers[0]->Teacher_Name:'';
$Tchr_one_image = $this->getStaff_Pic($Teachers[0]->Image_ID, $Teachers[0]->Gender );
$Tchr_one_StaffID = $Teachers[0]->StaffID?$Teachers[0]->StaffID:0;
$Tchr_one_User_Id = $Teachers[0]->User_Id?$Teachers[0]->User_Id:0;
$Tchr_Two_name = '';
$Tchr_Two_image = $this->getStaff_Pic(0, $Teachers[0]->Gender );
$Tchr_Two_StaffID = 0;
$Tchr_Two_User_Id = 0;
}
$Data = array(
"TOneName" => $Tchr_one_name,
"TOneImage" => $Tchr_one_image,
"TOneID" => $Tchr_one_StaffID,
"TTwoName" => $Tchr_Two_name,
"TTwoImage" => $Tchr_Two_image,
"TTwoID" => $Tchr_Two_StaffID,
);
}else
{
$Tchr_one_name = '';
$Tchr_one_image = $this->getStaff_Pic(0,'F');
$Tchr_one_StaffID = 0;
$Tchr_one_User_Id = 0;
$Tchr_Two_name = '';
$Tchr_Two_image = $this->getStaff_Pic(0,'F');
$Tchr_Two_StaffID = 0;
$Tchr_Two_User_Id = 0;
$Data = array(
"TOneName" => $Tchr_one_name,
"TOneImage" => $Tchr_one_image,
"TOneID" => $Tchr_one_StaffID,
"TTwoName" => $Tchr_Two_name,
"TTwoImage" => $Tchr_Two_image,
"TTwoID" => $Tchr_Two_StaffID,
);
}
return $Data;
} | [
"function get_teachers() {\n\n $teacher_array = array();\n $teacher_details = array();\n\n // TODO get the roles that are specified as being able to grade forums\n $teacher_roles = array(3, 4);\n\n foreach ($this->courses as $course) {\n\n // this mulidimensional array isn't currently used.\n // $teacher_array[$coure->id] = array();\n\n // get teachers in this course with this role\n $course_teachers = get_role_users($teacher_roles, $course->context);\n if ($course_teachers) {\n\n foreach($course_teachers as $course_teacher) {\n\n if (!in_array($course_teacher->id, $teacher_array)) {\n\n $teacher_array[] = $course_teacher->id;\n\n }\n }\n }\n }\n if (count($teacher_array, 1) > 0) { // some teachers were returned\n $this->teacher_array = $teacher_array;\n $this->teachers = implode(',', $teacher_array);\n } else {\n $this->teacher_array = false;\n }\n }",
"public function getsubjectdetails($subject, $grade);",
"function getAllTeachersOfTheStudent() {\n return $this->_group->getAllTeachersOfTheGroup();\n }",
"function gradeStudent(){\n\t\t$data = array();\n\t\t$this->aauth = new Aauth();\n\t\t$data['aauth'] = $this->aauth;\n\t\t$data['db'] = $this->db;\n\n\t\t$studentID = $this->request->getVar('studentInfo');\n\t\t$assignID = $this->request->getVar('assign');\n\t\t$grade = $this->request->getVar('pointSlider2');\n\n\t\t$checkID = $this->db->query('SELECT id FROM assignGrade WHERE studentID = ' . \"'\" . $studentID . \"'\" . 'AND assignmentID = '.\"'\".$assignID.\"'\");\n\t\t$id = $checkID->getResult();\n\n\t\tforeach ($id as $row) {\n\t\t\t $pKey = $row->id;\n\t\t}\n\n\t\t//if the student already has a grade for that assigment we want to edit that grade instead of making a new grade entry.\n\t\tif($id){\n\t\t\t$gradeData = [\n\t\t\t\t'id' => $pKey,\n\t\t\t\t'studentID' => $studentID,\n\t\t\t\t'classID' => $this->aauth->getUserVar('classID'),\n\t\t\t\t'assignmentID' => $assignID,\n\t\t\t\t'points' => $grade\n\t\t\t];\n\n\t\t\t$this->gradeModel->save($gradeData);\n\t\t}else{\n\t\t\t$gradeData = [\n\t\t\t\t'studentID' => $studentID,\n\t\t\t\t'classID' => $this->aauth->getUserVar('classID'),\n\t\t\t\t'assignmentID' => $assignID,\n\t\t\t\t'points' => $grade\n\t\t\t];\n\n\t\t\t$this->gradeModel->save($gradeData);\n\t\t}\n\n\t\t$studentNameList = $this->db->query('SELECT lms_students.firstName, lms_students.lastName, lms_students.id, lms_students.info FROM lms_students WHERE lms_students.classID = ' . $this->aauth->getUserVar('classID'));\n\t\t$studentInfo = $studentNameList->getResult();\n\n\t\t$data['studentList'] = $studentInfo;\n\n\t\t$assignmentList = $this->db->query('SELECT title, description, maxPoints, id FROM assignment WHERE classID = ' . $this->aauth->getUserVar('classID'));\n\t\t$list = $assignmentList->getResult();\n\n\t\t$data['assignList'] = $list;\n\n\t\treturn view('grades', $data);\n\n\t}",
"public function instructorAllDetails()\n {\n /* code goes here */\n }",
"function print_student_grade($user, $course) {\n \n global $CFG;\n \n if (!empty($user)) {\n $grades[$user->id] = array(); // Collect all grades in this array\n $gradeshtml[$user->id] = array(); // Collect all grades html formatted in this array\n $totals[$user->id] = array(); // Collect all totals in this array\n }\n \n $strmax = get_string(\"maximumshort\");\n /// Collect modules data\n get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);\n\n/// Search through all the modules, pulling out grade data\n $sections = get_all_sections($course->id); // Sort everything the same as the course\n \n // prints table\n\n // flag for detecting whether to print table header or not\n $nograde = 0;\n \n for ($i=0; $i<=$course->numsections; $i++) {\n if (isset($sections[$i])) { // should always be true\n $section = $sections[$i];\n if ($section->sequence) {\n $sectionmods = explode(\",\", $section->sequence);\n foreach ($sectionmods as $sectionmod) {\n \n $mod = $mods[$sectionmod];\n if (empty($mod->modname)) {\n continue; // Just in case, see MDL-7150\n }\n if (!$instance = get_record($mod->modname, 'id', $mod->instance)) {\n continue;\n }\n if (!$cm = get_coursemodule_from_instance($mod->modname, $mod->instance)) {\n continue;\n }\n if (!$cm->visible) {\n $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);\n if(!has_capability('moodle/course:viewhiddenactivities', $modcontext)) {\n continue;\n }\n }\n $libfile = \"$CFG->dirroot/mod/$mod->modname/lib.php\"; \n \n if (file_exists($libfile)) {\n require_once($libfile);\n $gradefunction = $mod->modname.'_grades';\n if (function_exists($gradefunction)) { // Skip modules without grade function\n if ($modgrades = $gradefunction($mod->instance)) {\n if (!empty($modgrades->maxgrade)) {\n if ($mod->visible) {\n $maxgrade = $modgrades->maxgrade;\n } else {\n $maxgrade = $modgrades->maxgrade;\n }\n } else {\n $maxgrade = '';\n }\n \n if ($maxgrade) { \n if (!$nograde) {\n echo ('<table align=\"center\" class=\"grades\"><tr><th scope=\"col\">'.get_string('activity').'</th><th scope=\"col\">'.get_string('yourgrade','grades').'</th><th scope=\"col\">'.get_string('maxgrade','grades').'</th></tr>');\n }\n $nograde++; \n \n $link_id = grade_get_module_link($course->id, $mod->instance, $mod->module);\n $link = $CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$link_id->id;\n\n echo '<tr>';\n if (!empty($modgrades->grades[$user->id])) {\n $currentgrade = $modgrades->grades[$user->id];\n echo \"<td><a href='$link'>$mod->modfullname: \".format_string($instance->name,true).\"</a></td><td>$currentgrade</td><td>$maxgrade</td>\"; \n } else {\n echo \"<td><a href='$link'>$mod->modfullname: \".format_string($instance->name,true).\"</a></td><td>\".get_string('nograde').\"</td><td>$maxgrade</td>\"; \n }\n echo '</tr>'; \n }\n }\n }\n }\n }\n }\n }\n } // a new Moodle nesting record? ;-)\n \n if ($nograde) {\n echo '</table>';\n }\n}",
"function ilp_display_teacher_info($student_id)\t{\n \t \t\tglobal\t$CFG;\n \t \t\n \t \t\t$teacherinfo\t\t=\t$this->dbc->get_per_teacher_info($student_id);\n \t \t\t\n \t \t\t$infotexts\t\t\t=\tarray();\n \t \t\t\n \t \t\tforeach ($teacherinfo as $ti) {\n \t \t\t\t$this->return_texts($ti,$infotexts);\t\n \t \t\t}\n \t \t\t\n \t \t\tif (!empty($infotexts)) {\n\t \t \t\t$this->get_archive_student_info($infotexts);\n \t \t\t}\n \t }",
"function gradebook_grade_assignment_page($gradebook, $nid) { // only accessed by teacher\n og_context('node', $gradebook);\n $types = gradebookapi_get_assignment_types();\n $node = node_load($nid);\n if (in_array($node->type, $types)) {\n $grades = array();\n $students = array();\n $students = gradebookapi_get_students($gradebook);\n foreach ($students['uid'] as $uid) {\n $grade = gradebookapi_get_grade($uid, $nid); //now its safe to get $grade\n $grades[$uid] = (array) $grade;\n }\n return theme_gradebook_grade_form(drupal_get_form('gradebook_grade_form', $gradebook, $grades));\n }\n drupal_not_found();\n}",
"function manage_subject_teachers()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t$subject = decryptValue($data['i']);\n\n\t\t\n\n\t\t#Get the paginated list of teachers\n\n\t\t$data['teachers'] = $this->db->query($this->Query_reader->get_query_by_code('get_subject_teachers', array('isactive'=>'Y', 'subject'=> $subject)))->result_array();\n\n\t\t\t\t\n\n\t\t$data['subject_details'] = get_db_object_details($this, 'subjects', $subject);\n\n\t\t\n\n\t\t$data = add_msg_if_any($this, $data);\n\n\t\t$this->load->view('curriculum/manage_subject_teachers', $data);\n\n\t}",
"function getSections(){\n require('db_connect.php');\n $tID = NULL;\n $gID = NULL;\n $tNum = NULL;\n $gNum = NULL;\n $i = 0;\n $b = false;\n foreach(func_get_args() as $arg){\n //only allow two arguments first being teacher id second be grader id\n switch($i){\n case 0: \n $tID = $arg;\n break;\n case 1:\n $gID = $arg;\n break;\n default:\n $b = true;\n break;\n }\n $i++;\n if($i > 2)\n break;\n }\n //return if no arguments were passed in\n if($i == 0){\n echo \"No arguments were passed in. Please pass in either teacher ID or teacher and grader ID <br>\";\n return false;\n }\n if($b){\n echo \"Too many arguments, Please pass in Teacher id or teacher and grader id <br>\";\n return false;\n }\n $teacher;\n $grader;\n $tNum;\n if(!($tID == -1)){\n $teacher = getTeacherByUsername($tID);\n $tNum = $teacher['id'];\n }\n //if a grader id was passed in make sure it exists\n if($gID){\n $grader = getGraderByUsername($gID);\n $gNum = $grader['id'];\n //have teacher and grader ID from database\n //get the section number\n if(!($tID == -1)){\n $sql = \"SELECT section_id FROM to_section WHERE grader_id=$gNum AND instructor_id=$tNum\";\n }else\n $sql = \"SELECT section_id FROM to_section WHERE grader_id=$gNum\";\n $result = mysqli_query($GLOBALS['conn'], $sql);\n $arr;\n $i = 0;\n //for each result add it to an array\n while($x = $result->fetch_assoc()){\n $arr[$i] = $x['section_id'];\n $i++;\n }\n return $arr;\n echo \"<br>\";\n }else{\n //only teacher id was passed in\n $sql = \"SELECT section_id FROM to_section WHERE instructor_id=$tNum\";\n $result = mysqli_query($GLOBALS['conn'], $sql);\n $arr;\n $i = 0;\n //for each result add it to an array\n while($x = $result->fetch_assoc()){\n $arr[$i] = $x['section_id'];\n $i++;\n }\n //if any results are found return them\n if($arr){\n return $arr;\n }else{\n echo 'No section found.';\n return false;\n }\n echo \"<br>\";\n }\n mysqli_free_result($result);\n }",
"function emailTeacher($questions, $stuUserObj, $logObj, $grade=0)\n\t{\n\t\t\t$u = $stuUserObj;\n\n\t\t\t$qstans .= \"Student ID: \".$stuUserObj->username.\"\\n\";\n\t\t\t$qstans .= \"Name: \".$stuUserObj->profile->values['firstname'].\" \".$stuUserObj->profile->values['lastname'].\"\\n\";\n\t\t\t$qstans .= \"Assessment: Name \".$this->displayName.\"\\n\";\n\t\t\t$qstans .= \"Date Started: \".date('m-d-y h:i A', $u->sessionvars['asmt_date_start']).\"\\n\";\n\t\t\t$qstans .= \"Date Stopped: \".date('m-d-y h:i A', $logObj->end_date).\"\\n\\n\";\n\n\t\t\t$questionCount = count($questions);\n\t\t\tfor ($i=0; $i<$questionCount; $i++)\n\t\t\t{\n\t\t\t\t$num = $i +1;\n\t\t\t\t$questionId = $questions[$i]->assessmentQuestionId;\n\t\t\t\t\t$qstans .= $num.\".\\n\";\n\t\t\t\t\t$qstans .= \"Type of Question: \".$questions[$i]->questionDisplay.\"\\nQuestion: \".$questions[$i]->questionText.\"\\n\";\n\t\t\t\t\t$qstans .= \"Points Assigned: \".$questions[$i]->answer->pointsEarned.\"\\n\";\t\n\t\t\t\t\tif ($questions[$i]->questionType == QUESTION_MATCHING || $questions[$i]->questionType == QUESTION_MANSWER) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$answer = unserialize($questions[$i]->answer->assessmentAnswerValues);\n\t\t\t\t\t\t\t$qstans .= \"Answers: \\n\";\n\t\t\t\t\t\t\tfor ($y=0;$y<$answerCount; $y++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ansnum = $y + 1;\n+ //$qstans .= \"\\t $ansnum. \".$answer[$y].\"\\n\";\n+ //trying out a fix for a bug where the teacher just\n+ //gets the index of the correct answer\n+ //MAK 11-03-04\n+ $qstans .= \"\\t $ansnum. \".$questions[$i]->questionChoices[$y]->label .\" \" .$answer[$y].\"\\n\";\n \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$qstans .= \"Answer: \".$questions[$i]->answer->assessmentAnswerValues.\"\\n\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$total_points_earned += $questions[$i]->answer->pointsEarned;\n\t\t\t\t\t\t$total_possible_points += $questions[$i]->questionPoints;\n\t\t\t}\n\t\t\t\n\t\t\t$qstans .= \"\\n\\nTotal Points Earned: \". $total_points_earned .\" out of \". $total_possible_points;\n\t\t\t# Send email to teacher\n\t\t\t$db = DB::getHandle();\n\t\t\t$sql = \"select email from lcUsers where username='\".$u->activeClassTaken->facultyId.\"'\";\n\t\t\t$db->queryOne($sql);\n\t\t\t$email = $db->Record['email'];\n\t\t\t$subject = $this->displayName.\" completed by \".$u->profile->values['firstname'].\" \".$u->profile->values['lastname'];\n\n\t\t\tif ( mail($email, $subject, $qstans) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t\t\n\t}",
"function getAllTeachersOfTheGroup();",
"function assign_teacher()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'a', 't'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\t\t\n\n\t\tif($data['save'])\n\n\t\t{\t\n\n\t\t\t$data['formdata'] = $data;\t\t\n\n $required_fields = array('subject', 'class', 'teacher');\n\n\t\t\t\n\n\t\t\tforeach($data as $key => $data_value)\n\n\t\t\t\t$data[$key] = restore_bad_chars($data_value);\n\n\t\t\t\n\n\t\t\t$_POST = clean_form_data($data);\n\n\t\t\t$validation_results = validate_form('', $_POST, $required_fields);\n\n\t\t\t$feename_error = '';\n\n \n\n\t\t\t#Only proceed if the validation for required fields passes\n\n\t\t\tif($validation_results['bool'])\n\n\t\t\t{\n\n if(!empty($data['editid']))\n\n {\n\n // print_r('Entered'); exit();\n\n\t\t\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('update_subject_teacher',array_merge($_POST, array('id'=> $data['editid']))));\n\n \t \t}\n\n\t\t\t \telse \n\n \t{\n\n\t\t\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('assign_subject_teacher',$_POST));\n\n\t\t\t\t\tif($result)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t#Delete previous assignments\n\n\t\t\t\t\t#\t$this->db->delete('subjectteacherassignments', 'class ='.$data['class'].' AND subject='.$data['subject'].' AND teacher !='.$data['teacher'].((!empty($data['paper']))? ' AND paper='.$data['paper'] : ''));\n\n\t\t\t\t\t}\n\n \t\t}\n\n\t\t\t\t\n\n \t\t#Format and send the errors\n\n \tif(!empty($result) && $result)\n\n\t\t\t\t{\t\t\t\t\t\n\n\t\t\t\t\t$user_details = get_db_object_details($this, 'schoolusers', $data['teacher']);\n\n\t\t\t\t\t$subject_details = get_db_object_details($this, 'subjects', $data['subject']);\n\n\t\t\t\t\t$data['msg'] = $user_details['firstname'].' '.$user_details['lastname'].' has been successfully assigned as <br />the '.$subject_details['subject'].' teacher for '.get_class_title($this, $data['class']);\n\n\t\t\t\t\t$data['formdata'] = array();\n\n \t }\n\n \t else if(empty($data['msg']))\n\n \t {\n\n\t\t\t\t \t$data['msg'] = \"ERROR: The subject-teacher assignment could not be saved or was not saved correctly.\";\t\t\t\t\t\n\n \t }\n\n }\n\n \n\n\t\t\t$data['requiredfields'] = $validation_results['requiredfields'];\n\n\t\t}\n\n \n\n\t\t$subjectid = $data['subject'];\n\n\t\t\t\n\n\t\t$data['formdata'] = $this->Query_reader->get_row_as_array('search_subjects', array('isactive' => 'Y', 'limittext'=>'', 'searchstring' => ' AND id = '.$subjectid));\n\n\t\t$classes_array = explode('|', $data['formdata']['classes']);\n\n\t\t$classes_array = remove_empty_indices($classes_array);\n\n\t\t$classes_str = implode(',', $classes_array);\n\n\t\t\n\n\t\t$data['classes'] = $this->classobj->get_classes('', ' AND id IN ('.$classes_str.')');\n\n\t\t\n\n\t\t$data['papers'] = $this->db->query($this->Query_reader->get_query_by_code('search_papers', array('isactive' => 'Y', 'searchstring' => ' AND subject = '.$subjectid, 'limittext' => '')))\n\n\t\t\t\t\t\t\t->result_array();\n\n\t\t\n\n\t\t$data['staff'] = $this->db->query($this->Query_reader->get_query_by_code('search_school_users', array('limittext' =>'', 'searchstring' => ' AND school ='.$this->myschool['id'])))\n\n\t\t\t\t\t\t\t->result_array();\n\n\t\t\n\n\t\t$this->load->view('incl/subject_teacher_form', $data);\n\n\t}",
"public function get_teacher_info()\r\n\t\t{\r\n\t\t\t$teacher_id = $this->input->post('t_id');\r\n\t\t\t$result = $this->admin_model->find_teacher_info($teacher_id);\r\n\r\n\t\t\techo $result->first_name . \"-\" . $result->last_name . \"-\" . $result->classroom_id;\r\n\t\t}",
"public function get_additionteacherinfo_output() {\n global $DB, $OUTPUT, $CFG;\n\n $result = '';\n\n $result .= html_writer::start_tag('div', array('id' => 'additional-teachers'));\n\n // Display section heading if necessary\n $display_additional_teachers_heading = ($this->data->block_config->additional_teachers_heading > 0);\n\n if($display_additional_teachers_heading) {\n $headings_options = array(get_string('no_teacher_heading', 'block_module_info'), get_string('custom_teacher_heading', 'block_module_info'));;\n $headings = get_config('block_module_info', 'additional_teacher_role_name_options');\n\n if(!empty($headings) && strlen($headings) > 0) {\n \t$headings_options = array_merge($headings_options, explode(\"\\r\\n\", $headings));\n\n \t// Set the custom heading if there is one.\n \tif(!empty($this->data->block_config->custom_additional_teachers_heading)) {\n \t $headings_options[1] = $this->data->block_config->custom_additional_teachers_heading;\n \t}\n }\n $result .= html_writer::tag('h2', $headings_options[$this->data->block_config->additional_teachers_heading], array('class'=>'additional-teachers-heading'));\n }\n\n // First, check to see if there is any additional teacher information\n if (! empty($this->data->block_config->additional_teacher_email) ) {\n $result .= html_writer::start_tag('div', array('id'=>'additional-teachers-pane'));\n // Display each additional teacher\n foreach($this->data->block_config->additional_teacher_email as $key=>$value) {\n // NOTE: the following logic assumes that users can't change their email addresses...\n if($thisteacher = $DB->get_record('user', array('email' => $value))) {\n $display_options = array_values($this->data->block_config->display_additional_teacher_options[$key]);\n // Profile picture - if needed\n if(in_array('profilepic', $display_options)) {\n $pic_size = $this->data->block_config->additional_teacher_profilepic_size[$key];\n $size = (strcmp($pic_size,'small')==0)?'50':'64';\n $result .= $OUTPUT->user_picture($thisteacher, array('size' => $size, 'class'=>'additional-teacher-profile-pic'));\n }\n\n // Name:\n if(in_array('name', $display_options) && $thisteacher->firstname && $thisteacher->lastname) {\n $result .= html_writer::tag('div', fullname($thisteacher, true), array('class'=>'additional-teacher-name'));\n }\n\n // Email address:\n if(in_array('email', $display_options) && $thisteacher->email) {\n $result .= html_writer::start_tag('div', array('class'=>'additional-teacher-email'));\n $result .= obfuscate_mailto($thisteacher->email, '');\n $result .= html_writer::end_tag('div');\n }\n // Web page\n if(in_array('url', $display_options) && $thisteacher->url) {\n $url = $thisteacher->url;\n if (strpos($thisteacher->url, '://') === false) {\n $url = 'http://'. $url;\n }\n $result .= html_writer::tag('div', '<a href=\"'.s($url).'\">'.s($thisteacher->url).'</a>', array('class'=>'additional-teacher-url'));\n }\n // Standard fields:\n if(in_array('icq', $display_options) && $thisteacher->icq) {\n $result .= html_writer::tag('div', get_string('icqnumber').': <a href=\\\"http://web.icq.com/wwp?uin=\\\"'.urlencode($thisteacher->icq).'\\\">'.s($thisteacher->icq).' <img src=\\\"http://web.icq.com/whitepages/online?icq=\\\"'.urlencode($thisteacher->icq).'&img=5\\\" alt=\\\"\\\" /></a>', array('class'=>'additional-teacher-icq'));\n }\n if(in_array('skype', $display_options) && $thisteacher->skype) {\n $result .= get_string('skypeid').': '.'<a href=\"callto:'.urlencode($thisteacher->skype).'\">'.s($thisteacher->skype).\n ' <img src=\"http://mystatus.skype.com/smallicon/'.urlencode($thisteacher->skype).'\" alt=\"'.get_string('status').'\" '.\n ' /></a>';\n }\n if(in_array('aim', $display_options) && $thisteacher->aim) {\n $result .= html_writer::tag('div', '<a href=\"http://edit.yahoo.com/config/send_webmesg?.target='.urlencode($thisteacher->yahoo).'&.src=pg\">'.s($thisteacher->yahoo).\" <img src=\\\"http://opi.yahoo.com/online?u=\".urlencode($thisteacher->yahoo).\"&m=g&t=0\\\" alt=\\\"\\\"></a>\", array('class'=>'additional-teacher-aim'));\n }\n if(in_array('yahoo', $display_options) && $thisteacher->yahooid) {\n $result .= html_writer::tag('div', get_string('yahooid').': '.'<a href=\"http://edit.yahoo.com/config/send_webmesg?.target='.urlencode($thisteacher->yahoo).'&.src=pg\">'.s($thisteacher->yahoo).\" <img src=\\\"http://opi.yahoo.com/online?u=\".urlencode($thisteacher->yahoo).\"&m=g&t=0\\\" alt=\\\"\\\"></a>\", array('class'=>'additional-teacher-yahoo'));\n }\n if(in_array('msn', $display_options) && $thisteacher->msnid) {\n $result .= html_writer::tag('div', get_string('msnid').': '.s($thisteacher->msn), array('class'=>'additional-teacher-msn'));\n }\n if(in_array('idnumber', $display_options) && $thisteacher->idnumber) {\n $result .= html_writer::tag('div', get_string('idnumber').': '.s($thisteacher->idnumber), array('class'=>'additional-teacher-idnumber'));\n }\n if(in_array('institution', $display_options) && $thisteacher->institution) {\n $result .= html_writer::tag('div', get_string('institution').': '.s($thisteacher->institution), array('class'=>'additional-teacher-institution'));\n }\n if(in_array('department', $display_options) && $thisteacher->department) {\n $result .= html_writer::tag('div', get_string('department').': '.s($thisteacher->department), array('class'=>'additional-teacher-department'));\n }\n if(in_array('phone1', $display_options) && $thisteacher->phone1) {\n $result .= html_writer::tag('div', get_string('phone').': '.s($thisteacher->phone1), array('class'=>'additional-teacher-phone'));\n }\n if(in_array('phone2', $display_options) && $thisteacher->phone2) {\n $result .= html_writer::tag('div', get_string('phone2').': '.s($thisteacher->phone2), array('class'=>'additional-teacher-phone2'));\n }\n if(in_array('address', $display_options) && $thisteacher->address) {\n $result .= html_writer::tag('div', get_string('address').': '.s($thisteacher->address), array('class'=>'additional-teacher-address'));\n }\n\n // Custom fields:\n if ($fields = $DB->get_records('user_info_field')) {\n foreach ($fields as $field) {\n if(in_array($field->shortname, $display_options)) {\n require_once($CFG->dirroot.'/user/profile/lib.php');\n require_once($CFG->dirroot.'/user/profile/field/'.$field->datatype.'/field.class.php');\n $newfield = 'profile_field_'.$field->datatype;\n $formfield = new $newfield($field->id, $thisteacher->id);\n if ($formfield->is_visible() and !$formfield->is_empty()) {\n $result .= html_writer::tag('div', format_string($formfield->field->name.': ').$formfield->display_data(), array('class'=>'additional-teacher-custom'));\n }\n }\n }\n }\n } else {\n $result .= html_writer::start_tag('p');\n $result .= html_writer::tag('strong', $value.get_string( 'convenor_not_found', 'block_module_info' ));\n $result .= html_writer::end_tag('p');\n }\n }\n $result .= html_writer::end_tag('div');\n\n } else {\n if($display_additional_teachers_heading) {\n $result .= $this->output->box(get_string('noadditionalteachersavailable', 'block_module_info'));\n }\n }\n\n $result .= html_writer::end_tag('div');\n\n return $result;\n }",
"public function gradingInfo() {\n\t\treturn '';\n\t}",
"public function getTeachingFaculty(){\r\n return $this->_teachingFaculty;\r\n }",
"public function teacher()\n {\n $data['title'] = 'Teacher\\'s Course Page';\n\n $course_id = $this->uri->segment(3);\n $classroom_id = $this->uri->segment(4);\n $data['classroom_id'] = $classroom_id;\n $data['course_info'] = $this->course->get_teacher_course($course_id, $classroom_id);\n $data['enrolled_students'] = $this->course->get_enrolled_students_for_teacher($classroom_id);\n $data['quizs'] = $this->course->get_quizs_for_teacher($classroom_id);\n $data['num_questions'] = $this->course->get_number_of_questions_for_teacher($data['quizs']);\n\n $this->load->view('templates/header');\n $this->load->view('courses/teacher', $data);\n $this->load->view('templates/footer');\n }",
"public function presentGradeSubject(){\n if($this->subject != null){\n return 'Grade '.$this->subject->grade->grade_name.' '.$this->subject->subject_name;\n } else {\n return '';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .gobgpapi.LongLivedGracefulRestartConfig config = 1; | public function setConfig($var)
{
GPBUtil::checkMessage($var, \Gobgpapi\LongLivedGracefulRestartConfig::class);
$this->config = $var;
return $this;
} | [
"public function setLongLivedGracefulRestart($var)\n\t{\n\t\tGPBUtil::checkMessage($var, \\Gobgpapi\\LongLivedGracefulRestart::class);\n\t\t$this->long_lived_graceful_restart = $var;\n\n\t\treturn $this;\n\t}",
"public function getLongLivedGracefulRestart()\n\t{\n\t\treturn $this->long_lived_graceful_restart;\n\t}",
"protected function reconfigureForceRestart()\n {\n return 0;\n }",
"public function getGracefulRestart()\n\t{\n\t\treturn $this->graceful_restart;\n\t}",
"function tailscale_resync_config_hook()\n{\n\tglobal $tailscale_is_installing;\n\n\tif (!$tailscale_is_installing)\n\t\ttailscale_service_checkpoint();\n\n\t$need_restart = false;\n\n\tif (tailscale_map_and_write_rcconf(tailscale_tailscaled_rcconf_map(), TAILSCALED_RCCONF))\n\t\t$need_restart = true;\n\n\tif (tailscale_map_and_write_rcconf(tailscale_pfsense_tailscaled_rcconf_map(), PFSENSE_TAILSCALED_RCCONF))\n\t\t$need_restart = true;\n\n\t# we perform this in the background, it can otherwise block for a while\n\tif ($need_restart && !$tailscale_is_installing)\n\t\ttailscale_run_rc_command(PFSENSE_TAILSCALED_RC, 'restart');\n\n\t# definitely not installing at this point\n\t$tailscale_is_installing = false;\n}",
"public function getMpGracefulRestart()\n\t{\n\t\treturn $this->mp_graceful_restart;\n\t}",
"public function safeRestart()\n {\n $response = $this->jenkinsRequest([\n 'POST', $this->buildUrl(URL::SAFE_RESTART),\n ]);\n\n return $this->getResponseTrueOrStatusCode($response, 503);\n }",
"public function reconfigureAction()\n {\n if ($this->request->isPost()) {\n $this->sessionClose();\n\n $backend = new Backend();\n\n if (!$this->serviceEnabled() || $this->reconfigureForceRestart()) {\n $backend->configdRun(escapeshellarg(static::$internalServiceName) . ' stop');\n }\n\n if ($this->invokeInterfaceRegistration()) {\n $backend->configdRun('interface invoke registration');\n }\n\n if (!empty(static::$internalServiceTemplate)) {\n $backend->configdRun('template reload ' . escapeshellarg(static::$internalServiceTemplate));\n }\n\n if ($this->serviceEnabled()) {\n $runStatus = $this->statusAction();\n if ($runStatus['status'] != 'running') {\n $backend->configdRun(escapeshellarg(static::$internalServiceName) . ' start');\n } else {\n $backend->configdRun(escapeshellarg(static::$internalServiceName) . ' reload');\n }\n }\n\n return array('status' => 'ok');\n } else {\n return array('status' => 'failed');\n }\n }",
"public function queueRestart()\n {\n $this->readConfig();\n $this->config['ToDo']['raspi_reboot'] = 'True';\n $this->saveConfig();\n }",
"public function GameserverRestarting($gsid)\n {\n GameServer::SetServerStatus($gsid, GameServerStatus::RESTARTING);\n }",
"public function getRestartAfterFail(): bool\n {\n return $this->restartAfterFail;\n }",
"public function getRestartDisabledWhileLoggedIn()\n {\n if (array_key_exists(\"restartDisabledWhileLoggedIn\", $this->_propDict)) {\n return $this->_propDict[\"restartDisabledWhileLoggedIn\"];\n } else {\n return null;\n }\n }",
"public function rebootServer()\n {\n $this->checkServer();\n $body = [\n 'restart_server' => [\n 'stop_type' => 'hard',\n ],\n ];\n\n return $this->callApi('post', '/server/'.$this->server.'/restart', $body);\n }",
"public function getRequiresRestartValue()\n {\n return $this->readWrapperValue(\"requires_restart\");\n }",
"public function setAptbconfstopvendchg($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->aptbconfstopvendchg !== $v) {\n $this->aptbconfstopvendchg = $v;\n $this->modifiedColumns[ConfigApTableMap::COL_APTBCONFSTOPVENDCHG] = true;\n }\n\n return $this;\n }",
"public function get_rebootCountdown()\n { $json_val = $this->_getAttr(\"rebootCountdown\");\n return (is_null($json_val) ? Y_REBOOTCOUNTDOWN_INVALID : intval($json_val));\n }",
"function config_lock($reason = \"\") {\n\tglobal $g, $process_lock;\n\n\t/* No need to continue if we're the ones holding the lock */\n\tif ($process_lock)\n\t\treturn;\n\n\t$lockfile = \"{$g['varrun_path']}/config.lock\";\n\n\t$n = 0;\n\twhile ($n < 10) {\n\t\t/* open the lock file in append mode to avoid race condition */\n\t\tif ($fd = @fopen($lockfile, \"x\")) {\n\t\t\t/* succeeded */\n\t\t\tfwrite($fd, $reason);\n\t\t\t$process_lock = true;\n\t\t\tfclose($fd);\n\t\t\treturn;\n\t\t} else {\n\t\t\t/* file locked, wait and try again */\n\t\t\t$process_lock = false;\n\t\t\tsleep(1);\n\t\t\t$n++;\n\t\t}\n\t}\n}",
"protected function getLastRestart()\n {\n return Cache::get(\n 'beyondcode:websockets:restart', 0\n );\n }",
"public function stuckLong()\n {\n $this->arguments[] = '--stuck-long';\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion de validacion departamento que corresponda a la jurisdiccion adecuada | function controlar_coincidencia_jurisdiccion_departamento(){
if (isset($this->data[$this->name]['departamento_id'])){
if ($this->data[$this->name]['departamento_id'] == '') return false;
if ($this->data[$this->name]['departamento_id'] != ''){
$jur_id = $this->data[$this->name]['jurisdiccion_id'];
$depto_id = $this->data[$this->name]['departamento_id'];
$this->Departamento->recursive = -1;
$tot = $this->Departamento->find('count',array('conditions'=> array('Departamento.id'=>$depto_id, 'Departamento.jurisdiccion_id'=>$jur_id)));
return ($tot > 0);
}
}
return false;
} | [
"public function guardarDepartamento() {\n $sql = \"INSERT INTO departamentos VALUES(NULL, '{$this->getNombreDepartamento()}');\";\n $guardar = $this->conexion->query($sql);\n $resultado = false;\n \n if ($guardar) {\n $resultado = true;\n }\n return $resultado;\n }",
"function validarDatosPresupuesto($presupuesto){\n\t\tswitch ($presupuesto[\"tipoServicio\"]) {\n\t\t\tcase 'grua':\n\t\t\t\tif($presupuesto[\"horasGrua\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa no pueden estar vacías.</p>\";\n\t\t\t\t}else if($presupuesto[\"horasGrua\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa deben ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"horasGrua\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para las horas.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"horasGrua\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Las horas de grúa se expresan sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_escombros':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_poda':\n\t\t\t\tif($presupuesto[\"tamañoCuba\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El tamaño no puede estar vacío.</p>\";\n\t\t\t\t}else if ($presupuesto[\"tamañoCuba\"]!=\"pequeña\" && $presupuesto[\"tamañoCuba\"]!=\"mediana\" && $presupuesto[\"tamañoCuba\"]!=\"grande\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tamaño válido</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'cuba_estiercol': \n\t\t\t\tif($presupuesto[\"tamañoCuba\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El tamaño no puede estar vacío.</p>\";\n\t\t\t\t}else if ($presupuesto[\"tamañoCuba\"]!=\"pequeña\" && $presupuesto[\"tamañoCuba\"]!=\"mediana\" && $presupuesto[\"tamañoCuba\"]!=\"grande\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tamaño válido</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'leña':\n\t\t\t\tif($presupuesto[\"pesoLeña\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso no puede estar vacío.</p>\";\n\t\t\t\t}else if($presupuesto[\"pesoLeña\"]<100){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso debe ser mayor o igual que 100.</p>\";\n\t\t\t\t}else if($presupuesto[\"pesoLeña\"]>4500){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso debe ser menor o igual que 4500.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"pesoLeña\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para el peso.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"pesoLeña\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>El peso se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'aridos':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'otros_materiales':\n\t\t\t\tif($presupuesto[\"distancia\"]==\"\"){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia no puede estar vacía.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]<1){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia de ser mayor o igual que uno.</p>\";\n\t\t\t\t}else if($presupuesto[\"distancia\"]>35){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia debe ser menor o igual que 35.</p>\";\n\t\t\t\t}else if(!ctype_digit($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un valor entero válido para la distancia.</p>\";\n\t\t\t\t}else if(!is_numeric($presupuesto[\"distancia\"])){\n\t\t\t\t\t$erroresPresupuesto[] = \"<p>La distancia se expresa sólo con números.</p>\";\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$erroresPresupuesto[] = \"<p>Introduzca un tipo de servicio válido</p>\";\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $erroresPresupuesto;\n\t}",
"function validarInscripcionEstudiante()\n {\n $this->datosInscripcion=$_REQUEST;\n $retorno['pagina']=$this->datosInscripcion['retornoPagina']=\"admin_consultarInscripcionesEstudiante\";\n $retorno['opcion']=$this->datosInscripcion['retornoOpcion']=\"mostrarConsulta\";\n $this->datosInscripcion['retornoParametros']=array('codProyectoEstudiante'=>$_REQUEST[\"codProyectoEstudiante\"],\n 'planEstudioEstudiante'=>$_REQUEST[\"planEstudioEstudiante\"],\n 'codEstudiante'=>$_REQUEST[\"codEstudiante\"]);\n $back='';\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value) {\n $back.=\"&\".$key.\"=\".$value;\n }\n $retorno['parametros']=$back;\n $retorno['nombreEspacio']=$this->consultarNombreEspacio();\n if (trim($_REQUEST['estado_est'])=='B'||trim($_REQUEST['estado_est'])=='J')\n {\n if(isset($_REQUEST['reprobado'])||isset($_REQUEST['confirmaPlan'])||isset($_REQUEST['cancelado']))\n {\n\n }else\n {\n $this->verificarEspacioReprobado($retorno);\n }\n }else\n {\n \n }\n\n if (isset($_REQUEST['confirmaPlan'])&&$_REQUEST['confirmaPlan']==1)\n {\n $this->inscribirEstudiante($this->datosInscripcion);\n }\n else\n {\n if(isset($_REQUEST['cancelado'])&&$_REQUEST['cancelado']==1)\n {\n $this->verificarEspacioPlan($this->datosInscripcion);\n }\n else\n {\n $this->verificarInscrito($retorno);\n $this->verificarCruce($retorno);\n $this->verificarSobrecupo($retorno);\n $this->verificarCancelado($retorno);\n $this->verificarEspacioPlan($retorno);\n $this->verificarCreditos($retorno);\n $this->verificarCreditosPorClasificacion($retorno);\n \n }\n $this->inscribirEstudiante($this->datosInscripcion);\n }\n\n//si hay confirmación de cancelado pasa a varificar plan\n//si hay confirmacion de planEstudio, pasa a registrar\n //si no hay, realiza validaciones\n\n }",
"public static function buscarCodigoDepartamento($codigo){\r\n\r\n\t\t\t\t$objDep = null;//Objeto departamento inicializado a null \r\n\t\t $arrayDepartamento = DepartamentoPDO::buscarCodigoDepartamento($codigo);//Llama al metodo con el mismo nombre de DepartmantoPDO\r\n\t\t \r\n\t\t if($arrayDepartamento) {//Si hay valores en el array\r\n\r\n\t\t \t\r\n\t\t \t$objDep = new Departamento($codigo,$arrayDepartamento['descripcionD']);//Crea un objeto departamento\r\n\r\n\r\n\r\n\t\t \t\r\n\t\t }\r\n\t\t \r\n\t\t return $objDep;//Lo debuelve\r\n\t\t\t}",
"function fnValidaPartidaOrden ($sContrato,$sNumeroOrden,$sIdConvenio,$sWbs, $sNumeroActividad,$sIdTipoActividad)\n{\n global $dExcedenteOrden;\n global $dInstaladoOrden;\n global $dCantidadOrden;\n global $cantidadIns;\n\n $dExcedenteOrden = 0 ;\n $dInstaladoOrden = 0 ;\n $dCantidadOrden = 0 ;\n\n $sql = \"Select\n (dInstalado + dExcedente) as dInstalado ,\n dCantidad\n from actividadesxorden\n where\n sContrato = '$sContrato'\n And sIdConvenio = '$sIdConvenio'\n And sNumeroOrden = '$sNumeroOrden'\n And sWbs = '$sWbs'\n And sNumeroActividad = '$sNumeroActividad'\n And sTipoActividad = 'Actividad'\";\n $rs = mysql_query($sql);\n if($row = mysql_fetch_array($rs))\n {\n $dInstaladoOrden = $row['dInstalado'] ;\n $dCantidadOrden = $row['dCantidad'] ;\n $dError = ($dInstaladoOrden + $cantidadIns) ;\n $dError = $dError - $dCantidadOrden ;\n If ( $dError > 0)\n {\n $dExcedenteOrden = ( $dInstaladoOrden + $cantidadIns) - $dCantidadOrden ;\n return False;\n }\n else\n return True;\n }\n else\n return False;\n}",
"function EliminarDepartamento()\n\t{\n\t\t\n\t}",
"function validatePaciente($apellido,$nombre,$fecha_nac,$domicilio,$genero,$tiene_documento,$tipoDoc,\n\t\t$numeroDocumento, $nro_historia_clinica, $nro_carpeta){\n\n\t\t$mensaje = NULL;\n\n\t\tif(empty($apellido)){\n\t\t\t$mensaje .= \"Debe informar apellido \";\n\t\t}\n\n\t\tif(empty($nombre)){\n\t\t\t$mensaje .= \"Debe informar nombre \";\n\t\t}\n\n\t\tif(empty($fecha_nac)){\n\t\t\t$mensaje .= \"Debe informar fecha de nacimiento\\n\";\n\t\t}\n\t\t//elseif(!Validaciones::EsFecha($fecha_nac,'d/m/Y')){\n\t\t//\t$mensaje .= \"Formato de fecha de nacimiento inválido (dd/mm/YY)\\r\";\n\t\t//}\n\n\t\tif(empty($domicilio)){\n\t\t\t$mensaje .= \"Debe informar domicilio \\n\";\n\t\t}\n\n\t\tif(empty($genero)){\n\t\t\t$mensaje .= \"Debe informar genero \\n\";\n\t\t}\n\n\n\t\tif(!empty($nro_historia_clinica)){\n\t\t\t\n\t\t\tif(!Validaciones::EsEntero($nro_historia_clinica)){\n\t\t\t\t$mensaje .= \"Número de historia clínica debe ser entero\\n\";\n\t\t\t}\n\t\t\telseif ($nro_historia_clinica > 999999) {\n\t\t\t\t$mensaje .= \"Número de historia clínica debe contener hasta 6 cifras\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($nro_carpeta)){\n\t\t\t\n\t\t\tif(!Validaciones::EsEntero($nro_carpeta)){\n\t\t\t\t$mensaje .= \"Número de carpeta debe ser entero\\n\";\n\t\t\t}\n\t\t\telseif ($nro_carpeta > 99999) {\n\t\t\t\t$mensaje .= \"Número de carpeta debe contener hasta 5 cifras\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif(isset($mensaje)){\n\t\t\tthrow new Exception($mensaje, 20);\n\t\t}\n\t}",
"private function carregarDepartamentos()\n {\n $oGestaoProcessoVencido = new GestaoProcessoVencido();\n $sqlGestao = $oGestaoProcessoVencido->sql_query_file(null, \"p102_db_usuarios\", null,\n \"p102_db_usuarios = {$this->oUsuario->getCodigo()}\");\n $rs = db_query($sqlGestao);\n\n if (pg_num_rows($rs) > 0) {\n $this->lCargoPrincipal = true;\n $this->aDepartamentosGeridos = $this->getTodosDepartamentos();\n } else {\n $oGestaoDepartamentoProcesso = new GestaoDepartamentoProcesso();\n $sqlGestao = $oGestaoDepartamentoProcesso->sql_query(null, \"db_depart.coddepto\", null,\n \"p103_db_usuarios = {$this->oUsuario->getCodigo()}\");\n $rs = db_query($sqlGestao);\n\n if (pg_num_rows($rs) > 0) {\n $this->aDepartamentosGeridos = \\db_utils::makeCollectionFromRecord($rs, function ($oDados) {\n return new Departamento($oDados->coddepto);\n });\n }\n }\n }",
"function fncValidaDI_45($IdEstado, $GestorErr, $NumReg, $Campo, $Campo2)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_45 = \"(45)Periodo de Pago Inicial\";\n\t$DI_45_ErrTam = \"Periodo de Pago Inicial ser de 8 Caracteres AAAAMMDD (AAAA=año, MM=mes, DD=día)\";\n\t$DI_45_noDI \t = \"Periodo de Pago Inicial no corresponde al formato establecido por DGRH(AAAAMMDD (AAAA=año, MM=mes, DD=día)\";\n\t$DI_45_PerFinal \t = \"Periodo de Pago Inicial no puede ser posterior a Periodo de Pago Final\";\t\t\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == OCHO)\n\t{\n\t\tif(!validateDate($LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_45.\"|\".$LocCampo.\"|\" . $DI_45_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\n\n\t\tif(validateDate($LocCampo) and validateDate($Campo2))\t\n\t\t{\n\t\t\t$Fecha1 = date_create($LocCampo);\n\t\t\t$Fecha2 = date_create($Campo2);\n\t\t\t$interval = date_diff($Fecha1, $Fecha2);\n\t\t\tif(intval($interval->format('%R%a') )< CERO)\n\t\t\t{\n\t\t\t\t\t$Error = $NumReg .\"|\".$DI_45.\"|\".$LocCampo.\"|\" . \n\t\t\t\t\t$DI_45_PerFinal .\"(\" .$LocCampo.\" )(\". $Campo2.\")|\\n\";\n\t\t\t\t\tfwrite($GestorErr, $Error);\n\t\t\t\t\t$Bandera = UNO;\n\t\t\t}\t\n\t\t}\t\n\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_45.\"|\".$LocCampo.\"|\" . $DI_45_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}",
"private static function validarParametrosUnidad($id_unidad = null, $nombre = null, $descripcion = null, $es_entero = null, $activa = null)\n {\n //valida que la unidad exista y que este activa\n /*if (!is_null($id_unidad)) {\n $unidad = UnidadDAO::getByPK($id_unidad);\n if (is_null($unidad))\n return \"La unidad con id \" . $id_unidad . \" no existe\";\n \n if (!$unidad->getActiva())\n return \"La unidad esta desactivada\";\n } //!is_null($id_unidad)*/\n \n //valida que el nombre este en el rango y que no se repita\n if (!is_null($nombre)) {\n $e = self::validarString($nombre, 100, \"nombre\");\n if (is_string($e))\n return $e;\n if (!is_null($id_unidad)) {\n $unidades = array_diff(UnidadDAO::search(new Unidad(array(\n \"nombre\" => trim($nombre)\n ))), array(\n UnidadDAO::getByPK($id_unidad)\n ));\n } //!is_null($id_unidad)\n else {\n $unidades = UnidadDAO::search(new Unidad(array(\n \"nombre\" => trim($nombre)\n )));\n }\n foreach ($unidades as $unidad) {\n if ($unidad->getActiva())\n return \"El nombre (\" . $nombre . \") ya esta siendo usado por la unidad \" . $unidad->getIdUnidad();\n } //$unidades as $unidad\n } //!is_null($nombre)\n \n //valida que la descripcion este en rango\n if (!is_null($descripcion)) {\n $e = self::validarString($descripcion, 255, \"descripcion\");\n if (is_string($e))\n return $e;\n } //!is_null($descripcion)\n \n //valida el boleano es_entero\n if (!is_null($es_entero)) {\n $e = self::validarNumero($es_entero, 1, \"es entero\");\n if (is_string($e))\n return $e;\n } //!is_null($es_entero)\n \n //valida el boleano activa\n if (!is_null($activa)) {\n $e = self::validarNumero($activa, 1, \"activa\");\n if (is_string($e))\n return $e;\n } //!is_null($activa)\n \n //No se encontro error, regresa true\n return true;\n }",
"function validarPagamento(){\n\n\t\t\tif( !$this->validarValorPago() )\n\t\t\t\t$this->relatarErro(\"Erro com o boleto. ID: \".$this->getid_user().\"<br>Nosso Número:\".$this->getboleto_registrado()->getnosso_numero());\n\t\t}",
"public function validaAcessoAcompanhamento_2() {\n\n\t\t$this->retornoValidaAcessoAcompanhamento = 0;\n\n\t\t$nao_esta_grupo_subgrupo = 0;\n\t\t$ha_subgrupo = 0;\n\n\t\tif ($_POST['cb_subgrupo_escolhido'] != 'Escolha Subgrupo') {\n\t\t\t$ha_subgrupo = 1;\n\n\t\t\t$atuacaoVoluntarioBase = Container::getModel('TbVnclVlntGrp');\n\t\t\t$atuacaoVoluntarioBase->__set('codVoluntario', $_SESSION['id']);\n\t\t\t$atuacaoVoluntarioBase->__set('codGrupo', $_POST['cb_grupo_escolhido']);\n\t\t\t$atuacaoVoluntarioBase->__set('codSubgrupo', $_POST['cb_subgrupo_escolhido']);\n\t\t\t$atuacaoVoluntario = $atuacaoVoluntarioBase->getNivelAtuacao();\n\n\t\t\t// Não está na tabela tb_vncl_vlnt_grp, ou seja, não está atrelado ao grupo/subgrupo\n\t\t\tif (empty($atuacaoVoluntario['cod_atuacao'])) { \n\t\t\t\t$nao_esta_grupo_subgrupo = 1;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$atuacaoVoluntarioBase = Container::getModel('TbVnclVlntGrp');\n\t\t\t$atuacaoVoluntarioBase->__set('codVoluntario', $_SESSION['id']);\n\t\t\t$atuacaoVoluntarioBase->__set('codGrupo', $_POST['cb_grupo_escolhido']);\n\t\t\t$atuacaoVoluntario = $atuacaoVoluntarioBase->getNivelAtuacaoGrupo();\n\t\t\n\t\t\tif ($atuacaoVoluntario['qtde'] == 0) { \n\t\t\t\t$nao_esta_grupo_subgrupo = 1;\n\t\t\t}\n\t\t}\n\n\t\t// Não está na tabela tb_vncl_vlnt_grp, ou seja, não está atrelado ao grupo/subgrupo\n\t\tif ($nao_esta_grupo_subgrupo == 1) { \n\t\t\t// Para possibilitar quem tem nível 1 e 2 consultar relatórios sem estar atrelado a grupo/subgrupo\n\t\t\t$nivel_acesso_requerido = 2;\n\t\t\t$autenticar_acesso = AuthController::verificaNivelAcesso($nivel_acesso_requerido);\n\n\t\t\t// Para validar se Voluntário tem o nível adequado para fazer a operação\n\t\t\tif ($autenticar_acesso['autorizado'] == 0) {\n\t\t\t\t$this->view->erroValidacao = 5;\n\n\t\t\t\tif ($ha_subgrupo == 1) {\n\t\t\t\t\t// Buscar Nome de Grupo e Subgrupo\n\t\t\t\t\t$dadosGrupoSubgrupo = Container::getModel('TbSbgrp');\n\t\t\t\t\t$dadosGrupoSubgrupo->__set('codGrupo_pesq', $_POST['cb_grupo_escolhido']);\n\t\t\t\t\t$dadosGrupoSubgrupo->__set('codSubgrupo_pesq', $_POST['cb_subgrupo_escolhido']);\n\t\t\t\t\t$dadosGS = $dadosGrupoSubgrupo->getDadosSubgrupo();\n\n\t\t\t\t\t$this->view->grupoTratado = $dadosGS['nome_grupo'];\n\t\t\t\t\t$this->view->subgrupoTratado = $dadosGS['nome_subgrupo'];\n\t\t\t\t} else {\n\t\t\t\t\t// Buscar Nome de Grupo\n\t\t\t\t\t$dadosGrupo = Container::getModel('TbGrp');\n\t\t\t\t\t$dadosGrupo->__set('cd_grp', $_POST['cb_grupo_escolhido']);\n\t\t\t\t\t$dadosG = $dadosGrupo->getDadosGrupo();\n\n\t\t\t\t\t$this->view->grupoTratado = $dadosG['nome_grupo'];\n\t\t\t\t\t$this->view->subgrupoTratado = '';\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$this->retornoValidaAcessoAcompanhamento = 1;\n\t\t\t}\n\t\t\n\t\t} else {\n\n\t\t\t$atuacaoVoluntarioBase = Container::getModel('TbVnclVlntGrp');\n\t\t\t$atuacaoVoluntarioBase->__set('codVoluntario', $_SESSION['id']);\n\t\t\t$atuacaoVoluntarioBase->__set('codGrupo', $_POST['cb_grupo_escolhido']);\n\t\t\t$atuacaoVoluntarioBase->__set('codSubgrupo', $_POST['cb_subgrupo_escolhido']);\n\t\t\t$atuacaoVoluntario = $atuacaoVoluntarioBase->getNivelAtuacao();\n\n\t\t\t// Está na tabela tb_vncl_vlnt_grp, mas não tem o nível Atuação Requerido\n\t\t\tif ($atuacaoVoluntario['cod_atuacao'] != $this->nivel_atuacao_requerido) { \n\t\t\t\t// Coordenador Geral acessa todas as funções\n\t\t\t\tif ($atuacaoVoluntario['cod_atuacao'] != 4) {\n\t\t\t\t\t// 99 abre acesso para todos do grupo (consultas)\n\t\t\t\t\tif ($this->nivel_atuacao_requerido != 99) {\n\t\t\t\t\t\t$this->view->erroValidacao = 5;\n\n\t\t\t\t\t\tif ($ha_subgrupo == 1) {\n\t\t\t\t\t\t\t// Buscar Nome de Grupo e Subgrupo\n\t\t\t\t\t\t\t$dadosGrupoSubgrupo = Container::getModel('TbSbgrp');\n\t\t\t\t\t\t\t$dadosGrupoSubgrupo->__set('codGrupo_pesq', $_POST['cb_grupo_escolhido']);\n\t\t\t\t\t\t\t$dadosGrupoSubgrupo->__set('codSubgrupo_pesq', $_POST['cb_subgrupo_escolhido']);\n\t\t\t\t\t\t\t$dadosGS = $dadosGrupoSubgrupo->getDadosSubgrupo();\n\n\t\t\t\t\t\t\t$this->view->grupoTratado = $dadosGS['nome_grupo'];\n\t\t\t\t\t\t\t$this->view->subgrupoTratado = $dadosGS['nome_subgrupo'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Buscar Nome de Grupo\n\t\t\t\t\t\t\t$dadosGrupo = Container::getModel('TbGrp');\n\t\t\t\t\t\t\t$dadosGrupo->__set('cd_grp', $_POST['cb_grupo_escolhido']);\n\t\t\t\t\t\t\t$dadosG = $dadosGrupo->getDadosGrupo();\n\n\t\t\t\t\t\t\t$this->view->grupoTratado = $dadosG['nome_grupo'];\n\t\t\t\t\t\t\t$this->view->subgrupoTratado = '';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->retornoValidaAcessoAcompanhamento = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"function validarRegistro()\n {\n if(is_numeric($_REQUEST['cod_padre1']) && is_numeric($_REQUEST['cod_hijo1'])){\n \n $datosRegistro=array('cod_proyecto'=>$_REQUEST['cod_proyecto'],\n 'cod_padre'=>$_REQUEST['cod_padre1'],\n 'cod_proyecto_hom'=>$_REQUEST['cod_proyecto_hom'],\n 'cod_hijo'=>$_REQUEST['cod_hijo1']);\n //iniciamos las validaciones\n $valida_diferentes = $this->verificarEspaciosDiferentes($datosRegistro);\n $datos_padre = array( 'cod_proyecto'=>\"\",\n 'cod_espacio'=>$datosRegistro['cod_padre']);\n $valida_padre = $this->verificarEspacioAcademico($datos_padre);\n\n $datos_hijo = array( 'cod_proyecto'=>\"\",\n 'cod_espacio'=>$datosRegistro['cod_hijo']);\n $valida_hijo = $this->verificarEspacioAcademico($datos_hijo);\n\n $valida_registro = $this->verificarRegistro($datosRegistro);\n $valida_pareja_union=$this->verificarParejaUnion($datosRegistro);\n $valida_pareja_bifurcacion=$this->verificarParejaBifurcacion($datosRegistro);\n\n $valida_plan_estudio = $this->verificarPlanEstudios($datosRegistro);\n $valida_espacio_ppal = $this->verificarEspacioPrincipalPlanEstudios($datosRegistro);\n }\n $mensaje=\"\";\n //revisamos los mensajes de errores\n if($valida_espacio_ppal <>'ok'){\n $mensaje=$valida_espacio_ppal;\n }\n \n if($valida_plan_estudio <>'ok'){\n $mensaje=$valida_plan_estudio;\n }\n \n if($valida_pareja_bifurcacion <>'ok' ){\n $mensaje=$valida_pareja_bifurcacion;\n }\n if($valida_pareja_union <>'ok' ){\n $mensaje=$valida_pareja_union;\n }\n if($valida_registro <>'ok' ){\n $mensaje=$valida_registro;\n }\n \n if($valida_hijo <>'ok' ){\n $mensaje=$valida_hijo;\n //echo \"<br>mensaje\".$mensaje; exit;\n }\n \n if($valida_padre <>'ok' ){\n $mensaje=$valida_padre;\n // echo \"<br>mensaje\".$mensaje; exit;\n }\n \n if($valida_diferentes <>'ok'){\n $mensaje=$valida_diferentes;\n }\n \n //verificamos que las validaciones esten ok para realizar la insercion\n if($valida_diferentes=='ok' && $valida_padre =='ok' && $valida_hijo =='ok' && $valida_registro=='ok' && $valida_plan_estudio=='ok' && $valida_espacio_ppal=='ok' && $valida_pareja_union=='ok' && $valida_pareja_bifurcacion=='ok'){\n //echo \"inscribir reg\" ;exit;\n $registro = $this->buscarRegistroHomologacion($datosRegistro);\n \n if($registro[0]['ESTADO']=='I'){\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=registro_adicionarTablaHomologacion\";\n $variable.=\"&opcion=deshabilitar\";\n $variable.=\"&tipo_hom=normal\";\n $variable.=\"&estado=A\";\n $variable.=\"&codHomologa=\".$datosRegistro['cod_hijo'];\n $variable.=\"&codPpal=\".$datosRegistro['cod_padre'];\n $variable.=\"&codCraPpal=\".$datosRegistro['cod_proyecto'];\n $variable.=\"&cod_proyecto=\".$_REQUEST['cod_proyecto'];\n $variable.=\"&fec_reg=\".$registro[0]['FEC_REG'];\n $variable.=\"&retorno=admin_homologaciones\";\n $variable.=\"&opcionRetorno=crearTablaHomologacion\";\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n $this->enlaceParaRetornar($pagina, $variable);\n //$this->actualizarRegistro($datosRegistro);\n }else{\n $this->inscribirRegistro($datosRegistro);\n }\n \n }else{\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'54',\n 'descripcion'=>'Error al registrar -'.$mensaje,\n 'registro'=>\"cod_proyecto-> \".$datosRegistro['cod_proyecto'].\", cod_padre->\".$datosRegistro['cod_padre'].\", cod_proyecto_hom->\".$datosRegistro['cod_proyecto_hom'].\", cod_hijo->\".$datosRegistro['cod_hijo'],\n 'afectado'=>$_REQUEST['cod_proyecto']);\n \n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=admin_homologaciones\";\n $variable.=\"&opcion=crearTablaHomologacion\";\n $variable.=\"&tipo_hom=normal\";\n $variable.=\"&cod_proyecto=\".$datosRegistro['cod_proyecto'];\n $variable.=\"&cod_padre1=\".$datosRegistro['cod_padre'];\n $variable.=\"&cod_proyecto_hom=\".$datosRegistro['cod_proyecto_hom'];\n $variable.=\"&cod_hijo1=\".$datosRegistro['cod_hijo'];\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n \n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }\n }",
"public function isValido(Produtos $produtos);",
"public function validaAsiento(){\n //no esta ocupado\n \n /*$filtrado[\"where\"] = \"t.cod_asiento = \".$this->cod_asiento;\n\n $entradas = $this->buscarTodos($filtrado);\n\n if(!empty($entradas))\n $this->setError(\"cod_asiento\",\"El asiento ya ha sido comprado\");*/\n \n if($this->asientoOcupado($this->cod_asiento,$this->cod_pase_pelicula)===true){\n $this->setError(\"cod_asiento\", \"El asiento ya ha sido reservado\");\n }\n\n }",
"function verificarEspacioPlan($retorno) {\n //verifica si el espacio pertenece al plan de estudios del estudiante\n $planEstudio=$this->validacion->validarEspacioPlan($_REQUEST);\n if($planEstudio!='ok')\n {\n $retorno['mensaje']=\"El espacio academico no pertenece al plan de estudios del estudiante.\";\n $this->enlaceNoAdicion($retorno);\n }\n }",
"function validarDirCorreoElec ($Cad) {\n // prueba si la entrada coincide con los patrones de correo electronico\n return preg_match (\"/^[a-zA-Z0-9\\._\\-]{2,}[@][a-zA-Z0-9\\-]{2,}([\\.][a-zA-Z]{2,}){1,2}$/\", $Cad);\n}",
"function es_valido($usuario, $certificado)\n\t{\n\t}",
"function fncValidaDI_44($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_44 = \"(44)Fecha de Pago\";\n\t$DI_44_ErrTam = \"Fecha de Pago debe ser de 9 Caracteres(DDMMMAAAA (AAAA=año, MM=mes(primeras 3 letras), DD=día))\";\n\t$DI_44_noDI \t = \"Fecha de Pago no corresponde al formato establecido por DGRH(DDMMMAAAA DD=día, MM=mes(primeras 3 letras), AAAA=año)\";\n\t$DI_44_FecIng \t = \"Fecha de Pago no puede ser menor a Fecha de Ingreso al Gobierno Federal\";\n\t$MesValido=array(\"ENE\",\"FEB\",\"MAR\",\"ABR\",\"MAY\",\"JUN\",\"JUL\",\"AGO\",\"SEP\", \"OCT\",\"NOV\",\"DIC\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == NUEVE)\n\t{\n\t\t$Dia =substr($LocCampo,0,2);\n\t\t$Mes =substr($LocCampo,2,3);\n\t\t$Anio=substr($LocCampo,5,4);\n\t\t$Resultado = array_search(strtoupper($Mes), $MesValido);\t\t\n\t\tif (strlen($Resultado) <= 0)\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_44.\"|\".$LocCampo.\"|\" . $DI_44_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\n\t\t}\t\n\t\t$Fecha =$Anio.str_pad(((int) $Resultado) +1,2,\"0\",STR_PAD_LEFT).$Dia;\n\n\t\tif(!validateDate($Fecha))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_44.\"|\".$LocCampo.\"|\" . $DI_44_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_44.\"|\".$LocCampo.\"|\" . $DI_44_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Api delete State by id | public function actionDeleteState($id) {
$response = \Yii::$app->response;
$response->format = \yii\web\Response::FORMAT_JSON;
$role = State::find()->where(['id' => $id])->one();
if (!empty($role)) {
$role->delete();
return array('status' => true, 'data' => 'State deleted successfully');
} else {
return array('status' => false, 'error' => 'No such State exists');
}
} | [
"public function deleteState($state_id);",
"function delete_state($id)\n {\n return $this->db->delete('states',array('id'=>$id));\n }",
"public function delete($id) {\n $statement = 'DELETE FROM State WHERE idState = :id';\n $query = Connection::getConnection()->prepare($statement);\n\n $query->bindParam(':id', $id, PDO::PARAM_INT);\n //execute query\n $query->execute(array('id' => $id));\n }",
"public function deleteEstate($id)\n { \n $estates = Estate::where('estate_id', $id);\n $estates->delete();\n \n // Success message\n $res['message'] = \"Estate deleted\";\n return response()->json($res, 200); \n }",
"public static function deleteState($state_name,$user_id){\n $State = DB_DataObject::factory('State');\n $State->state_name = $state_name;\n $State->user_id = $user_id;\n $State->delete();\n }",
"function ajax_delete_state() {\n\n\t\tcheck_ajax_referer( 'pluginss_nonce', 'nonce' );\n\n\t\t$state_ID = esc_attr( $_POST['id'] );\n\n\t\tif ( PLUGINSS_DB()->delete_state( $state_ID ) ) {\n\n\t\t\twp_send_json_success( array(\n\t\t\t\t'message' => __( 'Successfully deleted state!', 'plugin-state-switcher' ),\n\t\t\t) );\n\n\t\t} else {\n\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( 'Could not delete state.', 'plugin-state-switcher' ),\n\t\t\t) );\n\t\t}\n\t}",
"public static function deleteState(&$state) {\n\t\tassert('is_array($state)');\n\n\t\tif (!array_key_exists(self::ID, $state)) {\n\t\t\t/* This state hasn't been saved. */\n\t\t\treturn;\n\t\t}\n\n\t\tSimpleSAML_Logger::debug('Deleting state: ' . var_export($state[self::ID], TRUE));\n\n\t\t$session = SimpleSAML_Session::getSessionFromRequest();\n\t\t$session->deleteData('SimpleSAML_Auth_State', $state[self::ID]);\n\t}",
"function delete_status($id)\n {\n return $this->db->delete('status',array('id'=>$id));\n }",
"public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM statuses WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}",
"function deleteState($stateId)\n {\n // get the item id\n $itemId = $this->getItemByState($stateId);\n // get item's default state (that is not this state(for the case of this one being deleted))\n $defaultStateId = $this->getDefaultState($itemId, $stateId);\n // where item id = id and state item-id = state-id in ItemTutorYear, set state_id = default_state_id\n $sql = \"UPDATE ItemTutorYear SET state_id = ? WHERE item_id = ? AND state_id = ?\";\n $statement = $this->_dbh->prepare($sql);\n $statement->execute([$defaultStateId, $itemId, $stateId]);\n // delete the state\n $sql = \"DELETE FROM State WHERE state_id = ?\";\n $statement = $this->_dbh->prepare($sql);\n $statement->execute([$stateId]);\n // reorder the remaining states\n $this->orderStates($itemId);\n }",
"public function deleteById($id) {}",
"public function removeStateWithId($id) {\n\t\t\tif ($this->states->hasKey($id)) {\n\t\t\t\t$this->states->removeKey($id);\n\t\t\t}\n\t\t}",
"function delete_st_store($id)\n {\n $response = $this->db->delete('st_blocks',array('id'=>$id));\n if($response)\n {\n return \"st_store deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting st_store\";\n }\n }",
"public function delete(int $id) : mixed{\n $response = $this->deleteReq(\"/api/ParamServiceLower/{$id}\");\n return response()->json($response['data'],$response['status']);\n }",
"function delete($id){\n $bus = Bus::find($id);\n $bus->delete();\n }",
"public function destroy($id)\n {\n return RestHelper::destroy(Town::class,$id);\n }",
"public function destroy($id)\n {\n $medicalAppointmentState = $this->medicalAppointmentStateRepository->findWithoutFail($id);\n\n if (empty($medicalAppointmentState)) {\n Flash::error('Medical Appointment State not found');\n\n return redirect(route('medical.medicalAppointmentStates.index'));\n }\n\n $this->medicalAppointmentStateRepository->delete($id);\n\n Flash::success('Medical Appointment State deleted successfully.');\n\n return redirect(route('medical.medicalAppointmentStates.index'));\n }",
"public function deleteService($id);",
"public function actionDelete($id) {\n\t\treturn $this->txDelete ( $id, \"app\\models\\Country\" );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets an array of BeasiswaPtk objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, the cached collection is returned. If this Ptk is new, it will return an empty collection or the current collection; the criteria is ignored on a new object. | public function getBeasiswaPtks($criteria = null, PropelPDO $con = null)
{
$partial = $this->collBeasiswaPtksPartial && !$this->isNew();
if (null === $this->collBeasiswaPtks || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collBeasiswaPtks) {
// return empty collection
$this->initBeasiswaPtks();
} else {
$collBeasiswaPtks = BeasiswaPtkQuery::create(null, $criteria)
->filterByPtk($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collBeasiswaPtksPartial && count($collBeasiswaPtks)) {
$this->initBeasiswaPtks(false);
foreach($collBeasiswaPtks as $obj) {
if (false == $this->collBeasiswaPtks->contains($obj)) {
$this->collBeasiswaPtks->append($obj);
}
}
$this->collBeasiswaPtksPartial = true;
}
$collBeasiswaPtks->getInternalIterator()->rewind();
return $collBeasiswaPtks;
}
if($partial && $this->collBeasiswaPtks) {
foreach($this->collBeasiswaPtks as $obj) {
if($obj->isNew()) {
$collBeasiswaPtks[] = $obj;
}
}
}
$this->collBeasiswaPtks = $collBeasiswaPtks;
$this->collBeasiswaPtksPartial = false;
}
}
return $this->collBeasiswaPtks;
} | [
"public function getPtks($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collPtksPartial && !$this->isNew();\n if (null === $this->collPtks || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collPtks) {\n // return empty collection\n $this->initPtks();\n } else {\n $collPtks = PtkQuery::create(null, $criteria)\n ->filterByPekerjaan($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collPtksPartial && count($collPtks)) {\n $this->initPtks(false);\n\n foreach($collPtks as $obj) {\n if (false == $this->collPtks->contains($obj)) {\n $this->collPtks->append($obj);\n }\n }\n\n $this->collPtksPartial = true;\n }\n\n $collPtks->getInternalIterator()->rewind();\n return $collPtks;\n }\n\n if($partial && $this->collPtks) {\n foreach($this->collPtks as $obj) {\n if($obj->isNew()) {\n $collPtks[] = $obj;\n }\n }\n }\n\n $this->collPtks = $collPtks;\n $this->collPtksPartial = false;\n }\n }\n\n return $this->collPtks;\n }",
"public function getKitasPtks($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collKitasPtksPartial && !$this->isNew();\n if (null === $this->collKitasPtks || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collKitasPtks) {\n // return empty collection\n $this->initKitasPtks();\n } else {\n $collKitasPtks = KitasPtkQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collKitasPtksPartial && count($collKitasPtks)) {\n $this->initKitasPtks(false);\n\n foreach($collKitasPtks as $obj) {\n if (false == $this->collKitasPtks->contains($obj)) {\n $this->collKitasPtks->append($obj);\n }\n }\n\n $this->collKitasPtksPartial = true;\n }\n\n $collKitasPtks->getInternalIterator()->rewind();\n return $collKitasPtks;\n }\n\n if($partial && $this->collKitasPtks) {\n foreach($this->collKitasPtks as $obj) {\n if($obj->isNew()) {\n $collKitasPtks[] = $obj;\n }\n }\n }\n\n $this->collKitasPtks = $collKitasPtks;\n $this->collKitasPtksPartial = false;\n }\n }\n\n return $this->collKitasPtks;\n }",
"public function getBukuPtks($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collBukuPtksPartial && !$this->isNew();\n if (null === $this->collBukuPtks || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collBukuPtks) {\n // return empty collection\n $this->initBukuPtks();\n } else {\n $collBukuPtks = BukuPtkQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collBukuPtksPartial && count($collBukuPtks)) {\n $this->initBukuPtks(false);\n\n foreach($collBukuPtks as $obj) {\n if (false == $this->collBukuPtks->contains($obj)) {\n $this->collBukuPtks->append($obj);\n }\n }\n\n $this->collBukuPtksPartial = true;\n }\n\n $collBukuPtks->getInternalIterator()->rewind();\n return $collBukuPtks;\n }\n\n if($partial && $this->collBukuPtks) {\n foreach($this->collBukuPtks as $obj) {\n if($obj->isNew()) {\n $collBukuPtks[] = $obj;\n }\n }\n }\n\n $this->collBukuPtks = $collBukuPtks;\n $this->collBukuPtksPartial = false;\n }\n }\n\n return $this->collBukuPtks;\n }",
"public function getBimbingPds($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collBimbingPdsPartial && !$this->isNew();\n if (null === $this->collBimbingPds || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collBimbingPds) {\n // return empty collection\n $this->initBimbingPds();\n } else {\n $collBimbingPds = BimbingPdQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collBimbingPdsPartial && count($collBimbingPds)) {\n $this->initBimbingPds(false);\n\n foreach($collBimbingPds as $obj) {\n if (false == $this->collBimbingPds->contains($obj)) {\n $this->collBimbingPds->append($obj);\n }\n }\n\n $this->collBimbingPdsPartial = true;\n }\n\n $collBimbingPds->getInternalIterator()->rewind();\n return $collBimbingPds;\n }\n\n if($partial && $this->collBimbingPds) {\n foreach($this->collBimbingPds as $obj) {\n if($obj->isNew()) {\n $collBimbingPds[] = $obj;\n }\n }\n }\n\n $this->collBimbingPds = $collBimbingPds;\n $this->collBimbingPdsPartial = false;\n }\n }\n\n return $this->collBimbingPds;\n }",
"public function getMuloks($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collMuloksPartial && !$this->isNew();\n if (null === $this->collMuloks || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collMuloks) {\n // return empty collection\n $this->initMuloks();\n } else {\n $collMuloks = MulokQuery::create(null, $criteria)\n ->filterByMstWilayah($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collMuloksPartial && count($collMuloks)) {\n $this->initMuloks(false);\n\n foreach($collMuloks as $obj) {\n if (false == $this->collMuloks->contains($obj)) {\n $this->collMuloks->append($obj);\n }\n }\n\n $this->collMuloksPartial = true;\n }\n\n $collMuloks->getInternalIterator()->rewind();\n return $collMuloks;\n }\n\n if($partial && $this->collMuloks) {\n foreach($this->collMuloks as $obj) {\n if($obj->isNew()) {\n $collMuloks[] = $obj;\n }\n }\n }\n\n $this->collMuloks = $collMuloks;\n $this->collMuloksPartial = false;\n }\n }\n\n return $this->collMuloks;\n }",
"public function getBimbingPds($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collBimbingPdsPartial && !$this->isNew();\n if (null === $this->collBimbingPds || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collBimbingPds) {\n // return empty collection\n $this->initBimbingPds();\n } else {\n $collBimbingPds = BimbingPdQuery::create(null, $criteria)\n ->filterByAktPd($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collBimbingPdsPartial && count($collBimbingPds)) {\n $this->initBimbingPds(false);\n\n foreach($collBimbingPds as $obj) {\n if (false == $this->collBimbingPds->contains($obj)) {\n $this->collBimbingPds->append($obj);\n }\n }\n\n $this->collBimbingPdsPartial = true;\n }\n\n $collBimbingPds->getInternalIterator()->rewind();\n return $collBimbingPds;\n }\n\n if($partial && $this->collBimbingPds) {\n foreach($this->collBimbingPds as $obj) {\n if($obj->isNew()) {\n $collBimbingPds[] = $obj;\n }\n }\n }\n\n $this->collBimbingPds = $collBimbingPds;\n $this->collBimbingPdsPartial = false;\n }\n }\n\n return $this->collBimbingPds;\n }",
"public function getPesertaDidiks($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collPesertaDidiksPartial && !$this->isNew();\n if (null === $this->collPesertaDidiks || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collPesertaDidiks) {\n // return empty collection\n $this->initPesertaDidiks();\n } else {\n $collPesertaDidiks = PesertaDidikQuery::create(null, $criteria)\n ->filterByMstWilayah($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collPesertaDidiksPartial && count($collPesertaDidiks)) {\n $this->initPesertaDidiks(false);\n\n foreach($collPesertaDidiks as $obj) {\n if (false == $this->collPesertaDidiks->contains($obj)) {\n $this->collPesertaDidiks->append($obj);\n }\n }\n\n $this->collPesertaDidiksPartial = true;\n }\n\n $collPesertaDidiks->getInternalIterator()->rewind();\n return $collPesertaDidiks;\n }\n\n if($partial && $this->collPesertaDidiks) {\n foreach($this->collPesertaDidiks as $obj) {\n if($obj->isNew()) {\n $collPesertaDidiks[] = $obj;\n }\n }\n }\n\n $this->collPesertaDidiks = $collPesertaDidiks;\n $this->collPesertaDidiksPartial = false;\n }\n }\n\n return $this->collPesertaDidiks;\n }",
"public function getMailings(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collMailingsPartial && !$this->isNew();\n if (null === $this->collMailings || null !== $criteria || $partial) {\n if ($this->isNew()) {\n // return empty collection\n if (null === $this->collMailings) {\n $this->initMailings();\n }\n } else {\n\n $query = ChildMailingQuery::create(null, $criteria)\n ->filterByUser($this);\n $collMailings = $query->find($con);\n if (null !== $criteria) {\n return $collMailings;\n }\n\n if ($partial && $this->collMailings) {\n //make sure that already added objects gets added to the list of the database.\n foreach ($this->collMailings as $obj) {\n if (!$collMailings->contains($obj)) {\n $collMailings[] = $obj;\n }\n }\n }\n\n $this->collMailings = $collMailings;\n $this->collMailingsPartial = false;\n }\n }\n\n return $this->collMailings;\n }",
"public function getKesejahteraans($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collKesejahteraansPartial && !$this->isNew();\n if (null === $this->collKesejahteraans || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collKesejahteraans) {\n // return empty collection\n $this->initKesejahteraans();\n } else {\n $collKesejahteraans = KesejahteraanQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collKesejahteraansPartial && count($collKesejahteraans)) {\n $this->initKesejahteraans(false);\n\n foreach($collKesejahteraans as $obj) {\n if (false == $this->collKesejahteraans->contains($obj)) {\n $this->collKesejahteraans->append($obj);\n }\n }\n\n $this->collKesejahteraansPartial = true;\n }\n\n $collKesejahteraans->getInternalIterator()->rewind();\n return $collKesejahteraans;\n }\n\n if($partial && $this->collKesejahteraans) {\n foreach($this->collKesejahteraans as $obj) {\n if($obj->isNew()) {\n $collKesejahteraans[] = $obj;\n }\n }\n }\n\n $this->collKesejahteraans = $collKesejahteraans;\n $this->collKesejahteraansPartial = false;\n }\n }\n\n return $this->collKesejahteraans;\n }",
"public function getDiklats($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collDiklatsPartial && !$this->isNew();\n if (null === $this->collDiklats || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collDiklats) {\n // return empty collection\n $this->initDiklats();\n } else {\n $collDiklats = DiklatQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collDiklatsPartial && count($collDiklats)) {\n $this->initDiklats(false);\n\n foreach($collDiklats as $obj) {\n if (false == $this->collDiklats->contains($obj)) {\n $this->collDiklats->append($obj);\n }\n }\n\n $this->collDiklatsPartial = true;\n }\n\n $collDiklats->getInternalIterator()->rewind();\n return $collDiklats;\n }\n\n if($partial && $this->collDiklats) {\n foreach($this->collDiklats as $obj) {\n if($obj->isNew()) {\n $collDiklats[] = $obj;\n }\n }\n }\n\n $this->collDiklats = $collDiklats;\n $this->collDiklatsPartial = false;\n }\n }\n\n return $this->collDiklats;\n }",
"public function getMailings(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collMailingsPartial && !$this->isNew();\n if (null === $this->collMailings || null !== $criteria || $partial) {\n if ($this->isNew()) {\n // return empty collection\n if (null === $this->collMailings) {\n $this->initMailings();\n }\n } else {\n\n $query = ChildMailingQuery::create(null, $criteria)\n ->filterByGroup($this);\n $collMailings = $query->find($con);\n if (null !== $criteria) {\n return $collMailings;\n }\n\n if ($partial && $this->collMailings) {\n //make sure that already added objects gets added to the list of the database.\n foreach ($this->collMailings as $obj) {\n if (!$collMailings->contains($obj)) {\n $collMailings[] = $obj;\n }\n }\n }\n\n $this->collMailings = $collMailings;\n $this->collMailingsPartial = false;\n }\n }\n\n return $this->collMailings;\n }",
"public function getPassos(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collPassosPartial && !$this->isNew();\n if (null === $this->collPassos || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collPassos) {\n // return empty collection\n $this->initPassos();\n } else {\n $collPassos = ChildPassoQuery::create(null, $criteria)\n ->filterByProposicao($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collPassosPartial && count($collPassos)) {\n $this->initPassos(false);\n\n foreach ($collPassos as $obj) {\n if (false == $this->collPassos->contains($obj)) {\n $this->collPassos->append($obj);\n }\n }\n\n $this->collPassosPartial = true;\n }\n\n return $collPassos;\n }\n\n if ($partial && $this->collPassos) {\n foreach ($this->collPassos as $obj) {\n if ($obj->isNew()) {\n $collPassos[] = $obj;\n }\n }\n }\n\n $this->collPassos = $collPassos;\n $this->collPassosPartial = false;\n }\n }\n\n return $this->collPassos;\n }",
"public function getTickets($criteria = null, $con = null)\n\t{\n\t\t// include the Peer class\n\t\tinclude_once 'lib/model/om/BaseTicketPeer.php';\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria();\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTickets === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTickets = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TicketPeer::FILE_ID, $this->getId());\n\n\t\t\t\tTicketPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTickets = TicketPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TicketPeer::FILE_ID, $this->getId());\n\n\t\t\t\tTicketPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTicketCriteria) || !$this->lastTicketCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTickets = TicketPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTicketCriteria = $criteria;\n\t\treturn $this->collTickets;\n\t}",
"public function getTbprofessortickets($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbperiodoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbprofessortickets === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbprofessortickets = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbprofessorticketPeer::ID_PERIODO, $this->id_periodo);\n\n\t\t\t\tTbprofessorticketPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbprofessortickets = TbprofessorticketPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbprofessorticketPeer::ID_PERIODO, $this->id_periodo);\n\n\t\t\t\tTbprofessorticketPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbprofessorticketCriteria) || !$this->lastTbprofessorticketCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbprofessortickets = TbprofessorticketPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbprofessorticketCriteria = $criteria;\n\t\treturn $this->collTbprofessortickets;\n\t}",
"public function getHbfComandass(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collHbfComandassPartial && !$this->isNew();\n if (null === $this->collHbfComandass || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collHbfComandass) {\n // return empty collection\n $this->initHbfComandass();\n } else {\n $collHbfComandass = ChildHbfComandasQuery::create(null, $criteria)\n ->filterByHbfPrepagos($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collHbfComandassPartial && count($collHbfComandass)) {\n $this->initHbfComandass(false);\n\n foreach ($collHbfComandass as $obj) {\n if (false == $this->collHbfComandass->contains($obj)) {\n $this->collHbfComandass->append($obj);\n }\n }\n\n $this->collHbfComandassPartial = true;\n }\n\n return $collHbfComandass;\n }\n\n if ($partial && $this->collHbfComandass) {\n foreach ($this->collHbfComandass as $obj) {\n if ($obj->isNew()) {\n $collHbfComandass[] = $obj;\n }\n }\n }\n\n $this->collHbfComandass = $collHbfComandass;\n $this->collHbfComandassPartial = false;\n }\n }\n\n return $this->collHbfComandass;\n }",
"public function getNotes(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collNotesPartial && !$this->isNew();\n if (null === $this->collNotes || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collNotes) {\n // return empty collection\n $this->initNotes();\n } else {\n $collNotes = ChildNoteQuery::create(null, $criteria)\n ->filterByPerson($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collNotesPartial && count($collNotes)) {\n $this->initNotes(false);\n\n foreach ($collNotes as $obj) {\n if (false == $this->collNotes->contains($obj)) {\n $this->collNotes->append($obj);\n }\n }\n\n $this->collNotesPartial = true;\n }\n\n return $collNotes;\n }\n\n if ($partial && $this->collNotes) {\n foreach ($this->collNotes as $obj) {\n if ($obj->isNew()) {\n $collNotes[] = $obj;\n }\n }\n }\n\n $this->collNotes = $collNotes;\n $this->collNotesPartial = false;\n }\n }\n\n return $this->collNotes;\n }",
"public function getsfGuardRememberKeys($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collsfGuardRememberKeys === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collsfGuardRememberKeys = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(sfGuardRememberKeyPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardRememberKeyPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collsfGuardRememberKeys = sfGuardRememberKeyPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(sfGuardRememberKeyPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardRememberKeyPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastsfGuardRememberKeyCriteria) || !$this->lastsfGuardRememberKeyCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collsfGuardRememberKeys = sfGuardRememberKeyPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastsfGuardRememberKeyCriteria = $criteria;\n\t\treturn $this->collsfGuardRememberKeys;\n\t}",
"public function getKioskAssignments(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collKioskAssignmentsPartial && !$this->isNew();\n if (null === $this->collKioskAssignments || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collKioskAssignments) {\n // return empty collection\n $this->initKioskAssignments();\n } else {\n $collKioskAssignments = ChildKioskAssignmentQuery::create(null, $criteria)\n ->filterByEvent($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collKioskAssignmentsPartial && count($collKioskAssignments)) {\n $this->initKioskAssignments(false);\n\n foreach ($collKioskAssignments as $obj) {\n if (false == $this->collKioskAssignments->contains($obj)) {\n $this->collKioskAssignments->append($obj);\n }\n }\n\n $this->collKioskAssignmentsPartial = true;\n }\n\n return $collKioskAssignments;\n }\n\n if ($partial && $this->collKioskAssignments) {\n foreach ($this->collKioskAssignments as $obj) {\n if ($obj->isNew()) {\n $collKioskAssignments[] = $obj;\n }\n }\n }\n\n $this->collKioskAssignments = $collKioskAssignments;\n $this->collKioskAssignmentsPartial = false;\n }\n }\n\n return $this->collKioskAssignments;\n }",
"public function get_criteria() {\n global $DB;\n $records = $DB->get_records(self::$tablename, ['peerworkid' => $this->id], 'sortorder, id');\n return $records;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets whether or not related alerts will be merged in any reports generated. | public function setOptionMergeRelatedAlerts($enabled, $apikey='') {
$res = $this->zap->request($this->zap->base . 'core/action/setOptionMergeRelatedAlerts/', array('enabled' => $enabled, 'apikey' => $apikey));
return reset($res);
} | [
"public function shouldMergeExtra()\n {\n return $this->mergeExtra;\n }",
"public function set_reports_to_update() {\n\t\tif ( isset( $this->update_events_and_classes[ current_filter() ] ) ) {\n\t\t\t$this->reports_to_update = array_unique( array_merge( $this->reports_to_update, $this->update_events_and_classes[ current_filter() ] ) );\n\t\t}\n\t}",
"function setCombineBooks() {\n\t\t$this->maximumDivergenceLevel = 1;\n\t}",
"function setMerge()\n {\n $this->setAlign('merge');\n }",
"function set_merge()\r\n {\r\n $this->set_align('merge');\r\n }",
"public function isMerge();",
"function merge_occured(){\n}",
"public function shouldMergeExtraDeep()\n {\n return $this->mergeExtraDeep;\n }",
"public function testMergeConfig()\n {\n $this->reportManager->addGenerator('generator', $this->generator->reveal());\n $this->reportManager->addReport('one', array(\n 'generator' => 'generator',\n 'params' => array(\n 'one' => '1',\n 'three' => '3',\n 'array' => array(\n 'bar' => 'boo',\n 'boo' => 'bar',\n ),\n ),\n ));\n $this->reportManager->addReport('two', array(\n 'extends' => 'one',\n 'params' => array(\n 'two' => '2',\n 'three' => '7',\n 'array' => array(\n 'bar' => 'baz',\n ),\n ),\n ));\n $this->generator->getDefaultConfig()->willReturn(array(\n 'params' => array(),\n ));\n $this->generator->getSchema()->willReturn(array(\n 'type' => 'object',\n 'properties' => array(\n 'params' => array('type' => 'object'),\n ),\n ));\n $this->generator->generate(\n $this->suiteDocument,\n array(\n 'params' => array(\n 'one' => '1',\n 'three' => '7',\n 'array' => array(\n 'bar' => 'baz',\n 'boo' => 'bar',\n ),\n 'two' => '2',\n ),\n )\n )->shouldBeCalled();\n\n $this->reportManager->generateReports(\n $this->output->reveal(),\n $this->suiteDocument,\n array('two')\n );\n }",
"public function applyForMerged()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_STATIC_VERSION_CONFIG . 'apply_for_merged');\n }",
"public function onConfigMerge($e) \n {\n //Set the config for this object to the MergedConfig object.\n //Because PHP 5 objects are by reference, all changes made after this trigger is called will\n //still be applied to this object.\n $this->setConfig($e->getParam('configManager')->getMergedConfig());\n }",
"public function it_merges_in_combine_mode() {\n self::merge(self::CONFIG_BASIC, self::CONFIG_MERGE, PasswdPolicy::MODE_COMBINE)->shouldReturn(self::CONFIG_MERGED);\n }",
"public function it_merges_in_combine_mode() {\n self::merge(self::CONFIG_SIX, self::CONFIG_TWELVE, PasswdPolicy::MODE_COMBINE)->shouldReturn(self::CONFIG_TWELVE);\n }",
"public function setDefaultMergeVars()\n {\n $this->mergeVars = [\n [\n 'name' => 'SFNAME',\n 'content' => $this->sender->first_name\n ],\n [\n 'name' => 'SLNAME',\n 'content' => $this->sender->last_name\n ],\n [\n 'name' => 'SNAME',\n 'content' => $this->sender->first_name . ' ' . $this->sender->last_name\n ],\n [\n 'name' => 'RFNAME',\n 'content' => isset($this->recipient->first_name) ? $this->recipient->first_name : \"\"\n ],\n [\n 'name' => 'RLNAME',\n 'content' => isset($this->recipient->last_name) ? $this->recipient->last_name : \"\"\n ],\n [\n 'name' => 'RNAME',\n 'content' => isset($this->recipient->first_name) ? $this->recipient->first_name : \"\" \n . ' ' . \n isset($this->recipient->first_name) ? $this->recipient->first_name : \"\"\n ],\n [\n 'name' => 'SIMAGE',\n 'content' => isset($this->sender->avatar) ? $this->sender->avatar : env('DEFAULT_AVATAR')\n ],\n [\n 'name' => 'RIMAGE',\n 'content' => isset($this->recipient->avatar) ? $this->recipient->avatar : env('DEFAULT_AVATAR')\n ],\n [\n 'name' => 'SCCLINK',\n 'content' => 'https://www.thenetworkingeffect.com/cc/' . $this->sender->permalink\n ],\n [\n 'name' => 'SPHOTO',\n 'content' => $this->sender->avatar ?: env('DEFAULT_AVATAR')\n ],\n [\n 'name' => 'SCOMPANY',\n 'content' => $this->sender->business_name\n ]\n ];\n\n return $this;\n\n }",
"protected function send_alert_email_others() {\n if (!empty($this->get_instance()->emailothers)) {\n $others = explode(',', $this->get_instance()->emailothers);\n if ($others) {\n $this->send_alert_emails($others);\n }\n }\n }",
"private function mergeProductTypeBadge()\n {\n if (config($this->config_file_name.'.show-badge')) {\n $key = 'neptrox.product-type-badge';\n $config = $this->app['config']->get($key, []);\n $this->app['config']->set($key, array_merge($config, [\n 'product-basket' => config($this->config_file_name.'.badge-html')\n ]));\n }\n }",
"private function _mergeTags ( $merge_tags, $subset = false ) {\n\n\t\t$this->merges = array();\n\n\t\tforeach( $merge_tags as $tag ) {\n\t\t\t\n\t\t\tif( ( $subset && ! in_array( $tag->tag, $subset ) ) ||\n\t\t\t\t! isset( $tag->fb_name ) ||\n\t\t\t\tempty( $tag->fb_name ) )\t\tcontinue;\n\t\t\t\n\n\t\t\tif( ! isset( $tag->field_type ) ||\n\t\t\t\t! isset( $tag->fb_name ) ||\n\t\t\t\t( !method_exists( $this, $tag->field_type ) && isset( $tag->isGrouping ) && !$tag->isGrouping ) ) {\n\t\t\t\t\n\t\t\t\twriteErrorLog( 'MailChimp merge - property or handler missing', $tag );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// required test\n\t\t\tif( isset( $tag->req ) &&\n\t\t\t\t$tag->req &&\n\t\t\t\t$this->getPost( $tag->fb_name ) === false ) {\n\n\t\t\t\t$this->setError( _T( 'Required field %s is missing or failed input validation.', $tag->fb_name ) );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// field specific tests and merges\n\t\t\tif( $this->getPost( $tag->fb_name ) !== false ) {\n\n\t\t\t\t// grouping-tags can all be dealt with the same way\n\t\t\t\t$fieldtype = ( isset( $tag->isGrouping ) && $tag->isGrouping ) ? 'grouping' : $tag->field_type;\n\n\t\t\t\t$this->$fieldtype( $tag );\n\t\t\t}\n\t\t}\n\n\t\tif( ! empty( $merges ) )\t\t\t\t\t$this->data[ 'merge_vars'] = $merges;\n\t}",
"public function initAlerts($overrideExisting = true)\n {\n if (null !== $this->collAlerts && !$overrideExisting) {\n return;\n }\n $this->collAlerts = new PropelObjectCollection();\n $this->collAlerts->setModel('Alert');\n }",
"function accountswitcher_alerts_settings()\n{\n\tglobal $mybb, $lang, $alertSettings;\n\n\tif ($mybb->usergroup['as_canswitch'] != 1)\n\t{\n\t\t$lang->myalerts_setting_accountswitcher_pm = '<span style=\"text-decoration: line-through;\">'.$lang->myalerts_setting_accountswitcher_pm.'</span>';\n\t}\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks maintenance if we need to put the site offline | function check_maintenance() {
if(!$this->ci->data['config']['maintenance'])
return false;
redirect('maintenance_' . lang_code . '.html', 'refresh');
} | [
"public function check_site_maintenance(){ // && $_SERVER['REMOTE_ADDR'] != '127.0.0.1'\n\t\tif(Configure::read('WEBSITE_MAINTENANCE') == 1){\t\t\t\n\t\t\techo file_get_contents(Configure::read('WEBSITE').$this->webroot.'maintenance.php');\n\t\t\tdie;\t\t\n\t\t}\t\t\n\t}",
"function yourls_check_maintenance_mode() {\n\n\t$file = YOURLS_ABSPATH . '/.maintenance' ;\n\tif ( !file_exists( $file ) || yourls_is_upgrading() || yourls_is_installing() )\n\t\treturn;\n\t\n\tglobal $maintenance_start;\n\n\tinclude_once( $file );\n\t// If the $maintenance_start timestamp is older than 10 minutes, don't die.\n\tif ( ( time() - $maintenance_start ) >= 600 )\n\t\treturn;\n\n\t// Use any /user/maintenance.php file\n\tif( file_exists( YOURLS_USERDIR.'/maintenance.php' ) ) {\n\t\tinclude_once( YOURLS_USERDIR.'/maintenance.php' );\n\t\tdie();\n\t}\n\t\n\t// https://www.youtube.com/watch?v=Xw-m4jEY-Ns\n\t$title = yourls__( 'Service temporarily unavailable' );\n\t$message = yourls__( 'Our service is currently undergoing scheduled maintenance.' ) . \"</p>\\n<p>\" .\n\tyourls__( 'Things should not last very long, thank you for your patience and please excuse the inconvenience' );\n\tyourls_die( $message, $title , 503 );\n\n}",
"function site_maintenance()\n{\n\treturn maintenance_file_exists()||module_invoke_all('maintenance');\n}",
"public static function isDownForMaintenance() {\n \n }",
"function chkIsSiteUnderMaintenance()\n\t{\n\t\tglobal $CFG;\n\n\t\tif(!isAdmin())\n\t\t\t{\n\t\t\t\t$currentPage = strtolower($CFG['html']['current_script_name']);\n\t\t\t\tif($CFG['admin']['module']['site_maintenance'] AND $currentPage != 'maintenance')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Unset all of the session variables.\n\t\t\t\t\t\t$_SESSION = array();\n\t\t\t\t\t\t// If it's desired to kill the session, also delete the session cookie.\n\t\t\t\t\t\t// Note: This will destroy the session, and not just the session data!\n\t\t\t\t\t\tif (isset($_COOKIE[session_name()]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t setcookie(session_name(), '', time()-42000, '/');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t// Finally, destroy the session.\n\t\t\t\t\t\tsession_destroy();\n\t\t\t\t\t\tsession_write_close();\n\t\t\t\t\t\tsetcookie($CFG['cookie']['starting_text'].'_bba', '', time()-42000, '/');\n\t\t\t\t\t\t$murl = getUrl($CFG['redirect']['maintenance_module_url']['file_name'], $CFG['redirect']['maintenance_module_url']['normal'], $CFG['redirect']['maintenance_module_url']['htaccess'], 'root');\n\t\t\t\t\t\t$CFG['site']['current_url'];\n\t\t\t\t\t\tif($CFG['site']['current_url']!=$murl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRedirect2Url($murl);\n\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\t$value_array = explode('/', $CFG['site']['relative_url']);\n\t\t\t\tif(!in_array('admin', $value_array) and $CFG['admin']['module']['site_maintenance'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$admin_url = $CFG['site']['url'].'admin/index.php';\n\t\t\t\t\t\tRedirect2URL($admin_url);\n\t\t\t\t\t}\n\t\t\t}\n\t}",
"function _checkMaintenance()\n\t{\n\t\tglobal $ilSetting, $ilUser, $rbacsystem;\n\n\t\tif (!$ilSetting->get(\"lang_ext_maintenance\"))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($ilUser->getId())\n\t\t{\n\t\t\t$ref_id = self::_lookupLangFolderRefId();\n\t\t\treturn $rbacsystem->checkAccess(\"read,write\", (int) $ref_id);\n\t\t}\n\t\treturn false;\n\t}",
"function sp_maintenance() {\n\tif ( sp_get_option( 'maintenance_enable', 'is', 'on' ) ) {\n\t\t$ips = array_map( 'trim', explode( \"\\n\", sp_get_option( 'maintenance_ips' ) ) );\n\n\t\tif ( sp_get_option( 'maintenance_redirect_to', 'isset' ) && sp_get_option( 'maintenance_redirect_to', 'is', 'maintenance page' ) ) {\n\t\t\t// if user is logged in and is an admin, don't continue\n\t\t\tif ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n\t\t\t\treturn;\n\t\t\t\n\t\t\t// if page does not exist, don't continue\n\t\t\tif ( is_null( sp_get_page_id_from_slug( 'maintenance' ) ) )\n\t\t\t\treturn;\n\n\t\t\tif ( sp_check_ip( $ips ) == false && ! is_page( 'maintenance' ) ) {\n\t\t\t\t$page_id = get_permalink( sp_get_page_id_from_slug( 'maintenance' ) );\n\t\t\t\tif ( $page_id ) {\n\t\t\t\t\twp_safe_redirect( $page_id ); \n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( sp_get_option( 'maintenance_redirect_to', 'isset' ) && sp_get_option( 'maintenance_redirect_to', 'is', 'url' ) ) {\n\t\t\t// if user is logged in and is an admin, don't continue\n\t\t\tif ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif ( sp_check_ip( $ips ) == false && ( sp_get_option( 'maintenance_url', 'isset' ) && sp_get_option( 'maintenance_url' ) != '' ) ) {\n\t\t\t\twp_redirect( sp_get_option( 'maintenance_url' ) ); \n\t\t\t\texit; \n\t\t\t}\n\t\t}\n\t}\n}",
"public function isDownForMaintenance()\n {\n }",
"public function isDownForMaintenance()\n {\n return is_file($this->storagePath() . '/framework/down') || (defined('ABSPATH') && is_file(constant('ABSPATH') . '/.maintenance'));\n }",
"public function isDownForMaintenance()\n {\n return false;\n }",
"public function has_maintenance() {\n global $pagenow;\n if ($this->settings_values['enabled'] != '1') {\n return false;\n }\n\n if (defined('WPUMAINTENANCE_DISABLED') && WPUMAINTENANCE_DISABLED) {\n return false;\n }\n\n // Don't launch if CLI\n if (function_exists('php_sapi_name') && php_sapi_name() == 'cli') {\n return false;\n }\n\n // Don't launch if user is logged in\n $disable_loggedin = $this->settings_values['disabled_users'];\n if ($disable_loggedin == '1' && is_user_logged_in()) {\n return false;\n }\n\n // Don't launch if in admin\n if (is_admin()) {\n return false;\n }\n\n // Don't launch if login page\n if ($pagenow == 'wp-login.php') {\n return false;\n }\n\n // Check authorized ips\n $opt_ips = $this->settings_values['authorized_ips'];\n $opt_ips = str_replace(' ', '', $opt_ips);\n $opt_ips = str_replace(array(\n ';',\n ',',\n \"\\n\",\n \"\\r\"\n ), '###', $opt_ips);\n $authorized_ips = explode('###', $opt_ips);\n\n // If no IPs are authorized : maintenance\n if (empty($authorized_ips) || $authorized_ips[0] == '') {\n return true;\n }\n\n $my_ip = $this->get_ip();\n return !in_array($my_ip, $authorized_ips);\n }",
"public function is_maintenance() {\n\t\t$html = str_get_html($this->ios_index);\n\t\treturn (strpos($html->find('body', 0)->class, 'maintenance') !== false);\n\t}",
"function __2c_wp_maintenance_mode(){\n if(!current_user_can('update_core')){\n wp_die('<h1 style=\"color:red\">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back on-line shortly!');\n }\n}",
"public static function isDownForMaintenance(){\n return \\Illuminate\\Foundation\\Application::isDownForMaintenance();\n }",
"function kmz_maintenance_mode() {\r\n\tglobal $pagenow;\r\n\tif ( $pagenow !== 'wp-login.php' && ! current_user_can( 'manage_options' ) && ! is_admin() ) {\r\n\t\theader( 'HTTP/1.1 Service Unavailable', true, 503 );\r\n\t\theader( 'Content-Type: text/html; charset=utf-8' );\r\n\t\trequire_once plugin_dir_path( __FILE__ ) . 'views/maintenance-page.php';\r\n\t\tdie();\r\n\t}\r\n}",
"function wp_maintenance()\n {\n }",
"public function worksOffline(): bool\n {\n return $this->isAdminRoute();\n }",
"private static function checkOffline(): void\n {\n Debug::setBacklog()::bypassGenericMessage();\n\n if (Parameters::getOffline()) {\n throw new Exception(Parameters::getOfflineMessage(), self::DEFAULT_OFFLINE_MESSAGE[0]);\n }\n\n PerformanceAnalysis::flush(PERFORMANCE_ANALYSIS_LABEL);\n }",
"public static function MaintenanceStuff() {\n\t\t// Check Bancho maintenance\n\t\tif (checkBanchoMaintenance()) {\n\t\t\tself::BanchoMaintenanceAlert();\n\t\t}\n\t\t// Game maintenance check\n\t\tif (checkGameMaintenance()) {\n\t\t\tself::GameMaintenanceAlert();\n\t\t}\n\t\t// Check website maintenance\n\t\tif (checkWebsiteMaintenance()) {\n\t\t\tself::MaintenanceAlert();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy template files from package folder to specified user folder | private function copyTemplateFiles()
{
if(!\File::isDirectory($this->configSettings['pathTo']['templates']))
$this->fileCreator->copyDirectory("vendor/jrenton/laravel-scaffold/src/Jrenton/LaravelScaffold/templates/", $this->configSettings['pathTo']['templates']);
} | [
"public function copyBackTemplates()\n {\n $templateDir = getenv('HOME') . '/Projects/terminus/templates/localdev';\n copy(__DIR__ . '/docker-compose.yml', $templateDir . \"/docker-compose.yml\");\n copy(__DIR__ . '/RoboFile.php', $templateDir . \"/RoboFile.php\" );\n copy(__DIR__ . '/web/sites/default/settings.local.php', $templateDir . \"/settings.local.php\" );\n copy(__DIR__ . '/.envrc', $templateDir . '/.envrc');\n }",
"function install_templates() {\r\n\r\n $errors = array();\r\n\r\n $custom_template_path = STYLESHEETPATH . \"/wpi\";\r\n $original_template_path = dirname(__FILE__) . \"/template\";\r\n\r\n if (!is_dir($custom_template_path)) {\r\n if (!@mkdir($custom_template_path)) {\r\n $errors[] = __(\"Unable to create 'wpi' folder in template folder. \", WPI);\r\n die(json_encode($errors));\r\n }\r\n }\r\n\r\n $files_copied = 0;\r\n if ($dir = @opendir($original_template_path)) {\r\n while (($file = readdir($dir)) !== false) {\r\n unset($info);\r\n $info = pathinfo($file);\r\n if ($info['extension'] == 'php') {\r\n if (@copy($original_template_path . \"/\" . $file, \"$custom_template_path/$file\"))\r\n $files_copied++;\r\n }\r\n }\r\n closedir($dir);\r\n } else {\r\n $errors[] = __(\"Unable to open 'wpi' folder in template folder.\", WPI);\r\n die(json_encode($errors));\r\n }\r\n\r\n if ((intval($files_copied)) != 0) {\r\n $errors[] = sprintf(__(\"Success, (%s) template file(s) copied.\", WPI), $files_copied);\r\n die(json_encode($errors));\r\n } else {\r\n $errors[] = __(\"No template files copied.\", WPI);\r\n die(json_encode($errors));\r\n }\r\n }",
"private function copyTemplates() {\n\t\t// check if there's a /templates in plugin directory\n\t\t$source_path = ROOT_PATH . 'plugins/' . $this->getName() . '/templates';\n\t\tif (!file_exists($source_path)) return;\n\n\t\t// create directory in /templates/plugins/ if not exists\n\t\t$plugin_template_path = ROOT_PATH . 'templates/plugins/' . $this->getName();\n\n\t\t// try sym-linking first\n\t\tif (is_link($plugin_template_path)) return;\n\n\t\tif (!file_exists($plugin_template_path)) {\n\t\t\texec('ln -s '.$source_path.' '.$plugin_template_path);\n\t\t\tif (is_link($plugin_template_path)) return;\n\n\t\t\tmkdir($plugin_template_path);\n\t\t}\n\t\tcopy_recursively($source_path, $plugin_template_path);\n\t}",
"public static function copyTemplates(Event $event): void\n {\n /**\n * Require composer autoload file\n */\n require_once __DIR__ . '/../../../autoload.php';\n\n $magentoFile = new File();\n $driver = (new DriverPool())->getDriver(DriverPool::FILE);\n $rootMagentoDirectory = $driver->getRealPath(self::MAGENTO_ROOT_REALPATH_ARGUMENT);\n $readFactory = new ReadFactory(new DriverPool());\n $writeFactory = new WriteFactory(new DriverPool());\n $magentoFilesystem = new MagentoFilesystem(\n new DirectoryList($rootMagentoDirectory),\n $readFactory,\n $writeFactory\n );\n $composerFilesystem = new ComposerFilesystem();\n $devDirectory = $magentoFilesystem->getDirectoryRead(DirectoryList::ROOT)\n ->getAbsolutePath('dev' . DIRECTORY_SEPARATOR . LocatorInterface::DEV_MAGEBUNDLE_DIRNAME);\n $magentoFile->checkAndCreateFolder($devDirectory);\n $skeletonDir = $magentoFilesystem->getDirectoryRead(DirectoryList::ROOT)\n ->getAbsolutePath(LocatorInterface::VENDOR_SKELETON_PATH_DIR);\n $composerFilesystem->copy($skeletonDir, $devDirectory);\n }",
"public function install_templates()\n {\n // initialize the Finder\n $finder = new Finder();\n // we need only the top level\n $finder->depth('== 0');\n // get all directories in the /Examples\n $finder->directories()->in(MANUFAKTUR_PATH.'/TemplateTools/Examples');\n\n foreach ($finder as $directory) {\n $template_name = $directory->getFilename();\n $target_directory = CMS_PATH.'/templates/'.$template_name;\n\n if ($this->app['filesystem']->exists($target_directory)) {\n // the template already exists - remove it\n $this->app['filesystem']->remove($target_directory);\n }\n // create the template directory\n $this->app['filesystem']->mkdir($target_directory);\n\n // get all files and directories from source\n $source = new Finder();\n $source->in($directory->getRealpath());\n\n foreach ($source as $item) {\n if ($item->isDir()) {\n // create the directory in the target\n $this->app['filesystem']->mkdir($target_directory.'/'.$item->getFilename());\n }\n else {\n // copy file to target\n $this->app['filesystem']->copy($item->getRealPath(), $target_directory.'/'.$item->getRelativePathname());\n }\n }\n\n // ok - all files are copied, now update the CMS database\n if ($this->register_template($template_name)) {\n $this->app['monolog']->addDebug('Successfull installed and registered the template '.$template_name);\n }\n }\n }",
"protected static function copySrcIntoPkg()\n {\n $common_files_list = self::getModuleFiles(self::$src_directory);\n if (!empty($common_files_list)) {\n foreach ($common_files_list as $file_relative => $file_realpath) {\n $destination_directory = self::$pkg_directory . DIRECTORY_SEPARATOR . dirname($file_relative) . DIRECTORY_SEPARATOR;\n \n PackageOutput::createDirectory($destination_directory);\n PackageOutput::copyFile($file_realpath, $destination_directory . basename($file_realpath));\n }\n }\n }",
"public function copy_template(){\n\t\t$dir = get_stylesheet_directory() . '/WooCommerce/single-product';\n\t\tif( ! is_dir( $dir ) ){\n\t\t\t@wp_mkdir_p( $dir );\n\t\t}\n\n\t\t/**\n\t\t * a 'week check'. if the files are not same, then copy\n\t\t */\n\t\tif( @md5_file( dirname( __FILE__ ) . '/templates/review.php' ) != @md5_file( $dir . '/review.php' ) ){\n\t\t\tcopy( dirname( __FILE__ ) . '/templates/review.php' , $dir . '/review.php' );\n\t\t}\n\t}",
"function create_new_template($folder_name_id,$template_name,$parent_template_name){\n\n global $dir_path, $new_path, $temp_dir_path, $temp_new_path, $xerte_toolkits_site;\n\n\n $row_framework = db_query_one(\"SELECT template_framework from {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails WHERE template_name = ?\", array($template_name));\n\n\n // I think this is wrong, currently looking like : /home/david/src/xerteonlinetoolkits/modules//templates/0 should presumably be home/david/src/xerteonlinetoolkits/modules/xerte/templates/Nottingham\n $dir_path = $xerte_toolkits_site->basic_template_path . $row_framework['template_framework'] . \"/templates/\" . $template_name;\n\n /**\n * Get the id of the folder we are looking to copy into\n */\n\n _debug(\"Creating new template : $folder_name_id, $template_name\");\n $new_path = $xerte_toolkits_site->users_file_area_full . $folder_name_id . \"-\" . $_SESSION['toolkits_logon_username'] . \"-\" . $template_name;\n $path = $xerte_toolkits_site->users_file_area_full . $folder_name_id . \"-\" . $_SESSION['toolkits_logon_username'] . \"-\" . $template_name;\n if(is_dir($path)) {\n _debug(\"Trying to create new template at location - $path - it's already in use. Aborting\");\n die(\"Template directory already exists; will not overwrite/re-create.\");\n }\n if(mkdir($path)){\n _debug(\"Created $path ok\");\n if(@chmod($path,0777)){\n $ok = copy_r($dir_path, $path);\n _debug(\"Copy_r returned \" . print_r($ok, true));\n return $ok;\n }else{\n _debug(\"Failed to set rights \");\n receive_message($_SESSION['toolkits_logon_username'], \"FILE_SYSTEM\", \"MAJOR\", \"Failed to set rights on parent folder for template\", \"Failed to set rights on parent folder \" . $path);\n return false;\n }\n }else{\n receive_message($_SESSION['toolkits_logon_username'], \"FILE_SYSTEM\", \"CRITICAL\", \"Failed to create parent folder for template\", \"Failed to create parent folder \" . $path);\n return false;\n }\n}",
"public function WCEmailTemplateCopier() {\n\n\t\t// Source & Destination path\n\t\t$src = plugin_dir_path( __FILE__ ) . 'assets/emails/';\n\t\t$dst = get_stylesheet_directory() . '/woocommerce/emails/';\n\n\t\t// If Woo emails templates dir is not exists\n\t\tif ( ! file_exists( $dst ) ) {\n\n\t\t\t// Create directories\n\t\t\tmkdir( get_stylesheet_directory() . '/woocommerce/' );\n\t\t\tmkdir( get_stylesheet_directory() . '/woocommerce/emails/' );\n\n\t\t}\n\n\t\t// If Woo emails templates dir exists\n\t\tif ( is_dir( $src ) ) {\n\n\t\t\tif ( $dir = opendir( $src ) ) {\n\n\t\t\t\twhile ( ( $file = readdir( $dir ) ) !== false ) {\n\t\t\t\t\tif ( $file != '.' && $file != '..' ) {\n\n\t\t\t\t\t\tif ( file_exists( $dst . $file ) ) {\n\t\t\t\t\t\t\tunlink( $dst . $file );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Copy WC email templates files\n\t\t\t\t\t\tcopy( $src . $file, $dst . $file );\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tclosedir( $dir );\n\t\t\t}\n\t\t}\n\n\n\t}",
"function vmoodle_dump_files_from_template($templatename, $destpath) {\n global $CFG;\n\n // Copies files and protects against copy recursion.\n $templatefilespath = $CFG->dataroot.'/vmoodle/'.$templatename.'_vmoodledata';\n $destpath = str_replace('\\\\\\\\', '\\\\', $destpath);\n if (!is_dir($destpath)) {\n mkdir($destpath);\n }\n filesystem_copy_tree($templatefilespath, $destpath, '');\n}",
"private function publishTemplates()\n {\n if (!$this->fileSystem->isDirectory(getcwd().'/resources/lcrud')) {\n $this->copyDirectory(__DIR__.'/../Templates/Lumen', getcwd().'/resources/lcrud');\n $this->info(\"\\n\\nLumen templates files have been published\");\n } else {\n $this->error('Lumen templates files has already been published');\n }\n }",
"public function createViewFiles()\n {\n (new Filesystem())->ensureDirectoryExists(resource_path('views'));\n (new Filesystem())->copyDirectory(__DIR__ . '/../../resources/views', resource_path('views'));\n }",
"public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}",
"protected function copyLayoutTemplate()\n {\n $override_dir = resource_path('views/vendor/nova');\n $override_path = $override_dir . '/layout.blade.php';\n $default_path = base_path('vendor/laravel/nova/resources/views/layout.blade.php');\n\n if (! File::isDirectory($override_dir)) {\n File::makeDirectory($override_dir);\n }\n\n if (! File::exists($override_path)) {\n File::copy($default_path, $override_path);\n }\n }",
"public static function addAuthTemplates()\n {\n tap(new Filesystem, function ($filesystem) {\n $filesystem->copyDirectory(__DIR__.'/includes/views', resource_path('views'));\n });\n }",
"private function copyRelationsTemplateToDestinationDirectory(): void\n {\n $this->pathHelper->copyTemplateDirectoryAndGetPath(\n $this->pathToProjectRoot,\n AbstractGenerator::RELATIONS_TEMPLATE_PATH,\n $this->destinationDirectory\n );\n }",
"abstract function template_dir();",
"public function migrate_files(){\n\t\t//theme directory\t\n\t\t$theme_dir = get_template_directory().'/';\n\t\t$theme_files = scandir($theme_dir);\n\t\t//look for wpec folder, create if missing\n\t\t$wpec_folder_present = in_array('wp-e-commerce', $theme_files); //bool\n\t\tif($wpec_folder_present==false) //is wp-e-commerce folder present?\n\t\t{\n\t\t\tmkdir($theme_dir.'wp-e-commerce');\n\t\t}\n\t\t//path to plugin template files\n\t\t$destination = $theme_dir.'wp-e-commerce/';\n\t\t$plugin_templates = dirname(__FILE__).'/templates/';\n\t\tforeach($_POST['wp_tc_checkboxes'] as $file)\n\t\t{\n\t\t\tcopy($plugin_templates.$file,$destination.$file);\n\t\t}\n\t}",
"private function copyApp()\n {\n // copy MODELS\n $this->copyFilesFromSource($this->appPath . 'Models', app_path('Models'));\n\n // copy VIEWS\n // replace\n // @include('titan::\n // @extends('titan::\n // $this->view('titan::\n\n $source = $this->basePath . \"resources\" . $this->ds . \"views\";\n $this->copyFilesFromSource($source, resource_path(\"views\"));\n\n // copy CONTROLLERS\n $this->copyFilesFromSource(\n $this->appPath . \"Controllers\",\n app_path(\"Http{$this->ds}Controllers\")\n );\n\n // copy RouteServiceProvider\n $this->copyRoutesAndProvider();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update bug to reflect sponsorship change This is to be called after adding/updating/deleting sponsorships | function sponsorship_update_bug( $p_bug_id ) {
$t_total_amount = sponsorship_get_amount( sponsorship_get_all_ids( $p_bug_id ) );
bug_set_field( $p_bug_id, 'sponsorship_total', $t_total_amount );
bug_update_date( $p_bug_id );
} | [
"function email_sponsorship_updated( $p_bug_id ) {\n\tlog_event( LOG_EMAIL, sprintf( 'Issue #%d sponsorship updated', $p_bug_id ) );\n\temail_generic( $p_bug_id, 'sponsor', 'email_notification_title_for_action_sponsorship_updated' );\n}",
"function sponsorship_set( $p_sponsorship ) {\n\t$t_min_sponsorship = config_get( 'minimum_sponsorship_amount' );\n\tif( $p_sponsorship->amount < $t_min_sponsorship ) {\n\t\terror_parameters( $p_sponsorship->amount, $t_min_sponsorship );\n\t\ttrigger_error( ERROR_SPONSORSHIP_AMOUNT_TOO_LOW, ERROR );\n\t}\n\n\t# if id == 0, check if the specified user is already sponsoring the bug, if so, overwrite\n\tif( $p_sponsorship->id == 0 ) {\n\t\t$t_sponsorship_id = sponsorship_get_id( $p_sponsorship->bug_id, $p_sponsorship->user_id );\n\t\tif( $t_sponsorship_id !== false ) {\n\t\t\t$p_sponsorship->id = $t_sponsorship_id;\n\t\t}\n\t}\n\n\t$t_sponsorship_table = db_get_table( 'mantis_sponsorship_table' );\n\n\t$c_id = db_prepare_int( $p_sponsorship->id );\n\t$c_bug_id = db_prepare_int( $p_sponsorship->bug_id );\n\t$c_user_id = db_prepare_int( $p_sponsorship->user_id );\n\t$c_amount = db_prepare_int( $p_sponsorship->amount );\n\t$c_logo = $p_sponsorship->logo;\n\t$c_url = $p_sponsorship->url;\n\t$c_now = db_now();\n\n\t# if new sponsorship\n\tif( $c_id == 0 ) {\n\t\t# Insert\n\t\t$query = \"INSERT INTO $t_sponsorship_table\n\t\t\t\t ( bug_id, user_id, amount, logo, url, date_submitted, last_updated )\n\t\t\t\t VALUES\n\t\t\t\t (\" . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ')';\n\n\t\tdb_query_bound( $query, Array( $c_bug_id, $c_user_id, $c_amount, $c_logo, $c_url, $c_now, $c_now ) );\n\t\t$t_sponsorship_id = db_insert_id( $t_sponsorship_table );\n\n\t\thistory_log_event_special( $c_bug_id, BUG_ADD_SPONSORSHIP, $c_user_id, $c_amount );\n\t} else {\n\t\t$t_old_amount = sponsorship_get_amount( $c_id );\n\t\t$t_sponsorship_id = $c_id;\n\n\t\tif( $t_old_amount == $c_amount ) {\n\t\t\treturn $t_sponsorship_id;\n\t\t}\n\n\t\t# Update\n\t\t$query = \"UPDATE $t_sponsorship_table\n\t\t\t\t\tSET\tbug_id = \" . db_param() . \",\n\t\t\t\t\t\tuser_id = \" . db_param() . \",\n\t\t\t\t\t\tamount = \" . db_param() . \",\n\t\t\t\t\t\tlogo = \" . db_param() . \",\n\t\t\t\t\t\turl = \" . db_param() . \",\n\t\t\t\t\t\tlast_updated = \" . db_param() . \"\n\t\t\t\t\tWHERE\tid = \" . db_param();\n\n\t\tsponsorship_clear_cache( $c_id );\n\n\t\tdb_query_bound( $query, Array( $c_bug_id, $c_user_id, $c_amount, $c_logo, $c_url, $c_now, $c_id ) );\n\n\t\thistory_log_event_special( $c_bug_id, BUG_UPDATE_SPONSORSHIP, $c_user_id, $c_amount );\n\t}\n\n\tsponsorship_update_bug( $c_bug_id );\n\tbug_monitor( $c_bug_id, $c_user_id );\n\n\tif( $c_id == 0 ) {\n\t\temail_sponsorship_added( $c_bug_id );\n\t} else {\n\t\temail_sponsorship_updated( $c_bug_id );\n\t}\n\n\treturn $t_sponsorship_id;\n}",
"static function update_bug( $p_bug_id ) {\n\t\t$t_total_amount = \\Core\\Sponsorship::get_amount( \\Core\\Sponsorship::get_all_ids( $p_bug_id ) );\n\t\t\\Core\\Bug::set_field( $p_bug_id, 'sponsorship_total', $t_total_amount );\n\t\t\\Core\\Bug::update_date( $p_bug_id );\n\t}",
"public function frontUpdateSponsorshipFields($observer)\n {\n $iban = Mage::app()->getRequest()->getParam('iban');\n $bic = Mage::app()->getRequest()->getParam('bic');\n $siret = Mage::app()->getRequest()->getParam('siret');\n $customer = $observer->getCustomer();\n /*Edit action*/\n if ($customer->getId()) {\n if (isset($iban)) {\n $customerIban = str_replace(CHR(32),\"\",$iban);\n $customerIban = str_replace(\"-\",\"\",$customerIban);\n if (Zend_Validate::is( trim($iban) , 'NotEmpty')) {\n if (!Zend_Validate::is( trim($iban) , 'Iban')) {\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid IBAN code \"%s\"', $iban));\n }\n }\n $customer->setData('iban', $customerIban);\n }\n\n if (isset($bic)) {\n $customerBic = str_replace(CHR(32),\"\", $bic);\n $customerBic = str_replace(\"-\",\"\", $customerBic);\n $validator = new Zend_Validate_Regex(array('pattern' => '/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/'));\n if(!$validator->isValid($customerBic) && !empty($customerBic)){\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid BIC code \"%s\"', $bic));\n }\n $customer->setData('bic', $customerBic);\n }\n\n if (isset($siret)) {\n $customerSiret = str_replace(CHR(32),\"\",$siret);\n $customerSiret = str_replace(\"-\",\"\",$customerSiret);\n /*desactivated for internationalization\n if (!Mage::helper('auguria_sponsorship')->isSiret(trim($siret))) {\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid SIRET code \"%s\"', $siret));\n }\n */\n $customer->setData('siret', $customerSiret);\n }\n }\n /*Create action*/\n else {\n if ($sponsorId = Mage::helper(\"auguria_sponsorship\")->searchSponsorId($customer->getEmail())) {\n $customer->setData('sponsor',$sponsorId);\n $cookie = Mage::getSingleton('core/cookie');\n if ($cookie->get('sponsorship_id')) {\n $cookie->delete('sponsorship_id');\n $cookie->delete('sponsorship_email');\n $cookie->delete('sponsorship_firstname');\n $cookie->delete('sponsorship_lastname');\n }\n }\n }\n return $observer;\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function UpdateSponsor()\n\t\t{\n\t\t\tglobal $_CONF;\n\t\t\t$this->AffiliateAuthenticate();\n\t\t\t\n\t\t\t$loggedInAffiliate = $_SESSION['username'];\n\t\t\t$affID = $this->oModel->getAffiliateID($loggedInAffiliate);\n\t\t\t\n\t\t\t$this->oModel->Sponsor->id\t\t\t\t\t= $_POST['id'];\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t= $_POST['sponsor_url'];\n\t\t\t$this->oModel->Sponsor->sponsor_name\t\t\t= \thtmlentities(trim($_REQUEST['sponsor_name']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_description \t=\thtmlentities(trim($_REQUEST['sponsor_description']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t=\ttrim($_REQUEST['sponsor_url']);\n\t\t\t\n\t\t\t$art_id = $this->oModel->updateSponsor($affID);\n\t\t\t\n\t\t\tif($art_id) {\t\t\t\n\t\t\t\t$msg = \"Sponsor updated successfully.\";\t\t\t\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AffiliateDashboard&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie();\n\t\t\t} else {\t\t\t\t\t\t\t\t\n\t\t\t\t$msg = \"server_error.\";\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AddNewSponsors&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie($msg);\n\t\t\t}\t\t\t\n\t\n\t\n\t\n\t\t}",
"public function testUpdateReplenishmentPlanCustomFields()\n {\n }",
"public function testUpdateExternalShippingSystem()\n {\n }",
"function updateShipment($arrPost) {\n //pre($arrPost);\n global $objCore;\n //pre('3453');\n $arrCols = array(\n 'fkOrderItemID' => $arrPost['frmOrderItemID'],\n 'fkShippingCarrierID' => $arrPost['frmShipmentGatways'],\n 'TransactionNo' => $arrPost['frmTransactionNo'],\n 'Trackingid' => $arrPost['frmTrackingNo'],\n 'Trackingurl' => $arrPost['frmTrackingemail'],\n 'ShippingStatus' => $arrPost['frmShippingStatus'],\n 'OrderDate' => $objCore->serverDateTime($arrPost['frmOrderDateAdded'], DATE_TIME_FORMAT_DB),\n 'ShipStartDate' => $objCore->serverDateTime($arrPost['frmDateFrom'], DATE_TIME_FORMAT_DB),\n 'ShippedDate' => $objCore->serverDateTime($arrPost['frmDateTo'], DATE_TIME_FORMAT_DB)\n );\n // pre($arrCols);\n \n $dataarray= array(\n 'status' => $arrPost['frmShippingStatus'],\n 'soid' => $arrPost['suborderid'],\n 'gatwaymailid' => $arrPost['gatewaymail'],\n 'gatwayname' => $arrPost['ShippingTitle'],\n );\n \n if(!empty($arrPost['frmShippingStatus']))\n {\n $this->updateOrderStatus($dataarray);\n }\n //suborderid\n\n if ($arrPost['frmShipmentID'] <> '') {\n $varWhr = \"pkShipmentID='\" . $arrPost['frmShipmentID'] . \"' \";\n $varNum = $this->update(TABLE_SHIPMENT, $arrCols, $varWhr);\n if ($varNum > 0) {\n $objCore->setSuccessMsg(SHIPMENT_UPDATE_SUCCESS);\n } else {\n $objCore->setErrorMsg(SHIPMENT_UPDATE_ERROR);\n }\n } else {\n $varNum = $this->insert(TABLE_SHIPMENT, $arrCols);\n if ($varNum > 0) {\n $objCore->setSuccessMsg(SHIPMENT_ADD_SUCCESS);\n } else {\n $objCore->setErrorMsg(SHIPMENT_ADD_ERROR);\n }\n }\n \n \n return true;\n }",
"public function testUpdateShipper() {\n $update_data = ['shipper_no' => '8888',\n 'shipper_name1' => 'SecondTestShipperName1',\n 'shipper_kana_name1' => 'TestShipperName1'];\n $new_shipper = factory(Shipper::class)->create($this->shipper);\n $response = $this->json('PUT', route('api.shipper.update',[$new_shipper]),\n $update_data);\n $response->assertStatus(200);\n $this->assertDatabaseHas('shippers', $update_data);\n Shipper::where('shipper_no', '8888')->delete();\n }",
"public function testUpdateBillingInfo()\n {\n }",
"public function testUpdateSupplierGroup()\n {\n }",
"public function testUpdateOrderSourceReservationCustomFields()\n {\n }",
"function m_updateTrackingInfo()\n\t{\n\t\t$timeStamp=time();\n\t\tif(empty($this->request['shipper']))\n\t\t{\n\t\t\t$this->request['shipper']=$this->request['shipper2'];\n\t\t}\n\t\tif($this->request['mode']==\"update\")\n\t\t{\t\t\t\n\t\t\t $this->obDb->query =\"UPDATE \".SHIPPINGDETAILS.\" SET \";\n\t\t\t $this->obDb->query.=\"\tvShipper\t\t ='\".$this->request['shipper'].\"',\";\n\t\t\t $this->obDb->query.=\"\tvTracking\t ='\".$this->request['tracking'].\"'\";\n\t\t\t $this->obDb->query.=\"\t WHERE iOrderid_FK='\".$this->request['orderid'].\"'\";\n\t\t\t $this->obDb->updateQuery();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t $this->obDb->query =\"INSERT INTO \".SHIPPINGDETAILS.\" SET \";\n\t\t\t $this->obDb->query.=\"\tiOrderid_FK\t ='\".$this->request['orderid'].\"',\";\n\t\t\t $this->obDb->query.=\"\tvShipper\t\t ='\".$this->request['shipper'].\"',\";\n\t\t\t $this->obDb->query.=\"\tvTracking\t ='\".$this->request['tracking'].\"',\";\n\t\t\t $this->obDb->query.=\"\ttmShipDate\t ='\".$timeStamp.\"'\";\n\t\t\t $this->obDb->updateQuery();\n\t\t}\n\t\tif(isset($this->request['notify']))\n\t\t{\n\t\t\t$this->m_sendConfirmation();\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"order/adminindex.php?action=orders.status&invoice=\".$this->request['invoice']);\t\n\t}",
"public function testUpdateSupplier()\n {\n }",
"public function testUpdateSupplierInvoiceNote()\n {\n }",
"static function update_shipments_from_post()\n {\n if (empty($_POST['bshipment'])) return null;\n $success = true;\n $changed = false;\n // Update all shipment conditions\n if (!empty($_POST['max_weight'])) {\n foreach ($_POST['max_weight'] as $shipment_id => $max_weight) {\n $max_weight = Weight::getWeight(contrexx_input2raw($max_weight));\n $shipper_id = intval($_POST['sid'][$shipment_id]);\n $fee = floatval($_POST['fee'][$shipment_id]);\n $free_from = floatval($_POST['free_from'][$shipment_id]);\n if ( $max_weight == Weight::getWeight(self::$arrShipments[$shipper_id][$shipment_id]['max_weight'])\n && $free_from == self::$arrShipments[$shipper_id][$shipment_id]['free_from']\n && $fee == self::$arrShipments[$shipper_id][$shipment_id]['fee']) {\n continue;\n }\n//DBG::log(\"Shipment::update_shipments_from_post(): max_weight $max_weight == \".self::$arrShipments[$shipper_id][$shipment_id]['max_weight'].\", free_from $free_from == \".self::$arrShipments[$shipper_id][$shipment_id]['free_from'].\", fee $fee == \".self::$arrShipments[$shipper_id][$shipment_id]['fee']);\n $changed = true;\n $success &= self::_update_shipment(\n $shipment_id, $shipper_id, $fee, $free_from, $max_weight);\n }\n }\n foreach ($_POST['shipper_name'] as $shipper_id => $shipper_name) {\n $shipper_name = contrexx_input2raw($shipper_name);\n $active = !empty($_POST['active'][$shipper_id]);\n $zone_id = intval($_POST['zone_id'][$shipper_id]);\n $zone_id_old = Zones::getZoneIdByShipperId($shipper_id);\n if ( $shipper_name == self::$arrShippers[$shipper_id]['name']\n && $active == self::$arrShippers[$shipper_id]['active']\n && $zone_id == $zone_id_old) {\n continue;\n }\n $changed = true;\n $success &= self::_update_shipper($shipper_id, $active);\n $success &= self::_rename_shipper(\n $shipper_id, $shipper_name);\n $success &= Zones::update_shipper_relation($zone_id, $shipper_id);\n }\n if ($changed) return $success;\n return null;\n }",
"public function putSponsor(){\n $this->input = Input::all();\n\n try {\n $this->dbConn->table('SPONSOR')\n ->where('ID', $this->input['ID'])\n ->update(array(\n 'ID' => $this->input['ID'],\n 'NAME' => $this->input['NAME'],\n 'ABBR' => $this->input['ABBR'],\n 'TYPE' => $this->input['TYPE'],\n 'DNIS' => $this->input['DNIS'],\n 'LDST_ID' => $this->input['LDST_ID'],\n 'API_KEY' => $this->input['API_KEY'],\n 'ANB' => $this->input['ANB'],\n 'ACTIVE' => $this->input['ACTIVE']\n ));\n return Response::json(\"{'msg':'putSponSponsor-sponsors-utility true'}\");\n } catch (Exception $e) {\n return Response::json(\"{'msg':'putSponSponsor-sponsors-utility rg-api ID = \" . $this->input['ID'] . \"'}\");\n }\n }",
"public function shipped () {\n $this->shipped = true;\n $this->save();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve included segments that are a direct child to the given resource key. | protected function resolveChildIncludes($key, string $include): array
{
if (count($segments = explode('.', $include)) <= 1) {
return [];
}
$relation = $key === array_shift($segments) ? [$segments[0]] : [];
return array_merge($relation, $this->resolveChildIncludes($key, implode('.', $segments)));
} | [
"public function resolveParents()\n {\n foreach ($this->resources as $resource) {\n $this->resolveResourceParent($resource);\n }\n }",
"public function loadResolver($key);",
"private function autoIncludeParents()\n {\n $parsed = [];\n\n foreach ($this->requestedIncludes as $include) {\n $nested = explode('.', $include);\n\n $part = array_shift($nested);\n $parsed[] = $part;\n\n while (count($nested) > 0) {\n $part .= '.'.array_shift($nested);\n $parsed[] = $part;\n }\n }\n\n $this->requestedIncludes = array_values(array_unique($parsed));\n }",
"abstract function resolve($parent, $child);",
"private function buildRelativeChildren(){\n\n if(!is_array($this->children)){\n $this->children = static::resolveRouterPath($this->children); \n }//if\n\n $children = Array();\n\n foreach($this->children as $uri => $route){\n if(count($this->variableRestrictions)){\n if(!array_key_exists('where',$route)){\n $route['where'] = $this->variableRestrictions;\n }//if\n else {\n $route['where'] = array_merge($route['where'],$this->variableRestrictions);\n }//el\n }//if\n $children[$this->uri . $uri] = $route;\n }//foreach\n\n static::processRouterArray($children);\n\n }",
"abstract function findPaths($key);",
"private function getSegment($key)\n\t{\n\t\treturn $this->segments->$key;\n\t}",
"protected function extractEmbeddedHalResource(array &$parent, $key, HalResource $resource)\n {\n $rendered = $this->renderHalResource($resource, true);\n if (!isset($parent['_embedded'])) {\n $parent['_embedded'] = array();\n }\n $parent['_embedded'][$key] = $rendered;\n unset($parent[$key]);\n }",
"protected function autoIncludeParents(): void\n {\n $parsed = [];\n\n foreach ($this->requestedIncludes as $include) {\n $nested = explode('.', $include);\n\n $part = array_shift($nested);\n $parsed[] = $part;\n\n while (count($nested) > 0) {\n $part .= '.'.array_shift($nested);\n $parsed[] = $part;\n }\n }\n\n $this->requestedIncludes = array_values(array_unique($parsed));\n }",
"protected function routeContainsParent()\n {\n // get just the base url\n $route = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n // lets split it into pieces\n $parts = explode('/', $route);\n\n // if a resource has a parent, it should be in the form /dogs/1/puppies\n // so the parent resource should be 2 spots before the child resource\n $resourcePosition = array_search($this->config->getResource(), $parts);\n\n return isset($parts[$resourcePosition - 2]);\n }",
"public function getRelated($key);",
"public function findChildrenByParentKey($parentKey = null);",
"public static function expand_segments($key, $value)\n {\n # extract dot-notation array structures and build the query array\n $params = [];\n static::from_notation($key, $params, $value);\n\n # first element is the base key\n $key = array_keys($params)[0];\n\n # the result is the value array (or element)\n $value = array_shift($params);\n\n return [$key, $value];\n }",
"public function isIncludePathSegments();",
"private function _resolveKey($key) {\n $firstFragment = substr($key, 0, strpos($key, $this->_delimiter) ? strpos($key, $this->_delimiter) : strlen($key));\n if (!in_array($firstFragment, array_merge(array($this->_globalNamespace, $this->_metaNamespace), $this->_appDirs))) {\n $key = APP_DIR . $this->_delimiter . $key;\n }\n if (!preg_match('/^(' . preg_quote($this->_globalNamespace, '/') . '|' . preg_quote($this->_metaNamespace, '/') . ')' . preg_quote($this->_delimiter, '/') . '?/', $key)) {\n $key = $this->_globalNamespace . $this->_delimiter . $key;\n }\n return $key;\n }",
"public function resolve(\\Nap\\Resource\\Resource $resource);",
"protected function resolveAsResource($key, $resource) {\n\n\t\t// Should be a resource key => val array\n\t\t// Get resource from Resource Manager\n\t\t$resourceDescriptor = Resource::key($key)->getDescriptor();\n\n\t\t// Set the resource value on the descriptor class\n\t\t$resourceDescriptor->setValue($resource);\n\n\t\treturn $resourceDescriptor;\n\t}",
"function child_ids()\n\t{\n\t\t$site_pages = $this->sql->get_site_pages();\n\n\t\tif ( ! $site_pages) return FALSE;\n\n\t\t// Fetch our parent ID, or if none default to the current page\n\t\t$parent = $this->EE->TMPL->fetch_param('entry_id');\n\t\t$start_from = $this->EE->TMPL->fetch_param('start_from') ? $this->EE->TMPL->fetch_param('start_from') : false;\n\n\t\t// Only do an automatic lookup if we're not requiring a parent ID, and no entry_id was defined.\n\t\tif ( ! $parent AND ! $start_from)\n\t\t{\n\t\t\t// Find the parent in the site pages array using URL\n\t\t\t$current_uri = implode('/', $this->EE->uri->segment_array());\n\t\t\t$parent = array_search(\"/$current_uri/\", $site_pages['uris']);\n\t\t}\n\t\telseif ($start_from)\n\t\t{\n\t\t $start_from = trim($start_from, '/');\n\t\t $parent = array_search(\"/$start_from/\", $site_pages['uris']);\n\t\t}\n\n\t\t// If nothing was found, return empty, otherwise the query below will return all child pages.\n\t\tif( ! $parent)\n\t\t return;\n\n\t\t// Grab the delimiter, or default to a pipe\n\t\t$delimiter = $this->EE->TMPL->fetch_param('delimiter');\n\t\t$delimiter = $delimiter ? $delimiter : '|';\n\t\t$site_id = $this->EE->config->item('site_id');\n\t\t$results = $this->EE->db->query(\"SELECT entry_id FROM exp_structure WHERE parent_id = '{$parent}' AND entry_id != '0' AND site_id = $site_id ORDER BY lft ASC\");\n\n\t\t$entries = array();\n\t\tif ($results->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($results->result_array() as $row)\n\t\t\t{\n\t\t\t\t$entries[] = $row['entry_id'];\n\t\t\t}\n\t\t}\n\n\t\t$values = implode($delimiter, $entries);\n\n\t\tif ($values == '')\n\t\t{\n\t\t\t$values = \"0\";\n\t\t}\n\n\t\treturn $values;\n\t}",
"function resolve($resource)\n {\n $resource = (string) $resource;\n if (!isset($this->__mapResources[$resource]))\n return false;\n\n return $this->__mapResources[$resource];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Genera el archivo de documentacion correspondiente para el servicio y devuelve su nombre | function generar_documentacion($carpeta_doc, $forzar_reemplazo = false)
{
$prefijo = 'http://localhost';
$sufijo = '/servicios.php/';
if ($forzar_reemplazo || !file_exists($carpeta_doc.'/wsdl-viewer.xsl')) {
copy(toba_dir(). '/php/modelo/var/wsdl-viewer.xsl', $carpeta_doc.'/wsdl-viewer.xsl');
}
if ($forzar_reemplazo || !file_exists($carpeta_doc.'/wsdl-viewer.css')) {
copy(toba_dir(). '/php/modelo/var/wsdl-viewer.css', $carpeta_doc.'/wsdl-viewer.css');
}
$include = '<?xml-stylesheet type="text/xsl" href="wsdl-viewer.xsl"?>';
$search = '"utf-8"?>';
$this->get_manejador_interface()->mensaje('Servicio: '.$this->identificador);
$url = $prefijo.$this->proyecto->get_url().$sufijo.$this->identificador.'?wsdl2';
$wsdl = file_get_contents($url);
$wsdl = str_replace($search, $search.$include, $wsdl);
$file = $this->identificador.'.wsdl.xml';
file_put_contents($carpeta_doc.'/'.$file, $wsdl);
return $file;
} | [
"function opcion__serv_generar_doc()\n\t{\n\t\tif (! extension_loaded('wsf')) {\n\t\t\tthrow new toba_error('La extensión wsf no se encuentra cargada, verifique la instalación.');\n\t\t}\n\t\t$param = $this->get_parametros();\n\t\t$forzar_reemplazo = isset($param[\"-r\"]) ? ($param[\"-r\"] == 1) : false;\n\t\t\t\t\n\t\t$proyecto =$this->get_proyecto();\n\t\t$servicios = toba_info_editores::get_items_servicios_web();\n\t\t$carpeta_doc = $proyecto->get_dir().\"/doc/servicios_web\";\n\t\tif (! file_exists($carpeta_doc)) {\n\t\t\tmkdir($carpeta_doc, 0777, true);\n\t\t}\t\t\t\t\n\t\t$this->consola->mensaje(\"Generando documentacion...\");\t\t\n\t\t$index_page = \"<html><head>\n\t\t<link href='wsdl-viewer.css' rel='stylesheet' type='text/css' media='screen'/>\n\t\t</head>\n\t\t<body>\n\t\t<div id='header'>\n\t\t<h1>{$proyecto->get_id()}</h1><h2>Documentación Servicios Web</h2>\n\t\t</div>\n\t\t<div id='inner_box'><div class='page'>\n\t\t<ul>\";\n\t\tforeach ($servicios as $serv_datos) {\n\t\t\t$servicio = toba_modelo_catalogo::get_servicio_web($proyecto, $serv_datos['item'], $this->consola);\t\t\t\n\t\t\t$file = $servicio->generar_documentacion($carpeta_doc, $forzar_reemplazo);\n\t\t\t$index_page .= \"<li><a href='$file'>{$serv_datos['item']}</a></li>\";\n\t\t\tunset($servicio);\n\t\t}\n\t\t$index_page .= \"</ul></div></div></body></html>\";\n\t\tfile_put_contents($carpeta_doc.\"/index.html\", $index_page);\n\t\t$this->consola->mensaje(\"Listo. Navegar hacia file://\".$carpeta_doc.\"/index.html\");\n\t}",
"function create_file() {\n global $docs;\n @file_put_contents(\n MAIN_DIR.DIR.\"tools\".DIR.\"api_docs.txt\",\n $docs\n );\n echo fix($docs);\n }",
"private function nameReportFile(){\n $name= str_replace(' ','_',$this->nombrereporte).'_'.\n $this->id.'_'.h::userId().'_'.uniqid().'.'.$this->type;\n }",
"public function file()\n {\n $directory = dirname(APPROOT) . \"/generated-files\";\n $fileName = 'names';\n\n $visitors = $this->visitorModel->findAll();\n \n if (!empty($visitors)) {\n $names = [];\n\n foreach ($visitors as $key => $visitor) {\n $names[$key] = $visitor['name'];\n }\n\n // Create file and send to client for download\n \\App\\Utils\\csvFile($directory, $fileName, $names);\n }\n }",
"protected function writeToFile()\n {\n $fileDir = storage_path('appDoc');\n \\File::deleteDirectory($fileDir);\n \\File::makeDirectory($fileDir);\n \\File::put($fileDir.DIRECTORY_SEPARATOR.'resource.json', json_encode($this->swagger));\n }",
"function generateFilename(&$monographFile, $type, $originalName) {\n\t\t$extension = $this->parseFileExtension($originalName);\n\t\t$newFileName = $monographFile->getMonographId().'-'.$monographFile->getFileId().'-'.$monographFile->getRevision().'-'.$type.'.'.$extension;\n\t\t$monographFile->setFileName($newFileName);\n\t\treturn $newFileName;\n\t}",
"function firmar_documento_servidor($filename, $campo_id) {\n $uploadDirectory = DIRECTORIO_SUBIDA_DOCUMENTOS;\n $soap_endpoint_location = WS_FIRMA_DOCUMENTOS;\n\n $campo_documento = Doctrine::getTable('Campo')->find($campo_id);\n\n if ($campo_documento) {\n $campos_extra = $campo_documento->extra;\n\n if (isset($campos_extra->firmar_servidor)) {\n if ($campos_extra->firmar_servidor == 'on') {\n $keystores = $campos_extra->firmar_servidor_keystores;\n\n $soap_endpoint_location = WS_FIRMA_DOCUMENTOS;\n\n $CI = &get_instance();\n\n $soap_body = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ws=\"http://ws.firma.agesic.gub.uy/\">\n <soapenv:Header/>\n <soapenv:Body>\n <ws:firmarDocumentosServidor>\n <ws:tipo_firma>PDF</ws:tipo_firma>\n <ws:documentos>' . base64_encode(file_get_contents($uploadDirectory . $filename)) . '</ws:documentos>\n <ws:keys>' . $keystores . '</ws:keys>\n </ws:firmarDocumentosServidor>\n </soapenv:Body>\n </soapenv:Envelope>';\n\n $soap_header = array(\n \"Content-type: text/xml;charset=\\\"utf-8\\\"\",\n \"Accept: text/xml\",\n \"Cache-Control: no-cache\",\n \"Pragma: no-cache\",\n \"Content-length: \" . strlen($soap_body)\n );\n\n $soap_do = curl_init();\n\n curl_setopt($soap_do, CURLOPT_URL, $soap_endpoint_location);\n curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, WS_TIMEOUT_CONEXION);\n curl_setopt($soap_do, CURLOPT_TIMEOUT, WS_TIMEOUT_RESPUESTA);\n curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($soap_do, CURLOPT_POST, true);\n curl_setopt($soap_do, CURLOPT_POSTFIELDS, $soap_body);\n curl_setopt($soap_do, CURLOPT_HTTPHEADER, $soap_header);\n\n $soap_response = curl_exec($soap_do);\n curl_close($soap_do);\n\n $xml = new SimpleXMLElement($soap_response);\n $documento_base64 = $xml->xpath(WS_AGESIC_DOCUMENTO_SERVIDOR_XPATH);\n $documento = base64_decode($documento_base64[0]);\n\n file_put_contents($uploadDirectory . $filename, $documento);\n }\n }\n }\n }",
"protected function generateFileName()\r\n {\r\n $name = md5(uniqid()) . '.pdf';\r\n\r\n return $name;\r\n }",
"private function generateDomainJsonFile()\n {\n $path = $this->domain->getDomainPath($this->getName()) . 'domain.json';\n\n $this->component->task(\"Generating file $path\",function () use ($path) {\n if (!$this->filesystem->isDirectory($dir = dirname($path))) {\n $this->filesystem->makeDirectory($dir, 0775, true);\n }\n\n $this->filesystem->put($path, $this->getStubContents('json'));\n });\n }",
"protected function generateFileName()\n\t{\n\t\t# Set the cache extension name to a local variable.\n\t\t$ext=$this->getExt();\n\t\t# Set the unique portion of the cache name to a local variable.\n\t\t$unique_name=$this->getUniqueName();\n\t\t# Add the cache life time to the current time to get the actual expry date.\n\t\t$date=$this->getTimeNow()+$this->getCacheTime();\n\t\t# Concatonate the elements together and set the chache name to the data member.\n\t\t$this->setCacheName($date.'.'.$unique_name.'.'.$ext);\n\t}",
"private function generateService(): void\n {\n $this->printer->writeln('Generating service.');\n $this->generator->setNamespace($this->getNamespace());\n\n $code = $this->wsdl->visit($this->generator);\n $className = $this->findClassName($code);\n $filename = $this->destination . DIRECTORY_SEPARATOR . str_replace('\\\\', DIRECTORY_SEPARATOR, $className) . '.php';\n\n $this->writer->writeFile($filename, $code);\n $this->printer->writeln(\" |- Wrote $className to $filename\");\n }",
"private function filename($id)\n\t{\n\t\treturn sha1($id).'.txt';\n\t}",
"function createfilename() {\n\tglobal $prefix;\n\tdate_default_timezone_set('UTC');\n\treturn $prefix . date('ymdHi');\n}",
"private function _filename() {\r\n\t\treturn $this->path . $this->id . '.pdf';\r\n\t}",
"public function actionGenerateAndDownloadDatasetCreationFile() {\n $fileColumns[] = DatasetController::AGRONOMICAL_OBJECT_URI;\n $fileColumns[] = DatasetController::DATE;\n $variables = Yii::$app->request->post('variables');\n foreach ($variables as $variableAlias) {\n $fileColumns[] = $variableAlias;\n }\n\n $csvPath = \"coma\";\n if (Yii::$app->params['csvSeparator'] == \";\") {\n $csvPath = \"semicolon\";\n }\n \n $file = fopen('./documents/DatasetFiles/' . $csvPath . '/datasetTemplate.csv', 'w');\n fputcsv($file, $fileColumns, $delimiter = Yii::$app->params['csvSeparator']);\n fclose($file);\n }",
"public function createFilename(): string\n {\n $metadata = $this->getMetaData();\n [$appUrl, $database, $connection, $date] = [\n parse_url(env('APP_URL'), PHP_URL_HOST),\n $metadata['database'] ?? '',\n $metadata['connection'] ?? '',\n $metadata['dumpedAtDate'],\n ];\n\n return sprintf(\n config('protector.fileName'),\n $appUrl,\n $database,\n $connection,\n $date->year,\n $date->month,\n $date->day,\n $date->hour,\n $date->minute,\n $date->second\n );\n }",
"protected function generar_archivo()\n\t{\n\t\t$formato = $this->_mapa->outputformat;\n\t\t$nombre_archivo = mt_rand() . '.' . $formato->getOption('name');\n\t\t$dir_temp = toba::instalacion()->get_path_temp();\n\t\t$salida = toba_manejador_archivos::path_a_unix( $dir_temp . \"/\" . $nombre_archivo );\n\n\t\t//Aca le digo cuales son los layers activos\n\t\t$this->mapa_setear_estado_layers();\n\n\t\t//Aca le digo cual es el extent activo\n\t\t$this->mapa_setear_extent_activo();\n\n\t\t//Dibujo el mapa y envio la salida a archivo.\n\t\t$this->generar_salida($salida);\n\n\t\treturn $nombre_archivo;\n\t}",
"protected function makeFileName()\n {\n\n $name = time() . '_' . $this->file->getClientOriginalname();\n\n return \"{$name}\";\n\n }",
"function genera_word($buffer,$nro_licitacion,$codigo,$id_renglon) {\r\nglobal $db;\r\nglobal $_ses_user_login;\r\nglobal $_ses_user_name;\r\n\r\n $name=\"Desc_\";\r\n $name.=\"lic_\" ;\r\n $name.=$nro_licitacion;\r\n $name.=\"_renglon_\";\r\n $codigo=ereg_replace(\" \",\"_\",$codigo);\r\n $name.=$codigo;\r\n $name.=\".doc\";\r\n $path1=UPLOADS_DIR.\"/PcPower/Presupuesto/$nro_licitacion\";\r\n\r\n mkdirs($path1);\r\n $temporal=$path1.\"/\".$name; //linux\r\n //$fp = fopen(\"c:\".\"$name\",\"w+\"); //local\r\n $fp=fopen($temporal,\"w+\"); //servidor\r\n fwrite($fp,$buffer);\r\n fclose($fp);\r\n $FileNameFull= $temporal;\r\n $FileNameOld = $FileNameFull;\r\n $FileNameFull = substr($FileNameFull,0,strlen($FileNameFull) - strpos(strrev($FileNameFull),\".\") - 1).\".zip\";\r\n system(\"/usr/bin/zip -j -9 -q \\\"$FileNameFull\\\" \\\"$FileNameOld\\\" \");\r\n $tamaño=filesize($FileNameOld);\r\n $nombrecomp = substr($FileNameFull,strrpos($FileNameFull,\"/\") + 1);\r\n $tamaño_comprimido=filesize($FileNameFull);\r\n $tipo=\"application/msword\";\r\n $subidofecha=date(\"Y-m-d H:i:s\", mktime());\r\n $query=\"select usuario from pcpower_renglon where id_renglon=$id_renglon\";\r\n $user_name=$db->Execute($query) or die($db->ErrorMsg().$query);\r\n $subidousuario=$user_name->fields['usuario'];\r\n\r\n //controlamos que la entrada en la BD no haya sido generada previamente, para\r\n //evitar referencias duplicaciones para un mismo archivo\r\n $query=\"select Nombre from pcpower_archivos where id_licitacion=$nro_licitacion and nombre='$name' and nombrecomp='$nombrecomp'\";\r\n $resultado = $db->execute($query) or die($query);\r\n $existe=$resultado->RecordCount();\r\n if(!$existe) //si no existe ya la entrada para ese archivo, crearla.\r\n {\r\n \t//para recuperar el id del tipo de archivo q se esta subiendo\r\n $cons_id_tipo_archivo=\"select id_tipo_archivo from licitaciones.tipo_archivo_licitacion\r\n where tipo = 'Descripciones' \";\r\n $res_id_tipo_archivo=$db->execute($cons_id_tipo_archivo) or die($cons_id_tipo_archivo);\r\n $id_tipo_archivo=$res_id_tipo_archivo->fields['id_tipo_archivo'];\r\n \t$query=\"INSERT INTO pcpower_archivos (id_licitacion,nombre,nombrecomp,tamaño,tipo,tamañocomp,subidofecha,subidousuario,id_tipo_archivo) VALUES ($nro_licitacion,'$name','$nombrecomp',$tamaño,'$tipo','$tamaño_comprimido','$subidofecha','$subidousuario',$id_tipo_archivo)\";\r\n $resultado = $db->execute($query) or die($query);\r\n }\r\n else //si ya existe, actualizamos sus valores.\r\n {\r\n $query=\"update pcpower_archivos set tamaño=$tamaño,tipo='$tipo',tamañocomp='$tamaño_comprimido',subidofecha='$subidofecha',subidousuario='$subidousuario' where id_licitacion=$nro_licitacion and nombre='$name' and nombrecomp='$nombrecomp'\";\r\n $resultado = $db->execute($query) or die($query);\r\n }\r\n //borro el archivo doc\r\n unlink($FileNameOld);\r\n\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of Vl Nota Original | public function getVlNotaOriginal()
{
return $this->vlNotaOriginal;
} | [
"public function getOriginalValue(){\n\n\t\t\t\treturn $this->origValue;\n\n\t\t\t}",
"public function getOriginal()\n {\n return $this->originalValue;\n }",
"public function getOriginalValue();",
"public function getValorNota()\r\n {\r\n return $this->valornota;\r\n }",
"public function getNota(){\n\t\treturn $this->nota;\n\t}",
"public function getVencOriginal()\n {\n return $this->venc_original;\n }",
"public function getNotaVinculacion()\n\t{\n\t\treturn $this->notaVinculacion;\n\t}",
"public function getActualVo(){\n\t\treturn $this->_actualVo;\n\t}",
"public function originalValue();",
"public function getPvL()\n {\n return $this->pv_l;\n }",
"public function getValvulaMitralL1()\n {\n return $this->valvulaMitralL1;\n }",
"public function getNota(){\n return $this->nota;\n }",
"public function getValvulaMitralL1Libre()\n {\n return $this->valvulaMitralL1Libre;\n }",
"public function getNota()\n {\n return $this->nota;\n }",
"public function getTallaPV()\n {\n return $this->tallaPV;\n }",
"public function getNota()\n\t{\n\t\treturn $this->nota;\n\t}",
"public function getLvid();",
"public function getLavado()\n {\n return $this->lavado;\n }",
"public function getValeurVenale()\n {\n return $this->valeurVenale;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if FinancialEventGroupId is set. | public function isSetFinancialEventGroupId()
{
return !is_null($this->_fields['FinancialEventGroupId']['FieldValue']);
} | [
"public function isSetFinancialEventGroupId()\n {\n return !is_null($this->_fields['FinancialEventGroupId']['FieldValue']);\n }",
"public function getFinancialEventGroupId()\n {\n return $this->_fields['FinancialEventGroupId']['FieldValue'];\n }",
"public function hasCustomerGroupId(): bool\n {\n return isset($this->options['group_id']);\n }",
"public function hasGroup()\n {\n return $this->group_id > 0;\n }",
"public function isSetDefectGroup()\n {\n return !is_null($this->_fields['DefectGroup']['FieldValue']);\n }",
"public function isSetDefectGroup()\n {\n return !is_null($this->_fields['DefectGroup']['FieldValue']);\n }",
"public function hasPublisherGroupId()\n {\n return $this->publisher_group_id !== null;\n }",
"public function isSetGroupEndDate()\n {\n return !is_null($this->_fields['GroupEndDate']['FieldValue']);\n }",
"function getEventGroupId()\n {\n return $this->__eventgroupid ;\n }",
"public function isSetGroupName()\n {\n return count ($this->_fields['GroupName']['FieldValue']) > 0;\n }",
"public function usergroupConditionMatchesSingleGroupId() {}",
"public function hasGroupBy()\n {\n return !empty($this->group);\n }",
"public function group_exists($gid){\n\t\t$gid = goat::clean_id($gid);\n\t\treturn (\n\t\t\t$gid == GOAT_GROUP_PREF ||\n\t\t\tarray_key_exists($gid, $this->myCallbacks)\n\t\t);\n\t}",
"function setEventGroupId($id)\n {\n $this->__eventgroupid = $id ;\n }",
"public function isGroupEvent()\r\n {\r\n return ($this->getSourceType()=='group');\r\n }",
"public function testListFinancialEventGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function settingGetFreeGroupId()\r\n{\r\n\treturn 1;\r\n}",
"public function isGroup()\n {\n return $this->field_type_id == null;\n }",
"function group_exists( $group_name )\r\n {\r\n $group_name = strtolower( $group_name );\r\n $group =& $this->GROUPS[ $group_name ];\r\n if ( empty( $group ) ) return false;\r\n else return true;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of "then" attribute. If then attribute is not set, iterates through child nodes and renders ThenViewHelper. If then attribute is not set and no ThenViewHelper and no ElseViewHelper is found, all child nodes are rendered | protected function renderThenChild()
{
if ($this->hasArgument('then')) {
return $this->arguments['then'];
}
$elseViewHelperEncountered = false;
foreach ($this->childNodes as $childNode) {
if ($childNode instanceof ViewHelperNode
&& substr($childNode->getViewHelperClassName(), -14) === 'ThenViewHelper'
) {
$data = $childNode->evaluate($this->renderingContext);
return $data;
}
if ($childNode instanceof ViewHelperNode
&& substr($childNode->getViewHelperClassName(), -14) === 'ElseViewHelper'
) {
$elseViewHelperEncountered = true;
}
}
if ($elseViewHelperEncountered) {
return '';
} else {
return $this->renderChildren();
}
} | [
"protected function renderThenChild()\n {\n if ($this->hasArgument('then')) {\n return $this->arguments['then'];\n }\n if ($this->hasArgument('__thenClosure')) {\n $thenClosure = $this->arguments['__thenClosure'];\n return $thenClosure();\n } elseif ($this->hasArgument('__elseClosure')) {\n return '';\n }\n\n $elseViewHelperEncountered = false;\n foreach ($this->childNodes as $childNode) {\n if ($childNode instanceof ViewHelperNode\n && $childNode->getViewHelperClassName() === \\TYPO3\\Fluid\\ViewHelpers\\ThenViewHelper::class) {\n $data = $childNode->evaluate($this->renderingContext);\n return $data;\n }\n if ($childNode instanceof ViewHelperNode\n && $childNode->getViewHelperClassName() === \\TYPO3\\Fluid\\ViewHelpers\\ElseViewHelper::class) {\n $elseViewHelperEncountered = true;\n }\n }\n\n if ($elseViewHelperEncountered) {\n return '';\n } else {\n return $this->renderChildren();\n }\n }",
"public function render()\n {\n if (static::evaluateCondition($this->arguments, $this->renderingContext)) {\n return $this->renderThenChild();\n }\n\n return $this->renderElseChild();\n }",
"public function render() {\n\t\t$condition = $this->arguments['condition'];\n\t\tif (is_null($condition)) {\n\t\t\treturn $this->renderElseChild();\n\t\t} elseif ($condition === TRUE) {\n\t\t\treturn $this->renderThenChild();\n\t\t} elseif ($condition === FALSE) {\n\t\t\treturn $this->renderElseChild();\n\t\t} elseif (is_array($condition)) {\n\t\t\treturn (count($condition) > 0);\n\t\t} elseif ($condition instanceof \\Countable) {\n\t\t\treturn (count($condition) > 0);\n\t\t} elseif (is_string($condition) && trim($condition) === '') {\n\t\t\tif (trim($condition) === '') {\n\t\t\t\treturn $this->renderElseChild();\n\t\t\t} else if (preg_match('/[a-z^]/', $condition)) {\n\t\t\t\t$condition = '\\'' . $condition . '\\'';\n\t\t\t}\n\t\t} elseif (is_object($condition)) {\n\t\t\tif ($condition instanceof \\Iterator && method_exists($condition, 'count')) {\n\t\t\t\treturn (call_user_func(array($condition, 'count')) > 0);\n\t\t\t} else if ($condition instanceof \\DateTime) {\n\t\t\t\treturn $this->renderThenChild();\n\t\t\t} else if ($condition instanceof \\stdClass) {\n\t\t\t\treturn $this->renderThenChild();\n\t\t\t} else {\n\t\t\t\t$access = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ObjectAccess');\n\t\t\t\t$propertiesCount = count($access->getGettableProperties($condition));\n\t\t\t\tif ($propertiesCount > 0) {\n\t\t\t\t\treturn $this->renderThenChild();\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\Exception('Unknown object type in IfViewHelper condition: ' . get_class($condition), 1309493049);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$leftParenthesisCount = substr_count($condition, '(');\n\t\t$rightParenthesisCount = substr_count($condition, ')');\n\t\t$singleQuoteCount = substr_count($condition, '\\'');\n\t\t$escapedSingleQuoteCount = substr_count($condition, '\\\\\\'');\n\t\tif ($rightParenthesisCount !== $leftParenthesisCount) {\n\t\t\tthrow new \\Exception('Syntax error in IfViewHelper condition, mismatched number of opening and closing paranthesis', 1309490125);\n\t\t}\n\t\tif (($singleQuoteCount-$escapedSingleQuoteCount) % 2 != 0) {\n\t\t\tthrow new \\Exception('Syntax error in IfViewHelper condition, mismatched number of unescaped single quotes', 1309490125);\n\t\t}\n\t\t$configuration = $this->configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager::CONFIGURATION_TYPE_FRAMEWORK);\n\t\t$allowedFunctions = explode(',', $configuration['fluid']['allowedFunctions']);\n\t\t$languageConstructs = explode(',', $configuration['fluid']['disallowedConstructs']);\n\t\t$functions = get_defined_functions();\n\t\t$functions = array_merge($languageConstructs, $functions['internal'], $functions['user']);\n\t\t$functions = array_diff($functions, $allowedFunctions);\n\t\t$conditionLength = strlen($condition);\n\t\t$conditionHasUnderscore = strpos($condition, '_');\n\t\tforeach ($functions as $evilFunction) {\n\t\t\tif (strlen($evilFunction) > $conditionLength) {\n\t\t\t\t\t// no need to check for presence of this function - quick skip\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (preg_match('/' . $evilFunction . '([\\s]){0,}\\(/', $condition) === 1) {\n\t\t\t\tthrow new \\Exception('Disallowed PHP function \"' . $evilFunction . '\" used in IfViewHelper condition. Allowed functions: ' . $goodFunctions, 1309613359);\n\t\t\t}\n\t\t}\n\n\t\t$evaluation = NULL;\n\t\t$evaluationCondition = $condition;\n\t\t$evaluationCondition = trim($condition, ';');\n\t\t$evaluationExpression = '$evaluation = (bool) (' . $evaluationCondition . ');';\n\t\t@eval($evaluationExpression);\n\t\tif ($evaluation === NULL) {\n\t\t\tthrow new \\Exception('Syntax error while analyzing computed IfViewHelper expression: ' . $evaluationExpression, 1309537403);\n\t\t} else if ($evaluation === TRUE) {\n\t\t\treturn $this->renderThenChild();\n\t\t} else {\n\t\t\treturn $this->renderElseChild();\n\t\t}\n\t}",
"public function render() {\n $isMobile = \\F2\\Base\\Service\\MobileUtilsService::isMobileBrowser($_SERVER['HTTP_USER_AGENT']);\n\t\tif ($isMobile) {\n\t\t\treturn $this->renderThenChild();\n\t\t} else {\n\t\t\treturn $this->renderElseChild();\n\t\t}\n\t}",
"public static function ifThen($condition, $then, $value = null)\n {\n return static::ifThenElse(\n $condition,\n $then,\n true,\n $value\n );\n }",
"public function render($condition)\n {\n if ($condition) {\n return $this->renderThenChild();\n } else {\n return $this->renderElseChild();\n }\n }",
"protected function renderThenChild() {}",
"public function render($subject) {\n\t\tif (is_object($subject)) {\n\t\t\t$subject = $this->persistenceManager->getIdentifierByObject($subject);\n\t\t}\n\t\tif ($this->likeService->getNumberOfLikesBySubject($subject)) {\n\t\t\treturn $this->renderThenChild();\n\t\t} else {\n\t\t\treturn $this->renderElseChild();\n\t\t}\n\t}",
"public function render() {\n\t \n\t if($this->control_structure) {\n\t foreach($this->children as $child)\n\t $child->indent_level --;\n \n\t if($this->control_structure == 'elseif' or $this->control_structure == 'else')\n\t $return = $this->control_structure;\n elseif($this->control_structure == 'foreach') {\n list($array, $other) = handlers\\Tag::quote_safe_explode(' as ', $this->content);\n $array = trim($array);\n $other = trim($other);\n $return = '<?php $__array = ' . $array . '; if(!empty($__array)) { '\n . 'foreach($__array as ' . $other . ') { ?>';\n } else\n $return = '<?php ' . $this->control_structure;\n \n\t switch($this->control_structure) {\n\t case 'if':\n\t case 'elseif':\n\t case 'while':\n\t case 'for':\n\t case 'switch':\n\t $return .= '(' . $this->content . ') { ?>';\n break;\n case 'do':\n case 'else':\n $return .= ' { ?>';\n break;\n case 'case':\n foreach($this->children as $child)\n\t $child->indent_level --;\n $return .= ' ' . $this->content . '; ?>';\n break;\n\t }\n\t \n\t $return .= $this->render_children() . '<?php echo \"\\n\"; ?>';\n\t \n\t if($this->control_structure == 'case');\n elseif($this->control_structure == 'if' or $this->control_structure == 'elseif') {\n $next = $this->next_sibling();\n if($next and get_class($next) == get_class() and\n ($next->control_structure == 'elseif' or $next->control_structure == 'else'))\n $return .= '<?php } ';\n else\n $return .= '<?php } ?>';\n } elseif($this->control_structure == 'foreach') {\n $next = $this->next_sibling();\n if($next and get_class($next) == get_class() and $next->control_structure == 'else')\n $return .= '<?php }} ';\n else\n $return .= '<?php }} ?>';\n } else\n $return .= '<?php } ?>';\n \n return $return;\n\t }\n\t \n\t return '<?php ' . $this->content . '; ?>';\n\t \n\t}",
"public static function ifThenElse($condition, $then, $else = true, $value = null)\n {\n return static::that($value)->executeCheck('passesConditional', [\n $condition,\n $then,\n $else,\n ]);\n }",
"public function elseMacro(HtmlNode $node, TemplateNode $value = null)\n {\n $prev = $node->prev;\n $between = array();\n do {\n if ($prev instanceof IfNode) {\n $between = array_reverse($between);\n foreach ($between as $betweenNode) {\n $betweenNode->detach();\n $prev->then->append($betweenNode);\n }\n $node->detach();\n $prev->else->append($node);\n return;\n }\n $between[] = $prev;\n $prev = $prev->prev;\n } while (isset($prev));\n throw new InvalidTemplateException('Else-node must follow an if-node or another else-node.');\n }",
"public function __else__()\n {\n //else don't find\n //If parent is set if condition is false then else case is verificated\n return empty($this->parent) ? $this->getDummy() : $this->parent;\n }",
"public function viewHelperRendersChildrenIfNoValueGiven() {\n\t\t$viewHelper = $this->getMock('DERHANSEN\\\\SfEventMgt\\\\ViewHelpers\\\\Format\\\\ICalendarDescriptionViewHelper',\n\t\t\tarray('renderChildren'));\n\t\t$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Just some text'));\n\t\t$actual = $viewHelper->render();\n\t\t$this->assertSame('Just some text', $actual);\n\t}",
"public function compile($argumentsName, $closureName, &$initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)\n {\n $thenViewHelperEncountered = $elseViewHelperEncountered = false;\n foreach ($node->getChildNodes() as $childNode) {\n if ($childNode instanceof ViewHelperNode) {\n $viewHelperClassName = $childNode->getViewHelperClassName();\n if (substr($viewHelperClassName, -14) === 'ThenViewHelper') {\n $thenViewHelperEncountered = true;\n $childNodesAsClosure = $compiler->wrapChildNodesInClosure($childNode);\n $initializationPhpCode .= sprintf('%s[\\'__thenClosure\\'] = %s;', $argumentsName, $childNodesAsClosure) . chr(10);\n } elseif (substr($viewHelperClassName, -14) === 'ElseViewHelper') {\n $elseViewHelperEncountered = true;\n $childNodesAsClosure = $compiler->wrapChildNodesInClosure($childNode);\n $initializationPhpCode .= sprintf('%s[\\'__elseClosures\\'][] = %s;', $argumentsName, $childNodesAsClosure) . chr(10);\n $arguments = $childNode->getArguments();\n if (isset($arguments['if'])) {\n // The \"else\" has an argument, indicating it has a secondary (elseif) condition.\n // Compile a closure which will evaluate the condition.\n $elseIfConditionAsClosure = $compiler->wrapViewHelperNodeArgumentEvaluationInClosure($childNode, 'if');\n $initializationPhpCode .= sprintf('%s[\\'__elseifClosures\\'][] = %s;', $argumentsName, $elseIfConditionAsClosure) . chr(10);\n }\n }\n }\n }\n if (!$thenViewHelperEncountered && !$elseViewHelperEncountered && !isset($node->getArguments()['then'])) {\n $initializationPhpCode .= sprintf('%s[\\'__thenClosure\\'] = %s;', $argumentsName, $closureName) . chr(10);\n }\n\n return parent::compile($argumentsName, $closureName, $initializationPhpCode, $node, $compiler);\n }",
"public function vElse()\n {\n $this->attributes->establish(ElseDirective::class);\n return $this;\n }",
"private function isElse()\n\t{\n\t\treturn $this->expression=='';\n\t}",
"public function testCompilingElseStatement()\n {\n $this->view->setContents('<% if(false) %>foo<% else %>bar<% endif %>');\n $this->assertEquals(\n 'bar',\n $this->fortuneCompiler->compile($this->view)\n );\n }",
"public function elseif()\n {\n \t$a=\"THIS IS ELSEIF LOOP\";\n \t$b=\"Have a Great Day\";\n \treturn view(\"condition.elseif\",compact('a','b'));\n }",
"public function ifThenElse(callable $condition, callable $then, ?callable $else = null): Collection;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms array to recipe entity. | public function hydrate(array $recipe): Recipe
{
$entity = new Recipe();
$entity->setTitle($recipe['title']);
return $entity;
} | [
"public function toEntity($array)\n {\n $hydrator = new DoctrineHydrator($this->entityManager);\n return $hydrator->hydrate($array, $this->importProcessEntity);\n }",
"public static function fromArray(array $recipe): Recipe\n {\n $primaryKey = $recipe[\"primary_key\"];\n $ingredients = array_map(function(array $ingredient) {\n return static::ingredientFromArray($ingredient);\n }, $recipe[\"ingredients\"]);\n\n return new static($primaryKey, $ingredients);\n }",
"private static function rowToRecipe($row)\n {\n $recipe = new Recipe(\n $row['RecipeNo'],\n $row['RecipeName'],\n $row['RecipeDescription'],\n $row['RecipeSteps'],\n $row['RecipeCookTime'],\n $row['Ingredient1'],\n $row['Ingredient2'],\n $row['Ingredient3'],\n $row['Ingredient4'],\n $row['Ingredient5'],\n $row['Ingredient6'],\n $row['Ingredient7'],\n $row['Ingredient8'],\n $row['Ingredient9'],\n $row['Ingredient10'],\n $row['IsPublic'],\n $row['ImgFile'],\n $row['UserNo']\n );\n $recipe->setRecipeNo($row['RecipeNo']);\n return $recipe;\n }",
"abstract public function fromArray(array $array): BaseEntity;",
"private function convertArrayToDataEntities() {\r\n if($this->is_data_one_column and !($this->results instanceof DataEntity)) {\r\n $this->results = new DataEntity($this->table_name, $this->results);\r\n }\r\n\r\n foreach ($this->results as $i => $result) {\r\n // It is possible that a result is already a data entity\r\n // Therefore we don't want it to be a data entity in side a data entity\r\n if(!($result instanceof DataEntity))\r\n $this->results[$i] = new DataEntity($this->table_name, $result);\r\n }\r\n }",
"public static function entityArrayToArray(array $entity);",
"public static function buildEntityFromArray(array $row): EntityInterface\n {\n }",
"private function resultToArray($resultSet)\n\t{\n\t\t$this->recipes = array();\n\n\t\tforeach($resultSet->fetchAll(\\PDO::FETCH_NUM) as $result) {\n\n\t\t\t$this->mgrProduct->getProductById($result[1]);\n\t\t\t$finalProduct = $this->mgrProduct->getProduct();\t\n\n\t\t\t$recipe = new Recipe(\n\t\t\t\t$result[2], // name\n\t\t\t\t$finalProduct[0], // finalProduct\n\t\t\t\t$result[3], // is_custom\n\t\t\t\t$result[4] // steps\n\t\t\t);\n\n\t\t\t$recipe->setId($result[0]);\n\t\t\t$recipe->setIngredients($this->getIngredientsArray($result[0]));\n\t\t\tarray_push($this->recipes, $recipe);\n\t\t}\n\t}",
"public function createRecipe(array $data)\n {\n return new Recipe($this->post('recipes', $data)['recipe']);\n }",
"private function ingredientRecipesToArray($ingredientRecipes){\n $ingredientRecipesArray = EntityUtil::toArray($ingredientRecipes, true);\n foreach ($ingredientRecipesArray as $i=>&$ingredientRecipeArray) {\n $ingredientRecipeArray[\"name\"] = FormatUtil::decode($ingredientRecipes[$i]->getIngredient()->getName());\n $ingredientRecipeArray[\"unitName\"] = FormatUtil::decode($ingredientRecipes[$i]->getUnit()->getName());\n }\n return $ingredientRecipesArray;\n }",
"abstract protected function arrayableItemsToEntities(array $items): array;",
"protected function normalizeEntity(array $entity)\n {\n $normalized = [];\n\n foreach ($entity as $attribute => $value)\n {\n if ($this->isCollection($value))\n {\n $value = $this->normalizeCollection($value);\n }\n elseif ($this->isEntity($value))\n {\n $value = $this->normalizeEntity($value);\n }\n\n $normalized[$attribute] = $value;\n }\n\n return $this->newEntity($normalized);\n }",
"protected function getIngredientRecipesArray(){\n $recipe = RecipeDao::findById($_POST[\"idRecipe\"]);\n return array_map( function($ir) {\n return [\n 'quantity' => $ir->getQuantity(),\n 'unitName' => $ir->getUnit()->getName(),\n 'ingredientName' => $ir->getIngredient()->getName(),\n 'ingredientId' => $ir->getIngredient()->getId()\n ];\n }, $recipe->getIngredientRecipes([\"ORDER\"=>\"recipePosition ASC\"]));\n\n }",
"public static function fromArray($array) {\n\t\t$revision = new self();\n\t\t$revision->setData($array);\n\t\treturn $revision;\n\t}",
"abstract protected function createEntity(array $row);",
"public function getRecipesArray()\n\t{\n\t\treturn $this->recipes;\n\t}",
"public function reverseTransform($ids)\r\n {\r\n if (!$ids) {\r\n return null;\r\n }\r\n\r\n if(preg_match(\"/,/\", $ids))\r\n $ingredients = $this->om->getRepository('ckRecipesBundle:Ingredient')->findBy(array('id' => explode(\",\", $ids)));\r\n elseif($this->is_multiple)\r\n $ingredients = $this->om->getRepository('ckRecipesBundle:Ingredient')->findBy(array('id' => $ids));\r\n else\r\n $ingredients = $this->om->getRepository('ckRecipesBundle:Ingredient')->find($ids);\r\n\r\n if (null === $ingredients) {\r\n throw new TransformationFailedException(sprintf(\r\n 'Recipes #%s can\\' be found',\r\n $ids\r\n ));\r\n }\r\n\r\n // for many to many relations\r\n if($this->is_multiple && !is_null($this->collection))\r\n {\r\n // Process diff with bindings changes\r\n if(!is_array($ingredients))\r\n $ingredients = array($ingredients);\r\n\r\n // Transforms array into arrayCollection\r\n $col = new ArrayCollection();\r\n\r\n foreach ($ingredients as $u)\r\n {\r\n $col->add($u);\r\n }\r\n\r\n // Add ingredient if doesn't exist in collection\r\n foreach ($ingredients as $u)\r\n {\r\n if(!$this->collection->contains($u))\r\n $this->collection->add($u);\r\n }\r\n\r\n // Remove ingredient if no longer present\r\n foreach ($this->collection as $past_u)\r\n {\r\n if(!$col->contains($past_u))\r\n $this->collection->removeElement($past_u);\r\n }\r\n\r\n return $this->collection;\r\n }\r\n\r\n return $ingredients;\r\n }",
"public function getIngredientRecipes($options=[]): array{\n return $this->getRelatedEntities(\"IngredientRecipe\",$options);\n }",
"protected function toEntity(array $raw, \\Asgard\\Entity\\Definition $definition=null) {\r\n\t\tif(!$definition)\r\n\t\t\t$definition = $this->definition;\r\n\t\t$new = $definition->make([], $this->locale);\r\n\t\treturn static::unserialize($new, $raw);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merges a single attribute by key with a new given value. | protected function mergeAttribute(string $key, $mergeValue)
{
$current = $this[$key];
if ($current instanceof DataObjectInterface && method_exists($current, 'merge')) {
$class = get_class($current);
if (is_array($mergeValue)) {
$mergeValue = new $class($mergeValue);
}
// If we have nothing to merge with, don't bother
if (null === $mergeValue) {
return;
}
$mergeValue = $current->merge($mergeValue);
}
if (null === $mergeValue) {
return;
}
$this[$key] = $mergeValue;
} | [
"public function add($key, $value)\n {\n if (!$this->attributes->has($key) && $value != null) {\n $this->attributes->add($key, $value);\n }\n }",
"public static function mergeAttr(){\n\t\t$all_attr = func_get_args();\n\t\t$all_attr = array_filter($all_attr);\n\t\tforeach($all_attr as $x=>$attr){\n\t\t\tif(is_string($attr))parse_str($attr, $all_attr[$x]);\n\t\t}\n\t\treturn call_user_func_array('array_replace', $all_attr);\n\t}",
"public function amend_string_attribute($key, $value) {\n $this->configuration['attributes'][$key] .= \" \" . $value;\n }",
"protected function addToVirtualAttribute($key, $value)\n {\n if (! isset($this->virtualAttributes[$key])) {\n $this->virtualAttributes[$key] = [];\n }\n $this->virtualAttributes[$key] = array_merge($this->virtualAttributes[$key], (array) $value);\n }",
"public function setRegistryObjectAttribute($key, $value)\n {\n if ($existingAttribute = RegistryObjectAttribute::where('attribute', $key)\n ->where('registry_object_id', $this->registry_object_id)->first()\n ) {\n $existingAttribute->value = $value;\n return $existingAttribute->save();\n } else {\n return RegistryObjectAttribute::create([\n 'registry_object_id' => $this->registry_object_id,\n 'attribute' => $key,\n 'value' => $value\n ]);\n }\n }",
"public function addAttribute($key, $value)\n {\n $this->manifest->addAttribute($key, $value);\n }",
"public function append($key, $value);",
"public function setAttribute($key, $value)\n {\n if (in_array($key, $this->upercase)) {\n $value = strtoupper($value);\n }\n if (in_array($key, $this->encrypt) && $value != null) {\n $value = encryptString($value);\n }\n return parent::setAttribute($key, $value);\n }",
"public function offsetSet($key, $value)\n {\n $this->attributes[$key] = $value;\n }",
"function apigee_appdashboard_attribute_set($entity, $name, $value, $langcode, $type, $info)\n{\n $name = str_replace(\"attribute_\", '', $name);\n $entity->attributes[$name] = $value;\n}",
"function attr_set($key,$value,$pos=NULL){}",
"public function attrValue($key) {\n\t\tif ($this->hasAttr($key)) {\n\t\t\treturn $this->attributes[$key];\n\t\t}\n\t}",
"public function addMergedAttribute(Attribute $attribute): void\n {\n if (count($attribute->getValues()) === 0) {\n throw new EmptyElementsNotAllowedException('Attribute', $attribute->getKey());\n }\n\n if (array_key_exists($attribute->getKey(), $this->attributes)) {\n $attribute = new Attribute(\n $attribute->getKey(),\n array_unique(array_merge($this->attributes[$attribute->getKey()]->getValues(), $attribute->getValues()))\n );\n }\n\n $this->attributes[$attribute->getKey()] = $attribute;\n }",
"public function merge($key, $value = [])\n {\n if (is_array($key)) {\n $this->items = array_merge($this->items, $key);\n } elseif (is_string($key)) {\n $items = (array) $this->get($key, null, false);\n $value = array_merge($items, $this->getArrayItems($value));\n\n $this->set($key, $value, false);\n } elseif ($key instanceof self) {\n $this->items = array_merge($this->items, $key->all());\n }\n }",
"abstract function update(string $key, string $value);",
"public function addAttribute($key, $value)\n {\n $this->attributes[] = new ManifestAttribute($key, $value);\n }",
"public function findAttribute($key);",
"public function append($key, $value) {}",
"public function attr( $attr, $value = null ) {\n \n if( is_array($attr) ) $this->attrs = array_merge($this->attrs, $attr);\n \n else $this->attrs = array_merge($this->attrs, [$attr => $value]);\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the montant somme isol brut. | public function setMontantSommeIsolBrut(?float $montantSommeIsolBrut): EmpDadsuRectif {
$this->montantSommeIsolBrut = $montantSommeIsolBrut;
return $this;
} | [
"public function setMontant($_montant) { $this->montant = $_montant; }",
"public function setMontant($montant)\n {\n $this->montant = $montant;\n }",
"public function setMontant($_montant)\n {\n $this->_montant = $_montant;\n\n return $this;\n }",
"public function setMontantSommeIsolBrut($montantSommeIsolBrut) {\n $this->montantSommeIsolBrut = $montantSommeIsolBrut;\n return $this;\n }",
"public function testSetMontantSommeIsolBrut5() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setMontantSommeIsolBrut5(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantSommeIsolBrut5());\n }",
"public function testSetMontantSommeIsolBrut2() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setMontantSommeIsolBrut2(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantSommeIsolBrut2());\n }",
"public function setPuissanceMoteur(int $puissanceMoteur): void\n {\n $this->puissanceMoteur = $puissanceMoteur;\n }",
"public function setMontant(int $montant)\n {\n $this->montant = $montant;\n\n return $this;\n }",
"public function testSetMontantSommeIsolPlaf() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setMontantSommeIsolPlaf(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantSommeIsolPlaf());\n }",
"public function setImmagine($immagine)\n {\n \t$this->immagine=$immagine;\n }",
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"public function testSetMontantSommeIsolBrut3() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setMontantSommeIsolBrut3(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantSommeIsolBrut3());\n }",
"public function setMontant($montant)\n {\n $this->montant = $montant;\n\n return $this;\n }",
"public function testSetMontant() {\n\n $obj = new LignesAta();\n\n $obj->setMontant(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant());\n }",
"function setIme($novoIme) { //Definiranje 1. metode klase - postavlja vrijednost svojstva ime \n $this->ime = $novoIme; //Pomoću pseudovarijable $this svojstvu ime dodjeljujemo vrijednost parametra $novoIme\n }",
"function setMonograph($monograph) {\n\t\t$this->_monograph = $monograph;\n\t}",
"public function setMataPelajaran($mata_pelajaran);",
"function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}",
"public function testSetMontantIndemnites() {\n\n $obj = new LignesAta();\n\n $obj->setMontantIndemnites(10.092018);\n $this->assertEquals(10.092018, $obj->getMontantIndemnites());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check array level : multiple | private function isMultiple(array $array)
{
foreach ($array as $sub)
{
try
{
if (!is_array($sub)) throw new XTPLException('single');
else return true;
}
catch (XTPLException $e)
{
die($e->message());
}
}
} | [
"function isMultiDimentionalArray(array $array):bool\n{\n if (count($array) == count($array, COUNT_RECURSIVE))\n {\n return false;\n }else{\n return true;\n }\n}",
"function is_multidimensional(array $arr) {\n\t\tforeach ($arr as $elem) {\n\t\t\tif (is_array($elem)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function array_is_multidimensional(array $array) {\n\treturn count($array) !== count($array, COUNT_RECURSIVE);\n}",
"static function isMultidimensional($array) {\n if(!self::isIterable($array)) {\n return false;\n }\n\n foreach($array as $v) {\n if (is_array($v)) {\n return true;\n }\n }\n \n return false;\n }",
"private function validate_menu($array)\n {\n if (!is_array($array)) {\n return false;\n }\n $ids = array_keys($array);\n $ids[] = 0;\n foreach ($array as $id => $node) {\n if (!is_numeric($id) || !is_array($node)) {\n return false;\n }\n foreach ($node as $lang => $data) {\n if (!ZLanguage::isLangParam($lang)\n || !is_array($data)\n || empty($data['name'])\n || !ZLanguage::isLangParam($data['lang'])\n || !in_array($data['parent'],$ids)){\n return false;\n }\n }\n }\n return true;\n }",
"public function getDataWithTypeFieldAndFieldIsMultiDimensional() {}",
"function is_multi_array($var) {\r\n\tif (FALSE === is_array($var))\r\n\t\treturn FALSE;\r\n\tif (count($var, COUNT_RECURSIVE) !== count($var))\r\n\t\treturn TRUE;\r\n\treturn FALSE;\r\n}",
"private function isSingle(array $array)\n\t{\n\t\tforeach ($array as $sub)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t \tif (is_array($sub)) throw new XTPLException('multiple');\n\t\t \telse return true;\n\t\t }\n\t\t\tcatch (XTPLException $e)\n\t\t\t{\n\t\t\t\tdie($e->message());\n\t\t\t}\n\t\t}\n\t}",
"protected function isArrayMultiDim(array $data): bool\n {\n return count($data) !== count($data, COUNT_RECURSIVE);\n }",
"public function checkLevel(Array $data=array())\n {\n if (isset($data['level'])) $this->level = (int)$data['level'];\n if (isset($data['module'])) $this->module = $data['module'];\n if (isset($data['component'])) $this->component = $data['component'];\n if (isset($data['instance'])) $this->instance = $data['instance'];\n\n $access = false;\n if (xarSecurity::check('', \n 0, \n $this->component, \n $this->instance, \n $this->module, \n '',\n 0,\n $this->level)) {$access = true;\n }\n return $access;\n }",
"public function assertNonEmptyMultidimensionalArray($array) {}",
"public function treeLevelConditionMatchesMultipleValues() {}",
"public function treeLevelConditionMatchesMultipleValues() : void {}",
"public function isMultiDimensional(): bool\n {\n if ($this->bag === []) {\n return false;\n }\n\n return count($this->bag) !== count($this->bag, COUNT_RECURSIVE);\n }",
"function keyInMultiDimensionalArray( Array $array, $key ) {\n\n if (array_key_exists($key, $array)) {\n return true;\n }\n foreach ($array as $k=>$v) {\n if (!is_array($v)) {\n continue;\n }else{\n if( $this->keyInMultiDimensionalArray( $v, $key ) ){\n return true;\n }\n }\n }\n return false;\n }",
"public function is_multidimensional(array $array)\n {\n return count($array) !== count($array, COUNT_RECURSIVE);\n }",
"final public function isMulti():bool\n {\n return Base\\Arr::isMulti($this->arr());\n }",
"function invit0r_in_multiarray($elem, $array)\r\n{\r\n\t// if the $array is an array or is an object\r\n\tif( is_array( $array ) || is_object( $array ) ) {\r\n\t\t\t// if $elem is in $array object\r\n\t\t\tif( is_object( $array ) ) {\r\n\t\t\t\t$temp_array = get_object_vars( $array );\r\n\t\t\t\tif( in_array( $elem, $temp_array ) )\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\t// if $elem is in $array return true\r\n\t\t\tif( is_array( $array ) && in_array( $elem, $array ) )\r\n\t\t\t\treturn true;\r\n\r\n\r\n\t\t\t// if $elem isn't in $array, then check foreach element\r\n\t\t\tforeach ( $array as $array_element ) {\r\n\t\t\t\t// if $array_element is an array or is an object call the invit0r_in_multiarray function to this element\r\n\t\t\t\t// if invit0r_in_multiarray returns TRUE, than return is in array, else check next element\r\n\t\t\t\tif( ( is_array( $array_element ) || is_object( $array_element ) ) && invit0r_in_multiarray( $elem, $array_element ) ) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\r\n\t// if isn't in array return FALSE\r\n\treturn false;\r\n}",
"public static function isValidNestedSet();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field vICMSSTRet | public function setVICMSSTRet($vICMSSTRet)
{
$this->vICMSSTRet = $vICMSSTRet;
return $this;
} | [
"public function setValorICMSST($valorICMS_ST)\n {\n $this->valorICMS_ST = $valorICMS_ST;\n\n return $this;\n }",
"public function getValorICMSST()\n {\n return $this->valorICMS_ST;\n }",
"public function testSetTvaCptImmosIntraCom() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCptImmosIntraCom(\"tvaCptImmosIntraCom\");\n $this->assertEquals(\"tvaCptImmosIntraCom\", $obj->getTvaCptImmosIntraCom());\n }",
"public function testSetTvaCptImmos() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCptImmos(\"tvaCptImmos\");\n $this->assertEquals(\"tvaCptImmos\", $obj->getTvaCptImmos());\n }",
"public function setVat($value);",
"public function testSetEditerBulletinStc() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setEditerBulletinStc(true);\n $this->assertEquals(true, $obj->getEditerBulletinStc());\n }",
"public function testSetTvaCodeIntEmetteur() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCodeIntEmetteur(\"tvaCodeIntEmetteur\");\n $this->assertEquals(\"tvaCodeIntEmetteur\", $obj->getTvaCodeIntEmetteur());\n }",
"public function testSetVirSeuil() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setVirSeuil(10.092018);\n $this->assertEquals(10.092018, $obj->getVirSeuil());\n }",
"public function testSetNAttestIjss() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setNAttestIjss(10);\n $this->assertEquals(10, $obj->getNAttestIjss());\n }",
"public function testSetNAttestIjssAt() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setNAttestIjssAt(10);\n $this->assertEquals(10, $obj->getNAttestIjssAt());\n }",
"public function testSetTypeReglement() {\n\n $obj = new DecTva();\n\n $obj->setTypeReglement(10);\n $this->assertEquals(10, $obj->getTypeReglement());\n }",
"public function setMvaIcmsSt($mva_icms_st)\n {\n $this->mva_icms_st = $mva_icms_st;\n\n return $this;\n }",
"public function testSetInteretsCap() {\n\n $obj = new Dossier4();\n\n $obj->setInteretsCap(\"interetsCap\");\n $this->assertEquals(\"interetsCap\", $obj->getInteretsCap());\n }",
"public function testSetTypeOperation() {\n\n $obj = new SuiviCompteParticulier();\n\n $obj->setTypeOperation(\"typeOperation\");\n $this->assertEquals(\"typeOperation\", $obj->getTypeOperation());\n }",
"public function testSetEtblSiret() {\n\n $obj = new DeclarationsAt();\n\n $obj->setEtblSiret(\"etblSiret\");\n $this->assertEquals(\"etblSiret\", $obj->getEtblSiret());\n }",
"public function testSetSuiviClientIntituleGeneric10() {\n\n $obj = new Constantes2();\n\n $obj->setSuiviClientIntituleGeneric10(\"suiviClientIntituleGeneric10\");\n $this->assertEquals(\"suiviClientIntituleGeneric10\", $obj->getSuiviClientIntituleGeneric10());\n }",
"public function testSetSaisiePvInterdite() {\n\n $obj = new Collaborateurs();\n\n $obj->setSaisiePvInterdite(true);\n $this->assertEquals(true, $obj->getSaisiePvInterdite());\n }",
"function setSf_sv($isf_sv = '')\n {\n $this->isf_sv = $isf_sv;\n }",
"public function testSetCodeIntitContratTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeIntitContratTrav(\"codeIntitContratTrav\");\n $this->assertEquals(\"codeIntitContratTrav\", $obj->getCodeIntitContratTrav());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the entity_print handler is set for commerce_order. | public function testEntityPrintHandlerSet() {
$definition = $this->entityTypeManager->getDefinition('commerce_order');
$this->assertTrue($definition->hasHandlerClass('entity_print'));
$this->assertEquals(OrderRenderer::class, $definition->getHandlerClass('entity_print'));
} | [
"public function canPrint()\n {\n return Mage::getSingleton('customer/session')->isLoggedIn() && $this->isOrderVisible();\n }",
"public function actionPurchaseOrderPrint()\n {\n }",
"function printOrder() {\n\t$connection = createConnection();\n\t// Creates the order in the database, getting the created orderId back //\n\t$orderId = Order::saveOrderData($connection);\n\t\n\tif(!$orderId)\n\t\treturn FALSE;\n\n\t// Gets all of the customer & order information //\n\t$result = Order::getCustomerAndOrderInfo($connection, $orderId);\n\t$custId = $result[\"customerId\"];\n\n\t// Gets all of the products in that order //\n\t$orderInfo = Order::getProductsInOrder($connection, $orderId);\n\n\t// Gets the payment information for the customer //\n\t$paymentInfo = Account::getPaymentInformation($connection, $custId);\n\n\t// Header for the order confimation //\n\techo \"<div class='col-lg-12 col-md-12 col-sm-12' style='float: left; text-align:left'>\";\n\techo \"<h5>Your total is $\" . $result[\"totalAmount\"] . \"</h5>\";\n\techo \"<h5>Order reference number: \" . $result[\"orderId\"] . \"</h5>\";\n\techo \"<h5>Customer ID: \" . $result[\"customerId\"] . \"</h5>\";\n\techo \"<h5>Customer Name: \" . $result[\"firstName\"] . \" \" . $result[\"lastName\"] . \"</h5>\";\n\techo \"<h5>Shipping to: \" . $result[\"address\"] . \", \" . $result[\"city\"] . \", \" . \n\t\t$result[\"state\"] . \", \" . $result[\"country\"] . \"</h5>\";\n\t\n\t// Payment type and number //\n\tif ($paymentInfo[\"paymentType\"] != '') {\n\t\techo \"<h5>Payment Type: \" . $paymentInfo[\"paymentType\"] . \"</h5>\";\n\t}\n\tif (strlen($paymentInfo[\"paymentNumber\"]) > 12) {\n\t\techo \"<h5>Payment Number: \" . \"************\" . \n\t\t\tsubstr($paymentInfo[\"paymentNumber\"], 12) . \"</h5>\";\n\t}\n\techo \"</div>\";\n\n\t// Table of ordered products //\n\techo '\n\t\t<table class=\"table\">\n\t\t<tr>\n\t\t\t<th scope=\"col\">Product Id</th>\n <th scope=\"col\">Quantity</th>\n\t\t\t<th scope=\"col\">Price</th>\n\t\t\t<th scope=\"col\">Product Name</th>\n\t\t</tr>';\n\n\twhile ($row = $orderInfo->fetch_assoc()) {\n\t\techo '<tr>\n\t\t\t\t<td>'.$row[\"productId\"].'</td>\n\t\t\t\t<td>'.$row[\"quantity\"].'</td>\n\t\t\t\t<td>$'.$row[\"price\"].'</td>\n\t\t\t\t<td>'.$row[\"productName\"].'</td>\n\t\t\t</tr>';\n\t}\n\techo \"</table>\";\n\n\n\t$_SESSION['productList'] = null;\n\n\t$connection->close();\n\treturn true;\n}",
"function printorder()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\n\t\t$oid = $input->getUint('oid', 0);\n\t\t$sid = $input->getString('sid', '');\n\t\t\n\t\t$order_details = VikAppointments::fetchOrderDetails($oid, $sid, JFactory::getLanguage()->getTag());\n\n\t\tif ($order_details === false)\n\t\t{\n\t\t\tdie (JText::_('VAPORDERRESERVATIONERROR'));\n\t\t}\n\t\t\n\t\t$tmpl = VikAppointments::loadEmailTemplate($order_details);\n\t\t$html = VikAppointments::parseEmailTemplate($tmpl, $order_details, false);\n\n\t\t$input->set('tmpl', 'component');\n\t\t\n\t\t$html .= \"<script>window.print();</script>\\n\";\n\n\t\t/**\n\t\t * Use the specific blank layout to print the view\n\t\t * and exit to avoid including internal and external assets,\n\t\t * which may alter the default style of the template.\n\t\t *\n\t\t * @since 1.6\n\t\t */\n\t\techo JLayoutHelper::render('document.blankpage', array('body' => $html));\n\t\texit;\n\t}",
"public function testCreateOrder() {\n $line_item = $this->createEntity('commerce_line_item', [\n 'type' => 'product_variation',\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'line_items' => [$line_item],\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertTrue($order_exists, 'The new order has been created in the database.');\n $this->assertEquals($order->id(), $order->getOrderNumber(), 'The order number matches the order ID');\n }",
"function printOrder($order){\n\n\t//#1 - doc id is the same of configured in this Sync\n\t$docId = orderNdoc;\n\t$printerId = printerId;\n\t$repstamp = repstamp;\n\n\n\t$options = array('options' => '{\n\t\t\t\t\t\t\t\t\t \"docId\": '.$docId.',\n\t\t\t\t\t\t\t\t\t \"emailConfig\": {},\n\t\t\t\t\t\t\t\t\t \"generateOnly\": false,\n\t\t\t\t\t\t\t\t\t \"isPreview\": false,\n\t\t\t\t\t\t\t\t\t \"outputType\": 1,\n\t\t\t\t\t\t\t\t\t \"printerId\": \"'.$printerId.'\",\n\t\t\t\t\t\t\t\t\t \"records\": [\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t \"docId\": '.$docId.',\n\t\t\t\t\t\t\t\t\t \"entityType\": \"Ft\",\n\t\t\t\t\t\t\t\t\t \"stamp\": \"'.$order['ftstamp'].'\"\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t\t \"reportStamp\": \"'.$repstamp.'\",\n\t\t\t\t\t\t\t\t\t \"sendToType\": 0,\n\t\t\t\t\t\t\t\t\t \"serie\": 0\n\t\t\t\t\t\t\t\t\t}');\n\t//call to print!\n\t$printResult = DRIVE_printDocument($options);\n\tif($printResult == null){\n\t\t$msg = \"Error on print document, Verify config of report and printer id.<br><br>\";\n\t\techo $msg;\n\t\tlogData($msg);\t\t\n\t}else{\t\t\n\t\t$msg = \"Document printed!.<br><br>\";\n\t\techo $msg;\n\t\tlogData($msg);\t\n\t}\n}",
"public function testCreateOrder() {\n $lineItem = $this->createEntity('commerce_line_item', [\n 'type' => 'product_variation',\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'line_items' => [$lineItem],\n ]);\n\n $orderExists = (bool) Order::load($order->id());\n $this->assertTrue($orderExists, 'The new order has been created in the database.');\n $this->assertEqual($order->id(), $order->getOrderNumber(), 'The order number matches the order ID');\n }",
"public function handledFyndiqOrdersAction()\n {\n $this->orderHandling(true);\n }",
"public function onProcess(OrderEntity $order){}",
"public function testCreateOrder() {\n // Create a order through the add form.\n $this->drupalGet('/admin/commerce/orders');\n $this->clickLink('Create a new order');\n\n $entity = $this->variation->getSku() . ' (' . $this->variation->id() . ')';\n $values = [\n 'line_items[form][inline_entity_form][purchased_entity][0][target_id]' => $entity,\n 'line_items[form][inline_entity_form][quantity][0][value]' => 1,\n 'line_items[form][inline_entity_form][unit_price][0][amount]' => '9.99'\n ];\n $this->drupalPostForm(NULL, $values, t('Create entity'));\n\n $values = [\n 'store_id' => $this->store->id(),\n 'mail[0][value]' => $this->loggedInUser->getEmail()\n ];\n $this->drupalPostForm(NULL, $values, t('Save'));\n\n $order_number = $this->cssSelect('tr td.views-field-order-number');\n $this->assertEqual(count($order_number), 1, 'Order exists in the table.');\n }",
"public function isOrderPrintVisible($order)\n {\n return $this->_isOrderVisible($order);\n }",
"public function generateOrderTest(){\n\n\t\t\n\n\t\t\t$loginType = \"admin\"; //Other option is community login;\n\n\t\t\t$pathToLogin = $loginType == \"admin\" ? getPathToConfig() .\"/wsdl/soap-login-admin-user.wsdl\" : \n\t\t\t\tgetPathToConfig() .\"/wsdl/soap-login-community-user.wsdl\";\n\n\t\t\t$pathToWsdl = getPathToConfig() . \"/wsdl/myDefaultOrg-CustomOrder.wsdl\";\n\t\n\n\t\t\t$contactId = \"0031U00001WaiGcQAJ\"; // Specific to your org!\n\t\t\t$pricebookEntryId = \"01u1U000001tWTwQAM\"; // Specific to your org!\n\n\n\t\t\treturn $this->generateOrder($pathToLogin, $pathToWsdl, $contactId, $pricebookEntryId);\n \t}",
"function isOrderActionNecessary() {\n\t\treturn true;\n\t}",
"public function reportOrder()\n {\n //TODO: report order by status\n }",
"function wcfmmp_new_order_check($order, $updated_props) {\n if (!$order || !is_a($order, 'WC_Order'))\n return;\n if (defined('WCFM_MANUAL_ORDER'))\n return;\n if (defined('WC_BOOKINGS_VERSION'))\n return;\n if (defined('WC_APPOINTMENTS_VERSION'))\n return;\n $order_id = $order->get_id();\n if ($order_id) {\n if (get_post_meta($order_id, '_wcfmmp_order_processed', true))\n return;\n $order_posted = get_post($order_id);\n $this->wcfmmp_checkout_order_processed($order_id, $order_posted, $order);\n }\n }",
"function is_order_tracker() {\n\treturn is_page( jigoshop_get_page_id('track_order'));\n}",
"public static function isPrintableOrders()\n\t{\n\t\treturn (int) self::getFieldFromConfig('printorders', 'vapIsPrintableOrders');\n\t}",
"public function getOrderHandler()\n\t{\n\t\treturn $this->container->get('App\\Handlers\\OrderHandler');\n\t}",
"public function print() {\n \n echo \"\\n\";\n\n foreach ($this->order->getOrderItems() as $orderItem) {\n\n $product = $orderItem->getProduct();\n\n echo \"{$orderItem->getQuantity()} {$this->formattedName($product)}: \" .\n \"{$this->formatFloat($product->taxablePrice())}\\n\";\n }\n\n echo \"\\n\";\n\n echo \"Sales Taxes: {$this->formatFloat($this->order->allTaxes())}\\n\";\n echo \"Total: {$this->formatFloat($this->order->totalAmount())}\\n\";\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs the query being generated, then loads the object with the results of that query | public function run()
{
$this->object->clear();
$q = $this->getQuery();
$results = $this->site->db->query($q);
switch($this->type)
{
case 'list':
$class = $this->object->__CLASS__;
while($row = $results->fetch_assoc())
{
$o = new $class($this->site);
if($o->loadRow($row))
{
$this->object->push($o);
}
}
break;
default:
if($row = $results->fetch_assoc())
{
$this->object->loadRow($row);
}
break;
}
return $this->object;
} | [
"public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }",
"public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }",
"public function fetch()\n {\n $where = $this->_determineWhere($this->_args);\n $limits = $this->_determineOptions($this->_options);\n\n $object = new $this->_object();\n $cacheable = $object->isCacheable();\n\n if ($cacheable) {\n $this->_fetchFromCacheOrDB($where, $limits, $object);\n } else {\n $this->_fetchFromDB($where, $limits);\n }\n }",
"protected function _execute()\n {\n $this->triggerBeforeFind();\n if ($this->_results) {\n $decorator = $this->_decoratorClass();\n\n return new $decorator($this->_results);\n }\n\n $statement = $this->getEagerLoader()->loadExternal($this, $this->execute());\n\n return new ResultSet($this, $statement);\n }",
"private function loadData()\n {\n $this->data = $this->query->find();\n }",
"protected function loadData()\n {\n $this->data = $this->mapper->fetchObjects($this->query);\n }",
"function load(){\r\n\t\t$db=Factory::getDB();\r\n\t\tFactory::debug(\"loading object\");\r\n\t\t$db->loadObject($this);\r\n\t\tFactory::debug_r($this);\r\n\t}",
"public function perform_query()\n {\n $query_string = $this->get_query_string();\n $query_return = file_get_contents($query_string);\n return $this->create_data_collection(json_decode($query_return));\n }",
"function load(){\n\t\t$this->r = $this->result = mysql_query($this->r, $this->link);\n\t}",
"public function query(){\n\t\tif ( ! is_object( $this->entry ) ) {\n\t\t\t$this->find_entry();\n\t\t}\n\n\t\tif( is_numeric( $this->entry_id ) ){\n\t\t\t$this->find_fields();\n\t\t\t$this->find_metas();\n\t\t}\n\t}",
"public function fetch() {\r\n\t $class = $this->table;\r\n\t $data = \\Idk\\Database::getInstance()->orm->queryWriter->selectAllByCritWithSQL($class, $this->column, $this->entity->id, $this->orderBy . $this->order . $this->limit);\r\n\t $returnValues = array();\r\n\t\tforeach($data as $item) {\r\n\t\t\t$refClass = new ReflectionClass($class);\r\n\t\t\t\r\n\t\t\t$object = new $class();\r\n\t\t\t$object->id = $item['id'];\r\n\t\t\t$properties = $refClass->getProperties();\r\n\t\t\tIDKModel::initiateValues($object, $properties, $item);\r\n\t\t\t$returnValues[] = $object;\r\n\t\t}\r\n\t\t$this->_elements = $returnValues;\r\n \t$this->state = 1;\r\n\t}",
"protected function createQueryObject()\n {\n $this->query = Zig_Model_Query::create();\n }",
"function load() {\n\t\t# Global Variables\n\t\tglobal $_db;\n\t\t\n\t\t# Load Attributes\n\t\t$this->get_attributes();\n\t\t\n\t\t# Check if Object exists in Database\n\t\tif ($this->exists()) {\n\t\t\t# Get Data\n\t\t\t$query\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"\tSELECT\n\t\t\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\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`{$this->table}`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`{$this->uid_field}` = '{$this->uid}'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\t\t\t$data\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $_db->fetch_one($query);\n\t\t\t\n\t\t\t# Load Data\n\t\t\t$data_bits\t\t\t\t\t\t\t\t\t\t\t\t\t= get_object_vars($data);\n\t\t\tforeach ($data_bits as $key => $value) {\n\t\t\t\t$this->$key\t\t\t\t\t\t\t\t\t\t\t\t= $value;\n\t\t\t}\n\t\t}\n\t}",
"public function execute()\n {\n $transport = $this->objectmanager->getTransport();\n $rawData = $transport->query($this);\n $queryResult = $this->factory->get(\n 'Query\\QueryResult',\n array(\n $rawData,\n $this->objectmanager,\n )\n );\n return $queryResult;\n }",
"public function run()\n {\n $result = $this->__invoke()->fetch();\n $field = $this->table->{$this->field};\n\n return $field->dataFromDatabase($result[0]);\n }",
"function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }",
"protected function loadResult($array = false) {\n if ($array === false) {\n // Only fetch 1 record\n $this->db->limit(1);\n }\n\n if (!isset($this->dbApplied['select'])) {\n // Select all columns by default\n foreach ($this->tableColumns as $name => $row) {\n if (($column = $this->db->realColumn($name, false)) != $name)\n $this->db->select(\"$this->tableName.$column as $name\");\n else\n $this->db->select(\"$this->tableName.$name\");\n }\n }\n\n if (!empty($this->loadWith)) {\n foreach ($this->loadWith as $alias => $object) {\n // Join each object into the results\n if (is_string($alias)) {\n // Use alias\n $this->with($alias);\n }\n else {\n // Use object\n $this->with($object);\n }\n }\n }\n\n if (!isset($this->dbApplied['orderby']) && !empty($this->sorting)) {\n $sorting = array();\n foreach ($this->sorting as $column => $direction) {\n if (strpos($column, '.') === false) {\n // Keeps sorting working properly when using JOINs on\n // tables with columns of the same name\n $column = $this->tableName .'.'. $column;\n }\n \n $sorting[$column] = $direction;\n }\n\n // Apply the user-defined sorting\n $this->db->orderby($sorting);\n }\n\n // Load the result\n $result = $this->db->get($this->tableName);\n\n if ($array === true) {\n // Return an iterated result\n return new AetherORMIterator($this, $result);\n }\n\n if ($result->count() === 1) {\n // Load object values\n $this->loadValues($result->result(false)->current());\n }\n else {\n // Clear the object, nothing was found\n $this->clear();\n }\n\n return $this;\n }",
"public function execute() {\n $statement = $this->buildStatement();\n $result = $this->getDataSource()->query($statement, $this->getBindValues());\n\n if ($result) {\n $collection = new Collection($this->getMapper()->getClass(), $result, $this->getMapper());\n } else {\n $collection = new Collection($this->getMapper()->getClass(), array(), $this->getMapper());\n }\n return $collection;\n }",
"public function run(): Result\n {\n return Driver::query($this);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.