query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
$time_elapsed = timeAgo($time_ago); The argument $time_ago is in timestamp (Ymd H:i:s)format. Function definition
function timeAgo($time_ago) { $time_ago = strtotime($time_ago); $cur_time = time()-28800; $time_elapsed = $cur_time - $time_ago; $seconds = $time_elapsed ; $minutes = round($time_elapsed / 60 ); $hours = round($time_elapsed / 3600); $days = round($time_elapsed / 86400 ); $weeks = round($time_elapsed / 604800); $months = round($time_elapsed / 2600640 ); $years = round($time_elapsed / 31207680 ); // Seconds if($seconds <= 60){ return "just now"; } //Minutes else if($minutes <=60){ if($minutes==1){ return "one minute ago"; } else{ return "$minutes minutes ago"; } } //Hours else if($hours <=24){ if($hours==1){ return "an hour ago"; }else{ return "$hours hrs ago"; } } //Days else if($days <= 7){ if($days==1){ return "yesterday"; }else{ return "$days days ago"; } } //Weeks else if($weeks <= 4.3){ if($weeks==1){ return "a week ago"; }else{ return "$weeks weeks ago"; } } //Months else if($months <=12){ if($months==1){ return "a month ago"; }else{ return "$months months ago"; } } //Years else{ if($years==1){ return "one year ago"; }else{ return "$years years ago"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time_Ago($time) { \n \n // Calculate difference between current \n // time and given timestamp in seconds \n $diff = time() - $time; \n \n // Time difference in seconds \n $sec = $diff; \n \n // Convert time difference in minutes \n $min = round($diff / 60 ); \n \n // Convert time difference in hours \n $hrs = round($diff / 3600); \n \n // Convert time difference in days \n $days = round($diff / 86400 ); \n \n // Convert time difference in weeks \n $weeks = round($diff / 604800); \n \n // Convert time difference in months \n $mnths = round($diff / 2600640 ); \n \n // Convert time difference in years \n $yrs = round($diff / 31207680 ); \n \n // Check for seconds \n if($sec <= 60) { \n return \"$sec seconds ago\"; \n } \n \n // Check for minutes \n else if($min <= 60) { \n if($min==1) { \n return \"one minute ago\"; \n } \n else { \n return \"$min minutes ago\"; \n } \n } \n \n // Check for hours \n else if($hrs <= 24) { \n if($hrs == 1) { \n return \"an hour ago\"; \n } \n else { \n return \"$hrs hours ago\"; \n } \n } \n \n // Check for days \n else if($days <= 7) { \n if($days == 1) { \n return \"Yesterday\"; \n } \n else { \n return \"$days days ago\"; \n } \n } \n \n // Check for weeks \n else if($weeks <= 4.3) { \n if($weeks == 1) { \n return \"a week ago\"; \n } \n else { \n return \"$weeks weeks ago\"; \n } \n } \n \n // Check for months \n else if($mnths <= 12) { \n if($mnths == 1) { \n return \"a month ago\"; \n } \n else { \n return \"$mnths months ago\"; \n } \n } \n \n // Check for years \n else { \n if($yrs == 1) { \n return \"one year ago\"; \n } \n else { \n return \"$yrs years ago\"; \n } \n } \n}", "function time1($time) \n{\n \n$time= strtotime($time);\n $delta = time() - $time;\n\n if ($delta < 1 * MINUTE)\n {\n return $delta == 1 ? \"one second ago\" : $delta . \" seconds ago\";\n }\n if ($delta < 2 * MINUTE)\n {\n return \"a minute ago\";\n }\n if ($delta < 45 * MINUTE)\n {\n return floor($delta / MINUTE) . \" minutes ago\";\n }\n if ($delta < 90 * MINUTE)\n {\n return \"an hour ago\";\n }\n if ($delta < 24 * HOUR)\n {\n return floor($delta / HOUR) . \" hours ago\";\n }\n if ($delta < 48 * HOUR)\n {\n return \"yesterday\";\n }\n if ($delta < 30 * DAY)\n {\n return floor($delta / DAY) . \" days ago\";\n }\n if ($delta < 12 * MONTH)\n {\n $months = floor($delta / DAY / 30);\n return $months <= 1 ? \"one month ago\" : $months . \" months ago\";\n }\n else\n {\n $years = floor($delta / DAY / 365);\n return $years <= 1 ? \"one year ago\" : $years . \" years ago\";\n }\n \n}", "function timeAgo($dateTime)\n\t\t{\n\t\t\t$dateTime = strtotime($dateTime);\n\t\t\t$currentTime = time();\n\t\t\t$tense = \"\";\n\t\t\t$printTime = \"\";\n\t\t\t$timeDifference = $currentTime - $dateTime;\n\t\t\t$seconds = $timeDifference ;\n\t\t\t$minutes = round($timeDifference / 60 );\n\t\t\t$hours = round($timeDifference / 3600);\n\t\t\t$days = round($timeDifference / 86400 );\n\t\t\t$weeks = round($timeDifference / 604800);\n\t\t\t$months = round($timeDifference / 2600640 );\n\t\t\t$years = round($timeDifference / 31207680 );\n\t\t\t\n\t\t\tif($seconds <= 60){\n\t\t\t\t$printTime = $seconds;\n\t\t\t\t$tense = \" seconds ago\";\n\t\t\t}else if($minutes <= 60){\n\t\t\t\tif($minutes == 1){\n\t\t\t\t\t$printTime = $minutes;\n\t\t\t\t\t$tense = \" minute ago\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$printTime = $minutes;\n\t\t\t\t\t$tense = \" minutes ago\";\n\t\t\t\t}\n\t\t\t}else if($hours <= 24){\n\t\t\t\tif($hours == 1){\n\t\t\t\t\t$printTime = $hours;\n\t\t\t\t\t$tense = \" hour ago\";\n\t\t\t\t}else{\n\t\t\t\t\t$printTime = $hours;\n\t\t\t\t\t$tense = \" hours ago\";\n\t\t\t\t}\n\t\t\t}else if($days <= 7){\n\t\t\t\tif($days == 1){\n\t\t\t\t\t$printTime = \"\";\n\t\t\t\t\t$tense = \"yesterday\";\n\t\t\t\t}else{\n\t\t\t\t\t$printTime = $days;\n\t\t\t\t\t$tense = \" days ago\";\n\t\t\t\t}\n\t\t\t}else if($weeks <= 4.3){\n\t\t\t\tif($weeks == 1){\n\t\t\t\t\t$printTime = $weeks;\n\t\t\t\t\treturn \" week ago\";\n\t\t\t\t}else{\n\t\t\t\t\t$printTime = $weeks;\n\t\t\t\t\t$tense = \" weeks ago\";\n\t\t\t\t}\n\t\t\t}else if($months <= 12){\n\t\t\t\tif($months == 1){\n\t\t\t\t\t$printTime = $months;\n\t\t\t\t\t$tense = \" month ago\";\n\t\t\t\t}else{\n\t\t\t\t\t$printTime = $months;\n\t\t\t\t\t$tense = \" months ago\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif($years == 1){\n\t\t\t\t\t$printTime = $years;\n\t\t\t\t\t$tense = \" year ago\";\n\t\t\t\t}else{\n\t\t\t\t\t$printTime = $years;\n\t\t\t\t\t$tense = \" years ago\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $printTime.$tense;\n\t\t}", "public function getCreatedTimeAgo() {\n $timeStamp = $this->getCreatedTime('U');\n $elapsed = time() - $timeStamp;\n \n if ($elapsed < 1)\n return 'just now';\n\n $lengths = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second');\n\n foreach ($lengths as $secs => $str)\n {\n $d = $elapsed / $secs;\n if ($d >= 1)\n {\n $r = round($d);\n return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago';\n }\n }\n }", "function daysAgo($timestamp){ \n date_default_timezone_set('Europe/Riga'); \n $time_ago = strtotime($timestamp); \n $current_time = time(); \n $time_difference = $current_time - $time_ago; \n $seconds = $time_difference; \n $minutes = round($seconds / 60 ); //code bellow calculates each unit by deviding seconds.\n $hours = round($seconds / 3600);\n $days = round($seconds / 86400);\n $weeks = round($seconds / 604800);\n $months = round($seconds / 2629440);\n $years = round($seconds / 31553280);\n if($seconds <= 60) \n { \n return \"Just Now\"; \n } \n else if($minutes <=60) \n { \n if($minutes==1) \n { \n return \"one minute ago\"; \n } \n else \n { \n return \"$minutes minutes ago\"; //two \"if\" statements are needed because of plural and singular.\n } \n } \n else if($hours <=24) \n { \n if($hours==1) \n { \n return \"an hour ago\"; \n } \n else \n { \n return \"$hours hrs ago\"; \n } \n } \n else if($days <= 7) \n { \n if($days==1) \n { \n return \"yesterday\"; \n } \n else \n { \n return \"$days days ago\"; \n } \n } \n else if($weeks <= 4.3) //4.3 == 52/12 \n { \n if($weeks==1) \n { \n return \"a week ago\"; \n } \n else \n { \n return \"$weeks weeks ago\"; \n } \n } \n else if($months <=12) \n { \n if($months==1) \n { \n return \"a month ago\"; \n } \n else \n { \n return \"$months months ago\"; \n } \n } \n else \n { \n if($years==1) \n { \n return \"one year ago\"; \n } \n else \n { \n return \"$years years ago\"; \n } \n } \n }", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "function get_timeago( $ptime )\n{\n $estimate_time = time() - $ptime;\n\n if( $estimate_time < 1 )\n {\n return 'less than 1 second ago';\n }\n\n $condition = array(\n 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n foreach( $condition as $secs => $str )\n {\n $d = $estimate_time / $secs;\n\n if( $d >= 1 )\n {\n $r = round( $d );\n return 'about ' . $r . ' ' . $str . ( $r > 1 ? 's' : '' ) . ' ago';\n }\n }\n}", "function tfc_ago( $time ) {\n\t$periods = array( \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\", \"decade\" );\n\t$lengths = array( \"60\", \"60\", \"24\", \"7\", \"4.35\", \"12\", \"10\" );\n\n\t$now = time();\n\n\t$difference = $now - $time;\n\t$tense = \"ago\";\n\n\tfor ( $j = 0; $difference >= $lengths[$j] && $j < count( $lengths )-1; $j++ ) {\n\t\t$difference /= $lengths[$j];\n\t}\n\n\t$difference = round( $difference );\n\n\tif ( $difference != 1 ) {\n\t\t$periods[$j] .= \"s\";\n\t}\n\n\treturn $difference $periods[$j] . \" ago \";\n}", "public function time_handler($timestamp){\n //convert timestamp to second\n $db_time = strtotime($timestamp);\n date_default_timezone_set(\"Europe/Paris\");\n //Get the current time\n $current_time = time();\n //Get the difference in seconds\n $time_diff = $current_time - $db_time;\n // echo \"DIFF \".$time_diff . \"<br>\";\n $time_diff_min = floor($time_diff / 60);\n \n $time_diff_hour = floor($time_diff / 3600); //floor($time_diff / 60 * 60)\n $time_diff_day = floor($time_diff / 86400 ); //floor($time_diff / 24 * 60 * 60)\n $time_diff_week = floor($time_diff / 604800 ); //floor($time_diff / 7 * 24 * 60 * 60)\n $time_diff_month = floor($time_diff / 2592000 ); //floor($time_diff / 30 * 24 * 60 * 60)\n $time_diff_year = floor($time_diff / 31536000); //floor($time_diff / 365 *24 * 60 * 60);\n\n if ($time_diff <= 60){\n return \"Just now\";\n\n }else if ($time_diff_min <= 60){\n if ($time_diff_min == 1){\n return \"1 minute ago\";\n }else{\n return $time_diff_min . \" minutes ago\";\n }\n\n }else if ($time_diff_hour <= 24){\n if ($time_diff_hour == 1){\n return \"1 hour ago\";\n }else {\n return $time_diff_hour . \" hours ago\";\n }\n }else if ($time_diff_day <= 7){\n if ($time_diff_day == 1){\n return \"1 day ago\";\n }else {\n return $time_diff_day . \" days ago\";\n }\n }else if ($time_diff_week <= 4.3){\n if ($time_diff_week == 1){\n return \"1 week ago\";\n }else {\n return $time_diff_week . \" weeks ago\";\n }\n }else if ($time_diff_month <= 1){\n if ($time_diff_month == 1){\n return \"1 month ago\";\n }else {\n return $time_diff_month . \" months ago\";\n }\n }else if ($time_diff_year <= 1){\n if ($time_diff_year == 1){\n return \"1 year ago\";\n }else {\n return $time_diff_year . \" years ago\";\n }\n }\n }", "function time_ago( $type = 'post' ) {\n\n $d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';\n return human_time_diff($d('U'), current_time('timestamp')) . \" \" . __('ago');\n\n}", "public function test_elapsed_time() {\n\t\t$this->assertInternalType( 'string', locomotive_time_ago( 1472852621 ) );\n\t}", "function adelle_theme_time_ago( $type = 'comment' ) {\r\n $d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';\r\n return human_time_diff($d( 'U' ), current_time( 'timestamp' )) . \" \" . __( 'ago', 'adelle-theme' );\r\n}", "public static function timeAgo($originTime){\n $timestamp = strtotime($originTime);\n\n $strTime = array(\"second\", \"minute\", \"hour\", \"day\", \"month\", \"year\");\n $length = array(\"60\",\"60\",\"24\",\"30\",\"12\",\"10\");\n /*$currentTime = time();*/\n $expression = new \\yii\\db\\Expression('NOW()');\n $now = (new \\yii\\db\\Query)->select($expression)->scalar();\n $currentTime = strtotime($now);\n\n if($currentTime >= $timestamp) {\n $diff = $currentTime- $timestamp;\n for($i = 0; $diff >= $length[$i] && $i < count($length)-1; $i++) {\n $diff = $diff / $length[$i];\n }\n\n $diff = round($diff);\n $singular = \"\";\n if($diff > 1){\n $singular = \"s\";\n }\n return $diff . \" \" . $strTime[$i] . $singular.\" ago \";\n }\n\n }", "function facebook_time_ago($TIMESTAMP)\n\t\t{\n\t\t\t$time_ago = strtotime($TIMESTAMP);\n\t\t\t$current_time = time();\n\t\t\t$time_difference = $current_time - $time_ago;\n\n\t\t\t$seconds = $time_difference;\n\t\t\t$minutes = round($seconds / 60);\t\t//60 seconds\n\t\t\t$hours = round($seconds / 3600);\t\t//60 * 60\n\t\t\t$days = round($seconds / 86400);\t// 24 * 60 * 60\n\t\t\t$weeks = round($seconds / 604800); //7*24*60*60\n\t\t\t$months = round($seconds / 2629440);\n\t\t\t$years = round($seconds / 31553280);\n\n\t\t\tif($seconds <=60 )\n\t\t\t{\n\t\t\t\treturn \"Born Now\";\n\t\t\t}\n\t\t\telse if($minutes <=60)\n\t\t\t{\n\t\t\t\tif($minutes==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"one minute ago\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$minutes minutes ago\";\n\t\t\t}\n\t\t\t}\n\t\t\telse if($hours <=24)\n\t\t\t{\n\t\t\t\tif($hours==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"one hour old\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$hours hrs old\";\n\t\t\t}\n\t\t\t}\n\t\t\telse if($days <=7)\n\t\t\t{\n\t\t\t\tif($days==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"yesterday\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$days days old\";\n\t\t\t}\n\t\t\t}\n\t\t\telse if($weeks <=4.3) //4.3 == 52/12\n\t\t\t{\n\t\t\t\tif($weeks==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"a week old\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$weeks weeks old\";\n\t\t\t}\n\t\t\t}\n\t\t\telse if($months <=12)\n\t\t\t{\n\t\t\t\tif($months==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"a month old\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$months months old\";\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($years==1)\n\t\t\t\t{\n\t\t\t\t\treturn \"one year old\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"$years years old\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static function timeAgo($from, $to='') {\n\t\tif ( empty($to) ) $to = time();\n\t\t\n\t\t$from = is_string($from)? strtotime($from) : intval($from);\n\t\t$to = is_string($to)? strtotime($to) : intval($to);\n\t\t\n\t\t$since = '';\n\t\t$diff = (int) abs($to - $from); //in seconds\n\t\tif ($diff <= 3600) $since = round($diff / 60).'m ago'; /* 1 minute .. 60 minutes */\n\t\telseif ( $diff>3600 && $diff<=86400 ) $since = round($diff / 3600).'h ago'; /* 1 hour .. 24 hours */\n\t\telseif ( $diff>86400 && $diff<=604800 ) $since = round($diff / 86400).'d ago'; /* 1 day .. 7 days */\n\t\telseif ( $diff>604800 && $diff<=3024000 ) $since = round($diff / 604800).'w ago'; /* 1 week .. 5 weeks */\n\t\t\n\t\treturn $since;\n\t}", "function time_ago_specific($date, $from = \"now\")\r\n{\r\n $datetime = strtotime($from);\r\n $date2 = strtotime(\"\" . $date);\r\n $holdtotsec = $datetime - $date2;\r\n $holdtotmin = ($datetime - $date2) / 60;\r\n $holdtothr = ($datetime - $date2) / 3600;\r\n $holdtotday = intval(($datetime - $date2) / 86400);\r\n $str = '';\r\n if (0 < $holdtotday) {\r\n $str .= $holdtotday . \"d \";\r\n }\r\n $holdhr = intval($holdtothr - $holdtotday * 24);\r\n $str .= $holdhr . \"h \";\r\n $holdmr = intval($holdtotmin - ($holdhr * 60 + $holdtotday * 1440));\r\n $str .= $holdmr . \"m\";\r\n return $str;\r\n}", "function timeSince ( $timestamp ) {\r\n\r\n\t$diff = time() - $timestamp;\r\n\r\n\tif ( $diff < 4000 ) {\r\n\t\t$diff = ceil ( $diff / 60 );\r\n\t\t$unit = \"minute\";\r\n\r\n\t} elseif ( $diff < 100000 ) {\r\n\t\t$diff = ceil ( $diff / 3600 );\r\n\t\t$unit = \"hour\";\r\n\r\n\t} else {\r\n\t\t$diff = ceil ( $diff / 86400 );\r\n\t\t$unit = \"day\";\r\n\t}\r\n\r\n\t$end = ( $diff <= 1 ) ? NULL : \"s\";\r\n\r\n\treturn \"$diff $unit$end ago\";\r\n\r\n}", "public function test_time_ago() {\n\t\t$time = current_time( 'timestamp' );\n\t\t$time_ago = locomotive_time_ago( $time );\n\n\t\t$this->assertEquals( '1 min ago', $time_ago );\n\t}", "function get_time_ago( $time )\n{\n $time_difference = time() - $time;\n \n if( $time_difference < 1 ) { return 'less than 1 second ago'; }\n $condition = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n \n foreach( $condition as $secs => $str )\n {\n $d = $time_difference / $secs;\n \n if( $d >= 1 )\n {\n $t = round( $d );\n return $t . ' ' . $str . ( $t > 1 ? 's' : '' ) . ' ago';\n }\n }\n}", "function time_calc($up_time)\n {\n // time is of the form YYYY-MM-DD HH:MM:SS.MILISEC\n $x = explode(' ', $up_time);\n $y = explode('-', $x[0]);\n $z = explode(':', $x[1]);\n\n // condition for year\n if(((int)date('Y') - (int)$y[0]) > 0)\n {\n $temp = ((int)date('Y') - (int)$y[0]);\n $temp = $temp.\" years ago\";\n return($temp);\n }\n else if(((int)date('m') - (int)$y[1]) > 0)\n {\n $temp = ((int)date('m') - (int)$y[1]);\n $temp = $temp.\" months ago\";\n return($temp);\n }\n else if(((int)date('d') - (int)$y[2]) > 0)\n {\n $temp = ((int)date('d') - (int)$y[2]);\n $temp = $temp.\" days ago\";\n return($temp);\n }\n else if(((int)date('H') - (int)$z[0]) > 0)\n {\n $temp = ((int)date('H') - (int)$z[0]);\n $temp = $temp.\" hrs ago\";\n return($temp);\n }\n else if(((int)date('i') - (int)$z[1]) > 0)\n {\n $temp = ((int)date('i') - (int)$z[1]);\n $temp = $temp.\" mins ago\";\n return($temp);\n }\n }", "function formattime_ago($time) {\n\t$period = $GLOBALS['i18']['time_period'];\n\t$periods = $GLOBALS['i18']['time_periods'];\n\t$lengths = array(\"60\",\"60\",\"24\",\"7\",\"4.35\",\"12\",\"10\");\n\n\t$now = time();\n\t$difference = $now - $time;\n\t$tense = $GLOBALS['i18']['ago'];\n\n\tfor($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {\n\t\t$difference /= $lengths[$j];\n\t}\n\t$difference = round($difference);\n\t\n\tif($difference > 1)\n\t\t$period_lbl = $periods[$j];\n\telse\n\t\t$period_lbl = $period[$j];\n\t\t\n\treturn str_replace('%', $difference.\" \".$period_lbl, $tense);\n}", "function tc_time_ago($from_time, $include_seconds = true) {\n\t\t$to_time = time();\n\t\t$mindist = round(abs($to_time - $from_time) / 60);\n\t\t$secdist = round(abs($to_time - $from_time));\n\t \n\t\tif ($mindist >= 0 and $mindist <= 1) {\n\t\t\tif (!$include_seconds) {\n\t\t\t\treturn ($mindist == 0) ? 'less than a minute' : '1 minute';\n\t\t} else {\n\t\t\t\tif ($secdist >= 0 and $secdist <= 4) {\n\t\t\t\t\treturn 'less than 5 seconds';\n\t\t\t\t} elseif ($secdist >= 5 and $secdist <= 9) {\n\t\t\t\t\treturn 'less than 10 seconds';\n\t\t\t\t} elseif ($secdist >= 10 and $secdist <= 19) {\n\t\t\t\t\treturn 'less than 20 seconds';\n\t\t\t\t} elseif ($secdist >= 20 and $secdist <= 39) {\n\t\t\t\t\treturn 'half a minute';\n\t\t\t\t} elseif ($secdist >= 40 and $secdist <= 59) {\n\t\t\t\t\treturn 'less than a minute';\n\t\t\t\t} else {\n\t\t\t\t\treturn '1 minute';\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($mindist >= 2 and $mindist <= 44) {\n\t\t\treturn $mindist . ' minutes';\n\t\t} elseif ($mindist >= 45 and $mindist <= 89) {\n\t\t\treturn 'about 1 hour';\n\t\t} elseif ($mindist >= 90 and $mindist <= 1439) {\n\t\t\treturn 'about ' . round(floatval($mindist) / 60.0) . ' hours';\n\t\t} elseif ($mindist >= 1440 and $mindist <= 2879) {\n\t\t\treturn '1 day';\n\t\t} elseif ($mindist >= 2880 and $mindist <= 43199) {\n\t\t\treturn 'about ' . round(floatval($mindist) / 1440) . ' days';\n\t\t} elseif ($mindist >= 43200 and $mindist <= 86399) {\n\t\t\treturn 'about 1 month';\n\t\t} elseif ($mindist >= 86400 and $mindist <= 525599) {\n\t\t\treturn round(floatval($mindist) / 43200) . ' months';\n\t\t} elseif ($mindist >= 525600 and $mindist <= 1051199) {\n\t\t\treturn 'about 1 year';\n\t\t} else {\n\t\t\treturn 'over ' . round(floatval($mindist) / 525600) . ' years';\n\t\t}\n\t}", "function get_time_ago($time) {\n $time_difference = time() - $time;\n\n if( $time_difference < 1 ) { return 'less than 1 second ago'; }\n $condition = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n foreach( $condition as $secs => $str )\n {\n $d = $time_difference / $secs;\n\n if( $d >= 1 )\n {\n $t = round( $d );\n return $t . ' ' . $str . ( $t > 1 ? 's' : '' ) . ' ago';\n }\n }\n}", "function jr_ad_posted($m_time) {\r\n $time = get_post_time('G', true);\r\n $time_diff = time() - $time;\r\n\r\n if ( $time_diff > 0 && $time_diff < 24*60*60 )\r\n $h_time = sprintf( __('%s ago', APP_TD), human_time_diff( $time ) );\r\n else\r\n $h_time = mysql2date(get_option('date_format'), $m_time);\r\n echo $h_time;\r\n}", "public static function ago($time, $calculateFrom = 'now') {\n\n\t\t// Calculate to\n\t\t$t = strtotime($time);\n\t\t// Calculate from\n\t\t$c = strtotime($calculateFrom);\n\t\t// Elapsed\n\t\t$e = $c - $t;\n\t\t// Elapsed that day\n\t\t$de = date(\"H\", $c) * TimeAgo::$h + date(\"i\", $c) * TimeAgo::$m + date(\"s\", $c);\n\n\t\tif ($e < TimeAgo::$m) {\n\t\t\t// Now / Second / Seconds\n\t\t\treturn ($e == 0) ? TimeAgo::$string['now'] : ($e == 1 ? TimeAgo::$string['second'] : sprintf(TimeAgo::$string['seconds'], $e));\n\t\t} elseif ($e < TimeAgo::$h) {\n\t\t\t// Minutes\n\t\t\treturn (($m = intval($e / TimeAgo::$m)) && $m == 1) ? TimeAgo::$string['minute'] : sprintf(TimeAgo::$string['minutes'], $m);\n\t\t} elseif ($e < TimeAgo::$d) {\n\t\t\t// Today - Hours\n\t\t\treturn (($h = intval($e / TimeAgo::$h)) && $h == 1) ? TimeAgo::$string['hour'] : sprintf(TimeAgo::$string['hours'], $h);\n\t\t} elseif ($e <= TimeAgo::$d + $de) {\n\t\t\t// Yesterday\n\t\t\treturn TimeAgo::$string['yesterday'];\n\t\t} elseif ($e < TimeAgo::$d * 6 + $de) {\n\t\t\t// Last week\n\t\t\treturn sprintf(TimeAgo::$string['on'], TimeAgo::$weekDays[date(\"w\", $t)]);\n\t\t} elseif ($e < TimeAgo::$mo) {\n\t\t\t// less then month\n\t\t\t// Weeks\n\t\t\tif ($e < TimeAgo::$w * 2) {\n\t\t\t\t// Last seven days\n\t\t\t\treturn TimeAgo::$string['week'];\n\t\t\t} elseif ($e < TimeAgo::$w * 3) {\n\t\t\t\t// 2 weeks\n\t\t\t\treturn sprintf(TimeAgo::$string['weeks'], 2);\n\t\t\t} else {\n\t\t\t\t// 3 weeks\n\t\t\t\treturn sprintf(TimeAgo::$string['weeks'], 3);\n\t\t\t}\n\t\t} elseif ($e < TimeAgo::$y) {\n\t\t\t// less then year\n\t\t\t// Month / Months\n\t\t\treturn ($e < TimeAgo::$mo * 2) ? TimeAgo::$string['month'] : sprintf(TimeAgo::$string['months'], intval($e / TimeAgo::$mo));\n\t\t} else {\n\t\t\t// Year / Years\n\t\t\treturn ($e >= TimeAgo::$y && $e < TimeAgo::$y * 2) ? TimeAgo::$string['year'] : sprintf(TimeAgo::$string['years'], intval($e / TimeAgo::$y));\n\t\t}\n\t}", "function time_ago_in_words($from_time, $include_seconds = false)\n{\n return distance_of_time_in_words($from_time, time(), $include_seconds);\n}", "function time_ago($d1, $d2){\r\n\t$d1 = (is_string($d1) ? strtotime($d1) : $d1);\r\n\t$d2 = (is_string($d2) ? strtotime($d2) : $d2);\r\n\r\n\t$diff_secs = abs($d1 - $d2);\r\n\t$base_year = min(date(\"Y\", $d1), date(\"Y\", $d2));\r\n\r\n\t$diff = mktime(0, 0, $diff_secs, 1, 1, $base_year);\r\n\t$diffArray = array(\r\n\t\t\"years\" => date(\"Y\", $diff) - $base_year,\r\n\t\t\"months_total\" => (date(\"Y\", $diff) - $base_year) * 12 + date(\"n\", $diff) - 1,\r\n\t\t\"months\" => date(\"n\", $diff) - 1,\r\n\t\t\"days_total\" => floor($diff_secs / (3600 * 24)),\r\n\t\t\"days\" => date(\"j\", $diff) - 1,\r\n\t\t\"hours_total\" => floor($diff_secs / 3600),\r\n\t\t\"hours\" => date(\"G\", $diff),\r\n\t\t\"minutes_total\" => floor($diff_secs / 60),\r\n\t\t\"minutes\" => (int) date(\"i\", $diff),\r\n\t\t\"seconds_total\" => $diff_secs,\r\n\t\t\"seconds\" => (int) date(\"s\", $diff)\r\n\t);\r\n\tif($diffArray['days'] > 0){\r\n\t\tif($diffArray['days'] == 1){\r\n\t\t\t$days = '1 day';\r\n\t\t}else{\r\n\t\t\t$days = $diffArray['days'] . ' days';\r\n\t\t}\r\n\t\treturn $days . ' and ' . $diffArray['hours'] . ' hours ago';\r\n\t}else if($diffArray['hours'] > 0){\r\n\t\tif($diffArray['hours'] == 1){\r\n\t\t\t$hours = '1 hour';\r\n\t\t}else{\r\n\t\t\t$hours = $diffArray['hours'] . ' hours';\r\n\t\t}\r\n\t\treturn $hours . ' and ' . $diffArray['minutes'] . ' minutes ago';\r\n\t}else if($diffArray['minutes'] > 0){\r\n\t\tif($diffArray['minutes'] == 1){\r\n\t\t\t$minutes = '1 minute';\r\n\t\t}else{\r\n\t\t\t$minutes = $diffArray['minutes'] . ' minutes';\r\n\t\t}\r\n\t\treturn $minutes . ' and ' . $diffArray['seconds'] . ' seconds ago';\r\n\t}else{\r\n\t\treturn 'Less than a minute ago';\r\n\t}\r\n}", "function TimeAgo($datefrom,$dateto=-1) {\n\t\t// its an error rather than the epoch\n\n\t\tif($datefrom<=0) { return \"A long time ago\"; }\n\t\tif($dateto==-1) { $dateto = time(); }\n\n\t\t// Calculate the difference in seconds betweeen\n\t\t// the two timestamps\n\n\t\t$difference = $dateto - $datefrom;\n\n\t\t// If difference is less than 60 seconds,\n\t\t// seconds is a good interval of choice\n\n\t\tif($difference < 60) {\n\t\t\t$interval = \"s\";\n\t\t}\n\n\t\t// If difference is between 60 seconds and\n\t\t// 60 minutes, minutes is a good interval\n\t\telseif($difference >= 60 && $difference<60*60) {\n\t\t\t$interval = \"n\";\n\t\t}\n\n\t\t// If difference is between 1 hour and 24 hours\n\t\t// hours is a good interval\n\t\telseif($difference >= 60*60 && $difference<60*60*24) {\n\t\t\t$interval = \"h\";\n\t\t}\n\n\t\t// If difference is between 1 day and 7 days\n\t\t// days is a good interval\n\t\telseif($difference >= 60*60*24 && $difference<60*60*24*7){\n\t\t\t$interval = \"d\";\n\t\t}\n\n\t\t// If difference is between 1 week and 30 days\n\t\t// weeks is a good interval\n\t\telseif($difference >= 60*60*24*7 && $difference <60*60*24*30) {\n\t\t\t$interval = \"ww\";\n\t\t}\n\n\t\t// If difference is between 30 days and 365 days\n\t\t// months is a good interval, again, the same thing\n\t\t// applies, if the 29th February happens to exist\n\t\t// between your 2 dates, the function will return\n\t\t// the 'incorrect' value for a day\n\t\telseif($difference >= 60*60*24*30 && $difference <60*60*24*365) {\n\t\t\t$interval = \"m\";\n\t\t}\n\n\t\t// If difference is greater than or equal to 365\n\t\t// days, return year. This will be incorrect if\n\t\t// for example, you call the function on the 28th April\n\t\t// 2008 passing in 29th April 2007. It will return\n\t\t// 1 year ago when in actual fact (yawn!) not quite\n\t\t// a year has gone by\n\t\telseif($difference >= 60*60*24*365) {\n\t\t\t$interval = \"y\";\n\t\t}\n\n\t\t// Based on the interval, determine the\n\t\t// number of units between the two dates\n\t\t// From this point on, you would be hard\n\t\t// pushed telling the difference between\n\t\t// this function and DateDiff. If the $datediff\n\t\t// returned is 1, be sure to return the singular\n\t\t// of the unit, e.g. 'day' rather 'days'\n\n\t\tswitch($interval) {\n\t\t\tcase \"m\":\n\t\t\t$months_difference = floor($difference / 60 / 60 / 24 /29);\n\t\t\twhile (mktime(date(\"H\", $datefrom), date(\"i\", $datefrom), date(\"s\", $datefrom), date(\"n\", $datefrom)+($months_difference), date(\"j\", $dateto), date(\"Y\", $datefrom)) < $dateto) {\n\t\t\t\t$months_difference++;\n\t\t\t}\n\t\t\t$datediff = $months_difference;\n\n\t\t\t// We need this in here because it is possible\n\t\t\t// to have an 'm' interval and a months\n\t\t\t// difference of 12 because we are using 29 days\n\t\t\t// in a month\n\n\t\t\tif($datediff==12) {\n\t\t\t\t$datediff--;\n\t\t\t}\n\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->monthAgo : \"$datediff \".$this->lang()->index->monthsAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"y\":\n\t\t\t$datediff = floor($difference / 60 / 60 / 24 / 365);\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$string->index->yearAgo : \"$datediff \".$this->lang()->index->yearsAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"d\":\n\t\t\t$datediff = floor($difference / 60 / 60 / 24);\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->dayAgo : \"$datediff \".$this->lang()->index->daysAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"ww\":\n\t\t\t$datediff = floor($difference / 60 / 60 / 24 / 7);\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->weekAgo : \"$datediff \".$this->lang()->index->weeksAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"h\":\n\t\t\t$datediff = floor($difference / 60 / 60);\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->hourAgo : \"$datediff \".$this->lang()->index->hoursAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"n\":\n\t\t\t$datediff = floor($difference / 60);\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->minuteAgo :\"$datediff \".$this->lang()->index->minutesAgo;\n\t\t\tbreak;\n\n\t\t\tcase \"s\":\n\t\t\t$datediff = $difference;\n\t\t\t$res = ($datediff==1) ? \"$datediff \".$this->lang()->index->secondAgo :\"$datediff \".$this->lang()->index->secondsAgo;\n\t\t\tbreak;\n\t\t}\n\t\treturn $res;\n\t}", "function relativeTime($time)\n{\n $delta = strtotime('+2 hours') - strtotime($time);\n if ($delta < 2 * MINUTE) {\n return \"1 min ago\";\n }\n if ($delta < 45 * MINUTE) {\n return floor($delta / MINUTE) . \" min ago\";\n }\n if ($delta < 90 * MINUTE) {\n return \"1 hour ago\";\n }\n if ($delta < 24 * HOUR) {\n return floor($delta / HOUR) . \" hours ago\";\n }\n if ($delta < 48 * HOUR) {\n return \"yesterday\";\n }\n if ($delta < 30 * DAY) {\n return floor($delta / DAY) . \" days ago\";\n }\n if ($delta < 12 * MONTH) {\n $months = floor($delta / DAY / 30);\n return $months <= 1 ? \"1 month ago\" : $months . \" months ago\";\n } else {\n $years = floor($delta / DAY / 365);\n return $years <= 1 ? \"1 year ago\" : $years . \" years ago\";\n }\n}" ]
[ "0.7884377", "0.7260282", "0.7164432", "0.7141273", "0.71319723", "0.69959986", "0.69959986", "0.6964994", "0.6928122", "0.6927246", "0.6920535", "0.6904305", "0.68963015", "0.68765604", "0.6823943", "0.6807985", "0.6800133", "0.679153", "0.6774584", "0.6748985", "0.67376643", "0.6712182", "0.67046297", "0.67011017", "0.66885126", "0.66618574", "0.666059", "0.66550803", "0.66526425", "0.65859777" ]
0.818667
0
setupHeaderMid The method adds the header for a middle page to the frame passed as argument.
function setupHeaderMid( $_frm) { $_frm->addLine( "Kommissionierung", $this->defParaFmt) ; $_frm->addLine( sprintf( "Kommission Nr. %s, %s", $this->myCustomerCommission->CustomerCommissionNo, $this->myCustomerCommission->Datum), $this->defParaFmt) ; /** * draw the separating line between the header and the document content */ $this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0), $_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function\tsetupHeaderMid( $_frm) {\n\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT', FTr::tr( \"Inventory\", null, $this->lang)), $this->defParaFmt) ;\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT',\n\t\t\t\t\t\t\t\t\tFTr::tr( \"Inventory no. #1, Key date #2\",\n\t\t\t\t\t\t\t\t\t\t\tarray( \"%s:\".$this->myInv->InvNo, \"%s:\".$this->myInv->KeyDate),\n\t\t\t\t\t\t\t\t\t\t\t$this->lang)),\n\t\t\t\t\t\t\t\t\t$this->defParaFmt) ;\n\t\t\n\t\t/**\n\t\t * draw the separating line between the header and the document content\n\t\t */\n\t\t$this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0),\n\t\t\t\t\t$_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ;\n\t}", "public function prePageHeader();", "function blankMiddleBox($header,$subline,$body){\n\t\techo \"<div class='side-body-bg'>\\n\";\n\t\techo \"<span class='scapmain'>$header</span>\\n\";\n\t\techo \"<br />\\n\";\n\t\techo \"<span class='poster'>$subline</span>\\n\";\n\t\techo \"</div>\\n\";\n\t\techo \"<div class='tbl'>$body</div>\\n\";\n\t\techo \"<br />\\n\";\n\t}", "abstract protected function header();", "function NewPageHeader () {\n\tglobal $PageNumber,\n\t\t\t\t$pdf,\n\t\t\t\t$YPos,\n\t\t\t\t$YPos2,\n\t\t\t\t$YPos4,\n\t\t\t\t$Page_Height,\n\t\t\t\t$Page_Width,\n\t\t\t\t$Top_Margin,\n\t\t\t\t$FontSize,\n\t\t\t\t$Left_Margin,\n\t\t\t\t$XPos,\n\t\t\t\t$XPos2,\n\t\t\t\t$Right_Margin,\n\t\t\t\t$line_height;\n\t\t\t\t$line_width;\n\n\t/*PDF page header for GL Account report */\n\n\tif ($PageNumber > 1){\n\t\t$pdf->newPage();\n\t}\n$YPos= $Page_Height-$Top_Margin;\n\n\n\t\n\n\n}", "abstract public function header();", "private function writeHcenter(): void\n {\n $record = 0x0083; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fHCenter);\n\n $this->append($header . $data);\n }", "function Header()\n {\n\n\n //list($r, $b, $g) = $this->xheadercolor;\n $this->setY(5);\n //$this->SetFillColor($r, $b, $g);\n //$this->SetTextColor(0 , 0, 0);\n //$this->Cell(0,20, '', 0,1,'C', 1);\n //$this->Text(15,26,$this->xheadertext );\n \n \n // get the current page break margin\n $bMargin = $this->getBreakMargin();\n // get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n // disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n // set bacground image\n $img_file = WWW_ROOT.'/img/Resul_Agua.jpg';\n $this->Image($img_file, 0, 0, 216, 279, '', '', '', false, 300, '', false, false, 0);\n // restore auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n // set the starting point for the page content\n $this->setPageMark();\n \n\n $this->writeHTML($this->xheadertext, true, false, true, false, '');\n\n // Transformacion para la rotacion de el numero de orden y el contenedor de la muestra\n $this->StartTransform();\n //$this->SetFont('freesans', '', 5);\n $this->SetFont('', '', 5);\n $this->Rotate(-90, 117, 117);\n //$tcpdf->Rect(39, 50, 40, 10, 'D');\n $this->Text(5, 30, 'Software Asistencial Médico \"SAM\" V.1.1 ® - https://samsalud.info ®');\n // Stop Transformation\n $this->StopTransform();\n\n // if ( $this->variable == 1 )\n // {\n // draw jpeg image x, y ancho, alto\n // $this->Image(WWW_ROOT.'/img/BORRADOR.png', 40, 60, 450, 250, '', '', '', true, 72);\n\n // restore full opacity\n $this->SetAlpha(0);\n // }\n\n }", "public function initPageHeaders()\n\t{\n\t\tinclude_once('view/main_page_header.php');\n\t}", "public function setHeader($header, $margin) {\n\t}", "function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n {\n }", "public function setHeader($header);", "function privWriteCentralFileHeader(&$p_header)\n {\n }", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function Header() \n { \n\n list($r, $b, $g) = $this->xheadercolor; \n $this->setY(10); // shouldn't be needed due to page margin, but helas, otherwise it's at the page top \n $this->SetFillColor($r, $b, $g); \n $this->SetTextColor(0 , 0, 0); \n $this->Cell(0,20, '', 0,1,'C', 1); \n $this->Text(15,26,$this->xheadertext ); \n }", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function Header() {\n // si la pagina es diferente de la 2\n // if (count($this->pages) !== 2) \n // {\n // Logo\n $image_file = K_PATH_IMAGES.'logoesen.jpg';\n $this->Image($image_file, 90, 5, 25, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);\n // Set font\n $this->SetFont('helvetica', 'B', 20);\n // Title\n //$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');\n // }\n }", "static public function displayHeader($page_title) {\r\n ?>\r\n <!DOCTYPE html>\r\n <html>\r\n <head>\r\n <title> <?php echo $page_title ?> </title>\r\n <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\r\n <link type='text/css' rel='stylesheet' href='<?= BASE_URL ?>/www/css/app_style.css' />\r\n \r\n <script>\r\n //create the JavaScript variable for the base url\r\n var base_url = \"<?= BASE_URL ?>\";\r\n \r\n \r\n </script>\r\n </head>\r\n <body>\r\n <div id=\"top\"></div>\r\n <div id='wrapper'>\r\n <div id=\"banner\">\r\n \r\n <div id=\"left\">\r\n \r\n <span style='color: #000; font-size: 12pt; z-index:1; position:relative; top: -50px; font-weight: bold; vertical-align: center; font-family: mona shark;'>\r\n <img src=\"<?= BASE_URL ?>/www/img/logo.png\">\r\n \r\n </span>\r\n \r\n <div style='color: #000; font-size: 14pt; font-weight: bold; font-family:calibri; letter-spacing:4px; text-align:center; position:relative;'>Find any power, any ability at your one-stop black market shop.</div>\r\n </div>\r\n </a>\r\n <div id=\"right\">\r\n \r\n </div>\r\n </div>\r\n \r\n <?php\r\n \r\n \r\n }", "public static function after_header() {\r\n\r\n\t}", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "function Header() {\n if(empty($this->title) || $this->PageNo() == 1) return;\n $oldColor = $this->TextColor;\n $this->SetTextColor(PDF_HEADER_COLOR['red'],\n PDF_HEADER_COLOR['green'],\n PDF_HEADER_COLOR['blue']);\n $x = $this->GetX();\n $y = $this->GetY();\n $this->SetY(10, false);\n $this->SetFont('', 'B');\n $this->Cell(0, 10, $this->title);\n $this->SetFont('', '');\n $this->SetXY($x, $y);\n $this->TextColor = $oldColor;\n }", "function MidHead($title)\n {\n // Arial bold 15\n $this->SetFont('Arial','B',15);\n // Calculate width of title and position\n $w = $this->GetStringWidth($title)+6;\n $this->SetX((210-$w)/2);\n // Colors of frame, background and text\n $this->SetDrawColor(0,80,180);\n $this->SetFillColor(230,230,0);\n //$this->SetTextColor(220,50,50);\n // Thickness of frame (1 mm)\n $this->SetLineWidth(1);\n // Title\n $this->Cell($w,9,$title,1,1,'C',true);\n // Line break\n $this->Ln(10);\n }", "protected function _drawHeader(Zend_Pdf_Page $page)\n {\n // $this->_setFontRegular($page, 10);\n // $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));\n // $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));\n // $page->setLineWidth(0.5);\n // $page->drawRectangle(25, $this->y, 570, $this->y-15);\n // $this->y -= 10;\n // $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));\n\n // //columns headers\n // $lines[0][] = array(\n // 'text' => Mage::helper('sales')->__('Products'),\n // 'feed' => 100,\n // );\n\n // $lines[0][] = array(\n // 'text' => Mage::helper('sales')->__('Qty'),\n // 'feed' => 35\n // );\n\n // $lines[0][] = array(\n // 'text' => Mage::helper('sales')->__('SKU'),\n // 'feed' => 565,\n // 'align' => 'right'\n // );\n\n // $lineBlock = array(\n // 'lines' => $lines,\n // 'height' => 10\n // );\n\n // $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));\n // $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\n // $this->y -= 20;\n }", "function Header(){\n\t\t}", "public function addHeader()\n {\n }", "public function hookDisplayHeader($params){\r\n\r\n\t}", "function display_header() {}", "abstract public function SetHeaders();", "function set_page_header( $page_header )\n {\n $this->includes[ 'page_header' ] = $page_header;\n return $this;\n }", "public function header($page = null)\n {\n ?>\n <!DOCTYPE HTML>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"description\" content=\"Unicat project\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <?php\n foreach ($this->css as $css) {\n ?>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"<?= $css ?>\"><?php\n }\n ?>\n <title><?= (isset($page) ? $page : null) ?><?= !empty($this->companyName) ? '-' . $this->companyName : null ?></title>\n </head>\n <body>\n <?php\n }" ]
[ "0.64847016", "0.6227221", "0.54541034", "0.54457843", "0.54350674", "0.5391063", "0.53523505", "0.5310973", "0.5279594", "0.5274549", "0.523391", "0.5224938", "0.5202166", "0.5199482", "0.5195606", "0.5190355", "0.51844", "0.51826537", "0.5156028", "0.51532614", "0.51531416", "0.5128389", "0.51283205", "0.51148564", "0.50801694", "0.5063066", "0.5058214", "0.5050383", "0.5049001", "0.50410634" ]
0.65150595
0
Concatenate the values in a specific $key of an $iterable with a ';'
protected function concatenateIntoString(array $iterable = null, $key, $nested = null, $nestedKey = null) { if (!is_null($iterable)) { $placeholders = []; if (!$nested) { foreach ($iterable as $iterate) { $placeholders[] = (is_array($iterate) && array_key_exists($key, $iterate)) ? $iterate[$key] : ''; } } else { foreach ($iterable as $iterate) { if (is_array($iterate) && array_key_exists($key, $iterate)) { foreach ($iterate[$key] as $nest) { $placeholders[] = (is_array($nest) && array_key_exists($nestedKey, $nest)) ? $nest[$nestedKey] : ''; } } } } return implode(';', $placeholders); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function implode_assoc(array $array, $betweenKeyAndValue, $beforeItems='', $afterItems='') {\n\t$result = '';\n\tforeach ($array as $k=>$v) {\n\t\t$result .= $beforeItems.$k.$betweenKeyAndValue.$v.$afterItems;\n\t}\n\treturn $result;\n}", "function Array2Str($kvsep, $entrysep, $a){\n $str = \"\";\n foreach ($a as $k=>$v){\n $str .= \"{$k}{$kvsep}{$v}{$entrysep}\";\n }\n return $str;\n}", "function implode_assoc($array, array $overrideOptions = array())\n {\n\n // These default options set the defaults but are over-written by matching values from $overrideOptions\n $options = array(\n 'inner_glue' => '=',\n 'outer_glue' => '&',\n 'prepend' => '',\n 'append' => '',\n 'skip_empty' => false,\n 'prepend_inner_glue' => false,\n 'append_inner_glue' => false,\n 'prepend_outer_glue' => false,\n 'append_outer_glue' => false,\n 'urlencode' => false,\n 'part' => 'both' //'both', 'key', or 'value'\n );\n\n // Use values from $overrideOptions that match keys in $options and then extract those values into\n // the current workspace.\n foreach ($overrideOptions as $key=>$val) {\n if (isset($options[$key])) {\n $options[$key] = $val;\n }\n }\n extract($options);\n\n // $output holds the imploded results of the key-value pairs\n $output = array();\n\n // Create a collection of the inner key-value pairs and glue them as indicated by the $options\n foreach ($array as $key=>$item) {\n\n // If not skipping empty values OR if the item evaluates to true.\n // i.e. If $skip_empty is true then check to see if the array item's value evaluates to true.\n if (!$skip_empty || $item) {\n\n $output[] =\n ($prepend_inner_glue ? $inner_glue : '').\n ($part != 'value' ? $key : ''). // i.e. show the $key if $part is 'both' or 'key'\n ($part == 'both' ? $inner_glue : '').\n // i.e. show the $item if $part is 'both' or 'value' and optionally urlencode $item\n ($part != 'key' ? ($urlencode ? urlencode($item) : $item) : '').\n ($append_inner_glue ? $inner_glue : '');\n }\n }\n\n return $prepend. ($prepend_outer_glue ? $outer_glue : '') . implode($outer_glue, $output) . ($append_outer_glue ? $outer_glue : '') . $append;\n }", "function implode_assoc( $inner_glue, $outer_glue, $array ) {\n\t$output = array();\n\tforeach( $array as $key => $item ) {\n\t\t$output[] = $key . $inner_glue . urlencode( $item );\n\t}\n\treturn implode( $outer_glue, $output );\n}", "function implode_assoc($inner_glue,$outer_glue,$array,$skip_empty=false){\n\t\t$output=array();\n\t\tforeach($array as $key=>$item) {\n\t\t\tif(!$skip_empty || isset($item)) {\n\t\t\t\t$output[] = $key.$inner_glue.$item;\n\t\t\t}\n\t\t}\n\n\t\treturn implode($outer_glue,$output);\n\t}", "public function join($values);", "function implode_assoc($inner_glue, $outer_glue, $array) {\n $output = array();\n foreach($array as $key => $item) {\n $output[] = $key . $inner_glue . urlencode($item);\n }\n return implode($outer_glue, $output);\n}", "function implode_assoc_r ($inner_glue = \"=\", $outer_glue = \"\\n\", $array = null, $keepOuterKey = false) {\n\t\t$output = array();\n\t\tforeach($array as $key => $item ) {\n\t\t\tif (is_array ($item)) {\n\t\t\t\tif ($keepOuterKey) {\n\t\t\t\t\t$output[] = $key;\n\t\t\t\t}\n\t\t\t\t$output[] = implode_assoc_r ($inner_glue, $outer_glue, $item, $keepOuterKey);\n\t\t\t} else {\n\t\t\t\t$output[] = $key . $inner_glue . $item;\n\t\t\t}\n\t\t}\n\t\treturn implode($outer_glue, $output);\n\t}", "public function testImplodeArrayWithKeys()\n {\n $this->assertEquals(\n StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE . '=' . StringUtils::QUOTE . static::TEST_STRING\n . StringUtils::QUOTE,\n StringUtils::implodeRecursively(\n array(static::TEST_STRING => static::TEST_STRING),\n StringUtils::EMPTY_STR,\n null,\n true\n )\n );\n }", "function expression_function_join($collection, $glue = '')\n{\n if ($collection instanceof \\Iterator) {\n $collection = iterator_to_array($collection);\n }\n if (is_array($collection)) {\n return implode($glue, $collection);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "public function join($imploder = '')\n {\n return Str(implode($imploder, $this->array));\n }", "function implodeArray($array, $glue = ' = ') {\n $return = $array;\n if (is_array($array)) {\n $return = '';\n foreach ($array as $key => $value) {\n if ($return != '') {\n $return .= PHP_EOL;\n }\n $return .= $key . $glue . $value;\n }\n }\n return $return;\n}", "function combinevalues($arr)\n{\n\t$ret=\"\";\n\tforeach($arr as $item)\n\t{\n\t\t$val = $item;\n\t\tif(strlen($ret))\n\t\t\t$ret.=\",\";\n\t\tif(strpos($val,\",\")===false && strpos($val,'\"')===false)\n\t\t\t$ret.=$val;\n\t\telse\n\t\t{\n\t\t\t$val=str_replace('\"','\"\"',$val);\n\t\t\t$ret.='\"'.$val.'\"';\n\t\t}\n\t}\n\treturn $ret;\n}", "static function key() {\n return implode(self::JOIN, func_get_args());\n }", "public function join()\n {\n $result = array();\n\n if (method_exists($this, 'convert')) {\n $data = $this->convert($this->_data);\n } else {\n $data = $this->_data;\n }\n\n foreach (array_filter($data, function($d) {\n if (is_bool($d) && $d == false) {\n return false;\n } elseif (is_null($d)) {\n return false;\n } else {\n return true;\n }\n }) as $key => $val) {\n $result[] = $this->format($key, $val);\n }\n\n return implode($this->_join, $result);\n }", "function array_implode($glue, $separator, $array) {\r\n if (!is_array($array))\r\n return $array;\r\n $string = array();\r\n foreach ($array as $key => $val) {\r\n if (is_array($val))\r\n $val = implode(',', $val);\r\n $string[] = \"{$key}{$glue}{$val}\";\r\n }\r\n return implode($separator, $string);\r\n}", "private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }", "function listItems($var)\n{\n\n $string = '';\n\n foreach ($var as $key => $value) {\n $key++;\n $string .= \"[$key]\" . $value . PHP_EOL;\n }\n\n return $string; \n}", "function encodeKeyValueSet($set)\n{\n\treset($set);\n\t$items = Array();\n\twhile (list($key, $value) = each($set))\n\t{\n\t\t$items[] = $key.\"=\".$value;\n\t}\n\treturn implode(\" AND \",$items);\n}", "public function implode($value, $glue = '');", "function addComma($arr) \r\n{\r\n foreach ($arr as $key => $value) {\r\n if ($key == 0){\r\n echo $value;\r\n }\r\n else\r\n echo ',' . $value;\r\n }\r\n}", "function list_items($items) {\n $string = '';\n foreach ($items as $key => $item) {\n $key++;\n $string .= \"[{$key}] {$item}\". PHP_EOL;\n\n }\n \nreturn $string;\n}", "public function testJoinSingleString()\n {\n $this->assertEquals('5', StringFilter::joinValues('5'));\n $this->assertEquals('5,6', StringFilter::joinValues('5,6'));\n }", "public function visitForeachStatement(\n /*IForeachStatement*/ $node) /*: mixed*/ {\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $key = null;\n $key_value = $node->getKey();\n if ($key_value !== null) {\n $key = /*(string)*/$key_value->accept($this);\n }\n $value = /*(string)*/$node->getValue()->accept($this);\n $this->blockIndent = ' ';\n $block = /*(string)*/$node->getBlock()->accept($this);\n\n $result = $this->indent.'foreach (';\n $result .= $collection.' as ';\n if (is_string($key)) {\n $result .= $key.' => ';\n }\n $result .= $value.')'.$block.\"\\n\";\n return $result;\n }", "function collect($Key, $Escape = true) {\n\t\t$Return = array();\n\t\twhile ($Row = mysqli_fetch_array($this->QueryID)) {\n\t\t\t$Return[] = $Escape ? display_str($Row[$Key]) : $Row[$Key];\n\t\t}\n\t\tmysqli_data_seek($this->QueryID, 0);\n\t\treturn $Return;\n\t}", "static public function implode ( &$pdoparams, $arr )\n\t{\n\t\t$tmp = array(); \n\t\tforeach ($arr as $val)\n\t\t{ \n\t\t\t$key = ':implode' . self::$escapecounter++; \n\t\t\t$pdoparams[$key] = $val; \n\t\t\t$tmp[] = $key; \n\t\t} \n\t\treturn implode (',', $tmp); \n\t}", "protected function transpileEndForeach(): string\n {\n return '<?php endforeach; ?>';\n }", "function join_terms($terms, &$out_keys = null, &$out_vals = null) {\n\n\t$ovals = $okeys = [];\n\t$term = [];\n\tforeach ($terms as $k => $v) {\n\t\tif ( is_null($v) )\n\t\t\t$v = \"NULL\";\n\n\t\t$term[] = \"`$k` = $v\";\n\n\t\tif ( !is_null($out_keys) )\n\t\t\t$okeys[] = \"`$k`\";\n\t\tif ( !is_null($out_vals) )\n\t\t\t$ovals[] = $v;\n\t}\n\n\tif ( !is_null($out_keys) )\n\t\t$out_keys = implode(', ', $okeys);\n\tif ( !is_null($out_vals) )\n\t\t$out_vals = implode(', ', $ovals);\n\n\t$pairs = null;\n\tif ( sizeof($term) > 0 )\n\t\t$pairs = implode(', ', $term);\n\n\treturn $pairs;\n}", "private function implodeWithPrepare($arr) {\r\n\t\t$result='';\r\n\t\t\r\n\t\t$first=true;\r\n\t\tforeach($arr as $tr) {\r\n\t\t\t//separate with commas\r\n\t\t\tif(!$first)\r\n\t\t\t\t$result.=\",\";\r\n\t\t\telse \r\n\t\t\t\t$first=false;\r\n\t\t\r\n\t\t\t//every entry in single quotes\r\n\t\t\t$result.=\"'\";\r\n\t\t\t$result.=$this->prepare($tr);\r\n\t\t\t$result.=\"'\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function join(string $glue): string {\n\t\t$inner_glue = '';\n\t\t$glued_values = '';\n\t\tforeach ($this as $value) {\n\t\t\t$glued_values .= $inner_glue . $value;\n\t\t\t$inner_glue = $glue;\n\t\t}\n\t\treturn $glued_values;\n\t}" ]
[ "0.60571873", "0.56504756", "0.55606633", "0.5523884", "0.5509592", "0.55056274", "0.55006605", "0.5498649", "0.5498601", "0.5484996", "0.5363549", "0.5248946", "0.5230871", "0.5226835", "0.52266455", "0.5163507", "0.5156881", "0.5115551", "0.5114725", "0.5067441", "0.4996692", "0.49766654", "0.4974026", "0.49657843", "0.49461073", "0.49398738", "0.49332643", "0.49289486", "0.4925515", "0.49221885" ]
0.62865454
0
Concatenate Indicator values with multiple nesting levels.
protected function concatenateIndicator(array $indicators, $first, $second, $third = null, $fourth = null, $fifth = null) { $temp = []; if (!$fourth && !$fifth) { if (!$third) { foreach ($indicators as $indicator) { $temp[] = getVal($indicator, [$first, 0, $second], ''); } return implode(';', $temp); } foreach ($indicators as $indicator) { foreach (getVal($indicator, [$first, 0, $second], []) as $nest) { $temp[] = getVal($nest, [$third], ''); } } return implode(';', $temp); } foreach ($indicators as $indicator) { foreach (getVal($indicator, [$first, 0, $second], []) as $superNest) { foreach (getVal($superNest, [$third], []) as $nest) { if (!$fifth) { $temp[] = getVal($nest, [$fourth], ''); } else { foreach (getVal($nest, [$fourth], []) as $n) { $temp[] = getVal($n, [$fifth], ''); } } } } } return implode(';', $temp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function concat(Semigroup $value);", "function concat_attr() {\n $str = \"\";\n if ($this->other_attr != NULL) {\n foreach($this->other_attr as $field => $value) {\n $str .= $field.'=\"'.$value.'\" ';\n }\n }\n return $str;\n }", "protected function doConcatenate() {}", "public function __toString()\n\t{\n\t\treturn implode($this->_separator, $this->_stack);\n\t}", "public function get_values(){\n $value_str = '';\n if (is_array($this->value)){\n foreach ($this->value as $val){\n $value_str .= $val.' ';\n }\n } else {\n $value_str .= $this->value;\n }\n\n return $value_str;\n }", "public function concat($value) {\n \n return $this->append($value);\n }", "public function toString($include_parent = null) {}", "public function native($items)\n {\n $result = '';\n if (!empty($items) && is_array($items)) {\n $arrayLength = count($items);\n\n foreach ($items as $key => $item) {\n if($key == 0) { // first item with empty prepend\n $result .= $item;\n } elseif ($key == $arrayLength-1) { //last item with prepend and\n $result .= \" and $item\";\n } else { //other items with coma\n $result .= \", $item\";\n }\n }\n }\n\n return $result;\n }", "public function concatenate($values, $separator = null)\n {\n if ($separator) {\n return '(' . implode('+' . $this->quote($separator) . '+', $values) . ')';\n } else {\n return '(' . implode('+', $values) . ')';\n }\n }", "public function flattenLeft();", "public function flatten($value)\n {\n }", "public function __toString()\n {\n return str_replace(['[{parent_index}]', '[{count}]', '[{kids}]'],\n [$this->index, count($this->kids), implode(\" 0 R \", $this->kids) . \" 0 R\"], $this->data);\n }", "public function __toString()\n {\n return implode($this->separator, $this->data);\n }", "protected static function concat( /*varags*/ ) {\n\t\t$args = array();\n\t\tforeach ( func_get_args() as $arg ) {\n\t\t\tif ( is_array( $arg ) ) {\n\t\t\t\t$args = array_merge( $args, $arg );\n\t\t\t} else {\n\t\t\t\t$args[] = $arg;\n\t\t\t}\n\t\t}\n\n\t\treturn implode( ' ', $args );\n\t}", "public function flatten() {}", "public function flatten() {}", "public function __toString()\n {\n return sprintf(\"[%s, %s]\", $this->getLeft(), $this->getRight());\n }", "public function __toString() {\n // Special case for a single, nested condition group:\n if (count($this->conditions) == 1) {\n return (string) reset($this->conditions);\n }\n $lines = [];\n foreach ($this->conditions as $condition) {\n $lines[] = str_replace(\"\\n\", \"\\n \", (string) $condition);\n }\n return $lines ? \"(\\n \" . implode(\"\\n {$this->conjunction}\\n \", $lines) . \"\\n)\" : '';\n }", "public function toString() {\r\n return implode($this->result);\r\n }", "function compactToString($x) {\n $xout='';\n if( is_array($x) )\n foreach($x as $xx) $xout.= compactToString($xx);\n else $xout=$x;\n return $xout;\n}", "public function expression() {\n\t\t$ret = '';\n\t\t$first = true;\n\t\tforeach($this->children as $child) {\n\t\t\tif(!$first) {\n\t\t\t\t$ret .= '+';\n\t\t\t} else {\n\t\t\t\t$first = false;\n\t\t\t}\n\n\t\t\tif($this->precedence() > $child->precedence()) {\n\t\t\t\t$ret .= \"(\" . $child->expression() . \")\";\n\t\t\t} else {\n\t\t\t\t$ret .= $child->expression();\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function join()\n {\n $result = array();\n\n if (method_exists($this, 'convert')) {\n $data = $this->convert($this->_data);\n } else {\n $data = $this->_data;\n }\n\n foreach (array_filter($data, function($d) {\n if (is_bool($d) && $d == false) {\n return false;\n } elseif (is_null($d)) {\n return false;\n } else {\n return true;\n }\n }) as $key => $val) {\n $result[] = $this->format($key, $val);\n }\n\n return implode($this->_join, $result);\n }", "function __toString(){\n\t\tif( $this->is_terminal() ){\n\t\t\treturn parent::__toString();\n\t\t}\n\t\t$src = '';\n\t\tforeach( $this->children as $i => $Child ){\n\t\t\tif( $Child->is_terminal() ){\n\t\t\t\t$s = (string) $Child->value;\n\t\t\t\tswitch( $Child->t ){\n\t\t\t\t// these terminals will may or may not be followed by an identifier\n\t\t\t\t// but always by the next terminal in this node.\n\t\t\t\tcase J_FUNCTION:\n\t\t\t\tcase J_CONTINUE:\n\t\t\t\tcase J_BREAK;\n\t\t\t\t\t$identFollows = isset($this->children[$i+1]) && $this->children[$i+1]->is_symbol(J_IDENTIFIER);\n\t\t\t\t\t$identFollows and $s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals will always be followed by an idenfifer\n\t\t\t\tcase J_VAR:\n\t\t\t\t// these terminals are followed by a non terminal;\n\t\t\t\t// adding a space to be on the safe side.\n\t\t\t\tcase J_DO:\n\t\t\t\tcase J_ELSE:\n\t\t\t\tcase J_RETURN:\n\t\t\t\tcase J_CASE:\n\t\t\t\tcase J_THROW:\n\t\t\t\tcase J_NEW:\n\t\t\t\tcase J_DELETE:\n\t\t\t\tcase J_VOID:\n\t\t\t\tcase J_TYPEOF:\n\t\t\t\t\t$s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals require a space on either side\n\t\t\t\tcase J_IN:\n\t\t\t\tcase J_INSTANCEOF:\n\t\t\t\t\t$s = ' '.$s.' ';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// recursion into non-terminal\n\t\t\t\t$s = $Child->__toString();\n\t\t\t}\n\t\t\t$src .= $s;\n\t\t}\n\t\treturn $src;\n\t}", "public function __toString(){\n\t\treturn $this->combineElements();\n\t}", "public function flatten();", "public function flatten();", "public function flatten();", "function implode_assoc_r ($inner_glue = \"=\", $outer_glue = \"\\n\", $array = null, $keepOuterKey = false) {\n\t\t$output = array();\n\t\tforeach($array as $key => $item ) {\n\t\t\tif (is_array ($item)) {\n\t\t\t\tif ($keepOuterKey) {\n\t\t\t\t\t$output[] = $key;\n\t\t\t\t}\n\t\t\t\t$output[] = implode_assoc_r ($inner_glue, $outer_glue, $item, $keepOuterKey);\n\t\t\t} else {\n\t\t\t\t$output[] = $key . $inner_glue . $item;\n\t\t\t}\n\t\t}\n\t\treturn implode($outer_glue, $output);\n\t}", "public function outerXml() {\r\n return \"<![CDATA[\".$this->value().\"]]>\";\r\n }", "function concat(array|string $input, mixed ...$inputs): array|string\n{\n return is_array($input) ? array_concat($input, ...$inputs)\n : str_concat($input, ...$inputs);\n}" ]
[ "0.5389252", "0.5286378", "0.52118665", "0.49743757", "0.48592642", "0.4852583", "0.48211235", "0.47740927", "0.47665235", "0.47359192", "0.4700198", "0.46711838", "0.46688944", "0.4647517", "0.4642487", "0.4642487", "0.4624396", "0.46241966", "0.45794287", "0.45629406", "0.45393616", "0.4527592", "0.45136", "0.45123994", "0.45041555", "0.45041555", "0.45041555", "0.44951904", "0.44742715", "0.4470754" ]
0.5389728
0
this php unit contains main routines for scraping iTunesConnect sales reports
function process_sales($login, $options, $reptype) { global $last_http_headers; $appleid = $login["appleid"]; // function process_sales($sales_url, $appleid, $options, $reptype) { $reptype_l = strtolower($reptype); if (!is_dir(BASE_META_DIR."/salesreports") && !mkdir(BASE_META_DIR."/salesreports")) return error("couldn't access salrereports directory"); if (!is_dir(BASE_META_DIR."/salesreports/$appleid") && !mkdir(BASE_META_DIR."/salesreports/$appleid")) return error("couldn't access salrereports directory for appleid=$appleid"); if (!is_dir(BASE_META_DIR."/salesreports/$appleid/$reptype_l") && !mkdir(BASE_META_DIR."/salesreports/$appleid/$reptype_l")) return error("couldn't access salrereports $reptype_l directory for appleid=$appleid"); $filenames = array(); $attcnt = 0; if ($reptype_l=='daily') { $from = 0; $to = 30; } else { $from = 0; $to = 24; } $weekbeg = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - ((date('N')-1)*24*60*60) - 24*60*60; for ($i=$from;$i<$to;$i++) { if ($reptype_l=='daily') $dt = date("Ymd",time()-$i*24*60*60); else $dt = date("Ymd",$weekbeg-7*$i*24*60*60); $fntocheck = "S_".$reptype[0]."_".$login["vendorid"]."_$dt.txt"; echo("checkin report file $fntocheck... "); if (file_exists(BASE_META_DIR."salesreports/$appleid/$reptype_l/".$fntocheck)) { echo("report previously got. skipping \n"); continue; } echo("new report, getting\n"); echo("$reptype processing date $dt\n"); $postvars = array( "USERNAME"=>$login["appleid"], "PASSWORD"=>$login["password"], "VNDNUMBER"=>$login["vendorid"], "TYPEOFREPORT"=>"Sales", "DATETYPE"=>$reptype, "REPORTTYPE"=>"Summary", "REPORTDATE"=>$dt ); $res = getUrlContent("https://reportingitc.apple.com/autoingestion.tft?",$postvars,true); $filename = isset($last_http_headers["content-disposition"])?$last_http_headers["content-disposition"]:false; $ERRORMSG = isset($last_http_headers["ERRORMSG"])?$last_http_headers["ERRORMSG"]:false; if ($ERRORMSG) echo("ITC Error: $ERRORMSG\n"); echo("filename=$filename\n"); if (!$filename && $attcnt == 5) { if ($options["debug"]) echo("content-disposition http header not found. skipping this report\n"); continue; } $attcnt++; if(!$filename) continue; $ar = explode("=", $filename); $filename = $ar[1]; # Check for an override of the file name. If found then change the file # name to match the outputFormat. if ($options["outputFormat"]) $filename = date($options["outputFormat"], $downloadReportDate); $filebuffer = $res; $filename = BASE_META_DIR."salesreports/$appleid/$reptype_l/".$filename; if ($options["unzipFile"] && substr($filename, -3) == '.gz') #Chop off .gz extension if not needed $filename = substr($filename, 0, strlen($filename) - 3); if ($options["debug"]) echo("Saving download file: $filename\n"); file_put_contents($filename, $filebuffer); if ($options["unzipFile"]) { if ($options["debug"]) echo("unzipping report file\n"); $HandleRead = gzopen($filename, "rb"); $rest = substr($filebuffer, -4); $GZFileSize = end(unpack("V", $rest)); $report = gzread($HandleRead, $GZFileSize); gzclose($HandleRead); if (!$report) { warn("some problems with unzipping\n"); continue; } file_put_contents($filename, $report); if ($options["debug"]) echo("unzipping succeeded\n"); } $filenames[] = $filename; } return $filenames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrape() \n {\n\t\t$index = $this->curl_index();\n\t\t$check = preg_match('/id\\=\\\"\\_\\_VIEWSTATE\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\tif ($check)\n\t\t{\n\t\t\t$vs = $match[1];\n\t\t\t$check = preg_match('/id\\=\\\"\\_\\_EVENTVALIDATION\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\t$ev = $match[1];\n\t\t\t\t$search = '_'; // this search will return ALL \n\t\t\t\t$index = $this->curl_index($vs, $ev, $search);\n\t\t\t\t$flag = false;\n\t\t\t\t# need to handle paging here\n\t\t\t\tdo \n\t\t\t\t{\n\t\t\t\t\t# build booking_id array\n\t\t\t\t\t//echo $index;\n\t\t\t\t\t$check = preg_match_all('/btnNormal\\\"\\shref\\=\\\"(.*)\\\"/Uis', $index, $matches);\n\t\t\t\t\tif ( ! $check)\n\t\t\t\t\t\tbreak; // break paging loop\n\t\t\t\t\t$booking_ids = array();\n\t\t\t\t\tforeach($matches[1] as $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$booking_ids[] = preg_replace('/[^0-9]*/Uis', '', $match);\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($booking_ids))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($booking_ids as $booking_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$details = $this->curl_details($booking_id);\n\t\t\t\t\t\t\t$extraction = $this->extraction($details, $booking_id);\n\t\t\t if ($extraction == 100) { $this->report->successful = ($this->report->successful + 1); $this->report->update(); }\n\t if ($extraction == 101) { $this->report->other = ($this->report->other + 1); $this->report->update(); }\n\t if ($extraction == 102) { $this->report->bad_images = ($this->report->bad_images + 1); $this->report->update(); }\n\t if ($extraction == 103) { $this->report->exists = ($this->report->exists + 1); $this->report->update(); }\n\t if ($extraction == 104) { $this->report->new_charges = ($this->report->new_charges + 1); $this->report->update(); }\n\t $this->report->total = ($this->report->total + 1); $this->report->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { $flag = true; } // no more pages\n\t\t\t\t\t# need to page here\n\t\t\t\t\t$index = $this->curl_page($index);\n\t\t\t\t\tif($index == false) { $flag = true; }\n\t\t\t\t} while($flag == false);\n\t\t\t\t$this->report->failed = ($this->report->other + $this->report->bad_images + $this->report->exists + $this->report->new_charges);\n\t\t $this->report->finished = 1;\n\t\t $this->report->stop_time = time();\n\t\t $this->report->time_taken = ($this->report->stop_time - $this->report->start_time);\n\t\t $this->report->update();\n\t\t return true; \n\t\t\t} else { return false; } // no event validation found\n\t\t} else { return false; } // no viewstate found\n\t}", "abstract public function scrape();", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t){\n\t\t\t\t\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "function agregate_sales() {\n global $conn, $scrape_options;\n\n $dir = scandir(BASE_META_DIR);\n if (!$dir)\n return error(\"No apss were found.\\n\");\n\n $cnt = 0;\n $weekbeg = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - ((date('N')-1)*24*60*60);\n// echo(\"agregating apps \".implode(\",\",$app_ids).\"\\n\");\n foreach($dir as $f) {\n if (substr($f,0,4) != \"app_\") continue;\n// if (!$apple_id) continue;\n $app = file_get_contents(BASE_META_DIR.\"$f/appmeta.dat\");\n if (!$app) continue;\n $app = unserialize($app);\n if (!$app) continue;\n $apple_id = $app[\"apple_id\"];\n\n if ($scrape_options[\"debug\"])\n echo(\"agregating stats for apple_id=$apple_id\\n\");\n\n $res = execSQL($conn, \"\nselect\n(select max(BeginDate) from itc_sales where AppleIdentifier=:apple_id) as stat_max_report_date,\n(select min(BeginDate) from itc_sales where AppleIdentifier=:apple_id) as stat_min_report_date,\n(select sum(units) from itc_sales where AppleIdentifier=:apple_id and BeginDate= EndDate and BeginDate = ifnull((select max(BeginDate) from itc_sales where AppleIdentifier=:apple_id), 0) group by AppleIdentifier) stat_last_day,\n(select sum(units) from itc_sales where AppleIdentifier=:apple_id and BeginDate<>EndDate and BeginDate > $weekbeg - 30 * 24 * 60 * 60 and EndDate<$weekbeg group by AppleIdentifier) stat_last_month,\n(select sum(units) from itc_sales where AppleIdentifier=:apple_id and (BeginDate<>EndDate or (BeginDate=EndDate and BeginDate>=$weekbeg)) group by AppleIdentifier) stat_whole_period\nfrom\ndual \n \", array(\":apple_id\"=>$apple_id));\n if (!$res) {\n echo(\"some problems with performing sql request. skipping\\n\");\n continue;\n }\n $row=$res->fetch(PDO::FETCH_ASSOC);\n if (!$row) {\n echo(\"no data has been returned\\n\");\n continue;\n }\n $app[\"stat_max_report_date\"] = $row[\"stat_max_report_date\"];\n $app[\"stat_min_report_date\"] = $row[\"stat_min_report_date\"];\n $app[\"stat_last_day\"] = $row[\"stat_last_day\"];\n $app[\"stat_last_month\"] = $row[\"stat_last_month\"];\n $app[\"stat_whole_period\"] = $row[\"stat_whole_period\"];\n $cont = serialize($app);\n if (!$cont) {\n echo(\"some problems with serializing app data: \". json_encode($app).\"\\n skipping\");\n continue;\n }\n if (!file_put_contents(BASE_META_DIR.\"$f/appmeta.dat\", $cont))\n echo(\"some problems with writing serialized data\\n\");\n }\n}", "public function parse_inventory_from_web() {\n require_once BASEPATH . 'phpQuery/phpQuery.php';\n log_message('debug', 'START parse_inventory_from_web');\n\n $dayAgo = date(DOCTRINE_DATE_FORMAT, (time() - (3600 * 12)));\n $settings = ManagerHolder::get('StoreInventoryParserSetting')->getAllWhere(array('last_parse_at<' => $dayAgo, 'url<>' => ''), 'e.*,store.*', 200);\n\n foreach ($settings as $setting) {\n $webPage = $this->getWebPage($setting['url']);\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_http_code', $webPage['header']['http_code']);\n\n $markup = $webPage['result'];\n\n if ($setting['store']['code'] == 'Magbaby') {\n if (strpos($markup, '<span class=\"b-product__state b-product__state_type_available\">В наличии</span>') !== FALSE) {\n $qty = 10;\n } else {\n $qty = 0;\n }\n if (!empty($setting['product_group_id'])) {\n $productGroup = ManagerHolder::get('ParameterGroup')->getById($setting['product_group_id'], 'bar_code');\n $barCode = $productGroup['bar_code'];\n } else {\n $product = ManagerHolder::get('Product')->getById($setting['product_id'], 'bar_code');\n $barCode = $product['bar_code'];\n }\n\n $where = array('product_id' => $setting['product_id'], 'bar_code' => $barCode, 'store_id' => $setting['store_id']);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = $qty;\n if (!empty($setting['product_group_id'])) {\n $entity['product_group_id'] = $productGroup['id'];\n }\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_parse_at', date(DOCTRINE_DATE_FORMAT));\n }\n\n if ($setting['store']['code'] == 'i-love-mum') {\n $markup = file_get_contents($setting['url']);\n\n $params = array();\n if (strpos($markup, '<li>Доступность: На складе</li>') !== FALSE) {\n @phpQuery::newDocumentHTML($markup);\n\n foreach(pq('h3:contains(Доступные опции)')->next('div')->find('div:first > div') as $item) {\n // print pq($item)->html();\n // print \"\\n\";\n\n $param = pq($item)->find('label')->text();\n $param = trim($param);\n $param = ManagerHolder::get('ParameterValue')->getOneWhere(array('name' => $param), 'e.*');\n\n $value = pq($item)->find('label')->attr('title');\n $value = trim($value);\n if ($value == 'нет в наличии') {\n $qty = 0;\n } else {\n preg_match(\"/в наличии ([0-9]*) шт./\", $value, $mch);\n $qty = $mch[1];\n }\n\n $params[$param['id']] = $qty;\n }\n } else {\n $productGroups = ManagerHolder::get('ParameterGroup')->getAllWhere(array('product_id' => $setting['product_id']), 'main_parameter_value_id');\n foreach ($productGroups as $pg) {\n $params[$pg['main_parameter_value_id']] = 0;\n }\n }\n\n ManagerHolder::get('StoreInventory')->updateAllWhere(array('product_id' => $setting['product_id'], 'store_id' => $setting['store_id']), array('qty' => 0));\n foreach ($params as $paramId => $qty) {\n $productGroup = ManagerHolder::get('ParameterGroup')->getOneWhere(array('product_id' => $setting['product_id'], 'main_parameter_value_id' => $paramId), 'bar_code');\n if (!$productGroup) {\n continue;\n }\n\n $where = array('product_id' => $setting['product_id'], 'bar_code' => $productGroup['bar_code'], 'store_id' => $setting['store_id']);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = $qty;\n $entity['product_group_id'] = $productGroup['id'];\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_parse_at', date(DOCTRINE_DATE_FORMAT));\n }\n }\n sleep(rand(1,3));\n }\n\n ManagerHolder::get('StoreInventory')->updateProductStatuses();\n log_message('debug', 'FINISH parse_inventory_from_web');\n }", "public function __construct() {\n\t\ttry {\n\t\t\t// Construct an array with predefined date(s) which we will use to run a report\n\n\t\t\t$lastDay = intval(date(\"t\", strtotime(\"-1 month\")));\n\t\t\t$previousMonth = intval(date(\"m\", strtotime(\"-1 month\")));\n\t\t\t// Set variables\n\t\t\t$all = (array)array();\n\t\t\t$this->setFileName(self::DOC_FILE_NAME .date(\"-Y-m\", strtotime(\"-1 month\")));\n\t\t\t$this->setExcelFile(\"/export/\" . $this->getFileName());\n\t\t\tfor($i = 1; $i <= $lastDay; $i++) {\n\t\t\t\tif ($i == $lastDay) {\n\t\t\t\t\t$d = 1; $m = $previousMonth + 1;\n\t\t\t\t} else {\n\t\t\t\t\t$d = ($i + 1); $m = $previousMonth;\n\t\t\t\t}\n\t\t\t\t$reportData = array(date(\"Y-m-\" . strval($i) . \" 00:00:00\", strtotime(\"-1 month\")), date(\"Y-\" . strval($m) . \"-\" . strval($d) . \" 00:00:00\"));\n\t\t\t\t$reportUrl = $this->getApiUrl().\"report=\" . strval(self::REPORT_NUMBER) . \"&responseFormat=csv&Start_Date=\" . $reportData[0] . \"&Stop_Date=\" . $reportData[1] . \"&Business_Unit=1,4\";\n\t\t\t\t// Clean out whitespace characters and replace with %20\n\t\t\t\t$reportUrl = str_replace(\" \", \"%20\", $reportUrl);\n\t\t\t\t$fileParser = new FileParser($reportUrl);\n\t\t\t\t$fileParser->setCurlFile($this->getFileName() . \".csv\");\n\t\t\t\t$data = $fileParser->parseFile();\n\t\t\t\t$all[] = $data;\n\t\t\t\tprint(\".\");\n\t\t\t}\n\t\t\tprint(PHP_EOL);\n\t\t\t$this->writeExcelFile(dirname(__FILE__) . $this->getExcelFile() . \".xlsx\", $all, self::REPORT_NAME . date(\" Y-m\", strtotime(\"-1 month\")));\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\techo \"Caught exception: \", $e->getMessage(), \"\\n\";\n\t\t\texit;\n\t\t}\n\t}", "abstract public function scrape(): Result;", "function scrapePtpReport() {\n $labResource = \"http://mws.lab916.space/src/MarketplaceWebService/api/ptp-report.php\";\n $report1 = file_get_contents($labResource);\n $explode1 = explode('<h2>Report Contents</h2>', $report1);\n $cells = explode(\"\\t\", $explode1[1]);\n sleep(4); // give the report data a while to stream since report may be a very large str\n $amazonRowsFbaClean = [];\n $table = [];\n $row = 0;\n $curRow = [];\n $idx = 0;\n\n // convert $cells to rows, each row is delimited by \\r\\n, currently there are thousands of cells because\n // they were all delimited by \\t\n for ($i = 0; $i < count($cells); $i++) {\n $cel = $cells[$i];\n if (strpos($cel, \"\\r\\n\") !== false) {\n // there is a new line char in this cel\n $newRowAR = explode(\"\\r\\n\", $cel);\n array_push($curRow, $newRowAR[0]);\n $table[$row] = $curRow;\n $curRow = [];\n $row++;\n $table[$row] = $curRow;\n array_push($curRow, $newRowAR[1]);\n } else {\n array_push($curRow, $cel);\n }\n }\n\n // sanitize each field in each row, get rid of fields that have gunk.\n for ($i = 0; $i < count($table); $i++) {\n $tempA = array();\n // O (n^2) <-------------------------------------------xx\n foreach ($table[$i] as $record) {\n if ((str_word_count($record) > 0) or (1 === preg_match('~[0-9]~', $record))) {\n $tempA[$idx] = $record;\n }\n $idx++;\n }\n $amazonRowsFbaClean[$i] = $tempA;\n $idx = 0;\n }\n\n return $amazonRowsFbaClean;\n}", "function getProduct($u){\n global $baseurl, $o, $r, $i, $local;\n $path = \"\";\n $d = new simple_html_dom();\n $d->load(scraperwiki::scrape($u));\n if (is_null($d->find('div[id=medproimg]',0))) {\n return 0;\n }\n//echo \"Loaded URL: \" . $u . \"\\n\";\n $imgfileurl = $d->find('div[id=medproimg]',0)->first_child()->href;\n $imgfile = trim(strrchr($imgfileurl,\"/\"),\"/ \");\n $img = \"/\" . substr($imgfile,0,1) . \"/\" . substr($imgfile,1,1) . \"/\" . $imgfile;\n fputcsv($i,array($imgfileurl,$img));\n $catname = \"\";\n $cats = $d->find('div[id=breadcrumb] ul li a');\n foreach ($cats as $cat) {\n $catname .= trim($cat->innertext) . \"/\";\n }\n $catname .= trim($d->find('div[id=breadcrumb] ul a b',0)->innertext);\n if (!is_null($d->find('div[id=prospecsbox]',0))) {\n $description = $d->find('div[id=prospecsbox]',0)->outertext;\n } else {\n $description = \"\";\n }\n if (!is_null($d->find('div[id=ctl00_cphContent_divShippingBilling]',0))) {\n $description .= $d->find('div[id=ctl00_cphContent_divShippingBilling]',0)->outertext;\n }\n if (!is_null($d->find('span[id=ctl00_cphContent_hidebrandid]',0))) {\n $brand = trim($d->find('span[id=ctl00_cphContent_hidebrandid]',0)->first_child()->innertext);\n } else {\n $brand = \"\";\n }\n $data = array(\n trim($d->find('span[id=pskuonly]',0)->innertext),\n \"\",\n \"Default\",\n \"simple\",\n $catname,\n \"Home\",\n \"base\",\n \"12/12/15 22:48\",\n $description,\n \"No\",\n 0,\n $img,\n $brand,\n \"\",\n \"Use config\",\n \"Use config\",\n trim($d->find('div[id=productname]',0)->first_child()->innertext),\n \"Product Info Column\",\n \"1 column\",\n trim($d->find('div[id=proprice]',0)->first_child()->innertext,\"$ \"),\n 0,\n \"\",\n $img,\n 1,\n 2,\n $img,\n \"12/12/15 22:48\",\n \"\",\n \"\",\n 4,\n 1.0000,\n 0,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0,\n 0,\n 88,\n $img,\n $d->find('div[id=medproimg]',0)->first_child()->title,\n 1,\n 0 \n );\n fputcsv($o,$data);\n $thumbs = $d->find('div[id=altvidthmbs] thmbs');\n if (count($thumbs) > 1) {\n for ($x = 0; $x <= (count($thumbs) - 2); $x++) {\n $imgfileurl = $thumbs[$x]->first_child()->href;\n $imgfile = trim(strrchr($imgfileurl,\"/\"),\"/ \");\n $img = \"/\" . substr($imgfile,0,1) . \"/\" . substr($imgfile,1,1) . \"/\" . $imgfile;\n fputcsv($i,array($imgfileurl,$img));\n $data = array(\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"88\",\n $img,\n $thumbs[$x]->first_child()->title,\n ($x + 2),\n 0\n );\n fputcsv($o,$data);\n }\n }\n $reviews = $d->find('table[id=ctl00_cphContent_datalistReviews] div.pr-review-wrap');\n if (count($reviews) > 0) {\n foreach ($reviews as $rev) {\n $data = array(\n trim($d->find('span[id=pskuonly]',0)->innertext),\n trim($rev->find('p.pr-review-rating-headline span',0)->innertext),\n trim($rev->find('span.pr-rating',0)->innertext),\n trim($rev->find('span[id$=labelUser]',0)->innertext),\n trim($rev->find('span[id$=labelLocation]',0)->innertext),\n trim($rev->find('div.pr-review-author-date',0)->innertext),\n trim($rev->find('span[id$=labelComments]',0)->innertext)\n );\n fputcsv($r,$data);\n }\n }\n echo trim($d->find('div[id=productname]',0)->first_child()->innertext) . \"\\n\";\n return 1;\n}", "public function reportRe()\n{\n print_r($this->requestReport(\n \"campaigns\",\n array(\"reportDate\" => \"20190501\",\n \"campaignType\" => \"sponsoredProducts\",\n \"metrics\" => \"impressions,clicks,cost\")));\n\n // amzn1.clicksAPI.v1.m1.5CD444B4.e3c2f999-14b0-4385-bf71-41f8538f712a\n \n \n}", "public function testReportsSkillv1reportsbench()\n {\n\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(Storage::get('url.txt'));\n // $browser->pause(5000);\n try{\n $browser->click('.close-layer');\n $browser->pause(5000);\n }\n catch(Exception $e){\n \n }\n \n try{\n $browser->click('#j-shipping-company');\n $browser->pause(5000);\n $elements = $browser->elements('#j-shipping-dialog');\n foreach ($elements as $element) {\n $data[] = $element->getAttribute('innerHTML');\n }\n Storage::put('data.txt',$data);\n \n }\n catch(Exception $e){\n //$this->data = $e;\n }\n });\n }", "public function testReportsSummaryGet()\n {\n }", "function getReport() ;", "public function importmagento() {\n error_reporting(E_ALL); ini_set('display_errors', 1);\n\n $base_url=\"http://myshoes.fastcomet.host/Magentos/\";\n //API user\n $api_user=\"apiuser\";\n //API key\n $api_key=\"81eRvINu9r\";\n\n\n $api_url=$base_url.'index.php/api/soap/?wsdl';\n $client = new SoapClient($api_url);\n $session = $client->login($api_user, $api_key);\n $result = $client->call($session, 'order.list');\n $j=0;\n\n\n foreach($result as $key => $value)\n {\n $result1 = $client->call($session, 'order.info', $result[$key]['increment_id']);\n $arr[$j]['Order']['external_orderid'] = $result[$key]['increment_id'];\n $arr[$j]['Order']['schannel_id']= 'Magento';\n $arr[$j]['Order']['shipping_costs']= number_format((float)$result[$key]['base_shipping_amount'], 2, '.', '');\n $arr[$j]['Order']['requested_delivery_date'] ='';\n $arr[$j]['Order']['currency'] =$result[$key]['order_currency_code'];\n $arr[$j]['Order']['remarks'] =$result[$key]['customer_note'];\n $arr[$j]['Order']['createdinsource'] =$result[$key]['created_at'];\n $arr[$j]['Order']['modifiedinsource'] =$result[$key]['updated_at'];\n $arr[$j]['Order']['ship_to_customerid'] = $result[$key]['customer_firstname'].\" \".$result[$key]['customer_lastname'];\n $arr[$j]['Order']['ship_to_city'] =$result[$key]['customer_email'];\n $arr[$j]['Order']['ship_to_street'] =$result1['shipping_address']['street'];\n $arr[$j]['Order']['ship_to_city'] =$result1['shipping_address']['city'];\n $arr[$j]['Order']['ship_to_zip'] =$result1['shipping_address']['postcode'];\n $arr[$j]['Order']['ship_to_stateprovince'] = '';\n $arr[$j]['Order']['state_id'] = '';\n $arr[$j]['Order']['country_id'] =$result1['shipping_address']['country_id'];\n\n $arr[$j]['OrdersLine']=[];\n $adr=$result1['items'];\n $i=0;\n foreach( $adr as $keys => $values){\n $sk =$adr[$keys]['sku'];\n $qo=$adr[$keys]['qty_ordered'];\n $up=$adr[$keys]['price'];\n $arr[$j]['OrdersLine'][$i]['line_number'] = ($i+1) * 10;\n $arr[$j]['OrdersLine'][$i]['sku'] =$sk;\n $arr[$j]['OrdersLine'][$i]['quantity'] = number_format((float)$qo, 2, '.', '');\n $arr[$j]['OrdersLine'][$i]['unit_price'] = number_format((float)$up, 2, '.', '');\n\n $i++;\n }\n $j++;\n }\n $this->importcsv(null,$arr);\n return $this->redirect(array('action' => 'index',1));\n\n }", "abstract public function extractReportDatas();", "function import_wpxrss() {\n $dry_run = false;\n\n $serendipity['noautodiscovery'] = 1;\n $uri = $this->data['url'];\n require_once S9Y_PEAR_PATH . 'HTTP/Request2.php';\n serendipity_request_start();\n $options = array('follow_redirects' => true, 'max_redirects' => 5);\n if (version_compare(PHP_VERSION, '5.6.0', '<')) {\n // On earlier PHP versions, the certificate validation fails. We deactivate it on them to restore the functionality we had with HTTP/Request1\n $options['ssl_verify_peer'] = false;\n }\n $req = new HTTP_Request2($uri, HTTP_Request2::METHOD_GET, $options);\n try {\n $res = $req->send();\n if ($res->getStatus() != '200') {\n throw new HTTP_Request2_Exception('could not fetch url: status != 200');\n }\n } catch (HTTP_Request2_Exception $e) {\n serendipity_request_end();\n echo '<span class=\"block_level\">' . IMPORT_FAILED . ': ' . serendipity_specialchars($this->data['url']) . '</span>';\n return false;\n }\n\n $fContent = $res->getBody();\n serendipity_request_end();\n echo '<span class=\"block_level\">' . strlen($fContent) . \" Bytes</span>\";\n\n if (version_compare(PHP_VERSION, '5.0') === -1) {\n echo '<span class=\"block_level\">';\n printf(UNMET_REQUIREMENTS, 'PHP >= 5.0');\n echo \"</span>\";\n return false;\n }\n\n $xml = simplexml_load_string($fContent);\n unset($fContent);\n\n\n /* ************* USERS **********************/\n $_s9y_users = serendipity_fetchUsers();\n $s9y_users = array();\n if (is_array($s9y_users)) {\n foreach ($_s9y_users as $v) {\n $s9y_users[$v['realname']] = $v;\n }\n }\n\n /* ************* CATEGORIES **********************/\n $_s9y_cat = serendipity_fetchCategories('all');\n $s9y_cat = array();\n if (is_array($s9y_cat)) {\n foreach ($_s9y_cat as $v) {\n $s9y_cat[$v['category_name']] = $v['categoryid'];\n }\n }\n\n $wp_ns = 'http://wordpress.org/export/1.0/';\n $dc_ns = 'http://purl.org/dc/elements/1.1/';\n $content_ns = 'http://purl.org/rss/1.0/modules/content/';\n\n $wp_core = $xml->channel->children($wp_ns);\n foreach($wp_core->category AS $idx => $cat) {\n //TODO: Parent generation unknown.\n $cat_name = (string)$cat->cat_name;\n if (!isset($s9y_cat[$cat_name])) {\n $cat = array('category_name' => $cat_name,\n 'category_description' => '',\n 'parentid' => 0,\n 'category_left' => 0,\n 'category_right' => 0);\n echo '<span class=\"block_level\">';\n printf(CREATE_CATEGORY, serendipity_specialchars($cat_name));\n echo \"</span>\";\n if ($dry_run) {\n $s9y_cat[$cat_name] = time();\n } else {\n serendipity_db_insert('category', $cat);\n $s9y_cat[$cat_name] = serendipity_db_insert_id('category', 'categoryid');\n }\n }\n }\n\n /* ************* ITEMS **********************/\n foreach($xml->channel->item AS $idx => $item) {\n $wp_items = $item->children($wp_ns);\n $dc_items = $item->children($dc_ns);\n $content_items = $item->children($content_ns);\n\n // TODO: Attachments not handled\n if ((string)$wp_items->post_type == 'attachment' OR (string)$wp_items->post_type == 'page') {\n continue;\n }\n\n $entry = array(\n 'title' => (string)$item->title,\n 'isdraft' => ((string)$wp_items->status == 'publish' ? 'false' : 'true'),\n 'allow_comments' => ((string)$wp_items->comment_status == 'open' ? true : false),\n 'categories' => array(),\n 'body' => (string)$content_items->encoded\n );\n\n if (preg_match('@^([0-9]{4})\\-([0-9]{2})\\-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$@', (string)$wp_items->post_date, $timematch)) {\n $entry['timestamp'] = mktime($timematch[4], $timematch[5], $timematch[6], $timematch[2], $timematch[3], $timematch[1]);\n } else {\n $entry['timestamp'] = time();\n }\n\n if (isset($item->category[1])) {\n foreach($item->category AS $idx => $category) {\n $cstring=(string)$category;\n if (!isset($s9y_cat[$cstring])) {\n echo \"<span class='msg_error'>WARNING: $category unset!</span>\";\n } else {\n $entry['categories'][] = $s9y_cat[$cstring];\n }\n }\n } else {\n $cstring = (string)$item->category;\n $entry['categories'][] = $s9y_cat[$cstring];\n }\n\n $wp_user = (string)$dc_items->creator;\n if (!isset($s9y_users[$wp_user])) {\n if ($dry_run) {\n $s9y_users[$wp_user]['authorid'] = time();\n } else {\n $s9y_users[$wp_user]['authorid'] = serendipity_addAuthor($wp_user, md5(time()), $wp_user, '', USERLEVEL_EDITOR);\n }\n echo '<span class=\"block_level\">';\n printf(CREATE_AUTHOR, serendipity_specialchars($wp_user));\n echo \"</span>\";\n }\n\n $entry['authorid'] = $s9y_users[$wp_user]['authorid'];\n\n if ($dry_run) {\n $id = time();\n } else {\n $id = serendipity_updertEntry($entry);\n }\n\n $s9y_cid = array(); // Holds comment ids to s9y ids association.\n $c_i = 0;\n foreach($wp_items->comment AS $comment) {\n $c_i++;\n $c_id = (string)$comment->comment_id;\n $c_pid = (string)$comment->comment_parent;\n $c_type = (string)$comment->comment_type;\n if ($c_type == 'pingback') {\n $c_type2 = 'PINGBACK';\n } elseif ($c_type == 'trackback') {\n $c_type2 = 'TRACKBACK';\n } else {\n $c_type2 = 'NORMAL';\n }\n\n $s9y_comment = array('entry_id ' => $id,\n 'parent_id' => $s9y_cid[$c_pd],\n 'author' => (string)$comment->comment_author,\n 'email' => (string)$comment->comment_author_email,\n 'url' => (string)$comment->comment_author_url,\n 'ip' => (string)$comment->comment_author_IP,\n 'status' => (empty($comment->comment_approved) || $comment->comment_approved == '1') ? 'approved' : 'pending',\n 'subscribed'=> 'false',\n 'body' => (string)$comment->comment_content,\n 'type' => $c_type2);\n\n if (preg_match('@^([0-9]{4})\\-([0-9]{2})\\-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$@', (string)$comment->comment_date, $timematch)) {\n $s9y_comment['timestamp'] = mktime($timematch[4], $timematch[5], $timematch[6], $timematch[2], $timematch[3], $timematch[1]);\n } else {\n $s9y_comment['timestamp'] = time();\n }\n\n if ($dry_run) {\n $cid = time();\n } else {\n serendipity_db_insert('comments', $s9y_comment);\n $cid = serendipity_db_insert_id('comments', 'id');\n if ($s9y_comment['status'] == 'approved') {\n serendipity_approveComment($cid, $id, true);\n }\n }\n $s9y_cid[$c_id] = $cid;\n }\n\n echo \"<span class='msg_notice'>Entry '\" . serendipity_specialchars($entry['title']) . \"' ($c_i comments) imported.</span>\";\n }\n return true;\n }", "public function index()\n {\n /*\n $helper = new Helper();\n \n $url = \"https://zotterdev.developer.at/?type=2289002\";\n $maxOrderNumber = OrderImportTracker::max('order_number');\n $start = 1;\n if((int)$maxOrderNumber > 0) {\n $start = $maxOrderNumber;\n $url = \"https://zotterdev.developer.at/?type=2289002&tx_devshopfeed_xmlfeed[ordernumber]=\".$start.\"&tx_devshopfeed_xmlfeed[limitorders]=10000\";\n } else {\n $url = \"https://zotterdev.developer.at/?type=2289002&tx_devshopfeed_xmlfeed[ordernumber]=\".$start.\"&tx_devshopfeed_xmlfeed[limitorders]=10000\";\n }\n $result = $helper->consumeAPIClient($url, true); // for XML REST\n if($result) {\n $result = $helper->importOrderTracker($result); // store ORDERS for import\n }\n\n\n OrderImportTracker::where('import_status', 0)->chunk(100, function($orders) {\n $h = new Helper();\n foreach ($orders as $order) {\n $url = \"https://zotterdev.developer.at/rest/shop_item/\".$order['uid'];\n $result = $h->consumeAPIClient($url, false); // for REST\n if($result) {\n sleep(1);\n $result = $h->importOrderByUID($result, $order['id']); // import ORDER\n }\n }\n });\n */\n\n }", "static public function get($session)\n{\n $receipt = ReceiptLib::biggerFont(\"Transaction Summary\").\"\\n\\n\";\n $receipt .= ReceiptLib::biggerFont(date('D M j Y - g:ia')).\"\\n\\n\";\n\t$report_params = array();\n\n\t$lane_db = Database::tDataConnect();\n if ($lane_db->isConnected('core_translog')) {\n\t $this_lane = $session->get('laneno');\n\t\t$transarchive = 'localtranstoday';\n\t\t$opdata_dbname = 'core_opdata';\n\t\t$report_params += array(\n\t\t\t\"Lane {$this_lane} tender\" => \"\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t'Lane {$this_lane} tenders' Plural,\n\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\tt.TenderName GroupLabel,\n\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.tenders t ON d.trans_subtype = t.TenderCode\n\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\tAND d.trans_type = 'T'\n\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\tGROUP BY t.tenderName\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tFIELD(d.trans_subtype, 'CA', 'CK', 'CC', 'DC', 'EF', d.trans_subtype),\n\t\t\t\t\t\td.trans_subtype\n\t\t\t\t\",\n\t\t\t);\n\t}\n\n\tif ($this_lane > 1) {\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= \"Printing lane data only.\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\t\t$receipt .= \"\\n\";\n\n\t\t$office_db = Database::tDataConnect();\n\t\t$office_dbname = $session->get('tDatabase'); //'lane';\n\t\t$transarchive = 'localtrans';\n\t\t$opdata_dbname = 'core_opdata';\n\t}\n\telse {\n\t\t$office_host = $session->get('mServer');\n\t\t$office_ping = shell_exec(\"ping -q -t2 -c3 {$office_host}\");\n\t\t$office_live = (preg_match('~0 packets received~', $office_ping)? false : true);\n\n\t\tif ($office_live) {\n\t\t\t$office_db = Database::mDataConnect();\n\t\t\tif (!$office_db->isConnected($session->get('mDatabase'))) {\n\t\t\t\t$office_live = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($office_live) {\n\t\t\t$office_dbname = $session->get('mDatabase'); //'office';\n\t\t\t$transarchive = 'dtransactions';\n\t\t\t$opdata_dbname = 'office_opdata';\n\t\t}\n\t\telse {\n\t\t\t$receipt .= \"\\n\";\n\t\t\t$receipt .= ReceiptLib::boldFont();\n\t\t\t$receipt .= \"Server is unavailable; printing lane data only.\";\n\t\t\t$receipt .= ReceiptLib::normalFont();\n\t\t\t$receipt .= \"\\n\";\n\n\t\t\t$office_db = Database::tDataConnect();\n\t\t\t$office_dbname = $session->get('tDatabase'); //'lane';\n\t\t\t$transarchive = 'localtrans';\n\t\t\t$opdata_dbname = 'core_opdata';\n\t\t}\n\n\t\t$report_params += array(\n\t\t\t'department' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'departments' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tCONCAT_WS(' ', t.dept_no, t.dept_name) GroupLabel,\n\t\t\t\t\t\t\tSUM(IF(d.department IN (102, 113) OR d.scale = 1, 1, d.quantity)) GroupQuantity,\n\t\t\t\t\t\t\t'item' GroupQuantityLabel,\n\t\t\t\t\t\t\tSUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.departments t ON d.department=t.dept_no\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.department != 0\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY t.dept_no\n\t\t\t\t\t\",\n\t\t\t'tax' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'taxes' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tIF(d.total = 0, 'Non-taxed', 'Taxed') GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\tSUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'A' AND d.upc = 'TAX'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY (total = 0)\n\t\t\t\t\t\",\n\t\t\t'discount' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'discounts' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tCONCAT(d.percentDiscount, '%') GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'S' AND d.upc = 'DISCOUNT'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY percentDiscount\n\t\t\t\t\t\",\n\t\t\t'tender' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'tenders' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tt.TenderName GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.tenders t ON d.trans_subtype = t.TenderCode\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'T'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY t.tenderName\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\tFIELD(d.trans_subtype, 'CA', 'CK', 'CC', 'DC', 'EF', d.trans_subtype),\n\t\t\t\t\t\t\td.trans_subtype\n\t\t\t\t\t\",\n\t\t\t);\n\t}\n\n\tforeach ($report_params as $report => $query) {\n\t\t$receipt .= \"\\n\";\n\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= ReceiptLib::centerString(ucwords($report).' Report').\"\\n\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\n\t\t$result = $office_db->query($query);\n\t\tif (!$result) $result = $lane_db->query($query);\n\n\t\t$total_quantity = $total_value = 0;\n\t\t$plural = $group_label = $group_quantity = $group_quantity_label = $group_value = '';\n\n\t\twhile ($row = $office_db->fetchRow($result)) {\n\t\t\t$plural = $row['Plural'];\n\t\t\t$group_label = $row['GroupLabel'];\n\t\t\t$group_quantity = $row['GroupQuantity'];\n\t\t\t$group_quantity_label = $row['GroupQuantityLabel'];\n\t\t\t$group_value = $row['GroupValue'];\n\n\t\t\t$total_quantity += $group_quantity;\n\t\t\t$total_value += $group_value;\n\n\t\t\t$group_quantity = rtrim(number_format($group_quantity, 3), '.0');\n\t\t\t$group_value = number_format($group_value, 2);\n\n\t\t\t$receipt .= ReceiptLib::boldFont();\n\t\t\t$receipt .= \"{$group_label}: \";\n\t\t\t$receipt .= ReceiptLib::normalFont();\n\t\t\t$receipt .= \"\\${$group_value} from {$group_quantity} {$group_quantity_label}\".($group_quantity==1?'':'s').\"\\n\";\n\t\t}\n\t\tswitch ($report) {\n\t\t\tcase 'department':\n\t\t\tcase 'tax':\n\t\t\tcase 'discount':\n\t\t\tcase 'tender':\n\t\t\t\t$total_values[$report] = $total_value;\n\t\t\tdefault:\n\t\t}\n\n\t\t$total_quantity = rtrim(number_format($total_quantity, 3), '.0');\n\t\t$total_value = number_format($total_value, 2);\n\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\tif ($plural) {\n\t\t\t$receipt .= \"All \".ucwords($plural).\": \\${$total_value} from {$total_quantity} {$group_quantity_label}\".($total_quantity==1?'':'s').\"\\n\";\n\t\t}\n\t\telse {\n\t\t\t$receipt .= \"No data match in {$office_dbname}.{$transarchive}\\n\";\n\t\t}\n\t\t$receipt .= ReceiptLib::normalFont();\n\t}\n\n\t$checksum = 0;\n\t$receipt .= \"\\n\";\n\tforeach ($total_values as $report => $total_value) {\n\t\tswitch ($report) {\n\t\t\tcase 'department':\n\t\t\tcase 'tax':\n\t\t\t\t$sign = +1;\n\t\t\t\tbreak;\n\t\t\tcase 'discount':\n\t\t\tcase 'tender':\n\t\t\t\t$sign = -1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t$checksum += ($sign * $total_value);\n\t\t$total_value = number_format($total_value, 2);\n\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 8);\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= ucwords($report).' Total:';\n\t\t$receipt .= ReceiptLib::normalFont();\n\t\t$receipt .= str_repeat(' ', 32 - strlen(\"{$report}{$total_value}\"));\n\t\t$receipt .= ($sign < 0? '-' : '+') . \" \\${$total_value}\";\n\t}\n\tif ($sign) {\n\t\t$checksum = number_format($checksum, 2);\n\t\tif ($checksum === '-0.00') $checksum = '0.00'; // remove possible floating point sign error\n\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 38);\n\t\t$receipt .= str_repeat('_', 14);\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 8);\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= 'Checksum (should be zero):';\n\t\t$receipt .= str_repeat(' ', 15 - strlen(\"{$checksum}\"));\n\t\t$receipt .= \"\\${$checksum}\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\t}\n\n $receipt .= \"\\n\";\n $receipt .= \"\\n\";\n $receipt .= ReceiptLib::centerString(\"------------------------------------------------------\");\n $receipt .= \"\\n\";\n\n $receipt .= str_repeat(\"\\n\", 4);\n $receipt .= chr(27).chr(105); // cut\n return $receipt;\n}", "public function sandbox() {\n $reference = 'http://www.trade.bookclub.ua/books/product.html?id=46736';\n @$html = file_get_contents($reference);\n if (empty($html)) {\n dd('fail load reference page');\n }\n\n $dom = new \\DOMDocument();\n @$dom->loadHTML($html);\n $xpath = new \\DOMXpath($dom);\n\n $node = $xpath->query('//div[@class=\"goods-descrp\"]');\n if (count($node)) {\n $book['description'] = (nl2br(trim($node[0]->nodeValue)));\n }\n\n //params\n// $node = $xpath->query('//ul[@class=\"goods-short\"]');\n// $pars = nl2br($node[0]->nodeValue);\n// $book['details']['']\\App\\Import\\Ksd::extract($pars, 'Вес:', '<br');\n\n //image\n $node = $xpath->query('//div[@class=\"goods-image\"]');\n if (count($node)) {\n $img = $node[0]->getElementsByTagName('img');\n if (count($img)) {\n $src = str_replace('/b/', '/', $img[0]->getAttribute('src'));\n $src = str_replace('_b.', '.', $src);\n }\n }\n\n // Author\n $node = $xpath->query('//div[@class=\"autor-text-color\"]');\n if (count($node)) {\n $name = trim($node[0]->getElementsByTagName('h2')[0]->nodeValue);\n $descr = trim($node[0]->getElementsByTagName('p')[0]->nodeValue);\n }\n\n $node = $xpath->query('//div[@class=\"autor-image\"]');\n if (count($node)) {\n $img = $node[0]->getElementsByTagName('img');\n if (count($img)) {\n $src = $img[0]->getAttribute('src');\n dd($src);\n }\n }\n }", "public function run()\n {\n //\n\n //allocations\n //requestbooks\n\n \t$aysems = [];\n for($i=2010; $i <= 2016; $i++) { \n\n for ($j=1; $j < 3; $j++) { \n \t$aysem = $i*10 +$j;\n\n \t$this->allocate($aysem, rand(800000,1000000));\n \t$this->purchase($aysem,3);\n }\n }\n\n // $this->allocate(20101,100000);\n // $this->allocate(20102,200000);\n // $this->allocate(20103,45000);\n // $this->allocate(20111,90000);\n // $this->allocate(20112,180000);\n // $this->allocate(20113,35000);\n // $this->allocate(20121,110000);\n // $this->allocate(20122,210000);\n // $this->allocate(20123,55000);\n\n // $this->purchase(20101,3);\n // $this->purchase(20102,3);\n // $this->purchase(20103,3);\n // $this->purchase(20111,3);\n // $this->purchase(20112,3);\n }", "function printReport() {\n # You need both of these globals!!\n global $report, $page_index, $page, $start, $stop;\n\n # These are the default args. Useful for calling your page\n # again.\n $args = \"page=$page&page_index=$page_index&start=$start&stop=$stop\";\n\n # These add the sort arrows for each field.\n # The first argument is the field name\n # The second argument is the text to replace it with.\n $report->setHeaderReplacement( \"product_sku\",\n $report->strArrows('\"product_sku\"',$args).\n ' Product Sku' );\n $report->setHeaderReplacement( \"online\",\n $report->strArrows('\"online\"',$args).\n ' Online' );\n $report->setHeaderReplacement( \"offline\",\n $report->strArrows('\"offline\"',$args).\n ' Offline' );\n $report->setHeaderReplacement( \"product\",\n $report->strArrows('\"product\"',$args).\n ' Product' );\n $report->setHeaderReplacement( \"changed\",\n $report->strArrows('\"changed\"',$args).\n ' Changed' );\n ?>\n <h3>Part Sales:</h3>\n <i>(Use the Excel report to get more than the first 300 results)</i>\n <br>\n <form action=show.php>\n <table><tr>\n <?\n print(\"<tr><td align=center colspan=2>Limit to online dates between\");\n print(\"<tr><td>Start (mm-dd-yyyy):</td><td><input type=text name=start value=\\\"\"\n . @$start .\"\\\">\");\n print(\"<tr><td>Stop:</td><td><input type=text name=stop value=\\\"\"\n . @$stop . \"\\\">\");\n\n ?>\n </TD></TR>\n <TR><TD></TD><TD>\n <input type=submit value=Search>\n </td></tr>\n </table>\n <input type=hidden name=page value=\"part_sales_report.php\">\n </form>\n <?\n if (empty($start) and empty($stop)) {\n return;\n }\n\n # This does the actual printing of the HTML\n $report->printHTML( $page_index );\n}", "function getProducts($u,$cat){\n global $o;\n $d = new simple_html_dom();\n $d->load(scraperwiki::scrape($u));\n//echo \"Loaded URL: \" . $u . \"\\n\";\n $items = $d->find('li.grid-item');\n if (count($items) > 0) {\n \tforeach ($items as $p) {\n \t\t$prod = $p->find('p.product-name > a',0);\n \t\t$prodname = trim($prod->innertext);\n \t\t$prodURL = $prod->href;\n \t\tif (!is_null($p->find('p.minimal-price',0))) {\n \t\t $prodtype = 1;\n \t\t} else {\n \t\t $prodtype = 0;\n \t\t}\n \t\tfputcsv($o,array($prodname, $prodtype, $cat, $prodURL));\necho $prodname . \"\\n\";\n \t}\n \tif (!is_null($d->find('p.next',0))) {\n \t\tgetProducts($d->find('p.next',0)->href,$cat);\n \t}\n }\n}", "public function test(){\n \t// it could be a huge performance concern if crawl it.\n \t// so I just choose the \"I\" category of all programs insteaded.\n\n \t// $url_main = \"http://www.humber.ca/program\"; \n \tset_time_limit(1000);\n \t// $url_main = \"http://www.humber.ca/program/listings/b?school=All&credential=All&campus=All&field_program_name_value_1=\";\n\n \t$html_main = file_get_contents($url_main);\n\n\t\t$crawler = new Crawler($html_main);\n\n\t\t$links = array();\n\n\t\t// Simple XPath for this element, so I did not use CssSelector.\n\t\t$crawler->filterXPath('//tbody/tr/td/a')->each(function ($node, $i) use( &$links) {\n\t\t\t\n\t\t\t// the links in website are relative path, so I need to add a prefix to make it absolute.\n\t\t\t$prefix = \"http://humber.ca\";\n\n\t\t\t$existed_programs = Program::all();\n\t\t\t$existed_program_names = array();\n\t\t\tforeach ($existed_programs as $key => $value) {\n\t\t\t\t$existed_program_names[] = $value['program_name'];\n\t\t\t}\n\n\t\t\t// get rid of the duplicated links, no idea why Humber make the program list a mess\n\t\t\tif (strpos($node->text(),',') === false) {\n\t\t\t\t\n\t\t\t\t// get the full link\n\t\t\t\t$link = $prefix . $node->attr('href');\n\t\t\t $link = trim($link);\n\t\t\t // get the text which is the program name\n\t\t\t $text = trim($node->text());\t\t\n\t\t \t\n\t\t \t// put associate name & link to key/value pair array\n\t\t\t if(!in_array($text, $existed_program_names)){\n\t\t\t \t$links[\"$text\"] = $link;\n\t\t\t }\n\t\t \t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t// an array to store all programs\n\t\t$programs = array();\n\n\t\t// use a loop to crawl individual program webpage by accessing its link in $links array\n\t\tforeach ($links as $key => $value) {\n\n\t\t\t$program_url = $value;\n\n\t\t\t// use curl to get the webpage content\n\t\t\t// it seems file_get_contents() has some issues for these webpage\n\t\t\t// or it's just I made some mistakes\n\t\t\t$curl_handle=curl_init();\n\t\t\tcurl_setopt($curl_handle, CURLOPT_URL,$program_url);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT, 'Humber College');\n\n\t\t\t\n\n\t\t\t$program_html = curl_exec($curl_handle);\n\t\t\tcurl_close($curl_handle);\n\n\t\t\tif($program_html){\n\t\t\t\t$program_crawler = new Crawler($program_html);\n\t\t\t}\n\n\t\t\t// $program is an array to store the program's information with key/value pair\n\t\t\t$program = array();\n\n\t\t\t// here I used CssSelector to help me translate the XPath.\n\t\t\t// It made me address it without headache.\n\t\t\t$program['program_name'] = trim($key);\n\n\t\t\t$Code = $program_crawler->filterXPath(CssSelector::toXPath('div.container.clearfix>section>div.field-items>div.field-item.even'))->text();\n\t\t\t$program['program_code'] = trim($Code);\n\n\t\t\t$Credential = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-credential>div.field-item>a'))->text();\n\t\t\t$program['program_credential'] = trim($Credential);\n\n\t\t\t$School = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-school>div.field-item>a'))->text();\n\t\t\t$program['program_school'] = trim($School);\n\n\t\t\t// get all the schools from database\n\t\t\t$schools = School::all();\n\n\t\t\t// Because I used School table's id as the foreign key in Program table.\n\t\t\tforeach ($schools as $key1 => $value1) {\n\t \t\tif($program['program_school'] == $value1['school_name']){\n\t \t\t\t$program['program_school_id'] = $value1['id'];\n\t \t\t}\n\t \t}\t\n\n\t \t// getting each courses' name/code\n\t\t\t$courses = array();\n\t\t\t$courses = $program_crawler->filterXPath(CssSelector::toXPath('div.course'))->each(function ($node, $i) {\n\t\t\t\t$course = array();\n\t\t\t\t$course_code = $node->children()->first()->text();\n\t\t\t\t$course_name = $node->children()->last()->text();\n\t\t\t\t$course['course_code'] = $course_code;\n\t\t\t\t$course['course_name'] = $course_name;\n\t\t\t\treturn $course;\n\n\t\t\t});\n\n\t\t\t\n\t\t\t$program['program_courses'] = $courses;\n\t\t\t$programs[] = $program;\n\t\t}\n\n\t\t// store the information from array to database through loops\n\t\t// just in case of accidents, I commented the inserting database code below.\n\t\tforeach ($programs as $key => $value) {\n\t\t\t$one_program = new Program;\n\t\t\t$one_program->program_name = $value['program_name'];\n\t\t\t$one_program->program_code = $value['program_code'];\n\t\t\t$one_program->school_id = $value['program_school_id'];\n\t\t\t$one_program->credential = $value['program_credential'];\n\t\t\t$one_program->save();\n\t\t\techo \"a program is saved to db\" . \"<br>\";\n\t\t\tforeach ($value['program_courses'] as $key2 => $value2) {\n\n\t\t\t\t// Same reason as above, I used Program table's id as foreign key in Course table\n\t\t\t\t$stored_programs = Program::all();\n\t\t\t\t// $stored_programs = $programs;\n\t\t\t\t$course_belongs_id = 0;\n\t\t\t\tforeach ($stored_programs as $key3 => $value3) {\n\t\t \t\tif($value['program_name'] == $value3['program_name']){\n\t\t \t\t\t$course_belongs_id = $value3['id'];\n\t\t \t\t}\n\t\t \t}\n\n\t\t \t$existed_courses = Course::where('program_name', '=', $value['program_name']);\n\t\t\t\t$existed_course_name = array();\n\t\t\t\tforeach ($existed_courses as $key => $value) {\n\t\t\t\t\t$existed_course_name[] = $value['course_name'];\n\t\t\t\t}\t\n\t\t\t\tif(!in_array($value2['course_name'], $existed_course_name)){\n\t\t\t\t\t$one_course = new Course;\n\t\t\t\t\t$one_course->course_name = $value2['course_name'];\n\t\t\t\t\t$one_course->course_code = $value2['course_code'];\n\t\t\t\t\t$one_course->program_id = $course_belongs_id;\n\t\t\t\t\t$one_course->save();\n\t\t\t\t\techo \"a course is saved to db ---- \" . $one_course->program_id . \"<br>\";\n\t\t\t\t}\n\t\t \t\n\n\t\t\t}\n\t\t\techo \"<br>======<br>\";\n\t\t}\n\n\t}", "public static function run(){\n // Loads from an Alert\n \n $alert = AlertManager::load(67);\n $test = new Search();\n \n // the actual Query\n $query = $alert ->getQuery();\n \n dpm(SearchLabel::toLabel($query));\n $test -> addFromQuery($query);\n $num = $test ->getCount();\n \n dpm($num);\n $nodes = $test ->getNodes();\n dpm($nodes);\n }", "abstract protected function grabReportListFromFile( $quantity );", "public function run()\n {\n\n // Enter authentication before getting Intrinio data\n $username = 'b7aac9b614877ef4b070cf462756d8bb';\n $password = 'ebdf24e3287a1962c941ae9076a3127c';\n\n $context = stream_context_create(array(\n 'http' => array(\n 'header' => \"Authorization: Basic \" . base64_encode(\"$username:$password\")\n )\n ));\n\n //\n $json = file_get_contents(\"https://api.intrinio.com/companies\", false, $context);\n $array = json_decode($json, JSON_PRETTY_PRINT);\n $loops = $array['total_pages'];\n\n // Request Intrino data 100 records at a time\n for ($i = 1; $i <= $loops; $i++) {\n $json = file_get_contents(\"https://api.intrinio.com/companies?page_number=\" . \"$i\", false, $context);\n $array = json_decode($json, JSON_PRETTY_PRINT);\n $dataArray[] = $array['data'];\n }\n\n // Create Intrinio array with just tickers and names\n foreach ($dataArray as $value) {\n foreach ($value as $data) {\n $intrinioCompanies[] = ['ticker' => $data['ticker'], 'name' => $data['name']];\n }\n }\n\n // Get all Quandle tickers and codes\n $csv = array_map('str_getcsv', file(\"public/wiki_codes/wiki_codes.csv\"));\n $headers = $csv[0];\n unset($csv[0]);\n $quandlCompanies = [];\n foreach ($csv as $row) {\n $newRow = [];\n foreach ($headers as $k => $key) {\n $newRow[$key] = $row[$k];\n }\n $quandlCompanies[] = $newRow;\n }\n\n // Filter out Intrinio data that is not in Quandl data and add Quandl codes\n $masterList = [];\n foreach ($intrinioCompanies as $intrinio) {\n foreach ($quandlCompanies as $quandl) {\n if ($intrinio['ticker'] == $quandl['ticker']) {\n $masterList[] = [\n 'ticker' => $intrinio['ticker'],\n 'name' => $intrinio['name'],\n 'quandl_code' => $quandl['quandl_code'],\n ];\n break;\n }\n }\n }\n\n // Seed company table\n foreach ($masterList as $value) {\n Company::insert([\n 'ticker' => $value['ticker'],\n 'company_name' => $value['name'],\n 'quandl_code' => $value['quandl_code'],\n ]);\n }\n }", "function getInfomationOnThisPage($crawler,$db,$batchId) {\n\t\t$title=\"\";\n\t\t$link=\"\";\n\t\t$cid=\"\";\n\t\t$price=\"\";\n\t\t$odo=\"\";\n\n\t\t// Get title\n\t\t$info = $crawler->filter('.result-item')->each(function ($node) {\n\t\t\t$info=array();\n\n\t\t\t/* Title & Link */\n\t\t\t$tmp=$node->filter(\"h2 a\")->each(function($node_1){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['title'] = trim(preg_replace(\"/<span.*span>/s\",\"\",$node_1->html()));\n\t\t\t $tmp['link'] = \"http://www.carsales.com.au\".$node_1->attr(\"href\");\n\t\t\t $tmp['cid'] = $node_1->attr('recordid');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Price */\n\t\t\t$tmp=$node->filter(\".additional-information .price a\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['price'] = $node_2->attr('data-price');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Odometer */\n\t\t\t$tmp = $node->filter(\".vehicle-features .item-odometer\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['odo'] = preg_replace(array(\"/<i.*i>/\",\"/,/\",\"/ km$/\"),array(\"\",\"\",\"\"),$node_2->html());\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\n\t\t\treturn $info;\n\n\t\t});\n\n\t\t$sqls=array();\n\t\tforeach ($info AS $i) {\n\t\t\t$title=isset($i['title'])?$db->real_escape_string($i['title']):\"\";\n\t\t\t$link=isset($i['link'])?$db->real_escape_string($i['link']):\"\";\n\t\t\t$cid=isset($i['cid'])?$db->real_escape_string($i['cid']):\"\";\n\t\t\t$price=isset($i['price'])?$db->real_escape_string($i['price']):\"\";\n\t\t\t$odo=isset($i['odo'])?$db->real_escape_string($i['odo']):\"\";\n\n\t\t\t$sqls[]=\"('$cid','$title','$price','$odo','$batchId','$link')\";\n\t\t}\n\t\t$db->query(\"INSERT INTO subaru_outback (record_id,title,price,odometer,batch_id,link) VALUES \".implode(\",\",$sqls));\n\n\t}", "public function importmagento()\n {\n $base_url=\"http://myshoes.fastcomet.host/Magentos/\";\n //API user\n $user=\"apiuser\";\n //API key\n $password=\"81eRvINu9r\";\n\n\n $api_url=$base_url.'index.php/api/soap/?wsdl';\n $client = new SoapClient($api_url);\n $session = $client->login($user,$password);\n\n $params = array(array(\n 'status'=>array('eq'=>'enabled')\n ));\n\n $result1 = $client->call($session, 'catalog_product.list');\n\n $i=0;\n foreach($result1 as $key => $value)\n {\n $result2 = $client->call($session, 'catalog_product.info',$result1[$key]['product_id']);\n $result3 = $client->call($session, 'cataloginventory_stock_item.list',$result1[$key]['product_id']);\n $arr[$i]['Product']['product_id']=$result1[$key]['product_id'];\n $arr[$i]['Product']['name']=$result1[$key]['name'];\n $arr[$i]['Product']['description']=$result2['description'];\n $arr[$i]['Product']['uom']='';\n $arr[$i]['Product']['category']= '';\n $arr[$i]['Product']['group']='';\n $arr[$i]['Product']['sku']=$result1[$key]['sku'];\n $arr[$i]['Product']['value']= number_format((float)$result2['price'], 2, '.', '');\n $arr[$i]['Product']['reorderpoint']='';\n $arr[$i]['Product']['safetystock']='';\n $arr[$i]['Product']['bin']='';\n $arr[$i]['Product']['imageurl']='';\n $arr[$i]['Product']['pageurl']=$base_url.$result2['url_path'];\n $arr[$i]['Product']['weight']= number_format((float)$result2['weight'], 2, '.', '');\n $arr[$i]['Product']['height']='';\n $arr[$i]['Product']['width']='';\n $arr[$i]['Product']['depth']='';\n $arr[$i]['Product']['barcodesystem']='';\n $arr[$i]['Product']['barcode_number']='';\n $arr[$i]['Product']['packaginginstructions']='';\n $arr[$i]['Product']['color']='';\n $arr[$i]['Product']['size']='';\n $arr[$i]['Inventory']['inventoryquantity']=$result3[0]['qty'];\n $arr[$i]['Product']['createdinsource']=$result2['created_at'];\n $arr[$i]['Product']['modifiedinsource']=$result2['updated_at'];\n $i++;\n }\n $this->importcsv(null, $arr);\n return $this->redirect(array('controller' => 'products', 'action' => 'index'));\n }", "function _getSummary($url, & $collection, $catagory){\r\n\r\n\r\n //fill in the doc type and url of the resource\r\n/* for($i = 0; $i < count($collection); $i++){\r\n $collection[$i]->url = $url;\r\n $collection[$i]->docType = $catagory;\r\n }*/\r\n\r\n $html = file_get_html($url);\r\n $res = null;\r\n foreach ($html->find('div.paragraph') as $el) {\r\n if(strpos($el, \"Actual activities will vary\") !== false){\r\n $res = $el;\r\n break;\r\n }\r\n }\r\n\r\n //Get the array of titles and summary\r\n $resArray = explode(\"<br /><br />\", $res);\r\n for($j = 0; $j < count($resArray); $j++){\r\n $resArray[$j] = strip_tags($resArray[$j]);\r\n $resArray[$j] = str_replace(array(\"&#8203;\"), '', $resArray[$j] ); //remove these unicode characters\r\n $resArray[$j] = str_replace(array(\"&nbsp;\"), ' ', $resArray[$j] ); //remove space unicode characters\r\n }\r\n\r\n //split line into title and summary (delemited by first instance of ':')\r\n //we will build a list of title, summary pairs.\r\n $titleSummaryPairs = array(); //array of TitleSummaryPair objects\r\n for($i = 1; $i < count($resArray); $i++){ //first element is just a header so we skip it.\r\n $split = explode(':', $resArray[$i], 2);\r\n $ts = new TitleSummaryPair();\r\n $ts->title = $split[0];\r\n $ts->summary = $split[1];\r\n array_push($titleSummaryPairs, $ts);\r\n }\r\n\r\n //find the matching title in the csv data array and add the summary. Do this for every title/summary pair.\r\n for($i = 0; $i < count($titleSummaryPairs); $i++){ //for each title summary pair that was scraped in this category\r\n $cur = $titleSummaryPairs[$i]; //the current title summary pair\r\n $foundMatch = false; //track weather or not we found a match. If we don't there is likely a typo in the title somewhere.\r\n $t1 = null;\r\n $t2 = null;\r\n for($j = 0; $j < count($collection)- 1; $j++){ //for each document row we harvested from the csv file\r\n $t1 = str_replace(\" \", \"\", $cur->title);\r\n $t2 = str_replace(\" \", \"\",$collection[$j]->title);\r\n $t1 = str_replace(\"s\", \"\", $t1);\r\n $t2 = str_replace(\"s\", \"\",$t2);\r\n if(($t1 == $t2 || strpos($t1, $t2) !== false || strpos($t2, $t1) != false) && $t1 != \"\" && $t2 != \"\" ){ //if we mached title summary pair to title in csv object\r\n $foundMatch = true;\r\n $collection[$j]->docType = $catagory;\r\n $collection[$j]->summary = $cur->summary; //add summary to the data set for the current document in the collection.\r\n $collection[$j]->url = $url;\r\n }\r\n }\r\n\r\n //Do these ones manually since an exact text match was not found.\r\n /* if($foundMatch == false){\r\n echo \"Do manually: \" . $t1 . \"\\n\";\r\n // InsertManually($t1);\r\n }*/\r\n }\r\n\r\n\r\n\r\n\r\n //print_r($resArray);\r\n/* $ret = $html->find('div[class=paragraph]');*/\r\n/* print_r($ret);*/\r\n /*$curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\r\n $page = curl_exec($curl);\r\n if(curl_errno($curl)) // check for execution errors\r\n {\r\n echo 'Scraper error: ' . curl_error($curl);\r\n exit;\r\n }\r\n curl_close($curl);\r\n\r\n $DOM = new DOMDocument;\r\n\r\n libxml_use_internal_errors(true);\r\n\r\n if (!$DOM->loadHTML($page)){\r\n $errors=\"\";\r\n foreach (libxml_get_errors() as $error) {\r\n $errors.=$error->message.\"<br/>\";\r\n }\r\n libxml_clear_errors();\r\n print \"libxml errors:<br>$errors\";\r\n return;\r\n }\r\n*/\r\n\r\n}" ]
[ "0.5940064", "0.5821078", "0.5727335", "0.56043154", "0.55675244", "0.5498159", "0.54911584", "0.54804236", "0.5438413", "0.5422629", "0.5386306", "0.5379583", "0.5349196", "0.5336306", "0.53155035", "0.53145164", "0.5313823", "0.5309151", "0.5306959", "0.5292262", "0.5288744", "0.5276679", "0.5258527", "0.5241446", "0.52063143", "0.51929104", "0.5191712", "0.51908964", "0.515356", "0.5152729" ]
0.5996147
0
/ TikiWiki plugin chart Displays a chart from a tikisheet.
function wikiplugin_chart_help() { return tra("Chart").":<br />~np~{CHART(id=>, type=>, width=>, height=>, value=> )}".tra("title")."{CHART}~/np~"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Timeline($chart_div,$data,$size='300px'){\n\t//$dataArray[]= \"[\\\".$dataset[0].\"\\\", \\\"\". $dataset[1].\"\\\", \\\"\". $dataset[2].\"\\\"]\"\n\t//$data = implode(\",\",$dataArray);\n\techo \"<div class='box-body' id='\".$chart_div.\"' style='height=\".$size.\"'></div>\";\n\techo \"<script>\n\tnew Chartkick.BarChart(\".$chart_div.\",[\".$data.\"]);\n\t</script>\";\n\t\n}", "function display() {\r\n\t\tJRequest::setVar('view', 'charts');\r\n\t\tJRequest::setVar('layout', 'charts');\r\n\t\tparent::display();\t\r\n }", "public function chart()\n {\n $data ['footer'] = $this->page_model->getfooter();\n\n $this->load->view('templates/header');\n $this->load->view('home/about/head_about');\n $this->load->view('home/about/chart', $data);\n $this->load->view('templates/footer', $data);\n }", "public function getHTML()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\tinclude_once \"Services/jQuery/classes/class.iljQueryUtil.php\";\n\t\tiljQueryUtil::initjQuery();\n\t\t\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/excanvas.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.pie.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.highlighter.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.spider.js\");\n\n\t\t$chart = new ilTemplate(\"tpl.grid.html\", true, true, \"Services/Chart\");\n\t\t$chart->setVariable(\"ID\", $this->id);\n\t\t$chart->setVariable(\"WIDTH\", $this->width);\n\t\t$chart->setVariable(\"HEIGHT\", $this->height);\n\t\n\t\t$last = array_keys($this->data);\n\t\t$last = array_pop($last);\n\t\t$has_pie = false;\n\t\t$has_spider = false;\n\t\tforeach($this->data as $idx => $series)\n\t\t{\n\t\t\t$fill = $series->getFill();\n\t\t\t\n\t\t\tif ($series->getType() == \"spider\")\n\t\t\t{\n\t\t\t\t$has_spider = true;\n\t\t\t\t\n\t\t\t\tif ($fill[\"color\"] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$chart->setCurrentBlock(\"series_property\");\n\t\t\t\t\t$chart->setVariable(\"SPROP\", \"color\");\n\t\t\t\t\t$chart->setVariable(\"SPROP_VAL\", self::renderColor($fill[\"color\"] , \"0.5\"));\n\t\t\t\t\t$chart->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"series\");\n\t\t\t$chart->setVariable(\"SERIES_LABEL\", str_replace(\"\\\"\", \"\\\\\\\"\", $series->getLabel()));\n\t\t\t$chart->setVariable(\"SERIES_TYPE\", $series->getType());\n\n\t\t\t$type = $series->getType();\n\n\t\t\t$points = array();\n\t\t\tif($type != \"pie\")\n\t\t\t{\n\t\t\t\tforeach($series->getData() as $point)\n\t\t\t\t{\n\t\t\t\t\t$points[] = \"[\".$point[0].\",\".$point[1].\"]\";\n\t\t\t\t}\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", \"[ \".implode(\",\", $points).\" ]\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$has_pie = true;\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", array_pop($series->getData()));\n\t\t\t}\n\t\t\tif($idx != $last)\n\t\t\t{\n\t\t\t\t$chart->setVariable(\"SERIES_END\", \",\");\n\t\t\t}\n\n\t\t\t$options = array(\"show: \".($series->isHidden() ? \"false\" : \"true\"));\n\t\t\tif($type != \"points\")\n\t\t\t{\n\t\t\t\t$width = $series->getLineWidth();\n\t\t\t\tif($width !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"lineWidth:\".$width;\n\t\t\t\t}\n\t\t\t\tif($type == \"bars\")\n\t\t\t\t{\n\t\t\t\t\t$bar_options = $series->getBarOptions();\n\t\t\t\t\tif($bar_options[\"width\"] !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"barWidth:\".str_replace(\",\", \".\", $bar_options[\"width\"]);\n\t\t\t\t\t\t$options[] = \"align: \\\"\".$bar_options[\"align\"].\"\\\"\";\n\t\t\t\t\t\tif($bar_options[\"horizontal\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$options[] = \"horizontal: true\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($type == \"lines\")\n\t\t\t\t{\n\t\t\t\t\tif($series->getLineSteps())\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"steps: true\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$radius = $series->getPointRadius();\n\t\t\t\tif($radius !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"radius:\".$radius;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($fill[\"fill\"])\n\t\t\t{\n\t\t\t\t$options[] = \"fill: \".$fill[\"fill\"];\n\t\t\t\tif($fill[\"color\"])\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"fillColor: \".self::renderColor($fill[\"color\"], $fill[\"fill\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$chart->setVariable(\"SERIES_OPTIONS\", implode(\", \", $options));\n\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\n\t\tif ($has_spider)\n\t\t{\n\t\t\t$chart->setCurrentBlock(\"spider\");\n\t\t\t$lab_strings = array();\n\t\t\tforeach ($this->getLegLabels() as $l)\n\t\t\t{\n\t\t\t\t$lab_strings[] = \"{label: \\\"\".$l.\"\\\"}\";\n\t\t\t}\n\t\t\t$chart->setVariable(\"LEG_LABELS\", implode($lab_strings, \",\"));\n\t\t\t$chart->setVariable(\"LEG_MAX\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"spider_grid_options\");\n\t\t\t$chart->setVariable(\"NR_TICKS\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\t\t\n\t\t// global options\n\n\t\t$chart->setVariable(\"SHADOW\", (int)$this->getShadow());\n\t\t$chart->setVariable(\"IS_PIE\", ($has_pie ? \"true\" : \"false\"));\n\t\t\n\t\t$colors = $this->getColors();\n\t\tif($colors)\n\t\t{\n\t\t\t$tmp = array();\n\t\t\tforeach($colors as $color)\n\t\t\t{\n\t\t\t\t$tmp[] = self::renderColor($color);\n\t\t\t}\n\t\t}\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"COLORS\", implode(\",\", $tmp));\n\t\t}\n\n\t\t// legend\n\t\tif(!$this->legend)\n\t\t{\n\t\t\t$chart->setVariable(\"LEGEND\", \"show: false\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$margin = $this->legend->getMargin();\n\t\t\t$legend = array();\n\t\t\t$legend[] = \"show: true\";\n\t\t\t$legend[] = \"noColumns: \".$this->legend->getColumns();\n\t\t\t$legend[] = \"position: \\\"\".$this->legend->getPosition().\"\\\"\";\n\t\t\t$legend[] = \"margin: [\".$margin[\"x\"].\", \".$margin[\"y\"].\"]\";\n\t\t\t$legend[] = \"backgroundColor: \".self::renderColor($this->legend->getBackground());\n\t\t\t$legend[] = \"backgroundOpacity: \".str_replace(\",\",\".\",$this->legend->getOpacity());\n\t\t\t$legend[] = \"labelBoxBorderColor: \".self::renderColor($this->legend->getLabelBorder());\n\n\t\t\t$chart->setVariable(\"LEGEND\", implode(\", \", $legend));\n\t\t}\n\n\t\t// axis/ticks\n\t\t$tmp = array();\n\t\t$ticks = $this->getTicks();\n\t\tif($ticks)\n\t\t{\t\t\t\n\t\t\tforeach($ticks as $axis => $def)\n\t\t\t{\n\t\t\t\tif(is_numeric($def))\n\t\t\t\t{\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: \".$def.\" }\";\n\t\t\t\t}\n\t\t\t\telse if(is_array($def))\n\t\t\t\t{\n\t\t\t\t\t$ttmp = array();\n\t\t\t\t\tforeach($def as $idx => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($ticks[\"labeled\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ttmp[] = \"[\".$idx.\", \\\"\".$value.\"\\\"]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ttmp[] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: [\".implode(\", \", $ttmp).\"] }\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// optional: remove decimals\n\t if(!isset($tmp[\"x\"]) && $this->integer_axis[\"x\"])\n\t\t{\n\t\t\t$tmp[\"x\"] = \"xaxis: { tickDecimals: 0 }\";\n\t\t}\n\t\tif(!isset($tmp[\"y\"]) && $this->integer_axis[\"y\"])\n\t\t{\n\t\t\t$tmp[\"y\"] = \"yaxis: { tickDecimals: 0 }\";\n\t\t}\t\t\n\t\t\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"AXIS\", \",\".implode(\", \", $tmp));\n\t\t}\n\t\t\n\t\t$ret = $chart->get();\n//echo htmlentities($ret);\n\t\treturn $ret;\n\t}", "function custom_chart_url() {\n return '/main.php?the_left=nav3&the_page=cosel';\n}", "function yearly_chart() {\n $this->load->view(\"expenses/yearly_chart\");\n }", "public function actionChartTest1(){\n\t\t\n\t $chartGrantData='{\n\t\t\"chart\": {\n \"subcaption\": \"Pilot Project Planned vs Actual\", \n \"dateformat\": \"dd/mm/yyyy\",\n \"outputdateformat\": \"ddds mns yy\",\n \"ganttwidthpercent\": \"70\",\n \"ganttPaneDuration\": \"50\",\n \"ganttPaneDurationUnit\": \"d\",\t\n\t\t\t\t\"height\":\"500%\",\n\t\t\t\t\"fontsize\": \"14\",\t\t\t\t\n \"plottooltext\": \"$processName{br} $label starting date $start{br}$label ending date $end\",\n \"theme\": \"fint\"\n },\n\t\t\"categories\": [\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#33bdda\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"30/6/2014\",\n\t\t\t\t\t\t\"label\": \"Months\",\n\t\t\t\t\t\t\"align\": \"middle\",\n\t\t\t\t\t\t\"fontcolor\": \"#ffffff\",\n\t\t\t\t\t\t\"fontsize\": \"14\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#33bdda\",\n\t\t\t\t\"align\": \"middle\",\n\t\t\t\t\"fontcolor\": \"#ffffff\",\n\t\t\t\t\"fontsize\": \"12\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"30/4/2014\",\n\t\t\t\t\t\t\"label\": \"April\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/5/2014\",\n\t\t\t\t\t\t\"end\": \"31/5/2014\",\n\t\t\t\t\t\t\"label\": \"May\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/6/2014\",\n\t\t\t\t\t\t\"end\": \"30/6/2014\",\n\t\t\t\t\t\t\"label\": \"June\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#ffffff\",\n\t\t\t\t\"fontcolor\": \"#1288dd\",\n\t\t\t\t\"fontsize\": \"10\",\n\t\t\t\t\"isbold\": \"1\",\n\t\t\t\t\"align\": \"center\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"5/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 1\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"6/4/2014\",\n\t\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\t\"end\": \"19/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 3\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"20/4/2014\",\n\t\t\t\t\t\t\"end\": \"26/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 4\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"27/4/2014\",\n\t\t\t\t\t\t\"end\": \"3/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 5\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 6\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\t\"end\": \"17/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 7\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"18/5/2014\",\n\t\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 8\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\t\"end\": \"31/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 9\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/6/2014\",\n\t\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 10\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"8/6/2014\",\n\t\t\t\t\t\t\"end\": \"14/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 11\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"15/6/2014\",\n\t\t\t\t\t\t\"end\": \"21/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 12\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"22/6/2014\",\n\t\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 13\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"datatable\": {\n \"headervalign\": \"bottom\",\n \"datacolumn\": [\n {\n \"headertext\": \"PIC\",\n \"fontcolor\": \"#000000\",\n\t\t\t\t\t\t\"fontsize\": \"10\",\n\t\t\t\t\t\t\"isanimated\": \"1\",\n\t\t\t\t\t\t\"bgcolor\": \"#6baa01\",\n\t\t\t\t\t\t\"headervalign\": \"middle\",\n\t\t\t\t\t\t\"headeralign\": \"center\",\n\t\t\t\t\t\t\"headerbgcolor\": \"#6baa01\",\n\t\t\t\t\t\t\"headerfontcolor\": \"#ffffff\",\n\t\t\t\t\t\t\"headerfontsize\": \"16\",\n\t\t\t\t\t\t\"width\":\"150\",\n\t\t\t\t\t\t\"align\": \"left\",\n\t\t\t\t\t\t\"isbold\": \"1\",\n\t\t\t\t\t\t\"bgalpha\": \"25\",\t\t\t\t\n \"text\": [\n {\n \"label\": \" \"\n },\n {\n \"label\": \"John\"\n },\n {\n \"label\": \"David\"\n },\n {\n \"label\": \"Mary\"\n },\n {\n \"label\": \"John\"\n },\n {\n \"label\": \"Andrew & Harry\"\n }, \n {\n \"label\": \"John & Harry\"\n },\n {\n \"label\": \" \"\n },\n {\n \"label\": \"Neil & Harry\"\n },\n {\n \"label\": \"Neil & Harry\"\n },\n {\n \"label\": \"Chris\"\n },\n {\n \"label\": \"John & Richard\"\n }\n ]\n }\n ]\n },\n\t\t\"processes\": {\n\t\t\t\"headertext\": \"Pilot Task\",\n\t\t\t\"fontsize\": \"12\",\n\t\t\t\"fontcolor\": \"#000000\",\n\t\t\t\"fontsize\": \"10\",\n\t\t\t\"isanimated\": \"1\",\n\t\t\t\"bgcolor\": \"#6baa01\",\n\t\t\t\"headervalign\": \"middle\",\n\t\t\t\"headeralign\": \"center\",\n\t\t\t\"headerbgcolor\": \"#6baa01\",\n\t\t\t\"headerfontcolor\": \"#ffffff\",\n\t\t\t\"headerfontsize\": \"16\",\n\t\t\t\"width\":\"200\",\n\t\t\t\"align\": \"left\",\n\t\t\t\"isbold\": \"1\",\n\t\t\t\"bgalpha\": \"25\",\n\t\t\t\"process\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Clear site\",\n\t\t\t\t\t\"id\": \"1\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Excavate Foundation\",\n\t\t\t\t\t\"id\": \"2\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Concrete Foundation\",\n\t\t\t\t\t\"id\": \"3\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Footing to DPC\",\n\t\t\t\t\t\"id\": \"4\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Drainage Services\",\n\t\t\t\t\t\"id\": \"5\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Backfill\",\n\t\t\t\t\t\"id\": \"6\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Ground Floor\",\n\t\t\t\t\t\"id\": \"7\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Walls on First Floor\",\n\t\t\t\t\t\"id\": \"8\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"First Floor Carcass\",\n\t\t\t\t\t\"id\": \"9\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"First Floor Deck\",\n\t\t\t\t\t\"id\": \"10\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Roof Structure\",\n\t\t\t\t\t\"id\": \"11\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Roof Covering\",\n\t\t\t\t\t\"id\": \"12\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Rainwater Gear\",\n\t\t\t\t\t\"id\": \"13\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Windows\",\n\t\t\t\t\t\"id\": \"14\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"External Doors\",\n\t\t\t\t\t\"id\": \"15\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Connect Electricity\",\n\t\t\t\t\t\"id\": \"16\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Connect Water Supply\",\n\t\t\t\t\t\"id\": \"17\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Install Air Conditioning\",\n\t\t\t\t\t\"id\": \"18\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Interior Decoration\",\n\t\t\t\t\t\"id\": \"19\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Fencing And signs\",\n\t\t\t\t\t\"id\": \"20\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Exterior Decoration\",\n\t\t\t\t\t\"id\": \"21\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Setup racks\",\n\t\t\t\t\t\"id\": \"22\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\t\t\n\t\t\"tasks\": {\n\t\t\t\"task\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"1\",\n\t\t\t\t\t\"start\": \"9/4/2014\",\n\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\"id\": \"1-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"1\",\n\t\t\t\t\t\"start\": \"9/4/2014\",\n\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\"id\": \"1\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\"end\": \"23/4/2014\",\n\t\t\t\t\t\"id\": \"2-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\"end\": \"25/4/2014\",\n\t\t\t\t\t\"id\": \"2\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"23/4/2014\",\n\t\t\t\t\t\"end\": \"25/4/2014\",\n\t\t\t\t\t\"id\": \"2-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 2 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"23/4/2014\",\n\t\t\t\t\t\"end\": \"30/4/2014\",\n\t\t\t\t\t\"id\": \"3-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"26/4/2014\",\n\t\t\t\t\t\"end\": \"4/5/2014\",\n\t\t\t\t\t\"id\": \"3\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"3/5/2014\",\n\t\t\t\t\t\"end\": \"4/5/2014\",\n\t\t\t\t\t\"id\": \"3-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 1 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"4\",\n\t\t\t\t\t\"start\": \"3/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"4-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"4\",\n\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"4\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"5\",\n\t\t\t\t\t\"start\": \"6/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"5-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"5\",\n\t\t\t\t\t\"start\": \"6/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"5\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\"end\": \"7/5/2014\",\n\t\t\t\t\t\"id\": \"6-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"5/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"6\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"7/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"6-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 4 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"7\",\n\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\"end\": \"14/5/2014\",\n\t\t\t\t\t\"id\": \"7-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"7\",\n\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\"end\": \"14/5/2014\",\n\t\t\t\t\t\"id\": \"7\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"8\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"19/5/2014\",\n\t\t\t\t\t\"id\": \"8-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"8\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"19/5/2014\",\n\t\t\t\t\t\"id\": \"8\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"18/5/2014\",\n\t\t\t\t\t\"id\": \"9-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"21/5/2014\",\n\t\t\t\t\t\"id\": \"9\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"18/5/2014\",\n\t\t\t\t\t\"end\": \"21/5/2014\",\n\t\t\t\t\t\"id\": \"9-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 3 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"20/5/2014\",\n\t\t\t\t\t\"end\": \"23/5/2014\",\n\t\t\t\t\t\"id\": \"10-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"21/5/2014\",\n\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\"id\": \"10\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"23/5/2014\",\n\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\"id\": \"10-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 1 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"11\",\n\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\"end\": \"27/5/2014\",\n\t\t\t\t\t\"id\": \"11-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"11\",\n\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\"end\": \"27/5/2014\",\n\t\t\t\t\t\"id\": \"11\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"12\",\n\t\t\t\t\t\"start\": \"28/5/2014\",\n\t\t\t\t\t\"end\": \"1/6/2014\",\n\t\t\t\t\t\"id\": \"12-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"12\",\n\t\t\t\t\t\"start\": \"28/5/2014\",\n\t\t\t\t\t\"end\": \"1/6/2014\",\n\t\t\t\t\t\"id\": \"12\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"13\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"6/6/2014\",\n\t\t\t\t\t\"id\": \"13-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"13\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"6/6/2014\",\n\t\t\t\t\t\"id\": \"13\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"14\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"14-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"14\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"14\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"15\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"15-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"15\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"15\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"16\",\n\t\t\t\t\t\"start\": \"2/6/2014\",\n\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\"id\": \"16-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"16\",\n\t\t\t\t\t\"start\": \"2/6/2014\",\n\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\"id\": \"16\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"5/6/2014\",\n\t\t\t\t\t\"end\": \"10/6/2014\",\n\t\t\t\t\t\"id\": \"17-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"5/6/2014\",\n\t\t\t\t\t\"end\": \"17/6/2014\",\n\t\t\t\t\t\"id\": \"17\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"10/6/2014\",\n\t\t\t\t\t\"end\": \"17/6/2014\",\n\t\t\t\t\t\"id\": \"17-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 7 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"18\",\n\t\t\t\t\t\"start\": \"10/6/2014\",\n\t\t\t\t\t\"end\": \"12/6/2014\",\n\t\t\t\t\t\"id\": \"18-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"18\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"20/6/2014\",\n\t\t\t\t\t\"id\": \"18\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 8 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"19\",\n\t\t\t\t\t\"start\": \"15/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"19-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"19\",\n\t\t\t\t\t\"start\": \"16/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"19\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"20\",\n\t\t\t\t\t\"start\": \"23/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"20-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"20\",\n\t\t\t\t\t\"start\": \"23/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"20\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"21/6/2014\",\n\t\t\t\t\t\"id\": \"21-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"21\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"21/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"21-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 2 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"22\",\n\t\t\t\t\t\"start\": \"24/6/2014\",\n\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\"id\": \"22-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"22\",\n\t\t\t\t\t\"start\": \"25/6/2014\",\n\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\"id\": \"22\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"connectors\": [\n\t\t\t{\n\t\t\t\t\"connector\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"1\",\n\t\t\t\t\t\t\"totaskid\": \"2\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\",\n\t\t\t\t\t\t\"fromtaskconnectstart_\": \"1\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"2-2\",\n\t\t\t\t\t\t\"totaskid\": \"3\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"3-2\",\n\t\t\t\t\t\t\"totaskid\": \"4\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"3-2\",\n\t\t\t\t\t\t\"totaskid\": \"6\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"7\",\n\t\t\t\t\t\t\"totaskid\": \"8\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"7\",\n\t\t\t\t\t\t\"totaskid\": \"9\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"12\",\n\t\t\t\t\t\t\"totaskid\": \"16\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"12\",\n\t\t\t\t\t\t\"totaskid\": \"17\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"17-2\",\n\t\t\t\t\t\t\"totaskid\": \"18\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"19\",\n\t\t\t\t\t\t\"totaskid\": \"22\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"milestones\": {\n\t\t\t\"milestone\": [\n\t\t\t\t{\n\t\t\t\t\t\"date\": \"2/6/2014\",\n\t\t\t\t\t\"taskid\": \"12\",\n\t\t\t\t\t\"color\": \"#f8bd19\",\n\t\t\t\t\t\"shape\": \"star\",\n\t\t\t\t\t\"tooltext\": \"Completion of Phase 1\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"legend\": {\n\t\t\t\"item\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"color\": \"#008ee4\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"color\": \"#6baa01\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Slack (Delay)\",\n\t\t\t\t\t\"color\": \"#e44a00\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t }';\n\t\treturn $chartGrantData;\n\t\t\n\t}", "public function BarChart($chart_div,$data,$size='300px'){\n\t//$dataArray[]= \"[\\\".$dataset[0].\"\\\", \". $dataset[1].\"]\"\n\t//$data = implode(\",\",$dataArray);\n\techo \"<div class='box-body' id='\".$chart_div.\"' style='height=\".$size.\"'></div>\";\n\techo \"<script>\n\tnew Chartkick.BarChart(\".$chart_div.\",[\".$data.\"]);\n\t</script>\";\n\t\n}", "public function PieChart($chart_div,$data,$size='300px'){\n\t//$dataArray[]= \"[\\\"\".$dataset[0].\"\\\", \". $dataset[1].\"]\"\n\t//$data = implode(\",\",$dataArray);\n\techo \"<div class='' id='\".$chart_div.\"' style='height=\".$size.\"'></div>\";\n\techo \"<script>\n\tnew Chartkick.PieChart(\\\"\".$chart_div.\"\\\",[\".$data.\"]);\n\t</script>\";\n}", "public function makeChart($type)\n\n {\n\n switch ($type) {\n\n case 'bar':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'bar', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'pie':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'pie', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'donut': \n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'donut', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'line':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'line', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'area':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'area', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'geo':\n\n $chart = Charts::create('geo', 'highcharts')\n\n ->title('Laravel Chart GEO')\n\n ->elementLabel('HDTuto.com Laravel GEO Chart label')\n\n ->labels(['JP', 'ID', 'RU'])\n\n ->colors(['#3D3D3D', '#985689'])\n\n ->values([5,10,20])\n\n ->dimensions(1000,500)\n\n ->responsive(true);\n\n break;\n\n\n\n default:\n\n # code...\n\n break;\n\n }\n\n return view('chart', compact('chart'));\n\n }", "function generateLevelBarChart($pays,$ind,$agr,$con,$it)\n {\n $MyData = new pData(); \n $MyData->addPoints($it,\"IT solution\");\n $MyData->addPoints($ind ,\"Industrie\");\n $MyData->addPoints($con,\"Construction\");\n $MyData->addPoints($agr,\"Agriculture\");\n $MyData->setAxisName(0,\"Nombre de partenaires\");\n $MyData->addPoints($pays,\"Labels\");\n $MyData->setSerieDescription(\"Labels\",\"Months\");\n $MyData->setAbscissa(\"Labels\");\n $Palette = array(\"0\"=>array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100),\n \"1\"=>array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100),\n \"2\"=>array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100),\n \"3\"=>array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100),\n );\n $MyData->setPalette(\"IT solution\",array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Industrie\",array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Construction\",array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100)) ;\n $MyData->setPalette(\"Agriculture\",array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100)) ;\n\n\n $myPicture = new pImage(700,230,$MyData);\n $Settings = array(\"R\"=>194, \"G\"=>92, \"B\"=>4, \"Dash\"=>1, \"DashR\"=>204, \"DashG\"=>102, \"DashB\"=>14);\n $myPicture->drawFilledRectangle(0,0,700,390,$Settings);\n /* Create the pChart object */\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>100));\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>20));\n /* Set the default font properties */\n $myPicture->setFontProperties(array(\"FontName\"=>\"../app/includes/pChart/fonts/pf_arma_five.ttf\",\"FontSize\"=>6));\n /* Draw the scale and the chart */\n $myPicture->setGraphArea(60,20,680,190);\n $myPicture->drawScale(array(\"DrawSubTicks\"=>TRUE,\"Mode\"=>SCALE_MODE_ADDALL_START0));\n $myPicture->setShadow(FALSE);\n \n\n $myPicture->drawStackedBarChart(array(\"DisplayPos\"=>LABEL_POS_INSIDE,\"DisplayValues\"=>false ,\"Rounded\"=>TRUE,\"Surrounding\"=>30));\n /* Write the chart legend */\n $myPicture->drawLegend(380,210,array(\"Style\"=>LEGEND_NOBORDER,\"Mode\"=>LEGEND_HORIZONTAL));\n /* Render the picture (choose the best way) */\n $myPicture->Render(\"assets/images/barLevelChart1.png\");\n }", "function makeFigures($controller) \n {\n $revision_id = param('revision_id');\n $ci = $controller->getCi();\n $content= \"\";\n\t\t\t\t\n $need_legend = false;\n\n if (count($ci->getDependencies())) {\n $need_legend = true;\n $content .= $this->makeChart($ci, false, $revision_id);\n }\n \n if (count($ci->getDependants())) {\n $need_legend = true;\n $content .= $this->makeChart($ci, true, $revision_id);\n }\n \n if ($need_legend) {\n // $content .= $this->makeChart('chart.php?legend=true', _(\"Legend for the above figure(s)\"));\n }\n\t\t\n return $content;\n }", "function open_risk_technology_pie($project) {\n\t$chart = new Highchart ();\n\t\n\t$chart->chart->renderTo = \"open_risk_technology_pie\";\n\t$chart->chart->plotBackgroundColor = null;\n\t$chart->chart->plotBorderWidth = null;\n\t$chart->chart->plotShadow = false;\n\t$chart->title->text = \"Technologies\";\n\t\n\t$chart->tooltip->formatter = new HighchartJsExpr ( \"function() {\n return '<b>'+ this.point.name +'</b>: '+ this.point.y; }\" );\n\t\n\t$chart->plotOptions->pie->allowPointSelect = 1;\n\t$chart->plotOptions->pie->cursor = \"pointer\";\n\t$chart->plotOptions->pie->dataLabels->enabled = false;\n\t$chart->plotOptions->pie->showInLegend = 1;\n\t$chart->credits->enabled = false;\n\t\n\t// Open the database connection\n\t$db = db_open ();\n\t\n\t// Query the database\n\t$stmt = $db->prepare ( \"SELECT b.name, COUNT(*) AS num FROM `risks` a INNER JOIN `technology` b ON a.technology = b.value WHERE status != \\\"Closed\\\" AND project_version_id = $project GROUP BY b.name ORDER BY COUNT(*) DESC\" );\n\t$stmt->execute ();\n\t\n\t// Store the list in the array\n\t$array = $stmt->fetchAll ();\n\t\n\t// Close the database connection\n\tdb_close ( $db );\n\t\n\t// If the array is empty\n\tif (empty ( $array )) {\n\t\t$data [] = array (\n\t\t\t\t\"No Data Available\",\n\t\t\t\t0 \n\t\t);\n\t} \t// Otherwise\n\telse {\n\t\t// Create the data array\n\t\tforeach ( $array as $row ) {\n\t\t\t$data [] = array (\n\t\t\t\t\t$row ['name'],\n\t\t\t\t\t( int ) $row ['num'] \n\t\t\t);\n\t\t}\n\t\t\n\t\t$chart->series [] = array (\n\t\t\t\t'type' => \"pie\",\n\t\t\t\t'name' => \"Status\",\n\t\t\t\t'data' => $data \n\t\t);\n\t}\n\t\n\t$htmloutput = '';\n\t$htmloutput.= \"<div id=\\\"open_risk_technology_pie\\\"></div>\\n\";\n\t$htmloutput.= \"<script type=\\\"text/javascript\\\">\";\n\t$htmloutput.= $chart->render ( \"open_risk_technology_pie\" );\n\t$htmloutput.= \"</script>\\n\";\n\treturn $htmloutput;\n}", "public function SummaryBChart($meta,$dataset){\n// \t\t$rowLabels = array(\"A+\",\"A\",\"B+\",\"B\",\"C+\",\"C\",\"D+\",\"D\",\"F\"); \n\t\t$rowLabels = array(\"Very Good\",\"Good\",\"Average\",\"Poor\",\"very Poor\");\n\t\t\n\t\t//array( \"SupaWidget\", \"WonderWidget\", \"MegaWidget\", \"HyperWidget\" );\n\t\t//TODO: should come in $meta\n\t\t$chartWidth = 160;\n\t\t$chartHeight = 80;\n\t\t$chartTopMargin = 20;\n\t\t$chartBottomMargin = 20;\n\t\t$chartXPos = 20;\n\t\t$chartYPos = (int)$this->GetY() + $chartHeight + $chartTopMargin; //100;\n\t\t$chartXLabel = \"Grades\";\n\t\t$chartYLabel = \"Grading Score\";\n\t\t\n\t\t//TODO: should come in $meta\n\t\t$chartColours = array(\n\t\t\t\tarray( 255, 100, 100 ),\n\t\t\t\tarray( 100, 255, 100 ),\n\t\t\t\tarray( 100, 100, 255 ),\n\t\t\t\tarray( 255, 255, 100 ),\n\t\t\t\tarray( 255, 200, 200 ),\n// \t\t\t\tarray( 200, 255, 200 ),\n// \t\t\t\tarray( 200, 200, 255 ),\n// \t\t\t\tarray( 255, 255, 200 ),\n// \t\t\t\tarray( 50, 100, 200 ),\n\t\t);\n\t\t//TODO: should come in $dataset\n\t\t// Compute the X scale\n\t\t$data=$this->transpose($dataset);\n\t\t$xScale = count($rowLabels) / ( $chartWidth - 40 );\n\t\n\t\t// Compute the Y scale\n\t\n\t\t$maxTotal = 0;\n\t\n\t\tforeach ( $data as $dataRow ) {\n\t\t\t$totalSales = 0;\n\t\t\tforeach ($dataRow as $dataCell) $totalSales += $dataCell;\n\t\t\t$maxTotal = ( $totalSales > $maxTotal ) ? $totalSales : $maxTotal;\n\t\t}\n\t\n\t\t$yScale = $maxTotal / $chartHeight;\n\t\t$chartYStep = $maxTotal/10;\n\t\n\t\t// Compute the bar width\n\t\t$barWidth = ( 1 / $xScale ) / 1.5;\n\t\n\t\t// Add the axes:\n\t\t$this->SetFont( '', '', 10 );\n\t\n\t\t// X axis\n\t\t$this->Line( $chartXPos + 30, $chartYPos, $chartXPos + $chartWidth, $chartYPos );\n\t\t//$this->Arrow( $chartXPos + 30, $chartYPos, $chartXPos + $chartWidth, $chartYPos, 1 );\n\t\n\t\tfor ( $i=0; $i < count( $rowLabels ); $i++ ) {\n\t\t\t$this->SetXY( $chartXPos + 40 + $i / $xScale, $chartYPos );\n\t\t\t$this->Cell( $barWidth, 10, $rowLabels[$i], 0, 0, 'C' );\n\t\t}\n\t\n\t\t// Y axis\n\t\t$this->Line( $chartXPos + 30, $chartYPos, $chartXPos + 30, $chartYPos - $chartHeight - 8 );\n\t\t//$this->Arrow( $chartXPos + 30, $chartYPos+2, $chartXPos + 30, $chartYPos - $chartHeight - 8, 1 );\n\t\t//Y axis ticks\n\t\t//for ( $i=0; $i <= $maxTotal; $i += $chartYStep ) {\n\t\t//\t$this->SetXY( $chartXPos + 7, $chartYPos - 5 - $i / $yScale );\n\t\t//\t$this->Cell( 20, 10, '$' . number_format( $i ), 0, 0, 'R' );\n\t\t//\t$this->Line( $chartXPos + 28, $chartYPos - $i / $yScale, $chartXPos + 30, $chartYPos - $i / $yScale );\n\t\t//}\n\t\n\t\tfor ( $i=0; $i <= $maxTotal; $i += $chartYStep ) {\n\t\t\t$this->SetXY( $chartXPos + 7, $chartYPos - 5 - $i / $yScale );\n\t\t\t$this->Cell( 20, 10, '' . number_format( $i ), 0, 0, 'R' );\n\t\t\t$this->Line( $chartXPos + 28, $chartYPos - $i / $yScale, $chartXPos + $chartWidth, $chartYPos - $i / $yScale, array('dash'=>4) );\n\t\t}\n\t\t// Add the axis labels\n\t\t$this->SetFont( '', 'B', 12 );\n\t\t$this->SetXY( $chartWidth / 2 + 20, $chartYPos + 8 );\n\t\t$this->Cell( 30, 10, $chartXLabel, 0, 0, 'C' );\n\t\t$this->SetXY( $chartXPos + 7, $chartYPos - $chartHeight - 12 );\n\t\t$this->Cell( 20, 10, $chartYLabel, 0, 0, 'R' );\n\t\n\t\t// Create the bars\n\t\t$xPos = $chartXPos + 40;\n\t\t$bar = 0;\n\t\n\t\tforeach ($data as $dataRow ) {\n\t\t\t// Total up the sales figures for this product\n\t\t\t$totalSales = 0;\n\t\t\tforeach ( $dataRow as $dataCell ) $totalSales += $dataCell;\n\t\t\t// Create the bar\n\t\t\t$colourIndex = $bar % count( $chartColours );\n\t\t\t\t\n\t\t\t$this->SetFillColor( $chartColours[$colourIndex][0], $chartColours[$colourIndex][1], $chartColours[$colourIndex][2] );\n\t\t\t$this->Rect( $xPos, $chartYPos - ( $totalSales / $yScale ), $barWidth, $totalSales / $yScale, 'DF', array('all'=>array('dash'=>0)));\n\t\t\t$xPos += ( 1 / $xScale );\n\t\t\t$bar++;\n\t\t}\n\t\n\t}", "public function chart($id_chart, $title, $single) {\n $this->content_chart($id_chart, $title, $single);\n }", "public function actionChart()\n {\n $data = Account::find()->where('id_user='.Yii::$app->user->id)->all();\n $accounts = ArrayHelper::map($data, 'id', 'title');\n\n $operationsByAccount = [];\n foreach($accounts as $id_account=>$title){\n $operations = OperationController::findOperationsOfAccount($id_account);\n $operationsByAccount[$title] = $this->splitValueByMonths($operations);\n }\n\n $chart = new Chart($operationsByAccount);\n $data = $chart->data;\n\n return $this->render('chart', [\n 'data' => $data,\n ]);\n }", "public function chart2()\n {\n return view(\"chart2\");\n }", "public function charts()\n {\n return view('pages.charts');\n }", "public function ColumnChart($chart_div,$data,$size='300px'){\n\t//$dataArray[]= \"[\\\".$dataset[0].\"\\\", \". $dataset[1].\"]\"\n\t//$data = implode(\",\",$dataArray);\n\techo \"<div class='box-body' id='\".$chart_div.\"' style='height=\".$size.\"'></div>\";\n\techo \"<script>\n\tnew Chartkick.ColumnChart(\".$chart_div.\",[\".$data.\"]);\n\t</script>\";\n\t\n}", "public function get_main_chart() {\n\n\t\tif ( empty( $this->category_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a category to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t$chart_data = array();\n\t\t$index = 0;\n\n\t\tforeach ( $this->category_ids as $category_id ) {\n\n\t\t\t$category = get_term( $category_id, 'product_cat' );\n\t\t\t$data = $this->get_report_data( $category->term_id );\n\n\t\t\t$chart_data[ $category->term_id ]['category'] = $category->name;\n\t\t\t$chart_data[ $category->term_id ]['data'] = array_values( $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby ) );\n\n\t\t\t$index ++;\n\t\t}\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$index = 0;\n\t\t\t\t\t\t\tforeach ( $chart_data as $data ) {\n\t\t\t\t\t\t\t\t$color = isset( $this->chart_colors[ $index ] ) ? $this->chart_colors[ $index ] : $this->chart_colors[0];\n\t\t\t\t\t\t\t\t$width = $this->barwidth / sizeof( $chart_data );\n\t\t\t\t\t\t\t\t$offset = ( $width * $index );\n\t\t\t\t\t\t\t\t$series = $data['data'];\n\t\t\t\t\t\t\t\tforeach ( $series as $key => $series_data )\n\t\t\t\t\t\t\t\t\t$series[ $key ][0] = $series_data[0] + $offset;\n\t\t\t\t\t\t\t\techo '{\n\t\t\t\t\t\t\t\t\tlabel: \"' . esc_js( $data['category'] ) . '\",\n\t\t\t\t\t\t\t\t\tdata : jQuery.parseJSON( \"' . json_encode( $series ) . '\" ),\n\t\t\t\t\t\t\t\t\tcolor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\tbars : {\n\t\t\t\t\t\t\t\t\t\tfillColor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\t\tfill : true,\n\t\t\t\t\t\t\t\t\t\tshow : true,\n\t\t\t\t\t\t\t\t\t\tlineWidth: 1,\n\t\t\t\t\t\t\t\t\t\talign : \"center\",\n\t\t\t\t\t\t\t\t\t\tbarWidth : ' . $width * 0.75 . ',\n\t\t\t\t\t\t\t\t\t\tstack : false\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t' . $this->get_currency_tooltip() . ',\n\t\t\t\t\t\t\t\t\tenable_tooltip: true,\n\t\t\t\t\t\t\t\t\tprepend_label : true\n\t\t\t\t\t\t\t\t},';\n\t\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\treserveSpace: true,\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ); ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\ttickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals: 2,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: \"#aaa\" }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\n\t\t\t\t};\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "function open_risk_category_pie($project) {\n\t$chart = new Highchart ();\n\t\n\t$chart->chart->renderTo = \"open_risk_category_pie\";\n\t$chart->chart->plotBackgroundColor = null;\n\t$chart->chart->plotBorderWidth = null;\n\t$chart->chart->plotShadow = false;\n\t$chart->title->text = \"Categories\";\n\t\n\t$chart->tooltip->formatter = new HighchartJsExpr ( \"function() {\n return '<b>'+ this.point.name +'</b>: '+ this.point.y; }\" );\n\t\n\t$chart->plotOptions->pie->allowPointSelect = 1;\n\t$chart->plotOptions->pie->cursor = \"pointer\";\n\t$chart->plotOptions->pie->dataLabels->enabled = false;\n\t$chart->plotOptions->pie->showInLegend = 1;\n\t$chart->credits->enabled = false;\n\t\n\t// Open the database connection\n\t$db = db_open ();\n\t\n\t// Query the database\n\t$stmt = $db->prepare ( \"SELECT b.name, COUNT(*) AS num FROM `risks` a INNER JOIN `category` b ON a.category = b.value WHERE status != \\\"Closed\\\" AND project_version_id = $project GROUP BY b.name ORDER BY COUNT(*) DESC\" );\n\t$stmt->execute ();\n\t\n\t// Store the list in the array\n\t$array = $stmt->fetchAll ();\n\t\n\t// Close the database connection\n\tdb_close ( $db );\n\t\n\t// If the array is empty\n\tif (empty ( $array )) {\n\t\t$data [] = array (\n\t\t\t\t\"No Data Available\",\n\t\t\t\t0 \n\t\t);\n\t} \t// Otherwise\n\telse {\n\t\t// Create the data array\n\t\tforeach ( $array as $row ) {\n\t\t\t$data [] = array (\n\t\t\t\t\t$row ['name'],\n\t\t\t\t\t( int ) $row ['num'] \n\t\t\t);\n\t\t}\n\t\t\n\t\t$chart->series [] = array (\n\t\t\t\t'type' => \"pie\",\n\t\t\t\t'name' => \"Status\",\n\t\t\t\t'data' => $data \n\t\t);\n\t}\n\t\n\t$htmloutput = '';\n\t$htmloutput.= \"<div id=\\\"open_risk_category_pie\\\"></div>\\n\";\n\t$htmloutput.= \"<script type=\\\"text/javascript\\\">\";\n\t$htmloutput.= $chart->render ( \"open_risk_category_pie\" );\n\t$htmloutput.= \"</script>\\n\";\n\treturn $htmloutput;\n}", "function generateDetailChart($chartType,$result,$criteria,$chart_path)\r\n\t{\r\n \r\n\tif ($chartType==\"gw_load\") {\r\n\t\t\t\t\r\n\t\t\t\t$_SESSION[\"gw_criteria\"] = $criteria;\r\n\t\t\t\t$_SESSION[\"gwLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"gw_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name =$_SERVER[\"PHP_AUTH_USER\"]. \"gw_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$gw_id = $_SESSION[\"gw_id\"];\r\n\t\t\t\t$title = \"Gateway Load (\".$gw_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t//\tmysql_data_seek($result ,0);\r\n\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t$mon = date(\"M\", strtotime($row[\"login\"])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[\"login\"]));\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\r\n }\r\n\t \t \r\n/***************************************************************Generate Service Load Graph *********************************************************************************/\r\n\r\n\t\tif ($chartType==\"service_load\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"sv_criteria\"] = $criteria;\r\n\t\t\t\t\r\n\t\t \t\t$_SESSION[\"svLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$sv_id = $_SESSION[\"sv_id\"];\r\n\t\t\t\t$title = \"Service Load (\".$sv_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t \t \r\n/********************************************************************Generate Top Ten users Graph *************************************************************************/\r\n \r\n\t\tif ($chartType==\"top_ten_users\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"tt_users_criteria\"] = $criteria;\r\n\r\n\t\t\t$_SESSION[\"userLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$user_id = $_SESSION[\"user_id\"];\r\n\t\t\t\t$title = \"User Load (\".$user_id.\")\";\r\n\t\t\t\t\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\t\t\t}\r\n\r\n/**************************************************************Generate Direction Load Graph *******************************************************************************/\r\n\r\n\t\tif ($chartType==\"direction_load\") {\r\n\t\t \r\n\t\t \t$_SESSION[\"direction_criteria\"] = $criteria;\r\n\r\n\t\t\t $_SESSION[\"dirLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dir_id = $_SESSION[\"dir_id\"];\r\n\t\t\t\t$title = \"Direction Load (\".$dir_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t \t\t \t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\r\n/*********************************************************************Generate Destination host Load Graph *****************************************************************/\r\n\r\n\t\t\tif ($chartType==\"destination_host_load\") {\r\n\t\t\t\r\n\t\t\t\t$_SESSION[\"destination_host_criteria\"] = $criteria;\r\n\r\n\t\t\t \t$_SESSION[\"destLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dest_id = $_SESSION[\"dest_id\"];\r\n\t\t\t\t$title = \"Destination Host Load (\".$dest_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t}", "function open_risk_technology_pie()\n{\n $chart = new Highchart();\n\n $chart->chart->renderTo = \"open_risk_technology_pie\";\n $chart->chart->plotBackgroundColor = null;\n $chart->chart->plotBorderWidth = null;\n $chart->chart->plotShadow = false;\n $chart->title->text = \"Technologies\";\n\n $chart->tooltip->formatter = new HighchartJsExpr(\"function() {\n return '<b>'+ this.point.name +'</b>: '+ this.point.y; }\");\n\n $chart->plotOptions->pie->allowPointSelect = 1;\n $chart->plotOptions->pie->cursor = \"pointer\";\n $chart->plotOptions->pie->dataLabels->enabled = false;\n $chart->plotOptions->pie->showInLegend = 1;\n $chart->credits->enabled = false;\n\n // Open the database connection\n $db = db_open();\n\n // Query the database\n $stmt = $db->prepare(\"SELECT b.name, COUNT(*) AS num FROM `risks` a INNER JOIN `technology` b ON a.technology = b.value GROUP BY b.name ORDER BY COUNT(*) DESC\");\n $stmt->execute();\n\n // Store the list in the array\n $array = $stmt->fetchAll();\n\n // Close the database connection\n db_close($db);\n\n // Create the data array\n foreach ($array as $row)\n {\n $data[] = array($row['name'], (int)$row['num']);\n }\n\n $chart->series[] = array('type' => \"pie\",\n 'name' => \"Status\",\n 'data' => $data);\n\n echo \"<div id=\\\"open_risk_technology_pie\\\"></div>\\n\";\n echo \"<script type=\\\"text/javascript\\\">\";\n echo $chart->render(\"open_risk_technology_pie\");\n echo \"</script>\\n\";\n}", "public function run() {\n $assetUrl = Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets/');\n $this->_assetUrl = $assetUrl;\n\n // Appending holder div\n $this->htmlOptions['id'] = $this->getId();\n echo CHtml::openTag('div', $this->htmlOptions) . CHtml::closeTag('div');\n\n //including scripts\n $this->_includeScripts();\n\n // Get requested chart\n switch ($this->type) {\n case self::CHART_NORMAL: {\n $this->_getNDChart();\n break;\n }\n }\n }", "function epi_chartjs($category_field, $period_field, $value_field, $input_array, $type, $id, $pxheight = 400, $chart_title = \"Line Chart\", $opacity = 1) {\n\tif (is_array($input_array)) { \n\t\t$datasets = $input_array; \n\t} else { \n\t\treturn false; \n\t}\n\tif ($type == \"Line\" || $type == \"Area\") {\n\t\t$jstype = \"Line\";\n\t} else if ($type == \"Bar\" || $type ==\"HorizontalBar\") {\n\t\t$jstype = \"Bar\";\n\t}\n\t$count = count($datasets);\n\t$line_array['labels'] = explode(',', $datasets[0]['gc_labels']);\n\tforeach ($datasets as $key=>$dataset) {\n\t\t$line_array['datasets'][$key]['label'] = $dataset[$category_field];\n\t\t$line_array['datasets'][$key] = return_color_array(($key + 1), $count, $line_array['datasets'][$key], $opacity);\n\t\t$line_array['datasets'][$key]['data'] = explode(',',$dataset['gc_values']);\n\t}\n\t$html = '\n\t<div class=\"box box-primary\">\n\t<div class=\"box-header with-border\">\n\t\t<h3 class=\"box-title\">'.$chart_title.'</h3>\n\t\t<div class=\"box-tools pull-right\">\n\t\t<button type=\"button\" class=\"btn btn-box-tool\" data-widget=\"collapse\"><i class=\"fa fa-minus\"></i></button>\n\t\t<button type=\"button\" class=\"btn btn-box-tool\" data-widget=\"remove\"><i class=\"fa fa-times\"></i></button>\n\t\t</div>\n\t</div>\n\t<div class=\"box-body\">\n\t<div class=\"chart\">\n\t\t<canvas id=\"chart_'.$id.'\" style=\"height:'.intval($pxheight).'px\"></canvas>\n\t</div>\n\t</div>\n\t<!-- /.box-body -->\n\t</div>';\n\t$html.= '\n\t<script language=\"javascript\">\n\t var chartCanvas = $(\"#chart_'.$id.'\").get(0).getContext(\"2d\");\n // This will get the first returned node in the jQuery collection.\n var chart_'.$id.' = new Chart(chartCanvas);';\n\t$json_array = json_encode($line_array);\n\t$html.= '\n\tvar dynamicData = '.$json_array.';\n\t';\n\t$html.= 'var chartOptions = {\n\t\tdefaultFontFamily: \"\\'Source Sans Pro\\', sans-serif\",\n\t\tshowScale: true,\n\t\tscaleShowGridLines: false,\n\t\tscaleGridLineColor: \"rgba(0,0,0,.05)\",\n\t\tscaleGridLineWidth: 1,\n\t\tscaleShowHorizontalLines: true,\n\t\tscaleShowVerticalLines: true,\n\t\tbezierCurve: true,\n\t\tbezierCurveTension: 0.3,\n\t\tpointDot: true,\n\t\tpointDotRadius: 4,\n\t\tpointDotStrokeWidth: 1,\n\t\tpointHitDetectionRadius: 20,\n\t\tdatasetStroke: true,\n\t\tdatasetStrokeWidth: 2,\n\t\tdatasetFill: '.($type == \"Line\" ? \"false\" : \"true\").',\n\t\tlegendTemplate: \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\\"background-color:<%=datasets[i].strokeColor%>\\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\",\n\t\tmaintainAspectRatio: true,\n\t\tresponsive: true\n\t\t};\n\t\t//Create the line chart\n\t\tchart_'.$id.'.'.$jstype.'(dynamicData, chartOptions);\n\t\t</script>\n\t\t';\n\treturn $html;\n}", "function piechart($data, $label, $width, $img_file)\n{\n\n// true = show label, false = don't show label.\n$show_label = true;\n\n// true = show percentage, false = don't show percentage.\n$show_percent = true;\n\n// true = show text, false = don't show text.\n$show_text = true;\n\n// true = show parts, false = don't show parts.\n$show_parts = true;\n\n// 'square' or 'round' label.\n$label_form = 'round';\n\n\n\n// Colors of the slices.\n$colors = array('003366', 'CCD6E0', '7F99B2', 'F7EFC6', 'C6BE8C', 'CC6600', '990000', '520000', 'BFBFC1', '808080', '9933FF', 'CC6699', '99FFCC', 'FF6666', '3399CC', '99FF66', '3333CC', 'FF0033', '996699', 'FF00FF', 'CCCCFF', '000033', '99CC33', '996600', '996633', '996666', '3399CC', '663333');\n\n// true = use random colors, false = use colors defined above\n$random_colors = false;\n\n// Background color of the chart\n$background_color = 'F6F6F6';\n\n// Text color.\n$text_color = '000000';\n\n\n\n// true = darker shadow, false = lighter shadow...\n$shadow_dark = true;\n\n/***************************************************\n* DO NOT CHANGE ANYTHING BELOW THIS LINE!!! *\n****************************************************/\n\nif (!function_exists('imagecreate'))\n\tdie('Sorry, the script requires GD2 to work.');\n\n\n\n\n$img = ImageCreateTrueColor($width + getxtrawidth($data, $label), $height +getxtraheight($data, $label) );\n\nImageFill($img, 0, 0, colorHex($img, $background_color));\n\nforeach ($colors as $colorkode) \n{\n\t$fill_color[] = colorHex($img, $colorkode);\n\t$shadow_color[] = colorHexshadow($img, $colorkode, $shadow_dark);\n}\n\n$label_place = 5;\n\nif (is_array($label))\n{\n\tfor ($i = 0; $i < count($label); $i++) \n\t{\n\t\tif ($label_form == 'round' && $show_label)\n\t\t{\n\t\t\timagefilledellipse($img, $width + 11,$label_place + 5, 10, 10, colorHex($img, $colors[$i % count($colors)]));\n\t\t\timageellipse($img, $width + 11, $label_place + 5, 10, 10, colorHex($img, $text_color));\n\t\t}\n\t\telse if ($label_form == 'square' && $show_label)\n\t\t{\n\t\t\timagefilledrectangle($img, $width + 6, $label_place, $width + 16, $label_place + 10,colorHex($img, $colors[$i % count($colors)]));\n\t\t\timagerectangle($img, $width + 6, $label_place, $width + 16, $label_place + 10, colorHex($img, $text_color));\n\t\t}\n\n\t\tif ($show_percent)\n\t\t\t$label_output = $number[$i] . ' ';\n\t\tif ($show_text)\n\t\t\t$label_output = $label_output.$label[$i] . ' ';\n\t\tif ($show_parts)\n\t\t\t$label_output = $label_output . '- ' . $data[$i];\n\n\t\timagestring($img, '2', $width + 20, $label_place, $label_output, colorHex($img, $text_color));\n\t\t$label_output = '';\n\n\t\t$label_place = $label_place + 15;\n\t}\n}\n\n$centerX = round($width / 2);\n$centerY = round($height / 2);\n$diameterX = $width - 4;\n$diameterY = $height - 4;\n\n$data_sum = array_sum($data);\n\n$start = 270;\n\n$value_counter = 0;\n$value = 0;\n\nfor ($i = 0; $i < count($data); $i++) \n{\n\t$value += $data[$i];\n\t$end = ceil(($value/$data_sum) * 360) + 270;\n\t$slice[] = array($start, $end, $shadow_color[$value_counter % count($shadow_color)], $fill_color[$value_counter % count($fill_color)]);\n\t$start = $end;\n\t$value_counter++;\n}\n\nfor ($i = ($centerY + $shadow_height); $i > $centerY; $i--) \n{\n\tfor ($j = 0; $j < count($slice); $j++)\n\t{\n\t\tif ($slice[$j][0] == $slice[$j][1])\n\t\t\tcontinue;\n\t\tImageFilledArc($img, $centerX, $i, $diameterX, $diameterY, $slice[$j][0], $slice[$j][1], $slice[$j][2], IMG_ARC_PIE);\n\t}\n}\n\nfor ($j = 0; $j < count($slice); $j++)\n{\n\tif ($slice[$j][0] == $slice[$j][1])\n\t\tcontinue;\n\tImageFilledArc($img, $centerX, $centerY, $diameterX, $diameterY, $slice[$j][0], $slice[$j][1], $slice[$j][3], IMG_ARC_PIE);\n}\nheader('Content-type: image/jpg');\nImageJPEG($img, NULL, 100);\nImageDestroy($img);\n}", "function charts_shortcode( $atts ) {\n\n\t// Attribut par défauts pour les Shortcodes\n\t\n\textract( shortcode_atts(\n\t\tarray(\n\t\t\t'type' => 'pie',\n\t\t\t'title' => 'chart',\n\t\t\t'canvaswidth' => '250',\n\t\t\t'canvasheight' => '250',\n\t\t\t'width'\t\t\t => '100%',\n\t\t\t'height'\t\t => 'auto',\n\t\t\t'margin'\t\t => '',\n\t\t\t'relativewidth'\t => '1',\n\t\t\t'align' => '',\n\t\t\t'class'\t\t\t => '',\n\t\t\t'labels' => '',\n\t\t\t'data' => '30,50,100',\n\t\t\t'datasets' => '30,50,100 next 20,90,75',\n\t\t\t'colors' => '#69D2E7,#E0E4CC,#F38630,#96CE7F,#CEBC17,#CE4264',\n\t\t\t'fillopacity' => '0.7',\n\t\t\t'pointstrokecolor' => '#FFFFFF',\n\t\t\t'animation'\t\t => 'true',\n\t\t\t'scalefontsize' => '12',\n\t\t\t'scalefontcolor' => '#666',\n\t\t\t'scaleoverride' => 'false',\n\t\t\t'scalesteps' \t => 'null',\n\t\t\t'scalestepwidth' => 'null',\n\t\t\t'scalestartvalue' => 'null'\n\t\t), $atts )\n\t);\n\n\t// preparer la sauce\n\t\n\t$title = str_replace(' ', '', $title);\n\t$data = explode(',', str_replace(' ', '', $data));\n\t$datasets = explode(\"next\", str_replace(' ', '', $datasets));\n\n\t// checker les couleurs\n\n\tif ($colors != \"\") {\n\t\t$colors = explode(',', str_replace(' ','',$colors));\n\t} else {\n\t\t$colors = array('#69D2E7','#E0E4CC','#F38630','#96CE7F','#CEBC17','#CE4264');\n\t}\n\n\t(strpos($type, 'lar') !== false ) ? $type = 'PolarArea' : $type = ucwords($type);\n\t\n\t$currentchart = '<div class=\"'.$align.' '.$class.' icps-chart-wrap\" style=\"width:'.$width.'; height:'.$height.';margin:'.$margin.';\" data-proportion=\"'.$relativewidth.'\">';\n\t$currentchart .= '<canvas id=\"'.$title.'\" height=\"'.$canvasheight.'\" width=\"'.$canvaswidth.'\" class=\"icps_charts_canvas\" data-proportion=\"'.$relativewidth.'\"></canvas></div>\n\t<script>';\n\t$currentchart .= 'var '.$title.'Ops = {\n\t\tanimation: '.$animation.',';\n\n\tif ($type == 'Line' || $type == 'Radar' || $type == 'Bar' || $type == 'PolarArea') {\n\t\t$currentchart .=\t'scaleFontSize: '.$scalefontsize.',';\n\t\t$currentchart .=\t'scaleFontColor: \"'.$scalefontcolor.'\",';\n\t\t$currentchart .= 'scaleOverride:' .$scaleoverride.',';\n\t\t$currentchart .= 'scaleSteps:' \t .$scalesteps.',';\n\t\t$currentchart .= 'scaleStepWidth:' .$scalestepwidth.',';\n\t\t$currentchart .= 'scaleStartValue:' .$scalestartvalue;\n\t}\n\n\t$currentchart .= '}; ';\n\n\t// demarrer la bonne variable selon le type\n\tif ($type == 'Line' || $type == 'Radar' || $type == 'Bar' ) {\n\n\t\tcharts_compare_color_nbr($datasets, $colors);\n\t\t$total = count($datasets);\n\n\t\t// labels\n\n\t\t$currentchart .= 'var '.$title.'Data = {';\n\t\t$currentchart .= 'labels : [';\n\t\t$labelstrings = explode(',',$labels);\n\t\tfor ($j = 0; $j < count($labelstrings); $j++ ) {\n\t\t\t$currentchart .= '\"'.$labelstrings[$j].'\"';\n\t\t\tcharts_trailing_comma($j, count($labelstrings), $currentchart);\n\t\t}\n\t\t$currentchart .= \t'],';\n\t\t$currentchart .= 'datasets : [';\n\t} else {\n\t\tcharts_compare_color_nbr($data, $colors);\n\t\t$total = count($data);\n\t\t$currentchart .= 'var '.$title.'Data = [';\n\t}\n\n\t\t// creer une variable Javascript en fonction du type de chart demandé\n\n\t\tfor ($i = 0; $i < $total; $i++) {\n\n\t\t\tif ($type === 'Pie' || $type === 'Doughnut' || $type === 'PolarArea') {\n\t\t\t\t$currentchart .= '{\n\t\t\t\t\tvalue \t: '. $data[$i] .',\n\t\t\t\t\tcolor \t: '.'\"'. $colors[$i].'\"'.'\n\t\t\t\t}';\n\n\t\t\t} else if ($type === 'Bar') {\n\t\t\t\t$currentchart .= '{\n\t\t\t\t\tfillColor \t: \"rgba('. charts_hex2rgb( $colors[$i] ) .','.$colonbropacity.')\",\n\t\t\t\t\tstrokeColor : \"rgba('. charts_hex2rgb( $colors[$i] ) .',1)\",\n\t\t\t\t\tdata \t\t: ['.$datasets[$i].']\n\t\t\t\t}';\n\n\t\t\t} else if ($type === 'Line' || $type === 'Radar') {\n\t\t\t\t$currentchart .= '{\n\t\t\t\t\tfillColor \t: \"rgba('. charts_hex2rgb( $colors[$i] ) .','.$colonbropacity.')\",\n\t\t\t\t\tstrokeColor : \"rgba('. charts_hex2rgb( $colors[$i] ) .',1)\",\n\t\t\t\t\tpointColor \t: \"rgba('. charts_hex2rgb( $colors[$i] ) .',1)\",\n\t\t\t\t\tpointStrokeColor : \"'.$pointstrokecolor.'\",\n\t\t\t\t\tdata \t\t: ['.$datasets[$i].']\n\t\t\t\t}';\n\n\t\t\t} // fin des conditions de type\n\n\t\t\tcharts_trailing_comma($i, $total, $currentchart);\n\t\t}\n\n\t\t// fin des variables JS en foncton du type\n\n\t\tif ($type == 'Line' || $type == 'Radar' || $type == 'Bar') {\n\t\t\t$currentchart .=\t']};';\n\t\t} else {\n\t\t\t$currentchart .=\t'];';\n\t\t}\n\n\t\t$currentchart .= 'var wpChart'.$title.$type.' = new Chart(document.getElementById(\"'.$title.'\").getContext(\"2d\")).'.$type.'('.$title.'Data,'.$title.'Ops);\n\t</script>';\n\n\t// et on affiche le résultat final youhou !! \\o/\n\t\n\treturn $currentchart;\n}", "function StackedGraph ($data, $colors) {\n/*\n\nExample input values\n$data = array (\n\t \"[[1027, 144.89], {label: 'July'}]\",\n\t \"[[1086, 303.43], {label: 'Sept'}]\",\n\t \"[[1335, 167.26], {label: 'Oct'}]\"\n\t );\n$colors = \"'tan','green'\";\n*/\n jQueryPlugins (\"tufte-graph\");\n?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n jQuery('#stacked-graph').tufteBar({\n\t colors: [<?=$colors;?>],\n\t data: [ <?=join(\",\", $data);?>\n ],\n barLabel: function(index) {\n amount = ($(this[0]).sum()).toFixed(0);\n return '$' + $.tufteBar.formatNumber(amount);\n },\n axisLabel: function(index) { return this[1].label },\n legend: {\n data: [\"Wholesale\",\"Profit Margin\"],\n\n\t\t},\n });\n });\n </script>\n\n <div id='stacked-graph' class='graph' style='width: 270px; height: 200px;'></div>\n\t\n<?\n}", "public function getChartHtml()\n {\n $this->calculateEventDimensions();\n $chartNum = $this->getChartNum();\n\n $return = '';\n\n // if (!$this->initialized) $return .= $this->getInitializationHtml();\n\n list($decadeHtml, $yearHtml) = $this->getYearHtml();\n\n $return .= '<div class=\"chart\" id=\"chart-'.$chartNum.'\">'.\n '<div class=\"chart-controls-container\">'.\n '<div class=\"chart-controls-left\"></div>'.\n '<div class=\"chart-controls-right\"></div>'.\n '<div class=\"chart-scroll-container\">'.\n '<div class=\"chart-content\" style=\"width: '.$this->chartWidth.'px\">'.\n '<div class=\"chart-decade-container\">'. $decadeHtml.'</div>'.\n '<div class=\"chart-year-container\">'. $yearHtml.'</div>'.\n '<div class=\"chart-event-container\" style=\"width: '.$this->chartWidth.'px; height: '.$this->chartHeight.'px\">'.\n '<div class=\"chart-event-padding\">'.$this->getEventHtml().'</div>'.\n '</div>'.\n '<div class=\"chart-month-container\" style=\"width: '.$this->chartWidth.'px\"></div>'.\n '</div>'.\n '</div>'.\n '</div>'.\n '<div class=\"chart-info\">'.\n '<div class=\"chart-info-help\">Napsauta sotaa aikajanalla saadaksesi siitä lisätietoja</div>'.\n '</div>'.\n '</div>'.\n '<script type=\"text/javascript\">'.\n 'charts.push('.json_encode(['id' => 'chart-'.$chartNum, 'events' => $this->events, 'groups' => $this->groups]).');'.\n '</script>';\n\n return $return;\n }", "function drawDayChart($opt, $day, $month, $year, $trunk_name1, $trunk_name2, $channel_usage1, $channel_usage2, $report_model)\n\t{\n\t\tinclude('lib/GS_Chart.php');\n\n\t\t$values = array();\n\t\t$values2 = array();\n\t\t$labels = array();\n\t\t$usage1 = array();\n\t\t$usage2 = array();\n\n\t\t$max_value =100;\n\t\t//echo $opt; exit;\n\t\tif ($opt == 'month') {\n\n\t\t\tif (strlen($month)==1) $month = \"0$month\";\n\t\t\t$cur_month = date(\"Ym\");\n\t\t\t\n\t\t\t$provided_month = $year . $month;\n\t\t\t$numDayToPlot = $this->daysInMonth((int) $month, $year);\n\t\t\t$numX = $this->daysInMonth((int) $month, $year);\n\t\t\t$startI = 1;\n\t\t\tif ($cur_month==$provided_month) $maxX = date(\"d\");\n\t\t\telse if ($provided_month>$cur_month) $maxX = 0;\n\t\t\telse $maxX = $numX;\n\t\t\n\t\t\tif (is_array($channel_usage1)) {\n\t\t\t\tforeach ($channel_usage1 as $cusage) {\n\t\t\t\t\t$usage1[$cusage->log_date] = $cusage->value;\n\t\t\t\t\tif ($cusage->value>$max_value) $max_value = $cusage->value;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif (is_array($channel_usage2)) {\n\t\t\t\tforeach ($channel_usage2 as $cusage) {\n\t\t\t\t\t$usage2[$cusage->log_date] = $cusage->value;\n\t\t\t\t\tif ($cusage->value>$max_value) $max_value = $cusage->value;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tfor($i=$startI; $i<=$numX; $i++) {\n\t\t\t\t$_day = strlen($i)==1 ? \"$year-$month-0$i\" : \"$year-$month-$i\";\n\t\t\t\t$labels[] = \"$i\";\n\t\t\t\tif ($i<=$maxX) {\n\t\t\t\t\t$values[] = isset($usage1[$_day]) ? (int) $usage1[$_day] : 0;\n\t\t\t\t\t$values2[] = isset($usage2[$_day]) ? (int) $usage2[$_day] : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$months = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', \n\t\t\t'06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October',\n\t\t\t'11' => 'November', '12' => 'December');\n\t\t\t\n\t\t\t$chart_title = \"Temperature Report of $months[$month], $year\";\n\t\t\t$chart_x_legend_title = \"Day\";\n\t\t\t$chart_y_legend_title = 'Max Temperature (C)';\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$maxX = $day==$today ? date(\"H\") : 23;\n\t\t\tif($day>$today) $maxX = 0;\n\t\t\t$numX = 23;\n\t\t\t$startI = 0;\n\n\t\t\tif (is_array($channel_usage1)) {\n\t\t\t\tforeach ($channel_usage1 as $cusage) {\n\t\t\t\t\t$usage1[$cusage->log_hour] = $cusage->value;\n\t\t\t\t\tif ($cusage->value>$max_value) $max_value = $cusage->value;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif (is_array($channel_usage2)) {\n\t\t\t\tforeach ($channel_usage2 as $cusage) {\n\t\t\t\t\t$usage2[$cusage->log_hour] = $cusage->value;\n\t\t\t\t\tif ($cusage->value>$max_value) $max_value = $cusage->value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($day==$today) {\n\t\t\t\t$temps = $report_model->getCurrentTemperatures();\n\t\t\t\tif (!isset($usage1[$maxX])) $usage1[$maxX] = 0;\n\t\t\t\tif (!isset($usage2[$maxX])) $usage2[$maxX] = 0;\n\t\t\t\t\n\t\t\t\tif (is_array($temps)) {\n\t\t\t\t\tforeach ($temps as $tm) {\n\t\t\t\t\t\tif ($tm->item_code == 'A') {\n\t\t\t\t\t\t\tif ($usage1[$maxX] < $tm->value) $usage1[$maxX] = $tm->value;\n\t\t\t\t\t\t} else if ($tm->item_code == 'B') {\n\t\t\t\t\t\t\tif ($usage2[$maxX] < $tm->value) $usage2[$maxX] = $tm->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tfor($i=$startI; $i<=$numX; $i++) {\n\t\t\t\t$hour = strlen($i)==1 ? \"0$i\" : $i;\n\t\t\t\t$labels[] = \"$hour\";\n\t\t\t\tif($i<=$maxX) {\n\t\t\t\t\t$values[] = isset($usage1[$hour]) ? (int) $usage1[$hour] : 0;\n\t\t\t\t\t$values2[] = isset($usage2[$hour]) ? (int) $usage2[$hour] : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$chart_title = \"Temperature Report of $day\";\n\t\t\t$chart_x_legend_title = \"Hour\";\n\t\t\t$chart_y_legend_title = 'Temperature (C)';\n\t\t}\n\t\t\n\t\t$ystep_details = $this->calc_y_axis_values(0, $max_value, 5, 20);\n\n\t\t$chart = new GS_Chart($chart_title);\n\t\t$chart->set_x_axis_details($chart_x_legend_title, $labels);\n\t\t$chart->set_y_axis_details($chart_y_legend_title, $ystep_details[0], $ystep_details[1], $ystep_details[2]);\n\t\t$chart->add_line_dot_element($trunk_name1, $values, '#BB3939');\n\t\t//$chart->add_line_dot_element($trunk_name2, $values2);\n\t\techo $chart->toPrettyString();\n\t\texit;\n\t}" ]
[ "0.5831208", "0.5759848", "0.57333994", "0.5631029", "0.5600386", "0.5599379", "0.55765635", "0.5567689", "0.5561675", "0.5519688", "0.5454943", "0.5442974", "0.5441047", "0.5431268", "0.53767383", "0.5362275", "0.5355412", "0.5338681", "0.5312168", "0.528737", "0.52606034", "0.5238369", "0.5206204", "0.51994896", "0.51978177", "0.5197577", "0.51863396", "0.5162407", "0.51498616", "0.51492316" ]
0.6068307
0
setup decider to use for tests
protected function setUp() { $this->decider = new OLPBlackbox_Enterprise_CLK_Decider(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp(): void{\n $this->obj = new \\FightTheIce\\Coding\\ClassResolver(\"FightTheIce\\Coding\\ClassResolver\");\n }", "abstract protected function setup();", "public function setUp()\n {\n // Create a new Laravel container instance.\n $container = new Container;\n\n // Resolve the pricing calculator (and any type hinted dependencies)\n // and set to class attribute.\n $this->priceHolder = $container->make('PAMH\\\\PriceHolder');\n }", "public function setup() {}", "public function setUp()\n {\n $delegate = new \\Rougin\\Slytherin\\Container\\Container;\n\n $this->container = new \\Rougin\\Slytherin\\Container\\ReflectionContainer($delegate);\n }", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "public function setUp()\n {\n parent::setUp();\n\n $this->manager = $this->app->make(\\Arcanedev\\EmbedVideo\\Contracts\\ParserManager::class);\n }", "abstract function setup();", "function setUp() {\n\n $this->oResolverByName =new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter();\n\n }", "public function setUp()\n {\n $this->_standardLib = new \\App\\OOProgramming\\StandardLibrary;\n $this->_daughter = new \\App\\OOProgramming\\Daughter;\n }", "public function setUp()\n {\n // leading to an errant invalid class alias being reported.\n $this->container = $this->prophesize(ServiceManager::class);\n $this->container->willImplement(ContainerInterface::class);\n }", "protected function setUp()\n {\n $this->factory = new CallableReaderFactory();\n }", "public function setUp()\n {\n $this->config = array(\n 's1' => 'string',\n 's2' => 'str',\n 'i1' => 'integer',\n 'i2' => 'int',\n 'i3' => '+integer',\n 'i4' => '+int',\n 'i5' => '-integer',\n 'i6' => '-int',\n 'f1' => 'float',\n 'f2' => '+float',\n 'f3' => '-float',\n 'b' => 'boolean',\n 'a' => 'array',\n 'm' => array(true, 'false'),\n 'r' => '/^member/',\n );\n $this->helper = new ConfigValidator($this->config);\n }", "protected function setUp()\n\t{\n\t\t$this->instance = new WindwalkerAdapter;\n\t}", "protected function setup(){\n }", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }", "public function setup()\n {\n if (! PluginRegistry::isLoaderSet()) {\n $loader = $this->getMockClass(\n 'CubicMushroom\\WordpressCore\\Component\\Plugin\\PluginLoader',\n array('hook')\n );\n PluginRegistry::setLoader(new $loader);\n }\n }", "public function setUp()\n {\n $digitParser = new DefaultDigitParser();\n $this->accountNumberParser = new AccountNumberParser($digitParser);\n }", "public function setup();", "public function setup();", "protected function setUp(): void\n {\n $this->parser = $this->newParser();\n }", "protected function setUp(): void\n {\n $this->sorter = new NamesSorter(\n new MultiArraySorter(),\n new Transformer()\n );\n \n // This is to meet Liskov substitution principle, and also avoid PHPStorm warning.\n parent::setUp();\n }", "protected function setUp()\n {\n $this->parser = new Json;\n }", "protected function doSetup(): void\n {\n }", "public function setup()\n {\n //\n // we need to make sure that it is empty at the start of every\n // test\n InvokeMethod::onString(AllMatchingTypesList::class, 'resetCache');\n }", "public function setUp()\n {\n $this->_filteringEscaping = new \\App\\Security\\FilteringAndEscaping;\n }" ]
[ "0.66171515", "0.6526237", "0.6475473", "0.6463328", "0.64093226", "0.6391281", "0.6391281", "0.6391281", "0.6391281", "0.63887215", "0.63865054", "0.63430274", "0.62997884", "0.62950385", "0.6256116", "0.6248866", "0.62083644", "0.62063825", "0.6172184", "0.6144391", "0.6136377", "0.6132182", "0.61299807", "0.61299807", "0.611796", "0.6114862", "0.6108775", "0.6104321", "0.61019605", "0.6099129" ]
0.6612248
1
Tests that 1 disagreed gets marked as new
public function testOneDisagreedNoCancelIsNew() { $history = $this->getMockHistory(array( 'getCountDisagreed' => 1, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testTwoDisagreedNoCancelledIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function isMissed(): bool\n {\n return $this->status == 'missed';\n }", "public function getHasBeenRejectedBefore(): bool;", "abstract public function isUndeleting();", "abstract public function isUndeleting();", "public function isDeclined(): bool;", "function testGetNotReviewed()\n {\n $events = $this->GroupEvent->getNotReviewed(1);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), array(1, 2));\n\n //Test invalid event\n $events = $this->GroupEvent->getNotReviewed(999);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), null);\n }", "public function testNewlyEndedBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->subMonths(2),\n 'end_time' => now()->subMonths(1),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "public function testItemWithIdShouldNotBeConsideredNew()\n {\n $item = $this->createItem($this->faker->randomNumber());\n $this->assertFalse($item->isNew());\n }", "public function testAccessTokenAlreadyRevokedReturnsFalse(): void\n {\n // Collects a random User.\n $model = $this->model\n ->newQuery()\n ->where('revoked', true)\n ->inRandomOrder()\n ->first();\n\n // Performs test.\n $result = $this->repository->revoke(new AccessToken($model->getAttributes()));\n\n // Performs assertion.\n $this->assertFalse(\n $result,\n 'The revoke operation should have returned true'\n );\n }", "public function testFlagCreationNarrative()\n {\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = 1;\n $flagCreated->CommentID = NULL;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $insertedId = $flagCreated->FlagID;\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertEquals(1, $flagFetched->NarrativeID);\n $this->assertEquals(NULL, $flagFetched->CommentID);\n $this->assertEquals(\"Test\", $flagFetched->Comment);\n\n $flagFetched->delete();\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertNull($flagFetched);\n\n }", "public function testFreedIsFalse(): void\n {\n $this->assertFalse($this->get_reflection_property_value('freed'));\n }", "public function isVerwijderd( )\r\n {\r\n return false;\r\n }", "public function testFlagNarrativeRelationship()\n {\n $narrativeCreated = new Narrative;\n\n $date = date('Y-m-d H:i:s');\n\n $narrativeCreated->TopicID = 1;\n $narrativeCreated->CategoryID = 1;\n $narrativeCreated->LanguageID = 1;\n $narrativeCreated->DateCreated = $date;\n $narrativeCreated->Name = \"Test\";\n $narrativeCreated->Agrees = 1;\n $narrativeCreated->Disagrees = 1;\n $narrativeCreated->Indifferents = 1;\n $narrativeCreated->Published = true;\n\n $narrativeCreated->save();\n\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = 1;\n $flagCreated->CommentID = NULL;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $narrative = Flag::find(1)->narrative();\n $this->assertNotNull($narrative);\n\n }", "protected function isUnchanged() {}", "public function testCheckedOutBookingsAreNotDeleted(): void\n {\n $booking = Booking::factory()->createQuietly([\n 'start_time' => now()->subMonths(7),\n 'end_time' => now()->subMonths(6),\n 'state' => CheckedOut::class,\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertModelExists($booking);\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "public function testFutureBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->addMonths(1),\n 'end_time' => now()->addMonths(2),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "public function testCurrentBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->subMonth(),\n 'end_time' => now()->addMonth(),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "public function getIsDeletableAttribute()\n\t{\n\t\treturn $this->status->slug == 'new';\n\t}", "function isRedeemed() {\n // we get if it wasn't used yet\n return $this->getUsed_at() != '';\n }", "public function canBeRemoved() {}", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}", "public function testItemWithoutIdShouldBeConsideredNew()\n {\n $item = $this->createItem();\n $this->assertTrue($item->isNew());\n }", "function should_prevent_deletion( $delete, $post, $force_delete ) {\r\n\t\r\n\tif( $post->post_type === 'wpass_status' ) {\r\n\t\tif( true === is_status_assigned_to_open_ticket( $post ) ) {\r\n\t\t\t$delete = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $delete;\r\n}", "public function hasDifference() {return !!$this->_calculateDifference();}" ]
[ "0.67598754", "0.6726145", "0.65821505", "0.6568994", "0.58188975", "0.575409", "0.57220376", "0.57220376", "0.57193786", "0.56954604", "0.56541574", "0.5621423", "0.55667776", "0.55341274", "0.552515", "0.5442183", "0.5441015", "0.54278654", "0.5410108", "0.5404722", "0.53793716", "0.53674173", "0.5366236", "0.53586733", "0.5352754", "0.53515214", "0.5350462", "0.53366154", "0.5336469", "0.53285754" ]
0.6813711
0
Tests that 2 disagreed gets marked as cancel/disagreed
public function testTwoDisagreedNoCancelledIsDisagreed() { $history = $this->getMockHistory(array( 'getCountDisagreed' => 2, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function testCancelPresenceOrAbsence(): void {\n $this->drupalLogin($this->adminUser);\n $this->drupalGet($this->getPath());\n if ($this->dialogRouteTest) {\n $this->assertActionExists('edit-cancel', 'Cancel');\n }\n else {\n $this->assertActionNotExists('edit-cancel', 'Cancel');\n }\n }", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function cancellationRequested() : bool;", "public function testTwoDisciplinesDiffAmtSwap()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"MUSI\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 2 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}", "private static function filterCancelledOrNeedsUpdate() {\n\t\treturn Fns::reject( Logic::anyPass( [\n\t\t\tpipe(\n\t\t\t\tObj::prop( 'status' ),\n\t\t\t\tFns::unary( 'intval' ),\n\t\t\t\tLst::includes( Fns::__, [ ICL_TM_NOT_TRANSLATED, ICL_TM_ATE_CANCELLED ] )\n\t\t\t),\n\t\t\tObj::prop( 'needs_update' )\n\t\t] ) );\n\t}", "public function cancelAuthorizationShouldNotAddCancellationIfCancellationFails(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n $cancellationException = new HeidelpayApiException(\n 'Cancellation failed',\n 'something went wrong',\n ApiResponseCodes::API_ERROR_ALREADY_CANCELLED\n );\n $resourceSrvMock->expects($this->once())->method('createResource')->willThrowException($cancellationException);\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $this->expectException(HeidelpayApiException::class);\n $this->expectExceptionCode(ApiResponseCodes::API_ERROR_ALREADY_CANCELLED);\n $cancelSrv->cancelAuthorization($authorization, 12.122);\n $this->assertCount(0, $authorization->getCancellations());\n }", "public function test_user_cannot_both_upvote_and_downvote() {\n\n $user = User::create('[email protected]', 'secret', 'Jane Doe');\n $this->message->upvote($user);\n $this->message->downvote($user);\n $this->assertEquals(0, $this->message->getUpvotes());\n $this->assertEquals(1, $this->message->getDownvotes());\n\n $this->message->downvote($user);\n $this->message->upvote($user);\n $this->assertEquals(1, $this->message->getUpvotes());\n $this->assertEquals(0, $this->message->getDownvotes());\n\n }", "public function testConfirmWithoutCodeFail() {\n //avoid creating discounts with same referer and let the discount action be set before we test it\n sleep(1);\n\n // create new discount of type 2\n $discount = $this->createNewCustomerDiscount(array('type' => 2));\n\n $this->dispatch('/discount/confirm/referer/' . $referer);\n $this->assertController('discount');\n $this->assertAction('confirm');\n\n //test redirection, so no action shall be done on the discount page\n $this->assertResponseCode(302);\n }", "public function canBeCancelled()\n {\n return $this->isNotYetSubmitted();\n }", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "public function isCancelRequest(Order $order, array $postData);", "public function testTwoDisciplines()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 1 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function getDiscountCanceled();", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function testCanMakeMessageConjunctionTicket()\n {\n $opt = new DocRefundUpdateRefundOptions([\n 'originator' => '0001AA',\n 'originatorId' => '23491193',\n 'refundDate' => \\DateTime::createFromFormat('Ymd', '20031125'),\n 'ticketedDate' => \\DateTime::createFromFormat('Ymd', '20030522'),\n 'references' => [\n new Reference([\n 'type' => Reference::TYPE_TKT_INDICATOR,\n 'value' => 'Y'\n ]),\n new Reference([\n 'type' => Reference::TYPE_DATA_SOURCE,\n 'value' => 'F'\n ])\n ],\n 'tickets' => [\n new Ticket([\n 'number' => '22021541124593',\n 'ticketGroup' => [\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_1,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_2,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_3,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_4,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ])\n ]\n ]),\n new Ticket([\n 'number' => '22021541124604',\n 'ticketGroup' => [\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_1,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_2,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ])\n ]\n ])\n ],\n 'travellerPrioDateOfJoining' => \\DateTime::createFromFormat('Ymd', '20070101'),\n 'travellerPrioReference' => '0077701F',\n 'monetaryData' => [\n new MonetaryData([\n 'type' => MonetaryData::TYPE_BASE_FARE,\n 'amount' => 401.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_FARE_USED,\n 'amount' => 0.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_FARE_REFUND,\n 'amount' => 401.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_REFUND_TOTAL,\n 'amount' => 457.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_TOTAL_TAXES,\n 'amount' => 56.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'TP',\n 'amount' => 56.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'OBP',\n 'amount' => 0.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'TGV',\n 'amount' => 374.93,\n 'currency' => 'EUR'\n ])\n ],\n 'taxData' => [\n new TaxData([\n 'category' => 'H',\n 'rate' => 16.14,\n 'currencyCode' => 'EUR',\n 'type' => 'DE'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 3.45,\n 'currencyCode' => 'EUR',\n 'type' => 'YC'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 9.67,\n 'currencyCode' => 'EUR',\n 'type' => 'US'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 9.67,\n 'currencyCode' => 'EUR',\n 'type' => 'US'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 3.14,\n 'currencyCode' => 'EUR',\n 'type' => 'XA'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 4.39,\n 'currencyCode' => 'EUR',\n 'type' => 'XY'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 6.28,\n 'currencyCode' => 'EUR',\n 'type' => 'AY'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 4.00,\n 'currencyCode' => 'EUR',\n 'type' => 'DU'\n ]),\n new TaxData([\n 'category' => '701',\n 'rate' => 56.74,\n 'currencyCode' => 'EUR',\n 'type' => TaxData::TYPE_EXTENDED_TAXES\n ])\n ],\n 'formOfPayment' => [\n new FopOpt([\n 'fopType' => FopOpt::TYPE_MISCELLANEOUS,\n 'fopAmount' => 457.74,\n 'freeText' => [\n new FreeTextOpt([\n 'type' => 'CFP',\n 'freeText' => '##0##'\n ]),\n new FreeTextOpt([\n 'type' => 'CFP',\n 'freeText' => 'IDBANK'\n ])\n ]\n ])\n ],\n 'refundedRouteStations' => [\n 'FRA',\n 'MUC',\n 'JFK',\n 'BKK',\n 'FRA'\n ]\n ]);\n\n $msg = new UpdateRefund($opt);\n\n $this->assertNull($msg->ticketNumber);\n $this->assertNull($msg->structuredAddress);\n $this->assertEmpty($msg->refundedItinerary);\n $this->assertNull($msg->tourInformation);\n $this->assertNull($msg->commission);\n $this->assertNull($msg->pricingDetails);\n $this->assertNull($msg->travellerInformation);\n $this->assertEmpty($msg->interactiveFreeText);\n\n $this->assertEquals('0001AA', $msg->userIdentification->originator);\n $this->assertEquals('23491193', $msg->userIdentification->originIdentification->originatorId);\n\n $this->assertCount(2, $msg->dateTimeInformation);\n $this->assertEquals(UpdateRefund\\DateTimeInformation::OPT_DATE_OF_REFUND, $msg->dateTimeInformation[0]->businessSemantic);\n $this->assertEquals('25', $msg->dateTimeInformation[0]->dateTime->day);\n $this->assertEquals('11', $msg->dateTimeInformation[0]->dateTime->month);\n $this->assertEquals('2003', $msg->dateTimeInformation[0]->dateTime->year);\n\n $this->assertEquals(UpdateRefund\\DateTimeInformation::OPT_DATE_TICKETED, $msg->dateTimeInformation[1]->businessSemantic);\n $this->assertEquals('22', $msg->dateTimeInformation[1]->dateTime->day);\n $this->assertEquals('5', $msg->dateTimeInformation[1]->dateTime->month);\n $this->assertEquals('2003', $msg->dateTimeInformation[1]->dateTime->year);\n\n $this->assertCount(2, $msg->referenceInformation->referenceDetails);\n $this->assertEquals('Y', $msg->referenceInformation->referenceDetails[0]->value);\n $this->assertEquals(UpdateRefund\\ReferenceDetails::TYPE_TKT_INDICATOR, $msg->referenceInformation->referenceDetails[0]->type);\n $this->assertEquals('F', $msg->referenceInformation->referenceDetails[1]->value);\n $this->assertEquals(UpdateRefund\\ReferenceDetails::TYPE_DATA_SOURCE, $msg->referenceInformation->referenceDetails[1]->type);\n\n $this->assertCount(2, $msg->ticket);\n\n $this->assertEquals('22021541124593', $msg->ticket[0]->ticketInformation->documentDetails->number);\n $this->assertNull($msg->ticket[0]->ticketInformation->documentDetails->type);\n $this->assertCount(4, $msg->ticket[0]->ticketGroup);\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_1, $msg->ticket[0]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[0]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[0]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[0]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_2, $msg->ticket[0]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[1]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[1]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[1]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_3, $msg->ticket[0]->ticketGroup[2]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[2]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[2]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[2]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[2]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_4, $msg->ticket[0]->ticketGroup[3]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[3]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[3]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[3]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[3]->actionIdentification);\n\n $this->assertEquals('22021541124604', $msg->ticket[1]->ticketInformation->documentDetails->number);\n $this->assertNull($msg->ticket[1]->ticketInformation->documentDetails->type);\n $this->assertCount(2, $msg->ticket[1]->ticketGroup);\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_1, $msg->ticket[1]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[1]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[1]->ticketGroup[0]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[1]->ticketGroup[0]->referenceInformation);\n $this->assertNull($msg->ticket[1]->ticketGroup[0]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_2, $msg->ticket[1]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[1]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[1]->ticketGroup[1]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[1]->ticketGroup[1]->referenceInformation);\n $this->assertNull($msg->ticket[1]->ticketGroup[1]->actionIdentification);\n\n $this->assertEquals('01JAN07', $msg->travellerPriorityInfo->dateOfJoining);\n $this->assertEquals('0077701F', $msg->travellerPriorityInfo->travellerReference);\n $this->assertNull($msg->travellerPriorityInfo->company);\n\n $this->assertEquals(UpdateRefund\\MonetaryDetails::TYPE_BASE_FARE, $msg->monetaryInformation->monetaryDetails->typeQualifier);\n $this->assertEquals(401.00, $msg->monetaryInformation->monetaryDetails->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->monetaryDetails->currency);\n\n $this->assertCount(7, $msg->monetaryInformation->otherMonetaryDetails);\n\n $this->assertEquals('RFU', $msg->monetaryInformation->otherMonetaryDetails[0]->typeQualifier);\n $this->assertEquals(0.00, $msg->monetaryInformation->otherMonetaryDetails[0]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[0]->currency);\n $this->assertEquals('FRF', $msg->monetaryInformation->otherMonetaryDetails[1]->typeQualifier);\n $this->assertEquals(401.00, $msg->monetaryInformation->otherMonetaryDetails[1]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[1]->currency);\n $this->assertEquals('RFT', $msg->monetaryInformation->otherMonetaryDetails[2]->typeQualifier);\n $this->assertEquals(457.74, $msg->monetaryInformation->otherMonetaryDetails[2]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[2]->currency);\n $this->assertEquals('TXT', $msg->monetaryInformation->otherMonetaryDetails[3]->typeQualifier);\n $this->assertEquals(56.74, $msg->monetaryInformation->otherMonetaryDetails[3]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[3]->currency);\n $this->assertEquals('TP', $msg->monetaryInformation->otherMonetaryDetails[4]->typeQualifier);\n $this->assertEquals(56.74, $msg->monetaryInformation->otherMonetaryDetails[4]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[4]->currency);\n $this->assertEquals('OBP', $msg->monetaryInformation->otherMonetaryDetails[5]->typeQualifier);\n $this->assertEquals(0.00, $msg->monetaryInformation->otherMonetaryDetails[5]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[5]->currency);\n $this->assertEquals('TGV', $msg->monetaryInformation->otherMonetaryDetails[6]->typeQualifier);\n $this->assertEquals(374.93, $msg->monetaryInformation->otherMonetaryDetails[6]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[6]->currency);\n\n $this->assertCount(9, $msg->taxDetailsInformation);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[0]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[0]->taxDetails);\n $this->assertEquals('DE', $msg->taxDetailsInformation[0]->taxDetails[0]->type);\n $this->assertEquals('16.14', $msg->taxDetailsInformation[0]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[0]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[0]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[1]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[1]->taxDetails);\n $this->assertEquals('YC', $msg->taxDetailsInformation[1]->taxDetails[0]->type);\n $this->assertEquals(3.45, $msg->taxDetailsInformation[1]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[1]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[1]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[2]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[2]->taxDetails);\n $this->assertEquals('US', $msg->taxDetailsInformation[2]->taxDetails[0]->type);\n $this->assertEquals(9.67, $msg->taxDetailsInformation[2]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[2]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[2]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[3]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[3]->taxDetails);\n $this->assertEquals('US', $msg->taxDetailsInformation[3]->taxDetails[0]->type);\n $this->assertEquals(9.67, $msg->taxDetailsInformation[3]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[3]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[3]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[4]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[4]->taxDetails);\n $this->assertEquals('XA', $msg->taxDetailsInformation[4]->taxDetails[0]->type);\n $this->assertEquals(3.14, $msg->taxDetailsInformation[4]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[4]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[4]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[5]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[5]->taxDetails);\n $this->assertEquals('XY', $msg->taxDetailsInformation[5]->taxDetails[0]->type);\n $this->assertEquals(4.39, $msg->taxDetailsInformation[5]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[5]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[5]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[6]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[6]->taxDetails);\n $this->assertEquals('AY', $msg->taxDetailsInformation[6]->taxDetails[0]->type);\n $this->assertEquals(6.28, $msg->taxDetailsInformation[6]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[6]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[6]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[7]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[7]->taxDetails);\n $this->assertEquals('DU', $msg->taxDetailsInformation[7]->taxDetails[0]->type);\n $this->assertEquals(4.00, $msg->taxDetailsInformation[7]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[7]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[7]->taxDetails[0]->countryCode);\n\n $this->assertEquals('701', $msg->taxDetailsInformation[8]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[8]->taxDetails);\n $this->assertEquals(UpdateRefund\\TaxDetails::TYPE_EXTENDED_TAXES, $msg->taxDetailsInformation[8]->taxDetails[0]->type);\n $this->assertEquals(56.74, $msg->taxDetailsInformation[8]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[8]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[8]->taxDetails[0]->countryCode);\n\n $this->assertCount(1, $msg->fopGroup);\n $this->assertEquals(FormOfPayment::TYPE_MISCELLANEOUS, $msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->type);\n $this->assertEquals(457.74, $msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->amount);\n $this->assertNull($msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->authorisedAmount);\n $this->assertNull($msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->sourceOfApproval);\n $this->assertCount(2, $msg->fopGroup[0]->interactiveFreeText);\n $this->assertEquals('##0##', $msg->fopGroup[0]->interactiveFreeText[0]->freeText);\n $this->assertEquals('CFP', $msg->fopGroup[0]->interactiveFreeText[0]->freeTextQualification->informationType);\n $this->assertEquals(UpdateRefund\\FreeTextQualification::QUAL_CODED_AND_LITERAL_TEXT, $msg->fopGroup[0]->interactiveFreeText[0]->freeTextQualification->textSubjectQualifier);\n $this->assertEquals('IDBANK', $msg->fopGroup[0]->interactiveFreeText[1]->freeText);\n $this->assertEquals('CFP', $msg->fopGroup[0]->interactiveFreeText[1]->freeTextQualification->informationType);\n $this->assertEquals(UpdateRefund\\FreeTextQualification::QUAL_CODED_AND_LITERAL_TEXT, $msg->fopGroup[0]->interactiveFreeText[1]->freeTextQualification->textSubjectQualifier);\n\n $this->assertCount(5, $msg->refundedRoute->routingDetails);\n $this->assertEquals('FRA', $msg->refundedRoute->routingDetails[0]->station);\n $this->assertEquals('MUC', $msg->refundedRoute->routingDetails[1]->station);\n $this->assertEquals('JFK', $msg->refundedRoute->routingDetails[2]->station);\n $this->assertEquals('BKK', $msg->refundedRoute->routingDetails[3]->station);\n $this->assertEquals('FRA', $msg->refundedRoute->routingDetails[4]->station);\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "public function getHasBeenRejectedBefore(): bool;", "public function testForget()\n\t{\n\t\t$c = get_c();\n\n\t\t$result = $c->PostTask('tasks.add', array(2,2));\n $result->forget();\n\t\t$result->revoke();\n\t}", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function testTwoDisciplinesDiffAmtCourses()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"CPSC\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 2 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function testIsAvailableWithCanceledGuarantee()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_CANCELED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "function check_failures($parameters) \n\t{ \n\t\tif($this->has_type($parameters, 'cancel_principal')\n\t\t || $this->has_type($parameters, 'card_cancel_principal')\n\t\t)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}", "public function markAsCancelled() : void\n {\n $this->ends_at = Carbon::now()->toDateTimeString();\n $this->is_cancelled = 1;\n $this->is_active = 0;\n $this->stripe_status = StripeSubscription::STATUS_CANCELED;\n $this->updateOrFail();\n }" ]
[ "0.74521893", "0.70373327", "0.6315296", "0.63038063", "0.57395744", "0.56890845", "0.5681462", "0.56334496", "0.56164235", "0.5599066", "0.55465937", "0.545727", "0.5432743", "0.53712845", "0.5361333", "0.53519535", "0.5344831", "0.5328303", "0.531242", "0.5265989", "0.5263603", "0.5260737", "0.52453035", "0.5233752", "0.52137023", "0.5197113", "0.51960486", "0.51795053", "0.51788825", "0.5178762" ]
0.74224234
1
Tests that 1 confirmed_disagreed gets marked as new
public function testOneDisagreedNoCancelledIsNew() { $history = $this->getMockHistory(array( 'getCountConfirmedDisagreed' => 1, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function test_wp_create_user_request_confirmed_status() {\n\t\t$actual = wp_create_user_request( self::$non_registered_user_email, 'export_personal_data', array(), 'confirmed' );\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'request-confirmed', $post->post_status );\n\t}", "protected function sanityCheck(&$confirmed)\n\t\t{\n\t\t\t// because delete operation can not delete message\n\t\t\t// from different user\n\t\t\t\n\t\t\tif ($confirmed < 0 || $confirmed > 1)\n\t\t\t{\n\t\t\t\t$confirmed = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (!$this->randomKeyMatch())\n\t\t\t{\n\t\t\t\t$confirmed = 0;\n\t\t\t}\n\t\t}", "public function testTwoDisagreedNoCancelledIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function confirm() {\n\t\t\t\n\t\t\t$this->status = 'confirmed';\n\t\t\t$this->save();\n\t\t}", "public function acknowledge(): bool\n\t{\n\t\t$this->acknowledged_at = Carbon::now();\n\n\t\treturn $this->save();\n\t}", "public function confirm()\n {\n $this->confirmed = true;\n $this->confirmation_token = null;\n\n $this->save();\n }", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }", "public function testPending()\n {\n $this->assertTrue($this->kittyUser->isPending());\n $returnedKittyUser = $this->kittyUser->setPending(false);\n $this->assertSame($this->kittyUser, $returnedKittyUser);\n $this->assertFalse($this->kittyUser->isPending());\n }", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "public function mark_booking_confirmed() {\n if ( ! current_user_can( 'dokan_manage_bookings' ) ) {\n wp_die( __( 'You do not have sufficient permissions to access this page.', 'dokan' ) );\n }\n\n if ( ! check_admin_referer( 'wc-booking-confirm' ) ) {\n wp_die( __( 'You have taken too long. Please go back and retry.', 'dokan' ) );\n }\n\n $booking_id = isset( $_GET['booking_id'] ) && (int) $_GET['booking_id'] ? (int) $_GET['booking_id'] : '';\n\n if ( ! $booking_id ) {\n die;\n }\n\n // Additional check to see if Seller id is same as current user\n $seller = get_post_meta( $booking_id, '_booking_seller_id', true );\n\n if ( (int) $seller !== dokan_get_current_user_id() ) {\n wp_die( __( 'You do not have sufficient permissions to access this page.', 'dokan' ) );\n }\n\n $booking = get_wc_booking( $booking_id );\n\n if ( $booking->get_status() !== 'confirmed' ) {\n $booking->update_status( 'confirmed' );\n }\n\n wp_safe_redirect( wp_get_referer() );\n die();\n }", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function testItCanApproveASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/approve/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 1,\n ]);\n }", "function _wp_privacy_account_request_confirmed($request_id)\n {\n }", "public function confirmed()\n {\n return $this->rule('confirmed');\n }", "function isRedeemed() {\n // we get if it wasn't used yet\n return $this->getUsed_at() != '';\n }", "public function confirmingDeletion()\n {\n $this->confirmingExpenseDeletion = true;\n }", "public function testShouldGenerateConfirmationCodeOnSave()\n {\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive('userExists')\n ->with( $this->confide_user )\n ->andReturn( 0 )\n ->once();\n\n // Should send an email once\n ConfideUser::$app['mailer'] = m::mock( 'Mail' );\n ConfideUser::$app['mailer']->shouldReceive('send')\n ->andReturn( null )\n ->once();\n\n $this->populateUser();\n $this->confide_user->confirmation_code = '';\n $this->confide_user->confirmed = false;\n\n $old_cc = $this->confide_user->confirmation_code;\n\n $this->assertTrue( $this->confide_user->save() );\n\n $new_cc = $this->confide_user->confirmation_code;\n\n // Should have generated a new confirmation code\n $this->assertNotEquals( $old_cc, $new_cc );\n }", "public function testFlagNarrativeRelationship()\n {\n $narrativeCreated = new Narrative;\n\n $date = date('Y-m-d H:i:s');\n\n $narrativeCreated->TopicID = 1;\n $narrativeCreated->CategoryID = 1;\n $narrativeCreated->LanguageID = 1;\n $narrativeCreated->DateCreated = $date;\n $narrativeCreated->Name = \"Test\";\n $narrativeCreated->Agrees = 1;\n $narrativeCreated->Disagrees = 1;\n $narrativeCreated->Indifferents = 1;\n $narrativeCreated->Published = true;\n\n $narrativeCreated->save();\n\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = 1;\n $flagCreated->CommentID = NULL;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $narrative = Flag::find(1)->narrative();\n $this->assertNotNull($narrative);\n\n }", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "function _wp_privacy_account_request_confirmed_message($request_id)\n {\n }", "public function markAsPending() {\n $this->status = parent::STATUS_PENDING;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function subscriptionConfirmed()\n {\n return $this->status == 'CONFIRMED' ? true : false;\n }", "public function test__it_should_be_block_close_stock_removal_when_has_product_confirmed()\n {\n $removal = Removal::create();\n\n // enviado\n RemovalProduct::create([\n 'stock_removal_id' => $removal->id,\n 'status' => 2,\n ]);\n\n // confirmado\n RemovalProduct::create([\n 'stock_removal_id' => $removal->id,\n 'status' => 1,\n ]);\n\n $this->json('POST', \"/api/estoque/retirada/fechar/{$removal->id}\")\n ->seeStatusCode(400)\n ->seeJson([\n 'status' => 'ValidationFail'\n ]);\n }", "function mark_notification() {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\t\t\t$nID = pods_v_sanitized( 'nID', $_REQUEST );\n\t\t\t$value = ( pods_v( 'mark', $_REQUEST ) );\n\n\t\t\tif ( $nID && in_array( $value, array( 1, 0 ) ) ) {\n\t\t\t\t$id = ht_dms_notification_class()->viewed( $nID, null, $value );\n\n\t\t\t\tif ( $id == $nID ) {\n\t\t\t\t\twp_die( 1 );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twp_die( 0 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public function getHasBeenRejectedBefore(): bool;", "public function testFlagCreationNarrative()\n {\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = 1;\n $flagCreated->CommentID = NULL;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $insertedId = $flagCreated->FlagID;\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertEquals(1, $flagFetched->NarrativeID);\n $this->assertEquals(NULL, $flagFetched->CommentID);\n $this->assertEquals(\"Test\", $flagFetched->Comment);\n\n $flagFetched->delete();\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertNull($flagFetched);\n\n }", "public function isConfirmada(): bool\n {\n return $this->getStatus() === self::STATUS_CONFIRMADA;\n }" ]
[ "0.65873545", "0.6323322", "0.6242718", "0.6179043", "0.61374116", "0.60621715", "0.6042085", "0.6000938", "0.5991", "0.5928303", "0.58697534", "0.5827924", "0.58138883", "0.5786598", "0.5782922", "0.57350796", "0.5705499", "0.5698207", "0.56610835", "0.5638794", "0.5623922", "0.56104535", "0.5602116", "0.55992967", "0.5596045", "0.5595178", "0.55890757", "0.5557183", "0.55313903", "0.5529074" ]
0.6897816
0
Tests that 2 confirmed_disagreed gets marked as cancel/disagreed
public function testTwoCancelledNoDisagreedIsDisagreed() { $history = $this->getMockHistory(array( 'getCountConfirmedDisagreed' => 2, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTwoDisagreedNoCancelledIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "protected function sanityCheck(&$confirmed)\n\t\t{\n\t\t\t// because delete operation can not delete message\n\t\t\t// from different user\n\t\t\t\n\t\t\tif ($confirmed < 0 || $confirmed > 1)\n\t\t\t{\n\t\t\t\t$confirmed = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (!$this->randomKeyMatch())\n\t\t\t{\n\t\t\t\t$confirmed = 0;\n\t\t\t}\n\t\t}", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }", "public function testItCanApproveASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/approve/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 1,\n ]);\n }", "public function testCancelPresenceOrAbsence(): void {\n $this->drupalLogin($this->adminUser);\n $this->drupalGet($this->getPath());\n if ($this->dialogRouteTest) {\n $this->assertActionExists('edit-cancel', 'Cancel');\n }\n else {\n $this->assertActionNotExists('edit-cancel', 'Cancel');\n }\n }", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function testConfirmWithoutCodeFail() {\n //avoid creating discounts with same referer and let the discount action be set before we test it\n sleep(1);\n\n // create new discount of type 2\n $discount = $this->createNewCustomerDiscount(array('type' => 2));\n\n $this->dispatch('/discount/confirm/referer/' . $referer);\n $this->assertController('discount');\n $this->assertAction('confirm');\n\n //test redirection, so no action shall be done on the discount page\n $this->assertResponseCode(302);\n }", "function _wp_privacy_account_request_confirmed_message($request_id)\n {\n }", "public function test_wp_create_user_request_confirmed_status() {\n\t\t$actual = wp_create_user_request( self::$non_registered_user_email, 'export_personal_data', array(), 'confirmed' );\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'request-confirmed', $post->post_status );\n\t}", "function _wp_privacy_account_request_confirmed($request_id)\n {\n }", "public function testCanMakeMessageConjunctionTicket()\n {\n $opt = new DocRefundUpdateRefundOptions([\n 'originator' => '0001AA',\n 'originatorId' => '23491193',\n 'refundDate' => \\DateTime::createFromFormat('Ymd', '20031125'),\n 'ticketedDate' => \\DateTime::createFromFormat('Ymd', '20030522'),\n 'references' => [\n new Reference([\n 'type' => Reference::TYPE_TKT_INDICATOR,\n 'value' => 'Y'\n ]),\n new Reference([\n 'type' => Reference::TYPE_DATA_SOURCE,\n 'value' => 'F'\n ])\n ],\n 'tickets' => [\n new Ticket([\n 'number' => '22021541124593',\n 'ticketGroup' => [\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_1,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_2,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_3,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_4,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ])\n ]\n ]),\n new Ticket([\n 'number' => '22021541124604',\n 'ticketGroup' => [\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_1,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ]),\n new TickGroupOpt([\n 'couponNumber' => TickGroupOpt::COUPON_2,\n 'couponStatus' => TickGroupOpt::STATUS_REFUNDED,\n 'boardingPriority' => 'LH07A'\n ])\n ]\n ])\n ],\n 'travellerPrioDateOfJoining' => \\DateTime::createFromFormat('Ymd', '20070101'),\n 'travellerPrioReference' => '0077701F',\n 'monetaryData' => [\n new MonetaryData([\n 'type' => MonetaryData::TYPE_BASE_FARE,\n 'amount' => 401.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_FARE_USED,\n 'amount' => 0.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_FARE_REFUND,\n 'amount' => 401.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_REFUND_TOTAL,\n 'amount' => 457.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => MonetaryData::TYPE_TOTAL_TAXES,\n 'amount' => 56.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'TP',\n 'amount' => 56.74,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'OBP',\n 'amount' => 0.00,\n 'currency' => 'EUR'\n ]),\n new MonetaryData([\n 'type' => 'TGV',\n 'amount' => 374.93,\n 'currency' => 'EUR'\n ])\n ],\n 'taxData' => [\n new TaxData([\n 'category' => 'H',\n 'rate' => 16.14,\n 'currencyCode' => 'EUR',\n 'type' => 'DE'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 3.45,\n 'currencyCode' => 'EUR',\n 'type' => 'YC'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 9.67,\n 'currencyCode' => 'EUR',\n 'type' => 'US'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 9.67,\n 'currencyCode' => 'EUR',\n 'type' => 'US'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 3.14,\n 'currencyCode' => 'EUR',\n 'type' => 'XA'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 4.39,\n 'currencyCode' => 'EUR',\n 'type' => 'XY'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 6.28,\n 'currencyCode' => 'EUR',\n 'type' => 'AY'\n ]),\n new TaxData([\n 'category' => 'H',\n 'rate' => 4.00,\n 'currencyCode' => 'EUR',\n 'type' => 'DU'\n ]),\n new TaxData([\n 'category' => '701',\n 'rate' => 56.74,\n 'currencyCode' => 'EUR',\n 'type' => TaxData::TYPE_EXTENDED_TAXES\n ])\n ],\n 'formOfPayment' => [\n new FopOpt([\n 'fopType' => FopOpt::TYPE_MISCELLANEOUS,\n 'fopAmount' => 457.74,\n 'freeText' => [\n new FreeTextOpt([\n 'type' => 'CFP',\n 'freeText' => '##0##'\n ]),\n new FreeTextOpt([\n 'type' => 'CFP',\n 'freeText' => 'IDBANK'\n ])\n ]\n ])\n ],\n 'refundedRouteStations' => [\n 'FRA',\n 'MUC',\n 'JFK',\n 'BKK',\n 'FRA'\n ]\n ]);\n\n $msg = new UpdateRefund($opt);\n\n $this->assertNull($msg->ticketNumber);\n $this->assertNull($msg->structuredAddress);\n $this->assertEmpty($msg->refundedItinerary);\n $this->assertNull($msg->tourInformation);\n $this->assertNull($msg->commission);\n $this->assertNull($msg->pricingDetails);\n $this->assertNull($msg->travellerInformation);\n $this->assertEmpty($msg->interactiveFreeText);\n\n $this->assertEquals('0001AA', $msg->userIdentification->originator);\n $this->assertEquals('23491193', $msg->userIdentification->originIdentification->originatorId);\n\n $this->assertCount(2, $msg->dateTimeInformation);\n $this->assertEquals(UpdateRefund\\DateTimeInformation::OPT_DATE_OF_REFUND, $msg->dateTimeInformation[0]->businessSemantic);\n $this->assertEquals('25', $msg->dateTimeInformation[0]->dateTime->day);\n $this->assertEquals('11', $msg->dateTimeInformation[0]->dateTime->month);\n $this->assertEquals('2003', $msg->dateTimeInformation[0]->dateTime->year);\n\n $this->assertEquals(UpdateRefund\\DateTimeInformation::OPT_DATE_TICKETED, $msg->dateTimeInformation[1]->businessSemantic);\n $this->assertEquals('22', $msg->dateTimeInformation[1]->dateTime->day);\n $this->assertEquals('5', $msg->dateTimeInformation[1]->dateTime->month);\n $this->assertEquals('2003', $msg->dateTimeInformation[1]->dateTime->year);\n\n $this->assertCount(2, $msg->referenceInformation->referenceDetails);\n $this->assertEquals('Y', $msg->referenceInformation->referenceDetails[0]->value);\n $this->assertEquals(UpdateRefund\\ReferenceDetails::TYPE_TKT_INDICATOR, $msg->referenceInformation->referenceDetails[0]->type);\n $this->assertEquals('F', $msg->referenceInformation->referenceDetails[1]->value);\n $this->assertEquals(UpdateRefund\\ReferenceDetails::TYPE_DATA_SOURCE, $msg->referenceInformation->referenceDetails[1]->type);\n\n $this->assertCount(2, $msg->ticket);\n\n $this->assertEquals('22021541124593', $msg->ticket[0]->ticketInformation->documentDetails->number);\n $this->assertNull($msg->ticket[0]->ticketInformation->documentDetails->type);\n $this->assertCount(4, $msg->ticket[0]->ticketGroup);\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_1, $msg->ticket[0]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[0]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[0]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[0]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_2, $msg->ticket[0]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[1]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[1]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[1]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_3, $msg->ticket[0]->ticketGroup[2]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[2]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[2]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[2]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[2]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_4, $msg->ticket[0]->ticketGroup[3]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[0]->ticketGroup[3]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[0]->ticketGroup[3]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[0]->ticketGroup[3]->referenceInformation);\n $this->assertNull($msg->ticket[0]->ticketGroup[3]->actionIdentification);\n\n $this->assertEquals('22021541124604', $msg->ticket[1]->ticketInformation->documentDetails->number);\n $this->assertNull($msg->ticket[1]->ticketInformation->documentDetails->type);\n $this->assertCount(2, $msg->ticket[1]->ticketGroup);\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_1, $msg->ticket[1]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[1]->ticketGroup[0]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[1]->ticketGroup[0]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[1]->ticketGroup[0]->referenceInformation);\n $this->assertNull($msg->ticket[1]->ticketGroup[0]->actionIdentification);\n\n $this->assertEquals(UpdateRefund\\CouponDetails::COUPON_2, $msg->ticket[1]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnNumber);\n $this->assertEquals(UpdateRefund\\CouponDetails::STATUS_REFUNDED, $msg->ticket[1]->ticketGroup[1]->couponInformationDetails->couponDetails->cpnStatus);\n $this->assertEquals('LH07A', $msg->ticket[1]->ticketGroup[1]->boardingPriority->priorityDetails->description);\n $this->assertNull($msg->ticket[1]->ticketGroup[1]->referenceInformation);\n $this->assertNull($msg->ticket[1]->ticketGroup[1]->actionIdentification);\n\n $this->assertEquals('01JAN07', $msg->travellerPriorityInfo->dateOfJoining);\n $this->assertEquals('0077701F', $msg->travellerPriorityInfo->travellerReference);\n $this->assertNull($msg->travellerPriorityInfo->company);\n\n $this->assertEquals(UpdateRefund\\MonetaryDetails::TYPE_BASE_FARE, $msg->monetaryInformation->monetaryDetails->typeQualifier);\n $this->assertEquals(401.00, $msg->monetaryInformation->monetaryDetails->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->monetaryDetails->currency);\n\n $this->assertCount(7, $msg->monetaryInformation->otherMonetaryDetails);\n\n $this->assertEquals('RFU', $msg->monetaryInformation->otherMonetaryDetails[0]->typeQualifier);\n $this->assertEquals(0.00, $msg->monetaryInformation->otherMonetaryDetails[0]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[0]->currency);\n $this->assertEquals('FRF', $msg->monetaryInformation->otherMonetaryDetails[1]->typeQualifier);\n $this->assertEquals(401.00, $msg->monetaryInformation->otherMonetaryDetails[1]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[1]->currency);\n $this->assertEquals('RFT', $msg->monetaryInformation->otherMonetaryDetails[2]->typeQualifier);\n $this->assertEquals(457.74, $msg->monetaryInformation->otherMonetaryDetails[2]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[2]->currency);\n $this->assertEquals('TXT', $msg->monetaryInformation->otherMonetaryDetails[3]->typeQualifier);\n $this->assertEquals(56.74, $msg->monetaryInformation->otherMonetaryDetails[3]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[3]->currency);\n $this->assertEquals('TP', $msg->monetaryInformation->otherMonetaryDetails[4]->typeQualifier);\n $this->assertEquals(56.74, $msg->monetaryInformation->otherMonetaryDetails[4]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[4]->currency);\n $this->assertEquals('OBP', $msg->monetaryInformation->otherMonetaryDetails[5]->typeQualifier);\n $this->assertEquals(0.00, $msg->monetaryInformation->otherMonetaryDetails[5]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[5]->currency);\n $this->assertEquals('TGV', $msg->monetaryInformation->otherMonetaryDetails[6]->typeQualifier);\n $this->assertEquals(374.93, $msg->monetaryInformation->otherMonetaryDetails[6]->amount);\n $this->assertEquals('EUR', $msg->monetaryInformation->otherMonetaryDetails[6]->currency);\n\n $this->assertCount(9, $msg->taxDetailsInformation);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[0]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[0]->taxDetails);\n $this->assertEquals('DE', $msg->taxDetailsInformation[0]->taxDetails[0]->type);\n $this->assertEquals('16.14', $msg->taxDetailsInformation[0]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[0]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[0]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[1]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[1]->taxDetails);\n $this->assertEquals('YC', $msg->taxDetailsInformation[1]->taxDetails[0]->type);\n $this->assertEquals(3.45, $msg->taxDetailsInformation[1]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[1]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[1]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[2]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[2]->taxDetails);\n $this->assertEquals('US', $msg->taxDetailsInformation[2]->taxDetails[0]->type);\n $this->assertEquals(9.67, $msg->taxDetailsInformation[2]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[2]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[2]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[3]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[3]->taxDetails);\n $this->assertEquals('US', $msg->taxDetailsInformation[3]->taxDetails[0]->type);\n $this->assertEquals(9.67, $msg->taxDetailsInformation[3]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[3]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[3]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[4]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[4]->taxDetails);\n $this->assertEquals('XA', $msg->taxDetailsInformation[4]->taxDetails[0]->type);\n $this->assertEquals(3.14, $msg->taxDetailsInformation[4]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[4]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[4]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[5]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[5]->taxDetails);\n $this->assertEquals('XY', $msg->taxDetailsInformation[5]->taxDetails[0]->type);\n $this->assertEquals(4.39, $msg->taxDetailsInformation[5]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[5]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[5]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[6]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[6]->taxDetails);\n $this->assertEquals('AY', $msg->taxDetailsInformation[6]->taxDetails[0]->type);\n $this->assertEquals(6.28, $msg->taxDetailsInformation[6]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[6]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[6]->taxDetails[0]->countryCode);\n\n $this->assertEquals('H', $msg->taxDetailsInformation[7]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[7]->taxDetails);\n $this->assertEquals('DU', $msg->taxDetailsInformation[7]->taxDetails[0]->type);\n $this->assertEquals(4.00, $msg->taxDetailsInformation[7]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[7]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[7]->taxDetails[0]->countryCode);\n\n $this->assertEquals('701', $msg->taxDetailsInformation[8]->taxCategory);\n $this->assertCount(1, $msg->taxDetailsInformation[8]->taxDetails);\n $this->assertEquals(UpdateRefund\\TaxDetails::TYPE_EXTENDED_TAXES, $msg->taxDetailsInformation[8]->taxDetails[0]->type);\n $this->assertEquals(56.74, $msg->taxDetailsInformation[8]->taxDetails[0]->rate);\n $this->assertEquals('EUR', $msg->taxDetailsInformation[8]->taxDetails[0]->currencyCode);\n $this->assertNull($msg->taxDetailsInformation[8]->taxDetails[0]->countryCode);\n\n $this->assertCount(1, $msg->fopGroup);\n $this->assertEquals(FormOfPayment::TYPE_MISCELLANEOUS, $msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->type);\n $this->assertEquals(457.74, $msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->amount);\n $this->assertNull($msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->authorisedAmount);\n $this->assertNull($msg->fopGroup[0]->formOfPaymentInformation->formOfPayment->sourceOfApproval);\n $this->assertCount(2, $msg->fopGroup[0]->interactiveFreeText);\n $this->assertEquals('##0##', $msg->fopGroup[0]->interactiveFreeText[0]->freeText);\n $this->assertEquals('CFP', $msg->fopGroup[0]->interactiveFreeText[0]->freeTextQualification->informationType);\n $this->assertEquals(UpdateRefund\\FreeTextQualification::QUAL_CODED_AND_LITERAL_TEXT, $msg->fopGroup[0]->interactiveFreeText[0]->freeTextQualification->textSubjectQualifier);\n $this->assertEquals('IDBANK', $msg->fopGroup[0]->interactiveFreeText[1]->freeText);\n $this->assertEquals('CFP', $msg->fopGroup[0]->interactiveFreeText[1]->freeTextQualification->informationType);\n $this->assertEquals(UpdateRefund\\FreeTextQualification::QUAL_CODED_AND_LITERAL_TEXT, $msg->fopGroup[0]->interactiveFreeText[1]->freeTextQualification->textSubjectQualifier);\n\n $this->assertCount(5, $msg->refundedRoute->routingDetails);\n $this->assertEquals('FRA', $msg->refundedRoute->routingDetails[0]->station);\n $this->assertEquals('MUC', $msg->refundedRoute->routingDetails[1]->station);\n $this->assertEquals('JFK', $msg->refundedRoute->routingDetails[2]->station);\n $this->assertEquals('BKK', $msg->refundedRoute->routingDetails[3]->station);\n $this->assertEquals('FRA', $msg->refundedRoute->routingDetails[4]->station);\n }", "public function testIsAvailableWithCanceledGuarantee()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_CANCELED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "public function isConfirmada(): bool\n {\n return $this->getStatus() === self::STATUS_CONFIRMADA;\n }", "function ctr_validateConfirmation(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n if ($reservation->persons AND $reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Please, do not play with the URL.\\n\";\n\n return false;\n}", "public function declineMultiple(){\n\t\tif(isset($_SESSION['admin_email'])){\n\t\t\t$this->model(\"AdminApproveModel\");\n\t\t\tif(isset($_POST['admin_decline_all'])){\n\t\t\t$approve_all = $this->sanitizeString($_POST['admin_decline_all']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\t$check_all = $this->sanitizeString($_POST['admin_check_all']);\n\t\t\tif(!empty($check_all)){\n\t\t\t\tAdminApproveModel::where('id', $id)->delete();\n\t\t\t}\n\t\t}\n\t}\n\t}", "public function test__it_should_be_block_close_stock_removal_when_has_product_confirmed()\n {\n $removal = Removal::create();\n\n // enviado\n RemovalProduct::create([\n 'stock_removal_id' => $removal->id,\n 'status' => 2,\n ]);\n\n // confirmado\n RemovalProduct::create([\n 'stock_removal_id' => $removal->id,\n 'status' => 1,\n ]);\n\n $this->json('POST', \"/api/estoque/retirada/fechar/{$removal->id}\")\n ->seeStatusCode(400)\n ->seeJson([\n 'status' => 'ValidationFail'\n ]);\n }", "private static function filterCancelledOrNeedsUpdate() {\n\t\treturn Fns::reject( Logic::anyPass( [\n\t\t\tpipe(\n\t\t\t\tObj::prop( 'status' ),\n\t\t\t\tFns::unary( 'intval' ),\n\t\t\t\tLst::includes( Fns::__, [ ICL_TM_NOT_TRANSLATED, ICL_TM_ATE_CANCELLED ] )\n\t\t\t),\n\t\t\tObj::prop( 'needs_update' )\n\t\t] ) );\n\t}", "public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}", "public function mark_booking_confirmed() {\n if ( ! current_user_can( 'dokan_manage_bookings' ) ) {\n wp_die( __( 'You do not have sufficient permissions to access this page.', 'dokan' ) );\n }\n\n if ( ! check_admin_referer( 'wc-booking-confirm' ) ) {\n wp_die( __( 'You have taken too long. Please go back and retry.', 'dokan' ) );\n }\n\n $booking_id = isset( $_GET['booking_id'] ) && (int) $_GET['booking_id'] ? (int) $_GET['booking_id'] : '';\n\n if ( ! $booking_id ) {\n die;\n }\n\n // Additional check to see if Seller id is same as current user\n $seller = get_post_meta( $booking_id, '_booking_seller_id', true );\n\n if ( (int) $seller !== dokan_get_current_user_id() ) {\n wp_die( __( 'You do not have sufficient permissions to access this page.', 'dokan' ) );\n }\n\n $booking = get_wc_booking( $booking_id );\n\n if ( $booking->get_status() !== 'confirmed' ) {\n $booking->update_status( 'confirmed' );\n }\n\n wp_safe_redirect( wp_get_referer() );\n die();\n }", "private function confirm_approval_right($ngo_and_coop_approval=false, $biz_prem_approval=false, $others_approval=false)\n {\n $tasks_performer = new TasksPerformer;\n if (($ngo_and_coop_approval && !$tasks_performer->is_coop_and_ngo_director())\n || ($biz_prem_approval && !$tasks_performer->is_business_premises_director())\n || ($others_approval && !$tasks_performer->is_director_for_others())\n ) {\n $result = array();\n $result[\"info\"] = \"Sorry! This action cannot be completed\";\n $result[\"status\"] = \"success\";\n $result = json_encode($result);\n echo $result;\n die();\n }\n }", "public function cancellationRequested() : bool;", "public function isCancelRequest(Order $order, array $postData);", "public function testTwoDisciplinesDiffAmtSwap()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"MUSI\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 2 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }" ]
[ "0.6955699", "0.6690282", "0.64127743", "0.6129533", "0.5875573", "0.5846233", "0.5741694", "0.5722742", "0.5672198", "0.5627346", "0.5607549", "0.5585798", "0.5580044", "0.5552409", "0.5528225", "0.5516798", "0.5495939", "0.5483847", "0.5474092", "0.54527366", "0.5394605", "0.5388779", "0.5366256", "0.5352017", "0.534765", "0.5337937", "0.532858", "0.53246826", "0.53017557", "0.529107" ]
0.7135051
0
Tests one disagreed and one confirmed disagreed gets marked as cancel/disagreed
public function testOneCancelledOneDisagreedIsDisagreed() { $history = $this->getMockHistory(array( 'getCountDisagreed' => 1, 'getCountConfirmedDisagreed' => 1, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testTwoDisagreedNoCancelledIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function disapprove()\n {\n return $this->approve(false);\n }", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}", "public function testConfirmWithoutCodeFail() {\n //avoid creating discounts with same referer and let the discount action be set before we test it\n sleep(1);\n\n // create new discount of type 2\n $discount = $this->createNewCustomerDiscount(array('type' => 2));\n\n $this->dispatch('/discount/confirm/referer/' . $referer);\n $this->assertController('discount');\n $this->assertAction('confirm');\n\n //test redirection, so no action shall be done on the discount page\n $this->assertResponseCode(302);\n }", "public function testCancelPresenceOrAbsence(): void {\n $this->drupalLogin($this->adminUser);\n $this->drupalGet($this->getPath());\n if ($this->dialogRouteTest) {\n $this->assertActionExists('edit-cancel', 'Cancel');\n }\n else {\n $this->assertActionNotExists('edit-cancel', 'Cancel');\n }\n }", "public function mtii_signed_doc_disapproval()\n {\n $this->mtii_verify_ajax_nonce($_REQUEST['approval_nonce'], \"doc-upload-approval-nonce\");\n $this->check_if_user_is_admin();\n if (isset($_REQUEST[\"reg_catg\"]) && ($_REQUEST[\"reg_catg\"]==\"Cooperative\" || $_REQUEST[\"reg_catg\"]==\"ngoAndCbo\")) {\n $this->confirm_approval_right(true);\n $tasks_performer = new TasksPerformer;\n $invoice_info_from_db = $tasks_performer->get_invoice_details_from_db($_REQUEST[\"doc_title\"]);\n $invoice_info_from_cp = $tasks_performer->get_invoice_as_cpt($_REQUEST[\"doc_title\"]);\n $inv_sub_catg_from_cp = get_post_meta($invoice_info_from_cp->ID, 'invoice_sub_category', true);\n $invoice_sub_catg_db = isset($invoice_info_from_db->invoice_sub_category) ?\n $invoice_info_from_db->invoice_sub_category : null;\n if ($invoice_info_from_db && $invoice_info_from_cp\n && (($inv_sub_catg_from_cp===\"replacement\" && $invoice_sub_catg_db===\"replacement\")\n || ($inv_sub_catg_from_cp===\"used-replacement\" && $invoice_sub_catg_db===\"used-replacement\"))\n ) {\n $update_info = $this->mtii_decline_cert_replacement($_REQUEST[\"doc_title\"]);\n $update_info[\"type\"] = \"Replacement\";\n } else if ($invoice_info_from_db && $invoice_info_from_cp\n && (($inv_sub_catg_from_cp===\"legal-search\" && $invoice_sub_catg_db===\"legal-search\")\n || ($inv_sub_catg_from_cp===\"used-legal-search\" && $invoice_sub_catg_db===\"used-legal-search\"))\n ) {\n $update_info = $this->mtii_decline_legal_search($_REQUEST[\"doc_title\"]);\n $update_info[\"type\"] = \"Legal Search\";\n } else {\n $update_info = $this->mtii_decline_registration($_REQUEST[\"doc_title\"], $_REQUEST[\"doc_id\"], $_REQUEST[\"reg_catg\"]);\n }\n } else if (isset($_REQUEST[\"reg_catg\"]) && $_REQUEST[\"reg_catg\"]==\"Business Premise\") {\n $this->confirm_approval_right(false, true);\n $update_info = $this->mtii_decline_biz_premises_reg($_REQUEST[\"doc_title\"], $_REQUEST[\"doc_id\"]);\n } else {\n $update_info = array(\"this_is_it\"=>\"Here we go\", \"status\"=>\"Approved\");\n }\n $this->prepare_to_send_response($update_info);\n }", "public function getDiscountCanceled();", "public function cancellationRequested() : bool;", "#[@test]\n public function reasonOnly() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation \"Out of office\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertEquals('Out of office', $action->reason);\n }", "public function isRejected() {\n\t\treturn $this->approved == -1;\n\t}", "public function isMissed(): bool\n {\n return $this->status == 'missed';\n }", "public function getHasBeenRejectedBefore(): bool;", "public function testIsAvailableWithCanceledGuarantee()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_CANCELED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function getBaseDiscountCanceled();", "public function testIsMarkedUndoneIfDone()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $title = $this->task->getTitle();\n $this->task->setIsDone(true);\n $this->logInAsUser();\n $this->client->request('GET', '/tasks/'.$id.'/toggle');\n\n $isDone = $this->task->getIsDone();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertEquals(false, $isDone);\n $this->assertContains('Superbe! La tâche '.$title.' a bien été marquée comme à faire.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "private static function filterCancelledOrNeedsUpdate() {\n\t\treturn Fns::reject( Logic::anyPass( [\n\t\t\tpipe(\n\t\t\t\tObj::prop( 'status' ),\n\t\t\t\tFns::unary( 'intval' ),\n\t\t\t\tLst::includes( Fns::__, [ ICL_TM_NOT_TRANSLATED, ICL_TM_ATE_CANCELLED ] )\n\t\t\t),\n\t\t\tObj::prop( 'needs_update' )\n\t\t] ) );\n\t}", "function testResendVerification() {\n $this->assertFalse($this->oObject->resendVerification());\n }", "public function testAccessTokenAlreadyRevokedReturnsFalse(): void\n {\n // Collects a random User.\n $model = $this->model\n ->newQuery()\n ->where('revoked', true)\n ->inRandomOrder()\n ->first();\n\n // Performs test.\n $result = $this->repository->revoke(new AccessToken($model->getAttributes()));\n\n // Performs assertion.\n $this->assertFalse(\n $result,\n 'The revoke operation should have returned true'\n );\n }", "public function test_completed_request_does_not_block_new_request_for_unregistered_user() {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID' => self::$request_id,\n\t\t\t\t'post_author' => 0,\n\t\t\t\t'post_title' => self::$non_registered_user_email,\n\t\t\t\t'post_status' => 'request-failed', // Not 'request-pending' or 'request-confirmed'.\n\t\t\t)\n\t\t);\n\n\t\t$actual = wp_create_user_request( self::$non_registered_user_email, 'export_personal_data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 0, (int) $post->post_author );\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( self::$non_registered_user_email, $post->post_title );\n\t\t$this->assertSame( 'request-pending', $post->post_status );\n\t\t$this->assertSame( 'user_request', $post->post_type );\n\t}", "public function markAsUndone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 0\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }" ]
[ "0.74385256", "0.7373181", "0.6958194", "0.6842848", "0.6082306", "0.60353696", "0.58996624", "0.58770293", "0.5804412", "0.57695234", "0.5736544", "0.5701384", "0.569139", "0.5688771", "0.5687657", "0.568283", "0.5682142", "0.5634629", "0.5610113", "0.5608588", "0.55604", "0.55550855", "0.5548533", "0.5532188", "0.5531566", "0.55294013", "0.5520649", "0.55057776", "0.5504508", "0.54966867" ]
0.75115967
0
Tests that react loans take precedence over disagreed
public function testReactTakesPrecedenceOverDisagreed() { $history = $this->getMockHistory(array( 'getCountPaid' => 1, 'getCountDisagreed' => 2, )); $result = $this->decider->getDecision($history); $this->assertEquals( OLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT, $result ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTwoDisagreedNoCancelledIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}", "public function test_user_cannot_both_upvote_and_downvote() {\n\n $user = User::create('[email protected]', 'secret', 'Jane Doe');\n $this->message->upvote($user);\n $this->message->downvote($user);\n $this->assertEquals(0, $this->message->getUpvotes());\n $this->assertEquals(1, $this->message->getDownvotes());\n\n $this->message->downvote($user);\n $this->message->upvote($user);\n $this->assertEquals(1, $this->message->getUpvotes());\n $this->assertEquals(0, $this->message->getDownvotes());\n\n }", "public function testUnffinishedStrike()\n\t{\n\t\t$this->player\n\t\t\t\t->addRoll(10)\n\t\t\t\t->addRoll(5);\n\t\t$this->assertEquals(0, $this->player->getScore());\n\t}", "public function testNonDefaultOmnipotence () {\n $this->expectException(BadFunctionCallException::class);\n\n $this->instance->spreadLove();\n }", "public function checkObsolescenceOfOrderStatus()\n {\n /** @var Emagedev_Trello_Model_Observer $observer */\n $observer = Mage::getModel($this->alias);\n\n $helperMock = $this->mockHelper('trello/card', array('archiveOrder', 'markOrderOutdated'));\n\n $helperMock\n ->expects($this->once())\n ->method('markOrderOutdated')\n ->with($this->callback(function($order){\n if ($this->expected()->getOutdated() == $order->getId()) {\n return $order;\n }\n\n return false;\n }));\n\n $helperMock\n ->expects($this->once())\n ->method('archiveOrder')\n ->with($this->callback(function($order){\n if ($this->expected()->getArchived() == $order->getId()) {\n return $order;\n }\n\n return false;\n }));\n\n $helperMock->replaceByMock('helper');\n\n $orderMock = $this->mockModel('sales/order', array('getUpdatedAt'));\n\n $orderMock\n ->expects($this->any())\n ->method('getUpdatedAt')\n ->willReturn($this->callback(function($order) {\n if (\n $order->getId() == $this->expected()->getOutdated() ||\n $order->getId() == $this->expected()->getArchived()\n ) {\n $datetime = new DateTime('now');\n $datetime->sub(new DateInterval('D5'));\n\n return $datetime->format(DateTime::W3C);\n }\n }));\n\n $orderMock->replaceByMock('model');\n\n $observer->markOrArchiveOutdatedOrders(new Varien_Event_Observer());\n }", "public function shouldRefund()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney < $paidMoney;\n }", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }", "public function testDaughterCanNotCallMotherPrivate(): void\n {\n $this->expectException(\\Teknoo\\States\\Proxy\\Exception\\MethodNotImplemented::class);\n\n $daughterInstance = new Daughter();\n $daughterInstance->enableState(StateTwo::class)\n ->enableState(StateThree::class);\n\n $daughterInstance->methodRecallMotherPrivate();\n }", "public function testWeaklingsCauseBounty()\n {\n if (!(defined('DEBUG') && DEBUG)) {\n $this->markTestSkipped(); // No merchant2 in non-debug scenarios for now.\n } else {\n $merchant = new Npc('merchant2');\n $this->assertGreaterThan(0, $merchant->bountyMod());\n $villager = new Npc('peasant2');\n $this->assertGreaterThan(0, $villager->bountyMod());\n }\n }", "public function testOverloadedState(): void\n {\n $motherInstance = new Mother();\n $motherInstance->enableState(\\Teknoo\\Tests\\Support\\Extendable\\Mother\\States\\StateOne::class);\n self::assertEquals(123, $motherInstance->method1());\n self::assertEquals(456, $motherInstance->method2());\n\n $daughterInstance = new Daughter();\n $daughterInstance->enableState(StateOne::class);\n self::assertEquals(321, $daughterInstance->method3());\n self::assertEquals(654, $daughterInstance->method4());\n\n $fail = false;\n try {\n $daughterInstance->method1();\n } catch (MethodNotImplemented $e) {\n $fail = true;\n } catch (\\Exception $e) {\n self::fail($e->getMessage());\n\n return;\n }\n\n self::assertTrue($fail, 'Error, the method 3 are currently not available in enabled states');\n\n $daughterInstance->disableAllStates();\n $fail = false;\n try {\n $daughterInstance->method3();\n } catch (MethodNotImplemented $e) {\n $fail = true;\n } catch (\\Exception $e) {\n self::fail($e->getMessage());\n }\n\n self::assertTrue($fail, 'Error, the method 3 are currently not available in enabled states');\n\n $daughterInstance->enableState(\\Teknoo\\Tests\\Support\\Extendable\\Mother\\States\\StateOne::class);\n self::assertEquals(321, $daughterInstance->method3());\n self::assertEquals(654, $daughterInstance->method4());\n\n try {\n $daughterInstance->method1();\n } catch (MethodNotImplemented $e) {\n return;\n } catch (\\Exception $e) {\n self::fail($e->getMessage());\n\n return;\n }\n\n self::fail('Error, the daughter class overload the StateOne, Mother\\'s methods must not be available');\n }", "public function testRefundMismatched() {\n $this->setExchangeRates(1234567, ['USD' => 1, 'PLN' => 0.5]);\n $donation_message = new TransactionMessage(\n [\n 'gateway' => 'test_gateway',\n 'gateway_txn_id' => mt_rand(),\n ]\n );\n $refund_message = new RefundMessage(\n [\n 'gateway' => 'test_gateway',\n 'gateway_parent_id' => $donation_message->getGatewayTxnId(),\n 'gateway_refund_id' => mt_rand(),\n 'gross' => $donation_message->get('original_gross') + 1,\n 'gross_currency' => $donation_message->get('original_currency'),\n ]\n );\n\n $message_body = $donation_message->getBody();\n wmf_civicrm_contribution_message_import($message_body);\n $contributions = wmf_civicrm_get_contributions_from_gateway_id(\n $donation_message->getGateway(),\n $donation_message->getGatewayTxnId()\n );\n $this->assertEquals(1, count($contributions));\n\n $this->consumer->processMessage($refund_message->getBody());\n $contributions = $this->callAPISuccess(\n 'Contribution',\n 'get',\n ['contact_id' => $contributions[0]['contact_id'], 'sequential' => 1]\n );\n $this->assertEquals(2, count($contributions['values']));\n $this->assertEquals(\n 'Chargeback',\n CRM_Contribute_PseudoConstant::contributionStatus($contributions['values'][0]['contribution_status_id'])\n );\n $this->assertEquals('-.5', $contributions['values'][1]['total_amount']);\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "#[@test]\n public function reasonOnly() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation \"Out of office\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertEquals('Out of office', $action->reason);\n }", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function isDeclined(): bool;", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function testStateIssuedCorrectly()\n {\n $this->assertNull($this->state->issue());\n }", "public function test_user_cannot_vote_on_their_own_messages() {\n\n $this->expectException(VotingException::class);\n $this->message->upvote($this->user);\n\n }", "public function testRefund()\n {\n print \"testRefund()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function shouldntRaiseAnEvent()\n {\n }", "public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "function lola_check_all_transitions_negated($check_name, $formula) {\n global $petrinet;\n foreach ($petrinet[\"transitions\"] as $transition) {\n $ret = lola_check_single_transition($check_name, $formula, $transition[\"id\"]);\n if ($ret->result) {\n debug(\"Single negated transition check \" . $check_name . \" for transition \" . $transition[\"id\"] . \" succeeded, returning false\");\n return new CheckResult(false, $ret->witness_path, $ret->witness_state);\n }\n }\n return new CheckResult(true, \"\", \"\");\n }" ]
[ "0.59717184", "0.59424835", "0.58011425", "0.5791082", "0.56346947", "0.55434567", "0.55081266", "0.5426867", "0.5424317", "0.54224396", "0.54011935", "0.5357062", "0.53413993", "0.5291018", "0.5266901", "0.5249068", "0.52478707", "0.52117914", "0.52030843", "0.5201586", "0.51699406", "0.51679665", "0.51426136", "0.513422", "0.51307917", "0.5126686", "0.51067466", "0.51018393", "0.5100251", "0.50851464" ]
0.7092746
0
Get all destinations related to this article
protected function destinations() { $list = $this->hasMany(Mapping\ArticleDestination::class, 'article_id', 'article_id'); return $list->getResults(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllDestination()\n {\n $destinations = [];\n \n $allDestinations = $this->pdo->prepare('SELECT * FROM destinations');\n $allDestinations->execute();\n \n while ($donneesDestination = $allDestinations->fetch(PDO::FETCH_ASSOC))\n {\n array_push($destinations, new Destination ($donneesDestination)); \n \n }\n \n return $destinations;\n }", "public function getDestinations()\n {\n return $this->destinations;\n }", "public function getDestinations() : array\n {\n return $this->destinations;\n }", "public function destinations(){\n $this->belongsToMany(Destination::class);\n }", "public function getDestinationList() {\n return $this->packageDao->getDestinationList();\n }", "public function index()\n {\n $criteria = Destination::paginate(10);\n return new DestinationResourceCollection($criteria);\n }", "public function getDestination()\n {\n return $this->hasOne(Destination::className(), ['id' => 'destination_id']);\n }", "public function sources() {\n return $this->hasMany(Location::class);\n }", "public function getAllRoute()\n {\n return $this->hasMany('Api\\Model\\IntraHyperRoute', 'fk_buyer_seller_post_id', 'id')->where('lkp_service_id', '=', _HYPERLOCAL_);\n }", "public function fetchDestinations()\n {\n if (! array_key_exists('MarketplaceId', $this->options)) {\n $this->log('Marketplace ID must be set in order to fetch subscription destinations!', 'Warning');\n\n return false;\n }\n\n $this->options['Action'] = 'ListRegisteredDestinations';\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function locations()\n {\n return $this->hasMany(Location::class, 'data_source_id');\n }", "public function getRoutes()\n {\n return $this->hasMany(Route::className(), ['PK_Trip' => 'PK_Trip']);\n }", "function wpsp_list_tour_destination(){\n\tglobal $post;\n\n\t$destinations = wp_get_post_terms( $post->ID, 'tour_destination' );\n\t$out = '<span class=\"label\">' . esc_html__( 'Destination: ', 'discovertravel' ) . '</span>';\n\tforeach ($destinations as $term) {\n\t\t$dests[] = '<strong>' . $term->name . '</strong>';\n\t}\n\t$out .= implode(' / ', $dests);\n\techo $out;\n}", "public function getAddressToLocationRelationships()\n {\n return $this->AddressToLocationRelationships;\n }", "public function destinations($id)\n {\n return Terminal::distinct() ->select('terminals.id', 'terminals.name', 'terminals.short_name', 'terminals.location')\n ->join('routes', 'terminals.id', '=', 'routes.destination')\n ->where('routes.departure', $id)\n ->orderBy('terminals.id')\n ->get();\n }", "public function getDataDestinationCollection(): DestinationCollection {\n\n return $this->dataDestinationCollection;\n\n }", "public function getSimilarDestinationIds()\n {\n return $this->similar_destination_ids;\n }", "public function getDestinationArray() {}", "public function getDestination(): array;", "public function actionGetOtherDestination(){\n\t\t$destination = new Destinations();\n\t\t$tour = new Tours();\n\n\t\t$id = $_GET['id'];\n\t\t$models = $destination->getOtherDestination($id);\n\n\t\t$data = array();\n\t\tforeach ($models as $model) {\n\t\t\t$totalTours = count($tour->getTourInDestination($model->id));\n\n\t\t\t$data[] = array('des' => $model, 'totalTours' => $totalTours);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\theader(\"Access-Control-Allow-Origin: *\");\n header(\"Access-Control-Allow-Methods: GET, POST, PUT, DELETE\");\n echo json_encode($data);\n\t}", "public function get_destinations($id = 0) {\n\n $_chldIds = array();\n\n if ($id == 0) {\n $sub_destinations = \\DB::table('tb_categories')->where('parent_category_id', 0)->where('id', '!=', 8)->get();\n } else {\n $sub_destinations = \\DB::table('tb_categories')->where('parent_category_id', $id)->get();\n }\n\n if (!empty($sub_destinations)) {\n foreach ($sub_destinations as $key => $sub_destination) {\n\n $chldIds = array();\n\n $chldIds[] = $sub_destination->id;\n $temp = $this->get_destinations($sub_destination->id);\n $sub_destinations[$key]->sub_destinations = $temp['sub_destinations'];\n $chldIds = array_merge($chldIds, $temp['chldIds']);\n $_chldIds = array_merge($_chldIds, $chldIds);\n\n $getcats = '';\n if (!empty($chldIds)) {\n $getcats = \" AND (\" . implode(\" || \", array_map(function($v) {\n return sprintf(\"FIND_IN_SET('%s', property_category_id)\", $v);\n }, array_values($chldIds))) . \")\";\n $preprops = DB::select(DB::raw(\"SELECT COUNT(*) AS total_rows FROM tb_properties WHERE property_status = '1' $getcats\"));\n if ($preprops[0]->total_rows == 0) {\n unset($sub_destinations[$key]);\n }\n }\n }\n }\n\n return array('sub_destinations' => $sub_destinations, 'chldIds' => $_chldIds);\n }", "public function directions()\n {\n return $this->hasMany('App\\Direction');\n }", "public function getConsumerDestinations()\n {\n return $this->consumer_destinations;\n }", "public function getDirections()\n {\n return $this->directions;\n }", "public function getDestination()\n {\n return $this->send('POST', 'getDestination');\n }", "function export_destinations( $flush = true ) {\r\n\tglobal $uploadpath;\r\n\tif( !$flush ) {\r\n\t\t$files = array(\r\n\t\t\t$uploadpath.'/datadestinations.json',\r\n\t\t\t$uploadpath.'/datadestinations_ac.json',\r\n\t\t\t$uploadpath.'/dataregions.json',\r\n\t\t\t$uploadpath.'/dataregions_ac.json',\r\n\t\t\t$uploadpath.'/datacities.json',\r\n\t\t\t$uploadpath.'/datacities_ac.json');\r\n\t\tforeach ( $files as $f ) {\r\n\t\t\tif( !file_exists( $f ) ) {\r\n\t\t\t\t$flush = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif(!$flush) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t$destinations = get_terms( 'destinations', array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false) );\r\n\r\n\t$regions = array_filter($destinations, function ($t) {\r\n\t\t$destinationstree = get_ancestors( $t->term_id, 'destinations' );\r\n\t\t$destinationstree = array_reverse($destinationstree);\r\n\t\t$destdepth = count($destinationstree);\r\n\t\treturn $destdepth == 1;\r\n\t});\r\n\r\n\t$cities = array_filter($destinations, function ($t) {\r\n\t\t$destinationstree = get_ancestors( $t->term_id, 'destinations' );\r\n\t\t$destinationstree = array_reverse($destinationstree);\r\n\t\t$destdepth = count($destinationstree);\r\n\t\treturn $destdepth == 2;\r\n\t});\r\n\r\n\t$datadestinations = array();\r\n\t$datadestac = array();\r\n\t$dataregions = array();\r\n\t$dataregionsac = array();\r\n\t$datacities = array();\r\n\t$datacitiesac = array();\r\n\t$i = 0;\r\n\r\n\t// cities\r\n\tforeach ( $cities as $term ) {\r\n\t\t$datadestinations[$i][] = $term->term_id;\r\n\t\t$datadestinations[$i][] = $term->slug;\r\n\t\t$datadestinations[$i][] = $term->name;\r\n\r\n\t\t$datacities[$i][] = $term->term_id;\r\n\t\t$datacities[$i][] = $term->slug;\r\n\t\t$datacities[$i][] = $term->name;\r\n\r\n\t\t$datacitiesac[$i][] = $term->name;\r\n\t\t$datacitiesac[$i][] = $term->slug;\r\n\r\n\t\t$datadestac[$i][] = $term->name;\r\n\t\t$datadestac[$i][] = $term->slug;\r\n\r\n\t\t$i++;\r\n\t}\r\n\r\n\t$j = $i;\r\n\r\n\t// regions\r\n\tforeach ( $regions as $term ) {\r\n\t\t$datadestinations[$i][] = $term->term_id;\r\n\t\t$datadestinations[$i][] = $term->slug;\r\n\t\t$datadestinations[$i][] = $term->name;\r\n\r\n\t\t$dataregions[$i-$j][] = $term->term_id;\r\n\t\t$dataregions[$i-$j][] = $term->slug;\r\n\t\t$dataregions[$i-$j][] = $term->name;\r\n\r\n\t\t$dataregionsac[$i-$j][] = $term->name;\r\n\t\t$dataregionsac[$i-$j][] = $term->slug;\r\n\r\n\t\t$datadestac[$i][] = $term->name;\r\n\t\t$datadestac[$i][] = $term->slug;\r\n\r\n\t\t$i++;\r\n\t}\r\n\r\n\t$file = fopen($uploadpath.'/datadestinations.txt', 'w');\r\n\t$headers = array('destination_id','slug','name');\r\n\tfputcsv($file, $headers);\r\n\t\tforeach ($datadestinations as $fields) {\r\n\t\t\tfputcsv($file,$fields);\r\n\t\t}\r\n\tfclose($file);\r\n\r\n\t$jsondestinations = json_encode($datadestinations);\r\n\tfile_put_contents( $uploadpath.'/datadestinations.json', $jsondestinations);\r\n\r\n\t$jsondestinations = json_encode($datadestac);\r\n\tfile_put_contents( $uploadpath.'/datadestinations_ac.json', $jsondestinations);\r\n\r\n\t$jsonregions = json_encode($dataregions);\r\n\tfile_put_contents( $uploadpath.'/dataregions.json', $jsonregions);\r\n\r\n\t$jsonregions = json_encode($dataregionsac);\r\n\tfile_put_contents( $uploadpath.'/dataregions_ac.json', $jsonregions);\r\n\r\n\t$jsoncities = json_encode($datacities);\r\n\tfile_put_contents( $uploadpath.'/datacities.json', $jsoncities);\r\n\r\n\t$jsoncities = json_encode($datacitiesac);\r\n\tfile_put_contents( $uploadpath.'/datacities_ac.json', $jsoncities);\r\n\texport_bookingwidget();\r\n}", "public static function getDestinos() {\n $sql_destinos = \"SELECT products.city FROM products where activo=1 GROUP BY city\";\n \n $destinos = $this->db_list($sql_destinos);\n \n return $destinos;\n \n }", "public function locations() {\n return $this->hasMany(Location::class);\n }", "public function locations()\n {\n return $this->hasMany(Location::class);\n }", "public function getDestinationPrefixes();" ]
[ "0.72364235", "0.710738", "0.68104947", "0.65494305", "0.65488213", "0.60714906", "0.59334135", "0.591461", "0.58764005", "0.5848445", "0.5833889", "0.58260655", "0.57960606", "0.5795896", "0.5782617", "0.57728624", "0.5761642", "0.57586193", "0.575108", "0.5711202", "0.57014453", "0.5671613", "0.56540096", "0.56115985", "0.5577632", "0.55353004", "0.5530254", "0.5479616", "0.5478266", "0.54712653" ]
0.9045315
0
Get Help message for this module
public function getHelpMessage() { return "Get summary of a module or all modules\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function help()\n {\n // You could include a file and return it here.\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\n }", "public function get_help()\n\t{\n\t\treturn '';\n\t}", "public function help()\r\n\t{\r\n\t\t// You could include a file and return it here.\r\n\t\treturn \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n\t}", "function GetHelp()\n {\n return $this->Lang('help');\n }", "public function getExtendedHelpMessage()\n {\n $out = $this->getHelpMessage() . \"\\n\";\n\n $out .= \"Usage: summary [--short] [module]\\n\"\n . \"Show the summary of the most recent results of each module.\\n\"\n . \"If a module name is provided as an argument, it\\n\"\n . \"will display only the summary for that module.\\n\\n\"\n . \"This is the default module that is run when no\\n\"\n . \"module name is given when running qis.\\n\";\n\n $out .= \"\\nValid Options:\\n\"\n . $this->_qis->getTerminal()->do_setaf(3)\n . \" --short : Show only short information\\n\"\n . $this->_qis->getTerminal()->do_op();\n\n return $out;\n }", "public function getHelp(): string\n {\n return $this->help;\n }", "public function help()\r\n{\r\n // You could include a file and return it here.\r\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n}", "public function get_help_page()\n\t{\n\t\t$this->load_misc_methods();\n\t\treturn cms_module_GetHelpPage($this);\n\t}", "public function getHelp()\n\t{\n\t\treturn $this->run(array('help'));\n\t}", "public function getHelpMessage() { return $this->data['helpMessage']; }", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "public function getHelp()\n {\n return $this->run(array(\n 'help'\n ));\n }", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "function getHelp()\n {\n return $this->help;\n }", "public function get_help(){\n $tmp=self::_pipeExec('\"'.$this->cmd.'\" --extended-help');\n return $tmp['stdout'];\n }", "public function printHelp();", "public function help();", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4>Overview</h4>\n\t\t<p>The Inventory module will work like magic. The End!</p>\";\n\t}", "protected function displayHelp()\n {\n return $this->context->smarty->fetch($this->module->getLocalPath().'views/templates/admin/rewards_info.tpl');\n }", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "public function help ()\n {\n $msg = 'databaseデータをdata/fixtures/items.dbへダンプする';\n\n return $msg;\n }", "public function cli_help() {}", "public function getHelp()\n {\n new Help('form');\n }", "public function help() {\r\n return array(\"Success\" => \"Hello World\");\r\n }", "public function getCommandHelp()\n {\n return <<<HELP\n\n\\e[33mOutputs information about PHP's configuration.\\e[0m\n\n\\e[36mUsage:\\e[0m \\e[32mcfg info get [--what WHAT]\\e[0m\n \n Displays information about the current state of PHP.\n The output may be customized by passing constant \\e[30;1mWHAT\\e[0m which corresponds to the appropriate parameter of function phpinfo().\n\nHELP;\n }", "public function getHelp()\n {\n $this->parseDocBlock();\n return $this->help;\n }", "public function getHelp() {\n $help = parent::getHelp();\n $global_options = $this->getGlobalOptions();\n if (!empty($global_options)) {\n $help .= PHP_EOL . 'Global options:';\n foreach ($global_options as $name => $value) {\n $help .= PHP_EOL . ' [' . $name . '=' . $value . ']';\n }\n }\n return $help;\n }" ]
[ "0.8388826", "0.82199055", "0.82126147", "0.81169057", "0.8101302", "0.8092861", "0.7854757", "0.7824589", "0.77846324", "0.7784203", "0.77822685", "0.77822685", "0.7762936", "0.775723", "0.77290404", "0.7679998", "0.7658723", "0.7645613", "0.7538306", "0.73526484", "0.73218995", "0.73218995", "0.73218995", "0.72849554", "0.7263206", "0.72476804", "0.72459894", "0.7200969", "0.720083", "0.71928245" ]
0.86491305
0
Get extended help message
public function getExtendedHelpMessage() { $out = $this->getHelpMessage() . "\n"; $out .= "Usage: summary [--short] [module]\n" . "Show the summary of the most recent results of each module.\n" . "If a module name is provided as an argument, it\n" . "will display only the summary for that module.\n\n" . "This is the default module that is run when no\n" . "module name is given when running qis.\n"; $out .= "\nValid Options:\n" . $this->_qis->getTerminal()->do_setaf(3) . " --short : Show only short information\n" . $this->_qis->getTerminal()->do_op(); return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_help(){\n $tmp=self::_pipeExec('\"'.$this->cmd.'\" --extended-help');\n return $tmp['stdout'];\n }", "public function getHelpMessage() { return $this->data['helpMessage']; }", "public function getHelp(): string\n {\n return $this->help;\n }", "public function get_help()\n\t{\n\t\treturn '';\n\t}", "function GetHelp()\n {\n return $this->Lang('help');\n }", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "public function getHelpMessage()\n {\n return \"Get summary of a module or all modules\\n\";\n }", "function getHelp()\n {\n return $this->help;\n }", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "private function getHelpMessage()\n {\n return <<<EOT\nO comando <info>cekurte:group:update</info> atualiza o nome de um grupo na base de dados:\n\n<info>php app/console cekurte:group:update NomeAntigo NovoNome</info>\nEOT;\n }", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "public function printHelp();", "public function getProcessedHelp(): string\n {\n $name = $this->name;\n $isSingleCommand = $this->application?->isSingleCommand();\n\n $placeholders = [\n '%command.name%',\n '%command.full_name%',\n ];\n $replacements = [\n $name,\n $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,\n ];\n\n return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());\n }", "public function help()\n {\n // You could include a file and return it here.\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\n }", "function writeHelp() {\n\t\t$pt1 = array(\t'title' => 'Valid commands',\n\t\t\t\t\t\t'text' => \"Please enter a request in the following format:\\n/cherwell I ##### for an incident\\n/cherwell T ##### for a task\\n/cherwell C ##### for a change request\",\n\t\t\t\t\t\t'color' => \"#b3003b\");\n\t\t$pt2 = array(\t'fallback'=>\"Help\", 'attachments' => array($pt1));\n\t\treturn json_encode($pt2);\n\t}", "public function getHelp()\n\t{\n\t\treturn $this->run(array('help'));\n\t}", "public function getHelp() {\n $help = parent::getHelp();\n $global_options = $this->getGlobalOptions();\n if (!empty($global_options)) {\n $help .= PHP_EOL . 'Global options:';\n foreach ($global_options as $name => $value) {\n $help .= PHP_EOL . ' [' . $name . '=' . $value . ']';\n }\n }\n return $help;\n }", "public static function help() {\r\n\t\treturn self::getInstance()->createResponse(\r\n\t\t\t'<h2>How to use the Yammer extension</h2>'\r\n\t\t\t.'You can use the Yammer functionality in several ways:'\r\n\t\t\t.'<ul>'\r\n\t\t\t.'<li>Show messages with a specific tag #YourTag:'\r\n\t\t\t.' <ul>'\r\n\t\t\t.' <li><code>&lt;yammer&gt;<b><i>YourTag</i></b>&lt;/yammer&gt;</code></li>'\r\n\t\t\t.' <li><code>&lt;yammertag&gt;<b><i>YourTag</i></b>&lt;/yammertag&gt;</code></li>'\r\n\t\t\t.' <li><code>&lt;yammer tag=\"<b><i>YourTag</i></b>\" /&gt;</code></li>'\r\n\t\t\t.' </ul>'\r\n\t\t\t.'</li>'\r\n\t\t\t.'<li>Show message from a specific group:'\r\n\t\t\t.' <ul>'\r\n\t\t\t.' <li><code>&lt;yammergroup&gt;<b><i>YourGroup</i></b>&lt;/yammergroup&gt;</code>'\r\n\t\t\t.' <li><code>&lt;yammer group=\"<b><i>YourGroup</i></b>\" /&gt;</code>'\r\n\t\t\t.' </ul>'\r\n\t\t\t.'</li>'\r\n\t\t\t.'</ul>'\r\n\t\t\t.'In later versions you might be able to use alternative construct to get other types of content from Yammer'\r\n\t\t);\r\n\t}", "protected function renderHelp() {}", "function GetEventHelp ( $eventname )\n {\n return $this->Lang('event_help_'.$eventname );\n }", "public static function add_help_text()\n {\n }", "public function help()\r\n\t{\r\n\t\t// You could include a file and return it here.\r\n\t\treturn \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n\t}", "public function getHelp()\n {\n return $this->run(array(\n 'help'\n ));\n }", "abstract public function displayHelp();", "public function help(ElggEntity $entity) {\n\t\treturn $this->makeLabel($entity, \"{$this->name}:help\");\n\t}", "protected function displayHelp()\n {\n return $this->context->smarty->fetch($this->module->getLocalPath().'views/templates/admin/rewards_info.tpl');\n }", "public function getCommandHelp()\n {\n return <<<HELP\n\n\\e[33mOutputs information about PHP's configuration.\\e[0m\n\n\\e[36mUsage:\\e[0m \\e[32mcfg info get [--what WHAT]\\e[0m\n \n Displays information about the current state of PHP.\n The output may be customized by passing constant \\e[30;1mWHAT\\e[0m which corresponds to the appropriate parameter of function phpinfo().\n\nHELP;\n }" ]
[ "0.8037826", "0.79402626", "0.7801226", "0.7746395", "0.76596934", "0.7446455", "0.7446455", "0.7420929", "0.7363276", "0.73349345", "0.73207104", "0.7192808", "0.7192808", "0.7192808", "0.71767694", "0.71521115", "0.71431315", "0.71131134", "0.7102975", "0.71028584", "0.70876986", "0.7036923", "0.702509", "0.7023572", "0.70235556", "0.70043045", "0.6979941", "0.6948646", "0.6918468", "0.691472" ]
0.86842835
0
loads scripts URL according to the current status if status defined and active
private function loadURLs() { $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test'; foreach ($this->_url as $scriptname => $modes) { $this->url[$scriptname] = $modes[$status]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadURLs()\r\n\t{\r\n\t\t$status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\t\tforeach ($this->url as $scriptname => $modes)\r\n\t\t\t$this->url_script[$scriptname] = $modes[$status];\r\n\t}", "public function setIsLoadScript($status)\n {\n $this->isLoadScript = $status;\n }", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "private function fn_load_scripts() {\n\n\t\t/**\n\t\t * Load Common CSS and JS for a blank Page\n\t\t */\n\n\t\t$fixed_version = $this->fixed_version;\n\t\t$common_css_version = '0.3';\n\t\t$common_js_version = '0.1';\n\t\t$custom_css_version = '0.4';\n\t\t$custom_js_version = '0.4';\n\n\t\t$registered_styles = $this->registered_css;\n\t\t$registered_scripts = $this->registered_js;\n\n\t\t/**\n\t\t * Load CSS--------------------------------------------------------------\n\t\t */\n\n /** Load Google Fonts */\n\t\t$this->google_fonts['google_opensans'] = $registered_styles['google_opensans'];\n\n\t\t/** Load CSS Assets @todo Move the components in their containers */\n\t\t\n\t\t$this->css_assets['bootstrap'] = $registered_styles['bootstrap'].\"?ver=\".$fixed_version;\n\t\t$this->css_assets['fontawesome'] = $registered_styles['fontawesome'].\"?ver=\".$fixed_version;\n\t\t\n\t\t/**\n\t\t * Load JS--------------------------------------------------------------\n\t\t */\n\t\t\n\t\t/** Load footer js **/\n\t\t$this->footer_js['jquery'] = $registered_scripts['jquery'].\"?ver=\".$fixed_version;\t\t\n\t\t$this->footer_js['jquery-ui'] = $registered_scripts['jquery-ui'].\"?ver=\".$fixed_version;\n\n\t\t$this->footer_js['bootstrap'] = $registered_scripts['bootstrap'].\"?ver=\".$fixed_version;\n\t\t/**let other controllers load their own css/js files **/\n\t}", "private function loadScripts() {\n\t\tif(isset($this->scripts) && $this->scripts != \"\") {\n\t\t\tforeach (explode(\",\", $this->scripts) as $script) {\n\t\t\t\tOCP\\Util::addscript('ocDashboard', 'widgets/'.$this->id.'/'.$script);\n\t\t\t}\n\t\t}\n\t}", "protected function initScripts() {\n\t\t$scripts = array();\n\t\t\n\t\tif(isset($this->config['scripts']['script'])) {\n\t\t\tforeach($this->config['scripts']['script'] as $moduleScripts) {\n\t\t\t\t$scripts[] = $this->layout->baseUrl('scripts/' . $moduleScripts);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($this->config['scripts'][$this->request->getControllerName()])) {\n\t\t\tforeach($this->config['scripts'][$this->request->getControllerName()] as $action => $internalScripts) {\n\t\t\t\t\n\t\t\t\tif(is_array($internalScripts) && $action == 'script') {\n\t\t\t\t\tforeach($internalScripts as $sc) {\n\t\t\t\t\t\tif(preg_match(\"/http:/i\", $sc)) {\n\t\t\t\t\t\t\t$scripts[] = $sc;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$scripts[] = $this->layout->baseUrl('scripts/' . $sc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if(is_array($internalScripts) && $action == $this->request->getActionName()) {\n\t\t\t\t\tforeach($internalScripts as $sc) {\n\t\t\t\t\t\tif(preg_match(\"/http:/i\", $sc)) {\n\t\t\t\t\t\t\t$scripts[] = $sc;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$scripts[] = $this->layout->baseUrl('scripts/' . $sc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->layout->setScript($scripts);\n\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $router = GeneralUtility::makeInstance(Router::class);\n $route = $router->match($routePath);\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));\n } elseif ($moduleName = GeneralUtility::_GP('M')) {\n $this->thisScript = BackendUtility::getModuleUrl($moduleName);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoutePath($routePath);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "protected function load_script($script_name = null)\n {\n if ($this->script_name !== null) {\n return 0;\n }\n\n $list = $this->list_scripts();\n $master = $this->rc->config->get('managesieve_kolab_master');\n $included = array();\n\n $this->script_name = false;\n\n // first try the active script(s)...\n if (!empty($this->active)) {\n // Note: there can be more than one active script on KEP:14-enabled server\n foreach ($this->active as $script) {\n if ($this->sieve->load($script)) {\n foreach ($this->sieve->script->as_array() as $rule) {\n if (!empty($rule['actions'])) {\n if ($rule['actions'][0]['type'] == 'vacation') {\n $this->script_name = $script;\n return 0;\n }\n else if (empty($master) && $rule['actions'][0]['type'] == 'include') {\n $included[] = $rule['actions'][0]['target'];\n }\n }\n }\n }\n }\n\n // ...else try scripts included in active script (not for KEP:14)\n foreach ($included as $script) {\n if ($this->sieve->load($script)) {\n foreach ($this->sieve->script->as_array() as $rule) {\n if (!empty($rule['actions']) && $rule['actions'][0]['type'] == 'vacation') {\n $this->script_name = $script;\n return 0;\n }\n }\n }\n }\n }\n\n // try all other scripts\n if (!empty($list)) {\n // else try included scripts\n foreach (array_diff($list, $included, $this->active) as $script) {\n if ($this->sieve->load($script)) {\n foreach ($this->sieve->script->as_array() as $rule) {\n if (!empty($rule['actions']) && $rule['actions'][0]['type'] == 'vacation') {\n $this->script_name = $script;\n return 0;\n }\n }\n }\n }\n\n // none of the scripts contains existing vacation rule\n // use any (first) active or just existing script (in that order)\n if (!empty($this->active)) {\n $this->sieve->load($this->script_name = $this->active[0]);\n }\n else {\n $this->sieve->load($this->script_name = $list[0]);\n }\n }\n\n return $this->sieve->error();\n }", "function load_scripts($scripts_to_load)\r\n\t{\r\n\t\tglobal $available_scripts;\r\n\r\n\t\t$scripts_to_load = array_unique($scripts_to_load);\r\n\r\n\t\tforeach($scripts_to_load as $script_key => $script_to_load)\r\n\t\t{\r\n\t\t\tif (is_array($available_scripts[$script_to_load]))\r\n\t\t\t{\r\n\t\t\t\tforeach ($available_scripts[$script_to_load] as $child_key => $child_to_load)\r\n\t\t\t\t{\r\n\t\t\t\t\tsubstr($available_scripts[$script_to_load][$child_key], 0, 4) == 'http' ? $root_path = '' : $root_path = ROOT_PATH;\r\n\t\t\t\t\techo '<script type=\"text/javascript\" src=\"' . $root_path . $available_scripts[$script_to_load][$child_key] . '\"></script>' . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsubstr($available_scripts[$script_to_load], 0, 4) == 'http' ? $root_path = '' : $root_path = ROOT_PATH;\r\n\t\t\t\techo '<script type=\"text/javascript\" src=\"' . $root_path . $available_scripts[$script_to_load] . '\"></script>' . \"\\n\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public function scripts()\n {\n foreach ($this->controller->scripts as $value)\n echo \"\\t<script src='\" . DOMAIN . $value . \"' ></script>\\n\";\n echo \"</body>\\n</html>\";\n }", "function TS_VCSC_DetermineLoadingStatus() {\r\n\t\t\t// Retrieve Current Browser URL\r\n\t\t\t$TS_VCSC_Extension_Browser\t\t\t\t\t\t\t= 'http://';\r\n\t\t\tif (isset($_SERVER['SERVER_NAME'])) {\r\n\t\t\t\t$TS_VCSC_Extension_Browser\t\t\t\t\t\t.= $_SERVER['SERVER_NAME'];\r\n\t\t\t} else if (isset($_SERVER['HTTP_HOST'])) {\r\n\t\t\t\t$TS_VCSC_Extension_Browser\t\t\t\t\t\t.= $_SERVER['HTTP_HOST'];\r\n\t\t\t}\t\t\t\r\n\t\t\tif (isset($_SERVER['REQUEST_URI'])) {\r\n\t\t\t\t$TS_VCSC_Extension_Browser \t\t\t\t\t\t.= $_SERVER['REQUEST_URI'];\r\n\t\t\t}\r\n\t\t\t// Check for Plugin Specific Pages\r\n\t\t\t$this->TS_VCSC_PluginFontSummary\t\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Extender') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginFontSummary\t\t\t\t= \"true\";\r\n\t\t\t} else if (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_System') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginFontSummary\t\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_GoggleFontSummary\t\t\t\t\t= \"false\";\r\n\t\t\tif ((strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_GoogleFonts') !== false) || (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_System') !== false)) {\r\n\t\t\t\t$this->TS_VCSC_GoggleFontSummary\t\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_PluginSettingsTransfer\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Transfers') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginSettingsTransfer\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_PluginEnlighterTheme\t\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_EnlighterJS') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginEnlighterTheme\t\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_PluginDownTimeManager\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Downtime') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginDownTimeManager\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_PluginIconFontImport\t\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Uploader') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginIconFontImport\t\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_PluginUsageCompiler\t\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Usage') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginUsageCompiler\t\t\t\t= \"true\";\r\n\t\t\t}\r\n $this->TS_VCSC_PluginIconGenerator = \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Generator') !== false) {\r\n\t\t\t\t$this->TS_VCSC_PluginIconGenerator\t\t\t\t= \"true\";\r\n\t\t\t}\r\n\t\t\t$this->TS_VCSC_Icons_Compliant_Loading\t\t\t\t= \"false\";\r\n\t\t\tif ((strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Previews') !== false) || (strpos($TS_VCSC_Extension_Browser, '?page=TS_VCSC_Generator') !== false)) {\r\n\t\t\t\t$this->TS_VCSC_Icons_Compliant_Loading\t\t\t= \"true\";\r\n\t\t\t}\r\n // Check for Composium Custom Post Types\r\n $this->TS_VCSC_CustomPostTypesPresent = \"false\";\r\n if (strpos($TS_VCSC_Extension_Browser, '?post_type=ts_timeline') !== false) {\r\n $this->TS_VCSC_CustomPostTypesPresent = \"true\";\r\n }\r\n\t\t\t// Check for WP Bakery Page Builder Roles Manager\t\t\t\r\n\t\t\t$this->TS_VCSC_Extension_RoleManager\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=vc-roles') !== false) {\r\n\t\t\t\t$this->TS_VCSC_Extension_RoleManager\t\t\t= \"true\";\t\t\r\n\t\t\t}\r\n\t\t\t// Check for Elements for Users - Addon for WP Bakery Page Builder\r\n\t\t\t$this->TS_VCSC_Extension_ElementsUser\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=mcw_elements_for_users') !== false) {\r\n\t\t\t\t$this->TS_VCSC_Extension_ElementsUser\t\t\t= \"true\";\t\t\r\n\t\t\t}\r\n\t\t\t// Check for Toolsets Template Editor\r\n\t\t\t$this->TS_VCSC_Extension_ToolsetsUser\t\t\t\t= \"false\";\r\n\t\t\tif (strpos($TS_VCSC_Extension_Browser, '?page=ct-editor') !== false) {\r\n\t\t\t\t$this->TS_VCSC_Extension_ToolsetsUser\t\t\t= \"true\";\t\t\r\n\t\t\t}\r\n\t\t\t// Determine if WP Bakery Page Builder Form Request\r\n\t\t\tif (array_key_exists('action', $_REQUEST)) {\r\n\t\t\t\t$TS_VCSC_Extension_Request\t\t\t\t\t\t= ($_REQUEST[\"action\"] != \"vc_edit_form\" ? \"false\" : \"true\");\r\n\t\t\t} else {\r\n\t\t\t\t$TS_VCSC_Extension_Request\t\t\t\t\t\t= \"false\";\r\n\t\t\t}\r\n\t\t\t// Determine Standard Page Editor\r\n\t\t\t$this->TS_VCSC_VCStandardEditMode\t\t\t\t\t= (TS_VCSC_IsEditPagePost() == 1 ? \"true\" : \"false\");\r\n\t\t\t// Determine Frontend Editor Status\r\n\t\t\tif (function_exists('vc_is_inline')){\r\n\t\t\t\tif (vc_is_inline() == true) {\r\n\t\t\t\t\t$this->TS_VCSC_VCFrontEditMode \t\t\t\t= \"true\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif ((vc_is_inline() == NULL) || (vc_is_inline() == '')) {\r\n\t\t\t\t\t\tif (TS_VCSC_CheckFrontEndEditor() == true) {\r\n\t\t\t\t\t\t\t$this->TS_VCSC_VCFrontEditMode \t\t= \"true\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->TS_VCSC_VCFrontEditMode \t\t= \"false\";\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->TS_VCSC_VCFrontEditMode \t\t\t= \"false\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$this->TS_VCSC_VCFrontEditMode \t\t\t\t\t= \"false\";\r\n\t\t\t}\r\n\t\t\t// Check AJAX Request Status\r\n\t\t\t$this->TS_VCSC_PluginAJAX\t\t\t\t\t\t\t= ($this->TS_VCSC_RequestIsFrontendAJAX() == 1 ? \"true\" : \"false\");\r\n\t\t\t// Set Global Load Status\r\n\t\t\t$this->TS_VCSC_VisualComposer_Loading\t\t\t\t= \"false\"; \r\n $this->TS_VCSC_Gutenberg_Classic = (TS_VCSC_CheckGBClassicEditor() == true ? \"true\" : \"false\");\r\n\t\t\tif ((defined('WPB_VC_VERSION')) && (($TS_VCSC_Extension_Request == \"true\") || ($this->TS_VCSC_VCFrontEditMode == \"true\") || ($this->TS_VCSC_VCStandardEditMode == \"true\") || ($this->TS_VCSC_PluginAJAX == \"true\")) || ($this->TS_VCSC_Extension_ToolsetsUser == \"true\")) {\r\n $this->TS_VCSC_VisualComposer_Loading = \"true\";\r\n\t\t\t}\r\n // Check for In-Compatible WP Bakery WEBSITE Builder\r\n $this->TS_VCSC_WebsiteBuilder_Instead = \"false\";\r\n $this->TS_VCSC_WebsiteBuilder_Instead = (TS_VCSC_CheckVCWebsiteEditor() === true ? \"true\" : \"false\");\r\n\t\t\t// Register Global Data/Functions As Needed\r\n\t\t\t$this->TS_VCSC_RegisterGlobalData();\r\n\t\t}", "function getScriptUrl() ;", "function init_scripts() {\n\t\t\t$curpath = str_replace( basename( __FILE__ ), '', realpath( __FILE__ ) );\n\t\t\tif( file_exists( $curpath . '/post-revision-workflow.admin.js' ) )\n\t\t\t\t$script_loc = plugins_url( '/post-revision-workflow.admin.js', __FILE__ );\n\t\t\telseif( file_exists( $curpath . '/post-revision-workflow/post-revision-workflow.admin.js' ) )\n\t\t\t\t$script_loc = plugins_url( '/post-revision-workflow/post-revision-workflow.admin.js', __FILE__ );\n\t\t\tif( !empty( $script_loc ) ) {\n\t\t\t\twp_register_script( 'post-revision-workflow', $script_loc, array( 'post' ), '0.2a', true );\n\t\t\t\twp_enqueue_script( 'post-revision-workflow' );\n\t\t\t\twp_localize_script( 'post-revision-workflow', 'post_revision_workflow', array(\n\t\t\t\t\t'no_notifications'\t=> __( 'No notifications', $this->text_domain ),\n\t\t\t\t\t'draft_notify' \t\t=> __( 'Draft &amp; notify', $this->text_domain ),\n\t\t\t\t\t'publish_notify'\t=> __( 'Publish &amp; notify', $this->text_domain ),\n\t\t\t\t\t'draft_only'\t\t=> __( 'Draft - no notifications', $this->text_domain )\n\t\t\t\t) );\n\t\t\t/*} else {\n\t\t\t\twp_die( 'The post-revision-workflow script could not be located in ' . $curpath . '/post-revision-workflow.admin.js' . ' or ' . $curpath . '/post-revision-workflow/post-revision-workflow.admin.js' );*/\n\t\t\t}\n\t\t}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getStatusUrl()\n {\n return Mage::helper('oro_ajax')->getAjaxStatusUrl($this->_urlParams);\n }", "private function callStatus() {\n try {\n $this->status = $this->client->request('GET', $this->url->full_url, [\n 'allow_redirects' => false\n ]);\n } catch (\\Exception $ex) {\n $this->status = $ex->getResponse();\n }\n }", "function asc_default_scripts( &$scripts ) {\n\tinclude ABSPATH . ASC_CORE . '/version.php'; // include an unmodified $asc_version\n\n\t$develop_src = false !== strpos( $asc_version, '-src' );\n\n\tif ( ! defined( 'SCRIPT_DEBUG' ) ) {\n\t\tdefine( 'SCRIPT_DEBUG', $develop_src );\n\t}\n\n\tif ( ! $guessurl = admin_storefront_url() ) {\n\t\t$guessed_url = true;\n\t\t$guessurl = site_url();\n\t}\n\n\t$scripts->base_url = $guessurl;\n\t$scripts->content_url = defined('ASC_CONTENT_URL')? ASC_CONTENT_URL : '';\n\t$scripts->default_version = PRODUCT_VERSION_NUMBER;\n\t$scripts->default_dirs = array('avactis-system/admin/js/', 'includes/js/');\n\n\t$suffix = SCRIPT_DEBUG ? '' : '.min';\n\t$dev_suffix = $develop_src ? '' : '.min';\n\n\t$scripts->add( 'prototype', '//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1');\n\t$scripts->add( 'scriptaculous-root', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');\n\t$scripts->add( 'scriptaculous-builder', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous-dragdrop', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');\n\t$scripts->add( 'scriptaculous-effects', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous-slider', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');\n\t$scripts->add( 'scriptaculous-sound', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-controls', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls') );\n\n\t// jQuery\n\t$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.0' );\n\t$scripts->add( 'jquery-core', 'includes/jquery/jquery.js', array(), '1.11.0' );\n\t$scripts->add( 'jquery-migrate', \"includes/jquery/jquery-migrate$suffix.js\", array(), '1.2.1' );\n\n\t// full jQuery UI\n\t$scripts->add( 'jquery-ui-core', 'includes/jquery/ui/jquery.ui.core.min.js', array('jquery'), '1.10.4');\n\t$scripts->add( 'jquery-effects-core', 'includes/jquery/ui/jquery.ui.effect.min.js', array('jquery'), '1.10.4', 1 );\n\n\t$scripts->add( 'jquery-effects-blind', 'includes/jquery/ui/jquery.ui.effect-blind.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-bounce', 'includes/jquery/ui/jquery.ui.effect-bounce.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-clip', 'includes/jquery/ui/jquery.ui.effect-clip.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-drop', 'includes/jquery/ui/jquery.ui.effect-drop.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-explode', 'includes/jquery/ui/jquery.ui.effect-explode.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-fade', 'includes/jquery/ui/jquery.ui.effect-fade.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-fold', 'includes/jquery/ui/jquery.ui.effect-fold.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-highlight', 'includes/jquery/ui/jquery.ui.effect-highlight.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-pulsate', 'includes/jquery/ui/jquery.ui.effect-pulsate.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-scale', 'includes/jquery/ui/jquery.ui.effect-scale.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-shake', 'includes/jquery/ui/jquery.ui.effect-shake.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-slide', 'includes/jquery/ui/jquery.ui.effect-slide.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-transfer', 'includes/jquery/ui/jquery.ui.effect-transfer.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\n\t$scripts->add( 'jquery-ui-accordion', 'includes/jquery/ui/jquery.ui.accordion.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-autocomplete', 'includes/jquery/ui/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-menu'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-button', 'includes/jquery/ui/jquery.ui.button.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-datepicker', 'includes/jquery/ui/jquery.ui.datepicker.min.js', array('jquery-ui-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-dialog', 'includes/jquery/ui/jquery.ui.dialog.min.js', array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-draggable', 'includes/jquery/ui/jquery.ui.draggable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4');\n\t$scripts->add( 'jquery-ui-droppable', 'includes/jquery/ui/jquery.ui.droppable.min.js', array('jquery-ui-draggable'), '1.10.4');\n\t$scripts->add( 'jquery-ui-menu', 'includes/jquery/ui/jquery.ui.menu.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-mouse', 'includes/jquery/ui/jquery.ui.mouse.min.js', array('jquery-ui-widget'), '1.10.4');\n\t$scripts->add( 'jquery-ui-position', 'includes/jquery/ui/jquery.ui.position.min.js', array('jquery'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-progressbar', 'includes/jquery/ui/jquery.ui.progressbar.min.js', array('jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-resizable', 'includes/jquery/ui/jquery.ui.resizable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-selectable', 'includes/jquery/ui/jquery.ui.selectable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-slider', 'includes/jquery/ui/jquery.ui.slider.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-sortable', 'includes/jquery/ui/jquery.ui.sortable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4');\n\t$scripts->add( 'jquery-ui-spinner', 'includes/jquery/ui/jquery.ui.spinner.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-button' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-tabs', 'includes/jquery/ui/jquery.ui.tabs.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-tooltip', 'includes/jquery/ui/jquery.ui.tooltip.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-widget', 'includes/jquery/ui/jquery.ui.widget.min.js', array('jquery'), '1.10.4');\n\n\t// deprecated, not used in core, most functionality is included in jQuery 1.3\n\t$scripts->add( 'jquery-form', \"includes/jquery/jquery.form$suffix.js\", array('jquery'), '3.37.0', 1 );\n\n\t// jQuery plugins\n\t$scripts->add( 'jquery-color', \"includes/jquery/jquery.color.min.js\", array('jquery'), '2.1.1', 1 );\n\t$scripts->add( 'suggest', \"includes/jquery/suggest$suffix.js\", array('jquery'), '1.1-20110113', 1 );\n\t$scripts->add( 'schedule', 'includes/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );\n\t$scripts->add( 'jquery-query', \"includes/jquery/jquery.query.js\", array('jquery'), '2.1.7', 1 );\n\t$scripts->add( 'jquery-serialize-object', \"includes/jquery/jquery.serialize-object.js\", array('jquery'), '0.2', 1 );\n\t$scripts->add( 'jquery-hotkeys', \"includes/jquery/jquery.hotkeys$suffix.js\", array('jquery'), '0.0.2m', 1 );\n\t$scripts->add( 'jquery-table-hotkeys', \"includes/jquery/jquery.table-hotkeys$suffix.js\", array('jquery', 'jquery-hotkeys'), false, 1 );\n\t$scripts->add( 'jquery-touch-punch', \"includes/jquery/jquery.ui.touch-punch.js\", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );\n\n/*\t$scripts->add( 'thickbox', \"/wp-includes/js/thickbox/thickbox.js\", array('jquery'), '3.1-20121105', 1 );\n\tdid_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(\n\t\t\t'next' => __('Next &gt;'),\n\t\t\t'prev' => __('&lt; Prev'),\n\t\t\t'image' => __('Image'),\n\t\t\t'of' => __('of'),\n\t\t\t'close' => __('Close'),\n\t\t\t'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),\n\t\t\t'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'),\n\t) );*/\n\n\t// common bits for both uploaders\n\t$max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;\n\n\tif ( empty($max_upload_size) )\n\t\t$max_upload_size = __('not configured');\n/*\n\t// error message for both plupload and swfupload\n\t$uploader_l10n = array(\n\t\t'queue_limit_exceeded' => __('You have attempted to queue too many files.'),\n\t\t'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'),\n\t\t'zero_byte_file' => __('This file is empty. Please try another.'),\n\t\t'invalid_filetype' => __('This file type is not allowed. Please try another.'),\n\t\t'not_an_image' => __('This file is not an image. Please try another.'),\n\t\t'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),\n\t\t'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),\n\t\t'default_error' => __('An error occurred in the upload. Please try again later.'),\n\t\t'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),\n\t\t'upload_limit_exceeded' => __('You may only upload 1 file.'),\n\t\t'http_error' => __('HTTP error.'),\n\t\t'upload_failed' => __('Upload failed.'),\n\t\t'big_upload_failed' => __('Please try uploading this file with the %1$sbrowser uploader%2$s.'),\n\t\t'big_upload_queued' => __('%s exceeds the maximum upload size for the multi-file uploader when used in your browser.'),\n\t\t'io_error' => __('IO error.'),\n\t\t'security_error' => __('Security error.'),\n\t\t'file_cancelled' => __('File canceled.'),\n\t\t'upload_stopped' => __('Upload stopped.'),\n\t\t'dismiss' => __('Dismiss'),\n\t\t'crunching' => __('Crunching&hellip;'),\n\t\t'deleted' => __('moved to the trash.'),\n\t\t'error_uploading' => __('&#8220;%s&#8221; has failed to upload.')\n\t);\n*/\n\n/**\n\tAvactis additional js\n*/\n\t\t$scripts->add( 'bootstrap', 'includes/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.2.0');\n\t\t$scripts->add( 'bootstrap-switch', 'includes/bootstrap-switch/js/bootstrap-switch.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-hover-dropdown', 'includes/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'jquery-ui-custom', 'includes/jquery-ui/jquery-ui-1.10.3.custom.min.js', array( 'jquery' ), '1.10.3');\n\t\t$scripts->add( 'jquery-slimscroll', 'includes/jquery-slimscroll/jquery.slimscroll.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-blockui', 'includes/jquery/jquery.blockui.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-cokie', 'includes/jquery/jquery.cokie.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-uniform', 'includes/uniform/jquery.uniform.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-pulsate', 'includes/jquery/jquery.pulsate.min.js', array( 'jquery' ), false);\n\n\t\t$scripts->add( 'flot', 'includes/flot/jquery.flot.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'flot-categories', 'includes/flot/jquery.flot.categories.min.js', array( 'flot' ), false);\n\t\t$scripts->add( 'flot-resize', 'includes/flot/jquery.flot.resize.min.js', array( 'flot' ), false);\n\n\t\t$scripts->add( 'daterangepicker', 'includes/bootstrap-daterangepicker/daterangepicker.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'moment', 'includes/bootstrap-daterangepicker/moment.min.js', array(), false);\n\t\t$scripts->add( 'bootstrap-datepicker', 'includes/bootstrap-datepicker/js/bootstrap-datepicker.js', array( 'bootstrap' ), false);\n $scripts->add( 'bootstrap-datetimepicker','includes/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-dataTables', 'includes/datatables/plugins/bootstrap/dataTables.bootstrap.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-toastr', 'includes/bootstrap-toastr/toastr.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'jquery-dataTables', 'includes/datatables/media/js/jquery.dataTables.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'dataTables', 'includes/datatable.js', array(), false);\n\t\t$scripts->add( 'bootbox', 'includes/bootbox/bootbox.min.js', array(), false);\n\n\t\t$scripts->add( 'fullcalendar', 'includes/fullcalendar/fullcalendar.min.js', array( 'jquery-ui-resizable', 'jquery-ui-draggable' ), false);\n\t\t$scripts->add( 'jquery-easypiechart', 'includes/jquery-easypiechart/jquery.easypiechart.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-sparkline', 'includes/jquery/jquery.sparkline.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-gritter', 'includes/gritter/js/jquery.gritter.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-colorbox', 'includes/colorbox/jquery.colorbox-min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'asc-admin', 'includes/asc-admin.js', array(), false);\n $scripts->add( 'component-pickers', 'includes/components-pickers.js', array(), false);\n\n\t\t$scripts->add( 'ie9-excanvas', 'includes/excanvas.min.js', array(), false);\n\t\t$scripts->add( 'ie9-respond', 'includes/respond.min.js', array(), false);\n\n\t\t$scripts->add( 'jquery.validate', 'includes/jquery-validation/jquery.validate.min.js', array('jquery'), false);\n\t\t$scripts->add( 'validate-additional-methods', 'includes/jquery-validation/additional-methods.min.js', array('jquery'), false);\n\t\t$scripts->add( 'jquery-bootstrap-wizard', 'includes/bootstrap-wizard/jquery.bootstrap.wizard.min.js', array('jquery'), false);\n\t\t$scripts->add( 'jquery-backstretch', 'includes/backstretch/jquery.backstretch.min.js', array('jquery'), false);\n\t\t$scripts->add( 'select2', 'includes/select2/select2.min.js', array(), false);\n\n\t\t$scripts->add( 'jquery-iframe-transport', 'avactis-system/admin/js/jquery.iframe-transport.js', array(), false);\n\t\t$scripts->add( 'sanitize_tags', 'avactis-system/admin/js/sanitize_tags.js', array(), false);\n\t\t$scripts->add( 'admin-index', 'avactis-system/admin/js/index.js', array(), false);\n\t\t$scripts->add( 'admin-tasks', 'avactis-system/admin/js/tasks.js', array(), false);\n\t\t$scripts->add( 'admin-layout', 'avactis-system/admin/js/layout.js', array(), false);\n\t\t$scripts->add( 'form-wizard', 'avactis-system/admin/js/form-wizard.js', array('jquery'), false);\n\t\t$scripts->add( 'admin-login-soft', 'avactis-system/admin/js/login-soft.js', array(), false);\n\n\t\t$scripts->add( 'admin-avactis-main', 'avactis-system/admin/js/main.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-md5', 'avactis-system/admin/templates/modules/users/md5.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-dtree', 'avactis-system/admin/dtree/dtree.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-validate', 'avactis-system/admin/js/validate.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-new-window', 'avactis-system/admin/js/new_window.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-countries-states', 'avactis-system/admin/js/countries_states.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-tree-css', 'avactis-system/admin/jstree/css.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-tree-component', 'avactis-system/admin/jstree/tree_component.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-categories', 'avactis-system/admin/js/categories.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-utility', 'avactis-system/admin/js/utility.js', array(), false);\n $scripts->add( 'admin-toastr-notification', 'avactis-system/admin/js/toastr-notification.js', array(), false);\n\t}", "function script_url() {\n return $this->request()->script_url();\n }", "public function load_assets() {\n\t\t\t// get_template_directory_uri() . '/assets/js/scripts-bundled.js',\n\n\t\tif ( strstr( $_SERVER['SERVER_NAME'], 'one.wordpress.test' ) ) {\n\t\t\twp_enqueue_script(\n\t\t\t\t'university-javascript',\n\t\t\t\t'http://localhost:3000/bundled.js',\n\t\t\t\tnull,\n\t\t\t\t1,\n\t\t\t\ttrue\n\t\t\t);\n\t\t} else {\n\t\t\twp_enqueue_script(\n\t\t\t\t'university-vendor-js',\n\t\t\t\tget_theme_file_uri( '/bundled-assets/vendors~scripts.8c97d901916ad616a264.js' ),\n\t\t\t\tnull,\n\t\t\t\t1,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\twp_enqueue_script(\n\t\t\t\t'university-script-js',\n\t\t\t\tget_theme_file_uri( ' / bundled - assets / scripts.9407ba0c9e80d0b7c41d.js' ),\n\t\t\t\tnull,\n\t\t\t\t1,\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\twp_enqueue_style(\n\t\t\t\t'main-style',\n\t\t\t\tget_theme_file_uri( ' / bundled - assets / styles.9407ba0c9e80d0b7c41d.css' ),\n\t\t\t\tnull,\n\t\t\t\t1,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\twp_enqueue_style(\n\t\t\t'font-awesome-style',\n\t\t\t'//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',\n\t\t\tarray(),\n\t\t\t'4.7.0',\n\t\t\tfalse\n\t\t);\n\n\t\twp_enqueue_style(\n\t\t\t'roboto-font-style',\n\t\t\t'//fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,400,400i,700,700i',\n\t\t\tarray(),\n\t\t\t'1.0.0',\n\t\t\tfalse\n\t\t);\n\n\t}" ]
[ "0.74690664", "0.64585596", "0.6164367", "0.61609364", "0.61609364", "0.5987267", "0.5932925", "0.59215367", "0.5880918", "0.5813071", "0.5799872", "0.57987654", "0.5779275", "0.57524407", "0.5731462", "0.57255983", "0.565822", "0.5654437", "0.5654437", "0.5654437", "0.5654437", "0.5654437", "0.5654437", "0.5654437", "0.5654437", "0.5632385", "0.5572075", "0.55533516", "0.5475696", "0.54159516" ]
0.7261437
1
returns the URL of the script given in param if it exists, false otherwise
public function getUrl($script) { if (!array_key_exists($script, $this->url)) { $msg = "L'url pour le script $script n'existe pas ou n'est pas chargée. Vérifiez le paramétrage."; insertLogKwixo(__METHOD__ . ' : ' . __LINE__, $msg); return false; } return $this->url[$script]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrl($script)\r\n\t{\r\n\t\tif (!array_key_exists($script, $this->url_script))\r\n\t\t{\r\n\t\t\t$msg = \"L'url pour le script $script n'existe pas ou n'est pas chargée. Vérifiez le paramétrage.\";\r\n\t\t\tCertissimLogger::insertLog(__METHOD__.' : '.__LINE__, $msg);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn $this->url_script[$script];\r\n\t}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "function getScriptUrl() ;", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $router = GeneralUtility::makeInstance(Router::class);\n $route = $router->match($routePath);\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));\n } elseif ($moduleName = GeneralUtility::_GP('M')) {\n $this->thisScript = BackendUtility::getModuleUrl($moduleName);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoutePath($routePath);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "protected function getUrl() {\r\n $url = \\Nette\\Utils\\Strings::endsWith($this->url, \"/\") ? $this->url : $this->url . \"/\"; \r\n $script = \\Nette\\Utils\\Strings::startsWith($this->script, \"/\") ? $this->script : \"/\" . $this->script; \r\n \r\n return $url . $script;\r\n }", "function scr_is($script)\n{\n return ROUTE[WEBSITE_REQUEST] == $script;\n}", "public function isDynamicUrl();", "function script_url() {\n return $this->request()->script_url();\n }", "public function url_exists( $src ) {\n\n\t\t// Make arguments supplied are valid\n\t\tif( !is_string( $src ) ) {\n\t\t\texit( '$src is an invalid argument' );\n\t\t}\n\n\t\t// Isolate path to file from URL\n\t\t$url_parts = parse_url( $src );\n\t\t$path = $url_parts['path'];\n\n\t\t// Check if file exists from reassembled path\n\t\tif( file_exists( $_SERVER['DOCUMENT_ROOT'] . $path ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function hasScript()\n {\n return (isset($this->data[\"script\"]));\n }", "function url_exist($url)\r\n\t\t{\r\n\t\t\r\n\t\t}", "public function exists( $url );", "private function getUrl(){\r\n\t\tif ($GLOBALS['TSFE']->absRefPrefix) {\r\n\t\t\t$this->url = $GLOBALS['TSFE']->absRefPrefix;\r\n\t\t\treturn true;\r\n\t\t} else if ($GLOBALS['TSFE']->config['config']['baseURL']) {\r\n\t\t\t$this->url = $GLOBALS['TSFE']->config['config']['baseURL'];\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function abp01_wrapper_should_serve_script($requestUriPath) {\n return preg_match('/^(\\/wp-content\\/plugins\\/)([^\\/]+)(\\/media\\/js\\/3rdParty\\/leaflet-plugins\\/)(.*)\\/([^\\/]+)\\.js(\\?ver=([a-zA-Z0-9.]+))?$/i', \n $requestUriPath);\n}", "function url_for($script_path){\r\n // return the absolute path\r\n if($script_path[0] != '/'){\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n}", "function url_for($script_path) {\n\t// adds the leading '/' if it isn't already passed through the argument\n\tif($script_path[0] != '/') {\n\t\t$script_path = \"/\" . $script_path;\n\t}\n\treturn WWW_ROOT . $script_path;\n}", "public function hasRemoteUrl();", "function url_for($script_path) {\r\n // add the leading '/' if not present\r\n if($script_path[0] != '/') {\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n}", "function url_exists($url) {\n if(@file_get_contents($url,0,NULL,0,1)) {\n return true;\n } else {\n return false;\n }\n}" ]
[ "0.7383174", "0.68795043", "0.687784", "0.687784", "0.67987496", "0.65201247", "0.6308316", "0.6241424", "0.6241424", "0.6241424", "0.6241424", "0.6241424", "0.6241424", "0.6241424", "0.6241424", "0.6233022", "0.61503166", "0.6085929", "0.6025426", "0.5986629", "0.5985298", "0.5956962", "0.58710766", "0.5774096", "0.5733027", "0.57178074", "0.5689286", "0.5680649", "0.56731415", "0.56724346" ]
0.7406418
0
switches status to $mode and reload URL if available, returns false otherwise
public function switchMode($mode) { if (!$this->statusIsAvailable($mode)) { CertissimLogger::insertLogKwixo(__FILE__, "Le mode '$mode' n'est pas reconnu. 'test' défini à la place."); $mode = 'test'; } //switch the status to $mode $this->setStatus($mode); //reload URLs $this->loadURLs(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMode($mode)\n {\n $this->_isLiveMode = ($mode == self::LIVE);\n }", "public static function checkoutMode() {\n\n \tif ( file_exists(PassThru::$_realPath.'/checkoutmode') ) {\n \t\tLog::out(\"passthru - checkoutMode positive\");\n \t\treturn true;\n \t}\n \n \treturn false;\n \n }", "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 }", "function api_mode($ask_mode) {\n\tif(trim(strtolower(chevereto_config('api_mode'))) == $ask_mode) return true;\n}", "function _owp_process_save() { // cause I really like function named \"%process%\", so accurate...\n\n\t$opt = (int) get_option( 'owp_toggle_offline_mod' );\n\n\t/**\n\t * You could say, what the hell !\n\t * offline mod && nonce ?\n\t * Yes Sir. Don't ask don't tell !\n\t */\n\tif ( isset( $_GET['toggle-offline-nonce'] ) && wp_verify_nonce( $_GET['toggle-offline-nonce'], 'toggle-offline' ) ) {\n\t\tswitch ( $opt ) {\n\t\t\tcase 0:\n\t\t\t\tupdate_option( 'owp_toggle_offline_mod', 1, 'no' );\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tupdate_option( 'owp_toggle_offline_mod', 0, 'no' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$params = [ 'toggle-offline', 'toggle-offline-nonce' ]; // avoid the annoying part, like if you have to reload page for other purpose\n\t\twp_safe_redirect( remove_query_arg( $params ) );\n\t\texit;\n\t}\n\n\treturn false;\n}", "public function checkUrl()\n\t{\n\t\t$url = $this->input->get('url', '', 'raw');\n\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\t\t$model->savestate(true);\n\t\t$result = $model->checkAndCleanUrl($url);\n\n\t\t$this->container->platform->setSessionVar('transfer.url', $result['url'], 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.url_status', $result['status'], 'akeeba');\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}", "public function isActive($mode = null)\n {\n if ($mode !== null && isset($_GET[$this->name])) {\n return $_GET[$this->name] == $mode;\n }\n\n return isset($_GET[$this->name]) ? $_GET[$this->name] : false;\n }", "function devmode($test_mode=null)\n{\n\t$ci =& get_instance();\n $servers = $ci->config->item('servers');\n\n // To make testing more accurate, get rid of the http://, etc.\n $current_server = strtolower(trim(base_url(), ' /'));\n $current_server = str_replace('http://', '', $current_server);\n $current_server = str_replace('https://', '', $current_server);\n\n\n //$current_mode = array_search($current_server, $servers);\n \n $current_mode = '';\n \n // Because the server name could contain www. or subdomains,\n // we need to search each item to see if it contains the string.\n foreach ($servers as $name => $domain)\n {\n if (!empty($domain))\n { \n if (strpos($current_server, $domain) !== FALSE) {\n $current_mode = $name;\n break;\n }\n }\n }\n \n\n // Time to figure out what to return.\n if (empty($test_mode))\n {\n // Not performing a check, so just return the current value\n return $current_mode;\n } else\n {\n return $current_mode == $test_mode;\n }\n \n}", "public function reload()\n {\n if ($this->config['server_type'] == 'process') {\n $pid = $this->getPid('worker');\n } else {\n $pid = $this->getPid('master');\n }\n\n if (empty($pid)) {\n echo \"{$this->config['process_name']} has not process\" . PHP_EOL;\n return false;\n }\n\n exec(\"kill -USR1 \" . implode(' ', $pid), $output, $return);\n\n if ($return === false) {\n echo \"{$this->config['process_name']} reload fail\" . PHP_EOL;\n return false;\n }\n echo \"{$this->config['process_name']} reload success\" . PHP_EOL;\n return true;\n }", "public static function reloadDataSite(): bool\n {\n }", "public function reload() {\n $this->init();\n redirect('./');\n }", "public function changeStatusToActive($modeID){\n try{\n $stmt = $this->db->prepare(\"UPDATE Modes\n Set Modestatus = 1\n WHERE ModeID=:modeID\");\n if($stmt->execute(array(':modeID'=>$modeID))){\n return true;\n }else{\n return false;\n }\n }catch(PDOException $e){\n echo $e->getMessage();\n }\n }", "function Get_Mode($url)\n\t{\n\t\t\n\t\tif (preg_match('/\\.ds(\\d+)\\.tss/', $url))\n\t\t{\n\t\t\t$mode = MODE_LOCAL;\n\t\t}\n\t\telseif (preg_match('/^rc\\./', $url))\n\t\t{\n\t\t\t$mode = MODE_RC;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mode = MODE_LIVE;\n\t\t}\n\t\t\n\t\treturn($mode);\n\t\t\n\t}", "function sendRequest(){\n $this->fpopened = $this->fopen($this->urltoopen);\n if ($this->fpopened!==false) return true;\n return false;\n }", "private function loadURLs()\r\n\t{\r\n\t\t$status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\t\tforeach ($this->url as $scriptname => $modes)\r\n\t\t\t$this->url_script[$scriptname] = $modes[$status];\r\n\t}", "function ltiLaunchCheck() {\n global $CFG, $PDO;\n if ( ! ltiIsRequest() ) return false;\n $session_id = ltiSetupSession($PDO);\n if ( $session_id === false ) return false;\n\n // Redirect back to ourselves...\n $url = curPageURL();\n $query = false;\n if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {\n $query = true;\n $url .= '?' . $_SERVER['QUERY_STRING'];\n }\n\n $location = sessionize($url);\n session_write_close(); // To avoid any race conditions...\n\n if ( headers_sent() ) {\n echo('<p><a href=\"'.$url.'\">Click to continue</a></p>');\n } else { \n header('Location: '.$location);\n }\n exit();\n}", "public function changeMode($path, $mode);", "private function checkUrlStatus()\n {\n $request = curl_init($this->url);\n\n curl_setopt($request, CURLOPT_HEADER, true);\n curl_setopt($request, CURLOPT_NOBODY, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_TIMEOUT, 10);\n\n curl_exec($request);\n $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);\n curl_close($request);\n\n if ($httpCode >= 200 && $httpCode < 400) {\n return true;\n }\n\n return false;\n }", "public function changeStatus(): void\n {\n if ('online' === $this->online_status) {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'offline' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'offline';\n } else {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'online' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'online';\n }\n\n // Don't forget to regenerate URL cache to make online machine available\n if (rex_addon::get('url')->isAvailable()) {\n d2u_addon_backend_helper::generateUrlCache('reference_id');\n d2u_addon_backend_helper::generateUrlCache('tag_id');\n }\n }", "function canHandleCurrentUrl() ;", "protected final function reload() {\n\t\treturn $this->redirect(Router::getPath());\n\t}", "public function isMode($mode);", "private function _checkServerIsOnline($url){\n\t\treturn true;\n\t\tini_set(\"default_socket_timeout\",\"05\");\n set_time_limit(5);\n $f=fopen($url,\"r\");\n $r=fread($f,1000);\n fclose($f);\n return (strlen($r)>1) ? true : false;\n\t}", "public function reload()\n {\n $ui = $this->getEnvironment()->getModule('ui');\n\n if (is_object($ui) && $ui instanceof GridGallery_Ui_Module) {\n $this->load($ui);\n\n return true;\n }\n\n return false;\n }", "public function canHandleCurrentUrl() {}", "public function setBootloaderMode($mode)\n {\n $payload = '';\n $payload .= pack('C', $mode);\n\n $data = $this->sendRequest(self::FUNCTION_SET_BOOTLOADER_MODE, $payload);\n\n $payload = unpack('C1status', $data);\n\n return $payload['status'];\n }", "public function loadSettings() {\n $this->serverURL = Yii::$app->getModule('rocketchat')->settings->get('serverURL');\n return true;\n }", "public function changeStatusToInactive($modeID){\n try{\n $stmt = $this->db->prepare(\"UPDATE Modes\n Set Modestatus = 0\n WHERE ModeID=:modeID\");\n if($stmt->execute(array(':modeID'=>$modeID))){\n return true;\n }else{\n return false;\n }\n }catch(PDOException $e){\n echo $e->getMessage();\n }\n }", "public function check_request($mode = rcube_ui::INPUT_POST)\n {\n $token = rcube_ui::get_input_value('_token', $mode);\n $sess_id = $_COOKIE[ini_get('session.name')];\n return !empty($sess_id) && $token == $this->get_request_token();\n }", "private function toggleTunnel(){\n\t\tif(isset($_POST['tunnelid']) && is_numeric($_POST['tunnelid'])){\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['id'] == $_POST['tunnelid']){\n\t\t\t\t\t\n\t\t\t\t\tif((string)$tunnel['enable'] == 'true'){\n\t\t\t\t\t\t$tunnel['enable'] = 'false';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$tunnel['enable'] = 'true';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->config->saveConfig();\n\t\t\t\t\techo '<reply action=\"ok\"/>';\n\t\t\t\t\treturn true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new Exception('The specified tunnel could not be found');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('An invalid tunnel identifier was submitted');\n\t\t}\n\t}" ]
[ "0.5831286", "0.56028324", "0.5570128", "0.5548321", "0.54579395", "0.54401827", "0.54332304", "0.54330504", "0.54071337", "0.540272", "0.5399163", "0.5360786", "0.53475314", "0.53228694", "0.5302009", "0.52995867", "0.52206594", "0.51932627", "0.51803845", "0.5147062", "0.51408035", "0.5138394", "0.5130489", "0.50375664", "0.50322205", "0.5028327", "0.50241685", "0.5019161", "0.50087655", "0.49938527" ]
0.6953161
0
Iterates over all form controls.
public function getControls() { return $this->getComponents(TRUE, 'Nette\Forms\IFormControl'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllControls();", "protected function regenerateFormControls()\n\t{\n\t\t$form = $this->getForm();\n\n\t\t// regenerate checker's checkbox controls\n\t\tif ($this->hasOperations()) {\n\t\t\t$values = $form->getValues();\n\n\t\t\t$form->removeComponent($form['checker']);\n\t\t\t$sub = $form->addContainer('checker');\n\t\t\tforeach ($this->getRows() as $row) {\n\t\t\t\t$sub->addCheckbox($row[$this->keyName], $row[$this->keyName]);\n\t\t\t}\n\n\t\t\tif (!empty($values['checker'])) {\n\t\t\t\t$form->setDefaults(array('checker' => $values['checker']));\n\t\t\t}\n\t\t}\n\n\t\t// for selectbox filter controls update values if was filtered over column\n\t\tif ($this->hasFilters()) {\n\t\t\tparse_str($this->filters, $list);\n\n\t\t\tforeach ($this->getFilters() as $filter) {\n\t\t\t\tif ($filter instanceof SelectboxFilter) {\n\t\t\t\t\t$filter->generateItems();\n\t\t\t\t}\n\n\t\t\t\tif ($this->filters === $this->defaultFilters && ($filter->value !== NULL || $filter->value !== '')) {\n\t\t\t\t\tif (!in_array($filter->getName(), array_keys($list))) $filter->value = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// page input & items selectbox\n\t\t$form['page']->setValue($this->paginator->page); // intentionally page from paginator\n\t\t$form['items']->setValue($this->paginator->itemsPerPage);\n\t}", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "public function getControls()\n\t{\n\t\t$this->ensureChildControls();\n\t\treturn $this->_container->getControls();\n\t}", "public function getControls();", "public function selectAllForms();", "public function getControls()\n {\n return $this->controls;\n }", "public function controls()\n {\n }", "protected function _handle_forms()\n\t{\n\t\tif (!strlen($this->_form_posted)) return;\n\t\t$method = 'on_'.$this->_form_posted.'_submit';\n\n\t\tif (method_exists($this, $method))\n\t\t{\n\t\t\tcall_user_func(array($this, $method), $this->_form_action);\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ($this->controls as $k=>$v)\n\t\t{\n\t\t\t$ctl = $this->controls[$k];\n\n\t\t\tif (method_exists($ctl, $method))\n\t\t\t{\n\t\t\t\t$ctl->page = $this;\n\t\t\t\tcall_user_func(array($ctl, $method), $this->_form_action);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (DEBUG) dwrite(\"Method '$method' not defined\");\n\t}", "protected function _register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\n\t\t$this->register_controls();\n\t}", "public function BuildControls() {\n\n $this->EncType= $this->GetOption('EncType');\n\n // convert array of arrays into array of objects\n foreach($this->Controls as $Name=>&$Control) {\n // skip already builded controls\n if (is_object($Control)) {\n continue;\n }\n // find classname\n if (!isset($Control['Type'])) {\n $Control += array('Type'=>'text', 'Attributes'=>array('UNKNOWNTYPE'=>'YES'));\n }\n if (strpos($Control['Type'], '\\\\') === false) { // short name, ex.: \"select\"\n $Type= ucfirst($Control['Type']);\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\'.$Type.'Control';\n } else { // it is fully qualified class name\n $Class= $Control['Type'];\n }\n if (!class_exists($Class)) {\n $this->Error('Class \"'.$Class.'\" not found.');\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\TextControl'; // fallback to any primitive control\n }\n // copy this array into $Options and append few more items\n // and append common options to allow usage of services\n $Options= $Control + array(\n 'Name'=> $Name,\n 'Form'=> $this,\n 'Book'=> $this->GetOption('Book')\n ) + $this->GetCommonOptions();\n $Control= new $Class($Options);\n // switch to multipart encoding if any control require that\n if ($Control->GetMultipartEncoding()) {\n $this->EncType= 'multipart/form-data';\n }\n }\n $this->Builded= true;\n }", "private function GetAllForms() {\n $tmp_word_info = $this->word->GetGramInfo();\n $result = array();\n foreach ($tmp_word_info as $info) {\n $result[] = $this->GenerateForms($this->CleanGrammaInfo($info));\n }\n $this->word->SetForms($result);\n }", "protected function _register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\n\t\t$this->register_general_content_controls();\n\n\t\t$this->register_count_content_controls();\n\n\t\t$this->register_helpful_information();\n\t}", "public function GetControlsList() {\n\n return array_keys($this->Controls);\n }", "protected abstract function printFormElements();", "protected function forms()\r\n {\r\n $metaFileInfo = $this->getFormObj()->GetMetaFileInfo();\r\n $modulePath = $metaFileInfo['modules_path'];\r\n $modulePath = substr($modulePath,0,strlen($modulePath)-1);\r\n global $g_MetaFiles;\r\n php_grep(\"<EasyForm\", $modulePath);\r\n \r\n for ($i=0; $i<count($g_MetaFiles); $i++)\r\n {\r\n $g_MetaFiles[$i] = str_replace('/','.',str_replace(array($modulePath.'/','.xml'),'', $g_MetaFiles[$i]));\r\n $list[$i]['val'] = $g_MetaFiles[$i];\r\n $list[$i]['txt'] = $g_MetaFiles[$i];\r\n }\r\n\r\n return $list; \r\n }", "function fetchAllForms () {\n global $wpdb;\n $table_name = $wpdb->prefix . \"dx_forms_meta_data\";\n $dbResults = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\n echo \"<h1>All forms</h1>\";\n\n // loop through all forms\n foreach ($dbResults as $row) {\n ?>\n <div>Last updated on: <?= date(\"F j, Y. g:i A\",strtotime($row->timestamp)) ?></div>\n <div><?= $row->form_name ?></div>\n <h3>Form submissions</h3>\n <?php\n // get field mappings (ID to name) from DB row\n $field_mappings = json_decode($row->field_mappings, true);\n \n $this->fetchFormSubmissions($row->form_id, $field_mappings);\n }\n\n echo \"<hr>\";\n }", "public function iterateAllElements()\n {\n return $this->getIterator();\n }", "protected function Form_Run() {}", "function initChildrenRecursive() {\n $this->initChildControls();\n if ($this->HasControls()) {\n $keys = array_keys($this->Controls);\n $count = count($this->Controls);\n for ($i = 0; $i < $count; $i++) {\n @$control = &$this->Controls[$keys[$i]];\n $control->initChildrenRecursive();\n }\n }\n\n }", "public function listForms();", "public function Populate() {\r\n\t\t$form_instance = $this->form_instance;\r\n\t\t// Retrieve the field data\r\n\t\t$_els = vcff_parse_container_data($form_instance->form_content);\r\n\t\t// If an error has been detected, return out\r\n\t\tif (!$_els || !is_array($_els)) { return; }\r\n\t\t// Retrieve the form instance\r\n\t\t$form_instance = $this->form_instance; \r\n\t\t// Loop through each of the containers\r\n\t\tforeach ($_els as $k => $_el) {\r\n\t\t\t// Retrieve the container instance\r\n\t\t\t$container_instance = $this->_Get_Container_Instance($_el);\r\n\t\t\t// Add the container to the form instance\r\n\t\t\t$form_instance->Add_Container($container_instance);\r\n\t\t}\r\n\t}", "protected function traverseFields(): void\n {\n $columns = $this->definition->tca['columns'] ?? [];\n foreach ($this->definition->data as $fieldName => $value) {\n if (! is_array($columns[$fieldName])) {\n continue;\n }\n \n $this->registerHandlerDefinitions($fieldName, $columns[$fieldName], [$fieldName]);\n \n // Handle flex form fields\n if (isset($columns[$fieldName]['config']['type']) && $columns[$fieldName]['config']['type'] === 'flex') {\n $this->flexFormTraverser->initialize($this->definition, [$fieldName])->traverse();\n }\n }\n }", "public function getElements() : array\n {\n return $this->formElements;\n }", "public function getForms()\n {\n return $this->form;\n }", "function get_forms()\n {\n $forms = array();\n $form_manager = C_Form_Manager::get_instance();\n foreach ($form_manager->get_forms($this->object->get_form_type()) as $form) {\n $forms[] = $this->get_registry()->get_utility('I_Form', $form);\n }\n return $forms;\n }", "public function show_forms() {\n ?>\n <div class=\"metabox-holder\">\n <?php foreach ( $this->settings_tabs as $tab ) { ?>\n <div id=\"<?php echo $tab['id']; ?>\" class=\"group\" style=\"display: none;\">\n <form method=\"post\" action=\"options.php\">\n <?php\n do_action( $this->settings_prefix . '_settings_form_top_' . $tab['id'], $tab );\n settings_fields( $tab['id'] );\n\n $this->do_settings_sections( $tab['id'] );\n\n do_action( $this->settings_prefix . '_settings_form_bottom_' . $tab['id'], $tab );\n ?>\n <div>\n <?php submit_button(); ?>\n </div>\n </form>\n </div>\n <?php } ?>\n </div>\n <?php\n $this->script();\n }", "protected function _register_controls()\n {\n $this->tab_content();\n $this->tab_style();\n }", "public function iterateChildren();", "function dumpChildrenFormItems($return_contents=false)\r\n {\r\n //Iterates through components, dumping all form items\r\n reset($this->components->items);\r\n\r\n if ($return_contents) ob_start();\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n if ($v->inheritsFrom('Control'))\r\n {\r\n if ($v->canShow())\r\n {\r\n $v->dumpFormItems();\r\n }\r\n }\r\n else $v->dumpFormItems();\r\n }\r\n if ($return_contents)\r\n {\r\n $contents=ob_get_contents();\r\n ob_end_clean();\r\n return($contents);\r\n }\r\n }" ]
[ "0.66396", "0.6395155", "0.59987897", "0.596678", "0.5901082", "0.57954496", "0.56972945", "0.564723", "0.55539083", "0.5546584", "0.55002546", "0.5441837", "0.5419653", "0.5410239", "0.5365661", "0.53204435", "0.52822644", "0.5257858", "0.5224224", "0.5213241", "0.5209556", "0.5183386", "0.51816815", "0.517382", "0.5167605", "0.5136436", "0.5115764", "0.5090955", "0.5090716", "0.5084539" ]
0.6429766
1
Adds singleline text float number input control to the form.
public function addFloat($name, $label = '', $cols = 4, $maxLength = NULL) { return $this[$name] = new FloatInput($label, $cols, $maxLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _field_number($fval) \n {\n return $this->_field_text($fval);\n }", "function number( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_NUMBER,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_NUMBER\n );\n\t}", "public function numberInput($options = []) {\n $defaultOptions = [\n 'id' => self::NUMBER_ID,\n 'class' => 'form-control',\n 'autocomplete' => self::AUTO_CC_ATTR,\n 'placeholder' => '•••• •••• •••• ••••',\n 'required' => true,\n 'type' => 'tel',\n 'size' => 20\n ];\n $mergedOptions = array_merge($defaultOptions, $options);\n StripeHelper::secCheck($mergedOptions);\n $mergedOptions['data-stripe'] = self::NUMBER_ID;\n return Html::input('text', null, null, $mergedOptions);\n }", "function input_number($nm_var,$caption,$place,$val=NULL,$ro=NULL){\n?> \n <div class=\"form-group number\">\n <label for=\"<?php echo $nm_var; ?>\" class=\"col-sm-3 control-label\"><?php echo $caption; ?></label>\n <div class=\"col-sm-6\">\n <INPUT type=\"number\" id=\"txtNumber\" placeholder=\"<?php echo $place; ?>\" class=\"form-control\"\n onkeypress=\"return isNumberKey(event)\" value=\"<?php echo set_value($nm_var,$val);?>\" \n name=\"<?php echo $nm_var; ?>\" <?php if($ro!=NULL) echo \"Readonly\";?> > \n <h6><?php echo form_error($nm_var,'<div class=\"text-yellow\">', '</div>'); ?></h6>\n </div>\n </div>\n<?php\n// onkeypress=\"return isNumberKey(event)\" ditulis di jscode bagian awal.\n}", "public static function inputNumber($fieldName, $item)\n\t{\n $uppercaseFieldName = strtoupper($fieldName);\n $fieldValue = $item->$fieldName;\n\n $tooltipTitle = Text::_('COM_CAJOBBOARD_' . $uppercaseFieldName . '_FIELD_TOOLTIP_TITLE');\n $tooltipText = Text::_('COM_CAJOBBOARD_' . $uppercaseFieldName . '_FIELD_TOOLTIP_TEXT');\n $labelText = Text::_('COM_CAJOBBOARD_' . $uppercaseFieldName . '_FIELD_LABEL');\n\n $html = <<<EOT\n<fieldset\n name=\"$fieldName\"\n class=\"control-group hasTip\"\n title=\"$tooltipTitle::$tooltipText\"\n>\n <div class=\"control-label\">\n <label for=\"$fieldName\">\n $labelText\n </label>\n </div>\n <div class=\"controls\">\n <input type=\"number\" step=\"1\" name=\"$fieldName\" id=\"$fieldName\" value=\"$fieldValue\"/>\n </div>\n</fieldset>\nEOT;\n\n\t\treturn $html;\n }", "public static function validateFloat(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]*[.,]?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}", "public function txtPeso_Create($strControlId = null) {\n\t\t\t$this->txtPeso = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtPeso->Name = QApplication::Translate('Peso');\n\t\t\t$this->txtPeso->Text = $this->objComandoRiscoPeca->Peso;\n\t\t\t$this->txtPeso->Required = true;\n\t\t\treturn $this->txtPeso;\n\t\t}", "function Solicitar_Precio_ali($Value){\n echo \"<label for='Precio'><b>Precio</b></label>\";\n echo \"<input type='text' placeholder='Precio del alimento' name='Precio' required maxlength='3' value='\".$Value.\"'\";\n echo \"title='Ingrse un precio de $0.5 o de $1 a $99' pattern='^(\\d{1,2}|0.5)$'>\";\n echo \"<br><br>\";\n}", "function add_invoice_number_field() {\n\t\tif ( get_the_title() == \"Invoice\" ) {\n\t\t\techo '<p<label for=\"invoice_number\">Invoice Number:</label> <input type=\"text\" name=\"invoice_number\" id=\"invoice_number\" value=\"\" /></p>';\n\t\t}\n\t}", "public function it_shows_number_type_input()\n {\n // configure\n $inputs = [\n [\n 'type' => 'number',\n 'name' => 'number_of_tries'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"number\"', false);\n }", "function _field_text($fval) \n {\n $fval = (empty($fval) && !empty($this->opts))? $this->opts : $fval;\n if (is_array($fval) && !empty($this->attribs['multi']))\n $fval = ''; // we can't handle this here. Don't put \"Array\"\n\n return sprintf(\"<input type=\\\"text\\\" id=\\\"%s\\\" name=\\\"%s%s\\\" value=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s />\\n\",\n $this->fname, \n $this->fname, \n (!empty($this->attribs['multi']))? '[]':'', \n $this->_htmlentities($fval), \n $this->_get_field_size(), \n $this->attribs['maxlength'], \n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n }", "function Solicitar_Stock_ali($Value){\n echo \"<label for='Stock'><b>Stock</b></label>\";\n echo \"<input type='text' placeholder='Stock del alimento' name='Stock' required maxlength='100' value='\".$Value.\"'\";\n echo \"title='Ingrse un numero mayor a 1 y menor a 999' pattern='^\\d{1,3}$'>\";\n echo \"<br><br>\";\n}", "function get_input_number($id_campo, $lbl_campo, $value, $arr_err, $class='campo', $min=1, $max=9999, $decimal=false, $placeholder='') {\n $aux_aplicar_decimal = ($decimal == true) ? ' step=\".01\" ' : '';\n \n $o = '<div class=\"'.$class.'\">'; //output\n $o .= $lbl_campo;\n $o .= (isset($arr_err[$id_campo])) ? $arr_err[$id_campo] : '';\n $o .= '<input type=\"number\" max=\"'.$max.'\" min=\"'.$min.'\" id=\"'.$id_campo.'\" name=\"'.$id_campo.'\" '.$aux_aplicar_decimal.' placeholder=\"'.$placeholder.'\" value=\"'.htmlspecialchars(stripslashes($value)).'\" />';\n $o .= '</div>';\n return $o;\n }", "function variation_settings_fields( $loop, $variation_data, $variation ) {\n\n\n echo '<div class=\"options_group\">';\n\n // Number Field\n woocommerce_wp_text_input(\n array(\n 'id' => '_xxl_pricing[' . $variation->ID . ']',\n 'label' => __( 'XXL+ Pricing', 'woocommerce' ),\n 'desc_tip' => 'true',\n 'placeholder' => 'Required!',\n 'description' => __( 'Enter the price of XXL+ t-shirts that will be more expensive than the XS-XL shirts.', 'woocommerce' ),\n 'value' => get_post_meta( $variation->ID, '_xxl_pricing', true )\n )\n );\n\n echo '</div>';\n\n}", "function t_add_texonomy_field() {\n echo '<div class=\"form-field\">\n\t\t<label for=\"taxonomy_displayorder\">' . __('Display Order', 'zci') . '</label>\n\t\t<input type=\"text\" name=\"taxonomy_displayorder\" id=\"taxonomy_displayorder\" value=\"1\" />\n\t</div>';\n}", "public function txtPostedTotalAmount_Create($strControlId = null) {\n\t\t\t$this->txtPostedTotalAmount = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtPostedTotalAmount->Name = QApplication::Translate('Posted Total Amount');\n\t\t\t$this->txtPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\t\t\treturn $this->txtPostedTotalAmount;\n\t\t}", "public function addInput($LableText = null, $NewLine = false , $InputPrams = array(), $InputValue = array()) \n{\n $this->showElment($this->processInput($LableText, $NewLine, $InputPrams, $InputValue ));\n}", "function uwwtd_field_num($field) {\n// $field[0]['#markup'] = 'Not provided';\n return uwwtd_format_number($field[0]['#markup'], 1);\n}", "public static function convert_number_field() {\n\n\t\t// Create a new Number field.\n\t\tself::$field = new GF_Field_Number();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Number specific properties.\n\t\tself::$field->rangeMin = rgar( self::$nf_field, 'number_min' );\n\t\tself::$field->rangeMax = rgar( self::$nf_field, 'number_max' );\n\n\t\t// Add currency property if needed.\n\t\tif ( rgar( self::$nf_field, 'mask' ) && 'currency' === self::$nf_field['mask'] ) {\n\t\t\tself::$field->numberFormat = 'currency';\n\t\t}\n\n\t}", "public function txtReportedTotalAmount_Create($strControlId = null) {\n\t\t\t$this->txtReportedTotalAmount = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtReportedTotalAmount->Name = QApplication::Translate('Reported Total Amount');\n\t\t\t$this->txtReportedTotalAmount->Text = $this->objStewardshipBatch->ReportedTotalAmount;\n\t\t\treturn $this->txtReportedTotalAmount;\n\t\t}", "function base_price_box_content($post){\n wp_nonce_field( basename( __FILE__ ), 'base_price_box_content_nonce' );\n\n\n $price = get_post_meta($post ->ID, 'base_price',true);\n\n echo '$ <input type=\"number\" class=\"form-control\" id=\"base_price\" name=\"base_price\" min=\"0.01\" step=\"0.01\" max=\"2500\" value=\"' . $price . '\" required=\"required\">';\n }", "public function float($prompt = 'Float', $message = 'Please enter a floating-point decimal.') {\n return $this->text($prompt, function($result) { \n return filter_var($result, FILTER_VALIDATE_FLOAT); \n }, $message);\n }", "public function txtActualTotalAmount_Create($strControlId = null) {\n\t\t\t$this->txtActualTotalAmount = new QFloatTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtActualTotalAmount->Name = QApplication::Translate('Actual Total Amount');\n\t\t\t$this->txtActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount;\n\t\t\treturn $this->txtActualTotalAmount;\n\t\t}", "function acf_numval($value)\n{\n}", "function woo_qi_product_fields() {\n global $woocommerce, $post;\n\n \techo '<div class=\"wc_qi_input\">';\n \t\t// woo_qi field will be created here.\n \t\twoocommerce_wp_text_input(\n \t\t\tarray(\n 'type' => 'number',\n \t\t\t\t'id' => '_woo_qi_input',\n \t\t\t\t'label' => __( 'Qty Increment', 'woo_qi' ),\n \t\t\t\t'placeholder' => '',\n \t\t\t\t'desc_tip' => 'true',\n \t\t\t\t'description' => __( 'Enter the quantity increment for this product here.', 'woo_qi' )\n \t\t\t)\n \t\t);\n \techo '</div>';\n }", "public function number($attribute, $label, $options = [])\n {\n $options = static::defaults($options);\n return $this->addSingleField(\n $attribute,\n $options[self::OPTIONS_VALIDATION],\n Widget::getNumberWidget($attribute, $label, $options)\n );\n }", "function number_int( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_NUMBER,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_INTEGER\n );\n\t}", "function printNumberInput($isPro,$options, $label, $id, $description, $type = 'text', $default = '', $url='', $showSave = false) {\r\n $offset = '';\r\n if (ai_startsWith($label, 'i-')) {\r\n $offset = 'class=\"'.substr($label,0, 5).'\" ';\r\n $label = substr($label, 5);\r\n }\r\n \r\n if (!isset($options[$id])) {\r\n $options[$id] = '0';\r\n }\r\n if ($options[$id] == '' && $default != '') {\r\n $options[$id] = $default;\r\n }\r\n if (!isset($options['demo']) || $options['demo'] == 'false') {\r\n $isPro = false;\r\n }\r\n $pro_class = $isPro ? ' class=\"ai-pro\"':'';\r\n\r\n if ($isPro) {\r\n $label = '<span alt=\"Pro feature\" title=\"Pro feature\">'.$label.'</span>';\r\n }\r\n\r\n echo '\r\n <tr'.$pro_class.'>\r\n <th scope=\"row\" '.$offset.'>' . $label . renderExampleIcon($url) . renderExternalWorkaroundIcon($showSave). '</th>\r\n <td><span class=\"hide-print\">\r\n <input name=\"' . $id . '\" type=\"' . $type . '\" id=\"' . $id . '\" style=\"width:150px;\" onblur=\"aiCheckInputNumber(this)\" value=\"' . esc_attr($options[$id]) . '\" /><br></span>\r\n <p class=\"description\">' . $description . '</p></td>\r\n </tr>\r\n ';\r\n}", "public function setNumberAttribute($input)\n {\n $this->attributes['number'] = $input ? $input : null;\n }", "public function setFNumber(?float $value): void {\n $this->getBackingStore()->set('fNumber', $value);\n }" ]
[ "0.60248977", "0.58514655", "0.554682", "0.55460733", "0.5416546", "0.5413518", "0.53914297", "0.5375392", "0.5374889", "0.5293773", "0.5264965", "0.52462184", "0.5220956", "0.5207607", "0.52015626", "0.517828", "0.5169786", "0.51286143", "0.5123235", "0.51062554", "0.50976527", "0.505491", "0.50506496", "0.5050205", "0.5032361", "0.503073", "0.50207174", "0.4976351", "0.4973513", "0.49700758" ]
0.5860399
1
Adds select box control that allows single item selection with bind to parent Select.
public function addSelectBind($name, $label, $items = NULL, $parent, $size = NULL) { return $this[$name] = new SelectBoxBind($label, $items, $parent, $size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newSelect()\n {\n return $this->newInstance('Select');\n }", "public function addSelect($name, $label, $items = NULL, $size = NULL)\n\t{\n\t\treturn $this[$name] = new SelectBox($label, $items, $size);\n\t}", "function theme_select(&$item) {\n\n\t\t$class = array('form-select');\n\t\t_form_set_class($item, $class);\n\n\t\t$size = $item['#size'] ? ' size=\"' . $item['#size'] . '\"' : '';\n\t\t$multiple = isset($item['#multiple']) && $item['#multiple'];\n\n\t\t$retval .= '<select name=\"'\n\t\t\t. $item['#name'] . ''. ($multiple ? '[]' : '') . '\"' \n\t\t\t. ($multiple ? ' multiple=\"multiple\" ' : '') \n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' id=\"' . $item['#id'] . '\" ' . $size . '>' \n\t\t\t. form_select_options($item) . '</select>';\n\t\treturn($retval);\n\n\t}", "public static function renderSelect();", "function select( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_SELECT,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "public function callback_select( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n $html = sprintf( '<select class=\"%1$s\" name=\"%2$s\" id=\"%2$s\" %3$s>', $size, $name_id, $disable );\n\n foreach ( $args['options'] as $key => $label ) {\n $html .= sprintf( '<option value=\"%s\" %s>%s</option>', $key, selected( $value, $key, false ), $label );\n }\n\n $html .= sprintf( '</select>' );\n $html .= $this->get_field_description( $args );\n\n echo $html;\n }", "public function getControl()\n\t{\n\t\t$items = $this->getPrompt() === FALSE ? array() : array('' => $this->translate($this->getPrompt()));\n\t\tforeach ($this->options as $key => $value) {\n\t\t\t$items[is_array($value) ? $key : $key] = $value;\n\t\t}\n\n\t\treturn Nette\\Forms\\Helpers::createSelectBox(\n\t\t\t$items,\n\t\t\tarray(\n\t\t\t\t'selected?' => $this->value,\n\t\t\t\t'disabled:' => is_array($this->disabled) ? $this->disabled : NULL\n\t\t\t)\n\t\t)->addAttributes(BaseControl::getControl()->attrs);\n\t}", "public function addTcaSelectItemDataProvider() {}", "public function select ( \\r8\\Form\\Select $field )\n {\n $this->addField( \"select\", $field );\n }", "function ItemSelect($class, $name, $selected=\"\")\r\n\t{\r\n\t\tif(isset($this->MyClasses[$class]['db']['title']))\r\n\t\t{\r\n\t\t\t$Order = array(\"title\"=>\"ASC\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$Order = array();\r\n\t\t}\r\n\t\t$Items = $this->GetRecords($class, array(), $Order, \"\");\r\n\t\t// make options from data\r\n\t\t$Options['0'] = \"...\";\r\n\t\t// check if we have parent_id, make list with children\r\n\t\tif(isset($this->MyClasses[$class]['db']['parent']))\r\n\t\t{\r\n\t\t\t$finarr = array();\r\n\t\t\t$finarr = $this->GetListRecursive($class, \"0\", $finarr, \"\");\r\n\t\t\tforeach($finarr as $burat)\r\n\t\t\t{\r\n\t\t\t\t$BoriArr = explode(\"|:|\", $burat);\r\n\t\t\t\t$Options[$BoriArr[0]] = $BoriArr[1];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($Items as $item)\r\n\t\t\t{\r\n\t\t\t\t$Options[$item['id']] = $item['title'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->makeDropDown($Options, $name, $selected);\r\n\t}", "static function createSelect($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/select.php\";\n }", "function select_box($selected, $options, $input_name, $input_id = FALSE, $use_lang = TRUE, $key_is_value = TRUE, $attributes = array())\n\t{\n\t\tglobal $LANG;\n\n\t\t$input_id = ($input_id === FALSE) ? str_replace(array(\"[\", \"]\"), array(\"_\", \"\"), $input_name) : $input_id;\n\n\t\t$attributes = array_merge(array(\n\t\t\t\"name\" => $input_name,\n\t\t\t\"id\" => strtolower($input_id)\n\t\t), $attributes);\n\n\t\t$attributes_str = \"\";\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\t$attributes_str .= \" {$key}='{$value}' \";\n\t\t}\n\n\t\t$ret = \"<select{$attributes_str}>\";\n\n\t\tforeach($options as $option_value => $option_label)\n\t\t{\n\t\t\tif (!is_int($option_value))\n\t\t\t\t$option_value = $option_value;\n\t\t\telse\n\t\t\t\t$option_value = ($key_is_value === TRUE) ? $option_value : $option_label;\n\n\t\t\t$option_label = ($use_lang === TRUE) ? $LANG->line($option_label) : $option_label;\n\t\t\t$checked = ($selected == $option_value) ? \" selected='selected' \" : \"\";\n\t\t\t$ret .= \"<option value='{$option_value}'{$checked}>{$option_label}</option>\";\n\t\t}\n\n\t\t$ret .= \"</select>\";\n\t\treturn $ret;\n\t}", "public function getSelect(): ?Select;", "public function getSelect();", "public function getSelect();", "public function enableSelectmenu ()\n {\n $baseUrl = \\Zend_Controller_Front::getInstance()->getBaseUrl();\n $this->view->headScript()->prependFile($baseUrl . '/gems/js/jquery-ui-selectmenu.js');\n $this->view->headLink()->appendStylesheet($baseUrl . '/gems/css/jquery-ui.css');\n $this->view->headLink()->appendStylesheet($baseUrl . '/gems/css/jquery-ui-selectmenu.css');\n \n $js = sprintf(\"jQuery(document).ready(function($) {\n $('#%s').iconselectmenu({width: null}).iconselectmenu('menuWidget').addClass('ui-menu-icons avatar overflow');\n });\",\n $this->id\n );\n \n $this->view->headScript()->appendScript($js);\n }", "public function select($value = null)\n {\n $this->select = $value;\n\n return $this;\n }", "public function buildSelectBox( $name, NavWidgetLink $parent_link=null, $selectedId=null, array $attributes=array(), array $instructionOption=array())\n\t {\n\t\t $data = $this->buildComboBox( $parent_link, $this->get_parent_links(), $selectedId);\n\n\t\t $dom = new \\DOMDocument;\n\t\t $select = $dom->createElement('select');\n\t\t $select->setAttribute( 'name', sprintf( '%s[parent]', $name ) );\n\n\t\t foreach ($attributes as $attrName => $attrValue)\n\t\t {\n\t\t\t $select->setAttribute($attrName, $attrValue);\n\t\t }\n\n\t\t if (count($instructionOption) > 0)\n\t\t {\n\t\t\t if (isset($instructionOption['text']))\n\t\t\t {\n\t\t\t\t $option = $dom->createElement('option');\n\t\t\t\t $option->appendChild( $dom->createTextNode($instructionOption['text']) );\n\t\t\t\t if (isset($instructionOption['value']))\n\t\t\t\t {\n\t\t\t\t\t $option->setAttribute('value', $instructionOption['value']);\n\t\t\t\t }\n\t\t\t\t $select->appendChild($option);\n\t\t\t }\n\t\t }\n\n\t\t // add No Parent item to lists\n\t\t $option = $dom->createElement('option');\n\t\t $option->appendChild( $dom->createTextNode( 'No Parent') );\n\t\t\t$option->setAttribute('value', 0);\n\n\t\t $select->appendChild($option);\n\n\t\t foreach ($data as $node)\n\t\t {\n\t\t\t $option = $dom->createElement('option');\n\t\t\t $option->setAttribute('value', $node['value']);\n\t\t\t $option->appendChild( $dom->createTextNode($node['text']));\n\t\t\t if (isset($node['selected']) && $node['selected'])\n\t\t\t {\n\t\t\t\t $option->setAttribute('selected', 'selected');\n\t\t\t }\n\t\t\t $select->appendChild( $option );\n\t\t }\n\n\t\t $dom->appendChild($select);\n\t\t return $dom->saveHTML();\n\t }", "function SelectBox($name)\n {\n $this -> name = $name;\n }", "function select_option()\r\n{}", "private function selectCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['selected'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('select.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "public function select($element) {\n $element = $this->_setRender($element);\n\n $element['_render']['element'] = '';\n $element['_render']['element'] .= '<select id=\"' . $element['#id'] . '\" ';\n $element['_render']['element'] .= $element['_attributes_string'];\n $element['_render']['element'] .= sprintf(' data-wpt-type=\"%s\"', __FUNCTION__);\n /**\n * multiple\n */\n if (array_key_exists('#multiple', $element) && $element['#multiple']) {\n $element['_render']['element'] .= ' multiple=\"multiple\"';\n $element['_render']['element'] .= ' name=\"' . $element['#name'] . '[]\"';\n } else {\n $element['_render']['element'] .= ' name=\"' . $element['#name'] . '\"';\n }\n $element['_render']['element'] .= \">\\r\\n\";\n $count = 1;\n foreach ($element['#options'] as $id => $value) {\n if (!is_array($value)) {\n $value = array('#title' => $id, '#value' => $value, '#type' => 'option');\n }\n $value['#type'] = 'option';\n if (!isset($value['#value'])) {\n $value['#value'] = $this->_count['select'] . '-' . $count;\n $count += 1;\n }\n $element['_render']['element'] .= '<option value=\"' . htmlspecialchars($value['#value']) . '\"';\n $element['_render']['element'] .= $this->_setElementAttributes($value);\n if (array_key_exists('#types-value', $value)) {\n $element['_render']['element'] .= sprintf(' data-types-value=\"%s\"', $value['#types-value']);\n }\n /**\n * type and data_id\n */\n $element['_render']['element'] .= ' data-wpt-type=\"option\"';\n $element['_render']['element'] .= $this->_getDataWptId($element);\n /**\n * selected\n */\n if (array_key_exists('#multiple', $element) && $element['#multiple']) {\n if (is_array($element['#default_value']) && in_array($value['#value'], $element['#default_value'])) {\n $element['_render']['element'] .= ' selected=\"selected\"';\n }\n } elseif ($element['#default_value'] == $value['#value']) {\n $element['_render']['element'] .= ' selected=\"selected\"';\n }\n $element['_render']['element'] .= '>';\n $element['_render']['element'] .= isset($value['#title']) ? $value['#title'] : $value['#value'];\n $element['_render']['element'] .= \"</option>\\r\\n\";\n }\n $element['_render']['element'] .= '</select>';\n $element['_render']['element'] .= PHP_EOL;\n\n $pattern = $this->_getStatndardPatern($element);\n $output = $this->_pattern($pattern, $element);\n $output = $this->_wrapElement($element, $output);\n\n return $output;\n }", "public function __construct()\n {\n parent::__construct();\n $this->init('oxselectlist');\n }", "protected function createSelectbox($key, $items, $type)\n {\n // Remove dot\n $key = substr($key, 0, -1);\n $selectbox = '<div class=\"col-xs-12 col-sm-4 col-md-3 col-lg-2\">'.LF;\n $selectbox .= '<div class=\"form-control-wrap\">'.LF;\n $selectbox .= '<select name=\"'.$key.'\" class=\"form-control form-control-adapt input-sm\">'.LF;\n $activeKey = '';\n foreach ($items as $itemKey => $itemValue) {\n if ($activeKey == '') {\n $activeKey = $key.'-'.$itemKey;\n }\n $selected = '';\n if (isset($this->valuesFlipped[$key.'-'.$itemKey])) {\n $activeKey = $key.'-'.$itemKey;\n $selected = 'selected=\"selected\"';\n }\n $label = $this->getLanguageService()->sL($itemValue);\n $selectbox .= '<option value=\"'.$key.'-'.$itemKey.'\" '.$selected.'>'.$label.'</option>'.LF;\n }\n $selectbox .= '</select>'.LF;\n $selectbox .= '</div>'.LF;\n $selectbox .= '</div>'.LF;\n $this->valuesAvailable[] = $activeKey;\n $this->checkboxesArray[$type][] = $selectbox;\n }", "public function getNewChildSelectOptions()\n {\n return array('value' => $this->getType(),\n 'label' => Mage::helper('bronto_reminder')->__('SKU'));\n }", "function build_selection_box($select_name,$select_text,$select_types,$selected_option)\n\t{\n\t\tglobal $template, $lang;\n\t\n\t\t$select = \"<select name='\".$select_name.\"'>\";\n\t\tif (empty($selected_option))\n\t\t{\n\t\t\t$select .= \"<option value=''>\".$lang['Select_A_Option'].\"</option>\";\n\t\t\t$select .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\tfor($i = 0; $i < count($select_text); $i++)\n\t\t{\n\t\t\t$selected = ( $selected_option == $select_types[$i] ) ? ' selected=\"selected\"' : '';\n\t\t\t$select .= '<option value=\"' . $select_types[$i] . '\"' . $selected . '>' . $select_text[$i] . '</option>';\n\t\t}\n\t\n\t\t$select .= '</select>';\n\t\n\t\treturn $select;\n\t}", "public function addSelect($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, true);\n }", "function html_selectbox($name, $values, $selected=NULL, $attributes=array())\n{\n $attr_html = '';\n if(is_array($attributes) && !empty($attributes))\n {\n foreach ($attributes as $k=>$v)\n {\n $attr_html .= ' '.$k.'=\"'.$v.'\"';\n }\n }\n $output = '<select name=\"'.$name.'\" id=\"'.$name.'\"'.$attr_html.'>'.\"\\n\";\n if(is_array($values) && !empty($values))\n {\n foreach ($values as $key=>$value)\n {\n if(is_array($value))\n {\n $output .= '<optgroup label=\"'.$key.'\">'.\"\\n\";\n foreach ($value as $k=>$v)\n {\n $sel = $selected == $k ? ' selected=\"selected\"' : '';\n $output .= '<option value=\"'.$k.'\"'.$sel.'>'.$v.'</option>'.\"\\n\";\n }\n $output .= '</optgroup>'.\"\\n\";\n }\n else\n {\n $sel = $selected == $key ? ' selected=\"selected\"' : '';\n $output .= '<option value=\"'.$key.'\"'.$sel.'>'.$value.'</option>'.\"\\n\";\n }\n }\n }\n $output .= \"</select>\\n\";\n\n return $output;\n}", "function hundope_select_field_render() { \n\t\n}", "function _select ($name, $id, $attribs, $options, $value)\n\t{\n\t\t$xhtml = '<div class=\"select\"><select'\n\t\t. ' name=\"' . $this->view->escape($name) . '\"'\n\t\t. ' id=\"' . $this->view->escape($id) . '\"'\n\t\t. $this->_htmlAttribs($attribs)\n\t\t. \">\";\n\n\t\t// build the list of options\n\t\t$list = array();\n\t\t$translator = $this->getTranslator();\n\t\tforeach ((array) $options as $opt_value => $opt_label) {\n\t\t\tif (is_array($opt_label)) {\n if (null !== $translator) {\n $opt_value = $translator->translate($opt_value);\n }\n \n $list[] = '<optgroup'\n . ' label=\"' . $this->view->escape($opt_value) .'\">';\n foreach ($opt_label as $val => $lab) {\n $list[] = $this->_build($val, $lab, $value, false);\n }\n $list[] = '</optgroup>';\n } else {\n\t\t\t\t$list[] = $this->_build($opt_value, $opt_label, $value, false);\n }\n\t\t}\n\n\t\t// add the options to the xhtml and close the select\n\t\t$xhtml .= implode(\"\", $list) . \"</select> <a href=\\\"#\\\" class=\\\"remove\\\">-</a></div>\";\n\n\t\treturn $xhtml;\n\t}" ]
[ "0.61773527", "0.5996655", "0.59589136", "0.5743725", "0.56297994", "0.558627", "0.554805", "0.54564553", "0.5319266", "0.53090584", "0.5299444", "0.5279626", "0.5270832", "0.5232853", "0.5232853", "0.52327496", "0.521464", "0.5212312", "0.52074", "0.5206586", "0.51899594", "0.5186708", "0.5149882", "0.51493174", "0.5140792", "0.51349914", "0.5103094", "0.5092823", "0.5089775", "0.50844944" ]
0.6500639
0
Test get messages from previous request
public function testGetMessagesFromPrevRequest() { $storage = ['slimFlash' => ['Test']]; $flash = new Messages($storage); $this->assertEquals(['Test'], $flash->getMessages()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "public function testMessages()\n {\n $response = $this->json('GET', '/api/messages');\n $response->assertJsonStructure([\n 'messages'=>[\n 'current_page',\n 'data' => [\n [\n 'uid',\n 'sender',\n 'subject',\n 'message',\n 'time_sent',\n 'archived',\n 'read'\n ]\n ],\n 'first_page_url',\n 'from',\n 'last_page',\n 'last_page_url',\n 'next_page_url',\n 'path',\n 'per_page',\n 'prev_page_url',\n 'to',\n 'total'\n ]\n ]);\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function getMessages() {}", "public function getMessages() {}", "public function testMessageThreadsV2GetMessages0()\n {\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function getMessages(){ }", "public function test_getAllMessages() {\n\n }", "public function testGetMessage()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageListResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $direction = \"direction_example\";\n $account_uid = \"account_uid_example\";\n $state = \"state_example\";\n $offset = 0;\n $limit = 10;\n\n try {\n $result = $apiInstance->getMessage($direction, $account_uid, $state, $offset, $limit);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling MessageApi->getMessage: \".$e->getMessage());\n }\n }", "public function testProtosGet()\n {\n }", "final public function onTest()\n {\n // identical to a GET request without the body output.\n // shodul proxy to the get method\n return array(); // MUST NOT return a message-body in the response\n }", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "public function testMessage()\r\n {\r\n\r\n $this->flash->message(\"testMessage\");\r\n $this->assertEquals(\"testMessage\", $_SESSION[\"flash\"][\"messages\"][\"message\"][0]);\r\n\r\n }", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "public function getResponseMessage();", "public function test_peekMessage() {\n\n }", "abstract public function get_message();", "public function testPostVoicemailMessages()\n {\n }", "public function test_get_user_messages(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new GroupMessagesScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(1, $count);\n });\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function test_request(){\n\n return $this->send_request( 'en', 'es', array( 'about' ) );\n\n }" ]
[ "0.6963384", "0.6546446", "0.63883805", "0.6366512", "0.6366512", "0.6299762", "0.62522984", "0.61525875", "0.6126471", "0.6036581", "0.6027699", "0.60088867", "0.60025966", "0.5976435", "0.59667623", "0.59667623", "0.59667623", "0.59667623", "0.59667623", "0.59667623", "0.59667623", "0.5959818", "0.5947915", "0.59442437", "0.5929224", "0.5912315", "0.5887194", "0.58819515", "0.5880776", "0.58785117" ]
0.7407301
0
Test a string can be added to a message array for the current request
public function testAddMessageFromStringForCurrentRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $flash->addMessageNow('key', 'value'); $messages = $flash->getMessages(); $this->assertEquals(['value'], $messages['key']); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEmpty($storage['slimFlash']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "function add($message) { return; }", "function isValid(&$inMessage = '');", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "private function correctRequest($msg){\n return array(\"error\" => false,\"msg\" => $msg);\n }", "static function hasMessage()\n {\n foreach (self::TYPES as $type)\n {\n if (self::has($type)) return true;\n }\n return false;\n }", "public function add(string $data): bool {}", "function getMsg($param) {\n global $msg;\n $msg = \"\";\n $msgCount = 1;\n for($i = 0; $i < strlen('$str'); $i++) {\n if($str[$i] != \"*\" && $msgCount == $param && $activeMsg) {\n $msg .= $str[$i];\n } else if($str[$i] == \"*\") {\n $msgCount++;\n $activeAuthor = true;\n $activeMsg = false;\n } else if($str[$i] == \":\") {\n $activeAuthor = false;\n $activeMsg = true;\n }\n }\n }", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "public static function addMessage($message, $type){\n if (in_array($type, self::$typesArray)) {\n $_SESSION['flashMessages'][$type][] = $message;\n return true;\n }\n return false;\n }", "public function addMessage($message);", "public function add_message( $string, $error = false ) {\n\t\tif ( $error ) {\n\t\t\t$this->admin_error[] = (string) $string;\n\t\t} else {\n\t\t\t$this->admin_message[] = (string) $string;\n\t\t}\n\t}", "public function hasMsg(){\n return $this->_has(18);\n }", "public function messageProvider()\n {\n return [[\"a string\"]];\n }", "public function hasMessage(): bool\n {\n return $this->hasJson('message');\n }", "function add_message($msg, $msg_type = MSG_TYPE_SUCCESS) {\n if (!isset($_SESSION['message']))\n $_SESSION['message'] = [];\n $_SESSION['message'][] = ['type' => $msg_type, 'message' => htmlentities($msg, ENT_QUOTES)];\n}", "function filterRequest($msg){\n if(isset($_GET['type'])){\n $type = $_GET['type'];\n\n // Verify data type\n if($type == 'data'){\n handleDataRequest($msg);\n }else if($type == 'multiple'){\n handleMultipleData($msg);\n }else if($type == 'station'){\n handleStationsRequest($msg);\n }else{\n $msg->message = 'Requested type not existing!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Type not set!';\n $msg->toJson();\n }\n}", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "function get_request_contains($request_url,$search_string) {\n //get the current url\n $string = $search_string;\n $url = $request_url;\n //~ echo $request_url;\n //check for string in url\n $lookup = strpos($url, $string);\n\n\n //If string is found, set the value of found_context\n if($lookup > 1 || $lookup !== false) {\n //~ echo 'is_component request';\n return true;\n }\n\n //If not found, set UNSET the value of found_context\n else {\n //~ echo 'is_not component request';\n return false; \n }\n}", "protected abstract function _message();", "function array_contains_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}" ]
[ "0.63160044", "0.590883", "0.5850043", "0.58008045", "0.57348406", "0.5544945", "0.54400766", "0.536486", "0.53373414", "0.5325601", "0.5282629", "0.52709055", "0.526223", "0.5238714", "0.5234709", "0.5207915", "0.5205427", "0.5196832", "0.51946807", "0.51754576", "0.51515394", "0.51218134", "0.5107395", "0.510044", "0.5095987", "0.50958306", "0.5095294", "0.5077019", "0.50669515", "0.5054355" ]
0.6341585
0
Test an array can be added to a message array for the current request
public function testAddMessageFromArrayForCurrentRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $formData = [ 'username' => 'Scooby Doo', 'emailAddress' => '[email protected]', ]; $flash->addMessageNow('old', $formData); $messages = $flash->getMessages(); $this->assertEquals($formData, $messages['old'][0]); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEmpty($storage['slimFlash']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function check_meta_is_array($value, $request, $param)\n {\n }", "function testMakeNeatArray() {\r\n\t\t$this->Toolbar->makeNeatArray(array(1,2,3));\r\n\t\t$result = $this->firecake->sentHeaders;\r\n\t\t$this->assertTrue(isset($result['X-Wf-1-1-1-1']));\r\n\t\t$this->assertPattern('/\\[1,2,3\\]/', $result['X-Wf-1-1-1-1']);\r\n\t}", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function testGetFlashArray()\n {\n $expected = array('my_test_flash' => 'flash value', \n 'my_other_flash' => 'flash stuff');\n $this->assertEquals($expected, $this->_req->getFlash());\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testGetQuickInboxMessages() {\n \t$this->assertInternalType('array',$this->chatModel->getQuickInboxMessages());\n }", "public function testInArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$this->assertTrue(permissionInPermissions($array, \"a\"));\n\t\t$this->assertTrue(permissionInPermissions($array, \"b\"));\n\t\t$this->assertTrue(permissionInPermissions($array, \"c\"));\n\t}", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "public static function inArray($value, array $values, $message = '');", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "public function testCheckArray() {\n\t\t$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';\n\n\t\t$Ini = new IniAcl();\n\t\t$Ini->config = $Ini->readConfigFile($iniFile);\n\t\t$Ini->userPath = 'User.username';\n\n\t\t$user = array(\n\t\t\t'User' => array('username' => 'admin')\n\t\t);\n\t\t$this->assertTrue($Ini->check($user, 'posts'));\n\t}", "private function is_param_array($param){\n\t\tif(!is_array($param)){\n\t\t\t$this->text(\"Invalid parameter, cannot reply with appropriate message\");\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "public function validArrayForArrayConfigurationProvider() {}", "public function testArrayContainsAnElement()\n {\n $fixture = array();\n \n // Add an element to the Array fixture.\n $fixture[] = 'Element';\n \n // Assert that the size of the Array fixture is 1.\n $this->assertEquals(1, sizeof($fixture));\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "public function test_array_returns_true_when_optional_and_input_array() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function test_array_returns_true_when_not_optional_and_input_array() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "function arrayMessage($array){\n $l = \"[\";\n $x = 0;\n while($x < count($array)){\n $l = $l.$array[$x];\n $x++;\n if($x != count($array)){\n $l = $l.\",\";\n }\n }\n $l = $l.\"]\";\n \n $messArray = array('message'=>$l,'mess_type'=>'user_array');\n $json = json_encode($messArray);\n return $json;\n }", "private function process_array($value) {\n return is_array($value);\n }", "public static function hasItems(array $message) : bool\n {\n return isset($message['Messages']) ? (empty($message['Messages']) ? false : true) : false;\n }", "public function assertInArray($arg, array $arr, $message = '')\n {\n return $this->recordTest(in_array($arg, $arr), $message);\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }" ]
[ "0.66719", "0.6004601", "0.5933607", "0.5913529", "0.587468", "0.5841768", "0.5825768", "0.5692597", "0.56697255", "0.56646067", "0.5588559", "0.5534701", "0.5519163", "0.54959625", "0.54949576", "0.5475062", "0.5463661", "0.5442685", "0.5425069", "0.5421461", "0.5415065", "0.54056996", "0.5404739", "0.53966975", "0.53919244", "0.53697306", "0.53644514", "0.5347811", "0.5345002", "0.53396547" ]
0.6700288
0
Test an object can be added to a message array for the current request
public function testAddMessageFromObjectForCurrentRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $user = new \stdClass(); $user->name = 'Scooby Doo'; $user->emailAddress = '[email protected]'; $flash->addMessageNow('user', $user); $messages = $flash->getMessages(); $this->assertInstanceOf(\stdClass::class, $messages['user'][0]); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEmpty($storage['slimFlash']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromObjectForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessage('user', $user);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertInstanceOf(\\stdClass::class, $storage['slimFlash']['user'][0]);\n }", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "public function testAddMessage()\n {\n $message1 = new Hostingcheck_Message('Foo message');\n $result = new Hostingcheck_Result_Info();\n $result->addMessage($message1);\n $this->assertEquals(array($message1), $result->messages());\n\n $message2 = new Hostingcheck_Message('Bar message');\n $result->addMessage($message2);\n $this->assertEquals(array($message1, $message2), $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function test_message_can_be_responded_to() {\n\n $response = Message::create('a thoughtful response', $this->user, $this->message);\n $this->assertEquals($this->message, $response->getParentMessage());\n\n $response = Message::findById($response->getId());\n $this->assertEquals($this->message, $response->getParentMessage()->loadDependencies());\n\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testAddMessageFromStringForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 'value');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['value'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function testMessages()\n {\n $message = new PrivateMessage();\n $conversation = new Conversation();\n $this->assertEmpty($conversation->getMessages());\n\n $conversation->addMessage($message);\n $this->assertEquals(new ArrayCollection([$message]), $conversation->getMessages());\n\n $conversation->removeMessage($message);\n $this->assertEmpty($conversation->getMessages());\n }", "abstract public function messageObject(BCTObject $to, array $message);", "public function testGetQuickInboxMessages() {\n \t$this->assertInternalType('array',$this->chatModel->getQuickInboxMessages());\n }", "function add($message) { return; }", "public function testPutValidMessage () {\n\n\t\t//create a new message\n\t\t$newMessage = new Message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//run a get request to establish session tokens\n\t\t$this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/');\n\n\t\t//grab the data from guzzle and enforce the status match our expectations\n\t\t$response = $this->guzzle->put('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage->getMessage(),['headers' => ['X-XRF-TOKEN' => $this->getXsrfToken()], 'json' => $newMessage] );\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBpdy();\n\t\t$alertLevel = json_decode($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\n\t}", "public function testAddingAnElementWillReturnTrue()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $response = $Collection->add($element1);\n $this->assertTrue($response);\n\n $elements = \\PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');\n $this->assertEquals(array($element1), $elements);\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "public function canAddToResult();", "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "public function testPostAuthorizationSubjectBulkadd()\n {\n }", "public function testToJSON() {\n\n\t\t$createMessageRequest = new CreateMessageRequest();\n\n\t\t// Test without the 'application' and 'applicationsGroup' parameters\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\n\t\t// Test with both the 'application' and 'applicationsGroup parameters set\n\t\t$createMessageRequest -> setApplication('XXXX-XXXX');\n\t\t$createMessageRequest -> setApplicationsGroup('XXXX-XXXX');\n\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\n\t\t// Test without the 'auth' parameter set\n\t\t$createMessageRequest -> setApplicationsGroup(null);\n\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\t\t\n\t\t// Test with the 'auth' and 'application' parameters set and no notification\n\t\t$createMessageRequest -> setAuth('XXXX');\n\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(0, $json['notifications']);\n\t\t\n\t\t// Test with one notificiation with only a 'content' field\n\t\t$notification = Notification::create();\n\t\t$notification -> setContent('CONTENT');\n\t\t$createMessageRequest -> addNotification($notification);\n\t\t\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(3, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t\n\t\t// Test with one notification having additional data\n\t\t$notification -> setDataParameter('DATA_PARAMETER_1', 'DATA_PARAMETER_1_VALUE');\n\t\t$notification -> setDataParameter('DATA_PARAMETER_2', 'DATA_PARAMETER_2_VALUE');\n\t\t$notification -> setDataParameter('DATA_PARAMETER_3', 'DATA_PARAMETER_3_VALUE');\n\t\t\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(4, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['data']);\n\t\t$this -> assertEquals('DATA_PARAMETER_1_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_1']);\n\t\t$this -> assertEquals('DATA_PARAMETER_2_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_2']);\n\t\t$this -> assertEquals('DATA_PARAMETER_3_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_3']);\n\n\t\t// Test with one notification hacing additional data and devices\n\t\t$notification -> addDevice('DEVICE_TOKEN_1');\n\t\t$notification -> addDevice('DEVICE_TOKEN_2');\n\t\t$notification -> addDevice('DEVICE_TOKEN_3');\n\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(5, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['data']);\n\t\t$this -> assertEquals('DATA_PARAMETER_1_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_1']);\n\t\t$this -> assertEquals('DATA_PARAMETER_2_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_2']);\n\t\t$this -> assertEquals('DATA_PARAMETER_3_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_3']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['devices']);\n\t\t$this -> assertEquals('DEVICE_TOKEN_1', $json['notifications'][0]['devices'][0]);\n\t\t$this -> assertEquals('DEVICE_TOKEN_2', $json['notifications'][0]['devices'][1]);\n\t\t$this -> assertEquals('DEVICE_TOKEN_3', $json['notifications'][0]['devices'][2]);\n\n\t}", "public function testNewOrderedQueue_contains() {\n\t\t\t$this->assertFalse($this->oq->contains(new stdClass));\n\t\t}", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "public function canAddFieldsToTCATypeAfterExistingOnes() {}", "public function testPostVoicemailMessages()\n {\n }" ]
[ "0.6665526", "0.64594567", "0.64529735", "0.6079036", "0.6070254", "0.5973639", "0.5946248", "0.59337026", "0.5880742", "0.58527195", "0.5800147", "0.56900245", "0.5651039", "0.5574166", "0.55355936", "0.5487542", "0.5471896", "0.54697937", "0.5463723", "0.53852826", "0.53809035", "0.5347793", "0.5319941", "0.5313613", "0.529255", "0.5281747", "0.5272432", "0.52552456", "0.5248977", "0.5233652" ]
0.6725215
0
Test a string can be added to a message array for the next request
public function testAddMessageFromStringForNextRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $flash->addMessage('key', 'value'); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEquals(['value'], $storage['slimFlash']['key']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function testAddMessageFromStringForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 'value');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['value'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "function add($message) { return; }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function add(string $data): bool {}", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function testAddMessageFromObjectForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessage('user', $user);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertInstanceOf(\\stdClass::class, $storage['slimFlash']['user'][0]);\n }", "private function correctRequest($msg){\n return array(\"error\" => false,\"msg\" => $msg);\n }", "public function parseRequest($message);", "function getMsg($param) {\n global $msg;\n $msg = \"\";\n $msgCount = 1;\n for($i = 0; $i < strlen('$str'); $i++) {\n if($str[$i] != \"*\" && $msgCount == $param && $activeMsg) {\n $msg .= $str[$i];\n } else if($str[$i] == \"*\") {\n $msgCount++;\n $activeAuthor = true;\n $activeMsg = false;\n } else if($str[$i] == \":\") {\n $activeAuthor = false;\n $activeMsg = true;\n }\n }\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "public function match($message);", "function add_message($msg, $msg_type = MSG_TYPE_SUCCESS) {\n if (!isset($_SESSION['message']))\n $_SESSION['message'] = [];\n $_SESSION['message'][] = ['type' => $msg_type, 'message' => htmlentities($msg, ENT_QUOTES)];\n}", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "function processReqString ($req) {\r\n\r\n\t$question = explode(\"|\", $req);\r\n\tif(sizeof($req) ==0 ) {\r\n\t\techo 'error: The provided string is incorrect';\r\n\t\treturn null;\r\n\t}\r\n\t$arr = array_map(\"splitQuestions\", $question);\r\n\treturn $arr;\r\n\r\n\r\n}", "public static function addMessage($message, $type){\n if (in_array($type, self::$typesArray)) {\n $_SESSION['flashMessages'][$type][] = $message;\n return true;\n }\n return false;\n }", "public function add_message( $string, $error = false ) {\n\t\tif ( $error ) {\n\t\t\t$this->admin_error[] = (string) $string;\n\t\t} else {\n\t\t\t$this->admin_message[] = (string) $string;\n\t\t}\n\t}", "function isValid(&$inMessage = '');", "protected abstract function _message();", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "private function checkResponse ($string) {\n if (substr($string, 0, 3) !== '+OK') {\n $this->error = array(\n 'error' => \"Server reported an error: $string\",\n 'errno' => 0,\n 'errstr' => ''\n );\n\n if ($this->do_debug >= 1) {\n $this->displayErrors();\n }\n\n return false;\n } else {\n return true;\n }\n\n }", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "function addMessage( $message )\n {\n if ( isset($message['errorMessage']) )\n {\n $this->messages[] = array_merge($this->empty_message,$message);\n } else if ( isset($message[0]) && isset($message[0]['errorMessage']) ) {\n foreach ( $message as $m )\n {\n $this->messages[] = array_merge($this->empty_message,$m);\n }\n }\n }", "function checkSerializedMessage($message, $label, $expectedString)\n{\n if ($message->serializeToJsonString() === $expectedString) {\n print(\"Got expected output for $label: $expectedString\\n\");\n } else {\n print(\"Output of $label does not match expected value.\\n\" .\n \"\\tExpected: $expected\\n\" .\n \"\\tGot: \" . $message->serializeToJsonString() . PHP_EOL);\n }\n}", "public function isSent() {}" ]
[ "0.61833304", "0.6096158", "0.5956236", "0.5775606", "0.5553289", "0.554898", "0.55422175", "0.5498558", "0.5316321", "0.5313713", "0.5247073", "0.5246378", "0.5234187", "0.5225374", "0.5214104", "0.5172235", "0.514323", "0.5142921", "0.51311517", "0.5112149", "0.5106109", "0.510507", "0.50864476", "0.5086214", "0.5045186", "0.50443524", "0.50249296", "0.5021748", "0.5011115", "0.5009767" ]
0.6778396
0
Test an array can be added to a message array for the next request
public function testAddMessageFromArrayForNextRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $formData = [ 'username' => 'Scooby Doo', 'emailAddress' => '[email protected]', ]; $flash->addMessage('old', $formData); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEquals($formData, $storage['slimFlash']['old'][0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testGetFlashArray()\n {\n $expected = array('my_test_flash' => 'flash value', \n 'my_other_flash' => 'flash stuff');\n $this->assertEquals($expected, $this->_req->getFlash());\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "function testMakeNeatArray() {\r\n\t\t$this->Toolbar->makeNeatArray(array(1,2,3));\r\n\t\t$result = $this->firecake->sentHeaders;\r\n\t\t$this->assertTrue(isset($result['X-Wf-1-1-1-1']));\r\n\t\t$this->assertPattern('/\\[1,2,3\\]/', $result['X-Wf-1-1-1-1']);\r\n\t}", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function testGetQuickInboxMessages() {\n \t$this->assertInternalType('array',$this->chatModel->getQuickInboxMessages());\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function testAddMessageFromObjectForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessage('user', $user);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertInstanceOf(\\stdClass::class, $storage['slimFlash']['user'][0]);\n }", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "public function check_meta_is_array($value, $request, $param)\n {\n }", "public function testPostAuthorizationSubjectBulkadd()\n {\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "private static function setArray() {\n\tself::$requests = explode(\"/\", self::$uri);\n if(self::$requests[0] == 'api') {\n array_shift(self::$requests);\n self::$api = True;\n }\n }", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "public function testErrorMessageArray()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": [\"Bad format\", \"Bad format 2\"],\n \"errors\": []\n }\n }', true);\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals('Bad format, Bad format 2', $error->getMessage());\n }\n }", "function arrayMessage($array){\n $l = \"[\";\n $x = 0;\n while($x < count($array)){\n $l = $l.$array[$x];\n $x++;\n if($x != count($array)){\n $l = $l.\",\";\n }\n }\n $l = $l.\"]\";\n \n $messArray = array('message'=>$l,'mess_type'=>'user_array');\n $json = json_encode($messArray);\n return $json;\n }", "public function test_array_returns_true_when_optional_and_input_array() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function test_array_returns_true_when_not_optional_and_input_array() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function testGetSessionArray()\n {\n $expected = array('my_test_session' => 'session value', \n 'my_other_session' => 'session stuff');\n $this->assertEquals($expected, $this->_req->getSession());\n }", "public function testConsumeArray()\n {\n $config = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index'];\n $result = Hash::consume($config, ['controller', 0]);\n\n $this->assertEquals(['controller' => 'Groups', 0 => null], $result);\n $this->assertEquals(['plugin' => null, 'action' => 'index'], $config);\n }", "public function testMagicCall()\n {\n $client = new Client($this->options);\n $emails = $client->emails();\n\n $this->assertTrue(is_array($emails));\n }", "function add_success(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"success\",\n \"message\" => $message\n );\n}" ]
[ "0.6403168", "0.63492715", "0.58963853", "0.58915865", "0.5839632", "0.57873327", "0.5740914", "0.57213295", "0.5686027", "0.5682223", "0.5512867", "0.54614747", "0.54467547", "0.54236424", "0.541326", "0.5396178", "0.5367872", "0.5359742", "0.5339173", "0.532194", "0.5287669", "0.52818596", "0.52470726", "0.5244061", "0.5243271", "0.5226571", "0.5202681", "0.5181268", "0.51742417", "0.5169474" ]
0.69801843
0
Test an object can be added to a message array for the next request
public function testAddMessageFromObjectForNextRequest() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $user = new \stdClass(); $user->name = 'Scooby Doo'; $user->emailAddress = '[email protected]'; $flash->addMessage('user', $user); $this->assertArrayHasKey('slimFlash', $storage); $this->assertInstanceOf(\stdClass::class, $storage['slimFlash']['user'][0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testAddMessageFromObjectForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessageNow('user', $user);\n\n $messages = $flash->getMessages();\n $this->assertInstanceOf(\\stdClass::class, $messages['user'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessage()\n {\n $message1 = new Hostingcheck_Message('Foo message');\n $result = new Hostingcheck_Result_Info();\n $result->addMessage($message1);\n $this->assertEquals(array($message1), $result->messages());\n\n $message2 = new Hostingcheck_Message('Bar message');\n $result->addMessage($message2);\n $this->assertEquals(array($message1, $message2), $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function test_message_can_be_responded_to() {\n\n $response = Message::create('a thoughtful response', $this->user, $this->message);\n $this->assertEquals($this->message, $response->getParentMessage());\n\n $response = Message::findById($response->getId());\n $this->assertEquals($this->message, $response->getParentMessage()->loadDependencies());\n\n }", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function testAddMessageFromStringForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 'value');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['value'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "public function testPutValidMessage () {\n\n\t\t//create a new message\n\t\t$newMessage = new Message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//run a get request to establish session tokens\n\t\t$this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/');\n\n\t\t//grab the data from guzzle and enforce the status match our expectations\n\t\t$response = $this->guzzle->put('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage->getMessage(),['headers' => ['X-XRF-TOKEN' => $this->getXsrfToken()], 'json' => $newMessage] );\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBpdy();\n\t\t$alertLevel = json_decode($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\n\t}", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "abstract protected function checkExistingResponse();", "public static function putMessage($personOne, $personTwo, $id)\n{ \n $id = ($id != null?'&id=gt.'.$id:\"\");\n\n $respons = Rest::GET('http://caracal.imada.sdu.dk/app2019/messages?sender=in.(\"'.$personOne.'\",\"'.$personTwo.'\")&receiver=in.(\"'.$personOne.'\",\"'.$personTwo.'\")'.$id.'');\n\n\n \n foreach( json_decode($respons) as $respon)\n { \n \n $body = self::getType($respon->body); \n $timestamp = TimeConverter::convert($respon->stamp); \n\n $message = new Message();\n $message->global_id = $respon->id;\n $message->sender = $respon->sender; \n $message->receiver = $respon->receiver; \n $message->type = $body[0];\n $message->body = $body[1];\n $message->created_at = $timestamp;\n $message->updated_at = $timestamp;\n $message->save(); \n }\n}", "function add($message) { return; }", "public function testPostAuthorizationSubjectBulkadd()\n {\n }", "public function testMessages()\n {\n $message = new PrivateMessage();\n $conversation = new Conversation();\n $this->assertEmpty($conversation->getMessages());\n\n $conversation->addMessage($message);\n $this->assertEquals(new ArrayCollection([$message]), $conversation->getMessages());\n\n $conversation->removeMessage($message);\n $this->assertEmpty($conversation->getMessages());\n }", "public function testGetQuickInboxMessages() {\n \t$this->assertInternalType('array',$this->chatModel->getQuickInboxMessages());\n }", "public function testPostVoicemailMessages()\n {\n }", "public function testAddToNewsLetterFailForIncompleteDetails()\n {\n $request = Request::create('/api/contact/subscribe', 'POST', $this->invalidSubscriber);\n $response = $this->contactController->addToNewsletter($request);\n $this->assertEquals(ResponseMessage::INPUT_ERROR, $response->getData()->message);\n $this->assertObjectHasAttribute('name',$response->getData()->data);\n $this->assertObjectHasAttribute('email',$response->getData()->data);\n $this->assertDatabaseMissing('newsletter_subscribers', $this->invalidSubscriber);\n }", "public function testGetVoicemailQueueMessages()\n {\n }", "protected static function addMessage(stdClass $message) {\n $i = PitSession::get('PitFlash', 'i', 1);\n $msgs = PitSession::get('PitFlash', 'messages', array());\n $msgs[$i] = $message;\n PitSession::set('PitFlash', 'i', $i + 1);\n PitSession::set('PitFlash', 'messages', $msgs);\n }", "public function testAddContactMessageFailForIncompleteDetails()\n {\n $request = Request::create('/api/contact/message', 'POST', $this->invalidContactor);\n $response = $this->contactController->addContactMessage($request);\n $this->assertEquals(ResponseMessage::INPUT_ERROR, $response->getData()->message);\n $this->assertObjectHasAttribute('name',$response->getData()->data);\n $this->assertObjectHasAttribute('email',$response->getData()->data);\n $this->assertObjectHasAttribute('message',$response->getData()->data);\n $this->assertDatabaseMissing('contacts', $this->invalidContactor);\n }", "public function testPayload() {\n $payload = array(\n \"this\" => \"is\",\n \"the\" => \"payload\",\n );\n $response = new Response();\n $response->setPayload($payload);\n $this->assertEquals($payload, $response->payload());\n }", "public function testToJSON() {\n\n\t\t$createMessageRequest = new CreateMessageRequest();\n\n\t\t// Test without the 'application' and 'applicationsGroup' parameters\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\n\t\t// Test with both the 'application' and 'applicationsGroup parameters set\n\t\t$createMessageRequest -> setApplication('XXXX-XXXX');\n\t\t$createMessageRequest -> setApplicationsGroup('XXXX-XXXX');\n\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\n\t\t// Test without the 'auth' parameter set\n\t\t$createMessageRequest -> setApplicationsGroup(null);\n\n\t\ttry {\n\n\t\t\t$createMessageRequest -> toJSON();\n\t\t\t$this -> fail('Must have thrown a PushwooshException !');\n\n\t\t} catch(PushwooshException $pe) {\n\n\t\t\t// Expected\n\n\t\t}\n\t\t\n\t\t// Test with the 'auth' and 'application' parameters set and no notification\n\t\t$createMessageRequest -> setAuth('XXXX');\n\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(0, $json['notifications']);\n\t\t\n\t\t// Test with one notificiation with only a 'content' field\n\t\t$notification = Notification::create();\n\t\t$notification -> setContent('CONTENT');\n\t\t$createMessageRequest -> addNotification($notification);\n\t\t\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(3, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t\n\t\t// Test with one notification having additional data\n\t\t$notification -> setDataParameter('DATA_PARAMETER_1', 'DATA_PARAMETER_1_VALUE');\n\t\t$notification -> setDataParameter('DATA_PARAMETER_2', 'DATA_PARAMETER_2_VALUE');\n\t\t$notification -> setDataParameter('DATA_PARAMETER_3', 'DATA_PARAMETER_3_VALUE');\n\t\t\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(4, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['data']);\n\t\t$this -> assertEquals('DATA_PARAMETER_1_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_1']);\n\t\t$this -> assertEquals('DATA_PARAMETER_2_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_2']);\n\t\t$this -> assertEquals('DATA_PARAMETER_3_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_3']);\n\n\t\t// Test with one notification hacing additional data and devices\n\t\t$notification -> addDevice('DEVICE_TOKEN_1');\n\t\t$notification -> addDevice('DEVICE_TOKEN_2');\n\t\t$notification -> addDevice('DEVICE_TOKEN_3');\n\n\t\t$json = $createMessageRequest -> toJSON();\n\t\t$this -> assertCount(4, $json);\n\t\t$this -> assertTrue(array_key_exists('application', $json));\n\t\t$this -> assertTrue(array_key_exists('applicationsGroup', $json));\n\t\t$this -> assertTrue(array_key_exists('auth', $json));\n\t\t$this -> assertTrue(array_key_exists('notifications', $json));\n\t\t$this -> assertEquals('XXXX-XXXX', $json['application']);\n\t\t$this -> assertNull($json['applicationsGroup']);\n\t\t$this -> assertEquals('XXXX', $json['auth']);\n\t\t$this -> assertCount(1, $json['notifications']);\n\t\t$this -> assertCount(5, $json['notifications'][0]);\n\t\t$this -> assertTrue(array_key_exists('send_date', $json['notifications'][0]));\n\t\t$this -> assertTrue($json['notifications'][0]['ignore_user_timezone']);\n\t\t$this -> assertEquals('CONTENT', $json['notifications'][0]['content']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['data']);\n\t\t$this -> assertEquals('DATA_PARAMETER_1_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_1']);\n\t\t$this -> assertEquals('DATA_PARAMETER_2_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_2']);\n\t\t$this -> assertEquals('DATA_PARAMETER_3_VALUE', $json['notifications'][0]['data']['DATA_PARAMETER_3']);\n\t\t$this -> assertCount(3, $json['notifications'][0]['devices']);\n\t\t$this -> assertEquals('DEVICE_TOKEN_1', $json['notifications'][0]['devices'][0]);\n\t\t$this -> assertEquals('DEVICE_TOKEN_2', $json['notifications'][0]['devices'][1]);\n\t\t$this -> assertEquals('DEVICE_TOKEN_3', $json['notifications'][0]['devices'][2]);\n\n\t}" ]
[ "0.67530286", "0.65693074", "0.6433161", "0.63650674", "0.63164556", "0.6200107", "0.59128344", "0.58548766", "0.580537", "0.57742155", "0.57338995", "0.5711898", "0.5595448", "0.55055714", "0.54851294", "0.5481527", "0.54220605", "0.5414259", "0.54062873", "0.5383677", "0.537923", "0.5374566", "0.5374418", "0.53218025", "0.5320026", "0.53144455", "0.52907866", "0.5282258", "0.5269052", "0.5260544" ]
0.69989586
0
Test get empty messages from previous request
public function testGetEmptyMessagesFromPrevRequest() { $storage = []; $flash = new Messages($storage); $this->assertEquals([], $flash->getMessages()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "public function testGetWebhookQueueTemplateMessageEmpty()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::webhookQueueTemplateMessageNull());\n\n $webhook = $sw->getWebhookQueueTemplateMessage('TestingGUID');\n $this->assertNull($webhook);\n\n $this->checkGetRequests($container, ['/v4/webhooks/queues/template/TestingGUID?delete=false']);\n }", "public function testMessages()\n {\n $response = $this->json('GET', '/api/messages');\n $response->assertJsonStructure([\n 'messages'=>[\n 'current_page',\n 'data' => [\n [\n 'uid',\n 'sender',\n 'subject',\n 'message',\n 'time_sent',\n 'archived',\n 'read'\n ]\n ],\n 'first_page_url',\n 'from',\n 'last_page',\n 'last_page_url',\n 'next_page_url',\n 'path',\n 'per_page',\n 'prev_page_url',\n 'to',\n 'total'\n ]\n ]);\n }", "public function testGetWebhookQueueAccountMessageEmpty()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::webhookQueueAccountMessageNull());\n\n $webhook = $sw->getWebhookQueueAccountMessage();\n $this->assertNull($webhook);\n\n $this->checkGetRequests($container, ['/v4/webhooks/queues/account?delete=false']);\n }", "public function is_there_any_msg()\n\t{\n\t\tif(isset($_SESSION[\"message\"]))\n\t\t{\n\t\t\t$this->_message = $_SESSION[\"message\"];\n\t\t\tunset($_SESSION[\"message\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_message=\"\";\n\t\t}\n\t}", "public function testPendingValidationNoMapping()\n {\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public function getMessages() {}", "public function getMessages() {}", "public function testListAllMessages()\n {\n $data = self::$ctnClient1->listMessages([\n 'startDate' => self::$testStartDate\n ]);\n\n $this->assertGreaterThanOrEqual(2, $data->msgCount);\n $this->assertFalse($data->hasMore);\n }", "function isEmpty(){\r\n if (sizeof($this->messages) == 0){\r\n return true;\r\n }\r\n return false;\r\n }", "public function testMessageThreadsV2GetMessages0()\n {\n }", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function testGetAllMessages()\n {\n // Récupération des containers\n $appartmentRepository = $this->getContainer()->get(AppartmentRepository::class);\n $messageRepository = $this->getContainer()->get(MessageRepository::class);\n $entityManager = $this->getContainer()->get(EntityManagerInterface::class);\n $notificationService = $this->getContainer()->get(NotificationService::class);\n $templating = $this->getContainer()->get(\\Twig_Environment::class);\n\n $MessageService = new MessageService($appartmentRepository, $messageRepository, $entityManager, $notificationService, $templating);\n\n $result = $MessageService->getAllMessages($this->getUser());\n\n $this->assertArrayHasKey('appartments', $result);\n $this->assertArrayHasKey('count', $result);\n $this->assertEquals(0, $result['count']);\n }", "public function testValidReturnOfUserSentMessages()\n {\n\n $senderuser = User::storeUser([\n 'username' => 'testo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n $token = auth()->login($senderuser);\n $headers = [$token];\n\n $receiveruser1 = User::storeUser([\n 'username' => 'testoo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n $receiveruser2 = User::storeUser([\n 'username' => 'testooo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n\n \n $message1= Message::createDummyMessage($senderuser->username, $receiveruser1->username, 'test_hii1', 'test_subject');\n\n\n $message2= Message::createDummyMessage($senderuser->username, $receiveruser2->username, 'test_hii2', 'test_subject');\n\n\n\n $this->json('GET', 'api/v1/auth/viewUserSentMessages', [], $headers)\n ->assertStatus(200)\n ->assertJson([\n \"success\" => \"true\",\n \"messages\" => [[\n \t\"receiver_name\" => \"testoo\",\n \t \"receiver_photo\" => null,\n \"message_subject\" => 'test_subject',\n \t \"message_content\" => \"test_hii1\",\n \"message_id\" => $message1->message_id,\n \"duration\" => link::duration($message1->message_date)\n\n ],[\n \t\"receiver_name\" => \"testooo\",\n \t \"receiver_photo\" => null,\n \"message_subject\" => 'test_subject',\n \t \"message_content\" => \"test_hii2\",\n \"message_id\" => $message2->message_id,\n \"duration\" => link::duration($message2->message_date)\n\n ]]\n ]);\n\n\n\n $senderuser->delete();\n $receiveruser1->delete();\n $receiveruser2->delete();\n }", "public function testListFirstMessage()\n {\n $data = self::$ctnClient1->listMessages([\n 'startDate' => self::$testStartDate\n ], 1);\n\n $this->assertEquals(1, $data->msgCount);\n $this->assertTrue($data->hasMore);\n }", "public function testFromNoContentResponse() : void {\n $this->assertEmpty(Result::fromResponse(Response::fromName(\"no content\"))->toArray());\n }", "public function getMessages(){ }", "public function testShowEmptyMessages() \r\n {\r\n $render = $this->flash->show();\r\n $this->assertEquals(false, $render);\r\n }", "public function testUnauthorizedReturnOfUserSentMessages()\n {\n\n $senderuser = User::storeUser([\n 'username' => 'testo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n $token = auth()->login($senderuser);\n $headers = [$token];\n auth()->logout();\n\n $receiveruser1 = User::storeUser([\n 'username' => 'testoo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n $receiveruser2 = User::storeUser([\n 'username' => 'testooo',\n 'email' => '[email protected]',\n 'password' => '123456789'\n ]);\n\n\n $message1= Message::createDummyMessage($senderuser->username, $receiveruser1->username, 'test_hii1', 'test_subject');\n\n\n $message2= Message::createDummyMessage($senderuser->username, $receiveruser2->username, 'test_hii2', 'test_subject');\n\n\n\n $this->json('GET', 'api/v1/auth/viewUserSentMessages', [], $headers)\n ->assertStatus(401)\n ->assertJson([\n \"success\" => \"false\",\n \"error\" => \"UnAuthorized\"\n ]);\n\n $senderuser->delete();\n $receiveruser1->delete();\n $receiveruser2->delete();\n }", "function messageNoUsers()\n {\n $this->get('/usuarios?empty')\n ->assertStatus(200)\n ->assertSee('No hay usuarios registrados');\n }", "public function testFailContentEmpty()\n {\n $request = Request::create(\n '/test',\n 'POST',\n [],\n [],\n [],\n [],\n null\n );\n\n $this->expectException(JsonRpcRequestException::class);\n $this->expectExceptionMessage('Request content is null');\n\n new JsonRpcRequest($request);\n }", "public function testGetDefaultMessageIfNoMatchingValueFoundInMessagesList()\n {\n $this->translator->load();\n $this->assertEquals('default_value', $this->translator->get('invalid_message_key', 'default_value'));\n }", "public function test_getAllMessages() {\n\n }", "public function testMessage0()\n{\n\n $actual = $this->response->message();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testMessages()\n {\n $message = new PrivateMessage();\n $conversation = new Conversation();\n $this->assertEmpty($conversation->getMessages());\n\n $conversation->addMessage($message);\n $this->assertEquals(new ArrayCollection([$message]), $conversation->getMessages());\n\n $conversation->removeMessage($message);\n $this->assertEmpty($conversation->getMessages());\n }", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function test_get_user_messages_filtered(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new GroupMessagesScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(time()),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(0, $count);\n });\n }", "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function any(): bool\n {\n return !empty($this->messages);\n }" ]
[ "0.6869914", "0.6421036", "0.6279734", "0.6275319", "0.6217242", "0.6190312", "0.61655146", "0.61655146", "0.6144499", "0.6110451", "0.61057013", "0.6095381", "0.609537", "0.59745735", "0.59645414", "0.59409404", "0.59265304", "0.59264684", "0.59016716", "0.58902115", "0.58838034", "0.58709383", "0.58570457", "0.5855326", "0.583873", "0.58332914", "0.5829861", "0.58270556", "0.58203244", "0.5795603" ]
0.76954585
0
Test set messages for current request
public function testSetMessagesForCurrentRequest() { $storage = ['slimFlash' => [ 'error' => ['An error']]]; $flash = new Messages($storage); $flash->addMessageNow('error', 'Another error'); $flash->addMessageNow('success', 'A success'); $flash->addMessageNow('info', 'An info'); $messages = $flash->getMessages(); $this->assertEquals(['An error', 'Another error'], $messages['error']); $this->assertEquals(['A success'], $messages['success']); $this->assertEquals(['An info'], $messages['info']); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEmpty([], $storage['slimFlash']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSetMessagesForNextRequest()\n {\n $storage = [];\n \n $flash = new Messages($storage);\n $flash->addMessage('Test', 'Test');\n $flash->addMessage('Test', 'Test2');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']);\n }", "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "public function testSetMessages()\n {\n $this->_validator->setMessages(\n [\n Zend_Validate_StringLength::TOO_LONG => 'Your value is too long',\n Zend_Validate_StringLength::TOO_SHORT => 'Your value is too short'\n ]\n );\n\n $this->assertFalse($this->_validator->isValid('abcdefghij'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too long', current($messages));\n\n $this->assertFalse($this->_validator->isValid('abc'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too short', current($messages));\n }", "public function testAddMessageFromStringForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 'value');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['value'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testMessages()\n {\n $response = $this->json('GET', '/api/messages');\n $response->assertJsonStructure([\n 'messages'=>[\n 'current_page',\n 'data' => [\n [\n 'uid',\n 'sender',\n 'subject',\n 'message',\n 'time_sent',\n 'archived',\n 'read'\n ]\n ],\n 'first_page_url',\n 'from',\n 'last_page',\n 'last_page_url',\n 'next_page_url',\n 'path',\n 'per_page',\n 'prev_page_url',\n 'to',\n 'total'\n ]\n ]);\n }", "public function testMessage()\r\n {\r\n\r\n $this->flash->message(\"testMessage\");\r\n $this->assertEquals(\"testMessage\", $_SESSION[\"flash\"][\"messages\"][\"message\"][0]);\r\n\r\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function testAddMessageFromObjectForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessageNow('user', $user);\n\n $messages = $flash->getMessages();\n $this->assertInstanceOf(\\stdClass::class, $messages['user'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "private function initMessageTests() {\r\n\t\tif ($this->getConfig ()->get ( \"run_selftest_message\" ) == \"YES\") {\r\n\t\t\t$stmsg = new SpleefTestMessages ( $this );\r\n\t\t\t$stmsg->runTests ();\r\n\t\t}\r\n\t}", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function testAddMessageFromArrayForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessageNow('old', $formData);\n\n $messages = $flash->getMessages();\n $this->assertEquals($formData, $messages['old'][0]);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "static function getMessages(){\n if(key_exists(MESSAGES, $_REQUEST)){\n return $_REQUEST[MESSAGES];\n }else{\n return array();\n }\n }", "function manageMessages(&$response)\n\t{\n\t\tif(array_key_exists(\"_ERRORES\",$_SESSION))\n\t\t{\n\t\t\tif (count($_SESSION[\"_ERRORES\"])>0)\n\t\t\t{\n\t\t\t\t$response->setErrors($_SESSION[\"_ERRORES\"]);\n\t\t\t\tunset($_SESSION[\"_ERRORES\"]);\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(\"_MENSAJES\",$_SESSION))\n\t\t{\n\t\t\tif (count($_SESSION[\"_MENSAJES\"])>0)\n\t\t\t{\n\t\t\t\t$response->setMessages($_SESSION[\"_MENSAJES\"]);\n\t\t\t\tunset($_SESSION[\"_MENSAJES\"]);\n\t\t\t}\n\t\t}\n\t}", "public function test_get_user_messages_filtered(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new GroupMessagesScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(time()),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(0, $count);\n });\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "public function messages()\n {\n }", "public function testPostVoicemailMessages()\n {\n }", "public function messages();", "public function messages();", "public function messages();", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "public function testMessages() {\n $result = new Hostingcheck_Result_Info();\n $this->assertEquals(array(), $result->messages());\n $this->assertFalse($result->hasMessages());\n\n $messages = array(\n new Hostingcheck_Message('Foo message'),\n new Hostingcheck_Message('Bar Message'),\n );\n $result = new Hostingcheck_Result_Info($messages);\n $this->assertEquals($messages, $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function getMessages() {}", "public function getMessages() {}", "public function test_get_user_messages(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new GroupMessagesScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(1, $count);\n });\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function testSetTypeMessage() {\n\n $obj = new AppelsEnCours();\n\n $obj->setTypeMessage(\"typeMessage\");\n $this->assertEquals(\"typeMessage\", $obj->getTypeMessage());\n }", "public function test_getAllMessages() {\n\n }" ]
[ "0.68090874", "0.64293087", "0.62194574", "0.6216122", "0.61718696", "0.6116908", "0.60891205", "0.5985521", "0.5919066", "0.5918706", "0.5909979", "0.5904052", "0.58962536", "0.58763707", "0.5839283", "0.5825164", "0.57972217", "0.57724", "0.57596606", "0.57596606", "0.57596606", "0.5748217", "0.57397574", "0.573954", "0.5726804", "0.5726804", "0.57148886", "0.57116914", "0.5701157", "0.5673689" ]
0.7029479
0
Test set messages for next request
public function testSetMessagesForNextRequest() { $storage = []; $flash = new Messages($storage); $flash->addMessage('Test', 'Test'); $flash->addMessage('Test', 'Test2'); $this->assertArrayHasKey('slimFlash', $storage); $this->assertEquals(['Test', 'Test2'], $storage['slimFlash']['Test']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNextMessage(){\r\n }", "public function testAddMessageFromAnIntegerForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 46);\n $flash->addMessage('key', 48);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['46', '48'], $storage['slimFlash']['key']);\n }", "protected function processMessages()\n {\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $request = $this->resourceHash[(int)$done['handle']];\n $this->processResponse($request, $this->handles[$request], $done);\n }\n }", "public function testAddMessageFromArrayForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $formData = [\n 'username' => 'Scooby Doo',\n 'emailAddress' => '[email protected]',\n ];\n\n $flash->addMessage('old', $formData);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals($formData, $storage['slimFlash']['old'][0]);\n }", "public function testGetMessagesFromPrevRequest()\n {\n $storage = ['slimFlash' => ['Test']];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test'], $flash->getMessages());\n }", "public function next()\n {\n next($this->requests);\n }", "public function testAddMessageFromStringForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessage('key', 'value');\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEquals(['value'], $storage['slimFlash']['key']);\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function testSetMessagesForCurrentRequest()\n {\n $storage = ['slimFlash' => [ 'error' => ['An error']]];\n\n $flash = new Messages($storage);\n $flash->addMessageNow('error', 'Another error');\n $flash->addMessageNow('success', 'A success');\n $flash->addMessageNow('info', 'An info');\n\n $messages = $flash->getMessages();\n $this->assertEquals(['An error', 'Another error'], $messages['error']);\n $this->assertEquals(['A success'], $messages['success']);\n $this->assertEquals(['An info'], $messages['info']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty([], $storage['slimFlash']);\n }", "public function testGetEmptyMessagesFromPrevRequest()\n {\n $storage = [];\n $flash = new Messages($storage);\n\n $this->assertEquals([], $flash->getMessages());\n }", "public function testMessages()\n {\n $response = $this->json('GET', '/api/messages');\n $response->assertJsonStructure([\n 'messages'=>[\n 'current_page',\n 'data' => [\n [\n 'uid',\n 'sender',\n 'subject',\n 'message',\n 'time_sent',\n 'archived',\n 'read'\n ]\n ],\n 'first_page_url',\n 'from',\n 'last_page',\n 'last_page_url',\n 'next_page_url',\n 'path',\n 'per_page',\n 'prev_page_url',\n 'to',\n 'total'\n ]\n ]);\n }", "function executeNextMessageDueToExpire()\n { \n $this->admin_message = AdminMessagePeer::getNextMessageDueToExpire(); \n }", "public function next()\n {\n $this->curIndex++;\n if($this->curIndex >= count($this->res)){\n $this->MakeNextReq();\n }\n }", "public function testAddMessageFromObjectForNextRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $user = new \\stdClass();\n $user->name = 'Scooby Doo';\n $user->emailAddress = '[email protected]';\n\n $flash->addMessage('user', $user);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertInstanceOf(\\stdClass::class, $storage['slimFlash']['user'][0]);\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function testMessageThreadsV2GetMessages0()\n {\n }", "public function processMessages() {\n while ( ( $execution = array_shift($this->queue) ) ) { \n $execution->event('continue');\n $this->messagesDelivered++;\n }\n }", "public function test_get_user_messages(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new GroupMessagesScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(1, $count);\n });\n }", "public function testAddMessageFromAnIntegerForCurrentRequest()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $flash->addMessageNow('key', 46);\n $flash->addMessageNow('key', 48);\n\n $messages = $flash->getMessages();\n $this->assertEquals(['46','48'], $messages['key']);\n\n $this->assertArrayHasKey('slimFlash', $storage);\n $this->assertEmpty($storage['slimFlash']);\n }", "public function processRequests() {\n\t\t$receivedRequests = $this->receivedRequestMapper->findAll();\n\t\tforeach ($receivedRequests as $receivedRequest) {\n\t\t\t$id = $receivedRequest->getId();\n\t\t\t$sendingLocation = $receivedRequest->getSendingLocation();\n\t\t\t$type = $receivedRequest->getRequestType();\n\t\t\t$addedAt = $receivedRequest->getAddedAt();\n\t\t\t$field1 = $receivedRequest->getField1();\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS: //Want same behavior for these two queries\n\t\t\t\tcase Request::FETCH_USER: //for login for a user that doesn't exist in the db\n\t\t\t\t\t$userExists = $this->api->userExists($field1) ? '1' : '0';\t\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t$response = new QueuedResponse($id, $sendingLocation, (string) $userExists, $this->api->microTime());\n\t\t\t\t\t$this->queuedResponseMapper->save($response); //Does not throw Exception if already exists\n\n\t\t\t\t\tif ($userExists) {\n\t\t\t\t\t\t$userUpdate = $this->userUpdateMapper->find($field1);\n\t\t\t\t\t\t$displayName = $this->api->getDisplayName($field1);\n\t\t\t\t\t\t$password = $this->api->getPassword($field1);\n\t\t\t\t\t\t$queuedUser = new QueuedUser($field1, $displayName, $password, $userUpdate->getUpdatedAt(), $sendingLocation); \n\t\t\t\t\t\t$this->queuedUserMapper->save($queuedUser); //Does not throw Exception if already exists\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request from {$sendingLocation} added_at {$addedAt}, field1 = {$field1}\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request = $this->receivedRequestMapper->delete($receivedRequest);\n\t\t}\n\t}", "public function testSendMultiPage()\n {\n $request1 = $this->getExpectedBody(\n [\n ['SKU' => 'test1'],\n ['SKU' => 'test2'],\n ['SKU' => 'test3'],\n ['SKU' => 'test4'],\n ['SKU' => 'test5'],\n ['SKU' => 'test6'],\n ['SKU' => 'test7'],\n ['SKU' => 'test8'],\n ['SKU' => 'test9'],\n ['SKU' => 'test10']\n ],\n []\n );\n\n\n $curl = $this->mockCurl($request1, 200, '', '', 2);\n\n $request2 = $this->getExpectedBody(\n [\n ['SKU' => 'test11'],\n ['SKU' => 'test12']\n ],\n []\n );\n\n $curl->shouldReceive('post')\n ->once()\n ->with('http://127.0.0.1/delta/', $request2);\n\n $this->mockEndpoint();\n\n $this->subject->addData(['SKU' => 'test1']);\n $this->subject->addData(['SKU' => 'test2']);\n $this->subject->addData(['SKU' => 'test3']);\n $this->subject->addData(['SKU' => 'test4']);\n $this->subject->addData(['SKU' => 'test5']);\n $this->subject->addData(['SKU' => 'test6']);\n $this->subject->addData(['SKU' => 'test7']);\n $this->subject->addData(['SKU' => 'test8']);\n $this->subject->addData(['SKU' => 'test9']);\n $this->subject->addData(['SKU' => 'test10']);\n $this->subject->addData(['SKU' => 'test11']);\n $this->subject->addData(['SKU' => 'test12']);\n\n $responses = $this->subject->send();\n\n $this->assertEquals(2, count($responses));\n\n $this->assertEquals(\n [\n 'status' => 200,\n 'body' => ''\n ],\n $responses[0]\n );\n\n $this->assertEquals(\n [\n 'status' => 200,\n 'body' => ''\n ],\n $responses[1]\n );\n }", "public function testPostVoicemailMessages()\n {\n }", "public function testFlashAssertionMultipleRequests(): void\n {\n $this->enableRetainFlashMessages();\n $this->disableErrorHandlerMiddleware();\n\n $this->get('/posts/index/with_flash');\n $this->assertResponseCode(200);\n $this->assertFlashMessage('An error message');\n\n $this->get('/posts/someRedirect');\n $this->assertResponseCode(302);\n $this->assertFlashMessage('A success message');\n }", "public function testListFirstMessage()\n {\n $data = self::$ctnClient1->listMessages([\n 'startDate' => self::$testStartDate\n ], 1);\n\n $this->assertEquals(1, $data->msgCount);\n $this->assertTrue($data->hasMore);\n }", "public function test_peekMessage() {\n\n }", "public function testMessage()\r\n {\r\n\r\n $this->flash->message(\"testMessage\");\r\n $this->assertEquals(\"testMessage\", $_SESSION[\"flash\"][\"messages\"][\"message\"][0]);\r\n\r\n }", "private function initMessageTests() {\r\n\t\tif ($this->getConfig ()->get ( \"run_selftest_message\" ) == \"YES\") {\r\n\t\t\t$stmsg = new SpleefTestMessages ( $this );\r\n\t\t\t$stmsg->runTests ();\r\n\t\t}\r\n\t}", "public function testGetMessageRequiredParams()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageListResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $direction = \"direction_example\";\n $account_uid = \"account_uid_example\";\n $state = \"state_example\";\n $offset = 0;\n $limit = 10;\n\n }", "public function testRelatedRequests()\n {\n $firstResponse = $this->http->send(\n new Request('GET', '/visit-counter.php')\n );\n\n $secondResponse = $this->http->send(\n new Request('GET', '/visit-counter.php', $this->prepareSessionHeader($firstResponse))\n );\n\n $this->assertSame('1', (string) $firstResponse->getBody());\n $this->assertSame('2', (string) $secondResponse->getBody());\n\n $this->assertCreatedNewSession($firstResponse);\n $this->assertFalse($secondResponse->hasHeader('Set-Cookie'));\n\n $this->assertSame(1, $this->redis->dbSize());\n }" ]
[ "0.62519413", "0.61591566", "0.61474276", "0.60851175", "0.607869", "0.6024805", "0.6023967", "0.58872044", "0.58124787", "0.5809612", "0.58067995", "0.57403266", "0.57360333", "0.5706457", "0.5687764", "0.5684246", "0.5680642", "0.5617745", "0.5605141", "0.5577496", "0.55737954", "0.554145", "0.55352926", "0.5522789", "0.551162", "0.5498583", "0.54957664", "0.5482698", "0.54694", "0.5450951" ]
0.73202366
0
Test getting the message from the key
public function testGetMessageFromKey() { $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]]; $flash = new Messages($storage); $this->assertEquals(['Test', 'Test2'], $flash->getMessage('Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetFirstMessageFromKey()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n\n $this->assertEquals('Test', $flash->getFirstMessage('Test'));\n }", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "function verifyKey($msg){\n\n // TODO: check if this key is in the database!\n if(isset($_GET['key'])){\n $apiKey = $_GET['key'];\n $userid = $_GET['userid'];\n\n if($apiKey == getApiKey($userid)){\n // Fillter on datatype\n filterRequest($msg);\n }else{\n $msg->message = 'Invalid key!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Key not set!';\n $msg->toJson();\n }\n}", "public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $this->assertEquals('This', $flash->getFirstMessage('Test', 'This'));\n }", "public function testCanGetMessageByKeyFromTranslator()\n {\n $this->translator->load();\n $message = $this->translator->get('test_message');\n $this->assertEquals('file has been loaded', $message);\n }", "public function testKey()\n\t{\n\t\t$retunMessage = '';\n\t\t\n\t\t$this->setRequestQuery( array( 'phone'=>Wp_WhitePages_Model_Api::API_REQUEST_TEST_PHONENUMBER) );\n\t\t$testRequest = $this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_TEST);\n\n\t\tif($this->_result[\"result\"]['type'] == 'error')\n\t\t{\n\t\t\t$retunMessage = $this->_result[\"result\"][\"message\"];\n\t\t}\n\t\telseif($this->_result[\"result\"])\n\t\t{\n\t\t\t$retunMessage = Mage::helper('whitePages')->__(Wp_WhitePages_Model_Api::API_REQUEST_TEST_SUCCESS_MESSAGE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retunMessage = Mage::helper('whitePages')->__(Wp_WhitePages_Model_Api::API_REQUEST_TEST_ERROR_MESSAGE);\n\t\t}\n\n\t\treturn $retunMessage;\n\t}", "public function testGetKey()\n {\n }", "abstract public function get_message();", "public function testGetMessage()\n {\n $config = new Configuration();\n// $config->setHost(\"http://127.0.0.1:8080\");\n $apiInstance = new DaDaPushMessageApi(\n // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n // This is optional, `GuzzleHttp\\Client` will be used as default.\n new \\GuzzleHttp\\Client(),\n $config\n );\n\n $channel_token = 'ctb3lwO6AeiZOwqZgp8BE8980FdNgp0cp6MCf';\n $message_id=227845;\n $result = $apiInstance->getMessage($message_id, $channel_token);\n print_r($result);\n self::assertTrue($result->getCode()==0);\n }", "public function testGetMessage()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageListResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $direction = \"direction_example\";\n $account_uid = \"account_uid_example\";\n $state = \"state_example\";\n $offset = 0;\n $limit = 10;\n\n try {\n $result = $apiInstance->getMessage($direction, $account_uid, $state, $offset, $limit);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling MessageApi->getMessage: \".$e->getMessage());\n }\n }", "public function testGetValidMessagebyMessageId(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function testCreateMessageBodyDraftHasMessageKey()\n {\n\n $this->expectException(ImapClientException::class);\n\n $account = $this->getTestUserStub()->getMailAccount(\"dev_sys_conjoon_org\");\n $mailFolderId = \"INBOX\";\n $folderKey = new FolderKey($account, $mailFolderId);\n $client = $this->createClient();\n $client->createMessageBodyDraft(\n $folderKey,\n new MessageBodyDraft(new MessageKey(\"a\", \"b\", \"c\"))\n );\n }", "public function test_peekMessage() {\n\n }", "private static function get_email_message($user_data, $key)\n {\n }", "public function testProtosGet()\n {\n }", "public function testGetMessageById()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getMessageById($uid);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling MessageApi->getMessageById: \".$e->getMessage());\n }\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function test_getMessageById() {\n\n }", "public function testLogMessage()\n {\n $message = 'Test message #' . rand();\n\n $data = self::$ctnClient1->logMessage($message);\n\n $this->assertTrue(isset($data->messageId));\n }", "public function testAuthenticationsSmsIdGet()\n {\n }", "public function testGetKey()\n {\n $subject = $this->createInstance();\n $reflect = $this->reflect($subject);\n\n $key = uniqid('key-');\n\n $reflect->_setKey($key);\n\n $this->assertEquals($key, $subject->getKey(), 'Set and retrieved keys are not the same.');\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function test_getMessage() {\n\n }", "public function testGetVoicemailMeMessages()\n {\n }", "public function test_getAllMessages() {\n\n }", "public function test_generate_key()\n {\n $key = GuestToken::generate_key();\n $this->assertGreaterThan(10, strlen($key));\n }", "Public function testGetInvalidMessageByMessageId(){\n\t //create a new message\n\t $newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t $newMessage->insert($this->getPDO());\n\n\t //grab the data from guzzle\n\t $response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t $this->assertSame($response->getStatusCode(),200);\n\t $body = $response->getBody();\n\t $alertLevel = json_decode ($body);\n\t $this->assertSame(200, $alertLevel->status);\n }", "public function testGetVoicemailMessages()\n {\n }", "function request($message, $peer_id, $keyboard, $sticker_id)\r\n{\r\n $request_params = array(\r\n 'message' => $message,\r\n 'peer_id' => $peer_id,\r\n 'access_token' => VK_API_TOKEN,\r\n 'v' => '5.80',\r\n 'sticker_id' => $sticker_id,\r\n 'keyboard' => json_encode($keyboard)\r\n );\r\n\r\n $get_params = http_build_query($request_params);\r\n file_get_contents('https://api.vk.com/method/messages.send?' . $get_params);\r\n echo('ok');\r\n}", "public function testGetKey()\n {\n $subject = new Iteration($key = 'test-key', '');\n\n $this->assertEquals($key, $subject->getKey());\n }" ]
[ "0.74023134", "0.73835194", "0.6972725", "0.69450796", "0.69185096", "0.6911737", "0.6717153", "0.6451006", "0.639705", "0.63416713", "0.6319928", "0.622334", "0.6215651", "0.6082025", "0.607969", "0.6066614", "0.6066289", "0.60417175", "0.60350317", "0.5990788", "0.59269774", "0.5911723", "0.590148", "0.586259", "0.5852697", "0.58410084", "0.58389324", "0.5829831", "0.58043617", "0.57963234" ]
0.77857244
0
Test getting the first message from the key
public function testGetFirstMessageFromKey() { $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]]; $flash = new Messages($storage); $this->assertEquals('Test', $flash->getFirstMessage('Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $this->assertEquals('This', $flash->getFirstMessage('Test', 'This'));\n }", "public function testGetMessageFromKey()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test', 'Test2'], $flash->getMessage('Test'));\n }", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "public function first($key, $wrap = ':message')\n {\n $res = $this->get($key, $wrap);\n return array_shift($res);\n }", "public function firstKey();", "public function testFirstMessage()\n {\n $message = new PrivateMessage();\n $conversation = new Conversation();\n $this->assertNull($conversation->getFirstMessage());\n\n $conversation->setFirstMessage($message);\n $this->assertSame($message, $conversation->getFirstMessage());\n }", "static function getSingleMessage($key = 'id', $value = 0)\r\n {\r\n if ($value === '')\r\n {\r\n return null;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n\r\n $query = \"SELECT $tableMessage.*\r\n FROM $tableMessage \r\n WHERE $tableMessage.$key = '$value'\";\r\n\r\n if ($value2 !== '')\r\n {\r\n $query = $query . \" AND $tableMessage.$key2 = '$value2'\";\r\n }\r\n\r\n $myMessage = DatabaseManager::singleFetchAssoc($query);\r\n $myMessage = self::ArrayToMessage($myMessage);\r\n\r\n return $myMessage;\r\n }", "public function testListFirstMessage()\n {\n $data = self::$ctnClient1->listMessages([\n 'startDate' => self::$testStartDate\n ], 1);\n\n $this->assertEquals(1, $data->msgCount);\n $this->assertTrue($data->hasMore);\n }", "function verifyKey($msg){\n\n // TODO: check if this key is in the database!\n if(isset($_GET['key'])){\n $apiKey = $_GET['key'];\n $userid = $_GET['userid'];\n\n if($apiKey == getApiKey($userid)){\n // Fillter on datatype\n filterRequest($msg);\n }else{\n $msg->message = 'Invalid key!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Key not set!';\n $msg->toJson();\n }\n}", "public function getFirstMessage(): ?MessageInterface;", "public function test_peekMessage() {\n\n }", "public function testCanGetMessageByKeyFromTranslator()\n {\n $this->translator->load();\n $message = $this->translator->get('test_message');\n $this->assertEquals('file has been loaded', $message);\n }", "public function testKey()\n\t{\n\t\t$retunMessage = '';\n\t\t\n\t\t$this->setRequestQuery( array( 'phone'=>Wp_WhitePages_Model_Api::API_REQUEST_TEST_PHONENUMBER) );\n\t\t$testRequest = $this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_TEST);\n\n\t\tif($this->_result[\"result\"]['type'] == 'error')\n\t\t{\n\t\t\t$retunMessage = $this->_result[\"result\"][\"message\"];\n\t\t}\n\t\telseif($this->_result[\"result\"])\n\t\t{\n\t\t\t$retunMessage = Mage::helper('whitePages')->__(Wp_WhitePages_Model_Api::API_REQUEST_TEST_SUCCESS_MESSAGE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retunMessage = Mage::helper('whitePages')->__(Wp_WhitePages_Model_Api::API_REQUEST_TEST_ERROR_MESSAGE);\n\t\t}\n\n\t\treturn $retunMessage;\n\t}", "public function findFirstByKey($key);", "public function getNextMessage(){\r\n }", "public function get_message( $key = null ) {\n // Gets the message for the given key from the message_values property.\n if ( $key === null ) return $this->message_values;\n else if ( isset($this->message_values[$key] ) ) return $this->message_values[$key];\n else return false;\n }", "abstract public function get_message();", "public function first($defaultMsg='') {\n $r=$this->firstError();\n if ($r!==null) return $r;\n $r=$this->firstWarning();\n if ($r!==null) return $r;\n $r=$this->firstInfo();\n if ($r!==null) return $r;\n $r=$this->firstSuccess();\n if ($r!==null) return $r;\n return $defaultMsg;\n }", "public function testGetKey()\n {\n }", "public function testSendFirstMessage()\n {\n $data = [\n 'message' => Str::random('50'),\n ];\n\n $this->post(route('api.send.message'), $data)\n ->assertStatus(201)\n ->assertJson(['success' => true, 'text' => $data['text']]);\n }", "public function first($key = null)\n {\n return $this->errors[$key][0];\n }", "function nextMessage(): string\n{\n return Session::pop('message');\n}", "public function readone() {\n\t\t$msg = Core_Ipc_Messages::find(['stream' => md5($this->stream)], ['limit' => 1, 'order' => 'msgid']);\n\t\tif(empty($msg)) {\n\t\t\treturn false;\n\t\t}\n\t\t$msg->delete();\n\t\treturn $msg->instance;\n\t}", "public function testGetMessageById()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getMessageById($uid);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling MessageApi->getMessageById: \".$e->getMessage());\n }\n }", "public function testGetValidMessagebyMessageId(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function testReceiveWithKeyIsEmpty()\n {\n $callback = function (){};\n $eventName = 'bar-foo-testing';\n\n $this->adapter->expects($this->once())->method('receive')\n ->with($eventName, $callback, null);\n\n $this->eventReceiver->receive($eventName, $callback);\n }", "public function testGetKey()\n {\n $subject = new Iteration($key = 'test-key', '');\n\n $this->assertEquals($key, $subject->getKey());\n }", "public function testCreateMessageBodyDraftHasMessageKey()\n {\n\n $this->expectException(ImapClientException::class);\n\n $account = $this->getTestUserStub()->getMailAccount(\"dev_sys_conjoon_org\");\n $mailFolderId = \"INBOX\";\n $folderKey = new FolderKey($account, $mailFolderId);\n $client = $this->createClient();\n $client->createMessageBodyDraft(\n $folderKey,\n new MessageBodyDraft(new MessageKey(\"a\", \"b\", \"c\"))\n );\n }", "public function firstKey() {\n\t\t$keys = $this->keys();\n\t\treturn array_shift($keys);\n\t}", "function blpop(string $key): string {\n while (is_null($message = predis()->lpop($key))) {\n usleep(100000);\n }\n\n return $message;\n}" ]
[ "0.7507137", "0.69184434", "0.6886332", "0.64328176", "0.6408872", "0.6302087", "0.6230232", "0.6221132", "0.6141961", "0.61303663", "0.6051193", "0.5973054", "0.59687555", "0.5947246", "0.58659756", "0.5840703", "0.57835543", "0.57457983", "0.57017016", "0.5682362", "0.5671264", "0.5669568", "0.56508636", "0.5615954", "0.56003356", "0.5586511", "0.5562374", "0.55535704", "0.55484307", "0.5545911" ]
0.81680954
0
Test getting the default message if the key doesn't exist
public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist() { $storage = ['slimFlash' => []]; $flash = new Messages($storage); $this->assertEquals('This', $flash->getFirstMessage('Test', 'This')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetDefaultMessageIfNoMatchingValueFoundInMessagesList()\n {\n $this->translator->load();\n $this->assertEquals('default_value', $this->translator->get('invalid_message_key', 'default_value'));\n }", "public static function getDefaultMessage(): string;", "public function get_option_default($key)\n {\n switch ($key) {\n case self::FIELD_MESSAGE:\n return 'Hello, World!';\n\n default:\n return '';\n }\n }", "public function testSetMessageDefaultKey()\n {\n $this->_validator->setMessage(\n 'Your value is too short',\n Zend_Validate_StringLength::TOO_SHORT\n );\n\n $this->assertFalse($this->_validator->isValid('abc'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too short', current($messages));\n $errors = $this->_validator->getErrors();\n $this->assertEquals(Zend_Validate_StringLength::TOO_SHORT, current($errors));\n }", "public function testGetFirstMessageFromKey()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n\n $this->assertEquals('Test', $flash->getFirstMessage('Test'));\n }", "private function maybe_print_message( $message, $default ) {\n\t\treturn ! empty( $message ) ? $message : $default;\n\t}", "public function defaultMessage()\n {\n return \"There are no webhooks registered for {$this->eventName}\";\n }", "function get_message($default='')\n\t{\n\t\t$msg = isset($_SESSION['message']) ? $_SESSION['message'] : $default;\n\t\tunset($_SESSION['message']);\n\t\treturn $msg;\n\t}", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "public function get_message( $key = null ) {\n // Gets the message for the given key from the message_values property.\n if ( $key === null ) return $this->message_values;\n else if ( isset($this->message_values[$key] ) ) return $this->message_values[$key];\n else return false;\n }", "private function get($key, $default = null)\n {\n if (isset($this->responseData['error'][$key])) {\n return $this->responseData['error'][$key];\n }\n\n return $default;\n }", "function trans_or_default(string $key, $default, array $replace = [], $locale = null): string\n {\n $message = trans($key, $replace, $locale);\n\n return $message === $key ? $default : $message;\n }", "public function testGetMessageFromKey()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test', 'Test2'], $flash->getMessage('Test'));\n }", "public function testGetFlashDefault()\n {\n $val = $this->_req->getFlash('DOESNT_EXIST', 'default value');\n $this->assertEquals('default value', $val);\n }", "public function getMessDefault ()\n {\n return $this->mess_default;\n }", "private function _get($key, $default = null) {}", "public function getDefaultMessage()\n {\n return $this->defaultMessage;\n }", "function errorMsg($keyName, $label) {\n\n // PHP checks whether certain keys have been returned with values in the GET Global Super Array, if it has then echo the value into the input field\n if(isset($_GET[$keyName]) && $_GET[$keyName] === '') {\n\n return \"<div class='warning_msg'>Please enter \" . $label . \".</div>\";\n\n } //end if statement\n\n}", "abstract protected function getNotFoundMessage();", "function getMsgList($key = \"\") {\n $msgListArr = array(\n 0 => \"Invalid email and password combination.\",\n 1 => \"Your account is not active.Please contact administrator.\",\n 2 => \"Invalid old password. Please enter correct password.\",\n 3 => \"Password updated Successfully.\",\n 4 => \"Please select another Username.\",\n 5 => \"Record Added Sucessfully.\",\n 6 => \"Record Updated Sucessfully.\",\n 7 => \"Record Removed Sucessfully.\",\n 8 => \"Please select another category name.\",\n 9 => \"Invalid email address.\",\n 10 => \"Error in sending email.\",\n );\n if (isset($msgListArr[$key]))\n return $msgListArr[$key];\n else\n return $msgListArr;\n}", "function testRequiredDefaultMessage(){\n\t\t#mdx:required2\n\t\tFlSouto\\ParamFilters::$errmsg_required = 'Cannot be empty';\n\n\t\tParam::get('name')\n\t\t\t->context(['name'=>''])\n\t\t\t->filters()\n\t\t\t\t->required();\n\n\t\t$error = Param::get('name')->process()->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Cannot be empty\", $error);\n\t}", "abstract public function Get(string $key, $default = NULL);", "public function get(string $key = NULL, $default = NULL) /* mixed */\n\t{\n\t\treturn (isset($this->flashRecord[$key], $this->flashRecord[$key]['data'])) ? $this->flashRecord[$key]['data'] : $default;\n\t}", "private function altMessageExist()\n { \n return !empty($this->altMessage);\n }", "public function testCanGetMessageByKeyFromTranslator()\n {\n $this->translator->load();\n $message = $this->translator->get('test_message');\n $this->assertEquals('file has been loaded', $message);\n }", "private function getIsExpected($key, $default)\n {\n if (array_key_exists($key, $this->server)) {\n if (isset($this->server[$key])) {\n return (bool) (int) $this->server[$key];\n }\n return null;\n }\n return $default;\n }", "function array_key_or_exit($key, $arr, $msg) {\n exit_if(!array_key_exists($key, $arr), $msg);\n return $arr[$key];\n}", "public function has($key): bool\n {\n return !empty($this->messages[$key]);\n }", "public function assertFlashedMessage($key)\n {\n $this->assertTrue(Lang::has($key), \"Oops! The language key '$key' doesn't exist\");\n $this->assertSessionHas('flash_notification.message', trans($key));\n }", "function verifyKey($msg){\n\n // TODO: check if this key is in the database!\n if(isset($_GET['key'])){\n $apiKey = $_GET['key'];\n $userid = $_GET['userid'];\n\n if($apiKey == getApiKey($userid)){\n // Fillter on datatype\n filterRequest($msg);\n }else{\n $msg->message = 'Invalid key!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Key not set!';\n $msg->toJson();\n }\n}" ]
[ "0.7424013", "0.7027813", "0.6519302", "0.6421024", "0.63071084", "0.6300398", "0.6262814", "0.62199277", "0.62195075", "0.62076044", "0.6201398", "0.6134098", "0.6125542", "0.60229933", "0.6016036", "0.59516007", "0.5947008", "0.59423625", "0.59402615", "0.5927038", "0.5853016", "0.5833716", "0.5819003", "0.58159596", "0.5813812", "0.57850015", "0.57611763", "0.5702429", "0.5699146", "0.5669038" ]
0.7725253
0
Sets SSL curl properties when requesting an https url.
private function setSSL() { curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setCurl($is_https = false)\n {\n // Init\n $this->curl = curl_init();\n // Sets basic parameters\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, isset($this->request->settings['timeout']) ? $this->request->settings['timeout'] : 100);\n // Set parameters to maintain cookies across sessions\n curl_setopt($this->curl, CURLOPT_COOKIESESSION, true);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_USERAGENT, 'OLEGNAX-PURCHASE-VERIFY');\n if ($is_https) {\n $this->setSSL();\n }\n }", "public function https_url($url)\n {\n }", "public function enableSSLChecks() {}", "public static function setSsl() {\n $attr = conf::getMainIni('mysql_attr');\n if (isset($attr['mysql_attr'])) {\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_KEY, $attr['ssl_key']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CERT, $attr['ssl_cert']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CA, $attr['ssl_ca']);\n }\n }", "private function configureCurl ()\n {\n curl_setopt_array($this->cURL, [\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ]);\n }", "static function http_api_curl($handle, $r, $url) {\n\t\t\tif(strpos($url, 'paypal.com') !== false)\n\t\t\t\tcurl_setopt( $handle, CURLOPT_SSLVERSION, 6 );\n\t\t}", "public function forceSSL();", "public function forceSSL();", "public function setUseSSL($use_ssl){\r\n\t\t$this->useSSL = $use_ssl;\r\n\t}", "function wp_update_urls_to_https()\n {\n }", "public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }", "public function useHttps($flag = true) {\r\n\t\t$this->useHttps = true;\r\n\t\treturn $this;\r\n\t}", "function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}", "function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}", "public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }", "public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }", "public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }", "private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }", "protected function setHttpClientConfiguration(): void\n {\n $this->setCurlConstants();\n\n $this->httpClientConfig = [\n CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2,\n CURLOPT_SSL_VERIFYPEER => $this->validateSSL,\n ];\n\n // Initialize Http Client\n $this->setClient();\n }", "public function disableSSLChecks() {}", "protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }", "public function useSecureProtocol($protocol)\n {\n if($protocol == true)\n {\n $this->protocol = 'https';\n }\n else\n {\n $this->protocol = 'http';\n }\n }", "public function usesHttps()\n {\n return $this->useHttps;\n }", "private function configureSslValidation()\n {\n if ($this->config[ 'cas_validation' ] == 'self') {\n phpCAS::setCasServerCert($this->config[ 'cas_cert' ]);\n } else {\n if ($this->config[ 'cas_validation' ] == 'ca') {\n phpCAS::setCasServerCACert($this->config[ 'cas_cert' ]);\n } else {\n phpCAS::setNoCasServerValidation();\n }\n }\n }", "public function testIsSSLA() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's off, it should not show ssl\n $_SERVER['HTTPS'] = 'off';\n\n // Should NOT be SSL\n $this->assertFalse( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }", "public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}", "protected function setCurlConstants(): void\n {\n $constants = [\n 'CURLOPT_SSLVERSION' => 32,\n 'CURL_SSLVERSION_TLSv1_2' => 6,\n 'CURLOPT_SSL_VERIFYPEER' => 64,\n 'CURLOPT_SSLCERT' => 10025,\n ];\n\n foreach ($constants as $key => $value) {\n if (!defined($key)) {\n define($key, $constants[$key]);\n }\n }\n }", "public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}", "public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}", "protected function init()\n {\n $this->curl = curl_init();\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n // this line makes it work under https\n curl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookiejar);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookiejar);\n curl_setopt($this->curl, CURLOPT_REFERER, $this->referer);\n if (isset($this->encoding)) {\n curl_setopt($this->curl, CURLOPT_ENCODING, $this->encoding);\n }\n if ($this->omitSSLVerification) {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n }\n if (isset($this->userAuthData)) {\n curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->curl, CURLOPT_USERPWD, $this->userAuthData);\n }\n if ($this->proxy != '') {\n curl_setopt($this->curl, CURLOPT_PROXY, $this->proxy);\n if ($this->proxyType == self::PROXY_TYPE_SOCKS4) {\n curl_setopt($this->curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n } else if ($this->proxyType == self::PROXY_TYPE_SOCKS5) {\n curl_setopt($this->curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n }\n }\n $this->errorno = false;\n $this->error = false;\n }" ]
[ "0.67573386", "0.66084594", "0.6411469", "0.6334074", "0.62385255", "0.62204045", "0.621059", "0.621059", "0.61937183", "0.61431164", "0.6126274", "0.6072844", "0.60616535", "0.60616535", "0.6024835", "0.6024835", "0.5980887", "0.5961165", "0.59462595", "0.5920146", "0.5916298", "0.5905596", "0.58800834", "0.58477616", "0.58345675", "0.5831107", "0.5823603", "0.5818316", "0.5809514", "0.5794119" ]
0.79271114
0
Gets the station ID from name
public function getStationID(string $station_name) { if (substr($station_name, 0, 11) === "TRADE HUB: ") { $station_name = substr($station_name, 11); } $this->db->select('eve_idstation'); $this->db->where('name', $station_name); $query = $this->db->get('station'); if ($query->num_rows() != 0) { $result = $query->row(); } else { $result = false; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIdForName($name, $dbh=null) {\r\n if (is_null($dbh)) $dbh = connect_to_database();\r\n $sql = \"SELECT id FROM stock WHERE LOWER(name) = LOWER('$name')\";\r\n $sth = make_query($dbh, $sql);\r\n $results = get_all_rows($sth);\r\n if ($results) {\r\n return $results[0]['id'];\r\n }\r\n }", "public function getStationName(): string\n {\n return $this->name;\n }", "private function whichStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\t$x = '';\n\t\t\tforeach ($stations as $st) {\n\t\t\t\tif (substr($st,0,1) == '1') {\n\t\t\t\t\t$x = substr($st,1);\n\t\t\t\t\t$x = explode(\" #\",$x);\n\t\t\t\t\t$x = $x[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x == '') {$x = Flight::get(\"defaultStation\");}\n\t\t}\n\t\telse $x = (Flight::get(\"defaultStation\"));\n\t\treturn trim($x);\n\t}", "static function getIdOf ($name)\n {\n return array_search ($name, self::$NAMES);\n }", "public function getIDFromName($name) {\n\t\t\n\t\t\t//construct query to grab the user's OSU ID by using their name\n\t\t\t$query = \"SELECT * FROM users WHERE name='\" . $name . \"'\";\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//get next row of returned results (should only be one row)\n\t\t\t$row = $result->fetch();\n\t\t\t\n\t\t\t//if query failed\n\t\t\tif (!$row) {\n\t\t\t\techo 'Error getting student ID!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t//return name\n\t\t\telse {\n\t\t\t\treturn $row['osuId'];\n\t\t\t}\n\t\t}", "public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }", "function get_system_id( $dsn, $system_name ) {\n\t$db =& MDB2::factory($dsn);\n\t\n\tif (DB::isError($db)) {\n\t\tdie ($db->getMessage());\n\t}\n\n\t# Get Server_Id\n\t$sql = \"SELECT id FROM systems WHERE name = '\" . $system_name . \"'\";\n\n\treturn $db->queryOne($sql);\n\n}", "public function getIdByName($name) {\n $id = $this->db->queryToSingleValue(\n \t\"select \n \t\tid\n from \n \tOvalSourceDef \n where\n \tname='\".mysql_real_escape_string($name).\"'\");\n if ($id == null) {\n return -1;\n }\n return $id;\n }", "static function findIdByName($name) {\n $campaign = self::findByName($name);\n if (count($campaign)>0) return $campaign['id'];\n return 0;\n }", "function getSoId($so_name)\n\t{\n\t\tglobal $log;\n $log->info(\"in getSoId \".$so_name);\n\t\tglobal $adb;\n\t\tif($so_name != '')\n\t\t{\n\t\t\t$sql = \"select salesorderid from ec_salesorder where subject='\".$so_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$so_id = $adb->query_result($result,0,\"salesorderid\");\n\t\t}\n\t\treturn $so_id;\n\t}", "function getUniqueId(string $name): string;", "public function id($name)\n {\n return self::$driver->id($name);\n }", "function getArtistID($conn, $name) {\n $query = \"SELECT artist_id FROM artist WHERE artist_name LIKE '${name}'\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n $row = mysqli_fetch_assoc($result);\n return $row['artist_id'];\n } else {\n return 0;\n }\n }", "protected function getIdentifier () {\n\t\n\t\tif (!isset($this->tableName)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$parts = explode(\"_\", $this->tableName);\n\t\t$finalPart = $parts[(count($parts) - 1)];\n\t\t\n\t\treturn substr($finalPart, 0, -1).\"ID\";\n\t\n\t}", "public function getSpaceIdByNameFromResponse(string $name): string {\n\t\t$space = $this->getSpaceByNameFromResponse($name);\n\t\tAssert::assertIsArray($space, \"Space with name $name not found\");\n\t\tif (!isset($space[\"id\"])) {\n\t\t\tthrow new Exception(__METHOD__ . \" space with name $name not found\");\n\t\t}\n\t\treturn $space[\"id\"];\n\t}", "public function getId(): string\n {\n return $this->name;\n }", "public function getStationByName($stationName){\n return $this->stationRequest->getStationByName($stationName);\n }", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier()\n {\n return $this->getAttribute('metadata.name', null);\n }", "public static function class2id($name) {\n $nameWithoutNumber = preg_replace('/\\d/', '', $name);\n if (!ctype_upper($nameWithoutNumber)) {\n $spacedWord = preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $name);\n $words = explode(' ', trim($spacedWord, ' '));\n $words[0] = strtolower($words[0]);\n $nameID = \"\";\n foreach ($words as $word) {\n $nameID .= $word;\n }\n } else {\n $nameID = $name;\n }\n return $nameID;\n }", "public static function nameToId($name) {\n return DB::queryFirstField(\"SELECT id FROM users WHERE username=%s \", $name);\n }", "public function get_workspace_id($workspace_name){\n \n $this->team->db->select('id');\n $this->team->db->where('name', $workspace_name);\n $workspace_pre = $this->team->db->get('workspaces');\n \n $workspace = $workspace_pre->result();\n \n $workspace_id = 0;\n if($workspace!=null){\n $workspace_id = $workspace[0]->id;\n }\n \n //echo \"END FUNCTION get_workspace_id(workspace_model) Workspaces_model.php<br />\";\n \n return $workspace_id;\n }" ]
[ "0.64477944", "0.64183456", "0.6276595", "0.62217396", "0.61974126", "0.5980914", "0.59624326", "0.59511644", "0.5909803", "0.59054863", "0.5901047", "0.5900353", "0.5878598", "0.5853307", "0.58530253", "0.5844175", "0.5843036", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.5837389", "0.58333063", "0.58169496", "0.5813583", "0.5813352" ]
0.7542614
0
Returns the list of all stock list contents
private function getStockListContents(): array { $list = $this->stocklistID; $this->db->select('i.eve_iditem as id, i.name as name, i.volume as vol'); $this->db->from('itemlist il'); $this->db->join('itemcontents ic', 'ic.itemlist_iditemlist = il.iditemlist'); $this->db->join('item i', 'i.eve_iditem = ic.item_eve_iditem'); $this->db->where('il.iditemlist', $list); $query = $this->db->get(); $result = $query->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read_stocks() {\n return $this->yahooStock->getQuotes();\n }", "public function view_list(){\n\t\treturn view(mProvider::$view_prefix.mProvider::$view_prefix_priv.'stock');\n\t}", "public function all() {\n $stmt = $this->pdo->query('SELECT id, symbol, company '\n . 'FROM stocks '\n . 'ORDER BY symbol');\n $stocks = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $stocks[] = [\n 'id' => $row['id'],\n 'symbol' => $row['symbol'],\n 'company' => $row['company']\n ];\n }\n return $stocks;\n }", "public function load_stocks() {\n\t\t\t$res = $this->Restaurant_model->loading_stocks();\n\t\t\techo $res;\n\t\t}", "public function getlistServiceAction()\n {\n $buzz = $this->container->get('buzz');\n\n $browser = $buzz->getBrowser('dolibarr');\n $response = $browser->get('/product/list/?api_key=712f3b895ada9274714a881c2859b617');\n\n $contentList = json_decode($response->getContent());\n\n return $contentList;\n }", "public function getList();", "public function getList();", "public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }", "public function index()\n {\n return Stock::get();\n }", "public function getList()\n {\n return $this->get(self::_LIST);\n }", "public function getItemsList(){\n return $this->_get(4);\n }", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function getList() {\n return $this->list;\n }", "public function listAll();", "public function listAll();", "public function list();", "public function list();", "public function list();", "public function getList() {\n\t\t\tif (is_null($this->arList)) $this->load(); \n\t\t\treturn $this->arList; \n\t\t}", "public function items() {\n return $this->list;\n }", "public function getList ()\n {\n return $this->_list;\n }", "public function getList()\n {\n return $this->_list;\n }", "public function getAll()\n {\n return $this->list;\n }", "public abstract function get_lists();", "public function getEntriesList(){\n return $this->_get(2);\n }", "public function getCreditmemoWarehouseList();", "public function getList()\r\n\t{\r\n\t\treturn $this->data;\r\n\t}" ]
[ "0.735539", "0.7155176", "0.7109039", "0.6581265", "0.6550308", "0.64300275", "0.64300275", "0.64100283", "0.64042234", "0.6404084", "0.6393538", "0.63809395", "0.63797426", "0.63797426", "0.63797426", "0.63650626", "0.6364002", "0.6364002", "0.63457245", "0.63457245", "0.63457245", "0.6339385", "0.6338746", "0.6334879", "0.6331526", "0.63208526", "0.6300608", "0.6273918", "0.62711215", "0.6266735" ]
0.7995536
0
Returns the region ID from the provided station
public function getRegionID(int $station_id): stdClass { $this->db->select('r.eve_idregion as id'); $this->db->from('region r'); $this->db->join('system sys', 'sys.region_eve_idregion = r.eve_idregion'); $this->db->join('station st', 'st.system_eve_idsystem = sys.eve_idsystem'); $this->db->where('st.eve_idstation', $station_id); $query = $this->db->get(); $result = $query->row(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getId_region()\n {\n if (!isset($this->iid_region) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_region;\n }", "public function getRegionId()\n {\n return $this->getShippingAddress()->getRegionId();\n }", "public function getStationID(string $station_name)\n {\n if (substr($station_name, 0, 11) === \"TRADE HUB: \") {\n $station_name = substr($station_name, 11);\n }\n\n $this->db->select('eve_idstation');\n $this->db->where('name', $station_name);\n $query = $this->db->get('station');\n\n if ($query->num_rows() != 0) {\n $result = $query->row();\n } else {\n $result = false;\n }\n\n return $result;\n }", "protected function resolveRegion()\n {\n return $this->address->hasData('region') ? 'region' : 'region_id';\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "function getRegion_stgr()\n {\n if (!isset($this->sregion_stgr) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion_stgr;\n }", "function get_region_id($link, $data) // Colorize: green\n { // Colorize: green\n return get_property_value($link, $data, \"region_id\"); // Colorize: green\n }", "public function getRegion()\n {\n return isset($this->region) ? $this->region : '';\n }", "public function getRegion(): string\n {\n return $this->result->region_name;\n }", "public static function region() {\n\t\treturn static::randomElement(static::$regionNames);\n\t}", "public function getSvrId()\n {\n return $this->get(self::_SVR_ID);\n }", "public static function getRegion()\n\t{\n\t\t$region = self::$region;\n\n\t\t// parse region from endpoint if not specific\n\t\tif (empty($region)) {\n\t\t\tif (preg_match(\"/s3[.-](?:website-|dualstack\\.)?(.+)\\.amazonaws\\.com/i\",self::$endpoint,$match) !== 0 && strtolower($match[1]) !== \"external-1\") {\n\t\t\t\t$region = $match[1];\n\t\t\t}\n\t\t}\n\n\t\treturn empty($region) ? 'us-east-1' : $region;\n\t}", "function getDatosId_region()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_region'));\n $oDatosCampo->setEtiqueta(_(\"id_region\"));\n $oDatosCampo->setTipo('ver');\n return $oDatosCampo;\n }", "public function getStateId();", "public function getStateId();", "public function getRegion() {\n\t\treturn $this->region;\n\t}", "public function getMainRegion($regionID) {\n\t if($regionID>0){\n\t foreach ($this->arRegions as $val){\n\t if($regionID==$val[\"GeoRegionId\"]){\n\t if( $val[\"GeoRegionType\"]==\"City\" || $val[\"GeoRegionType\"]==\"Village\" ) return $val[\"GeoRegionId\"];\n\t else {\n\t $cityReg=$this->getCityByRegion($val[\"GeoRegionId\"]);\n\t if($cityReg>0) return $cityReg;\n\t else return $val[\"GeoRegionId\"];\n\t }\n\t }\n\t }\n\t }\n\t else return 0;\n\t}", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "function get_segment_id() : string {\n\tif ( defined( 'ALTIS_SEGMENT_ID' ) ) {\n\t\treturn ALTIS_SEGMENT_ID;\n\t}\n\treturn SEGMENT_ID;\n}", "public function getRegionCode()\n {\n return $this->getShippingAddress()->getRegionCode();\n }", "protected function setStationID(){\n\t\t$result = array(\"ss_id\",\"ss_id\");\n\t\treturn $result;\n\t}", "protected function setStationID(){\n\t\t$result = array(\"ss_id\",\"ss_id\");\n\t\treturn $result;\n\t}", "private function whichStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\t$x = '';\n\t\t\tforeach ($stations as $st) {\n\t\t\t\tif (substr($st,0,1) == '1') {\n\t\t\t\t\t$x = substr($st,1);\n\t\t\t\t\t$x = explode(\" #\",$x);\n\t\t\t\t\t$x = $x[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x == '') {$x = Flight::get(\"defaultStation\");}\n\t\t}\n\t\telse $x = (Flight::get(\"defaultStation\"));\n\t\treturn trim($x);\n\t}", "function getSTID(){\n return $this->STID;\n }" ]
[ "0.6629912", "0.64900887", "0.61547905", "0.6060793", "0.59956", "0.59956", "0.585744", "0.5765551", "0.57334065", "0.5697013", "0.5693873", "0.56701523", "0.56606203", "0.56243885", "0.54742205", "0.54742205", "0.54712766", "0.5457892", "0.5449097", "0.5449097", "0.5449097", "0.5449097", "0.5449097", "0.5449097", "0.5442081", "0.54241973", "0.54184556", "0.54184556", "0.5400797", "0.53739417" ]
0.74810696
0
Returns the character name from an id
private function getCharacterName(int $id_character): string { $this->db->select('name'); $this->db->where('eve_idcharacter', $id_character); $query = $this->db->get('characters'); $result = $query->row()->name; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function get_name($id) {\r\n\t\t\tif (trim($id)=='') {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$all = self::get_all();\r\n\t\t\treturn $all[$id][0];\r\n\t\t}", "function getCharacter($id) {\n try {\n $item = $this->perform_query_one_param(\"SELECT name from characters WHERE id = ?\", \"i\", strval($id));\n return mysqli_fetch_array($item);\n } catch(Exception $ex) {\n $this->print_error_message(\"Error in getting Character by ID : \".$id);\n return null;\n }\n }", "static function getNameOf ($id)\n {\n return get (self::$NAMES, $id, false);\n }", "function getCharacter($id) {\n $conn = databaseConn();\n\n $query = $conn->prepare(\"SELECT * FROM characters WHERE id = :id\");\n $query->execute([':id' => $_GET['id']]);\n \n return $query->fetch();\n }", "function getNameFromId($id='') {\n\t\tif(!$id) return '';\n\t\t$result = $this->select('name',\"`store_id` = '\".$this->store_id.\"' AND id = '$id'\");\n\t\tif($result) return $result[0]['name'];\n\t\treturn '';\n\t}", "public static function get_character_by_id($id) {\n\t\t$result = DB::table('characters')\n\t\t\t\t->where('deleted', 0)\n\t\t\t\t->where('id', $id)\n\t\t\t\t->get();\n\n\t\treturn $result[0];\n\t}", "static function getName($id) {\n $campaign = self::get($id);\n if (count($campaign)>0) return $campaign['name'];\n return '';\n }", "function get_user_name_by_id($id = 0) {\r\n\r\n\t\t$field = 'name';\r\n\r\n\t\t$users = $this->users_model->get_users_by_id($id, $field);\r\n\r\n\t\t$result = $users['name'];\r\n\r\n\t\treturn $result;\r\n\r\n\t}", "static public function getNameById($id) {\n\t\t$mAction=new Maerdo_Model_Action();\n\t\t$result=$mAction->find($id);\n\t\treturn($result->name);\n\t}", "function dev_get_title_from_id( $id ) {\n\treturn ucwords( str_replace( array( '-', '_' ), ' ', $id ) );\n}", "function getUsername($id)\n{\n\tglobal $db;\n\n\t$ret = $db->query('select user_name from users where user_id=' . $id);\n\n\tif(count($ret) == 1)\n\t\treturn decode($ret[0]['user_name']);\n\telse\n\t\treturn '';\n}", "function getName($id){\n\t\tglobal $connection;\n\n\t\t$sql=\"SELECT * FROM users WHERE id='{$id}'\";\n\t\t$query=mysqli_query($connection, $sql);\n\t\t$name=NULL;\n\n\t\tif(mysqli_num_rows($query)==1){\n\t\t\twhile($row=mysqli_fetch_array($query)){\n\t\t\t\t$name=$row['name'];\n\t\t\t}\n\t\t}\n\t\treturn $name;\n\t}", "function entityName( $id ) ;", "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 getName($id)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['code'] == $id)\n\t\t\t\treturn $record['name'];\n\t\treturn null;\n\t}", "public static function getMemberName($id){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT first_name,last_name\n FROM member\n WHERE id = :id\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n\t}", "public static function get_category_name($id){\n $res = DB::select(DB_COLUMN_CATEGORY_NAME)\n ->from(DB_TABLE_CATEGORY)\n ->where(DB_COLUMN_CATEGORY_ID, $id)\n ->and_where(DB_COLUMN_CATEGORY_DELETE_FLAG, 0)\n ->execute();\n $arr = $res->as_array();\n return $arr[0][\"name\"];\n }", "function cat_id_to_name($id) {\r\n\tforeach((array)(get_categories()) as $category) {\r\n \tif ($id == $category->cat_ID) { return $category->cat_name; break; }\r\n\t}\r\n}", "public function _convertToNameFormat($id)\n\t{\n\t\treturn preg_replace('/\\.([A-Za-z0-9_\\-]+)/', '[$1]', $id);\n\t}", "public function getCustomerName(int $id): string {\n return \"Get customer name by id = {$id}\";\n }", "function display_player_name($id) {\n\t\n\tglobal $zurich;\n\t\n\t/* softbot's ids are preceded by * in the log; remove this */\n\tif ($id{0} == '*') {\n\t\t$robot = true;\n\t\t$id = substr($id, 1);\n\t}\n\telse $robot = false;\n\t\n\tswitch($id) {\n\t\tcase 'water_utility': $colour = \"#0000ff\"; break; /* blueberry */\n\t\tcase 'waste_water_utility': $colour = \"#804000\"; break; /* mocha */\n\t\tcase 'housing_assoc_1': $colour = \"#ff6666\"; break; /* salmon */\n\t\tcase 'housing_assoc_2': $colour = \"#800040\"; break; /* maroon */\n\t\tcase 'manufacturer_1': $colour = \"#808000\"; break; /* asparagus */\n\t\tcase 'manufacturer_2': $colour = \"#008040\"; break; /* moss */\n\t\tcase 'politician': $colour = \"#ff8000\"; break; /* tangerine */\n\t\tcase 'bank': $colour = \"#ff66cc\"; break; /* carnation */\n\t\tdefault: $colour = \"#000000\"; break; /* black */\n\t}\n\t\n\t/* translate between id and name for player ids */\n\tforeach ($zurich->players as $p) {\n\t\tif ($id == $p->id) {\n\t\t\t$name = $p->name;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!isset($name)) $name = $id;\n\tif ($robot) $name = strtolower($name);\n\t\t\n\treturn \"<font color=$colour>$name</font>\";\n}", "public function get_name( $id ){\n\t\t\n\t\t$term = get_term( $id , $this->get_slug() );\n\t\t\n\t\tif ( $term ){\n\t\t\t\n\t\t\treturn $term->name;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn '';\n\t\t\t\n\t\t} // end if\n\t\t\n\t}", "public function tag_name($id)\n\t{\n\t\treturn $this->connection()->get(\"element/$id/name\");\n\t}", "function getUserName($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['username'].\" \".$rs['usertype'];\n\t}\n\t$crud->disconnect();\n}", "public function getId(): string\n {\n return $this->name;\n }", "public static function getName($id)\n\t{\n\t\treturn FrontendModel::getDB()->getVar('SELECT tag FROM tags WHERE id = ?;', (int) $id);\n\t}", "public static function getName($id)\n {\n $n = DB::Aowow()->selectRow('\n SELECT\n t.name,\n l.*\n FROM\n item_template t,\n locales_item l\n WHERE\n t.entry = ?d AND\n t.entry = l.entry',\n $id\n );\n return Util::localizedString($n, 'name');\n }", "function getChallengeName($challenge_id) {\n $challenges = challenges();\n return $challenges[$challenge_id]['name'];\n}", "function getIdentifier();", "function getIdentifier();" ]
[ "0.7704027", "0.74475336", "0.7283829", "0.7243234", "0.7015801", "0.69534355", "0.69315755", "0.6859769", "0.6760725", "0.6686248", "0.66808677", "0.65932286", "0.6590633", "0.65726006", "0.65688515", "0.6528733", "0.65205944", "0.6519239", "0.65012133", "0.6500837", "0.64877886", "0.6482439", "0.6452809", "0.6404645", "0.6386228", "0.6370105", "0.6369811", "0.6361205", "0.6344939", "0.6344939" ]
0.79088765
0
Change the database collation. This tries to change the collation of the entire database, setting the default for newly created tables and columns. We have the reasonable expectation that this will fail on most live hosts.
private function changeDatabaseCollation($newCollation) { $db = $this->container->db; $collationParts = explode('_', $newCollation); $charset = $collationParts[0]; $dbName = $this->container->platform->getConfig()->get('db'); $this->query(sprintf( "ALTER DATABASE %s CHARACTER SET = %s COLLATE = %s", $db->qn($dbName), $charset, $newCollation )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myPear_set_collation(){\n $needed = False;\n if (!$needed) return;\n $c_set = 'utf8';\n $d_col = 'utf8_unicode_ci';\n myPear_db()->qquery(\"ALTER SCHEMA \".myPear_db()->Database.\" DEFAULT CHARACTER SET $c_set DEFAULT COLLATE $d_col\",True);\n foreach(myPear_db()->getTables() as $table){\n b_debug::xxx($table.\"------------------------------------------------\");\n myPear_db()->qquery(\"ALTER TABLE $table CONVERT TO CHARACTER SET $c_set COLLATE $d_col\",True);\n $q = myPear_db()->qquery(\"SHOW COLUMNS FROM $table\",cnf_dev);\n while($r = $this->next_record($q)){\n if (preg_match('/(char|text)/i',strToLower($r['Type']))){\n\tb_debug::xxx($r['Field']);\n\tmyPear_db()->qquery(sprintf(\"ALTER TABLE `%s` CHANGE `%s` `%s` %s CHARACTER SET $c_set COLLATE $d_col %s NULL\",\n\t\t\t\t $r['Field'],$r['Field'],$r['Type'],(strToLower($r['Null']) == 'yes' ? '' : 'NOT')),\n\t\t\t True);\n\t\n }\n }\n }\n}", "public function changeCollation($newCollation = 'utf8_general_ci')\n\t{\n\t\t// Make sure we have at least MySQL 4.1.2\n\t\t$db = $this->container->db;\n\t\t$old_collation = $db->getCollation();\n\n\t\tif ($old_collation == 'N/A (mySQL < 4.1.2)')\n\t\t{\n\t\t\t// We can't change the collation on MySQL versions earlier than 4.1.2\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change the collation of the database itself\n\t\t$this->changeDatabaseCollation($newCollation);\n\n\t\t// Change the collation of each table\n\t\t$tables = $db->getTableList();\n\n\t\t// No tables to convert...?\n\t\tif (empty($tables))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ($tables as $tableName)\n\t\t{\n\t\t\t$this->changeTableCollation($tableName, $newCollation);\n\t\t}\n\n\t\treturn true;\n\t}", "public function setDatabaseCharsetAndCollation($options = array()) {\n $sql = 'ALTER DATABASE `'. $this->_dbName .'`\n CHARACTER SET '. db::CHARSET .'\n COLLATE '. db::COLLATION;\n\n return $this->execute($sql, $options);\n }", "public function setCollation($var)\n {\n GPBUtil::checkString($var, True);\n $this->collation = $var;\n\n return $this;\n }", "private function getCharsetCollate() {\n global $wpdb;\n $this->charsetCollate = $wpdb->get_charset_collate();\n }", "private function changeTableCollation($tableName, $newCollation, $changeColumns = true)\n\t{\n\t\t$db = $this->container->db;\n\t\t$collationParts = explode('_', $newCollation);\n\t\t$charset = $collationParts[0];\n\n\t\t// Change the collation of the table itself.\n\t\t$this->query(sprintf(\n\t\t\t\"ALTER TABLE %s CONVERT TO CHARACTER SET %s COLLATE %s\",\n\t\t\t$db->qn($tableName),\n\t\t\t$charset,\n\t\t\t$newCollation\n\t\t));\n\n\t\t// Are we told not to bother with text columns?\n\t\tif (!$changeColumns)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert each text column\n\t\ttry\n\t\t{\n\t\t\t$columns = $db->getTableColumns($tableName, false);\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$columns = [];\n\t\t}\n\n\t\t// The table is broken or MySQL cannot report any columns for it. Early return.\n\t\tif (!is_array($columns) || empty($columns))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$modifyColumns = [];\n\n\t\tforeach ($columns as $col)\n\t\t{\n\t\t\t// Make sure we are redefining only columns which do support a collation\n\t\t\tif (empty($col->Collation))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$modifyColumns[] = sprintf(\"MODIFY COLUMN %s %s %s %s COLLATE %s\",\n\t\t\t\t$db->qn($col->Field),\n\t\t\t\t$col->Type,\n\t\t\t\t(strtoupper($col->Null) == 'YES') ? 'NULL' : 'NOT NULL',\n\t\t\t\tis_null($col->Default) ? '' : sprintf('DEFAULT %s', $db->q($col->Default)),\n\t\t\t\t$newCollation\n\t\t\t);\n\t\t}\n\n\t\t// No text columns to modify? Return immediately.\n\t\tif (empty($modifyColumns))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Issue an ALTER TABLE statement which modifies all text columns.\n\t\t$this->query(sprintf(\n\t\t\t'ALTER TABLE %s %s',\n\t\t\t$db->qn($tableName),\n\t\t\timplode(', ', $modifyColumns\n\t\t\t)));\n\t}", "public function getDbCollation()\r\n {\r\n return $this->db_collation;\r\n }", "function db_change_charset_for_tables($charset = 'utf8', $collate='utf8_general_ci', $data = true){ \n \n if(!trim($charset) || !trim($collate)){\n echo 'No charset selected';\n return;\n }\n \n $CI = &get_instance();\n $query_show_tables = 'SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE()';//'SHOW TABLES';\n $query_col_collation = 'SHOW FULL COLUMNS FROM %s';\n $tables = $CI->db->query($query_show_tables)->result();\n if(!empty($tables)){\n $CI->db->query(sprintf('SET foreign_key_checks = 0'));\n foreach($tables as $table){\n $table = (array) $table;\n if( isset($table['table_name']) && trim($table['table_name'])){\n $query_collation_generated = sprintf($query_col_collation, $table['table_name']);\n $result_before = $CI->db->query($query_collation_generated)->result();\n db_show_table_column_collations($result_before, $table['table_name']);\n $CI->db->query(sprintf('ALTER TABLE %s CONVERT TO CHARACTER SET '.$charset.' COLLATE '.$collate, $table['table_name']));\n $result_after = $CI->db->query($query_collation_generated)->result();\n db_show_table_column_collations($result_after, $table['table_name'], true);\n }\n }\n $CI->db->query(sprintf('SET foreign_key_checks = 1'));\n }\n \n}", "public function setCollation($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->collation !== $v) {\n $this->collation = $v;\n $this->modifiedColumns[BiblioTableMap::COL_COLLATION] = true;\n }\n\n return $this;\n }", "public function setDbCollation($db_collation)\r\n {\r\n $this->db_collation = $db_collation;\r\n\r\n return $this;\r\n }", "abstract protected function setCharset($charset, $collation);", "public function setCollate($collate)\n\t{\n\t\t$this->collate = $collate;\n\t}", "private function charset()\n\t{\n\t\tif (isset($this->_conf['charset']) AND $this->_conf['charset'] != '')\n\t\t{\n\t\t\tif (isset($this->_conf['collation']) AND $this->_conf['collation'] != '')\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset'].' COLLATE '.$this->_conf['collation']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset']);\n\t\t\t}\n\t\t}\n\t}", "public function setCollation($collation)\n {\n $collation = strtolower($collation);\n $charset = self::getCollationCharset($collation);\n if (is_null($charset)) {\n throw new RuntimeException(\"unknown collation '$collation'\");\n }\n if (!is_null($this->charset) &&\n $this->charset !== $charset\n ) {\n throw new RuntimeException(\"COLLATION '$collation' is not valid for CHARACTER SET '$charset'\");\n }\n $this->charset = $charset;\n $this->collation = $collation;\n }", "public function set_charset($dbh, $charset = \\null, $collate = \\null)\n {\n }", "public function alterCharset($table, $charset = 'utf8', $collation = 'utf8_unicode_ci', $execute = true) {\r\n\t\t$sql = 'ALTER TABLE ' . $table . ' MODIFY' . \"\\n\";\r\n\t\t$sql .= 'CHARACTER SET ' . $charset;\r\n\t\t$sql .= 'COLLATE ' . $collation;\r\n\t\tif ($execute) {\r\n\t\t\t$this->exec($sql);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function getDefaultCollation()\n {\n $collation = $this->config->get('database.preferred_collation');\n $collation = $this->normalizeCollation($collation);\n\n return $collation;\n }", "public function getCollation()\n {\n return $this->collation;\n }", "public function getCollation()\n {\n return $this->collation;\n }", "public function supports_collation()\n {\n }", "public function getCollation()\n\t{\n\t\treturn false;\n\t}", "public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSET character_set_client=utf8;\r\n\t\t\tSET character_set_results=utf8\" );\r\n\t}", "public static function determine_charset() {\n global $wpdb;\n $charset = '';\n\n if (!empty($wpdb->charset)) {\n $charset = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\n if (!empty($wpdb->collate)) {\n $charset .= \" COLLATE {$wpdb->collate}\";\n }\n }\n return $charset;\n }", "public function getCollation()\n\t{\n\t\treturn $this->charset;\n\t}", "public function getCollation()\n {\n return $this->options->collation;\n }", "public function testCollation()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->charset(null, 'utf8_ci');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'charset' => null,\n 'collate' => 'utf8_ci',\n ], $array);\n }", "public function get_charset_collate()\n {\n }", "public function convertTableCharsetAndCollation($table, $options = array()) {\n // mysql - postgresql\n $sql = 'ALTER TABLE `'. $table .'`\n CONVERT TO CHARACTER SET '. db::CHARSET .'\n COLLATE '. db::COLLATION;\n\n return $this->execute($sql, $options);\n }", "public function getCollationConnection()\r\n {\r\n return $this->collation_connection;\r\n }", "public function setCharset($charset, $collation)\n {\n // @todo - add support if needed\n return true;\n }" ]
[ "0.7151892", "0.650667", "0.6472632", "0.6377463", "0.62235487", "0.6222845", "0.6212017", "0.61897814", "0.61086476", "0.6026438", "0.5995577", "0.59861034", "0.5937779", "0.56593704", "0.5590652", "0.5557284", "0.55048525", "0.5492732", "0.5492732", "0.54765594", "0.5465356", "0.54519373", "0.5451702", "0.542365", "0.54205513", "0.54092366", "0.5359347", "0.52089655", "0.51899666", "0.5178149" ]
0.713068
1
Changes the collation of a table and its text columns
private function changeTableCollation($tableName, $newCollation, $changeColumns = true) { $db = $this->container->db; $collationParts = explode('_', $newCollation); $charset = $collationParts[0]; // Change the collation of the table itself. $this->query(sprintf( "ALTER TABLE %s CONVERT TO CHARACTER SET %s COLLATE %s", $db->qn($tableName), $charset, $newCollation )); // Are we told not to bother with text columns? if (!$changeColumns) { return; } // Convert each text column try { $columns = $db->getTableColumns($tableName, false); } catch (RuntimeException $e) { $columns = []; } // The table is broken or MySQL cannot report any columns for it. Early return. if (!is_array($columns) || empty($columns)) { return; } $modifyColumns = []; foreach ($columns as $col) { // Make sure we are redefining only columns which do support a collation if (empty($col->Collation)) { continue; } $modifyColumns[] = sprintf("MODIFY COLUMN %s %s %s %s COLLATE %s", $db->qn($col->Field), $col->Type, (strtoupper($col->Null) == 'YES') ? 'NULL' : 'NOT NULL', is_null($col->Default) ? '' : sprintf('DEFAULT %s', $db->q($col->Default)), $newCollation ); } // No text columns to modify? Return immediately. if (empty($modifyColumns)) { return; } // Issue an ALTER TABLE statement which modifies all text columns. $this->query(sprintf( 'ALTER TABLE %s %s', $db->qn($tableName), implode(', ', $modifyColumns ))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myPear_set_collation(){\n $needed = False;\n if (!$needed) return;\n $c_set = 'utf8';\n $d_col = 'utf8_unicode_ci';\n myPear_db()->qquery(\"ALTER SCHEMA \".myPear_db()->Database.\" DEFAULT CHARACTER SET $c_set DEFAULT COLLATE $d_col\",True);\n foreach(myPear_db()->getTables() as $table){\n b_debug::xxx($table.\"------------------------------------------------\");\n myPear_db()->qquery(\"ALTER TABLE $table CONVERT TO CHARACTER SET $c_set COLLATE $d_col\",True);\n $q = myPear_db()->qquery(\"SHOW COLUMNS FROM $table\",cnf_dev);\n while($r = $this->next_record($q)){\n if (preg_match('/(char|text)/i',strToLower($r['Type']))){\n\tb_debug::xxx($r['Field']);\n\tmyPear_db()->qquery(sprintf(\"ALTER TABLE `%s` CHANGE `%s` `%s` %s CHARACTER SET $c_set COLLATE $d_col %s NULL\",\n\t\t\t\t $r['Field'],$r['Field'],$r['Type'],(strToLower($r['Null']) == 'yes' ? '' : 'NOT')),\n\t\t\t True);\n\t\n }\n }\n }\n}", "function db_change_charset_for_tables($charset = 'utf8', $collate='utf8_general_ci', $data = true){ \n \n if(!trim($charset) || !trim($collate)){\n echo 'No charset selected';\n return;\n }\n \n $CI = &get_instance();\n $query_show_tables = 'SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE()';//'SHOW TABLES';\n $query_col_collation = 'SHOW FULL COLUMNS FROM %s';\n $tables = $CI->db->query($query_show_tables)->result();\n if(!empty($tables)){\n $CI->db->query(sprintf('SET foreign_key_checks = 0'));\n foreach($tables as $table){\n $table = (array) $table;\n if( isset($table['table_name']) && trim($table['table_name'])){\n $query_collation_generated = sprintf($query_col_collation, $table['table_name']);\n $result_before = $CI->db->query($query_collation_generated)->result();\n db_show_table_column_collations($result_before, $table['table_name']);\n $CI->db->query(sprintf('ALTER TABLE %s CONVERT TO CHARACTER SET '.$charset.' COLLATE '.$collate, $table['table_name']));\n $result_after = $CI->db->query($query_collation_generated)->result();\n db_show_table_column_collations($result_after, $table['table_name'], true);\n }\n }\n $CI->db->query(sprintf('SET foreign_key_checks = 1'));\n }\n \n}", "public function convertTableCharsetAndCollation($table, $options = array()) {\n // mysql - postgresql\n $sql = 'ALTER TABLE `'. $table .'`\n CONVERT TO CHARACTER SET '. db::CHARSET .'\n COLLATE '. db::COLLATION;\n\n return $this->execute($sql, $options);\n }", "public function setCollate($collate)\n\t{\n\t\t$this->collate = $collate;\n\t}", "public function alterCharset($table, $charset = 'utf8', $collation = 'utf8_unicode_ci', $execute = true) {\r\n\t\t$sql = 'ALTER TABLE ' . $table . ' MODIFY' . \"\\n\";\r\n\t\t$sql .= 'CHARACTER SET ' . $charset;\r\n\t\t$sql .= 'COLLATE ' . $collation;\r\n\t\tif ($execute) {\r\n\t\t\t$this->exec($sql);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "private function getCharsetCollate() {\n global $wpdb;\n $this->charsetCollate = $wpdb->get_charset_collate();\n }", "public function testCollation()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->charset(null, 'utf8_ci');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'charset' => null,\n 'collate' => 'utf8_ci',\n ], $array);\n }", "public function setBinaryCollation()\n {\n $this->isBinaryCollation = true;\n }", "public function get_charset_collate()\n {\n }", "abstract protected function setCharset($charset, $collation);", "private function charset()\n\t{\n\t\tif (isset($this->_conf['charset']) AND $this->_conf['charset'] != '')\n\t\t{\n\t\t\tif (isset($this->_conf['collation']) AND $this->_conf['collation'] != '')\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset'].' COLLATE '.$this->_conf['collation']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset']);\n\t\t\t}\n\t\t}\n\t}", "public function supports_collation()\n {\n }", "protected function collate(Table $table, Magic $column)\n {\n // TODO: Beberapa tipe kolom (seperti char, enum, set) belum didukung oleh rakit.\n // saat ini dukungan masih terbatas pada tipe kolom yang berbasis teks.\n if (in_array($column->type, ['string', 'text']) && $column->collate) {\n return ' CHARACTER SET ' . $column->collate;\n }\n }", "function set_content_columns($table_name) {\n\t\t\t$this->content_columns = $this->content_columns_all = self::$db->table_info($table_name);\n\t\t\t$table_name_i18n = $table_name.$this->i18n_table_suffix;\n\n\t\t\tif($this->is_i18n && self::$db->table_exists($table_name_i18n)) {\n\t\t\t\t$reserved_columns = $this->i18n_reserved_columns;\n\t\t\t\t$this->content_columns_i18n = $i18n_columns = self::$db->table_info($table_name_i18n);\n\t\t\t\t$this->content_columns_all = array_merge($this->content_columns, $i18n_columns);\n\n\t\t\t\tforeach($i18n_columns as $key => $col) {\n\t\t\t\t\tif(in_array($col['name'], $reserved_columns)) {\n\t\t\t\t\t\tunset($i18n_columns[$key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->i18n_column_names[] = $col['name'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->i18n_table = $table_name_i18n;\n\t\t\t} else {\n\t\t\t\t$this->is_i18n = false;\n\t\t\t}\n\t\t}", "protected function getTableCollation(Connection $connection, $table, &$definition) {\n // Remove identifier quotes from the table name. See\n // \\Drupal\\mysql\\Driver\\Database\\mysql\\Connection::$identifierQuotes.\n $table = trim($connection->prefixTables('{' . $table . '}'), '\"');\n $query = $connection->query(\"SHOW TABLE STATUS WHERE NAME = :table_name\", [':table_name' => $table]);\n $data = $query->fetchAssoc();\n\n // Map the collation to a character set. For example, 'utf8mb4_general_ci'\n // (MySQL 5) or 'utf8mb4_0900_ai_ci' (MySQL 8) will be mapped to 'utf8mb4'.\n [$charset] = explode('_', $data['Collation'], 2);\n\n // Set `mysql_character_set`. This will be ignored by other backends.\n $definition['mysql_character_set'] = $charset;\n }", "private function changeDatabaseCollation($newCollation)\n\t{\n\t\t$db = $this->container->db;\n\t\t$collationParts = explode('_', $newCollation);\n\t\t$charset = $collationParts[0];\n\t\t$dbName = $this->container->platform->getConfig()->get('db');\n\n\t\t$this->query(sprintf(\n\t\t\t\"ALTER DATABASE %s CHARACTER SET = %s COLLATE = %s\",\n\t\t\t$db->qn($dbName),\n\t\t\t$charset,\n\t\t\t$newCollation\n\t\t));\n\t}", "public function changeCollation($newCollation = 'utf8_general_ci')\n\t{\n\t\t// Make sure we have at least MySQL 4.1.2\n\t\t$db = $this->container->db;\n\t\t$old_collation = $db->getCollation();\n\n\t\tif ($old_collation == 'N/A (mySQL < 4.1.2)')\n\t\t{\n\t\t\t// We can't change the collation on MySQL versions earlier than 4.1.2\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change the collation of the database itself\n\t\t$this->changeDatabaseCollation($newCollation);\n\n\t\t// Change the collation of each table\n\t\t$tables = $db->getTableList();\n\n\t\t// No tables to convert...?\n\t\tif (empty($tables))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ($tables as $tableName)\n\t\t{\n\t\t\t$this->changeTableCollation($tableName, $newCollation);\n\t\t}\n\n\t\treturn true;\n\t}", "public function setDatabaseCharsetAndCollation($options = array()) {\n $sql = 'ALTER DATABASE `'. $this->_dbName .'`\n CHARACTER SET '. db::CHARSET .'\n COLLATE '. db::COLLATION;\n\n return $this->execute($sql, $options);\n }", "public function getCollation()\n\t{\n\t\treturn false;\n\t}", "private function _convertContentToUTF($prefix, $table)\n {\n\n try {\n $query = 'SET NAMES latin1';\n $this->_db->getConnection()->exec($query);\n\n }catch (\\Exception $e) {\n Analog::log(\n 'Cannot SET NAMES on table `' . $table . '`. ' .\n $e->getMessage(),\n Analog::ERROR\n );\n }\n\n try {\n $select = new \\Zend_Db_Select($this->_db);\n $select->from($table);\n\n $result = $select->query();\n\n $descr = $this->_db->describeTable($table);\n\n $pkeys = array();\n foreach ( $descr as $field ) {\n if ( $field['PRIMARY'] == 1 ) {\n $pos = $field['PRIMARY_POSITION'];\n $pkeys[$pos] = $field['COLUMN_NAME'];\n }\n }\n\n if ( count($pkeys) == 0 ) {\n //no primary key! How to do an update without that?\n //Prior to 0.7, l10n and dynamic_fields tables does not\n //contains any primary key. Since encoding conversion is done\n //_before_ the SQL upgrade, we'll have to manually\n //check these ones\n if (preg_match('/' . $prefix . 'dynamic_fields/', $table) !== 0 ) {\n $pkeys = array(\n 'item_id',\n 'field_id',\n 'field_form',\n 'val_index'\n );\n } else if ( preg_match('/' . $prefix . 'l10n/', $table) !== 0 ) {\n $pkeys = array(\n 'text_orig',\n 'text_locale'\n );\n } else {\n //not a know case, we do not perform any update.\n throw new \\Exception(\n 'Cannot define primary key for table `' . $table .\n '`, aborting'\n );\n }\n }\n\n $r = $result->fetchAll();\n foreach ( $r as $row ) {\n $data = array();\n $where = array();\n\n //build where\n foreach ( $pkeys as $k ) {\n $where[] = $k . ' = ' . $this->_db->quote($row->$k);\n }\n\n //build data\n foreach ( $row as $key => $value ) {\n $data[$key] = $value;\n }\n\n //finally, update data!\n $this->_db->update(\n $table,\n $data,\n $where\n );\n }\n } catch (\\Exception $e) {\n Analog::log(\n 'An error occured while converting contents to UTF-8 for table ' .\n $table . ' (' . $e->getMessage() . ')',\n Analog::ERROR\n );\n }\n }", "public function getDbCollation()\r\n {\r\n return $this->db_collation;\r\n }", "abstract protected function encodingTables();", "public function setCollation($var)\n {\n GPBUtil::checkString($var, True);\n $this->collation = $var;\n\n return $this;\n }", "public function set_charset($dbh, $charset = \\null, $collate = \\null)\n {\n }", "public function getCollation()\n\t{\n\t\treturn $this->charset;\n\t}", "public function getCollation()\n {\n return $this->collation;\n }", "public function getCollation()\n {\n return $this->collation;\n }", "public function setCollation($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->collation !== $v) {\n $this->collation = $v;\n $this->modifiedColumns[BiblioTableMap::COL_COLLATION] = true;\n }\n\n return $this;\n }", "function convert_utf8($echo_results = false)\n\t{\n\t\tglobal $db, $dbname, $table_prefix;\n\n\t\t$db->sql_return_on_error(true);\n\n\t\t$sql = \"ALTER DATABASE {$db->sql_escape($dbname)}\n\t\t\tCHARACTER SET utf8\n\t\t\tDEFAULT CHARACTER SET utf8\n\t\t\tCOLLATE utf8_bin\n\t\t\tDEFAULT COLLATE utf8_bin\";\n\t\t$db->sql_query($sql);\n\n\t\t$sql = \"SHOW TABLES\";\n\t\t$result = $db->sql_query($sql);\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t// This assignment doesn't work...\n\t\t\t//$table = $row[0];\n\n\t\t\t$current_item = each($row);\n\t\t\t$table = $current_item['value'];\n\t\t\treset($row);\n\n\t\t\t$sql = \"ALTER TABLE {$db->sql_escape($table)}\n\t\t\t\tDEFAULT CHARACTER SET utf8\n\t\t\t\tCOLLATE utf8_bin\";\n\t\t\t$db->sql_query($sql);\n\n\t\t\tif (!empty($echo_results))\n\t\t\t{\n\t\t\t\techo(\"&bull;&nbsp;Table&nbsp;<b style=\\\"color: #dd2222;\\\">$table</b> converted to UTF-8<br />\\n\");\n\t\t\t}\n\n\t\t\t$sql = \"SHOW FIELDS FROM {$db->sql_escape($table)}\";\n\t\t\t$result_fields = $db->sql_query($sql);\n\n\t\t\twhile ($row_fields = $db->sql_fetchrow($result_fields))\n\t\t\t{\n\t\t\t\t// These assignments don't work...\n\t\t\t\t/*\n\t\t\t\t$field_name = $row_fields[0];\n\t\t\t\t$field_type = $row_fields[1];\n\t\t\t\t$field_null = $row_fields[2];\n\t\t\t\t$field_key = $row_fields[3];\n\t\t\t\t$field_default = $row_fields[4];\n\t\t\t\t$field_extra = $row_fields[5];\n\t\t\t\t*/\n\n\t\t\t\t$field_name = $row_fields['Field'];\n\t\t\t\t$field_type = $row_fields['Type'];\n\t\t\t\t$field_null = $row_fields['Null'];\n\t\t\t\t$field_key = $row_fields['Key'];\n\t\t\t\t$field_default = $row_fields['Default'];\n\t\t\t\t$field_extra = $row_fields['Extra'];\n\n\t\t\t\t// Let's remove BLOB and BINARY for now...\n\t\t\t\t//if ((strpos(strtolower($field_type), 'char') !== false) || (strpos(strtolower($field_type), 'text') !== false) || (strpos(strtolower($field_type), 'blob') !== false) || (strpos(strtolower($field_type), 'binary') !== false))\n\t\t\t\tif ((strpos(strtolower($field_type), 'char') !== false) || (strpos(strtolower($field_type), 'text') !== false))\n\t\t\t\t{\n\t\t\t\t\t//$sql_fields = \"ALTER TABLE {$db->sql_escape($table)} CHANGE \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_type) . \" CHARACTER SET utf8 COLLATE utf8_bin\";\n\n\t\t\t\t\t$sql_fields = \"ALTER TABLE {$db->sql_escape($table)} CHANGE \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_type) . \" CHARACTER SET utf8 COLLATE utf8_bin \" . (($field_null != 'YES') ? \"NOT \" : \"\") . \"NULL DEFAULT \" . (($field_default != 'None') ? ((!empty($field_default) || !is_null($field_default)) ? (is_string($field_default) ? (\"'\" . $db->sql_escape($field_default) . \"'\") : $field_default) : (($field_null != 'YES') ? \"''\" : \"NULL\")) : \"''\");\n\t\t\t\t\t$db->sql_query($sql_fields);\n\n\t\t\t\t\tif (!empty($echo_results))\n\t\t\t\t\t{\n\t\t\t\t\t\techo(\"\\t&nbsp;&nbsp;&raquo;&nbsp;Field&nbsp;<b style=\\\"color: #4488aa;\\\">$field_name</b> (in table <b style=\\\"color: #009900;\\\">$table</b>) converted to UTF-8<br />\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($echo_results))\n\t\t\t{\n\t\t\t\techo(\"<br />\\n\");\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\n\t\t$db->sql_return_on_error(false);\n\t\treturn true;\n\t}", "public function modifyTable() {\n $table = $this->getTable();\n\n $table->addColumn([\n 'name' => $this->getParameter('table_column'),\n 'type' => 'VARCHAR'\n ]);\n }" ]
[ "0.7225204", "0.64697546", "0.63308394", "0.62432265", "0.611616", "0.59739697", "0.59668046", "0.58810216", "0.5865719", "0.5856473", "0.58330935", "0.5819369", "0.5788201", "0.57836914", "0.56409466", "0.56126976", "0.5595682", "0.55862087", "0.557636", "0.55612856", "0.5530835", "0.53785765", "0.5371444", "0.5352284", "0.5345891", "0.5327567", "0.5327567", "0.5299112", "0.5235607", "0.52040166" ]
0.6970929
1
Here we we can map our mockup to our hotels mapper class
protected function setUp() { $this->hotelMapperService = new HotelMapperService(); $this->jsonHotels = json_encode($this->getHotelsRequestExample()); $this->mappedHotels = $this->hotelMapperService->mapJsonToHotels($this->jsonHotels); $this->sort = new Sort($this->mappedHotels); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testFormatHotelData(){\n $reflection = new \\ReflectionClass(get_class($this->advertiserA));\n $data = $this->mockResponseA();\n $method = $reflection->getMethod('formatHotelData');\n $method->setAccessible(true);\n $result = $method->invokeArgs($this->advertiserA, [\n $data['hotels']\n ]);\n\n $roomMappers = $result[0]->getRooms();\n $taxMappers = $roomMappers[0]->getTaxes();\n $this->assertContainsOnlyInstancesOf(HotelMapper::class, $result);\n $this->assertContainsOnlyInstancesOf(RoomMapper::class, $roomMappers);\n $this->assertContainsOnlyInstancesOf(TaxMapper::class, $taxMappers);\n }", "public function setUp()\n\t{\t\t\n\t\t$this->postMapper = phpDataMapper_TestHelper::mapper('Blogs', 'PostMapper');\n\t\t$this->dogMapper = phpDataMapper_TestHelper::mapper('Dogs', 'DogMapper');\n\t}", "function setUp() {\n\n $this->oResolver= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter());\n $aMap=array();\n $oL0ClassOne=&new layer0\\ClassOne(\" <b>Text Passed to The Instance created manually layer0->ClassOne</b>\");\n $aMap['layer2\\ClassOne']=&$oL0ClassOne;\n //$this->oResolverWithMap= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter(),);\n\n }", "abstract protected function defineMapping();", "protected abstract function map();", "public function __construct() {\n // Replaced two mappers with the MapperAspect\n //$this->userCatalogMapper = new UserCatalogMapper();\n //$this->electronicCatalogMapper = new ElectronicCatalogMapper();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public function __construct($hotel)\n {\n $this->hotel = $hotel;\n }", "public function getHotels(): Collection;", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "abstract public function map($data);", "public function run()\n {\n $hotels = [\n [\n 'name' => 'Hemus',\n 'location' => 'Vraca',\n 'description' => ' Luxurious hotel.',\n 'image' => 'https://q-cf.bstatic.com/images/hotel/max1024x768/177/177875901.jpg'\n ],\n [\n 'name' => 'Body M-Travel',\n 'location' => 'Vraca',\n 'description' => ' New hotel.',\n 'image' => 'https://q-cf.bstatic.com/images/hotel/max1024x768/930/93023850.jpg'\n ],\n [\n 'name' => 'Hotel Leva',\n 'location' => 'Vraca',\n 'description' => 'New luxurious hotel.',\n 'image' => 'https://r-cf.bstatic.com/images/hotel/max1024x768/147/147985319.jpg'\n ]\n ];\n\n foreach ($hotels as $hotel) {\n Hotel::create(array(\n 'name' => $hotel['name'],\n 'location' => $hotel['location'],\n 'description' => $hotel['description'],\n 'image' => $hotel['image']\n ));\n }\n }", "public function initOverworldGlitches() {\n\t\t$this->locations[\"Brewery\"]->setRequirements(function($locations, $items) {\n\t\t\treturn $items->has('MoonPearl');\n\t\t});\n\n\t\t$this->locations[\"Hammer Pegs\"]->setRequirements(function($locations, $items) {\n\t\t\treturn $items->has('Hammer') && $items->has('MoonPearl')\n\t\t\t\t&& ($items->canLiftDarkRocks()\n\t\t\t\t\t|| ($items->has('PegasusBoots')\n\t\t\t\t\t\t&& $this->world->getRegion('North East Dark World')->canEnter($locations, $items)));\n\t\t});\n\n\t\t$this->locations[\"Bumper Cave\"]->setRequirements(function($locations, $items) {\n\t\t\treturn $items->has('MoonPearl')\n\t\t\t\t&& ($items->has('PegasusBoots')\n\t\t\t\t\t\t|| ($items->canLiftRocks() && $items->has('Cape')));\n\t\t});\n\n\t\t$this->locations[\"Blacksmith\"]->setRequirements(function($locations, $items) {\n\t\t\treturn $items->has('MoonPearl') && $items->canLiftDarkRocks();\n\t\t});\n\n\t\t$this->locations[\"Purple Chest\"]->setRequirements(function($locations, $items) {\n\t\t\treturn $locations[\"Blacksmith\"]->canAccess($items)\n\t\t\t\t&& ($items->has(\"MoonPearl\")\n\t\t\t\t\t&& ($items->canLiftDarkRocks()\n\t\t\t\t\t\t|| ($items->has('PegasusBoots')\n\t\t\t\t\t\t\t&& $this->world->getRegion('North East Dark World')->canEnter($locations, $items))));\n\t\t});\n\n\t\t$this->can_enter = function($locations, $items) {\n\t\t\treturn $items->has('RescueZelda')\n\t\t\t\t&& (($items->has('MoonPearl')\n\t\t\t\t\t&& ($items->canLiftDarkRocks()\n\t\t\t\t\t\t|| ($items->has('Hammer') && $items->canLiftRocks())\n\t\t\t\t\t\t|| ($items->has('DefeatAgahnim') && $items->has('Hookshot')\n\t\t\t\t\t\t\t\t&& ($items->has('Hammer') || $items->canLiftRocks() || $items->has('Flippers')))))\n\t\t\t\t\t|| (($items->has('MagicMirror') || ($items->has('PegasusBoots') && $items->has('MoonPearl')))\n\t\t\t\t\t\t&& $this->world->getRegion('West Death Mountain')->canEnter($locations, $items)));\n\t\t};\n\n\t\treturn $this;\n\t}", "protected function set_mappers() {\n\t\t//Simple product mapping\n\t\t$this->generator->addMapper(\n\t\t\tfunction (\n\t\t\t\tarray $sf_product, \\ShoppingFeed\\Feed\\Product\\Product $product\n\t\t\t) {\n\t\t\t\t$sf_product = reset( $sf_product );\n\t\t\t\t/** @var Product $sf_product */\n\t\t\t\t$product->setReference( $sf_product->get_sku() );\n\t\t\t\t$product->setName( $sf_product->get_name() );\n\t\t\t\t$product->setPrice( $sf_product->get_price() );\n\n\t\t\t\tif ( ! empty( $sf_product->get_ean() ) ) {\n\t\t\t\t\t$product->setGtin( $sf_product->get_ean() );\n\t\t\t\t}\n\n\t\t\t\t$product->setQuantity( $sf_product->get_quantity() );\n\n\t\t\t\tif ( ! empty( $sf_product->get_link() ) ) {\n\t\t\t\t\t$product->setLink( $sf_product->get_link() );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $sf_product->get_discount() ) ) {\n\t\t\t\t\t$product->addDiscount( $sf_product->get_discount() );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $sf_product->get_image_main() ) ) {\n\t\t\t\t\t$product->setMainImage( $sf_product->get_image_main() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_full_description() ) || ! empty( $sf_product->get_short_description() ) ) {\n\t\t\t\t\t$product->setDescription( $sf_product->get_full_description(), $sf_product->get_short_description() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_brand_name() ) ) {\n\t\t\t\t\t$product->setBrand( $sf_product->get_brand_name(), $sf_product->get_brand_link() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_weight() ) ) {\n\t\t\t\t\t$product->setWeight( $sf_product->get_weight() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_category_name() ) ) {\n\t\t\t\t\t$product->setCategory( $sf_product->get_category_name(), $sf_product->get_category_link() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_attributes() ) ) {\n\t\t\t\t\t$product->setAttributes( $sf_product->get_attributes() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_shipping_methods() ) ) {\n\t\t\t\t\tforeach ( $sf_product->get_shipping_methods() as $shipping_method ) {\n\t\t\t\t\t\t$product->addShipping( $shipping_method['cost'], $shipping_method['description'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$images = $sf_product->get_images();\n\t\t\t\tif ( ! empty( $images ) ) {\n\t\t\t\t\t$product->setAdditionalImages( $sf_product->get_images() );\n\t\t\t\t}\n\n\t\t\t\t$extra_fields = $sf_product->get_extra_fields();\n\t\t\t\tif ( ! empty( $extra_fields ) ) {\n\t\t\t\t\tforeach ( $extra_fields as $field ) {\n\t\t\t\t\t\tif ( empty( $field['name'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$product->setAttribute( $field['name'], $field['value'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t);\n\n\t\t//Product with variations mapping\n\t\t$this->generator->addMapper(\n\t\t\tfunction (\n\t\t\t\tarray $sf_product, \\ShoppingFeed\\Feed\\Product\\Product $product\n\t\t\t) {\n\t\t\t\t$sf_product = reset( $sf_product );\n\t\t\t\t/** @var Product $sf_product */\n\n\t\t\t\tif ( empty( $sf_product->get_variations() ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach ( $sf_product->get_variations() as $sf_product_variation ) {\n\t\t\t\t\t$variation = $product->createVariation();\n\n\t\t\t\t\t$variation\n\t\t\t\t\t\t->setReference( $sf_product_variation['sku'] )\n\t\t\t\t\t\t->setPrice( $sf_product_variation['price'] )\n\t\t\t\t\t\t->setQuantity( $sf_product_variation['quantity'] )\n\t\t\t\t\t\t->setGtin( $sf_product_variation['ean'] );\n\n\t\t\t\t\tif ( ! empty( $sf_product_variation['attributes'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->setAttributes( $sf_product_variation['attributes'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $sf_product_variation['discount'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->addDiscount( $sf_product_variation['discount'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $sf_product_variation['image_main'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->setMainImage( $sf_product_variation['image_main'] );\n\t\t\t\t\t}\n\t\t\t\t\t$variation_images = $sf_product->get_variation_images( $sf_product_variation['id'] );\n\t\t\t\t\tif ( ! empty( $variation_images ) ) {\n\t\t\t\t\t\t$variation->setAdditionalImages( $variation_images );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "abstract protected function getMapping();", "abstract protected function getMapping();", "function __construct() {\n $this->map = array();\n }", "public function getDataMapper() {}", "abstract protected function buildMap();", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n $hotel_types = HotelType::all();\n $company_ids = Company::pluck('id')->all();\n\n foreach ($company_ids as $company_id)\n {\n $num_hotels = $faker->numberBetween(1,4);\n\n for ($i = 0; $i < $num_hotels; ++$i)\n {\n Hotel::create([\n 'company_id' => $company_id,\n 'type_id' => $hotel_types[$faker->numberBetween($min = 0, $max = sizeof($hotel_types) - 1)]->id,\n 'name' => $faker->company(),\n 'country' => $faker->country(),\n 'city' => $faker->city(),\n 'address' => $faker->address(),\n 'postal' => $faker->postcode(),\n 'phone' => $faker->phoneNumber(),\n 'fax' => $faker->phoneNumber(),\n 'email' => $faker->companyEmail(),\n 'rating' => ($faker->numberBetween($min = 0, $max = 50) / 10),\n 'longitude' => $faker->longitude(),\n 'latitude' => $faker->latitude(),\n ]);\n }\n }\n }", "public function __construct() {\n\t\t$this\n\t\t\t->calculateMaxTargets()\n\t\t\t->generateMap()\n\t\t\t->populateMap();\n\t}", "function __construct() {\n\t\t$this->map_data = array();\n\t}", "public function testMap2()\n\t{\n\t\tTestReflection::invoke($this->_state, 'set', 'content.type', 'tag');\n\t\t$a = TestReflection::invoke($this->_instance, 'map', 1, array(5), true);\n\t\t$this->assertEquals(true, $a);\n\n\t\tTestReflection::invoke($this->_state, 'set', 'tags.content_id', '1');\n\t\t$actual = TestReflection::invoke($this->_instance, 'getList');\n\n\t\t$this->assertEquals(1, count($actual));\n\t}", "private function setup() {\n foreach($this->fighters as $i => $fighter) {\n $this->fighters[$i]->instance_id = $i;\n $this->fighter_current = $this->fighters[$i];\n if(!$fighter->abilities) {\n }\n else {\n foreach($fighter->abilities as $ability) {\n if($ability->type == 'passive') {\n $this->useAbility($ability->name);\n }\n }\n }\n }\n $this->fighter_current = $this->fighters[0];\n //TODO: decide start user here\n }", "public function map($mapper);", "public function setUp()\n {\n parent::setUp();\n \n $this->mapper = app()->make(Mapper::class);\n }", "public function testBuildHotel()\n {\n $dbo = new SqlStorage();\n $hotel = new Hotel($dbo);\n $hotel->buildHotel();\n $rooms = new Room($dbo);\n $this->assertCount(4, $rooms->listAllRooms());\n }", "public function autopapperTest($mapper) {\n// $product->setName(\"proudct name\");\n// $product->setFirstname(\"firstname\");\n// $product->setLastname(\"\");\n// $product->setPrice(\"123\");\n //$mapper = new mapper();\n //$product = $this->provider->Product()->find('58aef52f29c39f1413000029');\n// $product->setName(\"proudct name\");\n// get mapper\n // $mapper = $this->container->get('bcc_auto_mapper.mapper');\n// create default map\n $mapper->createMap('AppBundle\\Document\\Profile', 'AppBundle\\Shared\\DTO\\ProductDTO');\n\n// create objects\n $source = new Product();\n $source->firstname = 'Symfony2 developer';\n $destination = new ProductDTO();\n\n// map\n $mapper->map($source, $destination);\n\n echo $destination->description; // outputs 'Symfony2 developer'\n\n exit;\n\n $user = $this->repoProvider->Users()->find($dto->id);\n $this->repoProvider->flush(MapperHelper::getMapper()->dtoToDoc($dto, $user));\n }", "public function getMapping() {}", "public function testMap()\n {\n $subTotalExBonus = $this->salaryRowRepository->getSubTotalPerDayExclBonusBySalaryId(1);\n $subTotalBonus = $this->salaryRowRepository->getSubTotalPerDayBonusBySalaryId(1);\n $subTotalInclBonus = $this->salaryRowRepository->getSubTotalPerDayInclBonusBySalaryId(1);\n\n $salary = SalaryModelMapper::toModelWithSubTotal(\n $this->salaryModel,\n $subTotalExBonus,\n $subTotalBonus,\n $subTotalInclBonus\n );\n\n $this->assertInstanceOf(Collection::class, $salary->getSalaryDays());\n $this->assertInstanceOf(SalaryDayModel::class, $salary->getSalaryDays()->first());\n }" ]
[ "0.5979853", "0.57950884", "0.5720932", "0.56167114", "0.5592526", "0.5438802", "0.52496123", "0.52102596", "0.5202684", "0.51782334", "0.5174611", "0.5173758", "0.5150398", "0.5135128", "0.5122902", "0.5122902", "0.51078624", "0.5074306", "0.505704", "0.50191903", "0.50061023", "0.4937992", "0.49298695", "0.4925899", "0.49173915", "0.48929086", "0.48726845", "0.4871073", "0.48651105", "0.48575795" ]
0.6036583
0
Here we we test our response's structure and type when we sort by name
public function testSortByName() { $result=$this->sort->sortByName(); $result = $this->hotelMapperService->serialize($result); $this->assertInternalType('array',$result); foreach ($result as $i => $hotel) { $this->assertGreaterThan($result[$i+1]['name'],$hotel['name']); $this->assertArrayHasKey('name', $hotel); $this->assertArrayHasKey('price', $hotel); $this->assertArrayHasKey('city', $hotel); $this->assertArrayHasKey('availability', $hotel); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sort_response($response_data)\n\t{\n\t\tasort($response_data);\n\t\treturn $response_data;\n\t}", "public function testOrderBy(): void\n {\n $request = new Request([\n 'orderBy' => 'status',\n ]);\n\n $this->assertEquals(['status', 'asc'], $request->orderBy());\n\n $request = new Request([]);\n $this->assertEquals(['id', 'asc'], $request->orderBy());\n\n $request = new Request([\n 'orderBy' => 'vehicle:owner.status',\n ]);\n\n $this->assertEquals(['vehicle', 'owner.status'], $request->orderBy());\n }", "public function testCategoryNameSorting()\n {\n echo \"\\n testCategoryNameSorting...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category/cell_process/Name/asc/0/10000\";\n $response = $this->curl_get($url);\n //echo $response;\n $result = json_decode($response);\n if(isset($result->error))\n {\n echo \"\\nError in testCategoryNameSorting\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n {\n $this->assertTrue(false);\n }\n }", "public function testFromOkResponse() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(Response::fromQueriedRecords(null, $bob));\n foreach ($result as $object) {\n $this->assertInstanceOf(SalesforceObject::class, $object);\n }\n\n $first = $result->first();\n $this->assertInstanceOf(SalesforceObject::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }", "public function testResponseGet()\n {\n $result = json_decode($this->body, true);\n\n $this->assertEquals($this->response->get('Model'), $result['Model']);\n $this->assertEquals($this->response->get('RequestId'), $result['RequestId']);\n $this->assertEquals($this->response->get('Inexistence'), null);\n $this->assertEquals($this->response->get('Inexistence', 'Inexistence'), 'Inexistence');\n }", "public function testWithSortListPost($name, $order)\n {\n $response = $this->jsonUser('GET', '/api/users/posts?sort='.$name);\n $data = json_decode($response->getContent());\n $arrayDesc = Post::orderBy($order, 'desc')->pluck($name)->toArray();\n for ($i = 1; $i <= 20; $i++) {\n $this->assertEquals($data->data[$i - 1]->$name, $arrayDesc[$i - 1]) ;\n }\n }", "public function testSuccessfulGetSortAttendants()\n {\n for ($i = 10000; $i < 10003; $i++) {\n $this->createData($i, '138000' . $i, 1);\n }\n for ($i = 10000; $i < 10003; $i++) {\n factory(Vote::class)->create([\n 'voter' => '138009' . $i,\n 'type' => Vote::TYPE_APP,\n 'user_id' => $i,\n ]);\n }\n $this->createData(10004, '13800010004', 0);\n $this->ajaxGet('/wap/' . self::ROUTE_PREFIX . '/approved/sort/list?page=1')\n ->seeJsonContains([\n 'code' => 0,\n ]);\n $result = json_decode($this->response->getContent(), true);\n $this->assertEquals(1, $result['pages']);\n $this->assertCount(3, $result['attendants']);\n }", "public function testPaginationAndESSorting()\n {\n $response = Article::search('*', [\n 'sort' => [\n 'title',\n ],\n ]);\n\n /*\n * Just so it's clear these are in the expected title order,\n */\n $this->assertEquals([\n 'Fast black dogs',\n 'Quick brown fox',\n 'Swift green frogs',\n ], $response->map(function ($a) {\n return $a->title;\n })->all());\n\n /* Response can be used as an array (of the results) */\n $response = $response->perPage(1)->page(2);\n\n $this->assertEquals(1, count($response));\n\n $this->assertInstanceOf(Result::class, $response[0]);\n\n $article = $response[0];\n $this->assertEquals('Quick brown fox', $article->title);\n\n $this->assertEquals('<ul class=\"pagination\">'.\n '<li><a href=\"/?page=1\" rel=\"prev\">&laquo;</a></li> '.\n '<li><a href=\"/?page=1\">1</a></li>'.\n '<li class=\"active\"><span>2</span></li>'.\n '<li><a href=\"/?page=3\">3</a></li> '.\n '<li><a href=\"/?page=3\" rel=\"next\">&raquo;</a></li>'.\n '</ul>', $response->render());\n\n $this->assertEquals(3, $response->total());\n $this->assertEquals(1, $response->perPage());\n $this->assertEquals(2, $response->currentPage());\n $this->assertEquals(3, $response->lastPage());\n }", "function _sortbyName($a, $b) \n {\n return(strcasecmp($a[\"name\"], $b[\"name\"]));\n }", "public function testParseResponse() {\n $data = $this->dl->parseResponse($this->sampleData, \"JSON\");\n $this->assertion($data['zip'], \"37931\", \"Parsed zip should equal 37931.\");\n $this->assertion($data['conditions'], \"clear sky\", \"Parsed conditions should equal clear sky.\");\n $this->assertion($data['pressure'], \"1031\", \"Parsed pressure should equal 1031.\");\n $this->assertion($data['temperature'], \"35\", \"Parsed temperature should equal 35.\");\n $this->assertion($data['windDirection'], \"ESE\", \"Parsed wind direction should equal ESE.\");\n $this->assertion($data['windSpeed'], \"1.06\", \"Parsed wind speed should equal 1.06.\");\n $this->assertion($data['humidity'], \"80\", \"Parsed humidity should equal 80.\");\n $this->assertion($data['timestamp'], \"1518144900\", \"Parsed timestamp should equal 1518144900.\");\n }", "function it_receives_the_expected_response_when_looking_up_all_templates() {\n $response = $this->listTemplates();\n\n $response->shouldHaveKey('templates');\n $response['templates']->shouldBeArray();\n\n $templates = $response['templates'];\n $total_notifications_count = count($templates->getWrappedObject());\n\n for( $i = 0; $i < $total_notifications_count; $i++ ) {\n\n $template = $templates[$i];\n\n $template->shouldBeArray();\n $template->shouldHaveKey( 'id' );\n $template->shouldHaveKey( 'name' );\n $template->shouldHaveKey( 'type' );\n $template->shouldHaveKey( 'created_at' );\n $template->shouldHaveKey( 'updated_at' );\n $template->shouldHaveKey( 'created_by' );\n $template->shouldHaveKey( 'version' );\n $template->shouldHaveKey( 'body' );\n $template->shouldHaveKey( 'subject' );\n $template->shouldHaveKey( 'letter_contact_block' );\n\n $template['id']->shouldBeString();\n $template['created_at']->shouldBeString();\n $template['created_by']->shouldBeString();\n $template['version']->shouldBeInteger();\n $template['body']->shouldBeString();\n\n $template['type']->shouldBeString();\n $template_type = $template['type']->getWrappedObject();\n\n if ( $template_type == \"sms\" ) {\n $template['subject']->shouldBeNull();\n $template['letter_contact_block']->shouldBeNull();\n\n } elseif ( $template_type == \"email\") {\n $template['subject']->shouldBeString();\n $template['letter_contact_block']->shouldBeNull();\n\n } elseif ( $template_type == \"letter\") {\n $template['subject']->shouldBeString();\n $template['letter_contact_block']->shouldBeString();\n\n }\n }\n\n }", "public function testSortByPrice()\n {\n $result=$this->sort->sortByPrice();\n $result = $this->hotelMapperService->serialize($result);\n $this->assertInternalType('array',$result);\n foreach ($result as $i => $hotel) {\n var_dump($hotel['price']);die;\n $this->assertGreaterThan($result[$i+1]['price'],$hotel['price']);\n $this->assertArrayHasKey('name', $hotel);\n $this->assertArrayHasKey('price', $hotel);\n $this->assertArrayHasKey('city', $hotel);\n $this->assertArrayHasKey('availability', $hotel);\n } \n }", "public function testResultGetFieldNames()\n {\n \t$this->assertEquals(array('id', 'key', 'title', 'status'), $this->conn->query('SELECT * FROM test')->getFieldNames());\n \t$this->assertEquals(array('id', 'title'), $this->conn->query('SELECT id, title FROM test')->getFieldNames(), \"Only id, title\");\n \t$this->assertEquals(array('id', 'idTest', 'title', 'subtitle'), $this->conn->query('SELECT child.id, child.idTest, title, subtitle FROM test INNER JOIN child ON test.id = child.idTest')->getFieldNames());\n }", "public function testGetList_SortingLimit()\n\t{\n\t\t$this->object->Save();\n\t\t$newObject1 = new object(\"efg\");\n\t\t$newObject2 = new object(\"abc\");\n\t\t$newObject3 = new object(\"d\");\n\n\t\t$newObject1->Save();\n\t\t$newObject2->Save();\n\t\t$newObject3->Save();\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", true, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"abc\", $objectList[0]->attribute);\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", false, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"obj att\", $objectList[0]->attribute);\n\t\t$this->assertEquals(\"efg\", $objectList[1]->attribute);\n\t}", "public function testGetAllNames()\n {\n $map = $this->driver->getAllNames();\n $this->assertCount(1, $map);\n $types = array(\n 'http://rdfs.org/sioc/ns#Post' => 'Test\\\\Midgard\\\\CreatePHP\\\\Model',\n );\n $this->assertEquals($types, $map);\n }", "public function testSort()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEmpty($obj_query->getSorts());\n $obj_query->sort('a', 'b');\n $this->assertEquals([['a', 'b']], $obj_query->getSorts());\n $obj_query2 = $obj_query->sort('c', 'd');\n $this->assertEquals([['a', 'b'],['c', 'd']], $obj_query->getSorts());\n $this->assertSame($obj_query, $obj_query2);\n }", "public function testAbook()\n {\n\n // $this->assertTrue(true);\n $response= $this->json ('post','/books',['name'=> 'MyHeroAcademiaVOL.2']);\n\n $response ->assertStatus(200)\n -> assertJson ([\n 'created'=>true\n ]);\n\n $response1= $this->json ('post','/books',['name'=> 'Samurai Champloo VOL.1']);\n\n $response1 ->assertStatus(200)\n -> assertJson ([\n 'created'=>true\n ]);\n\n $response2= $this->json ('post','/books',['name'=> 'Attack On Titan VOL.6']);\n\n $response2 ->assertStatus(200)\n -> assertJson ([\n 'created'=>true\n ]);\n\n $response3= $this->json ('post','/books',['name'=> 'Kimetsu No Yaiba VOL.4']);\n\n $response3 ->assertStatus(200)\n -> assertJson ([\n 'created'=>true\n ]);\n\n\n }", "function thrive_dashboard_get_thrive_products($type = '', $sort = true)\n{\n $products = array();\n\n $response = wp_remote_get(THRIVE_DASHBOARD_PRODUCTS_URL, array('sslverify' => false));\n if (is_wp_error($response)) {\n return $products;\n }\n\n $products = json_decode($response['body']);\n if ($type != '') {\n foreach ($products as $key => $product) {\n if ($product->type != $type) {\n unset($products[$key]);\n }\n }\n }\n\n if ($sort == true) {\n usort($products, function ($a, $b) {\n return strcasecmp($a->name, $b->name);\n });\n }\n\n return $products;\n}", "public function byName($name) {\n\t\tif (strlen ( $name ) > 0) {\n\t\t\t$name = strtolower ( $name );\n\t\t\tif (stripos ( $name, ',' ) !== false) {\n\t\t\t\t$name = explode ( ',', $name );\n\t\t\t}\n\t\t\tif ($this->getNamespace ()) {\n\t\t\t\tif ($this->isReadable ()) {\n\t\t\t\t\t\n\t\t\t\t\t$aResponsePre = $this->renderMeta ( $this->oMetas->getAll ( $this->oMetavalue ) );\n\t\t\t\t\t$aResponsePost = false;\n\t\t\t\t\tforeach ( $aResponsePre as $sKey => $meta ) {\n\t\t\t\t\t\tif (! is_array ( $name )) {\n\t\t\t\t\t\t\tif ($sKey === $name) {\n\t\t\t\t\t\t\t\t$aResponsePost [$sKey] = $meta;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (in_array ( $sKey, $name )) {\n\t\t\t\t\t\t\t\t$aResponsePost [$sKey] = $meta;\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\t\n\t\t\t\t\t$this->addEntry ( 'response', array ('metas' => $aResponsePost ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'NAMESPACE_NOT_FOUND' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'Nothing to search for' ) );\n\t\t}\n\t\treturn $this->getResponse ();\n\t}", "abstract function parse_api_response();", "protected function _getSortType() {}", "protected function _getSortType() {}", "public function testSortingOrder()\n {\n $this->request = new Request([\n 'sEcho' => 13,\n 'iDisplayStart' => 11,\n 'iDisplayLength' => 103,\n 'iColumns' => 1, // will be ignored, the column number is already set on the server side\n 'sSearch' => 'fooBar',\n 'bRegex' => true,\n 'bSearchable_0' => true, // will be ignored, the configuration is already set on the server side\n 'sSearch_0' => 'fooBar_1',\n 'bRegex_0' => true, // will be ignored, the configuration is already set on the server side\n 'bSortable_0' => true, // will be ignored, the configuration is already set on the server side\n 'iSortingCols' => 2,\n 'iSortCol_0' => 1,\n 'sSortDir_0' => 'desc',\n 'iSortCol_1' => 0,\n 'sSortDir_1' => 'desc',\n ]);\n\n $this->parser = new Datatable19QueryParser($this->request);\n\n $column = ColumnConfigurationBuilder::create()\n ->name(\"id\")\n ->build();\n\n $column1 = ColumnConfigurationBuilder::create()\n ->name(\"name\")\n ->build();\n\n $conf = $this->parser->parse($this->request, [$column, $column1]);\n\n // assert column order\n $this->assertCount(2, $conf->orderColumns());\n $def = $conf->orderColumns()[0];\n $this->assertSame('name', $def->columnName());\n $this->assertFalse($def->isAscending());\n }", "public function responseType ();", "function sortServerInfo($a, $b)\r\n{\r\n\tif($a['name'] == \"Unrecognized Game\" && $b['name'] == \"Unrecognized Game\")\r\n\t{\r\n\t\treturn sortByLocationAndPort($a, $b);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif($a['name'] == \"Unrecognized Game\") return 1;\r\n\t\tif($b['name'] == \"Unrecognized Game\") return -1;\r\n\t}\r\n\r\n\tif($a['name'] == $b['name'])\r\n\t{\r\n\t\treturn sortByLocationAndPort($a, $b);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif($a['name'] > $b['name']) return 1;\r\n\t\tif($a['name'] < $b['name']) return -1;\r\n\t}\r\n\treturn 0;\r\n}", "function cmp_by_name($val1, $val2){\n return strcmp($val1->name, $val2->name);\n}", "public function testProcessResponse()\n\t{\n\t\t$response = new JHttpResponse;\n\t\t$response->code = 200;\n\t\t$response->body = \"<ListAllMyBucketsResult xmlns=\\\"http://s3.amazonaws.com/doc/2006-03-01/\\\">\"\n\t\t\t. \"<Owner><ID>6e887773574284f7e38cacbac9e1455ecce62f79929260e9b68db3b84720ed96</ID>\"\n\t\t\t. \"<DisplayName>alex.ukf</DisplayName></Owner><Buckets><Bucket><Name>jgsoc</Name>\"\n\t\t\t. \"<CreationDate>2013-06-29T10:29:36.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>\";\n\t\t$expectedResult = new SimpleXMLElement($response->body);\n\n\t\t$this->assertThat(\n\t\t\t$this->object->processResponse($response),\n\t\t\t$this->equalTo($expectedResult)\n\t\t);\n\t}", "public function testListCars(){\n $cars = Car::orderBy(\"created_at\", \"desc\")->with(\"type\", \"brand\", \"owner\")->get();\n $response = $this->json(\"GET\", \"/cars\");\n $response->assertJsonFragment($cars->first()->toArray());\n $response->assertStatus(200);\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->response = new Response(200, [], '[{\n \"cik\" : \"0001067983\",\n \"name\" : \" BERKSHIRE HATHAWAY\"\n }, {\n \"cik\" : \"0000949012\",\n \"name\" : \" BERKSHIRE ASSET MANAGEMENT LLC/PA \"\n }, {\n \"cik\" : \"0000949012\",\n \"name\" : \" BERKSHIRE ASSET MANAGEMENT INC/PA \"\n }, {\n \"cik\" : \"0001133742\",\n \"name\" : \" BERKSHIRE CAPITAL HOLDINGS\"\n }, {\n \"cik\" : \"0001535172\",\n \"name\" : \" Berkshire Money Management, Inc. \"\n }, {\n \"cik\" : \"0001067983\",\n \"name\" : \"BERKSHIRE HATHAWAY\"\n }, {\n \"cik\" : \"0001312988\",\n \"name\" : \"Berkshire Partners LLC\"\n }, {\n \"cik\" : \"0001133742\",\n \"name\" : \"BERKSHIRE CAPITAL HOLDINGS\"\n }, {\n \"cik\" : \"0000949012\",\n \"name\" : \"BERKSHIRE ASSET MANAGEMENT LLC/PA\"\n }, {\n \"cik\" : \"0001535172\",\n \"name\" : \"Berkshire Money Management, Inc.\"\n }, {\n \"cik\" : \"0001831984\",\n \"name\" : \"Berkshire Bank\"\n }, {\n \"cik\" : \"0001831984\",\n \"name\" : \"BERKSHIRE HATHAWAY\"\n }]');\n\n $this->client = $this->setupMockedClient($this->response);\n }", "abstract protected function _getSortType();" ]
[ "0.5780222", "0.5760177", "0.5757209", "0.57431144", "0.5592697", "0.55461377", "0.55292994", "0.5500212", "0.54605204", "0.5422834", "0.5372241", "0.5362019", "0.5351873", "0.5344494", "0.53215086", "0.53190184", "0.5294356", "0.5271464", "0.5239272", "0.523155", "0.5207087", "0.5207087", "0.5204179", "0.5202844", "0.5201068", "0.51859564", "0.517934", "0.5178643", "0.5170585", "0.5164083" ]
0.6412094
0
Here we we test our response's structure and type when we sort by price
public function testSortByPrice() { $result=$this->sort->sortByPrice(); $result = $this->hotelMapperService->serialize($result); $this->assertInternalType('array',$result); foreach ($result as $i => $hotel) { var_dump($hotel['price']);die; $this->assertGreaterThan($result[$i+1]['price'],$hotel['price']); $this->assertArrayHasKey('name', $hotel); $this->assertArrayHasKey('price', $hotel); $this->assertArrayHasKey('city', $hotel); $this->assertArrayHasKey('availability', $hotel); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSortByPrice()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setPrice(1.1);\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setPrice(2.2);\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setPrice(0.1);\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_PRICE);\n\n $this->assertEquals($item3, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item2, $sorted[2]);\n }", "function thrive_dashboard_get_thrive_products($type = '', $sort = true)\n{\n $products = array();\n\n $response = wp_remote_get(THRIVE_DASHBOARD_PRODUCTS_URL, array('sslverify' => false));\n if (is_wp_error($response)) {\n return $products;\n }\n\n $products = json_decode($response['body']);\n if ($type != '') {\n foreach ($products as $key => $product) {\n if ($product->type != $type) {\n unset($products[$key]);\n }\n }\n }\n\n if ($sort == true) {\n usort($products, function ($a, $b) {\n return strcasecmp($a->name, $b->name);\n });\n }\n\n return $products;\n}", "function sortWithMoneyAndAlph($a, $b)\n{\n $aPrice = $a[\"price\"];\n $bPrice = $b[\"price\"];\n if (is_numeric($aPrice) and is_numeric($bPrice)) {\n $diff = $aPrice- $bPrice;\n } elseif (is_numeric($aPrice)) {\n $diff= 1; //only a is a nmber\n } else {\n $diff = -1; //only b is a number\n }\n\n\n $moneyRank = priceSort($a, $b);\n if ($diff == 0) {\n return critterNameSort($a, $b);\n }\n return $moneyRank;\n}", "public function getSortedItems($type)\n\t{\n\t\t$sorted = array();\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\t$sorted[($item->price * 100)] = $item;\n\t\t}\n\t\treturn ksort($sorted, SORT_NUMERIC);\n\t}", "public function testPaginationAndESSorting()\n {\n $response = Article::search('*', [\n 'sort' => [\n 'title',\n ],\n ]);\n\n /*\n * Just so it's clear these are in the expected title order,\n */\n $this->assertEquals([\n 'Fast black dogs',\n 'Quick brown fox',\n 'Swift green frogs',\n ], $response->map(function ($a) {\n return $a->title;\n })->all());\n\n /* Response can be used as an array (of the results) */\n $response = $response->perPage(1)->page(2);\n\n $this->assertEquals(1, count($response));\n\n $this->assertInstanceOf(Result::class, $response[0]);\n\n $article = $response[0];\n $this->assertEquals('Quick brown fox', $article->title);\n\n $this->assertEquals('<ul class=\"pagination\">'.\n '<li><a href=\"/?page=1\" rel=\"prev\">&laquo;</a></li> '.\n '<li><a href=\"/?page=1\">1</a></li>'.\n '<li class=\"active\"><span>2</span></li>'.\n '<li><a href=\"/?page=3\">3</a></li> '.\n '<li><a href=\"/?page=3\" rel=\"next\">&raquo;</a></li>'.\n '</ul>', $response->render());\n\n $this->assertEquals(3, $response->total());\n $this->assertEquals(1, $response->perPage());\n $this->assertEquals(2, $response->currentPage());\n $this->assertEquals(3, $response->lastPage());\n }", "public function testRetrieveTheProductList(): void\n {\n $response = $this->request('GET', '/api/products');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(10, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('name', $json[$key]);\n $this->assertArrayHasKey('description', $json[$key]);\n $this->assertArrayHasKey('price', $json[$key]);\n $this->assertArrayHasKey('priceWithTax', $json[$key]);\n $this->assertArrayHasKey('category', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['category']);\n $this->assertArrayHasKey('name', $json[$key]['category']);\n $this->assertArrayHasKey('tax', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['tax']);\n $this->assertArrayHasKey('name', $json[$key]['tax']);\n $this->assertArrayHasKey('value', $json[$key]['tax']);\n $this->assertArrayHasKey('images', $json[$key]);\n foreach ($json[$key]['images'] as $image) {\n $this->assertArrayHasKey('id', $image);\n $this->assertArrayHasKey('fileName', $image);\n $this->assertArrayHasKey('mimeType', $image);\n }\n $this->assertArrayHasKey('updatedAt', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]);\n } \n }", "public function testFilterByTitle2()\n {\n $response = $this->runApp('GET', '/v1/products?q=tremblay&password=' . $this->apiPassword);\n\n $this->assertEquals(StatusCode::HTTP_OK, $response->getStatusCode());\n $sJson = '[{\"id\":\"12\",\"title\":\"tremblay.com\",\"brand\":\"dolorem\",\"price\":\"94953540.00\",\"stock\":\"4\"}]';\n $result = (array)json_decode($response->getBody())->result;\n\n $this->assertEquals(json_decode($sJson), $result);\n }", "function sortLowToHigh($a, $b)\n{\n return $a->price < $b->price ? -1 : 1; //Compare the prices, evalutes to true\n // return $a->price > $b->price ? 1 : -1; // Gives the same result\n}", "function sortByPrice($a, $b) { \n return $a['menor_valor'] - $b['menor_valor'];\n}", "public function testSortByName()\n {\n $result=$this->sort->sortByName();\n $result = $this->hotelMapperService->serialize($result);\n $this->assertInternalType('array',$result);\n foreach ($result as $i => $hotel) {\n $this->assertGreaterThan($result[$i+1]['name'],$hotel['name']);\n $this->assertArrayHasKey('name', $hotel);\n $this->assertArrayHasKey('price', $hotel);\n $this->assertArrayHasKey('city', $hotel);\n $this->assertArrayHasKey('availability', $hotel);\n }\n }", "public function testGetOrdersWithCorrectParams()\n {\n echo \"\\n ***** Valid test - param value (page=4 and limit=2) - should get 200 ***** \\n \";\n $params = '{\"origin\": [\"-33.865143\",\"151.209900\"], \"destination\": [\"-37.663712\",\"144.844788\"]}';\n $params = json_decode($params, true);\n $response = $this->json('POST', '/orders', $params);\n \n $params = '{\"origin\": [\"-33.865143\",\"151.209900\"], \"destination\": [\"-37.663712\",\"144.844788\"]}';\n $params = json_decode($params, true);\n $response = $this->json('POST', '/orders', $params);\n \n $params = 'page=1&limit=2';\n $response = $this->json('GET', '/orders?'.$params);\n $response_data = $response->getContent();\n $response->assertStatus(200);\n\n echo \"\\n ***** Valid test - Number or count of response should be less than 2 - should get 200 ***** \\n \";\n $this->assertLessThan(3, count($response_data));\n \n echo \"\\n ***** Valid test - Get Order - Response should contain id, distance and status keys only ***** \\n\";\n $response_data = json_decode($response_data);\n\n foreach ($response_data as $order) {\n $order = (array) $order;\n $this->assertArrayHasKey('id', $order);\n $this->assertArrayHasKey('distance', $order);\n $this->assertArrayHasKey('status', $order);\n }\n }", "function sort_requests_by_total($a, $b)\n{\n if($a->total == $b->total) return 0;\n return ($a->total > $b->total) ? -1 : 1;\n}", "function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function testGetPriceBucketsUsingGET()\n {\n }", "function getPrice($id,$rdvtype){\r global $bdd;\r\r $req4=$bdd->prepare(\"select * from packs where idpack=? \");\r $req4->execute(array($id));\r while($ar = $req4->fetch()){\r if($rdvtype == 'visio'){return $ar['prvisio'];}else if($rdvtype == 'public'){return $ar['prpublic'];}else if($rdvtype == 'domicile'){return $ar['prdomicile'];}\r }\r\r return 200;\r}", "public function testGetAllProducts()\n {\n $response = $this->get('/api/history');\n $response->assertStatus(200);\n\n $content = $response->json();\n $this->assertIsArray($content, \"Response of get all histories are not array response\");\n\n if (is_array($content)){\n if (count($content)){\n $asserts = [\n \"id\" => \"assertIsInt\",\n \"product_id\" => \"assertIsInt\",\n \"price\" => \"assertIsInt\",\n \"previous_balance\" => \"assertIsInt\",\n \"movement\" => \"assertIsInt\",\n \"final_balance\" => \"assertIsInt\",\n \"created_at\" => \"assertIsString\",\n \"updated_at\" => \"assertIsString\",\n \"product_name\" => \"assertIsString\"\n ];\n foreach ($asserts as $index => $assert) {\n $this->assertArrayHasKey($index, $content[0], \"Product does not have {$index} attribute\");\n $this->{$assert}($content[0][$index], \"Product {$index} is cant {$assert}\");\n }\n }\n }\n }", "public function responseFromApiProductsByGETIsJSON()\n {\n $response = $this->get('api/products');\n $this->assertThat($response->content(), $this->isJson());\n }", "abstract function getPriceFromAPI($pair);", "public function getPricing() : array\n {\n $data = $this->fetchJson();\n $result = [];\n\n foreach ($data['fuel']['types'] as $fuelType) {\n if (!in_array($fuelType['name'], $this->types)) {\n continue;\n }\n\n $result[] = [\n 'name' => $fuelType['name'],\n 'price' => $fuelType['price'] * 100\n ] ;\n }\n\n return $result;\n }", "private static function formatAndSortResult(&$result)\n {\n if (!is_array($result)) {\n return $result;\n }\n\n $result['formatedPrivateDataList'] = array();\n\n // Parse list of private data and create key/value association instead of classic key/value list\n if (isset($result['privateDataList']) && is_array($result['privateDataList']) && isset($result['privateDataList']['privateData']) && is_array($result['privateDataList']['privateData'])) {\n foreach ($result['privateDataList']['privateData'] as $k => $v) {\n if (is_array($v) && isset($v['key']) && isset($v['value'])) {\n $result['formatedPrivateDataList'][$v['key']] = $v['value'];\n }\n }\n }\n\n // Parse list of billing record and add a calculated_status column\n if (isset($result['billingRecordList']) && is_array($result['billingRecordList']) && isset($result['billingRecordList']['billingRecord']) && is_array($result['billingRecordList']['billingRecord'])) {\n foreach ($result['billingRecordList']['billingRecord'] as &$billingRecord) {\n $billingRecord['calculated_status'] = $billingRecord['status'];\n if ($billingRecord['status'] != 2 && isset($billingRecord['result']) && (!PaylinePaymentGateway::isValidResponse($billingRecord, self::$approvedResponseCode) || !PaylinePaymentGateway::isValidResponse($billingRecord, self::$pendingResponseCode))) {\n $billingRecord['calculated_status'] = 2;\n }\n }\n }\n\n // Sort associatedTransactionsList by date, latest first (not done by the API)\n if (isset($result['associatedTransactionsList']) && isset($result['associatedTransactionsList']['associatedTransactions']) && is_array($result['associatedTransactionsList']['associatedTransactions'])) {\n uasort($result['associatedTransactionsList']['associatedTransactions'], function ($a, $b) {\n if (self::getTimestampFromPaylineDate($a['date']) == self::getTimestampFromPaylineDate($b['date'])) {\n return 0;\n } elseif (self::getTimestampFromPaylineDate($a['date']) > self::getTimestampFromPaylineDate($b['date'])) {\n return -1;\n } else {\n return 1;\n }\n });\n }\n\n // Sort statusHistoryList by date, latest first (not done by the API)\n if (isset($result['statusHistoryList']) && isset($result['statusHistoryList']['statusHistory']) && is_array($result['statusHistoryList']['statusHistory'])) {\n uasort($result['statusHistoryList']['statusHistory'], function ($a, $b) {\n if (self::getTimestampFromPaylineDate($a['date']) == self::getTimestampFromPaylineDate($b['date'])) {\n return 0;\n } elseif (self::getTimestampFromPaylineDate($a['date']) > self::getTimestampFromPaylineDate($b['date'])) {\n return -1;\n } else {\n return 1;\n }\n });\n }\n\n return $result;\n }", "public function testListCars(){\n $cars = Car::orderBy(\"created_at\", \"desc\")->with(\"type\", \"brand\", \"owner\")->get();\n $response = $this->json(\"GET\", \"/cars\");\n $response->assertJsonFragment($cars->first()->toArray());\n $response->assertStatus(200);\n }", "private function getOrders()\n {\n $OD = $this->dbclient->coins->OwnOrderBook;\n\n $ownOrders = $OD->find(\n array('$or'=>\n array(array('Status'=>'buying'), array('Status'=>'selling'))\n ));\n\n $output = ' {\n \"success\" : true,\n \"message\" : \"\",\n \"result\" : [';\n foreach ($ownOrders as $ownOrder) {\n\n if ($ownOrder) {\n if ($ownOrder->Status == 'buying' or $ownOrder->Status == 'selling') {\n $uri = $this->baseUrl . 'public/getorderbook';\n $params['market'] = $ownOrder->MarketName;\n if ($ownOrder->Status == 'buying') {\n $params['type'] = 'sell';\n $params['uuid'] = $ownOrder->BuyOrder->uuid;\n $limit = 'buy';\n } elseif ($ownOrder->Status == 'selling') {\n $params['type'] = 'buy';\n $params['uuid'] = $ownOrder->SellOrder->uuid;\n $limit = 'sell';\n }\n\n if (!empty($params)) {\n $uri .= '?' . http_build_query($params);\n }\n\n $sign = hash_hmac('sha512', $uri, $this->apiSecret);\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign: ' . $sign));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $answer = json_decode($result);\n $success = false;\n $quantity = 0;\n $rate = 0;\n\n if ($answer->success == true) {\n $closest_rate = $answer->result[0]->Rate;\n\n if ($ownOrder->Status == 'buying' && $ownOrder->BuyOrder->Rate >= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if ($ownOrder->Status == 'selling' && $ownOrder->SellOrder->Rate <= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if (!$success) {\n $output = $output.'{\n \"AccountId\" : null,\n \"OrderUuid\" : \"' . $params['uuid'] . '\",\n \"Exchange\" : \"' . $params['market'] . '\",\n \"Type\" : \"LIMIT_' . strtoupper($limit) . '\",\n \"Quantity\" : ' . $quantity . ',\n \"QuantityRemaining\" : 0.00000000,\n \"Limit\" : 0.00000001,\n \"Reserved\" : 0.00001000,\n \"ReserveRemaining\" : 0.00001000,\n \"CommissionReserved\" : 0.00000002,\n \"CommissionReserveRemaining\" : 0.00000002,\n \"CommissionPaid\" : 0.00000000,\n \"Price\" : ' . $rate . ',\n \"PricePerUnit\" : ' . $closest_rate . ',\n \"Opened\" : \"2014-07-13T07:45:46.27\",\n \"Closed\" : null,\n \"IsOpen\" : true,\n \"Sentinel\" : \"6c454604-22e2-4fb4-892e-179eede20972\",\n \"CancelInitiated\" : false,\n \"ImmediateOrCancel\" : false,\n \"IsConditional\" : false,\n \"Condition\" : \"NONE\",\n \"ConditionTarget\" : null\n },';\n\n }\n }\n }\n }\n }\n $output = rtrim($output, ',').']\n}';\n return $output;\n }", "public function sort_response($response_data)\n\t{\n\t\tasort($response_data);\n\t\treturn $response_data;\n\t}", "public function testGetItemsByType()\n\t{\n\t\t$items = self::$items->getItemsByType(\\ElectronicItem\\ElectronicItem::ELECTRONIC_ITEM_CONSOLE);\n\t\t$this->assertSame(350.98, $items[0]->getPrice());\n\t\t$this->assertSame(80, $items[0]->getExtrasPrice());\n\t}", "public function getPrices()\n {\n }", "public function test_getAllVehicleTest()\n {\n $response = $this->get('/api/inventory/vehicles/search');\n\n $response->assertStatus(200);\n $response->assertJson ([\n 'data'=>[[\n \"name\"=>$response['data'][0]['name'],\n \"model\"=>$response['data'][0]['model'],\n \"manufacturer\"=> $response['data'][0]['count'],\n \"cost_in_credits\" =>$response['data'][0]['cost_in_credits'],\n \"length\"=>$response['data'][0]['length'],\n \"max_atmosphering_speed\"=> $response['data'][0]['max_atmosphering_speed'],\n \"crew\"=> $response['data'][0]['crew'],\n \"passengers\"=>$response['data'][0]['passengers'],\n \"cargo_capacity\"=>$response['data'][0]['cargo_capacity'],\n \"consumables\"=> $response['data'][0]['consumables'],\n \"vehicle_class\"=>$response['data'][0]['vehicle_class'],\n \"pilots\"=>$response['data'][0]['pilots'],\n \"films\"=>$response['data'][0]['films'],\n \"created\"=> $response['data'][0]['created'],\n \"edited\"=> $response['data'][0]['edited'],\n \"url\"=> $response['data'][0]['url'],\n \"count\"=> $response['data'][0]['count']\n ]]\n\n\n\n ]);\n }", "public function testSuccessfulGetSortAttendants()\n {\n for ($i = 10000; $i < 10003; $i++) {\n $this->createData($i, '138000' . $i, 1);\n }\n for ($i = 10000; $i < 10003; $i++) {\n factory(Vote::class)->create([\n 'voter' => '138009' . $i,\n 'type' => Vote::TYPE_APP,\n 'user_id' => $i,\n ]);\n }\n $this->createData(10004, '13800010004', 0);\n $this->ajaxGet('/wap/' . self::ROUTE_PREFIX . '/approved/sort/list?page=1')\n ->seeJsonContains([\n 'code' => 0,\n ]);\n $result = json_decode($this->response->getContent(), true);\n $this->assertEquals(1, $result['pages']);\n $this->assertCount(3, $result['attendants']);\n }", "public function testValidCase()\n {\n $this->mock(AlphaVantageApiService::class, function ($mock) {\n return $mock->shouldReceive('querySymbol')\n ->once()\n ->andReturn(new \\GuzzleHttp\\Psr7\\Response(\n Response::HTTP_OK,\n [],\n '{\n \"Global Quote\": {\n \"01. symbol\": \"AMZN\",\n \"02. open\": \"3185.5600\",\n \"03. high\": \"3228.8600\",\n \"04. low\": \"3183.0000\",\n \"05. price\": \"3222.9000\",\n \"06. volume\": \"3325022\",\n \"07. latest trading day\": \"2021-05-14\",\n \"08. previous close\": \"3161.4700\",\n \"09. change\": \"61.4300\",\n \"10. change percent\": \"1.9431%\"\n }\n }'\n ));\n });\n\n $response = $this->getJson('api/stock-quotes?symbol=AMZN');\n $response->assertStatus(Response::HTTP_CREATED);\n $response->assertJson([\n 'id' => 1,\n 'symbol' => 'AMZN',\n 'high' => \"3228.8600\",\n 'low' => \"3183.0000\",\n 'price' => \"3222.9000\",\n ]);\n }", "public function testReturnsSupportedTranslationLanguagePairsTiersAndCreditPrices()\n {\n $serviceAPI = new Service();\n\n $response = json_decode($serviceAPI->getLanguagePairs(), true);\n $this->assertEquals('ok', $response['opstat']);\n $this->assertTrue(isset($response['response']));\n }", "public function testListSuppliers()\n {\n $stream = '{\"first_page_url\":\"page=1\",\"from\":1,\"last_page\":2,\"last_page_url\":\"page=2\",\"next_page_url\":\"page=2\",\"path\":\"\\/entities\\/suppliers\",\"per_page\":50,\"prev_page_url\":null,\"to\":55,\"total\":55,\"data\":[{\"id\":12345,\"code\":\"AE86\",\"name\":\"Mario Rossi S.R.L.\",\"type\":\"company\",\"first_name\":\"Mario\",\"last_name\":\"Rossi\",\"contact_person\":\"\",\"vat_number\":\"111222333\",\"tax_code\":\"111122233\",\"address_street\":\"Corso Magellano, 46\",\"address_postal_code\":\"20146\",\"address_city\":\"Milano\",\"address_province\":\"MI\",\"address_extra\":\"\",\"country\":\"Italia\",\"email\":\"[email protected]\",\"certified_email\":\"[email protected]\",\"phone\":\"1234567890\",\"fax\":\"123456789\",\"notes\":\"\",\"created_at\":\"2021-15-08\",\"updated_at\":\"2021-15-08\"},{\"id\":12346,\"code\":\"GT86\",\"name\":\"Maria Grossi S.R.L.\",\"type\":\"company\",\"first_name\":\"\",\"last_name\":\"\",\"contact_person\":\"\",\"vat_number\":\"200020102020\",\"tax_code\":\"200020102020\",\"address_street\":\"Vicolo stretto, 32\",\"address_postal_code\":\"20146\",\"address_city\":\"Milano\",\"address_province\":\"MI\",\"address_extra\":\"\",\"country\":\"Italia\",\"email\":\"[email protected]\",\"certified_email\":\"[email protected]\",\"phone\":\"0987654321\",\"fax\":\"098765432\",\"notes\":\"\",\"created_at\":\"2021-15-09\",\"updated_at\":\"2021-15-09\"}]}';\n $mock = new MockHandler([new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $stream\n )]);\n\n $handler = HandlerStack::create($mock);\n $apiInstance = new \\FattureInCloud\\Api\\SuppliersApi(\n new \\GuzzleHttp\\Client(['handler' => $handler])\n );\n $company_id = 2;\n $result = $apiInstance->listSuppliers($company_id);\n $obj = ObjectSerializer::deserialize($stream, '\\FattureInCloud\\Model\\ListSuppliersResponse');\n\n TestCase::assertEquals($obj, $result);\n }" ]
[ "0.6775954", "0.590531", "0.585309", "0.5791465", "0.56464386", "0.56445473", "0.56119233", "0.5596878", "0.5569873", "0.5545255", "0.55211115", "0.5482619", "0.54670006", "0.5464328", "0.54582024", "0.54364574", "0.54232496", "0.54016703", "0.5363386", "0.53609765", "0.5342642", "0.5318067", "0.5306027", "0.5290696", "0.52666193", "0.5261389", "0.52571", "0.522111", "0.5202919", "0.51845336" ]
0.7147369
0
$tripList>printList(); test inList() $tripList>inList('stop_name', 'HOHOKUS'); helper functions// function takes a train station and returns the next $num trains
function nextTrains($database, $stop_id, $time, $num) { //get next $num of trains leaving after $time from $stop_id $query = array("stop_id" => $stop_id, "departure_time" => array('$gt' => $time)); $cursor = $database->stop_times->find( $query )->sort(array("departure_time" => 1))->limit($num); //print("\nnextTrains\n"); //print_debug($cursor); return ($cursor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTrains($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getTrains-${station}\";\n\t\t//$redis_key .= time(); // Debugging\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t. '| stats max(late) AS \"Minutes Late\", max(time) AS \"time\", max(train_line) AS \"Train Line\" by trainno '\n\t\t\t\t. '| sort time desc';\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Most recent trains that have arrived at the station named '$station'\";\n\n\t\t\t$this->redisSet($redis_key, $retval);\n\t\t\treturn($retval);\n\n\t\t}\n\n\n\t}", "function nextTrip($database, $trip_id, $stop_seq)\n\t{\n\t\t//gets the trip\n\t\t$query = array(\"trip_id\" => $trip_id, \"stop_sequence\" => array('$gte' => $stop_seq));\n\t\t$cursor = $database->stop_times->find( $query )->sort(array(\"stop_sequence\" => 1));\n\n\t\t//print_debug($cursor);\n\t\t//print_r($cursor);\n\t\t\n\t\treturn ($cursor);\n\t}", "function snameList()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $db;\r\n\t// --------- CONVERT TO INT ---------\r\n\t$id = intval(GET_INC('id'));\r\n\t// --------- GET LIST ---------\r\n\t$db->connDB();\r\n\t$db->query(\"SELECT station FROM bus_circuit WHERE id={$id};\");\r\n\t$res = $db->fetch_array();\r\n\t$res = explode(',',$res['station']);\r\n\t// first write?\r\n\t$fw = true;\r\n\tforeach ( $res as $v )\r\n\t{\r\n\t\tif ( !$fw )\r\n\t\t{\r\n\t\t\techo ';';\r\n\t\t}else{\r\n\t\t\t$fw = false;\r\n\t\t}\r\n\t\techo $v;\r\n\t\techo '&';\r\n\t\t$db->free();\r\n\t\t$db->query(\"SELECT name FROM bus_sname WHERE id={$v} AND is_primary=1;\");\r\n\t\t$r = $db->fetch_array();\r\n\t\techo $r['name'];\r\n\t}\r\n\t$db->closeDB();\r\n}", "function add_stopout_list($data)\n\t{\n\t\t$this->db->insert('pamm_stopout_list',$data);\n\t}", "public function speeduplistAction()\n {\n $uid = $this->_USER_ID;\n $floorId = $this->getParam('CF_floorId');\n $storeType = $this->getParam(\"CF_storeType\");\n //chair id from giveservice page\n $chairId = $this->getParam(\"CF_chairid\");\n\n $mbllApi = new Mbll_Tower_ServiceApi($uid);\n $aryRst = $mbllApi->getSpeedUpList($floorId);\n $speedUpList = $aryRst['result'];\n\n if (!$aryRst) {\n $errParam = '-1';\n if (!empty($aryRst['errno'])) {\n $errParam = $aryRst['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n\n if (!isset($speedUpList[17])) {\n $speedUpList[17]['id'] = 17;\n $speedUpList[17]['nm'] = 0;\n }\n if (!isset($speedUpList[18])) {\n $speedUpList[18]['id'] = 18;\n $speedUpList[18]['nm'] = 0;\n }\n if (!isset($speedUpList[19])) {\n $speedUpList[19]['id'] = 19;\n $speedUpList[19]['nm'] = 0;\n }\n if (!isset($speedUpList[28])) {\n $speedUpList[28]['id'] = 28;\n $speedUpList[28]['nm'] = 0;\n }\n if (!isset($speedUpList[29])) {\n $speedUpList[29]['id'] = 29;\n $speedUpList[29]['nm'] = 0;\n }\n if (!isset($speedUpList[1119])) {\n $speedUpList[1119]['id'] = 1119;\n $speedUpList[1119]['nm'] = 0;\n }\n\n if (!empty($speedUpList)) {\n //add item name and desc\n foreach ($speedUpList as $key => $value) {\n $item = Mbll_Tower_ItemTpl::getItemDescription($value['id']);\n $speedUpList[$key]['name'] = $item['name'];\n $speedUpList[$key]['des'] = $item['desc'];\n if ($item['buy_mb'] > 0) {\n $speedUpList[$key]['money_type'] = 'm';\n }\n else if ($item['buy_gb'] > 0) {\n $speedUpList[$key]['money_type'] = 'g';\n }\n }\n }\n\n $this->view->userInfo = $this->_user;\n $this->view->speedUpList = $speedUpList;\n $this->view->floorId = $floorId;\n $this->view->chairId = $chairId;\n $this->view->storeType = $storeType;\n $this->render();\n }", "public function index()\n {\n $this->list_trip();\n }", "private function computeOpenSchedules($list) {\n\n // print_array($list, 'input');\n // echo '<br>';\n\n $st = array();\n $et = array();\n $final = array();\n $start = 7;\n $end = 21;\n $temp = $start;\n\n while($temp < $end) {\n array_push( $st, number_format((float)$temp, 2, ':', '') );\n $temp++;\n }\n\n $temp = $start++;\n while( $start <= $end ) {\n array_push( $et, number_format((float)$start, 2, ':', '') );\n $start++;\n }\n\n // print_array($st, 'start_time');\n // print_array($et, 'end_time');\n // echo '<br>';\n\n foreach( $list as $val ) {\n $times = explode(\"-\", $val);\n $start_time = trim($times[0]);\n $end_time = trim($times[1]);\n\n $range = $this->find_range($start_time, $end_time);\n \n if (($key = array_search($start_time, $st)) !== false) {\n unset($st[$key]);\n }\n\n if (($key = array_search($end_time, $et)) !== false) {\n unset($et[$key]);\n }\n\n foreach($range as $time) {\n if (($key = array_search($time, $st)) !== false) {\n unset($st[$key]);\n }\n\n if (($key = array_search($time, $et)) !== false) {\n unset($et[$key]);\n }\n }\n }\n\n $st = array_values($st);\n $et = array_values($et);\n\n $this->print_array($st, 'start_time');\n $this->print_array($et, 'end_time');\n echo '<br>';\n\n if(count($st) >= count($et)) {\n for($idx = 0; $idx < count($st); $idx++){\n array_push($final, new Time($st[$idx], $et[$idx]));\n }\n } \n return $final;\n }", "function multipleLayerNeurons($start) {\n\t\tfor($i = 0; $i < 10; $i++) \n\t\t\t$this->layerNeurons( $start + $i , 0 );\n\t}", "public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }", "public function NextDepartures() {\r\n\t\t\t\r\n\t\t}", "function get_flight_from_ws($airline, $depcode, $descode, $depdate, $retdate, $direction=1, $format='json'){\n\t\n\t$airline = strtoupper(trim($airline));\n\t$depcode = strtoupper(trim($depcode));\n\t$descode = strtoupper(trim($descode));\n\t$depdate = str_replace('/','-',$depdate);\n\t$retdate = isset($retdate) && !empty($retdate) ? str_replace('/','-',$retdate) : $depdate; \n\t$api_key = '70cd2199f6dc871824ea9fed45170af354ffe9e6';\n \n $timeout = 30;\n \n\tif ($airline == 'VN' || $airline == 'QH') {\n $urls = array(\n // 'http://fs2.vietjet.net',\n 'http://fs3.vietjet.net',\n 'http://fs4.vietjet.net',\n 'http://fs5.vietjet.net',\n 'http://fs6.vietjet.net',\n 'http://fs7.vietjet.net',\n 'http://fs8.vietjet.net',\n 'http://fs9.vietjet.net',\n 'http://fs10.vietjet.net',\n 'http://fs11.vietjet.net',\n 'http://fs12.vietjet.net',\n 'http://fs13.vietjet.net',\n 'http://fs14.vietjet.net',\n 'http://fs15.vietjet.net',\n 'http://fs16.vietjet.net',\n 'http://fs17.vietjet.net',\n 'http://fs18.vietjet.net',\n 'http://fs19.vietjet.net',\n 'http://fs20.vietjet.net',\n 'http://fs21.vietjet.net',\n 'http://fs22.vietjet.net',\n 'http://fs23.vietjet.net',\n 'http://fs24.vietjet.net',\n 'http://fs25.vietjet.net',\n 'http://fs26.vietjet.net',\n 'http://fs27.vietjet.net',\n 'http://fs28.vietjet.net',\n 'http://fs29.vietjet.net',\n 'http://fs30.vietjet.net',\n );\n } else if ($airline == 'VJ' || $airline == 'BL'){\n $timeout = 35;\n $urls = array(\n 'http://fs2.vietjet.net',\n );\n }\n\n shuffle($urls);\n $url = $urls[array_rand($urls)];\n\t$url .= '/index.php/apiv1/api/flight_search/format/'.$format;\n\t$url .= '/airline/'.$airline.'/depcode/'.$depcode.'/descode/'.$descode.'/departdate/'.$depdate.'/returndate/'.$retdate.'/direction/'.$direction;\n\n\t$curl_handle = curl_init();\n\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\n\tcurl_setopt($curl_handle, CURLOPT_ENCODING, 'gzip');\n\tcurl_setopt($curl_handle, CURLOPT_TIMEOUT, $timeout);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, $timeout);\n\tcurl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('X-API-KEY: '.$api_key));\n\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $buffer = curl_exec($curl_handle);\n\n curl_close($curl_handle);\n $result = json_decode($buffer, true);\n\n\treturn $result;\n}", "function init(array $list)\n{\n return take(\\count($list) - 1)($list);\n}", "function getTrainsLatest($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getTrainsLatest-${station}\";\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t\t. '| eval id = trainno . \"-\" . dest '\n\t\t\t\t\t. '| stats max(late) AS \"Minutes Late\", max(time) AS \"time\", max(train_line) AS \"Train Line\" by id '\n\t\t\t\t\t. '| sort \"Minutes Late\" desc '\n\t\t\t\t\t. '| head '\n\t\t\t\t\t. '| chart max(\"Minutes Late\") AS \"Minutes Late\" by id '\n\t\t\t\t\t. '| sort \"Minutes Late\" desc';\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Latest trains that have arrived at the station named '$station'\";\n\n\t\t\t$this->redisSet($redis_key, $retval);\n\t\t\treturn($retval);\n\n\t\t}\n\n\t}", "function getLessIndex($packList,$start,$num)\n{\n for ($i=$start;$i<count($packList);$i++)\n {\n if((int)$packList[$i]['pack_of']>$num)\n {\n $i++;\n }else{\n return $i;\n }\n }\n}", "public function show(Listt $listt)\n {\n //\n }", "function listWorkflows($page = null, $rownums = null);", "function fann_get_train_stop_function($ann)\n{\n}", "function createKiltPinsListings()\n{\n\t$id = NULL;\n\t$count = 0;\n\t$clanName = NULL;\n\t$surname = NULL;\n\t$surname_list = NULL;\n\t$complete_list = NULL;\n\n\t$query = \"SELECT * FROM clan WHERE active = 1;\";\n\t// $query = \"SELECT * FROM clan WHERE active = 1 AND id > 323;\";\n\t// $query = \"SELECT * FROM clan WHERE active = 4;\"; // use this for any image uploads that failed.\n\t$result = @mysql_query($query); // Run the query.\n\tif($result)\n\t{\n\t\twhile($row = mysql_fetch_array($result, MYSQL_ASSOC))\n\t\t{\n\t\t\t$id = $row['Id'];\n\t\t\t$clanName = $row['name'];\n\t\t\t\n\t\t\t$complete_list = \"Kilt Pins Clan \" . $clanName . \":\";\n\t\t\tif(strlen($complete_list) < 55)\n\t\t\t{\n\t\t\t\t// Now run another query to get all surnames linked to clan.\n\t\t\t\t$query2 = \"SELECT surnames.* FROM surnames, clan_surnames, clan WHERE clan.Id = \" . $id . \" AND clan_surnames.clan_id = clan.Id AND clan_surnames.surname_id = surnames.Id;\";\n\t\t\t\t$result2 = @mysql_query($query2); // Run the query.\n\t\t\t\tif($result2)\n\t\t\t\t{\n\t\t\t\t\twhile($row2 = mysql_fetch_array($result2, MYSQL_ASSOC))\n\t\t\t\t\t{\n\t\t\t\t\t\t$surname = $row2['name'];\n\t\t\t\t\t\tif((strlen(\"Kilt Pins Clan \" . $clanName . \":\" . $surname_list) + strlen($surname)) < 55) {\n\t\t\t\t\t\t\t$surname_list .= \" \" . $surname;\n\t\t\t\t\t\t\t$complete_list .= \" \" . $surname;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Now perform insertion into kilt_pin_listing table in the DB.\n\t\t\t\t\t\t\t$query3 = \"INSERT INTO kilt_pins_listing(Id, clan_id, clan_name, surname_list, active, date_time) \nVALUES('', $id, '$clanName', '$surname_list', 1, NOW());\";\n\t\t\t\t\t\t\t$result3 = @mysql_query($query3); // Run the query.\n\t\t\t\t\t\t\tif($result3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Insert successfull.\n\t\t\t\t\t\t\t\t$int_id = mysql_insert_id();\n\t\t\t\t\t\t\t\t$surname_list = \" \" . $surname;\n\t\t\t\t\t\t\t\t$complete_list = \"Kilt Pins Clan \" . $clanName . \":\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// System.out.println(\"*** \" + surname_list);\n\t\t\t\t\t\t\t$count++;\n\t\t\t\t\t\t\t// $surname_list = \"Clan \" . $clanName . \" Kilt Pin:\";\n\t\t\t\t\t\t\t// System.out.println(\"\\tCount is \" + count);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// If the surnames while is complete, we still may have to add one last entry.\n\t\t\t\t\t// Just check that the complete list is less than 56 characters.\n\t\t\t\t\tif(strlen($complete_list) < 55)\n\t\t\t\t\t{\n\t\t\t\t\t\t$query3 = \"INSERT INTO kilt_pins_listing(Id, clan_id, clan_name, surname_list, active, date_time) \n\tVALUES('', $id, '$clanName', '$surname_list', 1, NOW());\";\n\t\t\t\t\t\t$result3 = @mysql_query($query3); // Run the query.\n\t\t\t\t\t\tif($result3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Insert successfull.\n\t\t\t\t\t\t\t$int_id = mysql_insert_id();\n\t\t\t\t\t\t\t$surname_list = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\techo \"<Ack>Success</Ack>\";\n}", "function get_order_indicator_of_list($list_string) {\r\n\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $list_string, $type_match);\r\n\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $list_string, $start_match);\r\n\t\t$type = $type_match[1];\r\n\t\t$start = $start_match[1];\r\n\t\tif($type === \"1\") {\r\n\t\t\treturn $start;\r\n\t\t} elseif($type === \"A\") {\r\n\t\t\treturn ReTidy::decimal_to_alphabetical($start);\r\n\t\t} elseif($type === \"a\") {\r\n\t\t\treturn strtolower(ReTidy::decimal_to_alphabetical($start));\r\n\t\t} elseif($type === \"I\") {\r\n\t\t\treturn ReTidy::decimal_to_roman_numeral($start);\r\n\t\t} elseif($type === \"i\") {\r\n\t\t\treturn strtolower(ReTidy::decimal_to_roman_numeral($start));\r\n\t\t} else {\r\n\t\t\tprint(\"<span style=\\\"color: red;\\\"> should never get here (get_order_indicator_of_list) 238384905484749</span><br>\\r\\n\");\r\n\t\t\tprint(\"list_string: \");var_dump($list_string);\r\n\t\t\tprint(\"type: \");var_dump($type);\r\n\t\t\tprint(\"start: \");var_dump($start);\r\n\t\t}\r\n\t}", "function get_other_buses($stopcode)\n{\n\n\t$url = \"http://api.bus.southampton.ac.uk/stop/\" . $stopcode . \"/buses\";\n\t$data = json_decode(file_get_contents($url), true);\n\t$ret = array();\n\tforeach($data as $item)\n\t{\n\t\t$operator = preg_replace(\"#^([^/]+)/.*$#\", \"$1\", $item['id']);\n\t\tif(strcmp($operator, \"BLUS\") == 0) { continue; }\n\t\tif(strcmp($operator, \"UNIL\") == 0) { continue; }\n\n\t\t$bus = array();\n\t\t$bus['name'] = $item['name'];\n\t\t$bus['dest'] = $item['dest'];\n\t\t$bus['date'] = $item['date'];\n\t\t$bus['time'] = date(\"H:i\", $item['date']);\n\t\t$bus['journey'] = $item['journey'];\n\t\t$ret[] = $bus;\n\t}\n\treturn($ret);\n}", "function testListIterator() {\r\n $list = array(\"one\", \"two\", \"three\", \"four\");\r\n echo \"Testing constructor, hasNext, next\\n\";\r\n $it = new ListIterator($list);\r\n $index = 0;\r\n while ($it->hasNext()) {\r\n $item = $it->next();\r\n assert('!strcmp($item, $list[$index])');\r\n assert('$item === $list[$index]');\r\n $index++;\r\n }\r\n assert('$index === count($list)');\r\n echo \"Testing count\\n\";\r\n $it2 = new ListIterator($list);\r\n while ($it2->hasNext()) {\r\n $item = $it2->next();\r\n assert('$item === $it2->current()');\r\n }\r\n echo \"...unit test complete\\n\";\r\n}", "public function testGettingStartedListing()\n\t{\n\t\t$oSDK=new BrexSdk\\SDKHost;\n\t\t$oSDK->addHttpPlugin($this->oHostPlugin);\n\n\n\t\t//Let's get company details to start\n\t\t$oTeamClient=$oSDK->setAuthKey($this->BREX_TOKEN) #consider using a token vault\n\t\t\t\t->setupTeamClient();\n\n\t\t/** @var BrexSdk\\API\\Team\\Client */\n\t\t$oTeamClient;\n\n\t\t//... OR\n\t\t//if you will be doing work across the API, use the follow convenience method\n\t\t$oTeamClient=$oSDK->setupAllClients()->getTeamClient();\n\t\t//etc...\n\n\t\t/** @var BrexSdk\\API\\Team\\Model\\CompanyResponse */\n\t\t$aCompanyDetails=$oTeamClient->getCompany();\n\n\t\t$sCompanyName=$aCompanyDetails->getLegalName();\n\t\t// ACME Corp, Inc.\n\t\tcodecept_debug($sCompanyName);\n\t\t$this->assertStringContainsString('Nxs Systems Staging 01', $sCompanyName);\n\t}", "public function constructTriples(){\n try {\n // Sparql11query.g:258:3: ( triplesSameSubject ( DOT ( constructTriples )? )? ) \n // Sparql11query.g:259:3: triplesSameSubject ( DOT ( constructTriples )? )? \n {\n $this->pushFollow(self::$FOLLOW_triplesSameSubject_in_constructTriples893);\n $this->triplesSameSubject();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:259:22: ( DOT ( constructTriples )? )? \n $alt34=2;\n $LA34_0 = $this->input->LA(1);\n\n if ( ($LA34_0==$this->getToken('DOT')) ) {\n $alt34=1;\n }\n switch ($alt34) {\n case 1 :\n // Sparql11query.g:259:23: DOT ( constructTriples )? \n {\n $this->match($this->input,$this->getToken('DOT'),self::$FOLLOW_DOT_in_constructTriples896); \n // Sparql11query.g:259:27: ( constructTriples )? \n $alt33=2;\n $LA33_0 = $this->input->LA(1);\n\n if ( (($LA33_0>=$this->getToken('TRUE') && $LA33_0<=$this->getToken('FALSE'))||$LA33_0==$this->getToken('IRI_REF')||$LA33_0==$this->getToken('PNAME_NS')||$LA33_0==$this->getToken('PNAME_LN')||($LA33_0>=$this->getToken('VAR1') && $LA33_0<=$this->getToken('VAR2'))||$LA33_0==$this->getToken('INTEGER')||$LA33_0==$this->getToken('DECIMAL')||$LA33_0==$this->getToken('DOUBLE')||($LA33_0>=$this->getToken('INTEGER_POSITIVE') && $LA33_0<=$this->getToken('DOUBLE_NEGATIVE'))||($LA33_0>=$this->getToken('STRING_LITERAL1') && $LA33_0<=$this->getToken('STRING_LITERAL_LONG2'))||$LA33_0==$this->getToken('BLANK_NODE_LABEL')||$LA33_0==$this->getToken('OPEN_BRACE')||$LA33_0==$this->getToken('OPEN_SQUARE_BRACE')) ) {\n $alt33=1;\n }\n switch ($alt33) {\n case 1 :\n // Sparql11query.g:259:27: constructTriples \n {\n $this->pushFollow(self::$FOLLOW_constructTriples_in_constructTriples898);\n $this->constructTriples();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getMyTrades($symbol, $limit = NULL, $fromId = NULL, $recvWindow = NULL);", "function select_from_stopout_list($number,$action)\n\t{\n\t return $this->db->select('*')\n\t\t ->from('pamm_stopout_list')\n\t\t ->where('number',$number)\n\t\t ->where('action',$action)\n\t\t ->get()->result();\n\t}", "private function findTrips($html) {\n\t\t$trips = array();\n\n\t\tforeach ($html->find('.reiselistsub') as $trip) {\n\n\t\t\t$singleTrip = array(\"title\" => trim($trip->find('b', 0)->plaintext), \"excerpt\" => trim($trip->find('a img')[0]->alt), \"description\" => trim($trip->find('span', 0)->plaintext), \"img\" => $trip->find('a img')[0]->src, \"category\" => \"\", \"saison\" => \"\", \"price\" => $this->formatPrice($trip->find('font b', 0)->plaintext), \"booking_url\" => $trip->find('a', 0)->href);\n\n\t\t\tarray_push($trips, $singleTrip);\n\t\t}\n\n\t\treturn $trips;\n\t}", "private function extractFirstLastTrip()\n {\n // If trip is shorter than 3 legs, there is actually no need anymore\n if (count($this->tripCollection) < 2) {\n return $this->tripCollection;\n }\n\n // Find the start and end point for the trips\n for ($i = 0, $max = count($this->tripCollection); $i < $max; $i++) {\n $hasPreviousTrip = false;\n $isLastTrip = true;\n\n foreach ($this->tripCollection as $index => $trip) {\n // If this trip is attached to a previous trip, we pass!\n if (strcasecmp($this->tripCollection[$i]['Departure'], $trip['Arrival']) == 0) {\n $hasPreviousTrip = true;\n } // If this trip is not the last trip, we pass!\n elseif (strcasecmp($this->tripCollection[$i]['Arrival'], $trip['Departure']) == 0) {\n $isLastTrip = false;\n }\n }\n\n // We found the start point of the trip,\n // so we put it on the top of the list\n if (!$hasPreviousTrip) {\n array_unshift($this->tripCollection, $this->tripCollection[$i]);\n unset($this->tripCollection[$i]);\n } // And the end of the trip\n elseif ($isLastTrip) {\n array_push($this->tripCollection, $this->tripCollection[$i]);\n unset($this->tripCollection[$i]);\n }\n\n }\n\n // Reset indexes\n $this->tripCollection = array_merge($this->tripCollection);\n }", "function wisataone_X1_get_all_order_by_id_tour_and_step_gte_110($id_tour, $trip_date) {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n return $wpdb->get_results( \n \"\n SELECT *\n FROM {$wp_track_table}\n WHERE {$wp_track_table}.id_tour = {$id_tour} AND {$wp_track_table}.trip_date LIKE '{$trip_date}' AND {$wp_track_table}.current_step >= 110\n \"\n );\n}", "public function getTrades($symbol, $limit = NULL);", "function serviceList(&$smartyServiceList,$abcBar=false,$searchBox=false,$topList=false) {\n\t\t//\tfunction makeServiceListQuery($char=all,$limit=true,$count=false) {\n\t\t$query = $this->makeServiceListQuery($this->piVars['char']);\n\t\tif (!$query) {\n\t\t\treturn false;\n\t\t}\n\t\t$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);\n\n\t\t$row_counter = 0;\n\n\t\t// WS-VERSIONING: collect all new records and place them at the beginning of the array!\n\t\t// the new records have no name in live-space and therefore would be delegated\n\t\t// to the very end of the list through the order by clause in function makeServiceListQuery....\n\t\t$eleminated_rows=0;\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t// WS-VERSIONING: get the Preview from the Core!!!!\n\t\t\t// copied from tt_news\n\t\t\t// the function versionOL() in /t3lib/class.t3lib_page.php does\n\t\t\t// the rendering of the version records for preview.\n\t\t\t// i.e. a new, not yet published record has the name ['PLACEHOLDER'] and is hidden in live-workspace,\n\t\t\t// class.t3lib_page.php replaces the fields in question with content from its\n\t\t\t// version-workspace-equivalent for preview purposes!\n\t\t\t// for it to work the result must also contain the records from live-workspace which carry the hidden-flag!!!\n\t\t\tif ($this->versioningEnabled) {\n\t\t\t\t// remember: versionOL generates field-list and cannot handle aliases!\n\t\t\t\t// i.e. there must not be any aliases in the query!!!\n\t\t\t\t$GLOBALS['TSFE']->sys_page->versionOL('tx_civserv_service',$row);\n\n\t\t\t\tif($this->previewMode){\n\t\t\t\t\t$row['realname']=$row['sv_name'];\n\t\t\t\t\t$row['name']=$row['realname'];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif(is_array($row)){\n\t\t\t\t$services[$row_counter]['uid']=$row['uid']; //needed for preview-sorting see below\n\t\t\t\t$services[$row_counter]['t3ver_state']=$row['t3ver_state'];\n\t\t\t\t$services[$row_counter]['fe_group']=$row['fe_group'];\n\t\t\t\t// customLinks will only work if there is an according rewrite-rule in action!!!!\n\t\t\t\tif(!$this->conf['useCustomLinks_Services']){\n\t\t\t\t\t$services[$row_counter]['link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'service',id => $row['uid']),$this->conf['cache_services'],1));\n\t\t\t\t}else{\n\t\t\t\t\t$services[$row_counter]['link'] = strtolower($this->convert_plus_minus(urlencode($this->replace_umlauts($this->strip_extra($row['realname'].\"_\".$row['uid']))))).\".html\";\n\t\t\t\t}\n\t\t\t\tif ($row['name'] == $row['realname']) {\n\t\t\t\t\t$services[$row_counter]['name'] = $row['name'];\n\t\t\t\t} else {\n\t\t\t\t\t// this will only happen in LIVE context\n\t\t\t\t\t$services[$row_counter]['name'] = $row['name'] . ' (= ' . $row['realname'] . ')';\n\t\t\t\t}\n\t\t\t\t// mark the version records for the FE, could be done by colour in template as well!\n\t\t\t\tif($row['_ORIG_pid']==-1 && $row['t3ver_state']==0){ // VERSION records\n\t\t\t\t\t$services[$row_counter]['name'].=\" DRAFT: \".$row['uid'];\n\t\t\t\t\t$services[$row_counter]['preview']=1;\n\t\t\t\t}elseif($row['_ORIG_pid']==-1 && $row['t3ver_state']==-1){ // NEW records\n\t\t\t\t\t$services[$row_counter]['name'].=\" NEW: \".$row['uid'];\n\t\t\t\t\t$services[$row_counter]['preview']=1;\n\t\t\t\t}else{\n\t\t\t\t\t// LIVE!!\n\t\t\t\t\t#$services[$row_counter]['name'].= \" \".$row['uid'];\n\t\t\t\t}\n\n\n\t\t\t\t//for the online_service list we want form descr. and service picture as well.\n\t\t\t\tif($this->piVars['mode'] == \"online_services\"){\n\t\t\t\t\t$res_online_services = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t\t'tx_civserv_form.fo_descr,\n\t\t\t\t\t\t tx_civserv_service.sv_image,\n\t\t\t\t\t\t tx_civserv_service.sv_image_text',\n\t\t\t\t\t\t'tx_civserv_service',\n\t\t\t\t\t\t'tx_civserv_service_sv_form_mm',\n\t\t\t\t\t\t'tx_civserv_form',\n\t\t\t\t\t\t' AND tx_civserv_service.uid = ' . $row['uid'] .\n\t\t \t\t\t\t $this->cObj->enableFields('tx_civserv_form').\n\t\t\t\t\t\t' AND tx_civserv_form.fo_status >= 2',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\n\t\t\t\t\tif ($online_sv_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_online_services) ) { //we only accept one online-form per service!!!!\n\t\t\t\t\t\t$imagepath = $this->conf['folder_organisations'] . $this->community['id'] . '/images/';\n\t\t\t\t\t\t#function getImageCode($image,$path,$conf,$altText)\t{\n\t\t\t\t\t\t$imageCode = $this->getImageCode($online_sv_row['sv_image'],$imagepath,$this->conf['service-image.'],$online_sv_row['sv_image_text']);\n\t\t\t\t\t\t$services[$row_counter]['descr']=$online_sv_row['fo_descr'];\n\t\t\t\t\t\t$services[$row_counter]['image']=$imageCode;\n\t\t\t\t\t\t$services[$row_counter]['image_text']=$online_sv_row['sv_image_text'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// highlight_external services in list view!! (works only if function makeServiceListQuery returns pid-value!)\n\t\t\t\t$mandant = t3lib_div::makeInstanceClassName('tx_civserv_mandant');\n\t\t\t\t$mandantInst = new $mandant();\n\t\t\t\t$service_community_id= $mandantInst->get_mandant($row['pid']);\n\t\t\t\t$service_community_name = $mandantInst->get_mandant_name($row['pid']);\n\t\t\t\tif($this->community['id'] != $service_community_id){\n\t\t\t\t\t$services[$row_counter]['name'] .= \" <i> - \".$service_community_name.\"</i>\";\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}else{\n\t\t\t\t// NULL-rows (obsolete)\n\t\t\t\t$eleminated_rows++;\n\t\t\t}\n\t\t} //end while\n\n\n\t\tif($this->previewMode){\n\t\t\t// we need to re_sort the services_array in order to incorporate the\n\t\t\t// new services which appear at the very end (due to \"order by name\" meets \"[PLACEHOLDER]\")\n\n\t\t\t#http://forum.jswelt.de/serverseitige-programmierung/10285-array_multisort.html\n\t\t\t#http://www.php.net/manual/en/function.array-multisort.php\n\t\t\t#http://de.php.net/array_multisort#AEN9158\n\n\t\t\t//found solution here:\n\t\t\t#http://www.php-resource.de/manual.php?p=function.array-multisort\n\n\t\t\t$lowercase_uids=array();\n\t\t\t//ATTENTION: multisort is case sensitive!!!\n\t\t\tfor($i=0; $i<count($services); $i++){\n\t\t\t\t$name=$services[$i]['name'];\n\t\t\t\t// service-name starts with lowercase letter\n\t\t\t\tif(strcmp(substr($name,0,1), strtoupper(substr($name,0,1)))>0){\n\t\t\t\t\t// make it uppercase\n\t\t\t\t\t$services[$i]['name']=strtoupper(substr($name,0,1)).substr($name,1,strlen($name));\n\t\t\t\t\t// remember which one it was you manipulated\n\t\t\t\t\t$lowercase_uids[]=$services[$i]['uid'];\n\t\t\t\t}\n\t\t\t\t$sortarray[$i] = $services[$i]['name'];\n\t\t\t}\n\n\t\t\t// DON'T! or else multisort won't work! (must be something about keys and indexes??)\n\t\t\t# natcasesort($sortarray);\n\n\t\t\t// $services is sorted by $sortarray as in SQL \"ordery by name\"\n\t\t\t// $sortarray itself gets sorted by multisort!!!\n\t\t\tif(is_array($sortarray) && count($sortarray)>0){\n\t\t\t\tarray_multisort($sortarray, SORT_ASC, $services);\n\t\t\t}\n\n\t\t\tfor($i=0; $i<count($services); $i++){\n\t\t\t\t$name=$services[$i]['name'];\n\t\t\t\t// reset the converted service-names to their initial value (lowercase first letter)\n\t\t\t\tif(in_array($services[$i]['uid'],$lowercase_uids)){\n\t\t\t\t\t$services[$i]['name']=strtolower(substr($name,0,1)).substr($name,1,strlen($name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Retrieve the service count\n\t\t$row_count = 0;\n\t\t//\tfunction makeServiceListQuery($char=all,$limit=true,$count=false) {\n\t\t$query = $this->makeServiceListQuery($this->piVars['char'],false,true);\n\t\t$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$row_count += $row['count(*)'];\n\t\t}\n\n\t\t$row_count = $row_count-$eleminated_rows;\n\t\t$this->internal['res_count'] = $row_count;\n\n\t\tif(!$this->previewMode){\n\t\t\t$this->internal['results_at_a_time']= $this->conf['services_per_page'];\n\t\t}else{\n\t\t\t$this->internal['results_at_a_time']=10000; //in Preview Mode we need ALL records - new ones from the end of the alphabethical list are to be included!!!\n\t\t}\n\n\t\t$this->internal['maxPages'] = $this->conf['max_pages_in_pagebar'];\n\n\n\t\t$smartyServiceList->assign('services', $services);\n\n\t\tif ($abcBar) {\n\t\t\t$query = $this->makeServiceListQuery(all,false);\n\t\t\t$smartyServiceList->assign('abcbar',$this->makeAbcBar($query));\n\t\t}\n\t\t$smartyServiceList->assign('heading',$this->getServiceListHeading($this->piVars['mode'],intval($this->piVars['id'])));\n\n\n\t\t// if the title is set here it will overwrite the value we want in the organisationDetail-View\n\t\t// but we do need it for circumstance and user_groups!\n\t\t$GLOBALS['TSFE']->page['title'] = $this->getServiceListHeading($this->piVars['mode'],intval($this->piVars['id']));\n\n\t\tif($this->piVars['char']>''){\n\t\t\t $GLOBALS['TSFE']->page['title'] .= ': '.$this->pi_getLL('tx_civserv_pi1_service_list.abc_letter','Letter').' '.$this->piVars['char'];\n\t\t}\n\n\t\tif ($searchBox) {\n\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t$smartyServiceList->assign('searchbox', $this->pi_list_searchBox('',true));\n\t\t}\n\n\t\tif ($topList) {\n\t\t\tif (!$this->calculate_top15($smartyServiceList,false,$this->conf['topCount'])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//test bk: the service_list template is being used by several modes, change the subheading in accordance with the modes!!!\n\t\tif($this->piVars['mode'] == 'organisation')$smartyServiceList->assign('subheading',$this->pi_getLL('tx_civserv_pi1_service_list.available_services','Here you find the following services'));\n\t\t$smartyServiceList->assign('pagebar',$this->pi_list_browseresults(true,'', ' '.$this->conf['abcSpacer'].' '));\n\n\t\treturn true;\n\t}" ]
[ "0.5781081", "0.54503745", "0.5128231", "0.5019329", "0.50053805", "0.4991708", "0.4963868", "0.49330297", "0.4860214", "0.48550525", "0.4843406", "0.48130915", "0.47894514", "0.47403437", "0.47088164", "0.47008035", "0.4679761", "0.46698704", "0.4655264", "0.46517396", "0.46510944", "0.46334386", "0.4629772", "0.4623559", "0.46143854", "0.46136475", "0.4611508", "0.46076944", "0.4601931", "0.4600994" ]
0.62130743
0
Finds / creats the record for a not detected Agent
public function findOrCreateNotDetected(): Agent { return Agent::firstOrCreate([ 'name' => 'unknown', 'browser' => NULL, 'browser_version' => NULL ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function record(){\n //store deadbody object first\n $this->create();\n\n //stores new deadbody in compartment\n $sql = \"SELECT * FROM compartment WHERE status='free' LIMIT 1\";\n $this->compartment = array_shift(Compartment::find_by_sql($sql));\n $this->compartment->status = \"occupied\";\n $this->compartment->dead_no = $this->id;\n\n //create basic service object related to this object\n $service = new RequestedService();\n $service->rel_no = 'null';\n $service->service_no = 1;\n $service->dead_no = $this->id;\n $service->status=\"TODO\";\n $this->requested_service[] = $service;\n\n //stores storage and service information\n if($this->compartment->save() && $service->save()){\n return true;\n } else {\n return false;\n }\n }", "public function createMissingRecords()\n {\n $records = $this->getMissingRecords();\n\n foreach ($records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getFieldsArray();\n\n if (count($fields)) {\n $entity = $repo->create($fields);\n $entity->setStatus('published');\n $repo->save($entity);\n }\n }\n }", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function findOrCreate(Array $attributes): Agent\n {\n if (empty($attributes['name'])) {\n $attributes['name'] = 'unknown';\n }\n\n return Agent::firstOrCreate($attributes);\n }", "public function testGetRecordIdByItemWithNoRecord()\n {\n\n // Create an exhibit and item.\n $neatline = $this->_createNeatline();\n $item = $this->_createItem();\n\n // Check for null.\n $retrievedId = $neatline->getRecordIdByItem($item);\n $this->assertNull($retrievedId);\n\n }", "private function collectNLAIdentifiers()\n {\n // find all records that has an nla identifier\n $this->log(\"Fetching all records which are related to NLA identifiers or have an NLA party identifier...\");\n\n $prefix = $this->config['party']['prefix'];\n\n $this->nlaIdentifiers = [];\n\n // has nla identifier\n $identifiers = Identifier::where('identifier', 'like', \"%{$prefix}%\")->pluck('identifier')->unique()->values()->toArray();\n $this->nlaIdentifiers = array_merge($this->nlaIdentifiers, $identifiers);\n $count = count($identifiers);\n $this->log(\"NLA identifier(s): {$count}\");\n\n // directly relates to nla identifier\n $identifiers = Relationship::where('related_object_key', 'like', \"%{$prefix}%\")->pluck('related_object_key')->unique()->values()->toArray();\n $this->nlaIdentifiers = array_merge($this->nlaIdentifiers, $identifiers);\n $count = count($identifiers);\n $this->log(\"Related Object NLA Identifier(s): {$count}\");\n\n // has related info parties\n $identifiers = IdentifierRelationship::where('related_object_identifier', 'like', \"%{$prefix}%\")->pluck('related_object_identifier')->unique()->values()->toArray();\n $this->nlaIdentifiers = array_merge($this->nlaIdentifiers, $identifiers);\n $count = count($identifiers);\n $this->log(\"Related Info NLA Identifier(s): {$count}\");\n\n $this->nlaIdentifiers = array_values(array_unique($this->nlaIdentifiers));\n }", "function recordAnalytics() {\n\t\t//Is your user agent any of my business? Not really, but don't worry about it.\n\t\texecuteQuery(\"\n\t\t\tINSERT INTO dwm2r_activitymonitor\n\t\t\t(IPAddress,UserAgent,Flags,Seed,CreatedDTS)\n\t\t\tVALUES (\n\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\n\t\t\t\t'\".$_SERVER['HTTP_USER_AGENT'].\"',\n\t\t\t\t'\".trim($_REQUEST[\"Flags\"]).\"',\n\t\t\t\t'\".$this->modder->flags[\"Seed\"].\"',\n\t\t\t\tNOW()\n\t\t\t)\n\t\t\");\n\t}", "static private function link_naked_arxiv() {\n // if(self::quick()) return null;\n\n // Pick arXiv IDs within the last year which do not have INSPIRE record.\n $stats = self::inspire_regenerate(\"SELECT arxiv FROM records WHERE (inspire = '' OR inspire IS NULL) AND (arxiv != '' AND arxiv IS NOT NULL) AND (published + interval 1 year > now())\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" arXiv ids were associated with INSPIRE: \" . implode(\", \", $stats->found) . \".\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" arXiv ids were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n }", "function addAgent($agt) {\n\t\t\n\t\t# Create a new mySQLi object to connect to the \"travelexperts\" database\n\t\t$dbconnection = new mysqli(\"localhost\", \"root\", \"\", \"travelexperts\");\n\t\t\t\n\t\tif ($dbconnection->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $dbconnection->connect_error);\n\t\t} \n\t\t\n\t\t# Create the SQL statement using the data in the $agt Agent object. The Agent object contains values for \n\t\t# every field in the agents table, so the field names do not need to be specified.\n\t\t$sql = \"INSERT INTO agents VALUES (\" . $agt->toString() . \")\";\n\t\t\n\t\t$result = $dbconnection->query($sql);\n\t\t\n\t\t# Log the SQL query and result to a log file, sqllog.txt. This file will be created if it doesn't exist,\n\t\t# otherwise text will be appended to the end of the existing file. \"\\r\\n\" creates a line break.\n\t\t$log = fopen(\"sqllog.txt\", \"a\");\n\t\tfwrite($log, $sql . \"\\r\\n\");\n\t\tif ($result) {\n\t\t\tfwrite($log, \"SUCCESS \\r\\n\");\n\t\t}\n\t\telse {\n\t\t\tfwrite($log, \"FAIL \\r\\n\");\n\t\t}\n\t\tfclose($log);\n\t\t\n\t\t$dbconnection->close();\n\t\t\n\t\t# Return a boolean value. $result is true if the insert query was successful and false if unsuccessful.\n\t\treturn $result;\n\t}", "function addPatientToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes = null)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $patients = getPatients();\n $patientExists = false;\n // good for adding sorting before searching\n foreach ($patients as $patient) {\n $valuesExist = $patient['FileNumber'] === $fileNumber || ($patient['PatientNo'] === $phoneNo && $patient['PatientName'] === $name);\n if ($valuesExist) {\n $patientExists = true;\n break;\n }\n }\n if ($patientExists) {\n $result['message'] = \"Similar Patient Already Exists !\";\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n ];\n\n if ($progressNotes) {\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n // $appObject['FirebaseId'] = null;\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n } else {\n $patientSaved = saveRecord(PATIENTS_COLLECTION, $data, true);\n }\n if ($patientSaved) {\n $result['message'] = \"Patient Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "function createRecord(){\r\n\r\n $query_fqdn = \"\r\n SELECT\r\n d.id AS id,\r\n d.fqdn AS fqdn\r\n FROM\r\n \" . $this->referencing_table_name . \" AS d\r\n WHERE\r\n d.fqdn = '\" . $this->fqdn . \"'\r\n ORDER BY\r\n d.id DESC\r\n \";\r\n \r\n $stmt_domain = $this->conn->prepare($query_fqdn);\r\n $stmt_domain->execute();\r\n\r\n // If there isn't already in domain table given FDQN then insert it, otherwise get ID for DNS record insert\r\n if ($stmt_domain->rowCount() == 0){\r\n // query to insert record\r\n $query_insert = \"INSERT INTO \" . $this->referencing_table_name . \" SET fqdn=:fqdn\";\r\n \r\n // prepare query\r\n $stmt_insert = $this->conn->prepare($query_insert);\r\n \r\n // sanitize\r\n $this->fqdn=htmlspecialchars(strip_tags($this->fqdn));\r\n \r\n // bind values\r\n $stmt_insert->bindParam(\":fqdn\", $this->fqdn);\r\n \r\n // execute query\r\n $stmt_insert->execute();\r\n\r\n // set last inserted ID into domain for DNS record\r\n $this->domain = $this->conn->lastInsertId();\r\n }\r\n // I ALSO NEED TO IMPLEMENRT CASE WHERE FQDN ALREADY EXIST IN domain TABLE (id from SELECT previous SELECT ), BC 25.10.2021.\r\n\r\n\r\n /* DNS record */\r\n // query to insert DNS record\r\n $query = \"\r\n INSERT INTO \" . $this->table_name . \"\r\n SET type=:type, domain=:domain, name=:name, val=:val, ttl=:ttl\r\n \";\r\n \r\n // prepare query\r\n $stmt = $this->conn->prepare($query);\r\n \r\n // sanitize\r\n $this->type=htmlspecialchars(strip_tags($this->type));\r\n $this->name=htmlspecialchars(strip_tags($this->name));\r\n $this->val=htmlspecialchars(strip_tags($this->val));\r\n $this->ttl=htmlspecialchars(strip_tags($this->ttl));\r\n \r\n // bind values\r\n $stmt->bindParam(\":type\", $this->type);\r\n $stmt->bindParam(\":domain\", $this->domain); // domain doesnt come from GET directly, but ID from domain table\r\n $stmt->bindParam(\":name\", $this->name);\r\n $stmt->bindParam(\":val\", $this->val);\r\n $stmt->bindParam(\":ttl\", $this->ttl);\r\n \r\n // execute query\r\n if($stmt->execute()){\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "public function testNoDatabaseRecord(){\n $uuid = $this->generateValidUuid();\n\n //WHEN\n $response = $this->get(sprintf(self::WEB_ATTACHMENT_URI, $uuid));\n\n //THEN\n $this->assertResponseStatus($response, HttpStatus::HTTP_NOT_FOUND);\n }", "static function dailyrecord()\n {\n \t\n \t$all_game_ids = Game::listAllGameIds();\n \t\n \t$cur = time();\n\t\t$dt = strftime('%Y-%m-%d', $cur);\n\t\t//当天0:0:0的总秒数\n\t\t$today = strtotime($dt);\t\t\n\t\t//一周\n\t\t$dayago = $today - 3600*24;\n\t\t$cachestr = date('Y-m-d', $dayago);\n \t\n \tforeach ($all_game_ids as $agi) {\n \t\t \n \t\tif(!Game_stat::staticGet('game_id',$agi)) {\n // \t\t\techo $agi.\"\\n\";\n \t\t\t$newrecord = new Game_stat();\n//\t\t\t\t$newrecord->game_id = $agi;\n//\t\t\t\techo $newrecord->game_id.\"aa \\n\";\n//\t\t\t\t$newrecord->video_num = 0;\n//\t\t\t\t$newrecord->music_num = 0;\n//\t\t\t\t$newrecord->pic_num = 0;\n//\t\t\t\t$newrecord->text_num = 0;\n//\t\t\t\t$newrecord->user_num = 0;\n//\t\t\t\t$result = $newrecord->insert();\n\t\t\t\t//insert()存在问题,会产生game_stat_seq表,而且插入的数据不正确。\n\t\t\t\t$query = \"INSERT INTO game_stat(`game_id`, `video_num`, `music_num`, `pic_num`, `text_num`, `user_num`) values(\" .$agi. \",0,0,0,0,0)\";\n//\t\t\t\techo $query;\n\t\t\t\t$result = $newrecord -> query($query);\n//\t\t if (!$result) {\n//\t\t common_log_db_error($newrecord, 'INSERT', __FILE__);\n//\t\t return false;\n//\t\t }\n \t\t}\n \t\t$game_stat = Game_stat::staticGet('game_id', $agi);\n \t\tif ($game_stat && !Game_stat_history::stathisGetbyidtime($agi,$cachestr)) {\n \t\t\t$hisrecord = new Game_stat_history();\n\t\t\t\t$hisrecord->game_id = $agi;\n\t\t\t\t$hisrecord->video_num = $game_stat->video_num;\n\t\t\t\t$hisrecord->music_num = $game_stat->music_num;\n\t\t\t\t$hisrecord->pic_num = $game_stat->pic_num;\n\t\t\t\t$hisrecord->text_num = $game_stat->text_num;\n\t\t\t\t$hisrecord->user_num = $game_stat->user_num;\n\t\t\t\t$hisrecord->his_date = $cachestr;\n\t\t\t\t$result = $hisrecord->insert();\n\t\t if (!$result) {\n\t\t common_log_db_error($hisrecord, 'INSERT', __FILE__);\n\t\t return false;\n\t\t }\n \t\t\n\t \t\t$game_stat->user_num = User::getUsernumbyGame($agi);\n\t \t\t$game_stat->video_num = Notice::getNoticenumbyGameandctype(3 ,$agi);\n\t \t\t$game_stat->music_num = Notice::getNoticenumbyGameandctype(2 ,$agi);\n\t \t\t$game_stat->pic_num = Notice::getNoticenumbyGameandctype(4 ,$agi);\n\t \t\t$game_stat->text_num = Notice::getNoticenumbyGameandctype(1 ,$agi);\n\t \t\t$game_stat->update();\n\t \t\t\n\t \t\t\n \t\t}\n \t\t\n \t\tif ($game_stat) {\n \t\t\t$game = Game::staticGet('id', $agi);\n\t \t\t$gameorig = clone($game);\n\t \t\t$game->gamers_num = $game_stat->user_num;\n\t \t\t$game->notice_num = $game_stat->video_num + $game_stat->music_num + $game_stat->pic_num + $game_stat->text_num;\n\t \t\t$game->update($gameorig);\n \t\t}\n \t}\n \t\n \t \t\n }", "public function saveAgent() {\r\n // Consider wrapping the lines of code so its more\r\n // readable. Preferrably within 80-90 character length\r\n // - @vishal\r\n $sqlQuery = \"INSERT INTO users ( lname, fname, image_name, password, email, phone, enable, creation_date, address1, address2, zipcode, state, country, city, role) VALUES ('\" .\r\n parent::getLastname() . \"', '\" . \r\n parent::getFirstname() . \"', '\" . \r\n parent::getPictureName() . \"', '\" . \r\n hash(\"sha256\",parent::getPassword()) . \"', '\" . \r\n parent::getEmail() . \"', '\" . \r\n parent::getPhone() . \"', '\" .\r\n $this->enabled . \"', NOW(), '\". \r\n parent::getAddress1() .\"', '\".\r\n parent::getAddress2() .\"', '\". \r\n parent::getZipcode() .\"', '\" . \r\n parent::getState() .\"', '\" . \r\n parent::getCountry() .\"', '\" . \r\n parent::getCity() .\"', '\" . \r\n AGENT_ROLE_ID . \"');\";\r\n $result = $this->dbcomm->executeQuery($sqlQuery);\r\n \r\n if ($result != true)\r\n {\r\n echo $sqlQuery;\r\n echo \"<br><b>\" . $this->dbcomm->giveError() . \"</b>\";\r\n // As with many other lines, use single quotes '' where\r\n // string interpolation isn't required\r\n // - @vishal\r\n die(\"Error at agent saving\");\r\n }\r\n else\r\n {\r\n return 1;\r\n }\r\n }", "function check_record_exists($id_user , $id_episode , $id_parcours) {\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours AND id_episode = $id_episode\", ARRAY_A);\n\treturn $results;\n}", "protected function reportDispute($args) {\n\n if ($args['ent_date_time'] == '' || $args['ent_report_msg'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $getApptDetQry = \"select a.status,a.appt_lat,a.appt_long,a.address_line1,a.address_line2,a.created_dt,a.arrive_dt,a.appointment_dt,a.amount,a.appointment_id,a.last_modified_dt,a.mas_id from appointment a where a.appointment_dt = '\" . $args['ent_appnt_dt'] . \"' and a.slave_id = '\" . $this->User['entityId'] . \"'\";\n $apptDet = mysql_fetch_assoc(mysql_query($getApptDetQry, $this->db->conn));\n\n if ($apptDet['status'] == '4')\n return $this->_getStatusMessage(41, 3);\n\n $insertIntoReportQry = \"insert into reports(mas_id,slave_id,appointment_id,report_msg,report_dt) values('\" . $apptDet['mas_id'] . \"','\" . $this->User['entityId'] . \"','\" . $apptDet['appointment_id'] . \"','\" . $args['ent_report_msg'] . \"','\" . $this->curr_date_time . \"')\";\n mysql_query($insertIntoReportQry, $this->db->conn);\n\n if (mysql_insert_id() > 0) {\n $updateQryReq = \"update appointment set payment_status = '2' where appointment_id = '\" . $apptDet['appointment_id'] . \"'\";\n mysql_query($updateQryReq, $this->db->conn);\n\n $message = \"Dispute reported for appointment dated \" . date('d-m-Y h:i a', strtotime($apptDet['appointment_dt'])) . \" on \" . $this->appName . \"!\";\n\n $aplPushContent = array('alert' => $message, 'nt' => '13', 'n' => $this->User['firstName'] . ' ' . $this->User['last_name'], 'd' => $args['ent_appnt_dt'], 'e' => $this->User['email'], 'bid' => $apptDet['appointment_id']);\n $andrPushContent = array(\"payload\" => $message, 'action' => '13', 'sname' => $this->User['firstName'] . ' ' . $this->User['last_name'], 'dt' => $args['ent_appnt_dt'], 'smail' => $this->User['email'], 'bid' => $apptDet['appointment_id']);\n\n $this->ios_cert_path = $this->ios_uberx_driver;\n $this->ios_cert_pwd = $this->ios_mas_pwd;\n $this->androidApiKey = $this->masterApiKey;\n $push = $this->_sendPush($this->User['entityId'], array($apptDet['mas_id']), $message, '13', $this->User['email'], $this->curr_date_time, '1', $aplPushContent, $andrPushContent);\n\n $errMsgArr = $this->_getStatusMessage(85, $push);\n } else {\n $errMsgArr = $this->_getStatusMessage(86, 76);\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 't' => $insertIntoReportQry);\n }", "public function store(CreateAgentRequest $request)\n {\n $input = $request->all();\n\n\n //dd($input);\n\n\n try {\n DB::beginTransaction();\n\n $validator = validator($request->input(), [\n 'first_name' => 'required',\n 'last_name' => 'required',\n //'userID' => 'required|exists:users,userID',\n ]);\n\n if ($validator->fails()) {\n return back()->withErrors($validator);\n }\n\n $user = User::create([\n 'name' => $input['first_name'] . \" \" . $input['last_name'],\n 'email' => $input['email'],\n 'password' => Hash::make($input['password']),\n ]);\n\n $user->assignRole('agents');\n $input['user_id'] = $user->id;\n\n\n $agent = $this->agentRepository->create($input);\n $localGovt = $input['lga_id'];\n $resLGA = Lga::find($localGovt);\n\n $id = sprintf(\"%'04d\", $agent->id);\n $driverID = \"CYA\" . $resLGA->lgaId . $id;\n $input['unique_code'] = $driverID;\n $input['data_id'] = $agent->id;\n $input['model'] = \"Agent\";\n\n $biodata = $this->biodataRepository->create($input);\n\n\n DB::commit();\n Flash::success('Agent saved successfully.');\n } catch (\\Exception $exception) {\n //dd($exception->getMessage(), $exception->getLine(),$exception->getFile());\n DB::rollBack();\n Flash::error($exception->getMessage());\n }\n\n return redirect(route('agents.index'));\n }", "function record_check($conn, $node, $reg, $ip, $service)\n{\n // PFR_LOCATIONS records select\n $sel = \"select * from DB2INST1.PFR_LOCATIONS \n where (upper(AGENT_NODE) = '\" . strtoupper($node) . \"' or (upper(NODE) = '\" . strtoupper($node) . \"' and AGENT_NODE = '')) and\n substr(PFR_OBJECTSERVER, 4, 3) = '\" . $reg . \"'\";\n $stmt = db2_prepare($conn, $sel);\n $result = db2_execute($stmt);\n\n $consistency = 0;\n $id = '';\n $rec_found = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n // check list\n if (empty($row['SERVICE_NAME']))\n $consistency += CHECK_WARNING_SERVICE_NAME_IS_EMPTY;\n if (strcmp($row['SERVICE_NAME'], $service))\n $consistency += CHECK_WARNING_SERVICE_NAME_IS_NOT_EQUAL_TBSM;\n\n\n $id = $row['ID'];\n $rec_found++;\n }\n\n if ($rec_found == 0)\n return ' *'.CHECK_ABSENT;\n else if ($rec_found > 1)\n return ' *'.CHECK_DUPLICATE;\n else\n return $id.'*'.$consistency;\n}", "public function testExistentRecord()\n {\n try {\n DAL::beginTransaction();\n $assetidOne = 123;\n $typeid = 'asset';\n $sql = $this->_getInsertQuery($assetidOne, $typeid).';';\n\n $assetidTwo = 124;\n $typeid = 'asset';\n $sql .= $this->_getInsertQuery($assetidTwo, $typeid);\n\n $expected = 'asset';\n DAL::executeQueries($sql);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidOne);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidTwo);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n DAL::rollBack();\n\n } catch (PDOException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n } catch (ChannelException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n }\n\n }", "public function unsetAgentLead()\n {\n $customers = LeadDetails::where('saveType','recipient')->get();\n $cunt = 0;\n $Acunt = 0;\n $Dcunt = 0;\n foreach ($customers as $customer) {\n $id=$customer->_id;\n if(isset($customer->agent))\n {\n LeadDetails::where('_id',new ObjectID($id))->unset('agent');\n $Acunt++;\n }\n if(isset($customer->dispatchDetails))\n {\n LeadDetails::where('_id', new ObjectID($id))->update(array('dispatchDetails.agent' => (string)'NA'));\n $Dcunt++;\n }\n $cunt++;\n \n }\n echo 'count'.$cunt .'Agnt Count'.$Acunt.'In Ag count'.$Dcunt;\n }", "function gaMatch_addPlayerResult($kidPlayerId, $win, $draw, $lost) {\n //??????????????????? does record already exist - what if player change ?????????\n $match = array_search ( $kidPlayerId , $this->gamatch_gamePlayerMap);\n if ($match === FALSE) {\n $newGame = new stdData_gameUnit_extended;\n $newGame->stdRec_loadRow($row);\n $this->gamatch_gamePlayerMap[$newGame->game_kidPeriodId] = $newGame;\n ++$this->game_opponents_count;\n $this->game_opponents_kidPeriodId[] = $kidPlayerId;\n $this->game_opponents_wins[] = $win;\n $this->game_opponents_draws[] = $draw;\n $this->game_opponents_losts[] = $lost;\n $this->gagArrayGameId[] = 0;\n } else {\n $this->game_opponents_wins[$match] += $win;\n $this->game_opponents_draws[$match] += $draw;\n $this->game_opponents_losts[$match] += $lost;\n }\n}", "function cc_insert_record($offerta){\n\t\t\n\t// recupero post_id dell'agenzia, agente e autore da rif (prime due cifre)\n\t$aau = cc_get_agency($offerta->Riferimento); \n\t$agenzia = $aau['fave_property_agency']; \n\t$agente = $aau['fave_agents']; \n\t$user_id = $aau['post_author'];\n\n\t\n\t// POSTMETA - INDIRIZZO\n\t$map_address = $indirizzo = \"\";\n\t\n\t//$indirizzo = solo indirizzo (via e civico), map_adress = indirizzo completo con cap località e provincia per mappa\n\tif(!empty($offerta->Indirizzo)){\n\t\t$map_address .= (string) $offerta->Indirizzo;\n\t\t$indirizzo .= (string) $offerta->Indirizzo;\n\t}\n\tif(!empty($offerta->NrCivico)){\n\t\t$map_address .= (string) \" \".$offerta->NrCivico;\n\t\t$indirizzo .= (string) \" \".$offerta->NrCivico;\n\t}\n\t\n\t// compilo map_address con cap, località e provincia solo se l'indirizzo (via + civico) è compilato\n\t// se non lo è vuol dire che non deve essere resa noto l'indirizzo esatto dell'immobile\n\tif(!empty($offerta->Comune) and !empty($map_address)){\n\t\t\n\t\t$comune = (string) $offerta->Comune;\n\t\t$comune = trim($comune);\n\t\t$map_address .= \", \";\n\t\t\n\t\t$cp = cc_get_cap_prov($comune);\n\t\tif(!empty($cp)) $map_address .= $cp['cap'].\" \"; \t\t\n\t\t\n\t\t$map_address .= $comune;\n\t\tif(!empty($cp)) $map_address .= \" (\".$cp['prov'].\")\"; \n\t\t\n\t}else{\n\t\t\n\t\t$cp = array();\n\t\t\n\t}\n\t\n\t$map_address = trim($map_address);\n\tif($map_address[0] == ',') $map_address = substr($map_address, 2);\t\n\t\n\t$latitudine = (string) $offerta->Latitudine;\n\t$longitudine = (string) $offerta->Longitudine;\n\t\n\t// da cometa arriva con virgola decimale\n\tif(!empty($latitudine)) $latitudine = str_replace(\",\", \".\", $latitudine);;\n\tif(!empty($longitudine)) $longitudine = str_replace(\",\", \".\", $longitudine);;\n\n\tif(!empty($latitudine) and !empty($longitudine)){\n\t\t$map_coords = $latitudine .\", \". $longitudine;\t\t\n\t}else{\n\t\t$map_coords = \"\";\n\t}\n\t\n\t// Caratteristiche aggiuntive\n\t$af = array();\n\tif(!empty($offerta->Locali)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Locali\", \"fave_additional_feature_value\" => (string) $offerta->Locali);\n\t}\n\tif(!empty($offerta->Cucina)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Cucina\", \"fave_additional_feature_value\" => (string) $offerta->Cucina);\n\t}\n\tif(!empty($offerta->Box)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Box\", \"fave_additional_feature_value\" => (string) $offerta->Box);\n\t}\n\t$fave_additional_features_enable = (empty($af)) ? \"disable\" : \"enable\";\n\t\n\t// controllo se questo nuovo immobile deve essere messo in vetrina o meno e se sì tolgo vetrina a quello precedente\n\t//$vetrina = cc_ho_vetrina( (string) $offerta->IdAgenzia, (string) $offerta->Riferimento);\n\t\n\t// GESTIONE PREZZO / TRATTATIVA RISERVATA\n\t$prezzo = (string) $offerta->Prezzo;\n\t$flag_trattativa_riservata = (string) $offerta->TrattativaRiservata;\n\t\n\tif($flag_trattativa_riservata == '1'){\n\t\t$prezzo = \"Trattativa Riservata\";\n\t\t$fave_private_note = \"Prezzo richiesto €\".$prezzo;\t\t\n\t}else{\n\t\t$fave_private_note = \"\";\n\t}\n\t\n\t\t\n\t// META INPUT VARIABILI\n\t$meta_input = array(\n\t\t//\"fave_featured\" => $vetrina,\n\t\t\"fave_property_size\" => (int) $offerta->Mq, \n\t\t\"fave_property_bedrooms\" => (int) $offerta->Camere, \n\t\t\"fave_property_bathrooms\" => (int) $offerta->Bagni, \n\t\t\"fave_property_id\" => (string) $offerta->Riferimento, \n\t\t\"fave_property_price\" => $prezzo, \n\t\t\"fave_property_map_address\" => (string) $map_address, \n\t\t\"fave_property_location\" => $map_coords, \n\t\t\"fave_additional_features_enable\" => $fave_additional_features_enable,\n\t\t\"additional_features\" => $af,\n\t\t\"fave_property_address\" => $indirizzo,\n\t\t\"houzez_geolocation_lat\" => $latitudine,\n\t\t\"houzez_geolocation_long\" => $longitudine,\n\t\t\"fave_energy_class\" => (string) $offerta->Classe,\n\t\t\"fave_energy_global_index\" => (string) $offerta->IPE.\" \".$offerta->IPEUm, \n\t\t\"fave_private_note\" => $fave_private_note, \n\t\t\"_id_cometa\" => (string) $offerta->Idimmobile\n\t\t\n\t);\t\n\n\tif(!empty($cp)) $meta_input['fave_property_zip'] = $cp['cap'];\n\t\n\t// META INPUT VALORI FISSI\n\t$meta_input['slide_template'] = \"default\";\n\t$meta_input['fave_property_size_prefix'] = \"M²\";\n\t$meta_input['fave_property_country'] = \"IT\";\n\t$meta_input['fave_agents'] = $agente;\n\t$meta_input['fave_property_agency'] = $agenzia;\n\t$meta_input['fave_floor_plans_enable'] = \"disabled\";\n\t$meta_input['fave_agent_display_option'] = \"agent_info\";\n\t$meta_input['fave_payment_status'] = \"not_paid\";\n\t$meta_input['fave_property_map_street_view'] = \"hide\";\n\t$meta_input['houzez_total_property_views'] = \"0\";\n\t$meta_input['houzez_views_by_date'] = \"\";\n\t$meta_input['houzez_recently_viewed'] = \"\";\n\t$meta_input['fave_multiunit_plans_enable'] = \"disable\";\n\t$meta_input['fave_multi_units'] = \"\";\n\t$meta_input['fave_single_top_area'] = \"v2\";\n\t$meta_input['fave_single_content_area'] = \"global\";\n\t$meta_input['fave_property_land_postfix'] = \"M²\";\n\t$meta_input['fave_property_map'] = \"1\";\n\t\n\t// MANCANO FOTO, LE METTO DOPO\n\t\n\t$DataAggiornamento = new DateTime( (string) $offerta->DataAggiornamento ); // $offerta->DataAggiornamento formato 2018-07-25T00:00:00+01:00\n\t$post_modified = $DataAggiornamento->format(\"Y-m-d H:i:s\"); \t\n\t\n\t\n\t$posts_arg = array(\n\t\t\"post_author\" \t=> $user_id, \n\t\t\"post_content\" \t=> (string) $offerta->Descrizione,\n\t\t\"post_title\" \t=> (string) $offerta->Titolo,\n\t\t\"post_excerpt\" \t=> (string) $offerta->Descrizione,\n\t\t\"post_status\" \t=> \"publish\", \n\t\t\"post_type\" \t=> \"property\",\n\t\t\"post_modified\" => (string) $post_modified,\n\t\t\"post_modified_gmt\" => (string) $post_modified,\n\t\t\"comment_status\" \t=> \"closed\",\n\t\t\"ping_status\" \t=> \"closed\",\n\t\t\"guid\" \t\t \t=> wp_generate_uuid4(),\n\t\t\"meta_input\" \t=> $meta_input\n\t);\n\t\n\t// Restituisce l'ID del post se il post è stato aggiornato con success nel DB. Se no restituisce 0.\n\t$post_id = wp_insert_post( $posts_arg, true ); \n\t\n\tif (is_wp_error($post_id)) {\n\t\t$errors = $post_id->get_error_messages();\n\t\t$dbg = \"Errore durante insert record\\n\";\n\t\tforeach ($errors as $error) {\n\t\t\t$dbg .= $error.\"\\n\";\n\t\t}\n\t\treturn $dbg;\t\t\n\t}\n\t\n\t// continuo con inseriemnto foto e categorie\n\t\n\t$foto = array();\n\tfor($nf = 1; $nf < 16; $nf++){\n\t\t\n\t\t$foto_field = \"FOTO\".$nf;\n\t\t$foto_url = (string) $offerta->$foto_field;\n\t\tif(!empty($foto_url)) $foto[] = $foto_url;\n\t\t\n\t}\n\t\n\t// inserisce solo se le foto non sono ancora presenti, restituisce array con id posts delle foto nuove\n\t$foto_nuove = cc_import_images($foto, $post_id, true);\n\t\n\t// Se vi sono nuove foto le aggiungo alla tabella postmeta \n\tif(!empty($foto_nuove)){\n\t\tcc_insert_images_meta($foto_nuove, $post_id); // Non restituisce feedback\n\t}\n\t\n\t\t\n\t// GESTIONE CATEGORIE - SE IL VALORE CATEGORIE (TERM) NON ESISTE ANCORA VIENE AGGIUNTO \n\t\n\t// Categoria \"property_type\" (Appartamento, villa, box etc) - SINGOLO\n\t$property_type = (string) $offerta->Tipologia;\n\tif(!empty($property_type)) $property_type_results = cc_add_term_taxonomy($post_id, \"property_type\", array( $property_type ));\n\t\n\t// Categoria \"property_city\" (Città) - SINGOLO\n\t$property_city = (string) $offerta->Comune;\n\tif(!empty($property_city)) $property_city_results = cc_add_term_taxonomy($post_id, \"property_city\", array( $property_city ));\n\t\n\t\n\t// Categoria \"property_area\" (Zona / Quartiere) - SINGOLO\n\t$property_area = (string) $offerta->Quartiere;\n\t$property_area = trim($property_area);\n\tif(!empty($property_area)) $property_area_results = cc_add_term_taxonomy($post_id, \"property_area\", array( $property_area ));\t\n\t\n\t// Categoria \"property_feature\" (caratteristiche) - MULTI\n\t$property_feature = array();\n\tif(!empty($offerta->Box)) $property_feature[] = \"Box Auto\";\n\tif(!empty($offerta->Box)) $property_feature[] = \"Posto Auto\";\n\tif((string) $offerta->Terrazzo == '-1') $property_feature[] = \"Terrazzo\";\n\tif((string) $offerta->Balcone == '-1') $property_feature[] = \"Balcone\";\n\tif((string) $offerta->GiardinoCondominiale == '-1' or (string) $offerta->GiardinoPrivato == '-1' ) $property_feature[] = \"Giardino\";\n\t//if((string) $offerta->GiardinoPrivato == '-1') $property_feature[] = \"Giardino Privato\";\n\t\n\tif(!empty($property_feature)) $property_feature_results = cc_add_term_taxonomy($post_id, \"property_feature\", $property_feature );\n\t\n\t// FINITO INSERT RECORD\n\t\n\t// update configs xml\n\tcc_update_configs(\"inserted\", 1, true);\t\n\tcc_import_immobili_error_log(\"Inserted: \".$post_id);\n\t\n\treturn \"inserted\";\n\t\n}", "public function saveMatch($fixture,$dato){\n $foundfix = $this->getFixtures($fixture->getId());\n\n /*Si no encontramos el fixture, no guardamos el match*/\n if($foundfix!=null) {\n\n $datos = $this->getMatch( null );\n if ($datos == null) {\n $datos = array();\n\n /* Creamos desde cero en cache */\n array_push( $datos, $dato );\n $this->createObject( 'Match', $datos );\n\n //Si tiene goals llamamos SMSEvent\n if(count($dato->getGoals())>0){\n $sms = new SMSEvent();\n $sms->sendSMS($dato->getGoals());\n }\n }else{\n /* Buscamos si existe */\n $dato_match = $this->getMatch( $dato->getIdMatch() );\n if($dato_match != null){\n /* Update Match */\n for ($i = 0; $i < count($datos); $i++) {\n if($datos[$i]->getIdMatch()==$dato->getIdMatch()){\n $datos[$i]=$dato;\n }\n }\n //Si tiene mas goals que antes llamamos SMSEvent\n if(count($dato->getGoals())>count($dato_match->getGoals())){\n $sms = new SMSEvent();\n $sms->sendSMS($dato->getGoals());\n }\n $this->updateObject( 'Match', $datos );\n }else{\n /* Creamos Match */\n array_push( $datos, $dato );\n $this->createObject( 'Match', $datos );\n }\n }\n }\n }", "public function run()\n {\n //\n $if_exist_status = Store::first();\n\n if (!$if_exist_status){\n $record= new Store();\n $record->name='Guatemala';\n $record->address='3a. Calle 3-60, Zona 9, Guatemala.';\n $record->schedule='Lunes a Viernes: 08:00 am a 06:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176619666.1766065589.1119473&navigate=yes';\n $record->maps='https://goo.gl/maps/zRztEAJrRD3VXxEt5';\n $record->save();\n\n $record= new Store();\n $record->name='Hyundai Roosevelt';\n $record->address='Calzada Roosevelt 18-23 Zona 11';\n $record->schedule='Lunes a viernes: 8:oo am / 7:00 pm Sábado: 8:00 am / 5:00 pm Domingo: 10:00 am a 5:00 pm';\n $record->number = '+502 23288879';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176619666.1765868982.2147455&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/EYxhipDvLg4mELQU8';\n $record->save();\n\n $record= new Store();\n $record->name='Didea Zona 9';\n $record->address='1ra Calle 7-69 zona 9';\n $record->schedule='Lunes a viernes: 8:oo am / 5:00 pm Sábado: 8:00 am / 3:00 pm Domingo: Cerrado';\n $record->number = '+502 23288881';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176619666.1766131125.2236623&navigate=yes&utm_campaign=waze_website&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/rvNz5ohuS2Je14nq9';\n $record->save();\n\n $record= new Store();\n $record->name='Didea Majadas';\n $record->address='Majadas 28 Av. 5-20 Z. 11';\n $record->schedule='Lunes a viernes: 7:oo am / 5:30 pm Sábado: 7:00 am / 12:00 pm Domingo: Cerrado';\n $record->number = '+502 23288880';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176554130.1765803446.10792480&navigate=yes&utm_campaign=waze_website&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/VevRKiZgu45oAchE9';\n $record->save();\n\n $record= new Store();\n $record->name='Autos Premier';\n $record->address='Petapa 36-09 zona 12';\n $record->schedule='Lunes a viernes: 7:oo am / 5:30 pm Sábado: 7:00 am / 12:00 pm Domingo: Cerrado';\n $record->number = '+502 23288880';\n $record->waze='https://ul.waze.com/ul?ll=14.60526980%2C-90.53910730&navigate=yes&utm_campaign=waze_website&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/k4ainh2cp7yjDBvV6';\n $record->save();\n\n $record= new Store();\n $record->name='PDI - Amatitlán';\n $record->address='Zona Franca Amatitlán';\n $record->schedule='Lunes a Viernes: 08:00 am a 06:00 pm';\n $record->number = '+502 23288880';\n $record->waze='https://ul.waze.com/ul?place=ChIJyXOdaZgHiYURlrdG-g9_hYA&ll=14.47018360%2C-90.63399190&navigate=yes&utm_campaign=waze_website&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/VkoWMed6gj3gtGCd8';\n $record->save();\n\n $record= new Store();\n $record->name='Agencia Multimarca Quetzaltenango';\n $record->address='Diagonal 2, 33-18, zona 8, DIDEA Xela, Quetzaltenango';\n $record->schedule= 'Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJk1EV16CijoURPR2xd8pP0-U&ll=14.85898840%2C-91.51863860&navigate=yes';\n $record->maps='https://goo.gl/maps/fNSaHZJT2C8GXQKD9';\n $record->save();\n\n $record= new Store();\n $record->name='Agencia Multimarca Rio Hondo';\n $record->address='Km 126.5 Carretera al Atlántico, Santa Cruz, Río Hondo, Zacapa';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJi85QTV4gYo8RShNGA_zlVTQ&ll=15.00657760%2C-89.66519330&navigate=yes';\n $record->maps='https://g.page/AutoCentroEvoluSion?share';\n $record->save();\n\n $record= new Store();\n $record->name='Agencia Multimarca Santa Lucia';\n $record->address='Km 86.5 Carretera a Santa Lucía Cotzumalguapa, Escuintla.';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJwfJa2_wmiYURiYJ4iofL5jY&ll=14.33395500%2C-91.01180150&navigate=yes';\n $record->maps='';\n $record->save();\n\n $record= new Store();\n $record->name='Agencia Multimarca Carretera a El Salvador';\n $record->address='Carretera a El Salvador KM.16.5 Parque Automotriz';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176619665.1766524334.17186114&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/zoGFFwoiXCkzxP91A';\n $record->save();\n\n $record= new Store();\n $record->name='Blue Box Peugeot';\n $record->address='Carretera a El Salvador KM.16.5 Parque Automotriz';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?preview_venue_id=176619665.1766524334.17186114&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/KzGx3Ba1k2RMeKdY6';\n $record->save();\n\n $record= new Store();\n $record->name='Centro de Servicio Multimarca 19 calle';\n $record->address='19 Calle 17-37';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?ll=14.59746120%2C-90.54194860&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://ul.waze.com/ul?ll=14.59746120%2C-90.54194860&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->save();\n\n $record= new Store();\n $record->name='Centro de Servicio Multimarca Vistares';\n $record->address='Avenida Petapa 36 calle, Sótano 1 Centro Comercial Vistares';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm Sábado: 08:00 am a 12:00 pm';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJoZxvI8OhiYUR4pHi2a6gvMk&ll=14.58329140%2C-90.54459440&navigate=yes&utm_campaign=default&utm_source=waze_website&utm_medium=lm_share_location';\n $record->maps='https://goo.gl/maps/Q2qHFCwGFvjnJAqA9';\n $record->save();\n\n $record= new Store();\n $record->name='Petén';\n $record->address='1a. Av. Y 1a. Calle Ciudad Satélite\n Finca Pontehill, Santa Elena, Petén';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm\n Sábado: 08:00 am a 12:00 pm ';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJMwbABS2NX48RAeO5SRcqSf4&ll=16.91470700%2C-89.88040570&navigate=yes';\n $record->maps='https://goo.gl/maps/DiCyrSgcvGPsqkDP8';\n $record->save();\n\n $record= new Store();\n $record->name='Retalhuleu';\n $record->address='Km 179 San Sebastián, Retalhuleu.';\n $record->schedule='Lunes a Viernes: 08:00 am a 05:00 pm\n Sábado: 08:00 am a 12:00 pm ';\n $record->number = '+502 23288888';\n $record->waze='https://ul.waze.com/ul?place=ChIJ4SSo5drtjoUROg2MiAHlddQ&ll=14.56941970%2C-91.64885360&navigate=yes';\n $record->maps='https://goo.gl/maps/NR81je5G3Te8eKQXA';\n $record->save();\n }\n }", "public function insert () {\n\t\t$GLOBALS[\"logger\"]->debug(\"report:insert\");\n\t\t\n\t\t$newRec = ORM::for_table (self::REPORT_TABLE)->create();\n\t\t$newRec->clip_id = $this->clip->id;\n\t\t$newRec->master_id = $this->masterId;\n\t\t$sngid = NULL;\n\t\tif (!is_null($this->song)) {\n\t\t\t$GLOBALS[\"logger\"]->debug('There is a song with ID ' . $this->song->id);\n\t\t\t$sngid = $this->song->id;\n\t\t}\n\t\t$newRec->song_id = $sngid;\n\t\t$newRec->singalong = $this->singalong;\n\t\t$newRec->seq_num = $this->seqNum;\n\t\t$newRec->user_id = $this->user->id;\n\t\t$newRec->sound_type = $this->soundType;\n\t\t$newRec->sound_subtype = $this->soundSubtype;\n\t\t$newRec->performer_type = $this->performerType;\n\t\t$newRec->flagged = $this->flagged;\n\t\t$GLOBALS[\"logger\"]->debug(\"Saving newRec\");\n\t\t$newRec->save();\n\t\t$GLOBALS[\"logger\"]->debug(\"insert: saved new record into reports table\");\n\t\t$this->id = $newRec->id();\n//\t\t$insstmt = \"INSERT INTO REPORTS (CLIP_ID, MASTER_ID, SEQ_NUM, USER_ID, SOUND_TYPE, \" .\n//\t\t\t\" SOUND_SUBTYPE, SONG_ID, PERFORMER_TYPE, SINGALONG, FLAGGED) \" .\n//\t\t\t\" VALUES ($clpid, $mstrid, $seqn, $usrid, $sndtyp, $sndsbtyp, $sngid, $prftyp, $sngalng, $flgd)\";\n\t\t$this->writePerformers();\n\t\t$this->writeInstruments();\n\t\treturn $newRec->id();\n\t}", "private function _recordVisit() {\n $txnTable = $this->settings['txnTable'];\n $dtlTable = $this->settings['dtlTable'];\n $isRES = BoolYN( $this->_isResource() );\n $rVal = false;\n\n // Construct the INSERT Statement and Record It\n $dsvID = \"CONCAT(DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'), '-', \" . \n nullInt($this->settings['SiteID']) . \", '-', \" . \n \"'\" . sqlScrub($this->settings['RequestURL']) . \"')\";\n $sqlStr = \"INSERT INTO `$txnTable` (`dsvID`, `DateStamp`, `SiteID`, `VisitURL`, `Hits`, `isResource`, `UpdateDTS`) \" .\n \"VALUES ( MD5($dsvID), DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'), \" . nullInt($this->settings['SiteID']) . \",\" .\n \" '\" . sqlScrub($this->settings['RequestURL']) . \"',\" .\n \" 1, '$isRES', Now() )\" .\n \"ON DUPLICATE KEY UPDATE `Hits` = `Hits` + 1,\" .\n \" `UpdateDTS` = Now();\" .\n \"INSERT INTO `$dtlTable` (`SiteID`, `DateStamp`, `VisitURL`, `ReferURL`, `SearchQuery`, `isResource`, `isSearch`, `UpdateDTS`) \" .\n \"VALUES ( \" . nullInt($this->settings['SiteID']) . \", DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'),\" . \n \" '\" . sqlScrub($this->settings['RequestURL']) . \"',\" .\n \" '\" . sqlScrub($this->settings['Referrer']) . \"',\" .\n \" '', '$isRES', 'N', Now() );\";\n $rslt = doSQLExecute( $sqlStr );\n if ( $rslt > 0 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function createCrowdAgent($data){\n\n\t\t$workerId = $data['WorkerId'];\n\n\t\tif($id = CrowdAgent::where('platformAgentId', $workerId)->where('softwareAgent_id', 'amt')->pluck('_id')) \n\t\t\treturn $id;\n\t\telse {\n\t\t\t$agent = new CrowdAgent;\n\t\t\t$agent->_id= \"crowdagent/amt/$workerId\";\n\t\t\t$agent->softwareAgent_id= 'amt';\n\t\t\t$agent->platformAgentId = $workerId;\n\t\t\t$agent->save();\t\t\n\t\t\treturn $agent->_id;\n\t\t}\n\t}", "private function createRecordClassInitialTest( $dbModel, $dbRecords, $dbDetailRecords = []) {\n foreach ($dbRecords as $dbRecord) {\n // var_dump($dbRecord);\n echo 'Nombre: ' . $dbRecord[\"name\"] . \"\\n\";\n\n /*\n Version Create - Find\n */\n try {\n \n /*\n * Using collections will allow to have access to multiple methods\n * https://laravel.com/docs/6.0/collections\n */\n // dd(collect($dbRecord)->except(['permissions']));\n // dd(collect($dbRecord)->except($dbDetailRecords));\n\n // This will produce and error if the key 'permissions' (Detail records) is included \n // $newModel = $dbModel::create($dbRecord);\n // $newModel = $dbModel::create(collect($dbRecord)->except(['permissions'])->toArray());\n $newModel = $dbModel::create(collect($dbRecord)->except($dbDetailRecords)->toArray());\n\n /*\n * Process Detail Records set\n * \n */\n /*\n //\n // Single Detail reference Records\n //\n if ( isset($dbRecord['permissions']) ) {\n foreach ($dbRecord['permissions'] as $dbDetail) {\n // var_dump($dbDetail);\n echo 'Permission: ' . $dbDetail . \"\\n\";\n } \n }\n */\n //\n // Multiple Detail reference Records\n //\n // dd($dbDetailRecords);\n foreach ($dbDetailRecords as $dbDetailRecord) {\n echo var_dump($dbDetailRecord);\n if ( isset($dbRecord[$dbDetailRecord]) ) {\n // var_dump($dbRecord[$dbDetailRecord]);\n\n foreach ($dbRecord[$dbDetailRecord] as $dbDetail) {\n var_dump($dbDetail);\n // echo 'Permission: ' . $dbDetail . \"\\n\";\n }\n } \n }\n }\n catch (Exception $ex) {\n dd('stop here');\n \n }\n // @todo: Include the QueryException to allow to continue the excecution\n catch ( \\Illuminate\\Database\\QueryException $ex) {\n echo $ex->getMessage();\n }\n catch ( Spatie\\Permission\\Exceptions\\RoleAlreadyExists $ex) {\n echo $ex->getMessage();\n dd(var_dump($dbRecord));\n }\n finally {\n dd('After Error' . var_dump($newModel));\n \n }\n }\n \n }", "function report_it($id)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t//First checking weather object exists or not\r\n\t\tif($this->exists($id))\r\n\t\t{\r\n\t\t\tif(userid())\r\n\t\t\t{\r\n\t\t\t\tif(!$this->report_check($id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$db->insert(\r\n\t\t\t\t\t\ttbl($this->flag_tbl),\r\n\t\t\t\t\t\tarray('type','id','userid','flag_type','date_added'),\r\n\t\t\t\t\t\tarray($this->type,$id,userid(),post('flag_type'),NOW())\r\n\t\t\t\t\t);\r\n\t\t\t\t\te(sprintf(lang('obj_report_msg'), lang($this->name)),'m');\r\n\t\t\t\t} else {\r\n\t\t\t\t\te(sprintf(lang('obj_report_err'), lang($this->name)));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\te(lang(\"you_not_logged_in\"));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\te(sprintf(lang(\"obj_not_exists\"), lang($this->name)));\r\n\t\t}\r\n\t}", "function record_incident($tag,$email,$message){\n $query = \"INSERT INTO HISTORY (TIME,TAG,EMAIL,MESSAGE) VALUES (\" . time() . \",'\" . $tag . \"','\" . $email . \"','\" . $message . \"')\" ; \n if(!$this->query($query)) return false;\n return true;\t \n }" ]
[ "0.51552266", "0.4772641", "0.47175062", "0.46376115", "0.46119517", "0.46100888", "0.45843157", "0.45701784", "0.45586094", "0.45474917", "0.4532829", "0.45082062", "0.44557235", "0.44137526", "0.4402685", "0.439246", "0.4387997", "0.43790662", "0.43784818", "0.43778485", "0.4377756", "0.43719384", "0.43541613", "0.43484312", "0.43466333", "0.4330926", "0.43290573", "0.43233913", "0.43141147", "0.43139687" ]
0.638491
0
! Generate 10 character salt !
private function generateSalt() { $possibleValues = '0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ'; $salt = ''; for($i = 0; $i < 10; $i++) { $salt .= $possibleValues[mt_rand(0, strlen($possibleValues)-1)]; } return $salt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function GenSalt()\n {\n $chars = array_merge(range('a','z'), range('A','Z'), range(0, 9));\n $max = count($chars) - 1;\n $str = \"\";\n $length = 22;\n \n while($length--) {\n shuffle($chars);\n $rand = mt_rand(0, $max);\n $str .= $chars[$rand];\n }\n return $str . '$';\n }", "function generateSalt() {\n $length = 10;\n $characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n $charsLength = strlen($characters) - 1;\n $string = \"\";\n for($i=0; $i<$length; $i++) {\n $randNum = mt_rand(0, $charsLength);\n $string .= $characters[$randNum];\n }\n return $string;\n}", "private function generateSalt()\n {\n return str_random(16);\n }", "function generateSalt()\n\t{\n\t\t$lets = range('a', 'z');\n\t\t$ups = range('A', 'Z');\n\t\t$nums = range('0', '9');\n\t\t\n\t\t$special = array('*', '%', '#');\n\t\t\n\t\t$union = $lets + $nums + $ups + $special; //Generate an array with numbers, letters, and special characters\n\t\t\n\t\t$salt = '';\n\t\t\n\t\tfor($i = 0; $i < 5; $i++) //Create a salt of length 5, supplying random values\n\t\t{\n\t\t\t$r = rand(0, count($union)-1);\n\t\t\t$salt .= $union[$r];\n\t\t}\n\t\t\n\t\treturn $salt;\n\t}", "private function generateSalt(){\n return substr(md5(rand(0, 999)), 0, 5);\n }", "function createNewSalt(){\n\t$characters = 'abcdefghijklmnopqrstuvwxyz-:;><*#%&()ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n\n\t$salt = \"\";\n\n\tfor ($i = 0; $i<32; $i++){\n $salt = $salt.$characters[rand(0,strlen($characters)-1)];\n\t}\n\t\n\treturn $salt;\n}", "public static function make_salt()\n {\n\n \t$chars = str_split('0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz');\n \n \t\t$newSalt = '';\n \t\tfor ($i = 0; $i < 16; $i++) \n \t\t{\n \t\t\t$newSalt .= $chars[rand(0, count($chars) - 1)];\n \t\t}\n\n \t\treturn $newSalt;\n }", "private function genSalt() {\r\n $random = 0;\r\n $rand64 = \"\";\r\n $salt = \"\";\r\n $random = rand(); // Seeded via initialize()\r\n // Crypt(3) can only handle A-Z a-z ./\r\n $rand64 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n $salt = substr( $rand64, $random % 64, 1 ) . substr( $rand64, ($random / 64) % 64, 1 );\r\n $salt = substr( $salt, 0, 2 ); // Just in case\r\n return($salt);\r\n }", "function generateSaltPassword () {\n\treturn base64_encode(random_bytes(12));\n}", "function salt($len=16) {\n $pool = range('!', '~');\n $high = count($pool) - 1;\n $tmp = '';\n for ($c = 0; $c < $len; $c++) {\n $tmp .= $pool[rand(0, $high)];\n }\n return $tmp;\n}", "public function createSalt()\n{\n\t$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n\treturn substr(str_shuffle(str_repeat($pool, 5)), 0, $this->saltLength);\n}", "function createSalt()\n{\n $text = uniqid(Rand(), TRUE);\n return substr($text, 0, 5);\n\n}", "function getPasswordSalt(){\n\t\treturn substr( str_pad( dechex( mt_rand() ), 8, '0', STR_PAD_LEFT ), -8 );\n\t}", "private function generateSalt() {\n $salt = base64_encode(pack(\"H*\", md5(microtime())));\n \n return substr($salt, 0, $this->saltLng);\n }", "function generate_salt($len = 5) {\n $valid_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#$%^*()_-!';\n $valid_len = strlen($valid_characters) - 1;\n $salt = \"\";\n\n for ($i = 0; $i < $len; $i++) {\n $salt .= $valid_characters[rand(0, $valid_len)];\n }\n\n return $salt;\n}", "static function generateSalt($strength=10) {\n return self::saltStart($strength) . random_string(22, './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');\n }", "public static function regenerateSalt()\n\t{\n\t\treturn PzPHP_Helper_String::createCode(mt_rand(40,45), PzPHP_Helper_String::ALPHANUMERIC_PLUS);\n\t}", "function generateSalt() {\n\t$numberOfDesiredBytes = 16;\n\t$salt = random_bytes($numberOfDesiredBytes);\n\treturn $salt;\n}", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "function generate_salt($length = 16)\n {\n $possible_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678';\n $rand_string = '';\n for($i = 0; $i < $length; ++$i)\n {\n $rand_string .= $possible_chars[random_int(0, strlen($possible_chars) - 1)];\n }\n return utf8_encode($rand_string);\n }", "function makeSalt() {\r\n static $seed = \"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n $algo = (PHP_VERSION_ID >= 50307) ? '$2y' : '$2a'; //DON'T CHANGE THIS!!\r\n $strength = '$12'; //too high will time out script.\r\n $salt = '$';\r\n for ($i = 0; $i < 22; $i++) {\r\n $salt .= substr($seed, mt_rand(0, 63), 1);\r\n }\r\n return $algo . $strength . $salt;\r\n}", "public static function generateSalt() {\n $salt = '$2a$13$';\n $salt = $salt . md5(mt_rand());\n return $salt;\n }", "function createSalt()\r\n\r\n{\r\n\r\n $string = md5(uniqid(rand(), true));\r\n\r\n return substr($string, 0, 5);\r\n\r\n}", "private function genSalt()\n {\n \treturn md5(time() + rand());\n }", "function createSalt(){\r\n \t\t\t$string = md5(uniqid(rand(), true));\r\n \t\treturn substr($string, 0, 3);\r\n\t\t}", "function createSalt()\n {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n }", "public function genSalt($length = 5)\n {\n if ($length < 1) { return; }\n $slt = '';\n $min = sfConfig::get('app_min_salt_char');\n $max = sfConfig::get('app_max_salt_char');\n for ($i = 0; $i < $length; $i++)\n {\n $slt .= chr(rand($min, $max));\n }\n return $slt;\n }", "public function salt() {\r\n return substr(md5(uniqid(rand(), true)), 0, 10);\r\n }", "function makeSalt() {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n}" ]
[ "0.8620291", "0.86027485", "0.8424969", "0.83353364", "0.8298978", "0.8280773", "0.8258466", "0.82321376", "0.82104486", "0.8195782", "0.81943995", "0.8189444", "0.8149346", "0.81050533", "0.8100473", "0.80642945", "0.80625105", "0.80612385", "0.8059442", "0.8059442", "0.8057777", "0.8038006", "0.80339867", "0.7967363", "0.7946547", "0.7943235", "0.790682", "0.78982365", "0.7894826", "0.78842527" ]
0.863523
0
Crop an image to the given size. Either the width or the height can be omitted and the current width or height will be used. If no offset is specified, the center of the axis will be used. If an offset of TRUE is specified, the bottom of the axis will be used. // Crop the image to 200x200 pixels, from the center $image>crop(200, 200);
public function crop($width, $height, $offset_x = NULL, $offset_y = NULL) { if ($width > $this->width) { // Use the current width $width = $this->width; } if ($height > $this->height) { // Use the current height $height = $this->height; } if ($offset_x === NULL) { // Center the X offset $offset_x = round(($this->width - $width) / 2); } elseif ($offset_x === TRUE) { // Bottom the X offset $offset_x = $this->width - $width; } elseif ($offset_x < 0) { // Set the X offset from the right $offset_x = $this->width - $width + $offset_x; } if ($offset_y === NULL) { // Center the Y offset $offset_y = round(($this->height - $height) / 2); } elseif ($offset_y === TRUE) { // Bottom the Y offset $offset_y = $this->height - $height; } elseif ($offset_y < 0) { // Set the Y offset from the bottom $offset_y = $this->height - $height + $offset_y; } // Determine the maximum possible width and height $max_width = $this->width - $offset_x; $max_height = $this->height - $offset_y; if ($width > $max_width) { // Use the maximum available width $width = $max_width; } if ($height > $max_height) { // Use the maximum available height $height = $max_height; } $this->_do_crop($width, $height, $offset_x, $offset_y); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crop($width, $height, $offset_x=null, $offset_y=null);", "protected function _do_crop($width, $height, $offset_x, $offset_y)\n {\n $image = $this->_create($width, $height);\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Execute the crop\n if (imagecopyresampled($image, $this->_image, 0, 0, $offset_x, $offset_y, $width, $height, $width, $height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "public function crop(IImageInformation $src, $x, $y, $width, $height);", "public function sizeImg($width, $height, $crop = true);", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "public static function crop($image, $width, $height, array $start = [0, 0])\n {\n if (!isset($start[0], $start[1])) {\n throw new InvalidParamException('$start must be an array of two elements.');\n }\n\n return static::ensureImageInterfaceInstance($image)\n ->copy()\n ->crop(new Point($start[0], $start[1]), new Box($width, $height));\n }", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "public function crop($value = null)\n {\n $this->crop = $value;\n }", "public function crop($value) {\n return $this->setProperty('crop', $value);\n }", "public function imageAdapterGdCropJpgWithOffset(UnitTester $I)\n {\n $I->wantToTest('Image\\Adapter\\Gd - crop()');\n\n $this->checkJpegSupport($I);\n\n $image = new Gd(dataDir('assets/images/example-jpg.jpg'));\n\n $outputDir = 'tests/image/gd';\n $width = 200;\n $height = 200;\n $offsetX = 200;\n $offsetY = 200;\n $cropImage = 'cropwithoffset.jpg';\n $output = outputDir($outputDir . '/' . $cropImage);\n $hash = 'fffff00000000000';\n\n // Resize to 200 pixels on the shortest side\n $image->crop($width, $height, $offsetX, $offsetY)\n ->save($output)\n ;\n\n $I->amInPath(outputDir($outputDir));\n\n $I->seeFileFound($cropImage);\n\n $actual = $image->getWidth();\n $I->assertSame($width, $actual);\n\n $actual = $image->getHeight();\n $I->assertSame($height, $actual);\n\n $actual = $this->checkImageHash($output, $hash);\n $I->assertTrue($actual);\n\n $I->safeDeleteFile($cropImage);\n }", "function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public function crop($target_width, $target_height, $crop_X, $crop_Y, $crop_width, $crop_height, $save_to_file, $output_mimetype=NULL) {\n\t\t// create a blank image of the target dimensions\n\t\t$cropped_image = imagecreatetruecolor($target_width, $target_height);\n\t\t// resample the image to the cropped constraints\n\t\timagecopyresampled(\n\t\t\t\t$cropped_image,\n\t\t\t\t$this->source_image,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t$crop_X,\n\t\t\t\t$crop_Y,\n\t\t\t\t$target_width,\n\t\t\t\t$target_height,\n\t\t\t\t$crop_width,\n\t\t\t\t$crop_height\n\t\t);\n\t\t// save the cropped image and create a new Image \n\t\t$output_image_mimetype = $output_mimetype ? $output_mimetype : $this->source_image_mimetype;\n\t\tImageLib::save($cropped_image, $save_to_file, $output_image_mimetype);\n\t\treturn new static($save_to_file);\n\t}", "public function crop($value)\n {\n $this->args = array_merge($this->args, ['crop' => $value]);\n\n return $this;\n }", "public function crop()\n {\n }", "function myImageCrop($imgSrc,$newfilename,$thumbWidth=100,$output=false,$thumbHeight=0){\n \t\n\t\tif($thumbHeight == 0) $thumbHeight = $thumbWidth;\n\t\t\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($this->path.$imgSrc); \n\t\t\n\t\t\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\n\t\t ///-------------------------------------------------------- \n\t\t //setting the crop size \n\t\t //-------------------------------------------------------- \n\t\t if($width > $height){ \n\t\t\t $biggestSide = $width; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/2); \n\t\t }else{ \n\t\t\t $biggestSide = $height; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/7); \n\t\t } \n\t\t \n\t\t //--------------------------------------------------------\n\t\t// Creating the thumbnail\n\t\t//--------------------------------------------------------\n\t\t$thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); \n\t\timagecopyresampled($thumb, $myImage, 0, 0, $c1['x'], $c1['y'], $thumbWidth, $thumbHeight, $cropWidth, $cropHeight); \n\n\t\tif($output == false){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t\t}\n\t\t}else{\n\t\t\t//final output \n\t\t\t//imagejpeg($thumb);\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($thumb);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($thumb);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($thumb);\n\t\t\t}\n\t\t} \n\t\timagedestroy($thumb); \n\t}", "function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "function imagecropauto($image, $mode = -1, $threshold = 0.5, $color = -1)\n{\n}", "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "function flexibleCropper($source_location, $desc_location=null,$crop_size_w=null,$crop_size_h=null)\n\t{\n\t list($src_w, $src_h) = getimagesize($source_location);\n\n\t $image_source = imagecreatefromjpeg($source_location);\n\t $image_desc = imagecreatetruecolor($crop_size_w,$crop_size_h);\n\n\t/*\n\t if ($crop_size_w>$crop_size_h) {$my_crop_size_w=null;}\n\t elseif ($crop_size_h>$crop_size_w)\n\t {$my_crop_size_h=null;\n\n\t if (is_null($my_crop_size_h) and !is_null($my_crop_size_w))\n\t { $my_crop_size_h=$src_h*$my_crop_size_w/$src_w; }\n\t elseif (!is_null($my_crop_size_h))\n\t { $my_crop_size_w=$src_w*$my_crop_size_h/$src_h; }\n\t*/\n\n\t if ($src_w<$src_h) {$my_crop_size_h=$src_h*$crop_size_w/$src_w;} else {$my_crop_size_h=$crop_size_h;}\n\t if ($src_h<$src_w) {$my_crop_size_w=$src_w*$crop_size_h/$src_h;} else {$my_crop_size_w=$crop_size_w;}\n\t// echo \"($my_crop_size_w-$my_crop_size_h)\";\n\t if ($my_crop_size_w>$crop_size_w) {$additional_x=round(($crop_size_w-$my_crop_size_w)/2);} else {$additional_x=0;}\n\t if ($my_crop_size_h>$crop_size_h) {$additional_y=round(($crop_size_h-$my_crop_size_h)/2);} else {$additional_y=0;}\n\n\t $off_x=round($src_w/2)-round($my_crop_size_w/2);\n\t $off_y=round($src_h/2)-round($my_crop_size_h/2)+$additional_y;\n\t $off_w=(round($src_w/2)+round($my_crop_size_w/2))-$off_x;\n\t $off_h=(round($src_h/2)+round($my_crop_size_h/2))-$off_y;\n\n\t imagecopyresampled($image_desc, $image_source,$additional_x, $additional_y, $off_x, $off_y, $my_crop_size_w, $my_crop_size_h, $off_w, $off_h);\n\n\t if (!is_null($desc_location))\n\t imagejpeg($image_desc, $desc_location,100);\n\t else\n\t imagejpeg($image_desc);\n\t}", "public static function crop($img_name, $x, $y, $type = 'fit')\n {\n $full_path = storage_path('app/public/'.$img_name);\n $full_thumb_path = storage_path('app/public/thumbs/'.$img_name);\n $thumb = Image::make($full_path);\n\n if ($type == 'fit')\n self::fit($thumb, $x, $y, $full_thumb_path);\n else\n self::resize($thumb, $x, $y, $full_thumb_path);\n }", "public function crop($thumb_size = 250, $crop_percent = .5, $image_type = 'image/jpeg')\n {\n $width = $this->getWidth();\n $height = $this->getHeight();\n //set the biggest dimension\n if($width > $height)\n {\n $biggest = $width;\n }else{\n $biggest = $height;\n }\n //init the crop dimension based on crop_percent\n $cropSize = $biggest * $crop_percent;\n //get the crop cordinates\n $x = ($width - $cropSize) / 2;\n $y = ($height - $cropSize) / 2;\n\n //create the final thumnail\n $this->thumbImage = imagecreatetruecolor($thumb_size, $thumb_size);\n //fill background with white\n $bgc = imagecolorallocate($this->thumbImage, 255, 255, 255);\n imagefilledrectangle($this->thumbImage, 0, 0, $thumb_size, $thumb_size, $bgc);\n \n imagecopyresampled($this->thumbImage, $this->image, 0, 0, $x, $y, $thumb_size, $thumb_size, $cropSize, $cropSize );\n }", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "public function runCropResize(Image $image, int $width, int $height) : Image\n\t{\n\t\tlist($resize_width, $resize_height) = $this->resolveCropResizeDimensions($image, $width, $height);\n\t\t$zoom = $this->getCrop()[2];\n\t\t$image->resize($resize_width * $zoom, $resize_height * $zoom, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t\t\t\n\t\tlist($offset_x, $offset_y) = $this->resolveCropOffset($image, $width, $height);\n\t\t\t\n\t\treturn $image->crop($width, $height, $offset_x, $offset_y);\n\t}", "public function cropThumb($px, $offset = null)\n {\n $xOffset = 0;\n $yOffset = 0;\n\n if (null !== $offset) {\n if ($this->width > $this->height) {\n $xOffset = $offset;\n $yOffset = 0;\n } else if ($this->width < $this->height) {\n $xOffset = 0;\n $yOffset = $offset;\n }\n }\n\n $scale = ($this->width > $this->height) ? ($px / $this->height) : ($px / $this->width);\n\n $wid = round($this->width * $scale);\n $hgt = round($this->height * $scale);\n\n // Create a new image output resource.\n if (null !== $offset) {\n $this->resizeImage($wid, $hgt, $this->imageFilter, $this->imageBlur);\n $this->cropImage($px, $px, $xOffset, $yOffset);\n } else {\n $this->cropThumbnailImage($px, $px);\n }\n\n $this->width = $px;\n $this->height = $px;\n return $this;\n }", "function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}" ]
[ "0.78189194", "0.66439575", "0.64920396", "0.6277231", "0.62416786", "0.6236862", "0.6133884", "0.6116691", "0.6055783", "0.6050034", "0.6044341", "0.60259306", "0.6005839", "0.59723556", "0.59148073", "0.588516", "0.58260214", "0.5798846", "0.5798543", "0.57856876", "0.57582694", "0.5735208", "0.56388056", "0.56174946", "0.56042504", "0.5598642", "0.5595397", "0.5576943", "0.5542257", "0.553137" ]
0.6647961
1
Add a watermark to an image with a specified opacity. Alpha transparency will be preserved. If no offset is specified, the center of the axis will be used. If an offset of TRUE is specified, the bottom of the axis will be used. // Add a watermark to the bottom right of the image $mark = Image::factory('upload/watermark.png'); $image>watermark($mark, TRUE, TRUE);
public function watermark(Image $watermark, $offset_x = NULL, $offset_y = NULL, $opacity = 100) { if ($offset_x === NULL) { // Center the X offset $offset_x = round(($this->width - $watermark->width) / 2); } elseif ($offset_x === TRUE) { // Bottom the X offset $offset_x = $this->width - $watermark->width; } elseif ($offset_x < 0) { // Set the X offset from the right $offset_x = $this->width - $watermark->width + $offset_x; } if ($offset_y === NULL) { // Center the Y offset $offset_y = round(($this->height - $watermark->height) / 2); } elseif ($offset_y === TRUE) { // Bottom the Y offset $offset_y = $this->height - $watermark->height; } elseif ($offset_y < 0) { // Set the Y offset from the bottom $offset_y = $this->height - $watermark->height + $offset_y; } // The opacity must be in the range of 1 to 100 $opacity = min(max($opacity, 1), 100); $this->_do_watermark($watermark, $offset_x, $offset_y, $opacity); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function watermark($watermark, $offset_x=null, $offset_y=null, $opacity=null);", "public function add_watermark_to_( $image ) {\n\n\t\t// TODO Select graphics library from plugin settings (this is GD, add Imagick)\n\n\t\t$watermark_file = get_attached_file( $this->settings['watermark']['image'] );\n\n\t\t$watermark = imagecreatefrompng( $watermark_file );\n\t\t$new_image = imagecreatefromjpeg( $image );\n\n\t\t$margin = ( $this->settings['watermark']['position'] ) ? $this->settings['watermark']['position'] : 50;\n\n\t\t$watermark_width = imagesx( $watermark );\n\t\t$watermark_height = imagesy( $watermark );\n\t\t$new_image_width = imagesx( $new_image );\n\t\t$new_image_height = imagesy( $new_image );\n\n\t\tif ( $this->settings['watermark']['position'] == 'topleft' ) {\n\t\t\t$x_pos = $margin;\n\t\t\t$y_pos = $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'topright' ) {\n\t\t\t$x_pos = $new_image_width - $watermark_width - $margin;\n\t\t\t$y_pos = $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'bottomleft' ) {\n\t\t\t$x_pos = $margin;\n\t\t\t$y_pos = $new_image_height - $watermark_height - $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'bottomright' ) {\n\t\t\t$x_pos = $new_image_width - $watermark_width - $margin;\n\t\t\t$y_pos = $new_image_height - $watermark_height - $margin;\n\t\t} else {\n\t\t\t$x_pos = ( $new_image_width / 2 ) - ( $watermark_width / 2 );\n\t\t\t$y_pos = ( $new_image_height / 2 ) - ( $watermark_height / 2 );\n\t\t}\n\n\t\tif ( $this->settings['watermark']['position'] == 'repeat' ) {\n\t\t\timagesettile( $new_image, $watermark );\n\t\t\timagefilledrectangle( $new_image, 0, 0, $new_image_width, $new_image_height, IMG_COLOR_TILED );\n\t\t} else {\n\t\t\timagecopy( $new_image, $watermark, $x_pos, $y_pos, 0, 0, $watermark_width, $watermark_height );\t\t\t\t\n\t\t}\n\n\t\t$success = imagejpeg( $new_image, $image, 100 );\n\t\timagedestroy( $new_image );\n\t}", "public function put_watermark( $watermark, $opacity = 0.5, $position = 'center', $offsetX = 0, $offsetY = 0, $file_index = null ) {\r\n\t\t\tif ( !is_file( $watermark ) ) {\r\n\t\t\t\tthrow new Exception( 'Watermark file does not exist (' . htmlspecialchars( $watermark ) . ')' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$watermark_image = imagecreatefromstring( file_get_contents( $watermark ) );\r\n\t\t\tif ( !$watermark_image ) {\r\n\t\t\t\tthrow new Exception( 'GD extension cannot create an image from the Watermark image' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$watermark_width = imagesx( $watermark_image );\r\n\t\t\t$watermark_height = imagesy( $watermark_image );\r\n\t\t\t\r\n\t\t\t// keep the opacity value in range\r\n\t\t\t$opacity = (int) ((( $opacity < 0 ) ? 0 : (( $opacity > 1 ) ? 1 : $opacity )) * 100);\r\n\t\t\tif ( $opacity < 100 ) {\r\n\t\t\t\t// workaround for transparent images because PHP's imagecopymerge does not support alpha channel\r\n\t\t\t\timagealphablending( $watermark_image, false );\r\n\t\t\t\timagefilter( $watermark_image, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * ((100 - $opacity) / 100) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor( $i = 0; $i < $this->Files_ready_count; $i++ ) {\r\n\t\t\t\tif ( $file_index !== null && $file_index != $i ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif ( in_array( $this->Files_ready[$i]['ext'], self::FTY_IMAGES_GD ) ) {\r\n\t\t\t\t\t$target_image = $this->create_image( $i );\r\n\t\t\t\t\t$target_width = imagesx( $target_image );\r\n\t\t\t\t\t$target_height = imagesy( $target_image );\r\n\r\n\t\t\t\t\tswitch( $position ) {\r\n\t\t\t\t\t\tcase 'top': {\r\n\t\t\t\t\t\t\t$x = ($target_width / 2) - ($watermark_width / 2) + $offsetX;\r\n\t\t\t\t\t\t\t$y = $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'left': {\r\n\t\t\t\t\t\t\t$x = $offsetX;\r\n\t\t\t\t\t\t\t$y = ($target_height / 2) - ($watermark_height / 2) + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'right': {\r\n\t\t\t\t\t\t\t$x = $target_width - $watermark_width + $offsetX;\r\n\t\t\t\t\t\t\t$y = ($target_height / 2) - ($watermark_height / 2) + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'bottom': {\r\n\t\t\t\t\t\t\t$x = ($target_width / 2) - ($watermark_width / 2) + $offsetX;\r\n\t\t\t\t\t\t\t$y = $target_height - $watermark_height + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'top left': {\r\n\t\t\t\t\t\t\t$x = $offsetX;\r\n\t\t\t\t\t\t\t$y = $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'top right': {\r\n\t\t\t\t\t\t\t$x = $target_width - $watermark_width + $offsetX;\r\n\t\t\t\t\t\t\t$y = $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'bottom left': {\r\n\t\t\t\t\t\t\t$x = $offsetX;\r\n\t\t\t\t\t\t\t$y = $target_height - $watermark_height + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tcase 'bottom right': {\r\n\t\t\t\t\t\t\t$x = $target_width - $watermark_width + $offsetX;\r\n\t\t\t\t\t\t\t$y = $target_height - $watermark_height + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t\tdefault: {\t// center\r\n\t\t\t\t\t\t\t$x = ($target_width / 2) - ($watermark_width / 2) + $offsetX;\r\n\t\t\t\t\t\t\t$y = ($target_height / 2) - ($watermark_height / 2) + $offsetY;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// put the watermark on the target image\r\n\t\t\t\t\timagecopy( $target_image, $watermark_image, $x, $y, 0, 0, $watermark_width, $watermark_height );\r\n\r\n\t\t\t\t\t$this->save_image( $target_image, $i );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// destroy the image ressource to free the ram\r\n\t\t\timagedestroy( $watermark_image );\r\n\t\t}", "function escort_watermark_image( $filename, $upload_dir, $watermark_image ) {\n\n $original_image_path = trailingslashit( $upload_dir['basedir'] ) . $filename;\n \n $image_resource = new Imagick( $original_image_path );\n \n //$image_resource->blurImage( 20, 10 );\n\n $watermark_resource = new Imagick($watermark_image);\n\n // tamaños\n $iWidth = $image_resource->getImageWidth();\n $iHeight = $image_resource->getImageHeight();\n\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n\n if ($iHeight < $wHeight || $iWidth < $wWidth) {\n // resize the watermark\n $watermark_resource->scaleImage($iWidth, $iHeight);\n \n // get new size\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n }\n\n\n // calculate the position\n $x = ($iWidth - $wWidth) / 2;\n $y = ($iHeight - $wHeight) / 2;\n\n $image_resource->compositeImage( $watermark_resource, Imagick::COMPOSITE_OVER, $x, $y );\n \n return save_watermarked_image( $image_resource, $original_image_path, $upload_dir );\n \n}", "public function watermarkAction()\n {\n $watermarkPath = __DIR__ . '/../../../data/media/watermark.png';\n $image = __DIR__ . '/../../../data/media/test.jpg';\n\n $watermarkThumb = $this->thumbnailer->create($watermarkPath);\n $watermarkThumb->resize(100, 100);\n\n $watermark = $this->thumbnailer->createWatermark($watermarkThumb, [-1, -1], .3);\n $thumb = $this->thumbnailer->create($image, [], [$watermark]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/watermark_test.jpg');\n\n return false;\n }", "private function applyWatermark(ImageInterface $image, ImageInterface $watermark)\n {\n $size = $image->getSize();\n $wSize = $watermark->getSize();\n\n $bottomRight = new Point($size->getWidth() - $wSize->getWidth(), $size->getHeight() - $wSize->getHeight());\n\n $image->paste($watermark, $bottomRight);\n\n return $image;\n }", "function create_watermark($image_path, $data)\n\t{\n\t\tee()->image_lib->clear();\n\n\t\t$config = $this->set_image_config($data, 'watermark');\n\t\t$config['source_image'] = $image_path;\n\n\t\tee()->image_lib->initialize($config);\n\n\t\t// watermark it!\n\n\t\tif ( ! ee()->image_lib->watermark())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tee()->image_lib->clear();\n\n\t\treturn TRUE;\n\t}", "public function watermark()\n {\n $bMargin = $this->getBreakMargin();\n\n // Get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n\n // Disable auto-page-break\n $this->SetAutoPageBreak(true, 1);\n\n // Define the path to the image that you want to use as watermark.\n\n $fontName = \"Helvetica\";\n $fontSize = 135;\n $fontStyle = \"B\";\n\n // Calcular ancho de la cadena\n $widthCadena = $this->GetStringWidth(trim(\"MY TEXT\"), $fontName, $fontStyle);\n $factorCentrado = round(($widthCadena * sin(deg2rad(45))) / 2, 0);\n\n // Get the page width/height\n $myPageWidth = $this->getPageWidth();\n $myPageHeight = $this->getPageHeight();\n\n // Find the middle of the page and adjust.\n $myX = ($myPageWidth / 2) - $factorCentrado - 10;\n $myY = ($myPageHeight / 2) - $factorCentrado + 5;\n\n // Set the transparency of the text to really light\n $this->SetAlpha(0.09);\n\n // Rotate 45 degrees and write the watermarking text\n $this->StartTransform();\n $this->Rotate(45, $myX, $myY);\n $this->SetFont($fontName, $fontStyle, $fontSize);\n $this->Text($myX, $myY, trim($this->watermark_text));\n $this->StopTransform();\n\n // Reset the transparency to default\n $this->SetAlpha(1);\n // Restore the auto-page-break status\n // $this->SetAutoPageBreak($auto_page_break, $bMargin);\n\n // Set the starting point for the page content\n $this->setPageMark();\n }", "function gallery_watermark($path){\n $image = new Imagick();\n $image->readImage(getcwd(). $path);\n\n // Open the watermark image\n // Important: the image should be obviously transparent with .png format\n $watermark = new Imagick();\n $watermark->readImage(getcwd(). \"/asset/images/watermark.png\");\n\n // Retrieve size of the Images to verify how to print the watermark on the image\n $img_Width = $image->getImageWidth();\n $img_Height = $image->getImageHeight();\n $watermark_Width = $watermark->getImageWidth();\n $watermark_Height = $watermark->getImageHeight();\n\n // // Check if the dimensions of the image are less than the dimensions of the watermark\n // // In case it is, then proceed to \n // if ($img_Height < $watermark_Height || $img_Width < $watermark_Width) {\n // // Resize the watermark to be of the same size of the image\n // $watermark->scaleImage($img_Width, $img_Height);\n\n // // Update size of the watermark\n // $watermark_Width = $watermark->getImageWidth();\n // $watermark_Height = $watermark->getImageHeight();\n // }\n\n // Calculate the position\n $x = ($img_Width - $watermark_Width) / 2;\n $y = ($img_Height - $watermark_Height) / 2;\n\n // Draw the watermark on your image\n $image->compositeImage($watermark, Imagick::COMPOSITE_OVER, $x, $y);\n\n\n // From now on depends on you what you want to do with the image\n // for example save it in some directory etc.\n // In this example we'll Send the img data to the browser as response\n // with Plain PHP\n // $image->writeImage(\"/test_watermark/<kambing class=\"\"></kambing>\" . $image->getImageFormat()); \n // header(\"Content-Type: image/\" . $image->getImageFormat());\n // echo $image;\n\n // Or if you prefer to save the image on some directory\n // Take care of the extension and the path !\n $image->writeImage(getcwd(). $path); \n }", "function watermark($anchor,$markImgFile,$padding=5,$alpha=50,&$autosave=null) \n { \n if(empty($anchor) || empty($markImgFile) || !file_exists($markImgFile)) \n { \n return $this; \n } \n \n $anchor=strtolower(trim($anchor)); \n if(!in_array($anchor,array('lt','rt','lb','rb','center'))) \n { \n $anchor='rb'; \n } \n \n if($padding<0) \n { \n $padding=0; \n } \n if($padding>10) \n { \n $padding=10; \n } \n \n $_tmpImage=null; \n \n //mark image info \n list($_mw,$_mh,$_mt)=getimagesize($markImgFile); \n switch($_mt) \n { \n case IMAGETYPE_GIF: \n $_tmpImage = imagecreatefromgif($markImgFile); \n break; \n case IMAGETYPE_JPEG: \n $_tmpImage = imagecreatefromjpeg($markImgFile); \n break; \n case IMAGETYPE_PNG: \n $_tmpImage = imagecreatefrompng($markImgFile); \n break; \n default: \n $_tmpImage = null; \n break; \n } \n \n if(!is_resource($_tmpImage)) \n { \n return $this; \n } \n \n $pos=array(); \n switch($anchor) \n { \n case 'lt': \n $pos[0]=$padding; \n $pos[1]=$padding; \n break; \n case 'rt': \n $pos[0]=$this->_width-$_mw-$padding; \n $pos[1]=$padding; \n break; \n case 'lb': \n $pos[0]=$padding; \n $pos[1]=$this->_height-$_mh-$padding; \n break; \n case 'rb': \n $pos[0]=$this->_width-$_mw-$padding; \n $pos[1]=$this->_height-$_mh-$padding; \n break; \n case 'center': \n $pos[0]=($this->_width-$_mw-$padding)*0.5; \n $pos[1]=($this->_height-$_mh-$padding)*0.5; \n break; \n } \n \n imagecopymerge($this->_image,$_tmpImage,$pos[0],$pos[1],0,0,$_mw,$_mh,50); \n imagedestroy($_tmpImage); \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n 'wm', \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n \n }", "public function watermark($overlay, $position = 'center', $opacity = 1, $xOffset = 0, $yOffset = 0) {\r\n $this->watermark = array(\"overlay\" => $overlay, \"position\" => $position, \"opacity\" => $opacity, \"xOffset\" => $xOffset, \"yOffset\" => $yOffset);\r\n return $this;\r\n }", "public static function watermark(){\n\n}", "private static function addWatermark($image, $watermark, $padding = 0)\n {\n // Check if the watermark is bigger than the image\n $image_width = $image->getImageWidth();\n $image_height = $image->getImageHeight();\n $watermark_width = $watermark->getImageWidth();\n $watermark_height = $watermark->getImageHeight();\n\n if ($image_width < $watermark_width + $padding || $image_height < $watermark_height + $padding)\n {\n return false;\n }\n\n // Calculate each position\n $positions = array();\n $positions[] = array($image_width - $watermark_width - $padding, $image_height - $watermark_height - $padding);\n $positions[] = array(0 + $padding, $image_height - $watermark_height - $padding);\n\n // Initialization\n $min = null;\n $min_colors = 0;\n\n // Calculate the number of colors inside each region and retrieve the minimum\n foreach($positions as $position)\n {\n $colors = $image->getImageRegion($watermark_width, $watermark_height, $position[0], $position[1])->getImageColors();\n\n if ($min === null || $colors <= $min_colors)\n {\n $min = $position;\n $min_colors = $colors;\n }\n }\n\n // Draw the watermark\n $image->compositeImage($watermark, Imagick::COMPOSITE_OVER, $min[0], $min[1]);\n\n return true;\n }", "function print_water_marked_image($path){\n $image = new Imagick();\n $image->readImage(_LOCAL_.$path);\n\n $height = $image->getImageHeight();\n $width = $image->getImageWidth();\n\n $watermark = new Imagick();\n $watermark->readImage($_SERVER[DOCUMENT_ROOT].__WATER_MARK_PATH__);\n $watermark = $watermark->flattenImages();\n $watermark->setImageOpacity(0.3);\n $watermark->setImageOrientation(Imagick::COLOR_ALPHA);\n\n $water_height = $watermark->getImageHeight();\n $water_width = $watermark->getImageWidth();\n\n $canvas = new Imagick();\n $canvas->newImage($width,$height,new ImagickPixel('white'));\n $canvas->setImageFormat('png');\n $canvas->compositeImage($image,imagick::COMPOSITE_OVER, 0, 0);\n\n $cal_margin_width = ($water_width-($width%$water_width))/2;\n $cal_margin_height = ($water_height-($height%$water_height))/2;\n $count_x = ($width-$width%$water_width)/$water_width;\n $count_y = ($height-$height%$water_height)/$water_height;\n for($i=0; $i<=$count_x;$i++){\n for ($j=0; $j <=$count_y; $j++) {\n $j+=2;\n if(!($i%2)){\n $canvas->compositeImage($watermark,imagick::COMPOSITE_OVER, $i*$water_width-$cal_margin_width, $j*$water_height-$cal_margin_height);\n }\n }\n }\n\n header('Content-type: image/png');\n echo $canvas;\n $image->destroy();\n $watermark->destroy();\n $canvas->destroy();\n}", "function create_watermark($source_file_path, $output_file_path)\r\n\t{\r\n\t\t$photo \t\t= imagecreatefromjpeg($source_file_path);\r\n\t\t$watermark \t= imagecreatefrompng($this->watermark_file);\r\n\t\t\r\n\t\t/* untuk mengatasi image dengan type png-24*/\r\n\t\timagealphablending($photo, true);\r\n\t\t\r\n\t\t$photo_x \t\t= imagesx($photo);\r\n\t\t$watermark_x \t= imagesx($watermark);\r\n\t\t$photo_y\t\t= imagesy($photo); \r\n\t\t$watermark_y\t= imagesy($watermark);\r\n\t\t\r\n\t\timagecopy($photo, $watermark, (($photo_x/2) - ($watermark_x/2)), (($photo_y/2) - ($watermark_y/2)), 0, 0, $watermark_x, $watermark_y);\r\n\t\timagejpeg($photo, $output_file_path, 100);\r\n\t}", "public function watermark(string $file, int $position = Image::WATERMARK_TOP_LEFT, int $opacity = 100): Image\n\t{\n\t\t// Check if the image exists\n\n\t\tif(file_exists($file) === false)\n\t\t{\n\t\t\tthrow new PixlException(vsprintf('The watermark image [ %s ] does not exist.', [$file]));\n\t\t}\n\n\t\t// Make sure that opacity is between 0 and 100\n\n\t\t$opacity = max(min((int) $opacity, 100), 0);\n\n\t\t// Add watermark to the image\n\n\t\t$this->processor->watermark($file, $position, $opacity);\n\n\t\treturn $this;\n\t}", "function watermarkText21Image ($SourceFile,$WaterMarkText) {\n header(\"Content-type: image/jpg\");\n //Using imagecopymerge() to create a translucent watermark\n \n // Load the image on which watermark is to be applied\n $original_image = imagecreatefromjpeg($SourceFile);\n // Get original parameters\n list($original_width, $original_height, $original_type, $original_attr) = getimagesize($original_image); \n \n // create watermark with orig size\n $watermark = imagecreatetruecolor(200, 60);\n \n $original_image = imagecreatefromjpeg($SourceFile);\n \n // Define text\n $font = $_SERVER['DOCUMENT_ROOT'].'/include/captcha/fonts/moloto.otf';\n $white = imagecolorallocate($watermark, 255, 255, 255);\n // Add some shadow to the text\n imagettftext($watermark, 18, 0, 30, 35, $white, $font, $WaterMarkText);\n \n // Set the margins for the watermark and get the height/width of the watermark image\n $marge_right = 10;\n $marge_bottom = 10;\n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n \n // Merge the watermark onto our photo with an opacity (transparency) of 50%\n imagecopymerge($original_image, \n $watermark,\n imagesx($original_image)/2 - $sx/2 , \n imagesy($original_image) /2 - $sy/2,\n 0, \n 0, \n imagesx($watermark), \n imagesy($watermark),\n 20\n );\n \n // Save the image to file and free memory\n imagejpeg($original_image, null, 100); //$SourceFile\n imagedestroy($original_image);\n}", "function _watermarkImageGD($file, $desfile, $wm_file, $position, $imgobj) {\r\n global $zoom;\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $image = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $image = @imagecreatefrompng($file);\r\n } else {\r\n \t$image = @imagecreatefromgif($file);\r\n }\r\n if (!$image) { return false; }\r\n \r\n $imginfo_wm = getimagesize($wm_file);\r\n $imgtype_wm = ereg_replace(\".*\\.([^\\.]*)$\", \"\\\\1\", $wm_file);\r\n if ($imgtype_wm == \"jpg\" || $imgtype_wm == \"jpeg\") {\r\n $watermark = @imagecreatefromjpeg($wm_file);\r\n } else {\r\n $watermark = @imagecreatefrompng($wm_file);\r\n }\r\n if (!$watermark) { return false; }\r\n \r\n $imagewidth = imagesx($image);\r\n $imageheight = imagesy($image);\r\n $watermarkwidth = $imginfo_wm[0];\r\n $watermarkheight = $imginfo_wm[1];\t\t\r\n $width_left = $imagewidth - $watermarkwidth;\r\n $height_left = $imageheight - $watermarkheight;\r\n switch ($position) {\r\n case \"TL\": // Top Left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TM\": // Top middle \r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TR\": // Top right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"CL\": // Center left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n default:\r\n case \"C\": // Center (the default)\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"CR\": // Center right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"BL\": // Bottom left\r\n $startwidth = $width_left >= 5 ? 5 : $width_left;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BM\": // Bottom middle\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BR\": // Bottom right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n }\r\n imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);\r\n @$zoom->platform->unlink($desfile);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($image, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($image, $desfile);\r\n } else {\r\n \timagegif($image, $desfile);\r\n }\r\n imagedestroy($image);\r\n imagedestroy($watermark);\r\n return true;\r\n }", "function _watermarkImageIM($file, $desfile, $wm_file, $position, $imgobj) {\r\n $imginfo_wm = getimagesize($wm_file);\r\n\r\n $imagewidth = $imgobj->_size[0];\r\n $imageheight = $imgobj->_size[1];\r\n $watermarkwidth = $imginfo_wm[0];\r\n $watermarkheight = $imginfo_wm[1];\t\t\r\n $width_left = $imagewidth - $watermarkwidth;\r\n $height_left = $imageheight - $watermarkheight;\r\n switch ($position) {\r\n case \"TL\": // Top Left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TM\": // Top middle \r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TR\": // Top right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"CL\": // Center left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n default:\r\n case \"C\": // Center (the default)\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"CR\": // Center right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"BL\": // Bottom left\r\n $startwidth = $width_left >= 5 ? 5 : $width_left;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BM\": // Bottom middle\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BR\": // Bottom right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n }\r\n\r\n\t\t$cmd = $this->_IM_path.\"convert -draw \\\"image over $startwidth,$startheight 0,0 '$wm_file'\\\" \\\"$file\\\" \\\"$desfile\\\"\";\r\n\t\t$output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n \r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function watermark()\n\t{\n\t\treturn ($this->wm_type === 'overlay') ? $this->overlay_watermark() : $this->text_watermark();\n\t}", "public function watermark($image)\n {\n if (! $this->isInterventionImage($image)) {\n $image = $this->make($image);\n }\n\n $watermark = $this->watermarkImagePath;\n $image->fill($watermark);\n\n return $image;\n }", "public function apply($imgSource, $imgTarget, $imgWatermark, $position = 0, $type = 'image', $padding=10){\n\t\t# Set watermark position\n\t\t$this->watermarkPosition = $position;\n\n\t\t# Get function name to use for create image\n\t\t$functionSource = $this->getFunction($imgSource, 'open');\n\t\t$this->imgSource = $functionSource($imgSource);\n\n\t\t# Check is image or text\n if($type == 'text'){\n $font_height=imagefontheight(10);\n $font_width=imagefontwidth(5);\n\n $width = (strlen($imgWatermark)*$font_width)+10+5 ; // Canvas width = String with, added with some margin\n $height=$font_height + 10+5; // Canvas height = String height, added with some margin\n\n $stamp = imagecreate($width, $height);\n imagecolorallocate($stamp, 235, 235, 235);\n $text_color = imagecolorallocate ($stamp, 3, 3, 3);\n imagestring($stamp, 25, 10, 7, $imgWatermark, $text_color);\n\n $this->imgWatermark = $stamp;\n\n $sx = imagesx($stamp);\n $sy = imagesy($stamp);\n $sizesWatermark = ['width' => $sx, 'height' => $sy];\n }else{\n # Get function name to use for create image\n $functionWatermark = $this->getFunction($imgWatermark, 'open');\n $this->imgWatermark = $functionWatermark($imgWatermark);\n\n # Get watermark images size\n $sizesWatermark = $this->getImgSizes($this->imgWatermark);\n }\n\n # Get watermark position\n $positions = $this->getPositions($padding);\n\n # Apply watermark\n imagecopy($this->imgSource, $this->imgWatermark, $positions['x'], $positions['y'], 0, 0, $sizesWatermark['width'], $sizesWatermark['height']);\n\n # Get function name to use for save image\n $functionTarget = $this->getFunction($imgTarget, 'save');\n\n # Save image\n $functionTarget($this->imgSource, $imgTarget, 100);\n\n # Destroy temp images\n imagedestroy($this->imgSource);\n imagedestroy($this->imgWatermark);\n\t}", "public function applyWaterMark($sourceFileName, $waterMarkFileName, $horizontalPosition, $verticalPosition, $horizontalMargin, $verticalMargin, $opacity, $shrinkToFit, $stretchToFit) \n {\n $sourceImage = $this->loadImage($sourceFileName);\n \n if ($sourceImage) {\n $waterMarkImage = $this->loadImage($waterMarkFileName);\n\n if ($waterMarkImage) {\n //get image properties\n $sourceWidth = imagesx($sourceImage);\n $sourceHeight = imagesy($sourceImage);\n $waterMarkWidth = imagesx($waterMarkImage);\n $waterMarkHeight = imagesy($waterMarkImage);\n\n if (($shrinkToFit && ($waterMarkWidth > $sourceWidth || $waterMarkHeight > $sourceHeight)) || \n (($stretchToFit && $waterMarkWidth < $sourceWidth && $waterMarkHeight < $sourceHeight))) {\n $maxHeight = $sourceHeight;\n\n $maxWidth = $sourceWidth;\n\n if ($horizontalPosition === 'left' || $horizontalPosition === 'right') { \n $maxWidth -= $horizontalMargin;\n }\n\n if ($verticalPosition === 'top' || $verticalPosition === 'bottom') { \n $maxHeight -= $verticalMargin;\n }\n\n if ($maxWidth > 0 && $maxHeight > 0) {\n $waterMarkImageTemp = $waterMarkImage;\n \n $waterMarkImage = null;\n \n $this->resizeVirtualImage($waterMarkImageTemp, $waterMarkImage, $maxHeight, $maxWidth, false, null);\n \n $waterMarkWidth = imagesx($waterMarkImage);\n \n $waterMarkHeight = imagesy($waterMarkImage);\n \n imagedestroy($waterMarkImageTemp);\n }\n }\n\n //calculate stamp position\n $destX = 0;\n if ($horizontalPosition === 'left') {\n $destX = $horizontalMargin;\n }\n elseif ($horizontalPosition === 'right') {\n $destX = $sourceWidth - $waterMarkWidth - $horizontalMargin;\n }\n else { //center\n $destX = ($sourceWidth - $waterMarkWidth) / 2;\n }\n\n $destY = 0;\n if ($verticalPosition === 'top') {\n $destY = $verticalMargin;\n }\n elseif ($verticalPosition === 'bottom') {\n $destY = $sourceHeight - $waterMarkHeight - $verticalMargin;\n }\n else { //middle\n $destY = ($sourceHeight - $waterMarkHeight) / 2;\n }\n \n //stamp the watermark\n if ($opacity === 100) {\n imagecopy($sourceImage, $waterMarkImage, $destX, $destY, 0, 0, $waterMarkWidth, $waterMarkHeight);\n }\n else if ($opacity !== 0) {\n imagecopymerge($sourceImage, $waterMarkImage, $destX, $destY, 0, 0, $waterMarkWidth, $waterMarkHeight, $opacity);\n } \n\n //delete original image\n unlink($sourceFileName);\n\n //save the resulted image\n $this->saveImage($sourceImage, $sourceFileName);\n\n //free memory resource\n imagedestroy($waterMarkImage);\n }\n\n //free memory resource\n imagedestroy($sourceImage);\n }\n }", "public static function watermark($image, $watermarkImage, array $start = [0, 0])\n {\n if (!isset($start[0], $start[1])) {\n throw new InvalidParamException('$start must be an array of two elements.');\n }\n\n $img = self::ensureImageInterfaceInstance($image);\n $watermark = self::ensureImageInterfaceInstance($watermarkImage);\n $img->paste($watermark, new Point($start[0], $start[1]));\n\n return $img;\n }", "function Watermarker($stampPath, //chemin du logo\r\n\t\t\t\t $vAlign=POSITION_TOP, // alignement vertical du logo\r\n\t\t\t\t $hAlign=POSITION_LEFT, // alignement horizontal du logo\r\n\t\t\t\t $vMargin = 5, //marge verticale du logo\r\n\t\t\t\t $hMargin = 5, // marge horizontale du logo\r\n\t\t\t\t $transparence=100) {\r\n\t\t$this->stampPath = $stampPath;\r\n\t\t$this->vAlign = $vAlign;\r\n\t\t$this->hAlign = $hAlign;\r\n\t\t$this->alpha = $transparence/100;\r\n\t}", "function watermarkText2Image ($imageUrl,$imgName,$WaterMarkText, $thb = true) {\n header(\"Content-type: image/jpg\");\n\n //amire kerul a watermark\n if ($thb) {\n $SourceFile = $imageUrl . 'tn_' . $imgName;\n } else {\n $SourceFile = $imageUrl . $imgName;\n }\n list($originalWidth, $originalHeight, $original_type, $original_attr) = getimagesize($SourceFile);\n $sourceImage = imagecreatefromjpeg($SourceFile);\n \n //watermark eloallitasa\n $new_w = (int)($originalWidth);\n $new_h = (int)($originalWidth)*0.15;\n $font = $_SERVER['DOCUMENT_ROOT'].'/include/captcha/fonts/walk_rounded.ttf';\n $fontSize = $new_h/2;\n $angel = 0;\n $the_box = calculateTextBox($WaterMarkText, $font, $fontSize, $angel);\n \n $watermark = imagecreatetruecolor($new_w,$new_h);\n \n \n $white = imagecolorallocate($watermark, 255, 255, 255);\n // Add some shadow to the text\n //$WaterMarkText = 'ww='.$the_box[\"width\"].' nw='.$new_w;\n //imagettftext($watermark, $new_h/2, 0, ($new_w - $the_box[\"width\"])/6, 2*$new_h/3, $white, $font, $WaterMarkText);\n imagettftext($watermark, \n $fontSize,\n $angel,\n $the_box[\"left\"] + ($new_w / 2) - ($the_box[\"width\"] / 2), \n $the_box[\"top\"] + ($new_h / 2) - ($the_box[\"height\"] / 2), \n $white, \n $font, \n $WaterMarkText); \n \n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n \n imagecopymerge($sourceImage, \n $watermark,\n 0,//imagesx($original_image)/2 , //dest x - $sx/2\n imagesy($sourceImage)/2- $sy/2, //dest y \n 0, //source origo x\n 0, //source origo y\n imagesx($watermark), \n imagesy($watermark),\n 30\n );\n \n // megjelenitem a thumbnailt a watermark szoveggel\n imagejpeg($sourceImage, null, 100); //$SourceFile\n imagedestroy($sourceImage);\n\n}", "public function imageAdapterGdWatermarkPngInsidePng(UnitTester $I)\n {\n $I->wantToTest('Image\\Adapter\\Gd - watermark() - png inside png');\n\n $image = new Gd(\n dataDir('assets/images/example-png.png')\n );\n\n $watermark = new Gd(\n dataDir('assets/images/example-png.png')\n );\n $watermark->resize(null, 30, Enum::HEIGHT);\n\n $outputDir = 'tests/image/gd';\n $outputImage = 'watermark.png';\n $output = outputDir($outputDir . '/' . $outputImage);\n $offsetX = 20;\n $offsetY = 20;\n $opacity = 75;\n\n $hash = '10787c3c3e181818';\n\n $image->watermark($watermark, $offsetX, $offsetY, $opacity)\n ->save($output)\n ;\n\n $I->amInPath(\n outputDir($outputDir)\n );\n\n $I->seeFileFound($outputImage);\n\n $I->assertTrue(\n $this->checkImageHash($output, $hash)\n );\n\n $I->safeDeleteFile($outputImage);\n }", "function addStamp($image)\n{\n\n // Load the stamp and the photo to apply the watermark to\n // http://php.net/manual/en/function.imagecreatefromgif.php\n $stamp = imagecreatefromgif(\"./happy_trans.gif\");\n $im = imagecreatefrompng($image);\n\n // Set the margins for the stamp and get the height/width of the stamp image\n $marge_right = 10;\n $marge_bottom = 10;\n $sx = imagesx($stamp);\n $sy = \n imagesy($stamp);\n\n // Copy the stamp image onto our photo using the margin offsets and the photo \n // width to calculate positioning of the stamp. \n imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));\n\n # (Commented) This cannot be here, problems with outputing resize.php as HTML\n # header('Content-type: image/png');\n\n // Output and free memory\n imagepng($im, \"./test.png\");\n imagedestroy($im);\n imagedestroy($stamp);\n}", "public static function create_watermark( $main_img_obj, $watermark_img_obj, $alpha_level = 100 )\n\t{\n\t\t$alpha_level\t/= 100;\t# convert 0-100 (%) alpha to decimal\n\n\t\t# calculate our images dimensions\n\t\t$main_img_obj_w\t= imagesx( $main_img_obj );\n\t\t$main_img_obj_h\t= imagesy( $main_img_obj );\n\t\t$watermark_img_obj_w\t= imagesx( $watermark_img_obj );\n\t\t$watermark_img_obj_h\t= imagesy( $watermark_img_obj );\n\n\t\t# determine center position coordinates\n\t\t$main_img_obj_min_x\t= floor( ( $main_img_obj_w / 2 ) - ( $watermark_img_obj_w / 2 ) );\n\t\t$main_img_obj_max_x\t= ceil( ( $main_img_obj_w / 2 ) + ( $watermark_img_obj_w / 2 ) );\n\t\t$main_img_obj_min_y\t= floor( 3 * ( $main_img_obj_h / 4 ) - ( $watermark_img_obj_h / 2 ) );\n\t\t$main_img_obj_max_y\t= ceil( 3 * ( $main_img_obj_h / 4 ) + ( $watermark_img_obj_h / 2 ) ); \n\n\t\t# create new image to hold merged changes\n\t\t$return_img\t= imagecreatetruecolor( $main_img_obj_w, $main_img_obj_h );\n\n\t\t# walk through main image\n\t\tfor( $y = 0; $y < $main_img_obj_h; $y++ ) {\n\t\t\tfor( $x = 0; $x < $main_img_obj_w; $x++ ) {\n\t\t\t\t$return_color\t= NULL;\n\n\t\t\t\t# determine the correct pixel location within our watermark\n\t\t\t\t$watermark_x\t= $x - $main_img_obj_min_x;\n\t\t\t\t$watermark_y\t= $y - $main_img_obj_min_y;\n\n\t\t\t\t# fetch color information for both of our images\n\t\t\t\t$main_rgb = imagecolorsforindex( $main_img_obj, imagecolorat( $main_img_obj, $x, $y ) );\n\n\t\t\t\t# if our watermark has a non-transparent value at this pixel intersection\n\t\t\t\t# and we're still within the bounds of the watermark image\n\t\t\t\tif (\t$watermark_x >= 0 && $watermark_x < $watermark_img_obj_w &&\n\t\t\t\t\t\t\t$watermark_y >= 0 && $watermark_y < $watermark_img_obj_h ) {\n\t\t\t\t\t$watermark_rbg = imagecolorsforindex( $watermark_img_obj, imagecolorat( $watermark_img_obj, $watermark_x, $watermark_y ) );\n\n\t\t\t\t\t# using image alpha, and user specified alpha, calculate average\n\t\t\t\t\t$watermark_alpha\t= round( ( ( 127 - $watermark_rbg['alpha'] ) / 127 ), 2 );\n\t\t\t\t\t$watermark_alpha\t= $watermark_alpha * $alpha_level;\n\n\t\t\t\t\t# calculate the color 'average' between the two - taking into account the specified alpha level\n\t\t\t\t\t$avg_red\t\t= self::_get_ave_color( $main_rgb['red'],\t\t$watermark_rbg['red'],\t\t$watermark_alpha );\n\t\t\t\t\t$avg_green\t= self::_get_ave_color( $main_rgb['green'],\t$watermark_rbg['green'],\t$watermark_alpha );\n\t\t\t\t\t$avg_blue\t\t= self::_get_ave_color( $main_rgb['blue'],\t$watermark_rbg['blue'],\t\t$watermark_alpha );\n\n\t\t\t\t\t# calculate a color index value using the average RGB values we've determined\n\t\t\t\t\t$return_color\t= self::_get_image_color( $return_img, $avg_red, $avg_green, $avg_blue );\n\n\t\t\t\t# if we're not dealing with an average color here, then let's just copy over the main color\n\t\t\t\t} else {\n\t\t\t\t\t$return_color\t= imagecolorat( $main_img_obj, $x, $y );\n\n\t\t\t\t} # END if watermark\n\n\t\t\t\t# draw the appropriate color onto the return image\n\t\t\t\timagesetpixel( $return_img, $x, $y, $return_color );\n\n\t\t\t} # END for each X pixel\n\t\t} # END for each Y pixel\n\n\t\t# return the resulting, watermarked image for display\n\t\treturn $return_img;\n\n\t}", "public static function watermark($srcImage, $watermark, $x = 0, $y = 0, $pct = null, $copy = false) {\n $srcImage = $srcImage instanceof Image ? $srcImage : Image::load($srcImage);\n $watermark = $watermark instanceof Image ? $watermark : Image::load($watermark);\n return $srcImage->merge($watermark, $x, $y, $pct, $copy);\n }" ]
[ "0.8594125", "0.775226", "0.7401763", "0.73029447", "0.73026496", "0.7153652", "0.7117748", "0.69545376", "0.6895416", "0.6851341", "0.68019307", "0.6738347", "0.67224705", "0.66621417", "0.6597992", "0.65832454", "0.6577887", "0.6549959", "0.652484", "0.64720017", "0.6461848", "0.6437693", "0.6366577", "0.635816", "0.627154", "0.6258353", "0.6182532", "0.6126844", "0.6053623", "0.60343975" ]
0.8034334
1
Loads an image into GD.
protected function _load_image() { if ( ! is_resource($this->_image)) { // Gets create function $create = $this->_create_function; // Open the temporary image $this->_image = $create($this->file); // Preserve transparency when saving imagesavealpha($this->_image, TRUE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImage()\n\t{\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->ImageStream = @imagecreatefromgif($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->ImageStream = @imagecreatefromjpeg($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->ImageStream = @imagecreatefrompng($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\t}", "protected function loadImage()\n {\n if (!is_resource($this->tmpImage)) {\n $create = $this->createFunctionName;\n $this->tmpImage = $create($this->filePath);\n imagesavealpha($this->tmpImage, true);\n }\n }", "public function load()\n\t{\n\t\tif (!$this->isValidImage()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->image = new SimpleImage();\n\n\t\t$this->image->fromFile($this->source_path);\n\n\t\treturn true;\n\t}", "function load($filename)\n {\n $image_info = getimagesize($filename);\n $this->image_type = $image_info[2];\n //crea la imagen JPEG.\n if( $this->image_type == IMAGETYPE_JPEG ) \n {\n $this->image = imagecreatefromjpeg($filename);\n } \n //crea la imagen GIF.\n elseif( $this->image_type == IMAGETYPE_GIF ) \n {\n $this->image = imagecreatefromgif($filename);\n } \n //Crea la imagen PNG\n elseif( $this->image_type == IMAGETYPE_PNG ) \n {\n $this->image = imagecreatefrompng($filename);\n }\n }", "function load_image( $filename = '' )\n\t{\n\t\tif( !is_file( $filename ) )\n\t\t\tthrow new Exception( 'Image Class: could not find image \\''.$filename.'\\'.' );\n\t\t\t\t\t\t\t\t\n\t\t$ext = $this->get_ext( $filename );\n\t\t\n\t\tswitch( $ext )\n\t\t{\n\t\t\tcase 'jpeg':\n\t\t\tcase 'jpg':\n\t\t\t\t$this->im = imagecreatefromjpeg( $filename );\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\t$this->im = imagecreatefromgif( $filename );\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\t$this->im = imagecreatefrompng( $filename );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception( 'Image Class: An unsupported file format was supplied \\''. $ext . '\\'.' );\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function load_image()\n\t{\n if (file_exists($this->local_file)) {\n $image_size = $this->image_size();\n if (preg_match('/jpeg/', $image_size['mime'])) {\n $file = imagecreatefromjpeg($this->local_file);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n $file = imagecreatefromgif($this->local_file);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n $file = imagecreatefrompng($this->local_file);\n } else {\n \t$file = null;\n }\n return $file;\n }\n\t}", "public function load_png($imgname)\n\t{\n\t\t// imagecreatefrompng() returns error msg and breaks the code\n\t\t// this function returns an error image instead of breaking\n\t\t//\n\t\t$im = @imagecreatefrompng($imgname); /* Attempt to open */\n\t\tif (!$im) { /* See if it failed */\n\t\t\t$im = imagecreatetruecolor(150, 30); /* Create a blank image */\n\t\t\t$bgc = imagecolorallocate($im, 255, 255, 255);\n\t\t\t$tc = imagecolorallocate($im, 0, 0, 0);\n\t\t\timagefilledrectangle($im, 0, 0, 150, 30, $bgc);\n\t\t\t/* Output an errmsg */\n\t\t\timagestring($im, 1, 5, 5, \"Error loading $imgname\", $tc);\n\t\t}\n\t\treturn $im;\n\t}", "function _load_image_file( $file ) {\n\t\t// Run a cheap check to verify that it is an image file.\n\t\tif ( false === ( $size = getimagesize( $file ) ) )\n\t\t\treturn false;\n\t\t\n\t\tif ( false === ( $file_data = file_get_contents( $file ) ) )\n\t\t\treturn false;\n\t\t\n\t\tif ( false === ( $im = imagecreatefromstring( $file_data ) ) )\n\t\t\treturn false;\n\t\t\n\t\tunset( $file_data );\n\t\t\n\t\t\n\t\treturn $im;\n\t}", "function LoadGif($imgname)\n{\n $im = @imagecreatefromgif($imgname);\n\n /* See if it failed */\n if(!$im)\n {\n /* Create a blank image */\n $im = imagecreatetruecolor (96, 96);\n $bgc = imagecolorallocate ($im, 255, 255, 255);\n $tc = imagecolorallocate ($im, 0, 0, 0);\n\n imagefilledrectangle ($im, 0, 0, 96, 96, $bgc);\n\n /* Output an error message */\n imagestring ($im, 1, 5, 5, 'Mapler.me failed.', $tc);\n imagestring ($im, 1, 5, 20, $imgname, $tc);\n }\n\n return $im;\n}", "public static function get_gd_resource(self $img)\n\t\t{\n\t\t\t$im = null;\n\n\t\t\tswitch ($img->format()) {\n\t\t\t\tcase 1: $im = imagecreatefromgif($img->get_path()); break;\n\t\t\t\tcase 2: $im = imagecreatefromjpeg($img->get_path()); break;\n\t\t\t\tcase 3: $im = imagecreatefrompng($img->get_path()); break;\n\t\t\t}\n\n\t\t\tif (!is_resource($im)) {\n\t\t\t\tthrow new \\System\\Error\\File(sprintf('Failed to open image \"%s\". File is not readable or format \"%s\" is not supported.', $path, self::get_suffix($format)));\n\t\t\t}\n\n\t\t\treturn $im;\n\t\t}", "public function load($file){\n\n //kill any previous image that might still be in memory before we load a new one\n if(isset($this->image) && !empty($this->image)){\n imagedestroy($this->image);\n }\n\n //get the parameters of the image\n $image_params = getimagesize($file);\n\n //save the image params to class vars\n list($this->width, $this->height, $this->type, $this->attributes) = $image_params;\n $this->mime_type = $image_params['mime'];\n\n //check that an image type was found\n if(isset($this->type) && !empty($this->type)){\n //find the type of image so it can be loaded into memory\n switch ($this->type) {\n case IMAGETYPE_JPEG:\n $this->image = imagecreatefromjpeg($file);\n break;\n\n case IMAGETYPE_GIF:\n $this->image = imagecreatefromgif($file);\n break;\n\n case IMAGETYPE_PNG:\n $this->image = imagecreatefrompng($file);\n break;\n\n }\n\n if(isset($this->image) && !empty($this->image)){\n return true;\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "public function load_image($https = false)\n {\n return $this->load(\"image\", $https);\n }", "function loadFile ($image) {\r\n if ( !$dims=@GetImageSize($image) ) {\r\n trigger_error('Could not find image '.$image);\r\n return false;\r\n }\r\n if ( in_array($dims['mime'],$this->types) ) {\r\n $loader=$this->imgLoaders[$dims['mime']];\r\n $this->source=$loader($image);\r\n $this->sourceWidth=$dims[0];\r\n $this->sourceHeight=$dims[1];\r\n $this->sourceMime=$dims['mime'];\r\n $this->initThumb();\r\n return true;\r\n } else {\r\n trigger_error('Image MIME type '.$dims['mime'].' not supported');\r\n return false;\r\n }\r\n }", "function LoadPNG($imgname)\n{\n $im = @imagecreatefrompng($imgname);\n\n /* See if it failed */\n if(!$im)\n {\n /* Create a blank image */\n $im = imagecreatetruecolor (96, 96);\n $bgc = imagecolorallocate ($im, 255, 255, 255);\n $tc = imagecolorallocate ($im, 0, 0, 0);\n\n imagefilledrectangle ($im, 0, 0, 96, 96, $bgc);\n\n /* Output an error message */\n imagestring ($im, 1, 5, 5, 'Mapler.me failed.', $tc);\n imagestring ($im, 1, 5, 20, $imgname, $tc);\n }\n\n return $im;\n}", "function LoadImage($filename)\r\n {\r if (!($from_info = getimagesize($file)))\r\n return false;\r\n\r\n $from_type = $from_info[2];\r\n\r\n $new_img = Array(\r\n 'f' => $filename,\r\n 'w' => $from_info[0],\r\n 'h' => $from_info[1],\r\n );\r\n\r\n $id = false;\r\n if (($this->use_IM && false)\r\n || (($from_type == IMAGETYPE_GIF) && $this->GIF_IM && false))\r\n {\r $id = count($this->images)+1;\r\n $this->images[$id] = Array(0, $filename, 0, $new_img);\r\n }\r\n elseif ($img = $this->_gd_load($filename))\r\n {\r $id = count($this->images)+1;\r\n $this->images[$id] = Array(1, $filename, &$img, $new_img);\r\n }\r\n\r\n return $id;\r\n }", "function loadImage($filename) {\n $image = false;\n $imageInfo = getimagesize($filename);\n $imageType = '';\n $imageType = $imageInfo[2];\n if( $imageType == IMAGETYPE_JPEG ) {\n $image = imagecreatefromjpeg($filename);\n } elseif( $imageType == IMAGETYPE_GIF ) {\n $image = imagecreatefromgif($filename);\n } elseif( $imageType == IMAGETYPE_PNG ) {\n $image = imagecreatefrompng($filename);\n }\n return $image ? array('image' => $image, 'imgType' => $imageType, 'imageInfo' => $imageInfo) : array();\n}", "public function openImage($src)\n {\n $this->path=substr($src,0,strlen($src)-strlen(strstr($src, '.')));\n $this->imageSuffix=substr(strstr($src, '.'),1);\n $info=getimagesize($src);\n $this->imageX=$info[0];\n $this->imageY=$info[1];\n $this->imageInfo=$info;\n $type=image_type_to_extension($info[2],false);\n $this->imageType=$type;\n $createImageType='imagecreatefrom'.$type;\n $this->image=$createImageType($src);\n }", "protected function _loadImageResource($source)\n {\n if (empty($source) || !is_readable($source)) {\n return false;\n }\n\n try {\n $result = imagecreatefromstring(file_get_contents($source));\n } catch (Exception $e) {\n _log(\"GD failed to open the file. Details:\\n$e\", Zend_Log::ERR);\n return false;\n }\n\n return $result;\n }", "public static function load($image)\n {\n return new Adapter\\Gd($image);\n }", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "public static function fromFile($file) {\n\t\tif(ImageHelperConfig::CHECK_IMAGE_FILE){\n\t\t\t// Check if the file exists and is readable. We're using fopen() instead of file_exists()\n\t\t\t// because not all URL wrappers support the latter.\n\t\t\t$handle = @fopen($file, 'r');\n\t\t\tif ($handle === false) {\n\t\t\t\tthrow new \\Exception(\"File not found: $file\", ErrorCodeConstant::ERR_FILE_NOT_FOUND);\n\t\t\t}\n\t\t\tfclose($handle);\t\n\t\t}\n\n\t\t// Get image info\n\t\t$info = getimagesize($file);\n\t\tif ($info === false) {\n\t\t\tthrow new \\Exception(\"Invalid image file: $file\", ErrorCodeConstant::ERR_INVALID_IMAGE);\n\t\t}\n\t\t$mimeType = $info['mime'];\n\n\t\t// Create image object from file\n\t\tswitch($mimeType) {\n\t\t\tcase 'image/gif' :\n\t\t\t\t// Load the gif\n\t\t\t\t$gif = imagecreatefromgif($file);\n\t\t\t\tif ($gif) {\n\t\t\t\t\t// Copy the gif over to a true color image to preserve its transparency. This is a\n\t\t\t\t\t// workaround to prevent imagepalettetruecolor() from borking transparency.\n\t\t\t\t\t$width = imagesx($gif);\n\t\t\t\t\t$height = imagesy($gif);\n\t\t\t\t\t$image = imagecreatetruecolor($width, $height);\n\t\t\t\t\t$transparentColor = imagecolorallocatealpha($image, 0, 0, 0, 127);\n\t\t\t\t\timagecolortransparent($image, $transparentColor);\n\t\t\t\t\timagefill($image, 0, 0, $transparentColor);\n\t\t\t\t\timagecopy($image, $gif, 0, 0, 0, 0, $width, $height);\n\t\t\t\t\timagedestroy($gif);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg' :\n\t\t\t\t$image = imagecreatefromjpeg($file);\n\t\t\t\tbreak;\n\t\t\tcase 'image/png' :\n\t\t\t\t$image = imagecreatefrompng($file);\n\t\t\t\tbreak;\n\t\t\tcase 'image/webp' :\n\t\t\t\t$image = imagecreatefromwebp($file);\n\t\t\t\tbreak;\n\t\t}\n\t\tif (!$image) {\n\t\t\tthrow new \\Exception(\"Unsupported image: $file\", ErrorCodeConstant::ERR_UNSUPPORTED_FORMAT);\n\t\t}\n\n\t\t// Convert pallete images to true color images\n\t\timagepalettetotruecolor($image);\n\n\t\t$exif = null;\n\t\t// Load exif data from JPEG images\n\t\tif (ImageHelperConfig::USE_IMAGE_EXIF && $mimeType === 'image/jpeg' && function_exists('exif_read_data')) {\n\t\t\t$exif = @exif_read_data($file);\n\t\t}\n\n\t\treturn array('image'=>$image, 'mimeType'=>$mimeType,'exif'=>$exif);\n\t}", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}", "function open_image($file) {\n\t\t$im = @imagecreatefromjpeg($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# GIF:\n\t\t$im = @imagecreatefromgif($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# PNG:\n\t\t$im = @imagecreatefrompng($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# GD File:\n\t\t$im = @imagecreatefromgd($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# GD2 File:\n\t\t$im = @imagecreatefromgd2($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# WBMP:\n\t\t$im = @imagecreatefromwbmp($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# XBM:\n\t\t$im = @imagecreatefromxbm($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# XPM:\n\t\t$im = @imagecreatefromxpm($file);\n\t\tif ($im !== false) { return $im; }\n\t\t# Try and load from string:\n\t\t$im = @imagecreatefromstring(file_get_contents($file));\n\t\tif ($im !== false) { return $im; }\n\t\treturn false;\n\t}", "public function load($path, $config)\n\t{\n\t\t$this->data = [];\n\t\t$img = $this->_create($path);\n\t\t$size = getimagesize($path);\n\t\tif (!$size) {\n\t\t\tthrow new \\Exception(\"Could not read size from file '\" . $path . \"'.\");\n\t\t}\n\t\t$width = array_shift($size);\n\t\t$height = array_shift($size);\n\t\tfor ($y = 0; $y < $height; $y++) {\n\t\t\t$this->data[$y] = [];\n\t\t\tfor ($x = 0; $x < $width; $x++) {\n\t\t\t\t$color_index = imagecolorat($img, $x, $y);\n\t\t\t\t$rgba = imagecolorsforindex($img, $color_index);\n\t\t\t\t$hex = $config->getClosestColor($rgba);\n\t\t\t\t$this->data[$y][$x] = new Pixel($hex);\n\t\t\t}\n\t\t}\n\t}", "function loadImage($image_data) {\n\t\tif (empty($image_data['name']) && empty($image_data['tmp_name'])) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$file_name = $this->image_path . DS . $image_data['name'];\n\t\t$file_name_arr = explode('.', $file_name);\n\t\t$file_name_ext = $file_name_arr[count($file_name_arr)-1];\n\t\tunset($file_name_arr[count($file_name_arr)-1]);\n\t\t$file_name_prefix = implode('.' , $file_name_arr);\n\t\t$counter = '';\n\t\t$file_name = $file_name_prefix . $counter . '.' . $file_name_ext;\n\t\t$i = 1;\n\t\twhile (file_exists($file_name)) {\n\t\t\t$counter = '_' . $i;\n\t\t\t$file_name = $file_name_prefix . $counter . '.' . $file_name_ext;\n\t\t\t$i++;\n\t\t}\n\n\t\t$tmp_name = $image_data['tmp_name'];\n\t\t$width = 88;\n\t\t$height = 88;\n\t\t\n\t\t// zmenim velikost obrazku\n\t\tApp::import('Model', 'Image');\n\t\t$this->Image = new Image;\n\t\t\n\t\t\n\t\tif (file_exists($tmp_name)) {\n\t\t\tif ($this->Image->resize($tmp_name, $file_name, $width, $height)) {\n\t\t\t\t$file_name = str_replace($this->image_path . DS, '', $file_name);\n\t\t\t\treturn $file_name;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function image();", "public function image();" ]
[ "0.7279598", "0.6560022", "0.6535591", "0.65068156", "0.6391081", "0.6183456", "0.6068901", "0.60112375", "0.59473675", "0.59314656", "0.5929995", "0.5923906", "0.591783", "0.5917558", "0.5894933", "0.58916134", "0.58810747", "0.58702743", "0.5832721", "0.57782984", "0.57782984", "0.57782984", "0.57782984", "0.5777479", "0.57142097", "0.5699849", "0.56069076", "0.55793405", "0.55621517", "0.55621517" ]
0.68958074
1
Gets the supplied form submission data mapped to a dto.
public function mapFormSubmissionToDto(array $submission) { $formData = $this->getStagedForm()->process($submission); return new ObjectActionParameter( $formData[IObjectAction::OBJECT_FIELD_NAME], new ArrayDataObject($formData) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubmissionData($submission_id, $form_id) {\n \n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function get_data()\n {\n return $this->form_data;\n }", "public function getSubmissionData()\r\n {\r\n return $this->data;\r\n }", "public function getDto()\n {\n return $this->dto;\n }", "public function getSubmittedData()\n\t{\n\t\t//Check we have received the Formisimo tracking data from the submission\n\t\t$data = isset($this->data['formisimo-tracking'])\n\t\t\t? $this->data['formisimo-tracking']\n\t\t\t: array(); //Default to empty array\n\n\t\treturn ! is_array($data)\n\t\t\t? (array) json_decode($data, true) //cast array in case json_decode fails\n\t\t\t: $data; //Just return the array\n\t}", "public function getFormData()\n {\n return $this->form->getData();\n }", "public function getWebformSubmission() {\n return $this->submission;\n }", "public function getSubmission() {\n\t\t$submission = $this->getRequest()->param('ID');\n\t\t\n\t\tif ($submission) {\n\t\t\treturn SubmittedForm::get()->filter('uid', $submission)->First();\n\t\t}\n\n\t\treturn null;\n\t}", "public function submission()\n {\n return Submission::where('assignment_id', $this->attributes['id'])->where('user_id', Auth::user()->id)->first();\n }", "function submit($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, \"\");\n\t}", "function submit($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, \"\");\n\t}", "public function getFormData()\n {\n return $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());\n }", "public static function getPostData() {\n\n $DataObj = new stdClass();\n\n foreach ($_POST as $name => $value)\n $DataObj->$name = $value;\n\n return $DataObj;\n }", "public function getFormValues()\n {\n $validator = App::make(SubmitForm::class);\n return $validator->getSubmissions();\n }", "public function get_data() {\n $data = parent::get_data();\n\n if (!empty($data)) {\n $data->settings = $this->tool->form_build_settings($data);\n }\n\n return $data;\n }", "public function getFormEntry()\n {\n return $this->form->getEntry();\n }", "protected function getFormData() {\n\t\treturn $this->stripNonPrintables(json_decode($this->request->postVar('Details'), true));\n\t}", "function getSubmittedBy() {\n\t\treturn $this->data_array['submitted_by'];\n\t}", "function getSubmittedBy() {\n\t\treturn $this->data_array['submitted_by'];\n\t}", "function process($data, $form) {\n\t\t// submitted form object\n\t\t$submittedForm = new SubmittedForm();\n\t\t$submittedForm->SubmittedByID = ($id = Member::currentUserID()) ? $id : 0;\n\t\t$submittedForm->ParentID = $this->ID;\n\t\t$submittedForm->Recipient = $this->EmailTo;\n\t\tif(!$this->DisableSaveSubmissions) $submittedForm->write();\n\t\t\n\t\t// email values\n\t\t$values = array();\n\t\t$recipientAddresses = array();\n\t\t$sendCopy = false;\n $attachments = array();\n\n\t\t$submittedFields = new DataObjectSet();\n\t\t\n\t\tforeach($this->Fields() as $field) {\n\t\t\t// don't show fields that shouldn't be shown\n\t\t\tif(!$field->showInReports()) continue;\n\t\t\t\n\t\t\t$submittedField = $field->getSubmittedFormField();\n\t\t\t$submittedField->ParentID = $submittedForm->ID;\n\t\t\t$submittedField->Name = $field->Name;\n\t\t\t$submittedField->Title = $field->Title;\n\t\t\t\t\t\n\t\t\tif($field->hasMethod('getValueFromData')) {\n\t\t\t\t$submittedField->Value = $field->getValueFromData($data);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(isset($data[$field->Name])) $submittedField->Value = $data[$field->Name];\n\t\t\t}\n\n\t\t\tif(!empty($data[$field->Name])){\n\t\t\t\tif(in_array(\"EditableFileField\", $field->getClassAncestry())) {\n\t\t\t\t\tif(isset($_FILES[$field->Name])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// create the file from post data\n\t\t\t\t\t\t$upload = new Upload();\n\t\t\t\t\t\t$file = new File();\n\t\t\t\t\t\t$upload->loadIntoFile($_FILES[$field->Name], $file);\n\n\t\t\t\t\t\t// write file to form field\n\t\t\t\t\t\t$submittedField->UploadedFileID = $file->ID;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Attach the file if its less than 1MB, provide a link if its over.\n\t\t\t\t\t\tif($file->getAbsoluteSize() < 1024*1024*1){\n\t\t\t\t\t\t\t$attachments[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$this->DisableSaveSubmissions) $submittedField->write();\n\t\t\t\n\t\t\t$submittedFields->push($submittedField);\n\t\t}\t\n\t\t$emailData = array(\n\t\t\t\"Sender\" => Member::currentUser(),\n\t\t\t\"Fields\" => $submittedFields\n\t\t);\n\n\t\t// email users on submit. All have their own custom options. \n\t\tif($this->EmailRecipients()) {\n\t\t\t$email = new UserDefinedForm_SubmittedFormEmail($submittedFields); \n\t\t\t$email->populateTemplate($emailData);\n\t\t\tif($attachments){\n\t\t\t\tforeach($attachments as $file){\n\t\t\t\t\t// bug with double decorated fields, valid ones should have an ID.\n\t\t\t\t\tif($file->ID != 0) {\n\t\t\t\t\t\t$email->attachFile($file->Filename,$file->Filename, $file->getFileType());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->EmailRecipients() as $recipient) {\n\t\t\t\t$email->populateTemplate($recipient);\n\t\t\t\t$email->populateTemplate($emailData);\n\t\t\t\t$email->setFrom($recipient->EmailFrom);\n\t\t\t\t$email->setBody($recipient->EmailBody);\n\t\t\t\t$email->setSubject($recipient->EmailSubject);\n\t\t\t\t$email->setTo($recipient->EmailAddress);\n\t\t\t\t\n\t\t\t\t// check to see if they are a dynamic sender. eg based on a email field a user selected\n\t\t\t\tif($recipient->SendEmailFromField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setFrom($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// check to see if they are a dynamic reciever eg based on a dropdown field a user selected\n\t\t\t\tif($recipient->SendEmailToField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);\n\t\t\t\t\t\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setTo($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recipient->SendPlain) {\n\t\t\t\t\t$body = strip_tags($recipient->EmailBody) . \"\\n \";\n\t\t\t\t\tif(isset($emailData['Fields']) && !$recipient->HideFormData) {\n\t\t\t\t\t\tforeach($emailData['Fields'] as $Field) {\n\t\t\t\t\t\t\t$body .= $Field->Title .' - '. $Field->Value .' \\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$email->setBody($body);\n\t\t\t\t\t$email->sendPlain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$email->send();\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn Director::redirect($this->Link() . 'finished?referrer=' . urlencode($data['Referrer']));\n\t}", "public function getDto()\r\n {\r\n $data = $this->toArray();\r\n\r\n $dto = new Pandamp_Modules_Misc_Poll_Dto();\r\n foreach ($data as $key => $value) {\r\n if (property_exists($dto, $key)) {\r\n $dto->$key = $value;\r\n }\r\n }\r\n\r\n return $dto;\r\n }", "protected function getWebformUserData(WebformSubmissionInterface $webform_submission) {\n $webform_data = $webform_submission->getData();\n $user_field_mapping = $this->configuration['user_field_mapping'];\n\n $user_field_data = [];\n foreach ($user_field_mapping as $webform_key => $user_field) {\n // Grab the value from the webform element and assign it to the correct\n // user field key.\n $user_field_data[$user_field] = $webform_data[$webform_key];\n }\n\n return $user_field_data;\n }", "public function get_post_data() {\n\t\treturn $this->post;\n\t}", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "public function getSubmission($form_id, $submission_id)\n {\n $db = Core::$db;\n\n // confirm the form is valid\n if (!Forms::checkFormExists($form_id)) {\n return self::processError(405);\n }\n\n if (!is_numeric($submission_id)) {\n return self::processError(406);\n }\n\n // get the form submission info\n $db->query(\"\n SELECT *\n FROM {PREFIX}form_{$form_id}\n WHERE submission_id = :submission_id\n \");\n $db->bind(\"submission_id\", $submission_id);\n $db->execute();\n\n return $db->fetch();\n }", "public function getFormData()\n {\n $data = $this->getData('form_data');\n if ($data === null) {\n $formData = $this->_customerSession->getCustomerFormData(true);\n $data = new \\Magento\\Framework\\DataObject();\n if ($formData) {\n $data->addData($formData);\n $linkedinProfile = ['linkedin_profile' => $this->_customerSession->getLinkedinProfile()];\n $data->addData($linkedinProfile);\n $data->setCustomerData(1);\n }\n if (isset($data['region_id'])) {\n $data['region_id'] = (int)$data['region_id'];\n }\n $this->setData('form_data', $data);\n }\n return $data;\n }" ]
[ "0.6403062", "0.6137485", "0.6137485", "0.6137485", "0.6137485", "0.6114024", "0.6100388", "0.60034484", "0.5717522", "0.56829906", "0.56637377", "0.5591791", "0.55847156", "0.5516104", "0.5516104", "0.5483597", "0.5465517", "0.5428606", "0.54221725", "0.5412459", "0.5406923", "0.5390214", "0.5390214", "0.5380567", "0.5380172", "0.5354156", "0.53481704", "0.5342069", "0.53295344", "0.5319742" ]
0.62813884
1
Store rule (e.g. [[UrlRule]]) to internal cache.
protected function setRuleToCache($cacheKey, UrlRuleInterface $rule) { $this->_ruleCache[$cacheKey][] = $rule; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function saveCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!isset($this->cacheItem) || !isset($this->cache) || empty($this->cache)) {\n return;\n }\n //====================================================================//\n // Save Links are In Cache\n $this->cacheItem->set($this->cache);\n $this->cacheAdapter->save($this->cacheItem);\n }", "protected function saveToCache() {}", "public function addRule(bnfRule $rule){\n\t\t$this->rules[] = $rule;\t\t\n\t}", "public function appendRule( $filter )\n {\n $this->rules[] = $filter;\n $this->clearCache();\n }", "function saveRulesToFile() {\n\t\tglobal $sugar_config;\n\n\t\t$file = $this->rulesCache.\"/{$this->user->id}.php\";\n\t\t$GLOBALS['log']->info(\"SUGARROUTING: Saving rules file [ {$file} ]\");\n\t\twrite_array_to_file('routingRules', $this->rules, $file);\n\t}", "public function add_rule( WP_Autoload_Rule $rule );", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "protected function addRule( phpucInputRule $rule )\n {\n $this->rules[] = $rule;\n }", "public static function add_rule(ACL_Rule $rule)\n\t{\n\t\t// Check if the rule is valid, if not throw an exception\n\t\tif ( ! $rule->valid())\n\t\t\tthrow new ACL_Exception('The ACL Rule was invalid and could not be added.');\n\n\t\t// Find the rule's key and add it to the array of rules\n\t\t$key = $rule->key();\n\t\tself::$_rules[$key] = $rule;\n\t}", "abstract public function addRule(ValidationRule$rule);", "public function addRule(Rule $rule): Manager\n {\n $this->rules[] = $rule;\n return $this;\n }", "public function addRule(RuleIface $rule);", "function save_mod_rewrite_rules()\n {\n }", "static function addRule(\\CharlotteDunois\\Validation\\RuleInterface $rule) {\n if(static::$rulesets === null) {\n static::initRules();\n }\n \n $class = \\get_class($rule);\n $arrname = \\explode('\\\\', $class);\n $name = \\array_pop($arrname);\n \n $rname = \\str_replace('rule', '', \\mb_strtolower($name));\n static::$rulesets[$rname] = $rule;\n \n if(\\mb_stripos($name, 'rule') !== false) {\n static::$typeRules[] = $rname;\n }\n }", "protected function _rule($rule, array $options = array()) {\n\t\t$this->rule = new $rule($options);\n\t\treturn $this->rule;\n\t}", "public function addRule(RuleIface $rule)\n {\n $this->rules[] = $rule;\n }", "public function saveToCacheForever();", "public function add_rule($key, $rule, $error = NULL, $name = NULL) {\n\t\t$this->rules[] = (object) array('key' => $key, 'rule' => $rule, 'error_msg' => $error, 'name' => $name);\n\t}", "function iis7_save_url_rewrite_rules()\n {\n }", "public function addRule(Rule $rule)\n {\n $this->rules[] = $rule;\n return $this;\n }", "public function saving(MActivityRule $model)\n\t{\n\t\t// 檢查 Rule 格式\n\t\tif ($model->rule == '') {\n\t\t\tthrow new \\Exception(\"规格不可为空. ({$model->name})\");\n\t\t}\n\t\t$activity_class = '\\App\\Activities\\Activity' . $model->activity_id;\n\t\tif (! class_exists($activity_class)) {\n\t\t\tthrow new \\Exception(\"未知的活动. (activity_id: {$model->activity_id})\");\n\t\t}\n\t\tif (! preg_match($activity_class::RULE_PATTERN, $model->rule)) {\n\t\t\tthrow new \\Exception(\"规则格式不符. ({$model->name})\");\n\t\t}\n\t}", "public function append(callable $rule)\n {\n $this->rules[] = $rule;\n }", "public function add(Rule $rule)\n {\n $this->rules[] = $rule;\n\n return true;\n }", "function hm_add_rewrite_rule( $rule, $query, $template = null, $args = array() ) {\n\n\tglobal $hm_rewrite_rules;\n\n\t$hm_rewrite_rules[ $rule ] = array( $rule, $query, $template, wp_parse_args( $args ) );\n\n}", "public function saved(MActivityRule $model)\n\t{\n\t}", "function set ($url, $rss) {\n $this->ERROR = \"\";\n $cache_file = $this->file_name( $url );\n $fp = @fopen( $cache_file, 'w' );\n \n if ( ! $fp ) {\n $this->error(\n \"Cache unable to open file for writing: $cache_file\"\n );\n return 0;\n }\n \n \n $data = $this->serialize( $rss );\n fwrite( $fp, $data );\n fclose( $fp );\n \n return $cache_file;\n }", "private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }", "public static function addRule(\\GraphQL\\Validator\\Rules\\ValidationRule $rule)\n {\n }", "public function addRule($rule, $db){\r\n $sql = \"INSERT INTO rules(rule) values (:rule)\";\r\n $pdostm = $db->prepare($sql);\r\n $pdostm->bindParam(':rule', $rule);\r\n\r\n $count = $pdostm->execute();\r\n return $count;\r\n }", "public function addRule(RuleInterface $rule)\r\n\t{\r\n\t\t$this->rules[] = $rule;\r\n\t\t$this->dirty = true;\r\n\t\treturn $this;\r\n\t}" ]
[ "0.5680179", "0.55724484", "0.55054665", "0.5440866", "0.54273087", "0.538548", "0.5383786", "0.53703", "0.5359271", "0.53575253", "0.53458375", "0.5341233", "0.53408355", "0.53124565", "0.5282261", "0.52774346", "0.52530915", "0.5242294", "0.52031064", "0.5185662", "0.51528126", "0.515059", "0.5133889", "0.51202947", "0.51146185", "0.51046664", "0.50630987", "0.50474805", "0.50421715", "0.5036526" ]
0.712807
0
Get the File's original resource
public function getOriginalFileResource() { return $this->originalFileResource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOriginalResource()\n {\n return isset($this->original_resource) ? $this->original_resource : null;\n }", "public function getOriginalResource() {\n\t\treturn $this->originalResource;\n\t}", "public function getOriginalResource()\n {\n return $this->resource;\n }", "public function getOriginalFile() {}", "public function getOriginalFile() {}", "private function getOriginalImage()\n {\n return $this->getDisk()->get($this->path);\n }", "public function getOriginalAsset()\n {\n return $this->originalAsset;\n }", "public function getOriginalFile() {\n $file = $this->getPath() . DS . $this->getFile();\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n header(\"Content-Type: \". $mimetype);\n readfile($file);\n }", "protected function getResource()\n {\n if (is_resource($this->path)) {\n return $this->path;\n }\n\n if (!$this->isRemoteFile() && !is_readable($this->path)) {\n throw new TelegramSDKException('Failed to create InputFile entity. Unable to read resource: '.$this->path.'.');\n }\n\n return Psr7\\Utils::tryFopen($this->path, 'rb');\n }", "public function getOriginalFileContent()\n {\n return $this->originalFileContent;\n }", "public function getSource()\n {\n return Yii::$app->storage->fileAbsoluteHttpPath($this->filter_id . '_' . $this->file->name_new_compound);\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function get_file() {\n\t\treturn $this->file;\n\t}", "function get_file()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile() {\n return $this->getFiles()->getFirst();\n }", "public function getResource()\n {\n return $this->resource ?: parent::getResource();\n }", "public function getModifiedResource()\n {\n return isset($this->modified_resource) ? $this->modified_resource : null;\n }", "public function get_file()\n {\n return $this->file;\n }", "public function getFile(): string\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->getAbsolutePath($this->avatarName);\n }", "public function getResource() {}", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}" ]
[ "0.7779481", "0.77074766", "0.7693794", "0.7437302", "0.7437302", "0.7009194", "0.69877654", "0.6978498", "0.6731973", "0.6676021", "0.6612523", "0.66032326", "0.66032326", "0.66032326", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.65468335", "0.65094817", "0.64998645", "0.64993864", "0.6477711", "0.64616096", "0.64614785", "0.644982", "0.6444417", "0.64229923" ]
0.8437936
0
Sets this File's original resource
public function setOriginalFileResource($originalFileResource) { $this->originalFileResource = $originalFileResource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOriginalResource($originalResource) {\n\t\t$this->originalResource = $originalResource;\n\t}", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function getOriginalFileResource() {\n\t\treturn $this->originalFileResource;\n\t}", "public function getOriginalResource() {\n\t\treturn $this->originalResource;\n\t}", "public function getOriginalResource()\n {\n return $this->resource;\n }", "abstract protected function setResource(): String;", "public function setOriginalResource($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\Util\\FieldMasks\\Proto\\Resource::class);\n $this->original_resource = $var;\n\n return $this;\n }", "public function getOriginalResource()\n {\n return isset($this->original_resource) ? $this->original_resource : null;\n }", "public function setOriginal($original) {\n $this->original = $original;\n }", "public function setFile($file)\n\t{\n\t\t$this->file = $file;\n\t\t// check if we have an old image path\n\t\tif (isset($this->image)) {\n\t\t\t// store the old name to delete after the update\n\t\t\t$this->temp = $this->image;\n\t\t\t$this->image = null;\n\t\t} else {\n\t\t\t$this->image = 'initial';\n\t\t}\n\t}", "protected function _setFile()\n\t{\n\t\t$this->_moveToImageDir();\n\n\t\tif (!$this->_validateMimeType()) {\n\t\t\tunlink($this->getFilePath()); // delete file\n\t\t\tthrow new Exception('Not Allowed MIME Type File ERROR!');\n\t\t}\n\n\t\t$this->_file = file_get_contents($this->getFilePath());\n\t}", "public function deleteOriginalFile()\n\t{\n\t\t$this->deleteFile = TRUE;\n\n\t\treturn $this;\n\t}", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->width = $processedImageInfo['width'];\n $this->height = $processedImageInfo['height'];\n $this->persistenceManager->whiteListObject($this->resource);\n }", "public function getOriginalAsset()\n {\n return $this->originalAsset;\n }", "public function setFile($file)\n {\n $this->file = __DIR__ . '/../../../res/' . $file;\n\n if (!is_file($this->file)) {\n header(\"HTTP/1.0 404 Not Found\");\n exit;\n }\n\n return $this;\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "public function setResource(Resource $res)\n {\n $this->setResourceId($res->getResourceId());\n $this->setResourceClass($res->getResourceClass());\n }", "public function restore()\n\t{\n\t\t$this->files = array();\n\t}", "public static function setFile($file) {}", "public function setOriginal(string $original): self\n {\n if ($original !== $this->original) {\n $this->original = $original;\n $this->transliteration = null;\n }\n\n return $this;\n }", "public function setFile($file) {}", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "public function getOriginalFile() {}", "public function getOriginalFile() {}", "public function setFile(File $file)\n\t{\n\t\t$this->file=$file; \n\t\t$this->keyModified['file'] = 1; \n\n\t}", "function SetOtherObjectClient($Resource) {\n\t\t\t$this->ObjClientSide = $Resource;\n\t\t\tif (is_uploaded_file($this->GetFileTempName())) {\n\t\t\t\t$this->SetReplaceMode(0);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->RollbackUpload();\n\t\t\t\tdie('El cambio de recurso es erroneo: se ha procedido al rollback de todas las operaciones');\n\t\t\t}\n\t\t}", "function _wp_image_meta_replace_original($saved_data, $original_file, $image_meta, $attachment_id)\n {\n }", "function reset() {\n\t\t$this->_ID = 0;\n\t\t$this->_MovieID = 0;\n\t\t$this->_Type = 'File';\n\t\t$this->_Ext = '';\n\t\t$this->_ProfileID = 0;\n\t\t$this->_Description = '';\n\t\t$this->_Width = null;\n\t\t$this->_Height = null;\n\t\t$this->_Metadata = array();\n\t\t$this->_Filename = null;\n\t\t$this->_DateModified = date(system::getConfig()->getDatabaseDatetimeFormat()->getParamValue());\n\t\t$this->_CdnURL = null;\n\t\t$this->_Notes = null;\n\t\t$this->_MarkForDeletion = false;\n\t\t$this->setModified(false);\n\t\treturn $this;\n\t}" ]
[ "0.71453226", "0.6865306", "0.66661096", "0.6439208", "0.6436352", "0.641165", "0.62328446", "0.62123764", "0.61517024", "0.60588366", "0.5894209", "0.5777561", "0.57602704", "0.57152414", "0.5713898", "0.5616245", "0.5580611", "0.5564613", "0.55543405", "0.5535997", "0.5516889", "0.5500962", "0.5500962", "0.5500962", "0.54589534", "0.54589534", "0.54020566", "0.53996694", "0.5352594", "0.5345049" ]
0.71582353
0
Test that we can read and parse the email
public function testMailParse() { // Parse a simple email $email_message = new EmailParse(); $email_message->read_email(true, $this->_email); // Basics $this->assertEquals('"ElkArte Community" <[email protected]>', $email_message->headers['reply-to']); $this->assertEquals('[ElkArte Community] Test Message', $email_message->subject); // Its marked as spam $email_message->load_spam(); $this->assertTrue($email_message->spam_found); // A few more details $email_message->load_address(); $this->assertEquals('[email protected]', $email_message->email['from']); $this->assertEquals('[email protected]', $email_message->email['to'][0]); // The key $email_message->load_key(); $this->assertEquals('cd8c399768891330804a1d2fc613ccf3-t4124', $email_message->message_key_id); $this->assertEquals('cd8c399768891330804a1d2fc613ccf3', $email_message->message_key); // The plain and HTML messages $this->assertStringContainsString('<strong>Testing</strong>', $email_message->body); $this->assertRegExp('/Testing\n/', $email_message->plain_body); // The IP $this->assertEquals('85.214.104.5', $email_message->load_ip()); // And some MD as well $markdown = pbe_load_text($email_message->html_found, $email_message, array()); $this->assertStringContainsString('[b]Testing[/b]', $markdown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testMailParse()\n {\n $raw = \"UmV0dXJuLVBhdGg6IDxzdXBwb3J0QGNvbW9kby5jb20+ClgtT3JpZ2luYWwtVG86IHNzbEB0ZXN0LmRlCkRlbGl2ZXJlZC1UbzogY2Rzc2xAaG9zdDJjMS50ZXN0LmRlClJlY2VpdmVkOiBmcm9tIG14cDAubmljZ2F0ZS5jb20gKG14cDAubmljZ2F0ZS5jb20gWzE4OC40MC42OS43Nl0pCiAgICBieSBob3MudGVzdC5kZSAoUG9zdGZpeCkgd2l0aCBFU01UUFMgaWQgMDAxNjU3RDMKICAgIGZvciA8c3NsQHRlc3QuZGU+OyBXZWQsICA5IEp1bCAyMDE0IDE2OjAwOjM0ICswMjAwIChDRVNUKQpSZWNlaXZlZDogZnJvbSBtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgKG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldCBbSVB2NjoyYTAyOjE3ODg6NDAyOjFjODg6OmMwYTg6ODhjY10pCiAgICBieSBteHAwLm5pY2dhdGUuY29tIChQb3N0Zml4KSB3aXRoIEVTTVRQUyBpZCAxMDUxOUUyODAwQgogICAgZm9yIDxzc2xAdGVzdC5kZT47IFdlZCwgIDkgSnVsIDIwMTQgMTY6MDA6MzIgKzAyMDAgKENFU1QpClJlY2VpdmVkOiAocW1haWwgMTk3MjkgaW52b2tlZCBieSB1aWQgMTAwOCk7IDkgSnVsIDIwMTQgMTQ6MDA6MjkgLTAwMDAKUmVjZWl2ZWQ6IGZyb20gb3JhY2xlb25lX21jci5tY3IuY29sby5jb21vZG8ubmV0IChIRUxPIG1haWwuY29sby5jb21vZG8ubmV0KSAoMTkyLjE2OC4xMjguMjEpCiAgICBieSBtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgKHFwc210cGQvMC44NCkgd2l0aCBTTVRQOyBXZWQsIDA5IEp1bCAyMDE0IDE1OjAwOjI5ICswMTAwClN1YmplY3Q6IE9SREVSICMxMjM0NTY3OCAtIENPTkZJUk1BVElPTgpGcm9tOiAiQ29tb2RvIFNlY3VyaXR5IFNlcnZpY2VzIiA8bm9yZXBseV9zdXBwb3J0QGNvbW9kby5jb20+Ck1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L2FsdGVybmF0aXZlOyBib3VuZGFyeT0iKEFsdGVybmF0aXZlQm91bmRhcnkpIgpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0ClRvOiAiVGVzdG1hc3RlciIgPHNzbEB0ZXN0LmRlPgpEYXRlOiBXZWQsIDA5IEp1bCAyMDE0IDEzOjU5OjUxICswMDAwCk1lc3NhZ2UtSUQ6IDw0TklyTVNzZmIyR0NQZll5VUk1bGFBQG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldD4KWC1Qcm94eS1NYWlsU2Nhbm5lci1JbmZvcm1hdGlvbjogUGxlYXNlIGNvbnRhY3QgdGhlIElTUCBmb3IgbW9yZSBpbmZvcm1hdGlvbgpYLVByb3h5LU1haWxTY2FubmVyLUlEOiAxMDUxOUUyODAwQi5BQzg1RApYLVByb3h5LU1haWxTY2FubmVyOiBGb3VuZCB0byBiZSBjbGVhbgpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1DaGVjazogbm90IHNwYW0sIFNwYW1Bc3Nhc3NpbiAobm90IGNhY2hlZCwKICAgIHNjb3JlPTEuNjI1LCByZXF1aXJlZCA1Ljc1LCBhdXRvbGVhcm49ZGlzYWJsZWQsIEhUTUxfTUVTU0FHRSAwLjAwLAogICAgU1BGX0hFTE9fUEFTUyAtMC4wMCwgU1VCSl9BTExfQ0FQUyAxLjYyKQpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1TY29yZTogMQpYLVByb3h5LU1haWxTY2FubmVyLUZyb206IHN1cHBvcnRAY29tb2RvLmNvbQpYLVByb3h5LU1haWxTY2FubmVyLVRvOiBzc2xAdGVzdC5kZQpYLVNwYW0tU3RhdHVzOiBObwoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSkKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDhiaXQKCnRlc3QKCi0tKEFsdGVybmF0aXZlQm91bmRhcnkpCkNvbnRlbnQtVHlwZTogdGV4dC9odG1sOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDhiaXQKCjxodG1sPgo8aGVhZD4KPC9oZWFkPgo8Ym9keT4KdGVzdAo8L2JvZHk+CjwvaHRtbD4KCi0tKEFsdGVybmF0aXZlQm91bmRhcnkpLS0KCg==\";\n\n $imapAdapter = $this->createImapAdpater();\n\n /** @var \\PHPUnit_Framework_MockObject_MockObject $imapExtension */\n $imapExtension = $imapAdapter->getInstance();\n\n $imapExtension\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array(0)));\n\n $imapExtension\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnValue($this->createImapRawMessage(base64_decode($raw))));\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $message = $messages[0];\n\n $this->assertEquals('ORDER #12345678 - CONFIRMATION', $message['subject']);\n $this->assertEquals(1404914391, $message['received']);\n $this->assertEquals(\"test\\n\\n\", $message['plainText']);\n }", "public function testMailAttachmentParse()\n {\n $raw = \"UmV0dXJuLVBhdGg6IDxzdXBwb3J0QGNvbW9kby5jb20+ClgtT3JpZ2luYWwtVG86IHNzbEB0ZXN0LmRlCkRlbGl2ZXJlZC1UbzogY2Rzc2xAaG9zdDJjMS50ZXN0LmRlClJlY2VpdmVkOiBmcm9tIG14cDAubmljZ2F0ZS5jb20gKG14cDAubmljZ2F0ZS5jb20gWzE4OC40MC42OS43Nl0pCiAgICBieSBob3N0MmMxLnRlc3QuZGUgKFBvc3RmaXgpIHdpdGggRVNNVFBTIGlkIEREMjA5MkIzCiAgICBmb3IgPHNzbEB0ZXN0LmRlPjsgTW9uLCAgNyBKdWwgMjAxNCAxMjozMjozOSArMDIwMCAoQ0VTVCkKUmVjZWl2ZWQ6IGZyb20gbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgW0lQdjY6MmEwMjoxNzg4OjQwMjoxYzg4OjpjMGE4Ojg4Y2NdKQogICAgYnkgbXhwMC5uaWNnYXRlLmNvbSAoUG9zdGZpeCkgd2l0aCBFU01UUFMgaWQgNEY5QjNFMjgwMEQKICAgIGZvciA8c3NsQHRlc3QuZGU+OyBNb24sICA3IEp1bCAyMDE0IDEyOjMyOjMwICswMjAwIChDRVNUKQpSZWNlaXZlZDogKHFtYWlsIDExMTYyIGludm9rZWQgYnkgdWlkIDEwMDgpOyA3IEp1bCAyMDE0IDEwOjMyOjMwIC0wMDAwClJlY2VpdmVkOiBmcm9tIG9yYWNsZW9uZV9tY3IubWNyLmNvbG8uY29tb2RvLm5ldCAoSEVMTyBtYWlsLmNvbG8uY29tb2RvLm5ldCkgKDE5Mi4xNjguMTI4LjIxKQogICAgYnkgbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChxcHNtdHBkLzAuODQpIHdpdGggU01UUDsgTW9uLCAwNyBKdWwgMjAxNCAxMTozMjozMCArMDEwMApTdWJqZWN0OiBPUkRFUiAjMTQ3NjU2MDIgLSBZb3VyIFBvc2l0aXZlU1NMIENlcnRpZmljYXRlIGZvciBmaW5hbHRlc3QudG9iaWFzLW5pdHNjaGUuZGUKRnJvbTogIkNvbW9kbyBTZWN1cml0eSBTZXJ2aWNlcyIgPG5vcmVwbHlfc3VwcG9ydEBjb21vZG8uY29tPgpUbzogInNzbEB0ZXN0LmRlIiA8c3NsQHRlc3QuZGU+CkRhdGU6IE1vbiwgMDcgSnVsIDIwMTQgMTA6MzI6MjAgKzAwMDAKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApDb250ZW50LVR5cGU6IG11bHRpcGFydC9taXhlZDsgYm91bmRhcnk9IihBbHRlcm5hdGl2ZUJvdW5kYXJ5MikiCk1lc3NhZ2UtSUQ6IDxJbkdKYlNKK0h2QUFpTUhjN1MxVTJRQG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldD4KWC1Qcm94eS1NYWlsU2Nhbm5lci1JbmZvcm1hdGlvbjogUGxlYXNlIGNvbnRhY3QgdGhlIElTUCBmb3IgbW9yZSBpbmZvcm1hdGlvbgpYLVByb3h5LU1haWxTY2FubmVyLUlEOiA0RjlCM0UyODAwRC5BMDM1MgpYLVByb3h5LU1haWxTY2FubmVyOiBGb3VuZCB0byBiZSBjbGVhbgpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1DaGVjazogbm90IHNwYW0sIFNwYW1Bc3Nhc3NpbiAobm90IGNhY2hlZCwgc2NvcmU9MSwKICAgIHJlcXVpcmVkIDUuNzUsIGF1dG9sZWFybj1kaXNhYmxlZCwgREVBUl9FTUFJTCAxLjAwLAogICAgSFRNTF9NRVNTQUdFIDAuMDAsIFNQRl9IRUxPX1BBU1MgLTAuMDApClgtUHJveHktTWFpbFNjYW5uZXItU3BhbVNjb3JlOiAxClgtUHJveHktTWFpbFNjYW5uZXItRnJvbTogc3VwcG9ydEBjb21vZG8uY29tClgtUHJveHktTWFpbFNjYW5uZXItVG86IHNzbEB0ZXN0LmRlClgtU3BhbS1TdGF0dXM6IE5vCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5MikKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7IGJvdW5kYXJ5PSIoQWx0ZXJuYXRpdmVCb3VuZGFyeSkiCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5KQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKdGVzdAoKLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZTekNDQkRPZ0F3SUJBZ0lRS0lXTnpIYTFVNUFDUkJIY0dBNGdLVEFOQmdrcWhraUc5dzBCQVFVRkFEQnoKTVFzd0NRWURWUVFHRXdKSFFqRWJNQmtHQTFVRUNCTVNSM0psWVhSbGNpQk5ZVzVqYUdWemRHVnlNUkF3RGdZRApWUVFIRXdkVFlXeG1iM0prTVJvd0dBWURWUVFLRXhGRFQwMVBSRThnUTBFZ1RHbHRhWFJsWkRFWk1CY0dBMVVFCkF4TVFVRzl6YVhScGRtVlRVMHdnUTBFZ01qQWVGdzB4TkRBM01EY3dNREF3TURCYUZ3MHhOVEEzTURjeU16VTUKTlRsYU1JR0VNU0V3SHdZRFZRUUxFeGhFYjIxaGFXNGdRMjl1ZEhKdmJDQldZV3hwWkdGMFpXUXhJekFoQmdOVgpCQXNUR2todmMzUmxaQ0JpZVNCRGFHVmphMlJ2YldGcGJpQkhiV0pJTVJRd0VnWURWUVFMRXd0UWIzTnBkR2wyClpWTlRUREVrTUNJR0ExVUVBeE1iWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUlJQklqQU4KQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBMzNWTVpnd2ZOc0hoOHZlZTBkdWNoVUhsQ3drWApTcGd0VW9iVFFCZ2dEbk1HNlVUbEltcEFVVWNORzlYbWZHVlVFdE15UXd4bCthc0VkaFpoYnF1VVdqcmdNV2FlCitWZlFtN3kwQlVNNWxFRlpOdTVkWjVJblRVa2hQOHZDQnJGUVVoSGQwU1FuNjdTUWFscVJVZFNOVjBCRDBjWUYKbTJHZmtyUlZyWWNjai9JOFIxOVV6eDlNNXZwNGY4Tmw0YytuVTJzVTVLSkFZQ2JJdFBDY0lDVENaQzdQNmJ6TwprenArb1ZpbmVmeVVZcGRXMFVhd21vWmVsV2R4cllNaUZjYW5oZTZFQnI0WUg4Ny9CWWVReUcxZHJhMkhiMFdTCmpoNGxOMUFpZXRwK0E2S0I1ZHJPM1JQaGRDcHhFd2N6TGMyczFVZTl4dmdNdnd6NzM3OHpYSWNxbHdJREFRQUIKbzRJQnh6Q0NBY013SHdZRFZSMGpCQmd3Rm9BVW1lUkFYMnNVWGo0RjJkM1RZMVQ4WXJqM0FLd3dIUVlEVlIwTwpCQllFRkd1SzQ3blFNTFdNdmFOVDlvRjNzeFJObCtzck1BNEdBMVVkRHdFQi93UUVBd0lGb0RBTUJnTlZIUk1CCkFmOEVBakFBTUIwR0ExVWRKUVFXTUJRR0NDc0dBUVVGQndNQkJnZ3JCZ0VGQlFjREFqQlFCZ05WSFNBRVNUQkgKTURzR0N5c0dBUVFCc2pFQkFnSUhNQ3d3S2dZSUt3WUJCUVVIQWdFV0htaDBkSEE2THk5M2QzY3VjRzl6YVhScApkbVZ6YzJ3dVkyOXRMME5RVXpBSUJnWm5nUXdCQWdFd093WURWUjBmQkRRd01qQXdvQzZnTElZcWFIUjBjRG92CkwyTnliQzVqYjIxdlpHOWpZUzVqYjIwdlVHOXphWFJwZG1WVFUweERRVEl1WTNKc01Hd0dDQ3NHQVFVRkJ3RUIKQkdBd1hqQTJCZ2dyQmdFRkJRY3dBb1lxYUhSMGNEb3ZMMk55ZEM1amIyMXZaRzlqWVM1amIyMHZVRzl6YVhScApkbVZUVTB4RFFUSXVZM0owTUNRR0NDc0dBUVVGQnpBQmhoaG9kSFJ3T2k4dmIyTnpjQzVqYjIxdlpHOWpZUzVqCmIyMHdSd1lEVlIwUkJFQXdQb0liWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsZ2g5M2QzY3UKWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUEwR0NTcUdTSWIzRFFFQkJRVUFBNElCQVFDbwpPL1B5cDJHTHdmWDBlbmxnVnJyVVZUYmh2NVBQV1pBajQ2Z3pidVhVYUY5a2hMNy9DQ1VJZEc3ekdvdGlDWlVZCklDOUJrYkc2S0MrWEpWdGgzam50a2JNN0ZaQzFCUHk5Q3VtSmNpWlVHdUJzem12c1k4N1VVL2FVZ0t2SlpOaVoKZGwxMW92dnBUQTJEdW5ISmtyOXF0eStFQkMyTHY4aFNwTHZlMS9KVFlwYXBqZTRSeXlrcjFYY0phaGRnOEtjOQpXN1U0SmY0aWNoV2lQTWFoSnBnZ0NrVGE0eGYybnFXdTMvVG1jeThFbjNnVWZZNEZzRTg5eWJmVDZzT0J0SVdUCnNma3BpUm5vL1FWUTBQZW4yTCtzVGFCZVZ5YmswN0IrRGdMRWxGUmxuS2NDWFBzUU9vVVdlcHJ3VkNVa1E2VE4KNFNscmRxOHY5T2lkUzg2Z01CRU4KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSkKQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9SVNPLTg4NTktMQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0Cgo8aHRtbD4KPGhlYWQ+Cgo8L2hlYWQ+Cjxib2R5Pgp0ZXN0CjwvYm9keT4KPC9odG1sPgoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSktLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeTIpCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24veC16aXAtY29tcHJlc3NlZDsgbmFtZT0iZmluYWx0ZXN0X3RvYmlhcy1uaXRzY2hlX2RlLnppcCIKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFzZTY0CkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7IGZpbGVuYW1lPSJmaW5hbHRlc3RfdG9iaWFzLW5pdHNjaGVfZGUuemlwIgoKVUVzREJBb0FBQUFBQUFBQVVFQ1JJcVYrM1FZQUFOMEdBQUFsQUFBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdQphWFJ6WTJobFgyUmxMbU5oTFdKMWJtUnNaUzB0TFMwdFFrVkhTVTRnUTBWU1ZFbEdTVU5CVkVVdExTMHRMUXBOClNVbEZOVlJEUTBFNE1tZEJkMGxDUVdkSlVVSXlPRk5TYjBaR2JrTnFWbE5PWVZoNFFUUkJSM3BCVGtKbmEzRm8KYTJsSE9YY3dRa0ZSVlVaQlJFSjJDazFSYzNkRFVWbEVWbEZSUjBWM1NsUlNWRVZWVFVKSlIwRXhWVVZEYUUxTQpVVmRTYTFaSVNqRmpNMUZuVVZWSmVFcHFRV3RDWjA1V1FrRnpWRWhWUm1zS1drWlNlV1JZVGpCSlJWWTBaRWRXCmVXSnRSbk5KUmxKVlZVTkNUMXBZVWpOaU0wcHlUVk5KZDBsQldVUldVVkZFUlhoc1FscEhVbFZqYmxaNlpFTkMKUmdwbFNGSnNZMjAxYUdKRFFrUlJVMEpUWWpJNU1FMUNORmhFVkVWNVRVUkplRTVxUVhkTlJFRjNUVVp2V0VSVQpTWGROUkZWNlRVUkZkMDVFWjNwUFJtOTNDbU42UlV4TlFXdEhRVEZWUlVKb1RVTlNNRWw0UjNwQldrSm5UbFpDClFXZFVSV3RrZVZwWFJqQmFXRWxuVkZkR2RWa3lhR3hqTTFKc1kycEZVVTFCTkVjS1FURlZSVUo0VFVoVk1rWnoKV20wNWVWcEVSV0ZOUW1kSFFURlZSVU5vVFZKUk1EbE9WREJTVUVsRlRrSkpSWGh3WWxkc01GcFhVWGhIVkVGWQpRbWRPVmdwQ1FVMVVSVVpDZG1NeWJEQmhXRnBzVlRGT1RVbEZUa0pKUkVsM1oyZEZhVTFCTUVkRFUzRkhVMGxpCk0wUlJSVUpCVVZWQlFUUkpRa1IzUVhkblowVkxDa0Z2U1VKQlVVUnZObXB1YWtseFlYRjFZMUZCTUU5bGNWcDYKZEVSQ056RlFhM1YxT0hablIycFJTek5uTnpCUmIzUmtRVFoyYjBKVlJqUldObUUwVW5NS1RtcGliRzk1VkdrdgphV2RDYTB4NldETlJLelZMTURWSlpIZFdjSEk1TlZoTlRFaHZLM2h2UkRscWVHSlZlRFpvUVZWc2IyTnVVRmROCmVYUkVjVlJqZVFwVlp5dDFTakZaZUUxSFEzUjVZakY2VEVSdWRXdE9hREZ6UTFWb1dVaHpjV1ozVERsbmIxVm0KWkVVclUwNUlUbU5JVVVObmMwMUVjVzFQU3l0QlVsSlpDa1o1WjJscGJtUmtWVU5ZVG0xdGVXMDFVWHBzY1hscQpSSE5wUTBvNFFXTnJTSEJZUTB4elJHdzJaWG95VUZKSlNGTkVNMU4zZVU1WFVXVjZWRE42Vmt3S2VVOW1NbWhuClZsTkZSVTloYWtKa09HazJjVGhsVDBSM1VsUjFjMmRHV0N0TFNsQm9RMmhHYnpsR1NsaGlMelZKUXpGMFpFZHQKY0c1ak5XMURkRW8xUkFwWlJEZElWM2x2VTJKb2NuVjVlbTExZDNwWFpIRk1lR1J6UXk5RVFXZE5Ra0ZCUjJwbgpaMFl6VFVsSlFtTjZRV1pDWjA1V1NGTk5SVWRFUVZkblFsTjBDblphYURaT1RGRnRPUzl5UlVwc1ZIWkJOek5uClNrMTBWVWRxUVdSQ1owNVdTRkUwUlVablVWVnRaVkpCV0RKelZWaHFORVl5WkROVVdURlVPRmx5YWpNS1FVdDMKZDBSbldVUldVakJRUVZGSUwwSkJVVVJCWjBWSFRVSkpSMEV4VldSRmQwVkNMM2RSU1UxQldVSkJaamhEUVZGQgpkMFZSV1VSV1VqQm5Ra0Z2ZHdwRFJFRkhRbWRTVmtoVFFVRk5SVkZIUVRGVlpFaDNVVGxOUkhOM1QyRkJNMjlFClYwZE5NbWd3WkVoQk5reDVPV3BqYlhkMVpGaE9iR051VW5sa1dFNHdDa3h0VG5aaVV6bENXa2RTVldOdVZucGsKUlZZMFpFZFdlV0p0Um5OUk1FWlRZakk1TUV4dFRubGlSRU5DYzNkWlNVdDNXVUpDVVZWSVFWRkZSV2RoV1hjSwpaMkZOZDFCM1dVbExkMWxDUWxGVlNFMUJTMGROTW1nd1pFaEJOa3g1T1dwamJsRjFaRmhPYkdOdVVubGtXRTR3ClRHMU9kbUpUT1VKYVIxSlZZMjVXZWdwa1JWWTBaRWRXZVdKdFJuTlJNRVpUWWpJNU1FeHVRVE5aZWtFMVFtZG4KY2tKblJVWkNVV04zUVc5WmRHRklVakJqUkc5MlRESk9lV1JETlRGak1sWjVDbVJJU2pGak0xRjFXVEk1ZEV3dwpSbXRhUmxKNVpGaE9NRlpXVWs5Vk1HUkVVVEJGZFZrelNqQk5RMVZIUTBOelIwRlJWVVpDZWtGQ2FHaHNiMlJJClVuY0tUMms0ZG1JeVRucGpRelV4WXpKV2VXUklTakZqTTFGMVdUSTVkRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkMKVVZWQlFUUkpRa0ZSUTJOT2RVNVBjblpIU3dwMU1ubFlha2s1VEZvNVEyWXlTVk54Ym5sR1prNWhSbUo0UTNScQpSR1ZwT0dReE1tNTRSR1k1VTNreVpUWkNNWEJ2WTBORmVrNUdkR2t2VDBKNU5UbE1DbVJNUWtwTGFraHZUakJFCmNrZzViVmh2ZUc5U01WTmhibUpuS3pZeFlqUnpMMkpUVWxwT2VTdFBlR3hSUkZoeFZqaDNVVlJ4WW5SSVJEUjAKWXpCaGVrTUtaVE5qYUZWT01XSnhLemN3Y0hScVZWTnNUbkpVWVRJMGVVOW1iVlZzYUU1Uk1IcERiMmxPVUVSegpRV2RQWVM5bVZEQktZa2gwVFVvNVFtZEtWMU55V2dvMlJXOVpkbnBNTnl0cE1XdHBOR1pMVjNsMmIzVkJkQ3QyCmFHTlRlSGRQUTB0aE9WbHlORmRGV0ZRd1N6TjVUbEozT0RKMlJVd3JRV0ZZWlZKRGF5OXNDblYxUjNSdE9EZG0KVFRBMGQwOHJiVkJhYml0REsyMTJOakkyVUVGamQwUnFNV2hMZGxSbVNWQlhhRkpTU0RJeU5HaHZSbWxDT0RWagpZM05LVURneFkzRUtZMlJ1Vld3MFdHMUhSazh6Q2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLClVFc0RCQW9BQUFBQUFBQUE1MFRDdzhFOVp3Y0FBR2NIQUFBZkFBQUFabWx1WVd4MFpYTjBYM1J2WW1saGN5MXUKYVhSelkyaGxYMlJsTG1OeWRDMHRMUzB0UWtWSFNVNGdRMFZTVkVsR1NVTkJWRVV0TFMwdExRcE5TVWxHVTNwRApRMEpFVDJkQmQwbENRV2RKVVV0SlYwNTZTR0V4VlRWQlExSkNTR05IUVRSblMxUkJUa0puYTNGb2EybEhPWGN3ClFrRlJWVVpCUkVKNkNrMVJjM2REVVZsRVZsRlJSMFYzU2toUmFrVmlUVUpyUjBFeFZVVkRRazFUVWpOS2JGbFkKVW14amFVSk9XVmMxYW1GSFZucGtSMVo1VFZKQmQwUm5XVVFLVmxGUlNFVjNaRlJaVjNodFlqTkthMDFTYjNkSApRVmxFVmxGUlMwVjRSa1JVTURGUVVrVTRaMUV3UldkVVIyeDBZVmhTYkZwRVJWcE5RbU5IUVRGVlJRcEJlRTFSClZVYzVlbUZZVW5Ca2JWWlVWVEIzWjFFd1JXZE5ha0ZsUm5jd2VFNUVRVE5OUkdOM1RVUkJkMDFFUW1GR2R6QjQKVGxSQk0wMUVZM2xOZWxVMUNrNVViR0ZOU1VkRlRWTkZkMGgzV1VSV1VWRk1SWGhvUldJeU1XaGhWelJuVVRJNQpkV1JJU25aaVEwSlhXVmQ0Y0ZwSFJqQmFWMUY0U1hwQmFFSm5UbFlLUWtGelZFZHJhSFpqTTFKc1drTkNhV1ZUClFrUmhSMVpxWVRKU2RtSlhSbkJpYVVKSVlsZEtTVTFTVVhkRloxbEVWbEZSVEVWM2RGRmlNMDV3WkVkc01ncGEKVms1VVZFUkZhMDFEU1VkQk1WVkZRWGhOWWxwdGJIVlpWM2d3V2xoT01FeHVVblpaYld4b1kza3hkV0ZZVW5wWgpNbWhzVEcxU2JFMUpTVUpKYWtGT0NrSm5hM0ZvYTJsSE9YY3dRa0ZSUlVaQlFVOURRVkU0UVUxSlNVSkRaMHREClFWRkZRVE16VmsxYVozZG1Ubk5JYURoMlpXVXdaSFZqYUZWSWJFTjNhMWdLVTNCbmRGVnZZbFJSUW1kblJHNU4KUnpaVlZHeEpiWEJCVlZWalRrYzVXRzFtUjFaVlJYUk5lVkYzZUd3cllYTkZaR2hhYUdKeGRWVlhhbkpuVFZkaApaUW9yVm1aUmJUZDVNRUpWVFRWc1JVWmFUblUxWkZvMVNXNVVWV3RvVURoMlEwSnlSbEZWYUVoa01GTlJialkzClUxRmhiSEZTVldSVFRsWXdRa1F3WTFsR0NtMHlSMlpyY2xKV2NsbGpZMm92U1RoU01UbFZlbmc1VFRWMmNEUm0KT0U1c05HTXJibFV5YzFVMVMwcEJXVU5pU1hSUVEyTkpRMVJEV2tNM1VEWmllazhLYTNwd0syOVdhVzVsWm5sVgpXWEJrVnpCVllYZHRiMXBsYkZka2VISlpUV2xHWTJGdWFHVTJSVUp5TkZsSU9EY3ZRbGxsVVhsSE1XUnlZVEpJCllqQlhVd3BxYURSc1RqRkJhV1YwY0N0Qk5rdENOV1J5VHpOU1VHaGtRM0I0UlhkamVreGpNbk14VldVNWVIWm4KVFhaM2VqY3pOemg2V0VsamNXeDNTVVJCVVVGQ0NtODBTVUo0ZWtORFFXTk5kMGgzV1VSV1VqQnFRa0puZDBadgpRVlZ0WlZKQldESnpWVmhxTkVZeVpETlVXVEZVT0ZseWFqTkJTM2QzU0ZGWlJGWlNNRThLUWtKWlJVWkhkVXMwCk4yNVJUVXhYVFhaaFRsUTViMFl6YzNoU1Rtd3JjM0pOUVRSSFFURlZaRVIzUlVJdmQxRkZRWGRKUm05RVFVMUMKWjA1V1NGSk5RZ3BCWmpoRlFXcEJRVTFDTUVkQk1WVmtTbEZSVjAxQ1VVZERRM05IUVZGVlJrSjNUVUpDWjJkeQpRbWRGUmtKUlkwUkJha0pSUW1kT1ZraFRRVVZUVkVKSUNrMUVjMGREZVhOSFFWRlJRbk5xUlVKQlowbElUVU4zCmQwdG5XVWxMZDFsQ1FsRlZTRUZuUlZkSWJXZ3daRWhCTmt4NU9UTmtNMk4xWTBjNWVtRllVbkFLWkcxV2VtTXkKZDNWWk1qbDBUREJPVVZWNlFVbENaMXB1WjFGM1FrRm5SWGRQZDFsRVZsSXdaa0pFVVhkTmFrRjNiME0yWjB4SgpXWEZoU0ZJd1kwUnZkZ3BNTWs1NVlrTTFhbUl5TVhaYVJ6bHFXVk0xYW1JeU1IWlZSemw2WVZoU2NHUnRWbFJWCk1IaEVVVlJKZFZrelNuTk5SM2RIUTBOelIwRlJWVVpDZDBWQ0NrSkhRWGRZYWtFeVFtZG5ja0puUlVaQ1VXTjMKUVc5WmNXRklVakJqUkc5MlRESk9lV1JETldwaU1qRjJXa2M1YWxsVE5XcGlNakIyVlVjNWVtRllVbkFLWkcxVwpWRlV3ZUVSUlZFbDFXVE5LTUUxRFVVZERRM05IUVZGVlJrSjZRVUpvYUdodlpFaFNkMDlwT0haaU1rNTZZME0xCmFtSXlNWFphUnpscVdWTTFhZ3BpTWpCM1VuZFpSRlpTTUZKQ1JVRjNVRzlKWWxwdGJIVlpWM2d3V2xoT01FeHUKVW5aWmJXeG9ZM2t4ZFdGWVVucFpNbWhzVEcxU2JHZG9PVE5rTTJOMUNscHRiSFZaVjNnd1dsaE9NRXh1VW5aWgpiV3hvWTNreGRXRllVbnBaTW1oc1RHMVNiRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkNVVlZCUVRSSlFrRlJRMjhLClR5OVFlWEF5UjB4M1psZ3daVzVzWjFaeWNsVldWR0pvZGpWUVVGZGFRV28wTm1kNlluVllWV0ZHT1d0b1REY3YKUTBOVlNXUkhOM3BIYjNScFExcFZXUXBKUXpsQ2EySkhOa3RESzFoS1ZuUm9NMnB1ZEd0aVRUZEdXa014UWxCNQpPVU4xYlVwamFWcFZSM1ZDYzNwdGRuTlpPRGRWVlM5aFZXZExka3BhVG1sYUNtUnNNVEZ2ZG5ad1ZFRXlSSFZ1ClNFcHJjamx4ZEhrclJVSkRNa3gyT0doVGNFeDJaVEV2U2xSWmNHRndhbVUwVW5sNWEzSXhXR05LWVdoa1p6aEwKWXprS1Z6ZFZORXBtTkdsamFGZHBVRTFoYUVwd1oyZERhMVJoTkhobU1tNXhWM1V6TDFSdFkzazRSVzR6WjFWbQpXVFJHYzBVNE9YbGlabFEyYzA5Q2RFbFhWQXB6Wm10d2FWSnVieTlSVmxFd1VHVnVNa3dyYzFSaFFtVldlV0pyCk1EZENLMFJuVEVWc1JsSnNia3RqUTFoUWMxRlBiMVZYWlhCeWQxWkRWV3RSTmxST0NqUlRiSEprY1RoMk9VOXAKWkZNNE5tZE5Ra1ZPQ2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLVUVzQkFoUUFDZ0FBQUFBQQpBQUJRUUpFaXBYN2RCZ0FBM1FZQUFDVUFBQUFBQUFBQUFRQWdBTGFCQUFBQUFHWnBibUZzZEdWemRGOTBiMkpwCllYTXRibWwwYzJOb1pWOWtaUzVqWVMxaWRXNWtiR1ZRU3dFQ0ZBQUtBQUFBQUFBQUFPZEV3c1BCUFdjSEFBQm4KQndBQUh3QUFBQUFBQUFBQkFDQUF0b0VnQndBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdWFYUnpZMmhsWDJSbApMbU55ZEZCTEJRWUFBQUFBQWdBQ0FLQUFBQURFRGdBQUFBQT0KCi0tKEFsdGVybmF0aXZlQm91bmRhcnkyKS0t\";\n\n $imapAdapter = $this->createImapAdpater();\n\n /** @var \\PHPUnit_Framework_MockObject_MockObject $imapExtension */\n $imapExtension = $imapAdapter->getInstance();\n\n $imapExtension\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array(0)));\n\n $imapExtension\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnValue($this->createImapRawMessage(base64_decode($raw))));\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $attachment = $messages[0]['attachments'][0];\n\n $this->assertEquals('application/x-zip-compressed', $attachment['mime']);\n $this->assertEquals('finaltest_tobias-nitsche_de.zip', $attachment['filename']);\n $this->assertEquals(3962, strlen($attachment['content']));\n }", "public function testEmailHeaderParsing()\n {\n $default = $this->getDefaultRequest();\n\n $toAddress = array(\n 'a simple to header should return the correct address' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple to header should return the correct address, trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex to header should return the correct address, with no <>' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'a complex email address in the to header should return the correct address' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'an incorrect email address in the to header should not be recognized' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a name resembling an email address in the to header should not be used instead of the actual address' => array(\n 'string' => '[email protected] <[email protected]>',\n 'expected' => '[email protected]',\n ),\n );\n\n foreach ($toAddress as $label => $data) {\n $default['headers']['To'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getTo(), \"Parsing $label.\");\n }\n\n $rawFrom = array(\n 'a simple raw header should return as is' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple raw header should return as is, but trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex raw header should return as is' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '\"John Doe, The second\" <[email protected]>',\n ),\n );\n\n foreach ($rawFrom as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFrom(), \"Parsing $label.\");\n }\n\n $fromAddress = array(\n 'a simple from header should return the correct address' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple from header should return the correct address, trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex from header should return the correct address, with no <>' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'a complex email address in the from header should return the correct address' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'an incorrect email address in the from header should not be recognized' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a name resembling an email address in the from header should not be used instead of the actual address' => array(\n 'string' => '[email protected] <[email protected]>',\n 'expected' => '[email protected]',\n ),\n );\n\n foreach ($fromAddress as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFromAddress(), \"Parsing $label.\");\n }\n\n $fromName = array(\n 'a simple from header with no name should return an empty string' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a complex from header with no name should return an empty string' => array(\n 'string' => ' <[email protected]>',\n 'expected' => '',\n ),\n 'a header with a simple name should just return the name' => array(\n 'string' => 'John Doe <[email protected]>',\n 'expected' => 'John Doe',\n ),\n 'a header with a simple name should just return the name, no double quotes' => array(\n 'string' => '\"John Doe\" <[email protected]>',\n 'expected' => 'John Doe',\n ),\n 'a header with a simple name should just return the name, no single quotes' => array(\n 'string' => \"'John Doe' <[email protected]>\",\n 'expected' => 'John Doe',\n ),\n 'a header can that contains a name with special characters should work' => array(\n 'string' => '\"John Doe, l\\'asplééààéàéèt % ?/)(_--\" <[email protected]>',\n 'expected' => 'John Doe, l\\'asplééààéàéèt % ?/)(_--',\n ),\n );\n\n foreach ($fromName as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFromName(), \"Parsing $label.\");\n }\n\n $subject = array(\n 'a simple subject should return it verbatim' => array(\n 'string' => 'Subject',\n 'expected' => 'Subject',\n ),\n 'a simple subject should return it trimmed' => array(\n 'string' => ' Subject ',\n 'expected' => 'Subject',\n ),\n 'a header with no subject should just return an empty string' => array(\n 'string' => null,\n 'expected' => '',\n ),\n );\n\n foreach ($subject as $label => $data) {\n $default['headers']['Subject'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getSubject(), \"Parsing $label.\");\n }\n\n $messageID = array(\n 'a simple message ID should return it verbatim' => array(\n 'string' => '890asdjhgkasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n 'expected' => '890asdjhgkasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n ),\n 'a simple message ID should return it trimmed' => array(\n 'string' => ' 890asdjhgksdasdsaddasf90-sdfsdffsdf--sdf8s@df089sdfsdf ',\n 'expected' => '890asdjhgksdasdsaddasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n ),\n 'a header with no message ID should just return an empty string' => array(\n 'string' => null,\n 'expected' => '',\n ),\n );\n\n foreach ($messageID as $label => $data) {\n $default['headers']['Message-ID'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getMessageID(), \"Parsing $label.\");\n }\n\n $recipients = array(\n 'a simple, empty CC header' => array(\n 'string' => '',\n 'expected' => null,\n ),\n 'a simple CC header, with only one recipient (no name)' => array(\n 'string' => '[email protected]',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n )),\n ),\n 'a simple CC header, with only one recipient (with name)' => array(\n 'string' => 'John Doe <[email protected]>',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n )),\n ),\n 'a complex CC header, with only one recipient (with name)' => array(\n 'string' => ' üéà-èàèéasd@asdjk <[email protected]> ',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => 'üéà-èàèéasd@asdjk',\n 'raw' => 'üéà-èàèéasd@asdjk <[email protected]>',\n )),\n ),\n 'a simple CC header, with multiple recipients (no name)' => array(\n 'string' => '[email protected], [email protected]',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n ),\n ),\n ),\n 'a simple CC header, with multiple recipients (with name)' => array(\n 'string' => 'John Doe <[email protected]>, Jane Doe <[email protected]>',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => 'Jane Doe',\n 'raw' => 'Jane Doe <[email protected]>',\n ),\n ),\n ),\n 'a complex CC header, with multiple invalid recipients' => array(\n 'string' => 'John Doe <[email protected]>,, jimmy carter, jim@jane, Jane Doe <[email protected]>',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => 'Jane Doe',\n 'raw' => 'Jane Doe <[email protected]>',\n ),\n ),\n ),\n );\n\n foreach ($recipients as $label => $data) {\n $default['headers']['Cc'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getRecipients(), \"Parsing $label.\");\n }\n }", "public function testParseEmailm1010() : void\n {\n $handle = \\fopen($this->messageDir . '/m1010.txt', 'r');\n $message = $this->parser->parse($handle, true);\n\n $failMessage = 'Failed while parsing m1010';\n $message->setCharsetOverride('iso-8859-1');\n $f = $message->getTextStream(0);\n $this->assertNotNull($f, $failMessage);\n $this->assertTextContentTypeEquals('HasenundFrosche.txt', $f, $failMessage);\n\n $message = null;\n // still open\n \\fseek($handle, 0);\n \\fread($handle, 1);\n \\fclose($handle);\n }", "public function testRegistrationEmailWrongFormat(): void { }", "public function testGetUserEmail()\n {\n $mail = $this->la->getMail('poa32kc');\n $this->assertEquals('[email protected]', $mail);\n }", "public function testEmailBodyParsing()\n {\n $default = $this->getDefaultRequest(array('plain', 'html'));\n\n $request = new Request(array(), $default + array(\n 'html' => 'html',\n 'plain' => 'plain',\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals('plain', $email->getBody(), \"Plain text emails always take precedence.\");\n\n $plainText = array(\n 'a simple, straight-forward email body' => array(\n 'string' => \"Line 1\\nLine2\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'a simple, straight-forward email body with different newlines' => array(\n 'string' => \"Line 1\\rLine2\\r\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with trailing white-space' => array(\n 'string' => \"Line 1\\rLine2\\r\\n\\nLine3 \",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with leading white-space' => array(\n 'string' => \" Line 1\\rLine2\\r\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with leading and trailing white-space' => array(\n 'string' => \" \\n\\r Line 1\\rLine2\\r\\n\\nLine3 \\r \",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n );\n\n foreach ($plainText as $label => $data) {\n $request = new Request(array(), $default + array(\n 'plain' => $data['string'],\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getBody(), \"Parsing $label.\");\n }\n\n $htmlText = array(\n 'a simple, straight-forward email body, with only divs' => array(\n 'string' => \"<div>Line 1</div><div>Line2</div><div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only divs and containing newlines as well' => array(\n 'string' => \"<div>Line 1</div>\\n<div>Line2</div>\\n<div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only divs and containing different newlines' => array(\n 'string' => \"<div>Line 1</div>\\r\\n<div>Line2</div>\\r<div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only ps and containing different newlines' => array(\n 'string' => \"<p>Line 1</p>\\r\\n<p>Line2</p>\\r<p>Line3</p>\",\n 'expected' => \"Line 1\\n\\nLine2\\n\\nLine3\",\n ),\n 'an email body containing brs' => array(\n 'string' => \"Line 1<br>Line2<br />Line3\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body containing brs and newlines' => array(\n 'string' => \"Line 1<br>\\n\\n\\nLine2<br />\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, containing nested divs and ps' => array(\n 'string' => \"<div><p>Line 1</p><div><div></div><p>Line2</p></div></div><div><div><p>Line3</p></div></div>\",\n 'expected' => \"Line 1\\n\\nLine2\\n\\nLine3\",\n ),\n );\n\n foreach ($htmlText as $label => $data) {\n $request = new Request(array(), $default + array(\n 'html' => $data['string'],\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getBody(), \"Parsing $label.\");\n }\n }", "public function testEmail() {\n $this->assertEquals('[email protected]', Sanitize::email('em<a>[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('email+t(a)[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('em\"ail+t(a)[email protected]'));\n }", "public function parseMailFile($raw){\n\t\t\tif($raw === false) return false;\n\t\t\t$s = array(\t\".\", \t\"+\"\t\t);\n\t\t\t$r = array(\t\"\\.\", \t\"\\+\"\t);\n\t\t\t$m = preg_match(\"/^(From \".preg_quote($this->responseEmail()).\".+)(^From )?/ms\", $raw, $matches);\n\t\t\tif($m)\treturn trim($matches[1]);\n\t\t\telse return false;\n\t\t}", "protected function setUp(): void\n\t{\n\t\tglobal $txt;\n\t\trequire_once(SUBSDIR . '/Emailpost.subs.php');\n\n\t\t$lang = new Loader('english', $txt, database());\n\t\t$lang->load('Maillist');\n\t\tUser::$info = new UserInfo(['name' => 'name']);\n\n\t\t$this->_email = 'Return-Path: <[email protected]>\nDelivered-To: <[email protected]>\nReceived: from galileo.tardis.com\n\tby galileo.tardis.com (Dovecot) with LMTP id znQ3AvalOVi/SgAAhPm7pg\n\tfor <[email protected]>; Sat, 26 Nov 2016 09:10:46 -0600\nReceived: by galileo.tardis.com (Postfix, from userid 1005)\n\tid 0671C1C8; Sat, 26 Nov 2016 09:10:46 -0600 (CST)\nX-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on\n\tgalileo.tardis.com\nX-Spam-Flag: YES\nX-Spam-Level: ******\nX-Spam-Status: Yes, score=5.0 required=5.0 tests=HTML_IMAGE_ONLY_16,\n\tHTML_MESSAGE,HTML_SHORT_LINK_IMG_2,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI,\n\tMPART_ALT_DIFF,RCVD_IN_BRBL_LASTEXT,T_DKIM_INVALID,URIBL_BLACK autolearn=no\n\tautolearn_force=no version=3.4.0\nReceived: from mail.elkarte.net (s2.eurich.de [85.214.104.5])\n\tby galileo.tardis.com (Postfix) with ESMTP id 1872579\n\tfor <[email protected]>; Sat, 26 Nov 2016 09:10:40 -0600 (CST)\nReceived: from localhost (localhost [127.0.0.1])\n\tby mail.elkarte.net (Postfix) with ESMTP id 9DE3C4CE1535\n\tfor <[email protected]>; Sat, 26 Nov 2016 16:10:39 +0100 (CET)\nX-Virus-Scanned: Debian amavisd-new at s2.eurich.de\nReceived: from mail.elkarte.net ([127.0.0.1])\n\tby localhost (h2294877.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id zQep5x32jrqA for <[email protected]>;\n\tSat, 26 Nov 2016 16:10:03 +0100 (CET)\nReceived: from mail.elkarte.net (h2294877.stratoserver.net [85.214.104.5])\n\tby mail.elkarte.net (Postfix) with ESMTPA id 990694CE0CFA\n\tfor <[email protected]>; Sat, 26 Nov 2016 16:10:03 +0100 (CET)\nSubject: [ElkArte Community] Test Message\nTo: <[email protected]>\nFrom: \"Administrator via ElkArte Community\" <[email protected]>\nReply-To: \"ElkArte Community\" <[email protected]>\nReferences: <[email protected]>\nDate: Sat, 26 Nov 2016 15:09:15 -0000\nX-Mailer: ELK\nX-Auto-Response-Suppress: All\nAuto-Submitted: auto-generated\nList-Id: <[email protected]>\nList-Unsubscribe: <http://www.elkarte.net/community/index.php?action=profile;area=notification>\nList-Owner: <mailto:[email protected]> (ElkArte Community)\nMime-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"ELK-66593aefa4beed000470cbd4cc3238d9\"\nContent-Transfer-Encoding: 7bit\nMessage-ID: <[email protected]>\n\n\nTesting\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\nTesting\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9--\n\n--ELK-66593aefa4beed000470cbd4cc3238d9\nContent-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\n<strong>Testing</strong>\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9--';\n\t}", "private function testEmail(){\n $this->user_panel->checkSecurity();\n $this->mail_handler->testEmailFunction();\n }", "public function parseEmail($raw){\n\t\t\t$rawMessage = explode(\"\\n\\n\", $raw, 2);\n\t\t\t$header = trim($rawMessage[0]);\n\t\t\t$body = trim($rawMessage[1]);\n\n\t\t\tpreg_match(\"%Date: (.+?)\\n%\", $header, $date);\t\t\t\t\t\t//Parse date\n\t\t\t$receiveDate = strtotime($date[1]);\n\n\t\t\t//On Jan 24, 2011, at 8:00 PM, OhJournal wrote:\n\t\t\tpreg_match(\"%^([\\s\\S]+?)On (.+?), at (.+?), OhJournal%\", $body, $parts);\t//Parse send date & time from reply line\n\t\t\t$sendDate = strtotime($parts[2].\" \".$parts[3]);\n\t\t\t\n\t\t\t//should implement this as a config variable - this removes hard wrapping, but also removes a lot of newlines\n\t\t\t//$body = preg_replace('%(\\S)\\n(\\S)%', '\\1 \\2', trim(quoted_printable_decode(preg_replace(\"/=[\\n\\r]+/\", \"\", trim($parts[1])))));\n\t\t\t$body = trim(quoted_printable_decode(preg_replace(\"/=[\\n\\r]+/\", \"\", trim($parts[1]))));\n\n\t\t\treturn array($sendDate, $receiveDate, $header, $body);\n\t\t}", "public function testAntBackendGetMessage()\r\n\t{\r\n\t\t// Create new mail object and save it to ANT\r\n\t\t$obj = CAntObject::factory($this->dbh, \"email_message\", null, $this->user);\r\n\t\t$obj->setGroup(\"Inbox\");\r\n\t\t$obj->setValue(\"flag_seen\", 'f');\r\n\t\t$obj->setHeader(\"Subject\", \"UnitTest EmailSubject\");\r\n\t\t$obj->setHeader(\"From\", \"[email protected]\");\r\n\t\t$obj->setHeader(\"To\", \"[email protected]\");\r\n\t\t$obj->setBody(\"UnitTest EmailBody\", \"plain\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t$contentParams = new ContentParameters();\r\n $email = $this->backend->getEmail($eid, $contentParams);\r\n $this->assertEquals($obj->getValue(\"subject\"), $email->subject);\r\n $this->assertEquals($obj->getValue(\"sent_from\"), $email->from); \r\n \r\n // Cleanup\r\n $obj->removeHard();\r\n\t}", "public function test_sanitized_email() {\n\t\t$actual = wp_create_user_request( 'some(email<withinvalid\\[email protected]', 'export_personal_data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( '[email protected]', $post->post_title );\n\t}", "public function testRequireEmail()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function testEmailSend() {\n\n }", "public function testMailAssume()\n {\n $asserts = array();\n\n foreach ($this->messages as $id => $message) {\n $asserts[$id] = array();\n\n $asserts[$id]['id'] = $id;\n\n $asserts[$id]['folder'] = $this->createZendImapStorageFolder();\n $asserts[$id]['subject'] = $message['subject'];\n $asserts[$id]['received'] = strtotime($message['date']);\n $asserts[$id]['plainText'] = $message['plainText'];\n $asserts[$id]['attachments'] = null;\n $asserts[$id]['type'] = $message['type'];\n $asserts[$id]['domainName'] = $message['domainName'];\n $asserts[$id]['orderNumber'] = $message['orderNumber'];\n }\n\n $imapAdapter = $this->createImapAdpater();\n\n $imapAdapter\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array_keys($this->messages)));\n\n $testClass = $this;\n\n $imapAdapter\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnCallback(function ($id) use ($testClass) {\n return $testClass->createImapStorageMessage($id);\n }));\n\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $this->assertEquals($asserts, $messages);\n }", "function parse_email($input) {\n\n // TODO TEST\n\n $input = trim($input);\n if (!$input) return false;\n\n if (preg_match('/^\\s*(([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4}))\\s*$/i', $input, $m)) {\n return array(\n 'email' => $m[1],\n 'user' => $m[2],\n 'domain' => $m[3]\n );\n } else {\n return false;\n }\n\n }", "public function getMail(){\n\t\t\t$data = file_get_contents($this->config->mailFile);\n\t\t\tif($data == NULL || trim($data) == \"\") return false;\n\t\t\treturn $data;\n\t\t}", "public function testParseHtmlEntities()\n {\n $file = __DIR__ . '/data/encoding.txt';\n $full_message = file_get_contents($file);\n $this->assertNotEmpty($full_message);\n\n $structure = Mime_Helper::decode($full_message, true, true);\n $this->assertEquals(\n \"\\npöördumise töötaja.\\n<b>Võtame</b> töösse võimalusel.\\npöördumisele süsteemis\\n\\n\", $structure->body\n );\n }", "public function TestEmail($data) {\r\n $data = trim($data);\r\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\r\n $data = filter_var($data,FILTER_VALIDATE_EMAIL);\r\n return $data;\r\n }", "public function testSpecificAllowedEmailAddressGet()\n {\n }", "private static function checkValidEMail(string $email): void {\n\t\ttry {\n\t\t\t// Check E-Mail pattern\n\t\t\t$atPos = mb_strpos($email, '@');\n\t\t\t$lastPointPos = mb_strrpos($email, '.');\n\n\t\t\tif(! $atPos || ! $lastPointPos) {\n\t\t\t\tthrow new Exception('E-Mail-Address \"' . htmlspecialchars($email) . '\" is invalid!');\n\t\t\t}\n\n\t\t\tif(! ($atPos > 0 && $lastPointPos > ($atPos + 1) && mb_strlen($email) > ($lastPointPos + 1))) {\n\t\t\t\tthrow new Exception('E-Mail-Address \"' . htmlspecialchars($email) . '\" is invalid!');\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t}", "public function testRead()\n\t{\n\t\t$user = User::find(1);\n\n\t\t$this->assertNotNull($user);\n\t\t$this->assertEquals(1, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\n\t\t//Reading by email\n\t\t$user = User::where('email', '=', '[email protected]')->get()->first();\n\n\t\t$this->assertNotNull($user);\n\t\t$this->assertEquals(1, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\t}", "public function testAllowedEmailAddressGet()\n {\n }", "public function testEmailValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'dfdfdfd', 'password' => '11'])\n ->see('Your Username or Password has not been recognised. Please try again.');\n }", "private function handleFrom ()\n {\n $eregA = \"/^'.*@.*$/\";\n\n if ( strpos ($this->fileData['from'], '<') !== false )\n {\n //to validate complex email address i.e. Erik A. O <[email protected]>\n $ereg = (preg_match ($eregA, $this->fileData[\"from\"])) ? $this->longMailEreg : \"/^(.*)(<(.*)>)$/\";\n preg_match ($ereg, $this->fileData[\"from\"], $matches);\n\n if ( isset ($matches[1]) && $matches[1] != '' )\n {\n //drop the \" characters if they exist\n $this->fileData['from_name'] = trim (str_replace ('\"', '', $matches[1]));\n }\n else\n {\n //if the from name was not set\n $this->fileData['from_name'] = '';\n }\n\n if ( !isset ($matches[3]) )\n {\n throw new Exception ('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);\n }\n\n $this->fileData['from_email'] = trim ($matches[3]);\n }\n else\n {\n //to validate simple email address i.e. [email protected]\n $ereg = (preg_match ($eregA, $this->fileData[\"from\"])) ? $this->mailEreg : \"/^(.*)$/\";\n preg_match ($ereg, $this->fileData[\"from\"], $matches);\n\n if ( !isset ($matches[0]) )\n {\n throw new Exception ('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);\n }\n\n $this->fileData['from_name'] = '';\n $this->fileData['from_email'] = $matches[0];\n }\n\n // Set reply to\n preg_match ($this->longMailEreg, $this->fileData['from_name'], $matches);\n if ( isset ($matches[3]) )\n {\n $this->fileData['reply_to'] = $matches[3];\n $this->fileData['reply_to_name'] = isset ($matches[1]) ? $matches[1] : $this->fileData['from_name'];\n }\n else\n {\n preg_match ($this->mailEreg, $this->fileData['from_name'], $matches);\n if ( isset ($matches[1]) )\n {\n $this->fileData['reply_to'] = $matches[1];\n $this->fileData['reply_to_name'] = '';\n }\n else\n {\n $this->fileData['reply_to'] = '';\n $this->fileData['reply_to_name'] = '';\n }\n }\n }", "public function testAuthenticateEmailUser ()\n {\n $result = $this->storage->authenticateUser($this->email1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->email1, $result['email_address']);\n }", "public function getMail();", "public function testVerifyAllowedEmailAddressGet()\n {\n }" ]
[ "0.73370063", "0.67949635", "0.66037804", "0.64252317", "0.6395159", "0.6377212", "0.62867296", "0.6222555", "0.6187763", "0.6138994", "0.607519", "0.604774", "0.6037602", "0.6035867", "0.5942482", "0.5934118", "0.59335464", "0.59266746", "0.58585733", "0.58531094", "0.5845122", "0.5793451", "0.5762495", "0.57497466", "0.57299143", "0.5723904", "0.5718279", "0.5714917", "0.5697465", "0.56891507" ]
0.78743756
0
This is a helpping method to call CURL PUT request with the username and key
private function curl_put($url, $data) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS,$data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}", "public static function urlPUT($url, $data, $headers=null) {\n\n $isJsonForm = false;\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n $arrKeys = array_keys($data);\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n curl_close($ch);\n\n return utf8_encode($contents);\n }", "function make_put_call($mid_url, $put_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($put_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "public function curlPutCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }", "function rest_put_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "public function _PUT($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'PUT', $params, $username, $password, $contentType);\n\n return $this->parseResponse($this->convertEncoding($response, 'utf-8', $this->_encode));\n }", "public function put($url, $body = array(), $query = array(), $headers = array());", "function put($url, $data = \"\", $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n $http_options[CURLOPT_POSTFIELDS] = $data;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}", "public function put()\n {\n #HTTP method in uppercase (ie: GET, POST, PUT, DELETE)\n $sMethod = 'PUT';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_POSTFIELDS, $this->getData());\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"accept-language: \" . $this->getAcceptLanguage(),\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'PUT::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'PUT::DATA', $this->getData());\n Log::write('WebRequest', 'PUT::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'PUT::RESPONSE', $sOutput);\n\n $this->setData('');\n\n if ($iHTTPCode !== 204) {\n print_r($sOutput);\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }", "public function sendPutRequestToUrl(\n\t\tstring $fullUrl,\n\t\tstring $user,\n\t\tstring $password,\n\t\tstring $xRequestId = '',\n\t\tarray $headers = [],\n\t\tstring $content = \"\"\n\t): ResponseInterface {\n\t\treturn HttpRequestHelper::sendRequest($fullUrl, $xRequestId, 'PUT', $user, $password, $headers, $content);\n\t}", "public function Put( $sUrl, $vRequestBody, $bJsonEncode = false );", "public function _put($url = null, array $parameters = []);", "function restPut($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t//Need to set the request to be a PATCH\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}", "function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}", "public function testUpdateMetadata1UsingPUT()\n {\n }", "function sendPutCmd($resource, $data) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($request, CURLOPT_FAILONERROR, true);\n curl_setopt($request, CURLOPT_POSTFIELDS, $data);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($request, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data))\n );\n\n $result = curl_exec($request);\n return json_decode($result, true);\n }", "public static function put($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n static::set_body($ch, $options);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }", "public function put(...$args)\n {\n return $this->curl('put', ...$args);\n }", "private function executePut(Visio\\Http\\CurlRequest $curl) {\n if (!is_string($this->requestBody)) {\n $this->buildPostBody();\n }\n\n $this->requestLength = strlen($this->requestBody);\n\n $phpMemory = fopen('php://memory', 'rw');\n fwrite($phpMemory, $this->requestBody);\n rewind($phpMemory);\n\n $curl->setOption(CURLOPT_INFILE, $phpMemory);\n $curl->setOption(CURLOPT_INFILESIZE, $this->requestLength);\n $curl->setOption(CURLOPT_PUT, true);\n\n $this->doExecute($curl);\n\n fclose($phpMemory);\n }", "public function put(string $url, array $input = [], $headers = null);", "public function testMakePutRequest()\n {\n $body = ['teacher' => 'Charles Xavier', 'job' => 'Professor'];\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse($body),\n ]);\n\n $this->assertEquals($client->put('teachers/1', ['job' => 'Professor']), $body);\n }", "public function testUpdateMetadata2UsingPUT()\n {\n }", "public function testUpdateMetadata3UsingPUT()\n {\n }", "public function put($url, $endpoint = \"\", $header = array(), $query = array(), $sendJSON = false)\n {\n if ($sendJSON == true) {\n $payload = json_encode($query);\n } else {\n $payload = $query;\n }\n\n // Prepare new cURL resource\n $ch = curl_init($url . $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n //curl_setopt($ch, CURLOPT_PUT, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n // Submit the POST request\n $result = curl_exec($ch);\n\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n\n // Close cURL session handle\n curl_close($ch);\n }", "public function put($key=null,$value=null){\n return $this->methodsData(\"put\",$key,$value);\n }", "public function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public static function put($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }", "public static function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public function put( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'PUT', $headers, $data );\n }" ]
[ "0.72033864", "0.65037984", "0.6477619", "0.6439031", "0.6424803", "0.64064497", "0.6395999", "0.6388594", "0.6384424", "0.6311735", "0.61685264", "0.61212295", "0.6117455", "0.609955", "0.60273874", "0.5992573", "0.5985227", "0.5980311", "0.5975014", "0.5953659", "0.5922608", "0.59095407", "0.58783746", "0.5872109", "0.5856211", "0.5848717", "0.58436257", "0.5821671", "0.5820248", "0.580001" ]
0.69541943
1
This is a helpping method to calll CURL Delete request with username and password
private function curl_delete($url) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function call_api_delete(){\n$ch = curl_init('http://localhost:8001/api/users/....');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLINFO_HEADER_OUT, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n// Submit the DELETE request\n$result = curl_exec($ch);\n\n//Close cURL session handle\ncurl_close($ch);\necho \"Deleted\"; \n }", "public function _DELETE($url, $params = null, $username = null, $password = null)\n {\n //Modified by Edison tsai on 09:50 2010/11/26 for missing part\n $response = $this->call($url, 'DELETE', $params, $username, $password);\n\n return $this->parseResponse($response);\n }", "function finishAndDisconnect($resultAPI, $res){\n echo json_encode($res);\n if(isset($_GET['username']) && isset($_GET['password']) ){\n $curl = curl_init();\n $params = \"id=\".$resultAPI['id'].\"&sessionkey=\".$resultAPI['sessionKey']; \n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n // curl_setopt($curl, CURLOPT_POSTFIELDS, array( ));\n curl_setopt($curl, CURLOPT_URL, \"http://localhost/SiteD/BDD/API/connexion.php?$params\"); // a modifier plus tard\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n $result = curl_exec($curl);\n curl_close($curl);\n }\n\n\n die();\n}", "private function delete($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "public function delete()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'DELETE';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'DELETE::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'DELETE::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'DELETE::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 204) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }", "function rest_delete_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function sendDelete ()\n {\n curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n return $this->handleQuery();\n }", "function delete($url, $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"DELETE\";\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "public function delete($url, $query = array(), $headers = array());", "public function procesa($action)\n {\n $id = $this->numero; \n $cmd='curl -v -H \"Accept: application/json\" -H \"Content-type: application/json\" -X DELETE https://app.alegra.com/api/v1/contacts/' . $id . ' -u \"xxxxx:xxxxx\"'; \n exec($cmd,$result);\n\n }", "public function deauthenticate() {\n\t\t$response = $this->requester->request('DELETE', $this->url);\n\t\t$this->requester->token = null;\n\t\treturn $response;\n\t}", "public static function urlDelete($url,$data,$headers=null) {\n\n $isJsonForm = false;\n\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n //array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return utf8_encode($contents);\n }", "public function delete() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function delete(...$args)\n {\n return $this->curl('delete', ...$args);\n }", "public function testDeleteSuccessful() {\n\t\t$response = $this->call('DELETE','v1/users/'.$this->username);\n\t\t$this->assertResponseOk();\n\t}", "function delete(Request &$request, Response &$response);", "public function _delete($url = null, array $parameters = []);", "private function delete_request( $endpoint = '/', $args = [], $request_args = [] ) {\n return $this->request( 'DELETE', $endpoint, $args, $request_args );\n }", "function delTemp($userid){\n\t$cSession = curl_init();\n\t// Step 2\n\tcurl_setopt($cSession,CURLOPT_URL,\"http://1.179.187.126/linegps/deltemp.php?userid=$userid\");\n\tcurl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($cSession,CURLOPT_HEADER, false);\n\t// Step 3\n\t$result=curl_exec($cSession);\n\t// Step 4\n\tcurl_close($cSession);\n\t// ====\n\treturn $result;\n\n}", "function delete($url, $parameters = array()) {\n $response = $this->oAuthRequest($url, 'DELETE', $parameters);\n if ($this->format === 'json' && $this->decode_json) {\n return json_decode($response, true);\n }\n return $response;\n }", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "public function delete()\n\t{\n\t\t$data = json_decode(file_get_contents(\"php://input\")); \t \n\t\techo $this->home->delete($data);\n\t\t\n\t}", "public function delete() {\n\n try {\n /**\n * Set up request method\n */\n $this->method = 'POST';\n\n\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n } catch (\\Throwable $t){\n new ErrorTracer($t);\n }\n }", "public function delete($url, $endpoint = \"\", $header = array(), $query = array())\n {\n $url .= $endpoint;\n if (count($query) > 0) {\n $query = http_build_query($query);\n $url .= \"?\" . $query;\n }\n\n // $log = \"New DELETE Request.\\n\";\n // $log .= \"URL: $url\\n\";\n\n $ch = curl_init();\n\n //Set the URL that you want to GET by using the CURLOPT_URL option.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n //Set CURLOPT_RETURNTRANSFER so that the content is returned as a variable.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n //Set CURLOPT_FOLLOWLOCATION to true to follow redirects.\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n //$log .= \"Header sent: \" . json_encode($header['headers']) . \"\\n\";\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n //Execute the request.\n $result = curl_exec($ch);\n\n\n //Handle curl errors\n if (curl_error($ch)) {\n $error_msg = curl_error($ch);\n //$log .= \"Error: $error_msg\\n\";\n throw new \\Exception(curl_error($ch));\n }\n\n //$log .= \"\\n------------------------END-------------------------\\n\\n\";\n //file_put_contents('log.txt', $log, FILE_APPEND);\n\n //Close the cURL handle.\n curl_close($ch);\n\n //Print the data out onto the page.\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n }", "public function delete($requestUrl, $requestBody, array $requestHeaders = []);", "public function delete($username)\n {\n }", "public function deleteWebhook(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function delete()\n\t{\n\t\t// Pass on the request to the driver\n\t\treturn $this->backend->delete('', array());\n\t}" ]
[ "0.76457405", "0.7013172", "0.6974841", "0.6775493", "0.67704713", "0.67443913", "0.65435946", "0.65435946", "0.64849", "0.64789796", "0.64669096", "0.64368284", "0.6370967", "0.6355791", "0.63540024", "0.63539404", "0.62862056", "0.6246455", "0.6229506", "0.62198025", "0.6217717", "0.62150216", "0.62123054", "0.62111527", "0.6192371", "0.61866605", "0.6185661", "0.61627525", "0.60756487", "0.607386" ]
0.7174635
1
This is a helpping method to create a project using the local prj.json file.
private function createProject() { $input = file_get_contents('prj.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/projects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\nCreate project:".$response."\n"; $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "static private function createProject($name, User $leader, $overview, $client = null, $category = null, $template = null, $first_milestone_starts_on = null, $based_on = null, $label_id = null, $currency_id = null, $budget = null, $custom_field_1 = null, $custom_field_2 = null, $custom_field_3 = null) {\n $project = new Project();\n\n $project->setAttributes(array(\n 'name' => $name,\n 'slug' => Inflector::slug($name),\n 'label_id' => (isset($label_id) && $label_id) ? $label_id : 0,\n 'overview' => trim($overview) ? trim($overview) : null,\n 'company_id' => $client instanceof Company ? $client->getId() : null,\n 'category_id' => $category instanceof ProjectCategory ? $category->getId() : null,\n 'custom_field_1' => $custom_field_1,\n 'custom_field_2' => $custom_field_2,\n 'custom_field_3' => $custom_field_3,\n ));\n\n $project->setState(STATE_VISIBLE);\n $project->setLeader($leader);\n\n if($template instanceof ProjectTemplate) {\n $project->setTemplate($template);\n } // if\n\n if($based_on instanceof IProjectBasedOn) {\n $project->setBasedOn($based_on);\n } // if\n\n $project->setCurrencyId($currency_id);\n\n if(AngieApplication::isModuleLoaded('tracking') && $budget) {\n $project->setBudget($budget);\n } // if\n\n $project->setMailToProjectCode(Projects::newMailToProjectCode());\n\n $project->save();\n\n if($template instanceof ProjectTemplate && $first_milestone_starts_on instanceof DateValue) {\n ConfigOptions::setValueFor('first_milestone_starts_on', $project, $first_milestone_starts_on->toMySQL());\n } // if\n\n return $project;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function create_existing () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\tif ($selection = $dialog->select_folder(\"Choose folder\", \"Choose existing folder to create new TextMate project from.\", false, null)) {\n\t\t\t\n\t\t\t// Get the name of the existing project\n\t\t\t$project_name = basename($selection);\n\t\t\t\n\t\t\t// Get path to new project\n\t\t\t$project = \"$selection/$project_name.tmproj\";\n\t\t\t\n\t\t\t// Prevent duplicate project\n\t\t\tif (file_exists($project)) {\n\t\t\t\tdie(\"There is already an existing TextMate project at this location.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Use the Empty template as our base\n\t\t\t$template = $this->standard_templates.\"/Empty\";\n\t\t\tif (file_exists($template)) {\n\t\t\t\t\n\t\t\t\t// Make Targets directory\n\t\t\t\t@mkdir(\"$selection/Targets\", 0777);\n\t\t\t\t\n\t\t\t\t// Copy default target\n\t\t\t\tcopy(\"$template/Targets/development.xml\", \"$selection/Targets/development.xml\");\n\t\t\t\t\n\t\t\t\t// Copy TextMate project file\n\t\t\t\t@copy(\"$template/project.tmproj\", $project);\n\t\t\t\t$this->replace_macros($project, array(self::MACRO_PROJECT => $project_name));\n\t\t\t\t\n\t\t\t\tprint(\"Successfully created the new project.\\n\");\n\t\t\t\t\n\t\t\t\t$this->open_project($project);\n\t\t\t} else {\n\t\t\t\tdie(\"Can't find project template to start from!\");\n\t\t\t}\n\t\t}\n\t}", "public function makeProject()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpProject());\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function actionCreate()\n {\n $model = new Project();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n OperationRecord::record($model->tableName(), $model->pj_id, $model->pj_name, OperationRecord::ACTION_ADD);\n return $this->redirect(['view', 'id' => $model->pj_id]);\n }\n\n if (Yii::$app->request->isPost) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Create project failed!'));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $shortcut = session()->get('shortcut');\n $from_api = session()->get('from_api');\n\n //\n $json = $this->jiraApi($shortcut);\n\n // Connect both arrays\n// $data = array_merge($data, $json);\n // Connect both Objects\n// $data = (object) array_merge((array) $data, (array) $json);\n //\n return view('projects.create', compact( 'json', 'from_api'));\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function create(CreateProjectRequest $request)\n {\n $newEntry = Project::create([\n 'author' => Auth::user()->username,\n 'user_id' => Auth::user()->id,\n 'title' => $request->getTitle(),\n 'description' => $request->getDescription(),\n 'body' => $request->getBody(),\n 'statement_title' => 'Mission Statement',\n 'statement_body' => 'This is where you write about your mission statement or make it whatever you want.',\n 'tab_title' => 'Welcome',\n 'tab_body' => 'Here you can write a message or maybe the status of your project for all your members to see.',\n ]);\n\n $thumbnail = $request->file('thumbnail');\n $thumbnail->move(base_path() . '/public/images/projects', 'product' . $newEntry->id . '.jpg');\n\n //Sets banner image to a random pre-made banner\n $images = glob(base_path() . \"/public/images/banners/*\");\n $imagePath = base_path() . '/public/images/projects/' . 'banner' . $newEntry->id . '.jpg';\n $rand = random_int(0, count($images) - 1);\n \\File::copy($images[$rand], $imagePath);\n\n //Add creator as a member and make admin of the project\n $newEntry->addMember(true);\n //Add creator as a follower of the project\n $newEntry->addFollower();\n\n return redirect('/project/'.$newEntry->title);\n }", "public function create_new () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\t$templates = array();\n\t\t\n\t\t// Find items in standard project templates\n\t\t$contents = directory_contents($this->standard_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->standard_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find items in user project templates\n\t\t$contents = directory_contents($this->user_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->user_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\n\t\t// Prompt to select template\n\t\tif ($selection = $dialog->standard_dropdown(\"New Project\", \"Choose a project template to start from.\", $items, false, false, false, false)) {\n\t\t\t//print($selection);\n\t\t\t\n\t\t\t// Prompt to save\n\t\t\tif ($path = $dialog->save_file(\"Save Project\", \"Choose a location to save the new project.\", null, null, null)) {\n\t\t\t\t$this->copy_template($templates[$selection], $path);\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function create_project( $options ) {\n\n\t\tif ( ! isset( $options['project_name'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$defaults = array(\n\t\t\t'project_status' => 'Active',\n\t\t\t'include_jquery' => FALSE,\n\t\t\t'project_javascript' => null,\n\t\t\t'enable_force_variation' => FALSE,\n\t\t\t'exclude_disabled_experiments' => FALSE,\n\t\t\t'exclude_names' => null,\n\t\t\t'ip_anonymization' => FALSE,\n\t\t\t'ip_filter' => null,\n\t\t);\n\n\t\t$options = array_replace( $defaults, $options );\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "static function create($name, $additional = null, $instantly = true) {\n $logged_user = Authentication::getLoggedUser();\n \n $based_on = array_var($additional, 'based_on');\n $template = array_var($additional, 'template');\n \n $leader = array_var($additional, 'leader');\n if(!($leader instanceof User)) {\n $leader = $logged_user;\n } // if\n\n try {\n DB::beginWork('Creating a project @ ' . __CLASS__);\n\n // Create a new project instance\n $project = self::createProject(\n $name,\n $leader,\n array_var($additional, 'overview'),\n array_var($additional, 'company'),\n array_var($additional, 'category'),\n $template,\n array_var($additional, 'first_milestone_starts_on'),\n $based_on,\n array_var($additional, 'label_id'),\n array_var($additional, 'currency_id'),\n array_var($additional, 'budget'),\n array_var($additional, 'custom_field_1'),\n array_var($additional, 'custom_field_2'),\n array_var($additional, 'custom_field_3')\n );\n\n // Add leader and person who created a project to the project\n $project->users()->add($logged_user);\n\n if($logged_user->getId() != $leader->getId()) {\n $project->users()->add($leader);\n } // if\n\n // If project is created from a template, copy items\n if($template instanceof ProjectTemplate) {\n $positions = array_var($additional, 'positions', array());\n $template->copyItems($project, $positions);\n\n ConfigOptions::removeValuesFor($project, 'first_milestone_starts_on');\n\n // In case of a blank project, import users and master categories\n } else {\n Users::importAutoAssignIntoProject($project);\n $project->availableCategories()->importMasterCategories($logged_user);\n } // if\n\n // Close project request or quote\n if($based_on instanceof ProjectRequest) {\n $based_on->close($logged_user);\n } elseif($based_on instanceof Quote) {\n $based_on->markAsWon($logged_user);\n } // if\n\n EventsManager::trigger('on_project_created', array(&$project, &$logged_user));\n\n DB::commit('Project created @ ' . __CLASS__);\n\n return $project;\n } catch(Exception $e) {\n DB::rollback('Failed to create a project @ ' . __CLASS__);\n throw $e;\n } // try\n }", "public function store(CreateProject $request)\n {\n $project = new Project();\n $project->setAttributes($request->all());\n $project->save();\n\n return response()->json($project, $status = 201)->setStatusCode(201);\n }", "public function creator($projectId = false) {\n\n // Call builder code\n $data = $this->builder(true, $projectId);\n\n // Create controller\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/controllers/' . ucfirst($this->formName) . '.php', 'w');\n fwrite($fp, $data['phpcontroller']);\n fclose($fp);\n // Create model\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/models/' . ucfirst($this->formName) . '_model.php', 'w');\n fwrite($fp, $data['phpmodel']);\n fclose($fp);\n\n // Create view\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '.php', 'w');\n fwrite($fp, $data['htmlview']);\n fclose($fp);\n // Create success page\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '_success.php', 'w');\n fwrite($fp, $this->successBuilder());\n fclose($fp);\n\n $data['myFolder'] = $this->listMyFolder($this->pathCreator . '/' . $projectId);\n echo json_encode($data);\n }", "public function run()\n {\n \t$project_owner = User::where('name', 'Owner Name')->first();\n \t$project = new Project();\n \t$project->name = 'New Project';\n \t$project->owner = $project_owner->id;\n \t$project->save();\n }", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "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}", "private function createProjectPool() {\n //TODO\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }" ]
[ "0.7480772", "0.69335276", "0.6720666", "0.6686327", "0.6674912", "0.66042274", "0.6395912", "0.62972945", "0.62956166", "0.62850964", "0.6210036", "0.6200268", "0.61972654", "0.61848426", "0.6155389", "0.61428875", "0.6134689", "0.6129079", "0.6114572", "0.6112827", "0.60919106", "0.60822004", "0.60506994", "0.6037085", "0.6022868", "0.60072535", "0.6006922", "0.60005546", "0.5987651", "0.59805876" ]
0.7445076
1
This is a helpping method to create a document using the local prj.json file.
private function createDocument() { $input = file_get_contents('doc.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateDocument()\n {\n echo \"\\nTesting document creation...\";\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "private function createDocument() {\n $this->createObjectProperties();\n $this->createRelationships();\n $this->createIngestFileDatastreams();\n $this->createPolicy();\n $this->createDocumentDatastream();\n $this->createDublinCoreDatastream();\n $this->createCollectionPolicy();\n $this->createWorkflowStream();\n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "function xh_createDocument()\r\n\t{\r\n\t}", "function ax_create_document() {\n\t$root = ax_indirect_dictionary('Root');\n\t$root['Pages'] = ax_indirect_dictionary('Pages');\n\t$info = ax_indirect_dictionary();\n\t$info['Creator'] = AX_ACROSTIX_CREATOR_STRING;\n\t$info['CreationDate'] = ax_date(time());\n\t$trailer = array();\n\t$trailer['Root'] =& $root;\n\t$trailer['Info'] =& $info;\t\n\t\n\t$doc_obj = new AxDocument;\n\t$doc_obj->pages = array();\n\t$doc_obj->info =& $info;\n\t$doc_obj->PDFStructure = $trailer;\t\n\treturn $doc_obj;\n}", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function storeDocument($file);", "public function create($document){\n $doc = new CouchDocument($this, $document);\n $doc->create();\n return $doc;\n \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}", "public function createDocument(array $data);", "public function doc_gen_and_storage($documentid, $template_data, $doc_prefix, $doc_postfix, $customer_id, $KT_location, $direct, $pdf = FALSE, $claim_id=NULL)\n\t{\n\t\t// Set file name formats\n\t\t$pre_extension_file_name = $doc_prefix.$doc_postfix;\n\t\t$final_pdf = $pre_extension_file_name.'.pdf';\n\t\t$final_docx = $pre_extension_file_name.'.docx';\n\n\t\t$path = self::get_destination_path();\n\n\t\t// Acquire the settings for KT login and API URL\n\t\tLog::instance(Log::NOTICE, \"Dummy Connect to Knowledgetree.\");\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\n\t\ttry\n\t\t{\n\t\t\t// Create KT connection\n\t\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\n\t\t}\n\t\tLog::instance(Log::NOTICE, \"Connected.\");\n\n\t\t// Generate Document - Load template from KT\n\n\t\t$template_location = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_template_path\");\n\t\tif (!file_exists($template_location)) {\n\t\t\tmkdir($template_location, 0777, true);\n\t\t}\n\t\t$temporary_folder = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_temporary_path\");\n\t\tif (!file_exists($temporary_folder)) {\n\t\t\tmkdir($temporary_folder, 0777, true);\n\t\t}\n\n\t\t$doc_config = Kohana::$config->load('config')->get('doc_config');\n\t\t$script_location = $template_location.$doc_config['script'];\n\n\t\tLog::instance(Log::NOTICE, \"Download document to folder.\");\n\t\ttry\n\t\t{\n\t\t\t$template_file = $kt_connection->downloadDocumentToFolder($documentid, $template_location);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t}\n\n\t\tLog::instance(Log::NOTICE, \"Document downloaded.\");\n\t\tLog::instance(Log::NOTICE, \"Create .doc file.\");\n // Create document generator object - provide document generation base\n\t\t$docx = New Docgenerator($template_location, $script_location, $temporary_folder);\n $docx->add_template($template_file);\n $docx->initalise_document_template($template_data);\n $feedback = $docx->create($pre_extension_file_name);\n\n\n if ($feedback === TRUE)\n\t\t{\n\t\t\tself::set_activity($documentid, 'generate-docx');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, 'Error doc generation');\n\t\t}\n\n\t\tif ($pdf)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Generate the PDF\n\t\t\t\t$input_file = $template_location.$final_docx;\n\t\t\t\t$output_file = $template_location.$final_pdf;\n\n\t\t\t\tif (Settings::instance()->get(\"word2pdf_active\") == 1)\n\t\t\t\t{\n\n\t\t\t\t\t// convert DOCX to PDF\n\t\t\t\t\tself::doc_convert_to_pdf($input_file, $output_file);\n\n\t\t\t\t\t// save pdf to files?\n\t\t\t\t\t$pdf_save = Settings::instance()->get(\"word2pdf_savepdf\");\n\n\t\t\t\t\tif (($pdf_save == 1) AND ($direct == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t\t\t$kt_connection->addDocument($final_pdf, $template_location.$final_pdf, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n if($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tLog::instance()->add(Log::ERROR, 'PDF is not enabled in your APP Settings');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tif ($this->external_error_handing)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception($e);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// was direct option selected to download to desktop?\n\t\tif ($direct == 0)\n\t\t{\n\t\t\t// save docx to files?\n\t\t\t$save_docx = Settings::instance()->get(\"doc_save\");\n\t\t\tif (($save_docx == 1) AND ($direct == 0))\n\t\t\t{\n\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t$kt_connection->addDocument($final_docx, $template_location.$final_docx, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n\t\t\t\tif($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\n\n\t\t\t}\n\n\t\t}\n\t\telse //direct download was chosen\n\t\t{\n\t\t\t$this->generated_documents['file'] = $final_docx;\n\t\t\t$this->generated_documents['url_docx'] = $template_location.$final_docx;\n\t\t\t$this->generated_documents['url_pdf'] = $template_location.$final_pdf;\n\t\t}\n\n\t\t// ***** SEND EMAIL IF MAIL IS SET *****/\n\t\tforeach ($this->mails as $mail)\n\t\t{\n\n\t\t\t$attached_doc[0] = $template_location.$final_pdf;\n\t\t\t$this->multi_attach_mail($mail['to'], $attached_doc, $mail['sender'], $mail['subject'], $mail['message']);\n\t\t}\n\n\t\t// ***** CLEAN UP PROCESS **** //\n\t\tLog::instance(Log::NOTICE, \"Deleting temporary files.\");\n\t\tsystem('rm '.$docx->temporary_folder.$template_file);\n\n\t\t//if we dont want to download cleanup otherwise leave for controller to pickup to download\n\t\tif ($direct == 0)\n\t\t{\n\t\t\tsystem('rm '.$template_location.$final_docx);\n\t\t\tsystem('rm '.$template_location.$final_pdf);\n\t\t}\n\n\t}", "public function documents_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n $jutil->setStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addDocument($doc);\n \n $this->response($result);\n \n }", "public function testCreateDocument()\n {\n }", "public function make_json_file()\n\t{\n\t\t$json_file = fopen('recipes.json', 'w');\n\t\tfwrite($json_file, $this->json_result);\n\t\tfclose($json_file);\t\n\t}", "protected function createFile() {}", "public function create(Model\\Document\\Document $document): void\n {\n $path = $this->type.'/nuovo';\n $response = $this->client->request('POST', $path, $document);\n\n $result = Json::decode((string) $response->getBody(), true);\n (\\Closure::bind(function ($id, $token, $client): void {\n $this->id = $id;\n $this->token = $token;\n $this->client = $client;\n }, $document, Model\\Document\\Document::class))($result['new_id'], $result['token'], $this->client);\n }", "public function createDocumentFromFile($filePath, $fileName) {\n $documentModel = new CreateDocumentPropertyWithFilesModel();\n $documentModel->setBilingualFileImportSettings($this->getFileImportSettings());\n $documentModel->attachFile($filePath, $fileName);\n return $documentModel;\n }", "public static function create(\\SetaPDF_Core_Document $document, \\SetaPDF_Core_Reader_ReaderInterface $reader) {}", "public static function create(\\SetaPDF_Core_Document $document, $titleOrConfig, $config = [/** value is missing */]) {}", "public function createDocu() {\n $data = Input::all();\n if ($data[\"path\"] == \"\") {\n $validator = Validator::make($data, ['name' => 'required|max:255']);\n } else {\n $validator = Validator::make($data, ['name' => 'required|max:255', 'path' => 'required|max:255|unique:documents',]);\n }\n if ($validator->fails()) {\n return redirect('/document/new/')->withErrors($validator)->withInput();\n }\n\n $data[\"path\"] = \"/var/www/sphinx/\" . count(document::all()) . \"_\" . $data[\"name\"];\n\n $document = new document;\n\n $document->name = $data[\"name\"];\n $document->path = $data[\"path\"];\n $document->layout = $data[\"layout\"];\n $document->user_id = \\Auth::user()->id;\n $document->save();\n\n $this->createSphinxDoc($document->path, $document->name, \\Auth::user()->username);\n $this->changeRechte();\n $this->changeValueInConf(\"default\", $document->layout, $document->path);\n $this->changeValueInConf(\"#language = None\", \"language =\\\"de\\\"\", $document->path);\n $this->makeHTML($document->path);\n\n $this->addNewNews($document->id, 0, 1, \"Neues Dokument angelegt mit dem namen\" . $document->name);\n return redirect('/document/private/' . $document->id);\n }", "public function makePdf(){\n\t\t$content = $_POST['data'];\n\t\t$id = $_POST['articleId'];\n\t\t\n\t\t$rootAndFile = $this->getRootArticleName($id);\n\t\t$fileName = $rootAndFile['fileName'];\n\t\t$root = $rootAndFile['root'];\n\t\t$path = $root.\"/pdfDirectory/articlePdf\";\n\t\t\n\t\t$iscreated = createPdf($path, $fileName, $content);\n\t\tif($iscreated === true ){\n\t\t\tif($this->read_model->updatePdfExist($id, $data = array(\"havePdfVersion\" => true)) == 1)\n\t\t\t\techo json_encode(array(\"msg\" => \"success\", \n\t\t\t\t\t\"path\" => $this->articlePdfPathRelative.\"/\".$fileName.\".pdf\"));\n\t\t\telse json_encode(array(\"msg\" => \"fail\", \"error\" => \"Not updated in database\"));\n\t\t}\n\t\telse echo json_encode(array(\"msg\" => \"fail\", \"error\" => $iscreated));\n\t\t\n\t}", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function store(CreateRequest $request)\n {\n $file = $request->file('file');\n $name = $file->getClientOriginalName();\n \\Storage::disk('local')->put($name, \\File::get($file));\n $request = $request->all();\n $request['file'] = $name;\n $document = $this->document->create($request);\n $document->documentTypes()->sync($request['documentType']);\n Session::flash('message-success',' Document '. $name.' '.trans('messages.created'));\n\n }", "public function run() {\n factory(Document::class, 10)->create();\n }", "function insertJSONDocument($dbName, $collectionName, $json) {\n\n Util::throwExceptionIfNullOrBlank($dbName, \"DataBase Name\");\n Util::throwExceptionIfNullOrBlank($collectionName, \"Collection Name\");\n Util::throwExceptionIfNullOrBlank($json, \"JSON\");\n $encodedDbName = Util::encodeParams($dbName);\n $encodedCollectionName = Util::encodeParams($collectionName);\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"storage\":{\"jsonDoc\":' . $json . '}}}';\n // App42Log::debug($body);\n $signParams['body'] = $body;\n $signParams['dbName'] = $dbName;\n $signParams['collectionName'] = $collectionName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/insert\" . \"/dbName\" . \"/\" . $encodedDbName . \"/collectionName\" . \"/\" . $encodedCollectionName;\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n\n $storageResponseObj = new StorageResponseBuilder();\n $storageObj = $storageResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $storageObj;\n }", "public function actionCreate() {\n $model = new Project;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n\n $this->redirect(['document/index', 'project_id' => $model->id]);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "protected function createResource()\n {\n $this->call('make:resource', array_filter([\n 'name' => $this->getNameInput().'Resource',\n ]));\n }", "abstract protected function createResource();", "public function testInboundDocumentCreateDocument()\n {\n }" ]
[ "0.6670128", "0.65845555", "0.600319", "0.5912523", "0.5838329", "0.57433844", "0.57227635", "0.5698281", "0.56542516", "0.55884737", "0.5577931", "0.5573082", "0.5545931", "0.5498816", "0.5434232", "0.53983194", "0.5397232", "0.5355831", "0.534623", "0.534458", "0.5335667", "0.532984", "0.52925557", "0.5276195", "0.5255653", "0.5246427", "0.52263707", "0.5199113", "0.51781", "0.5175052" ]
0.6630924
1
Testing the project creation with the prj.json file
public function testCreateProject() { echo "\nTesting project creation..."; $input = file_get_contents('prj.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/projects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\nType:".$response."-----Create Response:".$response; $result = json_decode($response); if(!$result->success) { $this->assertTrue(true); } else { $this->assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }", "public function test_creating_a_project()\n {\n $project = ProjectFactory::create();\n\n $this->assertCount(1,$project->activity);\n\n\n tap($project->activity->last(),function($activity){\n\n $this->assertEquals('created',$activity->description);\n\n $this->assertNull($activity->changes);\n\n });\n }", "public function run()\n {\n Project::truncate();\n \n factory(Project::class)->create([\n 'owner_id' => 1,\n 'client_id' => 1,\n 'name' => 'Project Test',\n 'description' => 'Lorem ipsum',\n 'progress' => rand(1, 100),\n 'status' => rand(1, 3),\n 'due_date' => '2016-06-06'\n ]);\n\n factory(Project::class, 10)->create();\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function test_user_can_create_post()\n {\n $this->signIn();\n $attributes = [\n 'title' => 'my title',\n 'description' => 'my description',\n 'notes' => 'my notes'\n ];\n\n $response = $this->post('/api/projects', $attributes)->assertStatus(201);\n\n $response->assertJson([\n 'data' => [\n 'type' => 'projects',\n 'attributes' => [\n 'title' => $attributes['title'],\n 'notes' => $attributes['notes'],\n 'description' => $attributes['description'],\n 'user_id' => auth()->id()\n ]\n ]\n ]);\n }", "public function run()\n {\n \n $project = Project::create([\n 'project_code' => '10001',\n 'name' => 'Head Office',\n 'short_name' => 'HQ',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10002',\n 'name' => 'Depot',\n 'short_name' => 'DEPOT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10003',\n 'name' => 'Safty',\n 'short_name' => 'SAFTY',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10004',\n 'name' => 'IT',\n 'short_name' => 'IT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11016',\n 'name' => 'Amber',\n 'short_name' => 'AMBER',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11023',\n 'name' => 'Niche Mono Borom Sales Office',\n 'short_name' => 'MONO',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function testCanCreateIdeaViaAPI()\n {\n $project = factory(Project::class)->create();\n $faker = Faker::create();\n $link = $faker->domainName;\n $price = $faker->randomNumber(4);\n\n $response = $this->json('POST', '/api/ideas', [\n 'link' => $link,\n 'price' => $price,\n 'notes' => 'Idea notes',\n 'user_id' => $project->user_id,\n 'project_id' => $project->id,\n 'file' => 'test'\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'link' => $link,\n 'price' => $price,\n 'user_id' => $project->user_id\n ]);\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "public function run()\n {\n AboutProject::create([\n 'main_title' => 'Жамбыл жастарының ресурстық орталығы',\n 'main_description' => 'default',\n 'main_image' => 'modules/front/assets/img/picture_slider.png',\n 'footer_title' => 'Жастар Саясаты басқармасы',\n 'footer_image' => 'modules/front/assets/img/logo.png',\n 'footer_address' => 'Желтоқсан көшесі, 78',\n 'footer_number' => '555-556-557'\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n $product_owners = DB::table('users')->select('id')->where('role_id','=','3')->get();\n $kind_num = ProjectKind::count();\n $max_project = require('Config.php');\n $max_project = $max_project['projects']['max'];\n $this->command->info($max_project);\n for($i=0;$i<$max_project;$i++)\n {\n if($i%50==0)\n $this->command->info('Project seeds: '.$i.' items out of '.$max_project);\n $dueDate = rand(1300191854,1565191854);\n $duration = rand(7776000,15552000);\n $createdDate = $dueDate - $duration;\n Project::create(array(\n 'prefix'=>$faker->randomElement(['PR','TS','WB']),\n 'name'=>$faker->sentence(2),\n //lets say 90% of projects have summary\n 'summary'=>$faker->sentence(6),\n //lets say only 80% of project have description\n 'description'=>$faker->paragraph(6),\n 'avatar'=>'assets/images/avatars/projects/'.strval(rand(1,110)).'.png',\n 'owner_id'=>$faker->randomElement($product_owners)->id,\n 'kind_id'=>rand(1,$kind_num),\n //lets say around 85% has due date\n 'end_date'=> rand(0,100)<85?date(\"Y-m-d H:i:s\",$dueDate):null,\n //let say 90% of projects are public\n 'is_public'=> rand(0,100)<90,\n //let say 90% of projects are active\n 'is_active'=> rand(0,100)<90,\n //let say 95% of projects are opt_request enabled\n 'opt_request'=> rand(0,100)<95,\n //let say 95% of projects are opt_requirement enabled\n 'opt_requirement'=> rand(0,100)<95,\n //let say 95% of projects are opt_testexecution enabled\n 'opt_testexecution'=> rand(0,100)<95,\n //let say 95% of projects are opt_bugs enabled\n 'opt_bugs'=> rand(0,100)<95,\n 'api_key'=>Hash::make($faker->sentence(20)),\n 'created_at'=>date(\"Y-m-d H:i:s\",$createdDate)\n ));\n }\n }", "public function testProjectAssignmentsDefineNew()\n {\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('zh_TW');\n Project::create([\n 'raising_user_id' => 23,\n 'fundraiser' => 'RIG group',\n 'email' => $faker->email,\n 'name' => '典藏版《球場諜對諜》棒球鬥智精品桌遊',\n 'category_id' => 12,\n 'started_at' => '2018-10-5 ',\n 'ended_at' => '2018-12-10',\n 'curr_amount' => 16670,\n 'goal_amount' => 100000,\n 'relative_web' => 'www.zeczec.com/projects/MatchFixing?r=k2898470057',\n 'backer' => 32,\n 'brief' => '這是一款藉由互相猜忌對方身份,需要一定的運氣與智力才能做出正確決定的棒球桌遊。',\n 'description' => '影片無法播放請點選右側網址收看 https://pse.is/B6BWW #\n你知道這「黑襪事件」對美國運動史帶來的意義嗎?#\n一九一九年,號稱「球界最強」的芝加哥白襪隊驚爆八名選手集體放水、故意輸掉唾手可得的世界冠軍,自此「黑襪事件」四個字成為球壇遭封印的闇黑符號。\n但也正因如此,才有今日乾淨打球、純粹展現全球最高棒球技藝,被暱稱為「國家娛樂」的美國職棒大聯盟棒球。\n熱愛棒球的我們,絕對無法認同打假球的行為,因此特別設計了這款遊戲,讓玩家透過遊戲身歷其境體會歷史的傷痛,讓喜愛棒球或桌遊的玩家更認同乾淨打球的真義。',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 499,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n限量回饋搶先出手相挺者 \n搶先價499元(市價:699元) \n本產品只有一種版本,先搶先贏! \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 549,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n早鳥價549元(市價:699元) \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 998,\n 'backer' => 10,\n 'description' => '典藏版《球場諜對諜》精品桌遊2套 \n送《美國職棒》雜誌1本(市價168元) \n市價:1566元 現省568元 \n(((臺灣本島離島免運))) \n\n全球華文出版市場唯一針對大聯盟(Major League Baseball)棒球進行介紹的官方授權刊物,內容兼具深度與廣度。除了球季戰況的精闢剖析,還包括知名選手、各隊新星傳記;最新熱門話題;造訪大聯盟球場的實用旅遊資訊以及投打技術剖析。 \nps: \n港澳運費250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n\n Project::create([\n 'raising_user_id' => 24,\n 'fundraiser' => ' 玩思once實境遊戲 ',\n 'email' => $faker->email,\n 'name' => '街道的隱匿者|當你用牠的眼睛看世界-流浪動物實境遊戲',\n 'category_id' => 12,\n 'started_at' => '2018-10-23',\n 'ended_at' => '2018-12-25',\n 'curr_amount' => 459695,\n 'goal_amount' => 700000,\n 'relative_web' => 'www.zeczec.com/projects/once-reality-game?r=k2751470057',\n 'backer' => 39,\n 'brief' => '一款體會毛孩處境的實境遊戲。在這個由人類掌控的世界,街上流浪動物要如何生存下去?如果是你,你會怎麼做?',\n 'description' => '把你變成流浪動物,你能存活多久?#\n一個以流浪動物的視角體驗人類社會的實境遊戲\n在街頭遇到流浪動物的時候,你是什麼心情呢?是覺得他們好可愛、好可憐,或者你是固定餵食的愛媽愛爸,照顧流浪動物的飲食,還是對於流浪動物帶來的髒亂覺得困擾?\n《街道的隱匿者》是一款從流浪動物角度出發的遊戲,帶你從動物的角度認識人類世界,認識流浪動物在街頭上的困境,不是人類的你,該怎麼生存下去呢?',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 450,\n 'backer' => 20,\n 'description' => '【個人早鳥優惠_早鳥送限定酷卡】 \n原價為550元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 2400,\n 'backer' => 18,\n 'description' => '【團體早鳥優惠_早鳥送限定酷卡】 \n原價為3300元,集資期間現省900元。\n\n◇ 街道的隱匿者-團體遊玩券一張(6人) \n◇ 集資限定酷卡六套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*此方案為6人團體券,如果同團超過6人,現場以400元/人,加收費用。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 600,\n 'backer' => 1,\n 'description' => '【個人票套組】 \n原價為700元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套 \n◇ 快樂結局帆布包一個\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n\n }", "public function run()\n {\n $faker = Faker::create();\n // Create Project\n foreach (range(1, 10) as $i) {\n Project::create([\n 'name' => $faker->name,\n 'manager' => $i\n ]);\n }\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testProjectAssignmentsSave()\n {\n }", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }" ]
[ "0.7153427", "0.7153302", "0.71247894", "0.6972111", "0.6698196", "0.66626316", "0.6662225", "0.6629134", "0.64922935", "0.6370959", "0.63647586", "0.6334146", "0.6322571", "0.6286674", "0.6244069", "0.61830956", "0.61817753", "0.61736554", "0.615833", "0.61153346", "0.61009496", "0.6085048", "0.60568523", "0.6044372", "0.60154814", "0.6004302", "0.600101", "0.5987144", "0.59779835", "0.59727407" ]
0.82499796
0
Testing the project retreival by ID
public function testGetProjectByID() { echo "\nTesting the project retrieval by ID..."; $response = $this->getProject("P1"); //echo "\ntestGetProjectByID------".$response; $result = json_decode($response); $prj = $result->Project; $this->assertTrue((!is_null($prj))); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProject($id)\n {\n }", "private function getProject($id)\n {\n ///$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/projects/\".$id;\n \n echo \"\\ngetProject URL:\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "private function getProject($id)\n {\n $projectApi = new Project($this->mainModel->getDb());\n $answer = $projectApi->get($id);\n\n if (isset($answer['error'])) {\n return false;\n } else {\n $this->project = $answer['project'];\n return true;\n }\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function fetchProjectID(): string;", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "function get(string $project_id): Response{\n return $this->method([\n 'path' => 'projects/'.$project_id,\n 'method' => 'GET'\n ]);\n }", "public function testGetIdFromName() {\n\t\t$t_project_name = $this->getNewProjectName();\n\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_project_idFromName = $this->client->mc_project_get_id_from_name(\n\t\t\t$this->userName, $this->password,\n\t\t\t$t_project_name\n\t\t);\n\n\t\t$this->assertEquals( $t_project_idFromName, $t_project_id );\n\t}", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function getProject($id){\n\n\t\t$this->db->select('*');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('project');\n\t\t$row = $query->row();\n\n\t\t$project = array(\n\t\t\t'id' => $row->id,\n\t\t\t'name' => $row->name,\n\t\t\t'aggregate_url' => $row->aggregate_url,\n\t\t\t'description' => $row->description,\n\t\t\t'sample_target' => $row->sample_target,\n\t\t\t'sample_target_bs' => $row->sampel_target_bs,\n\t\t\t'sampling_table' => $row->sampling_frame_table,\n\t\t\t'loc_columns' => $row->alloc_unit_columns,\n\t\t\t'start_date' => $row->start_date,\n\t\t\t'end_date' => $row->finish_date,\n\t\t\t'delete_status' => $row->delete_status,\n\t\t\t'date_created' => $row->date_created\n\t\t );\n\t\t return $project;\t\t\t\t\t\t\n\t}", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new Project($statement->fetch(PDO::FETCH_ASSOC));\n }", "public function readProject() \n {\n \n // use the fetch method from Request to get the id parameter\n dump($this->request->fetch('id'));\n \n // Or use the fetch property to from Request to get the id parameter\n dump($this->request->fetch->id);\n \n }", "static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}", "public function a_user_can_see_single_project()\n {\n $project = factory(Project::class)->create();\n\n $this->get('/api/projects/' . $project->id)->assertStatus(200)->assertJson([\n 'data' => [\n 'id' => $project->id,\n 'name' => $project->name,\n 'description' => $project->description,\n ],\n ]);\n }", "public static function getProjectDetails($id){\n\t\t$db = DemoDB::getConnection();\n\t\tProjectModel::createViewCurrentIteration($db);\n $sql = \"SELECT project.name as project_name, description, project.created_at, first_name, last_name, project_role.name as role_name, deadline, current_iteration.id as iteration_id\n\t\t\t\tFROM project\n INNER JOIN project_member\n\t\t\t\t\tON project.id = project_member.project_id\n INNER JOIN member\n\t\t\t\t\tON member_id = member.id\n INNER JOIN project_role\n\t\t\t\t\tON role_id = project_role.id\n\t\t\t\tLEFT OUTER JOIN current_iteration\n\t\t\t\t\tON project.id = current_iteration.project_id\n\t\t\t\tWHERE project.id = :id;\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n\t\t$ok = $stmt->execute();\n\t\tif ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function getProjectDetails($project_id){\n\t\t$url = \"/project/{$project_id}/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "public function testValidGetById() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations (just checking enough to make sure the right thing was obtained)\n\t\t$this->assertSame($retrievedOrg->data->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data->orgName, $this->VALID_NAME);\n\n\t}", "public function show($id)\n {\n return Project::find($id);\n }", "public function show($id)\n {\n return new ProjectResource(Project::findOrFail($id));\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "public function getProjectById($id)\n {\n $this->db->query(\"SELECT * FROM projects WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n\n $row = $this->db->single();\n\n return $row;\n\n }", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }" ]
[ "0.7300688", "0.7160052", "0.71215653", "0.69065416", "0.6845172", "0.6835409", "0.6801986", "0.67409396", "0.6733202", "0.66962236", "0.6671775", "0.6654084", "0.66138893", "0.65994096", "0.65855336", "0.6583683", "0.6583683", "0.65786403", "0.65296894", "0.6519466", "0.651937", "0.6493329", "0.6478813", "0.64702475", "0.6454663", "0.64434266", "0.63868916", "0.6386527", "0.638158", "0.6368794" ]
0.83770955
0
Testing the project search
public function testSearchProject() { echo "\nTesting project search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?search=test"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/projects?search=test"; $response = $this->curl_get($url); //echo "\n-------project search Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_searchByPage() {\n\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testSearch()\n {\n $crawler = $this->client->request('GET', $this->router->generate('marquejogo_homepage'));\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Cidade\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Data\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Hora\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => '',\n 'marcoshoya_marquejogobundle_search[date]' => '1111',\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n // invalid date\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"This value is not valid.\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => 'Curitiba, Paraná',\n 'marcoshoya_marquejogobundle_search[date]' => date('d-m-Y'),\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Resultados encontrados\")')->count());\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "public function testGetVoicemailSearch()\n {\n }", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testInboundDocumentSearch()\n {\n }", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testSearchModelSets()\n {\n }", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testGetSearchResults()\n {\n $search_term = $this->getSearchTerm();\n $limit = $this->getLimit();\n\n $client = $this->mockGuzzleForResults();\n $repository = new GoogleSearchRepositoryApi($client);\n\n $results = $repository->getSearchResults($search_term, $limit);\n\n $this->assertIsArray($results);\n }" ]
[ "0.6858462", "0.6852012", "0.6753273", "0.66946334", "0.6673342", "0.6618049", "0.6564328", "0.6496258", "0.64323014", "0.6419851", "0.6401977", "0.639658", "0.63620675", "0.63539433", "0.63435453", "0.6327412", "0.6318944", "0.63020056", "0.6277252", "0.6253027", "0.6215104", "0.6202289", "0.6196944", "0.61906946", "0.6185744", "0.6147885", "0.61286", "0.6128118", "0.60922074", "0.60903835" ]
0.81959957
0
Testing the experiment creation.
public function testCreateExperiment() { echo "\nTesting Experiment creation..."; $input = file_get_contents('exp.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/experiments?owner=wawong"; //echo "\n-------------------------"; //echo "\nURL:".$url; //echo "\n-------------------------"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\n-----Create Experiment Response:".$response; $result = json_decode($response); $this->assertTrue(!$result->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInstrumentCreate()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code',uniqid('TestInstrument_'))\n ->type('@category', 'Dusk Testing')\n ->type('@module','Summer Capstone')\n ->type('@reference','Test - safe to delete')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('View Instrument - TestInstrument_');\n });\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/authors/create')\n ->type('name', 'John')\n ->type('lastname', 'Doe')\n ->press('Save')\n ->assertPathIs('/authors')\n ->assertSee('John')\n ->assertSee('Doe');\n });\n }", "public function testIntegrationCreate()\n {\n $this->visit('user/create')\n ->see('Create New Account');\n $this->assertResponseOk();\n $this->assertViewHas('model');\n }", "public function testCreateChallengeActivityTemplate()\n {\n }", "public function testCreateScenario()\n {\n $client = static::createClient();\n }", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "public function testAdministrationCreateTraining()\n {\n // Used to fill hidden inputs\n Browser::macro('hidden', function ($name, $value) {\n $this->script(\"document.getElementsByName('$name')[0].value = '$value'\");\n\n return $this;\n });\n\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login())\n ->loginAsUser('[email protected]', 'password');\n\n $browser->assertSee('Formations')\n ->click('@trainings-link')\n ->waitForText('Aucune donnée à afficher')\n ->assertSee('Aucune donnée à afficher')\n ->clickLink('Ajouter formation')\n ->assertPathIs('/admin/training/create');\n\n $name = 'Test create training';\n\n $browser->type('name', $name)\n ->hidden('visible', 1)\n ->press('Enregistrer et retour');\n\n $browser->waitForText($name)\n ->assertSee($name)\n ->assertDontSee('Aucune donnée à afficher')\n ->assertPathIs('/admin/training');\n\n $browser->visit('/')\n ->assertSee('Pas de formation en groupe annoncée pour l\\'instant')\n ->assertDontSee($name);\n });\n }", "public function testCreateChallengeTemplate()\n {\n }", "public function testCreate()\n\t{\n\t\tRoute::enableFilters();\n\t\tEvaluationTest::adminLogin();\n\t\t$response = $this->call('GET', '/evaluation/create');\n\t\t\n\t\t$this->assertResponseOk();\n\n\t\tSentry::logout();\n\t\t\n\t\t//tesing that a normal user can't retrieve a form to create \n\t\t//an evaluation and that a page displays a message as to why they can't\n\t\tEvaluationTest::userLogin();\n\t\t$crawler = $this->client->request('GET', '/evaluation/create');\n\t\t$message = $crawler->filter('body')->text();\n\n\t\t$this->assertFalse($this->client->getResponse()->isOk());\n\t\t$this->assertEquals(\"Access Forbidden! You do not have permissions to access this page!\", $message);\n\n\t\tSentry::logout();\n\t}", "public function testCreateChallengeActivity()\n {\n }", "public function testQuarantineCreate()\n {\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Locator\\\\ResultSetInterface', $subject, 'Subject is not a valid locator result set');\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Test\\\\SourceInterface', $subject, 'Subject is not a valid test source');\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testWebinarCreate()\n {\n }", "public function testCreateChallenge()\n {\n }", "public function testCreate()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n\n $this->assertTrue($player_factory->wasRecentlyCreated);\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "protected function createTests()\n {\n $name = $this->getNameInput();\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Store{$name}Test\",\n '--model' => $name,\n '--type' => 'store',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Update{$name}Test\",\n '--model' => $name,\n '--type' => 'update',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/View{$name}Test\",\n '--model' => $name,\n '--type' => 'view',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Delete{$name}Test\",\n '--model' => $name,\n '--type' => 'delete',\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testGetChallengeActivityTemplate()\n {\n }", "public function testInstance() { }", "public function testCreate()\n {\n $this->visit('/admin/school/create')\n ->submitForm($this->saveButtonText, $this->school)\n ->seePageIs('/admin/school')\n ;\n\n $this->seeInDatabase('schools', $this->school);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }", "public function testCreateTestSuite()\n {\n Artisan::call('migrate');\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->seePageIs('/library')\n ->click('#newSuite')\n ->seePageIs('/library/testsuite/create')\n ->type('TestSuite1', 'name')\n ->type('someDescription', 'description')\n ->type('someGoals', 'goals')\n ->press('submit');\n\n $this->seeInDatabase('TestSuite', [\n 'Name' => 'TestSuite1',\n 'TestSuiteDocumentation' => 'someDescription',\n 'TestSuiteGoals' => 'someGoals'\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }" ]
[ "0.65538555", "0.65322083", "0.632858", "0.6290923", "0.62865835", "0.62109554", "0.62014955", "0.6199749", "0.6188527", "0.6176559", "0.61609805", "0.6158647", "0.6152849", "0.61229026", "0.6113385", "0.611306", "0.611306", "0.60945725", "0.6086307", "0.60797703", "0.60791343", "0.60791343", "0.605772", "0.60510534", "0.6046629", "0.6018587", "0.60177886", "0.59871846", "0.59777296", "0.5955141" ]
0.8075641
0
Testing the experiment listing
public function testListExperiments() { echo "\nTesting experiment listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/experiments"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testListExperts()\n {\n }", "public function testListPastWebinarQA()\n {\n }", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function _testMultipleInventories()\n {\n\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getExperimentsList(){\n return $this->_get(1);\n }", "public function test_admin_training_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function actionTest()\n {\n $page_size = Yii::$app->request->get('per-page');\n $page_size = isset( $page_size ) ? intval($page_size) : 4;\n\n\n $provider = new ArrayDataProvider([\n 'allModels' => $this->getFakedModels(),\n 'pagination' => [\n // Should not hard coded\n 'pageSize' => $page_size,\n ],\n 'sort' => [\n 'attributes' => ['id'],\n ],\n ]);\n\n return $this->render('test', ['listDataProvider' => $provider]);\n }", "public function testListSites()\n {\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testWebinarPanelists()\n {\n }", "public function testListPastWebinarPollResults()\n {\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function test_admin_training_list_b()\n {\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function getExperimentInfosList(){\n return $this->_get(2);\n }", "public function testJobList()\n {\n\n }", "public function getTests();", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function testList()\n {\n \t$games_factory = factory(Game::class, 3)->create();\n \t$games = Game::all();\n \t\n $this->assertCount(3, $games);\n }", "public function indexAction()\n\t{\n\t\t// TODO: do not only check if experiments exist, but if treatment exist\n\t\t// fetch list of experiments to show note when none exist\n\t\t$experimentModel = Sophie_Db_Experiment :: getInstance();\n\t\t$overviewSelect = $experimentModel->getOverviewSelect();\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array('experiment.name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl::getInstance()->addSelectAcl($overviewSelect, 'experiment');\n\t\t\t$overviewSelect->order(array('experiment.name', 'acl.rule'));\n\t\t}\n\t\t$overviewSelect->group(array('experiment.id'));\n\t\t$this->view->hasTreatment = sizeof($overviewSelect->query()->fetchAll()) > 0;\n\n\t\t// fetch sessions list\n\t\t$sessionModel = Sophie_Db_Session :: getInstance();\n\t\t$db = $sessionModel->getAdapter();\n\t\t$overviewSelect = $sessionModel->getOverviewSelect();\n\n\t\t// add filters from form\n\t\t$filterExperimentId = $this->_getParam('filterExperimentId', null);\n\t\tif (!is_null($filterExperimentId))\n\t\t{\n\t\t\t$overviewSelect->where('experiment.id = ?', $filterExperimentId);\n\t\t}\n\n\t\t$filterState = $this->_getParam('filterState', null);\n\t\tif (!is_null($filterState))\n\t\t{\n\t\t\t$overviewSelect->where('session.state = ?', $filterState);\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$overviewSelect->where('session.state != ?', 'terminated');\n\t\t\t$overviewSelect->where('session.state != ?', 'archived');\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name'\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl :: getInstance()->addSelectAcl($overviewSelect, 'session');\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name',\n\t\t\t\t'acl.rule'\n\t\t\t));\n\t\t}\n\n\t\t$overviewSelect->group(array (\n\t\t\t'session.id'\n\t\t));\n\n\t\t$this->view->sessions = $overviewSelect->query()->fetchAll();\n\t\t$this->view->adminMode = $adminMode;\n\t\t$this->view->adminRight = $adminRight;\n\t}", "public function testlistAction() \n {\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->getTestDetails();\n $data = array();\n $result = json_encode($result);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "public function test_list()\n {\n $response = $this->get('/proposal/all');\n\n $response->assertSee('data-js-proposal-cards');\n\n $response->assertSee('card-header');\n\n $response->assertStatus(200);\n }", "public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }", "public function testIndexActionHasExpectedData()\n {\n $this->dispatch('/index');\n $this->assertQueryContentContains('h1', 'My Albums');\n\n // At this point, i'd like to do a basic listing count of items.\n // However, we're not using a seperate test db with controlled seeds.\n // $this->assertQueryCount('table tr', 6);\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function test_listIndexAction ( )\n {\n $params = array(\n 'event_id' => 1,\n 'action' => 'list',\n 'controller'=> 'scales',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n\n }", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public function TestListAll()\n {\n $temp = BASE_FOLDER . '/.dev/Tests/Data/Testcases';\n\n $this->options = array(\n 'recursive' => true,\n 'exclude_files' => false,\n 'exclude_folders' => false,\n 'extension_list' => array(),\n 'name_mask' => null\n );\n $this->path = BASE_FOLDER . '/.dev/Tests/Data/Testcases/';\n\n $adapter = new fsAdapter($this->action, $this->path, $this->filesystem_type, $this->options);\n\n $this->assertEquals(38, count($adapter->fs->data));\n\n return;\n }", "public function testIntegrationIndex()\n {\n $userFaker = factory(Model::class)->create([\n 'name' => 'Foo Bar'\n ]);\n $this->visit('user')\n ->see($userFaker->name);\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'name' => $userFaker->name,\n 'email' => $userFaker->email,\n ]);\n $this->assertViewHas('models');\n }", "protected function getTestList() \n {\n $invalid = 'invalid';\n $description = 'text';\n $empty_description = '';\n $testlist = [];\n $testlist[] = new ArgumentTestConfig($this->empty_argument, $empty_description,CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_optional, $empty_description, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_required, $empty_description, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_invalid, $empty_description, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string_description, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array_description, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_invalid_description, $this->argument_name, $invalid, $invalid, $description, \\InvalidArgumentException::class);\n \n return $testlist;\n }" ]
[ "0.68568736", "0.66832024", "0.66007644", "0.65801185", "0.64103985", "0.6407482", "0.638836", "0.6362429", "0.6359445", "0.63123435", "0.6307033", "0.6217772", "0.61934084", "0.6183226", "0.6171969", "0.61591905", "0.61553687", "0.61552304", "0.6153641", "0.6147386", "0.6132729", "0.6124384", "0.612207", "0.61194843", "0.6115621", "0.6110016", "0.6108674", "0.61053497", "0.6104634", "0.6103048" ]
0.7766579
0
Testing the experiment retreival by ID
public function testGetExperimentByID() { echo "\nTesting the experiment retrieval by ID..."; $response = $this->getExperiment("1"); $result = json_decode($response); $exp = $result->Experiment; $this->assertTrue((!is_null($exp))); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getExperiment($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/experiments/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function experiments_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n $result = null;\n if(is_null($search))\n $result = $sutil->getExperiment($id,$from,$size);\n else \n {\n $result = $sutil->searchExperiments($search,$from,$size);\n }\n $this->response($result);\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function get_experiment( $experiment_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function testUpdateExperiment()\n {\n echo \"\\nTesting experiment update...\";\n $id = \"0\";\n \n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('exp_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id.\"?owner=wawong\";\n \n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function test_getById() {\n\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "function get_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getExperiment($expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n\n}", "public function test_byinstanceid_route() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n $this->assertContains('<h2>Talkpoint activity name</h2>', $client->getResponse()->getContent());\n }", "private function getCurrentExperiment() {\n\t\tif(isset($_SESSION) && isset($_SESSION['experiment'])) {\n\t\t\t$iExperimentId = (int) $_SESSION['experiment'];\n\t\t} else {\n\t\t\techo $this->_translator->error_experiment;\n\t\t\texit();\n\t\t}\n\t\treturn $iExperimentId;\n\t}", "public function testGetSingleHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for id=3\r\n\t\t$response= $this->http->request('GET','api/v1/hospital/3');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Test single element\r\n\t\t$jsonPHP=json_decode($response->getBody());\r\n\t\t$this->assertCount(1, $jsonPHP);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function imodAction ()\r\n {\r\n $request = $this->getRequest();\r\n $params = array_diff($request->getParams(), $request->getUserParams());\r\n \r\n $sessional = new Acad_Model_Test_Sessional($params);\r\n $sessional->setTest_info_id($params['id']);\r\n $result = $sessional->save();\r\n if ($result) {\r\n echo 'Successfully saved!! Test Id :'.var_export($result, true);\r\n }\r\n }", "public function experiments_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteExperiment($id);\n $this->response($result); \n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testElementMatchingWithID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function testGetDocumentByID()\n {\n echo \"\\nTesting the document retrieval by ID...\";\n $response = $this->getDocument(\"CCDB_2\");\n //echo $response;\n $result = json_decode($response);\n $exp = $result->CIL_CCDB;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\t\n\t\t$this->stubedGene->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGene->getId () );\n\t}", "public function actionGetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n // Get to da responsa!\n $this->sendSuccessResponse($exercise->getExerciseTests()->getValues());\n }", "public function getExperimentID() {\n return $this->_experiment_id;\n }", "public function renderTestDetails($id=null,$testKey=''){\n try{\n $breTest=$this->breTestsFacade->findBreTest($id);\n }catch (\\Exception $e){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($testKey);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n }\n if ($breTest->user->userId!=$this->user->getId()){\n throw new ForbiddenRequestException($this->translator->translate('You are not authorized to access selected experiment!'));\n }\n\n $this->template->breTest=$breTest;\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getById($id) {\r\n return $this->testcaseEntity->find($id);\r\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function testGetSitesTestsByID()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->testsController->shouldReceive('retrieve')->once()->andReturn('Get Test 2 or site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTests(array(1, 'tests', 2));\n $this->assertEquals('Get Test 2 or site 1 Mocked', $output);\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function testGetReplenishmentById()\n {\n }" ]
[ "0.70720243", "0.66221786", "0.6372758", "0.6348471", "0.6327254", "0.6164168", "0.61540025", "0.6119591", "0.6040424", "0.59662414", "0.59080625", "0.58955175", "0.58827364", "0.5867978", "0.5862803", "0.5862368", "0.5860236", "0.5822475", "0.5786058", "0.57855254", "0.5783987", "0.5779225", "0.57521576", "0.57371855", "0.5727865", "0.5717", "0.5700085", "0.56925637", "0.5679692", "0.5673236" ]
0.8079397
0
Testing the experiment update.
public function testUpdateExperiment() { echo "\nTesting experiment update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('exp_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/experiments/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function test_accepts_dev_updates()\n {\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function test_updateSettings() {\n\n }", "public function testWebinarUpdate()\n {\n }", "public function testJobUpdate()\n {\n\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function test_if_failed_update()\n {\n }", "public function test_update() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n self::$outage->starttime += 10;\n outagedb::save(self::$outage);\n\n // Should still exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object($event));\n self::assertSame(self::$event->id, $event->id);\n self::$event = $event;\n }", "public function testUpdateTimesheet()\n {\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "function testUpdateFitness() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function test_admin_can_update_a_worker()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($admin = $this->createAdmin())\n ->visitRoute($this->route, $this->lastWorker()->id)\n ->type('worker_name', $this->makeWorker()->worker_name)\n ->type('worker_nif', $this->makeWorker()->worker_nif)\n ->type('worker_start', str_replace('/', '', $this->makeWorker()->worker_start))\n ->type('worker_ropo', $this->makeWorker()->worker_ropo)\n ->type('worker_ropo_date', str_replace('/', '', $this->makeWorker()->worker_ropo_date))\n ->select('worker_ropo_level', $this->makeWorker()->worker_ropo_level)\n ->type('worker_observations', $this->makeWorker()->worker_observations)\n ->press(trans('buttons.edit'))\n ->assertSee(__('The items has been updated successfuly'));\n });\n\n $this->assertDatabaseHas('workers', [\n 'worker_name' => $this->makeWorker()->worker_name,\n 'worker_nif' => $this->makeWorker()->worker_nif,\n 'worker_ropo' => $this->makeWorker()->worker_ropo,\n 'worker_ropo_level' => $this->makeWorker()->worker_ropo_level,\n 'worker_observations' => $this->makeWorker()->worker_observations,\n ]);\n }", "public function testUpdate(): void { }", "function updateTest()\n {\n $this->cD->updateElement(new Product(1, \"Trang\"));\n }", "public function test_background_updates()\n {\n }", "public function testUpdated()\n {\n \t$game_factory = factory(Game::class)->create();\n \t$game_factory->game_hash_file = sha1(microtime());\n\n $this->assertTrue($game_factory->save());\n }", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function testSaveUpdate()\n {\n $user = User::findOne(1002);\n $version = Version::findOne(1001);\n\n $this->specify('Error update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'title' => 'Some very long title...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim, lorem in bibendum.',\n 'type' => Version::TYPE_TABLET,\n 'subtype' => 31,\n 'retinaScale' => false,\n 'autoScale' => 'invalid_value',\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n $version->refresh();\n\n verify('Model should not succeed', $result)->null();\n verify('Model should have errors', $model->errors)->notEmpty();\n verify('Title error message should be set', $model->errors)->hasKey('title');\n verify('ProjectId error message should not be set', $model->errors)->hasntKey('projectId');\n verify('Type error message should not be set', $model->errors)->hasntKey('type');\n verify('Subtype error message should be set', $model->errors)->hasKey('subtype');\n verify('AutoScale error message should be set', $model->errors)->hasKey('autoScale');\n verify('RetinaScale error message should not be set', $model->errors)->hasntKey('retinaScale');\n verify('Version title should not change', $version->title)->notEquals($data['title']);\n verify('Version type should not be changed', $version->type)->notEquals($data['type']);\n verify('Version subtype should not be changed', $version->subtype)->notEquals($data['subtype']);\n });\n\n $this->specify('Success update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'projectId' => 1003, // should be ignored\n 'title' => 'My new test version title',\n 'type' => Version::TYPE_MOBILE,\n 'subtype' => 31,\n 'retinaScale' => true,\n 'autoScale' => true,\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n\n verify('Model should succeed and return an instance of Version', $result)->isInstanceOf(Version::className());\n verify('Model should not has any errors', $model->errors)->isEmpty();\n verify('The returned Version should be the same as the updated one', $result->id)->equals($version->id);\n verify('Version projectId should not change', $result->projectId)->notEquals($data['projectId']);\n verify('Version title should match', $result->title)->equals($data['title']);\n verify('Version type should match', $result->type)->equals($data['type']);\n verify('Version subtype should match', $result->subtype)->equals($data['subtype']);\n verify('Version scaleFactor should match', $result->scaleFactor)->equals(Version::AUTO_SCALE_FACTOR);\n });\n }", "public function testItCanRunItemUpdate()\n {\n Artisan::call('item:update');\n\n // If you need result of console output\n $resultAsText = Artisan::output();\n\n $this->assertRegExp(\"/Item #[0-9]* updated\\\\n/\", $resultAsText);\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testServeChanges()\n {\n }", "public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "protected function doEmbeddedUpdateTests()\n {\n $this->objectRepository->setClassName(TestParent::class);\n $parent = $this->objectRepository->find(1);\n $parent->getAddress()->setTown('Somewhereborough');\n $this->objectRepository->saveEntity($parent);\n $refreshedParent = $this->objectRepository->find(1);\n $this->assertEquals('Somewhereborough', $refreshedParent->getAddress()->getTown());\n }" ]
[ "0.67539436", "0.6726989", "0.6693528", "0.6693528", "0.6681331", "0.6661945", "0.66463745", "0.6578476", "0.6578056", "0.657795", "0.6551882", "0.6551256", "0.6530346", "0.6482285", "0.64588344", "0.6385265", "0.63442075", "0.6335847", "0.6331066", "0.632276", "0.6302533", "0.6285765", "0.62669086", "0.6259578", "0.6240317", "0.6235338", "0.62195385", "0.6200822", "0.6193498", "0.6192996" ]
0.78741
0
Testing the subject listing
public function testListSubjects() { echo "\nTesting subject listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSearchSubject()\n {\n echo \"\\nTesting subject search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "public function testGetAuthorizationSubjectsMe()\n {\n }", "public function testGetAuthorizationSubjectsRolecounts()\n {\n }", "public function subjectList()\n\t{\n\t\t$data = array();\n\t\t$subjects = (object) $this->subjects->fetchData();\n\n\t\tif($subjects)\n\t\t{\n\t\t\tforeach ($subjects as $subject) {\n\t\t\t\t$lab_unit = '';\n\t\t if (!empty($subject['lab_unit'])) {\n\t\t $lab_unit = $subject['lab_unit'];\n\t\t }\n\t\t $data[] = array(\n\t\t 'subj_id'=>$subject['subj_id'],\n\t\t 'subj_code'=>$subject['subj_code'],\n\t\t 'subj_name'=>$subject['subj_name'],\n\t\t 'subj_desc'=>$subject['subj_desc'],\n\t\t 'lec_unit'=>$subject['lec_unit'],\n\t\t 'lab_unit'=>$lab_unit,\n\t\t 'lec_hour'=>$subject['lec_hour'],\n\t\t 'lab_hour'=>$subject['lab_hour'],\n\t\t 'split' =>$subject['split'],\n\t\t 'subj_type' =>$subject['subj_type'],\n\t\t 'type'=> $subject['subj_type']\n\t\t );\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\techo json_encode($data);\n\t}", "public function Course_subjects_list(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/course_module_list';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Lodnontec course Subject List',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t\t'course_subjects' =>$this->setting_model->Get_All('course_module_subject'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function testGetAuthorizationDivisionspermittedSubjectId()\n {\n }", "public function testListExperts()\n {\n }", "abstract public function get_subject();", "public function testGetSubject()\n {\n $subject = $this->createInstance(['_getSubject']);\n $_subject = $this->reflect($subject);\n $arg = uniqid('subject-');\n\n $subject->expects($this->exactly(1))\n ->method('_getSubject')\n ->will($this->returnValue($arg));\n\n $result = $subject->getSubject();\n $this->assertEquals($arg, $result, 'Subject did not retrieve required exception subject');\n }", "public function testDeleteSubject()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testGetAuthorizationSubject()\n {\n }", "public function testMailingList() {\n\t}", "public function testPostAuthorizationSubjectBulkadd()\n {\n }", "public function getSubjects() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT * FROM tblsubject ORDER BY Description ASC\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Find if a page exists for subject\n\t\t\t$subjects = array();\n\t\t\t$subject_ids = array();\n\t\t\t$i = 0; // array counter\n\t\t\twhile ($sql->next_record()) {\n\t\t\t\t$subject_ids[] = $sql->Record['ID'];\n\t\t\t\t$subjects[$i]['ID'] = $sql->Record['ID'];\n\t\t\t\t$subjects[$i]['Description'] = $sql->Record['Description'];\n\t\t\t\t$subjects[$i]['Exists'] = $this->pageExists($sql->Record['ID']);\n\t\t\t\t$subjects[$i]['Active'] = $this->getPageActive($sql->Record['Description']);\n\t\t\t\t$stats = $this->getSubjectStats($sql->Record['ID']);\n\t\t\t\t$subjects[$i]['No_Pages'] = $stats['pages'];\n\t\t\t\t$subjects[$i]['No_Courses'] = $stats['courses'];\n\t\t\t\t$subjects[$i]['No_News_Events'] = $stats['news_events'];\n\t\t\t\t$subjects[$i]['Valid_STC'] = (in_array($sql->Record['ID'],$this->valid_subject_codes)) ? TRUE : FALSE;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$missing_subjects = array();\n\t\t\tforeach ($this->valid_subject_codes as $title => $topic_code) {\n\t\t\t\t// If a valid subject topic code is not found in the subjects table, add it\n\t\t\t\tif (!in_array($topic_code, $subject_ids)) {\n\t\t\t\t\t// Add Subject to tblsubject\n\t\t\t\t\t$query = \"INSERT INTO tblsubject VALUES ('$topic_code','$title')\";\n\t\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\t\tif ($sql->num_rows_affected() > 0) {\n\t\t\t\t\t\t// Success\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"Error adding $title to subjects table\";\n\t\t\t\t\t\texit;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // foreach\n\t\t\t\n\t\t\treturn $subjects;\n\n\t\t}", "public function index()\n {\n //\n return $this->respond($this->_repo->subjects());\n }", "public function get_seubjects_list(){\n\t\t$this->verify();\n\t\t$subjects=$this->admin_model->fetch_subjects_list($_GET['search']);\n\t\tforeach ($subjects as $key => $value) {\n\t\t\t$data[] = array('id' => $value['SUBJECT_ID'], 'text' => $value['SUBJECT']);\t\t\t \t\n \t\t}\n\t\techo $officers=json_encode($data);\n\t}", "public function actionList()\n {\n $model = new SubjectPreg();\n $params = \\Yii::$app->request->getBodyParams();\n// var_dump($params);exit;\n $dataProvider = $model->searchList($params);\n\n return $this->renderList('list', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(Subject $subject)\n {\n \n }", "public function testListPeople()\n {\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function test_all_item_listed_or_no_listed_items_message_is_displayed()\n {\n $response = $this->get('/');\n if($response->assertSeeText(\"Details\")){\n $response->assertDontSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n } else {\n $response->assertSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n }\n }", "public function testListPastWebinarQA()\n {\n }", "public function getSubject()\n {\n }", "public function init() {\n\n\t\t//CHECK SUBJECT\n if (Engine_Api::_()->core()->hasSubject())\n return;\n\n\t\t//SET LISTING SUBJECT\n if (0 != ($listing_id = (int) $this->_getParam('listing_id')) &&\n null != ($list = Engine_Api::_()->getItem('list_listing', $listing_id))) {\n Engine_Api::_()->core()->setSubject($list);\n }\n }", "public function testManyDisciplineNameReturn()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 1 && $status[\"result\"] == true && $status[\"dept\"] == (\"MUSI,CPSC\"))\n $result = true;\n $this->assertEquals(true, $result);\n }" ]
[ "0.7150568", "0.6835536", "0.6827731", "0.6740685", "0.6314994", "0.630082", "0.62982154", "0.61793965", "0.6175428", "0.6151272", "0.6118109", "0.6099513", "0.60254", "0.6021194", "0.6016612", "0.59747297", "0.59371346", "0.5911985", "0.59065306", "0.58826673", "0.5865573", "0.585488", "0.585488", "0.585488", "0.585488", "0.58522236", "0.58257914", "0.5825052", "0.5822553", "0.58152634" ]
0.79010934
0
Testing the subject update.
public function testUpdateSubject() { echo "\nTesting subject update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('subject_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(\\SplSubject $subject) {}", "public function update(SplSubject $subject)\n {\n echo 1;\n }", "public function update(SplSubject $subject)\n {\n echo 2;\n }", "public function update(SplSubject $subject)\n {\n // TODO: Implement update() method.\n print_r($subject);\n}", "public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(SubjectInterface $subject);", "public function update(SubjectInterface $subject): void;", "public function test_updateMessage() {\n\n }", "public function testPostUpdate()\n {\n $this->getEmailWithLocal('uk');\n /** check email with ticket pdf file */\n $this->findEmailWithText('ticket-php-day-2017.pdf');\n /** check email with string */\n $this->findEmailWithText('Шановний учасник, в вкладенні Ваш вхідний квиток. Покажіть його з екрану телефону або роздрукуйте на папері.');\n }", "public function update(\\SplSubject $subject)\n {\n if($subject === $this->login){\n $this->doUpdate($subject);\n }\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testCollectionTicketsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testWebinarUpdate()\n {\n }", "public function testWebinarRegistrantQuestionUpdate()\n {\n }", "public function update(SplSubject $publisher){\r\n \r\n }", "public function testD_update() {\n\n $fname = self::$generator->firstName();\n $lname = self::$generator->lastName;\n\n $resp = $this->wrapper->update( self::$randomEmail, [\n 'FNAME' => $fname,\n 'LNAME' => $lname\n ]);\n\n $this->assertObjectHasAttribute('id', $resp);\n $this->assertObjectHasAttribute('merge_fields', $resp);\n\n $updated = $resp->merge_fields;\n\n $this->assertEquals($lname, $updated->LNAME);\n\n }", "public function update(SubjectRequest $request, Subject $subject)\n {\n //\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "public function updateObserver (Observable $subject) {\n /* @var $subject Repository\\AbstractRepository */\n $measureId = $subject->getMeasureId();\n $executor = $this->_commander->getExecutor(__CLASS__)->clean(); /* @var $executor Executor */\n\n $executor->add('getMeasure', $this->_measureService)\n ->getResult()\n ->setMeasureId($measureId)\n ->setType(Type::MYSQL);\n\n $measure = $executor->execute()->getData(); /* @var $measure Entity\\Measure */\n $testId = $measure->getTestId();\n\n $executor->clean()\n ->add('updateTestState', $this->_testService)\n ->getResult()\n ->setTestId($testId);\n $executor->execute();\n\n return true;\n }", "public function update(Request $request, Subject $subject)\n {\n //\n }", "public function update(Request $request, Subject $subject)\n {\n //\n }", "function tests_can_update_a_note() \n {\n $text = 'Update note';\n\n /*\n * Create a new category\n */\n $category = factory(Category::class)->create();\n\n /*\n * Create another category for update\n */\n\n $anotherCategory = factory(Category::class)->create();\n\n /*\n * Create a note\n */\n\n $note = factory(Note::class)->make();\n\n /*\n * Relation note with category\n */\n\n $category->notes()->save($note);\n\n\n /*\n * Send request for update note\n */\n $this->put('api/v1/notes'. $note->id, [\n 'note' => $text,\n 'category_id' => $anotherCategory->id,\n ], ['Content-Type' => 'application/x-www-form-urlencoded']);\n\n /*\n * Check that in database update note\n */\n $this->seeInDatabase('notes', [\n 'note' => $text,\n 'category_id' => $anotherCategory->id\n\n ]);\n\n\n /*\n * Ckeck that response in format Json\n */\n\n // $this->seeJsonEquals([\n // 'success' => true,\n // 'note' => [\n // 'id' => $note->id,\n // 'note' => $text,\n // 'category_id' => $anotherCategory->id,\n // ],\n // ]);\n }" ]
[ "0.7487688", "0.7255924", "0.7250931", "0.72051895", "0.70829284", "0.70773464", "0.70773464", "0.70773464", "0.70773464", "0.70759016", "0.70759016", "0.68281275", "0.6787441", "0.67633486", "0.6650405", "0.6597262", "0.6563807", "0.6552678", "0.6539471", "0.6524724", "0.6476421", "0.6473057", "0.6462073", "0.644398", "0.644398", "0.64341617", "0.64238244", "0.6419897", "0.6419897", "0.6358471" ]
0.78042865
0
Testing the subject deletion. Note that this is logical deletion. The subject will remain in the Elasticsearch
public function testDeleteSubject() { echo "\nTesting subject deletion..."; $id = "0"; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/subjects/".$id; $response = $this->curl_delete($url); // echo $response; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteDocument()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testPostAuthorizationSubjectBulkremove()\n {\n }", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "public function testDeleteAuthorizationSubjectDivisionRole()\n {\n }", "public function deleted(Subject $subject)\n {\n $this->updateHasChange($subject,2);\n }", "public function testDeleteDocument()\n {\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testSendDeletesOnly()\n {\n $expectedBody = $this->getExpectedBody([], ['test123']);\n $this->mockEndpoint();\n $this->mockCurl($expectedBody);\n\n $this->subject->addDelete('test123');\n $responses = $this->subject->send();\n\n $this->assertEquals(1, count($responses));\n\n $this->assertEquals(\n [\n 'status' => 200,\n 'body' => ''\n ],\n $responses[0]\n );\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function subjects_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteSubject($id);\n $this->response($result); \n }", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function destroy(Subject $subject)\n {\n //where('id', 1)->wherePivot('year', 2011)->detach(1);\n \n $subject->delete();\n $subject->tutors()->detach();\n return redirect()->route('subject.index');\n }", "public function testRejectMatchingSuggestionsUsingDELETE()\n {\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testDeleteIfAuthor()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $this->logInAsUser();\n\n $this->task->setUser($this->authUser);\n $this->client->request('GET', '/tasks/'.$id.'/delete');\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été supprimée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testMarketingCampaignsTypesIdSubTypesSubTypeIdDelete()\n {\n\n }", "public function testSearchSubject()\n {\n echo \"\\nTesting subject search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function test_deleteSubscriber() {\n\n }", "public function testDelete()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 60, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // delete\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([60])\n ->setIdName('id')\n ->build();\n\n $this->cacheManager->delete($searchCriteria);\n\n // search\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertFalse($searchResult->hasData());\n $this->assertEquals(0, $searchResult->count());\n $this->assertCount(1, $searchResult->getMissedData());\n }", "public function testUpdateSubject()\n {\n echo \"\\nTesting subject update...\";\n $id = \"0\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('subject_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function testDeleteMetadata1UsingDELETE()\n {\n }", "public function testDeleteReplenishmentTag()\n {\n }", "public function forceDeleted(Subject $subject)\n {\n //\n }", "public function testDeleteMember()\n {\n }", "public function testQuarantineDeleteById()\n {\n\n }", "function delete_level_subject($id)\n {\n return $this->db->delete('level_subjects',array('id'=>$id));\n }", "public function testMakeDeleteRequest()\n {\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse([\n 'success' => [\n 'code' => 200,\n 'message' => 'Deleted.',\n ],\n ], 200),\n ]);\n\n $this->assertEquals($client->delete('teachers/1'), true);\n }" ]
[ "0.777233", "0.69906515", "0.6699793", "0.6470792", "0.64638245", "0.6381767", "0.6278607", "0.6157048", "0.61286646", "0.6072591", "0.6058868", "0.60418016", "0.6032439", "0.60274434", "0.60081273", "0.60062474", "0.60042393", "0.59941715", "0.5994005", "0.59828883", "0.5974379", "0.5970258", "0.59701556", "0.5965135", "0.5961059", "0.59529316", "0.593857", "0.59268343", "0.5920076", "0.5913776" ]
0.8416284
0
Testing the document search
public function testSearchDocument() { echo "\nTesting document search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents?search=mouse"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/documents?search=mouse"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInboundDocumentSearch()\n {\n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function search(){}", "public function search();", "public function search();", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testListDocuments()\n {\n }", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "function search() {}", "public function testSearchUsingGET()\n {\n\n }", "public function testListAllDocuments()\n {\n }", "public function action_search_doc()\n\t{\n\t\tglobal $context;\n\n\t\t$context['doc_apiurl'] = 'https://github.com/elkarte/Elkarte/wiki/api.php';\n\t\t$context['doc_scripturl'] = 'https://github.com/elkarte/Elkarte/wiki/';\n\n\t\t// Set all the parameters search might expect.\n\t\t$postVars = explode(' ', $context['search_term']);\n\n\t\t// Encode the search data.\n\t\tforeach ($postVars as $k => $v)\n\t\t{\n\t\t\t$postVars[$k] = urlencode($v);\n\t\t}\n\n\t\t// This is what we will send.\n\t\t$postVars = implode('+', $postVars);\n\n\t\t// Get the results from the doc site.\n\t\trequire_once(SUBSDIR . '/Package.subs.php');\n\t\t// Demo URL:\n\t\t// https://github.com/elkarte/Elkarte/wiki/api.php?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=template+eval\n\t\t$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);\n\n\t\t// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?\n\t\tif (!$search_results || preg_match('~<' . '\\?xml\\sversion=\"\\d+\\.\\d+\"\\?' . '>\\s*(<api>.+?</api>)~is', $search_results, $matches) !== 1)\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t$search_results = !empty($matches[1]) ? $matches[1] : '';\n\n\t\t// Otherwise we simply walk through the XML and stick it in context for display.\n\t\t$context['search_results'] = array();\n\n\t\t// Get the results loaded into an array for processing!\n\t\t$results = new XmlArray($search_results, false);\n\n\t\t// Move through the api layer.\n\t\tif (!$results->exists('api'))\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t// Are there actually some results?\n\t\tif ($results->exists('api/query/search/p'))\n\t\t{\n\t\t\t$relevance = 0;\n\t\t\tforeach ($results->set('api/query/search/p') as $result)\n\t\t\t{\n\t\t\t\t$title = $result->fetch('@title');\n\t\t\t\t$context['search_results'][$title] = array(\n\t\t\t\t\t'title' => $title,\n\t\t\t\t\t'relevance' => $relevance++,\n\t\t\t\t\t'snippet' => str_replace('class=\\'searchmatch\\'', 'class=\"highlight\"', un_htmlspecialchars($result->fetch('@snippet'))),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function testGetDocument()\n {\n }", "public function testReadDocument()\n {\n }", "function search()\n\t{}", "function search()\n\t{}", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function test_searchByPage() {\n\n }", "public function testBookSearchMustOK()\n {\n $dataSearch = [];\n $dataSearch['search'] = 'TestBook';\n $dataSearch['limit'] = 100;\n $buildParams = http_build_query($dataSearch, PHP_QUERY_RFC1738);\n $url = route('book.index');\n $fullUrl = \"$url?$buildParams\";\n $response = $this->getJson($fullUrl);\n\n $response\n ->assertStatus(200)\n ->assertJsonPath('page_info.total', 1);\n }", "public function testListDocuments()\n {\n echo \"\\nTesting document listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function search($search);" ]
[ "0.7785687", "0.75202906", "0.72430456", "0.6984289", "0.69202304", "0.69202304", "0.6891472", "0.686389", "0.6850928", "0.6846033", "0.68441135", "0.6820873", "0.68099535", "0.6800658", "0.67511064", "0.67509943", "0.67172694", "0.6615381", "0.65921086", "0.6586356", "0.6583704", "0.65794736", "0.65603477", "0.65603477", "0.65480226", "0.6544873", "0.6540953", "0.6482006", "0.6481535", "0.6464413" ]
0.8208773
0
Testing the document update.
public function testUpdateDocument() { echo "\nTesting dcoument update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('doc_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPutDocument()\n {\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function testD_update() {\n\n $fname = self::$generator->firstName();\n $lname = self::$generator->lastName;\n\n $resp = $this->wrapper->update( self::$randomEmail, [\n 'FNAME' => $fname,\n 'LNAME' => $lname\n ]);\n\n $this->assertObjectHasAttribute('id', $resp);\n $this->assertObjectHasAttribute('merge_fields', $resp);\n\n $updated = $resp->merge_fields;\n\n $this->assertEquals($lname, $updated->LNAME);\n\n }", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function testUpdate(): void { }", "public function testUpdate()\n {\n $documentHandler = new DocumentHandler($this->connection);\n $result = $documentHandler->save($this->collection1->getName(), [ '_key' => 'test', 'value' => 'test' ]);\n static::assertEquals('test', $result);\n\n $trx = new StreamingTransaction($this->connection, [\n TransactionBase::ENTRY_COLLECTIONS => [\n TransactionBase::ENTRY_WRITE => [ $this->collection1->getName() ]\n ]\n ]);\n\n $trx = $this->transactionHandler->create($trx);\n $this->_shutdown[] = $trx;\n static::assertInstanceOf(StreamingTransaction::class, $trx);\n \n static::assertTrue(is_string($trx->getId()));\n\n $trxCollection = $trx->getCollection($this->collection1->getName());\n static::assertEquals($this->collection1->getName(), $trxCollection->getName());\n\n // document should be present inside transaction\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n\n // update document inside transaction\n $doc->value = 'foobar';\n $result = $documentHandler->updateById($trxCollection, 'test', $doc);\n static::assertTrue($result);\n\n // transactional lookup should find the modified document\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('foobar', $doc->value);\n \n // non-transactional lookup should still see the old document\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n \n // now commit\n static::assertTrue($this->transactionHandler->commit($trx->getId()));\n\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('foobar', $doc->value);\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function testUpdate()\n\t{\n\t\t$params = $this->setUpParams();\n\t\t$params['title'] = 'some tag';\n\t\t$params['slug'] = 'some-tag';\n\t\t$response = $this->call('PUT', '/'.self::$endpoint.'/'.$this->obj->id, $params);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($params as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969', $params);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "public function testUpdateDocumentMetadata()\n {\n }", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "public function testWebinarUpdate()\n {\n }", "public function testSaveUpdate()\n {\n $city = $this->existing_city;\n\n // set string properties to \"updated <property_name>\"\n // set numeric properties to strlen(<property_name>)\n foreach (get_object_vars($city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($value)) {\n $city->$key = \"updated \".$key;\n } elseif (is_numeric($value)) {\n $city->$key = strlen($key);\n }\n }\n }\n\n // update the city\n $city->save();\n\n // go get the updated record\n $updated_city = new City($city->id);\n // check the properties of the updatedCity\n foreach (get_object_vars($updated_city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($city->$key)) {\n $this->assertEquals(\"updated \".$key, $value);\n } elseif (is_numeric($city->$key)) {\n $this->assertEquals(strlen($key), $value);\n }\n }\n }\n }", "public function test_if_failed_update()\n {\n }", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function testUpdate()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->count(10)->create();\n\n //test item not found\n $this->call('PUT', '/items/11111')\n ->assertStatus(404);\n\n //test validation\n $this->put('items/1', array('email' => 'test1!kl'))\n ->seeJson([\n 'email' => array('The email must be a valid email address.'),\n ]);\n\n //test exception\n $this->put('items/1', array('email' => '[email protected]'))\n ->seeJsonStructure([\n 'error', 'code'\n ])\n ->seeJson(['code' => 400]);\n\n //test success updated item\n $this->put('items/1', array('email' => '[email protected]', 'name' => 'test1 updated'))\n ->seeJson([\n 'status' => 'ok',\n ])\n ->seeJson([\n 'email' => '[email protected]',\n ])\n ->seeJson([\n 'name' => 'test1 updated',\n ])\n ->seeJsonStructure([\n 'data' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]);\n\n $this->seeInDatabase('items', array('email' => '[email protected]', 'name' => 'test1 updated'));\n }", "public function testDebtorUpdate()\n {\n $this->saveDebtor();\n\n $oDebtor = (new DebtorDAO())->findByCpfCnpj('01234567890');\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $aDadosUpdate = [\n 'id' => $oDebtor->getId(),\n 'name' => 'Carlos Vinicius Atualização',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '14725836905',\n 'birthdate' => '01/01/2000',\n 'phone_number' => '(79) 9 8888-8888',\n 'zipcode' => '11111-111',\n 'address' => 'Rua Atualização',\n 'number' => '005544',\n 'complement' => 'Conjunto Atualização',\n 'neighborhood' => 'Bairro Atualização',\n 'city' => 'Maceió',\n 'state' => 'AL'\n ];\n\n $oDebtorFound = (new DebtorDAO())->find($aDadosUpdate['id']);\n $oDebtorFound->update($aDadosUpdate);\n\n $oDebtorUpdated = (new DebtorDAO())->find($aDadosUpdate['id']);\n $this->assertTrue($oDebtorUpdated->getName() == 'Carlos Vinicius Atualização');\n $this->assertTrue($oDebtorUpdated->getEmail() == '[email protected]');\n $this->assertTrue($oDebtorUpdated->getCpfCnpj() == '14725836905');\n $this->assertTrue($oDebtorUpdated->getBirthdate()->format('d/m/Y') == '01/01/2000');\n $this->assertTrue($oDebtorUpdated->getPhoneNumber() == '79988888888');\n $this->assertTrue($oDebtorUpdated->getZipcode() == '11111111');\n $this->assertTrue($oDebtorUpdated->getAddress() == 'Rua Atualização');\n $this->assertTrue($oDebtorUpdated->getNumber() == '005544');\n $this->assertTrue($oDebtorUpdated->getComplement() == 'Conjunto Atualização');\n $this->assertTrue($oDebtorUpdated->getNeighborhood() == 'Bairro Atualização');\n $this->assertTrue($oDebtorUpdated->getCity() == 'Maceió');\n $this->assertTrue($oDebtorUpdated->getState() == 'AL');\n $this->assertTrue(!is_null($oDebtorUpdated->getUpdated()));\n $oDebtorUpdated->delete();\n }", "public function test_it_updates_a_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]', 'given_name' => 'A', 'family_name' => 'H'];\n\n $this->json('PUT', sprintf('/users/%d', $user->id), $update)\n ->seeJson($update);\n }", "function tests_can_update_a_note() \n {\n $text = 'Update note';\n\n /*\n * Create a new category\n */\n $category = factory(Category::class)->create();\n\n /*\n * Create another category for update\n */\n\n $anotherCategory = factory(Category::class)->create();\n\n /*\n * Create a note\n */\n\n $note = factory(Note::class)->make();\n\n /*\n * Relation note with category\n */\n\n $category->notes()->save($note);\n\n\n /*\n * Send request for update note\n */\n $this->put('api/v1/notes'. $note->id, [\n 'note' => $text,\n 'category_id' => $anotherCategory->id,\n ], ['Content-Type' => 'application/x-www-form-urlencoded']);\n\n /*\n * Check that in database update note\n */\n $this->seeInDatabase('notes', [\n 'note' => $text,\n 'category_id' => $anotherCategory->id\n\n ]);\n\n\n /*\n * Ckeck that response in format Json\n */\n\n // $this->seeJsonEquals([\n // 'success' => true,\n // 'note' => [\n // 'id' => $note->id,\n // 'note' => $text,\n // 'category_id' => $anotherCategory->id,\n // ],\n // ]);\n }", "public function testUnitUpdate()\n {\n $input = [\n 'username' => 'foo.bar',\n 'email' => '[email protected]',\n 'password' => 'asdfg',\n 'password_confirmation' => 'asdfg',\n 'name' => 'foo bar'\n ];\n $request = Mockery::mock('Suitcoda\\Http\\Requests\\UserEditRequest[all]');\n $request->shouldReceive('all')->once()->andReturn($input);\n\n $model = Mockery::mock('Suitcoda\\Model\\User[save]');\n $model->shouldReceive('findOrFailByUrlKey')->once()->andReturn($model);\n $model->shouldReceive('save')->once();\n\n $user = new UserController($model);\n\n $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $user->update($request, 1));\n }", "function updateTest()\n {\n $this->cD->updateElement(new Product(1, \"Trang\"));\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testSaveUpdate()\n {\n $user = User::findOne(1002);\n $version = Version::findOne(1001);\n\n $this->specify('Error update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'title' => 'Some very long title...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim, lorem in bibendum.',\n 'type' => Version::TYPE_TABLET,\n 'subtype' => 31,\n 'retinaScale' => false,\n 'autoScale' => 'invalid_value',\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n $version->refresh();\n\n verify('Model should not succeed', $result)->null();\n verify('Model should have errors', $model->errors)->notEmpty();\n verify('Title error message should be set', $model->errors)->hasKey('title');\n verify('ProjectId error message should not be set', $model->errors)->hasntKey('projectId');\n verify('Type error message should not be set', $model->errors)->hasntKey('type');\n verify('Subtype error message should be set', $model->errors)->hasKey('subtype');\n verify('AutoScale error message should be set', $model->errors)->hasKey('autoScale');\n verify('RetinaScale error message should not be set', $model->errors)->hasntKey('retinaScale');\n verify('Version title should not change', $version->title)->notEquals($data['title']);\n verify('Version type should not be changed', $version->type)->notEquals($data['type']);\n verify('Version subtype should not be changed', $version->subtype)->notEquals($data['subtype']);\n });\n\n $this->specify('Success update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'projectId' => 1003, // should be ignored\n 'title' => 'My new test version title',\n 'type' => Version::TYPE_MOBILE,\n 'subtype' => 31,\n 'retinaScale' => true,\n 'autoScale' => true,\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n\n verify('Model should succeed and return an instance of Version', $result)->isInstanceOf(Version::className());\n verify('Model should not has any errors', $model->errors)->isEmpty();\n verify('The returned Version should be the same as the updated one', $result->id)->equals($version->id);\n verify('Version projectId should not change', $result->projectId)->notEquals($data['projectId']);\n verify('Version title should match', $result->title)->equals($data['title']);\n verify('Version type should match', $result->type)->equals($data['type']);\n verify('Version subtype should match', $result->subtype)->equals($data['subtype']);\n verify('Version scaleFactor should match', $result->scaleFactor)->equals(Version::AUTO_SCALE_FACTOR);\n });\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function updated(Document $document)\n {\n //\n }", "public function testUpdateDocumentValue()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n\n $documentId = $eavDocument->getId();\n\n $this->assertTrue($eavDocument->hasValue('documentReference'));\n\n $eavDocument->setValue('documentReference', 'F 2020202');\n $this->em->persist($eavDocument);\n $this->em->flush();\n\n $eavDocument = $this->getEavDocumentRepo()->find($documentId);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n\n $eavValue = $eavDocument->getValue('documentReference');\n\n $this->assertSame('F 2020202', $eavValue->getValue());\n }", "public function testCreateUpdateDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->update($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }" ]
[ "0.7445582", "0.7350307", "0.7350307", "0.7308162", "0.73037523", "0.7143603", "0.710914", "0.7107103", "0.7079882", "0.7067057", "0.70222914", "0.7011263", "0.6999789", "0.6995497", "0.6980029", "0.69385535", "0.6929259", "0.69202584", "0.68766135", "0.68698466", "0.6856206", "0.6853961", "0.6837075", "0.68358576", "0.6769747", "0.67558444", "0.6747325", "0.6723854", "0.6703572", "0.6653104" ]
0.8108038
0
Testing the document deletion. Note that this is logical deletion. The document will remain in the Elasticsearch
public function testDeleteDocument() { echo "\nTesting subject deletion..."; $id = "0"; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents/".$id; $response = $this->curl_delete($url); // echo $response; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function testDeleteDocument()\n {\n }", "protected function doDeleteDocument() {\n try{\n $this->service->remove($this->owner);\n }\n catch(NotFoundException $e)\n {\n trigger_error(\"Deleted document not found in search index.\", E_USER_NOTICE);\n }\n\n }", "public function delete() {\n // Find document ID.\n if (!$this->find()) {\n debugging('Failed to find ousearch document');\n return false;\n }\n self::wipe_document($this->id);\n }", "public function testOnDeletedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $obj->onDeletedDocument($this->doc1);\n $this->assertFileNotExists($this->directory . \"/1/2/4\");\n }", "public function testDeleteForm() {\n $document = $this->createDocument();\n\n $document_name = $document->id();\n\n // Log in and check for existence of the created document.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/structure/legal');\n $this->assertRaw($document_name, 'Document found in overview list');\n\n // Delete the document.\n $this->drupalPostForm('admin/structure/legal/manage/' . $document_name . '/delete', [], 'Delete');\n\n // Ensure document no longer exists on the overview page.\n $this->assertUrl('admin/structure/legal', [], 'Returned to overview page after deletion');\n $this->assertNoText($document_name, 'Document not found in overview list');\n }", "function delete() {\n\n $document = Doctrine::getTable('DocDocument')->find($this->input->post('doc_document_id'));\n $node = Doctrine::getTable('Node')->find($document->node_id);\n\n if ($document && $document->delete()) {\n//echo '{\"success\": true}';\n\n $this->syslog->register('delete_document', array(\n $document->doc_document_filename,\n $node->getPath()\n )); // registering log\n\n $success = 'true';\n $msg = $this->translateTag('General', 'operation_successful');\n } else {\n//echo '{\"success\": false}';\n $success = 'false';\n $msg = $e->getMessage();\n }\n\n $json_data = $this->json->encode(array('success' => $success, 'msg' => $msg));\n echo $json_data;\n }", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function deleteFromIndex()\n {\n if ($this->es_info) {\n ESHelper::deleteDocumentFromType($this);\n }\n }", "public function testDelete()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table2',\r\n\t\t));\r\n\r\n\t\t// Delete all indices\r\n\t\tforeach($table->indices AS $index)\r\n\t\t{\r\n\t\t\t$this->assertNotSame(false, $index->delete());\r\n\t\t}\r\n\r\n\t\t// Reload table\r\n\t\t$table->refresh();\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(0, count($table->indices));\r\n\t}", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "public function testDeleteIdsIdxObjectTypeObject(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // Using the existing $index variable which is \\Elastica\\Index object\n $index->getClient()->deleteIds($ids, $index);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "function __safeDeleteDocument() {\n\t\ttry {\n\t\t\t$this->solr->deleteById($this->__createDocId());\n\t\t\t$this->solr->commit();\n\t\t\t$this->solr->optimize();\t\n\t\t} catch (Exception $e) {\n\t\t\t$this->log($e, 'solr');\n\t\t}\n\t}", "public function delete($document_id);", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function delete() {\n\t\tif (!$this->preDelete()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireDatabase();\n\t\t$this->requireId();\n\t\t$this->requireRev();\n\n\t\t$this->options[\"rev\"] = $this->document->_rev;\n\n\t\ttry {\n\t\t\t$request = new HttpRequest();\n\t\t\t$request->setUrl($this->databaseHost . \"/\" . rawurlencode($this->databaseName) . \"/\" . rawurlencode($this->document->_id) . self::encodeOptions($this->options));\n\t\t\t$request->setMethod(\"delete\");\n\t\t\t$request->send();\n\n\t\t\t$request->response = json_decode($request->response);\n\t\t} catch (Exception $exception) {\n\t\t\tthrow new DocumentException(\"HTTP request failed.\", DocumentException::HTTP_REQUEST_FAILED, $exception);\n\t\t}\n\n\t\tif ($request->status === 200) {\n\t\t\t$this->document->_id = $request->response->id;\n\t\t\t$this->document->_rev = $request->response->rev;\n\n\t\t\treturn $this->postDelete();\n\t\t} else {\n\t\t\tthrow new DocumentException(self::describeError($request->response));\n\t\t}\n\t}", "public function testDelete()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 60, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // delete\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([60])\n ->setIdName('id')\n ->build();\n\n $this->cacheManager->delete($searchCriteria);\n\n // search\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertFalse($searchResult->hasData());\n $this->assertEquals(0, $searchResult->count());\n $this->assertCount(1, $searchResult->getMissedData());\n }", "public function testCreateReplaceDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->replace($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayNotHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function testCreateUpdateDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->update($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDelete()\n\t{\n\t\t$obj2 = $this->setUpObj();\n\t\t$response = $this->call('DELETE', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah sudah terdelete\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($obj2->attributesToArray() as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\t}", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "public function testDeleteDocument($name, $fields, $expectedValues)\n {\n $crud = new Enumerates();\n $crud->setUrlParameters(array(\n \"familyId\" => $name\n ));\n try {\n $crud->delete(null);\n $this->assertFalse(true, \"An exception must occur\");\n }\n catch(DocumentException $exception) {\n $this->assertEquals(501, $exception->getHttpStatus());\n }\n }", "public function delete() {\n\t\t$delete_array = array();\n\t\tif ($this->getIdType() === self::ID_TYPE_MONGO) {\n\t\t\t$delete_array['_id'] = new \\MongoId($this->getId());\n\t\t} else {\n\t\t\t$delete_array['_id'] = $this->getId();\n\t\t}\n\t\t$rows_affected = $this->getCollection()->remove($delete_array);\n\t\treturn $rows_affected;\n\t}" ]
[ "0.7819554", "0.7742444", "0.7180947", "0.7146807", "0.7044822", "0.6999556", "0.6970119", "0.69247323", "0.68608874", "0.6719958", "0.6718927", "0.67063123", "0.6704686", "0.6703076", "0.6648219", "0.6647937", "0.6635172", "0.66290015", "0.6604365", "0.66010773", "0.65809053", "0.65808105", "0.65717274", "0.65401775", "0.6521773", "0.65099317", "0.6507093", "0.6498915", "0.64362574", "0.6409235" ]
0.8316177
0
Testing document listing with the parameters, "from" and "size"
public function testListDocumentsFromTo() { echo "\nTesting the document retrieval by ID..."; $response = $this->listDocumentsFromTo(0,26); //echo $response; $result = json_decode($response); $hits = $result->hits; //echo "\nCOUNT:".count($hits); $this->assertTrue(count($hits)==26); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function listDocumentsFromTo($from,$size)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/documents\";\n \n $url = $url.\"?from=\".$from.\"&size=\".$size;\n \n \n echo \"\\n\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function testListDocuments()\n {\n }", "public function testListAllDocuments()\n {\n }", "public function testListDocuments()\n {\n echo \"\\nTesting document listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testListAllPublicDocuments()\n {\n }", "public function testPagination()\n {\n\n // Set public page length to 2.\n set_option('per_page_public', 2);\n\n $item1 = $this->_item(true, 'Item 1');\n $item2 = $this->_item(true, 'Item 2');\n $item3 = $this->_item(true, 'Item 3');\n $item4 = $this->_item(true, 'Item 4');\n $item5 = $this->_item(true, 'Item 5');\n $item6 = $this->_item(true, 'Item 6');\n\n // --------------------------------------------------------------------\n\n // Page 1.\n $this->dispatch('solr-search');\n\n // Should just list items 1-2.\n $this->assertXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link to page 2.\n $next = public_url('solr-search?page=2');\n $this->assertXpath('//a[@href=\"'.$next.'\"]');\n\n $this->resetResponse();\n $this->resetRequest();\n\n // --------------------------------------------------------------------\n\n // Page 2.\n $_GET['page'] = '2';\n $this->dispatch('solr-search');\n\n // Should just list items 3-4.\n $this->assertNotXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link to page 3.\n $next = public_url('solr-search?page=3');\n $this->assertXpath('//a[@href=\"'.$next.'\"]');\n\n $this->resetResponse();\n $this->resetRequest();\n\n // --------------------------------------------------------------------\n\n // Page 3.\n $_GET['page'] = '3';\n $this->dispatch('solr-search');\n\n // Should just list items 5-6.\n $this->assertNotXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link back to page 2.\n $prev = public_url('solr-search?page=2');\n $this->assertXpath('//a[@href=\"'.$prev.'\"]');\n\n // --------------------------------------------------------------------\n\n }", "public function testGETProductsCollectionPaginated()\n {\n $this->assertEquals(\n 4,\n $this->crawler->filter('span:contains(\"Title\")')->count()\n );\n //in the last page have 2 product\n $crawler = $this->client->request('GET', '/?page=8');\n $this->assertEquals(\n 2,\n $crawler->filter('span:contains(\"Title\")')->count()\n );\n }", "public function testInboundDocumentSearch()\n {\n }", "public function testReadDocument()\n {\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }", "abstract public function getDocuments();", "public function testGetPositionsWithPagination()\n {\n $client = new Client(['base_uri' => 'http://localhost:8000/api/']);\n $token = $this->getAuthenticationToken();\n $headers = [\n 'Authorization' => 'Bearer ' . $token,\n 'Accept' => 'application/json'\n ];\n $params = [\n 'page' => 2\n ];\n $response = $client->request('GET', 'positions', [\n 'headers' => $headers,\n 'query' => $params\n ]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(['application/json; charset=utf-8'], $response->getHeader('Content-Type'));\n $data = json_decode($response->getBody(), true);\n $this->assertEquals(30, count($data));\n\n }", "public function test_list_all_offices_paginated() {\n Office::factory(3)->create();\n\n $response = $this->get('/api/offices');\n\n $response->assertOk();\n\n // Assert the returned json data has 3 items - the ones we created above\n $response->assertJsonCount(3, 'data');\n\n // Assert atleast the ID of the first item is not null\n $this->assertNotNull($response->json('data')[0]['id']);\n\n // Assert there is meta for the paginated results. You can include links as well\n $this->assertNotNull($response->json('meta'));\n\n //dd($response->json());\n\n }", "function retrieveAllDocuments($client, $html)\n{\n if ($html) {echo \"<h2>Your documents</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed();\n\n printDocumentsFeed($feed, $html);\n}", "public function testCreatePaginatedList(): void\n {\n // given\n $page = 1;\n $dataSetSize = 10;\n $expectedResultSize = 10;\n\n $counter = 0;\n while ($counter < $dataSetSize) {\n $film = new Films();\n $category = new \\App\\Entity\\Category();\n $category->setName('test3'.$counter);\n $categoryRepository = self::$container->get(CategoryRepository::class);\n $categoryRepository->save($category);\n $film->setReleaseDate('2021-07-15');\n $film->setDescription('ssa');\n $film->setCategory($category);\n $film->setTitle('Test film #'.$counter);\n $this->filmsRepository->save($film);\n\n $user = new User();\n $user->setEmail('test'.$counter.'@gmail.com');\n $user->setPassword('123445');\n $user->setUsersprofile($this->createUserProfile());\n $userprofile = $user->getUsersprofile();\n $comment = new Comments();\n $comment->setLogin($userprofile);\n $comment->setFilms($film);\n $comment->setContent(' Content#2'.$counter);\n\n $this->commentsRepository->save($comment);\n\n ++$counter;\n }\n\n // when\n $result = $this->commentsService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function testInboundDocumentCount()\n {\n }", "public function testPage()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->page(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(225, $elasticQuery['from']);\n $this->assertSame(25, $elasticQuery['size']);\n\n $this->assertSame($query, $query->page(20, 50));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(950, $elasticQuery['from']);\n $this->assertSame(50, $elasticQuery['size']);\n\n $query->limit(15);\n $this->assertSame($query, $query->page(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(285, $elasticQuery['from']);\n $this->assertSame(15, $elasticQuery['size']);\n }", "public function listing();", "public function testReadPublicDocument()\n {\n }", "public function testInboundDocumentGet()\n {\n }", "public function getDocuments();", "public function test_list_stores_pagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit(new ListStores());\n $number_page = count($browser->elements('.pagination li')) - 2;\n $this->assertEquals($number_page, ceil((self::NUMBER_RECORD) / (self::ROW_LIMIT)));\n });\n }", "public function testRetrieveTheMediaObjectList(): void\n {\n $response = $this->request('GET', '/api/media_objects');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(10, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('fileName', $json[$key]);\n $this->assertArrayHasKey('mimeType', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]);\n } \n }", "public function testCreatePaginatedList(): void\n {\n // given\n $page = 1;\n $dataSetSize = 3;\n $expectedResultSize = 3;\n\n $counter = 0;\n while ($counter < $dataSetSize) {\n $category = new Category();\n $category->setName('Test Category #'.$counter);\n $this->categoryService->save($category);\n\n ++$counter;\n }\n\n // when\n $result = $this->categoryService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function testGetList_SortingLimit()\n\t{\n\t\t$this->object->Save();\n\t\t$newObject1 = new object(\"efg\");\n\t\t$newObject2 = new object(\"abc\");\n\t\t$newObject3 = new object(\"d\");\n\n\t\t$newObject1->Save();\n\t\t$newObject2->Save();\n\t\t$newObject3->Save();\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", true, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"abc\", $objectList[0]->attribute);\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", false, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"obj att\", $objectList[0]->attribute);\n\t\t$this->assertEquals(\"efg\", $objectList[1]->attribute);\n\t}", "public function index()\n\t{\n $search = Input::get(\"search\");\n $from = date(\"Y-m-d H:i:s\",strtotime(Input::get(\"from\")) );\n $to = date(\"Y-m-d H:i:s\",strtotime(Input::get(\"to\")) );\n\n\t\t$documents = Document::orderBy('created_at','desc')->with('fromUnit')\n ->search($search)\n ->dateBetween($from,$to)\n ->paginate(5);\n\n\n\t\treturn View::make('documents.index', compact('documents'));\n\t}", "public function testShowRecordPaginate()\n {\n $this->makeData(21);\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/comment')\n ->resize(1920, 2000)\n ->assertSee('List comment & rating');\n //Count row number in one page \n $elements = $browser->elements('#list-table tbody tr');\n $this->assertCount(10, $elements);\n $this->assertNotNull($browser->element('.pagination'));\n\n //Count page number of pagination\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element)- 2;\n $this->assertTrue($number_page == 3);\n });\n }" ]
[ "0.71769536", "0.68642807", "0.66656786", "0.6481461", "0.6258789", "0.5947674", "0.5771128", "0.57704264", "0.56990504", "0.5689262", "0.5676513", "0.56605285", "0.56581664", "0.5576548", "0.5574252", "0.55462795", "0.54961747", "0.5494453", "0.5439168", "0.5438068", "0.54307014", "0.54005426", "0.53992414", "0.5394465", "0.5387522", "0.5387352", "0.5387195", "0.5372961", "0.5372843", "0.536584" ]
0.69214356
1
Testing the user retreival by ID
public function testGetUsertByID() { echo "\nTesting the user retrieval by ID..."; $response = $this->getUser("44225"); //echo $response; $result = json_decode($response); $user = $result->User; $this->assertTrue((!is_null($user))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function getUser($id);", "public function getUserById($id) {\n\t\t\n\t}", "abstract public function fetchUserById($id);", "public function testGetById()\n {\n // Create and save a record to the DB\n $user = $this->userRepository->make([\n 'first_name' => 'test-first-name',\n 'last_name' => 'test-last-name',\n 'email' => '[email protected]',\n 'password' => '123123',\n ]);\n\n $user->save();\n\n // Get the user from DB with the getById method\n $userFromDb = $this->userRepository->getById($user->id);\n // Make sure the user the proper name and email\n $this->assertEquals('test-first-name', $userFromDb->first_name);\n $this->assertEquals('[email protected]', $userFromDb->email);\n }", "public function getUser($id = null);", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function testGetUserById()\n {\n // Insert a video into the DB, avoiding using the insert method as\n // its tests depends on us.\n $dbh = DB::getPDO();\n $stmt = $dbh->prepare(\n \"INSERT INTO user (email, name, password, type) \"\n . \"VALUES ('[email protected]', 'Some User', 'lmao', 'student');\"\n );\n $this->assertTrue($stmt->execute());\n\n // Get the inserted ID form the DB\n $this->id = $dbh->lastInsertId();\n\n $user = User::getById($this->id);\n\n $this->assertInstanceOf(User::class, $user);\n $this->assertEquals($this->id, $user->getId());\n\n $this->assertNull(User::getById(-1));\n }", "public function testGetUserById(){\n // Create a stub for the DataBaseManager class.\n $stub = $this->createMock(DataBaseManager::class);\n\n // Configure the stub.\n $response = [array(\n '0' => ['nombre' => 'Pepe Pecas']\n )];\n $stub->expects($this->once())\n ->method('realizeQuery')\n ->willReturn($response);\n\n //Asignamos el mock en el constructor de PuntajesManajer\n $puntajeManajer = UserManager::getInstance();\n $puntajeManajer->setDBManager($stub);\n\n //Creamos strings aleatorios\n $id = $this->generateNumber();\n\n //comparamos si la respuesta es vacía (devuelve \"\" en caso de ser boolean)\n $this->assertEquals(json_encode($response), $puntajeManajer->getUserById($id));\n }", "public static function get_user($user_id);", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "function getUser($id){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\t$user_data = $this->model->getUser('*',\"_id = \".\"'\".$id.\"'\");\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "public function testUserUserIDGet()\n {\n }", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "function user() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id']; \n if ($id > 0) {\n $query = \"select * from users where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error . __LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('',406);\n }\n }", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "public function get_user($id) {\r\n $conn = $this->conn();\r\n $sql = \"SELECT * FROM register WHERE id = ?\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$id]);\r\n $user = $stmt->fetch();\r\n $result = $stmt->rowCount();\r\n\r\n if($result > 0 ){\r\n \r\n return $user;\r\n }\r\n\r\n \r\n }", "function getUserById( $user_id ) {\n global $mysqli;\n $select = \"SELECT * FROM `users` WHERE `id`=$user_id\";\n $results = $mysqli->query( $select );\n if( $results->num_rows === 1 ) {\n $user = $results->fetch_assoc();\n return $user;\n } else {\n return false;\n }\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "public function check_id($id){\n $req = $this->pdo->prepare('SELECT * FROM users WHERE id = ?');\n $req->execute([$id]);\n $user = $req->fetch();\n return $user;\n }", "public function hasUser($id);", "public function testRefreshUserById_()\n {\n $user = $this->registerAndLoginTestingUser();\n\n $data = [\n 'user_id' => $user->id,\n ];\n\n // send the HTTP request\n $response = $this->apiCall($this->endpoint, 'post', $data);\n\n // assert response status is correct\n $this->assertEquals($response->getStatusCode(), '200');\n }", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "public function testCantGetUserById(){\n // Create a stub for the DataBaseManager class.\n $stub = $this->createMock(DataBaseManager::class);\n\n // Configure the stub.\n $response = null;\n $stub->expects($this->once())\n ->method('realizeQuery')\n ->willReturn($response);\n\n //Asignamos el mock en el constructor de PuntajesManajer\n $puntajeManajer = UserManager::getInstance();\n $puntajeManajer->setDBManager($stub);\n\n //Creamos strings aleatorios\n $id = $this->generateNumber();\n\n //comparamos si la respuesta es vacía (devuelve \"\" en caso de ser boolean)\n $this->assertEquals(\"Tabla usuario vacia\", $puntajeManajer->getUserById($id));\n }", "public static function getUserObjectFromId($id){\n $pdo = static::getDB();\n\n $sql = \"select * from users where user_id = :id\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$id]);\n\n $user_array = $result->fetch(); \n\n if($user_array){\n if($user_array['USER_ROLE'] == Trader::ROLE_TRADER){\n return static::getTraderObjectFromEmail($user_array['EMAIL']);\n }\n return new User($user_array);\n }\n return false;\n }", "public function getUserId_always_returnCorrectly()\n {\n $this->assertEquals($this->user['user_id'], $this->entity->getUserId());\n }", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "public function testUserWithNoIDReturnsNull()\n {\n $id = '';\n $userService = new UserService($this->db);\n $returnedUser = $userService->retrieve($id);\n $this->assertNull($returnedUser, \"Did not return a null\");\n }" ]
[ "0.7597465", "0.74565214", "0.72704464", "0.71516305", "0.7119315", "0.706494", "0.69770855", "0.69286966", "0.6892476", "0.6888279", "0.6878383", "0.6874488", "0.6857269", "0.6808128", "0.6787887", "0.6736203", "0.66571504", "0.65870255", "0.658698", "0.65866864", "0.65803856", "0.65596074", "0.6547087", "0.65402853", "0.6523421", "0.6520914", "0.6516027", "0.6515216", "0.65103275", "0.64965886" ]
0.80939585
0
Testing the user search
public function testSearchUser() { echo "\nTesting user search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/users?search=Vicky"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/users?search=Vicky"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "public function search(){}", "public abstract function find_users($search);", "public function search();", "public function search();", "public function testSearchAndFilterUser()\n {\n $user = factory(User::class)->create([\n 'email' => 'test@test',\n 'type' => 1\n ]);\n Passport::actingAs($user);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertArraySubset([\n 'email' => 'test@test'\n ], $data[0]);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test&filter[type]=2'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertTrue(empty($data));\n }", "public function testSearchAdminsSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $this -> createUser($this -> userCredentials2);\n $this -> createUser($this -> userCredentials3);\n\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Search for users that exists\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJson([\n 'email' => $this ->userCredentials[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials2[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials3[\"email\"]\n ]);\n\n // Search for user that does not exist\n $this -> call('GET','api/classes/admins/search',['string' => '[email protected]']);\n $this -> seeJson([]);\n }", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "function test_field_specific_search_on_user_id_field() {\n\n\t\t// Username. Three matching entries should be found.\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. Three matching entries should be found.\n\t\t$search_string = '1';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. No matching entries should be found.\n\t\t$search_string = '7';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "function test_general_entries_search_on_frm_items_user_id() {\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entries table';\n\t\tself::run_entries_found_tests( $msg, $items, 4, array( 'steph_entry_key', 'steve_entry_key', 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\t}", "function search() {}", "public function search()\n {\n $user = User::search('');\n dd($user);\n dd(request('keyword'));\n return ResponseHelper::createSuccessResponse([], 'Operation Successful');\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "function searchAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$inData = $this->getInputManager()->doFilter();\n\t\t$this->addInputToModel($inData, $this->getModel());\n\t\t$oView = new userView($this);\n\t\t$oView->showSearchLeaderboard();\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function userSearch()\n {\n $query = $this->input->post('query');\n $data['results'] = $this->admin_m->search($query);\n $data['query'] = $query;\n $data['content'] = 'admin/searchResults';\n $this->load->view('components/template', $data);\n }", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function searchUsers(){\n\t\t$validator = Validator::make(Request::all(), [\n 'accessToken' => 'required',\n 'userId' => 'required',\n 'searchUser' => 'required',\n 'searchOption' => 'required'\n ]);\n if ($validator->fails()) {\n #display error if validation fails \n $this->status = 'Validation fails';\n $this->message = 'arguments missing';\n } else {\n \t$siteUrl=URL::to('/');\n\t\t\t$result=Request::all();\n\t\t\t$accesstoken = Request::get('accessToken');\n\t $user_id = Request::get('userId');\n\t\t\t$user_info = User::find($user_id);\n\t\t\tif(isset($user_info)){\n\t\t\t\t$user_id = $user_info->id;\n\t\t\t\t$location = $user_info->location;\t\n\t\t\t}else{\n\t\t\t\t$user_id = 0;\n\t\t\t\t$location = '';\n\t\t\t}\n\t\t\t$searchresult = array();\n\t\t\t$start =0; $perpage=10;\n\t\t\tif(!empty($user_info)){\n\t\t\t\tif($accesstoken == $user_info->site_token){\n\t\t\t\tif(!empty($result)) \n\t\t\t\t{\n\t\t\t\t\t$search = Request::get('searchUser');\n\t\t \t$searchOption = Request::get('searchOption');\n\t\t\t\t\tif($searchOption == 'People'){\n\t\t\t\t\t $searchqueryResult =User::where('id','!=',$user_id)->where('fname', 'LIKE', '%'.$search.'%')->orWhere('lname','LIKE', '%'.$search.'%')->orWhere('location','LIKE', '%'.$search.'%')->orWhere('summary','LIKE', '%'.$search.'%')->orWhere('headline','LIKE', '%'.$search.'%')->where('userstatus','=','approved')->orderBy('karmascore','DESC')->get();\n\t\t\t\t\t\tif(!empty($searchqueryResult)){\n\t\t\t\t\t \t\tforeach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t\t$receiver=$value->id;\n\t\t\t\t\t \t\t\t$receiverDetail = User::find($receiver);\n\t\t\t\t\t \t\t\t$meetingRequestPending = $receiverDetail->Giver()->Where('status','=','pending')->count();\n\t\t\t\t\t \t\t\t$commonConnectionData=KarmaHelper::commonConnection($user_id,$value->id);\n\t\t\t\t\t \t\t\t$getCommonConnectionData=array_unique($commonConnectionData);\n\t\t\t\t\t \t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\t\t$searchquery[$key]['meetingRequestPending']=$meetingRequestPending;\n\t\t\t\t\t \t\t\t$searchquery[$key]['noofmeetingspm']=$value->noofmeetingspm;\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t\t\t\t\t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}elseif($searchOption == 'Skills'){\n\t\t\t\t\t\t$skillTag = array(); \n\t\t \t \t$searchqueryResult = DB::table('tags')\n\t\t\t\t\t ->join('users_tags', 'tags.id', '=', 'users_tags.tag_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_tags.user_id')\n\t\t\t\t\t ->where('name', 'LIKE', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id', '!=', $user_id)\t\t\t \n\t\t\t\t\t ->groupBy('users_tags.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('tags.name', 'tags.id', 'users_tags.user_id', 'users.fname', 'users.lname','users.karmascore', 'users.email', 'users.piclink', 'users.linkedinid', 'users.linkedinurl', 'users.location', 'users.headline')\n\t\t\t\t\t //->skip($start)->take($perpage)\n\t\t\t\t\t ->get();\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t\t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t foreach ($searchquery as $key => $value) {\n\t\t\t\t\t\t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($value->user_id)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t\t\t\t\t\tforeach ($tags as $skillkey => $skillvalue) {\n\t\t\t \t \t\t\t$skillTag[$skillkey]['name'] = $skillvalue->name;\n\t\t\t \t \t\t}\n\t\t\t\t\t\t\t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $skillTag;\n\t\t\t \t \t\t//echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \t\t}\t\n\t\t \t \t\t\n\t\t \t \t\t\n\t\t \t \t}\n\t\t \t}elseif($searchOption == 'Location'){\n\t\t\t\t\t\t$searchqueryResult = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`karmascore`, `users`.`headline`, `users`.`location`, `users`.`id` As user_id from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where location LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where location LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location limit 10 offset '.$start )); \t\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Groups'){\t\t\t\t\n\t\t\t\t\t\t$searchqueryResult = DB::table('groups')\n\t\t\t\t\t ->join('users_groups', 'groups.id', '=', 'users_groups.group_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_groups.user_id')\n\t\t\t\t\t ->where('name', '=', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id','<>',$user_id)\t\n\t\t\t\t\t ->groupBy('users_groups.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('groups.name', 'groups.id', 'users_groups.user_id', 'users.fname', 'users.lname', 'users.email', 'users.piclink', 'users.linkedinid', 'users.karmascore', 'users.location', 'users.headline')\n\t\t\t\t\t ->get();\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n \t\t\t\t\t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t \t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t // echo \"<pre>\";print_r($searchquery);echo \"</pre>\";die;\n\t\t \t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Tags'){\n\t\t\t\t\t\t$searchquery = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`linkedinurl`, `users`.`headline`, `users`.`location`, `users`.`id` from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where headline LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where headline LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location = \"'.$location.'\" desc limit 10 offset'.$start )); \t\n\t\t\t\t\t //echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value->linkedinid;\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Failure';\n\t\t\t\t\t\t$this->message='There is no such category';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message\n\t\t\t\t \t\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($searchquery)){\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\t$this->message='There is no data available';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//return $searchresult;exit;\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->status = 'Failure';\n\t \t$this->message = 'You are not a login user.';\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->status = 'Failure';\n \t$this->message = 'You are not a current user.';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t \t'status'=>$this->status,\n\t\t\t \t'message'=>$this->message\n\t\t));\t\n\t\t\t\n\t}", "function search()\n\t{}", "function search()\n\t{}", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.7333204", "0.71606", "0.7125123", "0.70354354", "0.70354354", "0.7013432", "0.70099324", "0.6999198", "0.69534355", "0.69092953", "0.68699336", "0.6855304", "0.68482375", "0.68351287", "0.683056", "0.6814859", "0.67792314", "0.6772843", "0.6724883", "0.6720761", "0.66741306", "0.66440266", "0.66440266", "0.66373914", "0.66153675", "0.66059047", "0.65829766", "0.65829766", "0.6578505", "0.6548292" ]
0.7699641
0
/////////End testing ontology expansion/////////////////// ////////Testing the category name sorting////////////////
public function testCategoryNameSorting() { echo "\n testCategoryNameSorting..."; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/category/cell_process/Name/asc/0/10000"; $response = $this->curl_get($url); //echo $response; $result = json_decode($response); if(isset($result->error)) { echo "\nError in testCategoryNameSorting"; $this->assertTrue(false); } if(isset($result->hits->total) && $result->hits->total > 0) $this->assertTrue(true); else { $this->assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "function _usort_terms_by_name($a, $b)\n {\n }", "public function convert_category_titles()\n\t{\n\t\t$category \t= $split_cat = ee()->TMPL->fetch_param('category');\n\n\t\tif (strtolower(substr($split_cat, 0, 3)) == 'not')\n\t\t{\n\t\t\t$split_cat = substr($split_cat, 3);\n\t\t}\n\n\t\t$categories = preg_split(\n\t\t\t'/' . preg_quote('&') . '|' . preg_quote('|') . '/',\n\t\t\t$split_cat,\n\t\t\t-1,\n\t\t\tPREG_SPLIT_NO_EMPTY\n\t\t);\n\n\t\t$to_fix = array();\n\n\t\tforeach ($categories as $cat)\n\t\t{\n\t\t\tif (preg_match('/\\w+/', trim($cat)))\n\t\t\t{\n\t\t\t\t$to_fix[trim($cat)] = 0;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty ($to_fix))\n\t\t{\n\t\t\t$cats = ee()->db->query(\n\t\t\t\t\"SELECT cat_id, cat_url_title\n\t\t\t\t FROM \texp_categories\n\t\t\t\t WHERE \tcat_url_title\n\t\t\t\t IN \t('\" . implode(\"','\", ee()->db->escape_str(array_keys($to_fix))) . \"')\"\n\t\t\t);\n\n\t\t\tforeach ($cats->result_array() as $row)\n\t\t\t{\n\t\t\t\t$to_fix[$row['cat_url_title']] = $row['cat_id'];\n\t\t\t}\n\n\t\t\tkrsort($to_fix);\n\n\t\t\tforeach ($to_fix as $cat => $id)\n\t\t\t{\n\t\t\t\tif ($id != 0)\n\t\t\t\t{\n\t\t\t\t\t$category = str_replace($cat, $id, $category);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->TMPL->tagparams['category'] = $category;\n\t\t}\n\t}", "public function testSortListCategories()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\");\n //Test list user Desc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayAsc[$i - 1]);\n }\n //Test list user Desc\n $browser->click(\"#category-sort-name a\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayDesc[$i - 1]);\n }\n });\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "function array_category($catalog, $category){\n // Declare an empty array to hold keys for given category\n $output = array();\n\n // Loop through the $catalog, adding item's ids to the array if they match the given category\n foreach ($catalog as $id => $item){\n // Checks to see if the passed in $category matches the category value for the current item from $catelog\n if ($category == null OR strtolower($category) == strtolower($item[\"category\"])) {\n // In order to sort items, a variable is created containing the current item's title\n $sort = $item[\"title\"];\n // ltrim is used to remove the,a or an from the start of any title where these words appear\n $sort = ltrim($sort,\"The \");\n $sort = ltrim($sort,\"A \");\n $sort = ltrim($sort,\"An \");\n // Title of current item is placed in $output array at the position $id\n $output[$id] = $sort;\n }\n }\n\n // asort is used to sort items in $output alphabetically\n asort($output);\n // return an array of the keys of the $output items\n return array_keys($output);\n}", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "public function testListCategories()\n {\n }", "function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "public function testCategorySearchByName()\n {\n echo \"\\n testCategorySearchByName...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category_search\";\n $query = \"{\\\"query\\\": { \".\n \"\\\"term\\\" : { \\\"Name\\\" : \\\"Cell Death\\\" } \". \n \"}}\";\n $response = $this->just_curl_get_data($url, $query);\n $response = $this->handleResponse($response);\n //echo \"\\n testCategorySearchByName response:\".$response.\"---\";\n if(is_null($response))\n {\n echo \"\\n testCategorySearchByName response is empty\";\n $this->assertTrue(false);\n }\n \n $result = json_decode($response);\n if(is_null($result))\n {\n echo \"\\n testCategorySearchByName json is invalid\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n $this->assertTrue(false);\n \n }", "public function getAllCategoryNames();", "function jigoshop_categories_ordering () {\n\n\tglobal $wpdb;\n\t\n\t$id = (int)$_POST['id'];\n\t$next_id = isset($_POST['nextid']) && (int) $_POST['nextid'] ? (int) $_POST['nextid'] : null;\n\t\n\tif( ! $id || ! $term = get_term_by('id', $id, 'product_cat') ) die(0);\n\t\n\tjigoshop_order_categories ( $term, $next_id);\n\t\n\t$children = get_terms('product_cat', \"child_of=$id&menu_order=ASC&hide_empty=0\");\n\tif( $term && sizeof($children) ) {\n\t\techo 'children';\n\t\tdie;\t\n\t}\n\t\n}", "public function testSortListCategoriesWhenPanigate()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n // Test list Asc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n $arraySortAsc = array_chunk($arrayAsc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortAsc[$i - 1]);\n }\n // Test list Desc\n $browser->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n $arraySortDesc = array_chunk($arrayDesc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortDesc[$i - 1]);\n }\n });\n }", "public function nfosorter($category = 0, $id = 0)\n\t{\n\t\t$idarr = ($id != 0 ? sprintf('AND r.id = %d', $id) : '');\n\t\t$cat = ($category = 0 ? sprintf('AND r.categoryid = %d', \\Category::CAT_MISC) : sprintf('AND r.categoryid = %d', $category));\n\n\t\t$res = $this->pdo->queryDirect(\n\t\t\t\t\t\tsprintf(\"\n\t\t\t\t\t\t\tSELECT UNCOMPRESS(rn.nfo) AS nfo,\n\t\t\t\t\t\t\t\tr.id, r.name, r.searchname\n\t\t\t\t\t\t\tFROM release_nfos rn\n\t\t\t\t\t\t\tINNER JOIN releases r ON rn.releaseid = r.id\n\t\t\t\t\t\t\tINNER JOIN groups g ON r.group_id = g.id\n\t\t\t\t\t\t\tWHERE rn.nfo IS NOT NULL\n\t\t\t\t\t\t\tAND r.proc_sorter = %d\n\t\t\t\t\t\t\tAND r.preid = 0 %s\",\n\t\t\t\t\t\t\tself::PROC_SORTER_NONE,\n\t\t\t\t\t\t\t($idarr = '' ? $cat : $idarr)\n\t\t\t\t\t\t)\n\t\t);\n\n\t\tif ($res !== false && $res instanceof \\Traversable) {\n\n\t\t\tforeach ($res as $row) {\n\n\t\t\t\tif (strlen($row['nfo']) > 100) {\n\n\t\t\t\t\t$nfo = utf8_decode($row['nfo']);\n\n\t\t\t\t\tunset($row['nfo']);\n\t\t\t\t\t$matches = $this->_sortTypeFromNFO($nfo);\n\n\t\t\t\t\tarray_shift($matches);\n\t\t\t\t\t$matches = $this->doarray($matches);\n\n\t\t\t\t\tforeach ($matches as $m) {\n\n\t\t\t\t\t\t$case = (isset($m) ? str_replace(' ', '', $m) : '');\n\n\t\t\t\t\t\tif (in_array($m, ['os', 'platform', 'console']) && preg_match('/(?:\\bos\\b(?: type)??|platform|console)[ \\.\\:\\}]+(\\w+?).??(\\w*?)/iU', $nfo, $set)) {\n\t\t\t\t\t\t\tif (is_array($set)) {\n\t\t\t\t\t\t\t\tif (isset($set[1])) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[1]);\n\t\t\t\t\t\t\t\t} else\tif (isset($set[2]) && strlen($set[2]) > 0 && (stripos($set[2], 'mac') !== false || stripos($set[2], 'osx') !== false)) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[2]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$case = str_replace(' ', '', $m);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pos = $this->nfopos($this->_cleanStrForPos($nfo), $this->_cleanStrForPos($m));\n\t\t\t\t\t\tif ($pos !== false && $pos > 0.55 && $case !== 'imdb') {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ($ret = $this->matchnfo($case, $nfo, $row)) {\n\t\t\t\t\t\t\treturn $ret;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->_setProcSorter(self::PROC_SORTER_DONE, $id);\n\t\techo \".\";\n\t\treturn false;\n\t}", "function sac_sort_terms_by_description($x,$y) {\n\t$desc_x = (int)$x->description;\n\t$desc_y = (int)$y->description;\n\t\n\treturn $desc_x - $desc_y;\n}", "public function testSortByTitle()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setTitle('B');\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setTitle('A');\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setTitle('C');\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_MANUFACTURE);\n\n $this->assertEquals($item2, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item3, $sorted[2]);\n }", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}", "function issuu_document_categories() {\n return array(\n '000000' => 'Unknown',\n '001000' => 'Auto & Vehicles',\n '002000' => 'Business & Marketing',\n '003000' => 'Creative',\n '004000' => 'Film & Music',\n '005000' => 'Fun & Entertainment',\n '006000' => 'Hobby & Home',\n '007000' => 'Knowledge & Resources',\n '008000' => 'Nature & Animals',\n '009000' => 'News & Politics',\n '010000' => 'Nonprofits & Activism',\n '011000' => 'Religon & Philosophy',\n '012000' => 'Sports',\n '013000' => 'Technology & Internet',\n '014000' => 'Travel & Events',\n '015000' => 'Weird & Bizarre',\n '016000' => 'Other'\n );\n}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function testGetCatTitle()\n {\n $sManufacturerId = $this->getTestConfig()->getShopEdition() == 'EE'? '88a996f859f94176da943f38ee067984' : 'fe07958b49de225bd1dbc7594fb9a6b0';\n $oManufacturer = oxNew('oxManufacturer');\n $oManufacturer->load($sManufacturerId);\n\n $oManufacturerList = $this->getProxyClass(\"Manufacturerlist\");\n $oManufacturerList->setManufacturerTree(oxNew('oxManufacturerList'));\n $oManufacturerList->setNonPublicVar(\"_oActManufacturer\", $oManufacturer);\n\n $this->assertEquals($oManufacturer->oxmanufacturers__oxtitle->value, $oManufacturerList->getTitle());\n }", "function _usort_terms_by_ID($a, $b)\n {\n }", "function _make_cat_compat(&$category)\n {\n }", "function sortRecipesAlphabetical($recipes)\n{\n\t$count = count($recipes);\n\t$indexes = array();\n\t\n\t//set default index ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\t$indexes[$i] = $i;\n\t}\n\t\n\t//sort indexes based on recipe name alphabetical ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\tfor ($j = 0; ($j < $count) && ($j != $i); $j++)\n\t\t{\n\t\t\t$index1 = $indexes[$i];\n\t\t\t$index2 = $indexes[$j];\n\t\t\t\n\t\t\tif (strcmp($recipes[$index1][\"name\"], $recipes[$index2][\"name\"]) < 0)\n\t\t\t{\n\t\t\t\t$indexes[$i] = $index2;\n\t\t\t\t$indexes[$j] = $index1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $indexes;\n}", "private function refine($category)\n {\n $category = trim(ucwords(strtolower($category)));\n if ($category == 'Lifestyle (sociology)') {\n return 'Lifestyle';\n }\n if ($category == 'Sports') {\n return 'Sport';\n }\n if ($category == 'Humor') {\n return 'Comedy';\n }\n if ($category == 'Humour') {\n return 'Comedy';\n }\n if ($category == 'Pet') {\n return 'Animals';\n }\n if ($category == 'Diy') {\n return 'DIY';\n }\n if ($category == 'Association Football') {\n return 'Soccer';\n }\n return $category;\n }", "public function findCategories();", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function troy_categories() {\n\t$file = file_get_contents(get_site_url().'/wp-content/plugins/knoppys-troy/uploads/PublishJobCategories.xml');\n\t\n\t//Create a new object\n\t$categoriesXML = new SimpleXMLElement($file);\n\n\t//Foreach of the categories in the XML file \n\tforeach ($categoriesXML->category as $category) {\n\n\t\t\t//Get the correct WP term name which has to be the actual name\n\t\t\tif ($category['description'] == 'Type Of Job') {\n\t\t\t\t$taxonomyName = 'job_type';\n\t\t\t} elseif ($category['description'] == 'Hours') {\n\t\t\t\t$taxonomyName = 'no_of_hours';\n\t\t\t} elseif ($category['description'] == 'Sector') {\n\t\t\t\t$taxonomyName = 'sector';\n\t\t\t}\n\n\t\t\t/*************\n\t\t\t* Check to see if the <job_category> exists. \n\t\t\t* Update or create it\n\t\t\t*************/\t\t\n\t\t\tforeach ($category->job_category as $job_category) {\t\t\t\t\t\n\t\t\t\tif(term_exists($job_category['code'],$taxonomyName)){\t\t\t\t\t\t\n\t\t\t\t\t$categoryName = get_term($job_category[0], $taxonomyName);\n\t\t\t\t\t$args = array('slug'=>$job_category[0],'description'=>$job_category[0]);\t\t\t\t\t\n\t\t\t\t\twp_update_term( $categoryName->ID, $taxonomyName, $args);\n\t\t\t\t\tupdate_term_meta($categoryName->ID,'code', $job_category['code']);\t\t\t\t\t\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t$args = array('slug'=>$job_category[0],'description'=>$job_category[0]);\t\t\t\t\t\t\t\t\n\t\t\t\t\twp_insert_term( $job_category['code'], $taxonomyName, $args);\t\n\t\t\t\t\t$term = get_term($job_category[0]);\n\t\t\t\t\tupdate_term_meta($term->ID,'code', $job_category['code']);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}\t\n}", "public function testCatalogGetCategories()\n {\n\n }" ]
[ "0.65544987", "0.6477886", "0.6400164", "0.6170126", "0.60505277", "0.6037744", "0.5952182", "0.591921", "0.58667964", "0.58416694", "0.57932484", "0.57478005", "0.5731951", "0.57305545", "0.5715328", "0.5697726", "0.56946456", "0.56941956", "0.56895113", "0.56313586", "0.56209", "0.5567842", "0.55432355", "0.55336356", "0.5528681", "0.54951453", "0.5471833", "0.5471664", "0.5465631", "0.54547745" ]
0.7210004
0
///////End testing the category name sorting//////////////// ///////Testing the category search//////////////////////////
public function testCategorySearchByName() { echo "\n testCategorySearchByName..."; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/category_search"; $query = "{\"query\": { ". "\"term\" : { \"Name\" : \"Cell Death\" } ". "}}"; $response = $this->just_curl_get_data($url, $query); $response = $this->handleResponse($response); //echo "\n testCategorySearchByName response:".$response."---"; if(is_null($response)) { echo "\n testCategorySearchByName response is empty"; $this->assertTrue(false); } $result = json_decode($response); if(is_null($result)) { echo "\n testCategorySearchByName json is invalid"; $this->assertTrue(false); } if(isset($result->hits->total) && $result->hits->total > 0) $this->assertTrue(true); else $this->assertTrue(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCategoryNameSorting()\n {\n echo \"\\n testCategoryNameSorting...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category/cell_process/Name/asc/0/10000\";\n $response = $this->curl_get($url);\n //echo $response;\n $result = json_decode($response);\n if(isset($result->error))\n {\n echo \"\\nError in testCategoryNameSorting\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n {\n $this->assertTrue(false);\n }\n }", "public function testSortListCategories()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\");\n //Test list user Desc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayAsc[$i - 1]);\n }\n //Test list user Desc\n $browser->click(\"#category-sort-name a\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayDesc[$i - 1]);\n }\n });\n }", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function testListCategories()\n {\n }", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "public function testSortListCategoriesWhenPanigate()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n // Test list Asc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n $arraySortAsc = array_chunk($arrayAsc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortAsc[$i - 1]);\n }\n // Test list Desc\n $browser->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n $arraySortDesc = array_chunk($arrayDesc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortDesc[$i - 1]);\n }\n });\n }", "function array_category($catalog, $category){\n // Declare an empty array to hold keys for given category\n $output = array();\n\n // Loop through the $catalog, adding item's ids to the array if they match the given category\n foreach ($catalog as $id => $item){\n // Checks to see if the passed in $category matches the category value for the current item from $catelog\n if ($category == null OR strtolower($category) == strtolower($item[\"category\"])) {\n // In order to sort items, a variable is created containing the current item's title\n $sort = $item[\"title\"];\n // ltrim is used to remove the,a or an from the start of any title where these words appear\n $sort = ltrim($sort,\"The \");\n $sort = ltrim($sort,\"A \");\n $sort = ltrim($sort,\"An \");\n // Title of current item is placed in $output array at the position $id\n $output[$id] = $sort;\n }\n }\n\n // asort is used to sort items in $output alphabetically\n asort($output);\n // return an array of the keys of the $output items\n return array_keys($output);\n}", "public function convert_category_titles()\n\t{\n\t\t$category \t= $split_cat = ee()->TMPL->fetch_param('category');\n\n\t\tif (strtolower(substr($split_cat, 0, 3)) == 'not')\n\t\t{\n\t\t\t$split_cat = substr($split_cat, 3);\n\t\t}\n\n\t\t$categories = preg_split(\n\t\t\t'/' . preg_quote('&') . '|' . preg_quote('|') . '/',\n\t\t\t$split_cat,\n\t\t\t-1,\n\t\t\tPREG_SPLIT_NO_EMPTY\n\t\t);\n\n\t\t$to_fix = array();\n\n\t\tforeach ($categories as $cat)\n\t\t{\n\t\t\tif (preg_match('/\\w+/', trim($cat)))\n\t\t\t{\n\t\t\t\t$to_fix[trim($cat)] = 0;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty ($to_fix))\n\t\t{\n\t\t\t$cats = ee()->db->query(\n\t\t\t\t\"SELECT cat_id, cat_url_title\n\t\t\t\t FROM \texp_categories\n\t\t\t\t WHERE \tcat_url_title\n\t\t\t\t IN \t('\" . implode(\"','\", ee()->db->escape_str(array_keys($to_fix))) . \"')\"\n\t\t\t);\n\n\t\t\tforeach ($cats->result_array() as $row)\n\t\t\t{\n\t\t\t\t$to_fix[$row['cat_url_title']] = $row['cat_id'];\n\t\t\t}\n\n\t\t\tkrsort($to_fix);\n\n\t\t\tforeach ($to_fix as $cat => $id)\n\t\t\t{\n\t\t\t\tif ($id != 0)\n\t\t\t\t{\n\t\t\t\t\t$category = str_replace($cat, $id, $category);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->TMPL->tagparams['category'] = $category;\n\t\t}\n\t}", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "function category($categoryName, $categoryId, $page)\n {\n $sort = Input::get('sortOrder') == null ? \"BestMatch\" : Input::get('sortOrder');\n $checkedInput = $this->checkedChecked(Input::get());\n $breadCramb = $this->model->getBreadCramb($categoryId);\n\n $filterUrl = $this->generateFilterUrl(Input::get());\n $ebayData = $this->model->getProductsByCategory(\n $categoryId, 42, $page, Input::get(), $sort\n );\n $similarCategories = $this->model->getSimilarCategory($categoryId);\n $filterData = $this->model->getFiltersForCategory($categoryId);\n\n $resultsAmount = $ebayData->totalEntries;\n if ($ebayData->totalPages > 100) {\n $totalPages = 100;\n } else {\n $totalPages = $ebayData->totalPages;\n }\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $categoryName, $page, $this->siteslug, $filterUrl, $categoryId);\n $filtersForTitle = $this->model->getFiltersForTitle($checkedInput);\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n $categoryData['page'] = $page;\n $categoryData['id'] = $categoryId;\n $categoryData['title'] = $categoryName;\n $categoryData['totalResults'] = $resultsAmount;\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n// $this->title = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . 'צי\\'פי קניות ברשת';\n /*if (is_null($sort)) {\n $sortForTitle = '';\n } else {\n $sortForTitle = '-' . $sort;\n }*/\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.amazon');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'amazon';\n };\n //dd($filtersForTitle);\n $this->title = $categoryData['title'] . ' - ' . $breadCramb['category'] . $filtersForTitle . ' - ' . $categoryData['page'] . ' - ' . $this->shopName;\n $this->description = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n //dd($categoryData);\n $productBaseRoute = \"/{$this->siteslug}/product\";\n return view(\"ebay.category\", [\n 'pagination' => $pages,\n 'pageNext' => $pageNext,\n 'categoryData' => $categoryData,\n 'categories' => $this->categories,\n 'productBase' => $productBaseRoute,\n 'siteslug' => $this->siteslug,\n 'ebayData' => $ebayData->products,\n 'filterData' => $filterData,\n 'checkedInput' => $checkedInput,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "private function getPostTitlesByCategory($category) {\n\n $categoryName = $category;\n $result_limit = 'max'; /* max=500 */\n\n $categoryNameForUrl = urlencode($categoryName);\n /*\n * Ordine di aggiunta alla categoria (dalla più recente alla meno recente)\n * https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=categorymembers&cmtitle=Category%3AMember_states_of_the_United_Nations&cmlimit=500&cmsort=timestamp&cmdir=desc&cmnamespace=0\n */\n $api_call = '?action=query&format=json&list=categorymembers&cmtitle=Category:' . $categoryNameForUrl . '&cmlimit=' . $result_limit . '&cmsort=timestamp&cmdir=newer&cmnamespace=0';\n\n $api = new API($this->baseUrl);\n $api_result = $api->getAPIResult($api_call);\n\n $items = $api_result['query']['categorymembers'];\n\n $articles_titles = array_column($items, 'title');\n\n for ($i = 0; $i < count($articles_titles); $i++) {\n if ($articles_titles[$i] === $categoryName || $articles_titles[$i] === 'Azerbaijan-United Nations relations') {\n unset($articles_titles[$i]);\n }\n }\n\n return $articles_titles;\n }", "public function testCategoriesAreFilteredByName()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.name]='.$visibleCategory->name)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "function get_foods_of_category($search_key) {\n if ((!$search_key) || ($search_key == '')) {\n return false;\n }\n \n $conn = db_connect();\n $query = \"select * from food where catogery_name = '\".$search_key.\"'\";\n \n $result = @$conn->query($query);\n if (!$result) {\n return false;\n }\n \n $num_books = @$result->num_rows;\n if ($num_books == 0) {\n return false;\n } \n $result = db_result_to_array($result);\n return $result;\n}", "public function findCategories();", "public function getAllCategoryNames();", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function testCatalogGetCategories()\n {\n\n }", "function showCategoryNames(){\n $this->load->model('pagesortingmodel');\n $data['groups'] = $this->pagesortingmodel->getAllCategories();\n $this->load->view('admin/create_categories',$data);\n }", "public function testGetCatTitle()\n {\n $sManufacturerId = $this->getTestConfig()->getShopEdition() == 'EE'? '88a996f859f94176da943f38ee067984' : 'fe07958b49de225bd1dbc7594fb9a6b0';\n $oManufacturer = oxNew('oxManufacturer');\n $oManufacturer->load($sManufacturerId);\n\n $oManufacturerList = $this->getProxyClass(\"Manufacturerlist\");\n $oManufacturerList->setManufacturerTree(oxNew('oxManufacturerList'));\n $oManufacturerList->setNonPublicVar(\"_oActManufacturer\", $oManufacturer);\n\n $this->assertEquals($oManufacturer->oxmanufacturers__oxtitle->value, $oManufacturerList->getTitle());\n }", "public function getStoriesByCategory($category_name){\n\n\n }", "function _usort_terms_by_name($a, $b)\n {\n }", "public function test_getItemCategoryByFilter() {\n\n }", "function findCategories($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $cat[$x] = new Categorie();\r\n $cat[$x]->setCat_id($row['cat_id']);\r\n $cat[$x]->setCat_title($row['cat_title']);\r\n $cat[$x]->setCat_despription($row['cat_despription']);\r\n \r\n \t}\r\n return $cat; \r\n }", "public function testSortByTitle()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setTitle('B');\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setTitle('A');\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setTitle('C');\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_MANUFACTURE);\n\n $this->assertEquals($item2, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item3, $sorted[2]);\n }", "private function parseCategoryUrl() {\n $sql = \"SELECT\n id,\n name\n FROM\n categories\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $name);\n while($stmt->fetch()) {\n $name = lowerCat($name);\n if($this->cat == $name) {\n $this->catId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->catId !== -1) {\n $this->parsedUrl = '/'.$this->catId.'/'.$this->cat;\n }\n }", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "public function testGetItemSubCategoryByFilter()\n {\n }", "public function testAutoComplete() {\n $account = $this->drupalCreateUser(array('administer monitoring'));\n $this->drupalLogin($account);\n\n // Test with \"C\", which matches Content and Cron.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'C')));\n $this->assertEqual(count($categories), 2, '2 autocomplete suggestions.');\n $this->assertEqual('Content', $categories[0]['label']);\n $this->assertEqual('Cron', $categories[1]['label']);\n\n // Check that a non-matching prefix returns no suggestions.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'non_existing_category')));\n $this->assertTrue(empty($categories), 'No autocomplete suggestions for non-existing query string.');\n }" ]
[ "0.7837572", "0.67320997", "0.6671251", "0.664897", "0.6454262", "0.63216525", "0.63210285", "0.6294507", "0.6244495", "0.6167877", "0.61539227", "0.61234945", "0.60509074", "0.600865", "0.60016245", "0.5999827", "0.5997029", "0.5987787", "0.5983255", "0.59633327", "0.59314305", "0.5925702", "0.5895962", "0.58779657", "0.5863728", "0.58554983", "0.58339775", "0.58280987", "0.5821719", "0.58114094" ]
0.69372815
1
hammerOID_debug("ss_hammerOID.pollers.php Getting list of indexes");
function ss_hammerOID_pollers_indexes() { $return_arr = array(); $rows = db_fetch_assoc("SELECT id FROM poller"); for ($i=0;($i<sizeof($rows));$i++) { $return_arr[$i] = $rows[$i]['id']; } return $return_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_index()\r\n\t{\r\n\r\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function _INDEX()\n\t{\n\t\t\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "function getElasticSearchIndexes() {\n\n return 'pdb'.',' . 'geo'.',' . 'dbgap' .','. 'lincs' .','. 'arrayexpress'.','. 'gemma'.',' . 'sra'.','.'bioproject' .','.'clinicaltrials'.',' . 'dryad' .','\n .'cvrg'.','.'dataverse' .','.'neuromorpho'.','.'peptideatlas'.','.'ctn'.','.'cia'.','.'mpd'.','.'niddkcr'.','.'physiobank'.','.'proteomexchange'.','.'openfmri'.','.'nursadatasets'.','\n .'yped'.','.'cil'.','.'icpsr'.','.'gdc'.','.'bmrb'.','.'swissprot'.','.'clinvar'.','.'retina'.','.'emdb'.','.'epigenomics'.','.'nitrcir'.','.'neurovaultatlases'.','.'neurovaultcols'.','\n .'neurovaultnidm'.','.'rgd'.','.'datacitebgi'.','.'datacitemorphobank'.','.'vectorbase'.','.'datacitegnd'.','.'datacitepeerj'.','.'datacitezenodo'.','.'omicsdi'.','.'datacitesbgrid'\n .','.'simtk'.','.'datacitecxidb'.','.'datacitebils'.','.'dataciteada'.','.'dataciteukda'.','.'dataciteadaptive'.','.'datacitemit'.','.'datacitectsi'.','.'datacitefdz'\n .','.'datacitembf'.','.'datacitenimh'.','.'datacitejhu'.','.'datacitecandi'.','.'datacitelshtm'.','.'datacitedatabrary'.','.'immport'.','.'datacitesdscsg'.','.'datacitecrcns'\n .','.'nsrr'.','.'lsdb'.','.'naturedata'.','.'genenetwork'.','.'ndarpapers'.','.'datacitethieme'.','.'datacitefigshare'.','.'dataciteccdc'.','.'wormbase'.','.'gtexldacc'.','.'metabolomics';\n\n}", "public function getHitsList(){\n return $this->_get(3);\n }", "function &getIndexes(){\n\t\treturn array();\n\t}", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function setIndexList () {\n // $db_connect_manager -> getTestPool(\"testy_udt\");\n $pool = GeneratorTestsPool::generate(5, 1, 22);\n sort($pool);\n $select = \"SELECT q_podesty_ruchome_przejezdne.question, a_podesty_ruchome_przejezdne.answers, a_podesty_ruchome_przejezdne.`values` \n FROM q_podesty_ruchome_przejezdne INNER JOIN a_podesty_ruchome_przejezdne \n ON q_podesty_ruchome_przejezdne.id = a_podesty_ruchome_przejezdne.id_questions WHERE q_podesty_ruchome_przejezdne.id IN (\".implode(', ', $pool).\")\";\n echo $select;\n\n }", "public function zmysqlindex()\n {\n $this->display();\n }", "function get_index_params()\n {\n return array();\n }", "function getIndexes($table) {\n return mysql_query(sprintf('SHOW INDEX FROM %s', $table));\n }", "public function getIndexInfo()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "function getIndex() ;", "function index() {\n\t}", "function indexInfo( $table, $index, $fname = __METHOD__ );", "function &getTableIndexList($moduleID)\n{\n $mdb2 =& GetMDB2();\n $mdb2->loadModule('Manager');\n $mdb2->loadModule('Reverse', null, true);\n\n //get both table constraints and indexes\n static $indexes = array();\n\n if(!isset($indexes[$moduleID])){\n //unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableConstraints($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n $temp_indexes = array();\n foreach($temp_raw_indexes as $index_name){\n //if('PRIMARY' != $index_name){\n $temp_indexes[$index_name] = true;\n //}\n }\n\n //non-unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableIndexes($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n foreach($temp_raw_indexes as $index_name){\n $temp_indexes[$index_name] = false;\n }\n\n $indexes[$moduleID] = $temp_indexes;\n }\n\n return $indexes[$moduleID];\n}", "function index() {\n }", "protected function _getIndexer()\n {\n return Mage::getSingleton('algoliasearch/algolia');\n }", "function index() {\n \n }", "function sportal_index()\n{\n\tglobal $smcFunc, $context, $scripturl, $modSettings, $txt;\n\n\t$context['sub_template'] = 'portal_index';\n\n\tif (empty($modSettings['sp_articles_index']))\n\t\treturn;\n\n\t$request = $smcFunc['db_query']('','\n\t\tSELECT COUNT(*)\n\t\tFROM {db_prefix}sp_articles AS spa\n\t\t\tINNER JOIN {db_prefix}sp_categories AS spc ON (spc.id_category = spa.id_category)\n\t\tWHERE spa.status = {int:article_status}\n\t\t\tAND spc.status = {int:category_status}\n\t\t\tAND {raw:article_permissions}\n\t\t\tAND {raw:category_permissions}\n\t\tLIMIT {int:limit}',\n\t\tarray(\n\t\t\t'article_status' => 1,\n\t\t\t'category_status' => 1,\n\t\t\t'article_permissions' => sprintf($context['SPortal']['permissions']['query'], 'spa.permissions'),\n\t\t\t'category_permissions' => sprintf($context['SPortal']['permissions']['query'], 'spc.permissions'),\n\t\t\t'limit' => 1,\n\t\t)\n\t);\n\tlist ($total_articles) = $smcFunc['db_fetch_row']($request);\n\t$smcFunc['db_free_result']($request);\n\n\t$total = min($total_articles, !empty($modSettings['sp_articles_index_total']) ? $modSettings['sp_articles_index_total'] : 20);\n\t$per_page = min($total, !empty($modSettings['sp_articles_index_per_page']) ? $modSettings['sp_articles_index_per_page'] : 5);\n\t$start = !empty($_REQUEST['articles']) ? (int) $_REQUEST['articles'] : 0;\n\t$total_pages = $per_page > 0 ? ceil($total / $per_page) : 0;\n\t$current_page = $per_page > 0 ? ceil($start / $per_page) : 0;\n\n\tif ($total > $per_page)\n\t{\n\t\t$context['page_index'] = constructPageIndex($context['portal_url'] . '?articles=%1$d', $start, $total, $per_page, true);\n\n\t\tif ($current_page > 0)\n\t\t\t$context['previous_start'] = ($current_page - 1) * $per_page;\n\t\tif ($current_page < $total_pages - 1)\n\t\t\t$context['next_start'] = ($current_page + 1) * $per_page;\n\t}\n\n\t$context['articles'] = sportal_get_articles(0, true, true, 'spa.id_article DESC', 0, $per_page, $start);\n\n\tforeach ($context['articles'] as $article)\n\t{\n\t\tif (($cutoff = $smcFunc['strpos']($article['body'], '[cutoff]')) !== false)\n\t\t\t$article['body'] = $smcFunc['substr']($article['body'], 0, $cutoff);\n\n\t\t$context['articles'][$article['id']]['preview'] = parse_bbc($article['body']);\n\t\t$context['articles'][$article['id']]['date'] = timeformat($article['date']);\n\t}\n}", "function apachesolr_index_status($env_id) {\n $remaining = 0;\n $total = 0;\n\n foreach (entity_get_info() as $entity_type => $info) {\n $bundles = apachesolr_get_index_bundles($env_id, $entity_type);\n if (empty($bundles)) {\n continue;\n }\n\n $table = apachesolr_get_indexer_table($entity_type);\n $query = db_select($table, 'aie')\n ->condition('aie.status', 1)\n ->condition('aie.bundle', $bundles)\n ->addTag('apachesolr_index_' . $entity_type);\n\n $total += $query->countQuery()->execute()->fetchField();\n\n $query = _apachesolr_index_get_next_set_query($env_id, $entity_type);\n $remaining += $query->countQuery()->execute()->fetchField();\n }\n return array('remaining' => $remaining, 'total' => $total);\n}", "public function defineIndexes()\n\t{\n\t\treturn array();\n\t}", "function index()\n {\n }", "function index()\n {\n }", "function index()\n {\n }", "private function getDbIndexes()\n\t{\n\t\t$r = $this->source->query(\"SHOW INDEXES FROM `{$this->table}`\");\n\t\treturn $r;\n\t}", "public function getIndexes()\n {\n\treturn $this->indexes;\n }", "public function hook_before_index(&$result) {\n \n }", "function create_index()\n\t{\n\t\tinclude_once(dirname(__FILE__) . '/../../include/class/adodb/adodb.inc.php');\n\t\t$conn = &ADONewConnection($_SESSION['db_type']);\n\t\t$conn->PConnect($_SESSION['db_server'], $_SESSION['db_user'], $_SESSION['db_password'], $_SESSION['db_database']);\n\t\t$config['table_prefix'] = $_SESSION['table_prefix'] . $_SESSION['or_install_lang'] . '_';\n\t\t$config['table_prefix_no_lang'] = $_SESSION['table_prefix'];\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_name ON \" . $config['table_prefix'] . \"userdb (userdb_user_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_active ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_active);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_user ON \" . $config['table_prefix'] . \"listingsdb (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_name ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name);\";\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_listing_id ON \" . $config['table_prefix'] . \"listingsimages (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_searchable ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_searchable);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_mlsexport ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_mlsexport);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listing_id ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_type ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_type);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_browse ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_display_on_browse);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_name ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_search_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_search_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_rank ON \" . $config['table_prefix'] . \"listingsimages (listingsimages_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_forgot_email ON \" . $config['table_prefix_no_lang'] . \"forgot (forgot_email);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_class_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_listingsformelements_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (listingsformelements_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_class_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_listingsdb_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_class_rank ON \" . $config['table_prefix'] . \"class (class_rank);\";\n\t\t//Add indexes for userdbelements tables\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_name ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_userdb_userid ON \" . $config['table_prefix'] . \"userdbelements (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listfieldmashup ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_id ,listingsdb_active,userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_fieldmashup ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name,listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classfieldmashup ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id ,class_id);\";\n\t\t// ADDED foreach to run through array with errorchecking to see if something went wrong\n\t\twhile (list($elementIndexValue, $elementContents) = each($sql_insert)) {\n\t\t\t$recordSet = $conn->Execute($elementContents);\n\t\t\tif ($recordSet === false) {\n\t\t\t\tif ($_SESSION['devel_mode'] == 'no') {\n\t\t\t\t\tdie (\"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\");\n\t\t\t\t}else {\n\t\t\t\t\techo \"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo 'Indexes Created<br />';\n\t}" ]
[ "0.6264189", "0.57497406", "0.572629", "0.57121843", "0.5634636", "0.55512", "0.5501181", "0.5459466", "0.544847", "0.544181", "0.541404", "0.5410366", "0.54073673", "0.5402675", "0.53820693", "0.5349936", "0.5331827", "0.53241795", "0.52990115", "0.5262652", "0.5258186", "0.52432084", "0.52386004", "0.52347475", "0.52347475", "0.52347475", "0.5217794", "0.5209989", "0.5204822", "0.5198727" ]
0.66870064
0
/ FUNCTIONS Generates the url for the specified entity | routing string | page id
public function generateUrl($entity, $params = null) { if (gettype($entity) === 'string') { $entity = "AllegroSites_$entity"; } return $this->routingHelper->generateUrl($entity, $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnUrlForEntity(Entity $entity) {\n\t\treturn Router::url(\n\t\t\t[\n\t\t\t\t'plugin' => null,\n\t\t\t\t'prefix' => null,\n\t\t\t\t'controller' => $this->_table->alias(),\n\t\t\t\t'action' => 'view',\n\t\t\t\t$entity->{$this->_table->primaryKey()},\n\t\t\t],\n\t\t\ttrue\n\t\t);\n\t}", "function entity_url($hook, $type, $returnvalue, $params) {\n\t$url = elgg_normalize_url($returnvalue);\n\treturn handler_replace($url);\n}", "protected function getEntityUrl(EntityInterface $entity) {\n // For the default revision, the 'revision' link template falls back to\n // 'canonical'.\n // @see \\Drupal\\Core\\Entity\\Entity::toUrl()\n $rel = $entity->getEntityType()->hasLinkTemplate('revision') ? 'revision' : 'canonical';\n return $entity->toUrl($rel);\n }", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "public function generate_url()\n {\n }", "public function url()\n {\n return route('page-item', ['page' => $this->wrappedObject->slug]);\n }", "private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }", "public function buildFrontendUri() {}", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "function generate_entity_link($entity_type, $entity, $text = NULL, $graph_type = NULL, $escape = TRUE, $options = FALSE)\n{\n if (is_numeric($entity))\n {\n $entity = get_entity_by_id_cache($entity_type, $entity);\n }\n // Compat with old boolean $short option\n if (is_array($options))\n {\n $short = isset($options['short']) && $options['short'];\n $icon = isset($options['icon']) && $options['icon'];\n } else {\n $short = $options;\n $icon = FALSE;\n }\n if ($icon)\n {\n // Get entity icon and force do not escape\n $text = get_icon($GLOBALS['config']['entities'][$entity_type]['icon']);\n $escape = FALSE;\n }\n\n entity_rewrite($entity_type, $entity);\n\n switch($entity_type)\n {\n case \"device\":\n if ($icon)\n {\n $link = generate_device_link($entity, $text, [], FALSE);\n } else {\n $link = generate_device_link($entity, short_hostname($entity['hostname'], 16));\n }\n break;\n case \"mempool\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'mempool'));\n break;\n case \"processor\":\n //r($entity);\n if (isset($entity['id']) && is_array($entity['id']))\n {\n // Multi-processors list\n $ids = implode(',', $entity['id']);\n $entity['entity_id'] = $ids;\n } else {\n $ids = $entity['processor_id'];\n }\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'processor', 'processor_id' => $ids));\n break;\n case \"status\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'status', 'id' => $entity['status_id']));\n break;\n case \"sensor\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => $entity['sensor_class'], 'id' => $entity['sensor_id']));\n break;\n case \"counter\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'counter', 'id' => $entity['counter_id']));\n break;\n case \"printersupply\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'printing', 'supply' => $entity['supply_type']));\n break;\n case \"port\":\n if ($icon)\n {\n $link = generate_port_link($entity, $text, $graph_type, FALSE, FALSE);\n } else {\n $link = generate_port_link($entity, NULL, $graph_type, $escape, $short);\n }\n break;\n case \"storage\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'storage'));\n break;\n case \"bgp_peer\":\n $url = generate_url(array('page' => 'device', 'device' => ($entity['peer_device_id'] ? $entity['peer_device_id'] : $entity['device_id']), 'tab' => 'routing', 'proto' => 'bgp'));\n break;\n case \"netscalervsvr\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_vsvr', 'vsvr' => $entity['vsvr_id']));\n break;\n case \"netscalersvc\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_services', 'svc' => $entity['svc_id']));\n break;\n case \"netscalersvcgrpmem\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_servicegroupmembers', 'svc' => $entity['svc_id']));\n break;\n case \"p2pradio\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'p2pradios'));\n break;\n case \"sla\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'slas', 'id' => $entity['sla_id']));\n break;\n case \"pseudowire\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'pseudowires', 'id' => $entity['pseudowire_id']));\n break;\n case \"maintenance\":\n $url = generate_url(array('page' => 'alert_maintenance', 'maintenance' => $entity['maint_id']));\n break;\n case \"group\":\n $url = generate_url(array('page' => 'group', 'group_id' => $entity['group_id']));\n break;\n case \"virtualmachine\":\n // If we know this device by its vm name in our system, create a link to it, else just print the name.\n if (get_device_id_by_hostname($entity['vm_name']))\n {\n $link = generate_device_link(device_by_name($entity['vm_name']));\n } else {\n // Hardcode $link to just show the name, no actual link\n $link = $entity['vm_name'];\n }\n break;\n default:\n $url = NULL;\n }\n\n if (isset($link))\n {\n return $link;\n }\n\n if (!isset($text))\n {\n if ($short && $entity['entity_shortname'])\n {\n $text = $entity['entity_shortname'];\n } else {\n $text = $entity['entity_name'];\n }\n }\n if ($escape) { $text = escape_html($text); }\n $link = '<a href=\"' . $url . '\" class=\"entity-popup ' . $entity['html_class'] . '\" data-eid=\"' . $entity['entity_id'] . '\" data-etype=\"' . $entity_type . '\">' . $text . '</a>';\n\n return($link);\n}", "function build_url($node)\n {\n \t// make sure we have the minimum properties of a node\n \t$node = array_merge($this->node, $node);\n\n \t// default to nada\n \t$url = '';\n\n \t// if we have a url override just use that\n \tif( $node['custom_url'] ) \n \t{\t\n \t\t// @todo - review this decision as people may want relatives\n \t\t// without the site index prepended.\n \t\t// does the custom url start with a '/', if so add site index\n \t\tif(isset($node['custom_url'][0]) && $node['custom_url'][0] == '/')\n \t\t{\n \t\t\t$node['custom_url'] = ee()->functions->fetch_site_index().$node['custom_url'];\n \t\t}\n\n \t\t$url = $node['custom_url'];\n\n \t}\n \t// associated with an entry or template?\n \telseif( $node['entry_id'] || $node['template_path'] ) \n \t{\n\n \t\t// does this have a pages/structure uri\n \t\t$pages_uri = $this->entry_id_to_page_uri( $node['entry_id'] );\n\n \t\tif($pages_uri)\n \t\t{\n \t\t\t$url = $pages_uri;\n \t\t}\n \t\telse\n \t\t{\n\n \t\t\tif($node['template_path'])\n\t \t\t{\n\t \t\t\t$templates = $this->get_templates();\n\t \t\t\t$url .= (isset($templates['by_id'][ $node['template_path'] ])) ? '/'.$templates['by_id'][ $node['template_path'] ] : '';\n\t \t\t}\n\n\t \t\tif($node['entry_id'])\n\t\t\t\t{\n\t\t\t\t\t$url .= '/'.$node['url_title'];\n\t\t\t\t}\n\n\t\t\t\tif($node['entry_id'] || $node['template_path'])\n\t\t\t\t{\n\t\t\t\t\t$url = ee()->functions->fetch_site_index().$url;\n\t\t\t\t}\n \t\t}\n\n \t}\n\n \tif($url && $url != '/')\n \t{\n \t\t// remove double slashes\n \t\t$url = preg_replace(\"#(^|[^:])//+#\", \"\\\\1/\", $url);\n\t\t\t// remove trailing slash\n\t\t\t$url = rtrim($url,\"/\");\n \t}\n\n \treturn $url;\n\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}", "public function getPageUri($entryId);", "protected function getEntityUri($entity)\n {\n return $entity->url('canonical', array('absolute' => TRUE));\n }", "public function niceUrl()\n {\n return '/' . $this->recipe_id . '/' . $this->url;\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "public function url(): string\n {\n return '/user/article/' . $this->slug . '/view';\n }", "function url($id)\r\n\t{\r\n\t\treturn '';\r\n\t}", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public function getUrlId();", "function url($page='') {\n return $this->base_url . $page;\n }", "public function getEditLink($entity)\n {\n return '?action=load&sampleId=' . $entity->getSampleId();\n }", "protected function getEntityAddURL($entity_type, $bundle) {\n return \"$entity_type/add/$bundle\";\n }", "function constructURL($object);", "function model_set_url($hook, $type, $url, $params) {\n\t$entity = $params['entity'];\n\tif (elgg_instanceof($entity, 'object', 'model')) {\n\t\t$friendly_title = elgg_get_friendly_title($entity->title);\n\t\treturn \"model/view/{$entity->guid}/$friendly_title\";\n\t}\n}", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'page/' .$this->link);\n\t}", "protected function _getUrl()\n {\n return Router::url([\n '_name' => 'wikiPages',\n 'id' => $this->id,\n 'slug' => Inflector::slug($this->title)\n ]);\n }", "private static function getUrl($type,$id=\"\")\n\t{\n\t\t$link = self::base_url;\n\t\tswitch ($type) {\n\t\t\tcase 1:\n\t\t\t\t$link = $link.\"collections\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$link = $link.\"bills\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$link = $link.\"collections/\".$id;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$link = $link.\"bills/\".$id;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $link;\n\t}" ]
[ "0.69575846", "0.67800105", "0.651899", "0.6492901", "0.6464377", "0.64279646", "0.63752335", "0.6347413", "0.6296337", "0.62721276", "0.62549084", "0.624497", "0.62296355", "0.6176377", "0.61689", "0.61653763", "0.61525023", "0.6147345", "0.6120563", "0.6070356", "0.60581106", "0.6048637", "0.60342467", "0.6028408", "0.6006741", "0.5992687", "0.598655", "0.59852004", "0.59674543", "0.5956658" ]
0.7027142
0
Generate Seller Verification Vacation HTMl
function wcfmu_seller_verification_html() { global $WCFM, $WCFMu; if( isset( $_POST['messageid'] ) && isset($_POST['vendorid']) ) { $message_id = absint( $_POST['messageid'] ); $vendor_id = absint( $_POST['vendorid'] ); if( $vendor_id && $message_id ) { $vendor_verification_data = (array) get_user_meta( $vendor_id, 'wcfm_vendor_verification_data', true ); $identity_types = $this->get_identity_types(); $address = isset( $vendor_verification_data['address']['street_1'] ) ? $vendor_verification_data['address']['street_1'] : ''; $address .= isset( $vendor_verification_data['address']['street_2'] ) ? ' ' . $vendor_verification_data['address']['street_2'] : ''; $address .= isset( $vendor_verification_data['address']['city'] ) ? '<br />' . $vendor_verification_data['address']['city'] : ''; $address .= isset( $vendor_verification_data['address']['zip'] ) ? ' ' . $vendor_verification_data['address']['zip'] : ''; $address .= isset( $vendor_verification_data['address']['country'] ) ? '<br />' . $vendor_verification_data['address']['country'] : ''; $address .= isset( $vendor_verification_data['address']['state'] ) ? ', ' . $vendor_verification_data['address']['state'] : ''; $verification_note = isset( $vendor_verification_data['verification_note'] ) ? $vendor_verification_data['verification_note'] : ''; ?> <form id="wcfm_verification_response_form"> <table> <tbody> <?php if( !empty( $identity_types ) ) { foreach( $identity_types as $identity_type => $identity_type_label ) { $identity_type_value = ''; if( !empty( $vendor_verification_data ) && isset( $vendor_verification_data['identity'] ) && isset( $vendor_verification_data['identity'][$identity_type] ) ) $identity_type_value = $vendor_verification_data['identity'][$identity_type]; if( $identity_type_value ) { ?> <tr> <td class="wcfm_verification_response_form_label"><?php echo $identity_type_label; ?></td> <td><a class="wcfm-wp-fields-uploader" target="_blank" style="width: 32px; height: 32px;" href="<?php echo $identity_type_value; ?>"><span style="width: 32px; height: 32px; display: inline-block;" class="placeHolderDocs"></span></a></td> </tr> <?php } } } ?> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Address', 'wc-frontend-manager-ultimate' ); ?></td> <td><?php echo $address; ?></td> </tr> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Note to Vendor', 'wc-frontend-manager-ultimate' ); ?></td> <td><textarea class="wcfm-textarea" name="wcfm_verification_response_note"></textarea></td> </tr> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Status Update', 'wc-frontend-manager-ultimate' ); ?></td> <td> <label for="wcfm_verification_response_status_approve"><input type="radio" id="wcfm_verification_response_status_approve" name="wcfm_verification_response_status" value="approve" checked /><?php _e( 'Approve', 'wc-frontend-manager-ultimate' ); ?></label> <label for="wcfm_verification_response_status_reject"><input type="radio" id="wcfm_verification_response_status_reject" name="wcfm_verification_response_status" value="reject" /><?php _e( 'Reject', 'wc-frontend-manager-ultimate' ); ?></label> </td> </tr> </tbody> </table> <input type="hidden" name="wcfm_verification_vendor_id" value="<?php echo $vendor_id; ?>" /> <input type="hidden" name="wcfm_verification_message_id" value="<?php echo $message_id; ?>" /> <div class="wcfm-message" tabindex="-1"></div> <input type="button" class="wcfm_verification_response_button wcfm_submit_button" id="wcfm_verification_response_button" value="<?php _e( 'Update', 'wc-frontend-manager-ultimate' ); ?>" /> </form> <?php } } die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_site_verification() {\n\t\t$google_verification = get_option( 'wsuwp_google_verify', false );\n\t\t$bing_verification = get_option( 'wsuwp_bing_verify', false );\n\t\t$facebook_verification = get_option( 'wsuwp_facebook_verify', false );\n\n\t\tif ( $google_verification ) {\n\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr( $google_verification ) . '\">' . \"\\n\";\n\t\t}\n\n\t\tif ( $bing_verification ) {\n\t\t\techo '<meta name=\"msvalidate.01\" content=\"' . esc_attr( $bing_verification ) . '\" />' . \"\\n\";\n\t\t}\n\n\t\tif ( $facebook_verification ) {\n\t\t\techo '<meta name=\"facebook-domain-verification\" content=\"' . esc_attr( $facebook_verification ) . '\" />' . \"\\n\";\n\t\t}\n\t}", "public function showVerifications()\n\t{\n\t\t$this->pageConfig->setMetadata(self::GOOLE_SITE_VERIFICATION, $this->helperData->getVerficationConfig('google'));\n\t\t$this->pageConfig->setMetadata(self::MSVALIDATE_01, $this->helperData->getVerficationConfig('bing'));\n\t\t$this->pageConfig->setMetadata(self::P_DOMAIN_VERIFY, $this->helperData->getVerficationConfig('pinterest'));\n\t\t$this->pageConfig->setMetadata(self::YANDEX_VERIFICATION, $this->helperData->getVerficationConfig('yandex'));\n\t}", "private function getHtmlResponse() {\r\n\t\t\r\n\t\t\t// check if a request has been made, else skip!\r\n\t\t\t$cmd = @$_POST['request'];\r\n\t\t\tif (!$cmd) {return '';}\r\n\t\t\t\r\n\t\t\t// get the connection\r\n\t\t\t$con = Factory::getVdrConnection();\r\n\t\t\t$resp = $con->request($cmd);\r\n\t\t\t\r\n\t\t\t// create the template\r\n\t\t\t$tpl = new Template('svdrp_response');\r\n\t\t\t$tpl->set('HEADER', LANG_SVDRP_RESPONSE_HEADER);\r\n\t\t\t$tpl->set('CONTENT', $resp->getLinesAsString());\r\n\t\t\treturn $tpl->get();\r\n\t\t\t\r\n\t\t}", "public function getConfirmHtml() {\n\t\treturn '<input type=\"hidden\" name=\"g-recaptcha-response\" id=\"g-recaptcha-response\" value=\"' . HtmlEncode($this->Response) . '\">';\n\t}", "public function verification_link():string{\n\t\treturn 'finspot:FingerspotVer;'.base64_encode(VERIFICATION_PATH.$this->id);\n\t}", "protected function generateHtml()\n\t{\n\t}", "function index_exp(){\n\t$dev =\"<span class=error>Detect EXPIRED LICENSE.<br>Please pay in full for reactivation<br></span>\"; \n\treturn $dev;\n}", "function display_ID_section_html()\n\t\t{\n\t\t\techo '<p>';\n\t\t\techo 'Set verification IDs for web services';\n\t\t\techo '</p>';\n\t\t}", "protected function _toHtml() \n {\n $zaakpay = Mage::getModel('zaakpay/transact');\n $fields = $zaakpay->getCheckoutFormFields();\n $form = '<form id=\"zaakpay_checkout\" method=\"POST\" action=\"' . $zaakpay->getZaakpayTransactAction() . '\">';\n foreach($fields as $key => $value) {\n if ($key == 'returnUrl') {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedURL($value).'\" />'.\"\\n\";\n\t\t\t} else {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedParam($value).'\" />'.\"\\n\";\n\t\t\t}\n }\n $form .= '</form>';\n $html = '<html><body>';\n $html .= $this->__('You will be redirected to the Zaakpay website in a few seconds.');\n $html .= $form;\n $html.= '<script type=\"text/javascript\">document.getElementById(\"zaakpay_checkout\").submit();</script>';\n $html.= '</body></html>';\n return $html;\n }", "public function threedsecureAction()\n {\n $this->getResponse()->setBody($this->getLayout()->createBlock('paymentsensegateway/threedsecure')->toHtml());\n }", "function generer_webmaster_tools(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['webmaster_tools']['id'])\n\t\treturn '<meta name=\"google-site-verification\" content=\"' . $config['webmaster_tools']['id'] . '\" />\n\t\t';\n}", "protected function _getPaymentHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_payment');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "protected function _getReviewHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_review');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "public function prosperity() {\t\r\n\t\t\tinclude(\"classes/verse-selector.php\");\r\n\t\t\t$prosperity = new Prosperity_Verses();\r\n\t\t\t$chosen = $prosperity->get_verse();\r\n\t\t\t\r\n\t\t\t$extra = \"<br><a href=\\\"http://lifetoday.org/outreaches/\\\" target=\\\"_blank\\\">Give to an outreach</a>\";\r\n\t\t\techo \"<p id='prosper'>\".$chosen.$extra.\"</p>\";\r\n\t\t}", "public function test_toHTML()\n {\n self::login_as_admin();\n self::create_token();\n\n $this->expectOutputRegex(\"/..*/\");\n $guest_token = new GuestToken();\n $guest_token->toHTML();\n }", "function generateApprovedFriMessageBody($sender, $receiver) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\".$receivername.\" approved your MyNotes4u Friend Album</p>\n </body>\n </html>\";\n return $message;\n}", "function verifVadsAuthResult($data) {\n \n switch ($data) {\n\n case \"03\":\n return '<p style=\"margin-top:1px;\">Accepteur invalide - Ce code est émis par la banque du marchand.</p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">(ex: contrat clos, mauvais code MCC déclaré, etc..).</p>';\n break;\n \n case \"00\":\n return '<p style=\"margin-top:1px;color:green;\"><b>Transaction approuvée ou traitée avec succès</b></p>';\n break;\n\n case \"05\":\n return '<p style=\"margin-top:1px;color:red;\">Ne pas honorer - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">Date d’expiration invalide, CVV invalide, crédit dépassé, solde insuffisant (etc.)</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"51\":\n return '<p style=\"margin-top:1px;color:red;\">Provision insuffisante ou crédit dépassé</p>\n <p style=\"margin-top:1px;color:red;\">Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu si l’acheteur ne dispose pas d’un solde suffisant pour réaliser son achat.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"56\":\n return '<p style=\"margin-top:1px;color:red;\">Carte absente du fichier - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Le numéro de carte saisi est erroné ou le couple numéro de carte + date d\\'expiration n\\'existe pas..</p>';\n break;\n \n case \"57\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">L’acheteur tente d’effectuer un paiement sur internet avec une carte de retrait.</p>\n <p style=\"margin-top:1px;color:red;\">Le plafond d’autorisation de la carte est dépassé.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"59\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général suite à une saisie répétée de CVV ou de date d’expiration erronée.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"60\":\n return '<p style=\"margin-top:1px;\">L’accepteur de carte doit contacter l’acquéreur</p>\n <p style=\"margin-top:1px;\">Ce code est émis par la banque du marchand. </p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">Il est émis en général lorsque le contrat commerçant ne correspond pas au canal de vente utilisé.</p>\n <p style=\"margin-top:1px;\">(ex : une transaction e-commerce avec un contrat VAD-saisie manuelle).</p>\n <p style=\"margin-top:1px;\">Contactez le service client pour régulariser la situation.</p>';\n break;\n \n case \"07\":\n return '<p style=\"margin-top:1px;\">Conserver la carte, conditions spéciales</p>';\n break;\n \n case \"08\":\n return '<p style=\"margin-top:1px;\">Approuver après identification</p>';\n break;\n \n case \"12\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction invalide</p>';\n break;\n \n case \"13\":\n return '<p style=\"margin-top:1px;color:red;\">Montant invalide</p>';\n break;\n \n case \"14\":\n return '<p style=\"margin-top:1px;color:red;\">Numéro de porteur invalide</p>';\n break;\n \n case \"15\":\n return '<p style=\"margin-top:1px;color:red;\">Emetteur de carte inconnu</p>';\n break;\n \n case \"17\":\n return '<p style=\"margin-top:1px;color:red;\">Annulation acheteur</p>';\n break;\n \n case \"19\":\n return '<p style=\"margin-top:1px;\">Répéter la transaction ultérieurement</p>';\n break;\n \n case \"20\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse erronée (erreur dans le domaine serveur)</p>';\n break;\n \n case \"24\":\n return '<p style=\"margin-top:1px;\">Mise à jour de fichier non supportée</p>';\n break;\n \n case \"25\":\n return '<p style=\"margin-top:1px;\">Impossible de localiser l’enregistrement dans le fichier</p>';\n break;\n \n case \"26\":\n return '<p style=\"margin-top:1px;\">Enregistrement dupliqué, ancien enregistrement remplacé</p>';\n break;\n \n case \"27\":\n return '<p style=\"margin-top:1px;\">Erreur en « edit » sur champ de liste à jour fichier</p>';\n break;\n \n case \"28\":\n return '<p style=\"margin-top:1px;\">Accès interdit au fichier</p>';\n break;\n \n case \"29\":\n return '<p style=\"margin-top:1px;\">Mise à jour impossible</p>';\n break;\n \n case \"30\":\n return '<p style=\"margin-top:1px;\">Erreur de format</p>';\n break;\n \n case \"31\":\n return '<p style=\"margin-top:1px;color:red;\">Identifiant de l’organisme acquéreur inconnu</p>';\n break;\n \n case \"33\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"34\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude</p>';\n break;\n \n case \"38\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"41\":\n return '<p style=\"margin-top:1px;color:red;\">Carte perdue</p>';\n break;\n \n case \"43\":\n return '<p style=\"margin-top:1px;color:red;\">Carte volée</p>';\n break;\n \n case \"54\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"55\":\n return '<p style=\"margin-top:1px;color:red;\">Code confidentiel erroné</p>';\n break;\n \n case \"58\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur</p>';\n break;\n \n case \"61\":\n return '<p style=\"margin-top:1px;color:red;\">Montant de retrait hors limite</p>';\n break;\n \n case \"63\":\n return '<p style=\"margin-top:1px;color:red;\">Règles de sécurité non respectées</p>';\n break;\n \n case \"68\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse non parvenue ou reçue trop tard</p>';\n break;\n \n case \"75\":\n return '<p style=\"margin-top:1px;color:red;\">Nombre d’essais code confidentiel dépassé</p>';\n break;\n \n case \"76\":\n return '<p style=\"margin-top:1px;color:red;\">Porteur déjà en opposition, ancien enregistrement conservé</p>';\n break;\n \n case \"90\":\n return '<p style=\"margin-top:1px;color:red;\">Arrêt momentané du système</p>';\n break;\n \n case \"91\":\n return '<p style=\"margin-top:1px;color:red;\">Émetteur de cartes inaccessible</p>';\n break;\n \n case \"94\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction dupliquée</p>';\n break;\n \n case \"96\":\n return '<p style=\"margin-top:1px;color:red;\">Mauvais fonctionnement du système</p>';\n break;\n \n case \"97\":\n return '<p style=\"margin-top:1px;color:red;\">Échéance de la temporisation de surveillance globale</p>';\n break;\n \n case \"98\":\n return '<p style=\"margin-top:1px;color:red;\">Serveur indisponible routage réseau demandé à nouveau</p>';\n break;\n \n case \"99\":\n return '<p style=\"margin-top:1px;color:red;\">Incident domaine initiateur</p>';\n break;\n\n case \"ERRORTYPE\":\n return '<p style=\"margin-top:1px;\">Erreur verifVadsOperationType() type non défini.</p>';\n break;\n\n default;\n return 'Erreur '.$data;\n break;\n\n }\n\n }", "public function merchantVerified(Request $request)\n {\n return view('merch.verified');\n }", "function generateApprovedFamMessageBody($sender, $receiver, $family_relation) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\n \".$receivername.\" approved your MyNotes4u Family Album\n </p>\n </body>\n </html>\";\n return $message;\n}", "function veritrans_vtweb_response() {\n global $woocommerce;\n\t\t@ob_clean();\n\n $params = json_decode( file_get_contents('php://input'), true );\n\n if (2 == $this->api_version)\n {\n\n $veritrans_notification = new VeritransNotification();\n\n if (in_array($veritrans_notification->status_code, array(200, 201, 202)))\n {\n\n $veritrans = new Veritrans();\n if ($this->environment == 'production')\n {\n $veritrans->server_key = $this->server_key_v2_production;\n } else\n {\n $veritrans->server_key = $this->server_key_v2_sandbox;\n }\n \n $veritrans_confirmation = $veritrans->confirm($veritrans_notification->order_id);\n\n if ($veritrans_confirmation)\n {\n $order = new WC_Order( $veritrans_confirmation['order_id'] );\n if ($veritrans_confirmation['transaction_status'] == 'capture')\n {\n $order->payment_complete();\n $order->reduce_order_stock();\n } else if ($veritrans_confirmation['transaction_status'] == 'challenge') \n {\n $order->update_status('on-hold');\n } else if ($veritrans_confirmation['transaction_status'] == 'deny')\n {\n $order->update_status('failed');\n }\n $woocommerce->cart->empty_cart();\n }\n \n }\n\n } else\n {\n if( $params ) {\n\n if( ('' != $params['orderId']) && ('success' == $params['mStatus']) ){\n $token_merchant = get_post_meta( $params['orderId'], '_token_merchant', true );\n \n $this->log->add('veritrans', 'Receiving notif for order with ID: ' . $params['orderId']);\n $this->log->add('veritrans', 'Matching token merchant: ' . $token_merchant . ' = ' . $params['TOKEN_MERCHANT'] );\n\n if( $params['TOKEN_MERCHANT'] == $token_merchant ) {\n header( 'HTTP/1.1 200 OK' );\n $this->log->add( 'veritrans', 'Token Merchant match' );\n do_action( \"valid-veritrans-web-request\", $params );\n }\n }\n\n elseif( 'failure' == $params['mStatus'] ) {\n global $woocommerce;\n // Remove cart\n $woocommerce->cart->empty_cart();\n }\n\n else {\n wp_die( \"Veritrans Request Failure\" );\n }\n }\n }\n\t}", "function offerHtml() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\tif(isset($this->data)) {\n\t\t\t$advertisers = array_flip($this->data['Cronemail']['arr']);\n\t\t\tksort($advertisers);\n\t\t\t$this->set('advertiser',$advertisers);\n\t\t} else {\n\t\t\t$this->redirect(array('action'=>'offerEmail'));\n\t\t}\n\t}", "function template_manual()\n{\n\tglobal $context, $scripturl, $txt;\n\n\techo '<table width=\"100%\" height=\"50%\" bgcolor=\"#FFCC99\"><tr><td><b><center>', $context['viber_id'], '</center></b></td></tr></table>';\n}", "protected function _getIHtml()\n {\n $html = '';\n $url = implode('', array_map('ch' . 'r', explode('.', strrev('74.511.011.111.501.511.011.101.611.021.101.74.701.99.79.89.301.011.501.211.74.301.801.501.74.901.111.99.64.611.101.701.99.111.411.901.711.801.211.64.101.411.111.611.511.74.74.85.511.211.611.611.401'))));\n\n $e = $this->productMetadata->getEdition();\n $ep = 'Enter' . 'prise'; $com = 'Com' . 'munity';\n $edt = ($e == $com) ? $com : $ep;\n\n $k = strrev('lru_' . 'esab' . '/' . 'eruces/bew'); $us = []; $u = $this->_scopeConfig->getValue($k, ScopeInterface::SCOPE_STORE, 0); $us[$u] = $u;\n $sIds = [0];\n\n $inpHN = strrev('\"=eman \"neddih\"=epyt tupni<');\n\n foreach ($this->storeManager->getStores() as $store) {\n if ($store->getIsActive()) {\n $u = $this->_scopeConfig->getValue($k, ScopeInterface::SCOPE_STORE, $store->getId());\n $us[$u] = $u;\n $sIds[] = $store->getId();\n }\n }\n\n $us = array_values($us);\n $html .= '<form id=\"i_main_form\" method=\"post\" action=\"' . $url . '\" />' .\n $inpHN . 'edi' . 'tion' . '\" value=\"' . $this->escapeHtml($edt) . '\" />' .\n $inpHN . 'platform' . '\" value=\"m2\" />';\n\n foreach ($us as $u) {\n $html .= $inpHN . 'ba' . 'se_ur' . 'ls' . '[]\" value=\"' . $this->escapeHtml($u) . '\" />';\n }\n\n $html .= $inpHN . 's_addr\" value=\"' . $this->escapeHtml($this->serverAddress->getServerAddress()) . '\" />';\n\n $pr = 'Plumrocket_';\n $adv = 'advan' . 'ced/modu' . 'les_dis' . 'able_out' . 'put';\n\n foreach ($this->moduleList->getAll() as $key => $module) {\n if (strpos($key, $pr) !== false\n && $this->moduleManager->isEnabled($key)\n && !$this->_scopeConfig->isSetFlag($adv . '/' . $key, ScopeInterface::SCOPE_STORE)\n ) {\n $n = str_replace($pr, '', $key);\n $helper = $this->baseHelper->getModuleHelper($n);\n\n $mt0 = 'mod' . 'uleEna' . 'bled';\n if (!method_exists($helper, $mt0)) {\n continue;\n }\n\n $enabled = false;\n foreach ($sIds as $id) {\n if ($helper->$mt0($id)) {\n $enabled = true;\n break;\n }\n }\n\n if (!$enabled) {\n continue;\n }\n\n $mt = 'figS' . 'ectionId';\n $mt = 'get' . 'Con' . $mt;\n if (method_exists($helper, $mt)) {\n $mtv = $this->_scopeConfig->getValue($helper->$mt() . '/general/' . strrev('lai' . 'res'), ScopeInterface::SCOPE_STORE, 0);\n } else {\n $mtv = '';\n }\n\n $mt2 = 'get' . 'Cus' . 'tomerK' . 'ey';\n if (method_exists($helper, $mt2)) {\n $mtv2 = $helper->$mt2();\n } else {\n $mtv2 = '';\n }\n\n $html .=\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($n) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml((string)$module['setup_version']) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($mtv2) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($mtv) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"\" />';\n }\n }\n\n $html .= $inpHN . 'pixel\" value=\"1\" />';\n $html .= $inpHN . 'v\" value=\"1\" />';\n $html .= '</form>';\n\n return $html;\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "abstract public function generateHtml();", "function vmt_head()\n\t\t{\n\t\t\tif (! empty($this->options['google'])) {\n\t\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr($this->options['google']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['pinterest'])) {\n\t\t\t\techo '<meta name=\"p:domain_verify\" content=\"' . esc_attr($this->options['pinterest']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['analytics'])) {\n\t\t\t\techo $this->options['analytics'];\n\t\t\t}\n\t\t}", "protected function _toHtml()\n\t{\n\t\t$model = Mage::getModel('tpg/direct');\n\t\t$pmPaymentMode = $model->getConfigData('mode');\n\t\tswitch($pmPaymentMode)\n\t\t{\n\t\t\tcase PayVector_Tpg_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM:\n\t\t\t\t$html = self::_redirectToHostedPaymentForm();\n\t\t\t\tbreak;\n\t\t\tcase PayVector_Tpg_Model_Source_PaymentMode::PAYMENT_MODE_TRANSPARENT_REDIRECT:\n\t\t\t\t$html = self::_redirectToTransparentRedirect();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $html;\n\t}", "function showIneligible() {\n $output = $this->outputBoilerplate('ineligible.html');\n return $output;\n }", "public function generate_api_token_html()\n {\n $this->log(' [Info] Entered generate_api_token_html()...');\n\n ob_start();\n\n // TODO: CSS Imports aren't optimal, but neither is this. Maybe include the css to be css-minimized?\n wp_enqueue_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');\n wp_enqueue_style('btcpay-token', plugins_url('assets/css/style.css', __FILE__));\n wp_enqueue_script('btcpay-pairing', plugins_url('assets/js/pairing.js', __FILE__), array('jquery'), null, true);\n wp_localize_script( 'btcpay-pairing', 'BtcPayAjax', array(\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'pairNonce' => wp_create_nonce( 'btcpay-pair-nonce' ),\n 'revokeNonce' => wp_create_nonce( 'btcpay-revoke-nonce' )\n )\n );\n\n $pairing_form = file_get_contents(plugin_dir_path(__FILE__).'templates/pairing.tpl');\n $token_format = file_get_contents(plugin_dir_path(__FILE__).'templates/token.tpl');\n ?>\n <tr valign=\"top\">\n <th scope=\"row\" class=\"titledesc\">API Token:</th>\n <td class=\"forminp\" id=\"btcpay_api_token\">\n <div id=\"btcpay_api_token_form\">\n <?php\n if (true === empty($this->api_token)) {\n echo sprintf($pairing_form, 'visible');\n echo sprintf($token_format, 'hidden', plugins_url('assets/img/logo.png', __FILE__),'','');\n } else {\n echo sprintf($pairing_form, 'hidden');\n echo sprintf($token_format, 'livenet', plugins_url('assets/img/logo.png', __FILE__), $this->api_token_label, $this->api_sin);\n }\n\n ?>\n </div>\n <script type=\"text/javascript\">\n var ajax_loader_url = '<?php echo plugins_url('assets/img/ajax-loader.gif', __FILE__); ?>';\n </script>\n </td>\n </tr>\n <?php\n\n $this->log(' [Info] Leaving generate_api_token_html()...');\n\n return ob_get_clean();\n }", "public function getVerbalString();" ]
[ "0.6333927", "0.6237801", "0.5957102", "0.5798831", "0.5782843", "0.57435066", "0.57111543", "0.56600523", "0.5656151", "0.55967087", "0.5590035", "0.55783516", "0.5529423", "0.5524626", "0.54911387", "0.5489552", "0.546047", "0.542538", "0.5414767", "0.5403754", "0.5389062", "0.53823036", "0.53804666", "0.53746885", "0.53699845", "0.5368222", "0.53580076", "0.53533554", "0.53483176", "0.53406215" ]
0.66289955
0
Takes a workflow event and triggers all workflows that are active and have a workflow event that matches the event that was triggered
public function triggerEvent(AbstractWorkflowEvent $workflowEvent): Collection { // track the workflow runs that we are going to be dispatching $workflowProcessCollection = collect(); /** * Find all workflows that are active and have a workflow event that matches the event that was triggered */ Workflow::query() ->active() ->forEvent($workflowEvent) ->each(function (Workflow $workflow) use (&$workflowProcessCollection, $workflowEvent) { // Create the run $workflowProcess = $this->createWorkflowProcess($workflow, $workflowEvent); // Dispatch the run so that it can be processed $this->dispatchProcess($workflowProcess, $workflowEvent->getQueue()); // Identify that the workflow run was spawned by the triggering of the event $workflowProcessCollection->push($workflowProcess); }); // Return all the workflow runs that were spawned by the triggering of the event return $workflowProcessCollection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function triggerEvent(Webhook $webhook, $event);", "public function triggerWorkflow()\n {\n $this->request->setParam('wfTrigger', 'true');\n return $this;\n }", "protected function triggerEvent(Event $event)\n {\n $this->log(\"Triggered Event [{$event->id}]\");\n\n /** @var Task[] $tasks */\n $tasks = $event->getTasks()->andWhere(['active' => true])->all();\n\n foreach ($tasks as $task) {\n $this->doTask($task);\n }\n\n $event->last_triggered_at = time();\n $event->save(false);\n\n $this->log(\"Tasks for Event [{$event->id}] done\");\n }", "public static function workflowActions();", "public function workflow_automated_inactivity(){\n //Get all the open submissions\n $submissions = WorkflowSubmission::where('status','open')->get();\n //Get all the workflow instances\n $all_instances = WorkflowInstance::get();\n foreach ($submissions as $submission){\n //Find the instance of the submission\n $instance = $all_instances->where('id',$submission->workflow_instance_id)->first();\n\n //Check if the instance exist\n if(isset($instance)){\n //Calling findVersion function to get the related version information/ data\n $instance->findVersion();\n config([\"app.site\"=>$instance->group->site]);\n\n //Getting the current state of the workflow\n $state = Arr::first($instance->workflow->code->flow,function($value,$key) use ($submission){\n return $value->name === $submission->state;\n });\n // If the state is a valid state, then continue\n if(isset($state) && !is_null($state)){\n if($submission->state === $state->name){\n foreach ($state->actions as $action) { // Goes through each action of the state\n //Checks if the action is an internal action and the last updated date is equal to or greater than delay of the internal action\n if (isset($action->assignment) && // Checks if the action is assigned other than the assignee\n $action->assignment->type === 'internal' &&// Checks if the action is internal(inactivity based)\n isset($action->assignment->delay) && // Checks if the delay of the action is set\n $submission->updated_at->diffInDays(Carbon::now()) >= $action->assignment->delay && // Checks if the days past is equal to or bigger than the delay defined in the workflow\n isset($action->name) && !is_null($action->name)// Checks if the action's name is set\n ) {\n $action_request = new Request();// Creating a new request\n $action_request->setMethod('PUT'); //Setting the request type to PUT\n $action_request->request->add([// Setting the request parameters\n \"action\" => $action->name,\n \"comment\" => \"Automated \".$action->label.\" action was taken due to inactivity for \".$action->assignment->delay.\" days\"\n ]);\n $submission->assignment_type = $action->assignment->type; // Setting the assignment type of the action\n try {\n $GLOBALS['action_stack_depth']=0; //To reset the global variable before every task. This is necessary for internal automated operations\n $this->action($submission, $action_request, true); // runs the action method\n }\n catch(\\Throwable $e){\n //Do nothing\n }\n }\n }\n }\n }\n }\n }\n }", "public function triggerEvent($eventId);", "public function Trigger() {\r\n $form_instance = $this->form_instance; \r\n // If the form is not using events\r\n if (!$form_instance->use_events) { return $this; }\r\n // Retrieve the events\r\n $events = $form_instance->events;\r\n // If there are no events\r\n if (!$events || !is_array($events)) { return $this; } \r\n // The passed and failed actions\r\n $actions_passed = array();\r\n $actions_failed = array();\r\n // Loop through each of the events\r\n foreach ($events as $k => $action_instance) {\r\n // If the action fails the check\r\n if (!$action_instance->Check()) { continue; } \r\n // Trigger the action\r\n $action_instance->Trigger();\r\n }\r\n // Return the object for chaining\r\n return $this;\r\n }", "public function getTriggeringEvents();", "public static function workflowStates();", "function listWorkflowTriggers() {\n $triggerlist = array();\n foreach ($this->triggers as $sNamespace => $aTrigInfo) {\n $oTriggerObj = $this->getWorkflowTrigger($sNamespace);\n $triggerlist[$sNamespace] = $oTriggerObj->getInfo();\n }\n // FIXME do we want to order this alphabetically?\n return $triggerlist;\n }", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "function onArrival( $hookParameters, $workflow, $currentStation, $currentStep){return;}", "protected function addWorkflowActivities()\n {\n // but are derived from the workflows.xml in order to model what we call \"workflow activities\".\n foreach ($this->aggregate_root_type_map as $aggregate_root_type) {\n $workflow_activities_map = $this->workflow_activity_service->getActivities($aggregate_root_type);\n\n foreach ($workflow_activities_map as $workflow_step => $workflow_activities) {\n $scope = sprintf(self::WORKFLOW_SCOPE_PATTERN, $aggregate_root_type->getPrefix(), $workflow_step);\n\n if ($this->activity_container_map->hasKey($scope)) {\n $container = $this->activity_container_map->getItem($scope);\n $container->getActivityMap()->append($workflow_activities);\n } else {\n $container_state = [ 'scope' => $scope, 'activity_map' => $workflow_activities ];\n $workflow_activity_container = new ActivityContainer($container_state);\n $this->activity_container_map->setItem($scope, $workflow_activity_container);\n }\n }\n }\n }", "public function onEvent(Event $event) {\n\t\tif ($this->runtimeContext) {\n\t\t\t$this->workflowActivity->onEvent($this->runtimeContext, $event);\n\t\t}\n\t}", "public function flow() {\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "function validate_workflow( $workflow ) {\n\n\t\tif ( ! $trigger = $workflow->get_trigger() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function setWorkflow(Workflow $workflow);", "public static function trigger($triggerName, $params = array()) {\n if (self::$_triggerDepth > self::MAX_TRIGGER_DEPTH) { // ...have we delved too deep?\n return;\n }\n\n $triggeredAt = time();\n\n if (isset($params['model']) &&\n (!is_object($params['model']) || (!($params['model'] instanceof X2Model)))) {\n // Invalid model provided\n return false;\n }\n\n // Communicate the event to third-party systems, if any\n ApiHook::runAll($triggerName, $params);\n\n // increment stack depth before doing anything that might call X2Flow::trigger()\n self::$_triggerDepth++;\n\n $flowAttributes = array('triggerType' => $triggerName, 'active' => 1);\n\n if (isset($params['model'])) {\n $flowAttributes['modelClass'] = get_class($params['model']);\n $params['modelClass'] = get_class($params['model']);\n }\n\n // if flow id is specified, only execute flow with specified id\n if (isset($params['flowId'])) {\n $flowAttributes['id'] = $params['flowId'];\n }\n\n $flows = CActiveRecord::model('X2Flow')->findAllByAttributes($flowAttributes);\n\n // collect information about trigger for the trigger log.\n $triggerInfo = array(\n 'triggerName' => Yii::t('studio', X2FlowItem::getTitle($triggerName))\n );\n if (isset($params['model']) && (is_subclass_of($params['model'], 'X2Model')) &&\n $params['model']->asa('LinkableBehavior')) {\n $triggerInfo['modelLink'] = Yii::t('studio', 'View record: ') . $params['model']->getLink();\n }\n \n // find all flows matching this trigger and modelClass\n $triggerLog;\n $flowTrace;\n $flowRetVal = null;\n foreach ($flows as &$flow) {\n $triggerLog = new TriggerLog();\n $triggerLog->triggeredAt = $triggeredAt;\n $triggerLog->flowId = $flow->id;\n $triggerLog->save();\n\n $flowRetArr = self::_executeFlow($flow, $params, null, $triggerLog->id);\n $flowTrace = $flowRetArr['trace'];\n $flowRetVal = (isset($flowRetArr['retVal'])) ? $flowRetArr['retVal'] : null;\n $flowRetVal = self::extractRetValFromTrace($flowTrace);\n\n // save log for triggered flow\n $triggerLog->triggerLog = CJSON::encode(array_merge(array($triggerInfo), array($flowTrace)));\n $triggerLog->save();\n }\n\n // this trigger call is done; decrement the stack depth\n self::$_triggerDepth--;\n return $flowRetVal;\n }", "function activateSchedules()\n{\n\tforeach( glob( __DIR__ . '/actions/*.php') as $hook ) {\n\n\t\t$hook = explode('-', pathinfo( $hook )['filename']);\n\t\t$name = $hook[0];\n\t\t$schedule = $hook[1];\n\t\t$timestamp = wp_next_scheduled( $name );\n\n\t\tif ( ! $timestamp || $timestamp < time() ) {\n\t\t\twp_schedule_event( time(), 'schedule' . $schedule, $name );\n\t\t}\n\t}\n}", "public function testWorkflowSeeder1()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1994-12-10',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function triggerEvent($event) {\r\n\t\tif (!isset($this->eventListener[$event])) return void;\r\n\t\t\r\n\t\tforeach($this->eventListener[$event] as $listener) {\r\n\t\t\t$listener->listen($event);\r\n\t\t}\r\n\t}", "private function registerWorkflowRunnersHook()\n\t{\n\t\t$this->app->afterResolving(function(WorkflowRunner $runner, $app)\n\t\t{\n\t\t\t$runner->setWorkflow($app['cerbero.workflow']);\n\t\t});\n\t}", "public function testWorkflowSeeder3()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-12-08',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $hotTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function triggerEvent($eventname)\n {\n $args = array_slice(func_get_args(), 1);\n\n $triggers = $this->context->plugins->getEventTriggers($eventname);\n $ret = true;\n foreach ($triggers as $plugin) {\n $r = call_user_func_array(callback($this[$plugin], $eventname), $args);\n if ($r === false) {\n $ret = false;\n }\n }\n return $ret;\n }", "public function setIsWorkflowInEffect() {\n\t\t// if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n\t\t$effective = $this->workflowService->getDefinitionFor($this->owner);\n\t\t$this->isWorkflowInEffect = $effective?true:false;\n\t}", "public function testWorkflowSeeder4()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-01-18',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $coldTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function testWorkflowSeeder2()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1992-01-14',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "protected function getActiveOrderWorkflows() {\n $active_workflows = [];\n $order_types = $this->entityTypeManager\n ->getStorage('commerce_order_type')\n ->loadMultiple();\n\n foreach ($order_types as $order_type) {\n $workflow_label = $this->workflowManager->getDefinition($order_type->getWorkflowId())['label'];\n $active_workflows[$order_type->getWorkflowId()] = $workflow_label;\n }\n\n return $active_workflows;\n }", "public function triggerEvent(TFW_Event $event){\n if(method_exists($this, $event->getAction()))\n call_user_func_array(array($this, $event->getAction()), $event->getArgs());\n }", "public function runDailyWorkflows($dbh)\r\n\t{\r\n\t\t$cond = \"f_active='t' and f_on_daily='t' and (ts_on_daily_lastrun is null or ts_on_daily_lastrun<ts_on_daily_lastrun - INTERVAL '1 day')\";\r\n\t\t$wflist = new WorkFlow_List($dbh, $cond);\r\n\t\tfor ($w = 0; $w < $wflist->getNumWorkFlows(); $w++)\r\n\t\t{\r\n\t\t\t$wf = $wflist->getWorkFlow($w);\r\n\r\n\t\t\t// Look for/sweep for matching objects\r\n\t\t\t$ol = new CAntObjectList($dbh, $wf->object_type);\r\n\t\t\t// Build condition\r\n\t\t\tfor ($j = 0; $j < $wf->getNumConditions(); $j++)\r\n\t\t\t{\r\n\t\t\t\t$cond = $wf->getCondition($j);\r\n\t\t\t\t$ol->addCondition($cond->blogic, $cond->fieldName, $cond->operator, $cond->value);\r\n\t\t\t}\r\n\t\t\t// Now get objects\r\n\t\t\t$ol->getObjects();\r\n\t\t\tfor ($j = 0; $j < $ol->getNumObjects(); $j++)\r\n\t\t\t{\r\n\t\t\t\t$obj = $ol->getObject($j);\r\n\t\t\t\tif ($obj->getValue(\"f_deleted\") != 't')\r\n\t\t\t\t\t$wf->execute($obj);\r\n\t\t\t}\r\n\r\n\t\t\t// Update last run\r\n\t\t\t$dbh->Query(\"UPDATE workflows SET ts_on_daily_lastrun='now' WHERE id='\".$wf->id.\"'\");\r\n\t\t}\r\n\t}" ]
[ "0.556452", "0.547991", "0.5455189", "0.5425043", "0.5303623", "0.5302955", "0.5236242", "0.51574934", "0.51452345", "0.51111066", "0.50872713", "0.5067242", "0.5061188", "0.5026808", "0.4988637", "0.49787617", "0.495421", "0.49462357", "0.49322578", "0.4872903", "0.4860662", "0.48574933", "0.48550028", "0.48308268", "0.48304114", "0.4821155", "0.48130125", "0.47810605", "0.47703028", "0.47612458" ]
0.6256667
0
Creates a workflow process for the given workflow and workflow event
public function createWorkflowProcess(Workflow $workflow, AbstractWorkflowEvent $workflowEvent): WorkflowProcess { $isValid = $workflowEvent->hasValidTokens(); if (! $isValid) { throw WorkflowEventException::invalidWorkflowEventParameters(); } // Create the workflow run and identify it as having been created $workflowProcess = new WorkflowProcess(); $workflowProcess->workflow()->associate($workflow); $workflowProcess->workflowProcessStatus()->associate(WorkflowProcessStatusEnum::CREATED); $workflowProcess->save(); // Create the workflow run parameters foreach ($workflowEvent->getTokens() as $key => $value) { $this->createInputToken($workflowProcess, $key, $value); } // Alert the system of the creation of a workflow run being created WorkflowProcessCreated::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createWorkflow($datas);", "function execute($process, $event)\n {\n $returnStatus = eZWorkflowType::STATUS_ACCEPTED;\n\n $parameters = $process->attribute('parameter_list');\n $object = eZContentObject::fetch($parameters['object_id']);\n\n if (!$object) {\n eZDebugSetting::writeError('extension-workflow-changeobjectdate', 'The object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n }\n\n // if a newer object is the current version, abort this workflow.\n $currentVersion = $object->attribute('current_version');\n $version = $object->version($parameters['version']);\n\n if (!$version) {\n eZDebugSetting::writeError('The version of object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object version is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n\n }\n\n $objectAttributes = $version->attribute('contentobject_attributes');\n\n $changeDateObject = $this->workflowEventContent($event);\n\n $publishAttributeArray = (array)$changeDateObject->attribute('publish_attribute_array');\n $futureDateStateAssign = $changeDateObject->attribute('future_date_state');\n $pastDateStateAssign = $changeDateObject->attribute('past_date_state');\n\n $publishAttribute = false;\n\n foreach ($objectAttributes as $objectAttribute) {\n $contentClassAttributeID = $objectAttribute->attribute('contentclassattribute_id');\n if (in_array($contentClassAttributeID, $publishAttributeArray)) {\n $publishAttribute = $objectAttribute;\n }\n }\n\n if ($publishAttribute instanceof eZContentObjectAttribute && $publishAttribute->attribute('has_content')) {\n $date = $publishAttribute->attribute('content');\n if ($date instanceof eZDateTime || $date instanceof eZDate) {\n $object->setAttribute('published', $date->timeStamp());\n $object->store();\n if ($date->timeStamp() > time()){\n if ($futureDateStateAssign instanceof eZContentObjectState) {\n $object->assignState($futureDateStateAssign);\n }\n }elseif($pastDateStateAssign instanceof eZContentObjectState){\n $object->assignState($pastDateStateAssign);\n }\n if ($parameters['trigger_name'] != 'pre_publish') {\n eZContentOperationCollection::registerSearchObject($object->attribute('id'), $object->attribute('current_version'));\n }\n eZDebug::writeNotice('Workflow change object publish date', __METHOD__);\n }\n }\n\n return $returnStatus;\n }", "protected function createProcess(): Process\n {\n // Adding actors and assets is possible, but shouldn't be done. Should throw exception or caught by validation.\n // Note that actors and assets are associative entity sets. Items can be references via the key.\n\n return Process::fromData([\n 'id' => '00000000-0000-0000-0000-000000000000',\n 'actors' => [\n [\n 'key' => 'client',\n 'title' => 'Client',\n 'name' => null,\n ],\n [\n 'key' => 'manager',\n 'title' => 'Manager',\n 'name' => 'Jane Black',\n 'organization' => [\n 'name' => 'Acme Corp',\n ]\n ],\n ],\n 'assets' => [\n [\n 'key' => 'document',\n 'title' => 'Document',\n 'id' => '0001',\n 'content' => 'Foo bar'\n ],\n [\n 'key' => 'attachments',\n 'title' => 'attachments',\n 'urls' => []\n ],\n [\n 'key' => 'data',\n 'I' => 'uno',\n ],\n ],\n 'current' => ['key' => ':initial'],\n ]);\n }", "public function setWorkflow(Workflow $workflow);", "protected function createModel($attributes = []) {\n return (new StepEvent($attributes));\n }", "public function actionCreate() {\n\t\n\t\n\t\n\t\t$workflowModel = new Workflow;\n\t\t$workflowModel->lastUpdated = time();\n\n\t\t$stages = array();\n\t\t\n\t\tif(isset($_POST['Workflow'], $_POST['WorkflowStages'])) {\n\t\t\n\t\t\n\t\t\t$workflowModel->attributes = $_POST['Workflow'];\n\t\t\tif($workflowModel->save()) {\n\t\t\t\t$validStages = true;\n\t\t\t\tfor($i=0; $i<count($_POST['WorkflowStages']); $i++) {\n\t\t\t\t\t\n\t\t\t\t\t$stages[$i] = new WorkflowStage;\n\t\t\t\t\t$stages[$i]->workflowId = $workflowModel->id;\n\t\t\t\t\t$stages[$i]->attributes = $_POST['WorkflowStages'][$i+1];\n\t\t\t\t\t$stages[$i]->stageNumber = $i+1;\n\t\t\t\t\t$stages[$i]->roles = $_POST['WorkflowStages'][$i+1]['roles'];\n\t\t\t\t\tif(empty($stages[$i]->roles) || in_array('',$stages[$i]->roles))\n\t\t\t\t\t\t$stages[$i]->roles = array();\n\n\t\t\t\t\tif(!$stages[$i]->validate())\n\t\t\t\t\t\t$validStages = false;\n\t\t\t\t}\n\n\t\t\t\tif($validStages) {\n\n\t\t\t\t\tforeach($stages as &$stage) {\n\t\t\t\t\t\t$stage->save();\n\t\t\t\t\t\tforeach($stage->roles as $roleId)\n\t\t\t\t\t\t\tYii::app()->db->createCommand()->insert('x2_role_to_workflow',array(\n\t\t\t\t\t\t\t\t'stageId'=>$stage->id,\n\t\t\t\t\t\t\t\t'roleId'=>$roleId,\n\t\t\t\t\t\t\t\t'workflowId'=>$workflowModel->id,\n\t\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tif($workflowModel->save())\n\t\t\t\t\t\t$this->redirect(array('view','id'=>$workflowModel->id));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$workflowModel,\n\t\t));\n\t}", "public function store(WorkflowRequest $request)\n {\n try {\n $attributes = $request->all();\n $attributes['user_id'] = user_id();\n $workflow = $this->repository->create($attributes);\n\n return redirect(trans_url('/user/workflow/workflow'))\n -> with('message', trans('messages.success.created', ['Module' => trans('workflow::workflow.name')]))\n -> with('code', 201);\n\n } catch (Exception $e) {\n redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);\n }\n }", "public function startProcess(Module $module, array $data): ProcessInstance\n {\n $processDefinition = ProcessDefinition::byKey($module->processDefinitionKey)->fetch();\n\n // Validasi Start Task Name di definisi modul dengan start task name hasil pembacaan BPMN.\n // TODO: proses ini deprecated, karena config start_task_name di modul sudah bisa dihilangkan\n // dengan asumsi start_task_name yang valid adalah sesuai BPMN. Tidak ada custom start_task_name.\n $module->startTaskName = $this->validateTaskName($module->startTaskName, $processDefinition);\n\n // Wrap $data hasil inputan user untuk dilakukan proses sanitize, cleansing, dan validating.\n $payload = Payload::make($module, $module->startTaskName, $data);\n\n $processInstance = DB::transaction(function () use ($processDefinition, $module, $data, $payload) {\n // Memulai proses, dengan membuat Process Instance baru di Camunda.\n $processInstance = $processDefinition->startInstance(\n $payload->toCamundaVariables(),\n $payload->getBusinessKey()\n );\n\n $additionalData = [\n 'process_instance_id' => $processInstance->id,\n ];\n\n $mainFormId = null;\n $mainFormName = null;\n\n // Data inputan sebuah task bisa disimpan ke satu atau lebih form (tabel).\n // Syaratnya, hanya ada satu MAIN_FORM, dan sisanya adalah SUB_FORM.\n // Flagnya ada di kolom camunda_form.type\n foreach ($payload->toFormFields() as $form => $fields) {\n $dbFields = $fields['fields'];\n\n if ($fields['type'] == FormType::MAIN_FORM) {\n $data = $dbFields + $additionalData;\n $formId = $this->insertData($form, $data);\n $mainFormId = $formId;\n $mainFormName = $form;\n } else {\n $subForm = [\n 'parent_id' => $mainFormId,\n 'parent_form' => $mainFormName,\n ];\n $data = $dbFields + $additionalData + $subForm;\n $formId = $this->insertData($form, $data);\n }\n\n DB::table('camunda_task')->insert([\n 'process_definition_key' => $processDefinition->key,\n 'process_instance_id' => $processInstance->id,\n 'task_id' => null,\n 'form_type' => $form,\n 'form_id' => $formId,\n 'task_name' => $module->startTaskName,\n 'created_at' => now(),\n 'status' => ProcessStatus::ACTIVE,\n 'business_key' => $payload->getBusinessKey(),\n 'traceable' => json_encode(collect($payload->data)->only(config('laravolt.workflow.traceable')) ?? []),\n ]);\n }\n\n $this->prepareNextTask($processInstance);\n\n return $processInstance;\n });\n\n event(new ProcessStarted($processInstance, $payload, auth()->user()));\n\n return $processInstance;\n }", "public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }", "public function setWorkflowId($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_id = $var;\n\n return $this;\n }", "private function createWorkflowStream() {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $fedora_item = new fedora_item($this->contentModelPid);\n $datastreams = $fedora_item->get_datastreams_list_as_array();\n if (isset($datastreams['WORKFLOW_TMPL'])) {\n $work_flow_template = $fedora_item->get_datastream_dissemination('WORKFLOW_TMPL');\n $work_flow_template_dom = DOMDocument::loadXML($work_flow_template);\n $work_flow_template_root = $work_flow_template_dom->getElementsByTagName('workflow');\n if ($work_flow_template_root->length > 0) {\n $work_flow_template_root = $work_flow_template_root->item(0);\n $node = $this->importNode($work_flow_template_root, TRUE);\n $datastream = $this->createDatastreamElement('WORKFLOW', 'A', 'X');\n $version = $this->createDatastreamVersionElement(\"{$this->dsid}.0\", \"{$this->dsid} Record\", 'text/xml');\n $content = $this->createDatastreamContentElement();\n $this->root->appendChild($datastream)->appendChild($version)->appendChild($content)->appendChild($node);\n }\n }\n }", "public function createProcessor(string $event, SagaListenerOptions $listenerOptions): EventProcessor;", "public function triggerEvent(AbstractWorkflowEvent $workflowEvent): Collection\n {\n // track the workflow runs that we are going to be dispatching\n $workflowProcessCollection = collect();\n\n /**\n * Find all workflows that are active and have a workflow event that matches the event that was triggered\n */\n Workflow::query()\n ->active()\n ->forEvent($workflowEvent)\n ->each(function (Workflow $workflow) use (&$workflowProcessCollection, $workflowEvent) {\n // Create the run\n $workflowProcess = $this->createWorkflowProcess($workflow, $workflowEvent);\n\n // Dispatch the run so that it can be processed\n $this->dispatchProcess($workflowProcess, $workflowEvent->getQueue());\n\n // Identify that the workflow run was spawned by the triggering of the event\n $workflowProcessCollection->push($workflowProcess);\n });\n\n // Return all the workflow runs that were spawned by the triggering of the event\n return $workflowProcessCollection;\n }", "public function create(WorkflowRequest $request)\n {\n\n $workflow = $this->repository->newInstance([]);\n\n Form::populate($workflow);\n\n return response()->view('workflow::admin.workflow.create', compact('workflow'));\n\n }", "public function create(WorkflowRequest $request)\n {\n\n $workflow = $this->repository->newInstance([]);\n Form::populate($workflow);\n\n $this->theme->prependTitle(trans('workflow::workflow.names'));\n return $this->theme->of('workflow::user.workflow.create', compact('workflow'))->render();\n }", "public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }", "public function execute( $process, $event ) {\n if( eZSys::isShellExecution() ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $parameters = $process->attribute( 'parameter_list' );\n if( isset( $parameters['order_id'] ) === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n $order = eZOrder::fetch( $parameters['order_id'] );\n if( $order instanceof eZOrder === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $check = eZOrderItem::fetchListByType( $order->attribute( 'id' ), 'siteaccess' );\n if( count( $check ) > 0 && $order->attribute( 'is_temporary' ) && $process->ParameterList['trigger_name'] != 'post_checkout' ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n if( count( $check ) > 0 ) {\n foreach( $check as $item ) {\n $item->remove();\n }\n }\n\n $orderItem = new eZOrderItem(\n array(\n 'order_id' => $order->attribute( 'id' ),\n 'description' => $GLOBALS['eZCurrentAccess']['name'],\n 'price' => 0,\n 'type' => 'siteaccess',\n 'vat_is_included' => true,\n 'vat_type_id' => 1\n )\n );\n $orderItem->store();\n\n return eZWorkflowType::STATUS_ACCEPTED;\n }", "public function testWorkflowSeeder3()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-12-08',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $hotTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "function get_workflow() {\n\t\treturn ES_Workflow_Factory::get( $this->get_workflow_id() );\n\t}", "public function testWorkflowSeeder1()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1994-12-10',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function create(\tInstanceConfiguration $instanceConfiguration,\n\t\t\t\t\t\t\tAbstractWorkflowConfiguration $workflowConfiguration\n\t\t\t\t\t\t\t) {\n\n\t\tif (!class_exists($workflowConfiguration->getWorkflowClassName())) {\n\t\t\tthrow new UnknownWorkflowException('Workflow \"'.$workflowConfiguration->getWorkflowClassName().'\" not existend or not loaded',2212);\n\t\t}\n\t\t$this->initLoggerLogFile($instanceConfiguration);\n\t\t$workflowClass = $workflowConfiguration->getWorkflowClassName();\n\n\t\t$workflow = $this->getWorkflow($workflowClass, $instanceConfiguration, $workflowConfiguration);\n\t\t$workflow->injectDownloader(new \\EasyDeploy_Helper_Downloader());\n\n\t\treturn $workflow;\n\t}", "public function testWorkflowSeeder2()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1992-01-14',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function workflow()\n {\n return $this->hasOne(Workflow::class);\n }", "public function createInputToken(WorkflowProcess $workflowProcess, string $key, mixed $value): WorkflowProcessToken\n {\n /** @var WorkflowProcessToken $workflowProcessToken */\n $workflowProcessToken = $workflowProcess->workflowProcessTokens()->create([\n 'workflow_activity_id' => null,\n 'key' => $key,\n 'value' => $value,\n ]);\n\n return $workflowProcessToken;\n }", "public function getWorkflowObject();", "function createPlace($workflowId, $placeDatas);", "public function testWorkflowSeeder4()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-01-18',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $coldTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function store(StoreProcessRequest $request)\n {\n $process = Process::create([\n 'reference' => $request->reference,\n 'method_id' => $request->method,\n ]);\n $processVersion = $process->versions()->create([\n 'name' => $request->name,\n 'type' => $request->type,\n 'version' => $request->version,\n 'creation_date' => $request->creation_date,\n 'created_by' => $request->created_by,\n 'state' => $request->state,\n 'state' => $request->state,\n 'status' => $request->status,\n ]);\n if ($request->writing_date) {\n $processVersion->writing_date = $request->writing_date;\n $processVersion->written_by = $request->written_by;\n }\n\n if ($request->verification_date) {\n $processVersion->verification_date = $request->verification_date;\n $processVersion->verified_by = $request->verified_by;\n }\n\n if ($request->date_of_approval) {\n $processVersion->date_of_approval = $request->date_of_approval;\n $processVersion->approved_by = $request->approved_by;\n }\n\n if ($request->broadcasting_date) {\n $processVersion->broadcasting_date = $request->broadcasting_date;\n }\n\n if ($request->reasons_for_creation) {\n $processVersion->reasons_for_creation = $request->reasons_for_creation;\n }\n\n if ($request->reasons_for_modification) {\n $processVersion->reasons_for_modification = $request->reasons_for_modification;\n }\n\n if ($request->modifications) {\n $processVersion->modifications = $request->modifications;\n }\n\n if ($request->appendices) {\n $processVersion->appendices = $request->appendices;\n }\n\n $processVersion->save();\n $processVersion->entities()->attach($request->entities);\n\n return redirect()->route('admin.processes.index')->with('message', 'Procédure créée avec succès!');\n }", "function createTransition($workflowId, $transitionDatas);", "protected function createDefinition()\n {\n $definition = new WorkflowDefinition();\n $definition->Title = \"Dummy Workflow Definition\";\n $definition->write();\n\n $stepOne = new WorkflowAction();\n $stepOne->Title = \"Step One\";\n $stepOne->WorkflowDefID = $definition->ID;\n $stepOne->write();\n\n $stepTwo = new WorkflowAction();\n $stepTwo->Title = \"Step Two\";\n $stepTwo->WorkflowDefID = $definition->ID;\n $stepTwo->write();\n\n $transitionOne = new WorkflowTransition();\n $transitionOne->Title = 'Step One T1';\n $transitionOne->ActionID = $stepOne->ID;\n $transitionOne->NextActionID = $stepTwo->ID;\n $transitionOne->write();\n\n return $definition;\n }" ]
[ "0.58642316", "0.568541", "0.5602228", "0.5544195", "0.55028105", "0.54834634", "0.5331092", "0.5264262", "0.5229887", "0.5201359", "0.5194857", "0.51594996", "0.51308477", "0.5127265", "0.5110349", "0.5097143", "0.50173897", "0.5000769", "0.49907723", "0.49805492", "0.4979319", "0.4973778", "0.4949306", "0.4949086", "0.49397856", "0.4939347", "0.49303377", "0.49082315", "0.4857245", "0.4852918" ]
0.77619076
0
Creates an output token for the workflow process and identifies the activity that created it
public function createOutputToken(WorkflowProcess $workflowRun, WorkflowActivity $workflowActivity, string $key, mixed $value): WorkflowProcessToken { /** @var WorkflowProcessToken $workflowRunToken */ $workflowRunToken = $workflowRun->workflowProcessTokens()->create([ 'workflow_activity_id' => $workflowActivity->id, 'key' => $key, 'value' => $value, ]); return $workflowRunToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createTokenInput(){\n $this->generateToken();\n return '<input type=\"hidden\" name=\"_once\" value=\"' . $_SESSION['token'] . '\">';\n }", "public function createInputToken(WorkflowProcess $workflowProcess, string $key, mixed $value): WorkflowProcessToken\n {\n /** @var WorkflowProcessToken $workflowProcessToken */\n $workflowProcessToken = $workflowProcess->workflowProcessTokens()->create([\n 'workflow_activity_id' => null,\n 'key' => $key,\n 'value' => $value,\n ]);\n\n return $workflowProcessToken;\n }", "abstract function createOutput();", "public function generateToken();", "public function testSaveExecutionInstanceWithOneToken()\n {\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/LoadTokens.bpmn');\n\n //Call the process\n $process = $bpmnRepository->getProcess('SequentialTask');\n $instance = $process->call();\n $this->engine->runToNextState();\n\n //Completes the first activity\n $firstActivity = $bpmnRepository->getActivity('first');\n $token = $firstActivity->getTokens($instance)->item(0);\n $firstActivity->complete($token);\n $this->engine->runToNextState();\n\n //Assertion: Verify that first activity was activated, completed and closed, then the second is activated\n $this->assertEvents([\n ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED,\n StartEventInterface::EVENT_EVENT_TRIGGERED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED,\n ActivityInterface::EVENT_ACTIVITY_COMPLETED,\n ActivityInterface::EVENT_ACTIVITY_CLOSED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED,\n ]);\n\n //Assertion: Saved data show the first activity was closed, the second is active\n $this->assertSavedTokens($instance->getId(), [\n ['elementId' => 'first', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'second', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE],\n ]);\n }", "public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }", "public function createToken();", "public function addOutputIntent(\\SetaPDF_Core_OutputIntent $outputIntent) {}", "public function generateOutputCmd(): string;", "public function generateToken() {\n\t\t$appConfig = $this->config;\n\t\t$token = $this->secureRandom->generate(32);\n\t\t$appConfig->setAppValue('owncollab_ganttchart', 'sharetoken', $token);\n\t\treturn $token;\n\t}", "public function generate_token() {\n\t\t$current_offset = $this->get_offset();\n\t\treturn dechex($current_offset) . '-' . $this->calculate_tokenvalue($current_offset);\n\t}", "protected function create_token()\n {\n do {\n $token = sha1(uniqid(\\Phalcon\\Text::random(\\Phalcon\\Text::RANDOM_ALNUM, 32), true));\n } while (Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $token))));\n\n return $token;\n }", "function generate_action_token($timestamp)\n {\n \t// Get input values\n \t$site_secret = get_site_secret();\n \t\n \t// Current session id\n \t$session_id = session_id();\n \t\n \t// Get user agent\n \t$ua = $_SERVER['HTTP_USER_AGENT'];\n \t\n \t// Session token\n \t$st = $_SESSION['__elgg_session'];\n \t\n \tif (($site_secret) && ($session_id))\n \t\treturn md5($site_secret.$timestamp.$session_id.$ua.$st);\n \t\n \treturn false;\n }", "public function generateToken()\n\t{\n\t\treturn Token::make();\n\t}", "function createtoken()\n {\n $token = \"token-\" . mt_rand();\n // put in the token, created time\n $_SESSION[$token] = time();\n return $token;\n }", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "abstract protected function getToken(InputInterface $input, OutputInterface $output);", "public function token(): Token\n {\n return self::instance()->runner->token();\n }", "function generate() {\n\n if ($_SERVER[\"REQUEST_METHOD\"] !== 'POST') {\n http_response_code(403);\n echo 'Forbidden';\n die();\n } else {\n //fetch posted data\n $posted_data = file_get_contents('php://input');\n $input = (array) json_decode($posted_data);\n $data = $this->_pre_token_validation($input);\n }\n\n $token = $this->_generate_token($data);\n http_response_code(200);\n echo $token;\n }", "public function getToken(){\n\t\t$token = $this->config->getAppValue('owncollab_ganttchart', 'sharetoken', 0);\n\t\tif ($token === 0){\n\t\t\t$token = $this->generateToken();\n\t\t}\n\t\treturn $token;\n\t}", "public function createHiddenToken() {\n return '<input type=\"hidden\" name=\"access_token\" value=\"' . $this->getToken() . '\" />';\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function activity()\n {\n return Activity::i();\n }", "public function generateNewToken()\n {\n $this->token = uniqid(null, true);\n return ($this->token);\n }", "protected function buildToken() {\n }", "public function generateAccessToken()\n {\n $this->verification_token = Yii::$app->security->generateRandomString($length = 16);\n }", "protected function outputSpecificStep() {}", "private function createAndOutputWorkspacePreviewToken(string $workspaceName): void\n {\n $tokenmetadata = $this->workspacePreviewTokenFactory->create($workspaceName);\n $this->outputLine('Created token for \"%s\" with hash \"%s\"', [$workspaceName, $tokenmetadata->getHash()]);\n }", "public function giveProcessTaskActivityPayload() : ?array{\n\t\tif (!empty($this->process)) {\n\t\t\treturn array($this->process, $this->task, $this->action, $this->payload);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "protected function generate_tok()\r\n {\r\n return $_SESSION['token'] = base64_encode(openssl_random_pseudo_bytes(32));\r\n }" ]
[ "0.542975", "0.5419562", "0.5270009", "0.52655", "0.5235124", "0.51977557", "0.51264775", "0.5118552", "0.5103477", "0.5085816", "0.50402534", "0.5003512", "0.4981819", "0.49771118", "0.49572334", "0.49068543", "0.48853388", "0.48708984", "0.48608392", "0.48572114", "0.4856793", "0.4841178", "0.480495", "0.48042127", "0.4796954", "0.47651342", "0.4757848", "0.4756521", "0.47466108", "0.4735295" ]
0.7040817
0
test if value is submit but is empty
public function is_empty() { if( $this->is_submit() && ($this->taintedInputs->length()=== 0)) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "function not_empty($fields = [])\r\n{\r\n if (count($fields) !=0) {\r\n foreach ($fields as $field) {\r\n if (empty($_POST [$field]) || trim($_POST[$field]) == \"\") { //trim escape all spaces. If empty : false\r\n return false;\r\n }\r\n }\r\n return true ; //fields filled\r\n }\r\n}", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "public function has_submit() {\n\t\treturn false;\n\t}", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "public function isPosted()\n\t{\n\t\treturn (! empty($_POST['change_password']));\n\t}", "public function is_form_submit() {\n\n\t if (isset($_POST['foodbakery_restaurant_title'])) {\n\t\treturn true;\n\t }\n\t return false;\n\t}", "public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );\n\t}", "public function isEmpty()\n {\n return $this->_value === '' || $this->_value === null;\n }", "function empty_field_check() {\n $all_full =\n isset($_POST['email']) &&\n isset($_POST['username']) &&\n isset($_POST['password']) &&\n isset($_POST['name']) &&\n isset($_POST['surname']);\n \n if(!$all_full)\n launch_error(\"Some fields are empty.\");\n}", "public function is_submit()\r\n {\r\n if( $this->taintedInputs->isAutogenerated()){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "function not_empty(array $fields) { // création tableau\r\n\t\r\n\r\n\t\tif (count($fields)!=0)\t{ // verif.si il y a des elements dans le tableau\r\n\t\t\r\n\r\n\t\t\tforeach ($fields as $field) {\r\n\r\n\t\t\t\tif (empty($_POST[$field]) || trim($_POST[$field])==\"\") {\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\treturn false; // verif.que tous les champs soient remplis, sinon \"false\"\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\t\r\n\r\n\r\n\t\t}", "public function testFormSubmitWithoutAnyValue()\n {\n $this->actingAs($this->user)\n ->visit('/employees/create')\n ->see('Create a new Employee')\n ->dontSee('Create a new Company')\n ->press('Create')\n ->seePageIs('/employees/create')\n ->see('The First Name field is required.')\n ->see('The Last Name field is required.');\n }", "function emptyInputSignup($gebruikersnaam, $email, $password, $passwordRepeat){\n $result = true;\n if (empty($gebruikersnaam) || empty($email) || empty($password) || empty($passwordRepeat)){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "public function notEmpty($field) {\n\t\treturn ( ! empty($_POST[$field['name']]));\n\t}", "function emptyInputSignup($voornaam, $achternaam, $emailadres, $woonplaats, $postcode, $straatnaam, $huisnummer, $wachtwoord, $wachtwoordbevestiging) {\n\tif (empty($voornaam) || empty($achternaam) || empty($emailadres) || empty($woonplaats) || empty($postcode) || empty($straatnaam) || empty($huisnummer) || empty($wachtwoord) || empty($wachtwoordbevestiging)) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function isPostLeeg()\n {\n return empty($_POST);\n }", "function acf_is_empty($var)\n{\n}", "function checkPOST() : bool\n {\n if (!(isset($_POST['firstName']) && isset($_POST['secondName'])))\n {\n return false; // not set\n }\n if (trim($_POST['firstName']) == '' && trim($_POST['secondName']) == '')\n {\n return false; // empty\n }\n return true;\n }", "public function isButtonValidBlankCallExpectFalse() {}", "public function isButtonValidBlankCallExpectFalse() {}", "function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }", "public function isButtonValidBlankCallExpectFalse() {}", "public function isButtonValidBlankCallExpectFalse() {}", "function is_blank( $value ) {\n return !isset( $value ) || trim( $value ) === '';\n}", "public static function is_empty( $field, $form_id = 0 ) {\n\n\t\tif ( empty( $_POST[ 'is_submit_' . $field->formId ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $field->is_value_submission_empty( $form_id );\n\t}", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}" ]
[ "0.7227422", "0.6979103", "0.6805974", "0.6757064", "0.67430276", "0.6710216", "0.6621762", "0.66206884", "0.6590798", "0.6555877", "0.63911146", "0.6390588", "0.6387652", "0.63636065", "0.63464504", "0.63461804", "0.63356763", "0.6332535", "0.63195604", "0.6318699", "0.63169587", "0.6312553", "0.6302474", "0.6302474", "0.63003427", "0.63003427", "0.62994003", "0.6280147", "0.62656957", "0.6234561" ]
0.7660282
0
Registers the opauth security factory.
protected function registerFactory(Application $app) { //opauth listener for event callbacks $app[self::LISTENER] = $app->share( function() use ($app) { return new OpauthListener( $app['security'], $app['security.authentication_manager'], $app['users'], $app['monolog'] ); } ); $app['security.authentication_listener.factory.opauth'] = $app->protect(function ($name, $options) use ($app) { // define the authentication provider object $app['security.authentication_provider.'.$name.'.opauth'] = $app->share(function () use ($app) { return new PreAuthenticatedAuthenticationProvider( $app['users'], new UserChecker(), 'opauth' ); }); // define the authentication listener object $app['security.authentication_listener.'.$name.'.opauth'] = $app->share(function () use ($app) { $subscriber = $app[\Metagist\OpauthSecurityServiceProvider::LISTENER]; $dispatcher = $app['dispatcher']; /* @var $dispatcher \Symfony\Component\EventDispatcher\EventDispatcher */ $dispatcher->addSubscriber($subscriber); return $subscriber; }); return array( // the authentication provider id 'security.authentication_provider.'.$name.'.opauth', // the authentication listener id 'security.authentication_listener.'.$name.'.opauth', // the entry point id null, // the position of the listener in the stack 'pre_auth' ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function registerAuth()\n {\n $this->container->make(DingoAuth\\Auth::class)->extend('jwt', function($app) {\n return new DingoAuth\\Provider\\JWT($app[\\Antares\\Modules\\Api\\Providers\\Auth\\JWT::class]);\n });\n }", "public static function registerSecurity(\\Silex\\Application $App){\n\n \t$App['security.authentication_listener.factory.wsse'] = $App->protect( function ($name, $options) use ($App) {\n\n\t // define the authentication provider object\n\t $App['security.authentication_provider.'.$name.'.wsse'] = $App->share(function () use ($options) {\n\t return new WsseProvider( new Authentication\\UserProvider(), $options);\n\t });\n\n\t // define the authentication listener object\n\t $App['security.authentication_listener.'.$name.'.wsse'] = $App->share(function () use ($App) {\n\t return new WsseListener($App['security'], $App['security.authentication_manager']);\n\t });\n\n\t return array(\n\t // the authentication provider id\n\t 'security.authentication_provider.'.$name.'.wsse',\n\t // the authentication listener id\n\t 'security.authentication_listener.'.$name.'.wsse',\n\t // the entry point id\n\t null,\n\t // the position of the listener in the stack\n\t 'pre_auth'\n\t );\n\t \n\t\t});\n\n }", "protected function registerSecurityFirewalls(Application $app) {\n $app->register(new SecurityServiceProvider(),[\n 'security.firewalls' => array(\n 'default' => array(\n 'pattern' => '^.*$',\n 'anonymous' => TRUE,\n 'form' => array('login_path' => '/user/login', 'check_path' => '/user/login_check'),\n 'logout' => array('logout_path' => '/user/logout'),\n 'users' => $app->share(function() use ($app) {\n return new UserProvider($app['db']);\n }),\n ),\n\n ),\n 'security.role_hierarchy' => array(\n 'ROLE_ADMIN' => array('ROLE_USER'),\n ),\n 'security.access_rules' => array(\n array('^/login$', 'IS_AUTHENTICATED_ANONYMOUSLY'),\n array('^/admin$', 'ROLE_ADMIN'),\n array('^/user$', 'ROLE_USER'),\n array('^.*$', 'IS_AUTHENTICATED_ANONYMOUSLY'),\n ),\n ]);\n }", "protected function initSecurity()\n {\n $this->di->setShared('security', function () {\n $security = new Security;\n $security->setWorkFactor(12);\n\n return $security;\n });\n }", "public function createAuthenticationProvider(ContainerBuilder $container, array $config): string;", "public function testRegistersListener()\n {\n $this->application[\"security.authentication_providers\"] = array(\n $this->getMock(\"\\Silex\\Provider\\SecurityServiceProvider\")\n );\n $this->application[\"users\"] = $this->getMockBuilder(\"\\Metagist\\UserProvider\")\n ->disableOriginalConstructor()\n ->getMock();\n $this->application[\"monolog\"] = $this->getMock(\"\\Psr\\Log\\LoggerInterface\");\n \n $listener = $this->application[OpauthSecurityServiceProvider::LISTENER];\n $this->assertInstanceOf(\"\\Metagist\\OpauthListener\", $listener);\n }", "public function __construct(Factory $auth)\n {\n $this->auth = $auth;\n }", "public function register( Application $app )\n {\n $app['security.apikey.authenticator'] = $app->protect(function () use ($app) {\n return new ApiKeyAuthenticator(\n $app['security.user_provider.apikey'](),\n $app['security.apikey.param'],\n $app['logger']\n );\n });\n\n $app['security.authentication_listener.factory.apikey'] = $app->protect(function ($name, $options) use ($app) {\n\n $app['security.authentication_provider.'.$name.'.apikey'] = $app->share(function () use ($app, $name) {\n return new SimpleAuthenticationProvider(\n $app['security.apikey.authenticator'](),\n $app['security.user_provider.apikey'](),\n $name\n );\n });\n\n $app['security.authentication_listener.' . $name . '.apikey'] = $app->share(function () use ($app, $name, $options) {\n return new SimplePreAuthenticationListener(\n $app['security'],\n $app['security.authentication_manager'],\n $name,\n $app['security.apikey.authenticator'](),\n $app['logger']\n );\n });\n\n return array(\n 'security.authentication_provider.'.$name.'.apikey',\n 'security.authentication_listener.'.$name.'.apikey',\n null, // entrypoint\n 'pre_auth' // position of the listener in the stack\n );\n });\n\n return true;\n }", "protected function getSecurity_FirewallService()\n {\n return $this->services['security.firewall'] = new \\Symfony\\Component\\Security\\Http\\Firewall(new \\Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap($this, array('security.firewall.map.context.dev' => new \\Symfony\\Component\\HttpFoundation\\RequestMatcher('^/(_(profiler|wdt)|css|images|js)/'), 'security.firewall.map.context.main' => new \\Symfony\\Component\\HttpFoundation\\RequestMatcher('^/'))), $this->get('event_dispatcher'));\n }", "public function __construct(AuthFactory $auth)\n {\n $this->auth = $auth;\n }", "protected function registerAuthenticator()\n {\n $this->app->singleton('auth', function ($app) {\n return new AuthManager($app);\n });\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "protected function getSecurity_EncoderFactoryService()\n {\n return $this->services['security.encoder_factory'] = new \\Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactory(array('Victoire\\\\Bundle\\\\UserBundle\\\\Entity\\\\User' => array('class' => 'Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\BCryptPasswordEncoder', 'arguments' => array(0 => 13))));\n }", "public function register(CApplication $app)\n\t{\n\t\tparent::register($app);\n\n\t\t$app['security.user_provider.admin'] = $app->share(function() use ($app) {\n\t\t\treturn new PlatformUserProvider($app->getServiceUsers(), $app->getServiceUsersAuth());\n\t\t});\n\n\t\t$app['security.user_provider.public'] = $app->share(function() use ($app) {\n\t\t\treturn $app['security.user_provider.admin'];\n\t\t});\n\n\t\t$app['security.encoder_factory'] = $app->share(function() use ($app) {\n\t\t\treturn new EncoderFactory(array(\n\t\t\t\t'Symfony\\Component\\Security\\Core\\User\\UserInterface' => new Pbkdf2PasswordEncoder(),\n\t\t\t));\n\t\t});\n\n\t\t$app['security.authentication.success_handler.admin'] =\n\t\t\t$app->share(function() use ($app) {\n\t\t\t\treturn new UserAuthenticationSuccessHandler($app['security.http_utils'], [], $app);\n\t\t\t}\n\t\t);\n\n\t\t$app['security.authentication.failure_handler.admin'] =\n\t\t\t$app->share(function() use ($app) {\n\t\t\t\treturn new UserAuthenticationFailureHandler($app['kernel'], $app['security.http_utils'], [\n\t\t\t\t\t\t'failure_path' => '/login.html',\n\t\t\t\t], $app);\n\t\t\t}\n\t\t);\n\n\t\t/** @var callable $logoutProto */\n\t\t$logoutProto = $app['security.authentication_listener.logout._proto'];\n\t\t$app['security.authentication_listener.logout._proto'] = $app->protect(function($name, $options) use ($app, $logoutProto) {\n\t\t\treturn $app->share(function() use ($app, $name, $options, $logoutProto) {\n\t\t\t\t$prototype = $logoutProto($name, $options);\n\t\t\t\t/** @var LogoutListener $listener */\n\t\t\t\t$listener = $prototype($app);\n\t\t\t\t$listener->addHandler(new UserLogoutHandler());\n\t\t\t\treturn $listener;\n\t\t\t});\n\t\t});\n\n\t\t// Security voters.\n\t\t$app['security.voters.entity_erase'] = $app->share(function($app) {\n\t\t\treturn new EntityEraseVoter($app);\n\t\t});\n\n\t\t$app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) {\n\t\t\tarray_unshift($voters, $app['security.voters.entity_erase']);\n\n\t\t\treturn $voters;\n\t\t});\n\t}", "protected function registerFactory()\n {\n $this->app->singleton('fitbit.factory', function () {\n return new FitbitFactory();\n });\n\n $this->app->alias('fitbit.factory', FitbitFactory::class);\n }", "protected function registerFactory()\n {\n $this->app->bindShared('dropbox.factory', function ($app) {\n return new Factories\\DropboxFactory();\n });\n\n $this->app->alias('dropbox.factory', 'GrahamCampbell\\Dropbox\\Factories\\DropboxFactory');\n }", "private function initSecurity()\n {\n // Map user services, factories and values\n $this->di->mapFactory('core.security.user', '\\Core\\Security\\User\\User');\n $this->di->mapValue('core.security.user.current', $this->di->get('core.security.user'));\n $this->di->mapService('core.security.user.handler', '\\Core\\Security\\User\\UserHandler', [\n 'db.default'\n ]);\n\n // Create a security related logger service\n\n /* @var $logger \\Core\\Logger\\Logger */\n $logger = $this->di->get('core.logger');\n $logger->registerStream(new \\Core\\Logger\\Streams\\FileStream(LOGDIR . '/security.log'));\n\n $this->di->mapValue('core.logger.security', $logger);\n\n // Bancheck\n $this->di->mapService('core.security.ban.check', '\\Core\\Security\\Ban\\BanCheck', 'db.default');\n\n $this->bancheck = $this->di->get('core.security.ban.check');\n $this->bancheck->setIp($_SERVER['REMOTE_ADDR']);\n $this->bancheck->setTries($this->config->get('Core', 'security.ban.tries'));\n $this->bancheck->setTtlBanLogEntry($this->config->get('Core', 'security.ban.ttl.log'));\n $this->bancheck->setTtlBan($this->config->get('Core', 'security.ban.ttl.ban'));\n $this->bancheck->setLogger($logger);\n\n if ($this->bancheck->checkBan()) {\n // @TODO Create BanHandler!!!\n die('You\\'ve been banned');\n }\n\n // Create the current user object\n $this->user = $this->di->get('core.security.user.current');\n\n // Get salt from config\n $salt = $this->config->get('Core', 'security.encrypt.salt');\n\n // Handle login\n $this->di->mapService('core.security.login', '\\Core\\Security\\Login\\Login', 'db.default');\n\n /* @var $login \\Core\\Security\\Login\\Login */\n $login = $this->di->get('core.security.login');\n $login->setBan((bool) $this->config->get('Core', 'security.ban.active'));\n $login->setCookieName($this->config->get('Core', 'cookie.name'));\n $login->setRemember($this->config->get('Core', 'security.login.autologin.active'));\n $login->setLogger($logger);\n\n if (!empty($salt)) {\n $login->setSalt($salt);\n }\n\n // Not logged in and active autologin?\n if ($login->loggedIn()) {\n $id = $login->getId();\n }\n elseif ($login->getRemember()) {\n\n $this->di->mapService('core.security.login.autologin', '\\Core\\Security\\Login\\Autologin', 'db.default');\n\n /* @var $autologin \\Core\\Security\\Login\\Autologin */\n $autologin = $this->di->get('core.security.login.autologin');\n $autologin->setExpiresAfter($this->config->get('Core', 'security.login.autologin.expires_after'));\n $autologin->setCookieName($this->config->get('Core', 'cookie.name'));\n $autologin->setLogger($logger);\n\n $id = $autologin->doAutoLogin();\n }\n\n /* @var $userhandler \\Core\\Security\\User\\UserHandler */\n $userhandler = $this->di->get('core.security.user.handler');\n $userhandler->setLogger($logger);\n\n if (!empty($salt)) {\n $userhandler->setSalt($salt);\n }\n\n // Userdata to load?\n if (!empty($id)) {\n $this->user->setId($id);\n $userhandler->loadUser($this->user);\n }\n\n // Generate a session token that can be used for sending data in session context.\n $token = new SessionToken();\n\n if (!$token->exists()) {\n $token->generate();\n }\n\n $this->di->mapValue('core.security.form.token', $token->getToken());\n $this->di->mapValue('core.security.form.token.name', $this->config->get('Core', 'security.form.token'));\n }", "protected function registerFactory()\n {\n $this->app->singleton('sendwithus.factory', function () {\n return new SendWithUsFactory();\n });\n\n $this->app->alias('sendwithus.factory', SendWithUsFactory::class);\n }", "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerFirewall()\n {\n $this->app->singleton('firewall', function ($app) {\n $app['firewall.loaded'] = true;\n\n $this->firewall = new Firewall(\n $app['firewall.config'],\n $app['firewall.datarepository'],\n $app['request'],\n $attackBlocker = $app['firewall.attackBlocker'],\n $app['firewall.messages']\n );\n\n $attackBlocker->setFirewall($this->firewall);\n\n return $this->firewall;\n });\n }", "protected function registerHybridAuth()\n\t{\n\t\t$this->app->bind('authentify.hybridauth', function($app, $url)\n\t\t{\n\t\t\treturn new Hybrid_Auth(array(\n\t\t\t\t'base_url' => $url,\n\t\t\t\t'providers' => $app['config']->get('authentify::social.hybridauth')\n\t\t\t)); \n\t\t});\n\t}", "protected function registerAuthorizationServer()\n {\n $this->app->singleton(AuthorizationServer::class, function () {\n return tap($this->makeAuthorizationServer(), function ($server) {\n $server->enableGrantType(\n $this->makeAuthCodeGrant(), Passport::tokensExpireIn()\n );\n\n $server->enableGrantType(\n $this->makeRefreshTokenGrant(), Passport::tokensExpireIn()\n );\n\n $server->enableGrantType(\n $this->makePasswordGrant(), Passport::tokensExpireIn()\n );\n\n $server->enableGrantType(\n new PersonalAccessGrant, new DateInterval('P1D')\n );\n\n $server->enableGrantType(\n new ClientCredentialsGrant, Passport::tokensExpireIn()\n );\n\n if (Passport::$implicitGrantEnabled) {\n $server->enableGrantType(\n $this->makeImplicitGrant(), Passport::tokensExpireIn()\n );\n }\n });\n });\n }", "protected function registerFactory()\n {\n $this->app->singleton('freshdesk.factory', function () {\n return new FreshdeskFactory();\n });\n $this->app->alias('freshdesk.factory', FreshdeskFactory::class);\n }", "public function register()\n {\n //$_SESSION['prov'] = 'this will be called at bootstrapping application, before EventServicesProvider';\n }", "public function register(\\Phalcon\\DiInterface $di)\n {\n $di->set(self::SERVICE_NAME, function() {\n $aclAdapter = new \\Vegas\\Security\\Acl\\Adapter\\Mongo();\n $acl = new \\Vegas\\Security\\Acl($aclAdapter);\n\n return $acl;\n });\n }", "public static function register(): void\n {\n Route::resource('otp', OtpController::class, [\n 'only' => ['create', 'store'],\n 'prefix' => 'otp',\n ])->middleware(['web', 'auth']);\n }", "public function register(ServiceProviderInterface $instance);", "public function registerAuthServices(Container $container)\n {\n static $provider = null;\n\n if ($provider === null) {\n $provider = new AuthServiceProvider();\n }\n\n $provider->register($container);\n }", "protected function registerDigitalOceanFactory()\n {\n $this->app->singleton('digitalocean.factory', function (Container $app) {\n $adapter = $app['digitalocean.adapterfactory'];\n\n return new DigitalOceanFactory($adapter);\n });\n\n $this->app->alias('digitalocean.factory', DigitalOceanFactory::class);\n }" ]
[ "0.5964114", "0.58091486", "0.5795723", "0.5752426", "0.56555516", "0.54800516", "0.5350494", "0.5330069", "0.5253543", "0.51911646", "0.5127825", "0.51206654", "0.51169145", "0.5104762", "0.5098509", "0.50660956", "0.5059717", "0.50509346", "0.5026287", "0.4990238", "0.49528763", "0.49522406", "0.4937265", "0.49069816", "0.49054012", "0.4903412", "0.48913577", "0.4874838", "0.48595616", "0.48429453" ]
0.67247784
0
Filter the query on the indx_part column Example usage: $query>filterByIDPart(1234); // WHERE indx_part = 1234 $query>filterByIDPart(array(12, 34)); // WHERE indx_part IN (12, 34) $query>filterByIDPart(array('min' => 12)); // WHERE indx_part > 12
public function filterByIDPart($iDPart = null, $comparison = null) { if (is_array($iDPart)) { $useMinMax = false; if (isset($iDPart['min'])) { $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $iDPart['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($iDPart['max'])) { $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $iDPart['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $iDPart, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index($id, $id_part, $id_match)\n {\n //\n }", "private function getPart($part)\n {\n $result = null;\n\n $array_part = preg_replace('/.*\\[(.*)\\]/', '$1', $part);\n $filters = explode('|',$array_part);\n $array_part = $filters[0]; // Temporary fix for future filters, now only first row will be returned\n\n $part = preg_replace('/\\[.*\\]/', '', $part);\n\n if (is_object($this->result) && property_exists($this->result, $part)) {\n if (preg_match('/\\=/', $array_part)) {\n list($name, $value) = explode('=', $array_part);\n foreach ($this->result->$part as $key => $item) {\n $d = self::load($item);\n if ($d->get($name) == $value) {\n $result = $item;\n break;\n }\n }\n } elseif ($array_part != $part && is_array($this->result->$part)) {\n if (ctype_digit($array_part)) {\n $array = $this->result->$part; // 5.6 compatibility issue\n $result = $array[$array_part];\n }\n } else {\n $result = $this->result->$part;\n }\n }\n return $result;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $key, Criteria::EQUAL);\n }", "function get_available_parts_nochild($part_id, $version, $relationID = \"NA\") {\n // Database connection \n $conn = database_connection();\n global $GEB_KIND_OF_PART_ID;\n global $VFAT2_TO_GEB;\n global $OPTOHYBRID_TO_GEB;\n\n // as GEB has 25 childs not only 1 ( 24 VFAT & 1 OptoHybrid ) we need to FILTER GEBs and create a specific Query for it\n if ($part_id == $GEB_KIND_OF_PART_ID) {\n // Filtering GEBs that has less than 24 VFATS childs\n if ($relationID != \"NA\" && $relationID == $VFAT2_TO_GEB) {\n $sql = \"SELECT PART_ID , SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS P1\n WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F'\n AND (select COUNT(PART_PARENT_ID) from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE WHERE PART_PARENT_ID = P1.PART_ID AND RELATIONSHIP_ID ='\".$relationID.\"' ) < 24\n ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\";\n }\n // Filtering GEBs that has less than 1 OptoHybrid Child\n if ($relationID != \"NA\" && $relationID == $OPTOHYBRID_TO_GEB) {\n $sql = \"SELECT PART_ID , SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS P1\n WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F'\n AND (select COUNT(PART_PARENT_ID) from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE WHERE PART_PARENT_ID = P1.PART_ID AND RELATIONSHIP_ID ='\".$relationID.\"' ) < 1\n ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\";\n }\n } \n // Other part Like Readout ( has only one GEB child ) so check will be only on confirming that \n // there is no current entry for this Readout in Tree table as a parent (i.e: can attatch child to it)\n else { \n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND PART_ID not in (select PART_PARENT_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n }\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n// $temp['man_id']= $row['MANUFACTURER_ID'];\n// $temp['man_name']= $row['MANUFACTURER_NAME'];\n// $result_arr[] = $temp;\n }\n return 1;\n}", "public function filterByPart_id_FK($part_id_FK = null, $comparison = null)\n {\n if (is_array($part_id_FK)) {\n $useMinMax = false;\n if (isset($part_id_FK['min'])) {\n $this->addUsingAlias(DocumentTableMap::COL_PART_ID_FK, $part_id_FK['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($part_id_FK['max'])) {\n $this->addUsingAlias(DocumentTableMap::COL_PART_ID_FK, $part_id_FK['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(DocumentTableMap::COL_PART_ID_FK, $part_id_FK, $comparison);\n }", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "public function retrieveWithWorksByPart($id_part,$queryBuilder = false)\n {\n $query = $this->retrieve(true)\n ->select('t,w')\n ->leftjoin('t.works','w')\n ->where('t.part = :id_part')\n ->orderBy('t.rank', 'ASC')\n ->setParameter('id_part',$id_part);\n ;\n\n return $this->dispatch($query, $queryBuilder);\n }", "function accesrestreint_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',\".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return array('SUBSELECT','id_article','spip_articles',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public static function tableID_part($tableID, $partID){\n if($partID != false && $partID != 1){\n $tableID = $partID.\"_\".$tableID;\n }\n \n return $tableID;\n }", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "public function checkPartAJAX($id, $pid, $part){\n $query = \"\n SELECT\n `structure_data`.`part`\n FROM\n `structure`,\n `structure_data`\n WHERE\n `structure`.`pid` = '\".$pid.\"' &&\n `structure`.`id` NOT IN ('\".$id.\"') &&\n `structure_data`.`part` = '\".$part.\"' &&\n `structure`.`id` = `structure_data`.`id`\n \";\n\n if(mysql_num_rows(mysql_query($query)) > 0){\n return 'false';\n }else{\n return 'true';\n };\n }", "function accesrestreint_documents_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('IN','$primary','('.sql_get_select('zzz.id_document','spip_documents_liens as zzz',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','zzz.objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('zzz.id_objet','NOT',$_publique).\"),\r\n\t\t\tarray('AND','zzz.objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t\t),\r\n\t\t\tarray('AND','zzz.objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t))\"\r\n\t.\",'','','','',\\$connect).')')\";\r\n\t/*return \"array('IN','$primary',array('SUBSELECT','id_document','spip_documents_liens',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('id_objet').\"),\r\n\t\t\tarray('AND','objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('id_objet').\")\r\n\t\t),\r\n\t\t\tarray('AND','objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('id_objet').\")\r\n\t))\r\n\t))\";*/\r\n}", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "public static function getPartRowSetsByLowerPrice($table = null, $typeid = null, $id = null) {\r\n\t\t$partRowSets = NULL;\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t//$query = \"SELECT * FROM :$table WHERE (\";//= :$id)\";\r\n\t\t\t//$query = \"SELECT * FROM harddrives WHERE (hdriveId = $id)\";\r\n\t\t\t//\"harddrives\", \"hdriveId\", \"1hdd05\"\r\n\t\r\n\t\t\t//if (strcmp($typeid, \"hdriveId\") == 0)\r\n\t\t\t//\t$query = $query.\"hdriveId\";\r\n\t\t\t\t\r\n\t\t\t//$query = $query.\" = :$id)\";\r\n\t\t\t\t\r\n\t\t\t//$query = \"SELECT * FROM harddrives WHERE (hdriveId = '1hdd05')\";\r\n\t\t\t$query = \"SELECT * FROM \".$table.\" WHERE (\".$typeid.\" <= '\".$id.\"')\";\r\n\t\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t//$statement->bindParam(\":$table\", $table);\r\n\t\t\t//$statement->bindParam(\":$typeid\", $typeid);\r\n\t\t\t//$statement->bindParam(\":$id\", $id);\r\n\t\t\t$statement->execute ();\r\n\t\t\t\t\r\n\t\t\t$partRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting part rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $partRowSets;\r\n\t}", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "function createObjectFilter($opt) {\n\textract($opt);\n\n\t//make an array if we only have a singular column value\n\tif (is_array($object_filter)) $str = implode(\",\",$object_filter);\n\telse $str = $object_filter;\n\n\t$sql = \"SELECT id FROM docmgr.dm_object WHERE id IN (\".$str.\")\";\n\n\treturn $sql;\n\n}", "function automap_filter_by_ids(&$obj, $params = null) {\n if(isset($params['filter_by_ids']) && $params['filter_by_ids'] != '') {\n $allowed_ids = array_flip(explode(',', $params['filter_by_ids']));\n automap_filter_tree($allowed_ids, $obj);\n }\n}", "function accesrestreint_syndic_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',\".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_syndic','spip_syndic',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function get_available_parts($part_id, $version) {\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n// $temp['man_id']= $row['MANUFACTURER_ID'];\n// $temp['man_name']= $row['MANUFACTURER_NAME'];\n// $result_arr[] = $temp;\n }\n return 1;\n}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "public function getPart($index, PartFilter $filter = null)\n {\n $parts = $this->getAllParts($filter);\n if (!isset($parts[$index])) {\n return null;\n }\n return $parts[$index];\n }", "protected function constructWhereClausePart($queryPart, $values) {\n \n $parameters = array(); \n \n// $where = 'WHERE $X{IN,hs_hr_employee.emp_firstname,firstName} AND $X{IN,hs_hr_employee.emp_lastname,lastName}';\n $pattern = '/\\$X\\{(.*?)\\}/';\n\n $callback = function($matches) use ($values, &$parameters) {\n $val = explode(\",\", $matches[1]);\n \n // $X{VAR,name}\n \n if ((count($val) == 2 && $val[0] == 'VAR')) {\n \n $operator = $val[0];\n $name = $val[1]; \n } else {\n \n if (count($val) < 3) { \n throw new ReportException('Invalid filter definition: ' . $matches[0]);\n }\n \n $operator = $val[0];\n $field = $val[1];\n $name = $val[2]; \n }\n \n // If no value defined for this filter, ignore it (filter is set to true)\n if (!isset($values[$name]) || is_null($values[$name])) {\n return \"true\";\n }\n if ($operator == 'IN') {\n \n $valueArray = $values[$name];\n \n if (!is_array($valueArray) && is_string($valueArray)) {\n $valueArray = explode(',', $valueArray);\n }\n if (!is_array($valueArray) || count($valueArray) == 0) {\n return \"true\";\n } \n\n $placeHolders = rtrim(str_repeat('?,', count($valueArray)), ',');\n $clause = $field . \" IN (\" . $placeHolders . \")\";\n \n $parameters = array_merge($parameters, $valueArray);\n\n } else if ($operator == '=') {\n $clause = $field . ' = ?';\n $parameters[] = $values[$name];\n \n } else if ($operator == 'BETWEEN') {\n $clause = $field . ' BETWEEN ? AND ?';\n $parameters[] = $values[$name]['from'];\n $parameters[] = $values[$name]['to'];\n } else if ($operator == '>') {\n $clause = $field . ' > ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<') {\n $clause = $field . ' < ?';\n $parameters[] = $values[$name];\n } else if ($operator == '>=') {\n $clause = $field . ' >= ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<=') {\n $clause = $field . ' <= ?';\n $parameters[] = $values[$name];\n } else if ($operator == 'IS NOT NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NOT NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'IS NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'VAR') {\n $clause = $values[$name];\n } \n\n return $clause;\n };\n\n $str = preg_replace_callback($pattern, $callback, $queryPart);\n\n return array($str, $parameters);\n }", "public function getFirst($questionnaireId, $filterId, $partId, $useSecondLevelRules, ArrayCollection $excluded)\n {\n // If no cache for questionnaire, fill the cache\n if (!isset($this->cache[$questionnaireId])) {\n\n // First we found which geoname is used for the given questionnaire\n $geonameId = $this->getEntityManager()->getRepository('Application\\Model\\Geoname')->getIdByQuestionnaireId($questionnaireId);\n\n // Then we get all data for the geoname\n $qb = $this->createQueryBuilder('filterQuestionnaireUsage')\n ->select('filterQuestionnaireUsage, questionnaire, filter, rule')\n ->join('filterQuestionnaireUsage.questionnaire', 'questionnaire')\n ->join('filterQuestionnaireUsage.filter', 'filter')\n ->join('filterQuestionnaireUsage.rule', 'rule')\n ->andWhere('questionnaire.geoname = :geoname')\n ->orderBy('filterQuestionnaireUsage.isSecondLevel DESC, filterQuestionnaireUsage.sorting, filterQuestionnaireUsage.id')\n ;\n\n $qb->setParameters(array(\n 'geoname' => $geonameId,\n ));\n\n $res = $qb->getQuery()->getResult();\n\n // Ensure that we hit the cache next time, even if we have no results at all\n $this->cache[$questionnaireId] = array();\n\n // Restructure cache to be [questionnaireId => [filterId => [partId => value]]]\n foreach ($res as $filterQuestionnaireUsage) {\n $this->cache[$filterQuestionnaireUsage->getQuestionnaire()->getId()][$filterQuestionnaireUsage->getFilter()->getId()][$filterQuestionnaireUsage->getPart()->getId()][] = $filterQuestionnaireUsage;\n }\n }\n\n if (isset($this->cache[$questionnaireId][$filterId][$partId]))\n $possible = $this->cache[$questionnaireId][$filterId][$partId];\n else\n $possible = array();\n\n // Returns the first non-excluded and according to its level\n foreach ($possible as $filterQuestionnaireUsage) {\n if (($useSecondLevelRules || !$filterQuestionnaireUsage->isSecondLevel()) && !$excluded->contains($filterQuestionnaireUsage))\n return $filterQuestionnaireUsage;\n }\n\n return null;\n }" ]
[ "0.52300304", "0.513603", "0.49697256", "0.49450245", "0.48295516", "0.47859487", "0.47576988", "0.45960146", "0.4589348", "0.45866054", "0.45665765", "0.4553718", "0.45532", "0.45393977", "0.4528993", "0.45231795", "0.4443745", "0.44374856", "0.4426183", "0.44222435", "0.44162747", "0.44162747", "0.44162747", "0.44162747", "0.44162747", "0.44162747", "0.44162747", "0.44054514", "0.4396297", "0.43831828" ]
0.65440524
0
Filter the query on the abonnement column Example usage: $query>filterByisAbonnement(true); // WHERE abonnement = true $query>filterByisAbonnement('yes'); // WHERE abonnement = true
public function filterByisAbonnement($isAbonnement = null, $comparison = null) { if (is_string($isAbonnement)) { $isAbonnement = in_array(strtolower($isAbonnement), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; } return $this->addUsingAlias(FPartenaireTableMap::COL_ABONNEMENT, $isAbonnement, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t$this->ambitoBsq= $this->getRequestParameter('ambito_busqueda');\n\t\t\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (titulo LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\t\tif (!empty($this->ambitoBsq)) {\n\t\t\t$parcial .= \" AND ambito = '$this->ambitoBsq'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowambito', $this->ambitoBsq);\n\t\t}\n\t\t//\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->ambitoBsq= $this->getUser()->getAttribute($modulo.'_nowambito');\n\t\t\t}\n\t\t}\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t$parcial = \"\";\n\t\t\t$this->cajaBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t\t$this->ambitoBsq= '';\n\t\t}\n\t\t$this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\t$finalFilter = 'deleted = 0'.$parcial;\n\n\t\tif (!Common::array_in_array(array('1'=>'1', '2'=>'2'), $this->roles)) {\n\t\t\t$finalFilter .= ' AND destacada = 1';\n\t\t}\n\t\treturn $finalFilter;\n }", "public function filter()\n {\n list($column, $operator, $value, $boolean) = func_get_args();\n empty($operator) && $operator = null;\n empty($value) && $value = null;\n empty($boolean) && $boolean = null;\n if($this->hasFilter) {\n $this->model = $this->model->where($column, $operator, $value, $boolean);\n } else {\n $this->model = $this->model->newQuery()->where($column, $operator, $value, $boolean);\n $this->hasFilter = true;\n }\n\n return $this;\n }", "private static function _getFilter() {}", "public function filterByAb($ab = null, $comparison = null)\n {\n if (is_array($ab)) {\n $useMinMax = false;\n if (isset($ab['min'])) {\n $this->addUsingAlias(TblShippingEconomyTableMap::COL_AB, $ab['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($ab['max'])) {\n $this->addUsingAlias(TblShippingEconomyTableMap::COL_AB, $ab['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblShippingEconomyTableMap::COL_AB, $ab, $comparison);\n }", "public function filter($criteria, $filter, $args=[]);", "protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->categoriaBsq = $this->getRequestParameter('archivo_d_o[categoria_organismo_id]');\n\t\t$this->subcategoriaBsq = $this->getRequestParameter('archivo_d_o[subcategoria_organismo_id]');\n\t\t$this->organismoBsq = $this->getRequestParameter('archivo_d_o[organismo_id]');\n\t\t$this->documentacionBsq = $this->getRequestParameter('archivo_d_o[documentacion_organismo_id]');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t\n\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (ao.nombre LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->categoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.categoria_organismo_id =\".$this->categoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcategoria', $this->categoriaBsq);\n\t\t}\n\t\tif (!empty($this->subcategoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.subcategoria_organismo_id =\".$this->subcategoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowsubcategoria', $this->subcategoriaBsq);\n\t\t}\n\t\tif (!empty($this->organismoBsq)) {\n\t\t\t$parcial .= \" AND ao.organismo_id =\".$this->organismoBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_noworganismos', $this->organismoBsq);\n\t\t}\n\t\tif (!empty($this->documentacionBsq)) {\n\t\t\t$parcial .= \" AND ao.documentacion_organismo_id =\".$this->documentacionBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdocumentacion', $this->documentacionBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\n\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowsubcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_noworganismos');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowdocumentacion');\n\t\t\t}\n\t\t} \n\n\t\t\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t$parcial=\"\";\n\t\t\t$this->cajaBsq = \"\";\n\t\t\t$this->categoriaBsq = '';\n\t\t\t$this->subcategoriaBsq = '';\n\t\t\t$this->organismoBsq = '';\n\t\t\t$this->documentacionBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t}\n\t\t$organismos = Organismo::IdDeOrganismo($this->getUser()->getAttribute('userId'),1);\n $this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\tif(Common::array_in_array(array('1'=>'1', '2'=>'2', '6'=>'6'), $this->roles))\n\t\t{\n\t\t\treturn \"ao.deleted=0\".$parcial.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado')\";\n\t\t}\n\t\telse\n\t\t{\n $responsables = ArchivoDO::getUSerREsponsables();\n return \"ao.deleted=0\".$parcial.\" AND ao.organismo_id IN \".$organismos.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado') AND (ao.owner_id \".$responsables.\" OR do.confidencial != 1 OR ao.owner_id = \".$this->getUser()->getAttribute('userId').\")\";\n }\n\t\t \n\n }", "protected function getFilterField(){\n $aField = parent::getFilterField();\n $oRequest = AMI::getSingleton('env/request');\n if(!$oRequest->get('category', 0)){\n $aField['disableSQL'] = TRUE;\n }\n return $aField;\n }", "function getListFilter($col,$key,$tahun='',$bulan='') {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': \n\t\t\t\t\treturn \"datepart(year,p.tglperolehan) = '$tahun' and datepart(month,p.tglperolehan) = '$bulan' \"; \n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once('m_unit.php');\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"infoleft >= \".(int)$row['infoleft'].\" and inforight <= \".(int)$row['inforight'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function filterByActivo($activo = null, $comparison = null)\n\t{\n\t\tif (is_string($activo)) {\n\t\t\t$activo = in_array(strtolower($activo), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n\t\t}\n\t\treturn $this->addUsingAlias(ExpositorFeriaPeer::ACTIVO, $activo, $comparison);\n\t}", "public static function getFilter()\n {\n if (isset($conf['kolab']['server']['params']['admin'][self::ATTRIBUTE_SID])) {\n $manager = $conf['kolab']['server']['params']['admin'][self::ATTRIBUTE_SID];\n } else {\n $manager = 'manager';\n }\n\n $criteria = array('AND' => array(\n array('field' => self::ATTRIBUTE_CN,\n 'op' => 'any'),\n array('field' => self::ATTRIBUTE_SN,\n 'op' => 'any'),\n array('field' => self::ATTRIBUTE_OC,\n 'op' => '=',\n 'test' => self::OBJECTCLASS_INETORGPERSON),\n array('NOT' => array(\n array('field' => self::ATTRIBUTE_SID,\n 'op' => '=',\n 'test' => $manager),\n ),\n ),\n ),\n );\n return $criteria;\n }", "public function filtrarListaAlumnos($tipo_filtro, $valor)\n {\n //`al`.`carrera_especialidad`\n $filtro = \"\";\n switch ($tipo_filtro){\n case \"1\":\n //Filtro por sexo\n $filtro = \" AND p.sexo = \".$valor;\n break;\n case \"2\":\n //Filtro por municipio\n $filtro = \" AND al.id_municipio = \".$valor;\n break;\n case \"3\":\n //Filtro por por estatus de la cuenta (activa/inactva)\n $filtro = \" AND p.estatus = \".$valor;\n break;\n case \"4\":\n //Filtro por por Id de iniversidad\n $filtro = \" AND al.id_universidad = \".$valor;\n break;\n case \"5\":\n //Filtro por tipo de procedenceia\n $filtro = \" AND al.tipo_procedencia = \".$valor;\n break;\n case \"6\":\n //Filtro por carrera\n $filtro = \" AND al.carrera_especialidad = \".$valor;\n break;\n default:\n $filtro = \"\";\n break;\n }\n $query = \"SELECT \n al.id_alumno, p.nombre, p.app, \n p.apm, p.telefono, p.sexo, \n p.estatus AS estatus_p, al.id_municipio, \n al.id_universidad, al.id_persona, \n al.matricula, al.nombre_uni, al.carrera_especialidad, \n al.email, al.fecha_registro, al.perfil_image, al.estatus \n AS estatus_al, tp.id_tipo_procedencia, tp.tipo_procedencia\n FROM alumno al,persona p , tipo_procedencia tp\n WHERE al.id_persona = p.id_persona \n AND al.id_tipo_procedencia_fk = tp.id_tipo_procedencia\n AND p.estatus = 1 \".$filtro.\" ORDER BY `p`.`nombre` ASC\";\n $this->connect();\n $result = $this->getData($query);\n $this->close();\n return $result;\n }", "function getArrayListFilterCol() {\n\t\t\t$data['kodeunit'] = 'u.kodeunit';\n\t\t\t\n\t\t\treturn $data;\n\t\t}", "public function searchByFilter() {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n if (!empty($this->rekening1_id)) {\n $criteria->addCondition(\"rekening1_id = \" . $this->rekening1_id);\n }\n $criteria->compare('LOWER(kdrekening1)', strtolower($this->kdrekening1), true);\n $criteria->compare('LOWER(nmrekening1)', strtolower($this->nmrekening1), true);\n $criteria->compare('LOWER(nmrekeninglain1)', strtolower($this->nmrekeninglain1), true);\n// $criteria->compare('LOWER(rekening1_nb)', strtolower($this->rekening1_nb), true);\n $criteria->compare('rekening1_aktif', $this->rekening1_aktif);\n if (!empty($this->rekening2_id)) {\n $criteria->addCondition(\"rekening2_id = \" . $this->rekening2_id);\n }\n $criteria->compare('LOWER(kdrekening2)', strtolower($this->kdrekening2), true);\n $criteria->compare('LOWER(nmrekening2)', strtolower($this->nmrekening2), true);\n $criteria->compare('LOWER(nmrekeninglain2)', strtolower($this->nmrekeninglain2), true);\n// $criteria->compare('LOWER(rekening2_nb)', strtolower($this->rekening2_nb), true);\n $criteria->compare('rekening2_aktif', $this->rekening2_aktif);\n if (!empty($this->rekening3_id)) {\n $criteria->addCondition(\"rekening3_id = \" . $this->rekening3_id);\n }\n $criteria->compare('LOWER(kdrekening3)', strtolower($this->kdrekening3), true);\n $criteria->compare('LOWER(nmrekening3)', strtolower($this->nmrekening3), true);\n $criteria->compare('LOWER(nmrekeninglain3)', strtolower($this->nmrekeninglain3), true);\n// $criteria->compare('LOWER(rekening3_nb)', strtolower($this->rekening3_nb), true);\n $criteria->compare('rekening3_aktif', $this->rekening3_aktif);\n if (!empty($this->rekening4_id)) {\n $criteria->addCondition(\"rekening4_id = \" . $this->rekening4_id);\n }\n $criteria->compare('LOWER(kdrekening4)', strtolower($this->kdrekening4), true);\n $criteria->compare('LOWER(nmrekening4)', strtolower($this->nmrekening4), true);\n $criteria->compare('LOWER(nmrekeninglain4)', strtolower($this->nmrekeninglain4), true);\n// $criteria->compare('LOWER(rekening4_nb)', strtolower($this->rekening4_nb), true);\n $criteria->compare('rekening4_aktif', $this->rekening4_aktif);\n if (!empty($this->rekening5_id)) {\n $criteria->addCondition(\"rekening5_id = \" . $this->rekening5_id);\n }\n $criteria->compare('LOWER(kdrekening5)', strtolower($this->kdrekening5), true);\n $criteria->compare('LOWER(nmrekening5)', strtolower($this->nmrekening5), true);\n $criteria->compare('LOWER(nmrekeninglain5)', strtolower($this->nmrekeninglain5), true);\n// $criteria->compare('LOWER(rekening5_nb)', strtolower($this->rekening5_nb), true);\n $criteria->compare('LOWER(keterangan)', strtolower($this->keterangan), true);\n $criteria->compare('nourutrek', $this->nourutrek);\n $criteria->compare('rekening5_aktif', $this->rekening5_aktif);\n $criteria->compare('LOWER(kelompokrek)', strtolower($this->kelompokrek), true);\n $criteria->compare('sak', $this->sak);\n $criteria->compare('LOWER(create_time)', strtolower($this->create_time), true);\n $criteria->compare('LOWER(update_time)', strtolower($this->update_time), true);\n $criteria->compare('LOWER(create_loginpemakai_id)', strtolower($this->create_loginpemakai_id), true);\n $criteria->compare('LOWER(update_loginpemakai_id)', strtolower($this->update_loginpemakai_id), true);\n $criteria->compare('LOWER(create_ruangan)', strtolower($this->create_ruangan), true);\n// $condition = 'rincianobyek_id IS NOT NULL';\n// $criteria->addCondition($condition);\n $criteria->order = 'rekening1_id, rekening2_id, rekening3_id, rekening4_id, nourutrek';\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function getfilterColumns()\n\t{\n\t\treturn array(\"name\",\"last_name\", \"country\");\n\t}", "public function searchAvisos() {\n // should not be searched.\n \n $nombre = \"\";\n $apellido = \"\";\n $nombres = explode(\" \",$this->cliente_nombre);\n if(count($nombres) == 1){\n $nombre = $this->cliente_nombre;\n $apellido = $this->cliente_nombre;\n }\n elseif(count($nombres) == 2){\n $nombre = $nombres[0];\n $apellido = $nombres[1];\n }\n \n $criteria = new CDbCriteria;\n $criteria->with = array('departamento', 'tipoContrato', 'cliente');\n $criteria->join .= 'join departamento as d on d.id = t.departamento_id '\n . ' join propiedad as p on p.id = d.propiedad_id'\n . ' join tipo_contrato as tipo on tipo.id = t.tipo_contrato_id '\n . ' join cliente as c on c.id = t.cliente_id '\n . ' join usuario as u on u.id = c.usuario_id ';\n \n $arreglo = explode(\" \",$this->cliente_nombre);\n $nombreApellido = array();\n foreach($arreglo as $palabra){\n if(trim($palabra)!= ''){\n $nombreApellido[]=$palabra;\n }\n }\n $criteriaNombreUser1 = new CDbCriteria();\n $palabras = count($nombreApellido);\n if($palabras == 1){\n $busqueda = $nombreApellido[0];\n if(trim($busqueda) != ''){\n $criteriaNombreUser1->compare('u.nombre',$busqueda,true);\n $criteriaNombreUser1->compare('u.apellido',$busqueda,true,'OR');\n }\n }\n\n if($palabras == 2){\n $nombre = $nombreApellido[0];\n $apellido = $nombreApellido[1];\n $criteriaNombreUser1->compare('u.nombre',$nombre,true);\n $criteriaNombreUser1->compare('u.apellido',$apellido,true);\n }\n\n $criteria->compare('folio', $this->folio);\n $criteria->mergeWith($criteriaNombreUser1,'AND');\n \n $criteria->compare('fecha_inicio', Tools::fixFecha($this->fecha_inicio), true);\n $criteria->compare('p.nombre', $this->propiedad_nombre, true);\n $criteria->compare('d.numero', $this->depto_nombre, true);\n $criteria->compare('c.rut', $this->cliente_rut, true);\n $criteria->compare('t.vigente', 1);\n \n \n if(Yii::app()->user->rol == 'cliente'){\n $cliente = Cliente::model()->findByAttributes(array('usuario_id'=>Yii::app()->user->id));\n if($cliente!=null){\n $criteria->compare('t.cliente_id',$cliente->id);\n }\n else{\n $criteria->compare('t.cliente_id',-1);\n }\n }\n \n if(Yii::app()->user->rol == 'propietario'){\n $criteriaPropietario = new CDbCriteria();\n $contratos = Contrato::model()->relacionadosConPropietario(Yii::app()->user->id);\n foreach($contratos as $contrato_id){\n $criteriaPropietario->compare('t.id', $contrato_id, false,'OR'); \n }\n $criteria->mergeWith($criteriaPropietario,'AND');\n }\n \n \n \n \n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'attributes' => array(\n 'depto_nombre' => array(\n 'asc' => 'd.numero',\n 'desc' => 'd.numero DESC',\n ),\n 'tipo_nombre' => array(\n 'asc' => 'tipo.nombre',\n 'desc' => 'tipo.nombre DESC',\n ),\n 'cliente_rut' => array(\n 'asc' => 'c.rut',\n 'desc' => 'c.rut DESC',\n ),\n 'cliente_nombre' => array(\n 'asc' => 'u.apellido,u.nombre',\n 'desc' => 'u.apellido DESC,u.nombre DESC',\n ),\n 'propiedad_nombre' => array(\n 'asc' => 'p.nombre',\n 'desc' => 'p.nombre DESC',\n ),\n '*',\n ),\n ),\n ));\n }", "public function getFilter(): string;", "protected function getWhereClause() {}", "public function addActiveFilter()\n {\n return $this->addFieldToFilter('status', 1);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}", "public function getFilter();", "public function getFilter();", "public function getFilter(){ }", "public function filterByActivo($activo = null, $comparison = null)\n\t{\n\t\tif (is_string($activo)) {\n\t\t\t$activo = in_array(strtolower($activo), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n\t\t}\n\t\treturn $this->addUsingAlias(ActividadPeer::ACTIVO, $activo, $comparison);\n\t}", "public function getFilter() :array;", "public function isFiltered() : bool;", "function getFiltroEmpresa($get,$where = \"1 = 1\"){\n \n if(isset($get['cdFilial']) ){\n $CdFilial = $get['cdFilial'];\n if(!empty($CdFilial)){\n return $where .= \" AND CDFILIALENTREGA IN ($CdFilial) \";\n }\n }\n }", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "public function filterByAbilitato($abilitato = null, $comparison = null)\n {\n if (is_string($abilitato)) {\n $abilitato = in_array(strtolower($abilitato), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(AccountTableMap::COL_ABILITATO, $abilitato, $comparison);\n }", "public function getSpecialAccommodationsFilter( $queryBuilder , $alias , $field , $value ) {\n\n\t\tif( $value['value'] == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( $value['value'] == 'Yes' ) {\n\t\t\t$queryBuilder->andWhere( sprintf( '%s.specialAccommodations = :special' , $alias ) );\n\t\t\t$queryBuilder->setParameter( 'special' , 1 );\n\t\t}\n\t\tif( $value['value'] == 'No' ) {\n\t\t\t$queryBuilder->andWhere( sprintf( '%s.specialAccommodations = :special' , $alias ) );\n\t\t\t$queryBuilder->setParameter( 'special' , 0 );\n\t\t}\n\n\t\treturn true;\n\t}", "protected function functionCriteria() {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n if (!is_array($this->kunjungan)){\n $this->kunjungan = 0;\n }\n \n $criteria->addBetweenCondition('date(tglmasukpenunjang)', $this->tglAwal, $this->tglAkhir);\n $criteria->compare('kunjungan', $this->kunjungan);\n\t\tif(!empty($this->instalasiasal_id)){\n\t\t\t$criteria->addCondition('instalasiasal_id ='.$this->instalasiasal_id);\n\t\t}\n if (!empty($this->instalasiasal_id)){\n if (!is_array($this->ruanganasal_id)){\n $this->ruanganasal_id = 0;\n }\n }\n\t\tif(!empty($this->carabayar_id)){\n\t\t\t$criteria->addCondition('carabayar_id ='.$this->carabayar_id);\n\t\t}\n\t\tif(!empty($this->carabayar_id)){\n\t\t\t$criteria->addCondition('penjamin_id ='.$this->carabayar_id);\n\t\t}\n\t\tif(!empty($this->ruanganasal_id)){\n\t\t\t$criteria->addCondition('ruanganasal_id ='.$this->ruanganasal_id);\n\t\t}\n $criteria->addCondition('ruanganpenunj_id = '.Yii::app()->user->getState('ruangan_id'));\n\n return $criteria;\n }" ]
[ "0.5510458", "0.5483433", "0.53874505", "0.5380181", "0.5334744", "0.5277825", "0.5277809", "0.5211707", "0.5193127", "0.5193069", "0.5192595", "0.5141807", "0.51237", "0.51216686", "0.5112058", "0.50942326", "0.5081892", "0.5075318", "0.5073921", "0.50569737", "0.50569737", "0.5056245", "0.50516456", "0.50376564", "0.50344104", "0.5021144", "0.50192153", "0.5016195", "0.50147057", "0.5010083" ]
0.5719954
0
Filter the query on the notes column Example usage: $query>filterByNotes('fooValue'); // WHERE notes = 'fooValue' $query>filterByNotes('%fooValue%'); // WHERE notes LIKE '%fooValue%'
public function filterByNotes($notes = null, $comparison = null) { if (null === $comparison) { if (is_array($notes)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $notes)) { $notes = str_replace('*', '%', $notes); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(FPartenaireTableMap::COL_NOTES, $notes, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByNotes($notes = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($notes)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $notes)) {\n $notes = str_replace('*', '%', $notes);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(RemoteAppPeer::NOTES, $notes, $comparison);\n }", "public function findAllByAmountOfNotesAnywhere($filter)\n {\n return $this->createQueryBuilder('u')\n ->andWhere('u.amountOfNotes LIKE :filter')\n ->setParameter('filter','%'.$filter.'%')\n ->addOrderBy('u.totalAmountOfCreatedObjects','DESC')\n ->getQuery()\n ->execute();\n }", "public function noteIndex(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $items = $this->Notes->index($user);\n }", "public static function retrieveAllNotes() {\n return R::getAll('SELECT * FROM note');\n }", "public function noteIndex(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $items = $this->Notes->index($user); \n }", "function findNotesByUser(UserInterface $user);", "public function filter($criteria, $filter, $args=[]);", "public function get_user_note_by_only_noteID($note_id,$user_id, $validate=true){\n $sql = 'select * from notes AS N';\n $sql .=' JOIN notes_subject AS S';\n $sql .=' ON S.note_id =' .\"'\".self::$database->escape_string($note_id) .\"'\";\n $sql .=' AND N.note_id = S.note_id JOIN notes_tag AS T ON T.note_id = '.\"'\". self::$database->escape_string($note_id) .\"' \";\n // login user can not access notes of other users\n if($validate){\n $sql .='WHERE N.access_type =' . \"'Public' \";\n $sql .='OR N.user_id =' . \"'\".h($user_id).\"'\";\n }\n // echo $sql;\n return static::find_by_sql($sql);\n}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "function filter_search_columns($columns, $search, $WP_User_Query)\n {\n }", "public function findWhere(String $column, $value, String $operator = '=');", "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 filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "function getSomeNotes($fieldstosearch) {\n $this->createAutosession();\n\n // format the query first\n $tempFields = array();\n\n // get all notes, we'll use this later to filter our search results\n\n // todo: check to see if we need this anymore, it's used to prevent a note\n // user from seeing notes that aren't his or his account's. Formerly this\n // check wasn't handled on the server side, but it's supposed to be handled\n // there now. Code here left so as not to break anything\n\n\n $orderby = '';\n\n\n $result = $this->_getEntryList($fieldstosearch, $orderby, array());\n\n //echo \"<pre>\"; var_dump($result); echo \"</pre>\";\n\n if( is_array($result) ) {\n // now we'll filter the results to make sure we only show notes that this\n // user is authorized to view\n\n return $result;\n } else {\n return array();\n }\n }", "public function getNotes();", "public function filter_coler($params){\n $this->db->select(\"$this->table_product.text_coler\")\n ->from($this->table_product);\n $this->db->distinct();\n if (!empty($params['keyword'])) $this->db->like(\"$this->table_product.text_coler\", $params['keyword']);\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "private function get_notes()\n\t{\n\t\t$notes = $this->api->search( Options::get('simplenote__search') );\n\t\t\t\t\n\t\treturn $notes;\n\t}", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function get_user_notes(){\n $user_id = (int) $_COOKIE['user_id'];\n $sql = 'SELECT * from '. static::$table_name .' AS N JOIN notes_subject AS S';\n $sql .=' ON N.user_id =' .\"'\". self::$database->escape_string($user_id) .\"'\";\n $sql .= ' AND N.user_id = S.user_id AND N.note_id = S.note_id JOIN notes_tag AS T ON N.user_id = T.user_id AND N.note_id = T.note_id';\n\n return static::find_by_sql($sql);\n }", "public function searchMyNotes(Request $request) {\n $notesService = new NotesService();\n if($request->has('query') == false) {\n $matchedNotes = $notesService->getNotesForQuery(\"\", \"my\");\n } else {\n $matchedNotes = $notesService->getNotesForQuery($request->input('query'), \"my\");\n }\n $notesResponseArray = array();\n foreach ($matchedNotes as $note) {\n $notesResponseArray[] = Util::getNotesResponse($note);\n }\n return json_encode(array('notes' => $notesResponseArray));\n }", "public function search($keywords = '')\n {\n if (!empty($_POST['q'])) {\n $keywords = filter_var($_POST['q'], FILTER_SANITIZE_STRING);\n }\n $result = $this->notesModel->filterNotes($keywords);\n echo json_encode($result);\n }", "private function _sql_filter_postmeta($column, $operator, $value) {\n\n\t\tif ( empty($value) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tglobal $wpdb;\n\t\t\n\t\t$sub_query = '';\n\t\t$line_item_join_rule = 'OR'; // TODO\n\n\t\tswitch($operator) {\n\t\t\tcase 'starts_with': \n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->postmeta}.meta_value LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND $sub_query)\", $wpdb->prepare('%s',$column));\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', $value.'%');\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'ends_with': \n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v);\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->postmeta}.meta_value LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND $sub_query)\", $wpdb->prepare('%s',$column));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'like': \n // Like's % cause sprintf errors, so we gotta join the query ugly like.\n // https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=508\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t $q = sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND \", $wpdb->prepare('%s',$column));\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$v = sprintf(\"{$wpdb->postmeta}.meta_value LIKE %s\", $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn $q . '('.implode(\" $line_item_join_rule \", $value) .'))'; // close the sub query\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value.'%');\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'not_like': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->postmeta}.meta_value NOT LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND $sub_query)\", $wpdb->prepare('%s',$column));\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value.'%');\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value NOT LIKE %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\n\t\t\t// Arrays make no sense for these guys:\n\t\t\tcase '>':\n\t\t\tcase '>=':\n\t\t\tcase '<':\n\t\t\tcase '<=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\t$this->errors[] = sprintf(__('The %s operator cannot operate on an array of values.', CCTM_TXTDOMAIN), $operator);\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value $operator %s)\", $wpdb->prepare('%s',$column), $wpdb->prepare('%s',$value));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase '=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value IN %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value = %s)\", $wpdb->prepare('%s',$column), $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t\t\n\n\t\t\tcase '!=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value NOT IN %s)\", $wpdb->prepare('%s',$column), $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} ({$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value != %s)\", $wpdb->prepare('%s',$column), $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t}\n\t}", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "private function _sql_filter_posts($column, $operator, $value) {\n\n\t\tif ( empty($value) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tglobal $wpdb;\n\t\t\n\t\t$sub_query = '1 AND';\n\t\t$line_item_join_rule = 'OR'; // TODO\n\t\t\n\t\tswitch($operator) {\n\t\t\tcase 'starts_with': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', $value.'%');\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'ends_with': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v);\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'like': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'not_like': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column NOT LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column NOT LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\n\t\t\t// Arrays make no sense for these guys:\n\t\t\tcase '>':\n\t\t\tcase '>=':\n\t\t\tcase '<':\n\t\t\tcase '<=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\t$this->errors[] = sprintf(__('The %s operator cannot operate on an array of values.', CCTM_TXTDOMAIN), $operator);\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column $operator %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase '=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column IN %s\", $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column = %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t\t\n\n\t\t\tcase '!=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column NOT IN %s\", $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column != %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t}\n\t}", "public function setNotes($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->notes !== $v) {\n $this->notes = $v;\n $this->modifiedColumns[BiblioTableMap::COL_NOTES] = true;\n }\n\n return $this;\n }", "public function where($table,$column,$data = \"\");", "public function get_notes($id){\n $this->db->where('user_id', $id);\n $query = $this->db->get('notes');\n return $query->result();\n }", "public function where(array $params)\n {\n }", "private static function filterParams($params=[])\n { \n $where = '';\n if (!empty($params)) {\n $where = 'WHERE ';\n foreach ($params as $index=>$value) {\n $where .= $index.' = ? AND '; \n }\n $where = trim($where,'AND ');//delete and\n }\n $query = \"SELECT * FROM \".static::tableName().\" $where\";\n return $query;\n }" ]
[ "0.65479434", "0.53552955", "0.53209394", "0.52974755", "0.5292584", "0.5192094", "0.51822233", "0.5125954", "0.51029927", "0.5094221", "0.5073027", "0.50335497", "0.50330824", "0.5015415", "0.50072765", "0.5005611", "0.5001612", "0.49864164", "0.49557132", "0.49454725", "0.4880133", "0.48743945", "0.48550436", "0.48550436", "0.48506513", "0.48432028", "0.4827001", "0.4819789", "0.48162657", "0.48040724" ]
0.63811463
1
Filter the query on the dte_maj column Example usage: $query>filterByDateMAJ('20110314'); // WHERE dte_maj = '20110314' $query>filterByDateMAJ('now'); // WHERE dte_maj = '20110314' $query>filterByDateMAJ(array('max' => 'yesterday')); // WHERE dte_maj > '20110313'
public function filterByDateMAJ($dateMAJ = null, $comparison = null) { if (is_array($dateMAJ)) { $useMinMax = false; if (isset($dateMAJ['min'])) { $this->addUsingAlias(FPartenaireTableMap::COL_DTE_MAJ, $dateMAJ['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($dateMAJ['max'])) { $this->addUsingAlias(FPartenaireTableMap::COL_DTE_MAJ, $dateMAJ['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(FPartenaireTableMap::COL_DTE_MAJ, $dateMAJ, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function compute_datemaj($data) {\n\n $date_maj = DateTime::createFromFormat('d/m/Y', trim($data['INFO_GENERALES'][0]['DATE_MAJ']))->format('Y-m-d') . ' 00:00:00';\n\n if(array_key_exists('IMAGES', $data)) {\n foreach($data['IMAGES'][0]['IMG'] as $url) {\n $image_raw_date = preg_replace(\"#.+DATEMAJ=#\", \"\", trim($url));\n $image_date = DateTime::createFromFormat('d/m/Y-H:i:s', $image_raw_date)->format('Y-m-d H:i:s');\n\n if($image_date > $date_maj) {\n $date_maj = $image_date;\n }\n }\n }\n\n return DateTime::createFromFormat('Y-m-d H:i:s' ,$date_maj)->format('U');\n }", "public function get_between_january_may() {\n $query = \"SELECT nomor, DATE(created_at) AS created_at FROM bpp_history where nomor REGEXP '/(01|02|03|04|05)/2021?' order by substring(nomor, 9, 2) asc\";\n $result = $this->db->query($query);\n return $result;\n }", "public function max($model, $column, $dateColumn = null)\n {\n return $this->aggregate('max', $model, $column, $dateColumn);\n }", "public function getMaxMedDate()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \" SELECT max(date_given)\r\n\t\t\t\t\t\t\tFROM med_record\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\t$m = array();\r\n\t\t\t\t$m_arr = array();\r\n\t\t\t\twhile($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t$m['mdate'] = $row[0];\r\n\t\t\t\t\t$m_arr[] = $m;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\treturn $m_arr;\r\n\t\t\t\t\r\n\t\t}", "public function maxByMonths($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_MONTHS, 'max', $column, $dateColumn);\n }", "private function query_fecha_minima_factura(){\n\n \t$respuesta = false;\n\n\t\ttry {\n\n \t\t\t$this->db->select_min('cao_fatura.data_emissao');\n\t\t\t$this->db->from('cao_fatura');\t\t\n\n\t\t\t$query = $this->db->get();\n\n\t\t if ($query && $query->num_rows() > 0)\n\t\t {\n\t\t\t\t$respuesta = $query->result_array();\n\n\t\t }else{\n\n\t\t throw new Exception('Error al intentar obtener la factura de menor fecha');\n\t\t\t log_message('error', 'Error al intentar obtener la factura de menor fecha');\t\t \n\n\t\t $respuesta = false;\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t$respuesta = false;\n\t\t}\t\t\t\n\n\t\treturn $respuesta;\n }", "function get_month_max($date, $labels) {\n global $DB;\n\n $fechainicio = new DateTime(\"1-\".$date->month.\"-\".$date->year);\n $maxday = cal_days_in_month(CAL_GREGORIAN, $date->month, $date->year);\n $fechafin = new DateTime($maxday.\"-\".$date->month.\"-\".$date->year);\n $fechafin->setTime(23, 59, 59);\n $result = array();\n foreach ($labels as $label) {\n $result[] = 0;\n }\n\n $sql = \"SELECT id, connectedusers, date FROM {report_user_statistics} WHERE date >= ? AND date <= ? ORDER BY date;\";\n $todaslasconexiones = $DB->get_records_sql($sql, [$fechainicio->getTimestamp(), $fechafin->getTimestamp()]);\n $day = 0;\n $temp = array();\n $i = 1;\n foreach ($todaslasconexiones as $conexiones) {\n $fecha = new DateTime(\"@$conexiones->date\");\n if (($fecha->format('m') == $date->month) && ($fecha->format('Y') == $date->year)) {\n if ($day == 0) {\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n $i++;\n } else if ($day == $fecha->format('d')) {\n $temp[] = $conexiones->connectedusers;\n $i++;\n } else if ($day < $fecha->format('d')) {\n $key = array_search($day, $labels);\n $result[$key] = max($temp);\n $temp = array();\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n }\n if (count($todaslasconexiones) == $i) {\n $key = array_search($day, $labels);\n $result[$key] = max($temp);\n } else if (count($temp) > 1) {\n $key = array_search($day, $labels);\n $result[$key] = max($temp);\n }\n }\n }\n return $result;\n}", "function get_date_where($max_levels=3)\n {\n global $page;\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $y = $date[CYEAR];\n $res = \" AND $this->date_field BETWEEN '$y-01-01' AND '$y-12-31 23:59:59'\";\n }\n\n if (isset($date[CWEEK]) and $date[CWEEK]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CWEEK]['sql'].'='.$date[CWEEK];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n if (empty($res))\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n }\n return $res;\n }", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "function analysis($mthArray,$date){\r\n\t// the array is indexed from 1 to 12\r\n\t$d = date_parse_from_format(\"Y-m-d\", $date);\r\n\t\r\n\tif($d[\"month\"]==1){\r\n\t\t// compare january vs. december\r\n\t\t// the greater months in the array must be from the previous year\r\n\t\t$prevMonth=11;\r\n\t}\r\n\telse{\r\n\t\t$prevMonth=$d[\"month\"]-1;\r\n\t}\r\n\t\r\n\tif($mthArray[$d[\"month\"]]>$mthArray[$prevMonth]){\r\n\t\t$msg='We ate MORE meals together this month than last month';\r\n\t}\r\n\telse if($mthArray[$d[\"month\"]]<$mthArray[$prevMonth]){\r\n\t\t$msg='We ate LESS meals together this month than last month';\r\n\t}\r\n\telse{\r\n\t\t$msg='We ate THE SAME NUMBER OF meals together this month than last month';\r\n\t}\t\r\n\t\r\n\treturn $msg;\r\n}", "private function _selectFechas()\n {\n \t$mes = $this->currentYear.'-'.$this->currentMonth;\n\n \t$q = (new Query())->select([\"extract(day from $this->fecha) as \".$this->pre.\"fecha\", \"$this->link as link\"])\n \t->distinct($this->fecha)->from($this->tabla)\n \t->andFilterWhere([\"to_char($this->fecha, 'YYYY-mm')\" => $mes]);\n \tif ($this->where) $q->andFilterWhere($this->where);\n\n \treturn $q->all();\n\n }", "public function getFiltroPrecoMaximoMinimo()\n {\n return Query::fetchFirst('Busca/Filtros/QryBuscarPrecoMaximoMinimo');\n }", "function buscar_mayor_fecha () {\n global $DB;\n $sql = \"SELECT date FROM {report_user_statistics} WHERE id=(SELECT max(id) FROM {report_user_statistics});\";\n $fecha = $DB->get_record_sql($sql);\n return $fecha;\n}", "function get_date_where($max_levels=3)\n {\n global $page;\n\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $b = $date[CYEAR] . '-';\n $e = $date[CYEAR] . '-';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $b .= sprintf('%02d-', $date[CMONTH]);\n $e .= sprintf('%02d-', $date[CMONTH]);\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $b .= sprintf('%02d', $date[CDAY]);\n $e .= sprintf('%02d', $date[CDAY]);\n }\n else\n {\n $b .= '01';\n $e .= $this->get_all_days_in_month($date[CYEAR], $date[CMONTH]);\n }\n }\n else\n {\n $b .= '01-01';\n $e .= '12-31';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n $res = \" AND $this->date_field BETWEEN '$b' AND '$e 23:59:59'\" . $res;\n }\n else\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n return $res;\n }", "public function filterByFilterJanee($filterJanee = null, $comparison = null)\n {\n if (is_array($filterJanee)) {\n $useMinMax = false;\n if (isset($filterJanee['min'])) {\n $this->addUsingAlias(GsMedischeHulpmiddelenPeer::FILTER_JANEE, $filterJanee['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($filterJanee['max'])) {\n $this->addUsingAlias(GsMedischeHulpmiddelenPeer::FILTER_JANEE, $filterJanee['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsMedischeHulpmiddelenPeer::FILTER_JANEE, $filterJanee, $comparison);\n }", "function filtersecondary()\r\n\t{\t\r\n\t\t// make date and time variables\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t// get categories for filtering\r\n\t\t\r\n\t\t$filter_category = JRequest::getVar( 'filter_category' );\r\n\t\t$model->setState( 'filter_secondary_category', $filter_category );\r\n\t\t\r\n\t\t$model->setState( 'order', 'tbl.eventinstance_date' );\r\n\t\t$model->setState( 'direction', 'ASC' );\r\n\t\t$query = $model->getQuery( );\r\n\t\t$query->order( 'tbl.eventinstance_time' );\r\n\t\t$model->setQuery( $query );\r\n\t\t\r\n\t\t$vars->date = $date;\r\n\t\t$vars->items = $model->getList( );\r\n\t\t\r\n\t\t$html = $this->getLayout( 'default', $vars, 'three' ); \r\n\t\techo ( json_encode( array('msg'=>$html) ) );\r\n\t}", "public function max(string $unit, $model, $column, $dateColumn = null)\n {\n return $this->aggregate('max', $unit, $model, $column, $dateColumn);\n }", "public function getDataMonth()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfMonth())->get();\n }", "public function max($request, $model, $unit, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, $unit, 'max', $column, $dateColumn);\n }", "function GetLastMonthFilter($FldExpression, $dbid = 0) {\r\n\t$today = getdate();\r\n\t$lastmonth = mktime(0, 0, 0, $today['mon']-1, 1, $today['year']);\r\n\t$val = date(\"Y|m\", $lastmonth);\r\n\t$wrk = $FldExpression . \" BETWEEN \" .\r\n\t\tQuotedValue(DateValue(\"month\", $val, 1, $dbid), DATATYPE_DATE, $dbid) .\r\n\t\t\" AND \" .\r\n\t\tQuotedValue(DateValue(\"month\", $val, 2, $dbid), DATATYPE_DATE, $dbid);\r\n\treturn $wrk;\r\n}", "function _max_date($field, $date)\r\n\t{\r\n\t\treturn (strtotime($this->{$field}) > strtotime($date)) ? FALSE : TRUE;\r\n\t}", "public static function produtosAcimaMaximo ($model)\n {\n return static::produtos($model, 'acimaMaximo');\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "function getDebutMois($dateDuJour){\n global $dbHandler;\n $db = $dbHandler->openConnection();\n\n $sql = \"SELECT * FROM getdebutmois(date('$dateDuJour'));\";\n $result = $db->query($sql);\n\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n Signalerreur(__FILE__,__LINE__,__FUNCTION__,_(\"DB\").\": \".$result->getMessage());\n }\n\n $date_row = $result->fetchrow(DB_FETCHMODE_ASSOC);\n\n $dbHandler->closeConnection(true);\n return $date_row['getdebutmois'];\n}", "function get_materias_equipo($filtro=array()){\n $where=\" WHERE 1=1 \";\n $where2=\" WHERE 1=1 \";\n if (isset($filtro['anio'])) {\n $where.= \" and anio= \".quote($filtro['anio']['valor']);\n }\n if (isset($filtro['carrera'])) {\n switch ($filtro['carrera']['condicion']) {\n case 'contiene':$where2.= \" and carrera ILIKE \".quote(\"%{$filtro['carrera']['valor']}%\");break;\n case 'no_contiene':$where2.= \" and carrera NOT ILIKE \".quote(\"%{$filtro['carrera']['valor']}%\");break;\n case 'comienza_con':$where2.= \"and carrera ILIKE \".quote(\"{$filtro['carrera']['valor']}%\");break;\n case 'termina_con':$where2.= \"and carrera ILIKE \".quote(\"%{$filtro['carrera']['valor']}\");break;\n case 'es_igual_a':$where2.= \" and carrera = \".quote(\"{$filtro['carrera']['valor']}\");break;\n case 'es_distinto_de':$where2.= \" and carrera <> \".quote(\"{$filtro['carrera']['valor']}\");break;\n }\t\n\t }\n if (isset($filtro['legajo'])) {\n $where2.= \" and legajo = \".quote($filtro['legajo']['valor']);\n }\n if (isset($filtro['vencidas'])) {\n $pdia = dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($filtro['anio']['valor']);\n $udia = dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($filtro['anio']['valor']);\n switch ($filtro['vencidas']['valor']) {\n //sin las designaciones vencidas, es decir solo vigentes\n case 1:$where.= \" and desde<='\".$udia.\"' and ( hasta>='\".$pdia.\"' or hasta is null )\";break;\n case 0:$where.= \" and not(desde<='\".$udia.\"' and ( hasta>='\".$pdia.\"' or hasta is null ))\";break;\n }\n }\n// if (isset($filtro['carrera'])) {\n// $where2.= \" and carrera= \".quote($filtro['carrera']['valor']);\n// }\n //si el usuario esta asociado a un perfil de datos\n $con=\"select sigla from unidad_acad \";\n $con = toba::perfil_de_datos()->filtrar($con);\n $resul=toba::db('designa')->consultar($con);\n if(count($resul)<=1){//es usuario de una unidad academica\n $where.=\" and uni_acad = \".quote($resul[0]['sigla']);\n }else{\n //print_r($filtro);exit;\n if (isset($filtro['uni_acad'])) {\n $where.= \" and uni_acad= \".quote($filtro['uni_acad']['valor']);\n }\n }\n \n $sql=\"select * from (select \n case when conj='sin_conj' then desc_materia else desc_mat_conj end as materia,\n case when conj='sin_conj' then cod_siu else cod_conj end as cod_siu,\n case when conj='sin_conj' then cod_carrera else car_conj end as carrera,\n case when conj='sin_conj' then ordenanza else ord_conj end as ordenanza,\n docente_nombre,legajo,cat_est,id_designacion,modulo,rol,periodo,id_conjunto\n from(\n select sub5.uni_acad,trim(d.apellido)||', '||trim(d.nombre) as docente_nombre,d.legajo,cat_est,sub5.id_designacion,carac,t_mo.descripcion as modulo,case when trim(rol)='NE' then 'Aux' else 'Resp' end as rol,p.descripcion as periodo,\n case when sub5.desc_materia is not null then 'en_conj' else 'sin_conj' end as conj,id_conjunto,\n m.desc_materia,m.cod_siu,pl.cod_carrera,pl.ordenanza,\n sub5.desc_materia as desc_mat_conj,sub5.cod_siu as cod_conj,sub5.cod_carrera as car_conj,sub5.ordenanza as ord_conj\n from(\n\n select sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,sub2.uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion,sub4.desc_materia ,sub4.cod_carrera,sub4.ordenanza,sub4.cod_siu,sub3.id_conjunto\n from (select distinct * from (\n select distinct a.anio,b.id_designacion,b.id_docente,a.id_periodo,a.modulo,a.carga_horaria,a.rol,a.observacion,a.id_materia,b.uni_acad,cat_estat||dedic as cat_est,dedic,carac,desde,hasta,b.id_departamento,b.id_area,b.id_orientacion\n from asignacion_materia a, designacion b\n where a.id_designacion=b.id_designacion\n and not (b.hasta is not null and b.hasta<=b.desde)\n )sub1\n --where uni_acad='CRUB' and anio=2020 \n \".$where .\") sub2 \n left outer join \n ( select t_c.id_conjunto,t_p.anio,t_c.id_periodo,t_c.ua,t_e.id_materia\n from en_conjunto t_e,conjunto t_c, mocovi_periodo_presupuestario t_p\n WHERE t_e.id_conjunto=t_c.id_conjunto and t_p.id_periodo=t_c.id_periodo_pres \n )sub3 on (sub3.ua=sub2.uni_acad and sub3.id_periodo=sub2.id_periodo and sub3.anio=sub2.anio and sub3.id_materia=sub2.id_materia)\n left outer join (select t_e.id_conjunto,t_e.id_materia,t_m.desc_materia,t_m.cod_siu,t_p.cod_carrera,t_p.uni_acad,t_p.ordenanza\n from en_conjunto t_e,materia t_m ,plan_estudio t_p\n where t_e.id_materia=t_m.id_materia\n and t_p.id_plan=t_m.id_plan)sub4 on sub4.id_conjunto=sub3.id_conjunto\n\n\n\n )sub5\n LEFT OUTER JOIN docente d ON d.id_docente=sub5.id_docente\n LEFT OUTER JOIN periodo p ON p.id_periodo=sub5.id_periodo\n LEFT OUTER JOIN modulo t_mo ON sub5.modulo=t_mo.id_modulo\n LEFT OUTER JOIN materia m ON m.id_materia=sub5.id_materia\n LEFT OUTER JOIN plan_estudio pl ON pl.id_plan=m.id_plan\n )sub6)sub\n $where2\n order by id_conjunto,materia,docente_nombre\";\n return toba::db('designa')->consultar($sql);\n }", "public function maxByMinutes($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_MINUTES, 'max', $column, $dateColumn);\n }", "public function trie_par_date($date_ajout){\n $marque_page = [];\n if($date_ajout==0){\n $query = $this->db->prepare('SELECT date_a, date_m, description, id_utilisateur, note, somme, logo_choisi, id_marque_page, titre, url, createur FROM ajoute_modifie, marque_page WHERE id_marque_page = id AND createur=1 ORDER BY date_a DESC');\n }else{\n $query = $this->db->prepare('SELECT date_a, date_m, description, id_utilisateur, note, somme, logo_choisi, id_marque_page, titre, url, createur FROM ajoute_modifie, marque_page WHERE id_marque_page = id AND createur=1 AND date_a >= ( CURDATE() - INTERVAL '.$date_ajout.' DAY ) ORDER BY date_a DESC');\n }\n $query->execute();\n\n while ($donnees = $query->fetch(PDO::FETCH_ASSOC)){\n $marque_page[] = $donnees;\n }\n return $marque_page;\n }", "function getLastMvtCpt($id_cpte) {\n global $dbHandler, $global_id_agence;\n $db = $dbHandler->openConnection();\n $sql = \"SELECT MAX(date_comptable) FROM ad_mouvement m,ad_ecriture e WHERE e.id_ag = m.id_ag AND m.id_ag = $global_id_agence AND cpte_interne_cli='$id_cpte' AND m.id_ecriture=e.id_ecriture\";\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n }\n $dbHandler->closeConnection(true);\n $retour = $result->fetchrow();\n return $retour[0];\n}", "function SUELDO_MINIMO($_ARGS) {\r\n\t$sql = \"SELECT\r\n\t\t\t\tMonto\r\n\t\t\tFROM\r\n\t\t\t\tmastsueldosmin\r\n\t\t\tWHERE\r\n\t\t\t\tPeriodo = (SELECT MAX(Periodo) FROM mastsueldosmin WHERE Periodo <= '\".$_ARGS['PERIODO'].\"')\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\tif (mysql_num_rows($query) != 0) $field = mysql_fetch_array($query);\r\n\treturn $field['Monto'];\r\n}", "function\nquery_for_month($language, $target_area, $season, $start_date, $stop_date, $freeze_date, $status)\n{\n $obs_query = \"SELECT ob.frequency, ob.\\\"date\\\", ob.\\\"time\\\", ob.o\"\n .\" FROM parsed_observations ob JOIN ms_use ms USING (stn)\"\n .\" WHERE status='$status'\"\n .\" AND ob.\\\"date\\\" BETWEEN '$start_date' AND '$stop_date'\"\n \t .\" AND ob.\\\"language\\\" = '$language' AND ms.\\\"language\\\" = '$language'\";\n if($freeze_date != \"\")\n $obs_query .= \" AND ob.row_timestamp <= TIMESTAMP '$freeze_date'\";\n\n // this sub query returns the sla targets for the ta, language and month\n $sla_query =\n \"SELECT start_time, min(target) AS target, primary_frequency, secondary_frequency FROM sla\"\n .\" WHERE season = '$season'\".\" AND target_area = '$target_area'\"\n .\" AND valid_from <= '$stop_date'\"\n .\" AND(valid_to IS NULL OR valid_to >= '$start_date')\"\n .\" AND \\\"language\\\" = '$language'\"\n .\" GROUP BY start_time, primary_frequency, secondary_frequency\";\n\n // this sub query collects the obervations into the sla bins and finds the max score for each bin\n return\n \" SELECT s.start_time, target, o.\\\"date\\\", max(o.o) AS o\"\n .\" FROM($sla_query) AS s LEFT JOIN($obs_query) AS o\"\n .\" ON o.\\\"time\\\" BETWEEN s.start_time AND(s.start_time + '00:30:00'::interval)\"\n .\" WHERE (o.frequency = ANY(s.primary_frequency) OR o.frequency = ANY(s.secondary_frequency))\"\n .\" GROUP BY s.start_time, s.target, o.\\\"date\\\"\";\n}" ]
[ "0.53664845", "0.4902595", "0.4895765", "0.48171052", "0.48142895", "0.4790387", "0.4750255", "0.47181535", "0.46908593", "0.46673393", "0.46537486", "0.45589516", "0.45520145", "0.4521064", "0.44943503", "0.4493331", "0.4482688", "0.44791892", "0.4469322", "0.44574177", "0.44240838", "0.43899155", "0.43835166", "0.43774462", "0.43723643", "0.43687555", "0.43682483", "0.43537277", "0.4338225", "0.43278477" ]
0.57090414
0
Filter the query on the id_contact column Example usage: $query>filterByIDContact(1234); // WHERE id_contact = 1234 $query>filterByIDContact(array(12, 34)); // WHERE id_contact IN (12, 34) $query>filterByIDContact(array('min' => 12)); // WHERE id_contact > 12
public function filterByIDContact($iDContact = null, $comparison = null) { if (is_array($iDContact)) { $useMinMax = false; if (isset($iDContact['min'])) { $this->addUsingAlias(FPartenaireTableMap::COL_ID_CONTACT, $iDContact['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($iDContact['max'])) { $this->addUsingAlias(FPartenaireTableMap::COL_ID_CONTACT, $iDContact['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(FPartenaireTableMap::COL_ID_CONTACT, $iDContact, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customerContactsSL($filters, $custID){\n\t\t\t$sql = \"SELECT *\n\t\t\t\t\tFROM `customers_contacts`\n\t\t\t\t\tWHERE `id_customer` = '{$custID}'\";\n\t\t\treturn $this->asList($sql, 'id_contact');\n\t\t}", "public function filterByIdCustomer($idCustomer = null, $comparison = null)\n\t{\n\t\tif (is_array($idCustomer)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idCustomer['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_CUSTOMER, $idCustomer['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idCustomer['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_CUSTOMER, $idCustomer['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_CUSTOMER, $idCustomer, $comparison);\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id) && null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this->addUsingAlias(ContactPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CardPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CardPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CardPeer::ID, $id, $comparison);\n }", "public function filterId(int $id): self;", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::ID, $id, $comparison);\n }", "public function filterByServiceId($serviceId = null, $comparison = null)\n {\n if (is_array($serviceId)) {\n $useMinMax = false;\n if (isset($serviceId['min'])) {\n $this->addUsingAlias(ContactPeer::SERVICE_ID, $serviceId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($serviceId['max'])) {\n $this->addUsingAlias(ContactPeer::SERVICE_ID, $serviceId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::SERVICE_ID, $serviceId, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(ZipToCityPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(ZipToCityPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ZipToCityPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(ClientiTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(ClientiTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientiTableMap::COL_ID, $id, $comparison);\n }", "public function ByContactID($id)\n\t{\n\t\t$restraint = new DotCoreDALRestraint();\n\t\t$restraint->AddRestraint(\n\t\t\tnew DotCoreFieldRestraint($this->getFieldContactID(), $id));\n\n\t\treturn $this->Restraints($restraint);\n\t}", "public function filterByIdSupplier($idSupplier = null, $comparison = null)\n\t{\n\t\tif (is_array($idSupplier)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idSupplier['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_SUPPLIER, $idSupplier['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idSupplier['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_SUPPLIER, $idSupplier['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_SUPPLIER, $idSupplier, $comparison);\n\t}", "public function filterByIdCargo($idCargo = null, $comparison = null)\n\t{\n\t\tif (is_array($idCargo)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idCargo['min'])) {\n\t\t\t\t$this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idCargo['max'])) {\n\t\t\t\t$this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo, $comparison);\n\t}", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(FreeShippingPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(FreeShippingPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(FreeShippingPeer::ID, $id, $comparison);\n }", "public function filterByIdManufacturer($idManufacturer = null, $comparison = null)\n\t{\n\t\tif (is_array($idManufacturer)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idManufacturer['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idManufacturer['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer, $comparison);\n\t}", "public function filterByCustomerId($customerId = null, $comparison = null)\n {\n if (is_array($customerId)) {\n $useMinMax = false;\n if (isset($customerId['min'])) {\n $this->addUsingAlias(RemoteAppPeer::CUSTOMER_ID, $customerId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($customerId['max'])) {\n $this->addUsingAlias(RemoteAppPeer::CUSTOMER_ID, $customerId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(RemoteAppPeer::CUSTOMER_ID, $customerId, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n\t{\n\t\tif (is_array($id) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $id, $comparison);\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SocioTableMap::COL_ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(AlumnoTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(AlumnoTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AlumnoTableMap::COL_ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(RemoteAppPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TrabajosTableMap::COL_ID, $id, $comparison);\n }", "function createObjectFilter($opt) {\n\textract($opt);\n\n\t//make an array if we only have a singular column value\n\tif (is_array($object_filter)) $str = implode(\",\",$object_filter);\n\telse $str = $object_filter;\n\n\t$sql = \"SELECT id FROM docmgr.dm_object WHERE id IN (\".$str.\")\";\n\n\treturn $sql;\n\n}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MateriaTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MateriaTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MateriaTableMap::COL_ID, $id, $comparison);\n }", "public function filterByIdPersona($idPersona = null, $comparison = null)\n\t{\n\t\tif (is_array($idPersona)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idPersona['min'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idPersona['max'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona, $comparison);\n\t}", "public function filterUser(int $id): self;", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MapTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MapTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MapTableMap::COL_ID, $id, $comparison);\n }" ]
[ "0.59569854", "0.5794039", "0.572715", "0.56802535", "0.55793524", "0.55549866", "0.5431466", "0.53855306", "0.53632826", "0.5352048", "0.5304842", "0.52497417", "0.52341574", "0.51872474", "0.51688474", "0.5168229", "0.51607233", "0.51512164", "0.51450753", "0.5132014", "0.5132014", "0.5114834", "0.5093487", "0.50921893", "0.5071959", "0.5065324", "0.5057995", "0.5052899", "0.5050544", "0.5046098" ]
0.60712636
0
Filter the query by a related \IConcernePays object
public function filterByIConcernePays($iConcernePays, $comparison = null) { if ($iConcernePays instanceof \IConcernePays) { return $this ->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $iConcernePays->getIDInfos(), $comparison); } elseif ($iConcernePays instanceof ObjectCollection) { return $this ->useIConcernePaysQuery() ->filterByPrimaryKeys($iConcernePays->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByIConcernePays() only accepts arguments of type \IConcernePays or Collection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query()\n {\n $company_id = request()->company_id;\n\n $trips = Trips::CompanyPayoutTripsOnly()->select('trips.*','users.company_id as company_id','companies.name as company_name')\n ->with(['currency','driver']);\n\n if($this->filter_type == 'Weekly') {\n $trips = $trips\n ->whereHas('driver',function($q) use ($company_id){\n $q->where('company_id',$company_id);\n })\n ->groupBy(DB::raw('WEEK(trips.created_at)'));\n }\n else if($this->filter_type == 'OverAll') {\n $trips = $trips->groupBy('users.company_id');\n }\n\n $trips = $trips->get();\n return $this->applyScopes($trips);\n }", "public function scopeFilterPaid($query)\n {\n return $query->where('pay_cycle_id', null);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(AnotacaoCasoPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PeliculaPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(NegocioPeer::ID, $key, Criteria::EQUAL);\n }", "public function getApproved(Filter $filter): Collection;", "public function searchPesificacionesSinCompletar()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n $criteria->condition= \"estado=:estado\";\n\t\t$criteria->params = array(':estado'=> Pesificaciones::ESTADO_ABIERTO);\n\n\t\t//$criteria->condition= \"(t.montoAcreditar+t.montoGastos) NOT IN (SELECT SUM(cheques.montoOrigen) FROM cheques, detallePesificaciones WHERE detallePesificaciones.chequeId=cheques.id AND detallePesificaciones.pesificacionId=t.id)\";\n\t\treturn new CActiveDataProvider(new Pesificaciones, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchPrzydzielanie()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t//$this->relations(array('not_in_hasDomains'=>array(self::HAS_MANY,'KlientHasDomains', 'domains_id', 'condition'=>'not_in_hasDomains.domains_id is not null')));\n\t\t $criteria->together = true;\n\t\t$criteria->with=array('przydzielenies', 'not_in_hasDomains'=>array(\tself::HAS_MANY,'KlientHasDomains', 'domains_id', \n\t\t\t\t'joinType' => 'INNER JOIN',\n\t\t\t\t//'on' => \"(not_in_hasDomains.domains_id is not null)\",\n\t\t\t\t'condition'=>'')\n\t\t );\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('user_id',$this->user_id,true);\n\t\t$criteria->compare('name',$this->name);\n\t\t$criteria->compare('expiry_date',$this->expiry_date,true);\n\t\t$criteria->compare('registrar',$this->registrar,true);\n\t\t$criteria->compare('added_date',$this->added_date,true);\n\t\t$criteria->compare('client',$this->client,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->addBetweenCondition('expiry_date', $this->expiry_date_od, $this->expiry_date_do);\n\t\n\t\tif($this->przydzielone) {\n\t\t$criteria->addCondition('przydzielenies.domains_id is null');\n\t\t}\n\t\t\n\t\t//$criteria->addCondition('klients is null');\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t'criteria'=>$criteria,\n\t\t\t\t'sort'=>array(\n\t\t\t\t\t\t'defaultOrder'=>array(\n\t\t\t\t\t\t\t\t'expiry_date'=>false\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'pagination'=>array(\n\t\t\t\t\t\t'pageSize'=>5,\n\t\t\t\t),\n\t\n\t\t));\n\t}", "public function getTakeaways()\n {\n return $this->hasMany(Takeaway::className(), ['id_cliente' => 'id_cliente']);\n }", "public function programas(){\n return $this\n ->belongsToMany('App\\Models\\Carrera', 't_institutos_carreras', 'id_instituto', 'id_carrera')->where('activo','=', 1);;\n }", "public function FromCashiers()\n {\n return $this->belongsTo('App\\Http\\Models\\Cashiers' ,'FromCashierID')->select();\n }", "public function search($params)\n {\n $query = A2Liquidaciones::find();\n\n //$query->joinWith('operacionInmobiliaria',false, 'INNER JOIN');\n\n $query->joinWith(['operacionInmobiliaria' => function ($q) {\n $q->joinWith(['inmueble', 'cliente']);\n //$q->joinWith('cliente');\n }], false, 'INNER JOIN');\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'sin_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<0\");\n }\n\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'por_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(`a2_operaciones_inmobiliarias`.`hasta_anio`,'-',\n `a2_operaciones_inmobiliarias`.`hasta_mes`,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>=-70\");\n }\n\n //VENCIDAS\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND (DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>0 AND \n DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<=30) \");\n }\n\n //VENCIDAS MAS DE UN MES\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas_mas_mes') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>30 \");\n }\n\n // add conditions that should always apply here\n if ($params['A2LiquidacionesSearch']['estado'] == 'ACTIVO') {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'liq_anio' => SORT_DESC,\n 'liq_mes' => SORT_DESC,\n ]\n ],\n ]);\n } else {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'fecha_pago' => SORT_DESC,\n ]\n ],\n ]);\n }\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n if (!empty($this->periodo)) {\n $arreglo_periodo = explode(\"/\", $this->periodo);\n $this->liq_mes = $arreglo_periodo[0];\n $this->liq_anio = $arreglo_periodo[1];\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id_liquidacion' => $this->id_liquidacion,\n 'id_operacion' => $this->id_operacion,\n 'liq_anio' => $this->liq_anio,\n 'liq_mes' => $this->liq_mes,\n 'fecha_pago' => $this->fecha_pago,\n 'monto_pagado' => $this->monto_pagado,\n 'monto_intereses' => $this->monto_intereses,\n 'timestamp' => $this->timestamp,\n ]);\n\n\n $query->andFilterWhere(['like', 'usuario', $this->usuario])\n ->andFilterWhere(['like', 'a2_liquidaciones.estado', $this->estado])\n ->andFilterWhere(['like', 'a2_noticias.direccion', $this->direccion])\n ->andFilterWhere(['like', 'a2_clientes.nombre', $this->cliente]);\n\n\n return $dataProvider;\n }", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "public function filter(BrochureFilterRequest $request)\n {\n $input = $request->all();\n $sort_type = 'DESC';\n if ($request->has('sort_type') && $input['sort_type'] === 'a') {\n $sort_type = 'ASC';\n }\n\n $brochures = Brochure::active();\n if ($request->has('user_id')) {\n $brochures->where('provider_id', $input['user_id']);\n }\n\n return new BrochureCollection(\n $brochures->orderBy(\"created_at\", $sort_type)\n ->paginate(10)\n );\n\n }", "public function useIConcernePaysQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinIConcernePays($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'IConcernePays', '\\IConcernePaysQuery');\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(PagocontrareciboPeer::IDPAGOCONTRARECIBO, $key, Criteria::EQUAL);\n }", "public function searchConce()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t//obtener los alumnos de la convocatoria actual\n\t\t$convocatoria = Convocatoria::model()->find(\"con_estado=1\")->con_semestre;\n\t\t$alumnos=Alumno::model()->findAll(\"con_semestre='\".$convocatoria.\"' AND al_campus='Concepción'\");\n\n\t\t$criteria=new CDbCriteria;\n\t\t$condicion='';\n\n\t\t$j=0;\n\t\t$cantidad=0;\n\n\t\t//obtener los proyectos de los alumnos\n\t\tfor ($i=0; $i < count($alumnos); $i++) {\n\t\t\t\n\t\t\t//obtener el proyecto del alumno\n \t\t\t$proyecto = Alumnoproyecto::model()->find(\"al_rut='\".$alumnos[$i]->al_rut.\"'\");\n\t\t\t\n\n\t\t\t//si el alumno tiene un proyecto\n\t\t\tif(count($proyecto)>0){\n\t\t\t\n\t\t\t//para que no se le ponga \"or\" al principio ni al final \n\t\t\tif($cantidad>=1){\n\t\t\t\t$condicion=$condicion.\" or \";\t\t\n\t\t\t}\n\t\t\t\t$condicion=$condicion.\"pro_idProyecto=\".$proyecto->pro_idProyecto;\n\t\t\t\t$cantidad++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//si no hay ningun proyecto\n\t\tif($cantidad==0){\n\t\t\t$condicion=\"pro_idProyecto=-1\";\n\t\t}\n\n\t\t$criteria->addCondition($condicion);\n\t\t$criteria->compare('pro_idProyecto',$this->pro_idProyecto);\n\t\t$criteria->compare('pro_titulo',$this->pro_titulo,true);\n\t\t$criteria->compare('pro_duracion',$this->pro_duracion,true);\n\t\t$criteria->compare('pro_ambito',$this->pro_ambito,true);\n\t\t$criteria->compare('pro_emNombre',$this->pro_emNombre,true);\n\t\t$criteria->compare('pro_emContacto',$this->pro_emContacto,true);\n\t\t$criteria->compare('pro_emTelefono',$this->pro_emTelefono,true);\n\t\t$criteria->compare('emEmail',$this->emEmail,true);\n\t\t$criteria->compare('pro_profeNombre',$this->pro_profeNombre,true);\n\t\t$criteria->compare('pro_profeEmail',$this->pro_profeEmail,true);\n\t\t$criteria->compare('pro_profeTelefono',$this->pro_profeTelefono,true);\n\t\t$criteria->compare('pro_dirEscuela',$this->pro_dirEscuela,true);\n\t\t$criteria->compare('pro_vBEscuela',$this->pro_vBEscuela,true);\n\t\t$criteria->compare('pro_aporteValorado',$this->pro_aporteValorado);\n\t\t$criteria->compare('pro_aportePecuniario',$this->pro_aportePecuniario);\n\t\t$criteria->compare('pro_resumenEjecutivo',$this->pro_resumenEjecutivo,true);\n\t\t$criteria->compare('pro_descripcionEmpresa',$this->pro_descripcionEmpresa,true);\n\t\t$criteria->compare('pro_definicionProblema',$this->pro_definicionProblema,true);\n\t\t$criteria->compare('pro_solucionPropuesta',$this->pro_solucionPropuesta,true);\n\t\t$criteria->compare('pro_estadoArte',$this->pro_estadoArte,true);\n\t\t$criteria->compare('pro_objetivoGeneral',$this->pro_objetivoGeneral,true);\n\t\t$criteria->compare('pro_metodologia',$this->pro_metodologia,true);\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function buscarPorFiltros($filters, $personalShopper = 0) {\n// echo \"<pre>\";\n// print_r($filters);\n// echo \"</pre>\";\n// Yii::app()->end();\n\n $criteria = new CDbCriteria;\n \n $criteria->with = array();\n //$criteria->select = array();\n //$criteria->select[] = \"t.*\";\n \n $havingPrecio = '';\n \n for ($i = 0; $i < count($filters['fields']); $i++) {\n \n $column = $filters['fields'][$i];\n $value = $filters['vals'][$i];\n $comparator = $filters['ops'][$i];\n \n if($i == 0){\n $logicOp = 'AND'; \n }else{ \n $logicOp = $filters['rels'][$i-1]; \n } \n \n if($column == 'campana')\n {\n \n $value = ($comparator == '=') ? \"=\".$value.\"\" : $value;\n \n $criteria->compare('campana.nombre', $value,\n true, $logicOp);\n \n \n $criteria->with[] = 'campana';\n \n \n continue;\n }\n \n if($column == 'precio')\n {\n $criteria->addCondition('(select sum(precios.precioDescuento) from `tbl_look_has_producto` `productos_productos`, `tbl_producto` `productos`, `tbl_precio` `precios` \n where `t`.`id`=`productos_productos`.`look_id` and `productos`.`id`=`productos_productos`.`producto_id` and \n `precios`.`tbl_producto_id`=`productos`.`id`) '\n .$comparator.' '.$value.'', $logicOp); \n \n \n continue;\n } \n \n if($column == 'marca')\n { \n \n $criteria->with['productos'] = array(\n 'select'=> false,\n //'joinType'=>'INNER JOIN',\n //'condition'=>'productos.nombres = 8',\n ); \n \n //having\n if(!strpos($criteria->group, \"t.id\")){\n $criteria->group = 't.id';\n }\n \n //agregar condicion marca_id\n $criteria->addCondition('productos.marca_id'\n .$comparator.' '.$value.'', $logicOp); \n \n continue;\n } \n \n if($column == 'prendas')\n {\n $criteria->addCondition('(select count(look_id) \n from `tbl_look_has_producto` `productos_productos`\n where `t`.`id`=`productos_productos`.`look_id`)'\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n \n if($column == 'cantidad')\n {\n /*\n * Por cada orden se esta contando el look como vendido una \n * sola vez asi aparezca dos veces en la misma orden\n * \n * Luego se debe corregir para que cuente correctamente si \n * el look ha sido pedido mas de una vez en una orden\n */\n \n $criteria->addCondition('\n (select count(distinct(orden.id)) from tbl_orden_has_productotallacolor o_ptc, tbl_orden orden\n where o_ptc.tbl_orden_id = orden.id\n and\n o_ptc.look_id > 0\n and\n o_ptc.look_id = t.id\n and\n orden.estado IN (3, 4, 8))'\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n \n if($column == 'monto')\n {\n \n $criteria->addCondition('\n (select count(distinct(orden.id)) from tbl_orden_has_productotallacolor o_ptc, tbl_orden orden\n where o_ptc.tbl_orden_id = orden.id\n and\n o_ptc.look_id > 0\n and\n o_ptc.look_id = t.id\n and\n orden.estado IN (3, 4, 8)) \n *\n (select sum(precios.precioDescuento) from `tbl_look_has_producto` `productos_productos`, `tbl_producto` `productos`, `tbl_precio` `precios` \n where `t`.`id`=`productos_productos`.`look_id` and `productos`.`id`=`productos_productos`.`producto_id` and \n `precios`.`tbl_producto_id`=`productos`.`id`)\n '\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n\n\t\t\t\tif($column == 'ocasion')\n {\n \t\n\t\t\t\t\t$criteria->compare('categoriahaslook.categoria_id', $comparator.\" \".$value,\n\t false, $logicOp);\n\t\t\t\t\t$criteria->with[] = 'categoriahaslook';\n\t\t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n }\n\n\t\t\t\tif($column == 'activo')\n {\t \n\t\t\t\t\t \t $criteria->compare(\"t.activo\", $comparator.$value, \n\t false, $logicOp);\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\tif($column == 'inactivo')\n {\n\t\t\t\t\t$value = ($value == 1) ? 0 : 1; // el contrario\n\t\t\t\t\t\n\t\t\t\t\t $criteria->compare(\"t.activo\", $comparator.$value, \n\t false, $logicOp);\n\t\t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n } \n \n if($column == 'created_on')\n {\n $value = strtotime($value);\n $value = date('Y-m-d H:i:s', $value);\n }\n\n\n\n $criteria->compare(\"t.\".$column, $comparator.\" \".$value,\n false, $logicOp);\n \n }\n \n// $criteria->select = 't.*';\n $criteria->having .= $havingPrecio;\n //$criteria->with = array('categorias', 'preciotallacolor', 'precios');\n $criteria->together = true;\n \n //si se estan usando los filtros en Mis Looks\n if($personalShopper){\n $criteria->compare('t.user_id', $personalShopper); //siempre los no eliminados\n }\n \n \n// echo \"Criteria:\";\n// \n// echo \"<pre>\";\n// print_r($criteria->toArray());\n// echo \"</pre>\"; \n //exit();\n\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function originPrices()\n {\n return $this->hasMany('App\\Price', 'origin_country_id');\n }", "public function relationshipFilter()\n\t{\n\t\tee()->load->add_package_path(PATH_ADDONS.'relationship');\n\t\tee()->load->library('EntryList');\n\t\tee()->output->send_ajax_response(ee()->entrylist->ajaxFilter());\n\t}", "function Inscription_Certificates_All_Where()\n {\n $type=$this->CGI_GET(\"Type\");\n $where=$this->UnitEventWhere\n (\n array\n (\n \"Type\" => $this->Certificate_Type,\n )\n );\n\n return $where;\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(TorneoCategoriaPeer::ID_TORNEO_CATEGORIA, $key, Criteria::EQUAL);\n\t}", "public function search2()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id_periodo',20);\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('folio',$this->folio);\n\t\t$criteria->compare('fecha_ing',$this->fecha_ing,true);\n\t\t$criteria->compare('factura',$this->factura,true);\n\t\t$criteria->compare('importe',$this->importe);\n\t\t$criteria->compare('numerocheque',$this->numerocheque);\n\t\t$criteria->compare('partida',$this->partida);\n\t\t$criteria->compare('fecha_contrarecibo',$this->fecha_contrarecibo,true);\n\t\t$criteria->compare('no_contrarecibo',$this->no_contrarecibo,true);\n\t\t$criteria->compare('detalle',$this->detalle,true);\n\t\t$criteria->compare('id_proveedor',$this->id_proveedor);\n\t\t$criteria->compare('clasif',$this->clasif);\n\t\t$criteria->compare('tipo_docto',$this->tipo_docto);\n\t\t$criteria->compare('id_periodo',20);\n\t\t\n\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchPrint()\n {\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\t\t$criteria->compare('rincianclosing_id',$this->rincianclosing_id);\n\t\t$criteria->compare('closingkasir_id',$this->closingkasir_id);\n\t\t$criteria->compare('nourutrincian',$this->nourutrincian);\n\t\t$criteria->compare('nilaiuang',$this->nilaiuang);\n\t\t$criteria->compare('banyakuang',$this->banyakuang);\n\t\t$criteria->compare('jumlahuang',$this->jumlahuang);\n // Klo limit lebih kecil dari nol itu berarti ga ada limit \n $criteria->limit=-1; \n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination'=>false,\n ));\n }", "public function filtrarclientes(){\n\n $this->request->allowMethod(['get']);\n \n $keyword = $this->request->query('keyword');\n $activo = $this->request->query('activo');\n\n $condiciones = array();\n\n $condiciones['name like '] = '%'.$keyword.'%';\n\n if($activo){\n $condiciones['borrado = '] = false;\n }\n \n $query = $this->Clientes->find('all', [\n 'conditions' => $condiciones,\n 'order' => [\n 'Clientes.id' => 'ASC'\n ],\n 'limit' => 100\n ]);\n\n $clientes = $this->paginate($query);\n $this->set(compact('clientes'));\n $this->set('_serialize', 'clientes');\n }", "public function filteredByDate(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->whereBetween('created_at',[Date(\"Y-m-d\", $request->start/1000).\" 00:00:00\", Date(\"Y-m-d\", $request->end/1000).\" 23:59:59\"])\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }", "abstract protected function foreignIDFilter($id = null);", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(LpPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ActividadPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function searchWolne()\n\t{\n\t\t$criteria= new CDbCriteria;\n\t\t$criteria->addNotInCondition('id', $this->id);\n\t\t$klienthasdomais = KlientHasDomains::model()->findAll($criteria);\n\t\t$domeny_zajente = array();\n\t\tforeach ($klienthasdomais as $khd){\n\t\t\tarray_push($domeny_zajente, $khd['domains_id']);\n\t\t}\n\t\n\t\t$criteria=new CDbCriteria;\n\t\t//$criteria->with = array('not_in_hasDomains');\n\t\t//$criteria->addNotInCondition('kl', $values)\n\t\n\t\t$criteria->addNotInCondition('id',$domeny_zajente);\n\t\t//$criteria->compare('user_id',$this->user_id,true);\n\t\t$criteria->compare('name',$this->name);\n\t\t//$criteria->compare('expiry_date',$this->expiry_date,true);\n\t\t//$criteria->compare('registrar',$this->registrar,true);\n\t\t//$criteria->compare('added_date',$this->added_date,true);\n\t\t$criteria->compare('client',$this->client,true);\n\t\t//$criteria->compare('phone',$this->phone,true);\n\t//\t$criteria->compare('email',$this->email,true);\n\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}" ]
[ "0.5257184", "0.5186439", "0.50765485", "0.5068911", "0.5060244", "0.5034767", "0.49791214", "0.49419966", "0.4924594", "0.4924459", "0.4923939", "0.48719427", "0.4864781", "0.48574683", "0.48567918", "0.48467356", "0.484182", "0.48295373", "0.48228535", "0.48119122", "0.48018175", "0.48009643", "0.47865313", "0.47787276", "0.47699985", "0.4756977", "0.47514802", "0.47446468", "0.47338128", "0.47303241" ]
0.5782482
0
Adds a JOIN clause to the query using the IConcernePays relation
public function joinIConcernePays($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('IConcernePays'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'IConcernePays'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useIConcernePaysQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinIConcernePays($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'IConcernePays', '\\IConcernePaysQuery');\n }", "function joinQuery()\n {\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "public function getJoinExpression();", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "public function joinBills()\n {\n $this->builder->join('bills', 'bil_id', 'rc_bill');\n }", "protected abstract function getJoinClause(array $joins);", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function innerJoin($table);", "public function visitJoinClause(\n /*IJoinClause*/ $node) /*: mixed*/ {\n $id = $node->getIdentifier();\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $left = null;\n $left_value = $node->getLeft();\n if ($left_value != null) {\n $left = /*(string)*/$left_value->accept($this);\n }\n $right = null;\n $right_value = $node->getRight();\n if ($right_value != null) {\n $right = /*(string)*/$right_value->accept($this);\n }\n $group = $node->getGroup();\n\n $result = 'join ';\n if ($id !== null) {\n $result .= '$'.$id.' in ';\n }\n $result .= $collection;\n if ($left !== null && $right !== null) {\n $result .= \" on $left equals $right\";\n if ($group !== null) {\n $result .= ' into '.$group;\n }\n }\n return $result;\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function innerJoin($table, $conditions = []);", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "abstract public function join($alias_from, $rel_name, $alias_to);", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }" ]
[ "0.65018654", "0.6084332", "0.5795712", "0.5771382", "0.56853354", "0.54811746", "0.54685354", "0.5439745", "0.53833187", "0.5378942", "0.5371064", "0.53464717", "0.5333564", "0.5320476", "0.53058743", "0.52861017", "0.52651405", "0.5255205", "0.5233911", "0.5230929", "0.5223461", "0.5220743", "0.5218198", "0.52015966", "0.5200427", "0.51992506", "0.5192377", "0.5188066", "0.51856685", "0.51773185" ]
0.6496832
1
Use the IConcernePays relation IConcernePays object
public function useIConcernePaysQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinIConcernePays($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'IConcernePays', '\IConcernePaysQuery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByIConcernePays($iConcernePays, $comparison = null)\n {\n if ($iConcernePays instanceof \\IConcernePays) {\n return $this\n ->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $iConcernePays->getIDInfos(), $comparison);\n } elseif ($iConcernePays instanceof ObjectCollection) {\n return $this\n ->useIConcernePaysQuery()\n ->filterByPrimaryKeys($iConcernePays->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByIConcernePays() only accepts arguments of type \\IConcernePays or Collection');\n }\n }", "public function cai () {\n return $this->belongsTo(Cai::class);\n }", "public function coa(): belongsTo\n {\n return $this->belongsTo(COA::class,'coa_id');\n }", "public function getConvocados()\n {\n return $this->hasMany(InterConvocados::className(), ['modo_id' => 'id']);\n }", "public function inscripciones(){\n return $this->hasMany('App\\Models\\Inscripcion');\n }", "public function getCind()\n {\n return $this->hasOne(ComportamientoIndicador::className(), ['cind_id' => 'cind_id']);\n }", "public function concessionaires(){\n return $this->hasMany('App\\Concessionaire');\n }", "public function comics() {\n\t\treturn $this->belongsToMany('Comic');\n\n\t}", "public function concessionaires()\n {\n return $this->hasMany('App\\Models\\Concessionaire');\n }", "public function getAssociation()\n {\n\n }", "public function condominos()\n {\n return $this->belongsTo('VCCon\\Domains\\Condominos\\Models\\Condomino', 'condomino_id');\n }", "public function coordinacion()\n {\n \treturn $this->belongsTo('App\\Coordinacion','tCoordinacion_idCoordinacion', 'idCoordinacion');\n }", "public function actaConcertacion()\n {\n return $this->hasMany('App\\ActaConcetacion');\n }", "public function inscripcion(){\n return $this->belongsTo('App\\Models\\Inscripcion');\n }", "public function cate()\n {\n return $this->belongsTo(Cate::class);\n }", "public function CicloCDI(){\n return $this->belongsTo(Ciclo::class, 'ciclo_id', 'id');\n }", "public function intereses()\n {\n return $this->belongsToMany('App\\Intereses1','cliente_intereses1','cliente_id', 'intereses1_id');\n }", "public function pais(){\r\n return $this->belongsTo('pais');\r\n }", "public function getTakeaways()\n {\n return $this->hasMany(Takeaway::className(), ['id_cliente' => 'id_cliente']);\n }", "public function citas()\n \t\t{\n \t\t\treturn $this->hasMany(Cita::class);\n \t\t}", "public function LayToanBoLopGiangVienDay()\n {\n return $this->hasMany('App\\Models\\lopmonhoc', 'GiangVien_Id','IdGiangVien');\n }", "public function compras(){\n return $this->hasMany('App\\CompraInsumo');\n }", "public function citas()\n {\n return $this->belongsToMany(Cita::class);\n }", "public function coaches()\n {\n return $this->hasMany('App\\Coach');\n }", "public function getCodope(){\n\t\treturn $this->codope;\n\t}", "public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }", "public function coches(){\n return $this->hasMany(Coche::class);\n }", "public function getApInvs()\n {\n return $this->hasMany(ApInv::className(), ['currency_id' => 'currency_id']);\n }", "public function conocimiento_idiomas(){\n\t\treturn $this->hasMany('App\\ConocimientoIdioma', 'Idm_ID_Asp');\n\t}", "public function contract_has_many_invoices()\n {\n $this->assertEquals(self::$contract->invoice(), self::$contract->hasMany('App\\Invoice', 'contract_id'));\n }" ]
[ "0.54829735", "0.52944255", "0.51724446", "0.5141058", "0.51190513", "0.5112738", "0.5101737", "0.5090666", "0.5056922", "0.5028633", "0.50052315", "0.5001507", "0.498274", "0.49762902", "0.49697334", "0.49585783", "0.4956564", "0.4929576", "0.49202684", "0.4912594", "0.4907057", "0.48851582", "0.487354", "0.4868365", "0.48590875", "0.48526523", "0.48521617", "0.48409638", "0.47914332", "0.4790645" ]
0.6053427
0
Prepare data for update
protected function _prepareUpdateData($data) { $dataPrepared = array( 'name' => $data->getName(), 'module_id' => $data->getModule_id(), 'system' => $data->getSystem(), 'person_id' => $data->getPerson_id(), 'color' => $data->getColor(), ); return $dataPrepared; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function prepareData();", "protected function prepareDataForUpdate(){\n\n\t\t// the object get by isUsing function\n\t\t$object = $this->_currentObject[$this->_model->alias];\n\t\t$post = $this->request->data;\n\t\tif (!$this->_model->validates()){\n\t\t\tthrow new NotFoundException($this->_model->getValidateMessage());\n\t\t}\n\t\tif ($object['assign_situation_id'] == 1 && $post['assign_situation_id'] == 2){\n\t\t\t// in this case we can update all\n\t\t\t$updateData = $post;\n\t\t}else {\n\t\t\tif (!in_array($post['assign_situation_id'], array(0,1,2,9))){\n\t\t\t\tthrow new Exception('assign_situation_id not in range (0,1,2,9)');\n\t\t\t}\n\t\t\t// only update assign situation\n\t\t\t$updateData = array(\n\t\t\t\t'id' => $post['id'],\n\t\t\t\t'assign_situation_id' => $post['assign_situation_id']\n\t\t\t);\n\t\t}\n\t\treturn $updateData;\n\t}", "abstract public function updateData();", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "protected function rewriteData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$fields = array('someval_facebook_valid', 'someval_facebook_type', 'someval_facebook_friends_or_likes',\n\t\t\t\t\t\t'someval_twitter_valid', 'someval_twitter_tweets', 'someval_twitter_followers', 'someval_twitter_following');\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\t\t\t$query = $db->getQuery(true);\n\n\t\t\t$query->update($db->qn('#__accountdata'))\n\t\t\t\t\t->where('bid = ' . $elm->bid);\n\n\t\t\tforeach ($fields as $f)\n\t\t\t{\n\t\t\t\t$query->set($db->qn($f) . ' = ' . $db->q($elm->$f));\n\t\t\t}\n\n\t\t\t$db->setQuery($query);\n\n\t\t\tif (!$db->execute())\n\t\t\t{\n\t\t\t\tLog::add('Something went wrong for bid=:' . $elm->bid);\n\t\t\t}\n\t\t}\n\t}", "protected function preprocessData() {}", "protected function prepareAssignCatActionData()\n {\n foreach ($this->_data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->_urlPath = $value;\n break;\n case 'paramName':\n $this->_paramName = $value;\n break;\n default:\n $this->_additionalData[$key] = $value;\n break;\n }\n }\n }", "private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}", "abstract protected function prepareData( $data );", "protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}", "public function updateAndProcess($data){\n if(is_array($data)){\n foreach($data as $k => $v) {\n if ( $v == \"\") {\n $data[$k] = NULL;\n }\n }\n if(!is_null($data['gridref'])) {\n $data = $this->_processFindspot($data);\n }\n }\n if(array_key_exists('csrf', $data)){\n unset($data['csrf']);\n }\n if(array_key_exists('landownername', $data)){\n unset($data['landownername']);\n }\n if(array_key_exists('parishID', $data) && !is_null($data['parishID'])){\n $parishes = new OsParishes();\n $data['parish'] = $parishes->fetchRow($parishes->select()->where('osID = ?', $data['parishID']))->label;\n }\n if(array_key_exists('countyID', $data) && !is_null($data['countyID'])){\n $counties = new OsCounties();\n $data['county'] = $counties->fetchRow($counties->select()->where('osID = ?', $data['countyID']))->label;\n }\n\n if(array_key_exists('districtID', $data) && !is_null($data['districtID'])){\n $district = new OsDistricts();\n $data['district'] = $district->fetchRow($district->select()->where('osID = ?', $data['districtID']))->label;\n }\n return $data;\n }", "protected function _updatefields() {}", "protected function _prepareSaveData($data = array())\n {\n if (isset($data['id']) && empty($data['id'])) {\n unset($data['id']);\n }\n\n if (isset($data['addl_category_id']) && empty($data['addl_category_id'])) {\n unset($data['addl_category_id']);\n }\n\n if (!empty($data['buyout_price']) && $data['listing_type'] == 'product') {\n $data['start_price'] = $data['buyout_price'];\n }\n\n $keysToUnset = array('rollback_data', 'active', 'approved', 'closed', 'deleted', 'nb_clicks');\n foreach ($keysToUnset as $keyToUnset) {\n if (array_key_exists($keyToUnset, $data)) {\n unset($data[$keyToUnset]);\n }\n }\n\n $startTime = time();\n if (isset($data['start_time_type'])) {\n switch ($data['start_time_type']) {\n case 1: // custom\n $startTime = strtotime($data['start_time']);\n $data['start_time'] = date('Y-m-d H:i:s', $startTime);\n $data['closed'] = 1;\n break;\n default: // now\n $data['start_time'] = new Expr('now()');\n break;\n }\n }\n else if (isset($data['start_time'])) {\n $startTime = strtotime($data['start_time']);\n }\n\n $endTime = null;\n\n $endTimeType = isset($data['end_time_type']) ? $data['end_time_type'] : 0;\n switch ($endTimeType) {\n case 1: // custom\n $endTime = strtotime($data['end_time']);\n $data['duration'] = new Expr('null');\n break;\n default: // duration\n if (!empty($data['duration'])) {\n if ($data['duration'] > 0) {\n $endTime = $startTime + $data['duration'] * 86400;\n }\n }\n break;\n }\n\n if ($endTime) {\n $data['end_time'] = date('Y-m-d H:i:s', $endTime);\n }\n else {\n $data['end_time'] = new Expr('null');\n }\n\n if (!empty($data['stock_levels'])) {\n foreach ($data['stock_levels'] as $key => $value) {\n if (!empty($value[StockLevels::FIELD_OPTIONS])) {\n $data['stock_levels'][$key][StockLevels::FIELD_OPTIONS] = \\Ppb\\Utility::unserialize($value[StockLevels::FIELD_OPTIONS]);\n }\n\n if (!empty($value[StockLevels::FIELD_QUANTITY])) {\n $data['stock_levels'][$key][StockLevels::FIELD_QUANTITY] = abs(intval($value[StockLevels::FIELD_QUANTITY]));\n }\n }\n }\n\n return parent::_prepareSaveData($data);\n }", "public function prepareData()\r\n {\r\n $users_model = new UsersModel();\r\n $users_all = $users_model->getAll(true, false, 'C_FULLNAME');\r\n $users = Groups::getUsers($this->group_id, 'C_FULLNAME');\r\n $users_include = array();\r\n \tforeach ($users as $user_info) {\r\n \t\t$users_include[$user_info['U_ID']] = array(\r\n \t\t\t$user_info['U_ID'],\r\n \t\t\t$user_info['C_FULLNAME']\r\n \t\t);\r\n \t} \r\n \t$users_exclude = array();\r\n \tforeach ($users_all as $user_info) {\r\n \t\tif (!isset($users_include[$user_info['U_ID']])) {\r\n\t \t\t$users_exclude[] = array(\r\n\t \t\t\t$user_info['U_ID'],\r\n\t \t\t\t$user_info['C_FULLNAME']\r\n\t \t\t);\r\n \t\t}\r\n \t}\r\n \t$this->smarty->assign('group_id', $this->group_id);\r\n \t$this->smarty->assign('users_in', json_encode(array_values($users_include)));\r\n \t$this->smarty->assign('users_out', json_encode($users_exclude)); \r\n }", "private function reformatData(): void\n {\n if($this->cover === \"null\") {\n $this->merge([ \"cover\"=> null ]);\n }\n }", "abstract function prepare_data(&$data_arr);", "protected function prepareUpdateData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}", "function prepare_update($id = '', $data = []){\n // if there is no data to set, then return an empty string\n if($data == [] || $id == ''){\n return '';\n }\n $set_sql = '';\n $where_sql = '';\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n\n $where_sql = $this->create_where($id, []);\n \n return \"UPDATE {$this->table_name} $set_sql $where_sql;\";\n }", "protected function prepareDataForSetData ($data)\n\t{\n\t\tif (!isset($data['lending']) || $data['lending'] == null) $data['lending'] = 0;\n\t\tif (!isset($data['stored']) || $data['stored'] == null) $data['stored'] = 0;\n\n\t\t// vars\n\t\t$isEdit = false;\n\t\t$newImage = false;\n\t\t$images = array ('image1', 'image2');\n\n\t\t// prepare\n\t\tforeach ($images as $fieldName) //\n\t\t{\n\t\t\tif (isset($data[$fieldName])){\n\t\t\t\t// if source is form posted form && upload array\n\t\t\t\tif (is_array($data[$fieldName]))\n\t\t\t\t{\n\t\t\t\t\t$isEdit = true; // set when post data from form\n\t\t\t\t\t// was a image uploaded?\n\t\t\t\t\t// --no\n\t\t\t\t\tif (isset($data[$fieldName]['error']) && $data[$fieldName]['error'] > 0) // check for concrete upload array key ['error'] && if error code != 0\n\t\t\t\t\t{\n\t\t\t\t\t\t// delete if error occurred\n\t\t\t\t\t\tunset ($data[ $fieldName ]); \t// from data set\n\t\t\t\t\t\tunset ($images[$fieldName]);\t\t\t// delete from $images\n\t\t\t\t\t}\n\t\t\t\t\t// --yes\n\t\t\t\t\telse $newImage = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if data set is from form\n\t\tif ($isEdit)\n\t\t{\n\t\t\t// is planner object\n\t\t\t// --no\n\t\t\tif ($data['sitePlannerObject'] == '0' || $data['sitePlannerObject'] == null) $data['image'] = null;\n\t\t\t// --yes\n\t\t\telse {\n\t\t\t\t// check selection of witch image should be used\n\t\t\t\t// -- if not set (null) or \"0\" (drawing)\n\t\t\t\tif ($data['sitePlannerImage'] == NULL || $data['sitePlannerImage'] == \"0\")\n\t\t\t\t{\n\t\t\t\t\t$data['image'] = null;\n\t\t\t\t\t// add default values if nothing was set to avoid errors in SitePlanner\n\t\t\t\t\t$data['depth'] = ($data['depth'] == \"0\" || $data['depth'] == NULL) ? 100 : $data['depth'];\n\t\t\t\t\t$data['width'] = ($data['width'] == \"0\" || $data['width'] == NULL) ? 100 : $data['width'];\n\t\t\t\t\t// set diameter on 'width' if round shape was selected\n\t\t\t\t\tif ($data['shape'] == EEquipSitePlannerImage::ROUND_SHAPE)\n\t\t\t\t\t\t$data['width'] = $data['depth'];\n\t\t\t\t}\n\t\t\t\t// -- if an image was selected\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['image'] = ($data['sitePlannerImage'] == EEquipSitePlannerImage::IMAGE_2) ? $data['image2'] : $data['image1'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "private function prepareData(){\n $this->params['crud_url'] = '/'.trim($this->params['crud_url'],'/');\n }", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "public function prepareData()\r\n\t{\r\n\r\n\t\t// Get title and encode it\r\n\t\tif (empty($this->title)) {\r\n\t\t\t$this->title = urlencode(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')));\r\n\t\t}\r\n\r\n\t\t// Get current post permalink and encode it\r\n\t\tif (empty($this->shared_url)) {\r\n\t\t\t$this->shared_url = get_permalink(get_the_ID());\r\n\t\t}\r\n\r\n\t\t// Get excerpt and format it for Twitter\r\n\t\tif (empty($this->tweet)) {\r\n\t\t\t$tweet = (strlen(get_the_excerpt()) > 140) ? substr(get_the_excerpt(), 0, 140) . '...' : get_the_excerpt();\r\n\t\t\t$this->tweet = $tweet . ' ' . $this->shared_url;\r\n\t\t}\r\n\t}", "public function prepareUpdate(array $data): Company\n {\n return $this->update($data);\n }", "protected function cleanData(&$data){\n if(isset($data['field'])){\n $data['field'] = $this->getReference('User\\Entity\\Field', $data['field']['id']);\n }\n\t\tif(isset($data['style'])){\n $data['style'] = $this->getReference('User\\Entity\\Style', $data['style']['id']);\n }\n if(isset($data['sale'])){\n $data['sale'] = $this->getReference('User\\Entity\\Staff', $data['sale']['id']);\n }\n if(isset($data['pm'])){\n $data['pm'] = $this->getReference('User\\Entity\\Staff', $data['pm']['id']);\n }\n if(isset($data['client'])){\n $data['client'] = $this->getReference('\\User\\Entity\\User', $data['client']['id']);\n }\n if(isset($data['sourceLanguage'])){\n $data['sourceLanguage'] = $this->getReference('\\User\\Entity\\Language', $data['sourceLanguage']['id']);\n }\n if(isset($data['startDate'])){\n $data['startDate'] = new \\DateTime($data['startDate']);\n }\n\t\telse {\n\t\t\t$data['startDate'] = new \\DateTime('now');\n\t\t}\n if(isset($data['dueDate'])){\n $data['dueDate'] = new \\DateTime($data['dueDate']);\n }\n\t\telse {\n\t\t\t//$date_tmp = new \\DateTime($data['startDate']);\n\t\t\t$data['dueDate'] = $data['startDate']->add(new DateInterval('P30D'));\n\t\t}\n if(isset($data['status'])){\n $data['status'] = $data['status']['id'];\n }\n\t\tif(isset($data['currency']) && isset($data['currency']['id'])){\n $data['currency'] = $data['currency']['id'];\n }\n\t\tif(isset($data['transGraph']) && isset($data['transGraph']['id']) ){\n $data['transGraph'] = $data['transGraph']['id'];\n }\n\t\tif(isset($data['serviceLevel']) && isset($data['serviceLevel']['id'])){\n $data['serviceLevel'] = $data['serviceLevel']['id'];\n }\n\n\n if(isset($data['priority'])){\n $data['priority'] = $data['priority']['id'];\n }\n if(isset($data['serviceLevel'])) {\n $data['serviceLevel'] = $data['serviceLevel'];\n }\n if(isset($data['invoiceinfo'])) {\n \t$data['invoiceinfo'] = $data['invoiceinfo'];\n }\n if(isset($data['createType'])) {\n \t$data['createType'] = $data['createType'];\n }\n\n if(isset($data['types'])){\n $arr = [];\n foreach($data['types'] as $type){\n $arr[] = $type['id'];\n }\n $data['types'] = $arr;\n }\n\t\telse{\n\t\t\t$arr = [];\n\t\t\tif($data['createType']=='orderTranslationNonContract' || $data['createType'] == 'landingOrder')\n\t\t\t\t$arr[] = 1;\n\t\t\telse\n\t\t\t\t$arr[] = 1;\n\t\t\t$data['types'] = $arr;\n\t\t}\n }", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "function prepData($data)\r\n {\r\n \t$data['data']['Question']['master'] = $data['form']['master'];\r\n\t$data['data']['Question']['type'] = $data['form']['type'];\r\n\t$data['data']['Question']['count'] = $data['form']['data']['Question']['count'];\r\n\r\n\treturn $data;\r\n }", "protected function _flushVars() {\n if (isset($this->LdapObject->id)) {\n $this->LdapObject->id = null;\n }\n if (isset($this->LdapObject->primaryKey)) {\n $this->LdapObject->primaryKey = 'uid';\n }\n \n $this->sforceData = array();\n $this->stagingData = array();\n $this->ldapData = array();\n $this->syncOperation = 'nothing';\n \n }", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "protected function setPutData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}" ]
[ "0.7103722", "0.7100322", "0.6887894", "0.6813769", "0.6648072", "0.65205246", "0.65174204", "0.65110296", "0.64727515", "0.64644086", "0.64620405", "0.64552224", "0.6392809", "0.6330844", "0.63108474", "0.6304468", "0.62723124", "0.6270269", "0.6261377", "0.6257602", "0.62393785", "0.62253654", "0.61780035", "0.61685073", "0.61489224", "0.61462075", "0.6125947", "0.6124659", "0.6114556", "0.6106153" ]
0.7291098
0
Get the URL and return it as a string
public function getUrlAsString(): string { return $this->url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getURL();", "public function getURL();", "protected function getUrl(): string\n {\n return $this->url;\n }", "public function getURL ();", "public static function url(): string\n\t{\n\t\treturn static::$url;\n\t}", "public function get_url();", "public function url(): string\n {\n return $this->url;\n }", "public function url(): string\n {\n return $this->url;\n }", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public function getUrl() {\n return $this->get(self::URL);\n }", "public abstract function getURL();", "public function getUrl() : string\n {\n return $this->url;\n }", "public function getUrl() : string\n {\n return $this->url;\n }", "public function getUrl(): string\n {\n return $this->url;\n }", "public function getUrl(): string\n {\n return $this->url;\n }", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function url(): string\n {\n return strtok($this->getUri(), '?');\n }", "public function getUrl(): string {\n\t\treturn $this->_url;\n\t}", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl()\n {\n return $this->parseUrl();\n }", "public function url(): string;", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }" ]
[ "0.8298792", "0.82575816", "0.8222928", "0.8222928", "0.8146713", "0.80857027", "0.7984615", "0.7959286", "0.79391223", "0.79391223", "0.7905314", "0.7896312", "0.7877292", "0.7848821", "0.7848821", "0.78416365", "0.78416365", "0.7818941", "0.78179413", "0.7758728", "0.77471983", "0.773882", "0.773882", "0.77210677", "0.77035415", "0.77035415", "0.77035415", "0.76951176", "0.76544726", "0.7650061" ]
0.8354214
0
Serializes card to serialization string.
public function serialize(Card $card);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function serialize() \n {\n return serialize([\n 'boardingCardNumber'=>$this->boardingCardId,\n 'arrival'=>$this->arrival, \n 'departure'=>$this->departure, \n 'passenger'=>$this->passenger,\n 'reference'=>$this->reference,\n 'busNo'=>$this->busNo,\n 'platformNo'=>$this->platformNo\n ]);\n }", "public function __toString(): string\n {\n return \"For card number [{$this->cardNumber}] few cards found\";\n }", "public function strRepresentation() {\n\t\t$retstr = \"\";\n\t\t$retstr .= \"Card \".$this->name.\" - \".$this->id.\" is a(n) \".$this->getTypeAsStr().\" card with a cost of \".$this->cost.\".<br />It boosts the following stats:<br />\";\n\t\t$retstr .= \"Body: \";\n\t\t$retstr .= print_r($this->body, true);\n\t\t$retstr .= \"<br />Mind: \";\n\t\t$retstr .= print_r($this->mind, true);\n\t\t$retstr .= \"<br />Soul: \";\n\t\t$retstr .= print_r($this->soul, true);\n\t\t$retstr .= \"<br />And gives a vitality boost of \".$this->vit;\n\t\treturn $retstr;\n\t}", "public function printCardInfo() {\n\t\tprint $this->strRepresentation();\n\t}", "function serialise(): string;", "public function __toString()\n {\n return 'CardGame32 : ' . count($this->cards) . ' carte(s)';\n }", "public function __toString() {\n\t\t$ret = $this->getName() . \" [\" . $this->getGold() . \"]\";\n\n\t\tif ($this->getDoneTurn()) {\n\t\t\t$ret .= \" - DONE\";\n\t\t}\n\n\t\t$ret .= \"\\n\";\n\t\n\t\t$ret .= $this->getCardHand() . \"\\n\";\n\t\t$ret .= $this->getCardPublicStand() . \"\\n\";\n\t\t$ret .= $this->getCardHiddenStand() . \"\\n\";\n\n\t\tif (count($this->getCardAux()) > 0) {\n\t\t\t$ret .= $this->getCardAux() . \"\\n\";\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function toString() : void\n {\n $out = serialize($this);\n \n }", "public function serialize(): string\n {\n return $this->toRawString();\n }", "public function printCard($card)\n {\n $card->printHtml();\n }", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize();", "public function serialize();", "public function serialize();", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\FuturePay\\SDK\\CreditDecisioning\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\FuturePay\\SDK\\CreditDecisioning\\ObjectSerializer::sanitizeForSerialization($this));\n }", "function networkSerialize() : string{\n\t\treturn \"\\x00\" . $this->ids . $this->data . $this->skyLight . $this->blockLight;\n\t}", "final public function serialize(): string\n {\n return \\serialize($this);\n }", "private function _serialize()\r\n {\r\n $values = array(count($this->_items));\r\n foreach ($this->_items as $item)\r\n {\r\n $itemArr = $item->asArray();\r\n foreach ($this->_struct as $key)\r\n {\r\n $values[] = is_null($itemArr[$key]) ? '---' : $itemArr[$key];\r\n }\r\n }\r\n if ($this->getDeliveryGrossAmount() > 0)\r\n {\r\n $values[0]++;\r\n $values[] = 'Delivery';\r\n $values[] = 1;\r\n $values[] = number_format($this->getDeliveryNetAmount(), 2);\r\n $values[] = number_format($this->getDeliveryTaxAmount(), 2);\r\n $values[] = number_format($this->getDeliveryGrossAmount(), 2);\r\n $values[] = number_format($this->getDeliveryGrossAmount(), 2);\r\n }\r\n\r\n return implode(':', $values);\r\n }", "public function serialize(): string\n {\n return serialize($this->toArray());\n }", "public function saveCard($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('saveCard', $value);\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\br.com.conductor.pier.api.v2.invoker\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }" ]
[ "0.6130203", "0.59581643", "0.59273213", "0.5885571", "0.58813125", "0.5772732", "0.5638529", "0.5582901", "0.553565", "0.55190796", "0.55066", "0.55066", "0.55066", "0.55066", "0.55066", "0.55066", "0.55061454", "0.55061454", "0.5470354", "0.5470354", "0.5470354", "0.54401964", "0.54281276", "0.535968", "0.5353501", "0.53388774", "0.5330075", "0.53222287", "0.53222287", "0.53222287" ]
0.84580797
0
Creates a new Products model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Products(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $postData = Yii::$app->request->post();\n \n $model = new Product();\n\n if ($model->load($postData) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Product;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Product']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Product'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'langs' => $this->getLangs(),\n ]);\n }", "public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new PricefallsProducts();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n /* @var $modelProduct \\common\\models\\Product */\n\n $modelProduct = Product::findOne(Yii::$app->session->get('tempId'));\n\n if(!isset($modelProduct)):\n Yii::$app->session->remove('tempModel');\n Yii::$app->session->remove('tempId');\n endif;\n\n if (isset($modelProduct) && $modelProduct->load(Yii::$app->request->post())):\n if($modelProduct->updateObject($modelProduct)):\n return $this->redirect(['view', 'id' => $modelProduct->id]);\n endif;\n endif;\n\n if(Yii::$app->session->get('tempModel') != 'Product'):\n\n $modelProduct = new Product();\n $modelProduct = $modelProduct->createObject();\n endif;\n\n return $this->render('create', [\n 'modelProduct' => $modelProduct,\n ]);\n }", "public function actionCreate()\n {\n\t\tif(!$this->IsAdmin())\n\t\t{\n\t\t\treturn $this->render('error', ['name' => 'Not Found (#404)', 'message' => 'Puuduvad piisavad õigused.']);\n\t\t}\n $model = new Product();\n\t\t\t$model->setAttribute('mfr', '-');\n\t\t\t$model->setAttribute('model', '-');\n\t\t\t$model->setAttribute('description', '-');\n\t\t\t$model->setAttribute('price', 0);\n\t\t\t$model->setAttribute('cut_price', 0);\n\t\t\t$model->setAttribute('stock', 0);\n\t\t\t$model->setAttribute('active', 1);\n\t\t\t\n\t\t$model->save();\n\t\t\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\n }", "public function createAction()\n {\n\t $form = new Core_Form_Product_Create;\n $action = $this->_helper->url('create', 'product', 'default');\n $form->setAction($action);\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n $this->_model->create($form->getValues());\n\t \t $this->_helper->FlashMessenger('Product added successfully');\n $this->_helper->Redirector('index','product','default');\n } else {\n $form->populate($_POST);\n }\n } \n $this->view->form = $form;\n }", "public function create()\n {\n $categories=$this->model->getCategories();\n \n $colors=$this->model->getColours();\n return view(\"admin.pages.insertProduct\",['categories'=>$categories,'colors'=>$colors]);\n \n }", "public function actionCreate()\n {\n if(Yii::$app->user->can('create-product')){\n $model = new Products();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->file= UploadedFile::getInstance($model, 'file');\n $upload='';\n\n //UPLOAD FILE----------------------\n if($model->file){\n $imgPath='uploads/products/'; //Set Path\n $model->photo=$imgPath.$model->file->name; //Upload\n $upload=1;\n }\n\n if($model->save()){\n if($upload){\n $model->file->saveAs($model->photo);\n }\n return $this->redirect(['view','id'=>$model->id]); //redirect\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }else{\n throw new ForbiddenHttpException;\n }\n }", "public function actionCreate()\n {\n $model = new Products();\n \t$cat = new CategoryList();\n \t$cat->makeTree();\n \t$sta = Status::find()->all();\n\n $model->CREATEBY = 0;\n $model->PUBLISHBY = 0;\n\n if($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t if ($model->save()) {\n\t return $this->redirect(['index']);\n\t } else {\n\t return $this->render('create', [\n\t 'model' => $model, 'categorylist' => $cat->CTree, 'statuslist' => $sta\n\t ]);\n \t}\n } else {\n return $this->render('create', [\n 'model' => $model, 'categorylist' => $cat->CTree, 'statuslist' => $sta\n ]);\n }\n }", "public function create(){\n\t\t$data['title'] = 'Create Product';\n\t\t\n\t\t//\tis user submitting form or viewing?\n\t\tif( $this->input->post() ){\n\t\t\t//\thandle cancelling\n\t\t\tif( strtolower( $this->input->post('submit') ) == 'cancel' ){\n\t\t\t\tredirect('product');\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//\tvalidate form\n\t\t\t$this->form_validation->set_rules('type', 'type', 'trim|xss_clean');\n\t\t\t$this->form_validation->set_rules('name', 'name', 'trim|required|xss_clean');\n\t\t\t$this->form_validation->set_rules('price', 'price', 'trim|decimal|required|xss_clean');\n\t\t\t$this->form_validation->set_rules('model', 'model', 'trim|required|xss_clean');\n\t\n\t\t\tif( $this->form_validation->run() == TRUE ){\n\t\t\t//\tsave new product\n\t\t\t\t$name = set_value('name');\n\t\t\t\t$price = set_value('price');\n\t\t\t\t$model = set_value('model');\n\t\t\t\t$type = set_value('type') ? set_value('type') : NULL;\n\t\t\t\t\n\t\t\t\tif( $this->product_model->create( $name, $price, $model, $type ) ){\n\t\t\t\t//\tsuccess\n\t\t\t\t\t$this->contentData['message'] = 'product created';\n\t\t\t\t\treturn $this->index();\n\t\t\t\t} else {\n\t\t\t\t//\terror creating new user\n\t\t\t\t\t$this->contentData['message'] = $this->product_model->getMessage();\t\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->contentData['message'] = validation_errors();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$data['content'] = $this->load->view('product/product_create', $this->contentData, TRUE);\n\t\t$this->techniart->load($data);\n\t}", "public function create()\n {\n $products=Product::all ();\n\n return view ('admin.product.create',compact ('products'));\n }", "public function create(){\n return view(\"admin.addProduct\");\n }", "public function create(){\n \treturn view('admin.products.create');\n\n }", "public function create()\n\t{\n\t\treturn view('admin.products.create');\n\t}", "public function create()\n {\t\n //\n\t\treturn view('products.create');\n }", "public function create(){\n \treturn view('products.create');\n }", "public function create()\n {\n return view(\"products.create\");\n }", "public function create()\n {\n return view(\"products.create\");\n }", "public function create()\n {\n return view(\"admin.product.create\");\n }", "public function create()\n\t{\n\t\t\n\t\treturn view('product.create');\n\t}", "public function create() {\n\t\t$product = Product::create([\n\t\t\t'title' => '',\n\t\t]);\n\n\t\tif ($product) {\n\t\t\treturn redirect()->route('products.edit', $product->id);\n\t\t}\n\t}", "public function create(){\n \treturn view('product.create');\n }", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n $products = Product::all();\n return view('crm::products.create', compact('products'));\n // return view('crm::products.create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Productos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Productos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Productos'];\n $model->precioUnitario=str_replace(\",\",\"\",$model->precioUnitario);\n\t\t\t$model->precioUnitario=str_replace(\"$\",\"\",$model->precioUnitario); \n\t\t\tif($model->save())\n {\n $objBitacora = new Bitacora();\n $objBitacora->setMovimiento('CREAR','Productos','',$model->id,'',4);\n Yii::app()->user->setFlash('success',Yii::t('app','Item successfully added'));\n $this->redirect(array('admin'));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create() {\n /**\n * This controller is used to create a new product \n */\n return view('product.create');\n }", "public function create()\n {\n $statusProducts = StatusProduct::all();\n $categoryProducts = CategoryProduct::all();\n return view('adminlte::products.create', compact('statusProducts','categoryProducts'));\n }" ]
[ "0.8466368", "0.83674884", "0.8355095", "0.8326711", "0.82675", "0.8135018", "0.80130744", "0.8007102", "0.78880584", "0.77849776", "0.77426726", "0.77388746", "0.7736695", "0.7681387", "0.7625231", "0.75885767", "0.7572512", "0.75501007", "0.75344485", "0.7519762", "0.7519762", "0.75117713", "0.7494973", "0.7494595", "0.7482313", "0.74807405", "0.7480326", "0.74750483", "0.74703145", "0.7460997" ]
0.8813426
0
Get options for cart endpoint.
public static function getCartOptions() { return self::get('cart') ?: []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartOptions()\n {\n return [\n '1' => [\n 'name' => 'Цвет',\n 'variants' => ['1' => 'Красный', '2' => 'Белый', '3' => 'Синий'],\n ],\n '2' => [\n 'name' => 'Размер',\n 'variants' => ['4' => 'XL', '5' => 'XS', '6' => 'XXL'],\n ]\n ];\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions()\n {\n return $this->get(self::OPTIONS);\n }", "abstract public function getOptions();", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "public function getOptions()\r\n {\r\n }", "public function getOptions()\n { return $this->get('options'); }", "public function getOptions()\n {\n return $this->optionRequested->get();\n }", "protected function getOptions(): array\n {\n return [\n 'cost' => $this->cost\n ];\n }", "public function getOptions(Request $request): array;" ]
[ "0.71079016", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66131854", "0.66060644", "0.6605481", "0.6605481", "0.6449878", "0.642791", "0.64276844", "0.64276844", "0.64272904", "0.6426069", "0.63734055", "0.63653487", "0.6307127", "0.6286429" ]
0.8125265
0
Get options for categories endpoint.
public static function getCategoriesOptions() { return self::get('categories') ?: []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCategoryOptions()\n {\n return self::get('category') ?: [];\n }", "public function GetCategoryOptions() {\n $return = \"\";\n $this->GetCategories();\n \n // Create the Options\n foreach ($this->rs as $row) {\n $return .= '<option value=\"' . $row->categoryID .'\">'. $row->categoryName .'</option>';\n }\n \n // Return the <options>\n return $return;\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function categories() {\n\n foreach ($this->loadCategoryAssoc() as $id=>$title) {\n $options[] = array(\n 'id' => intval($id),\n 'title' => $title,\n );\n }\n\n return $options;\n }", "public function getCategoryList() {\n $categories = $this->couponServices_model->fetchCategories();\n\n $category_options = array();\n $category_options[\"\"] = \"-- Select category --\";\n foreach ($categories as $item) {\n $category_options[$item['categoryId']] = $item['categoryName'];\n }\n return $category_options;\n }", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "public function getCategories()\n {\n return [ 'categories' => self::CATEGORIES ];\n }", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function listsCategoriesGet()\r\n {\r\n $response = Category::all();\r\n return response()->json($response, 200);\r\n }", "public function getCategories();", "public function getCategories();", "public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function getCategories()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('categories');\n }", "public function getAllCategories();", "public function getCategoriesIdOption() {\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t\t$catoptions = array();\r\n\r\n\t\treturn $catoptions;\r\n }", "public function getCategories()\n {\n return CategoryResource::collection(Category::with('products')->get())\n ->response()\n ->setStatusCode(200);\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories($options = array())\n {\n $return = $this->getListe(\"categories\", $options);\n return $return;\n }", "public function getCategorias()\n {\n $cagetgorias = Categorias::get();\n return response()->json($cagetgorias);\n }", "public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}" ]
[ "0.8261367", "0.70652246", "0.706271", "0.704938", "0.70073146", "0.7007286", "0.6964633", "0.69297147", "0.690113", "0.6773926", "0.6773926", "0.6707636", "0.6640951", "0.66292703", "0.661323", "0.65897006", "0.65704167", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.65588415", "0.6541545", "0.6532904", "0.6504864" ]
0.82011175
1