query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
sql helper methods Sanitize single quote char sanitize($text)
function sanitize($text) { return str_replace("'", "''", $text); }
[ "public static function sanitizeSql($string){\n $sanitized=filter_var($string, FILTER_SANITIZE_MAGIC_QUOTES);\n return $sanitized;\n }", "function sqlsafe ($str) {\n //$str = str_replace(\"'\", \"''\", $str);\n //$str = stripslashes($str);\n $str = addslashes($str);\n return $str;\n}", "function sql_sanitize($value) {\r\n\t//$value = str_replace(\"'\", \"''\", $value);\r\n\t$value = str_replace(\";\", \"\\;\", $value);\r\n\r\n\treturn $value;\r\n}", "function sanitize( $input ){\n $mysqli = self::dbconnect();\n $input = $mysqli->real_escape_string( $input );\n $input = trim($input);\n $input = htmlentities($input);\n $mysqli->close();\n return $input;\n }", "function sanitize($data) {\n return pg_escape_string($data);\n }", "function sanitise($string)\n\t{\n\t\tif(ini_get('magic_quotes_gpc')) $string = stripslashes($string);\n\t\t$string = mysqli_real_escape_string($this->con,$string);\n\t\treturn $string;\n\t}", "function sanitize_SQL($connection, $user_input){\n\t$user_input = $connection->real_escape_string($user_input);\n\t$user_input = sanitize_string($user_input);\n\treturn $user_input;\n}", "function sanitizeMySQL($conn, $str) {\n $str = $conn->real_escape_string($str);\n $str = sanitizeString($str);\n return $str;\n}", "function norm(&$text) {\n\t\t$out = $text;\n\t\t\n\t\t// Stripslashes\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\t$out = stripslashes($out);\n\t\t}\n\n\t\t// Quote if not integer\n\t\tif (!is_numeric($out)) {\n\t\t\t$out = @mysql_real_escape_string($out);\n\t\t}\n\n\t\treturn $out;\n\t}", "public function sanitize_sql_string()\n\t{\n\t\t$pattern[0] = '/(\\\\\\\\)/';\n\t\t$pattern[1] = \"/\\\"/\";\n\t\t$pattern[2] = \"/'/\";\n\t\t$replacement[0] = '\\\\\\\\\\\\';\n\t\t$replacement[1] = '\\\"';\n\t\t$replacement[2] = \"\\\\'\";\n\t\t$len = strlen($this->_ARGS);\n\t\tif((($this->_MIN != '') && ($len < $this->_MIN)) || (($this->_MAX != '') && ($len > $this->_MAX)))\n\t\t return FALSE;\n\t\treturn preg_replace($pattern, $replacement, $this->_ARGS);\n\t}", "function api_sqlite_escape($text){\n\t\t\t$ret = str_replace(\"'\",\"''\",$text);\n\t\t\treturn $ret;\n\t\t}", "function antiinjection($data){\n\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \treturn $filter_sql;\n}", "function unsanitizeText($text) { \n\t\t$text = stripcslashes($text); \n\t\t$text = str_replace(\"&#039;\", \"'\", $text); \n\t\t$text = str_replace(\"&gt;\", \">\", $text); \n\t\t$text = str_replace(\"&quot;\", \"\\\"\", $text); \n\t\t$text = str_replace(\"&lt;\", \"<\", $text); \n return $text; \n}", "public function sql_escape_string($str);", "public function sanitize($data = NULL) {\n if (empty($data)) return false;\n return $this->db->quote($data);\n }", "function antiinjection($data){\n \t\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \t\treturn $filter_sql;\n\t}", "private function sanitize() {}", "function dbClean($str){\r\n\tif(isset($str) && $str!=\"\"){\r\n\t\t$results = addslashes($str);\r\n\t}\r\n\treturn $results;\r\n}", "function sanitise_string($string) {\n\t// @todo does this really need the trim?\n\t// there are times when you might want trailing / preceeding white space.\n\treturn mysql_real_escape_string(trim($string));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Simple substitute for the PHP function mail() which allows you to specify encoding and character set The fifth parameter ($encoding) will allow you to specify 'base64' encryption for the output (set $encoding=base64) Further the output has the charset set to ISO88591 by default. Usage: 4
public static function plainMailEncoded($email,$subject,$message,$headers='',$encoding='quoted-printable',$charset='',$dontEncodeHeader=false) { if (!$charset) { $charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : 'ISO-8859-1'; } $email = self::normalizeMailAddress($email); if (!$dontEncodeHeader) { // Mail headers must be ASCII, therefore we convert the whole header to either base64 or quoted_printable $newHeaders=array(); foreach (explode(chr(10),$headers) as $line) { // Split the header in lines and convert each line separately $parts = explode(': ',$line,2); // Field tags must not be encoded if (count($parts)==2) { if (0 == strcasecmp($parts[0], 'from')) { $parts[1] = self::normalizeMailAddress($parts[1]); } $parts[1] = t3lib_div::encodeHeader($parts[1],$encoding,$charset); $newHeaders[] = implode(': ',$parts); } else { $newHeaders[] = $line; // Should never happen - is such a mail header valid? Anyway, just add the unchanged line... } } $headers = implode(chr(10),$newHeaders); unset($newHeaders); $email = t3lib_div::encodeHeader($email,$encoding,$charset); // Email address must not be encoded, but it could be appended by a name which should be so (e.g. "Kasper Sk�rh�j <kasperYYYY@typo3.com>") $subject = t3lib_div::encodeHeader($subject,$encoding,$charset); } switch ((string)$encoding) { case 'base64': $headers=trim($headers).chr(10). 'Mime-Version: 1.0'.chr(10). 'Content-Type: text/plain; charset="'.$charset.'"'.chr(10). 'Content-Transfer-Encoding: base64'; $message=trim(chunk_split(base64_encode($message.chr(10)))).chr(10); // Adding chr(10) because I think MS outlook 2002 wants it... may be removed later again. break; case '8bit': $headers=trim($headers).chr(10). 'Mime-Version: 1.0'.chr(10). 'Content-Type: text/plain; charset='.$charset.chr(10). 'Content-Transfer-Encoding: 8bit'; break; case 'quoted-printable': default: $headers=trim($headers).chr(10). 'Mime-Version: 1.0'.chr(10). 'Content-Type: text/plain; charset='.$charset.chr(10). 'Content-Transfer-Encoding: quoted-printable'; $message=t3lib_div::quoted_printable($message); break; } // Headers must be separated by CRLF according to RFC 2822, not just LF. // But many servers (Gmail, for example) behave incorectly and want only LF. // So we stick to LF in all cases. $headers = trim(implode(chr(10), t3lib_div::trimExplode(chr(10), $headers, true))); // Make sure no empty lines are there. $this->pearmail = t3lib_div::makeInstance('pearmail'); // loading the extension configuration $this->pearmail->setUsername($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['stoefln_pear_mail']['smtpUser']); $this->pearmail->setPassword($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['stoefln_pear_mail']['smtpPassword']); $this->pearmail->setAuth(true); $this->pearmail->setHost($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['stoefln_pear_mail']['smtpServer']); $this->pearmail->setPort($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['stoefln_pear_mail']['smtpPort']); $this->pearmail->setDebug($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['stoefln_pear_mail']['smtpDebug']); $ret = $this->pearmail->send($to, $subject, $message, $headers); //$ret = @mail($email, $subject, $message, $headers); if (!$ret) { t3lib_div::sysLog('Mail to "'.$email.'" could not be sent (Subject: "'.$subject.'").', 'Core', 3); } return $ret; }
[ "function _send_email($to)\n{\n $subject = \"Volunteer Management - Someone needed Help!\";\n\n $message = \"Please comeback! Someone need help!\";\n\n $subject = \"=?UTF-8?B?\" . base64_encode($subject) . \"?=\";\n\n $headers[] = 'From: Team Shunno <no-replay@' . $GLOBALS['c_domain'] . '>';\n $headers[] = 'Content-Type: text/html; charset=UTF-8';\n\n return mail($to, $subject, $message, implode(\"\\r\\n\", $headers));\n}", "function kanonMail($to, $topic, $message, $headers, $charset = 'UTF-8'){\r\n\t$subject = '=?'.$charset.'?B?'.base64_encode($topic).'?=';\r\n\treturn mail($to, $subject, chunk_split(base64_encode($message)), \"MIME-Version: 1.0\\r\\nContent-Transfer-Encoding: BASE64\\r\\n\".$headers);\r\n}", "public static function sendMail($to, $from, $subject, $message, $encoding = 'iso-8859-1')\n {\n \t$header = \"Content-Type: text/html; charset=\\\"$encoding\\\"\\n\";\n \t$header .= \"From: $from\";\n \n if($encoding != 'iso-8859-1')\n $subject = \"=?$encoding?b?\".base64_encode($subject).\"?=\";\n \n \treturn @mail($to, $subject, $message, $header);\n }", "function mystery_encode_email($message, $type = '') {\n\t// for typical email, we can just follow RFC 2822 and not encode\n\t// the email since the line length is typically less than the max \n\t// of 998 characters. This function will be necessary\n\t// for possible future HTML encoded messages.\n\n\tswitch($type) {\n\t\n\t\tcase 'quoted/printable':\n\t\t\n\t\t\t$message = preg_replace( '/[^\\x21-\\x3C\\x3E-\\x7E\\x09\\x20]/e', 'sprintf( \"=%02x\", ord ( \"$0\" ) ) ;', $message );\n\t\t\t\n\t\t\tpreg_match_all( '/.{1,73}([^=]{0,3})?/', $message, $matches );\n\t\t\t\n\t\t\treturn implode( \"=\\r\\n\", $matches[0] );\n\t\t\t\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\n\t\t\treturn $message;\n\t\t\n\t\tbreak;\n\t\n\t}\n\t\n}", "function mailto_encode($name, $address, $encode = 'none', $params = array())\n{\n $text = $name;\n // netscape and mozilla do not decode %40 (@) in BCC field (bug?)\n // so, don't encode it.\n $search = array('%40', '%2C');\n $replace = array('@', ',');\n $mail_parms = array();\n foreach ($params as $var=>$value) {\n switch ($var) {\n case 'cc':\n case 'bcc':\n case 'followupto':\n if (!empty($value))\n $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value));\n break;\n \n case 'subject':\n case 'newsgroups':\n $mail_parms[] = $var.'='.rawurlencode($value);\n break;\n\n case 'extra':\n case 'text':\n $$var = $value;\n\n default:\n }\n }\n\n $mail_parm_vals = '';\n for ($i=0; $i<count($mail_parms); $i++) {\n $mail_parm_vals .= (0==$i) ? '?' : '&';\n $mail_parm_vals .= $mail_parms[$i];\n }\n $address .= $mail_parm_vals;\n\n if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) {\n $encode = 'none';\n return;\n }\n\n if ($encode == 'javascript' ) {\n $string = 'document.write(\\'<a href=\"mailto:'.$address.'\" '.$extra.'>'.$text.'</a>\\');';\n\n $js_encode = '';\n for ($x=0; $x < strlen($string); $x++) {\n $js_encode .= '%' . bin2hex($string[$x]);\n }\n\n return '<script type=\"text/javascript\">eval(unescape(\\''.$js_encode.'\\'))</script>';\n\n } elseif ($encode == 'javascript_charcode' ) {\n $string = '<a href=\"mailto:'.$address.'\" '.$extra.'>'.$text.'</a>';\n\n for($x = 0, $y = strlen($string); $x < $y; $x++ ) {\n $ord[] = ord($string[$x]); \n }\n\n $_ret = \"<script type=\\\"text/javascript\\\" language=\\\"javascript\\\">\\n\";\n $_ret .= \"<!--\\n\";\n $_ret .= \"{document.write(String.fromCharCode(\";\n $_ret .= implode(',',$ord);\n $_ret .= \"))\";\n $_ret .= \"}\\n\";\n $_ret .= \"//-->\\n\";\n $_ret .= \"</script>\\n\";\n \n return $_ret;\n \n \n } elseif ($encode == 'hex') {\n\n preg_match('!^(.*)(\\?.*)$!',$address,$match);\n if(!empty($match[2])) {\n throw new Exception('mailto: hex encoding does not work with extra attributes. Try javascript.');\n return;\n }\n $address_encode = '';\n for ($x=0; $x < strlen($address); $x++) {\n if(preg_match('!\\w!',$address[$x])) {\n $address_encode .= '%' . bin2hex($address[$x]);\n } else {\n $address_encode .= $address[$x];\n }\n }\n $text_encode = '';\n for ($x=0; $x < strlen($text); $x++) {\n $text_encode .= '&#x' . bin2hex($text[$x]).';';\n }\n\n $mailto = \"&#109;&#97;&#105;&#108;&#116;&#111;&#58;\";\n return '<a href=\"'.$mailto.$address_encode.'\" '.$extra.'>'.$text_encode.'</a>';\n\n } else {\n // no encoding\n return '<a href=\"mailto:'.$address.'\" '.$extra.'>'.$text.'</a>';\n }\n \n}", "function jl_send_html_email($to, $from_name, $from_email, $subject, $htmltext )\n{\n $headers = '';\n $headers .= 'From: ' . $from_name. ' <' . $from_email . \">\\r\\n\";\n $headers .= \"MIME-Version: 1.0\\r\\n\";\n $headers .= \"Content-type: text/html; charset=utf-8\\r\\n\";\n $headers .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\n $body = chunk_split(base64_encode($htmltext));\n\n // TODO: implement proper VERP stuff\n $additional_params = \"-f bounce@journalisted.com\";\n return mail($to, $subject, $body, $headers, $additional_params);\n}", "function setEncoding($mail)\n{\n return (preg_match('#[^\\n]{990}#', $mail)\n ? ENCODING_QUOTED_PRINTABLE\n : (preg_match('#[\\x80-\\xFF]#', $mail) ? ENCODING_8BIT : ENCODING_7BIT));\n}", "function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $plainContent = false, $customheaders = false, $inlineImages = false) {\n\t\n\tif ($customheaders && is_array($customheaders) == false) {\n\t\techo \"htmlEmail($to, $from, $subject, ...) could not send mail: improper \\$customheaders passed:<BR>\";\n\t\tdieprintr($headers);\n\t}\n\n \n\t$subjectIsUnicode = (strpos($subject,\"&#\") !== false);\n\t$bodyIsUnicode = (strpos($htmlContent,\"&#\") !== false);\n $plainEncoding = \"\";\n\t\n\t// We generate plaintext content by default, but you can pass custom stuff\n\t$plainEncoding = '';\n\tif(!$plainContent) {\n\t\t$plainContent = Convert::xml2raw($htmlContent);\n\t\tif(isset($bodyIsUnicode) && $bodyIsUnicode) $plainEncoding = \"base64\";\n\t}\n\n\n\t// If the subject line contains extended characters, we must encode the \n\t$subject = Convert::xml2raw($subject);\n\tif(isset($subjectIsUnicode) && $subjectIsUnicode)\n\t\t$subject = \"=?UTF-8?B?\" . base64_encode($subject) . \"?=\";\n\n\n\t// Make the plain text part\n\t$headers[\"Content-Type\"] = \"text/plain; charset=\\\"utf-8\\\"\";\n\t$headers[\"Content-Transfer-Encoding\"] = $plainEncoding ? $plainEncoding : \"quoted-printable\";\n\n\t$plainPart = processHeaders($headers, ($plainEncoding == \"base64\") ? chunk_split(base64_encode($plainContent),60) : wordwrap($plainContent,120));\n\n\t// Make the HTML part\n\t$headers[\"Content-Type\"] = \"text/html; charset=\\\"utf-8\\\"\";\n \n\t\n\t// Add basic wrapper tags if the body tag hasn't been given\n\tif(stripos($htmlContent, '<body') === false) {\n\t\t$htmlContent =\n\t\t\t\"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.0 Transitional//EN\\\">\\n\" .\n\t\t\t\"<HTML><HEAD>\\n\" .\n\t\t\t\"<META http-equiv=Content-Type content=\\\"text/html; charset=utf-8\\\">\\n\" .\n\t\t\t\"<STYLE type=3Dtext/css></STYLE>\\n\\n\".\n\t\t\t\"</HEAD>\\n\" .\n\t\t\t\"<BODY bgColor=#ffffff>\\n\" .\n\t\t\t\t$htmlContent .\n\t\t\t\"\\n</BODY>\\n\" .\n\t\t\t\"</HTML>\";\n\t}\n\n\tif($inlineImages) {\n\t\t$htmlPart = wrapImagesInline($htmlContent);\n\t} else {\n\t\t$headers[\"Content-Transfer-Encoding\"] = \"quoted-printable\";\n\t\t$htmlPart = processHeaders($headers, wordwrap(QuotedPrintable_encode($htmlContent),120));\n\t}\n\t\n\tlist($messageBody, $messageHeaders) = encodeMultipart(array($plainPart,$htmlPart), \"multipart/alternative\");\n\n\t// Messages with attachments are handled differently\n\tif($attachedFiles && is_array($attachedFiles)) {\n\t\t\n\t\t// The first part is the message itself\n\t\t$fullMessage = processHeaders($messageHeaders, $messageBody);\n\t\t$messageParts = array($fullMessage);\n\n\t\t// Include any specified attachments as additional parts\n\t\tforeach($attachedFiles as $file) {\n\t\t\tif($file['tmp_name'] && $file['name']) {\n\t\t\t\t$messageParts[] = encodeFileForEmail($file['tmp_name'], $file['name']);\n\t\t\t} else {\n\t\t\t\t$messageParts[] = encodeFileForEmail($file);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// We further wrap all of this into another multipart block\n\t\tlist($fullBody, $headers) = encodeMultipart($messageParts, \"multipart/mixed\");\n\n\t// Messages without attachments do not require such treatment\n\t} else {\n\t\t$headers = $messageHeaders;\n\t\t$fullBody = $messageBody;\n\t}\n\n\t// Email headers\n\t$headers[\"From\"] \t\t= validEmailAddr($from);\n\n\t// Messages with the X-SilverStripeMessageID header can be tracked\n\tif(isset($customheaders[\"X-SilverStripeMessageID\"]) && defined('BOUNCE_EMAIL')) {\n\t\t$bounceAddress = BOUNCE_EMAIL;\n\t\t// Get the human name from the from address, if there is one\n\t\tif(ereg('^([^<>]+)<([^<>])> *$', $from, $parts))\n\t\t\t$bounceAddress = \"$parts[1]<$bounceAddress>\";\n\t} else {\n\t\t$bounceAddress = $from;\n\t}\n\t\n\t// $headers[\"Sender\"] \t\t= $from;\n\t$headers[\"X-Mailer\"]\t= X_MAILER;\n\tif (!isset($customheaders[\"X-Priority\"])) $headers[\"X-Priority\"]\t= 3;\n\t\n\t$headers = array_merge((array)$headers, (array)$customheaders);\n\n\t// the carbon copy header has to be 'Cc', not 'CC' or 'cc' -- ensure this.\n\tif (isset($headers['CC'])) { $headers['Cc'] = $headers['CC']; unset($headers['CC']); }\n\tif (isset($headers['cc'])) { $headers['Cc'] = $headers['cc']; unset($headers['cc']); }\n\t\n\t// the carbon copy header has to be 'Bcc', not 'BCC' or 'bcc' -- ensure this.\n\tif (isset($headers['BCC'])) {$headers['Bcc']=$headers['BCC']; unset($headers['BCC']); }\n\tif (isset($headers['bcc'])) {$headers['Bcc']=$headers['bcc']; unset($headers['bcc']); }\n\t\t\n\t\n\t// Send the email\n\t$headers = processHeaders($headers);\n\t$to = validEmailAddr($to);\n\t\n\t// Try it without the -f option if it fails\n\tif(!($result = @mail($to, $subject, $fullBody, $headers, \"-f$bounceAddress\"))) {\n\t\t$result = mail($to, $subject, $fullBody, $headers);\n\t}\n\t\n\treturn $result;\n}", "function encode_subject($in_str, $charset) { \n $out_str = $in_str; \n if ($out_str && $charset) { \n\n // define start delimimter, end delimiter and spacer \n $end = \"?=\"; \n $start = \"=?\" . $charset . \"?B?\"; \n $spacer = $end . \"\\r\\n \" . $start; \n\n // determine length of encoded text within chunks \n // and ensure length is even \n $length = 75 - strlen($start) - strlen($end); \n\n /* \n [EDIT BY danbrown AT php DOT net: The following \n is a bugfix provided by (gardan AT gmx DOT de) \n on 31-MAR-2005 with the following note: \n \"This means: $length should not be even, \n but divisible by 4. The reason is that in \n base64-encoding 3 8-bit-chars are represented \n by 4 6-bit-chars. These 4 chars must not be \n split between two encoded words, according \n to RFC-2047. \n */ \n $length = $length - ($length % 4); \n\n // encode the string and split it into chunks \n // with spacers after each chunk \n $out_str = base64_encode($out_str); \n $out_str = chunk_split($out_str, $length, $spacer); \n\n // remove trailing spacer and \n // add start and end delimiters \n $spacer = preg_quote($spacer); \n $out_str = preg_replace(\"/\" . $spacer . \"$/\", \"\", $out_str); \n $out_str = $start . $out_str . $end; \n } \n return $out_str; \n}", "function send_email($email, $mail_subject_signup, $mail_text_signup, $mail_header) {\n\n\t// user-set email headers allowed by server\n\t\n\tif ($mail_type = \"1\") {\n\t\tmail($email, $mail_subject_signup, $mail_text_signup, $mail_header);\n\t}\n\n\t// user-set email headers NOT allowed by server\n\t\n\telseif ($mail_type = \"2\") {\n\t\tmail($email, $mail_subject_signup, $mail_text_signup);\n\t}\n\n\telse die(\"Please check your mail setup in the configuration file!\");\n}", "function p_mail($arr)\n{\t\n\trequire('key-cfg.php'); //key configurations\n\tinclude('p_init.php'); //initialised variables\n\t\n\t$arr = p_check_security($arr); //Last 3 headers in array MUST be FROM, MIME, Content-Type (in that sequence)\n\t\n\t//Define delimiter \n\t$p_delim=\"---++++++---\";\n\t\n\t//Create boundary to separate plaintext from html message\n\t$p_boundary = uniqid('np');\n\t\n\t//Check if fields are not null\n\tif ($arr['to']!=NULL && $arr['from']!=NULL && $arr['message']!=NULL)\n\t{\t\n\t\t//Check if inputs contain delimiter - if so, replace them with space - else verifier will break\n\t\t$arr['message'] = trim(str_replace($p_delim, \"\", $arr['message']));\n\t\t\n\t\t//Check if arr['headers'] is already defined - to be fixed - to send html/text simultaneously, headers must be From, MIME-Version,Content-Type\n\t\tif($arr['headers']!=NULL)\n\t\t{\n\t\t\t$p_headers = $arr['headers'];\n\n\t\t\t//Format : FROM, MIME, Content-Type (last three headers)\n\t\t\t//Replace content-type with defined boundaries - used to display multipart email (html or text dependent on recipient's email client)\n\t\t\t$p_headers = preg_replace('/Content-Type:.*/',\"Content-Type: multipart/alternative;boundary=\" . $p_boundary . \"\\r\\n\", $p_headers);\n\t\t}\n\t\t\n\t\t//Build default header\n\t\telse\n\t\t{\t\t\t\n\t\t\t//Build the header using to and from fields, and boundary\n\t\t\t$p_headers = p_buildHeader($arr['to'],$arr['from'],$p_boundary);\n\t\t}\n\t\t\n\t\t$message_tobe_hashed = prepare_message($arr['message']);\n\t\t\n\t\t//replace carriage returns with breaks for html display\n\t\t$arr['message'] = str_replace(\"\\r\", \"<br>\", $arr['message']);\n\t\t\n\t\t//For each line in the message - trim surrounding whitespace\n\t\t$arr['message'] = p_trim_line($arr['message']);\n\n\t\t//Hash headers and message using sha256\n\t\t$hMessage = p_hashBody($message_tobe_hashed,'sha256'); //hash message after removing empty white lines\n\t\t$hTo = p_hashBody($arr['to'],'sha256');\n\t\t$hFrom = p_hashBody($arr['from'],'sha256');\n\t\t$hSub = p_hashBody($arr['subject'],'sha256');\n\t\t\n\t\t//Sign hashes using private key\n\t\tif (isset($p_priv_key))\n\t\t{\n\t\t\t$sigM = p_sign($hMessage,$p_priv_key);\n\t\t\t$sigT = p_sign($hTo,$p_priv_key);\n\t\t\t$sigF = p_sign($hFrom,$p_priv_key);\n\t\t\t$sigS = p_sign($hSub,$p_priv_key);\n\t\t\t\n\t\t\t//Build new message with signatures\n\t\t\t$messageNew = p_buildMessage($p_delim,$sigT, $sigF, $sigM, $p_instruction, /*$p_stripped_message,*/ $arr['message'], $p_boundary, $sigS);\n\n\t\t\t//Send email\n\t\t\t$mail_result = mail($arr['to'],$arr['subject'],$messageNew,$p_headers);\n\n\t\t\t//Add sent email record to database\n\t\t\tp_addto_DB($arr['to'],$arr['from'],$arr['subject'],$hMessage,$sigM,date(\"Y-m-d H:i:s\"));\n\t\t\tprint_r($p_errors);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$p_errors = add_error(\"p_mail: Cannot sign. Private key not defined\");\n\t\t\tprint_r($p_errors);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}\n\t\n\telse\n\t{\n\t\t//Add to p_errors array for later printing\n\t\t$p_errors = add_error(\"p_mail: Please fill in the 'To' AND 'From' AND 'Message' fields\");\n\t\tprint_r($p_errors);\n\t\treturn false;\n\t}\n\t\n\t\n\n}", "function send_multipart_email($to,$from,$subject,$text_part,$html_part='',$bcc='')\n{\n $mail_sent = false;\n\n //define the headers we want passed. Note that they are separated with \\r\\n\n $headers = array();\n $headers[] = 'From: '.$from;\n\n if ($bcc != '')\n {\n $headers[] = 'Bcc: ' . $bcc;\n }\n\n //define the body of the message.\n if (trim($html_part) == '')\n {\n $body = $text_part;\n }\n else\n {\n //create a boundary string. It must be unique\n //so we use the MD5 algorithm to generate a random hash\n $random_hash = md5(date('r', time()));\n\n $headers[] = 'Content-Type: multipart/alternative; boundary=\"PHP-alt-'.$random_hash.'\"';\n\n $body = '--PHP-alt-'.$random_hash.\"\\n\";\n $body .= 'Content-Type: text/plain; charset=\"iso-8859-1\"'.\"\\n\";\n $body .= 'Content-Transfer-Encoding: 7bit'.\"\\n\\n\";\n\n $body .= $text_part.\"\\n\\n\";\n\n $body .= '--PHP-alt-'.$random_hash.\"\\n\";\n $body .= 'Content-Type: text/html; charset=\"iso-8859-1\"'.\"\\n\";\n $body .= 'Content-Transfer-Encoding: 7bit'.\"\\n\\n\";\n\n $body .= $html_part.\"\\n\\n\";\n\n $body .= '--PHP-alt-'.$random_hash.'--'.\"\\n\";\n }\n\n //send the email\n if (trim($body) != '')\n {\n if (preg_match('/<(.*@.*)>/',$from,$matches))\n {\n $envelope = $matches[1];\n }\n else\n {\n $envelope = $from;\n }\n\n $mail_sent = mail($to, $subject, $body, implode(\"\\r\\n\",$headers),'-f'.$envelope);\n }\n\n //if the message is sent successfully print \"Mail sent\". Otherwise print \"Mail failed\"\n return $mail_sent;\n}", "function encodeFileForEmail($file, $destFileName = false, $disposition = NULL, $extraHeaders = \"\") {\t\n\tif(!$file) {\n\t\tuser_error(\"encodeFileForEmail: not passed a filename and/or data\", E_USER_WARNING);\n\t\treturn;\n\t}\n\t\n\tif (is_string($file)) {\n\t\t$file = array('filename' => $file);\n\t\t$fh = fopen($file['filename'], \"rb\");\n\t\tif ($fh) {\n\t\t\twhile(!feof($fh)) $file['contents'] .= fread($fh, 10000);\t\n\t\t\tfclose($fh);\n\t\t}\n\t}\n\n\t// Build headers, including content type\n\tif(!$destFileName) $base = basename($file['filename']);\n\telse $base = $destFileName;\n\n\t$mimeType = $file['mimetype'] ? $file['mimetype'] : getMimeType($file['filename']);\n\tif(!$mimeType) $mimeType = \"application/unknown\";\n\t\t\n\tif (empty($disposition)) $disposition = isset($file['contentLocation']) ? 'inline' : 'attachment';\n\t\n\t// Encode for emailing\n\tif (substr($file['mimetype'], 0, 4) != 'text') {\n\t\t$encoding = \"base64\";\n\t\t$file['contents'] = chunk_split(base64_encode($file['contents']));\n\t} else {\n\t\t// This mime type is needed, otherwise some clients will show it as an inline attachment\n\t\t$mimeType = 'application/octet-stream';\n\t\t$encoding = \"quoted-printable\";\t\t\n\t\t$file['contents'] = QuotedPrintable_encode($file['contents']);\t\t\n\t}\n\n\t$headers = \"Content-type: $mimeType;\\n\\tname=\\\"$base\\\"\\n\".\n\t \"Content-Transfer-Encoding: $encoding\\n\".\n\t \"Content-Disposition: $disposition;\\n\\tfilename=\\\"$base\\\"\\n\" ;\n\t\n\tif ( isset($file['contentLocation']) ) $headers .= 'Content-Location: ' . $file['contentLocation'] . \"\\n\" ;\n\t\n\t$headers .= $extraHeaders . \"\\n\";\n\n\t// Return completed packet\n\treturn $headers . $file['contents'];\n}", "function sendMail($title, $message, $to, $to_name, $from, $from_name) {\n if (filter_var($to, FILTER_VALIDATE_EMAIL)) {\n saveToLogFile(getLogFileName(), \"Skickar email: \" . $title . \", till: $to \", 'INFO');\n\n /*\n $headers = 'To: ' . $to_name . ' <' . $to . '>' . \"\\r\\n\";\n $headers .= 'From: ' . $from_name . ' <' . $from . '>' . \"\\r\\n\";\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=ISO-8859-1' . \"\\r\\n\";\n\n $title_latin = utf8_decode($title);\n $message_latin = utf8_decode($message);\n $headers_latin = utf8_decode($headers);\n $to_latin = utf8_decode($to);\n\n $success = mail($to_latin, $title_latin, $message_latin, $headers_latin);\n */\n\n $headers = 'To: ' . $to_name . ' <' . $to . '>' . \"\\r\\n\";\n $headers .= 'From: ' . $from_name . ' <' . $from . '>' . \"\\r\\n\";\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n $success = mail($to, $title, $message, $headers);\n } else {\n $success = false;\n }\n if (!$success) {\n saveToLogFile(getLogFileName(), \"Misslyckades att skicka email: \" . $title . \", till: $to \", 'ERROR');\n }\n}", "function encodeString($str, $encoding = ENCODING_BASE64)\n{\n $encoded = '';\n switch (strtolower($encoding)) {\n case ENCODING_BASE64:\n $encoded = chunk_split(\n base64_encode($str),\n STD_LINE_LENGTH,\n EOL\n );\n break;\n case ENCODING_7BIT:\n case ENCODING_8BIT:\n $encoded = normalizeBreaks($str);\n // Make sure it ends with a line break\n if (substr($encoded, -(strlen(EOL))) != EOL) {\n $encoded .= EOL;\n }\n break;\n case ENCODING_QUOTED_PRINTABLE:\n $encoded = encodeQP($str);\n break;\n default:\n $encoded = $str;\n break;\n }\n\n return $encoded;\n}", "public function sendmail() \r\n\t{\t\r\n\t\r\n\t\t$mime_headers = [];\r\n\t\t$from = self::SERVERADDR; \t\t\r\n\t\t$to = $this->clean($this->fields['to'],'field');\r\n\t\t$name = $this->clean($this->fields['name'],'field');\r\n\t\t$email = $this->clean($this->fields['email'],'field');\r\n\t\t$subject = $this->clean($this->fields['subject'],'field');\r\n\t\t$message = $this->clean($this->body['body'],'body');\r\n\t\t$ip = $this->clean($_SERVER['REMOTE_ADDR'],'field');\r\n\t\t\r\n\t\t$headers = [\r\n\t\t\t'From' \t=> self::SERVERADDR,\r\n\t\t\t'Sender' \t=> self::SERVERADDR,\r\n\t\t\t'Return-Path' \t=> self::SERVERADDR,\r\n\t\t\t'MIME-Version' \t=> self::MIMEVERSION,\r\n\t\t\t'Content-Type' \t=> 'text/plain; charset='.self::CHARSET.'; format='.self::MAILFORMAT.'; delsp='.self::DELSP,\r\n\t\t\t'Content-Language'\t\t=> self::LANGUAGE,\r\n\t\t\t'Content-Transfer-Encoding' \t=> self::TRANSFERENCODING,\r\n\t\t\t'X-Mailer' \t=> self::XMAILER,\r\n\t\t\t'Date'\t\t\t\t=> date('r'),\r\n\t\t\t'Message-Id'\t\t\t=> $this->generateBytes(),\r\n\t\t];\r\n\t\t\r\n\t\tif(self::SENSITIVITY == true) {\r\n\t\t\t$custom = array('Sensitivity' => self::SENSITIVITY_VALUE);\r\n\t\t\t$headers = array_merge($headers,$custom);\r\n\t\t}\t\t\t\r\n\t\t\t\r\n\t\tif(self::CUSTOMHEADERVALUE != 'JAJ VIGHAJ') {\r\n\t\t\t$custom = array(self::CUSTOMHEADER => self::CUSTOMHEADERVALUE);\r\n\t\t\t$headers = array_merge($headers,$custom);\r\n\t\t}\t\r\n\t\t\r\n\t\tforeach ($headers as $key => $value) {\r\n\t\t\t$mime_headers[] = \"$key: $value\";\r\n\t\t}\r\n\t\t\r\n\t\t$mail_headers = join(\"\\n\", $mime_headers);\r\n\t\t\r\n\t\t$message .= \"\\n\\n\";\r\n\t\t$message .= \"From: \" . $email;\r\n\t\t$message .= \"\\n\";\r\n\t\t$message .= \"IP: \" . $ip;\r\n\t\t\r\n\t\tif(self::WORD_WRAP == true) {\r\n\t\t\t$message = wordwrap($message, self::WORD_WRAP_VALUE, \"\\r\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tif(self::SUPRESSMAILERROR == true) {\r\n\t\t\t$send = @mail($to, $subject, $message, $mail_headers, self::OPTPARAM . $from);\r\n\t\t\t} else {\r\n\t\t\t$send = mail($to, $subject, $message, $mail_headers, self::OPTPARAM . $from);\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function send_email_text_attachment($to,$from,$subject,$text_part,$attachments=array(),$bcc='')\n{\n /*******************************************************************************\n Simple text email with attachment\n *******************************************************************************/\n $random_hash = md5(date('r', time()));\n\n $headers = array();\n $headers[] = 'From: '.$from;\n if ($bcc != '')\n {\n $headers[] = 'Bcc: ' . $bcc;\n }\n $headers[] = 'MIME-Version: 1.0';\n $headers[] = 'Content-Type: multipart/mixed; boundary=\"DigiMail-'.$random_hash.'\"';\n\n $body = 'This is a multi-part message in MIME format.'.\"\\n\";\n\n $body .= '--DigiMail-'.$random_hash.\"\\n\";\n $body .= 'Content-Type: text/plain'.\"\\n\";\n $body .= 'Content-Transfer-Encoding: 7bit'.\"\\n\\n\";\n\n $body .= $text_part.\"\\n\\n\";\n\n foreach($attachments as $file)\n {\n $body .= '--DigiMail-'.$random_hash.\"\\n\";\n\n $body .= 'Content-Type: '.$file['mime'].'; name=\"'.basename($file['name']).'\"'.\"\\n\";\n $body .= 'Content-Transfer-Encoding: base64'.\"\\n\";\n $body .= 'Content-Disposition: inline; filename=\"'.basename($file['name']).'\"'.\"\\n\\n\";\n\n $body .= chunk_split(base64_encode(file_get_contents($file['path'])), 76, \"\\n\");\n $body .= \"\\n\";\n }\n\n $body .= '--DigiMail-'.$random_hash.'--'.\"\\n\";\n\n /******************************************************************************/\n\n if (preg_match('/<(.*@.*)>/',$from,$matches))\n {\n $envelope = $matches[1];\n }\n else\n {\n $envelope = $from;\n }\n\n $mail_sent = mail($to, $subject, $body, implode(\"\\r\\n\",$headers),'-f'.$envelope);\n\n return $mail_sent;\n}", "function send_email($to,$from,$subject,$message,$attachArray=null,$replyTo = null, $cc = null, $bcc = null) {\n\n\t$subject = stripslashes($subject);\n\n\t//stop here if in training mode\n\tif (defined(\"TRAINER\")) return false;\n\n\t//use php_imap if available, otherwise use sendmail\n\t//DISABLED: sendmail option seems to work better for setting return addresses\n\tif (function_exists(\"imap_mail\") && 1==2) {\n\n\t\t$headers = assembleEmail($to,$from,$subject,$message,$attachArray,$replyTo,null,$cc,$bcc);\n\n\t\tif (imap_mail(\"$to\",\"$subject\",\"\",\"$headers\",\"\")) return true;\n\t\telse return false;\n\n\t} else {\n\n\t\t$headers = assembleEmail($to,$from,$subject,$message,$attachArray,$replyTo,1,$cc,$bcc);\n\n\t\t//write our headers to a temp file for passing to sendmail\t\n\t\t$file = TMP_DIR.\"/\".rand().\".eml\";\n\t\n\t\t$fp = fopen($file,w);\n\t\tfwrite($fp,$headers);\n\t\tfclose($fp);\n\n\t\t//pass the file to sendmail\n\t\t`cat \"$file\" | sendmail -t -f \"$from\"`;\n\n\t\t//remove the temp file and exit\n\t\treturn $headers;\n\n\t}\n}", "function encode_string ($str, $encoding = \"base64\") {\n switch(strtolower($encoding)) {\n case \"base64\":\n // chunk_split is found in PHP >= 3.0.6\n $encoded = chunk_split(base64_encode($str));\n break;\n\n case \"7bit\":\n case \"8bit\":\n $encoded = $this->fix_eol($str);\n if (substr($encoded, -2) != \"\\r\\n\")\n $encoded .= \"\\r\\n\";\n break;\n\n case \"binary\":\n $encoded = $str;\n break;\n\n case \"quoted-printable\":\n $encoded = $this->encode_qp($str);\n break;\n\n default:\n $this->error_handler(sprintf(\"Unknown encoding: %s\", $encoding));\n return false;\n }\n return($encoded);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gather Deleted Entries Since the delete_entries_loop hook doesn't send the entry's data, we need to grab it here first and store it as a global variable.
function gather_deleted_entries() { global $DB, $snitch_deleted_entries; if ($this->settings['notify_on_delete'] == 'y') { $snitch_deleted_entries = array(); foreach ($_POST as $key => $val) { if (strstr($key, 'delete') AND ! is_array($val) AND is_numeric($val)) { $entry_id = $DB->escape_str($val); $query = $DB->query("SELECT weblog_id, title, url_title, status FROM exp_weblog_titles WHERE entry_id = {$entry_id} LIMIT 1"); if ($query->num_rows) { $snitch_deleted_entries[$entry_id] = $query->row; } } } } }
[ "private function entriesFetchDeleted(string $table) {\n\t\treturn $this->fetchWithStatus('-1', 'deleted', $table);\n\t}", "function deleteEntry() \n {\n // first remove any associated fields with this DAObj\n $daFieldList = new DAFieldList( $this->getID() );\n $daFieldList->setFirst();\n while( $field = $daFieldList->getNext() ) {\n $field->deleteEntry();\n }\n \n // now call parent method\n parent::deleteEntry();\n \n }", "function deleteEntry() \n {\n // first remove any associated fields with this Page\n $pageFieldList = new PageFieldList( $this->getID() );\n $pageFieldList->setFirst();\n while( $field = $pageFieldList->getNext() ) {\n $field->deleteEntry();\n }\n \n // now remove any labels associated with this Page\n $pageLabelList = new PageLabelsList( $this->getID() );\n $pageLabelList->setFirst();\n while( $label = $pageLabelList->getNext() ) {\n $label->deleteEntry();\n }\n \n // now call parent method\n parent::deleteEntry();\n \n }", "public function delete_entries_start ()\n\t{\n\t\t$return = (ee()->extensions->last_call) ?\n\t\t\t\t\tee()->extensions->last_call : '';\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\t$group_id = ee()->session->userdata['group_id'];\n\n\t\tif ($group_id != 1 AND ee()->calendar_permissions->enabled())\n\t\t{\n\t\t\t$count = count($_POST['delete']);\n\n\t\t\t//remove all the ones they are denied permission to\n\t\t\tforeach ($_POST['delete'] as $key => $delete_id)\n\t\t\t{\n\t\t\t\t//if there are only calendar IDs, lets alert\n\t\t\t\tif ( ! ee()->calendar_permissions->can_edit_entry($group_id, $delete_id))\n\t\t\t\t{\n\t\t\t\t\tunset($_POST['delete'][$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if we've removed everything, they were all\n\t\t\t//denied and we need to alert\n\t\t\tif ($count > 0 and count($_POST['delete']) == 0)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = TRUE;\n\n\t\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public static function batchDeleteEntries() {\n $result = array();\n $deleted = lC_Newsletters_Admin::batchDelete($_GET['batch']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "function entry_deleted($entryId) {\n TwitterPluginDbAccess::entry_deleted($entryId);\n }", "public static function batchDeleteEntries() {\n $result = array();\n $deleted = lC_Manufacturers_Admin::batchDelete($_GET['batch']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function deleted(Entry $entry)\n {\n //\n }", "function deleteEntry() {\n $fullname = hsc(trim($_REQUEST['delete__entry']));\n if (!$this->isAllowedToEditEntry($fullname)) return;\n\n unset($this->doodle[\"$fullname\"]);\n $this->writeDoodleDataToFile();\n $this->template['msg'] = $this->getLang('vote_deleted');\n }", "public static function batchDeleteEntries() {\n global $_module;\n\n $result = lC_Product_variants_Admin::batchDeleteEntries($_GET['batch'], $_GET[$_module]);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "function mu_events_handle_delete_event( )\r\n{\r\n\tglobal $wpdb , $blog_id; \r\n\t\r\n\t$ds = intval( $_GET[ 'ds' ] ) ;\r\n\t$row = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . ___TABLE . ' WHERE id=%d', $ds ) ) ;\r\n\t\r\n\tif( !empty( $row ) )\r\n\t{\r\n\t\t$title = \"Event “{$row->title}”\" ;\r\n\t\tif( $blog_id != $row->site_id )\r\n \t\tswitch_to_blog( $row->site_id ) ;\r\n\t\t\r\n\t\twp_delete_post( $row->event_id , true ) ; \r\n\t\t\r\n\t\tif( $blog_id != $row->site_id )\r\n \t\trestore_current_blog( );\t\r\n\r\n/* ****************************** FALLBACK DELETE *********************************** \r\n\tOn the off-chance that an event-custom-post-type is delted, but the shadow-entry\r\n\tis still floating around, this piece checks to see if the entry is still there,\r\n\tand if so, deletes it. \r\n ********************************************************************************** */\r\n \t\t$query = $wpdb->prepare( 'SELECT * FROM ' . ___TABLE . ' WHERE id=%d', $ds ) ;\r\n\t\t$row = $wpdb->get_row( $query ) ;\r\n\t\tif( !empty( $row ) )\r\n\t\t{\r\n\t\t\t$title = sprintf( __(\"The shadow-entry for event “$s”\" , MU_EVENTS_PLUGIN_ID ) , $row->title );\r\n\t\t\t$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . ___TABLE . ' WHERE id=%d', $ds ) ) ;\r\n\t\t}\r\n/* ****************************** END FALLBACK DELETE *********************************** */\r\n\t\t\r\n\t\tadd_option( \r\n\t\t\t\t \tMU_EVENTS_OPTION_STATUS_MESSAGE , \r\n\t\t\t\t \tsprintf( __( \"“%s” has been deleted.\" ), $title )\r\n\t\t\t\t );\r\n\t\t\r\n\t\twp_redirect( admin_url( 'edit.php?post_type=event&page=mu-events' ) ) ;\r\n\t\texit ;\r\n\t}\r\n}", "public function entries_reset()\n {\n return reset($this->entries);\n }", "public function getDeletionData(): array\n {\n return $this->deletion;\n }", "public function deleted(Dictionaryentries $dictionaryentries);", "public function publish_data_delete_db($entry_ids)\n\t{\n\t}", "public static function destroy_all() {\n\t\tif ( ! current_user_can( 'frm_delete_entries' ) || ! wp_verify_nonce( FrmAppHelper::simple_get( '_wpnonce', '', 'sanitize_text_field' ), '-1' ) ) {\n\t\t\t$frm_settings = FrmAppHelper::get_settings();\n\t\t\twp_die( esc_html( $frm_settings->admin_permission ) );\n\t\t}\n\n\t\t$params = FrmForm::get_admin_params();\n\t\t$message = '';\n\t\t$form_id = (int) $params['form'];\n\n\t\tif ( $form_id ) {\n\t\t\t$entry_ids = FrmDb::get_col( 'frm_items', array( 'form_id' => $form_id ) );\n\t\t\t$action = FrmFormAction::get_action_for_form( $form_id, 'wppost', 1 );\n\n\t\t\tif ( $action ) {\n\t\t\t\t// This action takes a while, so only trigger it if there are posts to delete.\n\t\t\t\tforeach ( $entry_ids as $entry_id ) {\n\t\t\t\t\tdo_action( 'frm_before_destroy_entry', $entry_id );\n\t\t\t\t\tunset( $entry_id );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$results = self::delete_form_entries( $form_id );\n\t\t\tif ( $results ) {\n\t\t\t\t$message = 'destroy_all';\n\t\t\t\tFrmEntry::clear_cache();\n\t\t\t}\n\t\t} else {\n\t\t\t$message = 'no_entries_selected';\n\t\t}\n\n\t\t$url = admin_url( 'admin.php?page=formidable-entries&frm-full=1&frm_action=list&form=' . absint( $form_id ) );\n\n\t\tif ( $message ) {\n\t\t\t$url .= '&message=' . $message;\n\t\t}\n\n\t\twp_safe_redirect( $url );\n\t\tdie();\n\t}", "protected function processDeletedObjects() {}", "function processDeletions(){\n// debug($this->request->data);\n $contents = $ccs = $delete_cc = $contentLevel = $delete_image = $delete_file = $delete_content = array();\n\n $images = array_keys($this->request->data); // image key set\n\n // locate Image record deletion requests and Content key set\n foreach($images as $key){\n if(isset($this->request->data[$key]['Content'])){\n $contentLevel = $contentLevel + $this->request->data[$key]['Content'];\n $contents = $contents + array_keys($this->request->data[$key]['Content']);\n }\n if($this->request->data[$key]['delete']==1){\n $delete_image[$key] = $key;\n if(!is_null($this->request->data[$key]['name']) && $this->request->data[$key]['delete_file']==1){\n $delete_file[$this->request->data[$key]['name']] = $this->request->data[$key]['name'];\n }\n }\n }\n\n // locate Content record deletion requests and ContentColletion key set\n foreach($images as $key){\n foreach($contents as $ckey){\n if(isset($this->request->data[$key]['Content'][$ckey]['ContentCollection'])){\n $ccs = $ccs + array_keys($this->request->data[$key]['Content'][$ckey]['ContentCollection']);\n }\n if(isset($this->request->data[$key]['Content']) && $this->request->data[$key]['Content'][$ckey]['delete']==1){\n $delete_content[$ckey] = $ckey;\n }\n }\n }\n\n // locate ContentCollection record deletion requests\n foreach($images as $key){\n foreach($contents as $ckey){\n foreach($ccs as $cckey){\n if(isset($this->request->data[$key]['Content'][$ckey]['ContentCollection'][$cckey]) \n && $this->request->data[$key]['Content'][$ckey]['ContentCollection'][$cckey]['delete']==1){\n $delete_cc[$cckey] = $cckey;\n }\n }\n }\n }\n\n // locate meaningful 'also delete' requests for Content\n foreach($delete_image as $key){\n foreach($contents as $ckey){\n if(isset($this->request->data[$key]['Content'][$ckey]) \n && $this->request->data[$key]['Content'][$ckey]['also']==1){\n $delete_content[$ckey] = $ckey;\n }\n }\n }\n\n // locate meaningful 'also delete' ContentColletion requests \n // using the specially constructed Content-level array.\n // We may delete a Content without deleting Image and in\n // this case, the dependent ContentCollection records\n // should go also\n// if(isset($delete_content)){\n foreach($delete_content as $key){\n foreach($ccs as $cckey){\n if(isset($contentLevel[$key]['ContentCollection'][$cckey]) &&\n $contentLevel[$key]['ContentCollection'][$cckey]['also']==1){\n $delete_cc[$cckey] = $cckey;\n }\n }\n }\n// }\n\n return array('File'=>$delete_file,\n 'Image'=>$delete_image,\n 'Content'=>$delete_content,\n 'ContentCollection'=>$delete_cc\n );\n// debug($delete_image);\n// debug($delete_content);\n// debug($delete_cc);\n// die;\n }", "function deleteEntry() \n { \n \n // get a viewerAccessGroup manager\n $viewerAccess = new RowManager_ViewerAccessGroupManager();\n \n // now update it so that it's condition is based on this viewer id\n $condition = $this->getPrimaryKeyField().'='.$this->getID();\n \n $viewerAccess->setDBCondition( $condition );\n $viewerAccess->deleteEntry();\n \n // now continue with remove of this entry...\n parent::deleteEntry();\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a preview link Creates a preview link using the values declared in options. The preview option array contains a route parameter map except the values will be replaced with the keys from the currently selected model record.
public function getPreviewURL() { $preview = $this->options['preview']; // Preview URLs may be unique for different types of content. If the // model contains multiple types then different urls are required for // each type. if (isset($this->type)) { $preview = $this->options['preview'][$this->type]; } foreach ($preview as $key => $val) { if (isset($this->$val)) { $preview[$key] = $this->$val; } else { throw new Error('The preview URL parameter "'.$val.'" does not exist on this model record. No URL can be generated.'); } } return sq::route()->to($preview, false); }
[ "static public function preview_link() {\n\t\treturn Util_Ui::button_link( __( 'Preview', 'w3-total-cache' ),\n\t\t\tUtil_Ui::url( array( 'w3tc_default_previewing' => 'y' ) ), true );\n\t}", "public function render_preview($options = array())\n\t{\n\t\t$current = Block::$current;\n\n\t\tBlock::$current = $this;\n\n\t\t$context = Timber::get_context();\n\t\t$context['disable'] = isset($options['disable']) ? $options['disable'] : false;\n\t\t$context['super_id'] = isset($options['super_id']) ? $options['super_id'] : 0;\n\t\t$context['space_id'] = isset($options['space_id']) ? $options['space_id'] : 0;\n\t\t$context['stack_url'] = get_edit_post_link($this->stack_id);\n\t\t$context['header'] = apply_filters('wpbb/preview_header', '', $this);\n\t\t$context['footer'] = apply_filters('wpbb/preview_footer', '', $this);\n\n\t\t$this->render($this->infos['preview_file'], $context);\n\n\t\tBlock::$current = $current;\n\t}", "public function setPreviewOptions(array $previewOptions)\n {\n $this->previewButtonOptions = $previewOptions;\n }", "public function make_preview() {\n\t\tcheck_ajax_referer( self::SAVE_OPTIONS_NONCE_ACTION );\n\n\t\tif ( ! isset( $_POST['options'] ) || ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\tdie();\n\t\t}\n\n\t\t$data = array();\n\t\tparse_str( wp_unslash( $_POST['options'] ), $data );\n\t\t$options_id = optionsframework_get_options_id();\n\n\t\tif ( empty( $data[ $options_id ] ) ) {\n\t\t\tdie();\n\t\t}\n\n\t\t$origin_options = array_merge( optionsframework_get_options(), $data[ $options_id ] );\n\t\t$the7_preview_options = optionsframework_sanitize_options_values(\n\t\t\toptionsframework_get_page_options( false ),\n\t\t\t$origin_options,\n\t\t\toptionsframework_presets_data( $origin_options['preset'] )\n\t\t);\n\n\t\t$this->save_options_for_preview( $the7_preview_options );\n\t\t$this->save_css();\n\n\t\tdie( esc_url( self::get_preview_url( self::PREVIEW_OPTIONS_MODE ) ) );\n\t}", "public function get_preview_url() {\n\t\t$base_url = get_permalink( $this->get_preview_page_id() );\n\t\t$args = array(\n\t\t\t'form_id' => $this->form_id\n\t\t);\n\n\t\tif( $this->is_preview ) {\n\t\t\t$args['preview'] = '';\n\t\t}\n\n\t\t$preview_url = add_query_arg( $args, $base_url );\n\t\treturn $preview_url;\n\t}", "public function get_preview_url() {}", "function get_preview_post_link($post = \\null, $query_args = array(), $preview_link = '')\n {\n }", "public function createPreviewLink($entity_type_id, $entity_id);", "public function set_preview_url($preview_url)\n {\n }", "public function get_preview_url()\n {\n }", "function tcb_get_preview_url( $post_id = false, $preview = true ) {\n\tglobal $tve_post;\n\tif ( empty( $post_id ) && ! empty( $tve_post ) ) {\n\t\t$post_id = $tve_post->ID;\n\t}\n\t$post_id = ( $post_id ) ? $post_id : get_the_ID();\n\t/*\n * We need the post to complete the full arguments for the preview_post_link filter\n */\n\t$post = get_post( $post_id );\n\t$preview_link = set_url_scheme( get_permalink( $post_id ) );\n\t$query_args = [];\n\n\tif ( $preview ) {\n\t\t$query_args['preview'] = 'true';\n\t}\n\n\t$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( apply_filters( 'tcb_editor_preview_link_query_args', $query_args, $post_id ), $preview_link ), $post ) );\n\n\treturn $preview_link;\n}", "public function areasPreviewLink(){\n\t\treturn Controller::join_links($this->owner->Link(), '?block_preview=1');\n\t}", "public function composer_generate_preview() {\n \n // Display post's preview\n (new MidrubBaseUserAppsCollectionPostsHelpers\\Preview)->composer_generate_preview();\n \n }", "function modify_preview_link( $link, $post ) {\n\tif ( empty( $_POST ) ) {\n\t\treturn $link;\n\t}\n\n\t$args = [\n\t\t'preview' => true,\n\t\t'token' => cargo_user_token()\n\t];\n\n\t// Fetch preview fields.\n\t$fields = cargo()->config( 'preview.fields', ['post_id' => 'ID'] );\n\n\tforeach ( $fields as $key => $value ) {\n\t\tif ( is_numeric( $key ) ) {\n\t\t\t$key = $value;\n\t\t}\n\n\t\tif ( isset( $post->$value ) ) {\n\t\t\t$args[$key] = $post->$value;\n\t\t}\n\t}\n\t\n\t/**\n\t * Modify new preview link.\n\t *\n\t * @param string $link\n\t */\n\treturn apply_filters( 'cargo_preview_link', add_query_arg( $args, cargo()->config( 'preview.url', home_url( '/' ) ) ) );\n}", "public function setPreviewUrl(string $preview_url): self;", "public function setPreview( $url );", "function mkPreviewLinks()\n {\n\n $previewUrls = array();\n foreach ($this->pageIds as $pageId) {\n $ttlHours = (int)$GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours');\n $ttlHours = ($ttlHours ? $ttlHours : 24 * 2);\n $params = 'id=' . $pageId . '&L=' . $this->sysLang . '&ADMCMD_previewWS=' . $this->workspaceId;\n $previewUrls[$pageId] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?ADMCMD_prev=' . PreviewHook::compilePreviewKeyword($params,\n $GLOBALS['BE_USER']->user['uid'], 60 * 60 * $ttlHours);\n }\n\n return $previewUrls;\n }", "public function previewAction()\n {\n $emotionId = (int) $this->Request()->getParam('emotionId');\n\n $emotion = $this->get('emotion_device_configuration')->getById($emotionId);\n\n // The user can preview the emotion for every device.\n $emotion['devices'] = '0,1,2,3,4';\n\n $viewAssignments['emotion'] = $emotion;\n $viewAssignments['previewSecret'] = $this->Request()->getParam('secret');\n $viewAssignments['hasEmotion'] = !empty($emotion);\n\n $viewAssignments['showListing'] = (bool) max(array_column($emotion, 'showListing'));\n\n $showListing = (empty($emotion) || !empty($emotion['show_listing']));\n $viewAssignments['showListing'] = $showListing;\n\n $this->View()->assign($viewAssignments);\n\n //fake to prevent rendering the templates with the widgets module.\n //otherwise the template engine don't accept to load templates of the `frontend` module\n $this->Request()->setModuleName('frontend');\n }", "public function setPreview($var)\n {\n GPBUtil::checkBool($var);\n $this->preview = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate that DB logging does not log a success message when a mixtures of successes and failures is encountered
public function test_version1dbloggingdoesnotlogsuccessonmixedresults() { $data = array( array( 'entity' => 'user', 'action' => 'create', 'username' => 'rlipusername', 'password' => 'Rlippassword!0', 'firstname' => 'rlipfirstname', 'lastname' => 'rliplastname', 'email' => 'rlipuser@rlipdomain.com', 'city' => 'rlipcity', 'country' => 'CA' ), array( 'entity' => 'user', 'action' => 'create', 'username' => 'rlipusername2', 'password' => 'Rlippassword!0', 'firstname' => 'rlipfirstname2', 'lastname' => 'rliplastname2', 'email' => 'rlipuse2r@rlipdomain.com', 'city' => 'rlipcity', 'country' => 'boguscountry' ) ); $provider = new rlipimport_version1_importprovider_multiuser($data); $importplugin = new rlip_importplugin_version1($provider); $result = $importplugin->run(); $this->assertNull($result); $exists = $this->log_with_message_exists(); $this->assertEquals($exists, false); }
[ "public function test_version1dbloggingdoesnotlogsuccessmessageonfailedusercreate() {\n $data = array(\n 'entity' => 'user',\n 'action' => 'create',\n 'username' => 'rlipusername',\n 'password' => 'Rlippassword!0',\n 'firstname' => 'rlipfirstname',\n 'lastname' => 'rliplastname',\n 'email' => 'rlipuser@rlipdomain.com',\n 'city' => 'rlipcity',\n 'country' => 'boguscountry'\n );\n $result = $this->run_user_import($data);\n $this->assertNull($result);\n\n $exists = $this->log_with_message_exists();\n $this->assertEquals($exists, false);\n }", "public function test_version1dbloggingdoesnotlogsuccessmessageonfaileduserdelete() {\n $data = array(\n 'entity' => 'user',\n 'action' => 'delete',\n 'username' => 'rlipusername'\n );\n $result = $this->run_user_import($data);\n $this->assertNull($result);\n\n $exists = $this->log_with_message_exists();\n $this->assertEquals($exists, false);\n }", "public function isSuccessLog(): bool;", "public function testEventLogWrittenProperlyWhenFailed()\n\t{\n\t\t$this->setUpDecisionExpectation($this->customer_history, FALSE);\n\n\t\t$this->event_log->expects($this->once())->method('logEvent')->with('PREVIOUS_CUSTOMER', 'FAIL', VendorAPI_Blackbox_EventLog::FAIL);\n\n\t\t$this->rule->isValid($this->getMock('VendorAPI_Blackbox_Data'), $this->getMock('Blackbox_IStateData'));\n\t}", "public function dbCheck()\n\t{\n\t\tif(!$this->checked)\n\t\t{\n\t\t\t$this->log[] = \"checking if db exists\";\n\t\t\t$this->checked = dbConnection::getInstance('Logger')->tableExists(Settings::Load()->Get('Logger', 'logtable'));\n\t\t\tif (!$this->checked) \n\t\t\t{\t\n\t\t\t\t$createquery = $this->createqueries[strtolower(Settings::Load()->Get('Logger', 'dbtype'))];\n\t\t\t\t$createquery = str_replace('@logtable@', Settings::Load()->Get('Logger', 'logtable'), $createquery);\n\t\t\t\t$this->checked = dbConnection::getInstance('Logger')->query($createquery);\n\t\t\t\tif(!$this->checked) die( \"Error creating logdatabase\");\n\t\t\t\tLogger::Log(\"Log database created.\");\n\t\t\t}\t\n\t\t}\n\t}", "private function _check_log_tables()\n\t{\n\t\t$outcome = TRUE;\n\t\n\t\t// Check the email log\n\t\tif(!$this->addon->db->table_exists('formojo_email_log')):\n\t\t\n\t\t\t$this->addon->load->dbforge();\n\n\t\t\t$this->addon->dbforge->add_field('id');\t\n\t\t\t\n\t\t\t$structure = array(\n\t\t\t\t'created'\t\t\t=> array('type' => 'DATETIME'),\n\t\t\t\t'subject'\t\t\t=> array('type' => 'VARCHAR', 'constraint' => '200'),\n\t\t\t\t'to'\t\t\t\t=> array('type' => 'VARCHAR', 'constraint' => '200'),\n\t\t\t\t'debug'\t\t\t\t=> array('type' => 'LONGTEXT'),\n\t\t\t\t'form_data'\t\t\t=> array('type' => 'LONGTEXT')\n\t\t\t);\t\t\n\t\t\t\n\t\t\t$this->addon->dbforge->add_field($structure);\n\t\t\t\t\t\t\n\t\t\t$outcome = $this->addon->dbforge->create_table('formojo_email_log');\n\t\t\t\n\t\tendif;\n\n\t\t// Check the contact log\n\t\tif(!$this->addon->db->table_exists('formojo_form_log')):\n\t\t\n\t\t\t$this->addon->load->dbforge();\n\n\t\t\t$this->addon->dbforge->add_field('id');\t\n\t\t\t\n\t\t\t$structure = array(\n\t\t\t\t'created'\t\t\t=> array('type' => 'DATETIME'),\n\t\t\t\t'form_data'\t\t\t=> array('type' => 'LONGTEXT')\n\t\t\t);\t\t\n\t\t\t\n\t\t\t$this->addon->dbforge->add_field($structure);\n\t\t\t\t\t\t\n\t\t\t$outcome = $this->addon->dbforge->create_table('formojo_form_log');\n\t\t\t\n\t\tendif;\n\t\t\n\t\t// Make sure it worked\n\t\tif(!$outcome):\n\t\t\n\t\t\tshow_error('Failed to create necessary tables');\n\t\t\n\t\tendif;\n\t}", "public function isFailure();", "public function test_exportdblogginglogsemptyexport() {\n global $CFG, $USER, $DB;\n require_once($CFG->dirroot.'/blocks/rlip/lib.php');\n\n // Lower bound on starttime.\n $starttime = time();\n // Run the export.\n $result = $this->run_export();\n // Upper bound on endtime.\n $endtime = time();\n\n $this->assertNull($result);\n\n // Data validation.\n $select = \"export = :export AND\n plugin = :plugin AND\n userid = :userid AND\n starttime >= :starttime AND\n endtime <= :endtime AND\n endtime >= starttime AND\n filesuccesses = :filesuccesses AND\n filefailures = :filefailures AND\n storedsuccesses = :storedsuccesses AND\n storedfailures = :storedfailures AND\n {$DB->sql_compare_text('statusmessage')} = :statusmessage AND\n dbops = :dbops AND\n unmetdependency = :unmetdependency\";\n $params = array(\n 'export' => 1,\n 'plugin' => 'rlipexport_version1elis',\n 'userid' => $USER->id,\n 'starttime' => $starttime,\n 'endtime' => $endtime,\n 'filesuccesses' => 0,\n 'filefailures' => 0,\n 'storedsuccesses' => 0,\n 'storedfailures' => 0,\n 'statusmessage' => 'Export file memoryexport successfully created.',\n 'dbops' => -1,\n 'unmetdependency' => 0\n );\n $exists = $DB->record_exists_select(RLIP_LOG_TABLE, $select, $params);\n $this->assertTrue($exists);\n }", "private function runAddFailureAssertions()\n {\n $this->assertResponseError('Response was not in the 4xx range');\n\n $originalCount = $this->Formulas->find()->count();\n $newCount = $this->Formulas->find()->count();\n $this->assertEquals($originalCount, $newCount, 'New formula record was created, but shouldn\\'t have been');\n\n $responseBody = $this->_response->getBody();\n $this->assertJsonStringEqualsJsonString(\n json_encode(['success' => false, 'id' => null]),\n (string)$responseBody,\n 'Unexpected API response'\n );\n }", "public function ValidatorInsertDBsuccesfull(){\n }", "public function testLogsRecordIsCreatedForNewMigration()\n {\n $this->logger->log('my_migration_123');\n\n $logs = $this->connectToDatabase()->prepare(\"\n SELECT * FROM {$this->testLogsTable}\n \");\n\n $logs->execute();\n $this->assertNotEmpty($logs->fetch());\n }", "public function test_exportdblogginglogsnonemptyexport() {\n global $CFG, $USER, $DB;\n require_once($CFG->dirroot.'/blocks/rlip/lib.php');\n\n // Make sure the export is insensitive to time values.\n set_config('nonincremental', 1, 'rlipexport_version1elis');\n // Set up data for one course and one enroled user.\n $this->load_csv_data();\n\n // Lower bound on starttime.\n $starttime = time();\n // Run the export.\n $result = $this->run_export();\n // Upper bound on endtime.\n $endtime = time();\n\n $this->assertNull($result);\n\n // Data validation.\n $select = \"export = :export AND\n plugin = :plugin AND\n userid = :userid AND\n starttime >= :starttime AND\n endtime <= :endtime AND\n endtime >= starttime AND\n filesuccesses = :filesuccesses AND\n filefailures = :filefailures AND\n storedsuccesses = :storedsuccesses AND\n storedfailures = :storedfailures AND\n {$DB->sql_compare_text('statusmessage')} = :statusmessage AND\n dbops = :dbops AND\n unmetdependency = :unmetdependency\";\n $params = array(\n 'export' => 1,\n 'plugin' => 'rlipexport_version1elis',\n 'userid' => $USER->id,\n 'starttime' => $starttime,\n 'endtime' => $endtime,\n 'filesuccesses' => 1,\n 'filefailures' => 0,\n 'storedsuccesses' => 0,\n 'storedfailures' => 0,\n 'statusmessage' => 'Export file memoryexport successfully created.',\n 'dbops' => -1,\n 'unmetdependency' => 0\n );\n $exists = $DB->record_exists_select(RLIP_LOG_TABLE, $select, $params);\n $this->assertTrue($exists);\n }", "abstract public function validateBeforeDbWrite();", "function synchronizeFailedRows() {\n if ($this->report['status']['fails'] > 0) {\n\n $report = $this->syncdb->synchronize($this->failed_rows);\n $this->populateFromReport($report);\n }\n \n return ($this->report['status']['fails'] == 0);\n }", "public function isAuditSuccess();", "protected function assertNoLogEntries() {}", "public function monitoringCheckDB()\n {\n $message = 'DB CONNECTION FAIL';\n try {\n if (! Setup_Core::isRegistered(Setup_Core::CONFIG)) {\n Setup_Core::setupConfig();\n }\n if (! Setup_Core::isRegistered(Setup_Core::LOGGER)) {\n Setup_Core::setupLogger();\n }\n $time_start = microtime(true);\n $dbcheck = Setup_Core::setupDatabaseConnection();\n $time = (microtime(true) - $time_start) * 1000;\n } catch (Exception $e) {\n $message .= ': ' . $e->getMessage();\n $dbcheck = FALSE;\n }\n \n if ($dbcheck) {\n echo \"DB CONNECTION OK | connecttime={$time}ms;;;;\\n\";\n return 0;\n } \n \n echo $message . \"\\n\";\n return 2;\n }", "public function test_if_failed_update()\n {\n }", "public function testFailSave()\n {\n // test type\n // test lengh\n // test unique\n $this->assertTrue(true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a service using a raw Phalcon\Di\Service definition
public function setRaw($name, ServiceInterface $rawDefinition) {}
[ "public function setService($name, \\Phalcon\\Di\\ServiceInterface $rawDefinition);", "public function setService(string $name, ServiceInterface $rawDefinition): ServiceInterface;", "public function setRaw(string $name, ServiceInterface $rawDefinition) : ServiceInterface;", "public function setService( Service $service)\r\n {\r\n $this->service = $service;\r\n }", "public function setService($service) {\n $this->service = $service;\n }", "public function setPyGenericServices($var) {}", "public function setServiceCode($service){\n\t\t$this->service = $service;\n\t}", "public static function setServiceName($serviceName)\n {}", "function set($key, $service) {\n $this->services[$key] = $service;\n }", "abstract protected function makeService();", "public function setJavaGenericServices($var) {}", "public function set_service(string $_service) : self\n {\n $this->_service = $_service;\n\n return $this;\n }", "public function setDbService($service){ }", "public function setServiceService (ServiceService $serviceService) {\n $this->serviceService = $serviceService;\n }", "protected function createService(): void\n {\n if ($this->answers->get('service')) {\n $service = Str::singular($this->answers->get('name_'));\n\n $model = Str::studly(Str::singular($this->answers->get('model')));\n\n $this->call('make:service', [\n 'name' => \"{$service}Service\",\n '--model' => $model,\n '--api' => $this->answers->get('visibility') === 'API' ?? false,\n ]);\n }\n }", "private function setServiceCode()\r\n {\r\n\r\n }", "public function set($id, $service)\n {\n $this->_container->set($id, $service);\n }", "protected function bindService()\n {\n $this->app->singleton(JsonApiService::class);\n $this->app->alias(JsonApiService::class, 'json-api');\n $this->app->alias(JsonApiService::class, 'json-api.service');\n }", "public function set(string $name, $service): void\n {\n $this->mapper[$name] = $service;\n\n unset($this->services[$name]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ function to delete kotbah
function delete_kotbah($id_kotbah) { return $this->db->delete('kotbah',array('id_kotbah'=>$id_kotbah)); }
[ "public function deleteIrRemout(){\n }", "public function delTagihanPb() {\r\n if (isset($_POST['kd_penerima_biaya'])) {\r\n $penerima_biaya_kontrak = new PenerimaBiayaKontrak();\r\n $penerima_biaya_kontrak->delete($_POST['kd_penerima_biaya']);\r\n\r\n //echo $data->kd_kontrak;\r\n }\r\n }", "function delete_artikel_komentar($id) {\n $query=\"DELETE komentar, artikel\n FROM komentar\n INNER JOIN artikel ON komentar.id_artikel = artikel.id_artikel\n WHERE artikel.id_artikel=$id;\";\n $query .= \"SET @num :=0;\";\n $query .= \"UPDATE artikel SET id_artikel = @num := (@num+1);\";\n $query .= \"ALTER TABLE artikel AUTO_INCREMENT=1\";\n return multi($query);\n}", "public function destroyRek() {\n $pic = $this->rekname;\n $this->delete(); // and cascade deleting from pivot table\n\n // delete keywords from kwords table which don't exist in pivot table\n $allKwords = Kword::all()->pluck('id');\n $pivotKwords = DB::table('kword_reklama')->pluck('kword_id');\n $deleteKwords = $allKwords->diff($pivotKwords);\n Kword::destroy($deleteKwords->all());\n\n $restReklama = self::all()->pluck('rekname')->all();\n if (!in_array($pic, $restReklama)) { // if deleted Rekname does not exist in Reklama table\n $file_name = public_path() . '/img/' . $pic . '.jpg';\n if(file_exists($file_name)){unlink($file_name);}\n $file_name = public_path() . '/img/' . $pic . 's.jpg';\n if(file_exists($file_name)){unlink($file_name);}\n }\n }", "public function del()\n {\n }", "public function delete($metricamanejoplagas);", "public function delete($lecturabalancehidrico);", "function delete($id)\n\t\t{\n\t\t\t$this->db->where('id', $id);\n\t\t\t$this->db->delete('keuzerichtingKlas');\n\t\t}", "function delete_tbl_kemitraan($id_kemitraan)\n {\n return $this->db->delete('tbl_kemitraan',array('id_kemitraan'=>$id_kemitraan));\n }", "function delete_tr_belanja_rekening($)\n {\n return $this->db->delete('tr_belanja_rekening',array(''=>$));\n }", "public function delete($concepto_cumplimiento);", "static public function ctrBorrarUnidad(){\n\t\tif (isset($_POST['idUnidad'])) {\n\t\t$answer=adminph\\Organization::find($_POST['idUnidad']);\n\t\t\tif ($_POST['fotoUnidad'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUnidad\"]);\n\t\t\t\tunlink($answer->logo2);\n\t\t\t\trmdir('Views/img/organizaciones/'.$_POST['codigoUnidad']);\n\t\t\t}\n\t\t$answer->delete();\n\t\t}\n\t}", "public function delImgpilihan($UUID,$pilihan)\n{\n $oldImg=$this->Mbanksoal->get_oldgambar_pilihan($UUID,$pilihan);\n // cek img soal null atau tidak\n if ($oldImg != null) {\n // jika ada hapus old img\n $namaImg=$oldImg[0]['gambar'];\n // hapus img\n unlink(FCPATH . \"./assets/image/jawaban/\" . $namaImg);\n $data['id_pilihan']=$oldImg[0]['id_pilihan'];\n $data['dataJawaban']= array(\n 'gambar' => ' ',\n );\n $this->Mbanksoal->ch_single_img($data);\n }\n}", "static public function ctrBorrarPropietario(){\n\t\tif (isset($_POST['idPropietario'])) {\n\t\t\tif ($_POST['fotoPropietario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoPropietario\"]);\n\t\t\t\trmdir('Views/img/propietarios/'.$_POST['propietario']);\n\t\t\t}\n\t\t$answer=adminph\\Propietary::find($_POST['idPropietario']);\n\t\t$answer->delete();\n\t\t}\n\t}", "public function hapus_peserta($kelas_id, $mahasiswa_id)\n {\n // return redirect()->back();\n // $krs =Krs::where('kelas_id', $kelas_id)\n // ->where('mahasiswa_id', $mahasiswa_id)->get();\n\n // foreach($krs as $krs)\n // {\n // $krs->delete();\n // }\n Krs::where('kelas_id', $kelas_id)\n ->where('mahasiswa_id', $mahasiswa_id)\n ->delete();\n return redirect()->back();\n }", "function delete($id)\n\t\t{\n\t\t\t$this->db->where('id', $id);\n\t\t\t$this->db->delete('klas');\n\t\t}", "function gVerfolgung_delete() {\r\n\t$pntables = pnDBGetTables();\r\n\t\r\n\t$table = $pntables['gVerfolgung_Verfolgungsliste'];\r\n\t$sql = \"DROP TABLE IF EXISTS $table\";\r\n\tDBUtil::executeSQL ($sql, false, false);\r\n\t\r\n\t\r\n\t \r\n\t \r\n\treturn true;\r\n}", "function deleteDogGuestListEntry(){\n\n }", "function delete_bahan_baku_keluar($id_bahan_baku_keluar)\n {\n return $this->db->delete('bahan_baku_keluar',array('id_bahan_baku_keluar'=>$id_bahan_baku_keluar));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the first Carrier's ShippingRange satisfied by a Cart. If none is found, return false
public function getShippingRangeSatisfiedByCart( CartInterface $cart, CarrierInterface $carrier ) { $shippingRanges = $carrier->getRanges(); foreach ($shippingRanges as $shippingRange) { $shippingRangeSatisfied = $this->isShippingRangeSatisfiedByCart( $cart, $shippingRange ); if ($shippingRangeSatisfied) { return $shippingRange; } } return false; }
[ "public function getCarrierCriterion()\n {\n $args = new GetCarrierCriterion();\n $result = $this->__soapCall(\"getCarrierCriterion\", [$args]);\n return $result->rval;\n }", "public function carrierHasStaticPricelist()\n {\n $carrier = new Carrier((int)$this->id_carrier);\n if ($carrier->is_free) {\n return true;\n }\n\n $sql = 'SELECT COUNT(*)\n FROM `'._DB_PREFIX_.'delivery` d\n WHERE d.`id_carrier` = '.(int)$carrier->id.'\n AND d.`price` > 0';\n\n $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\n\n if ((int)$result > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function loadCheapestShippingRange(CartOnLoadEvent $event)\n {\n $cart = $event->getCart();\n $shippingRange = $cart->getShippingRange();\n\n /**\n * We don't have the need to find the cheapest one if the real one is\n * already defined\n */\n if ($shippingRange instanceof ShippingRangeInterface) {\n return;\n }\n\n /**\n * If the cart is not associated to any customer, just skip it\n */\n if (!($cart->getCustomer() instanceof CustomerInterface)) {\n return;\n }\n\n $address = ($cart->getDeliveryAddress() instanceof AddressInterface)\n ? $cart->getDeliveryAddress()\n : $cart\n ->getCustomer()\n ->getAddresses()\n ->first();\n\n /**\n * If the user does'nt have any address defined, we cannot approximate\n * anything\n */\n if (!($address instanceof AddressInterface)) {\n return;\n }\n\n $cart->setDeliveryAddress($address);\n\n $validCarrierRanges = $this\n ->shippingRangeProvider\n ->getValidShippingRangesSatisfiedWithCart($cart);\n\n $cheapestCarrierRange = $this\n ->shippingRangeResolver\n ->getShippingRangeWithLowestPrice($validCarrierRanges);\n\n $cart->setCheapestShippingRange($cheapestCarrierRange);\n\n return;\n }", "public function firstDocumentPositionGrossPriceAllowanceCharge(): bool\n {\n $this->positionGrossPriceAllowanceChargePointer = 0;\n $tradeLineItem = $this->getInvoiceValueByPath(\"getSupplyChainTradeTransaction.getIncludedSupplyChainTradeLineItem\", []);\n $tradeLineItem = $tradeLineItem[$this->positionPointer];\n $allowanceCharge = $this->objectHelper->ensureArray($this->getInvoiceValueByPathFrom($tradeLineItem, \"getSpecifiedLineTradeAgreement.getGrossPriceProductTradePrice.getAppliedTradeAllowanceCharge\", []));\n return isset($allowanceCharge[$this->positionGrossPriceAllowanceChargePointer]);\n }", "public function fetchCompetitivePricing() {\n\n\t\t// @see http://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForASIN.html\n\t\t$competitivePricing = parent::fetchCompetitivePricing();\n\t\tif ( ! empty( $this->getLastErrorMessage() ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $competitivePricing;\n\t}", "public function firstDocumentShipFromContact(): bool\n {\n $this->documentShipFromContactPointer = 0;\n $contacts = $this->objectHelper->ensureArray($this->getInvoiceValueByPath(\"getSupplyChainTradeTransaction.getApplicableHeaderTradeDelivery.getShipFromTradeParty.getDefinedTradeContact\", []));\n return isset($contacts[$this->documentShipFromContactPointer]);\n }", "public function getCartRange($quote)\n {\n $itemPoints = [];\n $rules = $this->getRules($quote);\n $customer = $quote->getCustomer();\n $balancePoints = $this->rewardsBalance->getBalancePoints($quote->getCustomerId());\n\n $minPoints = 0;\n $quoteSubTotal = $this->getQuoteSubtotal($quote);\n $totalPoints = 0;\n /** @var \\Mirasvit\\Rewards\\Model\\Spending\\Rule $rule */\n foreach ($rules as $rule) {\n $rule->afterLoad();\n if ($quote->getItemVirtualQty() > 0) {\n $address = $quote->getBillingAddress();\n } else {\n $address = $quote->getShippingAddress();\n }\n if (/*$quoteSubTotal > 0 && */$rule->validate($address)) {\n $ruleSubTotal = $this->getLimitedSubtotal($quote, $rule);\n if ($ruleSubTotal > $quoteSubTotal) {\n $ruleSubTotal = $quoteSubTotal;\n }\n\n $monetaryStep = $rule->getMonetaryStep($customer, $ruleSubTotal);\n if (!$monetaryStep) {\n unset($this->validItems[$rule->getId()]);\n continue;\n }\n\n $ruleMinPoints = $rule->getSpendMinAmount($customer, $ruleSubTotal);\n $ruleMaxPoints = $rule->getSpendMaxAmount($customer, $ruleSubTotal);\n $ruleSpendPoints = $rule->getSpendPoints($customer);\n if (($ruleMinPoints && ($quoteSubTotal / $monetaryStep) < 1) || $ruleMinPoints > $ruleMaxPoints\n || $ruleMinPoints > $balancePoints) {\n unset($this->validItems[$rule->getId()]);\n continue;\n }\n\n $ruleMinPoints = $ruleMinPoints ? max($ruleMinPoints, $ruleSpendPoints) : $ruleSpendPoints;\n\n $minPoints = $minPoints ? min($minPoints, $ruleMinPoints) : $ruleMinPoints;\n\n if ($ruleMinPoints <= $ruleMaxPoints) {\n $quoteSubTotal -= $ruleMaxPoints / $ruleSpendPoints * $monetaryStep;\n $totalPoints += $ruleMaxPoints;\n }\n\n if ($rule->getSpendingStyle($customer) == SpendingStyleInterface::STYLE_FULL) {\n $roundedTotalPoints = floor($totalPoints / $ruleSpendPoints) * $ruleSpendPoints;\n if ($roundedTotalPoints < $totalPoints) {\n $totalPoints = $roundedTotalPoints + $ruleSpendPoints;\n } else {\n $totalPoints = $roundedTotalPoints;\n }\n if ($totalPoints > $balancePoints) {\n $totalPoints = floor($balancePoints / $ruleSpendPoints) * $ruleSpendPoints;\n }\n }\n\n if ($rule->getIsStopProcessing()) {\n break;\n }\n }\n }\n foreach ($this->validItems as $ruleId => $items) {\n $itemPoints = array_merge($itemPoints, $items);\n }\n if ($minPoints > $totalPoints) {\n $minPoints = $totalPoints = 0;\n }\n\n return new \\Magento\\Framework\\DataObject([\n 'min_points' => $minPoints,\n 'max_points' => $totalPoints,\n 'item_points' => $itemPoints,\n ]);\n }", "public function hasMinimumOrderValue()\n {\n return $this->supplier()->min_order_value <= $this->subtotal();\n }", "public function getShipByPosition($position) {\r\n if (false !== $position && $this->value != $position) {\r\n return $this->ships[$position];\r\n }\r\n\r\n return false;\r\n }", "protected function minBasketPriceEligible()\n {\n $helper = Mage::helper('paybyfinance');\n $cart = Mage::getModel('checkout/cart')->getQuote();\n $eligibleAmount = Mage::helper('paybyfinance/cart')\n ->getEligibleAmount($cart->getAllItems());\n\n $minBasketAmount = Mage::getStoreConfig(\n $helper::XML_PATH_MINIMUM_PRICE_BASKET\n );\n\n return ($eligibleAmount >= $minBasketAmount);\n }", "function shipping_required($cart) {\r\n $cart = $this->explode_cart($cart); \r\n \r\n foreach ($cart as $item) {\r\n if (!$this->SC->Items->item_flag($item['id'],'digital')) {\r\n return TRUE;\r\n }\r\n }\r\n \r\n return FALSE;\r\n }", "private function getApplicableItem(Cart $cart): ?CartItem\n {\n $item = null;\n foreach ($cart->getItems() as $cartItem) {\n if ($cartItem->getQuantity() >= $this->getStep()\n && $this->getCode() === $cartItem->getProduct()->getCode()\n ) {\n $item = $cartItem;\n }\n }\n\n return $item;\n }", "function cart_has_product_with_shipping_class( $slug ) {\n \n global $woocommerce;\n \n $product_in_cart = false;\n \n // start of the loop that fetches the cart items\n \n foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {\n \n $_product = $values['data'];\n $terms = get_the_terms( $_product->id, 'product_shipping_class' );\n \n if ( $terms ) {\n foreach ( $terms as $term ) {\n $_shippingclass = $term->slug;\n if ( $slug === $_shippingclass ) {\n \n // Our Shipping Class is in cart!\n $product_in_cart = true;\n }\n }\n }\n }\n \n return $product_in_cart;\n}", "public function requiresShippingAddress()\n {\n if (!$this->requiresShipping()) {\n return false;\n }\n\n if (!isset($this->arrCache['requiresShippingAddress'])) {\n $this->arrCache['requiresShippingAddress'] = true;\n $arrItems = $this->getItems();\n\n foreach ($arrItems as $objItem) {\n $product = $objItem->getProduct();\n if ($product instanceof IsotopeProduct && \\method_exists($product, 'isPickupOnly') && $product->isPickupOnly()) {\n $this->arrCache['requiresShippingAddress'] = false;\n break;\n }\n }\n }\n\n return $this->arrCache['requiresShippingAddress'];\n }", "private function getNearestAvailableCar()\n {\n return Car::find()\n ->where([\n 'type' => $this->type,\n 'status' => Car::STATUS_AVAILABLE\n ])\n ->orderBy(\"SQRT((($this->currentLocationX - current_location_x) * ($this->currentLocationX - current_location_x)) + (($this->currentLocationY - current_location_y) * ($this->currentLocationY - current_location_y))) ASC\")\n ->one();\n\n }", "public function firstDocumentPositionTax(): bool\n {\n $this->positionTaxPointer = 0;\n\n $tradeLineItem = $this->getInvoiceValueByPath(\"getSupplyChainTradeTransaction.getIncludedSupplyChainTradeLineItem\", []);\n $tradeLineItem = $tradeLineItem[$this->positionPointer];\n\n $taxes = $this->objectHelper->ensureArray($this->getInvoiceValueByPathFrom($tradeLineItem, \"getSpecifiedLineTradeSettlement.getApplicableTradeTax\", []));\n\n return isset($taxes[$this->positionTaxPointer]);\n }", "public function canShip()\n {\n if ($this->status == 'fraud')\n return false;\n\n foreach ($this->items as $item) {\n if ($item->qty_to_ship > 0) {\n return true;\n }\n }\n\n return false;\n }", "public function isParcelshopDelivery() {\n $shipment = $this->_getCurrentShipment();\n return Mage::helper('synergeticagency_gls/validate')->isParcelshopDelivery($shipment);\n }", "public function subnet_first_free_address () {\n\t\t// Check for id\n\t\t$this->validate_subnet_id ();\n\t\t// check for isFull\n\t\t$subnet = $this->read_subnet ();\n\t\tif($subnet->isFull==1) { $this->Response->throw_exception(404, \"No free addresses found\"); }\n // slaves\n if($this->Subnets->has_slaves ($this->_params->id)) { $this->Response->throw_exception(409, \"Subnet contains subnets\"); }\n\t\t// fetch\n\t\t$first = $this->Addresses->get_first_available_address ($this->_params->id, $this->Subnets);\n\t\t// available?\n\t\tif($first===false)\t{ $this->Response->throw_exception(404, \"No free addresses found\"); }\n\t\telse\t\t\t\t{ $first = $this->Addresses->transform_to_dotted($first); }\n\n\t\t# return\n\t\treturn $first;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send summary to all available receivers
public function send($summary) { foreach ($this->receivers as $receiver) { $receiver = $this->make($receiver); if ($receiver->allowed()) { $receiver->call($summary); } } }
[ "public function receivers();", "public static function send_summary() {\n\t\t// send the email\n\t\t$subject = __('Follow-up emails summary', 'follow_up_emails');\n\t\t$recipient = self::get_summary_recipient_emails();\n\t\t$body = self::get_summary_email_html();\n\n\t\tFUE_Sending_Mailer::mail($recipient, $subject, $body);\n\n\t\tupdate_option( 'fue_last_summary', current_time( 'timestamp' ) );\n\t\tupdate_option( 'fue_next_summary', current_time( 'timestamp' ) + 86400 );\n\t}", "public function sendersAction()\n {\n $service = new AmavisService();\n $this->view->messages = $service->topSenders();\n }", "public function actionCollectorReport() {\n /*Get result using model method*/\n $result = [\n ['a', 'b', 'c',],\n [1, 2, 3,],\n ];\n\n $fileName = 'debtorList' . date('Y-m-d');\n $this->createCSV($result, $fileName);\n\n //$subscribers = Subscriber::getSubscribers('collector');\n //$this->actionSendReport($fileName, $subscribers);\n\n }", "protected static function sendAllStats() {\n if (empty(static::$queuedStats) && empty(static::$queuedCounters))\n return;\n\n $lines = static::$queuedStats;\n foreach(static::$queuedCounters as $stat => $value) {\n $lines[] = \"$stat:$value|c\";\n }\n\n static::sendAsUDP(implode(\"\\n\", $lines));\n\n static::$queuedStats = array();\n static::$queuedCounters = array();\n }", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "public function send_summary() {\n\t\tif ( ! Helper::get_settings( 'general.sync_global_setting' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$registered = Admin_Helper::get_registration_data();\n\t\tif ( $registered && isset( $registered['username'] ) && isset( $registered['api_key'] ) ) {\n\t\t\tStats::get()->set_date_range( '-30 days' );\n\t\t\t$stats = Stats::get()->get_analytics_summary();\n\t\t\t\\RankMathPro\\Admin\\Api::get()->send_summary(\n\t\t\t\t[\n\t\t\t\t\t'username' => $registered['username'],\n\t\t\t\t\t'api_key' => $registered['api_key'],\n\t\t\t\t\t'site_url' => esc_url( home_url() ),\n\t\t\t\t\t'impressions' => array_values( $stats['impressions'] ),\n\t\t\t\t\t'clicks' => array_values( $stats['clicks'] ),\n\t\t\t\t\t'keywords' => array_values( $stats['keywords'] ),\n\t\t\t\t\t'pageviews' => isset( $stats['pageviews'] ) && is_array( $stats['pageviews'] ) ? array_values( $stats['pageviews'] ) : [],\n\t\t\t\t\t'adsense' => isset( $stats['adsense'] ) && is_array( $stats['adsense'] ) ? array_values( $stats['adsense'] ) : [],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}", "public function flushMetrics()\n {\n foreach ($this->senders as $sender) {\n $sender->flushMetrics();\n }\n }", "protected static function sendAllStats() {\n if (empty(static::$queuedStats) && empty(static::$queuedCounters))\n return;\n\n foreach(static::$queuedCounters as $stat => $value) {\n $line = \"$stat:$value|c\";\n static::$queuedStats[] = $line;\n }\n\n self::sendLines(static::$queuedStats);\n\n static::$queuedStats = array();\n static::$queuedCounters = array();\n }", "public function getSummaryRecipients()\n\t{\n\t\treturn $this->summary_recipients;\n\t}", "private function sendAdminSummaryMail()\n {\n $admin_summary = new AdminSummary();\n\n return $admin_summary->send();\n }", "public static function broadcastEmailNotifications()\n {\n $activeAccounts = static::find()->active();\n foreach($activeAccounts->each(50) as $account){\n $account->sendAgentsNotificationEmail();\n }\n }", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function senders()\n {\n $_params = array();\n return $this->master->call('users/senders', $_params);\n }", "public function callers()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$users = $this->userModel->get_all_callers();\n\t\tforeach ($users as $user)\n\t\t{\n\t\t\treset_language(user_language($user));\n\n\t\t\t$this->email->clear();\n\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $user->email);\n\t\t\t$this->email->subject(lang('rem_subject'));\n\n\t\t\t$call_messages = array();\n\t\t\t$experiments = $this->callerModel->get_experiments_by_caller($user->id);\n\t\t\tforeach ($experiments as $experiment)\n\t\t\t{\n\t\t\t\tif ($experiment->archived != 1)\n\t\t\t\t{\n\t\t\t\t\t$count = count($this->participantModel->find_participants($experiment));\n\t\t\t\t\tif ($count > 0) array_push($call_messages, sprintf(lang('rem_exp_call'), $experiment->name, $count));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($call_messages)\n\t\t\t{\n\t\t\t\t$message = sprintf(lang('mail_heading'), $user->username);\n\t\t\t\t$message .= '<br /><br />';\n\t\t\t\t$message .= lang('rem_body');\n\t\t\t\t$message .= '<br />';\n\t\t\t\t$message .= ul($call_messages);\n\t\t\t\t$message .= lang('mail_ending');\n\t\t\t\t$message .= '<br /><br />';\n\t\t\t\t$message .= lang('mail_disclaimer');\n\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: echo $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "public function actionStatisticsCustomerEmail(){\r\n\t\t$dbqueue2Conn = \\yii::$app->db_queue2;\r\n\t\t$allcount = $dbqueue2Conn->createCommand('SELECT count(1) count FROM customer_email')->queryAll();\r\n\t\techo \"\\n allCount: \".$allcount[0]['count'].\"\\n\";\r\n\t\t\r\n\t\t$platform_arr = $dbqueue2Conn->createCommand('SELECT platform_source, count(1) count FROM customer_email group by platform_source')->queryAll();\r\n\t\tif(!empty($platform_arr)){\r\n\t\t\techo \"\\n platform group statistics\";\r\n\t\t\tforeach($platform_arr as $val){\r\n\t\t\t\techo \"\\n \".$val['platform_source'].\": \".$val['count'];\r\n\t\t\t}\r\n\t\t\techo \"\\n \";\r\n\t\t}\r\n\t}", "public function allBySenderAnReceiverID(int $senderId, int $receiverId);", "public function sendMessagesAll($sendSettings);", "private function sendGeneralNotify()\n {\n $this->arr_emails = [];\n $cur_key = -1;\n \n foreach ($this->arr_views as $info) {\n\n foreach ($info['emails'] as $em) {\n if ($cur_key < 0 || $this->arr_emails[$cur_key]['email'] != $em) {\n $cur_key = $this->findEmailKey($em);\n }\n \n $is_added = false;\n foreach($this->arr_emails[$cur_key]['views'] as $view) {\n if ($view['view_id'] == $info['view']->id) {\n $is_added = true;\n \n break;\n }\n }\n \n if (!$is_added) {\n array_push($this->arr_emails[$cur_key]['views'], [\n 'view_id' => $info['view']->id,\n 'count' => $info['count'],\n 'view_title' => $info['view']->title,\n ]);\n }\n }\n }\n \n foreach ($this->arr_emails as $notify) {\n $arr_data = [];\n $arr_data['email'] = $notify['email'];\n $arr_data['subject'] = sprintf(trans('monitor_email.' . (count($this->arr_views) > 1 ? 'intro_general_n' : 'intro_general_1')), count($this->arr_views), trans('index.app_name'));\n $arr_data['items'] = $notify['views'];\n \n dispatch(new \\App\\Jobs\\SendMonitoringMail($arr_data, 'emails.monitor_general'));\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that two API requests don't send the same order ID and merchant reference. This was the case when users doubleclicked and we were using the last 5 digits of time in seconds as a suffix. We want to see what happens when a 2nd request comes in while the 1st is still waiting for a CURL response, so here we fake that situation by having CURL throw an exception during the 1st response.
public function testNoDupeOrderId() { $this->setUpRequest( [ 'action' => 'donate', 'amount' => '3.00', 'card_type' => 'amex', 'city' => 'Hollywood', 'contribution_tracking_id' => '22901382', 'country' => 'US', 'currency' => 'USD', 'email' => 'FaketyFake@gmail.com', 'first_name' => 'Fakety', 'format' => 'json', 'gateway' => 'ingenico', 'language' => 'en', 'last_name' => 'Fake', 'payment_method' => 'cc', 'referrer' => 'http://en.wikipedia.org/wiki/Main_Page', 'state_province' => 'MA', 'street_address' => '99 Fake St', 'utm_campaign' => 'C14_en5C_dec_dsk_FR', 'utm_medium' => 'sitenotice', 'utm_source' => 'B14_120921_5C_lg_fnt_sans.no-LP.cc', 'postal_code' => '90210' ] ); $gateway = new IngenicoAdapter(); $calls = []; $this->hostedCheckoutProvider->expects( $this->exactly( 2 ) ) ->method( 'createHostedPayment' ) ->with( $this->callback( function ( $arg ) use ( &$calls ) { $calls[] = $arg; if ( count( $calls ) === 2 ) { $this->assertFalse( $calls[0] === $calls[1], 'Two calls to the api did the same thing' ); } return true; } ) ) ->will( $this->onConsecutiveCalls( $this->throwException( new Exception( 'test' ) ), $this->returnValue( $this->hostedCheckoutCreateResponse ) ) ); try { $gateway->do_transaction( 'createHostedCheckout' ); } catch ( Exception $e ) { // totally expected this } // simulate another request coming in before we get anything back from GC $anotherGateway = new IngenicoAdapter(); $anotherGateway->do_transaction( 'createHostedCheckout' ); }
[ "public function testCanNotTakeOrderAlreadyTaken()\n {\n\n $response = $this->put(\"/api/v1/order/2?status=taken\" );\n\n $response\n ->receiveJson()\n ->seeStatusCode(Response::HTTP_CONFLICT)\n ->seeJsonContains([\n 'error' => \"ORDER_ALREADY_BEEN_TAKEN\"\n ]);\n }", "public function testNotChangingExpiration()\n {\n config([\n 'url.check_before' => 0,\n 'url.renovate_on_access' => 0,\n ]);\n\n $data = Url::factory()->create();\n\n // Make first query\n $this->get('/' . $data->slug);\n $date1 = Url::where('slug', $data->slug)->first()->valid;\n\n sleep(1);\n\n // Make second query after 2 secs\n $this->get('/' . $data->slug);\n\n $date2 = Url::where('slug', $data->slug)->first()->valid;\n\n $this->assertEquals($date1->toString(), $date2->toString());\n }", "function testNewInvoiceOrderIdRetry() {\n\t\t$init = $this->getDonorTestData( 'BR' );\n\t\t$gateway = $this->getFreshGatewayObject( $init );\n\t\t$gateway::setDummyGatewayResponseCode( 'collision' );\n\n\t\t$gateway->doPayment();\n\n\t\tparse_str( $gateway->curled[0], $firstParams );\n\t\tparse_str( $gateway->curled[1], $secondParams );\n\n\t\t$this->assertNotEquals( $firstParams['x_invoice'], $secondParams['x_invoice'],\n\t\t\t'Not generating new order id for retried NewInvoice call'\n\t\t);\n\t}", "public function testPullRequestImmediateFailureBadResponse() {\n\t\n\t\t$this->stdLocalNodeInterfaceUri($this->mNode);\n\t\t$otherNode = $this->mockLocalNodeInterface();\n\t\t$nodePublicKey = new Key('nodepublicarmor');\n\t\t$nodeCertificate = new Certificate('nodepublicarmor', false,\n\t\t\t\t'alpha.venus.uk', 'alpha@example.com',\n\t\t\t\t'nodekeyid',[new Signature('nodekeyid')]);\n\t\n\t\n\t\n\t\t$otherNode->method('uri')->willReturn('other.venus.uk');\n\t\t$responseMessage = Message::fromStr(ServiceEncoding::json(['nonsense' => 'blah'], $otherNode));\n\n\t\t$this->mKeyring->expects($this->once())\n\t\t\t->method('getNodeKeyid')\n\t\t\t->withAnyParameters()\n\t\t\t->willReturn('nodekeyid');\n\t\n\t\t$this->mKeyring->expects($this->never())->method('getNodeCertificate');\n\t\n\t\t$this->mKeyring->expects($this->never())->method('getNodePublicKey');\n\t\n\t\t$this->mSnur->expects($this->once())\n\t\t\t->method('requestFirstResponseFromUri')\n\t\t\t->with('spring://other.venus.uk', 'service spring://other.venus.uk/cert/pull/nodekeyid')\n\t\t\t->willReturn($responseMessage);\n\t\t\n\t\t$this->mKvs->expects($this->once())\n\t\t\t->method('get')\n\t\t\t->with('cert.notify')\n\t\t\t->willReturn(false);\n\t\n\t\t$this->mKservice->expects($this->never())->method('expand');\n\t\n\t\t$this->path[] = 'pullreq';\n\t\t$response = $this->service->run($this->path, ['source' => 'other.venus.uk']);\n\t\t$obj = MessageDecoder::jsonServiceTextStripNode($response);\n\t\n\t\t$this->assertNotNull($obj);\n\t\t$this->assertObjectHasAttribute('result', $obj);\n\t\t$this->assertEquals('error', $obj->result);\n\t}", "public function testSynchGetInvalid() {\n global $synchAuthToken;\n\n $data = array();\n $result = getApi('synchTripUser.php', $data, $synchAuthToken);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('hash'=>'');\n $result = getApi('synchTripUser.php', $data, $synchAuthToken);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('hash'=>'non-existent');\n $result = getApi('synchTripUser.php', $data, $synchAuthToken);\n $this->assertEquals(RESPONSE_NOT_FOUND, $result['resultCode']);\n }", "public function testRequestThrottle()\n {\n $this->json('GET', 'api/orderDraft/test');\n $this->json('GET', 'api/orderDraft/test')\n ->assertStatus(Response::HTTP_TOO_MANY_REQUESTS);\n }", "public function testOrdersOneResponseStatus()\n\t{\n\t\t$this->client->request('GET', \"/orders/$this->orderId\");\n\t\t$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n\n\t\t$this->client->request('GET', '/orders/foo');\n\t\t$this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());\n\t}", "public function testRequestId()\n {\n $req1 = new Mad_Controller_Request_Mock();\n $reqId1 = $req1->getRequestId();\n\n $req2 = new Mad_Controller_Request_Mock();\n $reqId2 = $req2->getRequestId();\n\n $this->assertFalse($reqId1 == $reqId2);\n }", "public function testUserCannotFillSameSurveyTwice()\n {\n // Our check is done simply using session ids so we must simulate two requests with same session id.\n $sessionId = $this->faker->uuid;\n\n // First attempt\n $this->submitCompletedSurvey($sessionId)\n ->assertRedirect(route('complete-survey.done'));;\n\n // Second attempt should fail\n $this->submitCompletedSurvey($sessionId)\n ->assertNotFound();\n }", "public function canNotCreateDuplicateForTwoPagesInTheFutureWithTheSameTimestamp() {\n\t\t$this->importDataSet(dirname(__FILE__).'/data/canNotAddDuplicatePagesToQueue.xml');\n\n\t\t$crawler_api = $this->getMockedCrawlerAPI(100000);\n\n\t\t$crawler_api->addPageToQueueTimed(5,100001);\n\t\t$crawler_api->addPageToQueueTimed(5,100001);\n\n\t\t$this->assertEquals($crawler_api->countUnprocessedItems(),1);\n\t}", "public function testNotShouldReturnATransaction()\n {\n $response = $this->call('GET', 'api/transactions/99999999');\n $this->assertEquals(400, $response->original['status']);\n }", "public function testRepeatOrderNotAvailable() {\n $order = new Yourdelivery_Model_Order($this->placeOrder());\n $service = $order->getService();\n $service->setIsOnline(false);\n $service->save();\n $this->dispatch('/request_order/repeat?hash=' . $order->getHashtag());\n $this->assertResponseCode(406);\n $service->setIsOnline(true);\n $service->save();\n }", "public function testTwoNewGETs()\n {\n $client = $this->makeRequest('GET', '/api/test/token1?somevar=hello');\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertSelectorTextContains('body', self::NEW_REQUEST_MESSAGE);\n\n $client = $this->makeRequest('GET', '/api/test/token2?somevar=world');\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertSelectorTextContains('body', self::NEW_REQUEST_MESSAGE);\n }", "public function testAgreementCheck1RefusalRejection()\n {\n $response = $this->json('POST', route('borrowings.store'), [\n 'agreementCheck1' => 'off'\n ]);\n $response->assertJsonValidationErrors('agreementCheck1');\n }", "public function testAccountReSyncHttpFailure()\n {\n \\AspectMock\\test::double('NostoHttpResponse', ['getCode' => 404]);\n\n $oauthMeta = new NostoOAuthClientMetaData();\n $oauthMeta->setAccount($this->account);\n\n $this->setExpectedException('NostoHttpException');\n $this->service->sync($oauthMeta, 'test123');\n }", "public function testUniqueNonceSameTime() {\n $time = time();\n $values = array();\n foreach (range(1,100) as $i) {\n $val = $this->oauth->generateNonce($time);\n $this->assertFalse(in_array($val, $values), 'Generated nonce should be unique,'.\n ' even with identical timestamp');\n $values[] = $val;\n }\n }", "public function testGetstoredetailsMissUserId() {\n $baseUrl = $this->getContainer()->getParameter('symfony_base_url');\n $serviceUrl = $baseUrl . 'api/getstoredetails?access_token=ZDM0MjM0NDFkZDMzMDNhMjU5NzdhMjA1MTY5ZjY3OGEyNDk1MGNiYjczODE2NWIzMTRkZjk0ZDU4YWQ2MTZhYQ';\n $data = '{\"reqObj\":{\"store_id\":\"3813\"}}';\n $client = new CurlRequestService();\n $response = $client->send('POST', $serviceUrl, array(), $data)\n ->getResponse();\n $response = json_decode($response);\n $this->assertEquals(300, $response->code);\n }", "public function testRequestTokenWithExplicitInvalidTimestamp() {\n $requestTime = self::$ably->time();\n $tokenParams = array_merge(self::$tokenParams, [\n 'timestamp' => $requestTime - 30 * 60 * 1000 // half an hour ago\n ]);\n $this->expectException(AblyException::class);\n $this->expectExceptionMessage('Timestamp not current');\n $this->expectExceptionCode(40104);\n self::$ably->auth->requestToken( $tokenParams );\n }", "public function testGetPurchaseWithInvalidID()\n {\n $this->expectException(GuzzleHttp\\Exception\\ClientException::class);\n $this->api->get_purchase(12345);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a copy of this set guaranteed to contain the given item (or one with an identical hash)
public function add($item): Set;
[ "public function add($item)\n {\n if ($item instanceof self) {\n foreach ($item->set as $i) {\n $this->add($i);\n }\n\n return;\n }\n\n $this->checkType($item);\n $hash = $this->hash($item);\n if (!isset($this->set[$hash]) && $this->tryEq($item) === NULL) {\n $this->set[$hash] = $item;\n }\n }", "abstract public function generateHash($item);", "public function setHash(string $hash = null) : CNabuDataObject\n {\n $this->setValue('nb_medioteca_item_hash', $hash);\n \n return $this;\n }", "static protected function _getItemHash(BaseZF_Item_Abstract $item)\n {\n return spl_object_hash($item);\n }", "public function contains($item): bool\n {\n $hash = ($this->hashFunction)($item);\n\n if (!array_key_exists($hash, $this->hashMap)) {\n return false;\n }\n\n foreach ($this->hashMap[$hash] as $element) {\n if (($this->equalityFunction)($element, $item)) {\n return true;\n }\n }\n\n return false;\n }", "public function copy ()\n {\n return new static($this->hash);\n }", "protected function _getContaining($item)\n {\n $me = $this;\n return $this->_search(function($idx, $set, &$isContinue) use ($item, $me) {\n return $me->_evalSetByHavingItem($idx, $set, $isContinue, $item);\n });\n }", "public function getHash()\n {\n return $this->itemHash;\n }", "public static function findByHash(string $hash)\n {\n return CNabuCatalogItem::buildObjectFromSQL(\n 'select * '\n . 'from nb_catalog_item '\n . \"where nb_catalog_item_hash='%hash\\$s'\",\n array(\n 'hash' => $hash\n )\n );\n }", "public function remove($item): Set\n {\n return $this->removeCore([$item]);\n }", "public function copy(): Set\n {\n // ImmutableSet extends Set, so return the calling class' type.\n return new static($this->A);\n }", "function getItem( $hash ) {}", "function Sql_Select_Hash_Unique($where,$noecho=FALSE,$sqldata=array(),$table=\"\")\n {\n if (is_array($where)) { $where=$this->Hash2SqlWhere($where); }\n if (empty($table)) { $table=$this->SqlTableName($table); }\n\n if (count($sqldata)==0) { $sqldata=\"*\"; }\n\n $items=$this->Sql_Select_Hashes($where,$sqldata,\"ID\",FALSE,$table);\n\n $item=NULL;\n if (count($items)==0 && !$noecho)\n { \n $this->AddMsg\n (\n $this->ModuleName.\n \": SelectUniqueHash: No such item in table $table: $where'\",\n 2\n );\n }\n elseif (count($items)>1 && !$noecho)\n {\n $this->AddMsg\n (\n $this->ModuleName.\n \", SelectUniqueHash: More than one item in table $table: '$where'\",\n 2\n );\n }\n\n if (count($items)>=1){ $item=$items[0]; }\n\n return $item;\n }", "function Sql_Update_Where_Unique($item,$where,$datas=array(),$table=\"\")\n {\n $hash=$this->SelectUniqueHash($table,$uniquewhere);\n if (empty($hash) || empty($hash[ \"ID\" ])) { return FALSE; }\n \n return $this->Sql_Update_Where($item,$where,$datas,$table);\n }", "public function uniqueSet();", "protected function setHash(DataModel $item, &$data)\n\t{\n\t\t// Sanity check\n\t\tif (!(\n\t\t\t$item->hasField('lft') && \n\t\t\t$item->hasField('rgt') && \n\t\t\t$item->hasField('hash') && \n\t\t\t$item->hasField('slug')\n\t\t))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$slugField = $item->getFieldAlias('slug');\n\n\t\t// sha1 hash of 'null' is 'da39a3ee5e6b4b0d3255bfef95601890afd80709',\n\t\t// so avoid setting the hash if no slug has been set. Set from input first.\n\t\tif ( isset($slugField, $data) )\n\t\t{\n\t\t\t$data['hash'] = sha1( $data[$slugField] );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $slug = $item->getFieldValue($slugField) )\n\t\t{\n\t\t\t$data['hash'] = $slug;\n\n\t\t\treturn;\n\t\t}\n\t}", "public function byHash($hash);", "public function testCheckHash()\n {\n $res = checkHash(self::$item, self::$item->num);\n $this->assertEquals(0, $res['code']);\n $this->assertEquals(self::$result['id'], $res['WP_ID']);\n\n $i = clone self::$item;\n $i->name = 'Testy McTestFace';\n $i->hashRegen();\n $res = checkHash($i, $i->num);\n $this->assertEquals(1, $res['code']);\n $this->assertEquals(self::$result['id'], $res['WP_ID']);\n\n $i = clone self::$item;\n $i->num = 'test99';\n $i->hashRegen();\n $res = checkHash($i, $i->num);\n $this->assertEquals(2, $res['code']);\n\n }", "public function with($key, $item): Collection;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get number of issues for giving supplier.
public function getCountIssuesForSupplier( Supplier $supplier ) { return $this->createQueryBuilder('issue') ->select('COUNT(issue.id) as total') ->where('issue.supplier = :supplier') ->setParameter('supplier', $supplier) ->getQuery() ->getSingleScalarResult(); }
[ "public function issuesCount()\n\t{\n\t\treturn $this->issues('count');\n\t}", "public function countIssues() {\n return $this->lookupIssues()->count();\n }", "public function getCount()\n {\n $filter['high'] = array_filter($this->issues, [$this, 'filterHigh']);\n $filter['medium'] = array_filter($this->issues, [$this, 'filterMedium']);\n $filter['low'] = array_filter($this->issues, [$this, 'filterLow']);\n $issues = $this->calculateIssues($filter);\n\n return $issues;\n }", "public function getTotalSuppliers() {\n\t\t$query = $this->db->query(\"SELECT COUNT(*) AS total FROM \" . DB_PREFIX . \"wkpos_supplier\");\n\n\t\treturn $query->row['total'];\n\t}", "private function problemsCount() {\n\t\treturn count($this->problems);\n\t}", "public function issuesCount()\n {\n return $this->issues()\n ->selectRaw('project_id, count(*) as aggregate')\n ->groupBy('project_id');\n }", "public function riskyCount(): int\n {\n return count($this->risky);\n }", "public function getRecentIssuesCount()\n {\n $criteria = new CDbCriteria();\n $criteria->condition = \"remark_id!=\".Order::REMARK_SUCCESS;\n $criteria->compare('status_id', Order::STATUS_DELIVERED);\n\n return $this->carrierOrdersCount($criteria);\n }", "public function getTotalSupplyRequests() {\n\t\t$query = $this->db->query(\"SELECT COUNT(*) AS total FROM \" . DB_PREFIX . \"wkpos_supplier_request\");\n\n\t\treturn $query->row['total'];\n\t}", "public function get_supply_item_count() {\n\t\treturn count($this->supplies->group_by('supply_id')->find_all()) + 1;\n\t}", "public function getIssueCount()\n {\n $issues = $this->gitHub->issues()\n ->all($this->username, $this->repository, [ 'state' => 'all', 'labels' => 'contributions-bot' ]);\n\n return count($issues);\n }", "public function getNotAssignedCount(): int;", "public function getAppliersCount()\n {\n return $this->count(self::_APPLIERS);\n }", "public function get_number_of_assignees()\n {\n $db = new PHPWS_DB('hms_assignment');\n\n $db->addJoin('LEFT OUTER', 'hms_assignment','hms_bed', 'bed_id', 'id');\n $db->addJoin('LEFT OUTER', 'hms_bed', 'hms_room', 'room_id', 'id');\n $db->addJoin('LEFT OUTER', 'hms_room', 'hms_floor', 'floor_id', 'id');\n\n $db->addWhere('hms_floor.id', $this->id);\n\n $result = $db->select('count');\n\n if($result == 0) {\n return $result;\n }\n\n if(PHPWS_Error::logIfError($result)) {\n throw new DatabaseException($result->toString());\n }\n\n return $result;\n }", "public function numberofrtips(){\n $numberoftips = $this->db->count_all_results('health_tips');\n return $numberoftips;\n }", "function countSuppliers($type = 0) {\n\n if ($type > 0) {\n if (isset($this->suppliers[$type])) {\n return count($this->suppliers[$type]);\n }\n\n } else {\n if (count($this->suppliers)) {\n $count = 0;\n foreach ($this->suppliers as $u) {\n $count += count($u);\n }\n return $count;\n }\n }\n return 0;\n }", "public function count(): int\n {\n return count($this->exercises);\n }", "static function get_assigned_open_bug_count() {\n\t\treturn \\Core\\User::get_assigned_open_bug_count( \\Core\\Auth::get_current_user_id(), \\Core\\Helper::get_current_project() );\n\t}", "function getExercisesCount() : int {\n try {\n\n //Count how many exercises there are in the database.\n return $this->db->table($this->table)\n ->select(\"count(*)\")\n ->get()\n ->getFirstRow('array')[\"count(*)\"];\n } catch (Exception $e) {\n error_log (\"Error at getNbExercices\");\n return -1;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setTopAxisTitle Sets the axis title to appear on the top edge of the graph
function setTopAxisTitle($text = '') { $this->axis_data[3]['t'] = $text; }
[ "function setBottomAxisTitle($text = '')\n {\n $this->axis_data[1]['t'] = $text;\n }", "public function plotTitle($title) {\n\t\t$this->plotAtt['title'] = \"set title '\" . $title . \"'\\n\";\n\t}", "public function setStrYAxisTitle($strTitle) {\n $this->strYAxisTitle = $strTitle;\n }", "function SetTitleSide($aSideOfAxis) {\n $this->title_side = $aSideOfAxis;\n }", "public function getTitle() {\r\n if ($this->axisTitle == null) {\r\n $this->axisTitle = new AxisTitle($this->chart);\r\n if ($this->horizontal)\r\n $this->axisTitle->setAngle(0);\r\n else\r\n $this->axisTitle->setAngle(90); \r\n }\r\n return $this->axisTitle;\r\n }", "function SetXTitle($which_xtitle, $which_xpos = 'plotdown')\n {\n if (!($which_xpos = $this->CheckOption($which_xpos, 'plotdown, plotup, both, none', __FUNCTION__)))\n return FALSE;\n if (($this->x_title_txt = $which_xtitle) === '')\n $this->x_title_pos = 'none';\n else\n $this->x_title_pos = $which_xpos;\n return TRUE;\n }", "public function setWorksheetTitle ($title)\n {\n $title = preg_replace (\"/[\\\\\\|:|\\/|\\?|\\*|\\[|\\]]/\", \"\", $title);\n $title = substr ($title, 0, 31);\n $this->sWorksheetTitle = $title;\n }", "function _set_title($title=NULL) {\n $this->output->prepend_title($title);\n }", "protected function draw_chart_title(){\n\n\t\tif($this->chart_title) {\n\n\t\t\t/* calculate the size of the title */\n\t\t\t$title_box = imageftbbox($this->title_font_size, 0, $this->title_font, $this->chart_title);\n\t\t\t$x = $title_box[0] + ($this->canvas_width / 2) - ($title_box[4] / 2);\n\t\t\t$y = 2*$this->title_font_size;\n\n\t\t\t/* draw the title */\n\t\t\timagefttext($this->img, $this->title_font_size,0 ,$x ,$y , $this->title_font_color, $this->title_font, $this->chart_title);\n\n\t\t}\n\t}", "function SetWindowTitle(string $title): void { }", "public function setOgTitle($og_title);", "function setSeriesTitle($title) {\n\t\t $this->setData('seriesTitle', $title);\n\t}", "function SetXTitle($which_xtitle, $which_xpos = 'plotdown') \n {\n if ($which_xtitle == '')\n $which_xpos = 'none';\n\n $this->x_title_pos = $this->CheckOption($which_xpos, 'plotdown, plotup, both, none', __FUNCTION__);\n\n $this->x_title_txt = $which_xtitle;\n\n $str = split(\"\\n\", $which_xtitle);\n $lines = count($str);\n $spacing = $this->line_spacing * ($lines - 1);\n\n if ($this->use_ttf) {\n $size = $this->TTFBBoxSize($this->x_title_font['size'], 0, $this->x_title_font['font'], $which_xtitle);\n $this->x_title_height = $size[1] * $lines;\n } else {\n $this->x_title_height = ($this->y_title_font['height'] + $spacing) * $lines;\n }\n\n return TRUE;\n }", "public function setWorksheetTitle ($title) {\n\t\t\tif (isEmptyString($title)) {\n\t\t\t\t$title = \"Sheet 1\"; \n\t\t\t}\n\n // strip out special chars first\n $title = preg_replace (\"/[\\\\\\|:|\\/|\\?|\\*|\\[|\\]]/\", \"\", $title);\n\n // now cut it to the allowed length\n $title = substr ($title, 0, 31);\n\n // set title\n $this->worksheet_title = $title;\n\n }", "protected function set_title()\n {\n }", "function DrawYTitle()\n {\n if ($this->y_title_pos == 'none')\n return;\n\n // Center the title vertically to the plot\n $ypos = ($this->plot_area[3] + $this->plot_area[1]) / 2;\n\n if ($this->y_title_pos == 'plotleft' || $this->y_title_pos == 'both') {\n $xpos = $this->safe_margin;\n $this->DrawText($this->y_title_font, 90, $xpos, $ypos, $this->ndx_title_color,\n $this->y_title_txt, 'left', 'center');\n }\n if ($this->y_title_pos == 'plotright' || $this->y_title_pos == 'both') {\n $xpos = $this->image_width - $this->safe_margin - $this->y_title_width - $this->safe_margin;\n $this->DrawText($this->y_title_font, 90, $xpos, $ypos, $this->ndx_title_color,\n $this->y_title_txt, 'left', 'center');\n }\n\n return TRUE;\n }", "public function getYAxisTitle()\n\t{\n\t\treturn $this->_yAxisTitle;\n\t}", "function setTitle($title, $font = false)\n {\n $this->_title = $title;\n if ($font === 'vertical') {\n $this->_titleFont = array('vertical' => true, 'angle' => 90);\n } elseif ($font === 'vertical2') {\n $this->_titleFont = array('vertical' => true, 'angle' => 270);\n } else {\n $this->_titleFont =& $font;\n }\n }", "public function setTitleEnd($titleEnd) \n {\n $this->titleEnd = $titleEnd;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return only supported operators by this condition.
public function getOperators() { return array_filter( parent::getOperators(), function ( $operator ) { return in_array( $operator, [ '!=', '==' ] ); }, ARRAY_FILTER_USE_KEY ); }
[ "public function get_operators() {\n\t\t$wpc_condition = wpc_get_condition( $this->condition );\n\t\treturn apply_filters( 'wapl_operators', $wpc_condition->get_available_operators() );\n\t}", "public function getSupportedOperators()\n {\n return $this->operators;\n }", "protected function supportedOperators() {\n return array(\n '=',\n 'IN',\n 'CONTAINS'\n );\n }", "public function availableOperators()\n {\n return array('me', 'group', 'groups', 'in', 'ins');\n }", "public function get_filter_operators() {\n\t\t$operators = $this->type == 'product' ? array( 'is' ) : array( 'is', 'isnot', '>', '<' );\n\n\t\treturn $operators;\n\t}", "protected function allowedOperators(): array\n {\n return [ '*' ];\n }", "private function getAllowedOperators()\n {\n return [\n EntityMap::TYPE_STRING => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_LIKE,\n self::OPERATOR_NOT_LIKE,\n ],\n EntityMap::TYPE_INTEGER => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_GT,\n self::OPERATOR_GTE,\n self::OPERATOR_LT,\n self::OPERATOR_LTE,\n self::OPERATOR_BTW,\n ],\n EntityMap::TYPE_DOUBLE => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_GT,\n self::OPERATOR_GTE,\n self::OPERATOR_LT,\n self::OPERATOR_LTE,\n self::OPERATOR_BTW,\n ],\n EntityMap::TYPE_BOOLEAN => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n ],\n EntityMap::TYPE_ARRAY => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_EMPTY,\n self::OPERATOR_IS_NOT_EMPTY,\n self::OPERATOR_HAS,\n self::OPERATOR_NOT_HAS,\n ],\n ];\n }", "public function getOperators()\n\t{\n\t\treturn $this->operators;\n\t}", "public function getOperators()\n {\n return array();\n }", "public function getOperators()\n {\n return $this->operators;\n }", "public function getOperators()\n {\n return array(\n );\n }", "protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }", "public static function getConditionOperators()\n\t{\n\t\tinclude_once './Services/AccessControl/classes/class.ilConditionHandler.php';\n\t\treturn array(\n\t\t\tilConditionHandler::OPERATOR_PASSED,\n\t\t\tilConditionHandler::OPERATOR_FAILED\n\t\t);\n\t}", "public function usesOperators(): bool\n {\n return $this->operators;\n }", "public function getOperators();", "public function get_filter_operators() {\n\t\treturn array( 'is' );\n\t}", "function getOperators()\n {\n return array();\n }", "public function getComparisonOperators()\n {\n return $this->operators['comparison'];\n }", "public function getOperators() : array\n {\n return $this->operators;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the [treatingfax] column value.
public function getTreatingfax() { return $this->treatingfax; }
[ "function getFax() {\n\t\treturn $this->getData('fax');\n\t}", "public function get_fax_number(){\n\t\treturn $this->v_fax_number;\n\t}", "public function getFax()\n\t{\n\t\treturn $this->getKeyValue('fax'); \n\n\t}", "public function getEtblFax() {\n return $this->etblFax;\n }", "function faxNumber()\n {\n return $this->faxNumber; \n }", "public function getFax()\n {\n return $this->fax;\n }", "public function getFaxnbr()\n {\n return $this->faxnbr;\n }", "public function getTaxFeeNumber(){\n\t\treturn $this->taxFee_number;\n\t}", "public function getFaxNumber()\n {\n return $this->faxNumber;\n }", "public function getFaxPhone()\n\t{\n\t\treturn $this->fax_phone;\n\t}", "public function organizationNumberFax()\n {\n return $this->numberFax;\n }", "public function getCfax()\n {\n return $this->cfax;\n }", "public function getFaxNumber()\n {\n return isset($this->faxNumber) ? $this->faxNumber : null;\n }", "public function getFax() {\n $fax = parent::getFax();\n\n if (!is_null($fax) && ($fax != 0)) {\n return $fax;\n }\n\n // restaurant has no fax, so get the fax of billing contact person\n try {\n $billcontact = new Yourdelivery_Model_Contact($this->getBillingContactId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n\n }\n\n if (!is_null($billcontact) && strlen($billcontact->getFax()) > 0) {\n return $billcontact->getFax();\n }\n\n // restaurant has no fax and billing contact person has no fax, so get the fax of contact person\n try {\n $contact = new Yourdelivery_Model_Contact($this->getContactId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n return null;\n }\n\n if (!is_null($contact) && strlen($contact->getFax()) > 0) {\n return $contact->getFax();\n }\n\n return null;\n }", "public function getCoordfaxphone()\n\t{\n\t\treturn $this->coordfaxphone;\n\t}", "public function getFax()\n {\n return $this->getParameter('billingFax');\n }", "public function getNomorFax()\n {\n return $this->nomor_fax;\n }", "public function getReqfaxphone()\n\t{\n\t\treturn $this->reqfaxphone;\n\t}", "public function getTaxVal() {\n\t\treturn $this->taxVal;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the necessary authorization. In case of a test verifying publicly accessible REST resources: grant permissions to the anonymous user role. In case of a test verifying behavior when using a particular authentication provider: create a user with a particular set of permissions. Because of the $method parameter, it's possible to first set up authentication for only GET, then add POST, et cetera. This then also allows for verifying a 403 in case of missing authorization.
abstract protected function setUpAuthorization($method);
[ "public function testCanMethodAsUser()\n {\n $auth = m::mock('\\Antares\\Contracts\\Auth\\Guard');\n\n $auth->shouldReceive('guest')->times(2)->andReturn(false)\n ->shouldReceive('roles')->times(2)->andReturn(['Admin', 'Staff']);\n\n $runtime = $this->getRuntimeMemoryProvider();\n $runtime->put('acl_foo', $this->memoryProvider());\n\n $stub = new Authorization($auth, 'foo', $runtime);\n\n $stub->addRoles(['Staff']);\n $stub->addActions(['Manage Application', 'Manage Photo']);\n $stub->allow('Admin', ['Manage Application', 'Manage Photo']);\n $stub->allow('Staff', ['Manage Photo']);\n\n $this->assertTrue($stub->can('manage application'));\n $this->assertTrue($stub->can('manage photo'));\n }", "public function testCanMethodAsUser()\n {\n $auth = m::mock('Orchestra\\Contracts\\Auth\\Guard,Illuminate\\Contracts\\Auth\\Guard');\n\n $auth->shouldReceive('guest')->times(2)->andReturn(false)\n ->shouldReceive('roles')->times(2)->andReturn(new Collection(['Admin', 'Staff']));\n\n $runtime = $this->getRuntimeMemoryProvider();\n $runtime->put('acl_foo', $this->memoryProvider());\n\n $stub = (new Authorization('foo', $runtime))->setAuthenticator($auth);\n\n $stub->addRoles(['Staff']);\n $stub->addActions(['Manage Application', 'Manage Photo']);\n $stub->allow('Admin', ['Manage Application', 'Manage Photo']);\n $stub->allow('Staff', ['Manage Photo']);\n\n $this->assertTrue($stub->can('manage application'));\n $this->assertTrue($stub->can('manage photo'));\n }", "protected function setupSecurity()\n {\n $this->accessDecisionManager = $this->objectManager->get('TYPO3\\Flow\\Security\\Authorization\\AccessDecisionManagerInterface');\n $this->accessDecisionManager->setOverrideDecision(null);\n\n $this->policyService = $this->objectManager->get('TYPO3\\Flow\\Security\\Policy\\PolicyService');\n\n $this->authenticationManager = $this->objectManager->get('TYPO3\\Flow\\Security\\Authentication\\AuthenticationProviderManager');\n\n $this->testingProvider = $this->objectManager->get('TYPO3\\Flow\\Security\\Authentication\\Provider\\TestingProvider');\n $this->testingProvider->setName('TestingProvider');\n\n $this->securityContext = $this->objectManager->get('TYPO3\\Flow\\Security\\Context');\n $this->securityContext->clearContext();\n $httpRequest = Request::createFromEnvironment();\n $this->mockActionRequest = new ActionRequest($httpRequest);\n $this->mockActionRequest->setControllerObjectName('TYPO3\\Flow\\Tests\\Functional\\Security\\Fixtures\\Controller\\AuthenticationController');\n $this->securityContext->setRequest($this->mockActionRequest);\n }", "public function testCanMethodAsAdminUser()\n {\n $auth = m::mock('\\Antares\\Contracts\\Auth\\Guard');\n\n $auth->shouldReceive('guest')->times(4)->andReturn(false)\n ->shouldReceive('roles')->times(4)->andReturn(['Admin']);\n\n $runtime = $this->getRuntimeMemoryProvider();\n $runtime->put('acl_foo', $this->memoryProvider());\n\n $stub = new Authorization($auth, 'foo', $runtime);\n\n $stub->addActions(['Manage Page', 'Manage Photo']);\n $stub->allow('admin', 'Manage Page');\n\n $this->assertTrue($stub->can('manage'));\n $this->assertTrue($stub->can('manage user'));\n $this->assertTrue($stub->can('manage-page'));\n $this->assertFalse($stub->can('manage-photo'));\n }", "abstract protected function createAuthorization();", "public function testCreateAuthorization()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function setupSecurity() {\n\t\t$this->accessDecisionManager = $this->objectManager->get('F3\\FLOW3\\Security\\Authorization\\AccessDecisionManagerInterface');\n\t\t$this->accessDecisionManager->setOverrideDecision(NULL);\n\n\t\t$this->testingProvider = $this->objectManager->get('F3\\FLOW3\\Security\\Authentication\\Provider\\TestingProvider');\n\t\t$this->testingProvider->setName('DefaultProvider');\n\n\t\t$this->securityContext = $this->objectManager->get('F3\\FLOW3\\Security\\Context');\n\t\t$request = $this->getMock('F3\\FLOW3\\MVC\\Web\\Request');\n\t\t$this->securityContext->initialize($request);\n\t}", "public function uri_requires_authorizated_user($method , $uri)\n {\n $response = $this->json($method, $uri);\n $response->assertStatus(403);\n }", "protected function prepare($method)\n\t{\n\t\t// Reset parameters\n\t\t$this->httpClient->resetParameters();\n\t\t\n\t\t// Add authentication data\n\t\t$this->httpClient->setMethod('POST');\n\t\t$this->httpClient->setParameterPost(array(\n\t\t\t'USER' => $this->authInfo->getUser(),\n\t\t\t'PWD' => $this->authInfo->getPassword(),\n\t\t\t'SIGNATURE' => $this->authInfo->getSignature(),\n\t\t\t'VERSION' => '2.3',\n\t\t\t'METHOD' => $method\n\t\t));\n\t}", "function authorize() {\n $auth = new authorizer(AUTH_REALM, new ArrayIterator(array('user1' =>\n'password1', 'user2' => 'password2')));\n $auth->check(); // dies if not OK\n}", "public function testPostAuthorizationRole()\n {\n }", "public function testGuardedRoutesNeedAuth() : void\n {\n // Simulating login\n $user = factory(User::class)->create();\n $token = $user->generateToken();\n $headers = ['Authorization' => \"Bearer $token\"];\n\n // Simulating logout\n $user->api_token = null;\n $user->save();\n\n $this->json('post', 'api/operation', ['expression' => '2+2'], $headers)->assertStatus(401);\n }", "private function setUpPermissions()\n {\n $crudArray1 = array(\n $this->actions[\"CreateFalse\"],\n $this->actions[\"DeleteFalse\"],\n $this->actions[\"UpdateTrue\"],\n $this->actions[\"ReadTrue\"]\n );\n \n $crudArray2 = array(\n $this->actions[\"CreateTrue\"],\n $this->actions[\"DeleteTrue\"],\n $this->actions[\"UpdateFalse\"],\n $this->actions[\"ReadFalse\"]\n );\n \n $this->perms[\"Permissions_Res1_Crud1\"] = $this->createMockPermission(self::Resource1, null, $crudArray1);\n $this->perms[\"Permissions_Res1_Crud2\"] = $this->createMockPermission(self::Resource1, self::Resource1_Key, $crudArray1);\n $this->perms[\"Permissions_Res1_Crud3\"] = $this->createMockPermission(self::Resource1, null, $crudArray2);\n $this->perms[\"Permissions_Res1_Crud4\"] = $this->createMockPermission(self::Resource1, self::Resource1_Key, $crudArray2);\n $this->perms[\"Permissions_Res2_Crud1\"] = $this->createMockPermission(self::Resource2, null, $crudArray1);\n $this->perms[\"Permissions_Res2_Crud2\"] = $this->createMockPermission(self::Resource2, self::Resource2_Key, $crudArray1);\n $this->perms[\"Permissions_Res2_Crud3\"] = $this->createMockPermission(self::Resource2, null, $crudArray2);\n $this->perms[\"Permissions_Res2_Crud4\"] = $this->createMockPermission(self::Resource2, self::Resource2_Key, $crudArray2);\n $this->perms[\"Permissions_Res3_Crud1\"] = $this->createMockPermission(self::Resource3, null, $crudArray1);\n $this->perms[\"Permissions_Res3_Crud2\"] = $this->createMockPermission(self::Resource3, self::Resource3_Key, $crudArray1);\n $this->perms[\"Permissions_Res3_Crud3\"] = $this->createMockPermission(self::Resource3, null, $crudArray2);\n $this->perms[\"Permissions_Res3_Crud4\"] = $this->createMockPermission(self::Resource3, self::Resource3_Key, $crudArray2);\n \n $stringArray1 = array(\n $this->actions[\"IsGrantedTrue\"]\n );\n \n $stringArray2 = array(\n $this->actions[\"IsGrantedFalse\"]\n );\n \n $this->perms[\"Permissions_Res1_String1\"] = $this->createMockPermission(self::Resource1, null, $stringArray1);\n $this->perms[\"Permissions_Res1_String2\"] = $this->createMockPermission(self::Resource1, self::Resource1_Key, $stringArray1);\n $this->perms[\"Permissions_Res1_String3\"] = $this->createMockPermission(self::Resource1, null, $stringArray2);\n $this->perms[\"Permissions_Res1_String4\"] = $this->createMockPermission(self::Resource1, self::Resource1_Key, $stringArray2);\n $this->perms[\"Permissions_Res2_String1\"] = $this->createMockPermission(self::Resource2, null, $stringArray1);\n $this->perms[\"Permissions_Res2_String2\"] = $this->createMockPermission(self::Resource2, self::Resource2_Key, $stringArray1);\n $this->perms[\"Permissions_Res2_String3\"] = $this->createMockPermission(self::Resource2, null, $stringArray2);\n $this->perms[\"Permissions_Res2_String4\"] = $this->createMockPermission(self::Resource2, self::Resource2_Key, $stringArray2);\n $this->perms[\"Permissions_Res3_String1\"] = $this->createMockPermission(self::Resource3, null, $stringArray1);\n $this->perms[\"Permissions_Res3_String2\"] = $this->createMockPermission(self::Resource3, self::Resource3_Key, $stringArray1);\n $this->perms[\"Permissions_Res3_String3\"] = $this->createMockPermission(self::Resource3, null, $stringArray2);\n $this->perms[\"Permissions_Res3_String4\"] = $this->createMockPermission(self::Resource3, self::Resource3_Key, $stringArray2);\n }", "protected function setUp() {\n //create a mock of the abstract class\n $this->controller = $this->getMockForAbstractClass('Controller');\n \n //change visibility of 'check_role' to public\n $this->method = TestHelper::getAccessibleMethod('Controller', 'check_role');\n \n //set the role to admin\n $_SESSION['role'] = 'admin';\n }", "public function testIsAllowed()\n {\n $this->server = [\n 'HTTP_HOST' => 'unittest.dev',\n 'SERVER_NAME' => 'unittest.dev',\n 'REQUEST_URI' => '/',\n 'QUERY_STRING' => '',\n 'REQUEST_METHOD' => 'POST'\n ];\n\n $config = new Config($this->config);\n $environmentManager = new EmptyEnvironmentManager(\n $config,\n $this->get,\n $this->post,\n $this->server,\n $this->cookie,\n $this->files\n );\n\n $userStorage = new UserStorage(\n self::$adapter,\n new EntitySet(),\n new UserEntity(),\n new UserGroupEntity()\n );\n\n $policyStorage = new PolicyStorage(\n self::$adapter,\n new EntitySet(),\n new PolicyEntity()\n );\n\n $aclAdapter = new Acl(\n $environmentManager,\n $userStorage,\n $policyStorage\n );\n\n $userEntity = new UserEntity();\n\n $resourceEntity = new ResourceEntity();\n $resourceEntity->setResourceId(90000);\n\n $applicationEntity = new ApplicationEntity();\n $applicationEntity->setApplicationId(90000);\n\n $userA = clone $userEntity;\n $userA->setUserId(90000);\n\n $userB = clone $userEntity;\n $userB->setUserId(90001);\n\n\n // POLICY 90000\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, null, null, null));\n // FALSE because User B isn't assigned to Policy 90000 and not member of User Group 90000\n $this->assertFalse($aclAdapter->isAllowed($userB, null, null, null));\n\n // POLICY 90001\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, 'GET'));\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, 'POST'));\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, null, null));\n // TRUE for GET, FALSE otherwise\n $this->assertTrue($aclAdapter->isAllowed($userB, $resourceEntity, null, 'GET'));\n $this->assertFalse($aclAdapter->isAllowed($userB, $resourceEntity, null, 'POST'));\n $this->assertFalse($aclAdapter->isAllowed($userB, $resourceEntity, null, null));\n\n // POLICY 90002\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, 'GET'));\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, 'POST'));\n $this->assertTrue($aclAdapter->isAllowed($userA, null, $applicationEntity, null));\n // always FALSE because User B isn't assigned to Policy 90002 and no User Group is assigned to Policy 90002\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, 'GET'));\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, 'POST'));\n $this->assertFalse($aclAdapter->isAllowed($userB, null, $applicationEntity, null));\n\n // POLICY 90003\n // always TRUE because User A is assigned to Policy 90000 which is admin\n $this->assertTrue($aclAdapter->isAllowed($userA, $resourceEntity, $applicationEntity, null));\n // TRUE because User B is assigned to Policy 90003 and/or assigned to User Group 90001\n $this->assertTrue($aclAdapter->isAllowed($userB, $resourceEntity, $applicationEntity, null));\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->authUser()\n ->withPermissions([\n 'task_create',\n ]);\n\n }", "public function prepareAuthCall($method){\n \n }", "public function testCollectPermissionsMethod()\n {\n $expectedCollection = [\n 'guards' => [],\n 'roles' => ['role-with-permission-method'],\n 'permissions' => [\n 'role-with-permission-method' => ['permission-method-a', 'permission-method-b'],\n ],\n 'options' => [\n 'guest_role' => 'guest',\n 'protection_policy' => GuardInterface::POLICY_ALLOW,\n ],\n ];\n\n $collection = $this->collectPermissionsPropertyTestBase(new MockRoleWithPermissionMethod());\n $this->assertEquals($expectedCollection, $collection);\n }", "public function __construct()\n {\n $this->authorizeResource(Post::class, 'post');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the index of the web guide.
public function index() { return $this->controller->fetch('WebGuideController@index'); }
[ "public function index()\n {\n return view('marketing.guides.index')->withGuides(Guide::where('visible', true)->orderBy('sort_order')->get());\n }", "public function index()\n {\n $this->help();\n }", "public function action_index()\n\t{\n\t\t$this->template->head->title = 'Help Center';\n\t\t$this->view = View::factory('help/index');\n\t}", "public function docs() {\n\t\techo(file_get_contents(BASE_PATH . '/app/views/docs/index.html'));\n\t\texit();\n\t}", "protected function displayIndex()\n {\n \\Phork::output()->addTemplate($this->views.'index');\n }", "public function index()\n {\n\n $demos = App::get('database')->selectAllPublished('demos', Demo::class);\n $page = 'Demos';\n\n return $this->render('demos.index', compact('page', 'demos'));\n }", "public function displayIndex()\n {\n $view = new Index();\n $view->display();\n }", "public function index()\n {\n $this->locate(inlink('browse'));\n }", "public function index() {\n return view('marketing.documentation.index')\n ->withTopics(Topic::where('visible', true)->orderBy('sort_order')->get());\n }", "function index(){\n\t\t$assignment=array(\n\t\t\t'title'=>'INDEX',\n\t\t\t'get'=>Clover::getQuery(),\n\t\t\t'post'=>Clover::getData(),\n\t\t\t'request'=>Clover::getRequest(),\n\t\t\t'server'=>Clover::getServer(),\n\t\t\t'controller_index'=>Clover::getControllerIndex(),\n\t\t\t'controller'=>Clover::getController(),\n\t\t);\n\n\t\tClover::display('CloverInfoTest.htm',$assignment);\n\t}", "public function index()\n { \n $this->locate(inlink('browse'));\n }", "function index() {\n $this->registry->template->show('index');\n\n }", "public function index(){\n $this->loadContent('index',array());\n }", "public function action_index()\n\t{\n\t\t// I need help!\n\t\t$this->action_help();\n\t}", "public function index()\n\t{\n\t\t$this->detail();\n\t}", "public function actionIndex() {\n $dataProvider = new ActiveDataProvider([\n 'query' => TravellerHelp::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(){\n\t\t$this->show_home();\n\t}", "function generate_index_page()\n\t{\n\t\tglobal $template, $config, $user, $db;\n\t\tglobal $phpbb_root_path, $auth, $phpEx;\n\t\t\n\t\t$this->finclude('functions_display', 'f:display_forums');\n\t\t$user->add_lang('viewtopic');\n\t\t\n\t\tkb_display_cats();\n\t\t\n\t\t// Build Navigation Links\n\t\tgenerate_kb_nav();\n\t\t\n\t\t$template->assign_vars(array(\n\t\t\t'S_IN_MAIN'\t\t=> true,\n\t\t\t'S_NO_TOPIC'\t=> true,\n\t\t\t'S_ON_INDEX'\t=> true,\n\t\t\t'S_CAT_STYLE'\t=> ($config['kb_layout_style']) ? true : false, // IF 1 then set to true bc. style = special\n\t\t\t'S_COL_WIDTH'\t=> ($config['kb_layout_style']) ? (100 / $config['kb_cats_per_row']) : 0,\n\t\t));\n\t\t\n\t\t// Output the page\n\t\t$this->page_header($user->lang['KB_INDEX']);\n\t\t\n\t\t$template->set_filenames(array(\n\t\t\t'body' => 'kb/view_cat_list.html')\n\t\t);\n\t\t\n\t\tpage_footer();\n\t}", "public function index()\n\t{\n\t\t$lessons = $this->repository->getLessons();\n\t\t$menuTab = $this->menuTab;\n\t\treturn response()->view('admin.lessons.index', compact(['lessons', 'menuTab']));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$t1='select id, add_p, root, name FROM `all` WHERE `all`.`id_city` IS NULL AND `all`.`id_r` IS NULL and `lv`=7';
function city(){ // $t1='select id_city, id, add_p, root, name FROM `all` WHERE id in (SELECT root FROM `all` WHERE `all`.`id_city` IS NULL AND `all`.`id_r` IS NULL and `lv`=7) and `all`.`id_city` IS not NULL order by id '; $q1=mysql_query ('SELECT id_city, id FROM `city` where id_city<500 '); while ($r = mysql_fetch_row($q1)) { //$t="s" // $id=$id.'<p>'.$r[1].'</p>'; //$t='UPDATE `all` SET name ="'.$r[1].". ".$r[3].', "+name , root="'.$r[2].'" WHERE `root` ="'.$r[0].'" '; $t='UPDATE `all` SET `id_city`="'.$r[0].'" WHERE `root` ="'.$r[1].'" '; echo $t;$q=mysql_query ($t);} echo "good|good"; }
[ "function fun1(){\n//$t1='SELECT `id_street` FROM `all` WHERE `all`.`id_city` IS not NULL AND `lv` =7 group by `id_street` having (count(`id_street`)>1)';\n\n//$t1='SELECT id, kod, name FROM `street_zab` where id>=10000 and id<10500 ';\n\n$y=8;\n//echo '<p>'.$x.'</p>';\n$t1='SELECT id, kod, name FROM `city_zab` where not( `name` like \"%.%\")';//type_sity<>\"99\" and type_sity ='.$x.' ';\n$q1=mysql_query ($t1);\nwhile ($r = mysql_fetch_row($q1)) \n\t\t\t\t\t{$y++;\n\t\t\n\t\t\t\t//\t$t='Select id, name, add_p, lv, root, id_city, id_r from `all` WHERE `id` =\"'.$r[0].'\" ';\t\t\n\t\t\t\t\n\t\t\t\t\t//while ($r = mysql_fetch_row($q1)) \n\t\t\t\t//\t{\n\t\t\t\n\t\t\t\t\t$t='UPDATE `city_zab` SET `name`=\"?.'.$r[2].'\" WHERE `id` =\"'.$r[0].'\" ';\n\t\t\t\t\techo $t;\n\t\t\t\t$q=mysql_query ($t);\n\t\t\t\t//}//}\n\t\t\t\t/*$ii=$ii.' '.$r[0];\n\t\t\t\t$t='SELECT * FROM `all` WHERE `id_street` =\"'.$r[0].'\"';\t\t\t\n\t\t\t\t$q=mysql_query ($t);\n\t\t\t\twhile ($r1 = mysql_fetch_row($q)) {\n\t\t\t\t\n\t\t\t\techo '<p>'.$r1[0].'|'.iconv(\"utf-8\",\"windows-1251\",$r1[2]).'|'.iconv(\"utf-8\",\"windows-1251\",$r1[3]).'|'.$r1[4].'|'.$r1[5].'|'.$r1[6].'</p>';\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t}echo $ii;\n}", "function chado_contact_chado_node_sync_select_query($query) {\n $query['where_clauses']['title'][] = 'contact.name <> :contact_name_null1';\n $query['where_clauses']['title'][] = 'contact.name <> :contact_name_null2';\n $query['where_args']['title'][':contact_name_null1'] = 'null';\n $query['where_args']['title'][':contact_name_null2'] = 'NULL';\n\n return $query;\n}", "function selcourt1(){\n\t\t$sql=\"SELECT * FROM gestion WHERE suingdate IS NOT NULL AND judicialdate IS NULL\";\n\t\t$data = $this->selcot($sql);\n\t\treturn $data; \n\t}", "function chado_pub_chado_node_sync_select_query($query) {\n $query['where_clauses']['title'][] = 'pub.title <> :pub_title_null';\n $query['where_args']['title'][':pub_title_null'] = 'NULL';\n\n return $query;\n}", "public function where(){\n\n $where = array(\n \"id >\" => 1,\n \"detail !=\" => \"\"\n );\n\n /*\n $rows = $this\n ->db\n ->or_where($where)\n ->get(\"personel\")\n ->result();\n\n $rows = $this\n ->db\n ->where_in(\"title\", array(\"kablosuzkedi\",\"felakettin\"))\n ->get(\"personel\")\n ->result();\n\n $rows = $this\n ->db\n ->where(\"id\", 1)\n ->or_where_in(\"title\", array(\"kablosuzkedi\",\"felakettin\"))\n ->get(\"personel\")\n ->result();\n\n $rows = $this\n ->db\n ->where_not_in(\"title\", array(\"kablosuzkedi\",\"felakettin\"))\n ->get(\"personel\")\n ->result();\n */\n\n $rows = $this\n ->db\n ->or_where_not_in(\"title\", array(\"kablosuzkedi\",\"felakettin\"))\n ->get(\"personel\")\n ->result();\n\n echo $this->db->last_query();\n\n $viewData = array(\"rows\" => $rows);\n\n $this->load->view(\"dbislem\", $viewData);\n\n }", "public function actionMissingarea(){\n\n // Получаем дату ab\n\n $date_ab='2020-05-01';\n\n $sql=\"select row_number() over() as npp,ww.code,ww.name,qq.zz_nametu,qq.zz_eic,qq.id from (\nselect distinct on(zz_eic) u.tarif_sap,case when qqq.oldkey is null then trim(yy.oldkey) else trim(qqq.oldkey) end as vstelle,\nwww.short_name as real_name,const.ver,const.begru_all as begru,\n'10' as sparte,qqq.* from\n(select distinct on(q1.num_eqp) q1.id,x.oldkey,cc.short_name,\ncase when q.id_cl=2062 then rr.id_client else q.id_cl end as id_potr,\nq1.num_eqp as zz_eic,q.* from\n(select distinct 'DATA' as DATA,c.id as id_cl,\ncase when p.voltage_max = 0.22 then '02'\n when p.voltage_max = 0.4 then '03'\n when p.voltage_max = 10.00 then '05' \n when p.voltage_max = 6.0 then '04'\n when p.voltage_max = 27.5 then '06'\n when p.voltage_max = 35.0 then '07'\n when p.voltage_max = 110.0 then '08' else '' end as SPEBENE,\n'0001' as ANLART,\n'0002' as ABLESARTST,\np.name_eqp as ZZ_NAMETU,\n'' as ZZ_FIDER,\n'$date_ab' as AB,\ncase when coalesce(c2.idk_work,0)=99 and p.id_classtarif = 13 then 'CN_4HN1_01???' \n when coalesce(c2.idk_work,0)=99 and p.id_classtarif = 14 then 'CN_4HN2_01???' \n else \n\tcase when p.id_tarif in (27,28,150,900001,900002) then 'CN_2TH2_01???' \n\telse '???' --tar_sap.id_sap_tar \n\tend \nend as TARIFTYP,p.vid_trf,\ncase when st.id_section = 201 then '02'\n when st.id_section = 202 then '50'\n when st.id_section = 203 then '60'\n when st.id_section in(210,211,213,214,215) then '68'\n when c2.idk_work = 99 then '72'\n else '67' end as BRANCHE,\n--case when c2.idk_work = 99 then '0004' else '0002' end as AKLASSE,\ncase when c.code = '900' then '0004' else '0002' end as AKLASSE,\n 'PC010131' as ABLEINH,\ncase when tgr.ident in('tgr1') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '004'\n when tgr.ident in('tgr2') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '012'\n when tgr.ident in('tgr6') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '020'\n when tgr.ident in('tgr3') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '028'\n when tgr.ident in('tgr4') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '036'\n when tgr.ident in('tgr5',' tgr8_62','tgr8_63') and tcl.ident='tcl1' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '044'\n when tgr.ident in('tgr1') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '054'\n when tgr.ident in('tgr2') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '060'\n when tgr.ident in('tgr6') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '066'\n when tgr.ident in('tgr3') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '072'\n when tgr.ident in('tgr4') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '078'\n when tgr.ident in('tgr5',' tgr8_62','tgr8_63') and tcl.ident='tcl2' and st.id_section not in (208,218) and tar.id not in (900001,999999) then '084'\n when tgr.ident in('tgr8_32','tgr8_4','tgr8_10','tgr8_30') and coalesce(st.id_section,1009) in (1009,1017,1018,1019,1020,1021,1001)then '286'\n when tgr.ident in('tgr8_32','tgr8_4','tgr8_10','tgr8_30') and coalesce(st.id_section,1009) =1010 then '288'\n when tgr.ident in('tgr8_10','tgr8_30') then '298'\n when tgr.ident in('tgr8_12','tgr8_22','tgr8_32','tgr8_4') then '300'\n when tgr.ident in('tgr7_1','tgr7_11','tgr7_21','tgr7_211','tgr7_21','tgr7_211') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218)then '352'\n when ((tgr.ident ~ 'tgr7_12') or (tgr.ident~ 'tgr7_22') or (tgr.ident= 'tgr7_13') or (tgr.ident = 'tgr7_23') or (tgr.ident= 'tgr8_101') or (tgr.ident = 'tgr8_61') ) and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '354'\nwhen tgr.ident in ('tgr7_511','tgr7_514','tgr7_5141') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '384'\nwhen (tgr.ident ~ 'tgr7_51') and tgr.ident not in ('tgr7_511','tgr7_514','tgr7_5141') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '385'\nwhen coalesce(st.id_section,1007) in (1007,1008) and (tgr.ident ~ 'tgr7_52') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) and tar.id not in (900001,999999) then '391'\nwhen tgr.ident~ 'tgr7_521' and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '392'\nwhen tgr.ident ~ 'tgr7_522' and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '394'\nwhen tgr.ident in ('tgr7_611','tgr7_614','tgr7_6141') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '402'\nwhen (tgr.ident ~ 'tgr7_61') and tgr.ident not in ('tgr7_611','tgr7_614','tgr7_6141') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '403'\nwhen coalesce(st.id_section,1015) in (1015,1016,1007,1008) and (tgr.ident ~ 'tgr7_62') and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218)then '409'\nwhen tgr.ident ~ 'tgr7_621' and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '410'\nwhen tgr.ident ~ 'tgr7_622' and tcl.ident='tcl2' and c.idk_work <> 0 and st.id_section not in (208,218) then '412'\nwhen tgr.ident in ( 'tgr7_15','tgr7_25','tgr7_35','tgr7_53','tgr7_63','tgr7_7') then '414'\nwhen tcl.ident='tcl1' and st.id_section = 209 and tar.id not in (900001,999999) then '574'\nwhen tcl.ident='tcl2' and st.id_section = 209 and tar.id not in (900001,999999) then '582'\nwhen c.idk_work=99 and p.voltage_min>10 and tcl.ident='tcl1' then '604'\nwhen c.idk_work=99 and p.voltage_min<=10 and tcl.ident='tcl2' then '606'\nwhen tcl.ident='tcl1' and p.id_extra =1003 then '632'\nwhen tcl.ident='tcl2' and p.id_extra =1003 then '634'\nwhen tcl.ident='tcl1' and p.id_extra in (1001,1002,1012,1013) then '638'\nwhen tcl.ident='tcl2' and p.id_extra in (1001,1002,1012,1013) then '640'\nwhen tgr.ident in('tgr8_101') then '666'\n else '' end as ZZCODE4NKRE,\n'' as ZZCODE4NKRE_DOP,\n'' as ZZOTHERAREA,\n'1' as sort \nfrom (select tr.name as vid_trf,dt.power,dt.connect_power, dt.id_tarif, tr.id_classtarif, dt.industry,dt.count_lost, dt.in_lost,dt.d, dt.wtm,dt.share,dt.id_position, cp.num_tab, dt.id_tg, p.val as kwedname,p.kod as kwedcode, tr.name as tarifname , tg.name as tgname, dt.id_voltage, \ndt.ldemand, dt.pdays, dt.count_itr, dt.itr_comment, dt.cmp, dt.day_control, v.voltage_min, v.voltage_max, dt.zone, z.name as zname, dt.flag_hlosts, dt.id_depart, cla.name as department,dt.main_losts, dt.ldemandr,dt.ldemandg,dt.id_un, \ndt.lost_nolost, dt.id_extra,dt.reserv,cla2.name as extra,vun.voltage_min as un, cp.represent_name, dt.con_power_kva, dt.safe_category, dt.disabled, dt.code_eqp, eq.name_eqp, eq.is_owner, eq.dt_install, eqh.dt_b, tr.id_grouptarif --, ph.id_extra --, tr.id_classtarif\n\tfrom eqm_equipment_tbl as eq \n\t join eqm_equipment_h as eqh on (eq.id=eqh.id and eqh.dt_b = (SELECT dt_b FROM eqm_equipment_h WHERE id = eq.id order by dt_b desc limit 1 ) ) \n\t join eqm_point_tbl AS dt on (dt.code_eqp= eq.id) \n\tleft join aci_tarif_tbl as tr on (tr.id=dt.id_tarif) \n\tleft join cla_param_tbl as p on (dt.industry=p.id) \n\tleft join eqk_tg_tbl as tg on (dt.id_tg=tg.id) \n\tleft join eqk_voltage_tbl AS v on (dt.id_voltage=v.id) \n\tleft join eqk_voltage_tbl AS vun on (dt.id_un=vun.id) \n\tleft join eqk_zone_tbl AS z on (dt.zone=z.id) \n\tleft join cla_param_tbl AS cla on (dt.id_depart=cla.id) \n\tleft join cla_param_tbl AS cla2 on (dt.id_extra=cla2.id) \n\tleft join clm_position_tbl as cp on (cp.id = dt.id_position) ) as p \n join eqm_eqp_tree_tbl as tt on (p.code_eqp = tt.code_eqp) \n join eqm_tree_tbl as t on (t.id = tt.id_tree) \n join (select distinct id,code,idk_work from clm_client_tbl) as c on (c.id = t.id_client) \nleft join eqm_eqp_use_tbl as use on (use.code_eqp = p.code_eqp) \nleft join clm_client_tbl as c2 on (c2.id = coalesce (use.id_client, t.id_client)) \nleft join clm_statecl_tbl as st on (st.id_client = c2.id) \nleft join aci_tarif_tbl as tar on (tar.id=p.id_tarif)\n--left join sap_energo_tarif as tar_sap on tar_sap.id_tar = p.id_tarif\nleft join eqi_grouptarif_tbl as tgr on tgr.id= p.id_grouptarif\nleft join eqi_classtarif_tbl as tcl on (p.id_classtarif=tcl.id) \n--left join reading_controller as w on w.tabel_numb = p.num_tab\nleft join (select ins.code_eqp, eq3.id as id_area, eq3.name_eqp as area_name from eqm_compens_station_inst_tbl as ins join eqm_equipment_tbl as eq3 on (eq3.id = ins.code_eqp_inst and eq3.type_eqp = 11) ) as area on (area.code_eqp = p.code_eqp) \nleft join (select code_eqp, trim(sum(e.name||','),',') as energy from eqd_point_energy_tbl as pe join eqk_energy_tbl as e on (e.id = pe.kind_energy) group by code_eqp ) as en on (en.code_eqp = p.code_eqp) \n) q \nleft join eqm_equipment_tbl q1 \non q.zz_nametu::text=q1.name_eqp::text and substr(q1.num_eqp::text,1,3)='62Z'\nleft join eqm_area_tbl ar on ar.code_eqp=q1.id\nleft join sap_evbsd x on case when trim(x.haus)='' then 0 else coalesce(substr(x.haus,9)::integer,0) end =q.id_cl\nleft join clm_client_tbl as cc on cc.id = q.id_cl\nleft join \n(select u.id_client,a.id from eqm_equipment_tbl a\n left join eqm_point_tbl tu1 on tu1.code_eqp=a.id \n left JOIN eqm_compens_station_inst_tbl AS area ON (a.id=area.code_eqp)\n left JOIN eqm_equipment_tbl AS eq2 ON (area.code_eqp_inst=eq2.id)\n left join eqm_area_tbl u on u.code_eqp=area.code_eqp_inst\n left join clm_client_tbl u1 on u1.id=u.id_client) rr \n on rr.id=q1.id and (x.oldkey is null or q.id_cl=2062)\nwhere SPEBENE::text<>'' and q1.num_eqp is not null) qqq\nleft join tarif_sap_energo u on trim(u.name)=trim(qqq.vid_trf)\nleft join sap_evbsd yy on case when trim(yy.haus)='' then 0 else coalesce(substr(yy.haus,9)::integer,0) end=qqq.id_potr\nleft join clm_client_tbl www on www.id=qqq.id_potr\ninner join sap_const const on 1=1\nwhere qqq.id_potr is not null and www.code<>999 \nand\n(www.code>999 or www.code=900) AND coalesce(www.idk_work,0)<>0 \n\t and www.code not in('20000556','20000565','20000753',\n\t '20555555','20888888','20999999','30999999','40999999','41000000','42000000','43000000',\n\t '10999999','11000000','19999369','50999999','1000000','1000001')\nand id_cl<>2062 \n-- and (yy.oldkey is not null or qqq.oldkey is not null)\n) qq\nleft join (select eq.*,c.code,c.name,c.idk_work,c.id as id_cl,u.* from eqm_equipment_tbl eq\n left join eqm_eqp_use_tbl as use on (use.code_eqp = eq.id) \n left join eqm_eqp_tree_tbl ttr on ttr.code_eqp = eq.id\n left join eqm_tree_tbl tr on tr.id = ttr.id_tree\n left join clm_client_tbl as c on (c.id = coalesce (use.id_client, tr.id_client)) \n\tjoin eqm_equipment_h as eqh on (eq.id=eqh.id and eqh.dt_b = (SELECT dt_b FROM eqm_equipment_h WHERE id = eq.id order by dt_b desc limit 1 ) ) \n\tjoin eqm_point_tbl AS dt on (dt.code_eqp= eq.id)\n\tleft JOIN eqm_compens_station_inst_tbl AS area ON (eq.id=area.code_eqp) \n\tleft join cla_param_tbl as p on (dt.industry=p.id) \n\tjoin eqm_eqp_tree_tbl as tt on (dt.code_eqp = tt.code_eqp) \n\tjoin eqm_tree_tbl as t on (t.id = tt.id_tree) \n\tleft join eqm_area_tbl u on u.code_eqp=area.code_eqp_inst\n\tjoin (select distinct id,code,idk_work from clm_client_tbl) as c1 on (c1.id = t.id_client) \n\t) ww on ww.num_eqp=qq.zz_eic\nwhere qq.vstelle is null \";\n\n $s = sap_connect::findBySql($sql)->asArray()->all();\n \n return $this->render('missingarea', compact('s'));\n\n }", "function tampil_data_id($tabel,$where,$id)\n {\n $row = $this->db->prepare(\"SELECT * FROM $tabel WHERE $where = :id,:teks,:label,:predict\");\n $row->execute(array($id));\n return $hasil = $row->fetch();\n }", "public function getDataPeg($id){\r\n $q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n //$q = \"SELECT KOLOK, KLOGAD,SPMU FROM \\\"vw_jabatan_terakhir\\\" WHERE NRK='\".$id.\"'\";\r\n $query = $this->db->query($q)->row();\r\n \r\n return $query;\r\n }", "function select($table,$where){\n//echo $table ;\nif($where == '' || $where == null){\n$where = null ;}\n $select = \"select * from \".TABLE_PREFIX.$table.\" where 1=1 \".$where.\"\" ;\n$result = mysql_query($select);\nreturn $result ;\n}", "function sql_check_null_or_empty($rs, $col_name) {\r\n\t\r\n\tif(trim($rs[\"$col_name\"])!=\"\"){\r\n\t\t$null_or_emoty_sql= $col_name .\"='$rs[$col_name]'\";\r\n\t}else{\r\n\t\t$null_or_emoty_sql=\"(\" . $col_name .\" is NULL OR \" . $col_name . \"='')\";\r\n\t}\r\n\t\r\n\treturn $null_or_emoty_sql;\r\n}", "function ambil_daftar_bagian(){\n $query1 = $this->db->query(\"select kd, nama_bagian from tbl_bagian where hapus is null order by nama_bagian;\");\n \n return $query1;\n }", "function get_where_pengguna(){\n\t\t// \tpengguna_level = '0', \");\n\t\t$this->db->select('*');\n\t\t$this->db->from('pengguna, detailikm');\n\t\t$this->db->where('pengguna.ID_IKM = detailikm.ID_IKM');\n\t\t$this->db->where('pengguna.pengguna_level = \"0\"');\n\t\t$this->db->where('pengguna.pengguna_status= \"1\"');\n\t\t$hsl = $this->db->get();\n\t\treturn $hsl;\t\n\t}", "private function prepareSelect() {\n $query = \"SELECT * FROM \" . $this->tableName . \" WHERE \";\n if (!empty($this->row)) {\n $keys = array_keys($this->row);\n foreach ($keys as $key) {\n $query .= $key . \"=:\" . $key . \" AND \";\n }\n $query = substr_replace($query, \"\", -4);\n } else {\n return \"current table is empty\";\n }\n //echo $query;\n return $query;\n }", "public function filterRoomByBranch($id){\n $sql = 'SELECT ROMnature, COUNT(ROMnature) AS countROMnature, USCcode, USCdescTH, USCdescEN FROM ROM LEFT JOIN USC ON ROM.ROMnature = USC.USCcode WHERE (ROMid NOT IN (SELECT BOKromid FROM BOK)) AND ROMdelete = 0 AND ROMbrhid = ' . $id .' AND USCuse = 14 GROUP BY ROMnature ';\n\n $query = $this->db->query($sql);\n $num = $query->num_rows();\n\n if ($num > 0) {\n $row = $query->result_array();\n\n return $row;\n } else {\n return $row = null;\n }\n }", "function get_resep($where){\n return $this->db->query(\"SELECT * from resep where id_kue = '\".$where.\"'\");\n }", "public function getDataPeg1($id){\r\n //$q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n $q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n $query = $this->db->query($q)->row();\r\n \r\n return $query;\r\n }", "function selectOneTechAndOneTravelPlace($id){\n return db()->query(\"SELECT * FROM post WHERE postID = $id\");\n }", "public function getAddressNoltlng(){\n $sql = \"SELECT * FROM $this->tableName WHERE lat IS NULL AND lng IS NULL \";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n }", "function get_tkd_a_anular($ua=null) {\r\n $where=\"\";\r\n if(isset($ua)){\r\n $where=\" where uni_acad='$ua' and nro_540 is not null \"\r\n . \"and not exists (select * from designacion b\"\r\n . \" where a.uni_acad=b.uni_acad\"\r\n . \" and a.nro_540=b.nro_540\"\r\n . \" and b.check_presup=1 )\";\r\n }\r\n $sql = \"SELECT distinct nro_540 FROM designacion a $where order by nro_540\";\r\n print_r($sql);\r\n return toba::db('designa')->consultar($sql);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform card payment call PayLane multiSale or redirect to 3D Secure Auth Page
public function payAction() { $paylanecreditcard = Mage::getSingleton("paylanecreditcard/standard"); $data = $paylanecreditcard->getPaymentData(); if (is_null($data)) { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("/")); } // connect to PayLane Direct System $paylane_client = new PayLaneClient(); // get login and password from store config $direct_login = Mage::getStoreConfig('payment/paylanecreditcard/direct_login'); $direct_password = Mage::getStoreConfig('payment/paylanecreditcard/direct_password'); $status = $paylane_client->connect($direct_login, $direct_password); if ($status == false) { // an error message $paylanecreditcard->addComment("Error processing your payment... Please try again later.", true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } $secure3d = Mage::getStoreConfig('payment/paylanecreditcard/secure3d'); if ($secure3d == true) { $back_url = Mage::getUrl('paylanecreditcard/standard/back', array('_secure' => true)); $result = $paylane_client->checkCard3DSecureEnrollment($data, $back_url); if ($result == false) { // an error message $paylanecreditcard->addComment("Error processing your payment... Please try again later.", true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->ERROR)) { // an error message $paylanecreditcard->addComment($result->ERROR->error_description, true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->OK)) { $paylanecreditcard->setIdSecure3dAuth($result->OK->secure3d_data->id_secure3d_auth); if (isset($result->OK->is_card_enrolled)) { $is_card_enrolled = $result->OK->is_card_enrolled; // card is enrolled in 3-D Secure if (true == $is_card_enrolled) { Mage::app()->getFrontController()->getResponse()->setRedirect($result->OK->secure3d_data->paylane_url); return; } // card is not enrolled, perform normal sale else { $data['secure3d'] = array(); $data['id_secure3d_auth'] = $result->OK->secure3d_data->id_secure3d_auth; $result = $paylane_client->multiSale($data); if ($result == false) { // an error message $paylanecreditcard->addComment("Error processing your payment... Please try again later.", true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->ERROR)) { // an error message $paylanecreditcard->addComment($result->ERROR->error_description, true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->OK)) { $paylanecreditcard->setCurrentOrderPaid(); $paylanecreditcard->addComment('id_sale=' . $result->OK->id_sale); $paylanecreditcard->addTransaction($result->OK->id_sale); session_write_close(); $this->_redirect('checkout/onepage/success'); return; } else { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("/")); return; } } } else { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("/")); return; } } else { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("/")); return; } } else { $result = $paylane_client->multiSale($data); if ($result == false) { // an error message $paylanecreditcard->addComment("Error processing your payment... Please try again later.", true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->ERROR)) { // an error message $paylanecreditcard->addComment($result->ERROR->error_description, true); session_write_close(); $this->_redirect('checkout/onepage/failure'); return; } if (isset($result->OK)) { $paylanecreditcard->setCurrentOrderPaid($result->OK->id_sale); session_write_close(); $this->_redirect('checkout/onepage/success'); return; } else { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("/")); return; } } }
[ "public function execute()\n {\n $threeDSecureChallengeParams = $this->checkoutSession->get3Ds2Params();\n \n $threeDSecureChallengeConfig = $this->checkoutSession->get3DS2Config();\n $directOrderParams = $this->checkoutSession->getDirectOrderParams();\n $orderId = $this->checkoutSession->getAuthOrderId();\n $iframe = false;\n // Chrome 84 releted updates for 3DS\n \n if (isset($_COOKIE['PHPSESSID'])) {\n $phpsessId = $_COOKIE['PHPSESSID'];\n $domain = parse_url($this->_url->getUrl(), PHP_URL_HOST);\n setcookie(\"PHPSESSID\", $phpsessId, [\n 'expires' => time() + 3600,\n 'path' => '/',\n 'domain' => $domain,\n 'secure' => true,\n 'httponly' => true,\n 'samesite' => 'None',\n ]);\n }\n\n //setcookie(\"PHPSESSID\", $phpsessId, time() + 3600, \"/; SameSite=None; Secure;\");\n \n \n \n if (!$threeDSecureChallengeConfig == null) {\n \n if ($threeDSecureChallengeConfig['challengeWindowType'] == 'iframe') {\n $iframe = true;\n }\n }\n if ($redirectData = $this->checkoutSession->get3DSecureParams()) {\n // Chrome 84 releted updates for 3DS\n// $phpsessId = $_COOKIE['PHPSESSID'];\n// setcookie(\"PHPSESSID\", $phpsessId, time() + 3600, \"/; SameSite=None; Secure;\");\n $responseUrl = $this->_url->getUrl('worldpay/threedsecure/authresponse', ['_secure' => true]);\n print_r('\n <form name=\"theForm\" id=\"form\" method=\"POST\" action=' . $redirectData->getUrl() . '>\n <input type=\"hidden\" name=\"PaReq\" value=' . $redirectData->getPaRequest() . ' />\n <input type=\"hidden\" name=\"TermUrl\" value=' . $responseUrl . ' />\n </form>');\n print_r('\n <script language=\"Javascript\">\n document.getElementById(\"form\").submit();\n </script>');\n } elseif ($threeDSecureChallengeParams) {\n if ($iframe) {\n $challengeUrl = $this->_url->getUrl(\"worldpay/hostedpaymentpage/challenge\");\n $imageurl = $this->_assetRepo->getUrl(\"Sapient_Worldpay::images/cc/worldpay_logo.png\");\n print_r('\n <div id=\"challenge_window\"> \n <div class=\"image-content\" style=\"text-align: center;\">\n <img src=' . $imageurl . ' alt=\"WorldPay\"/>\n </div>\n <div class=\"iframe-content\">\n <iframe src=\"' . $challengeUrl . '\" name=\"jwt_frm\" id=\"jwt_frm\"\n style=\"text-align: center; vertical-align: middle; height: 50%;\n display: table-cell; margin: 0 25%;\n width: -webkit-fill-available; z-index:999999;\">\n </iframe>\n </div>\n </div>\n </script>\n ');\n } else {\n $authUrl = $this->_url->getUrl('worldpay/threedsecure/ChallengeAuthResponse', ['_secure' => true]);\n print_r(' \n <form name= \"challengeForm\" id=\"challengeForm\"\n method= \"POST\"\n action=\"' . $threeDSecureChallengeConfig[\"challengeurl\"] . '\" >\n <!-- Use the above Challenge URL for test, \n we will provide a static Challenge URL for production once you go live -->\n <input type = \"hidden\" name= \"JWT\" id= \"second_jwt\" value= \"\" />\n <!-- Encoding of the JWT above with the secret \"worldpaysecret\". -->\n <input type=\"hidden\" name=\"MD\" value=' . $orderId . ' />\n <input type=\"hidden\" name=\"url\" value=' . $authUrl . ' />\n <!-- \n Extra field for you to pass data in to the challenge that will be included in the post \n back to the return URL after challenge complete \n -->\n </form>');\n print_r('\n <script src=\"//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha256.js\"></script>\n <script src=\"//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64-min.js\">\n </script>\n <script language=\"Javascript\">\n var header = {\n \"typ\": \"JWT\",\n \"alg\": \"HS256\"\n }; \n var iat = Math.floor(new Date().getTime()/1000);\n var jti = uuidv4();\n var data = {\n \"jti\": jti,\n \"iat\": iat,\n \"iss\": \"' . $threeDSecureChallengeConfig[\"jwtIssuer\"] . '\",\n \"OrgUnitId\": \"' . $threeDSecureChallengeConfig[\"organisationalUnitId\"] . '\",\n \"ReturnUrl\": \"' . $authUrl . '\",\n \"Payload\": {\n \"ACSUrl\": \"' . $threeDSecureChallengeParams['acsURL'] . '\",\n \"Payload\": \"' . $threeDSecureChallengeParams['payload'] . '\",\n \"TransactionId\": \"' . $threeDSecureChallengeParams['transactionId3DS'] . '\"\n },\n \"ObjectifyPayload\": true\n };\n var secret = \"' . $threeDSecureChallengeConfig[\"jwtApiKey\"] . '\";\n\n var stringifiedHeader = CryptoJS.enc.Utf8.parse(JSON.stringify(header));\n var encodedHeader = base64url(stringifiedHeader);\n\n var stringifiedData = CryptoJS.enc.Utf8.parse(JSON.stringify(data));\n var encodedData = base64url(stringifiedData);\n var signature = encodedHeader + \".\" + encodedData;\n signature = CryptoJS.HmacSHA256(signature, secret);\n signature = base64url(signature);\n var encodedJWT = encodedHeader + \".\" + encodedData + \".\" + signature;\n document.getElementById(\"second_jwt\").value = encodedJWT;\n function uuidv4() {\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, function(c){\n var crypto = window.crypto || window.msCrypto;\n return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n });\n }\n\n function base64url(source) {\n // Encode in classical base64\n var encodedSource = CryptoJS.enc.Base64.stringify(source);\n\n // Remove padding equal characters\n encodedSource = encodedSource.replace(/=+$/, \"\");\n\n // Replace characters according to base64url specifications\n encodedSource = encodedSource.replace(/\\+/g, \"-\");\n encodedSource = encodedSource.replace(/\\//g, \"_\");\n\n return encodedSource;\n }\n window.onload = function()\n {\n // Auto submit form on page load\n document.getElementById(\"challengeForm\").submit();\n } \n </script>');\n\n $this->checkoutSession->uns3DS2Params();\n $this->checkoutSession->uns3DS2Config();\n }\n } elseif ($this->checkoutSession->getIavCall()) {\n $this->checkoutSession->unsIavCall();\n return $this->resultRedirectFactory->create()->setPath('worldpay/savedcard', ['_current' => true]);\n } else {\n return $this->resultRedirectFactory->create()->setPath('checkout/onepage/success', ['_current' => true]);\n }\n }", "public function processCardgatePayment() {\n\t\t// return 'cardgate_redirect';\n\t\treturn 'success';\n\t}", "private function _redirectToHostedPaymentForm()\r\n {\r\n \t$html = '';\r\n \t$model = Mage::getModel('paymentsensegateway/direct');\r\n \t$szActionURL = \"https://secure.paguelofacil.com/LinkDeamon.cfm?\";\r\n \t$cookies = Mage::getSingleton('core/cookie')->get();\r\n \t$szServerResultURLCookieVariables;\r\n \t$szServerResultURLFormVariables = '';\r\n \t$szServerResultURLQueryStringVariables = '';\r\n \t\r\n \t// create a Magento form\r\n $form = new Varien_Data_Form();\r\n $form->setAction($szActionURL)\r\n ->setId('HostedPaymentForm')\r\n ->setName('HostedPaymentForm')\r\n ->setMethod('GET')\r\n ->setUseContainer(true);\r\n\r\n $form->addField(\"CCLW\", 'hidden', array('name'=>\"CCLW\", 'value'=>Mage::getSingleton('checkout/session')->getMerchantid()));\r\n $form->addField(\"CMTN\", 'hidden', array('name'=>\"CMTN\", 'value'=>(Mage::getSingleton('checkout/session')->getAmount()/100)));\r\n $form->addField(\"OrderID\", 'hidden', array('name'=>\"OrderID\", 'value'=>Mage::getSingleton('checkout/session')->getOrderid()));\r\n $form->addField(\"CDSC\", 'hidden', array('name'=>\"CDSC\", 'value'=>\"Compra en \".$_SERVER['HTTP_HOST'].\" ID de compra #\".Mage::getSingleton('checkout/session')->getOrderid()));\r\n $form->addField(\"HashDigest\", 'hidden', array('name'=>\"HashDigest\", 'value'=>Mage::getSingleton('checkout/session')->getHashdigest()));\r\n $form->addField(\"CurrencyCode\", 'hidden', array('name'=>\"CurrencyCode\", 'value'=>Mage::getSingleton('checkout/session')->getCurrencycode()));\r\n $form->addField(\"TransactionType\", 'hidden', array('name'=>\"TransactionType\", 'value'=>Mage::getSingleton('checkout/session')->getTransactiontype()));\r\n $form->addField(\"TransactionDateTime\", 'hidden', array('name'=>\"TransactionDateTime\", 'value'=>Mage::getSingleton('checkout/session')->getTransactiondatetime()));\r\n $form->addField(\"CallbackURL\", 'hidden', array('name'=>\"CallbackURL\", 'value'=>Mage::getSingleton('checkout/session')->getCallbackurl()));\r\n \r\n $form->addField(\"CustomerName\", 'hidden', array('name'=>\"CustomerName\", 'value'=>Mage::getSingleton('checkout/session')->getCustomername()));\r\n $form->addField(\"Address1\", 'hidden', array('name'=>\"Address1\", 'value'=>Mage::getSingleton('checkout/session')->getAddress1()));\r\n $form->addField(\"Address2\", 'hidden', array('name'=>\"Address2\", 'value'=>Mage::getSingleton('checkout/session')->getAddress2()));\r\n $form->addField(\"Address3\", 'hidden', array('name'=>\"Address3\", 'value'=>Mage::getSingleton('checkout/session')->getAddress3()));\r\n $form->addField(\"Address4\", 'hidden', array('name'=>\"Address4\", 'value'=>Mage::getSingleton('checkout/session')->getAddress4()));\r\n $form->addField(\"City\", 'hidden', array('name'=>\"City\", 'value'=>Mage::getSingleton('checkout/session')->getCity()));\r\n $form->addField(\"State\", 'hidden', array('name'=>\"State\", 'value'=>Mage::getSingleton('checkout/session')->getState()));\r\n $form->addField(\"PostCode\", 'hidden', array('name'=>\"PostCode\", 'value'=>Mage::getSingleton('checkout/session')->getPostcode()));\r\n $form->addField(\"CountryCode\", 'hidden', array('name'=>\"CountryCode\", 'value'=>Mage::getSingleton('checkout/session')->getCountrycode()));\r\n $form->addField(\"CV2Mandatory\", 'hidden', array('name'=>\"CV2Mandatory\", 'value'=>Mage::getSingleton('checkout/session')->getCv2mandatory()));\r\n $form->addField(\"Address1Mandatory\", 'hidden', array('name'=>\"Address1Mandatory\", 'value'=>Mage::getSingleton('checkout/session')->getAddress1mandatory()));\r\n $form->addField(\"CityMandatory\", 'hidden', array('name'=>\"CityMandatory\", 'value'=>Mage::getSingleton('checkout/session')->getCitymandatory()));\r\n $form->addField(\"PostCodeMandatory\", 'hidden', array('name'=>\"PostCodeMandatory\", 'value'=>Mage::getSingleton('checkout/session')->getPostcodemandatory()));\r\n $form->addField(\"StateMandatory\", 'hidden', array('name'=>\"StateMandatory\", 'value'=>Mage::getSingleton('checkout/session')->getStatemandatory()));\r\n $form->addField(\"CountryMandatory\", 'hidden', array('name'=>\"CountryMandatory\", 'value'=>Mage::getSingleton('checkout/session')->getCountrymandatory()));\r\n $form->addField(\"ResultDeliveryMethod\", 'hidden', array('name'=>\"ResultDeliveryMethod\", 'value'=>Mage::getSingleton('checkout/session')->getResultdeliverymethod()));\r\n $form->addField(\"ServerResultURL\", 'hidden', array('name'=>\"ServerResultURL\", 'value'=>Mage::getSingleton('checkout/session')->getServerresulturl()));\r\n $form->addField(\"PaymentFormDisplaysResult\", 'hidden', array('name'=>\"PaymentFormDisplaysResult\", 'value'=>Mage::getSingleton('checkout/session')->getPaymentformdisplaysresult()));\r\n $form->addField(\"ServerResultURLCookieVariables\", 'hidden', array('name'=>\"ServerResultURLCookieVariables\", 'value'=>Mage::getSingleton('checkout/session')->getServerresulturlcookievariables()));\r\n $form->addField(\"ServerResultURLFormVariables\", 'hidden', array('name'=>\"ServerResultURLFormVariables\", 'value'=>Mage::getSingleton('checkout/session')->getServerresulturlformvariables()));\r\n $form->addField(\"ServerResultURLQueryStringVariables\", 'hidden', array('name'=>\"ServerResultURLQueryStringVariables\", 'value'=>Mage::getSingleton('checkout/session')->getServerresulturlquerystringvariables()));\r\n\r\n // reset the session items\r\n Mage::getSingleton('checkout/session')->setHashdigest(null)\r\n\t \t\t\t\t\t\t\t\t\t->setMerchantid(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAmount(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCurrencycode(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setOrderid(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setTransactiontype(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setTransactiondatetime(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCallbackurl(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setOrderdescription(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCustomername(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAddress1(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAddress2(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAddress3(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAddress4(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCity(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setState(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setPostcode(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCountrycode(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCv2mandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setAddress1mandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCitymandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setPostcodemandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setStatemandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setCountrymandatory(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setResultdeliverymethod(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setServerresulturl(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setPaymentformdisplaysresult(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setServerresulturlcookievariables(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setServerresulturlformvariables(null)\r\n\t\t\t \t\t \t\t\t\t\t\t\t->setServerresulturlquerystringvariables(null);\r\n \r\n $html = '<html><body>';\r\n $html.= $form->toHtml();\r\n $html.= '<div align=\"center\"><img src=\"'.$this->getSkinUrl(\"images/paymentsense.gif\").'\"><p></div>';\r\n $html.= '<div align=\"center\"><img src=\"https://pfserver.net/img/loadingPF.gif\"><p></div>';\r\n $html.= '<div align=\"center\">Verificando sus Dato, por favor espere...</div>';\r\n $html.= '<script type=\"text/javascript\">document.getElementById(\"HostedPaymentForm\").submit();</script>';\r\n $html.= '</body></html>';\r\n \t\r\n \treturn $html;\r\n }", "public function callbacktransparentredirectAction()\n {\n $model = Mage::getModel('paymentsensegateway/direct');\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n \n \n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $szPaREQ = $this->getRequest()->getParams('Oper');\n $szPaRES = $this->getRequest()->getParams('TotalPagado');\n $nStatusCode = $this->getRequest()->getParams('Razon');\n \n if($szPaREQ && $szPaRES != 0)\n {\n self::_paymentComplete($szPaREQ, $szPaRES, $nStatusCode);\n }\n \n else\n {\n $error = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_260;\n Mage::logException($exc);\n \n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Transparent Redirect Payment Failed'));\n $order->setState($orderState, $orderStatus, $nStatusCode, false);\n $order->save();\n \n \n Mage::getSingleton('core/session')->addError($error);\n \n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n \n \n \n }", "function authorise_3dsecure( $order_id ) {\n\n \t// woocommerce order instance\n \t$order = wc_get_order( $order_id );\n\n \t$MD \t\t= WC()->session->get( 'MD' );\n \t$PAReq \t\t= WC()->session->get( 'PAReq' );\n \t$ACSURL \t= WC()->session->get( 'ACSURL' );\n \t$TermURL \t= WC()->session->get( 'TermURL' );\n\n if ( isset($_POST['MD']) && ( isset($_POST['PARes']) || isset($_POST['PaRes']) ) ) {\n\n \t$redirect_url = $this->get_return_url( $order );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// set the URL that will be posted to.\n\t\t\t\t\t$url \t\t = $this->callbackURL;\n\t\t\t\t\t$sage_result = array();\n\n\t\t\t\t\t// it could be PARes or PaRes #sigh\n\t\t\t\t\tif( isset($_POST['PARes']) ) {\n\t\t\t\t\t\t$pares = $_POST['PARes'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pares = $_POST['PaRes'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = 'MD=' . $_POST['MD'];\n\t\t\t\t\t$data .='&PaRes=' . $pares;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Send $data to Sage\n\t\t\t\t\t * @var [type]\n\t\t\t\t\t */\n\t\t\t\t\t$sageresult = $this->sagepay_post( $data, $url );\n\n\t\t\t\t\tif( isset( $sageresult['Status']) && $sageresult['Status']!= '' && $sageresult['Status']!= 'REJECTED' ) {\n\n\t\t\t\t\t\t$sageresult = $this->process_response( $sageresult, $order );\n\n\t\t\t\t\t} elseif( isset( $sageresult['Status']) && $sageresult['Status']!= '' && $sageresult['Status']== 'REJECTED' ) {\n\n\t\t\t\t\t\t$redirect_url = $order->get_checkout_payment_url();\n\t\t\t\t\t\tthrow new Exception( __('3D Secure Payment error, please try again.', 'sumopayments_sagepayform') );\n\n\t\t\t\t\t\tunset( $_POST['MD'] );\n\t\t\t\t\t\tunset( $_POST['PARes'] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$redirect_url = $order->get_checkout_payment_url();\n\n\t\t\t\t\t\t/**\n \t \t * Payment Failed! - $sageresult['Status'] is empty\n \t \t\t */\n\t\t\t\t\t\t$order->add_order_note( __('Payment failed at 3D Secure, contact Sage. This transaction returned no status, you should contact Sage.', 'sumopayments_sagepayform') );\n\n\t\t\t\t\t\tthrow new Exception( __('3D Secure Payment error, please try again.' ), 'sumopayments_sagepayform');\n\n\t\t\t\t\t\tunset( $_POST['MD'] );\n\t\t\t\t\t\tunset( $_POST['PARes'] );\n\n\t\t\t\t\t}\n\n\t\t\t\t} catch( Exception $e ) {\n\t\t\t\t\twc_add_notice( $e->getMessage(), 'error' );\n\t\t\t\t}\n\n\t\t\t\twp_redirect( $redirect_url );\n\t\t\t\texit;\n\n }\n\n \tif( isset($this->threeDSMethod) && $this->threeDSMethod === \"1\" ) {\n \t\t// Non-iFrame Method\n?>\n\t\t\t\t<form id=\"submitForm\" method=\"post\" action=\"<?php echo $ACSURL; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"PaReq\" value=\"<?php echo $PAReq; ?>\"/>\n\t\t\t\t\t<input type=\"hidden\" name=\"MD\" value=\"<?php echo $MD; ?>\"/>\n\t\t\t\t\t<input type=\"hidden\" id=\"termUrl\" name=\"TermUrl\" value=\"<?php echo $order->get_checkout_payment_url( true ); ?>\"/>\n\t\t\t\t\t<script>\n\t\t\t\t\t\tdocument.getElementById('submitForm').submit();\n\t\t\t\t\t</script>\n\t\t\t\t</form>\n<?php\n\n \t} else {\n \t\t// iFrame Method\n\t \t$order->get_checkout_payment_url( true );\n\n\t\t\t\tif( isset( $MD ) && isset( $PAReq ) && $PAReq != '' && isset( $ACSURL ) && isset( $TermURL ) ) {\n\n\t \t$redirect_page =\n\t \t\t'<!--Non-IFRAME browser support-->' .\n\t '<SCRIPT LANGUAGE=\"Javascript\"> function OnLoadEvent() { document.form.submit(); }</SCRIPT>' .\n\t '<html><head><title>3D Secure Verification</title></head>' .\n\t '<body OnLoad=\"OnLoadEvent();\">' .\n\t '<form name=\"form\" action=\"'. $ACSURL .'\" method=\"post\">' .\n\t '<input type=\"hidden\" name=\"PaReq\" value=\"' . $PAReq . '\"/>' .\n\t '<input type=\"hidden\" name=\"MD\" value=\"' . $MD . '\"/>' .\n\t '<input type=\"hidden\" name=\"TermURL\" value=\"' . $TermURL . '\"/>' .\n\t '<NOSCRIPT>' .\n\t '<center><p>Please click button below to Authenticate your card</p><input type=\"submit\" value=\"Go\"/></p></center>' .\n\t '</NOSCRIPT>' .\n\t '</form></body></html>';\n\n\t $iframe_page =\n\t \t'<iframe src=\"' . $this->iframe_3d_redirect . '\" name=\"3diframe\" width=\"100%\" height=\"500px\" >' .\n\t $redirect_page .\n\t '</iframe>';\n\n\t echo $iframe_page;\n\t\t\t\t\treturn;\n\n\t }\n\n\t }\n\n }", "private function payWithCard(): void\n {\n $receipt = Route::goTo('pay');\n if ($receipt) {\n echo $receipt->toString();\n }\n }", "public function handle_acs_response() {\n\n\t\trequire_once( 'class-wc-realex-api.php' );\n\n\t\t// decrypt the merchant data so we can complete the transaction\n\t\t$data = $this->wc_gateway_realex->get_post( 'MD' );\n\n\t\t// page requested with no data, nothing we can do but bail\n\t\tif ( ! $data ) return;\n\n\t\t$data = $this->decrypt_merchant_data( $data );\n\n\t\t$data['pares'] = $this->wc_gateway_realex->get_post( 'PaRes' );\n\n\t\t$order = wc_get_order( $data['order_id'] );\n\n\t\tif ( ! $order ) {\n\n\t\t\tSV_WC_Helper::wc_add_notice( __( 'Communication error', 'woocommerce-gateway-realex' ), 'error' );\n\n\t\t\t// redirect back to home page since we don't have valid order data\n\t\t\twp_safe_redirect( home_url( '/' ) );\n\t\t\texit;\n\t\t}\n\n\t\t$order->payment_total = number_format( $order->get_total(), 2, '.', '' );\n\n\t\t// build the redirect url back to the payment page if needed for failure handling\n\t\t$payment_page = $order->get_checkout_payment_url();\n\n\t\t// create the realex api client\n\t\t$realex_client = new Realex_API( $this->wc_gateway_realex->get_endpoint_url(), $this->wc_gateway_realex->get_realvault_endpoint_url(), $this->wc_gateway_realex->get_shared_secret() );\n\t\t$realex_client->set_realmpi_endpoint_url( $this->get_realmpi_endpoint_url() );\n\n\t\t// perform the 3ds verify signature request\n\t\t$response = $this->threeds_verifysig_request( $realex_client, $order, $data );\n\n\t\tif ( ! $response ) {\n\t\t\tSV_WC_Helper::wc_add_notice( __( 'Communication error', 'woocommerce-gateway-realex' ), 'error' );\n\n\t\t\t// redirect back to payment page\n\t\t\twp_redirect( $payment_page );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! $realex_client->verify_transaction_signature( $response ) ) {\n\t\t\t// response was not properly signed by realex\n\t\t\tSV_WC_Helper::wc_add_notice( __( 'Error - invalid transaction signature, check your Realex settings.', 'woocommerce-gateway-realex' ), 'error' );\n\n\t\t\t// if debug mode load the response into the messages object\n\t\t\tif ( $this->wc_gateway_realex->is_debug_mode() ) {\n\t\t\t\t$this->wc_gateway_realex->response_debug_message( $response, \"Response: 3ds-verifysig\", 'error' );\n\t\t\t}\n\n\t\t\twp_redirect( $payment_page );\n\t\t\texit;\n\t\t}\n\n\t\tif ( $response->result == '00' ) {\n\t\t\t// Success\n\t\t\tif ( $this->wc_gateway_realex->is_debug_mode() ) $this->wc_gateway_realex->response_debug_message( $response, \"Response: 3ds-verifysig\" );\n\n\t\t\t$result = null;\n\t\t\tswitch( $response->threedsecure->status ) {\n\t\t\t\tcase 'Y':\n\t\t\t\t\t// the cardholder entered their passphrase correctly, this is a full 3DSecure transaction, send a normal Realex auth message (ECI field 5 or 2)\n\t\t\t\t\t$this->threedsecure = $response->threedsecure;\n\n\t\t\t\t\t$result = $this->wc_gateway_realex->authorize( $realex_client, $order, $data, false );\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'N':\n\t\t\t\t\t// the cardholder entered the wrong passphrase. No shift in liability, do not proceed to authorization\n\t\t\t\t\t$error_note = __( '3DSecure authentication failure: incorrect passphrase', 'woocommerce-gateway-realex' );\n\t\t\t\t\t$this->wc_gateway_realex->order_failed( $order, $error_note );\n\n\t\t\t\t\t// customer error message\n\t\t\t\t\t$message = __( 'Order declined due to incorrect authentication passphrase. Please try again with the correct authentication, or use a different card or payment method.', 'woocommerce-gateway-realex' );\n\t\t\t\t\tSV_WC_Helper::wc_add_notice( $message, 'error' );\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'U':\n\t\t\t\t\t// the issuer was having problems with their systems at the time and was unable to check the passphrase. transaction may be completed, but no shift in liability will occur (ECI field 7 or 0)\n\n\t\t\t\t\t$order_note = __( '3DSecure enrollment status verification: issuer was having problems with their system, no shift in chargeback liability.', 'woocommerce-gateway-realex' );\n\n\t\t\t\t\tif ( $this->liability_shift() ) {\n\t\t\t\t\t\t// liability shift required, order fail\n\t\t\t\t\t\t$this->wc_gateway_realex->order_failed( $order, $order_note );\n\n\t\t\t\t\t\tSV_WC_Helper::wc_add_notice( __( 'The transaction has been declined, please wait and try again or try an alternative payment method. Your order has been recorded, please contact us if you wish to provide payment over the phone.', 'woocommerce-gateway-realex' ), 'error' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// charge without liability shift allowed\n\t\t\t\t\t\t$order->add_order_note( $order_note );\n\t\t\t\t\t\t$this->threedsecure = $this->get_eci_non_3dsecure( $data['realex_cardType'] );\n\t\t\t\t\t\t$result = $this->wc_gateway_realex->authorize( $realex_client, $order, $data, false );\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'A':\n\t\t\t\t\t// bank acknowledges the attempt made by the merchant and accepts the liability shift. send a normal auth message (ECI field 6 or 1)\n\t\t\t\t\t// TODO: no known test case\n\t\t\t\t\t$this->threedsecure = $response->threedsecure;\n\t\t\t\t\t$result = $this->wc_gateway_realex->authorize( $realex_client, $order, $data, false );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// if the authorization was successful, redirect to the thank-you page, otherwise redirect back to the payment page\n\t\t\tif ( isset( $result['result'] ) && $result['result'] == 'success' ) wp_redirect( $result['redirect'] );\n\t\t\telse wp_redirect( $payment_page );\n\n\t\t} elseif ( $response->result == '520' ) {\n\n\t\t\t// if debug mode load the response into the messages object\n\t\t\tif ( $this->wc_gateway_realex->is_debug_mode() ) {\n\t\t\t\t$this->wc_gateway_realex->response_debug_message( $response, \"Response: 3ds-verifysig\", 'error' );\n\t\t\t}\n\n\t\t\t// Invalid response from ACS, no liability shift. send a normal auth message (ECI field 7 or 0) (note: this isn't described in the realmpi integration sequence of events, but appears in the test cards)\n\t\t\t$order_note = __( '3DSecure invalid response from ACS, no shift in chargeback liability.', 'woocommerce-gateway-realex' );\n\n\t\t\tif ( $this->liability_shift() ) {\n\t\t\t\t// liability shift required, order fail\n\t\t\t\t$this->wc_gateway_realex->order_failed( $order, $order_note );\n\n\t\t\t\tSV_WC_Helper::wc_add_notice( __( 'The transaction has been declined, please wait and try again or try an alternative payment method. Your order has been recorded, please contact us if you wish to provide payment over the phone.', 'woocommerce-gateway-realex' ), 'error' );\n\t\t\t} else {\n\t\t\t\t// charge without liability shift allowed\n\t\t\t\t$order->add_order_note( $order_note );\n\n\t\t\t\t$this->threedsecure = $this->get_eci_non_3dsecure( $data['realex_cardType'] );\n\t\t\t\t$result = $this->wc_gateway_realex->authorize( $realex_client, $order, $data, false );\n\t\t\t}\n\n\t\t\t// if the authorization was successful, redirect to the thank-you page, otherwise redirect back to the payment page\n\t\t\tif ( isset( $result['result'] ) && $result['result'] == 'success' ) wp_redirect( $result['redirect'] );\n\t\t\telse wp_redirect( $payment_page );\n\n\t\t} else {\n\n\t\t\t// if debug mode load the response into the messages object\n\t\t\tif ( $this->wc_gateway_realex->is_debug_mode() ) {\n\t\t\t\t$this->wc_gateway_realex->response_debug_message( $response, \"Response: 3ds-verifysig\", 'error' );\n\t\t\t}\n\n\t\t\tif ( $response->result == '110' ) {\n\t\t\t\t// Failure: the Signature on the PaRes did not validate - treat this as a fraudulent authentication.\n\t\t\t\t$error_note = sprintf( __( '3DSecure Verify Signature mismatch, possible fradulent transaction (Result %s - \"%s\")', 'woocommerce-gateway-realex' ), $response->result, $response->message );\n\t\t\t} else {\n\t\t\t\t// the implementation guide doesn't indicate any other response errors, but lets be cautious\n\t\t\t\t$error_note = sprintf( __( 'Realex Verify Signature error (Result: %s - \"%s\").', 'woocommerce-gateway-realex' ), $response->result, $response->message );\n\t\t\t}\n\n\t\t\t// if this is a duplicate order error and the order is already paid, just redirect to the Thank You page\n\t\t\t// this accounts for situations where the customer refreshes/back-buttons during the 3DSecure processing\n\t\t\tif ( '501' === (string) $response->result && $order->is_paid() ) {\n\n\t\t\t\t$order->add_order_note( $error_note );\n\n\t\t\t\twp_redirect( $this->wc_gateway_realex->get_return_url( $order ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$this->wc_gateway_realex->order_failed( $order, $error_note );\n\n\t\t\t// customer error message\n\t\t\t$message = __( 'The transaction has been declined by your bank, please contact your bank for more details, or try an alternative payment method. Your order has been recorded, please contact us if you wish to provide payment over the phone.', 'woocommerce-gateway-realex' );\n\t\t\tSV_WC_Helper::wc_add_notice( $message, 'error' );\n\n\t\t\twp_redirect( $payment_page );\n\t\t}\n\t\texit;\n\t}", "public function callback3dAction()\n {\n \t$boError = false;\n \t$szMessage = '';\n \t\n \ttry\n \t{\n \t\t// get the PaRes and MD from the post \n \t\t$szPaRes = $this->getRequest()->getPost('PaRes');\n \t\t$szMD = $this->getRequest()->getPost('MD');\n \t\t\n \t\t// complete the 3D Secure transaction with the 3D Authorization result\n \t\tMage::getSingleton('tpg/direct')->_run3DSecureTransaction($szPaRes, $szMD);\n \t}\n \tcatch (Exception $exc)\n \t{\n \t\t$boError = true;\n \t\tMage::log('Callback 3DSecure action failed, exception details: '.$exc);\n \t\t\n \t\tif( isset($_SESSION['tpg_message']) )\n \t\t{\n \t\t\t$szMessage = $_SESSION['tpg_message'];\n \t\t\tunset($_SESSION['tpg_message']);\n \t\t}\n \t\telse\n \t\t{\n\t\t\t\t$szMessage = Iridiumcorp_Tpg_Model_Tpg_GlobalErrors::ERROR_7655;\n \t\t}\n\n \t\t// report out an fatal error\n \t\tMage::getSingleton('core/session')->addError($szMessage);\n \t\t$this->_redirect('checkout/onepage/failure');\n \t}\n\n \tif (!$boError)\n \t{\n \t\t// report out an payment result\n \t\tif($GLOBALS['m_bo3DSecureError'] == 1)\n \t\t{\n \t\t\t// if the global message is empty report out a general error message\n \t\t\tif(!$GLOBALS['m_sz3DSecureMessage'])\n \t\t\t{\n \t\t\t\tMage::getSingleton('core/session')->addError(\"3DSecure Validation was not successfull, please try again.\");\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tMage::getSingleton('core/session')->addError($GLOBALS['m_sz3DSecureMessage']);\n \t\t\t}\n \t\t\t$this->_redirect('checkout/onepage/failure');\n \t\t}\n \t\telse\n \t\t{\n\t\t // set the quote as inactive after back from 3DS Authorization page\n\t\t Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\t\n\t\t // send confirmation email to customer\n\t\t $order = Mage::getModel('sales/order');\n\t\n\t\t $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n\t\t if($order->getId())\n\t\t {\n\t\t $order->sendNewOrderEmail();\n\t\t }\n\t\n\t\t //Mage::getSingleton('checkout/session')->unsQuoteId();\n\t\t if($GLOBALS['m_sz3DSecureMessage'])\n\t\t {\n\t\t \tMage::getSingleton('core/session')->addSuccess($GLOBALS['m_sz3DSecureMessage']);\n\t\t }\n\t\t $this->_redirect('checkout/onepage/success');\n \t\t}\n \t}\n }", "public function redirect_3d($params)\n\t\t{\n\t\t\tif(array_key_exists('PayPalPro', $_SESSION))\n\t\t\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\t\t\t\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\t\t\t\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t\t\t<head></head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<form name=\"form\" id=\"3d_form\" action=\"'.$_SESSION['PayPalPro']['3d']['ASCurl'].'\" method=\"POST\">\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"PaReq\" value=\"'.$_SESSION['PayPalPro']['3d']['PaReq'].'\" />\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"TermUrl\" value=\"'.$_SESSION['PayPalPro']['3d']['TermUrl'].'\" />\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"MD\" value=\" \" />\n\t\t\t\t\t\t\t\t<noscript>\n\t\t\t\t\t\t\t\t\t<p>Please click button below to Authenticate your card</p><input type=\"submit\" value=\"Go\" /></p>\n\t\t\t\t\t\t\t\t</noscript>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t<script type=\"text/javascript\">setTimeout(function() { document.getElementById(\"3d_form\").submit(); }, 50);</script>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>';\n\t\t}", "function showPaymentPageForBluepay()\n\t{\n\t\t\t\t\n\t\t$bluepaydetails = explode(\"|\",$_SESSION['bluepaydetails']);\t\t\t\t\n\t\t$merchantid=$bluepaydetails[0];\n\t\t$sucess_url = $bluepaydetails[1];\n\t\t$cancel_url = $bluepaydetails[2];\n\t\tunset($_SESSION['bluepaydetails']);\t\n\t\t\n\n\t\t\n\t\t\t\t$output='<div id=\"myaccount_div\">\n\n\t\t<form action=\"https://secure.bluepay.com/interfaces/bp10emu\" method=POST class=\"form-horizontal\">\n\t\t\n\t\t<h3 class=\"accinfo_fnt\">Blue Pay Payment Information</h3>\n\t\t\n\t\t<h4 class=\"red_fnt\">Credit Card Information</h3>\n\n\t\t<h3 class=\"accinfo_fnt\">Please enter details below:</h3>\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Name On the Card <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t\t<input type=\"text\" name=\"NAME\" size=\"25\"/>\n\t\t</div>\n\t\t</div>\n\n\t\t\n\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Credit Card Number <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t\t<input type=\"text\" name=\"CC_NUM\" />\n\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Expiration Date (mm/yy) <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"CC_EXPIRES\"/>\n\t\t</div>\n\t\t</div>\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">CVV2 <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"CVCCVV2\" />\n\t\t</div>\n\t\t</div>\n\n\t\t<!--<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Address <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"ADDR1\" />\n\t\t</div>\n\t\t</div>\n\t\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">City <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"CITY\" />\n\t\t</div>\n\t\t</div>\n\t\t\n\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">State<i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"STATE\" />\n\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">ZipCode<i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"ZIPCODE\" />\n\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Phone <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"PHONE\" />\n\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class=\"control-group\">\n\t\t<label for=\"inputEmail\" class=\"control-label\">Email <i class=\"red_fnt\">*</i></label>\n\t\t<div class=\"controls\">\n\t\t<input type=\"text\" name=\"EMAIL\" />\n\t\t</div>\n\t\t</div>-->\n\n\t\t<input type=hidden name=MERCHANT value=\"'.$merchantid.'\">\n\t\t\t\t\t<input type=hidden name=TRANSACTION_TYPE value=\"AUTH\">\n\t\t\t\t\t<input type=hidden name=TAMPER_PROOF_SEAL value=\"adfc2d7799ffa98fc18c301bd4476ab9\">\n\t\t\t\t\t<input type=hidden name=APPROVED_URL value=\"'.$sucess_url.'&pay_type=17\">\n\t\t\t\t\t<input type=hidden name=DECLINED_URL value=\"'.$cancel_url.'\">\n\t\t\t\t\t<input type=hidden name=MISSING_URL value=\"'.$sucess_url.'&pay_type=17\">\n\t\t\t\t\t<input type=hidden name=MODE value=\"TEST\">\n\t\t\t\t\t<input type=hidden name=AUTOCAP value=\"0\">\n\t\t\t\t\t<input type=hidden name=REBILLING value=\"\">\n\t\t\t\t\t<input type=hidden name=REB_CYCLES value=\"\">\n\t\t\t\t\t<input type=hidden name=REB_AMOUNT value=\"\">\n\t\t\t\t\t<input type=hidden name=REB_EXPR value=\"\">\n\t\t\t\t\t<input type=hidden name=REB_FIRST_DATE value=\"\"> \n\t\t\t\t\t<input type=hidden name=AMOUNT value=\"'.round($_SESSION['checkout_amount']).'\">\t\n\t\t\n\t\n\t\t\n\t\t<div class=\"control-group\">\n\t\t<div class=\"controls\">\n\t\t\t<button class=\"btn btn-danger\" type=\"submit\">Submit</button>\n\t\t</div>\n\t\t</div>\n\t\t</form> </div>';\n\n\t\treturn $output;\n\n\t}", "public function payment_success()\r\n\t{\r\n\t\tredirect(\"/index\");\r\n\t}", "public function redirectAction()/*{{{*/\n {\n try {\n $session = $this->getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n\n #echo '<pre>'.print_r($order, 1).'</pre>';\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n\n if ($order->getPayment() !== false){\n \t$payment = $order->getPayment()->getMethodInstance();\n } else {\n \t$payment = $this->getHPPayment();\n }\n \n if ($order->getState() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {\n $order->setState(\n Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,\n $payment->getWaitState(),\n $this->_getHelper()->__('Customer was redirected to Payment IFrame.')\n )->save();\n }\n\t\t\n if ($session->getQuoteId() && $session->getLastSuccessQuoteId()) {\n $session->setHeidelpayQuoteId($session->getQuoteId());\n $session->setHeidelpayLastSuccessQuoteId($session->getLastSuccessQuoteId());\n $session->setHeidelpayLastRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(true)->save();\n $session->clear();\n }elseif ($session->getLastSuccessQuoteId()){\n\t\t$session->setHeidelpayQuoteId($session->getLastSuccessQuoteId());\n $session->setHeidelpayLastSuccessQuoteId($session->getLastSuccessQuoteId());\n $session->setHeidelpayLastRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(true)->save();\n $session->clear();\n\t }\n\n#\t\tmail('andreas.nemet@heidelpay.de', 'QuoteId', print_r($session->getQuoteId(),1).' # '.print_r($session->getLastSuccessQuoteId(),1).' # '.print_r($session->setHeidelpayQuoteId(),1));\n\n Mage::dispatchEvent('hp_payment_controller_redirect_action');\n\n $payment = $order->getPayment()->getMethodInstance()->getCode();\n #echo '<pre>'.print_r($payment, 1).'</pre>';\n if ($payment == 'hpsu'){\n $this->_redirect('heidelpay/payment/suform', array('_secure' => true));\n } else {\n $this->_redirect('heidelpay/payment/iframe', array('_secure' => true));\n }\n return;\n } catch (Exception $e){\n Mage::logException($e);\n $this->_redirect('checkout/cart', array('_secure' => true));\n }\n }", "public function directAction()\n {\n $config = $this->container->get('shopware.plugin.cached_config_reader')->getByPluginName('NetCentsPayment');\n $router = $this->Front()->Router();\n\n $data = $this->getOrderData();\n $user = Shopware()->Session()->sOrderVariables['sUserData'];\n $order_id = $data[0][\"orderID\"];\n $shop = $this->getShopData();\n\n $payload = array(\n 'external_id' => $order_id,\n 'amount' => $this->getAmount(),\n 'currency_iso' => $this->getCurrencyShortName(),\n 'callback_url' => $router->assemble(['action' => 'return']) . '?external_id=' . $order_id,\n 'first_name' => $user['billingaddress']['firstname'],\n 'last_name' => $user['billingaddress']['lastname'],\n 'email' => $user['additional']['user']['email'],\n 'webhook_url' => $router->assemble(['action' => 'webhook101010']),\n 'merchant_id' => $config['NetCentsCredentialsApiKey'],\n 'hosted_payment_id' => $config['NetCentsWebPluginId'],\n 'data_encryption' => array(\n 'external_id' => $order_id,\n 'amount' => $this->getAmount(),\n 'currency_iso' => $this->getCurrencyShortName(),\n 'callback_url' => $router->assemble(['action' => 'return']) . '?external_id=' . $order_id,\n 'first_name' => $user['billingaddress']['firstname'],\n 'last_name' => $user['billingaddress']['lastname'],\n 'email' => $user['additional']['user']['email'],\n 'webhook_url' => $router->assemble(['action' => 'webhook101010']),\n 'merchant_id' => $config['NetCentsCredentialsApiKey'],\n 'hosted_payment_id' => $config['NetCentsWebPluginId'],\n )\n );\n\n $api_url = $this->nc_get_api_url($config['NetCentsApiUrl']);\n $response = \\NetCents\\NetCents::request(\n $api_url . '/merchant/v2/widget_payments',\n $payload,\n $config['NetCentsCredentialsApiKey'],\n $config['NetCentsCredentialsSecretKey']\n );\n\n $token = $response['token'];\n\n if ($token) {\n $this->redirect($config['NetCentsApiUrl'] . \"/widget/merchant/widget?data=\" . $token);\n } else {\n error_log(print_r(array($order), true) . \"\\n\", 3, Shopware()->DocPath() . '/error.log');\n }\n }", "public function payment_success()\n\t{\n\t\tredirect(\"/index\");\n\t}", "public function redirectAction()\n {\n /** @var $helper PB_PaymentPaybox_Helper_Data */\n $helper = Mage::helper(self::MODULENAME);\n $session = Mage::getSingleton('checkout/session');\n $state = Mage_Sales_Model_Order::STATE_NEW;\n\n $status = Mage::getStoreConfig('payment/pbpaybox/order_status');\n if (strlen($status) == 0)\n $status = Mage::getModel('sales/order')->getConfig()->getStateDefaultStatus($state);\n\n $lastOrderId = $session->getLastOrderId();\n if (empty($lastOrderId)) {\n $helper->log(\"Error. Redirect to paybox.money failed. No data in session about order.\");\n $this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');\n $this->getResponse()->setBody($this->getLayout()->createBlock(self::MODULENAME.'/error')->toHtml());\n return;\n }\n\n /* @var $order Mage_Sales_Model_Order */\n $order = Mage::getModel('sales/order')->load($lastOrderId);\n $order->setState($state, $status, $this->__('Customer redirected to payment Gateway Paybox.kz'), false);\n $order->save();\n\n $payment = $order->getPayment()->getMethodInstance();\n if (!$payment)\n $payment = Mage::getSingleton(self::MODULENAME.\"/method_\".self::PAYMENTNAME);\n\n $dataForSending = $payment->preparePaymentData($order);\n\n $helper->log(array_merge(array('Data transfer' => 'To Paybox.kz'), $dataForSending));\n $this->getResponse()\n ->setHeader('Content-type', 'text/html; charset=UTF8');\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock(self::MODULENAME.'/redirect')\n ->setGateUrl($payment->getGateUrl())\n ->setPostData($dataForSending)\n ->toHtml());\n }", "function process_payment() {\n if ($this->session->userdata('payment_data')['payment_gateway'] == 'authorize') {\n $page_data['title'] = 'Process Payment';\n $page_data['page_name'] = 'authorize_payment';\n\n $this->load->view('backend/index', $page_data);\n } else {\n redirect(base_url('index.php?admin/make_payment'));\n }\n }", "static function _gotoPaymentPage()\n {\n if (Cart::is_empty()) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::redirect(\n \\Cx\\Core\\Routing\\Url::fromModuleAndCmd('Shop', '', '',\n (intval($_SESSION['shop']['previous_category_id']) > 0\n ? 'catId='.\n intval($_SESSION['shop']['previous_category_id'])\n : '')));\n }\n if (!isset($_SESSION['shop']['note'])) {\n $_SESSION['shop']['note'] = '';\n }\n if (!isset($_SESSION['shop']['agb'])) {\n $_SESSION['shop']['agb'] = '';\n }\n if (!isset($_SESSION['shop']['cancellation_terms'])) {\n $_SESSION['shop']['cancellation_terms'] = '';\n }\n // Since 3.1.0\n $page_repository = \\Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');\n if ($page_repository->findOneByModuleCmdLang(\n 'Shop', 'payment', FRONTEND_LANG_ID)) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::redirect(\n \\Cx\\Core\\Routing\\Url::fromModuleAndCmd('Shop', 'payment'));\n }\n \\Cx\\Core\\Csrf\\Controller\\Csrf::redirect(\n \\Cx\\Core\\Routing\\Url::fromModuleAndCmd('Shop', 'confirm'));\n }", "public function mpiRedirectAction()\n\t{\n\t\t$this->loadLayout();\n\t\t$this->_getPayment()->getOrder()->addStatusHistoryComment(\n\t\t\tMage::helper('saferpay_be')->__('Initializing 3D-Secure Redirect: display customer notification page')\n\t\t)->save();\n\t\t$this->getLayout()->getBlock('saferpay.mpi.redirect')->addData(array(\n\t\t\t'card_type_code' => $this->_getPayment()->getPaymentInfoData('card_type'),\n\t\t\t'redirect_url' => $this->_getPayment()->get3DSecureAuthorizeUrl(),\n\t\t\t'method' => $this->_getPayment(),\n\t\t));\n\t\t$this->renderLayout();\n\t}", "public function redirect_to_payment_form() {\n\t\t?>\n\n\t\t<html>\n\t\t\t<head>\n\t\t\t\t<title>TBC</title>\n\t\t\t\t<script type=\"text/javascript\" language=\"javascript\">\n\t\t\t\t\tfunction redirect() {\n\t\t\t\t\t\tdocument.returnform.submit();\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t</head>\n\n\t\t\t<body onLoad=\"javascript:redirect()\">\n\t\t\t\t<form name=\"returnform\" action=\"<?php echo esc_url( sprintf( 'https://%s.ufc.ge/ecomm2/ClientHandler', $_GET['merchant_host'] ) ); ?>\" method=\"POST\">\n\t\t\t\t\t<input type=\"hidden\" name=\"trans_id\" value=\"<?php echo rawurldecode( $_GET['transaction_id'] ); ?>\">\n\n\t\t\t\t\t<noscript>\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t<?php esc_html_e( 'Please click the submit button below.', 'tbc-gateway-free' ); ?><br>\n\t\t\t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Submit\">\n\t\t\t\t\t\t</center>\n\t\t\t\t\t</noscript>\n\t\t\t\t</form>\n\t\t\t</body>\n\n\t\t</html>\n\n\t\t<?php\n\t\texit();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
first appearance (20120117); word text boxes
protected function clean_word() { preg_match_all('/<img[^<>]*? alt="Text Box:\s*([^"]*?)"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE); $counter = sizeof($text_box_matches[0]) - 1; while($counter > -1) { $offset = $text_box_matches[0][$counter][1]; $text = $text_box_matches[1][$counter][0]; $text = '<p>' . str_replace('&#13;&#10;', '</p> <p>', $text) . '</p>'; $this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0])); $counter--; } // although at least firefox seems smart enough to not display them, // some versions of word may use soft hyphens for print layout or some such nonsense // is this a candidate for general (basic) usage? $this->code = str_replace('&shy;', '', $this->code); // this needs revision for array("­", "&#173;", "&#xad;", "&shy;"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox) ReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles // should we simply eliminate all names and ids (since the structure function will generate those which are needed)? // seems we should except for footnotes: _ftnref _ftn _ednref _edn $this->code = preg_replace('/ id="([^_][^"]*?|_[^fe][^"]*?|_f[^t][^"]*?|_e[^d][^"]*?|_ft[^n][^"]*?|_ed[^n][^"]*?)"/is', '', $this->code); $this->code = preg_replace('/(<a[^<>]*?) name="([^_][^"]*?|_[^fe][^"]*?|_f[^t][^"]*?|_e[^d][^"]*?|_ft[^n][^"]*?|_ed[^n][^"]*?)"([^<>]*?>)/is', '$1$3', $this->code); // often in word documents the lang attributes are wrong... so: $this->code = preg_replace('/ lang="EN[^"]*"/', '', $this->code); $this->code = preg_replace('/ xml:lang="EN[^"]*"/', '', $this->code); $this->code = preg_replace('/ lang="FR[^"]*"/', '', $this->code); $this->code = preg_replace('/ xml:lang="FR[^"]*"/', '', $this->code); // white background $this->code = preg_replace('/ class="([^"]*)whiteBG([^"]*)"/is', ' class="$1$2"', $this->code); // parks canada specific: $this->code = preg_replace('/ class="([^"]*)backTop([^"]*)"/is', ' class="$1alignRight$2"', $this->code); // topPage; these should not exist (since documents in their original format shall not have links to the top) // but they sometimes come from styles to classes. On tags other than spans they style the alignment. $this->code = preg_replace('/<span([^>]*)class="([^"]*)topPage([^"]*)"/is', '<span$1class="$2$3"', $this->code); // word document section <div>s //$this->code = preg_replace('/<div style="page\s*:\s*[^;]+;">/is', '<div stripme="y">', $this->code); ReTidy::non_DOM_stripme('<div style="page\s*:\s*[^;]+;">'); // remove style information declarations(?) or qualifications(?) like !msnorm and !important? // Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we // would like to keep it). Definately get rid of !msnorm though. $arrayStyleInformationPiecesToDelete = array( '!msorm', ); foreach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) { $styleInformationPieceToDeleteCount = -1; while($styleInformationPieceToDeleteCount != 0) { $this->code = preg_replace('/style="([^"]*?)' . $styleInformationPieceToDelete . '([^"]*?)"/is', 'style="$1$2"', $this->code, -1, $styleInformationPieceToDeleteCount); } } // blockquote preg_match_all('/<p[^<>]*style=[^<>]*(margin-right\s*:\s*([^;\'"]*)[;\'"])[^<>]*(margin-left\s*:\s*([^;\'"]*)[;\'"])[^<>]*>(.*?)<\/p>/is', $this->code, $p_matches2); foreach($p_matches2[0] as $index => $value) { preg_match('/([0-9\.]*)in/', $p_matches2[2][$index], $margin_right_matches); preg_match('/([0-9\.]*)in/', $p_matches2[4][$index], $margin_left_matches); if($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) { $original = $new = $p_matches2[0][$index]; $new = str_replace($p_matches2[1][$index], '', $new); $new = str_replace($p_matches2[3][$index], '', $new); $new = str_replace('<p', '<div', $new); $new = str_replace('</p>', '</div>', $new); $new = "<blockquote>" . $new . "</blockquote>"; $this->code = str_replace($original, $new, $this->code); } } // onmouseover, onmouseout; attributes to delete $arrayAttributesToDelete = array( 'onmouseover', 'onmouseout', ); foreach($arrayAttributesToDelete as $attributeToDelete) { $this->code = preg_replace('/' . $attributeToDelete . '="([^"]*)"/is', '', $this->code); } // microsoft styles to delete $arrayMicrosoftStylesToDelete = array( 'page-break-before', 'page-break-after', 'page-break-inside', 'text-autospace', 'text-transform', //'border', 'border-left', // (2011-11-07) 'border-right', // (2011-11-07) 'border-bottom', // (2011-11-07) 'border-top', // (2011-11-07) 'border-collapse', 'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation) 'margin-left', //// 'margin-right', //// 'margin-top', //// 'margin-bottom', //// 'padding', 'padding-left', 'padding-right', 'padding-top', 'padding-bottom', 'font', 'font-size', //// notice that we may in some cases want to keep font-size 'font-family', //'font-style', // font-style: italic; //'text-decoration', // text-decoration: underline; 'line-height', 'layout-grid-mode', 'page', 'text-indent', //// notice that we may in some cases want to keep text-indent 'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized) 'mso-style-name', 'mso-style-link', 'z-index', 'position', // we cannot enable the following and keep other style information that these are substrings of 'top', 'right', 'bottom', 'left', 'letter-spacing', ); // for this we assume that there are no embedded stylesheets foreach($arrayMicrosoftStylesToDelete as $microsoftStyle) { while(true) { $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape($microsoftStyle) . '\s*:\s*[^;"]*;\s*([^"]*)"/is', 'style="$1$2"', $this->code, -1, $countA); $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape($microsoftStyle) . '\s*:\s*[^;"]*"/is', 'style="$1"', $this->code, -1, $countB); if($countA === 0 && $countB === 0) { break; } } } if($this->config['strict_accessibility_level'] > 0) { // then just make it grey while(true) { $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape('color') . '\s*:\s*[^;"]*;\s*([^"]*)"/is', 'style="$1$2"', $this->code, -1, $countA); $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape('color') . '\s*:\s*[^;"]*"/is', 'style="$1"', $this->code, -1, $countB); if($countA === 0 && $countB === 0) { break; } } } $arrayMicrosoftStylesWithValuesToDelete = array( //'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour... 'text-align' => array('justify'), 'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), // we take this out although it can usefully cascade other styles // which brings up the point that these all probably can... ;( //'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'), 'background' => array('white', '#FFFFFF'), 'background-color' => array('white', '#FFFFFF'), ); foreach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) { foreach($value as $information) { while(true) { $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape($style) . '\s*:\s*' . ReTidy::preg_escape($information) . ';\s*([^"]*)"/is', 'style="$1$2"', $this->code, -1, $countC); $this->code = preg_replace('/style="([^"]*)' . ReTidy::preg_escape($style) . '\s*:\s*' . ReTidy::preg_escape($information) . '"/is', 'style="$1"', $this->code, -1, $countD); if($countC === 0 && $countD === 0) { break; } } } } $arrayMicrosoftStylesWithValuesOnTagsToDelete = array( 'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),), 'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),), 'vertical-align' => array( // we should be careful here not to remove any styles that might be used to identify footnotes; although // I do not know of any that are currently (2011-11-28) used 'baseline' => array('span'), 'sub' => array('span'), 'super' => array('span'), 'top' => array('span'), 'text-top' => array('span'), 'middle' => array('span'), 'bottom' => array('span'), 'text-bottom' => array('span'), 'inherit' => array('span'), ), ); foreach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) { foreach($stylings as $styling => $tags) { $tagsString = implode("|", $tags); while(true) { $this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style="([^"]*)' . ReTidy::preg_escape($property) . '\s*:\s*' . ReTidy::preg_escape($styling) . ';\s*([^"]*)"/is', '<$1$2 style="$3$4"', $this->code, -1, $countE); $this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style="([^"]*)' . ReTidy::preg_escape($property) . '\s*:\s*' . ReTidy::preg_escape($styling) . '"/is', '<$1$2 style="$3"', $this->code, -1, $countF); if($countE === 0 && $countF === 0) { break; } } } } // pseudo-elements // <a style=":visited { color: purple; }"> $countE = -1; while($countE !== 0) { //print("doing pseudo-elements<br>\r\n"); $this->code = preg_replace('/style="([^"]{0,}):\w+\s*\{[^\{\}]{0,}\}([^"]*)"/is', 'style="$1$2"', $this->code, -1, $countE); } // <hr> with width $this->code = preg_replace('/<hr([^<>]*) width="[^"]*"([^<>]*)\/>/is', '<hr$1$2/>', $this->code); // microsoft using operating system independant CSS... // I guess for this we assume that we are using windows. $this->code = preg_replace('/style="([^"]*)border\s*:\s*solid\s+windowtext\s+1.0pt\s*(;?)([^"]*)"/is', 'style="$1border: 1px solid black$2$3"', $this->code); // superscript using CSS //$this->code = preg_replace('/(<(\w*)[^<>]* style="[^"]*)vertical-align: super\s*(;?)([^"]*"[^<>]*>.*?<\/\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC); $this->code = preg_replace('/<(\w+[^<>]* style="[^"]*)vertical-align: super\s*(;?[^"]*"[^<>]*)>/is', '<$1$2 newtag="sup">', $this->code); // clean up stupidity generated by tidy $this->code = preg_replace('/<div([^<>]*?) start="[^"]*?"([^<>]*?)>/is', '<div$1$2>', $this->code); $this->code = preg_replace('/<div([^<>]*?) type="[^"]*?"([^<>]*?)>/is', '<div$1$2>', $this->code); ReTidy::post_dom(); // remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous // case of something like that many anchors at the same spot... //$this->code = str_replace('<a></a>', '', $this->code); $this->code = preg_replace('/<a>([^<>]*?)<\/a>/is', '$1', $this->code); // ReTidy::extra_space(); // lists where each list element has a <ul> if(ReTidy::is_XHTML()) { $this->code = preg_replace('/<\/li>\s*<\/ul>\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code); } else { $this->code = preg_replace('/<\/li>\s*<\/ul>\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code); } // empty text blocks; notice that we would not want to do this generally $this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\/\1>/is', '', $this->code); // some sort of full-width break from word that we do not want $this->code = preg_replace('/<br [^<>]*clear\s*=\s*["\']*all["\']*[^<>]*\/>/is', '', $this->code); // force a border onto tables because word html uses border on cells rather than on the table $this->code = preg_replace('/<table([^<>]*) border="0"/is', '<table$1 border="1"', $this->code); // despan anchors preg_match_all('/(<a ([^<>]*)[^\/<>]>)(.*?)(<\/a>)/is', $this->code, $anchor_matches); foreach($anchor_matches[0] as $index => $value) { if(strpos($anchor_matches[2][$index], "href=") === false) { if(strpos($anchor_matches[2][$index], "name=") !== false || strpos($anchor_matches[2][$index], "id=") !== false) { $this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code); } } } // simplify lists that unnecessarily have a list for each list item preg_match_all('/<ol([^<>]*?)>(.*?)<\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE); $size = sizeof($ol_matches[0]) - 1; while($size > -1) { preg_match('/ start="([^"]*?)"/is', $ol_matches[0][$size][0], $start_matches); preg_match('/ type="([^"]*?)"/is', $ol_matches[0][$size][0], $type_matches); $start = $start_matches[1]; $type = $type_matches[1]; $combine_string = ""; while(true) { $end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]); $end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]); $combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string; preg_match('/ type="([^"]*?)"/is', $ol_matches[0][$size - 1][0], $type_matches2); $type2 = $type_matches2[1]; if($type !== $type2) { break; } preg_match('/ start="([^"]*?)"/is', $ol_matches[0][$size - 1][0], $start_matches2); $start2 = $start_matches2[1]; if(!is_numeric($start2) || $start2 >= $start) { break; } ReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches); if($last_tag_piece_matches[0] !== "</ol>") { break; } $start = $start2; $size--; } $cleaned_combine_string = $combine_string; $cleaned_combine_string = preg_replace('/<\/ol>\s*<ol[^<>]*?>/is', '', $cleaned_combine_string); $this->code = str_replace($combine_string, $cleaned_combine_string, $this->code); $size--; } ReTidy::clean_redundant_sufficient_inline(); ReTidy::double_breaks_to_paragraphs(); ReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function //$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04 ReTidy::mitigate_consecutive_non_breaking_spaces(); // plz }
[ "function getWordForm($index);", "function superfood_elated_contact_form7_text_styles_1() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-text',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-number',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-date',\n\t\t\t'.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea',\n\t\t\t'.cf7_custom_style_1 select.wpcf7-form-control.wpcf7-select',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-quiz'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = superfood_elated_options()->getOptionValue('cf7_style_1_text_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t\techo superfood_elated_dynamic_css(\n\t\t\t'.cf7_custom_style_1 ::-webkit-input-placeholder',\n\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo superfood_elated_dynamic_css(\n\t\t\t'.cf7_custom_style_1 :-moz-placeholder',\n\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo superfood_elated_dynamic_css(\n\t\t\t'.cf7_custom_style_1 ::-moz-placeholder',\n\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo superfood_elated_dynamic_css(\n\t\t\t'.cf7_custom_style_1 :-ms-input-placeholder',\n\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t}\n\n\t\t$font_size = superfood_elated_options()->getOptionValue('cf7_style_1_text_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = superfood_elated_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$line_height = superfood_elated_options()->getOptionValue('cf7_style_1_text_line_height');\n\t\tif($line_height !== ''){\n\t\t\t$styles['line-height'] = superfood_elated_filter_px($line_height) . 'px';\n\t\t}\n\n\t\t$font_family = superfood_elated_options()->getOptionValue('cf7_style_1_text_font_family');\n\t\tif(superfood_elated_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = superfood_elated_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = superfood_elated_options()->getOptionValue('cf7_style_1_text_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = superfood_elated_options()->getOptionValue('cf7_style_1_text_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = superfood_elated_options()->getOptionValue('cf7_style_1_text_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = superfood_elated_options()->getOptionValue('cf7_style_1_text_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = superfood_elated_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\t$background_color = superfood_elated_options()->getOptionValue('cf7_style_1_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(superfood_elated_options()->getOptionValue('cf7_style_1_background_transparency') !== ''){\n\t\t\t\t$background_opacity = superfood_elated_options()->getOptionValue('cf7_style_1_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = superfood_elated_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = superfood_elated_options()->getOptionValue('cf7_style_1_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(superfood_elated_options()->getOptionValue('cf7_style_1_border_transparency') !== ''){\n\t\t\t\t$border_opacity = superfood_elated_options()->getOptionValue('cf7_style_1_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = superfood_elated_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\t$border_width = superfood_elated_options()->getOptionValue('cf7_style_1_border_width');\n\t\tif($border_width !== ''){\n\t\t\t$styles['border-width'] = superfood_elated_filter_px($border_width) . 'px';\n\t\t}\n\n\t\t$border_radius = superfood_elated_options()->getOptionValue('cf7_style_1_border_radius');\n\t\tif($border_radius !== ''){\n\t\t\t$styles['border-radius'] = superfood_elated_filter_px($border_radius) . 'px';\n\t\t}\n\n\t\t$padding_top = superfood_elated_options()->getOptionValue('cf7_style_1_padding_top');\n\t\tif($padding_top !== ''){\n\t\t\t$styles['padding-top'] = superfood_elated_filter_px($padding_top) . 'px';\n\t\t}\n\n\t\t$padding_right = superfood_elated_options()->getOptionValue('cf7_style_1_padding_right');\n\t\tif($padding_right !== ''){\n\t\t\t$styles['padding-right'] = superfood_elated_filter_px($padding_right) . 'px';\n\t\t}\n\n\t\t$padding_bottom = superfood_elated_options()->getOptionValue('cf7_style_1_padding_bottom');\n\t\tif($padding_bottom !== ''){\n\t\t\t$styles['padding-bottom'] = superfood_elated_filter_px($padding_bottom) . 'px';\n\t\t}\n\n\t\t$padding_left = superfood_elated_options()->getOptionValue('cf7_style_1_padding_left');\n\t\tif($padding_left !== ''){\n\t\t\t$styles['padding-left'] = superfood_elated_filter_px($padding_left) . 'px';\n\t\t}\n\n\t\t$margin_top = superfood_elated_options()->getOptionValue('cf7_style_1_margin_top');\n\t\tif($margin_top !== ''){\n\t\t\t$styles['margin-top'] = superfood_elated_filter_px($margin_top) . 'px';\n\t\t}\n\n\t\t$margin_bottom = superfood_elated_options()->getOptionValue('cf7_style_1_margin_bottom');\n\t\tif($margin_bottom !== ''){\n\t\t\t$styles['margin-bottom'] = superfood_elated_filter_px($margin_bottom) . 'px';\n\t\t}\n\n\t\tif(superfood_elated_options()->getOptionValue('cf7_style_1_textarea_height')) {\n\t\t\t$textarea_height = superfood_elated_options()->getOptionValue('cf7_style_1_textarea_height');\n\t\t\techo superfood_elated_dynamic_css(\n\t\t\t'.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea',\n\t\t\tarray('height' => superfood_elated_filter_px($textarea_height).'px')\n\t\t\t);\n\t\t}\n\n\t\techo superfood_elated_dynamic_css($selector, $styles);\n\t}", "public static function GetAutoFocusedFormField ();", "abstract protected function textField();", "private function setFirstWord()\n {\n // 15 characters length, because that is the max word length in the database\n $length = $this->grid->getWidth();\n $length = $length > 15 ? 15 : $length;\n $word = $this->wordGenerator->generate(['length' => $length]);\n // then place at random place in random row\n $this->placeWord($this->grid->getRandomRow(), $word, 0);\n }", "function genTextBox( $name, $initialValue )\n\t{\n \techo '<textarea name=\"' . $name . '\" class=\"groupBBS fbFont\">' .\n\t $initialValue . '</textarea>';\n\t}", "function textbox($text, $x, $y, $width, $size=12, $color=0) {\n\t\t$lines = explode(\"\\n\", trim($text));\n\t\t$line_nr = 0;\n\t\tforeach ($lines as $i => $line) {\n\t\t\t$subline = $subline_new = '';\n\t\t\tforeach (explode(' ', $line) as $word) {\n\t\t\t\t$subline_new .= ($subline?' ':'') . $word;\n\t\t\t\t$res = imagettfbbox((float) $size, 0, $this->fontfile, $subline_new);\n\t\t\t\t$subline_width = $res[2]-$res[0];\n\t\t\t\tif ($subline_width >= $width) { // derp!\n\t\t\t\t\t$this->tttext($subline, $x, $y + $line_nr * $this->line_height, $color, $size);\n\t\t\t\t\t$line_nr++;\n\t\t\t\t\t$subline_new = $word;\n\t\t\t\t}else{\n\t\t\t\t\t$subline = $subline_new;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// trailing word(s).\n\t\t\t$this->tttext($subline_new, $x, $y + $line_nr * $this->line_height, $color, $size);\n\t\t\t$line_nr++;\n\t\t}\n\t\treturn $line_nr * $this->line_height;\n\t}", "public function __placeFirstWord() {\n $word = $this->__getRandomWord($this->grid->getCols());\n\n $x = $this->grid->getCenterPos(PC_AXIS_H, $word);\n $y = $this->grid->getCenterPos(PC_AXIS_V);\n\n $this->grid->placeWord($word, $x, $y, PC_AXIS_H);\n }", "function calculateTextBox($font_size, $font_angle, $font_file, $text) { \n $box = imagettfbbox($font_size, $font_angle, $font_file, $text); \n if( !$box ) \n return false; \n $min_x = min( array($box[0], $box[2], $box[4], $box[6]) ); \n $max_x = max( array($box[0], $box[2], $box[4], $box[6]) ); \n $min_y = min( array($box[1], $box[3], $box[5], $box[7]) ); \n $max_y = max( array($box[1], $box[3], $box[5], $box[7]) ); \n $width = ( $max_x - $min_x ); \n $height = ( $max_y - $min_y ); \n $left = abs( $min_x ) + $width; \n $top = abs( $min_y ) + $height; \n // to calculate the exact bounding box i write the text in a large image \n $img = @imagecreatetruecolor( $width << 2, $height << 2 ); \n $white = imagecolorallocate( $img, 255, 255, 255 ); \n $black = imagecolorallocate( $img, 0, 0, 0 ); \n imagefilledrectangle($img, 0, 0, imagesx($img), imagesy($img), $black); \n // for sure the text is completely in the image! \n imagettftext( $img, $font_size, \n $font_angle, $left, $top, \n $white, $font_file, $text); \n // start scanning (0=> black => empty) \n $rleft = $w4 = $width<<2; \n $rright = 0; \n $rbottom = 0; \n $rtop = $h4 = $height<<2; \n for( $x = 0; $x < $w4; $x++ ) \n for( $y = 0; $y < $h4; $y++ ) \n if( imagecolorat( $img, $x, $y ) ){ \n $rleft = min( $rleft, $x ); \n $rright = max( $rright, $x ); \n $rtop = min( $rtop, $y ); \n $rbottom = max( $rbottom, $y ); \n } \n // destroy img and serve the result \n imagedestroy( $img ); \n return array( \"left\" => $left - $rleft, \n \"top\" => $top - $rtop, \n \"width\" => $rright - $rleft + 1, \n \"height\" => $rbottom - $rtop + 1 ); \n}", "private function prepareTextbox(){\n\t\techo (isset($this->settings['before_field']))? $this->settings['before_field']:null;\n\t\techo '<input type=\"text\" ';\n\t\techo 'name = \"'.$this->name.'\" ';\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\n\t\t\n\t\techo (isset($this->settings['datatype']))? 'datatype = \"'.$this->settings['datatype'].'\" ':null;\n\t\techo($this->settings['required_mark'])? ' required ':null;\n\t\t\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\n\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\n\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? 'disabled=\"disabled\"':null;\t\n\t\techo ' />';\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null;\n\t\techo $this->display_field_msg($this->name, $this->settings['field_msg']);\n\t}", "private function prepareTextbox(){\r\n\t\r\n\t\techo (isset($this->settings['before_field']))? $this->settings['before_field']:null;\r\n\t\techo '<input type=\"text\" ';\r\n\t\techo 'name = \"'.$this->name.'\" ';\r\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\r\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\r\n\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\r\n\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? 'disabled=\"disabled\"':null;\t\r\n\t\techo ' />';\r\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null;\r\n\t\techo $this->display_field_msg($this->name, $this->settings['field_msg']);\r\n\t\t\r\n\t}", "public function getFirstWord(){ $word = null; if( !($word = $this->getPrimaryWord()) ){ if( count($this->words) ){ $word = $this->words[0]; } } return $word; }", "public function getTexts();", "function acf_text_input($attrs = array())\n{\n}", "function display_find_vocabulary_tips()\n{\n echo \"Enter the headword of vocabulary which you want to find.\\n\";\n}", "function render_dialog_text_box_type() {\n\t\tinclude_once 'dialog_text_box_type.tpl.php';\n\t}", "function superfood_elated_contact_form7_text_styles_3() {\n $selector = array(\n '.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-text',\n '.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-number',\n '.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-date',\n '.cf7_custom_style_3 textarea.wpcf7-form-control.wpcf7-textarea',\n '.cf7_custom_style_3 select.wpcf7-form-control.wpcf7-select',\n '.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-quiz'\n );\n $styles = array();\n\n $color = superfood_elated_options()->getOptionValue('cf7_style_3_text_color');\n if($color !== ''){\n $styles['color'] = $color;\n echo superfood_elated_dynamic_css(\n '.cf7_custom_style_3 ::-webkit-input-placeholder',\n array('color' => $color)\n );\n echo superfood_elated_dynamic_css(\n '.cf7_custom_style_3 :-moz-placeholder',\n array('color' => $color)\n );\n echo superfood_elated_dynamic_css(\n '.cf7_custom_style_3 ::-moz-placeholder',\n array('color' => $color)\n );\n echo superfood_elated_dynamic_css(\n '.cf7_custom_style_3 :-ms-input-placeholder',\n array('color' => $color)\n );\n }\n\n $font_size = superfood_elated_options()->getOptionValue('cf7_style_3_text_font_size');\n if($font_size !== ''){\n $styles['font-size'] = superfood_elated_filter_px($font_size) . 'px';\n }\n\n $line_height = superfood_elated_options()->getOptionValue('cf7_style_3_text_line_height');\n if($line_height !== ''){\n $styles['line-height'] = superfood_elated_filter_px($line_height) . 'px';\n }\n\n $font_family = superfood_elated_options()->getOptionValue('cf7_style_3_text_font_family');\n if(superfood_elated_is_font_option_valid($font_family)) {\n $styles['font-family'] = superfood_elated_get_font_option_val($font_family);\n }\n\n $font_style = superfood_elated_options()->getOptionValue('cf7_style_3_text_font_style');\n if(!empty($font_style)){\n $styles['font-style'] = $font_style;\n }\n\n $font_weight = superfood_elated_options()->getOptionValue('cf7_style_3_text_font_weight');\n if(!empty($font_weight)){\n $styles['font-weight'] = $font_weight;\n }\n\n $text_transform = superfood_elated_options()->getOptionValue('cf7_style_3_text_text_transform');\n if(!empty($text_transform)){\n $styles['text-transform'] = $text_transform;\n }\n\n $letter_spacing = superfood_elated_options()->getOptionValue('cf7_style_3_text_letter_spacing');\n if($letter_spacing !== ''){\n $styles['letter-spacing'] = superfood_elated_filter_px($letter_spacing) . 'px';\n }\n\n $background_color = superfood_elated_options()->getOptionValue('cf7_style_3_background_color');\n $background_opacity = 1;\n if($background_color !== ''){\n if(superfood_elated_options()->getOptionValue('cf7_style_3_background_transparency') !== ''){\n $background_opacity = superfood_elated_options()->getOptionValue('cf7_style_3_background_transparency');\n }\n $styles['background-color'] = superfood_elated_rgba_color($background_color,$background_opacity);\n }\n\n $border_color = superfood_elated_options()->getOptionValue('cf7_style_3_border_color');\n $border_opacity = 1;\n if($border_color !== ''){\n if(superfood_elated_options()->getOptionValue('cf7_style_3_border_transparency') !== ''){\n $border_opacity = superfood_elated_options()->getOptionValue('cf7_style_3_border_transparency');\n }\n $styles['border-color'] = superfood_elated_rgba_color($border_color,$border_opacity);\n }\n\n $border_width = superfood_elated_options()->getOptionValue('cf7_style_3_border_width');\n if($border_width !== ''){\n $styles['border-width'] = superfood_elated_filter_px($border_width) . 'px';\n }\n\n $border_radius = superfood_elated_options()->getOptionValue('cf7_style_3_border_radius');\n if($border_radius !== ''){\n $styles['border-radius'] = superfood_elated_filter_px($border_radius) . 'px';\n }\n\n $padding_top = superfood_elated_options()->getOptionValue('cf7_style_3_padding_top');\n if($padding_top !== ''){\n $styles['padding-top'] = superfood_elated_filter_px($padding_top) . 'px';\n }\n\n $padding_right = superfood_elated_options()->getOptionValue('cf7_style_3_padding_right');\n if($padding_right !== ''){\n $styles['padding-right'] = superfood_elated_filter_px($padding_right) . 'px';\n }\n\n $padding_bottom = superfood_elated_options()->getOptionValue('cf7_style_3_padding_bottom');\n if($padding_bottom !== ''){\n $styles['padding-bottom'] = superfood_elated_filter_px($padding_bottom) . 'px';\n }\n\n $padding_left = superfood_elated_options()->getOptionValue('cf7_style_3_padding_left');\n if($padding_left !== ''){\n $styles['padding-left'] = superfood_elated_filter_px($padding_left) . 'px';\n }\n\n $margin_top = superfood_elated_options()->getOptionValue('cf7_style_3_margin_top');\n if($margin_top !== ''){\n $styles['margin-top'] = superfood_elated_filter_px($margin_top) . 'px';\n }\n\n $margin_bottom = superfood_elated_options()->getOptionValue('cf7_style_3_margin_bottom');\n if($margin_bottom !== ''){\n $styles['margin-bottom'] = superfood_elated_filter_px($margin_bottom) . 'px';\n }\n\n if(superfood_elated_options()->getOptionValue('cf7_style_3_textarea_height')) {\n $textarea_height = superfood_elated_options()->getOptionValue('cf7_style_3_textarea_height');\n echo superfood_elated_dynamic_css(\n '.cf7_custom_style_3 textarea.wpcf7-form-control.wpcf7-textarea',\n array('height' => superfood_elated_filter_px($textarea_height).'px')\n );\n }\n\n echo superfood_elated_dynamic_css($selector, $styles);\n }", "private function retrieve_focuskw()\n {\n }", "static function attach_meta_box_before_title(){\n\t\tglobal $post;\n\t\tif($post->post_type == 'post' && current_user_can('use_keywords')){\n\t\t\treturn self::key_word_field($post);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Given the policy information, either create or update a hot backup copy job.
private function createAssociatedHotBackupCopyJob($data, $policy, $sid) { $this->Log->writeVariable("In createAssociatedHotBackupCopyJob:, policy"); $this->Log->writeVariable($policy); // See if there is a replication target. global $replication; $targets = $replication->get('targets', array(), array(), $this->localID); if ($targets !== false && count($targets) > 0) { $targets = $targets['targets']; if (count($targets) > 0) { $target_id = $targets[0]['target_id']; } } if (isset($target_id)) { $jobInfo = array(); $jobInfo['type'] = 'replication'; $this->created['replication_job'] = $jobInfo['name'] = $this->createPolicyJobName($jobInfo['type'], $policy['name']); $jobInfo['description'] = $this->createAssociatedJobDescription($policy['name']); $jobInfo['target_id'] = $target_id; // For a replication job, the instances need to be passed in as an array of ints. $jobInfo['instances'] = array_map('intval', explode(',', $policy['instance_ids'])); // See if the job exists and needs update, or should be created. global $schedules; if (isset($policy['id'])) { $jobInfo['id'] = $policy['id']; } global $Log; $Log->writeVariable("REPLICATION POLICY"); $Log->writeVariable($policy); $schedule = $this->getExistingJob('replication', $jobInfo, $data, $sid); if ($schedule !== false) { // The only thing to replace in a replication job are the instances nad name. $schedule['instances'] = $jobInfo['instances']; $schedule['name'] = $jobInfo['name']; $result = $schedules->put(array($schedule['id']), $schedule, $sid); } else { // not found, unset the ID for job creation if (isset($jobInfo['id'])) { unset($jobInfo['id']); } $result = $schedules->save_schedule(-1, $jobInfo, $sid); if (is_array($result) && !isset($result['error'])) { $this->created['replication_job_id'] = $this->getIDFromJoborderCreation($result); } } } else { $result = array('error' => 500, 'message' => 'Cannot determine identification of hot backup copy target.'); } return $result; }
[ "private function createAssociatedColdBackupCopyJob($data, $policy, $sid) {\r\n\r\n // See if there is a replication target.\r\n global $appliance;\r\n $systems = array($sid => 'dummy');\r\n $targets = $appliance->get_storage(null, array('usage' => 'archive'), $this->localID, $systems);\r\n if ($targets !== false && count($targets) > 0) {\r\n $targets = $targets['storage'];\r\n if (count($targets) > 0) {\r\n $targetName = $targets[0]['name'];\r\n }\r\n }\r\n\r\n if (isset($targetName)) {\r\n\r\n $calendarArray = $data['calendar'];\r\n\r\n // SLA Policy Jobs only support one strategy.\r\n $firstCalendar = $calendarArray[0];\r\n // Archive each day of the week.\r\n $firstCalendar['run_on'] = array(0, 1, 2, 3, 4, 5, 6);\r\n // Archive each week\r\n $firstCalendar['schedule_run'] = 0;\r\n // Archive type\r\n $firstCalendar['backup_type'] = \"Archive\";\r\n // Remove recurrence as only run daily\r\n if (isset($firstCalendar['recurrence'])) {\r\n unset($firstCalendar['recurrence']);\r\n }\r\n\r\n $jobInfo = array();\r\n // The calendar describes the start, end_hour and recurrence period (RPO).\r\n $jobInfo['calendar'] = array($firstCalendar);\r\n // Include these jobs in the reports\r\n $jobInfo['email_report'] = true;\r\n // set purge option\r\n $jobInfo['purge'] = true;\r\n // Encrypt backups\r\n $jobInfo['encrypt'] = isset($data['archive_encryption']) ? $data['archive_encryption'] : false;\r\n $jobInfo['type'] = 'archive';\r\n $this->created['archive_job'] = $jobInfo['name'] = $this->createPolicyJobName($jobInfo['type'], $policy['name']);\r\n $jobInfo['description'] = $this->createAssociatedJobDescription($policy['name']);\r\n $jobInfo['storage'] = $targetName;\r\n // For an archive job, the instances need to be passed in as an array of ints.\r\n $jobInfo['instances'] = array_map('intval', explode(',', $policy['instance_ids']));\r\n // For incremental forever backup strategy, only need to archive Fulls, Incrementals, and Differentials.\r\n $jobInfo['types'] = array('Full', 'Differential', 'Incremental', 'Selective', 'Bare Metal', 'Transaction');\r\n // Get retention if set.\r\n if (isset($data['archive_retention_days'])) {\r\n $jobInfo['retention_days'] = $data['archive_retention_days'];\r\n }\r\n\r\n // See if the job exists and needs update, or should be created.\r\n global $schedules;\r\n if (isset($policy['id'])) {\r\n $jobInfo['id'] = $policy['id'];\r\n }\r\n $schedule = $this->getExistingJob('archive', $jobInfo, $data, $sid);\r\n if ($schedule !== false) {\r\n // don't overwrite the id with the policy id\r\n unset($jobInfo['id']);\r\n $schedule = array_merge($schedule, $jobInfo);\r\n $result = $schedules->put(array($schedule['id']), $schedule, $sid);\r\n } else {\r\n $result = $schedules->save_schedule(-1, $jobInfo, $sid);\r\n if (is_array($result) && !isset($result['error'])) {\r\n $this->created['archive_job_id'] = $this->getIDFromJoborderCreation($result);\r\n }\r\n }\r\n } else {\r\n $result = array('error' => 500,\r\n 'message' => 'Cannot determine identification of cold backup copy target.');\r\n }\r\n return $result;\r\n }", "abstract function PerformBackup();", "public function checkAndCreate()\n {\n\n if ($this->_isBackupDue())\n {\n $this->create();\n }\n\n }", "private function createBackup(): void\n {\n if (null === $this->backupService) {\n return;\n }\n $hash = $this->getHash();\n $connection = $this->entityManager->getConnection();\n\n $this->backupService->createBackup($connection, $hash);\n }", "public function createJob(Enlight_Components_Cron_Job $job);", "function bpsPro_db_backup( $db_backup, $tables, $job_name, $job_type, $email_zip ) {\nglobal $wpdb;\n\n$time_start = microtime( true );\n\n\tif ( $email_zip == 'Delete' ) {\n\t\t$email_zip_log = 'Yes & Delete';\n\t} else {\n\t\t$email_zip_log = $email_zip;\n\t}\n\tif ( $email_zip == 'EmailOnly' ) {\n\t\t$email_zip_log = 'Send Email Only';\n\t} else {\n\t\t$email_zip_log = $email_zip;\n\t}\n\n\t$timeNow = time();\n\t$gmt_offset = get_option( 'gmt_offset' ) * 3600;\n\t$timestamp = date_i18n(get_option('date_format'), strtotime(\"11/15-1976\")) . ' ' . date_i18n(get_option('time_format'), $timeNow + $gmt_offset);\n\t\n\t$handle = fopen( $db_backup, 'wb' );\n\t\n\tif ( $handle )\n\n\tfwrite( $handle, \"-- -------------------------------------------\\n\" );\n\tfwrite( $handle, \"-- BulletProof Security Pro DB Backup\\n\" );\n\tfwrite( $handle, \"-- Support: http://forum.ait-pro.com/\\n\" );\n\tfwrite( $handle, \"-- Backup Job Name: \". $job_name . \"\\n\" );\n\tfwrite( $handle, \"-- DB Backup Job Type: \". $job_type . \"\\n\" );\n\tfwrite( $handle, \"-- Email DB Backup: \". $email_zip_log . \"\\n\" );\n\tfwrite( $handle, \"-- DB Backup Time: \". $timestamp . \"\\n\" );\n\tfwrite( $handle, \"-- DB Name: \". DB_NAME . \"\\n\" );\t\t\n\tfwrite( $handle, \"-- DB Table Prefix: \". $wpdb->base_prefix . \"\\n\" );\n\tfwrite( $handle, \"-- Website URL: \" . get_bloginfo( 'url' ) . \"\\n\" );\n\tfwrite( $handle, \"-- WP ABSPATH: \". ABSPATH . \"\\n\" );\n\tfwrite( $handle, \"-- -------------------------------------------\\n\\n\" );\n\n\tfwrite( $handle, \"/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET NAMES \" . DB_CHARSET . \" */;\\n\" );\n\tfwrite( $handle, \"/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\\n\" );\n\tfwrite( $handle, \"/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\\n\" );\n\tfwrite( $handle, \"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\\n\\n\" );\n\n\tif ( ! empty( $tables ) )\n\n\t\tforeach ( $tables as $table_array ) {\n\t\t\n\t\t\t$table = current( $table_array );\n\t\t\t$create = $wpdb->get_var( \"SHOW CREATE TABLE \" . $table, 1 );\n\t\t\t$myisam = strpos( $create, 'MyISAM' );\n\n\t\t\tfwrite( $handle, \"--\\n-- BEGIN Table \" . $table . \"\\n--\\n\\nDROP TABLE IF EXISTS `\" . $table . \"`;\\n/*!40101 SET @saved_cs_client = @@character_set_client */;\\n/*!40101 SET character_set_client = '\" . DB_CHARSET . \"' */;\\n\" . $create . \";\\n/*!40101 SET character_set_client = @saved_cs_client */;\\n\\n\" );\n\n\t\t\t$data = $wpdb->get_results(\"SELECT * FROM `\" . $table . \"` LIMIT 1000\", ARRAY_A );\n\t\t\n\t\tif ( ! empty( $data ) ) {\n\t\t\t\n\t\t\tfwrite( $handle, \"LOCK TABLES `\" . $table . \"` WRITE;\\n\" );\n\t\t\t\n\t\t\tif ( false !== $myisam )\n\t\t\t\t\n\t\t\t\tfwrite( $handle, \"/*!40000 ALTER TABLE `\".$table.\"` DISABLE KEYS */;\\n\\n\" );\n\n\t\t\t$offset = 0;\n\t\t\t\n\t\t\tdo {\n\t\t\t\tforeach ( $data as $entry ) {\n\t\t\t\t\tforeach ( $entry as $key => $value ) {\n\t\t\t\t\t\tif ( NULL === $value )\n\t\t\t\t\t\t\t$entry[$key] = \"NULL\";\n\t\t\t\t\t\telseif ( \"\" === $value || false === $value )\n\t\t\t\t\t\t\t$entry[$key] = \"''\";\n\t\t\t\t\t\telseif ( !is_numeric( $value ) )\n\t\t\t\t\t\t\t$entry[$key] = \"'\" . esc_sql($value) . \"'\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite( $handle, \"INSERT INTO `\" . $table . \"` ( \" . implode( \", \", array_keys( $entry ) ) . \" )\\n VALUES ( \" . implode( \", \", $entry ) . \" );\\n\" );\n\t\t\t\t}\n\n\t\t\t\t$offset += 1000;\n\t\t\t\t$data = $wpdb->get_results(\"SELECT * FROM `\" . $table . \"` LIMIT \" . $offset . \",1000\", ARRAY_A );\n\t\t\t\n\t\t\t} while ( !empty( $data ) );\n\n\t\t\tfwrite( $handle, \"\\n--\\n-- END Table \" . $table . \"\\n--\\n\" );\n\t\t\t\n\t\tif ( false !== $myisam )\n\t\t\tfwrite( $handle, \"\\n/*!40000 ALTER TABLE `\" . $table . \"` ENABLE KEYS */;\" );\n\t\t\tfwrite( $handle, \"\\nUNLOCK TABLES;\\n\\n\" );\n\t\t}\n\t}\n\n\tfwrite( $handle, \"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\\n\" );\n\tfwrite( $handle, \"/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\\n\" );\n\tfwrite( $handle, \"/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\\n\" );\n\tfwrite( $handle, \"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\\n\" );\n\n\tfclose( $handle );\n\t\n\tif ( file_exists($db_backup) ) {\n\t\n\t$DBBoptions = get_option('bulletproof_security_options_db_backup'); \n\t//$db_backup = $DBBoptions['bps_db_backup_folder'] . '/' . DB_NAME . '.sql';\n\n\t// Use ZipArchive\n\tif ( class_exists('ZipArchive') ) {\n\n\t$zip = new ZipArchive();\n\t$filename = $DBBoptions['bps_db_backup_folder'] . '/' . date( 'Y-m-d-\\t\\i\\m\\e-g-i-s-a', $timeNow + $gmt_offset ) . '.zip';\n\t\n\tif ( $zip->open( $filename, ZIPARCHIVE::CREATE )!==TRUE ) {\n \texit(\"Error: Cannot Open $filename\\n\");\n\t}\n\n\t$zip->addFile( $db_backup, DB_NAME . \".sql\" );\n\t$zip->close();\n\t\n\t@unlink($db_backup);\n\t\n\t} else {\n\n\t// Use PCLZip\n\tdefine( 'PCLZIP_TEMPORARY_DIR', $DBBoptions['bps_db_backup_folder'] . '/' );\n\trequire_once( ABSPATH . 'wp-admin/includes/class-pclzip.php');\n\t\n\tif ( ini_get( 'mbstring.func_overload' ) && function_exists( 'mb_internal_encoding' ) ) {\n\t\t$previous_encoding = mb_internal_encoding();\n\t\tmb_internal_encoding( 'ISO-8859-1' );\n\t}\n \t\t$filename = $DBBoptions['bps_db_backup_folder'] . '/' . date( 'Y-m-d-\\t\\i\\m\\e-g-i-s-a', $timeNow + $gmt_offset ) . '.zip';\n \t\t$archive = new PclZip( $filename );\n\t\t$sql_filename = str_replace( $DBBoptions['bps_db_backup_folder'] . '/', \"\", $db_backup );\n\t\t$db_backup = str_replace( array( '\\\\', '//'), \"/\", $db_backup );\n\t\t$db_backup_folder = str_replace( DB_NAME . '.sql', \"\", $db_backup );\n\t\t$v_list = $archive->create( $db_backup_folder . $sql_filename, PCLZIP_OPT_REMOVE_PATH, $db_backup_folder );\n\t\t\n\t\t@unlink($db_backup);\n\t}\n\t}\n\t\n\t$time_end = microtime( true );\n\t\n\t$backup_time = $time_end - $time_start;\n\t$backup_time_log = 'Backup Job Completion Time: '. round( $backup_time, 2 ) . ' Seconds';\n\t$backup_time_display = '<strong>Backup Job Completion Time: </strong>'. round( $backup_time, 2 ) . ' Seconds';\n\t$bpsDBBLog = WP_CONTENT_DIR . '/bps-backup/logs/db_backup_log.txt';\n\t\n\techo '<div id=\"message\" class=\"updated\" style=\"border:1px solid #999999;margin-left:220px;background-color:#ffffe0;\"><p>';\n\techo bpsPro_memory_resource_usage();\n\techo $backup_time_display;\n\techo '</p></div>';\n\n\t$log_contents = \"\\r\\n\" . '[Backup Job Logged: ' . $timestamp . ']' . \"\\r\\n\" . 'Backup Job Name: ' . $job_name . \"\\r\\n\" . 'Backup Job Type: ' . $job_type . \"\\r\\n\" . 'Email DB Backup: ' . $email_zip_log . \"\\r\\n\" . $backup_time_log . \"\\r\\n\" . bpsPro_memory_resource_usage_logging() . \"\\r\\n\" . 'Zip Backup File Name: ' . $filename . \"\\r\\n\";\n\t\t\t\t\t\n\tif ( is_writable( $bpsDBBLog ) ) {\n\tif ( ! $handle = fopen( $bpsDBBLog, 'a' ) ) {\n \texit;\n }\n if ( fwrite( $handle, $log_contents ) === FALSE ) {\n \texit;\n }\n fclose($handle);\n\t}\t\n\t\t\n\t$DBBLog_Options = array( 'bps_dbb_log_date_mod' => bpsPro_DBB_LogLastMod_wp_secs() );\n\t\n\tforeach( $DBBLog_Options as $key => $value ) {\n\t\tupdate_option('bulletproof_security_options_DBB_log', $DBBLog_Options);\n\t}\n\n\t$DBB_Backup_Options = array( \n\t'bps_db_backup' \t\t\t\t\t\t=> $DBBoptions['bps_db_backup'], \n\t'bps_db_backup_description' \t\t\t=> $DBBoptions['bps_db_backup_description'], \n\t'bps_db_backup_folder' \t\t\t\t\t=> $DBBoptions['bps_db_backup_folder'], \n\t'bps_db_backup_download_link' \t\t\t=> $DBBoptions['bps_db_backup_download_link'], \n\t'bps_db_backup_job_type' \t\t\t\t=> $DBBoptions['bps_db_backup_job_type'], \n\t'bps_db_backup_frequency' \t\t\t\t=> $DBBoptions['bps_db_backup_frequency'], \t\t \n\t'bps_db_backup_start_time_hour' \t\t=> $DBBoptions['bps_db_backup_start_time_hour'], \n\t'bps_db_backup_start_time_weekday' \t\t=> $DBBoptions['bps_db_backup_start_time_weekday'], \n\t'bps_db_backup_start_time_month_date' \t=> $DBBoptions['bps_db_backup_start_time_month_date'], \n\t'bps_db_backup_email_zip' \t\t\t\t=> $DBBoptions['bps_db_backup_email_zip'], \n\t'bps_db_backup_delete' \t\t\t\t\t=> $DBBoptions['bps_db_backup_delete'], \n\t'bps_db_backup_status_display' \t\t\t=> $timestamp\n\t);\n\t\n\t\tforeach( $DBB_Backup_Options as $key => $value ) {\n\t\t\tupdate_option('bulletproof_security_options_db_backup', $DBB_Backup_Options);\n\t\t}\n\t\n\t// Send Email last: attaching a large zip file may fail\n\tif ( $job_type != 'Manual' || $email_zip != 'No' ) {\n\n\t\t$Email_options = get_option('bulletproof_security_options_email');\n\t\t$bps_email_to = $Email_options['bps_send_email_to'];\n\t\t$bps_email_from = $Email_options['bps_send_email_from'];\n\t\t$bps_email_cc = $Email_options['bps_send_email_cc'];\n\t\t$bps_email_bcc = $Email_options['bps_send_email_bcc'];\n\t\t$justUrl = get_site_url();\n\t\n\tif ( $email_zip == 'EmailOnly' ) {\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\t\t$headers .= \"From: $bps_email_from\" . \"\\r\\n\";\n\t\t$headers .= \"Cc: $bps_email_cc\" . \"\\r\\n\";\n\t\t$headers .= \"Bcc: $bps_email_bcc\" . \"\\r\\n\";\t\n\t\t$subject = \" BPS Pro DB Backup Completed - $timestamp \";\n\t\t$message = '<p><font color=\"blue\"><strong>DB Backup Has Completed For:</strong></font></p>';\n\t\t$message .= '<p>Website: '.$justUrl.'</p>';\n\t\n\t$mailed = wp_mail( $bps_email_to, $subject, $message, $headers );\t\n\t}\n\n\tif ( $email_zip == 'Delete' || $email_zip == 'Yes' ) {\n\t\t$attachments = array( $filename );\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\t\t$headers .= \"From: $bps_email_from\" . \"\\r\\n\";\n\t\t$headers .= \"Cc: $bps_email_cc\" . \"\\r\\n\";\n\t\t$headers .= \"Bcc: $bps_email_bcc\" . \"\\r\\n\";\t\n\t\t$subject = \" BPS Pro DB Backup Completed - $timestamp \";\n\t\t$message = '<p><font color=\"blue\"><strong>DB Backup File is Attached For:</strong></font></p>';\n\t\t$message .= '<p>Website: '.$justUrl.'</p>';\n\t\n\t$mailed = wp_mail( $bps_email_to, $subject, $message, $headers, $attachments );\t\n\t}\n\n\t\tif ( @$mailed && $email_zip == 'Delete' ) {\n\t\t\tunlink($filename);\n\t\t}\n\t}\n}", "function needBackup();", "function erp_hr_leave_insert_policy( $args = array() ) {\n if ( ! current_user_can( 'erp_leave_manage' ) ) {\n return new WP_Error( 'no-permission', esc_html__( 'You do not have sufficient permissions to do this action', 'erp' ) );\n }\n\n $defaults = array(\n 'id' => null\n );\n\n $args = wp_parse_args( $args, $defaults );\n\n $common = array(\n 'leave_id' => $args['leave_id'],\n 'department_id' => $args['department_id'],\n 'designation_id' => $args['designation_id'],\n 'location_id' => $args['location_id'],\n 'gender' => $args['gender'],\n 'marital' => $args['marital'],\n 'f_year' => $args['f_year']\n );\n\n $extra = apply_filters( 'erp_hr_leave_insert_policy_extra', array(\n 'description' => $args['description'],\n 'days' => $args['days'],\n 'color' => $args['color'],\n 'applicable_from_days' => $args['applicable_from'],\n 'apply_for_new_users' => $args['apply_for_new_users']\n ) );\n\n /**\n * Update\n */\n if ( $args['id'] ) {\n $where = array();\n\n foreach ( $common as $key => $value ) {\n $where[] = array( $key, $value );\n }\n\n $exists = Leave_Policy::where( $where )->where('id', '<>', $args['id'])->first();\n\n if ( $exists ) {\n return new WP_Error( 'exists', esc_html__( 'Policy already exists.', 'erp' ) );\n }\n\n // won't update days\n unset( $extra['days'] );\n\n $leave_policy = Leave_Policy::find( $args['id'] );\n $leave_policy->update( $extra );\n\n do_action( 'erp_hr_leave_update_policy', $args['id'] );\n\n return $leave_policy->id;\n }\n\n /**\n * Create\n */\n $leave_policy = Leave_Policy::firstOrCreate( $common, $extra );\n\n if ( ! $leave_policy->wasRecentlyCreated ) {\n return new WP_Error( 'exists', esc_html__( 'Policy already exists.', 'erp' ) );\n }\n\n // create policy segregation\n $segre = isset( $_POST['segre'] ) ? array_map( 'absint', wp_unslash( $_POST['segre'] ) ) : [];\n\n $segre['leave_policy_id'] = $leave_policy->id;\n\n Leave_Policies_Segregation::create($segre);\n\n do_action( 'erp_hr_leave_insert_policy', $leave_policy->id );\n\n return $leave_policy->id;\n}", "public function createAssetDeliveryPolicy($assetDeliveryPolicy);", "function backup_webquest_files($bf,$preferences) {\r\n\r\n global $CFG;\r\n\r\n $status = true;\r\n\r\n //First we check to moddata exists and create it as necessary\r\n //in temp/backup/$backup_code dir\r\n $status = check_and_create_moddata_dir($preferences->backup_unique_code);\r\n //Now copy the webquest dir\r\n if ($status) {\r\n if (is_dir($CFG->dataroot.\"/\".$preferences->backup_course.\"/\".$CFG->moddata.\"/webquest\")) {\r\n $status = backup_copy_file($CFG->dataroot.\"/\".$preferences->backup_course.\"/\".$CFG->moddata.\"/webquest/\",\r\n $CFG->dataroot.\"/temp/backup/\".$preferences->backup_unique_code.\"/moddata/webquest/\");\r\n }\r\n }\r\n\r\n return $status;\r\n\r\n}", "public function testUpdateOrganizationBrandingPolicy()\n {\n }", "public function create($policy, $mta, $premium, $quote, $ipt, $nilExcessOption);", "public function create_backup() {\n\t\t$this->verify_nonce( 'rank-math-ajax-nonce' );\n\t\t$this->has_cap_ajax( 'general' );\n\n\t\t$key = $this->run_backup();\n\t\tif ( is_null( $key ) ) {\n\t\t\t$this->error( esc_html__( 'Unable to create backup this time.', 'rank-math' ) );\n\t\t}\n\n\t\t$this->success(\n\t\t\t[\n\t\t\t\t'key' => $key,\n\t\t\t\t/* translators: Backup formatted date */\n\t\t\t\t'backup' => sprintf( esc_html__( 'Backup: %s', 'rank-math' ), date_i18n( 'M jS Y, H:i a', $key ) ),\n\t\t\t\t'message' => esc_html__( 'Backup created successfully.', 'rank-math' ),\n\t\t\t]\n\t\t);\n\t}", "public function createJobProcess(){\n $job = new SuggestedJobs();\n $job->set(self::COL2, $_POST[self::COL2]);\n\t$job->set(self::COL4, $_POST[self::COL4]);\n $job->set(self::COL5, $_POST[self::COL5]);\n\t$job->set(self::COL3, $_POST[self::COL3]);\n\t$job->set(self::COL7, $_POST[self::COL7]);\n \n $job->save();\n header(\"LOCATION: \".BASE_URL.\"/jobs\");\n }", "public function createBackupTask() {\n $this->type = \"backup\";\n return $this->createTask();\n }", "function cronBackup()\n\t{\n\t\t// Set Full Dump Path.\n\t\tif ($this->COMBINE)\n\t\t{\n\t\t\t// No folder if combined\n\t\t\t$this->FULL_PATH = $this->DUMP_PATH.$this->PREFIX.$this->DATE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add folder for multiple files.\n\t\t\t$this->SHORT_PATH = $this->DUMP_PATH.$this->DATE;\n\t\t\t$this->FULL_PATH = $this->SHORT_PATH.'/'.$this->PREFIX.$this->DATE;\n\n\t\t\t// Remove previous files.\n\t\t\t$this->removeDir($this->SHORT_PATH);\n\n\t\t\t// Recreate folder.\n\t\t\t$this->createDir($this->SHORT_PATH);\n\t\t}\n\n\t\t// Clear Cache \n\t\tclearstatcache();\n\n\t\t// Repair & Optimize.\n\t\tif ($this->REPAIR)\n\t\t{\n\t\t\t$this->repairTables();\n\t\t}\n\n\t\t// Start Initial Dump.\n\t\t$this->phpDump();\n\t}", "public function create() {\n\t\t$backupTime = time();\n\t\t$options = $this->getOptions();\n\n\t\tupdate_option( $this->optionsName . '_' . $backupTime, wp_json_encode( $options ) );\n\n\t\t$backups = $this->all();\n\n\t\t$backups[] = $backupTime;\n\n\t\tupdate_option( $this->optionsName, wp_json_encode( $backups ) );\n\t}", "public function createAssetDeliveryPolicy(AssetDeliveryPolicy $assetDeliveryPolicy);", "public function prepareProfileRequest(xxx_Job $job)\n {\n // For convenience.\n $policyId = $job->getDataItem($this->_wfconf->dataitem->policyId);\n $jobId = $this->getId();\n $diSet = $this->_wfconf->dataitem;\n \n // Fetch the cached policy (or get a fresh one).\n $uri = $this->_getPolicyUri($policyId);\n $doc = $this->_getDocument($uri);\n\n // Create a simpleXML object or exit this step.\n try\n {\n $xmlObj = new SimpleXMLElement($doc);\n }\n catch(Exception $e)\n {\n $this->_log->err(sprintf('Unable to load quote XML (%s) for job \"%s\"', $policyId, $jobId)); \n return FALSE;\n } \n\n // Execute all the Xpath ...\n $resultSet = $xmlObj->xpath(self::XPATH_POLICY_ID);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_POLICY_ID, $policyId, $jobId);\n return FALSE; \n }\n $job->setDataItem($diSet->actualPolicyId, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_STREET_NUMBER);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_STREET_NUMBER, $policyId, $jobId);\n return FALSE; \n }\n $job->setDataItem($diSet->propertyStreetNumber, (string) $resultSet[0]['value']);\n\n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_STREET_NAME);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_STREET_NAME, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->propertyStreetName, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_STREET_LINE_2);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_STREET_LINE_2, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->propertyStreetLine2, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_CITY);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_CITY, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->propertyCity, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_STATE);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_STATE, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->propertyState, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_PROPERTY_ZIP);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_PROPERTY_ZIP, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->propertyZip, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_COVERAGE_A);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_COVERAGE_A, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->coverageA, (string) $resultSet[0]['value']); \n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_ADDRESS_1);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_ADDRESS_1, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredAddress1, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_ADDRESS_2);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_ADDRESS_2, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredAddress2, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_CITY);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_CITY, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredCity, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_STATE);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_STATE, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredState, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_ZIP);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_ZIP, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredZip, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_PHONE);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_PHONE, $policyId, $jobId);\n return FALSE;\n }\n $resultSet[0]['value'] = str_replace('-', '', $resultSet[0]['value']);\n $job->setDataItem($diSet->insuredPhone, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_FIRST);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_FIRST, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredFirst, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_MIDDLE);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_MIDDLE, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredMiddle, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_INSURED_LAST);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_INSURED_LAST, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->insuredLast, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_EFFECTIVE_DATE); \n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_EFFECTIVE_DATE, $policyId, $jobId);\n return FALSE;\n }\n $tmpSet = explode('/', $resultSet[0]['value']);\n $tmpDate = $tmpSet[2] . '-' . $tmpSet[0] . '-' . $tmpSet[1];\n $job->setDataItem($diSet->effectiveDate, $tmpDate);\n \n $resultSet = $xmlObj->xpath(self::XPATH_AGENT_PHONE);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_AGENT_PHONE, $policyId, $jobId);\n return FALSE;\n }\n $resultSet[0]['value'] = str_replace('-', '', $resultSet[0]['value']); \n $job->setDataItem($diSet->agentPhone, (string) $resultSet[0]['value']);\n \n $resultSet = $xmlObj->xpath(self::XPATH_AGENT_ID);\n if (!isset($resultSet[0][0]))\n {\n $this->logXpathError(self::XPATH_AGENT_ID, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->agentId, (string) $resultSet[0][0]);\n \n $resultSet = $xmlObj->xpath(self::XPATH_AGENT_NAME);\n if (!isset($resultSet[0]['value']))\n {\n $this->logXpathError(self::XPATH_AGENT_NAME, $policyId, $jobId);\n return FALSE;\n }\n $job->setDataItem($diSet->agentName, (string) $resultSet[0]['value']); \n \n // Build the xxx ProfileRequest (heh sorry)\n // Note, OrderInspectionAccountNumber comes from ixConfig.\n // [REDACTED]\n\n $job->setDataItem($diSet->xxxPayload, $xml);\n return TRUE;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calcArea calculates the area of circle
public function calcArea() { return $this -> radius * $this -> radius * pi(); }
[ "public function calcArea();", "public function calcArea()\n {\n return $this -> radius * $this -> radius * pi();\n }", "public function calcArea()\n {\n return $this -> radius * $this -> radius * pi();\n }", "public function calcArea() {\n return $this->radius * $this->radius * pi();\n }", "public function calculateArea(){}", "function areaofcircle($radius){\n $pie = 3.412;\n $area =$pie *$radius *$radius;\n\n return $area;\n}", "public function calcArea()\n {\n return $this -> width * $this -> height;\n }", "public function calcArea()\n {\n return $this -> width * $this -> height;\n }", "public function calcArea()\r\n {\r\n return $this -> width * $this -> height;\r\n }", "function areaofacircle($radius){\r\n$pie = 3.142;\r\n $area = $pie * $radius * $radius;\r\n return $area;\r\n}", "public function calculate_area () {\n $area = $this -> width * $this->height;\n return $area;\n }", "function area_of_circle($radius)\n{\n $radius *= $radius;\n $area = pi() * $radius;\n return $area;\n}", "function calculateArea(Shape $shape){\n return $shape->getArea();\n}", "function _area_of_circle($radius, $options = null)\n {\n if(is_numeric($radius)){\n $pi = 22/7;\n $area = $pi * ($radius*$radius);\n if(!is_null($options)){\n $area = $this->_a_math_options($area, $options);\n }\n return $area;\n }else{\n $this->_a_throwExceptionOrString('Radius needs to be a numeric value');\n }\n }", "final public function area(): float\n {\n return ($this->sideAB * $this->sideBC) / 2;\n }", "function getArea()\n {\n // SQRT ( z * (z - side1) * (z - side2) * (z - side3))\n // WHERE z = (side1 + side2 + side3) / 2\n $z = $this->getPerimeter()/2;\n return sqrt($z*($z-$this->side1)*($z-$this->side2)*($z-$this->side3));\n }", "public function getArea(): float\n {\n $area = 0;\n\n if ($this->getNumberOfPoints() <= 2) {\n return $area;\n }\n\n $referencePoint = $this->points[0];\n $radius = $referencePoint->getEllipsoid()->getArithmeticMeanRadius();\n $segments = $this->getSegments();\n\n foreach ($segments as $segment) {\n $point1 = $segment->getPoint1();\n $point2 = $segment->getPoint2();\n\n $x1 = deg2rad($point1->getLng() - $referencePoint->getLng()) * cos(deg2rad($point1->getLat()));\n $y1 = deg2rad($point1->getLat() - $referencePoint->getLat());\n\n $x2 = deg2rad($point2->getLng() - $referencePoint->getLng()) * cos(deg2rad($point2->getLat()));\n $y2 = deg2rad($point2->getLat() - $referencePoint->getLat());\n\n $area += ($x2 * $y1 - $x1 * $y2);\n }\n\n $area *= 0.5 * $radius ** 2;\n\n return abs($area);\n }", "protected function _Area()\n\t{\n\t\t//\n\t\t// Get geometry.\n\t\t//\n\t\t$geom = $this->_Geometry();\n\t\tif( is_array( $geom ) )\n\t\t{\n\t\t\t//\n\t\t\t// Handle Rect.\n\t\t\t//\n\t\t\tif( $geom[ 'type' ] == kAPI_GEOMETRY_TYPE_RECT )\n\t\t\t\treturn abs( $geom[ 'coordinates' ][ 1 ][ 0 ]\n\t\t\t\t\t\t - $geom[ 'coordinates' ][ 0 ][ 0 ] )\n\t\t\t\t\t * abs( $geom[ 'coordinates' ][ 1 ][ 1 ]\n\t\t\t\t\t \t - $geom[ 'coordinates' ][ 0 ][ 1 ] );\t\t\t\t\t\t// ==>\n\t\t\n\t\t\t//\n\t\t\t// Handle polygons.\n\t\t\t//\n\t\t\tif( $geom[ 'type' ] == kAPI_GEOMETRY_TYPE_POLY )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Calculate area.\n\t\t\t\t//\n\t\t\t\t$total = NULL;\n\t\t\t\tforeach( $geom[ 'coordinates' ] as $ring )\n\t\t\t\t{\n\t\t\t\t\t//\n\t\t\t\t\t// Calculate ring area.\n\t\t\t\t\t//\n\t\t\t\t\tfor( $x = $y = $i = 0;\n\t\t\t\t\t\t $i < (count( $ring ) - 2);\n\t\t\t\t\t\t $i++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t$x += ($ring[ $i ][ 0 ] * $ring[ $i + 1 ][ 1 ]);\n\t\t\t\t\t\t$y += ($ring[ $i ][ 1 ] * $ring[ $i + 1 ][ 0 ]);\n\t\t\t\t\n\t\t\t\t\t} $area = ($x - $y) / 2;\n\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t// Set outer ring area.\n\t\t\t\t\t//\n\t\t\t\t\tif( $total === NULL )\n\t\t\t\t\t\t$total = $area;\n\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t// Handle inner ring area.\n\t\t\t\t\t//\n\t\t\t\t\telse\n\t\t\t\t\t\t$total -= $area;\n\t\t\t\t\n\t\t\t\t} // Iterating rings.\n\t\t\t\t\n\t\t\t\treturn $total;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t\n\t\t\t} // Polygon.\n\t\t\n\t\t} // Has geometry.\n\t\t\n\t\treturn NULL;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}", "function area_unit($radius, $cm = true)\n {\n $pie = 3.142;\n $area = $pie * $radius * $radius;\n if ($cm) {\n// area in cm\n echo \"Area is $area cm\";\n } else {\n// area in m\n echo \"Area is $area m\";\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns Simple Progress Report for BGB Goals data
public function getProgressReportSimpleBGB($esy = 'N', $vourefid = null) { if (!isset($this->progressReportSimpleBGB)) { if (!$vourefid) { $vourefid = $this->get('vourefid'); } $this->progressReportSimpleBGB = array(); $goals = $this->getBgbGoals($esy); $periods = IDEADistrict::factory(SystemCore::$VndRefID)->getMarkingPeriodsSimple($esy); $extents = IDEADistrict::factory(SystemCore::$VndRefID)->getProgressExtents(true); $options = json_decode(IDEAFormat::getIniOptions('bgb'), true); $extents_keyed = array(); foreach ($extents as $extent) { /** @var IDEADistrictProgressExtent $extent */ $extents_keyed[$extent->get(IDEADistrictProgressExtent::F_REFID)] = $extent->get(IDEADistrictProgressExtent::F_CODE); } foreach ($goals as $goal) { //Goal Line $line = array(); $line['grefid'] = $goal['grefid']; $line['brefid'] = ''; $line['goal'] = 'Goal ' . $goal['g_num'] . '. ' . $goal['gsentance']; $line['objective'] = ''; $progress = $this->db->execute(" SELECT spr_period_data FROM webset.std_progress_reporting WHERE sbg_grefid = " . $goal['grefid'] . " ")->getOne(); $spr_refid = $this->db->execute(" SELECT spr_refid FROM webset.std_progress_reporting WHERE sbg_grefid = " . $goal['grefid'] . " ")->getOne(); $line['id'] = $spr_refid; $line['period_data'] = $progress; if ($progress) $progress = json_decode($progress, true); foreach ($periods as $period) { $column = array(); $column['bm'] = $period['smp_period']; $column['smp_refid'] = $period['smp_refid']; $column['value'] = ''; $column['narrative'] = ''; $column['bmbgdt'] = ''; $column['bmendt'] = ''; $column['dsydesc'] = ''; if (isset($progress[$period['smp_refid']])) { $column['value'] = $extents_keyed[$progress[$period['smp_refid']]['extentProgress']]; $column['narrative'] = $progress[$period['smp_refid']]['narrative']; } $line['periods'][] = $column; } $this->progressReportSimpleBGB[] = $line; //Attached Objectives Lines foreach ($goal['objectives'] as $objective) { $line = array(); $line['goal'] = ''; $line['grefid'] = ''; $line['brefid'] = $objective['orefid']; $line['objective'] = $options['benchmark'] . ' ' . $objective['b_num_goal'] . '. ' . $objective['bsentance']; $progress = $this->db->execute(" SELECT spr_period_data FROM webset.std_progress_reporting WHERE sbb_brefid = " . $objective['orefid'] . " ")->getOne(); $spr_refid = $this->db->execute(" SELECT spr_refid FROM webset.std_progress_reporting WHERE sbb_brefid = " . $objective['orefid'] . " ")->getOne(); $line['id'] = $spr_refid; $line['period_data'] = $progress; if ($progress) $progress = json_decode($progress, true); foreach ($periods as $period) { $column = array(); $column['bm'] = $period['smp_period']; $column['value'] = ''; $column['narrative'] = ''; $column['bmbgdt'] = ''; $column['bmendt'] = ''; $column['dsydesc'] = ''; if (isset($progress[$period['smp_refid']])) { $column['value'] = $extents_keyed[$progress[$period['smp_refid']]['extentProgress']]; $column['narrative'] = $progress[$period['smp_refid']]['narrative']; } $line['periods'][] = $column; } $this->progressReportSimpleBGB[] = $line; } } } return $this->progressReportSimpleBGB; }
[ "public function renderGoals() {\n\t\t\t$layout = RCLayout::factory();\n\t\t\t$goals = $this->std->getBgbGoals();\n\t\t\t$reports = $this->std->getProgressReportIEP();\n\t\t\t$measures = $this->std->getBgbGoalsMeasures();\n\n\t\t\tforeach ($goals as $goal) {\n\t\t\t\t$goalRefID = $goal['grefid'];\n\t\t\t\t$reportsGoal = $reports[$goalRefID];\n\t\t\t\t$measureGoal = $measures[$goalRefID];\n\t\t\t\t$allMeasurs = count($measureGoal);\n\t\t\t\t$benckmarks = '<b>Measurable Benchmarks/Objectives:</b>';\n\t\t\t\t$annualGoal = '';\n\t\t\t\t$selectDomain = explode(',', $goal['mo_domains']);\n\t\t\t\t$domains = IDEADef::getValidValues('MO_BGB_Domains');\n\t\t\t\t$domainsBoxes = RCLayout::factory()\n\t\t\t\t\t->addText('For students with Post-secondary Transition Plans, please indicate which goal domain(s) this annual goal will support:')\n\t\t\t\t\t->newLine();\n\t\t\t\t# create layout for domains with checkboxes\n\t\t\t\tforeach ($domains as $domain) {\n\t\t\t\t\t/** @var IDEADefValidValue $domain */\n\t\t\t\t\t$domainsBoxes->addObject(\n\t\t\t\t\t\tRCLayout::factory()\n\t\t\t\t\t\t\t->addObject(\n\t\t\t\t\t\t\t\t$this->addCheck(\n\t\t\t\t\t\t\t\t\tin_array($domain->get(IDEADefValidValue::F_VALUE_ID), $selectDomain) ? 'Y' : 'N'\n\t\t\t\t\t\t\t\t), '.width20'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t->addText($domain->get(IDEADefValidValue::F_VALUE), '.padtop5')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t# row with benchmarks/objectives\n\t\t\t\tforeach ($goal['objectives'] as $objective) {\n\t\t\t\t\t$benckmarks .= PHP_EOL . '<i>' . $objective['bsentance'] . '</i>';\n\t\t\t\t\t$annualGoal = $goal['bl_num'] . '.' . $goal['g_num'];\n\t\t\t\t}\n\n\t\t\t\t$tbl = RCTable::factory('.table')\n\t\t\t\t\t->addCell(\n\t\t\t\t\t\t'3. IEP Goal(s) with Objectives/Benchmarks and Reporting Form' . PHP_EOL . 'Annual Measurable Goals',\n\t\t\t\t\t\t'.hr',\n\t\t\t\t\t\t4\n\t\t\t\t\t)\n\t\t\t\t\t->addRow('.row')\n\t\t\t\t\t->addCell(\n\t\t\t\t\t\t'<b>Baseline: ' . $goal['baseline'] . PHP_EOL . 'Annual Goal #: ' . $annualGoal . '</b>' . PHP_EOL . '<i>' . $goal['gsentance'] . '</i>' . $benckmarks,\n\t\t\t\t\t\t'.cellBorder',\n\t\t\t\t\t\t4\n\t\t\t\t\t)\n\t\t\t\t\t->addRow('.row')\n\t\t\t\t\t->addCell(\n\t\t\t\t\t\t$domainsBoxes->newLine()\n\t\t\t\t\t\t\t->addText('Progress toward the goal will be measured by: <b>(check all that apply)</b>'),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t4\n\t\t\t\t\t);\n\t\t\t\t# Progress toward the goal will be measured\n\t\t\t\tfor ($i = 0; $i < $allMeasurs; $i++) {\n\t\t\t\t\tif ($i % 4 == 0 || $i == 0) $tbl->addRow('.row');\n\n\t\t\t\t\t$tbl->addCell(\n\t\t\t\t\t\tRCLayout::factory()\n\t\t\t\t\t\t\t->addObject($this->addCheck($measureGoal[$i]['value']), '.width20')\n\t\t\t\t\t\t\t->addText($measureGoal[$i]['name'], '.padtop5')\n\t\t\t\t\t\t,\n\t\t\t\t\t\t'.cellBorder'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t# table with periods\n\t\t\t\t$allPeriods = count($reportsGoal);\n\t\t\t\t$progReportTbl = RCTable::factory('.table')\n\t\t\t\t\t->addCell('Periodic Progress Report', '.hr')\n\t\t\t\t\t->addCell('Progress Toward the Goal', '.next-hr', $allPeriods - 1);\n\n\t\t\t\tforeach ($reportsGoal as $row) {\n\t\t\t\t\t$allCell = count($row);\n\t\t\t\t\t$progReportTbl->addRow('.row');\n\t\t\t\t\tfor ($i = 0; $i < $allCell; $i++) {\n\t\t\t\t\t\t$check = '';\n\t\t\t\t\t\t# if first item add lable else add checkbox\n\t\t\t\t\t\tif ($i === 0) $check = $row[$i];\n\t\t\t\t\t\tif ($i > 0 && $row[$i] == 'Y') $check = $this->addCheck('Y');\n\n\t\t\t\t\t\t$progReportTbl->addCell(\n\t\t\t\t\t\t\t$check,\n\t\t\t\t\t\t\t# styles for first and default cells\n\t\t\t\t\t\t\t$i == 0 ? 'left [font-weight: normal;]' : 'center [border-left: 1px solid black; font-weight: normal;]');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$progReportTbl->addRow('.row')\n\t\t\t\t\t->addCell('<b>Comments:</b> <i>' . $goal['mo_comments'] . '</i>', 'left', $allPeriods);\n\n\t\t\t\t$layout->newLine()\n\t\t\t\t\t->addObject($tbl)\n\t\t\t\t\t->newLine()\n\t\t\t\t\t->addObject($progReportTbl);\n\t\t\t}\n\n\t\t\t$this->rcDoc->addObject($layout);\n\t\t}", "function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}", "public function getProgress();", "function report() {\n\n\t\tif( '100%' == get_option( 'g2p_build_progress' ) && ! get_option( 'g2p_building_manifest' ) ) {\n\t\t\techo \"complete\";\n\t\t} else {\n\t\t\techo get_option( 'g2p_build_progress' );\n\t\t}\n\n\t\tdie;\n\n\t}", "public function skipAcl_updateBillingStats(){\n\t\t$postObj = json_decode(file_get_contents(\"php://input\"),true);\n\t\t$dateFrom = date(\"Y-m-d\", strtotime($postObj[\"startDate\"]));\n\t\t$dateto = date(\"Y-m-d\", strtotime($postObj[\"endDate\"]));\n\t\t$pieChart = $forDate = array();\n\t\t$goalFilterForDate = array(\"startDate\"=>$postObj[\"startDate\"], \"endDate\"=> $postObj[\"endDate\"]);\n\t\t$goalValuesForDate = $this->getMonthDays($postObj[\"startDate\"] ,$postObj[\"endDate\"]);\n\t\t$dispatchersList = $this->Report->getDispatchersListForGoals();\n\t\t$forDate[\"goal\"] = $this->getPerformanceLoadsForAllDispatchers($dispatchersList, $goalFilterForDate, $goalValuesForDate);\n\t\t$jobStatusStats = $this->Job->fetchLoadsSummary(null, $postObj, \"all\");\n\t\t$forDate[\"sentToTriumph\"] = $this->Billing->sentForPaymentWithFilter( $postObj[\"startDate\"] ,$postObj[\"endDate\"] );\n\t\t$forDate[\"sentToTriumph\"] = is_null($forDate[\"sentToTriumph\"]) ? 0 : $forDate[\"sentToTriumph\"];\n\t\tif($forDate[\"goal\"] > 0 ){\n\t\t\t$forDate[\"goalCompleted\"] = ( $forDate[\"sentToTriumph\"] / $forDate[\"goal\"] ) * 100;\t\n\t\t}else{\n\t\t\t$forDate[\"goalCompleted\"] = 0;\n\t\t}\n\t\t\n\t\t$pieChart[\"waitingPaperwork\"] = (int)$this->Job->getWaitingPaperworkCount($postObj,\"all\");\n\t\t$pieChart[\"inprogress\"] = $pieChart[\"booked\"] = $pieChart[\"delivered\"] = $pieChart[\"hasValue\"] = 0;\n\t\tif(isset($jobStatusStats[0])){\n\t\t\tforeach ($jobStatusStats as $key => $value) {\n\t\t\t\tif(empty(trim($value['JobStatus'])) )\n\t\t\t\t\tcontinue;\n\t\t\t\t$pieChart[$value['JobStatus']] = (int)$value['tnum'];\n\t\t\t\t$pieChart[\"hasValue\"] = 1;\n\t\t\t}\n\t\t}\n\n\t\t$recentTransactions = $this->getRecentTransactions($postObj );\n\t\t\n\n\n\t\techo json_encode(array( \"lastWeek\"=> $forDate, \"recentTransactions\" => $recentTransactions, \"pieChart\" => $pieChart ));\n\t}", "public function billingStats(){\n\t\t\n\t\t$exportFlag = json_decode(file_get_contents('php://input'), true);\n\t\t\n\t\t$lastWeekStartDay = date(\"Y-m-d\", strtotime('monday last week'));\n\t\t$lastWeekEndDay = date(\"Y-m-d\", strtotime('sunday last week'));\n\t\t$thisWeekStartDay = date(\"Y-m-d\", strtotime('monday this week'));\n\t\t$thisWeekLastDay = date(\"Y-m-d\", strtotime('sunday this week'));\n\t\t$thisWeekToday = date(\"Y-m-d\");\n\t\t$yesterday = date(\"Y-m-d\", strtotime(\"yesterday\"));\n\t\t$pieChart = $lastWeek = $thisWeek = $filters = array();\n\t\tif(isset($_COOKIE[\"_gDateRangeBillDash\"])){\n\t\t\t$filters = json_decode($_COOKIE[\"_gDateRangeBillDash\"],true);\n\t\t\tif(!empty($filters[\"startDate\"])){\n\t\t\t\t$lastWeekStartDay = $filters[\"startDate\"];\n\t\t\t\t$lastWeekEndDay = $filters[\"endDate\"];\t\n\t\t\t}\n\t\t}\n\t\t$goalFilterThisWeek = array(\"startDate\"=>$thisWeekStartDay, \"endDate\"=> $thisWeekLastDay);\n\t\t$goalFilterLastWeek = array(\"startDate\"=>$lastWeekStartDay, \"endDate\"=> $lastWeekEndDay);\n\t\t$goalValuesThisWeek = $this->getMonthDays($thisWeekStartDay ,$thisWeekLastDay);\n\t\t$goalValuesLastWeek = $this->getMonthDays($lastWeekStartDay ,$lastWeekEndDay);\n\n\t\t$dispatchersList = $this->Report->getDispatchersListForGoals();\n\t\t$thisWeek[\"goal\"] = $this->getPerformanceLoadsForAllDispatchers($dispatchersList, $goalFilterThisWeek, $goalValuesThisWeek);\n\t\t$lastWeek[\"goal\"] = $this->getPerformanceLoadsForAllDispatchers($dispatchersList, $goalFilterLastWeek, $goalValuesLastWeek);\n\n\t\t$considerDate = $yesterday;\n\t\t$recentTransactions = $this->Billing->getRecentTransactions(date(\"Y-m-d\"), 1);\n\t\tif(isset($recentTransactions[0][\"date\"])){ \n\t\t\t$considerDate = $recentTransactions[0][\"date\"]; \n\t\t}\n\t\t$expectedBillingToday = $this->Billing->expectedBillingOnDate($considerDate,$yesterday);\t\n\t\t$expectedBillingToday = is_null($expectedBillingToday) ? 0 : $expectedBillingToday;\n\n\t\t$lastWeek[\"sentToTriumph\"] = $this->Billing->sentForPaymentWithFilter( $lastWeekStartDay, $lastWeekEndDay );\n\t\t$lastWeek[\"sentToTriumph\"] = is_null($lastWeek[\"sentToTriumph\"]) ? 0 : $lastWeek[\"sentToTriumph\"];\n\t\t$lastWeek[\"goalCompleted\"] = ( isset($lastWeek['goal']) && $lastWeek['goal'] != 0 ) ? ( $lastWeek[\"sentToTriumph\"] / $lastWeek[\"goal\"] ) * 100 : 0;\n\n\n\t\t$thisWeek[\"sentToTriumph\"] = $this->Billing->sentForPaymentWithFilter( $thisWeekStartDay, $thisWeekToday );\n\t\t$thisWeek[\"sentToTriumph\"] = is_null($thisWeek[\"sentToTriumph\"]) ? 0 : $thisWeek[\"sentToTriumph\"];\n\t\t$thisWeek[\"goalCompleted\"] = ( isset($lastWeek['goal']) && $lastWeek['goal'] != 0 ) ? ( $thisWeek[\"sentToTriumph\"] / $thisWeek[\"goal\"] ) * 100 : 0;\n\t\t$thisWeek[\"targetType\"] = $thisWeek[\"goalCompleted\"] > 100 ? \"ahead\" : \"behind\";\n\t\t$thisWeek[\"target\"] = abs($thisWeek[\"goalCompleted\"] - 100) ;\n\n\n\t\t$sentToTriumphToday = $this->Billing->sentForPaymentWithFilter( $thisWeekToday, $thisWeekToday );\n\t\t$sentToTriumphToday = is_null($sentToTriumphToday) ? 0 : $sentToTriumphToday;\n\t\t\n\n\t\t$jobStatusStats = $this->Job->fetchLoadsSummary(null, $filters,\"all\");\n\t\t$pieChart[\"waitingPaperwork\"] = (int)$this->Job->getWaitingPaperworkCount($filters,\"all\");\n\t\t$pieChart[\"inprogress\"] = $pieChart[\"booked\"] = $pieChart[\"delivered\"] = $pieChart[\"hasValue\"] = 0;\n\t\tif(isset($jobStatusStats[0])){\n\t\t\tforeach ($jobStatusStats as $key => $value) {\n\t\t\t\tif(empty(trim($value['JobStatus'])) )\n\t\t\t\t\tcontinue;\n\t\t\t\t$pieChart[$value['JobStatus']] = (int)$value['tnum'];\n\t\t\t\t$pieChart[\"hasValue\"] = 1;\n\t\t\t}\n\t\t}\n\n\t\t$recentTransactions = $this->getRecentTransactions($filters);\n\t\t$sentPaymentData = $this->fetchingSentPaymentsInfo('otherPage');\n\t\t//pr($exportFlag);die;\n\t\tif(!empty($exportFlag[\"export\"])){\n\t\t\t$this->exportStat($recentTransactions);die();\n\t\t}\n\n\t\techo json_encode(array(\"sentToTriumphToday\"=>$sentToTriumphToday, \"lastWeek\"=> $lastWeek, \"thisWeek\" => $thisWeek, \"recentTransactions\" => $recentTransactions, \"expectedBillingToday\"=>$expectedBillingToday,\"pieChart\" => $pieChart, \"sentPaymentData\" => $sentPaymentData));\n\t}", "public function drawProgressChart() {\n $pid = $this->session->userdata('project_id');\n\n if (empty($this->chart_model->getNotFinishedCount($pid)) && empty($this->chart_model->getFinishedCount($pid)))\n $this->data['display'] = 1;\n\n $category = array();\n $category['name'] = 'Category';\n\n $series1 = array();\n $series1['name'] = 'Open Test Cases';\n\n $series2 = array();\n $series2['name'] = 'Closed Test Cases ';\n\n $category['data'][] = $this->chart_model->getProjectName($pid);\n $series1['data'][] = $this->chart_model->getNotFinishedCount($pid);\n $series2['data'][] = $this->chart_model->getFinishedCount($pid);\n\n $result = array();\n array_push($result, $category);\n array_push($result, $series1);\n array_push($result, $series2);\n\n print json_encode($result, JSON_NUMERIC_CHECK);\n\n return $result;\n }", "function Sensei_Course_Progress() {\n\t\treturn Sensei_Course_Progress::instance( __FILE__, '1.0.5' );\n\t}", "public function getProgressMessage() {\n if ($this->isNotStarted()) {\n return 'Starts in ' . round(($this->getDateStart('U') - time()) / 86400) . ' days';\n }\n elseif ($this->isFinished()) {\n if ($this->isSubmissionsExtended()) {\n return 'Submission period extended';\n }\n else {\n return 'Closed';\n }\n }\n else {\n return 'In progress';\n }\n }", "function get_progress_by_user_goal($user_id, $goal_id){\n\t\t$database = new Database;\n\t\t\n\t\t$progress_query = \"SELECT `progress` FROM `user_goals` WHERE `goal_id` = ? AND `user_id` = ?\";\n\t\t$params = array($goal_id, $user_id);\n\t\t$cols = array_pad(array(), 1, '');\n\t\t$results = $database->db_select($progress_query, $params, $cols);\n\t\tforeach ($results as $result){\n\t\t\treturn stripslashes($result[0]);\n\t\t}\n\t\t\n\t}", "function _incrementalDbAction_getProgress() { \r\n $currentOperation = _incrementalDbAction_currentOperation();\r\n\r\n $filesize = filesize($currentOperation['filePath']);\r\n $offset = $currentOperation['fileOffset'];\r\n $percentageComplete = intval(($offset / $filesize) * 100);\r\n $elapsedSeconds = time() - $currentOperation['startTime'];\r\n $elapsedMinutes = intval($elapsedSeconds / 60);\r\n $elapsedTime = $elapsedSeconds < 60 ? \"$elapsedSeconds seconds\" : \"$elapsedMinutes minutes\";\r\n $actionName = ucfirst($currentOperation['action']);\r\n \r\n //$text = \"$actionName progress: $percentageComplete% complete, elapsed runtime: $elapsedTime<br>\\n\";\r\n return [$percentageComplete, $elapsedTime, $actionName];\r\n}", "private function calculateProgress()\n {\n $calculator = new \\DRI_SubWorkflows\\ProgressCalculator($this);\n $calculator->calculate();\n }", "public function progress() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n $data['current'] = str_replace('overview', 'play', $this->user->get_next_step());\n $this->load->view('account/progress', $data);\n }", "public function fetch_guild_progress(){\n\t\t\t$arrData = array();\n\t\t\t\n\t\t\t// fetch the ProgressList\n\t\t\t$progressListHTML = $this->urlfetcher->fetch('http://frostmourne.eu/progress/frostberry');\n\t\t\tpreg_match_all(\"/(<([\\w]+)[^>]*>)(.*?)(<\\/\\\\2>)/\", $progressListHTML, $arrProgressList, PREG_SET_ORDER);\n\t\t\t\n\t\t\tforeach ($arrProgressList as $step => $wert) {\n\t\t\t\t\t#echo \"gefunden: \" . $wert[0] . \"\\n\"; // gefunden: <b>fett gedruckter Text</b>\n\t\t\t\t\t#echo \"Teil 1: \" . $wert[1] . \"\\n\"; // Teil 1: <b>\n\t\t\t\t\t#echo \"Teil 2: \" . $wert[2] . \"\\n\"; // Teil 2: b\n\t\t\t\t\t#echo \"Teil 3: \" . $wert[3] . \"\\n\"; // Teil 3: fett gedruckter Text\n\t\t\t\t\t#echo \"Teil 4: \" . $wert[4] . \"\\n\\n\"; // Teil 4: </b>\n\t\t\t\tif($wert[0] == '<a href=\"/progress/frostberry/view/221202\">Assasinen</a>'){\n\t\t\t\t\t$arrData['NAME'] = $wert[3];\n\t\t\t\t\t$arrData['LEVEL'] = 0;\n\t\t\t\t\t$arrData['pr_RANK'] = $arrProgressList[$step-1][3];\n\t\t\t\t\t$arrData['pr_POINTS'] = $arrProgressList[$step+7][3];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// fetch the ProgressView\n\t\t\t$progressViewHTML = $this->urlfetcher->fetch('http://frostmourne.eu/progress/frostberry/view/221202');\n\t\t\tpreg_match_all(\"/(<([\\w]+)[^>]*>)(.*?)(<\\/\\\\2>)/\", $progressViewHTML, $arrProgressView, PREG_SET_ORDER);\n\t\t\t\n\t\t\tforeach ($arrProgressView as $step => $wert) {\n\t\t\t\tswitch($wert[1]){\n\t\t\t\t\tcase '<b data-glevel=\"\">':\t\t$arrData['LEVEL'] = $wert[3]; break;\n\t\t\t\t\tcase '<span data-glchar=\"\">':\t$arrData['gm_NAME'] = $wert[3]; break;\n\t\t\t\t\tcase '<span data-gllevel=\"\">':\t$arrData['gm_LEVEL'] = $wert[3]; break;\n\t\t\t\t\tcase '<span data-glrace=\"\">':\t$arrData['gm_RACE'] = $wert[3]; break;\n\t\t\t\t\tcase '<span data-glclass=\"\">':\t$arrData['gm_CLASS'] = $wert[3]; break;\n\t\t\t\t\t\n\t\t\t\t\tcase '<th data-speak=\"progress_table-head-name\">':\n\t\t\t\t\t\t\t//split to read each RAID (by bossname)\n\t\t\t\t\t\t\tswitch($arrProgressView[$step+4][3]){\n\t\t\t\t\t\t\t\tcase 'Argaloth':\t\t\t\t// Baradienhold\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 3; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bh_'.$i] = $arrProgressView[$step+$s][3];\t\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bh_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bh_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bh_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Magmaul':\t\t\t\t\t// Blackwing Descent\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 6; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bwd_'.$i] = $arrProgressView[$step+$s][3];\t\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bwd_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bwd_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bwd_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Valiona und Theralion':\t// Bastion of Twilight\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 5; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bot_'.$i] = $arrProgressView[$step+$s][3];\t\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bot_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bot_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_bot_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Al\\'Akir':\t\t\t\t// Throne of the Four Winds\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 2; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_tdfw_'.$i] = $arrProgressView[$step+$s][3];\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_tdfw_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_tdfw_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_tdfw_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Beth\\'tilac':\t\t\t\t// Firelands\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 7; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_fl_'.$i] = $arrProgressView[$step+$s][3];\t\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_fl_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_fl_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_fl_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Morchok':\t\t\t\t\t// Dragonsoul\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=4; $i <= 8; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_ds_'.$i] = $arrProgressView[$step+$s][3];\t\t\t $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_ds_'.$i.'_NORMAL'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_ds_'.$i.'_HEROIC'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_ds_'.$i.'_POINTS'] = $arrProgressView[$step+$s][3]; $s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//fetch Raid History\n\t\t\t\t\t\t\t\t\t\tfor($i=1,$s=44; $i <= 20; $i++){\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i] = $arrProgressView[$step+$s][3];\t\t\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_ZONE'] = $arrProgressView[$step+$s][3];\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_MODE'] = $arrProgressView[$step+$s][3];\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_DATE'] = $arrProgressView[$step+$s][3];\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_DURATION'] = $arrProgressView[$step+$s][3];\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_FASTEST'] = $arrProgressView[$step+$s][3];\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_TOTAL'] = $arrProgressView[$step+$s][3];\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t\t$arrData['rd_hs_'.$i.'_RANK'] = $arrProgressView[$step+$s][3];\t\t$s++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $arrData;\n\t\t}", "public function getCompletedGoals() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/app/completed_goal_list.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "public function getPendingStats() {\n\t\t// $findCond = [\n\t\t// \t'fields' => [\n\t\t// \t\t'job_type',\n\t\t// \t\t'created',\n\t\t// \t\t'status',\n\t\t// \t\t'fetched',\n\t\t// \t\t'progress',\n\t\t// \t\t'reference',\n\t\t// \t\t'failed',\n\t\t// \t\t'failure_message',\n\t\t// \t],\n\t\t// \t'conditions' => [\n\t\t// \t\t'completed IS' => null,\n\t\t// \t],\n\t\t// ];\n\t\t// return $this->find('all', $findCond);\n\t}", "public function createProgressBar(int $progress, int $unfinished): string;", "public function getInstallationProgress();", "function getProgression()\r\n\t{\r\n\t\treturn $this->progression;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the color fuchsia.
public static function Fuchsia() {return RgbColor::CreateRgbColor("Fuchsia");}
[ "public static function getColor()\n {\n return self::$colors[self::getGeneralStatus()];\n }", "static public final function getGreenYellow() {\r\n return new Color(173, 255, 47);\r\n }", "static public final function GREEN_YELLOW() {\r\n return self::getGreenYellow();\r\n }", "static public final function GREEN() {\r\n return new Color(0,128,0);\r\n }", "public function get_color()\n\t{\n\t\treturn $this->color;\n\t}", "public\tfunction\tgetColor()\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn\t$this->color;\n\t\t\t\t\t\t\t\t}", "public function fg()\n {\n return $this->arr_colors[1];\n }", "public function getColor()\n\t{\n\t\treturn $this->color;\n\t}", "public function getColor() {\n\t\treturn $this->color;\n\t}", "public function colour()\n\t{\n\t\treturn $this->rgb2hex($this->colour);\n\t}", "public static function DarkSeaGreen()\r\n {return RgbColor::CreateRgbColor(\"DarkSeaGreen\");}", "public function getColor() {\n return $this->color;\n }", "public static function Chocolate()\r\n {return RgbColor::CreateRgbColor(\"Chocolate\");}", "public function color(): string\n {\n return $this->color;\n }", "public function getColorValue();", "public static function DarkGreen()\r\n {return RgbColor::CreateRgbColor(\"DarkGreen\");}", "public static function Turquoise()\r\n {return RgbColor::CreateRgbColor(\"Turquoise\");}", "public function getGreen();", "public function getColorAsString () {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purpose: get pollanswers (by PollID) Output : array
function GetPollAnswers( $poll_id ) { $sql_query = " SELECT * ". " FROM `".DBTB::GetTB( 'EGL_POLLS', 'POLLS_ANSWERS')."` AS answers ". " WHERE poll_id=$poll_id ". " ORDER BY answers.sub_index ASC"; return $this->pDBInterfaceCon->FetchArrayObject( $this->pDBInterfaceCon->Query($sql_query)); }
[ "public function getPollAnswers($id_poll) {\n\t\t$results = $this->db->select($this->table_name.'.*, questions.type', \n\t\t\t\tfalse)\n\t\t\t->join('sheets', 'sheets.id = sheet_answers.id_sheet', 'LEFT')\n\t\t\t->join('questions', 'questions.id = sheet_answers.id_question', 'LEFT')\n\t\t\t->where('sheets.id_poll', $id_poll)\n\t\t\t->from($this->table_name)\n\t\t\t->order_by('id_question asc')\n\t\t\t->get()\n\t\t\t->result();\n\t\t\n\t\treturn $results;\n\t}", "function poll_getResults($poll_id)\n{\n\tglobal $poll_mySQL_host, $poll_mySQL_user, $poll_mySQL_pwd, $poll_usePersistentConnects;\n\tglobal $poll_dbName, $poll_descTableName, $poll_dataTableName, $poll_maxOptions;\n\n\t$ret = array();\n \n\t// connect to database\n\tif($poll_usePersistentConnects == 0)\n\t\t$poll_mySQL_ID = mysql_connect($poll_mySQL_host, $poll_mySQL_user, $poll_mySQL_pwd);\n\telse\n\t\t$poll_mySQL_ID = mysql_pconnect($poll_mySQL_host, $poll_mySQL_user, $poll_mySQL_pwd);\n\n\t$poll_result = mysql_db_query($poll_dbName, \"SELECT SUM(optionCount) AS SUM FROM $poll_dataTableName WHERE pollID=$poll_id\");\n\tif(!$poll_result)\n\t{\n\t\techo mysql_errno(). \": \".mysql_error(). \"<br>\";\n\t\treturn(0);\n\t}\n\n\t$poll_sum = mysql_result($poll_result, 0, \"SUM\"); \n \n\t$poll_result = mysql_db_query($poll_dbName, \"SELECT pollTitle FROM $poll_descTableName WHERE pollID=$poll_id\");\n\tif(!$poll_result)\n\t{\n\t\techo mysql_errno(). \": \".mysql_error(). \"<br>\";\n\t\treturn(0);\n\t}\n \n\t$poll_title = mysql_result($poll_result, 0, \"pollTitle\"); \n \n\t$ret[0] = array(\"title\"=>$poll_title, \"votes\"=>$poll_sum);\n \n\t// select next vote option\n\t$poll_result = mysql_db_query($poll_dbName, \"SELECT * FROM $poll_dataTableName WHERE pollID=$poll_id\");\n\tif(!$poll_result)\n\t{\n\t\techo mysql_errno(). \": \".mysql_error(). \"<br>\";\n\t\treturn(0);\n\t}\n\n\twhile ($row = mysql_fetch_array($poll_result))\n\t{\n\t\t$ret[] = array(\"text\"=>$row[\"optionText\"], \"votes\"=>$row[\"optionCount\"]);\n\t}\n\n\t// close link to database\n\tif($poll_usePersistentConnects == 0)\n\t\tmysql_close($poll_mySQL_ID);\n\n\treturn($ret);\n\n}", "public function getAnswersByEvent($eventId)\n {\n $eventLocationAnswers = $this->eventLocationAnswer->findByKey('event_id',$eventId)->get();\n $eventPolls = EventPoll::where('event_id', $eventId)->get();\n\n $result = [];\n foreach ($eventPolls as $poll) {\n $pollInfo = Poll::where('id', $poll->poll_id)->first();\n\n // set key for poll\n foreach ($eventLocationAnswers as $locationAnswer) {\n $eventAnswers = EventAnswer::where('event_location_answer_id', $locationAnswer->id)\n ->where('poll_id', $pollInfo->id)\n ->get();\n\n foreach ($eventAnswers as $answer) {\n $result[$pollInfo->name][] = [\n 'answer' => 1,\n 'label' => ucwords($answer->value)\n ];\n }\n }\n }\n\n return $result;\n }", "private function get_results_array( $poll_id ){\n\n $option_one_count = (int) get_post_meta( $poll_id , 'option_one_count' , true );\n $option_two_count = (int) get_post_meta( $poll_id , 'option_two_count' , true );\n // calculating total votes.\n $total_count = $option_one_count + $option_two_count;\n //calculating percentages.\n $option_one_percentage = ( $option_one_count / $total_count ) * 100;\n $option_two_percentage = ( $option_two_count / $total_count ) * 100;\n\n // returning the result in single array.\n return array(\n 'option_one_count' => $option_one_count\n ,'option_two_count' => $option_two_count\n ,'total_vote_count' => $total_count\n ,'option_one_percentage' => round ( $option_one_percentage ,1) \n ,'option_two_percentage' => round ( $option_two_percentage ,1) \n\n );\n }", "function cns_poll_get_results($poll_id, $request_results = true)\n{\n $poll_info = $GLOBALS['FORUM_DB']->query_select('f_polls', array('*'), array('id' => $poll_id), '', 1);\n if (!array_key_exists(0, $poll_info)) {\n attach_message(do_lang_tempcode('_MISSING_RESOURCE', escape_html(strval($poll_id)), 'poll'), 'warn');\n return null;\n }\n\n $_answers = $GLOBALS['FORUM_DB']->query_select('f_poll_answers', array('*'), array('pa_poll_id' => $poll_id), 'ORDER BY id');\n $answers = array();\n foreach ($_answers as $_answer) {\n $answer = array();\n\n $answer['answer'] = $_answer['pa_answer'];\n $answer['id'] = $_answer['id'];\n if ((($request_results) || ($poll_info[0]['po_is_open'] == 0)) && ($poll_info[0]['po_is_private'] == 0)) {// We usually will show the results for a closed poll, but not one still private\n $answer['num_votes'] = $_answer['pa_cache_num_votes'];\n }\n\n $answers[] = $answer;\n }\n\n if ($request_results) {\n // Forfeiting this by viewing results?\n if (is_guest()) {\n $voted_already_map = array('pv_poll_id' => $poll_id, 'pv_ip' => get_ip_address());\n } else {\n $voted_already_map = array('pv_poll_id' => $poll_id, 'pv_member_id' => get_member());\n }\n $voted_already = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_poll_votes', 'pv_member_id', $voted_already_map);\n if (is_null($voted_already)) {\n $forfeight = !has_privilege(get_member(), 'view_poll_results_before_voting');\n if ($forfeight) {\n $GLOBALS['FORUM_DB']->query_insert('f_poll_votes', array(\n 'pv_poll_id' => $poll_id,\n 'pv_member_id' => get_member(),\n 'pv_answer_id' => -1,\n 'pv_ip' => get_ip_address(),\n ));\n }\n }\n }\n\n $out = array(\n 'is_private' => $poll_info[0]['po_is_private'],\n 'id' => $poll_info[0]['id'],\n 'question' => $poll_info[0]['po_question'],\n 'minimum_selections' => $poll_info[0]['po_minimum_selections'],\n 'maximum_selections' => $poll_info[0]['po_maximum_selections'],\n 'requires_reply' => $poll_info[0]['po_requires_reply'],\n 'is_open' => $poll_info[0]['po_is_open'],\n 'answers' => $answers,\n 'total_votes' => $poll_info[0]['po_cache_total_votes']\n );\n\n return $out;\n}", "function GetPollAnswer( $answerid )\n\t{\n\t\t$sql_query = \t\" SELECT * \".\n\t\t\t\t\t\t\" FROM `\".DBTB::GetTB( 'EGL_POLLS', 'POLLS_ANSWERS').\"` \".\n\t\t\t\t\t\t\" WHERE id=$answerid \";\n\t\treturn $this->pDBInterfaceCon->FetchObject( $this->pDBInterfaceCon->Query($sql_query));\t\n\t\t\t\n\t}", "function answers()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Answer WHERE AlternativeID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAnswer( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public function getIndividualResponses($poll_id, $constraints = array())\n\t{\n\t\t$sql = \"SELECT rq.responseid, q.name, rq.response, rq.multi_id, r.timestamp FROM response_question rq, response r, question q WHERE r.poll_id = \" . $this->da->escape($poll_id) . \" and r.responseid = rq.responseid and rq.q_id = q.q_id\";\n\t\tif (!empty($constraints))\n\t\t{\n\t\t\tforeach ($constraints as $constraint)\n\t\t\t{\n\t\t\t\t$sql .= \" and $constraint\";\n\t\t\t}\n\t\t}\n\t\t$result = $this->retrieve($sql);\n\t\t$result->setFormat(\"NUM\");\n\t\t$responses = array();\n\t\tif ($result->getNumRows())\n\t\t{\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t// need to put responses in an array if it's a checkbox question\n\t\t\t\tif (array_key_exists($row->offsetGet(0), $responses))\n\t\t\t\t{\n\t\t\t\t\t$responses[$row->offsetGet(0)]['responses'][] = array($row->offsetGet(1), $row->offsetGet(2), $row->offsetGet(3));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$responses[$row->offsetGet(0)] = array(\n\t\t\t\t\t\t'time' => $row->offsetGet(4),\n\t\t\t\t\t\t'responses' => array(array($row->offsetGet(1), $row->offsetGet(2), $row->offsetGet(3))));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $responses;\n\t}", "function get_poll_data($topic_id)\n\t{\n\t\tglobal $db, $cache, $config, $user;\n\n\t\t$sql = \"SELECT o.*\n\t\t\tFROM \" . POLL_OPTIONS_TABLE . \" o\n\t\t\tWHERE o.topic_id = \" . (int) $topic_id . \"\n\t\t\tORDER BY o.poll_option_id\";\n\t\t$result = $db->sql_query($sql);\n\n\t\t$poll_info = array();\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t$poll_info[] = $row;\n\t\t}\n\t\t$db->sql_freeresult($result);\n\n\t\t$cur_voted_id = array();\n\t\tif (!empty($user->data) && $user->data['session_logged_in'] && ($user->data['bot_id'] === false))\n\t\t{\n\t\t\t$sql = \"SELECT v.poll_option_id\n\t\t\t\tFROM \" . POLL_VOTES_TABLE . \" v\n\t\t\t\tWHERE v.topic_id = \" . (int) $topic_id . \"\n\t\t\t\t\tAND v.vote_user_id = \" . (int) $user->data['user_id'];\n\t\t\t$result = $db->sql_query($sql);\n\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$cur_voted_id[] = $row['poll_option_id'];\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Cookie based guest tracking... I don't like this but hum ho... it's oft requested. This relies on \"nice\" users who don't feel the need to delete cookies to mess with results\n\t\t\tif (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))\n\t\t\t{\n\t\t\t\t$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);\n\t\t\t\t$cur_voted_id = array_map('intval', $cur_voted_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array('poll_info' => $poll_info, 'cur_voted_id' => $cur_voted_id);\n\t}", "public static function getVotes($pollId) {\n // Query\n\t\t$CI =& get_instance();\n\t\t$CI->load->database();\n\t\t$CI->db->select('answers.answer as answer, count(votes.id) as votes');\n\t\t$CI->db->from('answers');\n\t\t$CI->db->join('votes', 'answers.id=votes.answer', 'left');\n\t\t$CI->db->where('answers.poll', $pollId);\n\t\t$CI->db->group_by('answers.id');\n\t\t$CI->db->order_by('answers.id', 'asc');\n\t\t$result = $CI->db->get()->result_array();\n\n\t\treturn $result;\n\t}", "function get_answers_from_exam($qid){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_answers` WHERE `question_id` = '$qid'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data;\n}", "private function get_answers($question_id){\n\n\t\t$query=$this->conn->query(\"SELECT * FROM Answers WHERE question_id = '\".$question_id.\"'\");\n\t\twhile ($row=$query->fetch_array(MYSQLI_ASSOC)){\n\n\t\t\t//add fetched rows to ques array\n\t\t\t$this->answers[]=$row;\n\t}\n\n\t}", "function ipal_get_answers($questionid){\n\tglobal $ipal;\n\tglobal $DB;\n\tglobal $CFG;\n\t$line=\"\";\n\t$answers=$DB->get_records('question_answers',array('question'=>$questionid));\n\tforeach($answers as $answers){\n\t\t$line .= $answers->answer;\n\t\t$line .= \"&nbsp;\";\n\t}\n\treturn($line);\n}", "static public function response_answers_by_question($rid) {\n global $DB;\n\n $answers = [];\n $sql = 'SELECT r.id as id, r.response_id as responseid, r.question_id as questionid, r.choice_id as choiceid, ' .\n 'o.response as value ' .\n 'FROM {' . static::response_table() .'} r ' .\n 'LEFT JOIN {questionnaire_response_other} o ON r.response_id = o.response_id AND r.question_id = o.question_id AND ' .\n 'r.choice_id = o.choice_id ' .\n 'WHERE r.response_id = ? ';\n $records = $DB->get_records_sql($sql, [$rid]);\n foreach ($records as $record) {\n $answers[$record->questionid][$record->choiceid] = answer\\answer::create_from_data($record);\n }\n\n return $answers;\n }", "public function getAllAnswers()\n {\n return $this->answers;\n }", "public function getPollChoices($pollid)\n\t{\n\t\t$query = \"SELECT * FROM poll_choices WHERE poll_id = $pollid\";\n\t\treturn queryMysql($query);\n\t}", "function getPollChoices($pollid) {\n\n include(\"foodledbinfo.php\");\n\n try {\n $db = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);\n\n $tablename = \"choices{$pollid}\";\n\n $choices = array();\n if ($stmt = $db->prepare(\"SELECT * FROM {$tablename}\")) {\n $stmt->execute();\n $row = $stmt->fetch();\n while ($row) {\n\t$choices[$row['choiceid']] = $row['yelpid'];\n\t$row = $stmt->fetch();\t\n }\n return $choices;\n }\n return NULL;\n } catch (PDOException $e) {\n print \"Error!: \" . $e->getMessage() . \"<br/>\";\n return NULL; //die();;\n }\n}", "public function getAnswers() {\n return \\yii\\helpers\\ArrayHelper::map(\\common\\models\\Answer::find()->where(['question_id' => $this->id])->all(), 'id', 'title');\n }", "static public function response_answers_by_question($rid) {\n global $DB;\n\n $dateformat = get_string('strfdate', 'questionnaire');\n $answers = [];\n $sql = 'SELECT id, response_id as responseid, question_id as questionid, 0 as choiceid, response as value ' .\n 'FROM {' . static::response_table() .'} ' .\n 'WHERE response_id = ? ';\n $records = $DB->get_records_sql($sql, [$rid]);\n foreach ($records as $record) {\n // Convert date from yyyy-mm-dd database format to actual questionnaire dateformat.\n // does not work with dates prior to 1900 under Windows.\n if (preg_match('/\\d\\d\\d\\d-\\d\\d-\\d\\d/', $record->value)) {\n $dateparts = preg_split('/-/', $record->value);\n $val = make_timestamp($dateparts[0], $dateparts[1], $dateparts[2]); // Unix timestamp.\n $val = userdate ( $val, $dateformat);\n $record->value = $val;\n }\n $answers[$record->questionid][] = answer\\answer::create_from_data($record);\n }\n\n return $answers;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes objects contained in another storage from the current storage
public function removeAll($storage){}
[ "public function removeAll ($storage) {}", "public function removeAllExcept ($storage) {}", "public function removeAllExcept($storage)\n {\n }", "public function removeAllRelatedAlbums() {\n\t\t$this->relatedAlbums = new Tx_Extbase_Persistence_ObjectStorage();\n\t}", "public function clear()\n {\n \tunlink($this->_storage);\n }", "public function removeObjectReallyRemovesTheObjectFromStorage() {\n\t\t$originalObject = new \\F3\\FLOW3\\Fixture\\DummyClass();\n\t\t$this->objectRegistry->putObject('DummyObject', $originalObject);\n\t\t$this->objectRegistry->removeObject('DummyObject');\n\t\t$this->assertFalse($this->objectRegistry->objectExists('DummyObject'), 'removeObject() did not really remove the object.');\n\t}", "public function destroy_storage();", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp . DS . 'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp . DS . 'file1.txt');\n $this->assertTrue(!is_file(self::$temp . DS . 'file1.txt'));\n }", "public function unlinkDisownedObjects()\n {\n $object = $this->getObjectInStage(Versioned::DRAFT);\n if ($object) {\n $object->unlinkDisownedObjects($object, Versioned::LIVE);\n }\n }", "public function removeRetainsObjectForObjectsNotInCurrentSession() : void {}", "public function removeAll() {\n\t\t$this->addedObjects = new \\SplObjectStorage();\n\t\tforeach ($this->findAll() as $object) {\n\t\t\t$this->remove($object);\n\t\t}\n\t}", "protected function discardExistingImages() {\n\t\t$mapper = tx_oelib_MapperRegistry::get('tx_realty_Mapper_Image');\n\t\tforeach ($mapper->findAllByRelation($this, 'object') as $image) {\n\t\t\t$mapper->delete($image);\n \t\t}\n\n \t\t$this->oldImagesNeedToGetDeleted = FALSE;\n\t}", "protected function processDeletedObjects() {\n\t\tforeach ($this->deletedEntities as $entity) {\n\t\t\tif ($this->persistenceSession->hasObject($entity)) {\n\t\t\t\t$this->removeEntity($entity);\n\t\t\t\t$this->persistenceSession->unregisterObject($entity);\n\t\t\t}\n\t\t}\n\t\t$this->deletedEntities = new \\SplObjectStorage();\n\t}", "abstract public function removeObjectsById( $id );", "public static function remove()\n {\n self::$storage = null;\n }", "public function clearStorage() {\n $storage = app()->make('filesystem');\n\n $dbFiles = collect(MediaSize::getModel()->pluck('path'));\n $storageFiles = collect($storage->allFiles($this::UPLOAD_PATH));\n\n $unusedFiles = $storageFiles->filter(function($file) use ($dbFiles) {\n return $dbFiles->search($file) === false;\n });\n\n $unusedFiles->each(function($file) use ($storage) {\n $storage->delete($file);\n });\n\n return $unusedFiles->count();\n }", "public function removeAll() {\n\t\tforeach ($this->findAll() AS $object) {\n\t\t\t$this->remove($object);\n\t\t}\n\t}", "public function removeAllPhotos() {\n\t\t$this->photos = new Tx_Extbase_Persistence_ObjectStorage();\n\t}", "function remove_all(){\n\t\t$archives = new Archive();\n\t\t$archives->get();\n\t\tforeach($archive->all as $archive) {\n\t\t\t$archive->remove();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the API used by publisher.
public function setApi($api);
[ "protected function setClientApiConnection()\n {\n\n }", "protected function setAPIUrl()\n {\n $this->apiURL = $this->server;\n }", "public function setApi(Api $api);", "abstract public function setApiKey();", "public function setAPIKeys($api_keys){}", "private function setApiEndpoint()\n {\n $this->apiEndPoint = sprintf($this->apiUrl, explode('-', $this->apiKey)[1]);\n }", "function set_api_key($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t}", "protected function set_api() {\n\n\t\t$twitter = new TwitterOAuth(\n\t\t\t$this->auth_keys[ 'consumer_key' ],\n\t\t\t$this->auth_keys[ 'consumer_secret' ],\n\t\t\t$this->auth_keys[ 'access_token' ],\n\t\t\t$this->auth_keys[ 'access_token_secret' ]\n\t\t);\n\n\t\t$connected = $twitter->get(\"account/verify_credentials\");\n\t\tif ( $connected ) {\n\t\t\t$this->api = $twitter;\n\t\t}\n\n\t}", "public function __construct() {\n $this->defaultApiClient = $this->getSpecificDefaultApi();\n $this->setDefaultAffkey($this);\n $this->setDefaultHost($this);\n }", "public function setAPIUrl($url){\n\t\t$this->apiUrl = $url;\n }", "protected function setAPI($api)\n\t{\n\t\t# Check if the passed value is empty.\n\t\tif(!empty($api))\n\t\t{\n\t\t\t# Strip slashes and decode any html entities.\n\t\t\t$api=html_entity_decode(stripslashes($api), ENT_COMPAT, 'UTF-8');\n\t\t\t# Clean it up.\n\t\t\t$api=trim($api);\n\t\t\t# Set the data member.\n\t\t\t$this->api=$api;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Explicitly set the data member to NULL.\n\t\t\t$this->api=NULL;\n\t\t}\n\t}", "abstract public function setApiMethod();", "public function setAPIKey($key) {\r\n\t\r\n\t\t$this->_APIKey = $key;\r\n\t}", "public function setAPIKey($key)\n {\n $this->api_key = $key;\n }", "public function setApi()\n {\n $this->_mpdf = new mPDF($this->mode, $this->format . '-' . $this->orientation, $this->defaultFontSize, $this->defaultFont, $this->marginLeft, $this->marginRight, $this->marginTop, $this->marginBottom, $this->marginHeader, $this->marginFooter);\n }", "function set_api_key()\n\t\t{\n\t\t\tStripe::setApiKey($this->private_key);\n\t\t}", "public function setAPIKey($key)\n {\n $this->_api_key = $key;\n }", "function setApiMode($value)\n {\n $this->_props['ApiMode'] = $value;\n }", "protected abstract function _apiInstance();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set min max of slider.
public function setMinMax(float $min, float $max): void { $this->min = $min; $this->max = $max; $this->dispatchBrowserEvent('setSliderMinMax', ['min' => $min, 'max' => $max]); }
[ "public function setMinMax($min, $max) {\r\n $this->automatic = false;\r\n $this->automaticMinimum = false;\r\n $this->automaticMaximum = false;\r\n\r\n if ($min > $max) { // swap\r\n $tmp = $min;\r\n $min = $max;\r\n $max = $tmp;\r\n }\r\n\r\n $this->internalSetMinimum($min);\r\n $this->internalSetMaximum($max);\r\n if (($this->maximumvalue - $this->minimumvalue) < self::$MINAXISRANGE) {\r\n $this->internalSetMaximum($this->minimumvalue + self::$MINAXISRANGE);\r\n }\r\n }", "function setRange($minvalue, $maxvalue)\n {\n $this->m_minvalue = $minvalue;\n $this->m_maxvalue = $maxvalue;\n }", "function SetRange($minVal, $maxVal){}", "public function setMinLimit($min) {\n $this->min = $min;\n }", "function SetRange($minValue, $maxValue){}", "public function setRange($minvalue, $maxvalue)\n {\n $this->setMinValue($minvalue);\n $this->setMaxValue($maxvalue);\n }", "public function setMinValue($value) {\n\t\t$value = FormItBuilder::forceNumber($value);\n\t\tif($this->_maxValue!==NULL && $this->_maxValue<$value){\n\t\t\tFormItBuilder::throwError('[Element: '.$this->_id.'] Cannot set minimum value to \"'.$value.'\" when maximum value is \"'.$this->_maxValue.'\"');\n\t\t}else{\n\t\t\t$this->_minValue = FormItBuilder::forceNumber($value);\n\t\t}\n\t}", "function setMax($value) { $this->_max=$value; }", "public function setXMax($xMax) {}", "public function adjustMaxMin() {\r\n $this->left->adjustMaxMin();\r\n $this->top->adjustMaxMin();\r\n $this->right->adjustMaxMin();\r\n $this->bottom->adjustMaxMin();\r\n $this->depth->adjustMaxMin();\r\n $this->depthTop->adjustMaxMin();\r\n\r\n for ($t = 0; $t < sizeof($this->custom); $t++) {\r\n $this->custom->getAxis($t)->adjustMaxMin();\r\n }\r\n }", "public function setMin($min) {\n\t\t$this->min = $min;\n\t}", "public function setMinMaxDate($minDate = 'null', $maxDate = 'null') {\n \n if($minDate != 'null'){\n $this->_config_mapper(Array('minDate' => \"'\" . $minDate . \"'\")); \n }\n \n if($maxDate != 'null'){\n $this->_config_mapper(Array('maxDate' => \"'\" . $maxDate . \"'\")); \n }\n }", "public function setIDRange($min, $max)\n {\n }", "function set_y_min( $min )\n {\n $this->y_min = floatval( $min );\n }", "function set_y_min($min) {\n\t\t$this->y_min = floatval ( $min );\n\t}", "public function setMin($min) {\n $this->setOptionNumeric(\"min\", $min);\n }", "public function SetXMinMax($aMin, $aMax) {\n\t\t$this->iXMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep;\n\t\t$this->iXMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep;\n\t}", "public function setDateMin($min = null)\n {\n $this->m_date_max = $this->dateArray($min);\n }", "function setSlider($slider=7){\n\t\t\t$this->slider = $slider;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsets the target_collection class variable.
public function tearDown() { unset($this->target_collection); }
[ "public function clearTarget();", "public function __destruct() {\n unset($this->collection);\n }", "public function clear()\n {\n $this->targets = array();\n $this->defaultTarget = null;\n }", "public function setRootCollection(Blackbox_TargetCollection $collection)\n\t{\n\t\t$this->target_collection = $collection;\n\t}", "public function clear() {\n // Drop collection.\n $this->collection->drop();\n }", "public function restoreToDefault()\n {\n $this->lastCollection = $this->collection;\n $this->collection = clone $this->originalCollection;\n }", "public function clear( )\n {\n $this->collection = array( );\n }", "public function unsetMain($arrayCollection);", "public function clearTargets();", "function __destruct() {\n if(!empty($this->collection)) static::merge($this->collection);\n }", "public function clearCollections()\n {\n $this->_collections = [];\n $this->_fileCollections = [];\n }", "function removeCollection()\n {\n $collection = eZProductCollection::fetch( $this->attribute( 'productcollection_id' ) );\n $collection->remove();\n }", "public function clearSkillReferences()\n {\n $this->collSkillReferences = null; // important to set this to NULL since that means it is uninitialized\n }", "public abstract function retain_collection(Collection $collection);", "public function tearDown()\n\t{\n\t\tunset($this->_collectionMock);\n\t}", "public function getTargetCollection() {\n return get_record_by_id('Collection', $this->target_collection_id);\n }", "public function resetPickedTargets()\n\t{\n\t\t$this->picked = array();\n\t}", "public function unsetSellable(): void\n {\n $this->sellable = [];\n }", "public function clearAnswers()\n {\n $this->collAnswers = null; // important to set this to NULL since that means it is uninitialized\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the transmitter "creating" event.
public function creating(Transmitter $transmitter) { $unique = false; $unique_ssid = false; while (! $unique) { $license_key = licenseKeyGenerator(16); if (Transmitter::where('license_key', $license_key)->count() == 0) { $unique = true; } } $transmitter->license_key = $license_key; if ($transmitter->mode == 'AP' || is_null($transmitter->old_transmitter)) { if (is_null($transmitter->password)) { $transmitter->password = keyGenerator(16); } if (is_null($transmitter->ssid)) { while (! $unique_ssid) { $ssid = 'RUGNET0'; $ssid .= idGenerator(5); if (Transmitter::where('ssid', $ssid)->count() == 0) { $unique_ssid = true; } } $transmitter->ssid = $ssid; } } else { $old_transmitter = Transmitter::find($transmitter->old_transmitter); $transmitter->ssid = $old_transmitter->ssid; $transmitter->password = $old_transmitter->password; } unset($transmitter->old_transmitter); }
[ "public function created(Transmitter $transmitter)\n {\n //\n }", "public function handleVoucherCreation(VoucherCreatedEvent $event)\n {\n }", "public function createEvent() {\n \n // get random user from game\n $user = User::orderBy(DB::raw('RAND()'))->first();\n $event = $this->getRandomEvent($user->id);\n \n // get user to show this event to\n $showTo = DB::table(\"users\")->select(\"id\")->where('id', '<>', $user->id)->orderBy(DB::raw('RAND()'))->first();\n $push = array(\n 'event_id' => $event->id,\n 'user_id' => $event->getUserId(),\n 'control_id' => $event->getEventType(),\n 'show_to' => $showTo->id,\n 'show_text' => $this->getTickerText($event),\n 'cid' \t\t => $event->control_id \n );\n \n // push to client and display\n $this->getPusher()->trigger(\n Config::get('app.pusher_channel_name'), \n 'event_create', \n $push\n );\n }", "public function handleOfferCreated(OfferCreated $event)\n { \n $event->tender->user->notify(new OfferWasCreated($event->tender, $event->offer)); \n }", "private function processOnStoreV3OrderCreate(): void\n\t{\n\t\tif (!Main\\Loader::includeModule('landing'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$platform = $this->getTradeBindingCollection()->getTradingPlatform(\n\t\t\tLanding::TRADING_PLATFORM_CODE,\n\t\t\tLanding::LANDING_STORE_STORE_V3\n\t\t);\n\t\tif ($platform)\n\t\t{\n\t\t\t$this->addTimelineEntryOnStoreV3OrderCreate();\n\t\t\t$this->sendSmsToClientOnStoreV3OrderCreate($platform);\n\t\t}\n\t}", "function createSensor()\n\t{\n\t\t# Here we initialize the sensor with some values.\n\t\t# Initialize the sensor with your own logic.\n\t\t$sensor = new Sensor(\"Station 1\", 10, 15, date(\"Y-m-d H:i:s\"));\n\t\t\n\t\t# This is to make sure that the sensor has been sent successfully.\n\t\t# You can use your own logic to do this.\n\t\t$done = false;\n\t\t\n\t\twhile ($done == false)\n\t\t{\n\t\t\t$done = sendData($sensor);\n\t\t}\n\t}", "function on_create_handler()\n{\n\tglobal $g_obj_course_manager;\n\t\n\t// create a new course\n\t$str_course_name = PageHandler::get_post_value( 'CourseName' );\n\t$str_course_description = PageHandler::get_post_value( 'CourseDescription' );\n\t\n\t// verify the input\n\tif ( !isset( $str_course_name ) || !isset( $str_course_description ) )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Please enter the necessary information' );\n\t\treturn;\n\t}\n\t \n\t// process the input\n\tif ( $g_obj_course_manager->add_course( $str_course_name, $str_course_description ) )\n\t{\n\t\tMessageHandler::add_message( MSG_SUCCESS, 'Successfully created Course \"' . $str_course_name . '\"' );\n\t}\n\t\n\telse\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Failed to create Course \"' . $str_course_name . '\"' );\n\t}\n}", "public function createSignal();", "function on_create_handler()\n{\n\tglobal $g_obj_ta_manager;\n\t\n\t$str_user_name = PageHandler::get_post_value( 'Username' );\n\t$str_first_name = PageHandler::get_post_value( 'FirstName' );\n\t$str_last_name = PageHandler::get_post_value( 'LastName' );\n\t$str_password = PageHandler::get_post_value( 'Password' );\n\t$str_password_confirm = PageHandler::get_post_value( 'ConfirmPassword' );\n\t$int_greengene_course = PageHandler::get_post_value( 'GreenGeneCourseCreate' );\n\n\t// verify the input\n\tif ( !isset( $str_first_name ) || !isset( $str_last_name ) )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Please enter the necessary information' );\n\t\treturn;\n\t}\n\t\n\tif ( $str_password != $str_password_confirm )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'The password does not match' );\n\t\treturn;\n\t}\n\n\tif ( strlen( $str_user_name ) == 0 )\n\t{\n\t\t$str_user_name = $g_obj_ta_manager->autogen_user( $str_first_name, $str_last_name );\n\t}\n\t\n\tif ( strlen( $str_password ) == 0 )\n\t{\n\t\t$str_password = $g_obj_ta_manager->autogen_password( $str_first_name, $str_last_name );\n\t}\n\t\n\tif ( empty( $int_greengene_course ) )\n\t{\n\t\t$int_greengene_course = 0;\n\t}\n\t\n\t// create a new ta\n\tif ( $g_obj_ta_manager->create_user( $str_user_name, $int_greengene_course, UP_TA, $str_first_name, $str_last_name, $str_password, 0 ) )\n\t{\n\t\tMessageHandler::add_message( MSG_SUCCESS, 'Successfully created an account for TA \"' . $str_user_name . '\" with password \"' . $str_password . '\"' );\n\t}\n\t\n\telse\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Failed to create an account for TA \"' . $str_user_name . '\"' );\n\t}\n}", "public function create() {\n if ( $this->f3->exists( 'POST.create' ) ) {\n $event = new Event( $this->db );\n $event->add();\n\n $this->f3->reroute( '/esuccess/New event Created' );\n } else {\n $this->f3->set( 'page_head', 'Create Event' );\n $this->f3->set( 'view', 'event/create.htm' );\n $this->f3->set( 'type', 'event' );\n }\n\n }", "public function trigger_before_create() {\n\t\t\n\t}", "public function created(Transaction $transaction)\n {\n $transaction->account;\n $this->producer->produce($transaction);\n }", "public function actionCreate() {\r\n\t\t$model = new Sender ();\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( ['view','id'=>$model->sender_id] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'create', ['model'=>$model] );\r\n\t\t}\r\n\t}", "public function createEventRecord() {\n//\t\t$event = new Events();\n//\t\t$event->type = 'record_create';\n//\t\t$event->subtype = 'quote';\n//\t\t$event->associationId = $this->id;\n//\t\t$event->associationType = 'Quote';\n//\t\t$event->timestamp = time();\n//\t\t$event->lastUpdated = $event->timestamp;\n//\t\t$event->user = $this->createdBy;\n//\t\t$event->save();\n\t}", "protected function before_create() {\n\n\t}", "public function action_create()\n\t{\n\t\t$this->_edit(\\Ticker\\Model_Message::forge());\n\t}", "function mCREATE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$CREATE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:39:3: ( 'create' ) \n // Tokenizer11.g:40:3: 'create' \n {\n $this->matchString(\"create\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function handle_sku_created( $data = array() ){\n\t\t// DO NOTHING\t\n\t}", "public function handleCreateEquipmentReservation() {\n $reserveDuration = 1;\n $this->requireParam('equipmentID');\n $this->requireParam('userID');\n\t\t$this->requireParam('messageID'); \n $body = $this->requestBody;\n\n $isEquipmentAvailable = $this->EquipmentReservationDao->getEquipmentAvailableStatus($body['equipmentID']);\n if (!$isEquipmentAvailable) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Equipment already reserved or checked out'));\n }\n\n $reservation = new EquipmentReservation();\n $reservation->setEquipmentID($body['equipmentID']);\n $reservation->setUserID($body['userID']);\n $reservation->setDatetimeReserved(new \\DateTime());\n $reservation->setDatetimeExpired(QueryUtils::HoursFromCurrentDate($reserveDuration));\n $reservation->setIsActive(true);\n\n $ok = $this->EquipmentReservationDao->addNewReservation($reservation);\n if (!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Failed to create equipment reservation'));\n }\n\n // Create email\n $user = $this->userDao->getUserByID($body['userID']);\n $equipment = $this->EquipmentDao->getEquipment($body['equipmentID']);\n\t\t$message = $this->messageDao->getMessageByID($body['messageID']);\n\t\t//$mailer = New TekBotsMailer('tekbot-worker@engr.oregonstate.edu');\n $ok = $this->mailer->sendEquipmentEmail($user, null, $equipment, $message);\n\n $this->respond(new Response(\n Response::OK,\n 'Successfully created equipment reservation'\n ));\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get open status codes
public static function getOpenStatusCodes() { return array( self::STATUS_NEW, self::STATUS_ACCEPTED_BY_SELLER, self::STATUS_REJECTED_BY_SELLER, self::STATUS_IN_PICK_AT_SELLER, self::STATUS_READY_FOR_DISPATCH_TO_HUB, self::STATUS_IN_TRANSIT_TO_HUB, self::STATUS_READY_FOR_PICKUP_FROM_HUB, self::STATUS_AT_HUB, ); }
[ "public function getStatusCodes() {\n\t\treturn self::$statusCodes;\n\t}", "public static function getStatusCodes()\n {\n $codes = array();\n\n $reflectionClass = new \\ReflectionClass(__CLASS__);\n foreach ($reflectionClass->getConstants() as $constant => $value) {\n if (0 === strpos($constant, 'STATUS_')) {\n $codes[] = $value;\n }\n }\n\n return $codes;\n }", "public static function getOpenStates()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_ASSIGNED,\n self::STATUS_OVERDUE,\n ];\n }", "public function get_error_codes() {}", "public static function getStatusCodeList()\n {\n return [\n self::STATUS_CODE_AUTHORISED,\n self::STATUS_CODE_DECLINE,\n self::STATUS_CODE_REFUNDED,\n ];\n }", "function getStatusCode();", "public function getStatusCode()\n {\n return $this->shell->getReturnValue();\n }", "public function getStatus() {\n return $this->_sockcmd('STATUS', 210); \n }", "public function getHttpCodeStates()\n {\n return [\n [200, false],\n [100, false],\n [301, false],\n [400, true],\n [401, true],\n [403, true],\n [405, true],\n [500, true],\n [502, true]\n ];\n }", "static function getReopenableStatusArray() {\n return [self::CLOSED, self::SOLVED, self::WAITING];\n }", "public static function getStatus()\n {\n return Headers::getCode();\n }", "public function getStatusCode()\n {\n }", "public function getPollStatus()\n {\n return $this->extractData('open');\n }", "public function successCodes()\n\t{\n\t\treturn array(200);\n\t}", "public static function states() {\n return array(\n self::STATUS_OK, \n self::STATUS_FAILED, \n self::STATUS_EXCEPTION,\n self::STATUS_FATAL\n );\n }", "public function get_status_code() {\n\n\t\treturn $this->statusCode;\n\t}", "final public function readStatus() {}", "public function get_http_status() {\n\t\tif ($this->curl_error_num) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\n\t}", "public function getValidStatusCodes()\n {\n return array(\n self::STATUS_OK,\n self::STATUS_ACCEPTED,\n self::STATUS_NON_AUTHORITATIVE_INFORMATION,\n self::STATUS_NO_CONTENT,\n self::STATUS_RESET_CONTENT,\n self::STATUS_PARTIAL_CONTENT,\n self::STATUS_CREATED\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function build the export zip file.
protected function buildZipFile(array $config) { $file = FileHelper::buildZip($config["exportPath"], null, true); Log::info(sprintf("Built zipfile [%s]", basename($file))); }
[ "private function generateArchive()\n\t{\t\t\t\n\t\t$count = 0;\n\t\t$zip = new ZipArchive();\n\t\t$zip_file_name = md5(time()).\".zip\";\n\t\tif ($zip->open(_EXPORT_FOLDER_.$zip_file_name, ZipArchive::OVERWRITE) === true)\n\t\t{\n\t\t\tif (!$zip->addFromString('Config.xml', $this->xmlFile))\n\t\t\t\t$this->error = true;\n\t\t\twhile (isset($_FILES['mydoc_'.++$count]))\n\t\t\t{\n\t\t\t\tif (!$_FILES['mydoc_'.$count]['name'])\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!$zip->addFile($_FILES['mydoc_'.$count]['tmp_name'], 'doc/'.$_FILES['mydoc_'.$count]['name']))\n\t\t\t\t\t$this->error = true;\n\t\t\t}\n\t\t\tforeach ($this->variations as $row)\n\t\t\t{\n\t\t\t\t$array = explode('¤', $row);\n\t\t\t\t$this->archiveThisFile($zip, $array[1], _PS_ALL_THEMES_DIR_, 'themes/');\n\t\t\t}\n\t\t\tforeach ($this->to_export as $row)\n\t\t\t\tif (!in_array($row, $this->native_modules))\n\t\t\t\t\t$this->archiveThisFile($zip, $row, dirname(__FILE__).'/../../modules/', 'modules/');\n\t\t\t$zip->close();\n\t\t\tif ($this->error === false)\n\t\t\t{\n\t\t\t\tob_end_clean();\n\t\t\t\theader('Content-Type: multipart/x-zip');\n\t\t\t\theader('Content-Disposition:attachment;filename=\"'.$zip_file_name.'\"');\n\t\t\t\treadfile(_EXPORT_FOLDER_.$zip_file_name);\n\t\t\t\tunlink(_EXPORT_FOLDER_.$zip_file_name);\n\t\t\t\tdie ;\n\t\t\t}\n\t\t}\n\t\t$this->_html .= parent::displayError($this->l('An error occurred during the archive generation'));\n\t}", "private function generateZip()\r\n\t{\r\n\t\tLumine_Log::debug('Gerando arquivo ZIP');\r\n\t\t$raiz = $this->cfg->getProperty('class_path') . '/';\r\n\t\t$zipname = $this->cfg->getProperty('class_path') .'/lumine.zip';\r\n\t\t\r\n\t\tif( !is_writable($raiz))\r\n\t\t{\r\n\t\t\tLumine_Log::error('Nao e possivel criar arquivos em \"'.$raiz.'\". Verifique as permissoes.');\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t$zip = new dZip($zipname);\r\n\t\t$sufix = $this->cfg->getOption('class_sufix');\r\n\t\tif( !empty($sufix))\r\n\t\t{\r\n\t\t\t$sufix = '.' .$sufix;\r\n\t\t}\r\n\t\t$filename = str_replace('.', DIRECTORY_SEPARATOR, $this->cfg->getProperty('package'));\r\n\t\t$filename .= DIRECTORY_SEPARATOR;\r\n\t\t\r\n\t\treset($this->files);\r\n\t\tforeach($this->files as $classname => $content)\r\n\t\t{\r\n\t\t\tLumine_Log::debug('Adicionando '.$classname . ' ao ZIP');\r\n\t\t\t$name = $filename . $classname . $sufix . '.php';\r\n\t\t\t$zip->addFile($content, $name, 'Lumine Reverse', $content);\r\n\t\t}\r\n\t\t\r\n\t\t// adiciona os dto's\r\n\t\treset($this->dto_files);\r\n\t\t\r\n\t\t// 2010-11-05\r\n\t\t// permite configurar a pasta para gravar os dto's\r\n\t\t$dtopath = '';\r\n\t\tif( $this->cfg->getOption('dto_package') != '' ){\r\n\t\t\t$dtopath = str_replace('.','/', $this->cfg->getOption('dto_package'));\r\n\t\t}\r\n\t\t\r\n\t\tforeach($this->dto_files as $classname => $content)\r\n\t\t{\r\n\t\t\tLumine_Log::debug('Adicionando DTO '.$classname . ' ao ZIP');\r\n\t\t\t$name = $filename . 'dto/' . $dtopath . $classname . $sufix . '.php';\r\n\t\t\t$zip->addFile($content, $name, 'Lumine Reverse DTO', $content);\r\n\t\t}\r\n\t\t\r\n\t\t// models\r\n\t\t$path = $this->cfg->getOption('model_path') . '/';\r\n\t\t\r\n\t\tforeach($this->models as $item){\r\n\t\t\tLumine_Log::debug('Adicionando Model '.$classname . ' ao ZIP');\r\n\t\t\t\r\n\t\t\t$filename = $path . $item->getFileName();\r\n\t\t\t$content = $item->getContent();\r\n\t\t\t$zip->addFile($content, $filename, 'Lumine Reverse Model', $content);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// adiciona os controles\r\n\t\t$path = 'controls' . DIRECTORY_SEPARATOR;\r\n\t\tforeach($this->controls as $classname => $content)\r\n\t\t{\r\n\t\t\tLumine_Log::debug('Adicionando controle '.$classname . ' ao ZIP');\r\n\t\t\t$name = $path . $classname . '.php';\r\n\t\t\t$zip->addFile($content, $name, 'Lumine Reverse Control', $content);\r\n\t\t}\r\n\t\t\r\n\t\t$zip->addFile($this->config, 'lumine-conf.php', 'Configuration File', $this->config);\r\n\t\t$zip->save();\r\n\t\t// altera as permissoes do arquivo\r\n\t\tchmod($zipname, 0777);\r\n\t\t\r\n\t\tLumine_Log::debug('Arquivo ZIP gerado com sucesso em '.$zipname);\r\n\t\t\r\n\t\t/*\r\n\t\t$fp = @fopen($zipname, \"wb+\");\r\n\t\tif($fp)\r\n\t\t{\r\n\t\t\tfwrite($fp, $zip->getZippedfile());\r\n\t\t\tfclose($fp);\r\n\t\t\t\r\n\t\t\tchmod($zipname, 0777);\r\n\t\t\t\r\n\t\t\tLumine_Log::debug('Arquivo ZIP gerado com sucesso em '.$zipname);\r\n\t\t} else {\r\n\t\t\tLumine_Log::error('Falha ao gerar ZIP em '.$obj->getClassname().'. Verifique se a pasta existe e se tem direito de escrita.');\r\n\t\t\texit;\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t}", "public function buildExport()\r\n {\r\n\r\n $oTranslate = $this->getZendTranslate();\r\n $oZendDbSelect = $this->getZendDbSelect()\r\n ->order('r_country_calling_code_id asc');\r\n\r\n $aRetrievedData = array(\r\n 'Id' => 'r_country_calling_code_id',\r\n $oTranslate->translate('label_country_calling_code') => 'r_country_calling_code',\r\n $oTranslate->translate('label_actif') => 'r_country_calling_code_actif',\r\n );\r\n\r\n $oExport = new My_Data_Export_CSV(new My_Data_Export_Source_Adapter_Select($this->getMySearchEngine($oZendDbSelect)->getSelect()->from('r_countries_calling_codes', $aRetrievedData)));\r\n $sFileName = My_Env::getInstance()->getConfig()->path->tmp . '/' . Phoenix_Data_Export_Csv::buildFileName();\r\n if (false === file_put_contents($sFileName, $oExport->make())) {\r\n throw new \\RuntimeException('An error occurred while writing data into file \"' . $sFileName . '\"');\r\n }\r\n return $sFileName;\r\n }", "protected function createZipFile()\n {\n $this->log->info('Creating ZIP files with the exported files.');\n\n if (!extension_loaded('zlib') || !class_exists('ZipArchive'))\n {\n $this->log->warning('The zlip extension seems to be missing. The ZIP file could not be created!');\n\n return $this;\n } // if\n\n $zip = new \\ZipArchive();\n\n foreach ($this->orderedConfiguration as $config)\n {\n $masterConfig = array_search(true, $config, true);\n\n if ($masterConfig === false)\n {\n $this->log->error('The master configuration between ' . implode(', ', $config) . ' could not be found - need to skip.');\n continue;\n } // if\n\n $path = $this->configuration[$masterConfig]['path'];\n $cut = isys_strlen($path);\n $dirSegment = end(explode(DS, trim($path, DS)));\n\n if ($zip->open($path . $dirSegment . '.zip', \\ZipArchive::CREATE) === true)\n {\n $this->log->info('Creating ZIP \"' . $path . $dirSegment . '.zip' . '\".');\n\n if (is_array($this->exportedFiles[$masterConfig]))\n {\n foreach ($this->exportedFiles[$masterConfig] as $file)\n {\n $this->log->debug('Adding \"' . $file . '\"');\n $zip->addFile($file, substr($file, $cut));\n } // foreach\n } // if\n\n $zip->close();\n\n $this->log->notice(' > Finished!');\n } // if\n } // foreach\n\n return $this;\n }", "protected function generate_zip() {\n\t\t// If we're building an existing zip, remove the existing file first.\n\t\tif ( file_exists( $this->zip_file ) ) {\n\t\t\tunlink( $this->zip_file );\n\t\t}\n\t\t$this->exec( sprintf(\n\t\t\t'cd %s && find %s -print0 | sort -z | xargs -0 zip -Xuy %s 2>&1',\n\t\t\tescapeshellarg( $this->tmp_build_dir ),\n\t\t\tescapeshellarg( $this->slug ),\n\t\t\tescapeshellarg( $this->zip_file )\n\t\t), $zip_build_output, $return_value );\n\n\t\tif ( $return_value ) {\n\t\t\tthrow new Exception( __METHOD__ . ': ZIP generation failed, return code: ' . $return_value, 503 );\n\t\t}\n\t}", "function generateZipArchive() {\n\t\t$files = $this->dirToArray( self::$pluginDirectory );\n\t\t$this->buildFlatFile( $files );\n\n\t\t//check and create base directory if needed\n\t\t$upload_dir = wp_upload_dir();\n\t\t$base_dir = $upload_dir['basedir'] . '/bp-generator/';\n\t\t$base_url = $upload_dir['baseurl'] . '/bp-generator/';\n\t\t$time = time();\n\t\t$zipname = $base_dir . $_POST['plugin_file_slug'] . '-' . $time . '.zip';\n\t\t$zipurl = $base_url . $_POST['plugin_file_slug'] . '-' . $time . '.zip';\n\t\tif ( ! is_dir( $base_dir ) ) {\n\t\t\tmkdir( $base_dir, 0755 );\n\t\t}\n\n\t\t$search = [\n\t\t\t'a2 Plugin Blueprint',\n\t\t\t'a2PluginBlueprint',\n\t\t\t'a2-plugin-blueprint',\n\t\t\t'0.1.0',\n\t\t\t'https://github.com/asquaredstudio/a2PluginBlueprint',\n\t\t\t'WordPress plugin template',\n\t\t\t'(a)squaredstudio',\n\t\t\t'https://asquaredstudio.com'\n\t\t];\n\n\t\t$replace = [\n\t\t\t$_POST['plugin_label'],\n\t\t\t$_POST['plugin_namespace'],\n\t\t\t$_POST['plugin_file_slug'],\n\t\t\t$_POST['plugin_version'],\n\t\t\t$_POST['plugin_url'],\n\t\t\t$_POST['plugin_description'],\n\t\t\t$_POST['plugin_author'],\n\t\t\t$_POST['plugin_author_url'],\n\t\t];\n\n\t\t// Create a new zip archive\n\t\t$zip = new \\ZipArchive();\n\t\t$zip->open( $zipname, \\ZipArchive::CREATE );\n\n\n\t\t// Loop through all the results and create the new zip\n\t\tforeach ( $this->flatFileList as $node ) {\n\t\t\tswitch ( $node['type'] ) {\n\t\t\t\tcase 'directory':\n\t\t\t\t\t$dirname = str_replace( self::$pluginDirectory, '', $node['value'] );\n\t\t\t\t\t$zip->addEmptyDir( $dirname );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'file':\n\t\t\t\t\t$contents = str_replace( $search, $replace, file_get_contents( $node['value'] ) );\n\t\t\t\t\t$file = str_replace( self::$pluginDirectory, '', $node['value'] );\n\t\t\t\t\t$file = str_replace( $search, $replace, $file );\n\t\t\t\t\t$zip->addFromString( $file, $contents );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$zip->close();\n\t\t$result['url'] = $zipurl;\n\t\t$result['type'] = 'success';\n\t\techo json_encode( $result );\n\t\tdie();\n\t}", "protected function createZip() {\n $outFile = $this->getOutFile();\n\n $zip = new ZipArchive();\n $zip->open($outFile, ZIPARCHIVE::CREATE);\n\n foreach ($this->files as $file) {\n $zip->addFile($file);\n }\n\n $zip->close();\n\n return $outFile;\n }", "public function createModuleZip()\n\t{\n\t\t$zip = new ZipArchive();\n\t\t$zip->open(\"{$this->rootDirectory}/{$this->fullModule}.zip\", ZipArchive::CREATE);\n\t\tforeach ($this->directories as $directory)\n\t\t\t$zip->addEmptyDir(\"$directory\");\n\t\t$zip->addFile(\"{$this->directories['etc']}/config.xml\");\n\t\t$zip->addFile(\"{$this->namespace}/{$this->module}/{$this->fullModule}.xml\");\n\t\t$zip->close();\n\t}", "public function createZipArchive(): void {\n try {\n $version = $this->getPtVersion();\n $this->prepareStagingFolder($version);\n $filesystem = new Filesystem();\n if (!$filesystem->exists($this->outdir)) {\n $filesystem->mkdir($this->outdir, 0755);\n }\n\n $wversionzip = \"{$this->ptname}.{$version}.zip\";\n $woversionzip = \"{$this->ptname}.zip\";\n\n $wversionfname = self::$with_version_appended_fname;\n $woversionfname = self::$without_version_appended_fname;\n\n file_put_contents(\"{$this->outdir}{$wversionfname}\", $wversionzip);\n file_put_contents(\"{$this->outdir}{$woversionfname}\", $woversionzip);\n\n $this->zipDir(\"./{$this->ptname}\", \"{$this->outdir}{$wversionzip}\");\n $this->zipDir(\"./{$this->ptname}\", \"{$this->outdir}{$woversionzip}\");\n\n $this->deleteStagingFolder();\n } catch (Exception $exception) {\n echo $exception->getMessage();\n }\n }", "function export_zip($lp_id = null)\n {\n if ($this->debug > 0) { error_log('In aicc::export_zip method('.$lp_id.')', 0); }\n if (empty($lp_id)) {\n if (!is_object($this)) {\n return false;\n } else {\n $id = $this->get_id();\n if (empty($id)) {\n return false;\n } else {\n $lp_id = $this->get_id();\n }\n }\n }\n // Zip everything that is in the corresponding scorm dir.\n // Write the zip file somewhere (might be too big to return).\n $course_id = api_get_course_int_id();\n $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);\n $_course = api_get_course_info(api_get_course_id());\n\n $sql = \"SELECT * FROM $tbl_lp WHERE c_id = \".$course_id.\" id=\".$lp_id;\n $result = Database::query($sql);\n $row = Database::fetch_array($result);\n $LPname = $row['path'];\n $list = split('/', $LPname);\n $LPnamesafe = $list[0];\n //$zipfoldername = '/tmp';\n //$zipfoldername = '../../courses/'.$_course['directory'].'/temp/'.$LPnamesafe;\n $zipfoldername = api_get_path(SYS_COURSE_PATH).$_course['directory'].'/temp/'.$LPnamesafe;\n $scormfoldername = api_get_path(SYS_COURSE_PATH).$_course['directory'].'/scorm/'.$LPnamesafe;\n $zipfilename = $zipfoldername.'/'.$LPnamesafe.'.zip';\n\n // Get a temporary dir for creating the zip file.\n\n //error_log('New LP - cleaning dir '.$zipfoldername, 0);\n removeDir($zipfoldername); //make sure the temp dir is cleared\n mkdir($zipfoldername, api_get_permissions_for_new_directories());\n //error_log('New LP - made dir '.$zipfoldername, 0);\n\n // Create zipfile of given directory.\n $zip_folder = new PclZip($zipfilename);\n $zip_folder->create($scormfoldername.'/', PCLZIP_OPT_REMOVE_PATH, $scormfoldername.'/');\n\n //this file sending implies removing the default mime-type from php.ini\n //DocumentManager :: file_send_for_download($zipfilename, true, $LPnamesafe.\".zip\");\n DocumentManager :: file_send_for_download($zipfilename, true);\n\n // Delete the temporary zip file and directory in fileManage.lib.php\n my_delete($zipfilename);\n my_delete($zipfoldername);\n\n return true;\n }", "public function generate_zip_archive(): void {\n\t\t\tif ( empty( $this->work_dir ) ) {\n\t\t\t\t$this->init();\n\t\t\t}\n\n\t\t\tif ( empty( $this->zip_dir_path ) ) {\n\t\t\t\t$this->init_zip();\n\t\t\t}\n\n\t\t\t$zip = new ZipArchive();\n\n\t\t\t$result = $zip->open( $this->zip_archive_path, ZipArchive::CREATE | ZipArchive::OVERWRITE );\n\t\t\tif ( true !== $result ) {\n\t\t\t\tthrow new Exception( __( 'Unable to create the zip file.', 'learndash' ) );\n\t\t\t}\n\n\t\t\t// add files to the zip.\n\t\t\tforeach ( $this->files as $name => $path ) {\n\t\t\t\t$result = $zip->addFile( $path, $name );\n\t\t\t\tif ( true !== $result ) {\n\t\t\t\t\tthrow new Exception( __( 'Unable to add file to the zip file.', 'learndash' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add raw folders to the zip.\n\n\t\t\t$upload_dir = wp_upload_dir();\n\n\t\t\tforeach ( $this->raw_folders as $path ) {\n\t\t\t\t// get all files in the folder.\n\t\t\t\t$files = glob(\n\t\t\t\t\t$upload_dir['basedir'] . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . '*'\n\t\t\t\t);\n\n\t\t\t\tif ( ! empty( $files ) ) {\n\t\t\t\t\tforeach ( $files as $file ) {\n\t\t\t\t\t\t$file_name = basename( $file );\n\t\t\t\t\t\tif ( 'index.php' === $file_name ) { // skip index.php.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = $zip->addFile( $file, $path . DIRECTORY_SEPARATOR . $file_name );\n\t\t\t\t\t\tif ( true !== $result ) {\n\t\t\t\t\t\t\tthrow new Exception( __( 'Unable to add file to the zip file.', 'learndash' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = $zip->close();\n\n\t\t\tif ( true !== $result ) {\n\t\t\t\tthrow new Exception( __( 'Unable to save the zip file.', 'learndash' ) );\n\t\t\t}\n\n\t\t\t$this->remove_directory_recursively( $this->work_dir );\n\n\t\t\t/**\n\t\t\t * Fires after export zip archive is created.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t */\n\t\t\tdo_action( 'learndash_export_archive_created' );\n\t\t}", "public function onExport(){\r\n $stories = Input::get('checked');\r\n if(count($stories) >1){\r\n throw new ApplicationException('Please select maximum one storyline');\r\n }\r\n $downloadPath = 'uploads/temp_export/'.BackendAuth::getUser()->id;\r\n $archive_file = $downloadPath.'/'.rand(11111,99999).'.zip';\r\n if(!is_dir($downloadPath)){\r\n mkdir($downloadPath, 0777, true);\r\n }\r\n\r\n $zip = new ZipArchive;\r\n if ($zip->open($archive_file, ZIPARCHIVE::CREATE )) {\r\n $xmlName = '';\r\n /**\r\n * Creating the content to be written in xml file\r\n */\r\n foreach ($stories as $story) {\r\n $storyDetails = StoryModel::find($story);\r\n $xmlName = $storyDetails->id.'.xml';\r\n \r\n foreach ($storyDetails->pages as $key=>$page) {\r\n $pageDetails = Page::find($page->id);\r\n $xmlAsset = '';\r\n foreach ($pageDetails->assets as $asset) {\r\n $assetDetails = Asset::find($asset->id);\r\n $assetFile = 'assets/'.BackendAuth::getUser()->id.'/'.$assetDetails->file_name.'.htm';\r\n\r\n /**\r\n * Adding asset files in zip\r\n */\r\n if(file_exists($assetFile)){\r\n $zip->addFile($assetFile,'assets/'.$assetDetails->file_name.'.htm');\r\n }\r\n \r\n }\r\n foreach ($pageDetails->ltiobject as $object) {\r\n $ltiDetails = Ltiobject::find($object->id);\r\n $frame = rtrim($ltiDetails->launcher_url, '?').'==='.rtrim($ltiDetails->endpoint_url, '&').'==='.$ltiDetails->key.'==='.$ltiDetails->secret;\r\n $zip->addFromString('objects/'.$ltiDetails->object_name.'.htm', $frame);\r\n }\r\n $img ='';\r\n if($pageDetails->image){\r\n $img = basename($pageDetails->image->getPath());\r\n $zip->addFile($pageDetails->image->getLocalPath(), 'images/'.$img);\r\n } \r\n } \r\n }\r\n $zip->addFile('assets/'.$xmlName,$xmlName);\r\n $zip->close();\r\n\r\n /**\r\n * return download URL in ajax response\r\n */\r\n return (Backend::url('unisa\\storycore\\storycore\\download?file='.basename($archive_file)));\r\n \r\n\r\n }\r\n //add each files of $file_name array to archive\r\n }", "function buildExportFileXML()\n\t{\n\t\tglobal $ilBench;\n\n\t\t$ilBench->start(\"QuestionpoolExport\", \"buildExportFile\");\n\n\t\tinclude_once(\"./Services/Xml/classes/class.ilXmlWriter.php\");\n\t\t$this->xml = new ilXmlWriter;\n\n\t\t// set dtd definition\n\t\t$this->xml->xmlSetDtdDef(\"<!DOCTYPE Test SYSTEM \\\"http://www.ilias.uni-koeln.de/download/dtd/ilias_co.dtd\\\">\");\n\n\t\t// set generated comment\n\t\t$this->xml->xmlSetGenCmt(\"Export of ILIAS Test Questionpool \".\n\t\t\t$this->qpl_obj->getId().\" of installation \".$this->inst.\".\");\n\n\t\t// set xml header\n\t\t$this->xml->xmlHeader();\n\n\t\t// create directories\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\tilUtil::makeDir($this->export_dir.\"/\".$this->subdir);\n\t\tilUtil::makeDir($this->export_dir.\"/\".$this->subdir.\"/objects\");\n\n\t\t// get Log File\n\t\t$expDir = $this->qpl_obj->getExportDirectory();\n\t\tilUtil::makeDirParents($expDir);\n\n\t\tinclude_once \"./Services/Logging/classes/class.ilLog.php\";\n\t\t$expLog = new ilLog($expDir, \"export.log\");\n\t\t$expLog->delete();\n\t\t$expLog->setLogFormat(\"\");\n\t\t$expLog->write(date(\"[y-m-d H:i:s] \").\"Start Export\");\n\t\t\n\t\t// write qti file\n\t\t$qti_file = fopen($this->export_dir.\"/\".$this->subdir.\"/\".$this->qti_filename, \"w\");\n\t\tfwrite($qti_file, $this->qpl_obj->toXML($this->questions));\n\t\tfclose($qti_file);\n\n\t\t// get xml content\n\t\t$ilBench->start(\"QuestionpoolExport\", \"buildExportFile_getXML\");\n\t\t$this->qpl_obj->exportPagesXML($this->xml, $this->inst_id,\n\t\t\t$this->export_dir.\"/\".$this->subdir, $expLog, $this->questions);\n\t\t$ilBench->stop(\"QuestionpoolExport\", \"buildExportFile_getXML\");\n\n\t\t// dump xml document to screen (only for debugging reasons)\n\t\t/*\n\t\techo \"<PRE>\";\n\t\techo htmlentities($this->xml->xmlDumpMem($format));\n\t\techo \"</PRE>\";\n\t\t*/\n\n\t\t// dump xml document to file\n\t\t$ilBench->start(\"QuestionpoolExport\", \"buildExportFile_dumpToFile\");\n\t\t$this->xml->xmlDumpFile($this->export_dir.\"/\".$this->subdir.\"/\".$this->filename\n\t\t\t, false);\n\t\t$ilBench->stop(\"QuestionpoolExport\", \"buildExportFile_dumpToFile\");\n\t\t\n\t\t// add media objects which were added with tiny mce\n\t\t$ilBench->start(\"QuestionpoolExport\", \"buildExportFile_saveAdditionalMobs\");\n\t\t$this->exportXHTMLMediaObjects($this->export_dir.\"/\".$this->subdir);\n\t\t$ilBench->stop(\"QuestionpoolExport\", \"buildExportFile_saveAdditionalMobs\");\n\n\t\t// zip the file\n\t\t$ilBench->start(\"QuestionpoolExport\", \"buildExportFile_zipFile\");\n\t\tilUtil::zip($this->export_dir.\"/\".$this->subdir, $this->export_dir.\"/\".$this->subdir.\".zip\");\n\t\tif (@is_dir($this->export_dir.\"/\".$this->subdir))\n\t\t{\n\t\t\t// Do not delete this dir, since it is required for container exports\n\t\t\t#ilUtil::delDir($this->export_dir.\"/\".$this->subdir);\n\t\t}\n\n\t\t$ilBench->stop(\"QuestionpoolExport\", \"buildExportFile_zipFile\");\n\n\t\t// destroy writer object\n\t\t$this->xml->_XmlWriter;\n\n\t\t$expLog->write(date(\"[y-m-d H:i:s] \").\"Finished Export\");\n\t\t$ilBench->stop(\"QuestionpoolExport\", \"buildExportFile\");\n\n\t\treturn $this->export_dir.\"/\".$this->subdir.\".zip\";\n\t}", "public function generateExport()\n {\n }", "function export_file_extension() {\n return '.zip';\n }", "public function returnZipFile() {\n chdir(codemonkey_pathTempDir);\n $zipname = $this->config['projectname'].\".zip\";\n $zip = new ZipArchive();\n $zip->open($zipname, ZipArchive::CREATE);\n\n foreach ($this->listTempDir() as $file) {\n $zip->addFile($file);\n }\n $zip->close();\n\n header('Content-Type: application/zip');\n header('Content-disposition: attachment; filename='.$zipname);\n header('Content-Length: ' . filesize($zipname));\n readfile(codemonkey_pathTempDir.$zipname);\n unlink($zipname);\n $this->clearTempFolder();\n exit();\n }", "public function export()\n {\n $products = $this->getData();\n $xml = [];\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n $xml[] = '<products>';\n\n foreach ($products as $product)\n {\n $xml[] = '<product>';\n $xml[] = \"<id>{$product->id}</id>\";\n $xml[] = \"<title>{$product->title}</title>\";\n $xml[] = '</product>';\n }\n $xml[] = \"</products>\";\n\n $filename = 'XML/' . time() . '.xml';\n file_put_contents($filename, implode(PHP_EOL, $xml));\n return $filename;\n }", "public function __addon_export()\n {\n appengine_live_guard();\n\n $file = preg_replace('#^[\\_\\.\\-]#', 'x', preg_replace('#[^\\w\\.\\-]#', '_', post_param_string('name'))) . date('-dmY-Hi', time()) . '.tar';\n\n $files = array();\n foreach ($_POST as $key => $val) {\n if (!is_string($val)) {\n continue;\n }\n\n if (get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n\n if (substr($key, 0, 5) == 'file_') {\n $files[] = $val;\n }\n }\n\n create_addon(\n $file,\n $files,\n post_param_string('name'),\n post_param_string('incompatibilities'),\n post_param_string('dependencies'),\n post_param_string('author'),\n post_param_string('organisation'),\n post_param_string('version'),\n post_param_string('category'),\n post_param_string('copyright_attribution'),\n post_param_string('licence'),\n post_param_string('description')\n );\n\n $download_url = get_custom_base_url() . '/exports/addons/' . $file;\n\n log_it('EXPORT_ADDON', $file);\n\n // Show it worked / Refresh\n $_url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n $url = $_url->evaluate();\n $url = get_param_string('redirect', $url);\n return redirect_screen($this->title, $url, do_lang_tempcode('ADDON_CREATED', escape_html($download_url)));\n }", "function xml_create_archive()\n\t{\n\t\t$this->xml->xml_set_root( 'xmlarchive', array( 'generator' => 'IPB', 'created' => time() ) );\n\t\t$this->xml->xml_add_group( 'fileset' );\n\t\t\n\t\t$entry = array();\n\t\t\n\t\tforeach( $this->file_array as $f )\n\t\t{\n\t\t\t$content = array();\n\t\t\t\n\t\t\tforeach ( $f as $k => $v )\n\t\t\t{\n\t\t\t\tif ( $k == 'content' )\n\t\t\t\t{\n\t\t\t\t\t$v = chunk_split(base64_encode($v));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$content[] = $this->xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\t\t\t\n\t\t\t$entry[] = $this->xml->xml_build_entry( 'file', $content );\n\t\t}\n\t\t\n\t\t$this->xml->xml_add_entry_to_group( 'fileset', $entry );\n\t\t\n\t\t$this->xml->xml_format_document();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ComposeSentMessage() This functions is work a round for mother fucker twitter app!!! The function send message for twitter and "copy" to sent messages
function ComposeSentMessage($Message,$TwitterAccessToken,$TwitterAccessTokenSecret) { include("config.php"); require_once(''.$xlibpath.'/twitteroauth/twitteroauth.php'); $xDBConn = mysql_connect('localhost', $xDBUser, $xDBPass); $xDBSelect = mysql_select_db($xDBName); $xTwitterConn = new TwitterOAuth($xtConsummerKey, $xtConsummerSecret, $TwitterAccessToken, $TwitterAccessTokenSecret); $xTwitterConn->post('statuses/update', array('status' => "$Message")); boxlogger("Posting message $Message"); sleep(2); $BoxID=Get2boxid($TwitterAccessToken); $LastPost = $xTwitterConn->get('statuses/user_timeline',array('count' => 1)); foreach ($LastPost as $x) { $xIDSTR = $x->id_str; $xScreenName = $x->user->screen_name; $xText = $x->text; $xtDate = strtotime($x->created_at); $xDate = date('Y-m-d H:i:s', $xtDate); $xQueryNewRecord="INSERT INTO msgmentions VALUES (\"$BoxID\",\"$xIDSTR\",\"$xDate\",\"$xScreenName\",\"$xText\",\"sent\",\"\");"; mysql_query($xQueryNewRecord); boxlogger("Adding message ID $xIDSTR for BoxID $BoxID in Sent Folder"); } mysql_close($xDBConn); }
[ "public function twitter_send_message()\n\t{\n\t\theader ('Content-type: application/json');\n\t\t$this->load->library('twitteroauth');\n\t\t\n\t\t$twitter_user_id = $this->uri->segment(3);\n\n\t\t$access_token = $this->session->userdata('access_token');\n\n\t\t$twitteroauth = new TwitterOAuth('FYsfXE5zLY6vcVKTHfs1Q', 'ljQOwDBQZzomn2VKVF4znLZNiK8CC6pfUD5rkA64KnQ', $access_token['oauth_token'] , $access_token['oauth_token_secret'] );\n\t\t\n\t\t$value = $twitteroauth->post('direct_messages/new', array('user_id' => $twitter_user_id, 'text' =>\"Únete a mi ejercito en Guerreros de Luz, una comunidad guerreros en contra de la trata humana. http://guerrerosdeluz.org/ via @RM_Foundation\"));\n\t\tif(isset($value->id_str))\n\t\t{\n\t\t\techo json_encode (array ('response'=>'success', 'obj'=> $value));\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\techo json_encode (array ('response'=>'error'));\t\t\n\t\t}\n\t}", "function sendTweet($mensaje, $tweet,$settings){\n require_once('TwitterAPIExchange.php');\n \n $url = 'https://api.twitter.com/1.1/statuses/update.json';\n \n $requestMethod = 'POST';\n \n $postfields = array( 'status' => $mensaje,\n 'in_reply_to_status_id' => $tweet);\n\n $twitter = new TwitterAPIExchange($settings);\n \n return $twitter->buildOauth($url, $requestMethod)->setPostfields($postfields)->performRequest();\n }", "private function sendTweets(){\n\t\t$this->_st->setOAuth($this->config['oauth']['ckey'], $this->config['oauth']['csec'], $this->config['oauth']['atok'], $this->config['oauth']['asec']);\n\n\t\t$next = $this->_tq->getNext(); \n\n\t\tforeach($next as $tweet){\n\t\t\t$this->_st->postTweet($tweet['duser'], $tweet['dmessage']);\n\t\t\t$this->_st->getUser($tweet['duser']);\n\t\t\t$this->_tq->updateSent($tweet['tid']);\n\t\t\t$this->_tq->delete($tweet['tid']);\n\t\t}\n\t}", "public function twitterAction()\n {\n\n\t\t//$response = $this->twitter->directMessageSent();\n\t\t$this->twitter->status->update('Teste');\n\n\t\t$this->view->statusMsgs = $response;\n }", "function sendtweet($message)\n{\n\t$letters = array(\"å\",\"ä\",\"ö\",\"Å\",\"Ä\",\"Ö\");\n\t$replacers = array(\"&aring;\",\"&auml;\",\"&ouml;\",\"&Aring;\",\"&Auml;\",\"&Ouml;\");\n\t$info = \"......http://www.student.itn.liu.se/~simbe109/TNM065/project/startpage.php\";\n\n\t$resultmsg = $message; \n\n\t$resultmsg = substr($resultmsg,0,60); // shorten string to fit in a tweet plus the url\n\n\n\n\t$resultmsg = $resultmsg . $info; // add url\n\t$resultmsg = str_replace ($letters, $replacers, $resultmsg); // Trixar lite med å ä ö ...\n\t$resultmsg = utf8_encode($resultmsg);\n\n\t$settings = array(\n\n\t\t'oauth_access_token' => \"382616554-IbswNNEAls5mm5x0NeEOQI3Jd2MudOtxF8tHmrRZ\",\n\t\t'oauth_access_token_secret' => \"fQUpwVyNbxeKeISQssVbKURuVmuvBkjTbY7aZ54hFyEJb\",\n\t\t'consumer_key' => \"wpBwxDw5In2jwrPcR7GMPg\",\n\t\t'consumer_secret' => \"37oecgdkOHsYx0WG0V14IhwowmzURW6a85Bz5RZtxT0\"\n\t);\n\n\t$url = 'https://api.twitter.com/1.1/statuses/update.json';\n\t$requestMethod = 'POST';\n\n\t$twitter = new TwitterAPIExchange($settings);\n\n\t$postfields = array(\n\t 'status' => \"$resultmsg\" ); \n\n\t $twitter->buildOauth($url, $requestMethod)\n\t ->setPostfields($postfields)\n\t ->performRequest();\n}", "function sendMessage($username, $password, $nickname, $to, $messages){\n \n $identity = strtolower(urlencode(sha1($username, true)));\n \n //check chanel\n //if fail, add fail code into db\n try{\n $w = new WhatsProt($username, $nickname, false, $identity);\n $w->Connect();\n $w->LoginWithPassword($password);\n }catch(Exception $e) {\n $this->db->insert('sent_log',array('fromphone'=>$username, 'tophone'=>$to, 'type'=>'error', 'content'=>'connection error, please check chanel', 'state'=>'0'));\n return true;\n }\n \n //check content, send message and insert db\n foreach ($messages as $message){\n $dbobj = array();\n $dbobj['fromphone'] = $username;\n $dbobj['tophone'] = $to;\n \n $type = $message['kind'];\n $dbobj['type'] = $type;\n \n $content1 = $message['content1'];\n $dbobj['content'] = $content1;\n \n if ($type == \"text\"){\n $result = $w->sendMessage($to , $content1);\n }\n \n if ($type == \"image\"){\n $result = $w->sendMessageImage($to , $content1);\n while($w->pollMessage());\n }\n \n if ($type == \"video\"){\n $result = $w->sendMessageVideo($to , $content1);\n while($w->pollMessage());\n }\n \n if ($type == \"audio\"){\n //$base64 = base64_encode(hash_file(\"sha256\", $content1, true));\n //$size = $this->getRemoteFilesize($content1);\n \n //$w->sendMessageAudio($to , $content1, true, $size, $base64);\n $result = $w->sendMessageAudio($to , $content1);\n while($w->pollMessage());\n }\n \n if ($type == \"location\"){\n $content2 = $message['content2'];\n $content3 = $message['content3'];\n \n $dbobj['content'] = $content3;\n \n $result = $w->sendMessageLocation($to , $content1, $content2, $content3, null);\n //$w->sendMessage($to , \"123.471909\", \"41.62366\", 'Ji Chang Lu, Dongling Qu, Shenyang Shi, Liaoning Sheng, Áß±¹', null);\n while($w->pollMessage());\n }\n \n $dbobj['state'] = $result;\n \n $this->db->insert('sent_log',$dbobj);\n \n sleep(1);\n }\n \n $w->disconnect();\n return true;\n }", "function twittermessage( $user, $message, $consumer_key, $consumer_secret, $token, $secret ) {\n\n\trequire_once 'twitter/EpiCurl.php';\n\trequire_once 'twitter/EpiOAuth.php';\n\trequire_once 'twitter/EpiTwitter.php';\n\n\t$Twitter = new EpiTwitter( $consumer_key, $consumer_secret );\n\t$Twitter->setToken( $token, $secret );\n\n\t$direct_message = $Twitter->post_direct_messagesNew( array( 'user' => $user, 'text' => $message ) );\n\t$tweet_info = $direct_message->responseText;\n\n}", "public function actionShare() {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata);\n\n if ($request) {\n\n $query = new Query;\n $query\n ->from('user')\n ->where(['id' => $request->to_user_id])\n ->select(\"email_id, admin_name\");\n\n $command = $query->createCommand();\n $user = $command->queryOne();\n\n\n $message = new Share;\n $message->to_user_id = $request->to_user_id;\n $message->sender_name = $request->sender_name;\n $message->sender_email = $request->sender_email;\n $message->message = $request->message;\n $message->sent_time = date(\"Y-m-d H:i:s\");\n\n $message->insert();\n\n $messageToSend = $request->sender_name . \" shared this...\\n\\n\" . $request->message;\n Yii::$app->view->params = Yii::$app->commoncomponent->getBrand(1);\n Yii::$app->mailer->compose()\n ->setFrom([$message->sender_email => $request->sender_name])\n ->setTo($request->to_email)\n ->setSubject($request->subject)\n ->setTextBody($messageToSend)\n ->send();\n\n\n $status = 1;\n $response = 'Your message has been sent.';\n } else {\n $status = 0;\n $response = 'No Email Sent';\n }\n\n $this->setHeader(200);\n echo json_encode(array('status' => $status, 'data' => $response), JSON_PRETTY_PRINT);\n }", "public function action_send()\n\t{\n\t\tglobal $txt, $modSettings, $context;\n\n\t\t// Load in some text and template dependencies\n\t\tTxt::load('PersonalMessage');\n\t\ttheme()->getTemplates()->load('PersonalMessage');\n\n\t\t// Set the template we will use\n\t\t$context['sub_template'] = 'send';\n\n\t\t// Extract out the spam settings - cause it's neat.\n\t\tlist ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(',', $modSettings['pm_spam_settings']);\n\n\t\t// Set up some items for the template\n\t\t$context['page_title'] = $txt['send_message'];\n\t\t$context['reply'] = isset($this->_req->query->pmsg) || isset($this->_req->query->quote);\n\n\t\t// Check whether we've gone over the limit of messages we can send per hour.\n\t\tif (!empty($modSettings['pm_posts_per_hour']) && !allowedTo(array('admin_forum', 'moderate_forum', 'send_mail')) && $this->user->mod_cache['bq'] === '0=1' && $this->user->mod_cache['gq'] === '0=1')\n\t\t{\n\t\t\t// How many messages have they sent this last hour?\n\t\t\t$pmCount = pmCount($this->user->id, 3600);\n\n\t\t\tif (!empty($pmCount) && $pmCount >= $modSettings['pm_posts_per_hour'])\n\t\t\t{\n\t\t\t\tthrow new Exception('pm_too_many_per_hour', true, array($modSettings['pm_posts_per_hour']));\n\t\t\t}\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->_events->trigger('before_set_context', array('pmsg' => $this->_req->query->pmsg ?? ($this->_req->query->quote ?? 0)));\n\t\t}\n\t\tcatch (PmErrorException $e)\n\t\t{\n\t\t\t$this->messagePostError($e->namedRecipientList, $e->recipientList, $e->msgOptions);\n\t\t\treturn;\n\t\t}\n\n\t\t// Quoting / Replying to a message?\n\t\tif (!empty($this->_req->query->pmsg))\n\t\t{\n\t\t\t$pmsg = $this->_req->getQuery('pmsg', 'intval');\n\n\t\t\t// Make sure this is accessible (not deleted)\n\t\t\tif (!isAccessiblePM($pmsg))\n\t\t\t{\n\t\t\t\tthrow new Exception('no_access', false);\n\t\t\t}\n\n\t\t\t// Validate that this is one has been received?\n\t\t\t$isReceived = checkPMReceived($pmsg);\n\n\t\t\t// Get the quoted message (and make sure you're allowed to see this quote!).\n\t\t\t$row_quoted = loadPMQuote($pmsg, $isReceived);\n\t\t\tif ($row_quoted === false)\n\t\t\t{\n\t\t\t\tthrow new Exception('pm_not_yours', false);\n\t\t\t}\n\n\t\t\t// Censor the message.\n\t\t\t$row_quoted['subject'] = censor($row_quoted['subject']);\n\t\t\t$row_quoted['body'] = censor($row_quoted['body']);\n\n\t\t\t// Lets make sure we mark this one as read\n\t\t\tmarkMessages($pmsg);\n\n\t\t\t// Figure out which flavor or 'Re: ' to use\n\t\t\t$context['response_prefix'] = response_prefix();\n\n\t\t\t$form_subject = $row_quoted['subject'];\n\n\t\t\t// Add 'Re: ' to it....\n\t\t\tif ($context['reply'] && trim($context['response_prefix']) !== '' && Util::strpos($form_subject, trim($context['response_prefix'])) !== 0)\n\t\t\t{\n\t\t\t\t$form_subject = $context['response_prefix'] . $form_subject;\n\t\t\t}\n\n\t\t\t// If quoting, lets clean up some things and set the quote header for the pm body\n\t\t\tif (isset($this->_req->query->quote))\n\t\t\t{\n\t\t\t\t// Remove any nested quotes and <br />...\n\t\t\t\t$form_message = preg_replace('~<br ?/?' . '>~i', \"\\n\", $row_quoted['body']);\n\t\t\t\t$form_message = removeNestedQuotes($form_message);\n\n\t\t\t\tif (empty($row_quoted['id_member']))\n\t\t\t\t{\n\t\t\t\t\t$form_message = '[quote author=&quot;' . $row_quoted['real_name'] . '&quot;]' . \"\\n\" . $form_message . \"\\n\" . '[/quote]';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$form_message = '[quote author=' . $row_quoted['real_name'] . ' link=action=profile;u=' . $row_quoted['id_member'] . ' date=' . $row_quoted['msgtime'] . ']' . \"\\n\" . $form_message . \"\\n\" . '[/quote]';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$form_message = '';\n\t\t\t}\n\n\t\t\t// Do the BBC thang on the message.\n\t\t\t$bbc_parser = ParserWrapper::instance();\n\t\t\t$row_quoted['body'] = $bbc_parser->parsePM($row_quoted['body']);\n\n\t\t\t// Set up the quoted message array.\n\t\t\t$context['quoted_message'] = array(\n\t\t\t\t'id' => $row_quoted['id_pm'],\n\t\t\t\t'pm_head' => $row_quoted['pm_head'],\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row_quoted['real_name'],\n\t\t\t\t\t'username' => $row_quoted['member_name'],\n\t\t\t\t\t'id' => $row_quoted['id_member'],\n\t\t\t\t\t'href' => !empty($row_quoted['id_member']) ? getUrl('profile', ['action' => 'profile', 'u' => $row_quoted['id_member']]) : '',\n\t\t\t\t\t'link' => !empty($row_quoted['id_member']) ? '<a href=\"' . getUrl('profile', ['action' => 'profile', 'u' => $row_quoted['id_member']]) . '\">' . $row_quoted['real_name'] . '</a>' : $row_quoted['real_name'],\n\t\t\t\t),\n\t\t\t\t'subject' => $row_quoted['subject'],\n\t\t\t\t'time' => standardTime($row_quoted['msgtime']),\n\t\t\t\t'html_time' => htmlTime($row_quoted['msgtime']),\n\t\t\t\t'timestamp' => forum_time(true, $row_quoted['msgtime']),\n\t\t\t\t'body' => $row_quoted['body']\n\t\t\t);\n\t\t}\n\t\t// A new message it is then\n\t\telse\n\t\t{\n\t\t\t$context['quoted_message'] = false;\n\t\t\t$form_subject = '';\n\t\t\t$form_message = '';\n\t\t}\n\n\t\t// Start of like we don't know where this is going\n\t\t$context['recipients'] = array(\n\t\t\t'to' => array(),\n\t\t\t'bcc' => array(),\n\t\t);\n\n\t\t// Sending by ID? Replying to all? Fetch the real_name(s).\n\t\tif (isset($this->_req->query->u))\n\t\t{\n\t\t\t// If the user is replying to all, get all the other members this was sent to..\n\t\t\tif ($this->_req->query->u === 'all' && isset($row_quoted))\n\t\t\t{\n\t\t\t\t// Firstly, to reply to all we clearly already have $row_quoted - so have the original member from.\n\t\t\t\tif ($row_quoted['id_member'] != $this->user->id)\n\t\t\t\t{\n\t\t\t\t\t$context['recipients']['to'][] = array(\n\t\t\t\t\t\t'id' => $row_quoted['id_member'],\n\t\t\t\t\t\t'name' => htmlspecialchars($row_quoted['real_name'], ENT_COMPAT),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Now to get all the others.\n\t\t\t\t$context['recipients']['to'] = array_merge($context['recipients']['to'], isset($pmsg) ? loadPMRecipientsAll($pmsg) : array());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$users = array_map('intval', explode(',', $this->_req->query->u));\n\t\t\t\t$users = array_unique($users);\n\n\t\t\t\t// For all the member's this is going to, get their display name.\n\t\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\t\t$result = getBasicMemberData($users);\n\n\t\t\t\tforeach ($result as $row)\n\t\t\t\t{\n\t\t\t\t\t$context['recipients']['to'][] = array(\n\t\t\t\t\t\t'id' => $row['id_member'],\n\t\t\t\t\t\t'name' => $row['real_name'],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get a literal name list in case the user has JavaScript disabled.\n\t\t\t$names = array();\n\t\t\tforeach ($context['recipients']['to'] as $to)\n\t\t\t{\n\t\t\t\t$names[] = $to['name'];\n\t\t\t}\n\t\t\t$context['to_value'] = empty($names) ? '' : '&quot;' . implode('&quot;, &quot;', $names) . '&quot;';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$context['to_value'] = '';\n\t\t}\n\n\t\t// Set the defaults...\n\t\t$context['subject'] = $form_subject;\n\t\t$context['message'] = str_replace(array('\"', '<', '>', '&nbsp;'), array('&quot;', '&lt;', '&gt;', ' '), $form_message);\n\n\t\t// And build the link tree.\n\t\t$context['linktree'][] = array(\n\t\t\t'url' => getUrl('action', ['action' => 'pm', 'sa' => 'send']),\n\t\t\t'name' => $txt['new_message']\n\t\t);\n\n\t\t// Needed for the editor.\n\t\trequire_once(SUBSDIR . '/Editor.subs.php');\n\n\t\t// Now create the editor.\n\t\t$editorOptions = array(\n\t\t\t'id' => 'message',\n\t\t\t'value' => $context['message'],\n\t\t\t'height' => '250px',\n\t\t\t'width' => '100%',\n\t\t\t'labels' => array(\n\t\t\t\t'post_button' => $txt['send_message'],\n\t\t\t),\n\t\t\t'preview_type' => 2,\n\t\t);\n\n\t\t// Trigger the prepare_send_context PM event\n\t\t$this->_events->trigger('prepare_send_context', array('editorOptions' => &$editorOptions));\n\n\t\tcreate_control_richedit($editorOptions);\n\n\t\t// No one is bcc'ed just yet\n\t\t$context['bcc_value'] = '';\n\n\t\t// Register this form and get a sequence number in $context.\n\t\tcheckSubmitOnce('register');\n\t}", "public function sendMessage() {\n // Retrieving data from fetch\n $contentType = isset($_SERVER[\"CONTENT_TYPE\"]) ? trim($_SERVER[\"CONTENT_TYPE\"]) : '';\n if ($contentType === \"application/json\") {\n //Receiving the RAW post data.\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n\n // Creating a new message object with appropriate properties, and saving it\n $chat_id = $decoded['chatId'];\n $message_body = filter_var($decoded['newPostMessage'], FILTER_SANITIZE_SPECIAL_CHARS);\n $message = new Messages();\n $message->setChatId($chat_id);\n $message->setMessage($message_body);\n $message->setAuthorId($_SESSION['id']);\n $message->save();\n\n //Updating chat updated at property (used to sort chats according to most recent messages)\n $chat = Chats::find($chat_id);\n $chat->setUpdatedAt(new DateTime());\n $chat->save();\n\n //Sending response to be displayed on appropriate chat\n header('Content-type: application/json');\n header('Access-Control-Allow-Origin', '*');\n header('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE');\n echo json_encode($decoded['chatId']);\n \n }\n \n }", "abstract function sendMessage($screenname, $body);", "public function sendsAction()\n\t{\n\t\t$user = Application_Model_User::getAuth();\n\n\t\tif ($user == null)\n\t\t{\n\t\t\tthrow new RuntimeException('You are not authorized to access this action');\n\t\t}\n\n\t\t$model = new Application_Model_Conversation;\n\t\t$paginator = Zend_Paginator::factory(\n\t\t\t$model->select()\n\t\t\t\t->setIntegrityCheck(false)\n\t\t\t\t->from(array('c' => 'conversation'), array(\n\t\t\t\t\t'c.id',\n\t\t\t\t\t'c.subject',\n\t\t\t\t\t'c.created_at',\n\t\t\t\t\t'user_name' => 'u.Name',\n\t\t\t\t\t'is_read' => 'IFNULL(cm.is_read,1)'\n\t\t\t\t))\n\t\t\t\t->where('c.from_id=?', $user['id'])\n\t\t\t\t->joinLeft(array('cm' => 'conversation_message'), '(cm.conversation_id=c.id AND ' .\n\t\t\t\t\t'cm.is_read=0 AND cm.from_id=' . $user['id'] . ')', '')\n\t\t\t\t->joinLeft(array('u' => 'user_data'), 'u.id=c.to_id', [\n\t\t\t\t\t'u_image_id' => 'u.image_id',\n\t\t\t\t\t'u_image_name' => 'u.image_name'\n\t\t\t\t])\n\t\t\t\t->group('c.id')\n\t\t\t\t->order('c.created_at DESC')\n\t\t);\n\t\t$paginator->setCurrentPageNumber($this->_request->getParam('page', 1));\n\t\t$paginator->setItemCountPerPage(14);\n\n\t\t$this->view->userTimezone = Application_Model_User::getTimezone($user);\n\t\t$this->view->paginator = $paginator;\n\t\t$this->view->hideRight = true;\n\n\t\t$this->view->headScript()->appendFile(My_Layout::assetUrl('www/scripts/messageindex.js'));\n\t}", "public function sendmsg()\n\t{\n\t\t$xhr = new Xhr();\n\t\tif($this->mayConversation($_POST['c']))\n\t\t{\n\t\t\tS::noWrite();\n\n\t\t\tif(isset($_POST['b']))\n\t\t\t{\n\t\t\t\t$body = trim($_POST['b']);\n\t\t\t\t$body = htmlentities($body);\n\t\t\t\tif(!empty($body))\n\t\t\t\t{\n\t\t\t\t\tif($message_id = $this->model->sendMessage($_POST['c'],$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$xhr->setStatus(1);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * for not so db intensive polling store updates in memcache if the recipients are online\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif($member = $this->model->listConversationMembers($_POST['c']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($member as $m)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($m['id'] != fsId())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tMem::userAppend($m['id'], 'msg-update', (int)$_POST['c']);\n\n\t\t\t\t\t\t\t\t\tsendSock($m['id'],'conv', 'push', array(\n\t\t\t\t\t\t\t\t\t\t'id' => $message_id,\n\t\t\t\t\t\t\t\t\t\t'cid' => (int)$_POST['c'],\n\t\t\t\t\t\t\t\t\t\t'fs_id' => fsId(),\n\t\t\t\t\t\t\t\t\t\t'fs_name' => S::user('name'),\n\t\t\t\t\t\t\t\t\t\t'fs_photo' => S::user('photo'),\n\t\t\t\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t\t\t\t'time' => date('Y-m-d H:i:s')\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t * send an E-Mail if the user is not online\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\tif($this->model->wantMsgEmailInfo($m['id']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$this->convMessage($m, $_POST['c'], $body);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$xhr->addData('msg', array(\n\t\t\t\t\t\t\t'id' => $message_id,\n\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t'time' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'fs_photo' => S::user('photo'),\n\t\t\t\t\t\t\t'fs_name' => S::user('name'),\n\t\t\t\t\t\t\t'fs_id' => fsId()\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$xhr->send();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xhr->addMessage(s('error'),'error');\n\t\t$xhr->send();\n\t}", "function attach_message_su(&$messages_bottom)\n{\n $unsu_link = get_self_url(true, true, array('keep_su' => null));\n $su_username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $messages_bottom->attach(do_template('MESSAGE', array(\n '_GUID' => '13a41a91606b3ad05330e7d6f3e741c1',\n 'TYPE' => 'notice',\n 'MESSAGE' => do_lang_tempcode('USING_SU', escape_html($unsu_link), escape_html($su_username)),\n )));\n}", "public function SendMessage(){\n\t\t$receive_team=MakeItemString(DispFunc::X1Clean($_POST['receiveteam']));\n\t\tModifySql(\"insert into\", X1_DB_messages, \n\t\t\"(randid, messid, message, hasread, steam_id, sender, rteam_id, tstamp) \n\t\tvalues (\".MakeItemString(DispFunc::X1Clean($_POST['randid'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['messagecount'])).\", \n\t\t\".MakeItemString(trim(DispFunc::X1Clean($_POST['x1_hometext'],$cleantype=3))).\", \n\t\t\".MakeItemString(0).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sendteam'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sender'])).\", \n\t\t\".$receive_team.\", \n\t\t\".MakeItemString(time()).\")\");\n\t\n\t\tModifySql(\"update\", X1_DB_teams, \"set totalnmessag=totalnmessag+1 where team_id = \".$receive_team);\t\n\t}", "function sendsms($mobilenumbers, $message)\n {\n // echo \"mobiile\". $mobilenumbers;\n // echo \"message\".$message;\n\n\n\n\n\n // $data = \"username=\".$username.\"&hash=\".$hash.\"&message=\".$message.\"&sender=\".$sender.\"&numbers=\".$numbers.\"&test=\".$test;\n // $ch = curl_init('http://api.textlocal.in/send/?');\n // curl_setopt($ch, CURLOPT_POST, true);\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n // $result = curl_exec($ch); // This is the result from the API\n // curl_close($ch);\n // return $response;\n\n $profile_id = 't5umdaa';\n $api_key = '010km0X150egpk3lD9dQ';\n $sender_id = 'UMDAAO';\n $mobile = $mobilenumbers;\n $sms_text = urlencode($message);\n\n //Submit to server\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://www.nimbusit.info/api/pushsms.php?\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"user=\" . $profile_id . \"&key=\" . $api_key . \"&sender=\" . $sender_id . \"&mobile=\" . $mobile . \"&text=\" . $sms_text);\n $response = curl_exec($ch);\n return $response;\n curl_close($ch);\n }", "function send_message_group($key, $message,$from = NULL){\n\tif ($from) $message.=\" DE: \".$from;\n\t$ci = &get_instance();\n\t$ci->load->model(\"user_model\");\n\t$ci->load->model(\"outbox_model\");\n\t$Users_dest = $ci->user_model->getWhere(array(\"keyword\" => $key));\n\tforeach($Users_dest as $dest):\n\t$outbox[\"number\"] = $dest[\"numtel\"];\n\t$outbox[\"text\"] = convert_accented_characters($message);\n\t$ci->outbox_model->add($outbox);\n\tendforeach;\n}", "public function send_sms() {\n\t\t$vars = array();\n\t\t$vars['length_blog_name'] = strlen( get_bloginfo( 'name' ) );\n\t\t$vars['length_blog_url'] = strlen( home_url() );\n\n\t\t$this->render_admin( 'send-sms.php', $vars);\n\t}", "public function AdminSendMessage(){\n\t\t$send_team=MakeItemString(DispFunc::X1Clean($_POST['sendteam']));\n\t\t$receive_team=MakeItemString(DispFunc::X1Clean($_POST['receiveteam']));\n\t\t\n\t\tModifySql(\"insert into\", X1_DB_messages, \"(randid,messid,message,hasread,steam_id,sender,rteam_id,tstamp) \n\t\tvalues (\".MakeItemString(DispFunc::X1Clean($_POST['randid'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['messagecount'])).\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['x1_hometext'],$cleantype=3)).\", \n\t\t0,\n\t\t\".$send_team.\", \n\t\t\".MakeItemString(DispFunc::X1Clean($_POST['sender'])).\", \n\t\t\".$receive_team.\", \n\t\t\".time().\")\");\n\t\t\n\t\tModifySql(\"update\", X1_DB_teams, \"set totalnmessag=totalnmessag+1 where team_id = \".$receive_team.\" or team_id = \".$send_team);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies any column filters to the data.
private function applyFilters() { if (empty($this->filters)) { return; } foreach ($this->filters as $filter) { $column = $filter[0]; $callback = $filter[1]; foreach ($this->data as $row_id => $row_data) { if ($row_data !== CONSOLE_TABLE_HORIZONTAL_RULE) { $this->data[$row_id][$column] = call_user_func($callback, $row_data[$column]); } } } }
[ "protected function applyColumnFilter()\n {\n $this->columns->each->bindFilterQuery($this->model());\n }", "function _applyFilters()\n {\n if (!empty($this->_filters)) {\n foreach ($this->_filters as $filter) {\n $column = $filter[0];\n $callback = $filter[1];\n\n foreach ($this->_data as $row_id => $row_data) {\n if ($row_data !== CONSOLE_TABLE_HORIZONTAL_RULE) {\n $this->_data[$row_id][$column] = call_user_func($callback, $row_data[$column]);\n }\n }\n }\n }\n }", "public function applyFilters()\n {\n $newRows = array();\n\n foreach ($this->row as $rowIndex => $row) {\n if ($this->checkFiltering($row)) {\n $newRows[] = $row;\n }\n }\n\n $this->rows = &$newRows;\n }", "private function processColumnFilters()\n {\n $columns = $this->getColumns();\n\n foreach ($columns as $column) {\n // caso coluna tenha filtro\n if ($column->hasFilter())\n // seto grid com filtro\n $this->setHasFilter(true);\n }\n\n return $this;\n }", "public function dtPerformColumnFilter($columns);", "protected function initColumns()\n {\n if ($this->_columns) foreach($this->_columns as $name => $col)\n {\n if (is_string($col)) {\n $column = $this->createDataColumn($col);\n } else {\n $column = Yii::createObject(array_merge($col, [\n 'class' => empty($col['class']) ? DataColumn::className() : __NAMESPACE__.'\\\\'.$col['class'],\n 'grid' => $this\n ]));\n }\n\n if(!$column->visible) {\n unset($this->_columns[$i]);\n continue;\n }\n $this->_columns[$i]=$column;\n }\n\n if ($this->_columns) foreach($this->_columns as $column) {\n $column->init();\n\n $filterValue = ($this->filter && $column->name && isset($this->filter[$column->name])) ? $this->filter[$column->name] : null;\n $this->filterPrepared[$column->name] = $column->prepareFilterValue($filterValue);\n\n }\n }", "public function columnFilter(array $columns);", "private function setStandardFilters() {\n $source = $this->_grid->getSource()->execute();\n\n $filters = new Bvb_Grid_Filters();\n foreach ($source[0] as $column => $content) {\n $filters->addFilter($column);\n }\n $this->_grid->addFilters($filters);\n }", "function applyFilters()\n {\n foreach ($this->_files as &$file_data)\n {\n foreach ($this->_filters as $name => $func)\n {\n $file_data['filtered'][$name] = $func($file_data);\n }\n }\n }", "private function verifyCustomFilterColumns()\n {\n if (is_array($this->filterAndSortOnColumns) && sizeOf($this->filterAndSortOnColumns) > 0) {\n $this->filterEnabledTableColumnCollection = collect($this->filterAndSortOnColumns);\n } else {\n $this->filterEnabledTableColumnCollection = collect($this->tableColumns);\n }\n }", "public function set_column_filtering($parsed_data, $table_name)\n {\n $column_filtering_data = $parsed_data['column_filtering_data'];\n \n foreach ($column_filtering_data as $filtering_data) {\n \n foreach ($filtering_data as $key => $value) {\n \n $this->session->set_userdata($table_name . \"_\" . $key, $value);\n }\n }\n }", "protected function applyColumns()\n {\n $columns = [];\n $newColumns = [];\n foreach ($this->columns as $column) {\n $order = ArrayHelper::getValue($column, 'order', self::ORDER_MIDDLE);\n if ($order == self::ORDER_FIX_LEFT) {\n $newColumns = $column;\n unset($column['order']);\n $columns[] = $column;\n }\n }\n foreach ($this->_visibleKeys as $key) {\n if (empty($this->_columns[$key])) {\n continue;\n }\n $column = $this->_columns[$key];\n $newColumns = $column;\n if (isset($column['order'])) {\n unset($column['order']);\n }\n if (isset($column['visible'])) {\n unset($column['visible']);\n }\n $columns[] = $column;\n }\n foreach ($this->columns as $column) {\n $order = ArrayHelper::getValue($column, 'order', self::ORDER_MIDDLE);\n if ($order == self::ORDER_FIX_RIGHT) {\n $newColumns = $column;\n unset($column['order']);\n $columns[] = $column;\n }\n }\n $this->columns = $newColumns;\n $this->gridOptions['columns'] = $columns;\n }", "private function reset_filters()\r\n\t\t{\r\n\t\t\tforeach ($this->c_columns as $key_column => &$val_column)\r\n\t\t\t{\r\n\t\t\t\tif(isset($val_column['filter']))\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($val_column['filter']);\r\n\t\t\t\t}\r\n\t\t\t\tunset($this->c_columns[$key_column]['taglov_possible']);\r\n\t\t\t}\r\n\r\n\t\t\t$this->check_column_lovable();\r\n\t\t}", "protected function updateFilterDefs()\n {\n // Start by collecting all of the filters rows within a statement\n $sql = 'SELECT\n id, filter_template, filter_definition, module_name\n FROM\n filters\n WHERE deleted = 0';\n $stmt = $this->db->getConnection()->executeQuery($sql);\n\n // For each row, investigate whether we need to update the data and, if so,\n // get it updated\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n // Run the row through the converter. If something changed then\n // handle saving that change\n $row = $this->convertRow($row);\n if ($row['converted']) {\n $this->handleUpdate($row['converted'], ['id' => $row['id']]);\n }\n }\n }", "public function getDefaultFilterColumns();", "private function handle_columns()\n {\n if (empty($this->columns)) {\n return;\n }\n\n $custom_post_types = DiviRoids_Queries::query_divi_registered_post_types();\n\n foreach ($custom_post_types as $key => $value) {\n add_filter('manage_' . $key . '_posts_columns', array( $this, 'add_columns' ));\n add_action('manage_' . $key . '_posts_custom_column', array( $this, 'add_value' ), 500, 2);\n }\n }", "private function applyQueryFilters()\n {\n if (is_array($this->queryFilter())) {\n $this->createQueryFilter();\n } else {\n $this->queryFilter();\n }\n\n $this->queryFilterRequest();\n }", "public function filterRows()\n {\n if (!empty($this->request->query())) {\n $columns = $this->getGrid()->getColumns();\n $tableColumns = $this->getValidGridColumns();\n\n foreach ($columns as $columnName => $columnData) {\n // skip rows that are not to be filtered\n if (!$this->canFilter($columnName, $columnData)) {\n continue;\n }\n // user input check\n if (!$this->canUseProvidedUserInput($this->getRequest()->get($columnName))) {\n continue;\n }\n // column check. Since the column data is coming from a user query\n if (!$this->canUseProvidedColumn($columnName, $tableColumns)) {\n continue;\n }\n $operator = $this->extractFilterOperator($columnName, $columnData)['operator'];\n\n $this->doFilter($columnName, $columnData, $operator, $this->getRequest()->get($columnName));\n }\n }\n }", "public function apply(FilterDatasourceAdapterInterface $ds, $data);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get first related permission by the given uuid, or fails if not found.
public function firstPermissionWithUuidOrFail(Role $role, string $uuid): Permission { return $role->permissions() ->where('uuid', '=', $uuid) ->firstOrFail(); }
[ "private function getPermissionById($id)\n {\n return $this->permissions()->getRelated()->where('id', $id)->first();\n }", "public static function get_permission($permission_slug) {\n $p = \\R::findOne('permission', ' slug=? ', array($permission_slug));\n if ($p->id) {\n return $p;\n } else {\n return false;\n }\n }", "public function find(int $id): Permission\n {\n return Permission::find($id);\n }", "public function getPermissionForId($id);", "public static function getPermission($permission) {\n $params = self::getPermissionParts($permission);\n return static::where($params)->first();\n }", "public function permissionFetchById($permission_id);", "public function find($id)\n {\n return $this->permission->find($id);\n }", "public static function findUuid($uuid)\n {\n return static::where('uuid', $uuid)->first();\n }", "public static function existeUuid($uuid){\n return self::where('uuid',$uuid)->first();\n }", "public function findPermissionById($permissionId);", "public function findByName($name)\n {\n $permission = $this->model->where('name', $name)->first();\n\n if (!$permission) {\n throw new PermissionDoesNotExist();\n }\n\n return $permission;\n }", "function getMyPermissionWithID( $id = false )\r\n {\r\n if ( $id === false )\r\n {\r\n throw new Exception( __METHOD__.\" error, invalid parameter given!\" );\r\n }\r\n \r\n if ( is_numeric( $id ) )\r\n { \r\n foreach( $this->permissions as $permObj )\r\n { \r\n if ( is_object($permObj) && $permObj->getId() == $id )\r\n {\r\n return $permObj;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n foreach( $this->permissions as $permObj )\r\n { \r\n if ( $permObj->getName() == $id )\r\n {\r\n return $permObj;\r\n }\r\n } \r\n }\r\n \r\n return false;\r\n }", "public function getByUuid(string $uuid);", "public function find(string $uuid): ?Metadata\n {\n return $this->list[strtolower($uuid)] ?? null;\n }", "public function findOneByName(string $permissionName);", "function permission_first_or_create($permission)\n {\n try {\n return Permission::create(['name' => $permission]);\n } catch (PermissionAlreadyExists $e) {\n return Permission::findByName($permission);\n }\n }", "public function findPermission($user, $object, $permission);", "public function getPermissionsForUuid($accessEntityUuid);", "public function getPerm()\n {\n return $this->hasOne(AuthPermission::className(), ['id' => 'perm_id']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scan shell for all available commands and remember it.
protected function _scanShell($fullName) { $fullName = Inflector::camelize($fullName); $className = App::className($fullName, 'Shell', 'Shell'); $Shell = new $className($this->_io); $Shell->params['requested'] = true; $Shell->initialize(); $Shell->startup(); $Shell->OptionParser = $Shell->getOptionParser(); if ($fullName != 'Bake') { foreach ($Shell->taskNames as $task) { $taskParser = $Shell->{$task}->getOptionParser(); $subcommands = $Shell->OptionParser->subcommands(); $taskName = Inflector::underscore($task); if (isset($subcommands[$taskName])) { continue; } $Shell->OptionParser->addSubcommand($taskName, [ 'help' => $taskParser->description(), 'parser' => $taskParser ]); } } $this->_addCommand($Shell->OptionParser->toArray(), $Shell->OptionParser); }
[ "private function scanCommands() {\n $dirIterator = new DirectoryIterator(__DIR__.'/Command');\n $commandsIt = new RegexIterator(new IteratorIterator($dirIterator), '/^.+\\Cmd.php$/', RegexIterator::GET_MATCH);\n $commandNameSpace = __NAMESPACE__.'\\\\Command\\\\';\n foreach ($commandsIt as $info) {\n $commandName = $commandNameSpace.pathinfo($info[0], PATHINFO_FILENAME);\n if (is_subclass_of($commandName, $commandNameSpace.'Command')) {\n $command = new $commandName($this->cli);\n $this->commands[$command->getName()] = $command;\n }\n }\n }", "protected function _listAvailableShells() {\n\t\t$shellList = $this->Command->getShellList();\n\t\t$plugins = Plugin::loaded();\n\t\t$shells = [];\n\t\tforeach ($shellList as $plugin => $commands) {\n\t\t\tforeach ($commands as $command) {\n\t\t\t\t$callable = $command;\n\t\t\t\tif (in_array($plugin, $plugins)) {\n\t\t\t\t\t$callable = Inflector::camelize($plugin) . '.' . $command;\n\t\t\t\t}\n\n\t\t\t\t$shells[] = [\n\t\t\t\t\t'name' => $command,\n\t\t\t\t\t'call_as' => $callable,\n\t\t\t\t\t'provider' => $plugin,\n\t\t\t\t\t'help' => $callable . ' -h'\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $shells;\n\t}", "function execCmds() {\n\tglobal $commands;\n\tforeach ($commands as $idx => $command) {\n\t\tshowCmdT($idx, $command);\n\t}\n}", "protected function initAvailableCommands()\n {\n $this->availableCommands = collect($this->getApplication()->all())\n ->filter(function (SymfonyCommand $command) {\n return $this->isEligibleCommand($command);\n })->map(function (Command $command) {\n return str_replace('make:', '', $command->getName());\n })->values();\n }", "function load_all_commands() {\n $cmd_dir = TERMINUS_ROOT . '/php/commands';\n\n $iterator = new \\DirectoryIterator($cmd_dir);\n\n foreach ($iterator as $filename) {\n if (substr($filename, -4) != '.php') {\n continue;\n }\n\n include_once \"$cmd_dir/$filename\";\n }\n}", "public function getConsoleCommands();", "public function loadCommands(){\r\n $kernel = new \\Component\\Cli\\Kernel();\r\n $commands = $kernel->commands;\r\n if(count($commands)){\r\n foreach($commands as $command){\r\n $this->commands[] = new $command();\r\n }\r\n }\r\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "function drush_shell_complete($command = FALSE) {\n $commands = drush_get_commands();\n if (empty($command)) {\n ksort($commands);\n foreach($commands as $key => $command) {\n if (!$command['hidden'] && !in_array($key, $command['deprecated-aliases'])) {\n $rows[] = $key . ':' . str_replace(':', '\\:', $command['description']);\n }\n }\n }\n else {\n if (array_key_exists($command, $commands)) {\n $command = $commands[$command];\n foreach ($command['arguments'] as $key => $description) {\n $rows[] = $key . ':' . str_replace(':', '\\:', $description;\n }\n }\n }\n print join(\"\\n\", $rows) . \"\\n\";\n return;\n}", "static function getAvailableCommands() {\n if(is_array(self::$available_commands)) {\n return self::$available_commands;\n } // if\n \n self::$available_commands = array();\n \n $search_in = array(\n ANGIE_PATH . '/project/commands/',\n Angie::engine()->getDevelopmentPath('scripts/commands/'),\n ); // array\n \n foreach($search_in as $path) {\n $path = with_slash($path);\n $files = get_files($path, 'php');\n \n if(is_foreachable($files)) {\n foreach($files as $file) {\n if(str_ends_with($file, '.php')) {\n $command = substr($file, strlen($path), strlen($file) - strlen($path) - 4);\n self::$available_commands[$command] = $file;\n } // if\n } // foreach\n } // if\n } // foreach\n \n return self::$available_commands;\n }", "abstract protected function searchCommands();", "public function clear_commands()\n {\n $this->commands = array();\n }", "private function doAddCommands()\n {\n if (!empty($this->newCommands)) {\n $this->shell->addCommands($this->newCommands);\n $this->newCommands = [];\n }\n }", "public function registerCommands()\n {\n $this->app['command.session.bucket'] = $this->app->share(function($app)\n {\n $properties = new BucketPropertyList();\n $properties\n ->setAllowMult(false)\n ->setLastWriteWins(false);\n return new BucketInitCommand('session:bucket:init', $app['riak'], $app['config']['session.bucket'], $properties);\n });\n $this->commands('command.session.bucket');\n }", "function loadAllCommands() {\n $cmd_dir = TERMINUS_ROOT . '/php/Terminus/Commands';\n\n $iterator = new \\DirectoryIterator($cmd_dir);\n\n foreach ($iterator as $filename) {\n if (substr($filename, -4) != '.php') {\n continue;\n }\n\n include_once \"$cmd_dir/$filename\";\n }\n}", "public function getAvailableCommands()\n {\n return $this->commands;\n }", "private function requiredSystemCommands()\n {\n\n // todo fix command existence in windows os\n return true;\n\n\n // Programs needed in $PATH\n $required_commands = ['git', 'rsync','php', 'composer'];\n\n $missing = [];\n foreach ($required_commands as $command) {\n $this->process->setCommandLine('which ' . $command);\n $this->process->setTimeout(null);\n $this->process->run();\n\n if (!$this->process->isSuccessful()) {\n $missing[] = $command;\n }\n }\n\n if (count($missing)) {\n asort($missing);\n\n $this->console->error('Commands not found: ' . implode(', ', $missing));\n $this->errors = true;\n }\n }", "public function registerConsoleCommands()\n {\n }", "protected function populateAvailableCommands(): void\n {\n foreach ($this->commandRegistry->getLegacyCommands() as $commandName => $command) {\n /** @var Command $command */\n $this->application->add($command);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if 'minor' has a value
public function hasMinor() { return $this->minor !== null; }
[ "public function hasMinor(): bool {\n\t\treturn $this->minor !== null;\n\t}", "function fserver__project_property_default_major_validate($value) {\n if (is_array($value)) {\n foreach ($value as $key => $v) {\n if (array_key_exists('api', $v) and array_key_exists('default_major', $v)) {\n if (is_int($v['default_major']) and $v['default_major'] > 0 and is_string($v['api'])) {\n return TRUE;\n }\n }\n }\n }\n\n return FALSE;\n}", "public function isMinor(): bool\n {\n if ($this->hasPreReleaseSuffix()) {\n return false;\n }\n\n if (!isset($this->versionNumber[1]) || $this->versionNumber[1] === 0) {\n return false;\n }\n\n $length = count($this->versionNumber);\n for ($index = 2; $index < $length; $index++) {\n if ($this->versionNumber[$index] > 0) {\n return false;\n }\n }\n\n return true;\n }", "public static function is_minor_returns() {\n return new external_single_structure(\n array(\n 'status' => new external_value(PARAM_BOOL, 'True if the user is considered to be a digital minor,\n false if not')\n )\n );\n }", "public function setIsKnownMinor($value)\n {\n return $this->set(self::IS_KNOWN_MINOR, $value);\n }", "public function getMinor(): int\n {\n return $this->get('minor');\n }", "function CheckToolkitVersion($major, $minor){}", "public function getMinor()\n\t\t{\n\t\t\treturn $this->minor;\n\t\t}", "public function setMinor($var)\n {\n GPBUtil::checkInt32($var);\n $this->minor = $var;\n $this->has_minor = true;\n\n return $this;\n }", "public function testGetMinor(): void\n {\n $model = OsVersion::load([\n \"minor\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getMinor());\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function test_auto_updates_constant_minor() {\n\t\t$this->assertTrue(\n\t\t\tCore_Upgrader::_auto_update_enabled_for_versions(\n\t\t\t\t'1.0.0-beta1',\n\t\t\t\t'1.0.0-beta2',\n\t\t\t\t'minor' // prerelease\n\t\t\t)\n\t\t);\n\n\t\t$this->assertTrue(\n\t\t\tCore_Upgrader::_auto_update_enabled_for_versions(\n\t\t\t\t'1.0.0+nightly.20190226',\n\t\t\t\t'1.0.1+nightly.20190331',\n\t\t\t\t'minor' // nightly\n\t\t\t)\n\t\t);\n\n\t\t$this->assertTrue(\n\t\t\tCore_Upgrader::_auto_update_enabled_for_versions(\n\t\t\t\t'1.0.0',\n\t\t\t\t'1.0.1',\n\t\t\t\t'minor' // patch\n\t\t\t)\n\t\t);\n\n\t\t$this->assertTrue(\n\t\t\tCore_Upgrader::_auto_update_enabled_for_versions(\n\t\t\t\t'1.0.1',\n\t\t\t\t'1.1.0',\n\t\t\t\t'minor' // minor\n\t\t\t)\n\t\t);\n\n\t\t$this->assertFalse(\n\t\t\tCore_Upgrader::_auto_update_enabled_for_versions(\n\t\t\t\t'1.0.1',\n\t\t\t\t'2.0.0',\n\t\t\t\t'minor' // major\n\t\t\t)\n\t\t);\n\t}", "public function hasValue(){\n return $this->_has(1);\n }", "public function GetMinor()\n\t{\n\t\treturn $this->minor_step;\n\t}", "public function isOnCorrectMinorReleaseBranch(): bool\n {\n if (!preg_match('#^([0-9]{1,2}\\.[0-9]{1,2})\\.[0-9]{1,2}#', $this->version, $matches)) {\n return false;\n }\n return $matches[1] == $this->getLibrary()->getBranch();\n }", "protected function getMinor()\n {\n return $this->versionMetaData['minor'];\n }", "function isMajor() {\r\n\t\treturn $this->major;\r\n\t}", "public function test_accepts_minor_updates()\n {\n }", "public function isMajor(): bool\n {\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Collect valid telegram recipients for telegram messgae notification
function telegram_message_collect_recipients( $p_bug_id, $p_notify_type, array $p_extra_user_ids_to_telegram_message = array(), $p_bugnote_id = null ) { $t_recipients = array(); # add explicitly specified users $t_explicit_enabled = ( ON == telegram_message_notify_flag( $p_notify_type, 'explicit' ) ); foreach( $p_extra_user_ids_to_telegram_message as $t_user_id ) { if( $t_explicit_enabled ) { $t_recipients[$t_user_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (explicitly specified)', $p_bug_id, $t_user_id ) ); } else { plugin_log_event( sprintf( 'Issue = #%d, skip @U%d (explicit disabled)', $p_bug_id, $t_user_id ) ); } } # add Reporter $t_reporter_id = bug_get_field( $p_bug_id, 'reporter_id' ); if( ON == telegram_message_notify_flag( $p_notify_type, 'reporter' ) ) { $t_recipients[$t_reporter_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (reporter)', $p_bug_id, $t_reporter_id ) ); } else { plugin_log_event( sprintf( 'Issue = #%d, skip @U%d (reporter disabled)', $p_bug_id, $t_reporter_id ) ); } # add Handler $t_handler_id = bug_get_field( $p_bug_id, 'handler_id' ); if( $t_handler_id > 0 ) { if( ON == telegram_message_notify_flag( $p_notify_type, 'handler' ) ) { $t_recipients[$t_handler_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (handler)', $p_bug_id, $t_handler_id ) ); } else { plugin_log_event( sprintf( 'Issue = #%d, skip @U%d (handler disabled)', $p_bug_id, $t_handler_id ) ); } } $t_project_id = bug_get_field( $p_bug_id, 'project_id' ); # add users monitoring the bug $t_monitoring_enabled = ON == telegram_message_notify_flag( $p_notify_type, 'monitor' ); db_param_push(); $t_query = 'SELECT DISTINCT user_id FROM {bug_monitor} WHERE bug_id=' . db_param(); $t_result = db_query( $t_query, array( $p_bug_id ) ); while( $t_row = db_fetch_array( $t_result ) ) { $t_user_id = $t_row['user_id']; if( $t_monitoring_enabled ) { $t_recipients[$t_user_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (monitoring)', $p_bug_id, $t_user_id ) ); } else { plugin_log_event( sprintf( 'Issue = #%d, skip @U%d (monitoring disabled)', $p_bug_id, $t_user_id ) ); } } # add Category Owner if( ON == telegram_message_notify_flag( $p_notify_type, 'category' ) ) { $t_category_id = bug_get_field( $p_bug_id, 'category_id' ); if( $t_category_id > 0 ) { $t_category_assigned_to = category_get_field( $t_category_id, 'user_id' ); if( $t_category_assigned_to > 0 ) { $t_recipients[$t_category_assigned_to] = true; plugin_log_event( sprintf( 'Issue = #%d, add Category Owner = @U%d', $p_bug_id, $t_category_assigned_to ) ); } } } # add users who contributed bugnotes $t_bugnote_id = ( $p_bugnote_id === null ) ? bugnote_get_latest_id( $p_bug_id ) : $p_bugnote_id; if( $t_bugnote_id !== 0 ) { $t_bugnote_date = bugnote_get_field( $t_bugnote_id, 'last_modified' ); } $t_bug = bug_get( $p_bug_id ); $t_bug_date = $t_bug->last_updated; $t_notes_enabled = ( ON == telegram_message_notify_flag( $p_notify_type, 'bugnotes' ) ); db_param_push(); $t_query = 'SELECT DISTINCT reporter_id FROM {bugnote} WHERE bug_id = ' . db_param(); $t_result = db_query( $t_query, array( $p_bug_id ) ); while( $t_row = db_fetch_array( $t_result ) ) { $t_user_id = $t_row['reporter_id']; if( $t_notes_enabled ) { $t_recipients[$t_user_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (note author)', $p_bug_id, $t_user_id ) ); } else { plugin_log_event( sprintf( 'Issue = #%d, skip @U%d (note author disabled)', $p_bug_id, $t_user_id ) ); } } # add project users who meet the thresholds $t_bug_is_private = bug_get_field( $p_bug_id, 'view_state' ) == VS_PRIVATE; $t_threshold_min = telegram_message_notify_flag( $p_notify_type, 'threshold_min' ); $t_threshold_max = telegram_message_notify_flag( $p_notify_type, 'threshold_max' ); $t_threshold_users = project_get_all_user_rows( $t_project_id, $t_threshold_min ); foreach( $t_threshold_users as $t_user ) { if( $t_user['access_level'] <= $t_threshold_max ) { if( !$t_bug_is_private || access_compare_level( $t_user['access_level'], config_get( 'private_bug_threshold' ) ) ) { $t_recipients[$t_user['id']] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (based on access level)', $p_bug_id, $t_user['id'] ) ); } } } # add users as specified by plugins $t_recipients_include_data = event_signal( 'EVENT_NOTIFY_USER_INCLUDE', array( $p_bug_id, $p_notify_type ) ); foreach( $t_recipients_include_data as $t_plugin => $t_recipients_include_data2 ) { foreach( $t_recipients_include_data2 as $t_callback => $t_recipients_included ) { # only handle if we get an array from the callback if( is_array( $t_recipients_included ) ) { foreach( $t_recipients_included as $t_user_id ) { $t_recipients[$t_user_id] = true; plugin_log_event( sprintf( 'Issue = #%d, add @U%d (by %s plugin)', $p_bug_id, $t_user_id, $t_plugin ) ); } } } } # FIXME: the value of $p_notify_type could at this stage be either a status # or a built-in actions such as 'owner and 'sponsor'. We have absolutely no # idea whether 'new' is indicating a new bug has been filed, or if the # status of an existing bug has been changed to 'new'. Therefore it is best # to just assume built-in actions have precedence over status changes. switch( $p_notify_type ) { case 'new': case 'feedback': # This isn't really a built-in action (delete me!) case 'reopened': case 'resolved': case 'closed': case 'bugnote': $t_pref_field = 'telegram_message_on_' . $p_notify_type; break; case 'owner': # The telegram_message_on_assigned notification type is now effectively # telegram_message_on_change_of_handler. $t_pref_field = 'telegram_message_on_assigned'; break; case 'deleted': case 'updated': case 'sponsor': case 'relation': case 'monitor': case 'priority': # This is never used, but exists in the database! # Issue #19459 these notification actions are not actually implemented # in the database and therefore aren't adjustable on a per-user # basis! The exception is 'monitor' that makes no sense being a # customisable per-user preference. default: # Anything not built-in is probably going to be a status $t_pref_field = 'telegram_message_on_status'; break; } # @@@ we could optimize by modifiying user_cache() to take an array # of user ids so we could pull them all in. We'll see if it's necessary $t_final_recipients = array(); $t_user_ids = array_keys( $t_recipients ); user_cache_array_rows( $t_user_ids ); user_pref_cache_array_rows( $t_user_ids ); user_pref_cache_array_rows( $t_user_ids, $t_bug->project_id ); # Check whether users should receive the telegram message # and put telegram user id to $t_recipients[user_id] foreach( $t_recipients as $t_id => $t_ignore ) { # Possibly eliminate the current user if( ( auth_get_current_user_id() == $t_id ) && ( OFF == plugin_config_get( 'telegram_message_receive_own' ) ) ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (own action)', $p_bug_id, $t_id ) ); continue; } # Eliminate users who don't exist anymore or who are disabled if( !user_exists( $t_id ) || !user_is_enabled( $t_id ) ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (user disabled)', $p_bug_id, $t_id ) ); continue; } # Exclude users who have this notification type turned off if( $t_pref_field ) { $t_notify = plugin_config_get( $t_pref_field, NULL, FALSE, $t_id ); if( OFF == $t_notify ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (pref %s off)', $p_bug_id, $t_id, $t_pref_field ) ); continue; } else { # Users can define the severity of an issue before they are emailed for # each type of notification $t_min_sev_pref_field = $t_pref_field . '_min_severity'; $t_min_sev_notify = plugin_config_get( $t_min_sev_pref_field, NULL, FALSE, $t_id ); $t_bug_severity = bug_get_field( $p_bug_id, 'severity' ); if( $t_bug_severity < $t_min_sev_notify ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (pref threshold)', $p_bug_id, $t_id ) ); continue; } } } # exclude users who don't have at least viewer access to the bug, # or who can't see bugnotes if the last update included a bugnote if( !access_has_bug_level( config_get( 'view_bug_threshold', null, $t_id, $t_bug->project_id ), $p_bug_id, $t_id ) || ( $t_bugnote_id !== 0 && $t_bug_date == $t_bugnote_date && !access_has_bugnote_level( config_get( 'view_bug_threshold', null, $t_id, $t_bug->project_id ), $t_bugnote_id, $t_id ) ) ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (access level)', $p_bug_id, $t_id ) ); continue; } # check to exclude users as specified by plugins $t_recipient_exclude_data = event_signal( 'EVENT_NOTIFY_USER_EXCLUDE', array( $p_bug_id, $p_notify_type, $t_id ) ); $t_exclude = false; foreach( $t_recipient_exclude_data as $t_plugin => $t_recipient_exclude_data2 ) { foreach( $t_recipient_exclude_data2 as $t_callback => $t_recipient_excluded ) { # exclude if any plugin returns true (excludes the user) if( $t_recipient_excluded ) { $t_exclude = true; plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (by %s plugin)', $p_bug_id, $t_id, $t_plugin ) ); } } } # user was excluded by a plugin if( $t_exclude ) { continue; } # Finally, let's get their emails, if they've set one $t_telegram_user_id = telegram_user_get_id_by_user_id( $t_id ); if( $t_telegram_user_id == NULL ) { plugin_log_event( sprintf( 'Issue = #%d, drop @U%d (no telegram user id)', $p_bug_id, $t_id ) ); } else { # @@@ we could check the emails for validity again but I think # it would be too slow $t_final_recipients[$t_id] = $t_telegram_user_id; } } return $t_final_recipients; }
[ "public function getAllRecipients() {}", "public function getNewsletterRecipientIDs();", "public function get_recipients() {\n\t\tglobal $wpdb, $bp;\n\n\t\t$recipients = array();\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d\", $this->thread_id ) );\n\n\t\tforeach ( (array) $results as $recipient )\n\t\t\t$recipients[$recipient->user_id] = $recipient;\n\n\t\treturn $recipients;\n\t}", "function get_recipients()\n\t{\n\t\treturn (empty($this->_rcpt_to) ? array() : $this->_rcpt_to);\n\t}", "public function recipients() {\r\n if(!in_array($this->event, [\r\n Xoxzo::VOICE_NEW,\r\n Xoxzo::VOICE_CANCELLED,\r\n Xoxzo::VOICE_FAILED,\r\n Xoxzo::VOICE_ON_HOLD,\r\n Xoxzo::VOICE_PROCESSING,\r\n Xoxzo::VOICE_COMPLETED,\r\n Xoxzo::VOICE_FULLY_REFUNDED,\r\n Xoxzo::VOICE_PARTIALLY_REFUNDED,\r\n Xoxzo::VOICE_LOW_STOCK,\r\n Xoxzo::VOICE_NO_STOCK,\r\n Xoxzo::VOICE_ORDER_DETAILS,\r\n Xoxzo::VOICE_CUSTOMER_NOTE,\r\n Xoxzo::VOICE_RESET_PASSWORD,\r\n Xoxzo::VOICE_NEW_ACCOUNT,\r\n ])) {\r\n $recipients = get_option($this->recipients);\r\n $__ = explode(\",\", $recipients);\r\n $list = array();\r\n foreach($__ as $item) {\r\n $list[] = trim($item);\r\n }\r\n return $list;\r\n }\r\n return [];\r\n }", "private function uniqueRecipients()\n\t{\n\t\t/** @var $search Recipient */\n\t\t$search = Search_Object::create(Recipient::class);\n\t\t$recipients = array_merge(\n\t\t\t[$this->from, $this->reply_to, $this->return_path],\n\t\t\t$this->to, $this->copy_to, $this->blind_copy_to\n\t\t);\n\t\t$already = [];\n\t\tforeach ($recipients as $recipient) {\n\t\t\tif (isset($recipient)) {\n\t\t\t\t$search->email = $recipient->email;\n\t\t\t\t$search->name = $recipient->name;\n\t\t\t\tif (isset($already[strval($search)])) {\n\t\t\t\t\tDao::replace($recipient, $already[strval($search)], false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$already[strval($search)] = $recipient;\n\t\t\t\t\tif ($find = Dao::searchOne($recipient)) {\n\t\t\t\t\t\tDao::replace($recipient, $find, false);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tDao::disconnect($recipient);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getAvailableRecipients():?array;", "private function addRecipients(): void\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Collection $recipients */\n $recipients = $this->message->recipients;\n\n $to = $this->getRecipients(MessageParticipantTypes::TO, $recipients);\n\n /** @var \\App\\Components\\Messages\\Models\\MessageRecipient $recipient */\n foreach ($to as $recipient) {\n $this->to($recipient->address, $recipient->name);\n }\n\n $cc = $this->getRecipients(MessageParticipantTypes::CC, $recipients);\n if (!empty($cc)) {\n foreach ($cc as $recipient) {\n $this->cc($recipient->address, $recipient->name);\n }\n }\n\n $bcc = $this->getRecipients(MessageParticipantTypes::BCC, $recipients);\n if (!empty($bcc)) {\n foreach ($bcc as $recipient) {\n $this->bcc($recipient->address, $recipient->name);\n }\n }\n }", "public static function get_email_recipients() {\n\t\t$email_recipients = array();\n\t\t$options = Smartcrawl_Settings::get_component_options( self::COMP_CHECKUP );\n\t\t$new_recipients = empty( $options['checkup-email-recipients'] )\n\t\t\t? array()\n\t\t\t: $options['checkup-email-recipients'];\n\t\t$old_recipients = empty( $options['email-recipients'] )\n\t\t\t? array()\n\t\t\t: $options['email-recipients'];\n\n\t\tforeach ( $old_recipients as $user_id ) {\n\t\t\tif ( ! is_numeric( $user_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$old_recipient = self::get_email_recipient( $user_id );\n\t\t\tif ( self::recipient_exists( $old_recipient, $new_recipients ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$email_recipients[] = $old_recipient;\n\t\t}\n\n\t\treturn array_merge(\n\t\t\t$email_recipients,\n\t\t\t$new_recipients\n\t\t);\n\t}", "private function getRecipients()\n\t{\n\t\t$i = 0;\n\t\tif(is_null($this->recipients)){\n\t\t\t$this->error('INVALID_RECIPIENTS');\n\t\t\treturn false;\n\t\t}\n\t\tforeach($this->recipients as $recipient){\n\t\t\t$array['L_EMAIL'.$i] = $recipient['email'];\n\t\t\t$array['L_AMT'.$i] = $recipient['amt'];\n\t\t\t$i++;\n\t\t}\n\t\t$this->recipients = null;\n\t\treturn $array;\n\t}", "function _elastic_email_parse_recipient(&$recipients, $to) {\n\n if (!$to) {\n return;\n }\n\n // Trim any whitespace\n $to = trim($to);\n\n if (!empty($to)) {\n // Explode on comma\n $parts = explode(',', $to);\n foreach ($parts as $part) {\n // Again, trim any whitespace\n $part = trim($part);\n if (!empty($part)) {\n $recipients[] = $part;\n }\n }\n }\n}", "private function recipients()\n {\n if (request('type') === 'bulk') {\n return $recipients = count(Contact::active()->where('group_id', request('recipients'))->pluck('mobile'));\n } elseif (request('type') === 'single') {\n return $recipients = 1;\n }\n }", "public function createMessagesForRecipients()\n {\n $messageObjectArray = array();\n\n foreach ($this->participants as $participantName => $participantEmail) {\n $newMessageObject = clone $this->message;\n\n if (!is_numeric($participantName)) {\n $name = $participantName;\n } else {\n $name = null;\n }\n\n $newMessageObject->addTo($participantEmail, $name);\n $messageObjectArray[] = $newMessageObject;\n }\n\n return $messageObjectArray;\n }", "protected function __prepareInviteTo()\r\n {\r\n $recipients = $this->getRecipients();\r\n $recipients = array_unique( array_merge( $recipients['valid']['users'], $recipients['valid']['guests'] ) );\r\n return join(', ',$recipients);\r\n \r\n }", "protected function getEmailNotificationsRecipients()\n {\n return [\n ['address' => null, 'name' => null],\n ];\n }", "public function getAllRecipientsForChat() : array {\n $query = \"SELECT c.name, u.id FROM companies \n c JOIN users u ON c.user_id = u.id \n UNION SELECT t.first_name, u.id \n FROM teachers t JOIN users u ON t.user_id = u.id\";\n $pdostm = $this->db->prepare($query);\n $pdostm->setFetchMode(PDO::FETCH_OBJ);\n $pdostm->execute();\n\n $recipientsDB = $pdostm->fetchAll(PDO::FETCH_OBJ);\n // var_dump($recipientsDB);\n $recipients = array();\n\n foreach ($recipientsDB as $r)\n {\n $recipient = new ChatMember();\n\n $recipient->setUserId($r->id);\n $recipient->setName($r->name);\n\n array_push($recipients,$recipient);\n\n }\n return $recipients;\n\n }", "public function clearAllRecipients() {}", "public function clearRecipients()\n {\n $this->recipients = [];\n }", "public function getRecipientsWildcard(): ?string;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isXSDIDREFS match the IDREFS format as described in the XMLSchema documentation. See for more information.
static public function isXSDIDREFS(string $var): bool { // TODO : To be implemented. return true; }
[ "static public function isXSDID(string $var): bool\n {\n // TODO : To be implemented.\n return true; }", "public function isValidRef($ref);", "public function getValidRefAttributes(): array\n {\n return [\n 'Prefix (absent) and bound to default namespace' => [\n 'element_ref_0009.xsd', \n [\n '' => 'http://example.org', \n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n 'http://example.org', \n 'foo', \n ], \n 'Prefix and local part (starts with _)' => [\n 'element_ref_0010.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n '_foo', \n ], \n 'Prefix and local part (starts with letter)' => [\n 'element_ref_0011.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f', \n ], \n 'Prefix and local part (contains letter)' => [\n 'element_ref_0012.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'foo', \n ], \n 'Prefix and local part (contains digit)' => [\n 'element_ref_0013.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f00', \n ], \n 'Prefix and local part (contains .)' => [\n 'element_ref_0014.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f.bar', \n ], \n 'Prefix and local part (contains -)' => [\n 'element_ref_0015.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f-bar', \n ], \n 'Prefix and local part (contains _)' => [\n 'element_ref_0016.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f_bar', \n ], \n 'Prefix (starts with _) and local part' => [\n 'element_ref_0017.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n '_foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (starts with letter) and local part' => [\n 'element_ref_0018.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains letter) and local part' => [\n 'element_ref_0019.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains digit) and local part' => [\n 'element_ref_0020.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f00' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains .) and local part' => [\n 'element_ref_0021.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f.bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains -) and local part' => [\n 'element_ref_0022.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f-bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains _) and local part' => [\n 'element_ref_0023.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f_bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n ];\n }", "function checkSameReference($moduleID, $referenceID){\n $internalReferences = getInternalReferences($moduleID);\n $seealso = array();\n foreach ($internalReferences as $references) {\n $referencedModule = references($moduleID); \n array_push($seealso, $references[\"referencedModuleID\"]);\n }\n return $seealso;\n}", "public function getValidRefAttributes(): array\n {\n return [\n 'Prefix (absent) and bound to default namespace' => [\n 'group_ref_0009.xsd', \n [\n '' => 'http://example.org', \n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n 'http://example.org', \n 'foo', \n ], \n 'Prefix and local part (starts with _)' => [\n 'group_ref_0010.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n '_foo', \n ], \n 'Prefix and local part (starts with letter)' => [\n 'group_ref_0011.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f', \n ], \n 'Prefix and local part (contains letter)' => [\n 'group_ref_0012.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'foo', \n ], \n 'Prefix and local part (contains digit)' => [\n 'group_ref_0013.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f00', \n ], \n 'Prefix and local part (contains .)' => [\n 'group_ref_0014.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f.bar', \n ], \n 'Prefix and local part (contains -)' => [\n 'group_ref_0015.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f-bar', \n ], \n 'Prefix and local part (contains _)' => [\n 'group_ref_0016.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f_bar', \n ], \n 'Prefix (starts with _) and local part' => [\n 'group_ref_0017.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n '_foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (starts with letter) and local part' => [\n 'group_ref_0018.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains letter) and local part' => [\n 'group_ref_0019.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains digit) and local part' => [\n 'group_ref_0020.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f00' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains .) and local part' => [\n 'group_ref_0021.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f.bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains -) and local part' => [\n 'group_ref_0022.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f-bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains _) and local part' => [\n 'group_ref_0023.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f_bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n ];\n }", "public function isReference(): bool\n {\n $val = $this->value;\n return is_scalar($val) && Strings::startsWith($val, self::$REFERENCE_KEY);\n }", "public static function isRef($ref) {}", "static function resolveDBRef($ref, $id='')\n {\n // ref is collection name, so pack it\n if($id && is_string($ref)) {\n $ref = array('$ref' => $ref, '$id' => MongoLib::fix_id($id));\n }\n \n // ref is a raw thingy, so repack it\n if(is_array($ref) && !$ref['$ref']) {\n list($collection, $id) = array_values($ref);\n if($collection && $id) {\n $new_ref = array('$ref' => $collection, '$id' => MongoLib::fix_id($id));\n $ref = $new_ref;\n }\n }\n \n if($ref != array('$ref' => $ref['$ref'], '$id' => $ref['$id']))\n return false;\n \n return $ref;\n }", "function parseXSD(){\n \n\t\t $xml = new DOMDocument();\n\t\t $xml->loadXML($this->xsdString);\n\t\t $xpath = new DOMXPath($xml);\n\t\t foreach($this->nameSpaces as $prefix => $uri){\n\t\t\t\t$xpath->registerNamespace($prefix, $uri); //get those namespaces registered!\n\t\t }\n\t\t \n\t\t $this->doRefElement = false;\n\t\t $this->doneElementTypes = array();\n\t\t $schema = $this->extractSchema($xpath, $xml, \"recordType\", self::cowNSprefix.\":\".\"record\");\n\t\t //$schema = $this->extractSchema($xpath, $xml, \"cowItemType\", \"cowItem\");\n\t\t \n\t\t $this->schema = $schema;\n\t}", "protected function schemaIsXml()\n {\n return strpos($this->schema, '<') !== false;\n }", "public function hasXref()\n {\n return isset($this->xref);\n }", "static public function isXSDLanguage(string $var): bool\n {\n return self::isXSDToken($var) && preg_match('/[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*/', $var);\n }", "static public function isXSDNMTOKENS(string $var): bool\n {\n // TODO : To be implemented.\n return true;\n }", "public static function validateXmlId()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\Validator\\Unique(),\n\t\t\tnew Entity\\Validator\\Length(null, 200),\n\t\t);\n\t}", "public function issetReferencedConsignmentID($index)\n {\n return isset($this->referencedConsignmentID[$index]);\n }", "public function theXmlSitemapShouldBeValid() {\n $this->theXmlFeedShouldBeValidAccordingToTheXsd(__DIR__ . '/../../schemas/xsd/sitemap.xsd');\n }", "public function getUniqueXrefs() {\n\t\t$elements = $this->getElements( 'DataNode' );\n\n\t\t$xrefs = [];\n\n\t\tforeach ( $elements as $elm ) {\n\t\t\t$id = $elm->Xref['ID'];\n\t\t\t$system = $elm->Xref['Database'];\n\t\t\t$ref = new Xref( $id, $system );\n\t\t\t$xrefs[$ref->asText()] = $ref;\n\t\t}\n\n\t\treturn $xrefs;\n\t}", "public static function validateXmlId()\n\t{\n\t\treturn array(\n\t\t\tnew ORM\\Fields\\Validators\\LengthValidator(null, 255),\n\t\t);\n\t}", "public static function validateXmlId()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\Validator\\Length(null, 255),\n\t\t);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts system time session collection into normalised collection
private function createNormalisedTimeSessions( int $projectId, int $ticketId = null, CodebaseTimeSession\Collection $collection ) : TimeSession\Collection { $normalisedTimeSessionCollection = new TimeSession\Collection(); foreach($collection as $timeSession) { $user = $timeSession->getUser() ? $this->createNormalisedUser($timeSession->getUser()) : null; $normalisedTimeSessionCollection->addTimeSession( new TimeSession\TimeSession( $timeSession->getId(), $timeSession->getSummary(), $timeSession->getMinutes(), $timeSession->getSessionDate(), $user, $timeSession->getUpdatedAt(), $timeSession->getCreatedAt(), $projectId, $ticketId ) ); } return $normalisedTimeSessionCollection; }
[ "public function getTimeSessions()\n {\n return $this->timeSessionCollection;\n }", "function toArray(){\n\t\treturn $this->_SessionStorer->toArray();\n\t}", "public function userSessionData()\r\n {\r\n $data = (new \\Dsc\\Mongo\\Collections\\Sessions)->load(array('session_id'=>$this->session_id_user));\r\n \r\n return $data;\r\n }", "public function getSessions(){\n\t\t$list = new ArrayList();\n\n\t\t$col1 = new ArrayList();\n\t\t$col2 = new ArrayList();\n\t\t$col3 = new ArrayList();\n\t\t$col4 = new ArrayList();\n\n\t\t$i = 0;\n\t\t$j = 1;\n\n\t\t// $\n\t\t\n\t\twhile ($i <= 11) {\n\t\t\t$session = MeetingSession::get()->sort($this->SessionsSort, 'DESC')->limit(1, $i)->first();\n\t\t\tif($session) {\n\t\t\t\tswitch ($j) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$col1->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$col2->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$col3->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$col4->push($session);\n\t\t\t\t\t\t$j = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\t$list->push(new ArrayData(array('Columns' => $col1)));\n\t\t$list->push(new ArrayData(array('Columns' => $col2)));\n\t\t$list->push(new ArrayData(array('Columns' => $col3)));\n\t\t$list->push(new ArrayData(array('Columns' => $col4)));\n\n\t\treturn $list;\n\t}", "public static function splice_session($session) {\n $daytimestart = date('G', $session->sessionstart) * HOURSECS + date('i', $session->sessionstart) * MINSECS + date('s', $session->sessionstart);\n $endofday = 24 * HOURSECS;\n $daygap = $endofday - $daytimestart;\n $startstamp = $session->sessionstart;\n\n $sessions = array();\n\n while ($startstamp + $daygap < $session->sessionend) {\n $daysess = new StdClass();\n $daysess->sessionstart = $startstamp;\n $daysess->sessionend = $startstamp + $daygap;\n $daysess->elapsed = $daygap;\n $daytimestart = 0; // Back to midnight;\n $daygap = $endofday - $daytimestart;\n $startstamp = $daysess->sessionend;\n $sessions[] = $daysess;\n }\n\n // We now need to keep the last segment.\n if ($startstamp < $session->sessionend) {\n $daysess = new stdClass();\n $daysess->sessionstart = $startstamp;\n $daysess->sessionend = $session->sessionend;\n $daysess->elapsed = $session->sessionend - $daysess->sessionstart;\n $sessions[] = $daysess;\n }\n\n return $sessions;\n }", "private function collectSessionData()\n {\n foreach($_SESSION as $key=>$val)\n {\n $this->{$key} = $val;\n }\n }", "public function getSessionValues()\n {\n $values = $this->extension->getSessionValues();\n\n foreach ($values as $key => $value) {\n if (false !== ($tmp = @unserialize($value))) {\n $values[$key] = $tmp;\n }\n }\n\n return $values;\n }", "function convert_session_time($session_ID) {\n $session_time = get_session_time($session_ID);\n $session_time = preg_split(\"/ - /\", $session_time->name);\n if (preg_match(\"/PM/\",$session_time[0])) {\n $session_time = preg_split(\"/ /\", $session_time[0]);\n $session_time = preg_replace(\"/:/\", \"\", $session_time[0]);\n if ($session_time < 1200) $session_time += 1200;\n } else {\n $session_time = preg_split(\"/ /\", $session_time[0]); \n $session_time = preg_replace(\"/:/\", \"\", $session_time[0]);\n } \n return $session_time;\n}", "private function convertListToCollection()\n {\n $count = $this->list->count();\n $newList = new Collection();\n for ($i = 0; $i < $count; $i++) {\n $newList->push([\n 'date' => '',\n 'user' => $this->list[$i],\n ]);\n }\n $this->list = $newList;\n }", "function getSessions(): array\n {\n return $this->sessions;\n }", "private static function _pma_format_training_session_properly($sess) {\n\t\t$sess_data = array(\n\t\t\t\"Id\" => $sess[\"Id\"],\n\t\t\t\"Title\" => $sess[\"Title\"],\n\t\t\t\"LogoPath\" => $sess[\"LogoPath\"],\n\t\t\t\"StartsOn\" => $sess[\"StartsOn\"],\n\t\t\t\"EndsOn\" => $sess[\"EndsOn\"],\n\t\t\t\"ProjectId\" => $sess[\"ProjectId\"],\n\t\t\t\"State\" => $sess[\"State\"],\n\t\t\t\"CaseCollections\" => array(),\n\t\t\t\"NumberOfParticipants\" => count($sess[\"Participants\"])\n\t\t);\n\t\tforeach ($sess[\"CaseCollections\"] as $coll) {\n\t\t\t$sess_data[\"CaseCollections\"][$coll[\"Id\"]] = $coll[\"Title\"];\n\t\t}\n\t\treturn $sess_data;\n\t}", "public function getSessionAsArray() {\n $settings = array();\n foreach(Zend_Registry::get('session') as $key => $value)\n $settings[$key] = $value;\n return $settings;\n }", "public function getAllSessions() {\n $sql = 'SELECT * FROM Sessions\n INNER JOIN Places ON Places.placeID = Sessions.placeID\n WHERE sectionID = :id';\n $args = array(':id' => $this->id);\n $rows = Database::executeGetAllRows($sql, $args);\n return array_map(function ($row) { return new SectionSession($row); }, $rows);\n }", "protected function getSessionData()\n\t{\n\t\tif (! isset($this->app['session'])) return [];\n\n\t\treturn $this->removePasswords((new Serializer)->normalizeEach($this->app['session']->all()));\n\t}", "protected function getSessionData()\n\t{\n\t\tif (! isset($this->app['session'])) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn $this->removePasswords((new Serializer)->normalizeEach($this->app['session']->all()));\n\t}", "public function makeCollection()\n \t {\n \t \treturn collect(session('cart'));\n \t }", "public static function sortDevicesAndSessions() {\n $devices = Record::select(\"device_id\")->groupBy(\"device_id\")->pluck(\"device_id\");\n foreach ($devices as $device_id) {\n $device = Device::whereDeviceId($device_id)->first();\n if (empty($device)) {\n $device = new Device();\n $device->device_id = $device_id;\n $device->save();\n }\n }\n $sessions = Record::select(\"session_id\")->groupBy(\"session_id\")->pluck(\"session_id\");\n foreach ($sessions as $session_id) {\n $session = Session::whereSessionId($session_id)->first();\n if (empty($session)) {\n $session = new Session();\n $session->device_id = Record::whereSessionId($session_id)->first()->device_id;\n $session->session_id = $session_id;\n $session->first_seen = Record::whereSessionId($session_id)->orderBy(\"created_at\")->first()->created_at;\n $session->last_seen = Record::whereSessionId($session_id)->orderBy(\"created_at\", \"DESC\")->first()->created_at;\n $session->duration = $session->last_seen->diffInMinutes($session->first_seen);\n $session->ended = $session->duration>360;\n $session->save();\n }\n }\n }", "public function setPhpSessions() {\n\t\t$idx = 0;\n\t\tunset($_SESSION['sessions']);\n\t\tforeach ($this->sessions as $session){\n\t\t\t$_SESSION['sessions'][$idx]['userLogin']\t= $session->userLogin;\n\t\t\t$_SESSION['sessions'][$idx]['userPassword']\t= $session->userPassword;\n\t\t\t$_SESSION['sessions'][$idx]['userLogged']\t= $session->userLogged;\n\t\t\t$_SESSION['sessions'][$idx]['userBanner']\t= $session->userBanner;\n\t\t\t$idx++;\n\t\t}\n\t}", "public function toArray()\n {\n if (!$this->parseSucceeded())\n return array();\n \n $serialized = array();\n foreach ($this->all() as $meetingTime) {\n $meetingTimeEntry = array(\"days\" => $meetingTime->daysText(),\n \"time\" => $meetingTime->timeText());\n if ($meetingTime->isLocationKnown()) {\n $meetingTimeEntry[\"location\"] = $meetingTime->locationText();\n }\n else {\n $meetingTimeEntry[\"location\"] = \"\";\n }\n $serialized[] = $meetingTimeEntry;\n }\n \n return $serialized;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get assignee name Notice: This data is loaded from the admin_user table and cannot be saved via the message.
public function getAssigneeName();
[ "public function getAssignee()\n {\n return $this->assignee;\n }", "public function getAssigneeEmail();", "public function getAssignedUserName()\n {\n return $this->assignedUser->getFullName();\n }", "public function getNextAssignee() {\n\t\t$admin = &Yii::app()->params->admin;\n\t\t$type = $admin->serviceDistribution;\n\t\tif ($type == \"\") {\n\t\t\treturn \"Anyone\";\n\t\t} elseif ($type == \"evenDistro\") {\n\t\t\treturn $this->evenDistro();\n\t\t} elseif ($type == \"trueRoundRobin\") {\n\t\t\treturn $this->roundRobin();\n\t\t} elseif($type=='singleUser') {\n $user=User::model()->findByPk($admin->srrId);\n if(isset($user)){\n return $user->username;\n }else{\n return \"Anyone\";\n }\n } elseif($type=='singleGroup') {\n $group=Groups::model()->findByPk($admin->sgrrId);\n if(isset($group)){\n return $group->id;\n }else{\n return \"Anyone\";\n }\n }\n\t}", "public function getAssignee()\n\t\t{\n\t\t\treturn User::model()->findAll(\"id_user IN (SELECT id_user FROM assign WHERE id_task = '\" . $this->id_task . \"')\", array(\"id_user\", \"username\"));\n\t\t}", "public function getAssignee() {\n\t\t$assignee = null;\n\t\tif(isset($this->uID)) {\n\t\t\tif($this->uID == 0) {\n\t\t\t\t// 0 means to filter by the logged in user.\n\t\t\t\t$assignee = new User;\n\t\t\t} else {\n\t\t\t\t$assignee = User::getByUserID($this->uID);\n\t\t\t}\n\t\t}\n\t\treturn $assignee;\n\t}", "public function getAssignee()\n {\n return $this->hasOne(Assignee::className(), ['id' => 'assignee_id']);\n }", "public function getAssigneeDisplayName(): ?string {\n $val = $this->getBackingStore()->get('assigneeDisplayName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'assigneeDisplayName'\");\n }", "public function getAssignedUser()\n {\n return $this->assignedUser;\n }", "public function assignee() \n {\n return $this->belongsTo(User::class, 'assignee_id')\n ->withDefault(['name' => 'Niemand']);\n }", "public function getAssignerUserId()\n {\n if (array_key_exists(\"assignerUserId\", $this->_propDict)) {\n return $this->_propDict[\"assignerUserId\"];\n } else {\n return null;\n }\n }", "public function assignee()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "protected function getInviteeName()\n {\n return $this->invitee->fullName();\n }", "public function setAssignee($var)\n {\n GPBUtil::checkString($var, True);\n $this->assignee = $var;\n\n return $this;\n }", "public function getAssignedToAttribute() {\n return $this->users()->wherePivot('type', 'assigned')->first();\n }", "public function getAssignedToAttribute()\n {\n return $this->ticket->profiles->implode('preferred_name', ', ');\n }", "public function getEmployerName(): string\n {\n return $this->employerName;\n }", "abstract protected function getAssigneeClass();", "public function getOfficerName(){\n return $this->getValue(\"name\", \"officer\", \"username\", $this->user);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/===================================================================== Function: sort_courses Description: Goes through all of the courses and place them into the right buckets Author: Christopher Smith ======================================================================
function sort_courses() { global $CSC_courses; global $CSC_electives; global $MATH_courses; global $ENGL_courses; global $SCI_courses; global $MATH_electives; $mcore = math_required(); $melec = math_elective(); $core = csc_required(); $elec = csc_elective(); $courses = simplexml_load_file("course_data/courses.xml"); foreach( $courses as $c) { if( $c->prefix == 'CSC' && in_array($c->number, $core)) { array_push($CSC_courses,$c); } elseif( $c->prefix == 'CSC' && in_array($c->number, $elec) ) { array_push($CSC_electives, $c ); } elseif( $c->prefix=='MATH' && in_array($c->number, $mcore)) { array_push($MATH_courses, $c); } elseif( $c->prefix=='MATH' && in_array($c->number, $melec)) { array_push($MATH_electives,$c); } elseif($c->prefix=='ENGL') { array_push($ENGL_courses, $c); } elseif($c->prefix=='PHYS') { array_push($SCI_courses, $c); } } }
[ "function sort_template_courses($a, $b) {\n $cmp = strcmp($a->shortname, $b->shortname);\n\n if ($cmp < 0) {\n return -1;\n } else if ($cmp > 1) {\n return 1;\n }\n\n $aparts = explode(' ', $a->catname);\n $bparts = explode(' ', $b->catname);\n\n if (count($aparts) != 2 && count($bparts) != 2) {\n $cmp = strcmp($a->catname, $b->catname);\n\n if ($cmp < 0) {\n return -1;\n } else if ($cmp > 1) {\n return 1;\n }\n\n } else {\n if ($aparts[1] > $bparts[1]) {\n return 1;\n } else if ($aparts[1] < $bparts[1]) {\n return -1;\n }\n\n if ($aparts[0] == $bparts[0]) {\n return 0;\n }\n\n if ($aparts[0] == 'Spring' || $bparts[0] == 'Winter') {\n return -1;\n } else if ($aparts[0] == 'Winter' || $bparts[0] == 'Spring') {\n return 1;\n } else if ($aparts[0] == 'Summer') {\n switch($bparts[0]) {\n case 'Spring':\n return 1;\n break;\n\n case 'Fall':\n case 'Winter':\n return -1;\n break;\n }\n } else if ($aparts[0] == 'Fall') {\n switch ($bparts[0]) {\n case 'Spring':\n case 'Summer':\n return 1;\n break;\n\n case 'Winter':\n return -1;\n break;\n }\n }\n }\n\n if ($a->crn == $b->crn) {\n return 0;\n }\n\n return ($a->crn > $b->crn) ? -1 : 1;\n }", "public function bubble_sort_compare(&$courses)\n {\n $done = false;\n\n // Step 1\n $numOfCourses = count($courses);\n\n // Step 2\n while (!$done)\n {\n $swap = false;\n for ($curr_index = 0, $next_index = 1; $next_index < $numOfCourses; $curr_index++, $next_index++)\n {\n $curr_course = $courses[$curr_index];\n $next_course = $courses[$next_index];\n $diff = $this->course_compare_ascend($curr_course, $next_course);\n if ($diff > 0)\n {\n $courses[$curr_index] = $next_course;\n $courses[$next_index] = $curr_course;\n $swap = true;\n }\n }\n if (!$swap)\n {\n $done = true;\n }\n }\n }", "private function transformCourses($data)\n {\n $courses = [];\n\n if (! is_array($data) || empty($data)) {\n return $courses;\n }\n\n foreach ($data as $courseObject) {\n // NOTE: sort is starting at 1, so we substract 1, to make it zero based arrays\n $courses[$courseObject['sort']] = $courseObject['id'];\n }\n\n ksort($courses);\n\n return $courses;\n }", "function get_user_courses ($userid) {\n global $DB;\n $records['actual'] = [];\n $records['prev'] = [];\n $records['next'] = [];\n $studentrole = $DB->get_record('role', array('shortname' => 'student'))->id;\n $rolcourses = get_usercourses_by_rol($userid);\n $categories = [];\n\n // Separate in categories, courses.\n foreach ($rolcourses as $r) {\n $catexists = false;\n foreach ($categories as $category) {\n if ($category->id == $r['category']) {\n $catexists = true;\n $coursexists = false;\n\n if (!$coursexists) {\n $course = new stdClass();\n $course->id = $r['course'];\n $r = get_students_course_data($course->id, $category->actualmodule, $studentrole);\n $record = add_course_activities($r);\n if ($record->date == 'actual') {\n array_push($records['actual'], $record);\n usort($records['actual'], \"sort_obj_by_shortname\");\n } else if ($record->date == 'next') {\n array_push($records['next'], $record);\n usort($records['next'], \"sort_obj_by_shortname\");\n } else {\n array_push($records['prev'], $record);\n usort($records['prev'], \"sort_obj_by_shortname\");\n }\n array_push($category->courses, $course);\n }\n }\n }\n if (!$catexists) {\n $category = new stdClass();\n $category->id = $r['category'];\n $category->actualmodule = get_actual_module($category->id, $studentrole);\n $course = new stdClass();\n $course->id = $r['course'];\n $r = get_students_course_data($course->id, $category->actualmodule, $studentrole);\n $record = add_course_activities($r);\n if ($record->date == 'actual') {\n array_push($records['actual'], $record);\n usort($records['actual'], \"sort_obj_by_shortname\");\n } else if ($record->date == 'next') {\n array_push($records['next'], $record);\n usort($records['next'], \"sort_obj_by_shortname\");\n } else {\n array_push($records['prev'], $record);\n usort($records['prev'], \"sort_obj_by_shortname\");\n }\n $category->courses = [];\n array_push($category->courses, $course);\n array_push($categories, $category);\n }\n }\n return $records;\n}", "function get_courses($categoryid=\"all\", $sort=\"c.sortorder ASC\", $fields=\"c.*\") {\n\n global $USER, $CFG;\n\n $categoryselect = \"\";\n if ($categoryid != \"all\" && is_numeric($categoryid)) {\n $categoryselect = \"c.category = '$categoryid'\";\n }\n\n $teachertable = \"\";\n $visiblecourses = \"\";\n $sqland = \"\";\n if (!empty($categoryselect)) {\n $sqland = \"AND \";\n }\n if (!empty($USER->id)) { // May need to check they are a teacher\n if (!iscreator()) {\n $visiblecourses = \"$sqland ((c.visible > 0) OR t.userid = '$USER->id')\";\n $teachertable = \"LEFT JOIN {$CFG->prefix}user_teachers t ON t.course = c.id\";\n }\n } else {\n $visiblecourses = \"$sqland c.visible > 0\";\n }\n\n if ($categoryselect or $visiblecourses) {\n $selectsql = \"{$CFG->prefix}course c $teachertable WHERE $categoryselect $visiblecourses\";\n } else {\n $selectsql = \"{$CFG->prefix}course c $teachertable\";\n }\n\n $extrafield = str_replace('ASC','',$sort);\n $extrafield = str_replace('DESC','',$extrafield);\n $extrafield = trim($extrafield);\n if (!empty($extrafield)) {\n $extrafield = ','.$extrafield;\n }\n return get_records_sql(\"SELECT \".((!empty($teachertable)) ? \" DISTINCT \" : \"\").\" $fields $extrafield FROM $selectsql \".((!empty($sort)) ? \"ORDER BY $sort\" : \"\"));\n}", "function sortCourseByBUPO(&$bupoCoursesArray, $coursesJson){\n foreach($coursesJson as $courseJson){\n $BUPO = $courseJson['entiteCommanditaire']['libelle'];\n if (!array_key_exists($BUPO, $bupoCoursesArray)) {\n // new bupo, then creat a new array and add the course\n $bupoCourses = array();\n $bupoCoursesArray[$BUPO] = $bupoCourses;\n }\n \n $bupoCoursesArray[$BUPO][$courseJson['id']] = $courseJson;\n }\n}", "function sortCourseByBUPO(&$bupoCoursesArray, $coursesJson){\n foreach($coursesJson as $courseJson){\n $courseJson['CODEBUPO'] = $courseJson['entiteFacture']['codeBupo'];\n $BUPO = $courseJson['CODEBUPO'].'-'.$courseJson['entiteCommanditaire']['libelle'];\n //$BUPO = $courseJson['entiteCommanditaire']['libelle'];\n if (!array_key_exists($BUPO, $bupoCoursesArray)) {\n // new bupo, then creat a new array and add the course\n $bupoCourses = array();\n $bupoCoursesArray[$BUPO] = $bupoCourses;\n }\n \n $bupoCoursesArray[$BUPO][$courseJson['id']] = $courseJson;\n }\n}", "public function get_courses() {\n\t\tif ( ! isset( $this->courses ) ) {\n\t\t\t$course_ids = array_unique( array_merge( array_keys( $this->a->get_results() ), array_keys( $this->a->get_results() ) ) );\n\t\t\tsort( $course_ids );\n\n\t\t\t$missing = [];\n\t\t\t$this->courses = [];\n\t\t\tforeach ( $course_ids as $course_id ) {\n\t\t\t\t$course = \\get_post( $course_id );\n\t\t\t\tif ( ! $course || 'course' !== get_post_type( $course ) ) {\n\t\t\t\t\t$missing[] = $course_id;\n\t\t\t\t}\n\n\t\t\t\t$this->courses[ $course_id ] = $course;\n\t\t\t}\n\n\t\t\tif ( ! empty( $missing ) ) {\n\t\t\t\t// translators: %s placeholder is list of course IDs.\n\t\t\t\t$this->notices['missing_courses'] = sprintf( __( 'The following course IDs were included in snapshots but can no longer by found: %s', 'sensei-enrollment-comparison-tool' ), implode( ', ', $missing ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $this->courses;\n\t}", "protected function _sort() {}", "public function test_get_courses_ordered_by_title_desc() {\n\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t// create 3 courses.\n\t\t$courses = $this->factory->course->create_many( 3, array( 'sections' => 0 ) );\n\n\t\t$course_first = new LLMS_Course( $courses[0] );\n\t\t$course_first->set( 'title', 'Course B' );\n\t\t$course_second = new LLMS_Course( $courses[1] );\n\t\t$course_second->set( 'title', 'Course A' );\n\t\t$course_second = new LLMS_Course( $courses[2] );\n\t\t$course_second->set( 'title', 'Course C' );\n\n\t\t$response = $this->perform_mock_request(\n\t\t\t'GET',\n\t\t\t$this->route,\n\t\t\tarray(),\n\t\t\tarray(\n\t\t\t\t'orderby' => 'title', // default is id.\n\t\t\t\t'order' => 'desc', // default is 'asc'.\n\t\t\t)\n\t\t);\n\n\t\t// Success.\n\t\t$this->assertResponseStatusEquals( 200, $response );\n\n\t\t$res_data = $response->get_data();\n\n\t\t// Check retrieved courses are ordered by title desc.\n\t\t$this->assertEquals( 'Course C', $res_data[0]['title']['rendered'] );\n\t\t$this->assertEquals( 'Course B', $res_data[1]['title']['rendered'] );\n\t\t$this->assertEquals( 'Course A', $res_data[2]['title']['rendered'] );\n\t}", "function user_courses_load($cid) {\n\tglobal $db;\n\t$user_courses = $db->array_load('USER_COURSE','Course_ID',$cid);\n\tsort($user_courses);\n\treturn $user_courses;\n}", "public function sort() {\r\n $this->putFirstAndLast();\r\n\r\n foreach ($this->boardingCards as $boardingCard) {\r\n $this->put($boardingCard);\r\n }\r\n }", "public function loadCourses(){\n \n global $DB;\n \n $records = $DB->get_records(\"bcgt_course_quals\", array(\"qualid\" => $this->id));\n if ($records)\n {\n foreach($records as $record)\n {\n $course = new \\GT\\Course($record->courseid);\n if ($course->isValid())\n {\n $this->courses[$course->id] = $course;\n }\n }\n }\n \n }", "function sort_course_code_ascend($a,$b){\n\tif (isset($a['Course_Code']) && isset($b['Course_Code'])) {\n\t\treturn strcmp($a['Course_Code'],$b['Course_Code']);\n\t}\n}", "function get_major_courses($major) {\n global $dbh;\n \n // get top 10 courses taken by students other than user with major not yet taken by user\n $query = 'SELECT subject_code,course_number,count(*) as freq FROM classes\n WHERE student_id in (SELECT student_id FROM students WHERE (major1=? or major2=?) and student_id<>?)\n and concat(subject_code,course_number) not in (SELECT concat(subject_code,course_number) FROM classes WHERE student_id=?)\n GROUP BY concat(subject_code,course_number) ORDER BY freq DESC LIMIT 10';\n $resultset = prepared_query($dbh,$query,array($major,$major,$_SESSION['user'],$_SESSION['user']));\n\n if ($resultset->numRows() > 0) {\n $major_courses = array();\n while ($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n // format course with link to search query\n $course_data = <<< EOF\n <a href=\"search/q?course_number={$row['subject_code']}+{$row['course_number']}\">{$row['subject_code']} {$row['course_number']}</a>\nEOF;\n array_push($major_courses,$course_data);\n }\n }\n echo \"<h5>Courses taken by other \".$major.\" majors</h5>\";\n echo implode(', ',$major_courses); // create list of courses\n}", "function get_courses_page($categoryid=\"all\", $sort=\"c.sortorder ASC\", $fields=\"c.*\",\n &$totalcount, $limitfrom=\"\", $limitnum=\"\") {\n\n global $USER, $CFG;\n\n $categoryselect = \"\";\n if ($categoryid != \"all\" && is_numeric($categoryid)) {\n $categoryselect = \"c.category = '$categoryid'\";\n }\n\n $teachertable = \"\";\n $visiblecourses = \"\";\n $sqland = \"\";\n if (!empty($categoryselect)) {\n $sqland = \"AND \";\n }\n if (!empty($USER) and !empty($USER->id)) { // May need to check they are a teacher\n if (!iscreator()) {\n $visiblecourses = \"$sqland ((c.visible > 0) OR t.userid = '$USER->id')\";\n $teachertable = \"LEFT JOIN {$CFG->prefix}user_teachers t ON t.course=c.id\";\n }\n } else {\n $visiblecourses = \"$sqland c.visible > 0\";\n }\n\n if ($limitfrom !== \"\") {\n $limit = sql_paging_limit($limitfrom, $limitnum);\n } else {\n $limit = \"\";\n }\n\n $selectsql = \"{$CFG->prefix}course c $teachertable WHERE $categoryselect $visiblecourses\";\n\n $totalcount = count_records_sql(\"SELECT COUNT(DISTINCT c.id) FROM $selectsql\");\n\n return get_records_sql(\"SELECT DISTINCT $fields FROM $selectsql \".((!empty($sort)) ? \"ORDER BY $sort\" : \"\").\" $limit\");\n}", "function _learn_press_get_course_terms_name_num_usort_callback( $a, $b ) {\n\tif ( $a->name + 0 === $b->name + 0 ) {\n\t\treturn 0;\n\t}\n\n\treturn ( $a->name + 0 < $b->name + 0 ) ? - 1 : 1;\n}", "public function sort();", "function i4_lms_get_courses() {\n global $wpdb, $wpcwdb;\n\n $SQL = \"SELECT course_id, course_title\n\t\t\tFROM $wpcwdb->courses\n\t\t\tORDER BY course_title ASC\n\t\t\t\";\n\n $courses = $wpdb->get_results($SQL);\n\n return $courses;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch billing, delivery and payment from session.
protected function fetchSessionDataIntoSessionAttribute() { $feUser = $this->getFrontendUser(); $this->sessionData['billing'] = \CommerceTeam\Commerce\Utility\GeneralUtility::removeXSSStripTagsArray( $feUser->getKey('ses', \CommerceTeam\Commerce\Utility\GeneralUtility::generateSessionKey('billing')) ); $this->sessionData['delivery'] = \CommerceTeam\Commerce\Utility\GeneralUtility::removeXSSStripTagsArray( $feUser->getKey('ses', \CommerceTeam\Commerce\Utility\GeneralUtility::generateSessionKey('delivery')) ); $this->sessionData['payment'] = \CommerceTeam\Commerce\Utility\GeneralUtility::removeXSSStripTagsArray( $feUser->getKey('ses', \CommerceTeam\Commerce\Utility\GeneralUtility::generateSessionKey('payment')) ); $this->sessionData['mails'] = $feUser->getKey( 'ses', \CommerceTeam\Commerce\Utility\GeneralUtility::generateSessionKey('mails') ); if ($this->piVars['check'] == 'billing' && $this->piVars['step'] == 'payment') { // Remove reference to delivery address $this->sessionData['delivery'] = false; $feUser->setKey( 'ses', \CommerceTeam\Commerce\Utility\GeneralUtility::generateSessionKey('delivery'), false ); } }
[ "public function fetchSessionData() {}", "function wpgf_pull_billing_data ( $order_id ) {\n\t$_SESSION['wcgf_email'] = $_REQUEST['billing_email'];\n\t$_SESSION['wcgf_firstname'] = $_REQUEST['billing_first_name'];\n\t$_SESSION['wcgf_orderid'] = $order_id;\n}", "public function getPayment()\n {\n return $this->_get($this->_sPaymentSessionKey);\n }", "public function trial_order_retrieve()\n {\n \n }", "public function getPaymentData();", "protected function fetchCartData()\n {\n return ShoppingCart::fetch();\n }", "public function getCheckoutSession(){\n return Mage::getSingleton('mysubscription/session');\n }", "public function getSessionData();", "public function getBillingData() {\n\n include_once $_SERVER['DOCUMENT_ROOT'] . '/Storage.php';\n $db = Storage::getInstance();\n $mysqli = $db->getConnection();\n\n $this->model->setAllOrders();\n\n $name_array = array();\n $street_array = array();\n $city_array = array();\n $state_array = array();\n $zip_array = array();\n $country_array = array();\n $wrap_array = array();\n\n $i = 0;\n while($i < count($this->model->getAllOrders())) {\n $sql_query = \"SELECT name, street, city, state, zip, country, wrap FROM orders WHERE order_id='{$this->model->getEachOrder($i)}'\";\n $result = $mysqli->query( $sql_query );\n\n if ($result->num_rows > 0) {\n // output data of each row\n while ($row = $result->fetch_assoc()) {\n array_push($name_array, $row['name']);\n array_push($street_array, $row['street']);\n array_push($city_array, $row['city']);\n array_push($state_array, $row['state']);\n array_push($zip_array, $row['zip']);\n array_push($country_array, $row['country']);\n array_push($wrap_array, $row['wrap']);\n }\n }\n\n $i++;\n }\n\n $this->model->setAccountName( $name_array );\n $this->model->setAccountStreet( $street_array );\n $this->model->setAccountCity( $city_array );\n $this->model->setAccountState( $state_array );\n $this->model->setAccountZip( $zip_array );\n $this->model->setAccountCountry( $country_array );\n $this->model->setAccountGift( $wrap_array );\n }", "public function getPayment()\n {\n }", "abstract public function getPaymentData();", "abstract function getPayment();", "public function getBilling()\n {\n return $this->getMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT)\n )->execute();\n\n }", "function getBillingDetails()\n {\n $data = $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/billing\");\n return $data;\n }", "public static function getPaymentObject();", "protected function getPaymentData($key, $type)\n {\n if($type == 'session') {\n\n $reservation = SessionReservation::find($key);\n\n $price_list = $reservation->price_list;\n\n $price = array(\n 'hours' => $price_list->total_hours,\n 'base_per_hour' => $price_list->base_hour_price,\n 'total_hour_price' => $price_list->total_hour_price,\n 'host_fee' => $price_list->host_fee,\n 'service' => $price_list->service_fee,\n 'security' => $price_list->security_fee,\n 'currency_code' => $price_list->currency_code,\n 'currency_symbol' => Currency::original_symbol($price_list->currency_code),\n 'penalty_amount' => '',\n 'guest_total' => $price_list->total_price,\n 'full_day_amount' => $price_list->full_day_amount,\n 'hour_amount' => $price_list->hour_amount,\n 'weekly_amount' => $price_list->weekly_amount,\n 'monthly_amount' => $price_list->monthly_amount,\n 'additional_total_price' => $price_list->additional_total_price,\n 'count_total_hour' => $price_list->count_total_hour,\n 'count_total_days' => $price_list->count_total_days,\n 'count_total_week' => $price_list->count_total_week,\n 'count_total_month' => $price_list->count_total_month,\n 'payment_total' => $price_list->payment_total,\n 'coupon_code' => $price_list->coupon_code,\n 'coupon_amount' => $price_list->coupon_amount,\n );\n }\n else {\n $reservation = Reservation::exceptContact()\n ->with('currency','hostPayouts','reservation_times')\n ->find($key);\n if(!$reservation) {\n return array();\n }\n \n $price = array(\n 'hours' => $reservation->hours,\n 'base_per_hour' => $reservation->base_per_hour,\n 'total_hour_price' => $reservation->subtotal,\n 'host_fee' => $reservation->host_fee,\n 'service' => $reservation->service,\n 'security' => $reservation->security,\n 'currency_code' => $reservation->currency->code,\n 'currency_symbol' => $reservation->currency->symbol,\n 'penalty_amount' => optional($reservation->hostPayouts)->total_penalty_amount,\n 'guest_total' => $reservation->subtotal,\n 'host_total' => $reservation->check_total,\n 'full_day_amount' => $reservation->per_day,\n 'hour_amount' => $reservation->per_hour,\n 'weekly_amount' => $reservation->per_week,\n 'monthly_amount' => $reservation->per_month,\n 'additional_total_price' => $reservation->subtotal,\n 'count_total_hour' => $reservation->hours,\n 'count_total_days' => $reservation->days,\n 'count_total_week' => $reservation->weeks,\n 'count_total_month' => $reservation->months,\n 'payment_total' => $reservation->total,\n 'coupon_code' => $reservation->coupon_code,\n 'coupon_amount' => $reservation->coupon_amount,\n );\n }\n\n return $price;\n }", "protected function getCouponData()\n {\n $this->couponData = session('couponData');\n }", "public function getBillingData()\n {\n return $this->data['billing'];\n }", "function getCurrentPendingPaymentInfo() ;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the location to where the form needs to submit for an edited entry
protected function _getEditSubmitLocation() { $location = $this->_getNewSubmitLocation(); $location[$this->_getPrimaryIdKey()] = $this->_getPrimaryId(); return $location; }
[ "protected function _getNewSubmitLocation()\n {\n return array('module' => $this->getRequest()->getModuleName(),\n 'controller' => $this->getRequest()->getControllerName(),\n 'action' => $this->_getAddEditAction());\n }", "public function getFormEntry()\n {\n return $this->form->getEntry();\n }", "public function getCpEditUrl()\n\t{\n\t\treturn UrlHelper::getCpUrl('formbuilder/entries/'.$this->id);\n\t}", "public function get_edit_form() {\n return $this->edit_form;\n }", "public function getFormActionUrl()\n {\n if ($this->hasFormActionUrl()) {\n return $this->getData('form_action_url');\n }\n return $this->getUrl('*/' . 'hotkeys_routes/save');\n }", "public function edit()\n {\n //It cannot retrieve an id for the location so it wants to create a new one. (is_new) {SOLVED}\n if ($this->access->hasWriteAccess()) {\n $xlcdLocationFormGUI = new xlcdLocationFormGUI($this, xlcdLocation::find($_GET[self::IDENTIFIER]));\n $xlcdLocationFormGUI->fillForm();\n $this->tpl->setContent($xlcdLocationFormGUI->getHTML());\n } else {\n $this->ctrl->redirect(ilMyTableGUI::class);\n }\n }", "protected function _getEditForm()\n {\n }", "function get_form_response_location($form, $entry) {\n\t// get current location based on form class\n\t$location = '';\n\tif( strstr( $form['cssClass'], 'locationD10' ) !== false )\n\t\t$location = 'd10';\n\tif( strstr( $form['cssClass'], 'locationK10' ) !== false )\n\t\t$location = 'k10';\n\n\t// overwrite current location based on locationChoice select field\n\tif (get_field_atts_by_admin_label( $form, $entry, 'locationChoice' ) !== false) {\n\t\t$locationField = get_field_atts_by_admin_label( $form, $entry, 'locationChoice' );\n\t\t$choice = $locationField['id'];\n\t\t$location = rgar($entry, $choice);\n\t}\n\n\treturn $location;\n}", "protected function getExposedFormActionUrl() {\n if ($this->displayHandler->getRoutedDisplay()) {\n return $this->displayHandler->getUrl();\n }\n\n $request = \\Drupal::request();\n $url = Url::createFromRequest($request);\n $url->setAbsolute();\n\n return $url;\n }", "public function getFormAction()\n {\n return $this->getUrl('zirconprocessing/catalogrequest');\n }", "public function getCommentFormAction()\n {\n return $this->url->getSiteUrl('wp-comments-post.php');\n }", "public function edit_form(){\n\t\t?>\n\t\t<form action=\"<?php echo get_save_url($this->page) ?>\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>Editing</legend>\n\t\t\t\t<label for=\"text\">Content:</label><br>\n\t\t\t\t<textarea cols=\"78\" rows=\"20\" name=\"text\" id=\"text\"><?php echo $this->file->data; ?></textarea>\n\t\t\t\t<br>\n\n\t\t\t\t<input type=\"submit\" name=\"preview\" value=\"Preview\">\n\t\t\t\t<input type=\"submit\" name=\"save\" value=\"Save\">\n\t\t\t\t<input type=\"hidden\" name=\"updated\" value=\"<?php echo $this->file->time; ?>\">\n\t\t\t</fieldset>\n\t\t</form>\n\t\t<?php\n\t}", "abstract public function getEditUrl();", "protected function getFormActionUrl() \n {\n return $this->getUrl('adminhtml/klevu_search_wizard/configure_userplan_post');\n }", "protected function get_admin_form_uri()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $_SERVER['PHP_SELF'].'?page=bmlt-wordpress-satellite-plugin.php';\n }", "public function get_form_action_url() {\n\t\treturn $this->form_action_url;\n\t}", "public function get_edit_path() {\n return $this->get_base_path() . '/field-settings';\n }", "public abstract function fetchAdminEditForm();", "public function getFormAction(){\r\n return $this->getUrl(self::URL_PATH);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the WP_Post object of the introduction page associated with a post series.
public static function get_intro_page( $post_series ) { $post_series_id = is_a( $post_series, \WP_Term::class ) ? $post_series->term_id : $post_series; $intro_page_id = self::get_intro_page_id( $post_series_id ); if ( empty( $intro_page_id ) ) { return null; } return get_post( $intro_page_id ); }
[ "public static function get_intro_page_id( $post_series ) {\n\t\t$term_id = is_a( $post_series, \\WP_Term::class ) ? $post_series->term_id : $post_series;\n\n\t\t$page_id = get_term_meta( $term_id, PostSeriesMeta::INTRO_PAGE_ID_META_KEY, true );\n\n\t\treturn ( false === $page_id ) ? '' : $page_id;\n\t}", "public static function get_whosnext_story() {\n return static::get_by_post_name( 'whos-next', [\n 'post_type' => 'pedestal_story',\n ] );\n }", "public function get_article_post() {\n\n if ( $post_id = $this->get_meta( 'article_post_id' ) ) {\n\n if ( $post = get_post( $post_id ) ) {\n return new Article( $post );\n }\n\n }\n\n return false;\n }", "public function get_article_post() {\n\n\t\tif ( $post_id = $this->get_meta( 'article_post_id' ) ) {\n\n\t\t\tif ( $post = get_post( $post_id ) ) {\n\t\t\t\treturn new Article( $post );\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\t}", "function get_episode($id = null)\n{\n $post = get_post($id);\n\n if (!$post) {\n return null;\n }\n\n $episode = Model\\Episode::find_one_by_property('post_id', $post->ID);\n\n if (!$episode) {\n return null;\n }\n\n return new Template\\Episode($episode);\n}", "public function post() {\n\t\treturn get_post( $this->post_id );\n\t}", "public function getDescriptivePost()\n {\n return $this->hasOne(DescriptivePost::class, ['post_id' => 'id']);\n }", "function gschichtn_meta_box_intro( $post ) {\n\twp_nonce_field( 'gschichtn_save_meta_boxes', 'gschichtn-story-nonce' );\n\n\t$introduction = get_post_meta( $post->ID, 'gschichtn-introduction', true );\n\n\tinclude 'partials/admin/intro.php';\n}", "public function getPost($selector) {\n\t\t$selector .= \", limit=1\";\n\t\t$item = $this->findPosts($selector)->first();\n\t\tif(!$item) return new NullPage();\n\t\treturn $item;\n\t}", "function get_jetpack_post() {\n\t$post = false;\n\n\t$safe_css_post = get_posts( array(\n\t\t'posts_per_page' => 1,\n\t\t'post_type' => 'safecss',\n\t\t'post_status' => 'private',\n\t\t'post_name' => SAFE_CSS_POST_SLUG,\n\t) );\n\n\tif ( $safe_css_post ) {\n\t\t$post = $safe_css_post[0];\n\t}\n\n\treturn $post;\n}", "function sensei_the_lesson_excerpt( $lesson_id = '' ) {\n\n if( empty( $lesson_id )){\n\n $lesson_id = get_the_ID();\n\n }\n\n if( 'lesson' != get_post_type( $lesson_id ) ){\n return;\n }\n\n echo Sensei_Lesson::lesson_excerpt( get_post( $lesson_id ), false );\n\n}", "function sp_get_sermons_by_series($series_page_id)\n{\n\t$args = array (\n\t\t'numberposts'=> -1,\n\t\t'post_type'=>'sp_sermon',\n\t\t'meta_query' => array (\n\t\t\tarray (\n\t\t\t\t'key' => 'sermon_series',\n\t\t\t\t'value'=> $series_page_id,\n\t\t\t)\n\t\t),\n\t\t'orderby'=> 'post_date',\n\t\t'order' => 'ASC'\n\t);\n\treturn get_posts($args);\n}", "private function makeArticlePageInstance()\n {\n return ArticlePage::create([\n 'toc' => $this->extractToc(),\n 'length' => $this->extractLength(),\n 'toctext' => $this->extractTocText(),\n 'abstract' => $this->extractAbstract(),\n ]);\n }", "function get_demo_personalization_block_page() : ?WP_Post {\n\t$existing = new WP_Query(\n\t\t[\n\t\t\t'post_type' => 'page',\n\t\t\t'meta_key' => '_altis_analytics_demo_data',\n\t\t\t'posts_per_page' => 1,\n\t\t]\n\t);\n\n\tif ( ! $existing->found_posts ) {\n\t\treturn null;\n\t}\n\n\treturn $existing->posts[0];\n}", "public function next_post() {\n\n\t\t$this->current_post++;\n\n\t\t/** @var WP_Post */\n\t\t$this->post = $this->posts[ $this->current_post ];\n\t\treturn $this->post;\n\t}", "public function get_home_page()\n\t{\n\t\t$post = null;\n\t\tswitch( get_option('show_on_front') )\n\t\t{\n\t\t\tcase 'page':\n\t\t\t\t$id = get_option( 'page_on_front' );\n\t\t\t\tif( empty($id) ) break;\n\t\t\t\t\n\t\t\t\t$query = new WP_Query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'p'\t\t\t\t\t=> $id,\n\t\t\t\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t\t\t\t'post_status'\t\t=> 'publish',\n\t\t\t\t\t\t'posts_per_page'\t=> 1,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif( $query->have_posts() )\n\t\t\t\t{\n\t\t\t\t\t$query->the_post();\n\t\t\t\t\t$post = get_post();\n\t\t\t\t}\n\n\t\t\t\twp_reset_query();\n\t\t\t\tbreak;\n\n\t\t\tcase 'posts':\n\t\t\tdefault:\n\t\t\t\t$query = new WP_Query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'\t\t\t=> 'post',\n\t\t\t\t\t\t'post_status'\t\t=> 'publish',\n\t\t\t\t\t\t'posts_per_page'\t=> 1\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif( $query->have_posts() )\n\t\t\t\t{\n\t\t\t\t\t$query->the_post();\n\t\t\t\t\t$post = get_post();\n\t\t\t\t}\n\n\t\t\t\twp_reset_query();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $post;\n\t}", "public function getNewsIntro() {\n return $this->newsIntro;\n }", "public function getFirstPost() {\r\n\t\treturn $this->getPosts()->first();\r\n\t}", "public function getText($refresh = false)\n {\n if ($refresh) { // We want to query the API\n // Specify relevant page properties to retrieve\n $data = array(\n 'titles' => $this->title,\n 'prop' => 'info|revisions',\n 'rvprop' => 'content', // Need to get page text\n 'curtimestamp' => 1,\n );\n\n $r = $this->wikimate->query($data); // Run the query\n\n // Check for errors\n if (isset($r['error'])) {\n $this->error = $r['error']; // Set the error if there was one\n return null;\n } else {\n $this->error = null; // Reset the error status\n }\n\n // Get the page (there should only be one)\n $page = array_pop($r['query']['pages']);\n\n // Abort if invalid page title\n if (isset($page['invalid'])) {\n $this->invalid = true;\n return null;\n }\n\n $this->starttimestamp = $r['curtimestamp'];\n unset($r, $data);\n\n if (!isset($page['missing'])) {\n // Update the existence if the page is there\n $this->exists = true;\n // Put the content into text\n $this->text = $page['revisions'][0]['*'];\n }\n unset($page);\n\n // Now we need to get the section headers, if any\n preg_match_all('/(={1,6}).*?\\1 *(?:\\n|$)/', $this->text, $matches);\n\n // Set the intro section (between title and first section)\n $this->sections->byIndex[0]['offset'] = 0;\n $this->sections->byName['intro']['offset'] = 0;\n\n // Check for section header matches\n if (empty($matches[0])) {\n // Define lengths for page consisting only of intro section\n $this->sections->byIndex[0]['length'] = strlen($this->text);\n $this->sections->byName['intro']['length'] = strlen($this->text);\n } else {\n // Array of section header matches\n $sections = $matches[0];\n\n // Set up the current section\n $currIndex = 0;\n $currName = 'intro';\n\n // Collect offsets and lengths from section header matches\n foreach ($sections as $section) {\n // Get the current offset\n $currOffset = strpos($this->text, $section, $this->sections->byIndex[$currIndex]['offset']);\n\n // Are we still on the first section?\n if ($currIndex == 0) {\n $this->sections->byIndex[$currIndex]['length'] = $currOffset;\n $this->sections->byIndex[$currIndex]['depth'] = 0;\n $this->sections->byName[$currName]['length'] = $currOffset;\n $this->sections->byName[$currName]['depth'] = 0;\n }\n\n // Get the current name and index\n $currName = trim(str_replace('=', '', $section));\n $currIndex++;\n\n // Search for existing name and create unique one\n $cName = $currName;\n for ($seq = 2; array_key_exists($cName, $this->sections->byName); $seq++) {\n $cName = $currName . '_' . $seq;\n }\n if ($seq > 2) {\n $currName = $cName;\n }\n\n // Set the offset and depth (from the matched ='s) for the current section\n $this->sections->byIndex[$currIndex]['offset'] = $currOffset;\n $this->sections->byIndex[$currIndex]['depth'] = strlen($matches[1][$currIndex - 1]);\n $this->sections->byName[$currName]['offset'] = $currOffset;\n $this->sections->byName[$currName]['depth'] = strlen($matches[1][$currIndex - 1]);\n\n // If there is a section after this, set the length of this one\n if (isset($sections[$currIndex])) {\n // Get the offset of the next section\n $nextOffset = strpos($this->text, $sections[$currIndex], $currOffset);\n // Calculate the length of this one\n $length = $nextOffset - $currOffset;\n\n // Set the length of this section\n $this->sections->byIndex[$currIndex]['length'] = $length;\n $this->sections->byName[$currName]['length'] = $length;\n } else {\n // Set the length of last section\n $this->sections->byIndex[$currIndex]['length'] = strlen($this->text) - $currOffset;\n $this->sections->byName[$currName]['length'] = strlen($this->text) - $currOffset;\n }\n }\n }\n }\n\n return $this->text; // Return the text in any case\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Multiplies all values of array $a with $m
function mmult($a, $m) { foreach ($a as $i=>$v) { $a[$i] = $v*$m; } return $a; }
[ "function multi($a){\n\t$acu = 1;\n\t\tforeach($a as $v){\n\t\t\t$acu *= $v;\n\t\t}\n\techo \"La multiplicación vale $acu\";\n\t}", "function matrixmult($m1, $m2){\n\t$r = count($m1);\n\t$c = count($m2[0]);\n\t$p = count($m2);\n\tif(count($m1[0]) != $p){throw new Exception('Incompatible matrixes');}\n\t$m3 = array();\n\tfor ($i = 0; $i < $r; $i++){\n\t\tfor($j = 0; $j < $c; $j++){\n\t\t\t$m3[$i][$j] = 0;\n\t\t\tfor($k = 0; $k < $p; $k++){\n\t\t\t\t$m3[$i][$j] += $m1[$i][$k] * $m2[$k][$j];\n\t\t\t}\n\t\t}\n\t}\n\treturn $m3;\n}", "public function multiply($a, $b);", "private function _multiply()\r\n {\r\n list($a, $b) = $this->_stack->splice(-2, 2);\r\n \r\n $this->_validate($a);\r\n $this->_validate($b);\r\n \r\n $this->_stack->push(array_product(array($a, $b)));\r\n }", "function multiply($num, $multiple){\n $new_array= array();\n foreach ($num as $number) {\n array_push($new_array, $number * $multiple);\n }\n return $new_array;\n}", "function M_multiplication_entrywise($vector_0,$vector_1)\r\n{\r\n $result = [];\r\n foreach ($vector_0 as $key => $value)\r\n {\r\n $result[$key] = $vector_0[$key]*$vector_1[$key];\r\n }\r\n\r\n return $result;\r\n}", "function matrix_multiply($m1, $m2){\n\t$r = count($m1);\n\t$c = count($m2[0]);\n\t$p = count($m2);\n\tif(count($m1[0]) != $p){\n\t\treturn false; //incompatible matrix\n\t}\n\t$m3 = array();\n\tfor($i = 0; $i < $r; $i++){\n\t\tfor($j = 0; $j < $c; $j++){\n\t\t\t$m3[$i][$j] = 0;\n\t\t\tfor($k = 0; $k < $p; $k++){\n\t\t\t\t$m3[$i][$j] += $m1[$i][$k]*$m2[$k][$j];\n\t\t\t}\n\t\t}\n\t}\n\treturn ($m3);\n}", "function array_product (array $array) {}", "public function multiply($value);", "public static function multiply($values) {\n\t\treturn array_product($values);\n\t}", "public static function mul(/**\n * If $b was negative, we then apply the same value to $c here.\n * It doesn't matter much if $a was negative; the $c += above would\n * have produced a negative integer to begin with. But a negative $b\n * makes $b >>= 1 never return 0, so we would end up with incorrect\n * results.\n *\n * The end result is what we'd expect from integer multiplication.\n */\n$a, /**\n * If $b was negative, we then apply the same value to $c here.\n * It doesn't matter much if $a was negative; the $c += above would\n * have produced a negative integer to begin with. But a negative $b\n * makes $b >>= 1 never return 0, so we would end up with incorrect\n * results.\n *\n * The end result is what we'd expect from integer multiplication.\n */\n$b, /**\n * If $b was negative, we then apply the same value to $c here.\n * It doesn't matter much if $a was negative; the $c += above would\n * have produced a negative integer to begin with. But a negative $b\n * makes $b >>= 1 never return 0, so we would end up with incorrect\n * results.\n *\n * The end result is what we'd expect from integer multiplication.\n */\n$size = 0) {}", "function multiply_by_n($arr, $n) {\n foreach ($arr as $index => $value) {\n $arr[$index] = ($value * $n);\n };\n return $arr;\n}", "public function mult(array $real0, array $real1): array;", "public function multiply($multiplier);", "function valueTimesArray($v1,$value){\n\n $p[0]=$v1[0]*$value;\n $p[1]=$v1[1]*$value;\n $p[2]=$v1[2]*$value;\n\n return $p;\n}", "function array_product ($arg) {}", "public function mTranspose($a)\n {\n $n = count($a);\n $m = count($a[1]);\n \n for ($i=1; $i<=$n; $i++) {\n for ($j=1; $j<=$m; $j++) {\n $c[$j][$i] = $a[$i][$j];\n }\n }\n \n return $c; \n }", "public function mult()\r\n\t{\r\n\t\treturn array_product($this->valores);\r\n\t}", "public function multiply( array $vector, array &$result ) {\n\t\tfor( $i = 0; $i < getRows(); ++$i ) {\n\t\t\t$result[$i] = 0;\n\t\t\tfor( $j = 0; $j < getCols(); ++$j ) {\n\t\t\t\t$result[$i] += $this->matrix[$i][$j] * $vector[$j];\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Implements hook_theme_script(). Since Drupal 7 does not (yet) support the 'browser' option in drupal_add_js() ddbasic provides a way to load scripts inside conditional comments. This function wraps a file in script elements and returns a string.
function ddbasic_theme_script($filepath) { $script = ''; // We need the default query string for cache control finger printing. $query_string = variable_get('css_js_query_string', '0'); if (file_exists($filepath)) { $file = file_create_url($filepath); $script = '<script src="' . $file . '?' . $query_string . '"></script>'; } return $script; }
[ "function theme_conditional_scripts()\n{\n}", "function script_script()\n{\n prepare_for_known_ajax_response();\n\n header('Content-Type: application/javascript');\n $script = get_param_string('script');\n if ($script != '') {\n $path = javascript_enforce(filter_naughty($script), get_param_string('theme', null));\n if ($path != '') {\n echo @str_replace('../../../', '', cms_file_get_contents_safe($path));\n }\n }\n\n exit(); // So auto_append_file cannot run and corrupt our output\n}", "static function htm_includeJSFile($filename) {\r\n\t\t$content = '\r\n<script language=\"JavaScript\" src=\"'.$filename.'\" type=\"text/javascript\"></script>';\r\n\t\treturn $content;\r\n\t}", "public function getFallbackScriptContents($fileName = \"\"):string {\r\n $jsContents = $this->getJsContents($fileName,\"fallbacks\");\r\n\r\n if(!wp_script_is('jquery', 'enqueued') ){\r\n wp_enqueue_script('jquery');\r\n }\r\n\r\n return '\r\n (function(variables){\r\n (function($){\r\n $(function(){'.$jsContents.'});\r\n })(window.jQuery);\r\n })({\"jsRootURL\":\"'.$this->jsURL.'\",\"cssRootURL\":\"'.$this->cssURL.'\"});';\r\n }", "function src_inc_js(string $file) : string{\n return \"<script type='text/javascript' src='\".$file.\"'></script>\";\n}", "function scriptContent() {}", "function javascript($file = '') {\n return JS_PATH . $file;\n}", "function _script(){\n\t$sitewideWarnings = _cfg('sitewideWarnings');\n\t$sites = _cfg('sites');\n\t$script = '<script type=\"text/javascript\">';\n\t$script .= 'var LC = {};';\n\tif(WEB_ROOT){\n\t\t$script .= 'var WEB_ROOT = \"'.WEB_ROOT.'\";';\n\t\t$script .= 'LC.root = WEB_ROOT;';\n\t}\n\tif(WEB_APP_ROOT){\n\t\t$script .= 'var WEB_APP_ROOT = \"'.WEB_APP_ROOT.'\";';\n\t\t$script .= 'LC.appRoot = WEB_ROOT;';\n\t}\n\t$script .= 'LC.self = \"'._self().'\";';\n\t$script .= 'LC.lang = \"'._lang().'\";';\n\t$script .= 'LC.baseURL = \"'._cfg('baseURL').'/\";';\n\t$script .= 'LC.route = \"'._r().'\";';\n\t$script .= 'LC.namespace = \"'.LC_NAMESPACE.'\";';\n\t$script .= 'LC.sites = '.(is_array($sites) && count($sites) ? json_encode($sites) : 'false').';';\n\t$script .= 'LC.sitewideWarnings = '.json_encode($sitewideWarnings).';';\n\t# run hook\n\tif(function_exists('__script')) __script();\n\t# user defined variables\n\t$jsVars = _cfg('jsVars');\n\tif(count($jsVars)){\n\t\tforeach($jsVars as $name => $val){\n\t\t\tif(is_array($val)) $script .= 'LC.'.$name.' = '.json_encode($val).';';\n\t\t\telseif(is_numeric($val)) $script .= 'LC.'.$name.' = '.$val.';';\n\t\t\telse $script .= 'LC.'.$name.' = \"'.$val.'\";';\n\t\t}\n\t}\n\t$script .= '</script>';\n\techo $script;\n}", "function javascript_include_tag()\n{\n $sources = func_get_args();\n $sourceOptions = (func_num_args() > 1 && is_array($sources[func_num_args() - 1])) ? array_pop($sources) : array();\n\n $html = '';\n foreach ($sources as $source)\n {\n $absolute = false;\n if (isset($sourceOptions['absolute']))\n {\n unset($sourceOptions['absolute']);\n $absolute = true;\n }\n\n $condition = null;\n if (isset($sourceOptions['condition']))\n {\n $condition = $sourceOptions['condition'];\n unset($sourceOptions['condition']);\n }\n\n if (!isset($sourceOptions['raw_name']))\n {\n $source = javascript_path($source, $absolute);\n }\n else\n {\n unset($sourceOptions['raw_name']);\n }\n\n $options = array_merge(array('type' => 'text/javascript', 'src' => $source), $sourceOptions);\n $tag = content_tag('script', '', $options);\n\n if (null !== $condition)\n {\n $tag = comment_as_conditional($condition, $tag);\n }\n\n $html .= $tag.\"\\n\";\n }\n\n return $html;\n}", "static function jsFile(){\n $files = explode(',',F3::get('PARAMS.file'));\n foreach($files as $i=>$file)\n $files[$i] = 'pg.'.$file.'.js';\n echo 'window.onload = function () {';\n self::loadFiles($files);\n echo '}';\n }", "function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALSE) {\n if (!isset($javascript)) {\n $javascript = drupal_add_js();\n }\n\n // If no JavaScript items have been added, or if the only JavaScript items\n // that have been added are JavaScript settings (which don't do anything\n // without any JavaScript code to use them), then no JavaScript code should\n // be added to the page.\n if (empty($javascript) || (isset($javascript['settings']) && count($javascript) == 1)) {\n return '';\n }\n\n // Allow modules to alter the JavaScript.\n if (!$skip_alter) {\n drupal_alter('js', $javascript);\n }\n\n // Filter out elements of the given scope.\n $items = array();\n foreach ($javascript as $key => $item) {\n if ($item['scope'] == $scope) {\n $items[$key] = $item;\n }\n }\n\n $output = '';\n // The index counter is used to keep aggregated and non-aggregated files in\n // order by weight.\n $index = 1;\n $processed = array();\n $files = array();\n $preprocess_js = (variable_get('preprocess_js', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));\n\n // A dummy query-string is added to filenames, to gain control over\n // browser-caching. The string changes on every update or full cache\n // flush, forcing browsers to load a new copy of the files, as the\n // URL changed. Files that should not be cached (see drupal_add_js())\n // get REQUEST_TIME as query-string instead, to enforce reload on every\n // page request.\n $default_query_string = variable_get('css_js_query_string', '0');\n\n // For inline JavaScript to validate as XHTML, all JavaScript containing\n // XHTML needs to be wrapped in CDATA. To make that backwards compatible\n // with HTML 4, we need to comment out the CDATA-tag.\n $embed_prefix = \"\\n<!--//--><![CDATA[//><!--\\n\";\n $embed_suffix = \"\\n//--><!]]>\\n\";\n\n // Since JavaScript may look for arguments in the URL and act on them, some\n // third-party code might require the use of a different query string.\n $js_version_string = variable_get('drupal_js_version_query_string', 'v=');\n\n // Sort the JavaScript so that it appears in the correct order.\n uasort($items, 'drupal_sort_css_js');\n\n // Provide the page with information about the individual JavaScript files\n // used, information not otherwise available when aggregation is enabled.\n $setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1);\n unset($setting['ajaxPageState']['js']['settings']);\n drupal_add_js($setting, 'setting');\n\n // If we're outputting the header scope, then this might be the final time\n // that drupal_get_js() is running, so add the setting to this output as well\n // as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's\n // because drupal_get_js() was intentionally passed a $javascript argument\n // stripped off settings, potentially in order to override how settings get\n // output, so in this case, do not add the setting to this output.\n if ($scope == 'header' && isset($items['settings'])) {\n $items['settings']['data'][] = $setting;\n }\n\n // Loop through the JavaScript to construct the rendered output.\n $element = array(\n '#tag' => 'script',\n '#value' => '',\n '#attributes' => array(\n 'type' => 'text/javascript',\n ),\n );\n foreach ($items as $item) {\n $query_string = empty($item['version']) ? $default_query_string : $js_version_string . $item['version'];\n\n switch ($item['type']) {\n case 'setting':\n $js_element = $element;\n $js_element['#value_prefix'] = $embed_prefix;\n $js_element['#value'] = 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(drupal_array_merge_deep_array($item['data'])) . \");\";\n $js_element['#value_suffix'] = $embed_suffix;\n $output .= theme('html_tag', array('element' => $js_element));\n break;\n\n case 'inline':\n $js_element = $element;\n if ($item['defer']) {\n $js_element['#attributes']['defer'] = 'defer';\n }\n $js_element['#value_prefix'] = $embed_prefix;\n $js_element['#value'] = $item['data'];\n $js_element['#value_suffix'] = $embed_suffix;\n $processed[$index++] = theme('html_tag', array('element' => $js_element));\n break;\n\n case 'file':\n $js_element = $element;\n if (!$item['preprocess'] || !$preprocess_js) {\n if ($item['defer']) {\n $js_element['#attributes']['defer'] = 'defer';\n }\n $query_string_separator = (strpos($item['data'], '?') !== FALSE) ? '&' : '?';\n $js_element['#attributes']['src'] = file_create_url($item['data']) . $query_string_separator . ($item['cache'] ? $query_string : REQUEST_TIME);\n $processed[$index++] = theme('html_tag', array('element' => $js_element));\n }\n else {\n // By increasing the index for each aggregated file, we maintain\n // the relative ordering of JS by weight. We also set the key such\n // that groups are split by items sharing the same 'group' value and\n // 'every_page' flag. While this potentially results in more aggregate\n // files, it helps make each one more reusable across a site visit,\n // leading to better front-end performance of a website as a whole.\n // See drupal_add_js() for details.\n $key = 'aggregate_' . $item['group'] . '_' . $item['every_page'] . '_' . $index;\n $processed[$key] = '';\n $files[$key][$item['data']] = $item;\n }\n break;\n\n case 'external':\n $js_element = $element;\n // Preprocessing for external JavaScript files is ignored.\n if ($item['defer']) {\n $js_element['#attributes']['defer'] = 'defer';\n }\n $js_element['#attributes']['src'] = $item['data'];\n $processed[$index++] = theme('html_tag', array('element' => $js_element));\n break;\n }\n }\n\n // Aggregate any remaining JS files that haven't already been output.\n if ($preprocess_js && count($files) > 0) {\n foreach ($files as $key => $file_set) {\n $uri = drupal_build_js_cache($file_set);\n // Only include the file if was written successfully. Errors are logged\n // using watchdog.\n if ($uri) {\n $preprocess_file = file_create_url($uri);\n $js_element = $element;\n $js_element['#attributes']['src'] = $preprocess_file;\n $processed[$key] = theme('html_tag', array('element' => $js_element));\n }\n }\n }\n\n // Keep the order of JS files consistent as some are preprocessed and others are not.\n // Make sure any inline or JS setting variables appear last after libraries have loaded.\n return implode('', $processed) . $output;\n}", "function custom_get_custom_script($file = null)\n{\n return custom_get_script($file, 'custom');\n}", "function addHeaderScript($file_name) {\n\treturn \"<script type=\\\"text/javascript\\\" src=\\\"\" . $file_name . \"\\\"></script>\";\n}", "function web12_custom_scripts() {\n\t\t#\t\tscript-keys: type*URL,type*URL... \t\n\t\t#\t\texample: fly*fly.bobBee,js*post.test\n\t\t# \t\tScripts are added from theme /js folder\t\t \n\t\t#\t\tand are appended with .js\n\t\t#\t\tscript names should be enqueue friendly (lowercase string)\n\t\t#\t\ttypes: js (for generic),raphael,paper,fx (to add dependencies)\n\t\t#\t\ttype fly adds paper.js and flypaper.js as dependencies\n\t\t#\t\ttype paper (not implememnted yet) also adds scripts as text/paperscript\n\t\t#\n\t\t#\tCalled by: header.php before wp_head()\n\t\t\n\t\t\t# get script keys\n\t\tglobal $post;\n\t\t$script_list = get_post_meta($post->ID,'script-keys',true);\n\t\tif (!empty($script_list)) {\n\t\t\t\t# split keys\n\t\t\t$keys = explode(',', $script_list);\n\t\t\tforeach ($keys as $key) {\n\t\t\t\t$a_script = explode('*',$key);\n\t\t\t\t$type = $a_script[0];\n\t\t\t\t$script = $a_script[1];\n\t\t\t\tif ($script[0] == 'paper') {\n\t\t\t\t\t# add paperscript function here if needed...\n\t\t\t\t} else {\n\t\t\t\t\t\t# handle dependencies\n\t\t\t\t\tweb12_add_script_deps($type);\n\t\t\t\t\t# register and enqueue script\n\t\t\t\t\tweb12_add_custom_scripts($script);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function orangecooltheme_javascript_detection() {\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}", "function navis_get_theme_script_url( $filename ) {\n return navis_get_theme_resource_url( 'js', $filename );\n}", "function theme_add_module_type_scripts($tag, $handler, $src) {\n if ($handler === 'theme-utils') {\n $tag = '<script type=\"module\" src=\"' . esc_url( $src ) . '\"></script>';\n return $tag;\n }\n return $tag;\n }", "static function admin_additional_script() {\n\t\t//Avec netbeans, le javascript n'est considéré comme tel qu'entre des balises script oiu dans un ficher .js\n\t\tif (0) {\n\t\t\t?><script><?php\n\t\t}\n\t\t?>\n\n\t\t<?php\n\t\tif (0) {\n\t\t\t?></script><?php\n\t\t}\n\t}", "function include_javascript(string $script, string $path = NULL)\n{\n if (! $path)\n $path = \"/engine/js\";\n if ($path == \"template\")\n $path = \"templates/\" . Template;\n echo \"<script src='$path/$script.js'></script>\";\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method used to remove all subscriptions associated with a given set of issues.
function removeByIssues($ids) { $items = @implode(", ", Misc::escapeInteger($ids)); $stmt = "SELECT sub_id FROM " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription WHERE sub_iss_id IN ($items)"; $res = DB_Helper::getInstance()->getCol($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return false; } else { self::remove($res); return true; } }
[ "public function removeCalendarSubscriptions()\n {\n foreach ($this->subscriptions as $sub) {\n $this->subscriptions->removeElement($sub);\n $sub->delete(false);\n }\n }", "public static function clearSubscriptions() {\n\t\t$boardIDs = Board::getAccessibleBoards();\n\t\t\n\t\t// clear board subscriptions\n\t\t$sql = \"DELETE FROM\twbb\".WBB_N.\"_board_subscription\n\t\t\tWHERE\t\tuserID = \".WCF::getUser()->userID.\"\n\t\t\t\t\t\".(!empty($boardIDs) ? \"AND boardID NOT IN (\".$boardIDs.\")\" : \"\");\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// clear thread subscriptions\n\t\t$sql = \"DELETE FROM\twbb\".WBB_N.\"_thread_subscription\n\t\t\tWHERE\t\tuserID = \".WCF::getUser()->userID.\"\n\t\t\t\t\t\".(!empty($boardIDs) ? \"AND threadID IN (\n\t\t\t\t\t\tSELECT\tthreadID\n\t\t\t\t\t\tFROM\twbb\".WBB_N.\"_thread\n\t\t\t\t\t\tWHERE\tboardID NOT IN (\".$boardIDs.\")\n\t\t\t\t\t)\" : \"\");\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "function removeByIssues($ids)\n {\n $items = implode(\", \", Misc::escapeInteger($ids));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_requirement\n WHERE\n isr_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n return true;\n }\n }", "public function cleanupAll(array $authorizationChallenges);", "protected function _unsubscribe()\n {\n if (count($this->_pubsubTopics)) {\n $this->debug('Unsubscribing from pubsub topics %s', implode(', ', $this->_pubsubTopics));\n $command = [\n 'unsub' => $this->_pubsubTopics,\n ];\n $this->_publish(self::PUBSUB_TOPIC, Realtime::jsonEncode($command), self::ACKNOWLEDGED_DELIVERY);\n }\n if (count($this->_graphqlTopics)) {\n $this->debug('Unsubscribing from graphql topics %s', implode(', ', $this->_graphqlTopics));\n $command = [\n 'unsub' => $this->_graphqlTopics,\n ];\n $this->_publish(self::REALTIME_SUB_TOPIC, Realtime::jsonEncode($command), self::ACKNOWLEDGED_DELIVERY);\n }\n }", "public function clearPublishers()\n {\n foreach ($this->publishers as $publisher) {\n $this->removePublisher($publisher);\n }\n }", "function unsubscribe_all() {\n if($this->request->isSubmitted() && ($this->request->isAsyncCall() || $this->request->isApiCall())) {\n if($this->active_object->subscriptions()->canSubscribe($this->logged_user)) {\n try {\n\n $this->active_object->subscriptions()->unsubscribeAllUsers();\n $this->response->respondWithData($this->active_object, array(\n 'as' => $this->active_object->getBaseTypeName(),\n 'detailed' => true,\n ));\n } catch(Exception $e) {\n $this->response->exception($e);\n } // try\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function removeByIssues($ids)\n {\n $items = implode(\", \", Misc::escapeInteger($ids));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_checkin\n WHERE\n isc_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n }\n\n return true;\n }", "private function deleteRemovedRuleSets(){\n \n global $DB;\n \n // Delete any rule sets not submitted this time\n $oldRuleSetIDs = array();\n $currentRuleSetIDs = array();\n \n $oldRuleSets = $DB->get_records(\"bcgt_qual_structure_rule_set\", array(\"qualstructureid\" => $this->id));\n if ($oldRuleSets)\n {\n foreach($oldRuleSets as $oldRuleSet)\n {\n $oldRuleSetIDs[] = $oldRuleSet->id;\n }\n }\n \n // Now loop through rule sets on this object\n if ($this->ruleSets)\n {\n foreach($this->ruleSets as $ruleSet)\n {\n $currentRuleSetIDs[] = $ruleSet->getID();\n }\n }\n \n // Now remove the ones not present on the object \n $removeIDs = array_diff($oldRuleSetIDs, $currentRuleSetIDs);\n if ($removeIDs)\n {\n foreach($removeIDs as $removeID)\n {\n $DB->delete_records(\"bcgt_qual_structure_rule_set\", array(\"id\" => $removeID));\n }\n }\n \n \n // Now loop through the Rule Sets and remove any Rules that were not submitted this time\n if ($this->ruleSets)\n {\n foreach($this->ruleSets as $ruleSet)\n {\n $ruleSet->deleteRemovedRules();\n }\n }\n \n \n }", "public function removeSets();", "function removeByIssues($ids)\n {\n $ids = Misc::escapeInteger($ids);\n $items = @implode(\", \", $ids);\n $stmt = \"SELECT\n iat_id\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->getCol($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n }\n\n foreach ($res as $id) {\n self::remove($id);\n }\n return true;\n }", "public function unsubscribeAll(Request $request)\n {\n $user = Auth::user();\n $rubrics = Rubric::all();\n\n if($rubrics){\n $user->rubrics()->detach($rubrics);\n return response()->json([\n 'status' => 'success',\n ]);\n } else {\n return response()->json([\n 'status' => 'failed',\n ]);\n }\n }", "function clearSubscriptions() {\n\t\tglobal $current_user;\n\n\t\tif(!empty($current_user->id)) {\n $this->db->getConnection()\n ->delete('folders_subscriptions', ['assigned_user_id' => $current_user->id]);\n\t\t}\n\t}", "public function clearNarrationIssues()\n {\n $this->collNarrationIssues = null; // important to set this to NULL since that means it is uninitialized\n }", "public function clearTopicSubscriptions()\n {\n $this->topicSubscriptions->clear();\n }", "public static function reload_issues() {\n\t\t// Remove issue and issue counts.\n\t\tself::remove();\n\t}", "function delete_subscriptions()\n\t{\n\t\tee()->db->where($this->publisher);\n\t\tee()->db->delete($this->table);\n\t}", "public function remove_notifications()\n {\n $this->addchat_lib->remove_notifications();\n }", "function deleteAllSubscriptions() {\n\n\t\treturn $this->httpDelete($this->_baseUrl.'subscriptions');\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the input name prefix.
public function get_input_name_prefix() { return $this->input_name_prefix; }
[ "public function get_name_prefix() {\n return $this->prefix_name;\n }", "public function get_name_prefix() {\n return $this->get_person_name_field( 'prefix' );\n }", "protected function getFieldNamePrefix()\n {\n if ($this->hasArgument('fieldNamePrefix')) {\n return $this->arguments['fieldNamePrefix'];\n }\n return $this->getDefaultFieldNamePrefix();\n }", "public function prefixName($prefix);", "protected function _getPrefix()\n {\n $prefix = $this->param('prefix');\n if (!$prefix) {\n return '';\n }\n $parts = explode('/', $prefix);\n\n return implode('/', array_map([$this, '_camelize'], $parts));\n }", "public function getPrefix()\n {\n if (empty($this->prefix)) {\n return '';\n }\n\n return Format::personName($this->prefix);\n }", "public function getFieldNamePrefix()\n {\n return $this->getData('field_name_prefix');\n }", "public function getPrefix () {}", "public function getPrefix();", "public static function get_prefix()\n {\n return self::$prefix;\n }", "public function getPrefix(): string {\n\t\treturn implode( '', array_map( static function ( $part ) {\n\t\t\treturn ucfirst( $part );\n\t\t}, explode( '-', $this->wikiId ) ) );\n\t}", "public function getPrefix()\n {\n $connector_parameters = $this->getConnectorParameters();\n \n foreach( $connector_parameters as $param )\n {\n if( $param->getName() == self::PREFIX )\n {\n return $param->getValue();\n }\n }\n }", "private function getPrefixOption(InputInterface $input): string\n {\n return strval($input->getOption('prefix')) ?? '';\n }", "public function getClassInputName() {\n\t\t$pattern = $this->enableColonNamespacing ? \"/[_.:-]+/\" : \"/[_.-]+/\";\n\t\t$segments = preg_split($pattern, $this->input);\n\t\t$segments = array_map('ucfirst', $segments);\n\t\t$name = implode('', $segments);\n\t\t$name = implode('/', array_map('ucfirst', preg_split(\"/[\\/\\\\\\]+/\", $name)));\n\n\t\treturn $name;\n\t}", "public function inputName() \n {\n $stripped = preg_replace('/\\s+/', '', $this->name);\n\n return $this->delimeter . $this->id . '-' . strtolower($stripped);\n }", "public function getPrefix() {\n return $this->prefix;\n }", "public function getNamePrefix(): ?string;", "protected function getFieldNamePrefix() {}", "public function buildPrefixedFieldName()\n {\n $field_name = $this->field->getAttribute('field_name');\n\n if ($this->prefix) {\n $adjustedPrefix = str_replace('.', '[', $this->prefix);\n\n if (str_contains($adjustedPrefix, '[')) {\n $adjustedPrefix = $adjustedPrefix.']';\n }\n\n return $adjustedPrefix.'['.$field_name.']';\n }\n\n return $field_name;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for updateClientUsingPut Update a client.
public function testUpdateClientUsingPut() { }
[ "public function testUpdateAdminClientUsingPUT()\n {\n }", "public function testUpdateClientResponseUsingPut()\n {\n }", "public function testUpdateClientStatusUsingPut()\n {\n }", "public function testUpdateBrokerageClientUsingPut()\n {\n }", "public function testUpdateClient()\n {\n }", "public function testAlterClientApi(){\n $client = \\App\\Client::create([\n 'name' => 'Daniel Araujo',\n 'mail' => 'daniel@gmail.com',\n 'celphone' => '(11) 94859-9865',\n 'age' => 30\n ]); \n\n $affected = \\App\\Client::where('id', $client->id)->update(['name'=>'Daniel Araujo Santos']);\n\n $this->assertDatabaseHas('clients', [\n 'name' => 'Daniel Araujo Santos',\n 'mail' => 'daniel@gmail.com',\n 'celphone' => '(11) 94859-9865',\n 'age' => 30\n ]);\n }", "public function testPutMethodIsUsed() {\n\t\t$connection = new TestJsonApiClientHttpSocketAdapter();\n\n\t\t//Pre-set our response so we are not actually making an HTTP call\n\t\t$response = new HttpResponse();\n\t\t$response->body = 'test';\n\t\t$response->code = 200;\n\t\t$connection->socket->_testResponse = $response;\n\n\t\t//Pass our method into makeRequest\n\t\t$connection->makeRequest('PUT', 'test');\n\n\t\t//Verify the socket was built with the correct method\n\t\t$actual = $connection->socket->_testRequest['method'];\n\t\t$expected = 'PUT';\n\t\t$this->assertEqual($actual, $expected);\n\t}", "function test_update()\n {\n //Arrange\n $client_name = \"Alicia\";\n $id = null;\n $stylist_id = 2;\n $test_client = new Client($client_name, $id, $stylist_id);\n $test_client->save();\n\n $new_client_name = \"Yuri\";\n\n //Act\n $test_client->update($new_client_name);\n\n //Assert\n $this->assertEquals($new_client_name, $test_client->getclientName());\n\n }", "public function testUpdateDocumentUsingPut()\n {\n }", "public function testPut()\n\t {\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/HTTPclientResponder.php\",\n\t\t array(\"param\" => \"value\"),\n\t\t array(\"HTTPclientTest-headers\" => \"value\"),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'value'\", $page);\n\t\t$this->assertContains(\"POST: param = 'value'\", $page);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/HTTPclientResponder.php\",\n\t\t array(\"\" => \"<xml>\"),\n\t\t array(\"HTTPclientTest-headers\" => \"value\"),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'value'\", $page);\n\t\t$this->assertContains(\"Request body: <xml>\", $page);\n\n\t\t$this->object->setRequest(\n\t\t \"HTTPclientResponder.php\",\n\t\t array(\"param\" => array(\"one\", \"two\")),\n\t\t array(\"HTTPclientTest-headers\" => array(\"one\", \"one\"))\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(200, $lastcode);\n\t\t$this->assertContains(\"Method: PUT\", $page);\n\t\t$this->assertContains(\"User-agent: HTTPclientTest\", $page);\n\t\t$this->assertContains(\"HTTPclientTest-headers = 'one'\", $page);\n\t\t$this->assertRegExp(\"/POST: param =.*('one'|'two')/\", $page);\n\n\t\t$this->object = new HTTPclient(\n\t\t $this->remotepath . \"/nonexistentResponder.php\",\n\t\t array(\"param\" => array(\"one\", \"two\")),\n\t\t array(\"HTTPclientTest-headers\" => array(\"one\", \"two\")),\n\t\t array(\"useragent\" => \"HTTPclientTest\")\n\t\t);\n\t\t$page = $this->object->put();\n\t\t$this->assertInternalType(\"string\", $page);\n\t\t$lastcode = $this->object->lastcode();\n\t\t$this->assertInternalType(\"int\", $lastcode);\n\t\t$this->assertEquals(404, $lastcode);\n\t }", "public function updated(Client $client)\n {\n //\n }", "public function testUpdateOrderItemUsingPUT()\n {\n }", "public function testUpdateOfferUsingPUT()\n {\n }", "public function createUpdateClient(){\r\n\t $client = $_POST['client'];\r\n\t parse_str($client,$data);\r\n\t if ($state = $this->loginToSandBox()){\r\n\t\t\t$ch = $this->session;\r\n\t\t\tif ($data['operation'] == 'create')\r\n\t\t\t$url = SANDBOX_URL.$this->account_id.'/clients?token='.$this->token; \r\n\t\t\telse\r\n\t\t\t$url = SANDBOX_URL.$this->account_id.'/clients/'.$data['id'].'?token='.$this->token;\r\n\t\t\t$params = array(\r\n\t\t\t\t\tCURLOPT_URL => $url, \r\n\t\t\t\t\tCURLOPT_HEADER => 'Content-Type: application/json; Accept: application/json;',\r\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => 1, \r\n\t\t\t\t\tCURLOPT_TIMEOUT\t\t => 20,\r\n\t\t\t);\r\n\t\t\tif ($data['operation'] == 'create')\r\n\t\t\t$params[CURLOPT_POST] = true; //curl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\telse\r\n\t\t\t$params[CURLOPT_CUSTOMREQUEST] = 'PUT';\r\n\t\t\t$params[CURLOPT_POSTFIELDS] = json_encode(array(\"title\" => $data['title'],\r\n\t\t\t\t\t\t\t\t\t\t \"fullTitle\" => $data['fullTitle'],\r\n\t\t\t\t\t\t\t\t\t \"idCity\" => (int)$data['idCity'],\r\n\t\t\t\t\t\t\t\t\t\t \"address\" => $data['address'],\r\n\t\t\t\t\t\t\t\t\t\t \"phone\" => $data['phone'],\r\n\t\t\t\t\t\t\t\t\t\t \"email\"=> $data['email'],\r\n\t\t\t\t\t\t\t\t\t\t \"inn\" => $data['inn'],\r\n\t\t\t\t\t\t\t\t\t\t \"kpp\" => $data['kpp'],\r\n\t\t\t\t\t\t\t\t\t\t \"jurAddress\" => $data['jurAddress'],\r\n\t\t\t\t\t\t\t\t\t\t \"createDate\" => 0,\r\n\t\t\t\t\t\t\t\t\t\t \"modifyDate\" => 0\r\n\t\t\t\t\t\t\t )\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t//$out = curl_exec($ch);\r\n\t\t\theader('Content-Type: application/json');\r\n\t\t\techo json_encode($this->sendCurl($ch, $params));\r\n\t }else\r\n\t echo $state;\r\n\t}", "public static function updateClient($client){\n $mysqlPDO = cnsDao::connect();\n\n $sql = 'update client set CA=:ca,\n EFFECTIF=:effectif,\n RAISON_SOCIALE=:raisonSociale,\n CODE_POSTAL=:codePostal,\n TELEPHONE=:telephone,\n NOM_NATURE=:nature,\n TYPE_SOCIETE=:type,\n ADRESSE_DU_CLIENT=:adresse,\n VILLE=:ville,\n COMMENTAIRE=:commentaire\n where ID_CLIENT =' . $client->getIdClient();\n\n $req =$mysqlPDO->prepare($sql);\n $req->execute(array(':ca'=>$client->getCa(),\n ':effectif'=>$client->getEffectif(),\n ':raisonSociale'=>$client->getRaisonSociale(),\n ':codePostal'=>$client->getCodePostal(),\n ':telephone'=>$client->getTelephone(),\n ':nature'=>$client->getNature(),\n ':type'=>$client->getType(),\n ':adresse'=>$client->getAdresse(),\n ':ville'=>$client->getVille(),\n ':commentaire' => $client->getCommentaire()\n )\n );\n\n $done = $req !== false ? true : false;\n $req->closeCursor();\n cnsDao::disconnect($mysqlPDO);\n\n return $done;\n }", "public function testPut()\n {\n $response = new Response(['HTTP/1.1 200 OK'], 'Response Body !');\n $client = m::mock('Cake\\Network\\Http\\Client');\n $client->shouldReceive('put')->with('http://example.com', [], [])->andReturn($response);\n\n $socket = new CakeHttpClientSocket($client);\n $str = $socket->put('http://example.com');\n\n $this->assertEquals('Response Body !', $str);\n }", "public function put_request_put() {\n\n $this->response('received a put request');\n\n }", "public function testUpdateCompanyUsingPUT()\n {\n }", "public function client_setter_and_getter()\n {\n // Arrange\n $service = new Service;\n $client = new Client;\n\n // Act\n $returned = $service->setClient($client)->getClient();\n\n // Assert\n $this->assertEquals($client, $returned);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds an array of ScheduleEntry objects. Creates an array of ScheduleEntry objects, populates it with the data in the given associative array
private function buildScheduleEntryModels($dbResults) { $scheduleEntries = array(); foreach ($dbResults as $dbResult) { $user = new Application_Model_Impl_User(); $user->setUserId($dbResult['user_id']); $scheduleEntry = new Application_Model_Impl_ScheduleEntry(); $scheduleEntry ->setId($dbResult['week_id']) ->setStartDate($dbResult['start_date']) ->setUser($user); $scheduleEntries[$dbResult['week_id']] = $scheduleEntry; } return $scheduleEntries; }
[ "public static function fromArray(array $data)\n {\n $obj = new Schedule();\n\n foreach ($obj as $key => $value) {\n if (isset($data[$key])) {\n $obj->$key = $data[$key];\n }\n }\n\n return $obj;\n }", "public function construct_event_array() {\r\n\r\n\t\t\t$data = $this->data;\r\n\t\t\tif( !$data[\"start_time\"] ) return false;\r\n\r\n\t\t\t$timezone = isset( $data[\"timezone\"] ) ? $data[\"timezone\"] : $this->cliff_fpe_helpers->get_timezone( $data[\"start_time\"] );\r\n\r\n\t\t\t$event_array = [\r\n\t\t\t\t\"post_title\"\t\t=> $data[\"name\"],\r\n\t\t\t\t\"post_content\"\t\t=> $data[\"description\"],\r\n\t\t\t\t\"post_status\"\t\t=> \"publish\",\r\n\t\t\t\t\"post_type\"\t\t\t=> \"tribe_events\",\r\n\t\t\t\t\"post_meta\"\t\t\t=> [\r\n\t\t\t\t\t\"_EventFacebookID\"\t\t=> $data[\"id\"],\r\n\t\t\t\t\t\"_EventShowMapLink\"\t\t=> 1,\r\n\t\t\t\t\t\"_EventShowMap\"\t\t\t=> 1,\r\n\t\t\t\t\t\"_EventStartDate\"\t\t=> $this->cliff_fpe_helpers->convert_fb_date( $data[\"start_time\"], $timezone ),\t\t\r\n\t\t\t\t\t\"_EventStartDateUTC\"\t=> $this->cliff_fpe_helpers->convert_fb_date_utc( $data[\"start_time\"] ),\r\n\t\t\t\t\t\"_EventDuration\"\t\t=> 0,\r\n\t\t\t\t\t\"_EventURL\"\t\t\t\t=> \"https://facebook.com/\" . $data[\"id\"],\r\n\t\t\t\t\t\"_EventTimezone\"\t\t=> $timezone,\r\n\t\t\t\t\t\"_EventTimezoneAbbr\" => $this->cliff_fpe_helpers->get_timezone_abbreviation( $timezone ),\r\n\t\t\t\t\t\"_EventVenueID\" \t\t=> null, // updateme\r\n\t\t\t\t\t\"_EventOrganizerID\"\t\t=> null, // updateme\r\n\t\t\t\t\t\"_EventUpdatedDate\"\t\t=> $data[\"updated_time\"] // updateme\r\n\t\t\t\t]\r\n\t\t\t];\r\n\r\n\t\t\tif( array_key_exists( \"end_time\", $data ) ) {\r\n\r\n\t\t\t\t$event_array[\"post_meta\"][\"_EventEndDate\"] \t\t= $this->cliff_fpe_helpers->convert_fb_date( $data[\"end_time\"], $timezone );\r\n\t\t\t\t$event_array[\"post_meta\"][\"_EventEndDateUTC\"]\t= $this->cliff_fpe_helpers->convert_fb_date_utc( $data[\"end_time\"] );\r\n\t\t\t\t$event_array[\"post_meta\"][\"_EventDuration\"]\t\t= $this->cliff_fpe_helpers->get_event_duration( $data[\"start_time\"], $data[\"end_time\"] );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif( isset( $data[\"cover\"] ) ) {\r\n\r\n\t\t\t\t$event_array[\"post_meta\"][\"_EventCover\"] \t\t= isset( $data[\"cover\"][\"source\"] ) ? $data[\"cover\"][\"source\"] : $data[\"cover\"]->source;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif( array_key_exists( \"ticket_uri\", $data ) ) {\r\n\r\n\t\t\t\t$event_array[\"post_meta\"][\"_EventTicketUrl\"]\t= $data[\"ticket_uri\"];\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn $event_array;\r\n\r\n\t\t}", "private function createScheduleArray(){\n $doctorNames = $this->getDoctorNames();\n $array = $this->getDatabaseSchedules();\n foreach($array as $row){\n $month = $row['Month'];\n $year = $row['Year'];\n //break out the schedule array from query \n $createdSchedule = array_slice($row,2);\n //remove any null values\n $createdSchedule = array_filter($createdSchedule);\n \n //Color options for doctors\n //@todo create a color for the number of unique doctors\n $colors = array(\"#7d7d7d\",\"#7d9dbd\",\"#7dbdfd\",\"#7dfd9d\",\"#9d7ddd\",\"#9dbd7d\",\"#9dddbd\",\"#9dfdfd\",\"#bd9d9d\",\"#bdbddd\",\"#bdfd7d\",\"#dd7dbd\",\"#dd9dfd\",\"#dddd9d\",\"#ddfddd\",\"#fd9d7d\",\"#fdbdbd\",\"#fdddfd\",\"#555555\",\"#557595\",\"#5595d5\",\"#55d575\",\"#7555b5\",\"#759555\",\"#75b595\",\"#75d5d5\",\"#957575\",\"#9595b5\",\"#95d555\",\"#b55595\",\"#b575d5\",\"#b5b575\",\"#b5d5b5\",\"#d57555\",\"#d59595\",\"#d5b5d5\",\"#2d2d2d\",\"#2d4d6d\",\"#2d6dad\",\"#2dad4d\",\"#4d2d8d\",\"#4d6d2d\",\"#4d8d6d\",\"#4dadad\",\"#6d4d4d\",\"#6d6d8d\",\"#6dad2d\",\"#8d2d6d\",\"#8d4dad\",\"#8d8d4d\",\"#8dad8d\",\"#ad4d2d\",\"#ad6d6d\",\"#ad8dad\");\n \n //index, increments for each day scheduled \n $day = 1;\t\n foreach($createdSchedule as $value){\n //add a leading 0 so numbers < 10 display correctly\n $dayString = str_pad($day,2,\"0\",STR_PAD_LEFT);\n $monthString = str_pad($month,2,\"0\",STR_PAD_LEFT);\n $dayArray = array(\n 'id' => \"$value\",\n 'title' => $doctorNames[$value],\n 'start' => \"$year-$monthString-$dayString\",\n 'backgroundColor' => $colors[$value % count($colors)]\n ); \n //add the day to the schedule\n $schedule[] = $dayArray;\n $day++;\n //clear the array\n unset($tempArray);\t\n }\n }\n\t\treturn $schedule;\n\t}", "public function buildScheduleAttributeArray($data) {\n $schedule_attributes_array = [];\n foreach ($data as $key) {\n $schedule_attributes_array[] = array(\n 'arrival_time' => $this->renderTimeFormat($key['attributes']['arrival_time']),\n 'vehicle_name' => $key['relationships']['trip']['data']['id'],\n 'stop_name' => $key['relationships']['stop']['data']['id'],\n );\n }\n return $schedule_attributes_array;\n }", "public function create(array $data)\n {\n $cleaned = $this->clean($data);\n\n $cleaned['activity_id'] = $data['activity'];\n\n $schedule = Schedule::create($cleaned);\n\n return $schedule;\n }", "private static function get_schedules($entry_rows, $num_schedules)\n {\n // final schedule results\n $schedules = array();\n // BFS search to get schedules\n $queue = array();\n\n if(empty($entry_rows))\n {\n return $schedules;\n }\n\n // push empty schedule and entry_rows into the queue\n array_push($queue, array(new schedule_temp(), $entry_rows));\n\n // get the memory limit\n $memory_limit = trim(ini_get('memory_limit'));\n $last = strtolower($memory_limit[strlen($memory_limit) - 1]);\n switch($last)\n {\n case 'g':\n $memory_limit *= 1024;\n case 'm':\n $memory_limit *= 1024;\n case 'k':\n $memory_limit *= 1024;\n }\n\n while(!empty($queue))\n {\n // make sure we are not near the memory limit\n // if we come within 2MB of the memory limit, return null\n $memory_current = memory_get_usage();\n if($memory_limit - $memory_current < 2097152)\n {\n warn('Schedule builder hit memory limit');\n return null;\n }\n\n // see if we have the number of requested schedules\n if($num_schedules > 0 && count($schedules) >= $num_schedules)\n {\n return $schedules;\n }\n\n // BFS: get element at the front of the queue\n //$current = array_shift($queue);\n // DFS: get element off the end of the queue\n $current = array_pop($queue);\n\n // split it up\n $schedule = $current[0];\n $rows = $current[1];\n if(empty($rows))\n {\n // no more selections to add - add this schedule to the list of\n // schedules and process the next entry\n $schedules[] = $schedule;\n continue;\n }\n\n // get the smallest priority of the selections remaining\n $min_priority = null;\n foreach($rows as $row)\n {\n if($min_priority == null || $row[3] < $min_priority)\n $min_priority = $row[3];\n }\n\n // get the selections with the min priority, removing these rows from\n // $rows\n $current_selections = array();\n foreach($rows as $id => $row)\n {\n if($row[3] == $min_priority)\n {\n $current_selections[] = $row;\n unset($rows[$id]);\n }\n }\n\n // process the current_selections\n foreach($current_selections as $row)\n {\n // try to find the department\n $department = new department();\n $department->load('abbreviation=?', array($row[0]));\n if(!$department->id)\n continue;\n // try to find the course\n $course = new course();\n $course->load('department_id=? and course_number=?', array($department->id, $row[1]));\n if(!$course->id)\n continue;\n if(trim($row[2]) != \"\")\n {\n // try to find the course secection\n $section = new course_section();\n $section->load('course_id=? and section=?', array($course->id, $row[2]));\n if(!$section->id)\n continue;\n if(!$schedule->conflicts($section))\n {\n $new_schedule = clone $schedule;\n $new_schedule->add_course_section($section);\n array_push($queue, array($new_schedule, $rows));\n }\n }\n else\n {\n // get all the course sections\n $section = new course_section();\n $sections = $section->find('course_id=?', array($course->id));\n foreach($sections as $section)\n {\n if(!$schedule->conflicts($section))\n {\n $new_schedule = clone $schedule;\n $new_schedule->add_course_section($section);\n array_push($queue, array($new_schedule, $rows));\n }\n }\n }\n }\n }\n\n return $schedules;\n }", "abstract protected function jsonToArrayOfSchedule();", "static function fetchJobSchedules() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \" SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n ORDER BY job_id\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $schedule = array();\n foreach( $resultset as $record ) {\n if( false === empty( $record->repeat_time_minutes ) ) {\n $schedule[] = new ScheduledJobRepeat(\n $record->job_id, \n $record->classname, \n $record->repeat_time_minutes, \n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n else if( false === empty( $record->repeat_daily_at ) ) {\n $schedule[] = new ScheduledJobDaily(\n $record->job_id, \n $record->classname, \n $record->repeat_daily_at,\n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n }\n return $schedule;\n }", "function auditSchedule($row) {\n if (!empty($row)) {\n $auditSchedule = new AuditSchedule();\n foreach ($row as $key => $value) {\n $auditSchedule->$key = $value;\n }\n return $auditSchedule;\n }\n }", "function _get_cron_array() {}", "private function createEntryFromResult(array $result)\n {\n // check if the first element in the given array is an array\n // => if so, we have to return an array of instances\n // => if not, we can create a single instace from the array\n if (count($result) === 1) {\n // we have to construct only one array\n return $this->createSingleInstance($result[0]);\n } else {\n // create empty array to later store created instances\n $entires = [];\n // Iteate over all given entry data\n foreach ($result as $entryData) {\n // create a new entry instance and push to array\n array_push($entires, $this->createSingleInstance($entryData));\n }\n\n return $entires;\n }\n }", "function _get_cron_array()\n {\n }", "function CreateBlankEpisodeEntries() {\n $saturday = '2020-08-01T19:00:00-06:00';\n $sunday = '2020-08-02T19:00:00-06:00';\n \n $dates = array();\n $dates_string = '';\n $shows = array('shows' => array(\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n ),\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n ),\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n ),\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n ),\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n ),\n array(\n \"title\" => \"\",\n \"broadcastDate\" => \"\",\n \"sourceFile\" => \"\"\n )\n ));\n \n for ($i = 0; $i < 52; $i++) {\n $new_sat = date('c', strtotime($saturday . ' +' . $i . ' week'));\n $new_sun = date('c', strtotime($sunday . ' +' . $i . ' week'));\n $dates[$new_sat] = $shows;\n $dates[$new_sun] = $shows;\n $dates_string .= $new_sat . '<br>';\n $dates_string .= $new_sun . '<br>';\n }\n \n echo $dates_string;\n \n echo '<pre>';\n echo json_encode($dates, JSON_PRETTY_PRINT);\n echo '</pre>';\n}", "public function jsonToArrayOfSchedule(){\n\t\t$timetables = array();\n\t\t$today = Carbon::today();\n\t\t$tomorrow = Carbon::tomorrow();\n\t\t$dates = array($today,$tomorrow);\n\n\t\tforeach ($dates as $d){\n\t\t\t$this->outputName = $d->__get('day').\"_\".$d->__get('month').\"_\".$d->__get('year').'.json';\n\t\t\ttry\n\t\t\t{\n\t\t\t $contents = File::get($this->savePath.$this->outputName);\n\t\t\t $arrayClass = json_decode($contents);\n\t\t\t $counter = 0;\n\t\t\t $dateString = $d->toDateString();\n\n\t\t\t foreach ($arrayClass as $element) {\n\t\t\t \t//$object = $this->arrayElementToObject($element);\n\t\t\t \t$timetables[$dateString][] = $element; //$object;\n\t\t\t }\n\n\t\t\t \n\t\t\t //var_dump($timetables[$dateString]);\n\t\t\t}\n\t\t\tcatch (Illuminate\\Filesystem\\FileNotFoundException $exception)\n\t\t\t{\n\t\t\t\t$this->getOne($this->idExternal);\n\t\t\t //die(\"The file \".$this->outputName.\" doesn't exist\");\n\t\t\t}\n\t\t}\n\t\tusort($timetables[$dateString], array($this, 'compareWeekday'));\n\t\tusort($timetables[$dateString], array($this, 'compareStart'));\n\t\t$timetables['__dates'] = $dates;\n\t\treturn $timetables;\n\t}", "public function timeEntries(): array {\n $timeEntries = $this->get('/time-entries');\n $result = [];\n\n if (!empty($timeEntries)) {\n foreach ($timeEntries['time_entries'] as $timeEntry) {\n try {\n $timeEntry['timeFrom'] = new DateTime($timeEntry['time_from']);\n $timeEntry['timeTo'] = new DateTime($timeEntry['time_to']);\n $timeEntry['projectId'] = $timeEntry['project']['id'];\n $timeEntry['taskId'] = $timeEntry['task']['id'];\n } catch (Exception $e) {\n }\n $result[] = new TimeEntry($timeEntry);\n }\n }\n\n return $result;\n }", "protected function buildCalendarDataStructure() {\n\n $today_datetime = new \\DateTime();\n $today_datetime->setTime(0, 0, 0);\n\n $one_day_interval = new \\DateInterval('P1D');\n\n //Get the first date of a given month\n $datetime = DateTimeHelper::getFirstDayOfMonth($this->month, $this->year);\n\n $scaffold_data = array(\n 'calendar_id' => $this->generateCalendarID(),\n 'month' => $this->month,\n 'year' => $this->year,\n 'label' => DateTimeHelper::getMonthLabelByNumber($this->month) . ' ' . $this->year,\n 'first_date_weekday' => $datetime->format('N'),\n 'days' => array()\n );\n\n //Calculate the days in a month\n $days_in_month = DateTimeHelper::getDayCountInMonth($this->month, $this->year);\n\n //Build all dates in a month\n $i = 1;\n while($i <= $days_in_month) {\n\n $scaffold_data['days'][] = array(\n 'date' => $datetime->format('Y-m-d'),\n 'day' => $datetime->format('j'),\n 'weekday' => $datetime->format('N'),\n 'nodes' => array(),\n 'is_today' => ($today_datetime == $datetime) ? TRUE : FALSE,\n );\n\n $i++;\n $datetime->add($one_day_interval);\n }\n\n return $scaffold_data;\n\n }", "public function _load_schedule() {\n\t\t$this->data['schedule'] = array();\n\n\t\t$sql = \"SELECT ssrmeet_begin_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_bldg_code building_code,\n\t\t\t\t\t\t\t\t\t stvbldg_desc building,\n\t\t\t\t\t\t\t\t\t ssrmeet_room_code room_number,\n\t\t\t\t\t\t\t\t\t ssrmeet_start_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_catagory ssrmeet_category,\n\t\t\t\t\t\t\t\t\t ssrmeet_sun_day sunday,\n\t\t\t\t\t\t\t\t\t ssrmeet_mon_day monday,\n\t\t\t\t\t\t\t\t\t ssrmeet_tue_day tuesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_wed_day wednesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_thu_day thursday,\n\t\t\t\t\t\t\t\t\t ssrmeet_fri_day friday,\n\t\t\t\t\t\t\t\t\t ssrmeet_sat_day saturday,\n\t\t\t\t\t\t\t\t\t ssrmeet_schd_code schedule_type_code,\n\t\t\t\t\t\t\t\t\t stvschd_desc schedule_type,\n\t\t\t\t\t\t\t\t\t ssrmeet_credit_hr_sess session_credit_hours,\n\t\t\t\t\t\t\t\t\t ssrmeet_meet_no num_meeting_times,\n\t\t\t\t\t\t\t\t\t ssrmeet_hrs_week hours_per_week\n\t\t\t\t\t\t\tFROM ssrmeet,\n stvbldg,\n stvschd\n\t\t\t\t\t WHERE ssrmeet_crn = :crn \n\t\t\t\t\t\t\t AND ssrmeet_term_code = :term_code\n AND stvbldg_code = ssrmeet_bldg_code\n\t\t\t\t\t\t\t AND stvschd_code = ssrmeet_schd_code\n ORDER BY ssrmeet_start_date, ssrmeet_end_date, ssrmeet_begin_time\";\t\t\n\n\t\t$args = array(\n\t\t\t'crn' => $this->crn,\n\t\t\t'term_code' => $this->term_code\n\t\t);\n\n\t\tif($results = \\PSU::db('banner')->Execute($sql, $args)) {\n\t\t\tforeach($results as $row) {\n\t\t\t\t$row = \\PSU::cleanKeys('ssrmeet_', '', $row);\n\t\t\t\t$row['begin_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['begin_time']);\n\t\t\t\t$row['end_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['end_time']);\n\t\t\t\t$row['start_date'] = strtotime($row['start_date']);\n\t\t\t\t$row['end_date'] = strtotime($row['end_date']);\n\t\t\t\t$row['days'] = $row['sunday'].$row['monday'].$row['tuesday'].$row['wednesday'].$row['thursday'].$row['friday'].$row['saturday'];\n\t\t\t\t$this->data['schedule'][] = $row;\n\t\t\t}//end foreach\n\t\t}//end if\n\t\t$this->meeting_times = $this->meeting_locations = $this->schedule;\n\t}", "function buildAnnouncementArray($results) {\n $announcementList = array();\n \n foreach($results as $result) {\n $announcement = createAnnouncement($result);\n $announcementList[] = $announcement;\n }\n \n return $announcementList;\n}", "function initialize_events() {\n global $daily_events, $calendardata, $month, $day, $year;\n\n for ($i=7;$i<23;$i++){\n if ($i<10){\n $evntime = '0' . $i . '00';\n } else {\n $evntime = $i . '00';\n }\n $daily_events[$evntime] = 'empty';\n }\n\n $cdate = $month . $day . $year;\n\n if (isset($calendardata[$cdate])){\n\t\tforeach($calendardata[$cdate] as $calfoo) {\n $daily_events[\"$calfoo[key]\"] = $calendardata[$cdate][$calfoo['key']];\n }\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Default PDF list template Copyright Usability Dynamics, Inc. <
static public function default_pdf_list_template($property, $list_data) { $descr = '&nbsp;'; $title = '&nbsp;'; $info = '&nbsp;'; $image_width = '90'; $image_height = '90'; //** Prepare and Render view of Property Stats */ $wpp_property_stats = class_wpp_pdf_flyer::get_pdf_list_attributes('property_stats'); $exclude_property_stats = array(); foreach ((array)$wpp_property_stats as $key => $value) { if(!array_key_exists($key, $list_data['attributes'])) { $exclude_property_stats[] = $key; } else { unset($list_data['attributes'][$key]); } } $property_stats = @draw_stats( 'exclude=' . implode(',', $exclude_property_stats) . '&display=array', $property ); foreach ((array)$property_stats as $label => $value) { $info .= '<br/>'. $label .': '. $value; } //** Prepare and Render view of Taxonomies */ $wpp_taxonomies = class_wpp_pdf_flyer::get_pdf_list_attributes('taxonomies'); if(is_array($wpp_taxonomies)) { foreach ($wpp_taxonomies as $key => $value) { if(array_key_exists($key, $list_data['attributes'])) { if(get_features("type=$key&format=count" , $property)) { $features = get_features("type=$key&format=array&links=false", $property); $info .= '<br/>'. $value .': '. implode($features, ", "); } unset($list_data['attributes'][$key]); } } } //** Prepare other property attributes (image, title, description, tagline, etc) */ foreach ( (array)$list_data['attributes'] as $attr_id => $attr_value) { if ( $attr_id == 'post_thumbnail' && !empty( $property['images']['thumbnail'] ) && WPP_F::can_get_image($property['images']['thumbnail'])) { $image = '<table cellspacing="0" cellpadding="5" border="0" style="background-color:' . $list_data['background'] . '"><tr><td>'; $image .= '<img width="'. $image_width .'" height="'. $image_height .'" src="'. $property['images']['thumbnail'] .'" alt="" />'; $image .= '</td></tr></table>'; } elseif( $attr_id == 'post_content' && !empty( $property['post_content'] ) ) { //** Post Content */ $descr = strip_shortcodes( $property['post_content'] ); $descr = apply_filters('the_content', $descr); $descr = str_replace(']]>', ']]&gt;', $descr); $descr = strip_tags($descr); $excerpt_length = 65; $words = preg_split("/[\n\r\t ]+/", $descr, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY); if ( count($words) > $excerpt_length ) { array_pop($words); $descr = implode(' ', $words); $descr = $descr . '...'; } else { $descr = implode(' ', $words); } } elseif( $attr_id == 'post_title' && !empty( $property['post_title'] ) ) { //** Title */ $title = $property['post_title']; } elseif( $attr_id == 'tagline' && !empty( $property['tagline'] ) ) { //** Tagline */ $tagline = '<span><b>' . $property['tagline'] . '</b></span><br/>'; }else { //** Attributes (Property Meta) */ $info .= !empty($property[$attr_id]) ? '<br>'. $attr_value .': '. $property[ $attr_id ] : ''; } } echo '<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr>'; if (!empty($image)) { echo '<td colspan="7" style="font-size:8px;height:8px;line-height:8px;">$nbsp;</td>'; echo '</tr><tr>'; echo '<td width="2%">$nbsp;</td>'; echo '<td width="12%" align="left" valign="middle">' . $image . '</td>'; echo '<td width="2%">$nbsp;</td>'; echo '<td width="25%"><b>'. $title .'</b>'.$info . '</td>'; echo '<td width="2%">$nbsp;</td>'; echo '<td width="54%">'. $tagline . $descr .'</td>'; echo '<td width="2%">$nbsp;</td>'; echo '</tr><tr>'; echo '<td colspan="7" style="font-size:8px;height:8px;line-height:8px;">$nbsp;</td>'; } else { echo '<td colspan="5" style="font-size:8px;height:8px;line-height:8px;">$nbsp;</td>'; echo '</tr><tr>'; echo '<td width="2%">$nbsp;</td>'; echo '<td width="39%"><b>'. $title .'</b>'.$info . '</td>'; echo '<td width="2%">$nbsp;</td>'; echo '<td width="54%">'. $tagline . $descr .'</td>'; echo '<td width="2%">$nbsp;</td>'; echo '</tr><tr>'; echo '<td colspan="5" style="font-size:8px;height:8px;line-height:8px;">$nbsp;</td>'; } echo '</tr></table>'; }
[ "public function get_document_title_template() {}", "public function get_document_title_template()\n {\n }", "private function renderTemplate( ) {\n\t\t$PDFDate = new DateTime($this->PDFDate);\t\n\t\t$quotenumber = $PDFDate->format('ymdHis') . $this->PDFNumber;\n\t\t$TemplatePageName = $this->TemplatePageName;\n\t\t$TemplateTitle = $this->TemplateTitle;\n\t\t$PDFNumber = $quotenumber;\n\t\t$PDFContent = $this->PDFContent;\n\n\t\t$image = 'quotebackground';\n\n\t\t$html = '<html>\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t\t<title>'.$TemplatePageName.'</title>\n\n\t\t<style type=\"text/css\">\n\t\t\tbody { color: #555555; font-family: \"Lucida Grande\",\"Lucida Sans Unicode\",Verdana,sans-serif; margin: 0; padding: 0;sans-serif; background-color: #ffffff; background-repeat: repeat-x; }\n\t\t\ttable { font-size: 12px; }\n\t\t\th1 { color: #000033; font-size: 30px; }\n\t\t\th2 { margin: 0 0 0 0; color: #000000; font-size: 20px; font-weight: normal; }\n\t\t\th3, h4, h5 { margin: 0 0 7px 0; }\n\t\t\th3 { color: #E31818; font-size: 18px; }\n\t\t\th4 { font-size: 14px; }\n\t\t\th5 { font-size: 12px; margin: 0 0 10px 0; color: #006699; }\n\t\t\tp { font-size:12px; margin: 0 0 12px 0; line-height: 15px; }\n\t\t\thr { height: 1px; line-height: 1px; border: none; border-top: 1px solid #dde2e6; margin: 5px 20px; }\n\t\t\tul, li { margin: 0 0 0 0; padding: 0 0 0 0; }\n\t\t\tli { line-height: 15px; }\n\t\t\t.bulletLarge { padding: 0 0 0 3px; }\n\t\t\t.bulletLarge li { list-style-type: none; background-image: url(\\'images/pdf/bulletLarge.png\\'); background-repeat: no-repeat; background-position: left 5px; padding: 0 0 4px 15px; }\n\t\t\t.bulletLarge li a { color: #3c3c3c; }\n\t\t\t#headerwrapper { background-repeat: repeat-x; background-position: left top; height: 112px; }\n\t\t\t#header { margin: 0 auto; width: 100%; padding: 0 30px 10px 30px; height: 125px;}\n\t\t\t#main{ background-color: #FFF;border: 1px solid #DDE2E6; margin: 20px auto; width: 750px;}\n\t\t\t#info { height: 30px; padding: 20px;}\n\t\t\t#pdfinfo{ padding: 20px; }\n\t\t\t#pdfnumber { float: left; color: #000000; font-size: 20px;}\n\t\t\t#pdfdate { width: 200px; text-align: right;}\n\t\t\t#clientinfo { font-size: 12px; padding: 20px 30px 20px 20px; }\n\t\t\t#content { padding: 20px; }\n\t\t</style>\n\t</head>\n\n\t<body>\n\t\t<div id=\"headerwrapper\">\n\t\t\t<div id=\"header\">\n\t\t\t\t<a href=\"http://www.ebannuities.co.za\"><img src=\"images/pdf/headerlogoright.jpg\" alt=\"Momentum Employee Benefits\" border=\"0\"></a>\n\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"main\">\n\t\t\t<div id=\"pdfinfo\">\n\t\t\t\t<div style=\"float: right; text-align: right;\">\n\t\t\t\t\t<font id=\"date\" >'.$PDFDate->format('d F Y').'</font>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"pdfnumber\" style=\"float: right;\">Gross Annuity Quote '.(!empty($PDFNumber)?'No. '.$PDFNumber:'').'</div>\n\t\t\t</div>';\n\t\t\t\t\t\n\t\t\t$html .='<div id=\"content\">\n\t\t\t'.$PDFContent.'\n\t\t\t<div class=\"clearer\"></div>\n\t\t\t</div>\n\n\t\t\t<div id=\"footer\"></div>\n\t</body>';\n\n\t\t$this->HTML = $html;\n\t\t\n\t}", "function send_as_pdf()\n {\n global $objInit, $_ARRAYLANG;\n\n if (!$this->load()) {\n return \\Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_LOADING']);\n }\n $objPdf = new \\Cezpdf('A4');\n $objPdf->setEncryption('', '', array('print'));\n $objPdf->selectFont(\\Cx\\Core\\Core\\Controller\\Cx::instanciate()->getCodeBaseLibraryPath() . '/ezpdf/fonts/' . $this->font);\n $objPdf->ezSetMargins(0, 0, 0, 0); // Reset margins\n $objPdf->setLineStyle(0.5);\n $marginTop = 30;\n $biggerCountTop = $biggerCountBottom = 0;\n $arrHeaderLeft = $arrHeaderRight = $arrFooterLeft = $arrFooterRight =\n array();\n if ($this->header) { // header should be shown\n $arrHeaderLeft = explode(\"\\n\", $this->header_left);\n $arrHeaderRight = explode(\"\\n\", $this->header_right);\n $countLeft = count($arrHeaderLeft);\n $countRight = count($arrHeaderRight);\n $biggerCountTop = ($countLeft > $countRight\n ? $countLeft : $countRight);\n $marginTop = ($biggerCountTop * 14)+36;\n }\n // Bottom margin\n $marginBottom = 20;\n $arrFooterRight = array();\n if ($this->footer) { // footer should be shown\n // Old, obsolete:\n $this->footer_left = str_replace('<--DATE-->',\n date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);\n $this->footer_right = str_replace('<--DATE-->',\n date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);\n // New:\n $this->footer_left = str_replace('[DATE]',\n date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);\n $this->footer_right = str_replace('[DATE]',\n date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);\n $arrFooterLeft = explode(\"\\n\", $this->footer_left);\n $arrFooterRight = explode(\"\\n\", $this->footer_right);\n $countLeft = count($arrFooterLeft);\n $countRight = count($arrFooterRight);\n $biggerCountBottom = ($countLeft > $countRight\n ? $countLeft : $countRight);\n $marginBottom = ($biggerCountBottom * 20)+20;\n }\n // Borders\n if ($this->border) {\n $linesForAllPages = $objPdf->openObject();\n $objPdf->saveState();\n $objPdf->setStrokeColor(0, 0, 0, 1);\n $objPdf->rectangle(10, 10, 575.28, 821.89);\n $objPdf->restoreState();\n $objPdf->closeObject();\n $objPdf->addObject($linesForAllPages, 'all');\n }\n // Header\n $headerArray = array();\n $startpointY = 0;\n if ($this->header) {\n $objPdf->ezSetY(830);\n $headerForAllPages = $objPdf->openObject();\n $objPdf->saveState();\n for ($i = 0; $i < $biggerCountTop; ++$i) {\n $headerArray[$i] = array(\n 'left' => (isset($arrHeaderLeft[$i]) ? $arrHeaderLeft[$i] : ''),\n 'right' => (isset($arrHeaderRight[$i]) ? $arrHeaderRight[$i] : ''),\n );\n }\n $tempY = $objPdf->ezTable($headerArray, '', '', array(\n 'showHeadings' => 0,\n 'fontSize' => $this->font_size_header,\n 'shaded' => 0,\n 'width' => 540,\n 'showLines' => 0,\n 'xPos' => 'center',\n 'xOrientation' => 'center',\n 'cols' => array('right' => array('justification' => 'right')),\n ));\n $tempY -= 5;\n if ($this->border) {\n $objPdf->setStrokeColor(0, 0, 0);\n $objPdf->line(10, $tempY, 585.28, $tempY);\n }\n $startpointY = $tempY - 5;\n $objPdf->restoreState();\n $objPdf->closeObject();\n $objPdf->addObject($headerForAllPages, 'all');\n }\n // Footer\n $pageNumbersX = $pageNumbersY = $pageNumbersFont = 0;\n if ($this->footer) {\n $footerForAllPages = $objPdf->openObject();\n $objPdf->saveState();\n $tempY = $marginBottom - 5;\n if ($this->border) {\n $objPdf->setStrokeColor(0, 0, 0);\n $objPdf->line(10, $tempY, 585.28, $tempY);\n }\n // length of the longest word\n $longestWord = 0;\n foreach ($arrFooterRight as $line) {\n if ($longestWord < strlen($line)) {\n $longestWord = strlen($line);\n }\n }\n for ($i = $biggerCountBottom-1; $i >= 0; --$i) {\n if (empty($arrFooterLeft[$i])) $arrFooterLeft[$i] = '';\n if (empty($arrFooterRight[$i])) $arrFooterRight[$i] = '';\n if ( $arrFooterLeft[$i] == '<--PAGENUMBER-->' // Old, obsolete\n || $arrFooterLeft[$i] == '[PAGENUMBER]') {\n $pageNumbersX = 65;\n $pageNumbersY = $tempY-18-($i*$this->font_size_footer);\n $pageNumbersFont = $this->font_size_list;\n } else {\n $objPdf->addText(\n 25, $tempY-18-($i*$this->font_size_footer),\n $this->font_size_footer, $arrFooterLeft[$i]);\n }\n if ( $arrFooterRight[$i] == '<--PAGENUMBER-->' // Old, obsolete\n || $arrFooterRight[$i] == '[PAGENUMBER]') {\n $pageNumbersX = 595.28-25;\n $pageNumbersY = $tempY-18-($i*$this->font_size_footer);\n $pageNumbersFont = $this->font_size_list;\n } else {\n // Properly align right\n $width = $objPdf->getTextWidth($this->font_size_footer, $arrFooterRight[$i]);\n $objPdf->addText(\n 595.28-$width-25, $tempY-18-($i*$this->font_size_footer),\n $this->font_size_footer, $arrFooterRight[$i]);\n }\n }\n $objPdf->restoreState();\n $objPdf->closeObject();\n $objPdf->addObject($footerForAllPages, 'all');\n }\n // Page numbers\n if (isset($pageNumbersX)) {\n $objPdf->ezStartPageNumbers(\n $pageNumbersX, $pageNumbersY, $pageNumbersFont, '',\n $_ARRAYLANG['TXT_SHOP_PRICELIST_FORMAT_PAGENUMBER'], 1);\n }\n // Margins\n $objPdf->ezSetMargins($marginTop, $marginBottom, 30, 30);\n // Product table\n if (isset($startpointY)) {\n $objPdf->ezSetY($startpointY);\n }\n $objInit->backendLangId = $this->lang_id;\n $_ARRAYLANG = $objInit->loadLanguageData('Shop');\n Currency::setActiveCurrencyId($this->currency_id);\n $currency_symbol = Currency::getActiveCurrencySymbol();\n $category_ids = $this->category_ids();\n if ($category_ids == '*') $category_ids = null;\n $count = 1000; // Be sensible!\n // Pattern is \"%\" because all-empty parameters will result in an\n // empty array!\n $arrProduct = Products::getByShopParams($count, 0, null,\n $category_ids, null, '%', null, null,\n '`category_id` ASC, `name` ASC');\n $arrCategoryName = ShopCategories::getNameArray();\n $arrOutput = array();\n foreach ($arrProduct as $product_id => $objProduct) {\n $category_id = $objProduct->category_id();\n $category_name = self::decode($arrCategoryName[$category_id]);\n//$objProduct = new Product();\n $arrOutput[$product_id] = array(\n 'product_name' => self::decode($objProduct->name()),\n 'category_name' => $category_name,\n 'product_code' => self::decode($objProduct->code()),\n 'product_id' => self::decode($objProduct->id()),\n 'price' =>\n ($objProduct->discount_active()\n ? Currency::formatPrice($objProduct->price())\n : \"S \".Currency::formatPrice($objProduct->discountprice())).\n ' '.$currency_symbol,\n );\n }\n $objPdf->ezTable($arrOutput, array(\n 'product_name' => '<b>'.self::decode($_ARRAYLANG['TXT_SHOP_PRODUCT_NAME']).'</b>',\n 'category_name' => '<b>'.self::decode($_ARRAYLANG['TXT_SHOP_CATEGORY_NAME']).'</b>',\n 'product_code' => '<b>'.self::decode($_ARRAYLANG['TXT_SHOP_PRODUCT_CODE']).'</b>',\n 'product_id' => '<b>'.self::decode($_ARRAYLANG['TXT_ID']).'</b>',\n 'price' => '<b>'.self::decode($_ARRAYLANG['TXT_SHOP_PRICE']).'</b>'), '',\n array(\n 'showHeadings' => 1,\n 'fontSize' => $this->font_size_list,\n 'width' => 530,\n 'innerLineThickness' => 0.5,\n 'outerLineThickness' => 0.5,\n 'shaded' => 2,\n 'shadeCol' => array(\n hexdec(substr($this->row_color_1, 0, 2))/255,\n hexdec(substr($this->row_color_1, 2, 2))/255,\n hexdec(substr($this->row_color_1, 4, 2))/255,\n ),\n 'shadeCol2' => array(\n hexdec(substr($this->row_color_2, 0, 2))/255,\n hexdec(substr($this->row_color_2, 2, 2))/255,\n hexdec(substr($this->row_color_2, 4, 2))/255,\n ),\n // Note: 530 points in total\n 'cols' => array(\n 'product_name' => array('width' => 255),\n 'category_name' => array('width' => 130),\n 'product_code' => array('width' => 50),\n 'product_id' => array('width' => 40, 'justification' => 'right'),\n 'price' => array('width' => 55, 'justification' => 'right')\n ),\n )\n );\n $objPdf->ezStream();\n // Never reached\n return true;\n }", "private function listTemplate() {\n $tmp = \"{#\\n\";\n $tmp .= \" Module: \" . $this->sinPrefijo . \"\\n\";\n $tmp .= \" Document : modules\\\\\" . $this->sinPrefijo . \"\\\\list.html.twig\\n\\n\";\n $tmp .= \" copyright: ALBATRONIC\\n\";\n $tmp .= \" date \" . date('d.m.Y H:i:s') . \"\\n\";\n $tmp .= \"#}\\n\\n\";\n\n $tmp .= \"{% extends values.controller ~ '/index.html.twig' %}\\n\\n\";\n $tmp .= \"{% block listado %}\\n\\n\";\n $tmp .= \"<div class='listado'>\\n\";\n $tmp .= \"\\t{% include '_global/listGenerico.html.twig' with {'listado': values.listado, 'controller': values.controller} %}\\n\";\n $tmp .= \"\\t{% include '_global/paginacion.html.twig' with {'filter': values.listado.filter, 'controller': values.controller, 'position': 'izq'}%}\\n\";\n //$tmp .= \"\\t{% include '_global/paginacion.html.twig' with {'filter': values.listado.filter, 'controller': values.controller, 'position': 'der'}%}\\n\";\n $tmp .= \"</div>\\n\";\n $tmp .= \"{% endblock %}\";\n\n $this->templates['list'] = $tmp;\n }", "function origin_theme_copyright_default()\n {\n return 'Copyright %1$d %2$s.';\n }", "static public function regenerate_pdf_lists() {\n global $wp_properties;\n\n $lists = $wp_properties['configuration']['feature_settings']['wpp_pdf_flyer']['pdf_lists'];\n\n if(!is_array($lists))\n return;\n\n foreach($lists as $slug => $list) {\n class_wpp_pdf_flyer::render_pdf_list($slug, \"force_generate=true&display=false\");\n }\n\n }", "public function generateDepartmentPdf($list, $output = \"\")\n {\n $dateOfBirth = date_create_from_format(\"d/m/Y\", $list[\"dateOfBirth\"]);\n $now = new DateTime();\n $age = $now->diff($dateOfBirth);\n\n\n $font = 'dejavusans';\n $style_filled = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(114, 115, 117));\n $first_border_width = 0.5;\n $first_border_style = array('width' => $first_border_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));\n $second_border_width = 0.4;\n $second_border_style = array('width' => $second_border_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(73, 22, 29));\n $left_cell_width = 50;\n $right_cell_width = 75;\n\n $facultyName = '';\n $facultyAddress = '';\n if ($this->faculty) {\n $facultyName = $this->faculty->getFacultyName();\n $facultyAddress = $this->faculty->getFacultyAddress();\n }\n $pdf = new IfmsaRemotePdf(\n 'Department',\n $facultyName,\n $facultyAddress,\n './',\n $this->myAuthorizator\n );\n\n $pdf->SetTitle('Department Info');\n $pdf->SetSubject('Department Info');\n $pdf->AddPage();\n\n\n $img_top_pos = 41.2;\n $img_left_pos = 145;\n $imgwidth = 50;\n $imgheight = 0;\n if ($list['jpgPath']) {\n try {\n $response = $this->guzzleClient->head($list[\"jpgPath\"]);\n $mime_img = $response->getHeader('Content-Type');\n $imgsize = $response->getHeader('Content-Length');\n $imginfo = $this->getimgsize($list[\"jpgPath\"]);\n if (($mime_img[0] == \"image/gif\" || $mime_img[0] == \"image/jpeg\" || $mime_img[0] == \"image/png\") &&\n $imgsize[0] < 4000000 && $imginfo[0] > 0 && $imginfo[1] > 0) {\n $pdf->Image($list[\"jpgPath\"], $img_left_pos, $img_top_pos, $imgwidth, 0, \"\", $list[\"jpgPath\"], '', true);\n $imgheight = ($imgwidth / $imginfo[0]) * $imginfo[1];\n }\n } catch (Exception $e) {\n }\n }\n $pdf->setPageMark();\n\n\n $pdf->setCellMargins(0, 5, 0, 3);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Personal Information', 0, '');\n $pdf->SetFont($font);\n\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n\n $pdf->setCellMargins(0, 1, 0, 1);\n $pdf->Cell($left_cell_width, 0, \"Name\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"name\"] . \" \" . $list[\"surname\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Date of Birth\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"dateOfBirth\"] . \" (\" . $age->y . \" years)\", 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Nationality\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"nationality\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Languages\");\n $pdf->MultiCell($right_cell_width, 0, str_replace(';', \"\\n\", $list[\"languages\"]), 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Cell Phone\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"cellular\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Email\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"email\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Alternative Email\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"altEmail\"], 1, \"\", true);\n\n\n $pdf->setCellMargins(0, 5, 0, 3);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Education', 0, '');\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(0, 1, 0, 1);\n $pdf->Cell($left_cell_width, 0, \"Medical School\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"medSchool\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Medical student since\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"medStudentSince\"], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 5);\n $pdf->Cell($left_cell_width, 0, \"Clinical Student since\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"clinStudentSince\"], 1, \"\", true);\n\n\n /* Draw first border */\n $first_border_y = $pdf->GetY();\n if ($first_border_y < $imgheight + $img_top_pos) {\n $first_border_y = $imgheight + $img_top_pos + 5;\n }\n $pdf->SetY($first_border_y);\n\n $pdf->SetLineStyle($first_border_style);\n $pdf->Line(PDF_MARGIN_LEFT - 5 + ($first_border_width / 2), PDF_MARGIN_TOP + 1, PDF_MARGIN_LEFT - 5 + ($first_border_width / 2), $first_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, PDF_MARGIN_TOP + 1, 210 - PDF_MARGIN_RIGHT + 5, PDF_MARGIN_TOP + 1);\n $pdf->Line(210 - PDF_MARGIN_RIGHT + 5 - ($first_border_width / 2), PDF_MARGIN_TOP + 1, 210 - PDF_MARGIN_RIGHT + 5 - ($first_border_width / 2), $first_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $first_border_y, 210 - PDF_MARGIN_RIGHT + 5, $first_border_y);\n\n $pdf->Rect(\n 10,\n $first_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n /* End of first border */\n\n\n\n /* DEPARTMENT CHOSEN PARAGRAPH */\n $left_cell_width = 60;\n $right_cell_width = 80;\n\n $pdf->Rect(\n 10,\n $first_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n\n if ($this->myAuthorizator->isScope()) {\n $pdf->SetFont($font, 'B');\n $pdf->Cell($left_cell_width, 0, 'DEPARTMENT');\n $pdf->SetFont($font);\n\n $dep_splitted = explode(\";\", $list[\"departmentChosen\"]);\n if (count($dep_splitted) == 4) {\n $dep_splitted[1] = substr($dep_splitted[1], 17);\n if ($dep_splitted[1] == false) {\n $dep_splitted[1] = \"\";\n }\n $dep_splitted[2] = substr($dep_splitted[2], 15);\n if ($dep_splitted[2] == false) {\n $dep_splitted[2] = \"\";\n }\n } elseif (count($dep_splitted) < 4) {\n $dep_splitted = array($list[\"departmentChosen\"], \"\", \"\");\n }\n\n $pdf->setCellMargins(0, 6.9, 0, 4);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[0], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->Cell($left_cell_width, 0, \"Field Studied\");\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[1], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Exam Passed\");\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[2], 1, \"\", true);\n } else {\n $pdf->SetFont($font, 'B');\n $pdf->Cell($left_cell_width, 0, 'PROJECT', 0, 1);\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(1, 1, 0, 1);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n $pdf->MultiCell(210 - PDF_MARGIN_LEFT - PDF_MARGIN_RIGHT, 0, $list[\"departmentChosen\"], 1, \"\", true);\n }\n\n $first_border_y = $pdf->GetY();\n\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'EXCHANGE DATES', 0, '');\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(0, 1, 0, 1);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n\n $pdf->Cell($left_cell_width, 0, \"Exchange Start Date\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"exchStartDate\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Exchange End Date\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"exchEndDate\"], 1, \"\", true);\n\n $duration = date_diff(date_create_from_format(\"d/m/Y\", $list[\"exchStartDate\"]), date_create_from_format(\"d/m/Y\", $list[\"exchEndDate\"]));\n $pdf->setCellMargins(0, 1, 0, 5);\n $pdf->Cell($left_cell_width, 0, \"Duration\");\n $pdf->MultiCell($right_cell_width, 0, $duration->days . \" days\", 1, \"\", true);\n\n\n /* Draw second border */\n $second_border_y = $pdf->GetY();\n $pdf->SetLineStyle($second_border_style);\n $pdf->Line(PDF_MARGIN_LEFT - 5 + ($second_border_width / 2), $first_border_y + 5, PDF_MARGIN_LEFT - 5 + ($second_border_width / 2), $second_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $first_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5, $first_border_y + 5);\n $pdf->Line(210 - PDF_MARGIN_RIGHT + 5 - ($second_border_width / 2), $first_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5 - ($second_border_width / 2), $second_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $second_border_y, 210 - PDF_MARGIN_RIGHT + 5, $second_border_y);\n /* End of second border */\n\n\n /* DOCUMENTS */\n $right_cell_width = 170;\n\n $dep_list[] = $list[\"department1\"];\n $dep_list[] = $list[\"department2\"];\n $dep_list[] = $list[\"department3\"];\n $dep_list[] = $list[\"department4\"];\n\n $let_list[] = $list[\"motivationLetter1\"];\n $let_list[] = $list[\"motivationLetter2\"];\n $let_list[] = $list[\"motivationLetter3\"];\n $let_list[] = $list[\"motivationLetter4\"];\n\n $key = array_search($list[\"departmentChosen\"], $dep_list);\n if ($key !== false && $let_list[$key] != \"\") {\n $mot_letter = $let_list[$key];\n\n $pdf->setCellMargins(0, 4, 0, 1);\n $pdf->SetLineStyle($style_filled);\n $pdf->MultiCell($left_cell_width, 0, \"Motivation Letter \" . ($key+1), 0, \"\");\n\n $pdf->setCellMargins(1, 0, 0, 1);\n $pdf->SetTextColor(0, 0, 255);\n $pdf->SetFont($font, \"U\");\n $pdf->Cell($right_cell_width, 0, basename($mot_letter), 1, 1, \"\", true, $mot_letter);\n $pdf->SetFont($font);\n $pdf->SetTextColor();\n }\n\n if ($list[\"languageCertificate\"] != \"\") {\n $pdf->setCellMargins(0, 4, 0, 1);\n $pdf->SetLineStyle($style_filled);\n $pdf->MultiCell($left_cell_width, 0, \"Language Certificate\", 0, \"\");\n\n $pdf->setCellMargins(1, 0, 0, 1);\n $pdf->SetTextColor(0, 0, 255);\n $pdf->SetFont($font, \"U\");\n $pdf->Cell($right_cell_width, 0, basename($list[\"languageCertificate\"]), 1, 1, \"\", true, $list[\"languageCertificate\"]);\n $pdf->SetFont($font);\n $pdf->SetTextColor();\n }\n\n if ($list[\"hepbAntPath\"] != \"\") {\n $pdf->setCellMargins(0, 4, 0, 1);\n $pdf->SetLineStyle($style_filled);\n $pdf->MultiCell($left_cell_width, 0, \"HepB Antibodies count\", 0, \"\");\n\n $pdf->setCellMargins(1, 0, 0, 1);\n $pdf->SetTextColor(0, 0, 255);\n $pdf->SetFont($font, \"U\");\n $pdf->Cell($right_cell_width, 0, basename($list[\"hepbAntPath\"]), 1, 1, \"\", true, $list[\"hepbAntPath\"]);\n $pdf->SetFont($font);\n $pdf->SetTextColor();\n }\n\n if ($list[\"tubTestPath\"] != \"\") {\n $pdf->setCellMargins(0, 4, 0, 1);\n $pdf->SetLineStyle($style_filled);\n $pdf->MultiCell($left_cell_width, 0, \"Tuberculosis test\", 0, \"\");\n\n $pdf->setCellMargins(1, 0, 0, 1);\n $pdf->SetTextColor(0, 0, 255);\n $pdf->SetFont($font, \"U\");\n $pdf->Cell($right_cell_width, 0, basename($list[\"tubTestPath\"]), 1, 1, \"\", true, $list[\"tubTestPath\"]);\n $pdf->SetFont($font);\n $pdf->SetTextColor();\n }\n\n\n if ($output == \"\") {\n $pdf->Output($list[\"name\"] . \"_\" . $list[\"surname\"] . \"_DEP.pdf\");\n } else {\n $pdf->Output($output, 'F');\n }\n }", "function returnPDFBasics()\n{\n $pdf = new FPDI();\n $pageCount = $pdf->setSourceFile('template.pdf');\n $tplIdx = $pdf->importPage(1);\n $pdf->AddFont('Roboto-Regular', '', 'Roboto-Regular.php');\n $pdf->AddPage();\n $pdf->SetFont('Roboto-Regular', '', 10);\n $pdf->useTemplate($tplIdx, 0, 0, 210, 297);\n\n return $pdf;\n}", "function pdf_info() {\n\n\t\t//checklist subject\n\t\t$format = 'f m l';\n\t\t$info[ 'person_name' ] = parent::get_name( $this->user, $format );\n\n\t\t//checklist categories\n\t\t$info[ 'categories' ] = HRChecklist::categories( $this->checklist_type );\n\t\t\n\t\t//category items\n\t\tforeach( $info[ 'categories' ] as &$category ) {\n\t\t\t$category[ 'items' ] = HRChecklist::get_items( $category );\n\t\t}\t\n\t\t\n\t\t//checklist info .... date created, id, user, type. the latter two should already be defined before this point.\n\t\t$info[ 'checklist_info' ] = HRChecklist::get( $this->user, $this->type );\t\n\t\t$info[ 'checklist_info' ][ 'title' ] = self::format_type_slug( $info[ 'checklist_info' ][ 'type' ] ).' Checklist';\n\n\t\t//checklist status\n\t\t$info[ 'is_complete' ] = HRChecklist::is_complete( $this->type, $info[ 'checklist_info' ][ 'id' ] );\n\t\t\t\n\t\t//if a closed date exists \n\t\tif( HRChecklist::get_meta( $info[ 'checklist_info' ][ 'id' ],\t'closed', 'activity_date' ) ) {\n\t\t\t$info[ 'checklist_info' ][ 'closed_date' ] = HRChecklist::get_meta( $info[ 'checklist_info' ][ 'id' ],\t'closed', 'activity_date' );\t\n\t\t\t$info[ 'closed_date' ] = new DateTime( $info[ 'checklist_info' ][ 'closed_date' ][ 'activity_date' ] ); \n\t\t\t$info[ 'closed_date' ] = $info[ 'closed_date' ]->format( 'l F j, Y' );\n\t\t}\n\t\t\n\t\treturn $info;\n\t}", "protected function getDocumentTemplate() {}", "public function generateContactPersonPdf($list, $cardOfDocuments, $output = \"\", $defaultFolder = './')\n {\n $dateOfBirth = date_create_from_format(\"d/m/Y\", $list[\"dateOfBirth\"]);\n $now = new DateTime();\n $age = $now->diff($dateOfBirth);\n\n\n $font = 'dejavusans';\n $style_filled = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(114, 115, 117));\n $first_border_width = 0.5;\n $first_border_style = array('width' => $first_border_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));\n $third_border_width = 0.4;\n $third_border_style = array('width' => $third_border_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(73, 22, 29));\n $fifth_border_width = 0.4;\n $fifth_border_style = array('width' => $fifth_border_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(73, 22, 29));\n $left_cell_width = 50;\n $right_cell_width = 75;\n\n $facultyName = '';\n $facultyAddress = '';\n if ($this->faculty) {\n $facultyName = $this->faculty->getFacultyName();\n $facultyAddress = $this->faculty->getFacultyAddress();\n }\n $pdf = new IfmsaRemotePdf(\n 'Contact Person',\n $facultyName,\n $facultyAddress,\n $defaultFolder,\n $this->myAuthorizator\n );\n\n $pdf->SetTitle('Contact Person Info');\n $pdf->SetSubject('Contact Person Info');\n $pdf->AddPage();\n\n $img_top_pos = PDF_MARGIN_TOP + 6;\n $img_left_pos = PDF_MARGIN_LEFT;\n $imgwidth = 50;\n $imgheight = 0;\n if ($list['jpgPath']) {\n try {\n $response = $this->guzzleClient->head($list[\"jpgPath\"]);\n $mime_img = $response->getHeader('Content-Type');\n $imgsize = $response->getHeader('Content-Length');\n $imginfo = $this->getimgsize($list[\"jpgPath\"]);\n if (($mime_img[0] == \"image/gif\" || $mime_img[0] == \"image/jpeg\" || $mime_img[0] == \"image/png\") &&\n $imgsize[0] < 4000000 && $imginfo[0] > 0 && $imginfo[1] > 0) {\n $pdf->Image($list[\"jpgPath\"], $img_left_pos, $img_top_pos, $imgwidth, 0, \"\", $list[\"jpgPath\"], '', true);\n $imgheight = ($imgwidth / $imginfo[0]) * $imginfo[1];\n }\n } catch (Exception $e) {\n }\n }\n $pdf->setPageMark();\n\n\n /* First paragraph */\n $pdf->setCellMargins(0, 5, 0, 3);\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Personal Information', 0, '');\n $pdf->SetFont($font);\n\n $pdf->SetLineStyle($pdf->getEntryBorderStyle());\n $pdf->SetFillColorArray($pdf->getEntryFillColor());\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Name\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"name\"] . \" \" . $list[\"surname\"], 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Exchange is unilateral\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"unilateral\"], 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Date of Birth\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"dateOfBirth\"] . \" (\" . $age->y . \" years)\", 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Nationality\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"nationality\"], 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Languages\");\n $pdf->MultiCell($right_cell_width, 0, str_replace(';', \"\\n\", $list[\"languages\"]), 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Cell Phone\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"cellular\"], 1, \"\", true);\n\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Email\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"email\"], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 5);\n $pdf->SetX(PDF_MARGIN_LEFT + $imgwidth + 5);\n $pdf->Cell($left_cell_width, 0, \"Alternative Email\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"altEmail\"], 1, \"\", true);\n\n\n /* Draw border of paragraph */\n $first_border_y = $pdf->GetY();\n if ($first_border_y < $imgheight + $img_top_pos) {\n $first_border_y = $imgheight + $img_top_pos + 5;\n }\n $pdf->SetY($first_border_y);\n\n $pdf->SetLineStyle($first_border_style);\n $pdf->Line(PDF_MARGIN_LEFT - 5 + ($first_border_width / 2), PDF_MARGIN_TOP + 1, PDF_MARGIN_LEFT - 5 + ($first_border_width / 2), $first_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, PDF_MARGIN_TOP + 1, 210 - PDF_MARGIN_RIGHT + 5, PDF_MARGIN_TOP + 1);\n $pdf->Line(210 - PDF_MARGIN_RIGHT + 5 - ($first_border_width / 2), PDF_MARGIN_TOP + 1, 210 - PDF_MARGIN_RIGHT + 5 - ($first_border_width / 2), $first_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $first_border_y, 210 - PDF_MARGIN_RIGHT + 5, $first_border_y);\n\n\n /* Second paragraph */\n $left_cell_width = 60;\n $right_cell_width = 80;\n\n $pdf->Rect(\n 10,\n $first_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n\n if ($this->myAuthorizator->isScope()) {\n $pdf->SetFont($font, 'B');\n $pdf->Cell($left_cell_width, 0, 'DEPARTMENT');\n $pdf->SetFont($font);\n\n $dep_splitted = explode(\";\", $list[\"departmentChosen\"]);\n if (count($dep_splitted) == 4) {\n $dep_splitted[1] = substr($dep_splitted[1], 17);\n if ($dep_splitted[1] == false) {\n $dep_splitted[1] = \"\";\n }\n $dep_splitted[2] = substr($dep_splitted[2], 15);\n if ($dep_splitted[2] == false) {\n $dep_splitted[2] = \"\";\n }\n } elseif (count($dep_splitted) < 4) {\n $dep_splitted = array($list[\"departmentChosen\"], \"\", \"\");\n }\n\n $pdf->setCellMargins(0, 6.9, 0, 4);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[0], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->Cell($left_cell_width, 0, \"Field Studied\");\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[1], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Exam Passed\");\n $pdf->MultiCell($right_cell_width, 0, $dep_splitted[2], 1, \"\", true);\n } else {\n $pdf->SetFont($font, 'B');\n $pdf->Cell($left_cell_width, 0, 'PROJECT', 0, 1);\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(1, 1, 0, 1);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n $pdf->MultiCell(210 - PDF_MARGIN_LEFT - PDF_MARGIN_RIGHT, 0, $list[\"departmentChosen\"], 1, \"\", true);\n }\n\n $pdf->SetLineStyle($style_filled);\n $pdf->setCellMargins(0, 5, 0, 1);\n $pdf->MultiCell($left_cell_width, 0, \"Student Remarks\", 0, \"\");\n $pdf->setCellMargins(1, 0, 0, 1);\n $pdf->MultiCell(210 - PDF_MARGIN_LEFT - PDF_MARGIN_RIGHT, 0, $list[\"studentRemarks\"], 1, \"\", true);\n\n\n /* Third paragraph */\n $left_cell_width = 70;\n $right_cell_width = 80;\n $second_border_y = $pdf->GetY();\n\n $pdf->Rect(\n 10,\n $second_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'OTHERS', 0, '');\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Emergency Contact', 0, '');\n $pdf->SetFont($font);\n\n $pdf->Cell($left_cell_width, 0, \"Emergency Name\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"emergName\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Emergency Telephone Number\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"emergCell\"], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 4);\n $pdf->Cell($left_cell_width, 0, \"Emergency Email\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"emergMail\"], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Accommodation', 0, '');\n $pdf->setCellMargins(0, 1, 0, 4);\n $pdf->SetFont($font);\n $pdf->MultiCell(210 - PDF_MARGIN_LEFT - PDF_MARGIN_RIGHT, 0, $list[\"accommodation\"], 1, \"\", true);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Other Details', 0, '');\n $pdf->setCellMargins(0, 1, 0, 5);\n $pdf->SetFont($font);\n $pdf->MultiCell(210 - PDF_MARGIN_LEFT - PDF_MARGIN_RIGHT, 0, $list[\"otherDetails\"], 1, \"\", true);\n\n\n /* Draw border of paragraph */\n $third_border_y = $pdf->GetY();\n $pdf->SetLineStyle($third_border_style);\n $pdf->Line(PDF_MARGIN_LEFT - 5 + ($third_border_width / 2), $second_border_y + 5, PDF_MARGIN_LEFT - 5 + ($third_border_width / 2), $third_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $second_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5, $second_border_y + 5);\n $pdf->Line(210 - PDF_MARGIN_RIGHT + 5 - ($third_border_width / 2), $second_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5 - ($third_border_width / 2), $third_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $third_border_y, 210 - PDF_MARGIN_RIGHT + 5, $third_border_y);\n\n\n /* Fourth paragraph */\n $pdf->Rect(\n 10,\n $third_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'ARRIVAL DETAILS', 0, '');\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n\n $pdf->Cell($left_cell_width, 0, \"Arrival Date and Time\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"arrivalDate\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Arrival Location\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"arrivalLocation\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Arrival Location Details\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"arrivalLocationDetails\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Flight/Bus/Train Number\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"flightBusTrainNumber\"], 1, \"\", true);\n\n $pdf->Cell($left_cell_width, 0, \"Departure Date\");\n $pdf->MultiCell($right_cell_width, 0, $list[\"departureDate\"], 1, \"\", true);\n\n\n /* Fifth paragraph */\n $left_cell_width = 80;\n $right_cell_width = 100;\n $fourth_border_y = $pdf->GetY();\n\n if (($fourth_border_y + 5 + 9) >= (297 - PDF_MARGIN_TOP - PDF_MARGIN_BOTTOM)) {\n $pdf->AddPage();\n $fourth_border_y = $pdf->GetY();\n }\n $pdf->Rect(\n 10,\n $fourth_border_y + 5,\n 190,\n 9,\n 'DF',\n array('all' => array('width' => 0, 'cap' => 'square', 'join' => 'miter', 'dash' => '0', 'color' =>\n array(199, 183, 183))),\n array(199, 183, 183)\n );\n $pdf->setPageMark();\n\n $pdf->setCellMargins(0, 5, 0, 2);\n $pdf->setCellPaddings(1, 2, 2, 2);\n\n $pdf->SetFont($font, 'B');\n $pdf->MultiCell(0, 0, 'Card of documents', 0, '');\n $pdf->SetFont($font);\n\n $pdf->setCellMargins(0, 1, 0, 0);\n $pdf->setCellPaddings(1, 0, 1, 0);\n $pdf->SetLineStyle($style_filled);\n $pdf->SetFillColor(242, 242, 242, -1);\n\n foreach ($cardOfDocuments as $key => $val) {\n $doubledot = strpos($key, \":\");\n if ($doubledot == false) {\n $pdf->Cell($left_cell_width, 0, $key);\n } else {\n $pdf->Cell($left_cell_width, 0, substr($key, 0, $doubledot));\n }\n $pdf->Cell($right_cell_width, 0, basename($val), 1, 1, \"\", false, $val);\n }\n\n $pdf->SetY($pdf->GetY() + 4);\n\n /* Draw border of paragraph */\n $fifth_border_y = $pdf->GetY();\n $pdf->SetLineStyle($fifth_border_style);\n $pdf->Line(PDF_MARGIN_LEFT - 5 + ($fifth_border_width / 2), $fourth_border_y + 5, PDF_MARGIN_LEFT - 5 + ($fifth_border_width / 2), $fifth_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $fourth_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5, $fourth_border_y + 5);\n $pdf->Line(210 - PDF_MARGIN_RIGHT + 5 - ($fifth_border_width / 2), $fourth_border_y + 5, 210 - PDF_MARGIN_RIGHT + 5 - ($fifth_border_width / 2), $fifth_border_y);\n $pdf->Line(PDF_MARGIN_LEFT - 5, $fifth_border_y, 210 - PDF_MARGIN_RIGHT + 5, $fifth_border_y);\n\n if ($output == \"\") {\n $pdf->Output($list[\"name\"] . \"_\" . $list[\"surname\"] . \"_CP.pdf\");\n } else {\n $pdf->Output($output, 'F');\n }\n }", "function fdf_add_template($fdfdoc, $newpage, $filename, $template, $rename) {}", "protected function initDocInfo()\n {\n $pdf = $this->getPdf();\n \n $pdf->SetTitle('IRC Certificate');\n $pdf->SetSubject('IRC Education Certificate');\n $pdf->SetAuthor('IRC Education Management System');\n $pdf->SetKeywords('x, y, z');\n }", "public function pi_list_header() {}", "public function template()\n\t{\n\t}", "function _getCitationTemplate() {\n\t\t$basePath = $this->getBasePath();\n\t\treturn 'file:'.$basePath.DIRECTORY_SEPARATOR.'nlm-citation.tpl';\n\t}", "protected function get_license_page_title()\n {\n }", "function show_sw_license ($lheader, $lcontent) {\n global $switem_defaults;\n\n $lurl = $switem_defaults[$lcontent];\n $lurlpref = '';\n if ($lurl) :\n $lurlpref = substr_count($lurl, 'http') ? '' : get_stylesheet_directory_uri().'/docs/licenses/';\n $line = '<li><a href=\"'.$lurlpref.$lurl.'\">'.$switem_defaults[$lheader].'</a></li>';\n echo $line;\n endif;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Bank Swift Code from Iban
public function getCode($Iban);
[ "public static function get_bank_code()\n {\n }", "public function getBankCode();", "public function getClientBankCode();", "public function getBankSwift();", "public function getBankCode() {\n \tif($this->bankCode == null)\n\t\t\treturn \"\";\n\t\telse\n \treturn $this->bankCode;\n }", "public function getBank_code()\n {\n return $this->bank_code;\n }", "function _iban_get_info($iban,$code) {\n $country = iban_get_country_part($iban);\n return _iban_country_get_info($country,$code);\n}", "function getBankaccount()\n {\n if (!$this->validate()) {\n $this->_errorcode = VALIDATE_FINANCE_IBAN_GENERAL_INVALID;\n return PEAR::raiseError($this->errorMessage($this->_errorcode), $this->_errorcode, PEAR_ERROR_TRIGGER, E_USER_WARNING, $this->errorMessage($this->_errorcode).\" in VALIDATE_FINANCE_IBAN::getBankaccount()\");\n } else {\n $_iban_countrycode_bankaccount = Validate_Finance_IBAN::_getCountrycodeBankaccount();\n $currCountrycodeBankaccount = $_iban_countrycode_bankaccount[ substr($this->_iban,0,2) ];\n return substr($this->_iban, $currCountrycodeBankaccount['start'], $currCountrycodeBankaccount['length']);\n }\n }", "function getBankaccount()\n {\n if (!$this->validate()) {\n $this->_errorcode = VALIDATE_FINANCE_IBAN_GENERAL_INVALID;\n return PEAR::raiseError($this->errorMessage($this->_errorcode), $this->_errorcode, PEAR_ERROR_TRIGGER, E_USER_WARNING, $this->errorMessage($this->_errorcode).\" in VALIDATE_FINANCE_IBAN::getBankaccount()\");\n } else {\n $_iban_countrycode_bankaccount = Validate_Finance_IBAN::_getCountrycodeBankaccount();\n $currCountrycodeBankaccount = $_iban_countrycode_bankaccount[ substr($iban,0,2) ];\n return substr($this->_iban, $currCountrycodeBankaccount['start'], $currCountrycodeBankaccount['length']);\n }\n }", "public function getBankCode()\n {\n return $this->getParameter('bankCode');\n }", "public function getBankcode()\n {\n $bankcode = '';\n if (array_key_exists('bankcode', $this->previousParams)) {\n $bankcode = $this->previousParams['bankcode'];\n }\n\n return $bankcode;\n }", "public function getBankCode()\n {\n return $this->bank_code;\n }", "function iban_country_get_iban_format_swift($iban_country) {\n return _iban_country_get_info($iban_country,'iban_format_swift');\n}", "public function getBankAccountNumber(): string\n {\n $countryCode = $this->getCountryCode();\n $length = static::$ibanFormatMap[$countryCode][0] - static::INSTITUTE_IDENTIFICATION_LENGTH;\n return substr($this->iban, static::BANK_ACCOUNT_NUMBER_OFFSET, $length);\n }", "function iban_country_get_bban_format_swift($iban_country) {\n return _iban_country_get_info($iban_country,'bban_format_swift');\n}", "function _getCountrycodeBankaccount()\n {\n static $_iban_countrycode_bankaccount;\n if (!isset($_iban_countrycode_bankaccount)) {\n $_iban_countrycode_bankaccount =\n array(\n 'AD' => array('start' => 12, 'length' => 12),\n 'AT' => array('start' => 9, 'length' => 11),\n 'BE' => array('start' => 7, 'length' => 9),\n 'CH' => array('start' => 9, 'length' => 12),\n 'CZ' => array('start' => 8, 'length' => 16),\n 'DE' => array('start' => 12, 'length' => 10),\n 'DK' => array('start' => 8, 'length' => 10),\n 'ES' => array('start' => 12, 'length' => 12),\n 'FI' => array('start' => 10, 'length' => 8),\n 'FR' => array('start' => 14, 'length' => 13),\n 'GB' => array('start' => 8, 'length' => 14),\n 'GI' => array('start' => 8, 'length' => 15),\n 'GR' => array('start' => 11, 'length' => 16),\n 'HU' => array('start' => 12, 'length' => 15), // followed by 1 char (checksum)\n 'IE' => array('start' => 14, 'length' => 8),\n 'IS' => array('start' => 8, 'length' => 18),\n 'IT' => array('start' => 15, 'length' => 12),\n 'LU' => array('start' => 8, 'length' => 13),\n 'NL' => array('start' => 8, 'length' => 10),\n 'NO' => array('start' => 8, 'length' => 7),\n 'PL' => array('start' => 12, 'length' => 16),\n 'PT' => array('start' => 12, 'length' => 13),\n 'SE' => array('start' => 7, 'length' => 17),\n 'SE' => array('start' => 7, 'length' => 8) // followed by 1 char (checksum)\n );\n }\n return $_iban_countrycode_bankaccount;\n }", "private function _getSepaBankCode()\n {\n return \"ASPKAT2L\";\n }", "public function getBankCode()\n {\n return $this->bankCode;\n }", "function iban_country_get_bban_example($iban_country) {\n return _iban_country_get_info($iban_country,'bban_example');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for pOSTPromotionRules Create a promotion rule.
public function testPOSTPromotionRules() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function __construct($promotionalRules);", "public function pOSTCouponCodesPromotionRulesRequest($coupon_codes_promotion_rule_create)\n {\n // verify the required parameter 'coupon_codes_promotion_rule_create' is set\n if ($coupon_codes_promotion_rule_create === null || (is_array($coupon_codes_promotion_rule_create) && count($coupon_codes_promotion_rule_create) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $coupon_codes_promotion_rule_create when calling pOSTCouponCodesPromotionRules'\n );\n }\n\n $resourcePath = '/coupon_codes_promotion_rules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n ['application/vnd.api+json']\n );\n }\n\n // for model (json/xml)\n if (isset($coupon_codes_promotion_rule_create)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_codes_promotion_rule_create));\n } else {\n $httpBody = $coupon_codes_promotion_rule_create;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createProductPromotion($product_id,\n $title = 'Test Promotion',\n $date_from = NULL,\n $date_to = NULL,\n $type = 'percentageOff',\n $value = 10,\n $count = 1,\n $stackable = true)\n {\n // Create promotion\n $promo = new rtShopPromotionProduct();\n $promo->setTitle($title);\n $promo->setDateFrom($date_from);\n $promo->setDateTo($date_to);\n $promo->setReductionType($type);\n $promo->setReductionValue($value);\n $promo->setCount($count);\n $promo->setStackable($stackable);\n $promo->save();\n\n // Connect promotion to product\n $promo_product = new rtShopProductToPromotion();\n $promo_product->setProductId($product_id);\n $promo_product->setPromotionId($promo->getId());\n $promo_product->save();\n\n return $promo->getId();\n }", "public function createCartRule(array $options)\n {\n $shop = $this->getShop();\n $browser = $this->getBrowser();\n\n $shop->getBackOfficeNavigator()->visit('AdminCartRules', 'new');\n\n $browser\n ->fillIn($this->i18nFieldName('#name'), $options['name']);\n\n if (isset($options['product_restrictions'])) {\n $blockId = 1;\n $ruleId = 0;\n\n $browser\n ->click('#cart_rule_link_conditions')\n ->click('#product_restriction')\n ->click('{xpath}//a[contains(@href, \"addProductRuleGroup\")]');\n\n foreach ($options['product_restrictions'] as $type => $ids) {\n $browser\n ->select('#product_rule_type_' . $blockId, $type)\n ->click('{xpath}//a[contains(@href, \"addProductRule(' . $blockId . ')\")]')\n ->click('#product_rule_' . $blockId . '_' . (++$ruleId) . '_choose_link')\n ->multiSelect('#product_rule_select_' . $blockId . '_' . $ruleId . '_1', $ids)\n ->click('#product_rule_select_' . $blockId . '_' . $ruleId . '_add')\n ->click('a.fancybox-close');\n\n // sanity check\n $matched = $browser->getValue('#product_rule_' . $blockId . '_' . $ruleId . '_match');\n if ($matched != count($ids)) {\n throw new CartRuleCreationIncorrectException('Could not select all of the requested `' . $type . '`.');\n }\n }\n }\n\n $browser->click('#cart_rule_link_actions');\n\n $m = [];\n\n if (isset($options['discount'])) {\n if (preg_match('/^\\s*(\\d+(?:.\\d+)?)\\s*((?:%|before|after))/', $options['discount'], $m)) {\n $amount = $m[1];\n $type = $m[2];\n\n if ($type === '%') {\n $browser\n ->clickLabelFor('apply_discount_percent')\n ->waitFor('#reduction_percent')\n ->fillIn('#reduction_percent', $amount);\n } else {\n $browser\n ->clickLabelFor('apply_discount_amount')\n ->waitFor('#reduction_amount')\n ->fillIn('#reduction_amount', $amount)\n ->select('select[name=\"reduction_tax\"]', ['before' => 0, 'after' => 1][$type]);\n }\n } else {\n throw new \\Exception(\"Incorrect discount spec: {$options['discount']}.\");\n }\n }\n\n if (isset($options['free_shipping'])) {\n $browser->prestaShopSwitch('free_shipping', $options['free_shipping']);\n }\n\n if (isset($options['apply_to_product'])) {\n /**\n * This is not how a user would do it, but JQuery autocomplete\n * will NOT be triggered if the window doesn't have focus,\n * so unfortunately we can't rely on it.\n */\n $browser\n ->clickLabelFor('apply_discount_to_product')\n ->executeScript('$(\"#reduction_product\").val(arguments[0])', [$options['apply_to_product']]);\n } else if (!empty($options['apply_to_selected_products'])) {\n $browser->clickLabelFor('apply_discount_to_selection');\n } else if (!empty($options['apply_to_cheapest_product'])) {\n $browser->clickLabelFor('apply_discount_to_cheapest');\n }\n\n $browser\n ->click('#desc-cart_rule-save-and-stay')\n ->ensureStandardSuccessMessageDisplayed();\n\n $id_cart_rule = (int) $browser->getURLParameter('id_cart_rule');\n\n if ($id_cart_rule <= 0)\n throw new CartRuleCreationIncorrectException();\n\n return $id_cart_rule;\n }", "public function testCreatePromotionUsingPOST1()\n {\n }", "public function pOSTOrderAmountPromotionRules($order_amount_promotion_rule_create)\n {\n $this->pOSTOrderAmountPromotionRulesWithHttpInfo($order_amount_promotion_rule_create);\n }", "public function pOSTCouponCodesPromotionRules($coupon_codes_promotion_rule_create)\n {\n $this->pOSTCouponCodesPromotionRulesWithHttpInfo($coupon_codes_promotion_rule_create);\n }", "public static function createProductPromotion($product_id, $discount_percentage, array $store_ids, array $order_types);", "public function testOrderPromotion() : void {\n $order = $this->createOrder();\n $discount = new Price('-1.1', 'EUR');\n $order->addAdjustment(new Adjustment(\n [\n 'type' => 'promotion',\n 'label' => 'D',\n 'amount' => new Price('-1.1', 'EUR'),\n 'percentage' => '10',\n ]\n ));\n $order->setRefreshState(OrderInterface::REFRESH_ON_LOAD);\n $order->save();\n\n $request = $this->sut->createSessionRequest($order);\n\n // Make sure there is a discount added as negative order line.\n /** @var \\Klarna\\Payments\\Model\\OrderLine[] $discounts */\n $discounts = array_filter($request->getOrderLines(), function (OrderLine $item) {\n return $item->getName() === 'Discount';\n });\n $this->assertEquals(UnitConverter::toAmount($discount), reset($discounts)->getTotalAmount());\n $this->assertCount(1, $discounts);\n $this->assertEquals(990, $request->getOrderAmount());\n }", "function testCreateRule()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Go to the Rules page\r\n\t\t$this->assertTrue($this->get(\"$webUrl/rules.php\", array(\r\n\t\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'action' => 'create_rule',\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'schema' => 'public',\r\n\t\t\t\t\t\t'table' => 'student',\r\n\t\t\t\t\t\t'subject' => 'table'))\r\n\t\t\t\t\t);\r\n \r\n // Set properties for the new rule \r\n $this->assertTrue($this->setField('name', 'insert_stu_rule')); \r\n $this->assertTrue($this->setField('event', 'INSERT')); \r\n $this->assertTrue($this->setField('where', '')); \r\n $this->assertTrue($this->setField('type', 'NOTHING')); \r\n $this->assertTrue($this->clickSubmit($lang['strcreate']));\r\n \r\n // Verify if the rule is created correctly.\r\n $this->assertTrue($this->assertWantedText($lang['strrulecreated']));\r\n \r\n return TRUE; \r\n }", "protected function _savePromotionRules()\n {\n foreach($this->_salesRules as $rule){\n $rule->save();\n }\n }", "public function create(Proposition $condition, $action = null)\n {\n return new Rule($condition, $action);\n }", "public function actionCreate()\n {\n $model = new Promotion();\n\n if ($model->saveData(Yii::$app->request->post())) {\n return $this->success();\n }\n\n return $this->fail($model->errors);\n }", "public function testCreateNotificationRule()\r\n {\r\n }", "abstract public static function createRules(): AbstractRules;", "public function appendPromotions(\\service\\message\\common\\PromotionRule $value)\n {\n return $this->append(self::promotions, $value);\n }", "protected function getSylius_Factory_PromotionRuleService()\n {\n return $this->services['sylius.factory.promotion_rule'] = new \\Sylius\\Component\\Core\\Factory\\PromotionRuleFactory(new \\Sylius\\Component\\Resource\\Factory\\Factory('Sylius\\\\Component\\\\Promotion\\\\Model\\\\PromotionRule'));\n }", "public function testCreateReactionRule() {\n $account = $this->drupalCreateUser(['administer rules']);\n $this->drupalLogin($account);\n\n $this->drupalGet('admin/config/workflow/rules');\n $this->getSession()->getPage()->findLink('Add reaction rule')->click();\n\n $this->getSession()->getPage()->findField('Label')->setValue('Test rule');\n $this->getSession()->getPage()->findField('Machine-readable name')->setValue('test_rule');\n $this->getSession()->getPage()->findButton('Save')->click();\n\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Reaction rule Test rule has been created.');\n\n $this->getSession()->getPage()->findLink('Add condition')->click();\n\n $this->getSession()->getPage()->findField('Condition')->setValue('rules_node_is_promoted');\n $this->getSession()->getPage()->findButton('Continue')->click();\n\n $this->getSession()->getPage()->findField('Node')->setValue('1');\n $this->getSession()->getPage()->findButton('Save')->click();\n\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Your changes have been saved.');\n }", "public function testCreateNetworkSwitchQosRule()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add all users to the skill
public function initializeUsers($users) { foreach($users as $user){ $userSkill = new UserSkills(); $userSkill->setUser($user) ->setSkill($this); $this->addUserSkill($userSkill); } }
[ "public function addMultipleUsers() {\n $this->addUser();\n\n while ( true ) {\n echo \"\\033[32m\".\"Želite li unjeti novog zaposlenika? da/ne \".\"\\033[0m\";\n if ( readline() !== 'da' ) {\n break;\n } else {\n $this->addUser();\n\n }\n\n }\n }", "public function populateDatabaseWithUsers(){\n $names = array(\"Jack\", \"John\", \"Jamie\", \"Jane\", \"Julie\", \"Jackson\", \"Joe\", \"Jacob\", \"Joshua\", \"Jayden\", \"Jasmine\", \"Joel\", \"Jack\");\n foreach ($names as $name){\n $this->addUser($name);\n }\n }", "function add_users_to_team() {\n\t\t$this->_team->retrieve(\"West\");\n\t\t$this->_team->add_user_to_team($this->guids['sarah']);\n\t\t$this->_team->add_user_to_team($this->guids['sally']);\n\t\t$this->_team->add_user_to_team($this->guids[\"max\"]);\n\n\t\t// Create the east team memberships\n\t\t$this->_team->retrieve(\"East\");\n\t\t$this->_team->add_user_to_team($this->guids[\"will\"]);\n\t\t$this->_team->add_user_to_team($this->guids['chris']);\n\t}", "function addTeamUsers() {\n global $DB;\n\n $iterator = $DB->request([\n 'SELECT' => 'items_id',\n 'FROM' => 'glpi_projectteams',\n 'WHERE' => [\n 'itemtype' => 'User',\n 'projects_id' => $this->obj->fields['id']\n ]\n ]);\n $user = new User;\n while ($data = $iterator->next()) {\n if ($user->getFromDB($data['items_id'])) {\n $this->addToRecipientsList(['language' => $user->getField('language'),\n 'users_id' => $user->getField('id')]);\n }\n }\n }", "private function update_users() {\n\t\t\t$users = get_users();\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$this->connection->hmSet(\n\t\t\t\t\t'user:' . $user->ID,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user_id' => $user->ID,\n\t\t\t\t\t\t'login' => $user->data->user_login,\n\t\t\t\t\t\t'display_name' => $user->data->display_name,\n\t\t\t\t\t\t'email' => $user->data->user_email,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function multipleAdd(array $users);", "private function set_users_permissions()\n {\n $users = get_users();\n foreach ($users as $user) {\n $user = new WP_User($user->ID);\n $user->remove_cap('wptuts_client');\n }\n if (!empty($this->users)) {\n foreach ($this->users as $user_id) {\n $user = new WP_User($user_id);\n $user->add_cap('wptuts_client');\n }\n }\n }", "public function lsvt_api_can_bulk_add_points_to_multiple_users_in_one_call()\n {\n //\n }", "private function attachUsersRoleToExistingUsers()\n {\n $role = $this->role->where('default', true)->first();\n\n $this->user->with('roles')->whereDoesntHave('roles', function(Builder $query) use($role) {\n return $query->where('roles.id', $role->id);\n })->select('id')->chunk(500, function(Collection $users) use($role) {\n $insert = $users->map(function(User $user) use($role) {\n return ['user_id' => $user->id, 'role_id' => $role->id, 'created_at' => Carbon::now()];\n })->toArray();\n DB::table('user_role')->insert($insert);\n });\n }", "public function test_add_users() {\n $this->resetAfterTest();\n\n $u1 = $this->getDataGenerator()->create_user();\n $u2 = $this->getDataGenerator()->create_user();\n $u3 = $this->getDataGenerator()->create_user();\n $expected = [$u1->id, $u3->id];\n\n $uut = new userlist(\\context_system::instance(), 'core_privacy');\n $uut->add_users([$u1->id, $u3->id]);\n\n $this->assertCount(2, $uut);\n\n foreach ($uut as $user) {\n $this->assertNotFalse(array_search($user->id, $expected));\n }\n }", "public function action_add_skill($params) {\n\t\t// Get params\n\t\t$p = Parameters::extract($params, 'uid', 'uid');\n\t\t\n\t\t// Find user\n\t\t$user = Mongo_Document::factory('user');\n\t\t$user->load($p->uid);\n\t\ttry {\n//\t\t\t$user->skills[$_POST['name']] = $_POST['level'];\n\t\t\t$user->save();\n\t\t\t$message = __(\"This skill has been added to your Resume\");\n\t\t} catch (MongoException $message) {\n\t\t\t$message = __(\"Skill not added\");\n\t\t}\n\n\t\t// Send notification\n\t\t$response = array(\n\t\t\t'message' => $message,\n\t\t);\n\n\t\techo json_encode($response);\n\t\treturn;\n\t}", "public function addUsers(Request $request, $conversation_id) {\n // Get users\n $users = $request->json()->get('users');\n\n // Get conversation\n $conversation = \\Chat::conversation($conversation_id);\n\n // Get users in conversation\n $previous_users = $conversation->users;\n\n // Extract only ids\n foreach ($previous_users as $user) {\n array_push($users, $user->id);\n }\n\n \t\\Chat::addParticipants($conversation_id, $users); // Add multiple users or one\n }", "public function extend_for_user($user) {\n $this->extendforuser[] = $user;\n }", "public function addUser($user)\n {\n\t$this->users[] = $user;\n\t$user->setGame($this);\n }", "function addUser($user) {\n $this->setValue('users', $user);\n }", "public function add_user_skill() {\r\n\t\t$skill = $this->input->post('skill');\r\n\r\n\t\t// find the current users id\r\n\t\t$user_id = $this->session->userdata('user_id');\r\n\r\n\t\t// send value to database\r\n\t\tif ($this->User_model->add_user_skill($skill, $user_id)) {\r\n\t\t\t// Print value\r\n\t\t\treturn $this->display_user_skills($user_id);\r\n\t\t} else {\r\n\t\t\techo 'duplicated';\r\n\t\t}\r\n\t}", "public function skilledUsers()\n {\n return $this->morphToMany(User::class, 'skillable', 'user_skills');\n }", "protected function loadUsers()\n {\n $this->addFixture(new UserData);\n $this->executeFixtures();\n }", "function propagate_users() {\n $this->mongo_connect();\n $m_users = Db::find(\"wp_user\",array(), array());\n for($blog_id = 2; $blog_id <= count($this->sites_array); $blog_id++) {\n printf(\"Starting site %d\\n\", $blog_id);\n switch_to_blog($blog_id);\n wp_cache_flush();\n foreach($m_users as $m_user) {\n $role = $m_user[\"true_user\"] == 1 ? \"subscriber\" : \"author\";\n add_user_to_blog($blog_id, $m_user[\"wp_id\"], $role);\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new database, returning the password if successful or null if not. Defaults to generating random password , and using $DbName for $UserName if none supplied.
function CreateDatabase($DbName, $Pass=0, $UserName=0) { // Fix. Due to virtual shared hosting restrictions in my primary environment I just left this for the moment. Databases and users can only be created via the cPanel on BlueHost, but in other circumstances this should actually function... }
[ "public function testDatabaseCreate( )\n {\n $db = $this->_getdb();\n \n $dbname = 'wp_phpunit' . rand( 0, 9999 ); /* Randomize? */\n $mysql = $db->get_mysql();\n\n $ret = $db->create( $dbname, $mysql->dbuser, $mysql->dbpasswd, $mysql->dbhost );\n $this->assertNotFalse( $ret );\n\n // Now get a list of databases and make sure our database has been created\n $dblist = $db->get_list();\n\n $dbidx = array_search( $dbname, $dblist );\n $this->assertNotFalse( $dbidx );\n\n return $dbname;\n }", "public function createDatabase () {\n\t\t$db = $this->connectWithoutDbname();\n\t\t$setupdb->exec('CREATE DATABASE IF NOT EXISTS ' . $this->dbname);\n\t\t$db = null;\n\t}", "function createDB() {\n require 'database.php';\n $sql = $this->dbh->exec(\"CREATE DATABASE IF NOT EXISTS `$DB_NAME`;\n CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASSWORD';\n GRANT ALL ON `$DB_NAME`.* TO '$DB_USER'@'localhost';\n FLUSH PRIVILEGES;\")\n or die(print('Error - createDB: ').print_r($this->dbh->errorInfo(), true));\n echo \"Database `$DB_NAME` created <br>\";\n }", "public function createDatabase(string $database);", "public function createDatabase() {\n $database = $this->getMachineName('What is the name of the database? This ideally will match the site directory name. No special characters please.');\n $this->connectAcquiaApi();\n $this->say('<info>' . $this->acquiaDatabases->create($this->appId, $database)->message . '</info>');\n }", "private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "public function createDb() {\n $query= \"CREATE DATABASE IF NOT EXISTS `users_db`\";\n $handle= $this->conn->query($query);\n if(!$handle) {\n die(\"A problem occurred: go back and try again\");\n }\n }", "function CreateRandomUser()\n\t{\n\t\t$id = $this -> generateString(15);\n\t\t$pass = $this -> generateString(30);\n\n\t\tif ($this -> sql -> connect_errno) {\n\t\t\tprintf('Connection Failed!');\n\t\t\texit();\n\t\t}\n\n\t\t$q = $this -> sql -> query(\"SELECT * FROM Users WHERE Name = '\".$id.\"'\");\n\t\t$r = mysqli_fetch_array($q);\n\t\t$c = mysqli_num_rows($q);\n\t\t$q -> close();\n\n\t\tif ($c == 0) \n\t\t{\n\t\t\t$this -> sql -> query(\"INSERT INTO Users (Name, Password) VALUES ('\".$id.\"', '\".$pass.\"')\");\t\t\t\n\t\t\treturn printf($id.':'.$pass);\n\t\t}\n\t\treturn printf('FAILED');\n\t}", "public function createDatabase();", "public function createDatabase($nameDatabase) {\n\t\tif (!empty($nameDatabase)) {\n\t\t\t$res = $this->client->parseResponse($this->client->query('PUT', urlencode($nameDatabase)));\n\t\t\treturn $res['body'];\n\t\t}\n\t\telse \n\t\t\tthrow new Exception(\"CouchDB Error : Unable to create database : \".$nameDatabase.\".\");\n\t}", "public function createDatabase($database);", "public function CreateDb($db_name) {\n $query = \"CREATE DATABASE IF NOT EXISTS $db_name\";\n if ( !$this->IsDbConnReady() ) {\n $this->SetDbConnectionError();\n return null;\n }\n $this->m_link->query($query);\n return $this->m_link->errno;\n }", "public function createDatabase() {\n\t\tglobal $mwtSQLTemplate;\n\t\tUtilities::createAndImportDatabase( $this->dbname, $mwtSQLTemplate );\n\t}", "public function createDatabase(): Database {\n $moduleBaseName = 'Database';\n if (! $this->isTestMode()) {\n $moduleName = $moduleBaseName . 'Mysql';\n } else {\n $moduleName = $moduleBaseName . 'Test';\n }\n $object = $this->createModule($moduleName, $moduleBaseName);\n return $object;\n }", "public function create_db($name, $flags = 0, array $parameters = []) {\n return UPS_SUCCESS;\n }", "private function createDataBase()\n {\n try {\n $statement = \"CREATE DATABASE IF NOT EXISTS \" . $this->dbName;\n $query = $this->pdoConnection->prepare($statement);\n $query->execute();\n } catch (\\PDOException $e) {\n }\n }", "public function makeDatabase(){\n \n $disk = Storage::disk('clients');\n $query = DB::connection('engine');\n \n #Valida inexistencia de Usuario y Database para el proyecto \n if(!$query->table('user')->where('user', $this->project->db_username)->get()){\n if(!$query->table('db')->where('db', $this->project->database)->get()){\n \n # ~ Crear base de datos\n $query->statement(\"CREATE DATABASE IF NOT EXISTS \".$this->project->database);\n $query->statement(\"CREATE USER '\".$this->project->db_username.\"'@'\".$this->project->db_host.\"' IDENTIFIED BY '\".$this->project->db_password.\"'\");\n $query->statement(\"GRANT ALL PRIVILEGES ON `\".$this->project->database.\"`.* TO '\".$this->project->db_username.\"'@'\".$this->project->db_host.\"'\");\n \n DB::disconnect('engine');\n return true;\n\n }else Flash::error(\"The database already exists\");\n }else Flash::error(\"The user from database already exists\");\n }", "function createDbUser($database,$user) {\n\t$dbh = mysql_connect($database['host'],$database['user'],$database['pwd']);\n\t\n\t$query = \"CREATE DATABASE \" . $user['dbusername'];\n\tif(mysql_query($query,$dbh)) {\n\t\techo \"Database user \" . $user['dbusername'] . \" created\\n\";\n } else {\n\t\techo \"Database not created: \" . mysql_error() . \"\\n\";\n\t}\n\n\t$query = \"GRANT ALL on \" . $user['dbusername']. \".* TO '\" . $user['dbusername'] .\"'@'localhost' IDENTIFIED BY '\" . $user['pass'] . \"'\";\n\tif(mysql_query($query,$dbh)) {\n echo \"User \" . $user['dbusername'] . \" assigned to \" . $user['dbusername'] .\".\\n\";\n } else {\n echo \"User \" . $user['dbusername'] . \" not assigned: \" . mysql_error() . \"\\n\";\n }\n}", "function notes_create_db($database_name) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recalculer pour chacun des mandataires les CA stylimmo
public function recalculer_les_ca_styl() { // On reccuperere tous les mandataires $mandataires = User::where('role','mandataire')->get(); $deb_annee = date("Y")."-01-01"; // pour chaque mandataire on calcul le ca styl et on le met à jour dans la table des mandataires foreach ($mandataires as $mandataire ) { // CA encaissé non partagé $compro_encaisse_partage_pas_n = Compromis::where([['user_id',$mandataire->id],['est_partage_agent',false],['demande_facture',2],['archive',false]])->get(); $ca_encaisse_partage_pas_n = 0; if($compro_encaisse_partage_pas_n != null){ foreach ($compro_encaisse_partage_pas_n as $compros_encaisse) { if($compros_encaisse->getFactureStylimmo()->a_voir = false && $compros_encaisse->getFactureStylimmo()->encaissee == 1 && $compros_encaisse->getFactureStylimmo()->date_encaissement->format("Y-m-d") >= $deb_annee){ $ca_encaisse_partage_pas_n += $compros_encaisse->getFactureStylimmo()->montant_ttc; // echo $mandataire->id == 12 ? "<br/>".$compros_encaisse->numero_mandat." np".$compros_encaisse->getFactureStylimmo()->montant_ttc : null ; } } } // CA encaissé partagé et porte affaire $compro_encaisse_porte_n = Compromis::where([['user_id',$mandataire->id],['est_partage_agent',true],['demande_facture',2],['archive',false]])->get(); $ca_encaisse_porte_n = 0; if($compro_encaisse_porte_n != null){ foreach ($compro_encaisse_porte_n as $compros_encaisse) { if($compros_encaisse->getFactureStylimmo()->a_voir = false && $compros_encaisse->getFactureStylimmo()->encaissee == 1 && $compros_encaisse->getFactureStylimmo()->date_encaissement->format("Y-m-d") >= $deb_annee){ $ca_encaisse_porte_n += $compros_encaisse->frais_agence * $compros_encaisse->pourcentage_agent/100; // echo $mandataire->id == 12 ? '<br/> pp '.$compros_encaisse->numero_mandat.'--'.$compros_encaisse->getFactureStylimmo()->montant_ttc * $compros_encaisse->pourcentage_agent/100: null ; } } } // CA encaissé partagé et ne porte pas affaire $compro_encaisse_porte_pas_n = Compromis::where([['agent_id',$mandataire->id],['est_partage_agent',true],['demande_facture',2],['archive',false]])->get(); $ca_encaisse_porte_pas_n = 0; if($compro_encaisse_porte_pas_n != null){ foreach ($compro_encaisse_porte_pas_n as $compros_encaisse) { if($compros_encaisse->getFactureStylimmo()->a_voir = false && $compros_encaisse->getFactureStylimmo()->encaissee == 1 && $compros_encaisse->getFactureStylimmo()->date_encaissement->format("Y-m-d") >= $deb_annee){ $ca_encaisse_porte_pas_n += $compros_encaisse->frais_agence * (100-$compros_encaisse->pourcentage_agent)/100; // echo $mandataire->id == 12 ? '<br/>ppp '.$compros_encaisse->numero_mandat.'--'.$compros_encaisse->getFactureStylimmo()->montant_ttc* (100-$compros_encaisse->pourcentage_agent)/100 : null ; } } } $ca_encaisse_N = round(($ca_encaisse_partage_pas_n+$ca_encaisse_porte_n+$ca_encaisse_porte_pas_n)/Tva::coefficient_tva(),2); $mandataire->chiffre_affaire_sty = $ca_encaisse_N ; $mandataire->update(); // $mandataire->id == 12 ? dd($ca_encaisse_N) : null; } return "OK"; }
[ "private function calcSWCSS() {\r\n $temp = 0;\r\n for ($i = 0; $i < count($this->clusters); $i++) {\r\n $temp = $temp + $this->clusters[$i]->getSumSqr();\r\n }\r\n $this->SWCSS = $temp;\r\n }", "function calCcs()\n{\n //global variable declaration\n global $ccs, $wtcs, $nc, $ccspps;\n\n //Calculating the ccs value for each line having a control structure component\n for ($i = 1; $i <= sizeof($ccs); $i++) {\n $ccs[$i] = ($wtcs[$i] * $nc[$i]) + $ccspps[$i];//Given formula for the calculation\n }\n}", "private function metragemCubicaCobrada() {\n\n $iConsumoCobrado = 0;\n foreach ($this->aLeiturasMensuradas as $iConsumo) {\n $iConsumoCobrado += $iConsumo;\n }\n\n $this->iMetragemCubicaCobrada = $iConsumoCobrado;\n }", "public function updateCalculations() {\n\n foreach( $this->sheet->contents->sheetData->row as $row ) {\n\n foreach ( $row->c as $col ) {\n\n if ( ! empty ($col->f ) ) {\n unset( $col->v );\n }\n }\n }\n }", "function transformacja()\n\t{\n\t\t\n\t\t for ($i=0; $i < $this->liczba_zadan_c; $i++)\n\t\t {\n\t\t\t$this->transformacja_c[$i] = round( $this->czestotliwosc_c[$i] * $this->NWW_c,0) ;\n\t\t }\n\t\t\t \n\t\t\t\n\t}", "function costs(){\n\t\t\tforeach ($this->_companies as $company){\n\t\t\t\t$company->setInterestTotal();\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['pr_fixed_cost']=$company->getPrFixedCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_hiring_costs']=$company->getHrHiringCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_training_costs']=$company->getHrTrainingCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_wages_costs']=$company->getHrWagesCost();\t\n\t\t\t\t// Los de distribución sacados de abajo porque se calculan completos (excepto los de distribución de stock) en la rutina $company->getPrDistribCost()\n\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\t\t\t\t}\n\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=$company->getPrDistribCost();\n\t\t\t\t//todo lo incluido en este foreach funciona debidamente\n\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){ \n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_var_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']+=$company->getPrVarCost($channel->getChannelNumber(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $product->getProductNumber());\n\t\t\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]+=$company->getPrRawMaterialsCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Sacado el cálculo fuera porque la rutina ya calcula el total.\n\t\t\t\t\t\t\t\t// $this->_costs[$company->getId()]['pr_distrib_costs']+=(($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//test\n\t\t\t\t\t\t\t\t// if ($company->getId()==168) {\n\t\t\t\t\t\t\t\t\t\t// echo(\"Costes distribución Test. Empresa: \" . $company->getId() . \", Canal: \" . $channel->getChannelNumber() . \", Región : \" . $region->getRegionNumber() . \", Producto: \" . $product->getProductNumber() . \", COSTE = \" . ($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())) . \"<br/>\");\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t//VERO: Costes de distribución de stocks\n\t\t\t\t\t\t\t\tforeach($this->_channels as $channelD){\n\t\t\t\t\t\t\t\t\tforeach ($this->_regions as $regionD){\n\t\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']+=$company->getStDistribCost($channel->getChannelNumber(), $channelD->getChannelNumber(), $region->getRegionNumber(), $regionD->getRegionNumber(), $product->getProductNumber());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//VERO\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]+=$company->getMkSalesCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]+=$company->getMkFixedCost2($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber()); // getMkFixedCost does not have $product as argument!\n\t\t\t\t\t\t\t\t// AHG 20171122 Mode change can be done by providing or not $product as argument\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//Costes funcionan por canal, para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\tforeach ($this->_medias as $media){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]+=$company->getMkAdvertCost($media->getMediaNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\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\tforeach ($this->_trademedias as $trademedia){\n\t\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]+=$company->getMkTradeCost($trademedia['trademedia_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\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//Medias y TradeMedias funcionan para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\t//costes de las iniciativas selecionadas funcionando OK.\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_pr_costs']=$company->getInitiativesProductionCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_mk_costs']=$company->getInitiativesMarketingCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_hr_costs']=$company->getInitiativesHumanResourcesCost();\n\t\t\t\t\n\t\t\t\t//costes de los estudios de mercado solicitados funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['market_researches_costs']=$company->getMarketResearchesCosts();\n\t\t\t\t//costes de cambios de I+D+i funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_changes_costs']=$company->getIdiChangesCosts();\n\t\t\t\t//costes de I+D+i en lanzamiento de nuevos productos funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_new_costs']=$company->getIdiNewCosts();\n\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_st']=$company->getFiDebtCostsSt();\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_lt']=$company->getFiDebtCostsLt();\n\t\t\t\techo(\"<br>CORE (1) FIDEBTCOSTS: \".$company->getFiDebtCostsLt().\"<br>\");\n\t\t\t\t\n\t\t\t\t//Para que no haya ningun coste a NULL\n\t\t\t\tforeach ($this->_costs[$company->getId()] as $name=>$cost){\n\t\t\t\t\tif(!isset($cost)){\n\t\t\t\t\t\t$this->_costs[$company->getId()][$name]=0;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$this->save_costs();\n\t\t}", "function monta_corpo()\n {\n if (isset($this->array_total_participante))\n {\n foreach ($this->array_total_participante as $campo_participante => $dados_participante)\n {\n $val_grafico_participante = $dados_participante[5];\n $this->resumo_campos = $dados_participante;\n $this->monta_linha($dados_participante[5], 0, \"normal\", \"&participante=\" . urlencode($val_grafico_participante) . \"\");\n if (isset($this->array_total_pista[$campo_participante]))\n {\n foreach ($this->array_total_pista[$campo_participante] as $campo_pista => $dados_pista)\n {\n $val_grafico_pista = $dados_pista[5];\n $this->resumo_campos = $dados_pista;\n $this->monta_linha($dados_pista[5], 1, \"normal\", \"\");\n } // foreach pista\n } // isset pista\n } // foreach participante\n } // isset participante\n }", "function modificarClasificacionEspacioAcademico() {\n $this->crearArregloDatosEspacio();\n $resultadoPeriodo=$this->consultarPeriodoActivo();\n $ano=$resultadoPeriodo[0][0];\n $periodo=$resultadoPeriodo[0][1];\n\n $espacio=$this->buscarEspacio();\n if (is_array($espacio)&&$espacio[0][0]>0)\n {\n $this->modificarClasificacion();\n $this->modificarClasificacionPlanEspacio();\n if($this->datosEspacio['clasificacionTodos']==3||$this->datosEspacio['clasificacionTodos']==4)\n {\n $this->datosEspacio['electiva']='S';\n }\n else\n {\n $this->datosEspacio['electiva']='N';\n }\n $this->modificarClasificacionAcpen();\n\n if ($this->datosEspacio['clasificacionTodos']==4)\n {\n $this->datosEspacio['nivel']=0;\n $this->modificarNivelPlanEspacio();\n $this->modificarNivelAcpen();\n }\n elseif ($this->datosEspacio['clasificacionTodos']==5)\n {\n $this->datosEspacio['nivel']=98;\n $this->modificarNivelPlanEspacio();\n $this->modificarNivelAcpen();\n }\n }else\n {\n $this->errorConexion();\n }\n\n $planOriginal=$this->datosEspacio['planEstudio'];\n $resultado_proyectos=$this->consultarPlanesEspacio();\n foreach ($resultado_proyectos as $key => $value) {\n $this->datosEspacio['planEstudio']=$value['PLAN'];\n\n $datosRegistro=array(usuario=>$this->usuario,\n evento=>'19',\n descripcion=>'Modifica Clasificacion Espacio Asesor',\n registro=>$ano.'-'.$periodo.', '.$this->datosEspacio['codEspacio'].', 0, 0, '.$this->datosEspacio['planEstudio'],\n afectado=>$this->datosEspacio['planEstudio']);\n $this->procedimientos->registrarEvento($datosRegistro);\n }\n $this->datosEspacio['planEstudio']=$planOriginal;\n\n $this->datosEspacio['pagina']=\"adminAprobarEspacioPlan\";\n $this->datosEspacio['opcion']=\"mostrar\";\n unset ($this->datosEspacio['action']);\n echo \"<script>alert('La clasificaci\\u00F3n del Espacio Acad\\u00E9mico \".$this->datosEspacio['nombreEspacio'].\" se ha modificado')</script>\";\n $retorno=$this->generarRetorno($this->datosEspacio);\n $this->retornar($retorno);\n }", "private function _getMCNoSmontaggio()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n $tmp = $arredo->getMC();\n if ($arredo->getParametroB() == Arredo::MONTATO_PIENO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_PIENO);\n $mc+= $tmp;\n\n }\n\n if ($arredo->getParametroB() == Arredo::MONTATO_VUOTO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_VUOTO);\n $mc+= $tmp;\n\n }\n\n\n\n }\n\n return $mc;\n }", "function modificarDatosEspacioAcademico() {\n $cadena_sql=$this->sql->cadena_sql($this->configuracion,\"actualizar_espacioAcademico\",$this->datosEspacio);\n $resultado_espacioAcad=$this->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql,\"\" );\n return $this->totalAfectados($this->configuracion, $this->accesoGestion);\n }", "public function total_du(){\n\n $compromis = $this;\n\n $total_ht = 0 ;\n $total_tva = 0 ;\n\n if($compromis->getHonoPorteur() != null){\n $total_ht += $compromis->getHonoPorteur()->montant_ht;\n $total_tva += $compromis->getHonoPorteur()->montant_ttc > 0 ? $compromis->getHonoPorteur()->montant_ht * Tva::tva() : 0 ;\n\n }else{\n $total_ht += $compromis->getFactureHonoProvi()['montant_ht'];\n $total_tva += $compromis->getFactureHonoProvi()['montant_tva'];\n }\n\n if($compromis->getHonoPartage() != null){\n $total_ht += $compromis->getHonoPartage()->montant_ht;\n $total_tva += $compromis->getHonoPartage()->montant_ttc > 0 ? $compromis->getHonoPartage()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureHonoPartageProvi()['montant_ht'];\n $total_tva += $compromis->getFactureHonoPartageProvi()['montant_tva'];\n }\n\n if($compromis->getFactureParrainPorteur() != null){\n\n $total_ht += $compromis->getFactureParrainPorteur()->montant_ht;\n $total_tva += $compromis->getFactureParrainPorteur()->montant_ttc > 0 ? $compromis->getFactureParrainPorteur()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureParrainPorteurProvi()['montant_ht'];\n $total_tva += $compromis->getFactureParrainPorteurProvi()['montant_tva'];\n }\n\n if($compromis->getFactureParrainPartage() != null){\n $total_ht += $compromis->getFactureParrainPartage()->montant_ht;\n $total_tva += $compromis->getFactureParrainPartage()->montant_ttc > 0 ? $compromis->getFactureParrainPartage()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureParrainPartageProvi()['montant_ht'];\n $total_tva += $compromis->getFactureParrainPartageProvi()['montant_tva'];\n }\n\n\n return array(\"total_ht\"=> $total_ht, \"total_tva\"=> $total_tva) ;\n}", "function centrocampo($casa, $trasferta){\r\n $Casa = $casa['pti'];\r\n $Fuori = $trasferta['pti']+5*($casa['gioc']-$trasferta['gioc']);\r\n $delta = abs($Casa -$Fuori);\r\n if($delta<2){\r\n $mod['casa']=0;\r\n $mod['fuori']=0;\r\n return $mod; }\r\n $pti=(int)($delta/2);\r\n if($pti>4)\r\n $pti=4;\r\n $mod['casa']=abs($Casa-$Fuori)/($Casa-$Fuori)*$pti;\r\n $mod['fuori']=-abs($Casa-$Fuori)/($Casa-$Fuori)*$pti;\r\n return $mod;\r\n}", "public function recalcular() {\n if ($this->status->status !== 'Fechada') {\n // Se tiver co recalculo ativado ele apaga todos os itens e processa\n if (($this->recalculo === 'sim')) {\n $this->deleteAllItens();\n } else {\n // $this->deleteAllItensCusto();\n }\n $this->processarItens($this->recalculo);\n } \n }", "function recalcDesconto(){\r\n\t\t$cupom = $this->getCupom();\r\n\t\t# ou pela data\r\n\t\t#XXX(F|P|B)XXX()\r\n\t\t$desconto = \"\";\r\n\t\tswitch($cupom){\r\n\t\t\tcase 'FR': #frete\r\n\t\t\t\t$desconto = $this->getFrete();\r\n\t\t\tbreak;\r\n\t\t\tcase 'PE': #percent\r\n\t\t\t\t$percent=0.1;\r\n\t\t\t\t$desconto = number_format($this->getSubTotal() * $percent);\r\n\t\t\tbreak;\r\n\t\t\tcase 'BR': #vlr bruto\r\n\t\t\t\t$valor=50;\r\n\t\t\t\t$desconto = $valor;\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$desconto = \"\";\r\n\r\n\t\t}\r\n\t\t$_SESSION['desconto']=$desconto;\r\n\t\t#return true;\r\n\t}", "private function preparaCadena()\n {\n $filtro = array();\n $filtro[] = \"\";\n $filtro[] = \"EL\";\n $filtro[] = \"EN\";\n $filtro[] = \"LA\";\n $filtro[] = \"LOS\";\n $filtro[] = \"LAS\";\n $filtro[] = \"DE\";\n $filtro[] = \"DEL\";\n $filtro[] = \"UN\";\n $filtro[] = \"UNA\";\n $filtro[] = \"UN0\";\n $filtro[] = \"UNOS\";\n $filtro[] = \"UNAS\";\n $filtro[] = \"DR\";\n $filtro[] = \"DR.\";\n $filtro[] = \"DRA\";\n $filtro[] = \"DRA.\";\n $filtro[] = \"MTRO\";\n $filtro[] = \"MTRO.\";\n $filtro[] = \"MTRA\";\n $filtro[] = \"MTRA.\";\n $filtro[] = \"ING\";\n $filtro[] = \"ING.\";\n $filtro[] = \"LIC\";\n $filtro[] = \"LIC.\";\n $filtro[] = \"_\";\n $filtro[] = \"-\";\n\n $aux_arr_cad = explode(\" \", $this->cadena);\n $arr_cad = array();\n\n //FILTRO\n foreach ($aux_arr_cad as $palabra) {\n if ( !in_array(strtoupper(trim($palabra)), $filtro)) {\n $arr_cad[] = $palabra;\n }\n }\n\n\n if (!empty($arr_cad)) {\n $this->palabras = $arr_cad;\n }\n\n // dump($this->palabras); exit();\n }", "public function calcula13o()\n {\n }", "function setFidiCM(){\n\t\t$db=$this->db;\n\t\t$sql=\"UPDATE oneri.c_monetario SET fideiussione=(SELECT totale-coalesce(versato,0) from oneri.rate where pratica=$this->pratica and rata=6) WHERE pratica=$this->pratica;\";\n\t\t//echo $sql; \n\t\t$db->sql_query($sql);\n\t}", "public function recalculateParameters(): void\n {\n $this->a_ = $this->pa_->getY() - $this->pb_->getY();\n $this->b_ = $this->pb_->getX() - $this->pa_->getX();\n $this->c_ = $this->pa_->getX() * $this->pb_->getY() - $this->pb_->getX() * $this->pa_->getY();\n if ($this->a_ < 0) {\n $this->a_ *= (-1);\n $this->b_ *= (-1);\n $this->c_ *= (-1);\n } elseif (($this->b_ < 0) and ($this->a_ == 0)) {\n $this->b_ *= (-1);\n $this->c_ *= (-1);\n }\n }", "public static function changeShiftsTotalLateFlagsCountYear($company_id, $rok){\n date_default_timezone_set('Europe/Prague');\n $smeny_late_flagy = DB::table('shift_info_dimension')\n ->selectRaw('COUNT(employee_late_flag) as count_employee_late_flags')\n ->join('shift_facts','shift_info_dimension.shift_info_id','=','shift_facts.shift_info_id')\n ->where(['shift_facts.company_id' => $company_id])\n ->where(['shift_facts.employee_late_flag' => 1])\n ->whereYear('shift_info_dimension.shift_start', $rok)\n ->groupByRaw('MONTH(shift_info_dimension.shift_start)')\n ->get();\n $mesice_smeny_zpozdeni = DB::table('shift_info_dimension')\n ->selectRaw('MONTH(shift_info_dimension.shift_start) as month_shifts_late')\n ->join('shift_facts','shift_info_dimension.shift_info_id','=','shift_facts.shift_info_id')\n ->where('shift_facts.company_id', $company_id)\n ->where(['shift_facts.employee_late_flag' => 1])\n ->whereYear('shift_info_dimension.shift_start', $rok)\n ->groupByRaw('MONTH(shift_info_dimension.shift_start)')\n ->get();\n $statistikaSmen = array(0,0,0,0,0,0,0,0,0,0,0,0);\n for ($i = 0; $i < sizeof($mesice_smeny_zpozdeni); $i++){\n $statistikaSmen[$mesice_smeny_zpozdeni[$i]->month_shifts_late - 1] = $smeny_late_flagy[$i]->count_employee_late_flags;\n }\n return $statistikaSmen;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grab the WDS_CMB2_Date_Range_Field object and return it. Wrapper for WDS_CMB2_Date_Range_Field::get_instance()
function wds_cmb2_date_range_field() { return WDS_CMB2_Date_Range_Field::get_instance(); }
[ "public function render_date_range_field( $field ) {\n\n\t\t$field = wp_parse_args( $field, array(\n\t\t\t'id' => '',\n\t\t\t'title' => __( 'Date Range', 'woocommerce-memberships' ),\n\t\t\t'desc' => '',\n\t\t\t'desc_tip' => '',\n\t\t\t'type' => 'wc-memberships-date-range',\n\t\t\t'class' => '',\n\t\t\t'css' => '',\n\t\t) );\n\n\t\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t<label for=\"\"><?php echo esc_html( $field['title'] ); ?></label>\n\t\t\t</th>\n\t\t\t<td class=\"forminp forminp-<?php echo sanitize_html_class( $field['type'] ) ?>\">\n\t\t\t\t<span class=\"label\">\n\t\t\t\t\t<?php esc_html_e( 'From:', 'woocommerce-memberships' ); ?>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"<?php echo esc_attr( $field['id'] ) . '_from'; ?>\"\n\t\t\t\t\t\tid=\"<?php echo esc_attr( $field['id'] ) . '_from'; ?>\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $field['css'] ); ?>\"\n\t\t\t\t\t\tvalue=\"\"\n\t\t\t\t\t\tclass=\"<?php echo esc_attr( $field['class'] ); ?>\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t&nbsp;&nbsp;\n\t\t\t\t<span class=\"label\">\n\t\t\t\t\t<?php esc_html_e( 'To:', 'woocommerce-memberships' ); ?>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"<?php echo esc_attr( $field['id'] . '_to' ); ?>\"\n\t\t\t\t\t\tid=\"<?php echo esc_attr( $field['id'] . '_to' ); ?>\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $field['css'] ); ?>\"\n\t\t\t\t\t\tvalue=\"\"\n\t\t\t\t\t\tclass=\"<?php echo esc_attr( $field['class'] ); ?>\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t<br><span class=\"description\"><?php echo $field['desc']; ?></span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\t}", "protected function getSonata_Core_Form_Type_DatetimeRangePickerService()\n {\n return $this->services['sonata.core.form.type.datetime_range_picker'] = new \\Sonata\\CoreBundle\\Form\\Type\\DateTimeRangePickerType(${($_ = isset($this->services['translator']) ? $this->services['translator'] : $this->get('translator')) && false ?: '_'});\n }", "protected function getSonata_Core_Form_Type_DatetimeRangeService()\n {\n return $this->services['sonata.core.form.type.datetime_range'] = new \\Sonata\\CoreBundle\\Form\\Type\\DateTimeRangeType($this->get('translator'));\n }", "protected function getSonata_Core_Form_Type_DateRangeService()\n {\n return $this->services['sonata.core.form.type.date_range'] = new \\Sonata\\CoreBundle\\Form\\Type\\DateRangeType($this->get('translator'));\n }", "protected function getOroFilter_Form_Type_DatetimeRangeService()\n {\n return $this->services['oro_filter.form.type.datetime_range'] = new \\Oro\\Bundle\\FilterBundle\\Form\\Type\\DateTimeRangeType($this->get('oro_locale.settings'));\n }", "protected function getSonata_Core_Form_Type_DateRangeService()\n {\n return $this->services['sonata.core.form.type.date_range'] = new \\Sonata\\CoreBundle\\Form\\Type\\DateRangeType(${($_ = isset($this->services['translator']) ? $this->services['translator'] : $this->get('translator')) && false ?: '_'});\n }", "protected function _getDateRange()\n {\n if (is_null($this->_dateRange)) {\n $this->_dateRange = array();\n $rules = $this->getAttributeObject()->getValidateRules();\n if (isset($rules[self::MIN_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MIN_DATE_RANGE_KEY] = $rules[self::MIN_DATE_RANGE_KEY];\n }\n if (isset($rules[self::MAX_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MAX_DATE_RANGE_KEY] = $rules[self::MAX_DATE_RANGE_KEY];\n }\n }\n return $this->_dateRange;\n }", "private function _getDateRange(): \\Google_Service_AnalyticsReporting_DateRange\n {\n $dateRange = new \\Google_Service_AnalyticsReporting_DateRange();\n $dateRange->setStartDate($this->startDate);\n $dateRange->setEndDate($this->endDate);\n return $dateRange;\n }", "private function date_field() {\n\t\t$picker = null;\n\n\t\t// Get date picker specific to the duration unit for this product\n\t\tswitch ( $this->product->get_duration_unit() ) {\n\t\t\tcase 'month' :\n\t\t\t\tinclude_once( 'class-wc-booking-form-month-picker.php' );\n\t\t\t\t$picker = new WC_Booking_Form_Month_Picker( $this );\n\t\t\t\tbreak;\n\t\t\tcase 'day' :\n\t\t\tcase 'night' :\n\t\t\t\tinclude_once( 'class-wc-booking-form-date-picker.php' );\n\t\t\t\t$picker = new WC_Booking_Form_Date_Picker( $this );\n\t\t\t\tbreak;\n\t\t\tcase 'minute' :\n\t\t\tcase 'hour' :\n\t\t\t\tinclude_once( 'class-wc-booking-form-datetime-picker.php' );\n\t\t\t\t$picker = new WC_Booking_Form_Datetime_Picker( $this );\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! is_null( $picker ) ) {\n\t\t\t$this->add_field( $picker->get_args() );\n\t\t}\n\t}", "protected function getSonata_Core_Form_Type_DateRangeService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\FormTypeInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\AbstractType.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src\\\\Form\\\\Type\\\\DateRangeType.php';\n\n return $this->services['sonata.core.form.type.date_range'] = new \\Sonata\\Form\\Type\\DateRangeType(($this->services['translator'] ?? $this->getTranslatorService()));\n }", "protected function getSonata_Admin_Form_Filter_Type_DatetimeRangeService()\n {\n return $this->services['sonata.admin.form.filter.type.datetime_range'] = new \\Sonata\\AdminBundle\\Form\\Type\\Filter\\DateTimeRangeType($this->get('translator'));\n }", "public function getDateRangeType()\n {\n return $this->dateRangeType;\n }", "protected function getSonata_Core_Form_Type_DateRangeLegacyService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\FormTypeInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\AbstractType.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src\\\\Form\\\\Type\\\\DateRangeType.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\sonata-project\\\\core-bundle\\\\src\\\\CoreBundle\\\\Form\\\\Type\\\\DateRangeType.php';\n\n return $this->services['sonata.core.form.type.date_range_legacy'] = new \\Sonata\\CoreBundle\\Form\\Type\\DateRangeType(($this->services['translator'] ?? $this->getTranslatorService()));\n }", "function dbDateRange($min_field, $max_field) {\n\t\n\t\t$sql = \"SELECT ( UNIX_TIMESTAMP( MIN(DATE($min_field)))) AS min_time, (UNIX_TIMESTAMP(MAX(DATE($max_field)))) AS max_time FROM \" . $this->getTableName('results');\n $Result = mysql_query( $sql );\n while ($row = mysql_fetch_object($Result)) {\n\t\t\treturn($row);\n }\n\n\t\t//return($sql);\n\t\n\t}", "protected function getClaroline_Form_DaterangeService()\n {\n return $this->services['claroline.form.daterange'] = new \\Claroline\\CoreBundle\\Form\\DateRangeType($this->get('translator.default'));\n }", "protected function getSonata_Admin_Orm_Filter_Type_DatetimeRangeService()\n {\n return new \\Sonata\\DoctrineORMAdminBundle\\Filter\\DateTimeRangeFilter();\n }", "public function getDateRange2($format = 'Y-m-d H:i:s')\n\t{\n\t\tif ($this->date_range2 === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->date_range2 === '0000-00-00 00:00:00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->date_range2);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->date_range2, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "function getDateField2() {\n return $this->getFieldValue('date_field_2');\n }", "private function _get_range()\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate range array (faux object)\n\t\t// --------------------------------------\n\n\t\t$range = array(\n\t\t\t'start_date' => NULL,\n\t\t\t'start_time' => NULL,\n\t\t\t'end_date' => NULL,\n\t\t\t'end_time' => NULL\n\t\t);\n\n\t\t// --------------------------------------\n\t\t// Passed, Active and Upcoming\n\t\t// --------------------------------------\n\n\t\tforeach (array('passed', 'active', 'upcoming') AS $key)\n\t\t{\n\t\t\t$range[$key] = ! ($this->_get_param('show_'.$key) == 'no');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Get field IDs from param\n\t\t// --------------------------------------\n\n\t\t$range['fields'] = $this->_get_event_field_ids();\n\n\t\t// --------------------------------------\n\t\t// Site IDs\n\t\t// --------------------------------------\n\n\t\t$range['site_id'] = implode('|', ee()->TMPL->site_ids);\n\n\t\t// Return it\n\t\treturn $range;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test we can insert a new record.
public function test_insert_record() { global $CFG; $this->resetAfterTest(); $manager = new records_manager(); $this->assertCount(0, $manager->get_all()); $record1 = new record((object)[ 'id' => 'test1', 'enabled' => false, 'type' => 'test 1', ]); $manager->save($record1); $this->assertCount(1, $manager->get_all()); $record2 = new record((object)[ 'id' => 'test2', 'enabled' => true, 'type' => 'test 2', 'settings' => [], ]); $manager->save($record2); $this->assertCount(2, $manager->get_all()); $this->assertEquals([ 'test1' => (object) [ 'id' => 'test1', 'name' => '', 'enabled' => false, 'type' => 'test 1', 'trackadmin' => 0, 'cleanurl' => 0, 'settings' => [], ], 'test2' => (object) [ 'id' => 'test2', 'name' => '', 'enabled' => true, 'type' => 'test 2', 'trackadmin' => 0, 'cleanurl' => 0, 'settings' => [], ] ], unserialize($CFG->tool_webanalytics_records)); }
[ "public function testInsertExistingPokemon()\n {\n $inserted = $this->insertData();\n $this->assertTrue($inserted);\n\n $inserted = $this->insertData();\n $this->assertFalse($inserted);\n }", "public function testDatabaseInsert()\n {\n $this->assertTrue($this->offer->save());\n }", "public function insertRecord()\n {\n }", "public function validateInsert() {}", "protected function validateInsert()\n\t{\n\t\treturn true;\n\t}", "public function testIsNewRecordA()\n {\n $unitTest = UnitTest::find(1);\n $this->assertFalse($unitTest->isNewRecord());\n }", "public function testRecordExists() {\n\t\t$data = $this->getData();\n\n\t\t$this->dataStore->create($data);\n\t\t$this->assertTrue($this->dataStore->recordExists($data->key));\n\t}", "public function testInsertValidTag() {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t//create a new Tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAGID);\n\t\t$tag->insert($this->getPDO());\n\n\t\t//grab data from mySQL and enforce firleds to match expectations\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGID);\n\t}", "public function testNewRecord(): void\n {\n $this->__createRecords(5);\n $this->News->addBehavior('CkTools.Sortable', [\n 'sortField' => 'sorting',\n 'defaultOrder' => ['sorting ASC'],\n ]);\n $entity = $this->News->newEntity([\n 'name' => 'New Entry',\n 'field1' => 'scope1',\n ]);\n $this->News->save($entity);\n\n $savedEntity = $this->News->get($entity->id);\n $this->assertEquals(6, $savedEntity->sorting);\n\n $entity = $this->News->newEntity([\n 'name' => 'New Entry',\n 'field1' => 'scope1',\n ]);\n $this->News->save($entity);\n\n $savedEntity = $this->News->get($entity->id);\n $this->assertEquals(7, $savedEntity->sorting);\n }", "public function testInsert()\n {\n // Prepare a video and insert it into the database\n $video = $this->createDummyVideo();\n $id = $video->insert();\n\n // Ensure that the insert was successful\n $this->assertNotEquals(false, $id);\n // Verify that the model updated the instance ID.\n $this->assertEquals($id, $video->getId());\n\n // Fetch the video from the database\n $fetchedVideo = Video::getById($id);\n\n // Verify that at least one field matches as it should, NOT NULL\n // constraints should be enough to verify that the other fields at least\n // holds a value.\n $this->assertInstanceOf(Video::class, $fetchedVideo);\n $this->assertEquals($video->getVideoPath(), $fetchedVideo->getVideoPath());\n }", "public function testInsertData() {\n\n /**\n * Test with empty array\n */\n $asFeedData = array();\n $id = $this->obModel->insertData($asFeedData);\n\n $this->assertFalse($id);\n\n /**\n * Test with valid data\n */\n $asFeedData = array('id_vehicle' => 13, 'maintenance_name' => 'tire_rotation', 'cost' => 1000, 'description' => 'Tire Rotation');\n $id = $this->obModel->insertData($asFeedData);\n $this->assertTrue(is_integer($id));\n }", "public function testInsertValidFriend(): void {\n\n\t\t// Count the number of rows, and save it for later.\n\t\t$numRows = $this->getConnection()->getRowCount(\"friend\");\n\n\t\t// Create new Friend, and insert it into mySQL.\n\t\t$friend = new Friend($this->profileOne->getProfileId(), $this->profileTwo->getProfileId());\n\t\t$friend->insert($this->getPDO());\n\n\t\t// Grab the data from mySQL and be sure the fields match our expectations.\n\t\t$pdoFriend = Friend::getFriendByFriendFirstProfileIdAndFriendSecondProfileId($this->getPDO(), $friend->getFriendFirstProfileId(), $friend->getFriendSecondProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"friend\"));\n\t\t$this->assertEquals($pdoFriend->getFriendFirstProfileId(), $friend->getFriendFirstProfileId());\n\t\t$this->assertEquals($pdoFriend->getFriendSecondProfileId(), $friend->getFriendSecondProfileId());\n\t}", "public function testInsert()\n\t{\t\t\n\t\t$resource = $this->buildResource();\n\t\t$this->em->persist($resource);\n\t\t$this->em->flush();\n\n\t\t$resource = $this->em->find('Auth\\Entity\\Resource', $resource->getId());\n\t\t\n\t\t/**\n\t\t * Verificando se salvou o registro no banco\n\t\t */\t\t\n\t\t$this->assertEquals('Application\\Entity\\Index.index', $resource->getNome());\n\t\t$this->assertEquals(1, $resource->getId());\t\t\n\t}", "public function testInsertRecord() { \n $stmt = $this->pdo->prepare('DELETE FROM categories WHERE name = \"Test Insertion\";');\n $stmt->execute();\n\n // Prepare SQL statment for checking whether a record exists in the database.\n $stmt = $this->pdo->prepare('SELECT name FROM categories WHERE name = \"Test Insertion\";');\n \n // Execute the SQL statement and fetch results from execution.\n $stmt->execute();\n $results = $stmt->fetchAll();\n\n // Check if any results were returned.\n $this->assertEmpty($results);\n\n // Define values to be inserted.\n $values = [\n 'category_id' => 100,\n 'name' => 'Test Insertion'\n ];\n\n // Insert record into database.\n $this->categoriesTable->insertRecord($values);\n\n // Execute the SQL statement and fetch results from execution.\n $stmt->execute();\n $results = $stmt->fetchAll();\n\n // Check if any results were returned.\n $this->assertNotEmpty($results);\n }", "public final function testInsertValidTag() : void {\n\t\t// counts the number of rows and saves it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\t\t$tagId = generateUuidV4();\n\t\t$tag = new Tag($tagId, $this->VALID_TAGNAME);\n\t\t$tag->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our experience\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(),$tag->getTagId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagId(), $tagId);\n\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGNAME);\n\t}", "public function testInsertExisting()\r\n\t{\r\n\t\t// Load schema\r\n\t\t$schema = Schema::model()->findByPk('schematest2');\r\n\r\n\t\t// Call insert instead of update -> Exception should be thrown.\r\n\t\t$schema->insert();\r\n\t}", "public function testInsert()\n\t{\n\t\t$juridica = $this->buildJuridica();\n\t\t$this->em->persist($juridica);\n\t\t$this->em->flush();\n\n\n\t\t$this->assertNotNull($juridica->getId());\n\t\t$this->assertEquals(1, $juridica->getId());\n\n\t\t/**\n\t\t * Buscando no banco de dados a pessoa juridica que foi cadastrada\n\t\t */\n\t\t$savedPessoaJuridica = $this->em->find(get_class($juridica), $juridica->getId());\n\n\t\t$this->assertInstanceOf(get_class($juridica), $savedPessoaJuridica);\n\t\t$this->assertEquals($juridica->getId(), $savedPessoaJuridica->getId());\n\t}", "public function testStore_Insert()\n {\n \t$id1 = $this->conn->store('test', array(null, 'new1', 'new row ONE', 'NEW'));\n \t$id2 = $this->conn->store('test', array('key'=>'new2', 'title'=>'new row TWO'));\n \t\n \t$result = $this->conn->query('SELECT * FROM test where status=\"NEW\"');\n \t$this->assertEquals(array($id1, 'new1', 'new row ONE', 'NEW'), $result->fetchOrdered());\n \t$this->assertEquals(array($id2, 'new2', 'new row TWO', 'NEW'), $result->fetchOrdered());\n\t}", "public function validateInsert(){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for manage dose
public function manageDose() { $result = DB::table('tbl_p_dose')->where('branch_id',$this->branch_id)->where('status',0)->get(); return view('dose.manageDose')->with('result',$result); }
[ "function deleteDepositdetails()\n {\n global $db;\n $requete = $db->prepare('DELETE FROM deposit_details WHERE idDd = ?');\n $requete->execute(array($this->idDd));\n }", "function updateDoseAdjustments($doseAdjustments, $name, $dbhandle, $user) \n{\n $status = TRUE;\n foreach ($doseAdjustments AS $adjustment) {\n if (isset($adjustment['delete']) && $adjustment['delete'] == TRUE) {\n $sql = \"DELETE FROM dose_adjusts WHERE problem = ?\";\n $updateStmt = $dbhandle->prepare($sql);\n $status = $status && $updateStmt->execute(array($adjustment['orig_name']));\n } else if (isset($adjustment['orig_name']) && !empty($adjustment['orig_name'])) {\n if (isset($adjustment['chart_url']) && !empty($adjustment['chart_url'])) {\n $sql = \"UPDATE dose_adjusts SET problem = ?, note = ?, who_updated = ? WHERE drug = ? AND problem = ?\";\n $updateStmt = $dbhandle->prepare($sql);\n $status = $status && $updateStmt->execute(array($adjustment['problem'], $adjustment['note'], $user, $name, $adjustment['orig_name']));\n } else {\n $chart_value = \"\";\n if (isset($adjustment['chart']) && !empty($adjustment['chart'])) {\n // Upload New Chart\n $chart = $adjustment[\"chart\"];\n\n $type = explode(\"/\", $adjustment[\"chart_type\"]);\n $type = end($type);\n\n if (substr($chart,0,5) != \"api/d\") {\n $parts = explode(\".\", $chart);\n $chart_value = \"api/doseAdjustCharts/\".$name.\"_\"\n .$adjustment[\"problem\"].\".\"\n .$type;\n $destination = \"/var/www/web/\" . $chart_value;\n move_uploaded_file($chart, $destination);\n //unlink($adjustment['orig_chart']); // Delete Original Chart (stop name collisions)\n }\n }\n $sql = \"UPDATE dose_adjusts SET problem = ?, note = ?, chart = ?, who_updated = ? WHERE drug = ? AND problem = ?\";\n $updateStmt = $dbhandle->prepare($sql);\n $status = $status && $updateStmt->execute(array($adjustment['problem'], $adjustment['note'], $chart_value, $user, $name, $adjustment['orig_name']));\n }\n } else {\n if (isset($adjustment['chart']) && !empty($adjustment['chart'])) {\n $chart = $adjustment[\"chart\"];\n\n $type = explode(\"/\", $adjustment[\"chart_type\"]);\n $type = end($type);\n\n if (substr($chart,0,5) != \"api/d\") {\n $parts = explode(\".\", $chart);\n $chart_value = \"api/doseAdjustCharts/\".$name.\"_\"\n .$adjustment[\"problem\"].\".\"\n .$type;\n $destination = \"/var/www/web/\" . $chart_value;\n move_uploaded_file($chart, $destination);\n }\n $sql = \"INSERT INTO dose_adjusts (drug, problem, note, chart, who_updated) VALUES (?,?,?,?,?)\";\n $updateStmt = $dbhandle->prepare($sql);\n $status = $status && $updateStmt->execute(array($name, $adjustment['problem'], $adjustment['note'], $chart_value, $user));\n } else {\n $sql = \"INSERT INTO dose_adjusts (drug, problem, note, chart, who_updated) VALUES (?,?,?,?,?)\";\n $updateStmt = $dbhandle->prepare($sql);\n $status = $status && $updateStmt->execute(array($name, $adjustment['problem'], $adjustment['note'], \"\", $user));\n }\n }\n }\n \n return $status;\n}", "function mass_donate()\n \t{\n\n\t\tif ( !$this->ipsclass->member['g_tools_pts'] )\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_no_tools_pts'));\n\t\t}\n\n\t\t$this->ipsclass->input['points'] = str_replace( ',', '', $this->ipsclass->input['points'] );\n\t\t$this->ipsclass->input['points'] = str_replace( '-', '', intval($this->ipsclass->input['points']) );\n\t\t$pts = intval($this->ipsclass->input['points']);\n\t\n\t\t$this->ipsclass->DB->build_query( array( 'update' => 'members', 'set' => \"points=points+\".$pts ) );\n\t\t$this->ipsclass->DB->exec_query();\n\n\t\t$s = intval($this->ipsclass->input['status']);\n\n\t\t$this->ipsclass->boink_it( $this->ipsclass->base_url.\"autocom=points&amp;cmd=tools&amp;s=\".$s );\n\n \t}", "function doseForDate ( $doseplanid, $date ) {\n\t\t$plan = freemed::get_link_rec( $doseplanid, $this->table_name );\n\t\tif ($plan['doseplantype'] == 'regular-methadone') {\n\t\t\t// No dose if before start of plan\n\t\t\tif ( $this->dateToStamp( $date ) < $this->dateToStamp( $plan['doseplanstartdate'] ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Handle regular and split dosing\n\t\t\tif ($plan['doseplansplit']) {\n\t\t\t\t// If there has been a dose given today, doseplansplit2, else doseplansplit1\n\t\t\t\t$c = $GLOBALS['sql']->fetch_array($GLOBALS['sql']->query(\"SELECT COUNT(*) AS my_count FROM doserecord WHERE doseassigneddate='\".addslashes($date).\"' AND dosegiven=1 AND doseplanid='\".addslashes($doseplanid).\"'\"));\n\t\t\t\tif ($c['my_count'] == 1) {\n\t\t\t\t\treturn $plan['doseplansplit2'];\n\t\t\t\t} else {\n\t\t\t\t\treturn $plan['doseplansplit1'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Plain old, plain old\n\t\t\t\treturn $plan['doseplandose'];\n\t\t\t}\n\t\t}\n\t\tif ($plan['doseplantype'] != 'incremental-methadone' && $plan['doseplanstartdate'] == $date && !$plan['doseplansplit']) {\n\t\t\treturn $plan['doseplandose'];\n\t\t}\t\n\t\t$doses = explode( ',', $plan['doseplanincrementationschedule'] );\n\t\t// Avoid divide by 0, give initial date.\n\t\tif ( $date == $plan['doseplanstartdate'] ) {\n\t\t\treturn $doses[0];\n\t\t}\n\n\t\t// Magic\n\t\t$days = ceil( ( $this->dateToStamp( $date ) - $this->dateToStamp( $plan['doseplanstartdate'] ) ) / (60 * 60 * 24) );\n\t\treturn ( $days < 1 or $days >= count( $doses ) ) ? 0 : $doses[$days];\n\t}", "public function addDoors()\n {\n }", "public function need_dse_pgreport()\n\t{\n\t\t $this->load->library('session');\n $emis_loggedin = $this->session->userdata('emis_loggedin');\n\t\t\tif($emis_loggedin) \n\t\t\t{\n\t\t\t\t$dist_id =$this->session->userdata('emis_district_id');\n\t\t\t\t$data['need_dsereport'] = $this->Collector_model->need_dsereport($dist_id);\n\t\t\t\t$this->load->view('Collector/emis_need_dse_pg',$data); \n\t\t\t}\n\t}", "public function maintain();", "public function di()\n {\n }", "function modification_droits(){\n\n//changer les capabilities du role administrator que nous utilisons pour\n//avoir acces au CPT News\n$role_administrateur = get_role( 'administrator' );\n$capabilities_admin = array(\n 'edit_new',\n 'read_new',\n 'delete_new',\n 'edit_news',\n 'edit_others_news',\n 'read_others_news',\n 'publish_news',\n 'publish_pages_news',\n 'read_private_news',\n 'create_private_news',\n 'edit_published_news',\n 'delete_published_news',\n 'delete_others_news',\n 'edit_private_news',\n 'delete_private_news',\n);\n//on parcours le tableau de capabilities que nous avons fixé\n//et on ajoute avec add_cap chaque capability pour avoir la possibilité d'ajouter\n//dans CPT News un post\nforeach( $capabilities_admin as $capabilitie_admin ) {\n\t$role_administrateur->add_cap( $capabilitie_admin );\n}\n\n}", "protected function getDepiction()\n {\n }", "function ExibeDados(){\r\n\t\t\r\n\t\techo 'Codigo: ' . $this->Codigo .\"<br>\\n\";\r\n\t\techo 'Descricao: ' . $this->Descricao .\"<br>\\n\";\r\n\t\techo 'Preco: ' . $this->Preco .\"<br>\\n\";\r\n\t\techo 'Fornecedor: '. $this->Fornecedor->Nome .\"<br>\\n\";\r\n\t\t\r\n\t\t//atribui a um fornecedor ao produto \r\n\t\tfunction setFornecedor(Fornecedor $fornecedor){\r\n\t\t\t\r\n\t\t\t$this->Fornecedor = $fornecedor; //associação interna \r\n\t\t\t\r\n\t\t}\r\n\t}", "function updateDepositdetails()\n {\n global $db;\n $requete = $db->prepare('UPDATE deposit_details SET `designation`, `unit`, `amount`, `unitprice`, \n `totaluwt`, `percentage`, `equivalent` WHERE idDd = ?');\n $requete->execute(array(\n $this->designation,\n $this->unit,\n $this->amount,\n $this->unitprice,\n $this->totaluwt,\n $this->percentage,\n $this->idDd\n ));\n }", "protected function storeDisease()\n\t{\n\t\t$validate = Validator::make(Input::all(), array(\n\t\t\t\t'disease_name' => 'required|unique:diseases,name',\n\t\t\t));\n\n\t\tif($validate->fails())\n\t\t{\n\t\t\treturn Redirect::route('stones-home')->withErrors($validate)->with('modal', '#disease_form');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$disease = new Disease;\n\t\t\t$disease->name = Input::get('disease_name');\n\n\t\t\tif($disease->save())\n\t\t\t{\n\t\t\t\treturn Redirect::route('stones-home')->with('success', 'Disease gespeichert'); \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::route('stones-home')->with('fail', 'Error on save from Disease'); \n\t\t\t}\n\t\t}\n\t}", "function add_dj($dj_id, $dj_name, $user_id, $dj_desc, $dj_website){\n $dj_name = valid_f($dj_name, null, null, \"dj name\", false);\n $dj_desc = valid_f($dj_desc, null, 1000, \"dj description\", true);\n $dj_website = valid_f(website_f($dj_website), null, null, \"dj_website\", true);\n $cred = array_find($dj_id, get_session(\"dj_ids\"));\n \n $changed = false;\n $user_id = get_session(\"user_id\");\n //echo($dj_id.\"dj_id\\n\");\n if ($dj_id > 0 && $dj_name && warn($cred, \"NO CRED\")){\n $changed = feedback_op(query(\" UPDATE dj SET dj_name = '$dj_name', dj_website = '$dj_website', dj_desc = '$dj_desc' WHERE dj_id = $dj_id\", false),\n \"$dj_name updated\", \"$dj_name not updated\");\n echo(\"<br />$changed CHANGED<br />\");\n if ($changed) $changed = $dj_id;\n}\n \n elseif ($dj_name){ \n $changed = feedback_op(query(\"INSERT INTO dj (user_id, dj_name, dj_desc, dj_website) VALUES\n ($user_id,'$dj_name', '$dj_desc', '$dj_website')\", false),\n \"$dj_name added\", \"$dj_name not added\", false);\n $changed = last_id();\n }\n if ($changed) reload_user_info();\n if ($changed) header('Location: '.\"dj.php?dj_id=$dj_id\");\n return $changed;\n}", "public function test_get_site_dpos() {\n global $DB;\n\n $this->resetAfterTest();\n\n $generator = new testing_data_generator();\n $u1 = $generator->create_user();\n $u2 = $generator->create_user();\n\n $context = context_system::instance();\n\n // Give the manager role with the capability to manage data requests.\n $managerroleid = $DB->get_field('role', 'id', array('shortname' => 'manager'));\n assign_capability('tool/dataprivacy:managedatarequests', CAP_ALLOW, $managerroleid, $context->id, true);\n // Assign u1 as a manager.\n role_assign($managerroleid, $u1->id, $context->id);\n\n // Give the editing teacher role with the capability to manage data requests.\n $editingteacherroleid = $DB->get_field('role', 'id', array('shortname' => 'editingteacher'));\n assign_capability('tool/dataprivacy:managedatarequests', CAP_ALLOW, $editingteacherroleid, $context->id, true);\n // Assign u1 as an editing teacher as well.\n role_assign($editingteacherroleid, $u1->id, $context->id);\n // Assign u2 as an editing teacher.\n role_assign($editingteacherroleid, $u2->id, $context->id);\n\n // Only map the manager role to the DPO role.\n set_config('dporoles', $managerroleid, 'tool_dataprivacy');\n\n $dpos = api::get_site_dpos();\n $this->assertCount(1, $dpos);\n $dpo = reset($dpos);\n $this->assertEquals($u1->id, $dpo->id);\n }", "public function getDebtor();", "function add_desaparecido($params)\n {\n $this->db->insert('desaparecidos',$params);\n return $this->db->insert_id();\n }", "public function unitcosts_addemp( )\t \n\t {\n\t \tif ( Session::get('level') != '' )\n\t \t{ \n\t \t\t$unitcosts = DB::table('s_unit_costs')->get();\t \t\t\n\t\t return View::make( 'unitcosts.addemp', \n\t\t \tarray( \n\t\t \t\t'unitcosts' => $unitcosts\t\t \t\t \t\t\n\t\t \t) \n\t\t );\n\t \t}\n\t \telse\n\t \t{\n\t \t\t//return login\n\t \t\treturn View::make( 'login.index' );\t\n\t \t} \n\t }", "public function disease(){\n\t\tif (Input::all()) {\n\t\t\t$rules = array();\n\t\t\t$newDiseases = Input::get('new-diseases');\n\n\t\t\tif (Input::get('new-diseases')) {\n\t\t\t\t// create an array that form the rules array\n\t\t\t\tforeach ($newDiseases as $key => $value) {\n\t\t\t\t\t\n\t\t\t\t\t//Ensure no duplicate disease\n\t\t\t\t\t$rules['new-diseases.'.$key.'.disease'] = 'unique:diseases,name';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t\tif ($validator->fails()) {\n\t\t\t\treturn Redirect::route('reportconfig.disease')->withErrors($validator);\n\t\t\t} else {\n\n\t\t $allDiseaseIds = array();\n\t\t\t\t\n\t\t\t\t//edit or leave disease entries as is\n\t\t\t\tif (Input::get('diseases')) {\n\t\t\t\t\t$diseases = Input::get('diseases');\n\n\t\t\t\t\tforeach ($diseases as $id => $disease) {\n\t\t $allDiseaseIds[] = $id;\n\t\t\t\t\t\t$diseases = Disease::find($id);\n\t\t\t\t\t\t$diseases->name = $disease['disease'];\n\t\t\t\t\t\t$diseases->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//save new disease entries\n\t\t\t\tif (Input::get('new-diseases')) {\n\t\t\t\t\t$diseases = Input::get('new-diseases');\n\n\t\t\t\t\tforeach ($diseases as $id => $disease) {\n\t\t\t\t\t\t$diseases = new Disease;\n\t\t\t\t\t\t$diseases->name = $disease['disease'];\n\t\t\t\t\t\t$diseases->save();\n\t\t $allDiseaseIds[] = $diseases->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t //check if action is from a form submission\n\t\t if (Input::get('from-form')) {\n\t\t\t \t// Delete any pre-existing disease entries\n\t\t\t \t//that were not captured in any of the above save loops\n\t\t\t $allDiseases = Disease::all(array('id'));\n\n\t\t\t $deleteDiseases = array();\n\n\t\t\t //Identify disease entries to be deleted by Ids\n\t\t\t foreach ($allDiseases as $key => $value) {\n\t\t\t if (!in_array($value->id, $allDiseaseIds)) {\n\n\t\t\t\t\t\t\t//Allow delete if not in use\n\t\t\t\t\t\t\t$inUseByReports = Disease::find($value->id)->reportDiseases->toArray();\n\t\t\t\t\t\t\tif (empty($inUseByReports)) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t // The disease is not in use\n\t\t\t \t$deleteDiseases[] = $value->id;\n\t\t\t\t\t\t\t}\n\t\t\t }\n\t\t\t }\n\t\t\t //Delete disease entry if any\n\t\t\t if(count($deleteDiseases)>0){\n\n\t\t\t \tDisease::destroy($deleteDiseases);\n\t\t\t }\n\t\t }\n\t\t\t}\n\t\t}\n\t\t$diseases = Disease::all();\n\n\t\treturn View::make('reportconfig.disease')\n\t\t\t\t\t->with('diseases', $diseases);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation postV1ServicesAtg Create a new ATG agreement
public function postV1ServicesAtg($v1ServicesAtg) { list($response) = $this->postV1ServicesAtgWithHttpInfo($v1ServicesAtg); return $response; }
[ "protected function postV1ServicesAtgRequest($v1ServicesAtg)\n {\n // verify the required parameter 'v1ServicesAtg' is set\n if ($v1ServicesAtg === null || (is_array($v1ServicesAtg) && count($v1ServicesAtg) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $v1ServicesAtg when calling postV1ServicesAtg'\n );\n }\n\n $resourcePath = '/v1/services/atg';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($v1ServicesAtg)) {\n $_tempBody = $v1ServicesAtg;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function CreateBillingAgreement($request){\r\n return $this->sendRequest($request, \"CreateBillingAgreement\");\r\n }", "public function postV1ServicesAtgWithHttpInfo($v1ServicesAtg)\n {\n $returnType = '\\Vertaislaina\\Maventa\\AutoXChange\\Entity\\CompanyAgreementsAtg';\n $request = $this->postV1ServicesAtgRequest($v1ServicesAtg);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Vertaislaina\\Maventa\\AutoXChange\\Entity\\CompanyAgreementsAtg',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testCreateAgreement()\n {\n }", "public function Create()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$json = json_decode(RequestUtil::GetBody());\n\n\t\t\tif (!$json)\n\t\t\t{\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\n\t\t\t}\n\n\t\t\t$agendasgp = new AgendaSGP($this->Phreezer);\n\n\t\t\t// TODO: any fields that should not be inserted by the user should be commented out\n\r\n\t\t\t// this is an auto-increment. uncomment if updating is allowed\n\t\t\t// $agendasgp->Id = $this->SafeGetVal($json, 'id');\n\n\t\t\t$agendasgp->Data = date('Y-m-d H:i:s',strtotime($this->SafeGetVal($json, 'data')));\n\t\t\t$agendasgp->Horario = date('H:i:s',strtotime('1970-01-01 ' . $this->SafeGetVal($json, 'horario')));\n\t\t\t$agendasgp->Publico = $this->SafeGetVal($json, 'publico');\n\t\t\t$agendasgp->Evento = $this->SafeGetVal($json, 'evento');\n\t\t\t$agendasgp->Equipe = $this->SafeGetVal($json, 'equipe');\n\t\t\t$agendasgp->Local = $this->SafeGetVal($json, 'local');\n\n\t\t\t$agendasgp->Validate();\r\n\t\t\t$errors = $agendasgp->GetValidationErrors();\n\n\t\t\tif (count($errors) > 0)\r\n\t\t\t{\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$agendasgp->Save();\n\t\t\t\t$this->RenderJSON($agendasgp, $this->JSONPCallback(), true, $this->SimpleObjectParams());\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}", "public function getV1ServicesAtgWithHttpInfo()\n {\n $returnType = '\\Vertaislaina\\Maventa\\AutoXChange\\Entity\\CompanyAgreementsAtg[]';\n $request = $this->getV1ServicesAtgRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Vertaislaina\\Maventa\\AutoXChange\\Entity\\CompanyAgreementsAtg[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createAction(Request $request)\n {\n $entity = new Agreement();\n $form = $this->createCreateForm($entity);\n\n $em = $this->getDoctrine()->getManager();\n $value = $request->request->all();\n if (!empty($value['acilia_cmsbundle_agreement']['image']))\n {\n $value['acilia_cmsbundle_agreement']['image'] = $em->getRepository('AciliaCmsBundle:Image')->find($value['acilia_cmsbundle_agreement']['image']);\n $request->request->set('acilia_cmsbundle_agreement', $value['acilia_cmsbundle_agreement']);\n }\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n $entity->setSlug($entity->getSlug().'-'.$entity->getId());\n $em->flush();\n\n return $this->redirect($this->generateUrl('agreement_show', array('id' => $entity->getId())));\n }\n\n return $this->render('AciliaCmsBundle:Agreement:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function addBillingAgreement($args) {\n $pp = $this->getRecurringPaymentManager('paypal_billing_agreement');\n $pp->methodName = 'CreateBillingAgreement';\n $pp->requestHeaderArr['TOKEN'] = $args['token'];\n $ppResponse = $pp->PPHttpPost();\n $billingAgreementId = isset($ppResponse['billingagreementid']) ? $ppResponse['billingagreementid'] : (isset($ppResponse['BILLINGAGREEMENTID']) ? $ppResponse['BILLINGAGREEMENTID'] : false);\n $ack = strtolower($ppResponse['ACK']);\n if (($ack == 'success' || $ack == 'successwithwarning') && $billingAgreementId) {\n $em = $this->container->get('doctrine')->getEntityManager();\n $payment = new PaymentAccount();\n $payment->setAck('success');\n $payment->setPaymentType('paypal_billing_agreement');\n $params = $this->getBaseParams();\n $user = $params['user'];\n $this->setUserStatus($user, 'Pending');\n $payment->setLicense(isset($args['license']) ? $args['license'] : 'agency');\n\n $payment->setJson(json_encode($ppResponse));\n $payment->setProfileId($billingAgreementId);\n $payment->setTitle('PayPal');\n\n // Clean old payments here\n $dec = $params['user']->getDeclinedPaymentCount();\n $this->removePaymentAccounts($params['user']);\n $payment->setUser($params['user']);\n $em->persist($payment);\n if ($dec > 0) {\n error_log(\"====== Setting declined count to 1 because the prior payment was declined more\");\n $payment->setDeclinedCount(1);\n $em->flush();\n $em->persist($payment);\n }\n $em->flush();\n\n return $this->postPaymentCreation($payment);\n } else {\n error_log(\"==== Failed to get billing agreement from Paypal ====\");\n error_log(print_r($pp->requestHeaderArr, 1));\n error_log(print_r($ppResponse, 1));\n $this->paymentError(array(\n 'title' => $ppResponse['L_SHORTMESSAGE0'], 'message' => $ppResponse['L_LONGMESSAGE0'], 'code' => $ppResponse['L_ERRORCODE0'], 'type' => 'paypal account'\n ));\n return false;\n }\n }", "public function create()\n {\n // $config = Config::get('cashier-authorize');\n // Set the transaction's refId\n $refId = 'ref' . time();\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName($this->plan['name']);\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($this->plan['duration']);\n $interval->setUnit('days'); // To Do $this->plan['invoice_interval'\n\n $trialDays = $this->plan['trial_period'];\n $this->trialDays($trialDays);\n\n // Must use mountain time according to Authorize.net\n $nowInMountainTz = Carbon::now('America/Denver')->addDays($trialDays);\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime($nowInMountainTz));\n $paymentSchedule->setTotalOccurrences(9999); //TO DO make it variable\n $paymentSchedule->setTrialOccurrences(0); //TO DO make it variable\n\n // $amount = round(floatval($this->plan['price']) * floatval('1.'.$this->getTaxPercentageForPayload()), 2);\n $amount = round(floatval($this->plan['price']) + floatval($this->plan['price'] * $this->getTaxPercentageForPayload() / 100), 2);\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($amount);\n $subscription->setTrialAmount(0); //TO DO make it variable\n\n $profile = new AnetAPI\\CustomerProfileIdType();\n $profile->setCustomerProfileId($this->user->authorize_id);\n $profile->setCustomerPaymentProfileId($this->user->authorize_payment_id);\n $subscription->setProfile($profile);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(mt_rand(10000, 99999)); //generate random invoice number \n $order->setDescription($this->plan['description']); \n $subscription->setOrder($order);\n\n $requestor = new Requestor();\n $request = $requestor->prepare((new AnetAPI\\ARBCreateSubscriptionRequest()));\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse($requestor->env);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") ) {\n if ($this->skipTrial) {\n $trialEndsAt = null;\n } else {\n $trialEndsAt = $this->trialDays ? Carbon::now()->addDays($this->trialDays) : null;\n }\n return [\n 'name' => $this->name,\n 'authorize_id' => $response->getSubscriptionId(),\n 'authorize_plan' => $this->plan['name'],\n 'authorize_payment_id' => $this->user->authorize_payment_id,\n 'metadata' => json_encode([\n 'refId' => $requestor->refId\n ]),\n 'quantity' => $this->quantity,\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null,\n ];\n // return $this->user->subscriptions()->create([\n // 'name' => $this->name,\n // 'authorize_id' => $response->getSubscriptionId(),\n // 'authorize_plan' => $this->plan['name'],\n // 'authorize_payment_id' => $this->user->authorize_payment_id,\n // 'metadata' => json_encode([\n // 'refId' => $requestor->refId\n // ]),\n // 'quantity' => $this->quantity,\n // 'trial_ends_at' => $trialEndsAt,\n // 'ends_at' => null,\n // ]);\n } else {\n $errorMessages = $response->getMessages()->getMessage();\n throw new Exception(\"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText(), 1);\n }\n }", "public function createApprover();", "public function storeGp(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'date' => 'required',\n 'time' => 'required',\n 'gpServiceId' => 'required|exists:general_practitioner_services,id',\n ]);\n\n if($validator->fails()){\n return $this->failedResponse($validator->messages(), 422);\n }\n\n $gpService = GeneralPractitionerService::find($request->gpServiceId);\n $appointment = $gpService->appointment()->create([\n 'date' => date('d-m-Y',strtotime($request->date)),\n 'time' => date('h:i a',strtotime($request->time)),\n 'status' => 'NEW'\n ]);\n \n $gpService->serviceCenter->notify(new GPServiceRequest($appointment));\n \n\n return $this->successfulResponse(200, $appointment);\n }", "public static function addAgreement($form, $a_obj_id, $a_type)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$agreement = new ilCheckboxInputGUI($lng->txt($a_type.'_agree'),'agreement');\n\t\t$agreement->setRequired(true);\n\t\t$agreement->setOptionTitle($lng->txt($a_type.'_info_agree'));\n\t\t$agreement->setValue(1);\n\t\t$form->addItem($agreement);\n\t\t\n\t\treturn $form;\n\t}", "function create_account(\\Hostville\\Dorcas\\Sdk $sdk, array $config): DorcasResponse\n{\n $service = $sdk->createRegistrationService();\n foreach ($config as $key => $value) {\n $service = $service->addBodyParam($key, $value);\n }\n return $service->send('post');\n}", "public function create(AgreementInfoBuilder $builder, bool $raw = false)\n {\n $body = json_encode($builder->make(), JSON_PRETTY_PRINT);\n\n $headers = [\n 'Content-Type' => 'application/json'\n ];\n \n $response = $this->_post('/agreements', [], $body, $headers);\n\n return $raw ? $response : $response['id'];\n }", "protected function servicePost(Request $request)\n {\n try {\n if ($this->factory->completeServicePayment($request)) {\n \\conference\\Factory\\ServiceFactory::successPost();\n } else {\n \\conference\\Factory\\ServiceFactory::failurePost();\n }\n } catch (\\Exception $e) {\n \\phpws2\\Error::log($e);\n \\conference\\Factory\\ServiceFactory::failurePost();\n }\n exit();\n }", "function houzez_create_paypal_agreement($package_id, $access_token, $plan_id) {\n global $current_user;\n wp_get_current_user();\n $userID = $current_user->ID;\n $blogInfo = esc_url( home_url() );\n\n $host = 'https://api.sandbox.paypal.com';\n $is_paypal_live = houzez_option('paypal_api');\n if( $is_paypal_live =='live'){\n $host = 'https://api.paypal.com';\n }\n\n $time = time();\n $date = date('Y-m-d H:i:s',$time);\n\n $packPrice = get_post_meta($package_id, 'fave_package_price', true );\n $packName = get_the_title($package_id);\n $billingPeriod = get_post_meta( $package_id, 'fave_billing_time_unit', true );\n $billingFreq = intval( get_post_meta( $package_id, 'fave_billing_unit', true ) );\n\n $submissionCurency = houzez_option('currency_paid_submission');\n $return_url = houzez_get_template_link('template/template-thankyou.php');\n $plan_description = $packName.' '.esc_html__('Membership payment on ','houzez').$blogInfo;\n $return_url = houzez_get_template_link('template/template-thankyou.php');\n\n $url = $host.'/v1/payments/billing-agreements/';\n\n\n $billing_agreement = array(\n 'name' => $packName,\n 'description' => $plan_description,\n 'start_date' => gmdate(\"Y-m-d\\TH:i:s\\Z\", time()+100 ),\n \n );\n \n $billing_agreement['payer'] = array(\n 'payment_method'=>'paypal',\n 'payer_info' => array('email'=>'payer@example.com'),\n );\n \n $billing_agreement['plan'] = array(\n 'id' => $plan_id,\n );\n \n $json = json_encode($billing_agreement);\n $json_resp = houzez_execute_paypal_request($url, $json,$access_token);\n \n foreach ($json_resp['links'] as $link) {\n if($link['rel'] == 'execute'){\n $payment_execute_url = $link['href'];\n $payment_execute_method = $link['method'];\n } else if($link['rel'] == 'approval_url'){\n $payment_approval_url = $link['href'];\n $payment_approval_method = $link['method'];\n print $payment_approval_url;\n }\n }\n\n $output['payment_execute_url'] = $payment_execute_url;\n $output['access_token'] = $access_token;\n $output['package_id'] = $package_id;\n $output['recursive'] = 1;\n $output['date'] = $date;\n\n $save_output[$userID] = $output;\n update_option('houzez_paypal_package_transfer', $save_output);\n update_user_meta( $userID, 'houzez_paypal_package', $output);\n \n}", "public function createInvoice(InvoiceTransfer $invoiceTransfer);", "function addBillingAgreement(BillingAgreementInterface $billingAgreement);", "public function create_billing_agreement( $token ) {\n\n\t\t$this->set_method( 'CreateBillingAgreement' );\n\t\t$this->add_parameter( 'TOKEN', $token );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the dependencies for this course
protected function delete_dependencies() { parent::delete_dependencies(); $id = $this->get_id(); // Remove subtree location $location = CourseManagementRights::getInstance()->get_courses_subtree_root($id); if ($location) { if (! $location->delete()) { return false; } } // Remove location in root tree $location = $this->get_rights_location(); if ($location) { if (! $location->delete()) { return false; } } return true; }
[ "public function clearDependencies()\n {\n $this->dependencies = array();\n }", "public function clear() {\r\n\r\n try {\r\n $this->db->delete(\"dependencies\", $this->db->quoteInto(\"sourceid = ?\", $this->model->getSourceId()) . \" AND \" . $this->db->quoteInto(\"sourcetype = ?\", $this->model->getSourceType()));\r\n }\r\n catch (\\Exception $e) {\r\n \\Logger::error($e);\r\n }\r\n }", "public function deleteAllDependents() {\n\t\t$this->dependents = array();\n\t}", "function deleteDepend(): void\n {\n TraceLocationTableCollection::deleteByTrace($this);\n $this->delete();\n }", "function clearDeps()\n {\n unset($this->_packageInfo['release_deps']);\n }", "public function test_delete_courses(){\n $this->predate_course($this->course1);\n\n $courseids = $this->cleanup->get_old_courseids($this->threshold);\n $errors = $this->cleanup->delete_courses($courseids);\n $this->assertEquals(0, count($errors));\n }", "public function completeDependencies()\n {\n foreach($this->dependencies as $details) {\n foreach($details as $dependency) {\n isset($this->dependencies[$dependency]) or $this->dependencies[$dependency] = array();\n }\n }\n }", "public function delete()\n {\n \tif($this->course_id != null)\n \t{\n \t\t$this->db->where(\"course_id\", $this->course_id);\n \t\t$this->db->delete(\"Courses\");\n \t}\n }", "public function test_delete_dependency_with_multiple_dependencies_in_container()\n {\n $dependency_container = new DependencyContainer();\n $dependency_container->add('dependency_container_test', $this);\n $dependency_container->add('dependency_container_test2', $this);\n $dependency_container->delete('dependency_container_test');\n \n $value = $dependency_container->get_dependencies();\n \n $this->assertEquals($this, $value['dependency_container_test2']);\n }", "public function delete_course()\n {\n $course = Course::findOrFail($this->selected_course_id);\n if ($course->user_id == Auth::id() && Auth::user()->is_teacher())\n {\n $course_content_list = CourseContent::where('course_id', $course->course_id)->get();\n foreach ($course_content_list as $course_content)\n {\n try\n {\n Storage::delete($course_content->course_content_file_path);\n }\n catch (\\Throwable $e)\n {\n // Do something\n }\n \n $course_content->delete();\n }\n $course->delete();\n \n $this->selected_course_id = null;\n $this->confirming_course_deletion = false;\n \n $this->emit('course-deleted');\n }\n }", "function delete_role_dependency( $role_dependency ) {\n $this->load->database('default');\n \n $this->db->where($role_dependency);\n $this->db->delete('role_dependency');\n }", "public function deleteConfiguratorDependencyAction()\n {\n $id = (int) $this->Request()->getParam('id');\n if (empty($id)) {\n $this->View()->assign([\n 'success' => false,\n 'message' => 'No valid dependency id passed',\n ]);\n\n return;\n }\n $model = Shopware()->Models()->find(Dependency::class, $id);\n Shopware()->Models()->remove($model);\n Shopware()->Models()->flush();\n $this->View()->assign([\n 'success' => true,\n ]);\n }", "static function deleteAll() {\n $GLOBALS['DB']->exec(\"DELETE FROM courses;\");\n }", "final protected function eliminar() {\n if ($this -> dependencia != null) {\n throw new Exception('Dependencia sin datos');\n }\n DataAccess::delete($this -> dependencia);\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM courses;\");\n }", "static function clearDependancies() {\n if(XShell::admini_mode()) XDbIni::clear('dependant%');\n }", "function clearDeps()\n {\n if (!isset($this->_packageInfo['dependencies'])) {\n $this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(),\n array(\n 'dependencies' => array('providesextension', 'usesrole', 'usestask',\n 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',\n 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog')));\n }\n $this->_packageInfo['dependencies'] = array();\n }", "function deleteControleDependencies($sIdControles) {\r\n\r\n // Suppression dpépendance s_anc.evacuation_eaux\r\n $this->deleteControleEvacuationEaux($sIdControles);\r\n\r\n // Suppression dpépendance s_anc.filieres_agrees\r\n $this->deleteControleFilieresAgrees($sIdControles);\r\n\r\n // Suppression dpépendance s_anc.pretraitement\r\n $this->deleteControlePretraitements($sIdControles);\r\n\r\n // Suppression dpépendance s_anc.traitement\r\n $this->deleteControleTraitements($sIdControles);\r\n \r\n // Suppression dpépendance s_anc.composant\r\n $this->deleteControleComposants($sIdControles);\r\n }", "public function cascade()\n {\n foreach ($this->dependants as $dependent) {\n\n $related = $this->{$dependent}()->get();\n\n foreach ($related as $model) {\n if ($this->{$dependent}() instanceof BelongsToMany) {\n $this->{$dependent}()->detach($model->id);\n }\n $model->delete();\n }\n }\n\n $this->delete();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'bucketsBucketIDOwnersPost'
protected function bucketsBucketIDOwnersPostRequest($bucket_id, $add_resource_member_request_body, $zap_trace_span = null) { // verify the required parameter 'bucket_id' is set if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $bucket_id when calling bucketsBucketIDOwnersPost' ); } // verify the required parameter 'add_resource_member_request_body' is set if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $add_resource_member_request_body when calling bucketsBucketIDOwnersPost' ); } $resourcePath = '/buckets/{bucketID}/owners'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // header params if ($zap_trace_span !== null) { $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span); } // path params if ($bucket_id !== null) { $resourcePath = str_replace( '{' . 'bucketID' . '}', ObjectSerializer::toPathValue($bucket_id), $resourcePath ); } // body params $_tempBody = null; if (isset($add_resource_member_request_body)) { $_tempBody = $add_resource_member_request_body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function postBucketsIDOwnersRequest($bucket_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'bucket_id' is set\n if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket_id when calling postBucketsIDOwners'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling postBucketsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/buckets/{bucketID}/owners';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bucketID' . '}',\n ObjectSerializer::toPathValue($bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n }\n\n $headers = array_merge(\n $headerParams,\n $headers\n );\n\n return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);\n }", "protected function getBucketsIDOwnersRequest($bucket_id, $zap_trace_span = null)\n {\n // verify the required parameter 'bucket_id' is set\n if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket_id when calling getBucketsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/buckets/{bucketID}/owners';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bucketID' . '}',\n ObjectSerializer::toPathValue($bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n }\n\n $headers = array_merge(\n $headerParams,\n $headers\n );\n\n return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);\n }", "protected function bucketsBucketIDOwnersUserIDDeleteRequest($user_id, $bucket_id, $zap_trace_span = null)\n {\n // verify the required parameter 'user_id' is set\n if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_id when calling bucketsBucketIDOwnersUserIDDelete'\n );\n }\n // verify the required parameter 'bucket_id' is set\n if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket_id when calling bucketsBucketIDOwnersUserIDDelete'\n );\n }\n\n $resourcePath = '/buckets/{bucketID}/owners/{userID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($user_id !== null) {\n $resourcePath = str_replace(\n '{' . 'userID' . '}',\n ObjectSerializer::toPathValue($user_id),\n $resourcePath\n );\n }\n // path params\n if ($bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bucketID' . '}',\n ObjectSerializer::toPathValue($bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function orgsOrgIDOwnersPostRequest($org_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'org_id' is set\n if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $org_id when calling orgsOrgIDOwnersPost'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling orgsOrgIDOwnersPost'\n );\n }\n\n $resourcePath = '/orgs/{orgID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($org_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orgID' . '}',\n ObjectSerializer::toPathValue($org_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function deleteBucketsIDOwnersIDRequest($user_id, $bucket_id, $zap_trace_span = null)\n {\n // verify the required parameter 'user_id' is set\n if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_id when calling deleteBucketsIDOwnersID'\n );\n }\n // verify the required parameter 'bucket_id' is set\n if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket_id when calling deleteBucketsIDOwnersID'\n );\n }\n\n $resourcePath = '/api/v2/buckets/{bucketID}/owners/{userID}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($user_id !== null) {\n $resourcePath = str_replace(\n '{' . 'userID' . '}',\n ObjectSerializer::toPathValue($user_id),\n $resourcePath\n );\n }\n // path params\n if ($bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bucketID' . '}',\n ObjectSerializer::toPathValue($bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n }\n\n $headers = array_merge(\n $headerParams,\n $headers\n );\n\n return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);\n }", "protected function tasksTaskIDOwnersPostRequest($task_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling tasksTaskIDOwnersPost'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling tasksTaskIDOwnersPost'\n );\n }\n\n $resourcePath = '/tasks/{taskID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'taskID' . '}',\n ObjectSerializer::toPathValue($task_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function bucketsPostRequest($bucket, $zap_trace_span = null)\n {\n // verify the required parameter 'bucket' is set\n if ($bucket === null || (is_array($bucket) && count($bucket) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket when calling bucketsPost'\n );\n }\n\n $resourcePath = '/buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($bucket)) {\n $_tempBody = $bucket;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function postTasksIDOwnersRequest($task_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling postTasksIDOwners'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling postTasksIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/tasks/{taskID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'taskID' . '}',\n ObjectSerializer::toPathValue($task_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function postTasksIDOwnersRequest($task_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling postTasksIDOwners'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling postTasksIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/tasks/{taskID}/owners';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'taskID' . '}',\n ObjectSerializer::toPathValue($task_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n }\n\n $headers = array_merge(\n $headerParams,\n $headers\n );\n\n return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);\n }", "protected function getOrgsIDOwnersRequest($org_id, $zap_trace_span = null)\n {\n // verify the required parameter 'org_id' is set\n if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $org_id when calling getOrgsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/orgs/{orgID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($org_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orgID' . '}',\n ObjectSerializer::toPathValue($org_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function tasksTaskIDOwnersGetRequest($task_id, $zap_trace_span = null)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling tasksTaskIDOwnersGet'\n );\n }\n\n $resourcePath = '/tasks/{taskID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'taskID' . '}',\n ObjectSerializer::toPathValue($task_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function orgsOrgIDOwnersGetRequest($org_id, $zap_trace_span = null)\n {\n // verify the required parameter 'org_id' is set\n if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $org_id when calling orgsOrgIDOwnersGet'\n );\n }\n\n $resourcePath = '/orgs/{orgID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($org_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orgID' . '}',\n ObjectSerializer::toPathValue($org_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function telegrafsTelegrafIDOwnersPostRequest($telegraf_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'telegraf_id' is set\n if ($telegraf_id === null || (is_array($telegraf_id) && count($telegraf_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $telegraf_id when calling telegrafsTelegrafIDOwnersPost'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling telegrafsTelegrafIDOwnersPost'\n );\n }\n\n $resourcePath = '/telegrafs/{telegrafID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($telegraf_id !== null) {\n $resourcePath = str_replace(\n '{' . 'telegrafID' . '}',\n ObjectSerializer::toPathValue($telegraf_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function dashboardsDashboardIDOwnersPostRequest($dashboard_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'dashboard_id' is set\n if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $dashboard_id when calling dashboardsDashboardIDOwnersPost'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling dashboardsDashboardIDOwnersPost'\n );\n }\n\n $resourcePath = '/dashboards/{dashboardID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($dashboard_id !== null) {\n $resourcePath = str_replace(\n '{' . 'dashboardID' . '}',\n ObjectSerializer::toPathValue($dashboard_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function ajax_create_bucket() {\n\t\t$this->verify_ajax_request();\n\n\t\t$bucket = $this->ajax_check_bucket();\n\n\t\tif ( defined( 'AS3CF_REGION' ) ) {\n\t\t\t// Are we defining the region?\n\t\t\t$region = AS3CF_REGION;\n\t\t} else {\n\t\t\t// Are we specifying the region via the form?\n\t\t\t$region = isset( $_POST['region'] ) ? sanitize_text_field( $_POST['region'] ) : null; // input var okay\n\t\t}\n\n\t\t$result = $this->create_bucket( $bucket, $region );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$out = $this->prepare_bucket_error( $result, false );\n\n\t\t\t$this->end_ajax( $out );\n\t\t}\n\n\t\t// check if we were previously selecting a bucket manually via the input\n\t\t$previous_manual_bucket_select = $this->get_setting( 'manual_bucket', false );\n\n\t\t$args = array(\n\t\t\t'_nonce' => wp_create_nonce( 'as3cf-create-bucket' )\n\t\t);\n\n\t\t$this->save_bucket_for_ajax( $bucket, $previous_manual_bucket_select, $region, $args );\n\t}", "protected function getScrapersIDOwnersRequest($scraper_target_id, $zap_trace_span = null)\n {\n // verify the required parameter 'scraper_target_id' is set\n if ($scraper_target_id === null || (is_array($scraper_target_id) && count($scraper_target_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $scraper_target_id when calling getScrapersIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/scrapers/{scraperTargetID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($scraper_target_id !== null) {\n $resourcePath = str_replace(\n '{' . 'scraperTargetID' . '}',\n ObjectSerializer::toPathValue($scraper_target_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function bucketsBucketIDMembersPostRequest($bucket_id, $add_resource_member_request_body, $zap_trace_span = null)\n {\n // verify the required parameter 'bucket_id' is set\n if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $bucket_id when calling bucketsBucketIDMembersPost'\n );\n }\n // verify the required parameter 'add_resource_member_request_body' is set\n if ($add_resource_member_request_body === null || (is_array($add_resource_member_request_body) && count($add_resource_member_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $add_resource_member_request_body when calling bucketsBucketIDMembersPost'\n );\n }\n\n $resourcePath = '/buckets/{bucketID}/members';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bucketID' . '}',\n ObjectSerializer::toPathValue($bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($add_resource_member_request_body)) {\n $_tempBody = $add_resource_member_request_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTelegrafsIDOwnersRequest($telegraf_id, $zap_trace_span = null)\n {\n // verify the required parameter 'telegraf_id' is set\n if ($telegraf_id === null || (is_array($telegraf_id) && count($telegraf_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $telegraf_id when calling getTelegrafsIDOwners'\n );\n }\n\n $resourcePath = '/api/v2/telegrafs/{telegrafID}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n // path params\n if ($telegraf_id !== null) {\n $resourcePath = str_replace(\n '{' . 'telegrafID' . '}',\n ObjectSerializer::toPathValue($telegraf_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function linkWithOwnersRequest($body, $id)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling linkWithOwners'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling linkWithOwners'\n );\n }\n\n $resourcePath = '/position/{id}/owners';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Parent Job Quickbook Id
public function getParentJobQuickbookId($job) { if(!$job->isMultiJob()) return false; $jobEntity = []; $customer = $job->customer; $displayName = $job->getQuickbookDisplayName(); $quickbookId = $job->quickbook_id; $data = $this->getQuickbookCustomer($quickbookId, $displayName); $dateTime = convertTimezone($job->created_date, Settings::get('TIME_ZONE')); $createdDate = $dateTime->format('Y-m-d'); $jobEntity = [ 'MetaData' => [ 'CreateTime' => $createdDate, ] ]; $jobEntity['Job'] = true; $jobEntity['DisplayName'] = removeQBSpecialChars($displayName); $jobEntity['BillWithParent'] = true; $jobEntity['ParentRef']['value'] = $customer->quickbook_id; $billingAddress = $customer->billing; $jobEntity['GivenName'] = removeQBSpecialChars(substr($customer->getFirstName(), 0, 25)); // maximum of 25 char $jobEntity['FamilyName'] = removeQBSpecialChars(substr($customer->last_name, 0, 25)); $jobEntity['CompanyName'] = substr($customer->getCompanyName(), 0, 25); $jobEntity['BillAddr'] = [ 'Line1' => $billingAddress->address, 'Line2' => $billingAddress->address_line_1, 'City' => $billingAddress->city ? $billingAddress->city : '', 'Country' => isset($billingAddress->country->name) ? $billingAddress->country->name : '', 'CountrySubDivisionCode' => isset($billingAddress->state->code) ? $billingAddress->state->code : '', 'PostalCode' => $billingAddress->zip ]; $jobEntity['PrimaryEmailAddr'] = [ "Address" => $customer->email ]; $jobEntity["Notes"] = removeQBSpecialChars(substr($job->description, 0, 4000)); $jobEntity = array_filter($jobEntity); if(ine($data, 'Id')) { $jobEntity = array_merge($data, $jobEntity); } $qboCustomer = QBOCustomer::create($jobEntity); $resultingCustomer = QuickBooks::getDataService()->Add($qboCustomer); // we are updating this with model for stoping model events Job::where('id', $job->id)->update([ 'quickbook_id' => $resultingCustomer->Id, 'quickbook_sync' => true ]); $job = Job::find($job->id); return $job->quickbook_id; }
[ "public function getParentId()\n {\n if($this->parentId) {\n return $this->parentId;\n }\n\n $path = [];\n\t\tif($this->scope->has()) {\n\t\t\t$path[] = $this->scope->id();\n\t\t}\n $path[] = 'jobs';\n $path[] = $this->job->number;\n $path[] = $this->entityType;\n\n $parentId = null;\n\t\tforeach ($path as $keyName) {\n\t\t\t$parentId = $this->repository->findOrCreateByName($keyName, $parentId);\n }\n $this->parentId = $parentId;\n return $parentId;\n }", "function getParentId() {\n return $this->getFieldValue('parent_id');\n }", "private function getParentId() {\n return (int) Xss::filter($this->request->get('pid'));\n }", "public function getParentId()\n {\n return $this->getWrappedObject()->parent_id;\n }", "public function getParentId()\n {\n return $this->parent;\n }", "public function parent_uid(){\n return $this->getValue(\"parent_uid\");\n }", "public function getParentQuoteId();", "public function getParentId() {\n return Util::getItem($this->wpTerm, 'parent', 0);\n }", "public function getParentItemId()\n\t{\n\t\treturn $this->parent_item_id;\n\t}", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParentInvoiceId()\n {\n return $this->getParameter('parentInvoiceId');\n }", "abstract public function get_top_parent_id();", "public function get_parent_id() {\n return wp_get_post_parent_id( $this->get_id() );\n }", "public function getParentIdName();", "function GetParentBuildId()\n {\n if(!$this->SiteId || !$this->Name || !$this->Stamp)\n {\n return 0;\n }\n\n $parent = pdo_single_row_query(\n \"SELECT id FROM build WHERE parentid=-1 AND\n siteid='$this->SiteId' AND name='$this->Name' AND stamp='$this->Stamp'\");\n\n if ($parent && array_key_exists('id', $parent))\n {\n return $parent['id'];\n }\n return 0;\n }", "function getParentID() {\n\t\treturn $this->_ParentID;\n\t}", "public function getParentPid()\n\t{\n\t\treturn $this->parent_pid;\n\t}", "public function getParentRevisionNumber() {\n if($this->projectJob->isSecondLevelJob()) {\n $parentUserJob = $this->getParentJob();\n // Redelivery should have the revision number of last actual job\n if ($this->projectJob->is_redelivery && $parentUserJob instanceof UserJob) {\n $parentJob = PProjectJob::model()->findByPk($parentUserJob->job_id);\n if ($parentJob instanceof PProjectJob)\n $parentUserJob = $parentJob->getLanguageActualJob(true, true, true)->getUserJob();\n }\n\n // There is a possibility in the system\n // when QA job is assigned before its direct parent job assignment\n // In this case we must set the parent revision number of reviewed user job\n if (!$parentUserJob instanceof UserJob)\n $parentUserJob = $this->projectJob->getReviewedUserJob();\n }\n else {\n $parentUserJob = $this->projectJob->getReviewedUserJob();\n }\n\n return $parentUserJob instanceof UserJob ? $parentUserJob->revision_number : 0;\n }", "public function getParentSlideID()\n {\n $parentID = $this->getParam(\"parentid\", \"\");\n\n return $parentID;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new RestaurantUser model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate($restaurant_id = null) { $model = new RestaurantUser(); $model->restaurant_id = $restaurant_id; $restaurant = Restaurant::getById($restaurant_id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'restaurant_id' => $restaurant->id]); } else { return $this->render('update', [ 'model' => $model, 'restaurant' => $restaurant ]); } }
[ "public function actionCreate() {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Restaurants();\n $model->scenario = Restaurants::SCENARIO_UPDATE;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['restaurants/update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new User();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new UserModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new RestaurantMenu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new UserDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store()\n {\n $restaurant = new App\\Models\\Database\\Restaurant();\n \n $restaurant->user_id \t= Auth::id();\n $restaurant->name\t = Input::get('name');\n \n $restaurant->save();\n \n return Redirect::to('/user');\n }", "public function actionCreate()\n {\n $model=new User('create');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('/site/index'));\n }\n\n //Yii::app()->user->setFlash('success', Yii::t('user', '<strong>Congratulations!</strong> You have been successfully registered on our website! <a href=\"/\">Go to main page.</a>'));\n $this->render('create', compact('model'));\n }", "public function actionCreate()\n {\n $model = new User();\n if(null !== (Yii::$app->request->post()))\n {\n if($this->saveUser($model))\n {\n Yii::$app->session->setFlash('userUpdated');\n $this->redirect(['update', 'id' => $model->getId()]);\n return;\n }\n\n }\n\n return $this->render('@icalab/auth/views/user/create', ['model' => $model]);\n }", "public function actionCreate()\n {\n $model = new TrainUsers();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new UserFdp();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AuthUser();\n if ($model->load(Yii::$app->request->post()) && $model->create())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n return $this->render('create', ['model' => $model,]);\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether the permit application can be withdrawn
public function canBeWithdrawn() { return $this->isUnderConsideration() || ($this->isAwaitingFee() && $this->issueFeeOverdue()); }
[ "public function canWithdraw()\n {\n $user = $this->getUser();\n\n return ($this->getData('user_id') == $user['id'] &&\n $this->getData('status') == self::STATUS_PENDING) ? true : false;\n }", "function isWithdrawn() {\n\t\tif ($this->active==0) { return false; }\n\t\treturn $this->dateWithdrawn > 0;\n\t}", "public function canBeGranted(): bool\n {\n return\n $this->isUnderConsideration()\n && $this->licence->isValid()\n && (string)$this->getBusinessProcess() === RefData::BUSINESS_PROCESS_APGG;\n }", "public function isWithdrawRequested()\n {\n $status = $this->getStatus(true);\n return $status->has(ParticipantStatus::TYPE_STATUS_WITHDRAW_REQUESTED);\n }", "public function isGuaranteeEligible();", "public function isWithdrawn()\n\t{\n\t\treturn ($this->get('status') == static::WISH_STATE_WITHDRAWN);\n\t}", "public function isAppPermitted(){\n return $this->assignTokenToClient()===false ? false : true;\n }", "public function isUnderProtection()\n {\n return ($this->getProtectionEndDate() >= Carbon::now());\n }", "public function isReadyForNoOfPermits()\n {\n $canBeUpdated = $this->canBeUpdated();\n $hasIrhpPermitApplications = count($this->irhpPermitApplications) > 0;\n\n return $canBeUpdated && $hasIrhpPermitApplications;\n }", "public function canDecline()\n {\n $user = $this->getUser();\n\n if ($this->getData('transfer_status') == Service\\BankTransfers::STATUS_PENDING) {\n if ($user->getData('role') == 'Admin') {\n return true;\n }\n else {\n $sale = $this->findParentRow('\\Ppb\\Db\\Table\\Transactions')\n ->findParentRow('\\Ppb\\Db\\Table\\Sales');\n\n if ($sale !== null) {\n if ($user->getData('id') == $sale->getData('seller_id')) {\n return true;\n }\n }\n }\n }\n\n return false;\n }", "public function canDecline()\n {\n $user = $this->getUser();\n\n return ($this->getData('receiver_id') == $user['id'] &&\n $this->getData('status') == self::STATUS_PENDING) ? true : false;\n }", "public function isPayoutAllowed(): bool\n {\n return $this->isPayoutAllowed;\n }", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function isProtectingTheKing(): bool\r\n {\r\n // TODO...\r\n return FALSE;\r\n }", "public function validate_withdraw_count(){\n\t\t$withdraw = $this->validate_count(2);\n\t\tif($withdraw < 3){\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function is_reserved(){\n\t $result = false;\n\t if( $this->booking_status == 0 && get_option('dbem_bookings_approval_reserved') ){\n\t $result = true;\n\t }elseif( $this->booking_status == 0 && !get_option('dbem_bookings_approval') ){\n\t $result = true;\n\t }elseif( $this->booking_status == 1 ){\n\t $result = true;\n\t }\n\t return apply_filters('em_booking_is_reserved', $result, $this);\n\t}", "public function isCancelAllowed()\n {\n return (strtotime('now') <= strtotime('-1 hour '.$this->show->show_time) && $this->booking_status != self::CANCELLED);\n }", "public function canViewCandidatePermits(): bool\n {\n return $this->isAwaitingFee()\n && $this->isCandidatePermitsAllocationMode()\n && $this->isApgg();\n }", "public function isWithdrawn()\n {\n $status = $this->getStatus(true);\n return $status->has(ParticipantStatus::TYPE_STATUS_WITHDRAWN);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get record count based on filter (for detail record count in master table pages)
public function loadRecordCount($filter) { $origFilter = $this->CurrentFilter; $this->CurrentFilter = $filter; $this->recordsetSelecting($this->CurrentFilter); $select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : $this->getQueryBuilder()->select("*"); $groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : ""; $having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : ""; $sql = $this->buildSelectSql($select, $this->getSqlFrom(), $this->getSqlWhere(), $groupBy, $having, "", $this->CurrentFilter, ""); $cnt = $this->getRecordCount($sql); $this->CurrentFilter = $origFilter; return $cnt; }
[ "function record_count($filter){\n\n if($filter){\n $filter = \" and \". $filter;\n }\n\n $query = $this->db->query('\n SELECT count(*) as total FROM categoria \n LEFT JOIN categoria AS c2 on categoria.id_categoria_padre = c2.id_categoria\n LEFT JOIN pos_empresa as e on e.id_empresa = categoria.Empresa \n LEFT JOIN pos_giros as g on g.id_giro = categoria.codigo_giro\n where categoria.Empresa='.$this->session->empresa[0]->id_empresa .' '.$filter );\n $data = $query->result(); \n\n return $data[0]->total;\n }", "function LoadRecordCount($filter) {\n\t\t$origFilter = $this->CurrentFilter;\n\t\t$this->CurrentFilter = $filter;\n\t\t$this->Recordset_Selecting($this->CurrentFilter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = ew_BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $this->CurrentFilter, \"\");\n\t\t$cnt = $this->TryGetRecordCount($sql);\n\t\tif ($cnt == -1) {\n\t\t\tif ($rs = $this->LoadRs($this->CurrentFilter)) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\t$this->CurrentFilter = $origFilter;\n\t\treturn intval($cnt);\n\t}", "public function count_filtered(){\n\t\t$this->get_query();\n\t\t$query = $this->db->get();\n\t\treturn (int) $query->num_rows();\n\t}", "public function recordsCount();", "public function getModelCount($filter = '');", "public function getRecordCount();", "function ListRecordCount() {\n\t\t$filter = $this->getSessionWhere();\n\t\tew_AddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->ApplyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = ew_BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->TryGetRecordCount($sql);\n\t\tif ($cnt == -1) {\n\t\t\t$conn = &$this->Connection();\n\t\t\tif ($rs = $conn->Execute($sql)) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\treturn intval($cnt);\n\t}", "public function filteredCount();", "public function count_records($table,$filter=\"\") {\n\t\t$res = @mysql_query(\"select count(*) as num from $table\".(($filter!=\"\")?\" where $filter\" : \"\"));\n\t\t$xx=@mysql_result($res,0,\"num\");\n\t\treturn $xx;\n\t}", "public function documentCountAction() {\r\n $this->checkUserPermission(\"documents\");\r\n\r\n $condition = urldecode($this->getParam(\"condition\"));\r\n $groupBy = $this->getParam(\"groupBy\");\r\n $params = array();\r\n\r\n if (!empty($condition)) $params[\"condition\"] = $condition;\r\n if (!empty($groupBy)) $params[\"groupBy\"] = $groupBy;\r\n\r\n\r\n $count = Document::getTotalCount($params);\r\n\r\n $this->encoder->encode(array(\"success\" => true, \"data\" => array(\"totalCount\" => $count)));\r\n }", "function count_filtered()\n\t{\n\t\t$this->_get_datatables_query();\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function listRecordCount()\n\t{\n\t\t$filter = $this->getSessionWhere();\n\t\tAddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->applyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->getRecordCount($sql);\n\t\treturn $cnt;\n\t}", "abstract public function prepareFilteredCount();", "function test_record_count_and_total_count_with_filter(){\n\t\tself::clear_get_values();\n\n\t\tadd_filter('frm_display_entry_content', 'frm_get_current_entry_num_out_of_total', 20, 7);\n\n\t\t// Check page 1, page size of 1\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\t\t$string = 'Viewing entry 1 to 1 (of 3 entries)';\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', $string ), array( 'Steph', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test' );\n\n\t\t// Check page 2, page size of 1\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 2;\n\t\t$string = 'Viewing entry 2 to 2 (of 3 entries)';\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steph', $string ), array( 'Jamie', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test 2' );\n\n\t\t// Check page 1 with a page size of 2\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 1;\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 2;\n\t\t$string = 'Viewing entry 1 to 2 (of 3 entries)';\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', 'Steph', $string ), array( 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with record_count and total_count test 3' );\n\t}", "public function searchCount(Tinebase_Model_Filter_FilterGroup $_filter);", "public function getNumberOfRecords() {}", "public static function filterCount()\n {\n return self::filter(request(['q']))->count();\n }", "function count_filtro()\n {\n $this->_get_datatables_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "public function count()\n {\n if ($this->queryShouldBeStopped) {\n return 0;\n }\n\n $queryType = 'SectionQuery::count';\n $filter = $this->normalizeFilter();\n $callback = function() use ($filter) {\n return (int) $this->bxObject->getCount($filter);\n };\n\n return $this->handleCacheIfNeeded(compact('queryType', 'filter'), $callback);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OBTIENE LOS DATOS DE UN USUARIO
function obtiene_datos_usuario (){ //preparo la consulta a la base if($this->optbusca == 1){//TRAE LOS USUARIOS ACTIVOS $query = "SELECT * FROM usuario as u, nivel as n WHERE u.nivel=n.id_nivel and n.id_nivel <> 4"; }else{//TRAE LOS USUARIOS INACTIVOS $query = "SELECT * FROM usuario as u, nivel as n WHERE u.nivel=n.id_nivel and n.id_nivel = 4"; } $datos = mysql_query($query); return $datos; }
[ "public function cambia_datos_usuario() {\n\t\t$usuario = $this -> ssouva -> login();\n\t\t$datos[\"usuario\"] = $usuario;\n\n\t\t// Cosas de sesiones y si es admin o no\n\t\tif ($this -> admin_model -> es_admin($usuario)>0) {\n\t\t\t$idu = $this -> input -> post(\"idu\");\n\t\t\t$nombre = $this -> input -> post(\"nombre\");\n\t\t\t$apellidos = $this -> input -> post(\"apellidos\");\n\t\t\t$login = $this -> input -> post(\"login\");\n\t\t\t$password = $this -> input -> post(\"password\");\n\t\t\t$direccion = $this -> input -> post(\"direccion\");\n\t\t\t$tlf = $this -> input -> post(\"tlf\");\n\t\t\t$email = $this -> input -> post(\"email\");\n\t\t\t$verificado = $this -> input -> post(\"verificado\");\n\n\t\t\t$this -> usuarios_model -> updatea_user($idu, $nombre, $apellidos, $login, $password, $direccion, $tlf, $email, $verificado);\n\t\t\t// Y recargamos los datos\n\t\t\t$datos[\"denuncias\"] = $this -> comentarios_model -> hay_denuncias();\n\t\t\t$datos[\"usuarios_no\"] = $this -> usuarios_model -> usuarios_no_activados();\n\t\t\t$datos[\"pisos_no\"] = $this -> pisos_model -> mostar_pisos_no_validados();\n\t\t\t$this -> load -> view(\"doc/index\", $datos);\n\t\t}\n\t}", "function rellenaDatos(){\n $stmt = $this->db->prepare(\"SELECT *\n\t\t\t\t\tFROM usuario\n\t\t\t\t\tWHERE login = ?\");\n\n $stmt->execute(array($this->login));\n $user = $stmt->fetch(PDO::FETCH_ASSOC);\n if($user != null){\n $usuario = new USUARIO_Model(\n $user['usuario_id'],$user['login'],$user['nombre']\n ,$user['apellidos'],$user['password'],$user['fecha_nacimiento'],$user['email_usuario']\n ,$user['telef_usuario'],$user['dni'],$user['rol'],$user['afiliacion'],$user['nombre_puesto']\n ,$user['nivel_jerarquia'],$user['depart_usuario'],$user['grupo_usuario'],$user['centro_usuario']\n );\n\n return $usuario;\n\n\n }else{\n return 'Error inesperado al intentar cumplir su solicitud de consulta';\n }\n\n }", "function dameUsuariosFabricaToro(){\n $consultaSql = \"select * from usuarios where activo=1 and id_tipo=1 or id_almacen=2\";\n $this->setConsulta($consultaSql);\n $this->ejecutarConsulta();\n return $this->getResultados();\n }", "function seguimiento_usuario() {\n\t\t// si los datos han sido enviados por post se sobre escribe la variable $edo\n\t\tif ($_POST) {\n\t\t\t$edo = $this -> input -> post('estado');\n\t\t} else {\n\t\t\t$edo = 'pendientes';\n\t\t}\n\t\t$datos['selec'] = $edo;\n\n\t\t// se obtiene el listado\n\t\t$datos['consulta'] = $this -> conformidades_model -> get_conformidades_usuario($edo);\n\n\t\t// variables necesarias para la página\n\t\t$datos['titulo'] = 'Seguimiento de No Conformidades ';\n\t\t$datos['secciones'] = $this -> Inicio_model -> get_secciones();\n\t\t$datos['identidad'] = $this -> Inicio_model -> get_identidad();\n\t\t$datos['usuario'] = $this -> Inicio_model -> get_usuario();\n\t\t$this -> Inicio_model -> set_sort(15);\n\t\t$datos['sort_tabla'] = $this -> Inicio_model -> get_sort();\n\t\t$datos['selec'] = $edo;\n\n\t\t// estructura de la página\n\t\t$this -> load -> view('_estructura/header', $datos);\n\t\t$this -> load -> view('_estructura/top', $datos);\n\t\t$this -> load -> view('procesos/conformidades/seguimiento_usuario', $datos);\n\t\t$this -> load -> view('_estructura/right');\n\t\t$this -> load -> view('_estructura/footer');\n\t}", "public static function setUsuarios(){\n\t\t$conn = new Read;\n\t\t$conn->ExeRead('usuarios');\n\t\t$conn->getRowCount();\n\t\t$dado=$conn->getRowCount();\n\t\treturn $dado;\n\t}", "public function exposConEntrada(){\n\t\t$query = sprintf(\"SELECT * FROM Eventos EV, Entradas EN WHERE EV.id=EN.id_evento AND EN.id_usuario=%d\", $this->id);\n\t\t$obras = self:: consulta($query);\n\t\treturn $obras;\n\t}", "function obtenerUsuarios(){\n $db = obtenerBaseDeDatos();\n $sentencia = $db->query(\"SELECT * FROM usuarios\");\n return $sentencia->fetchAll(); \n }", "public function consulta() {\n\n\t\t// Buscar as informações do usuario atual logado\n\t\t$this->sql = \"SELECT * FROM dados_usuario WHERE Id = '$this->id'\";\n\n\t\t$this->dados_usuario = mysqli_fetch_array(mysqli_query($this->con, $this->sql));\t\t\n\n\t}", "protected function get_data_usuario(){\n\t\treturn json_encode(\n\t\t\tarray(\n\t\t\t\t'id_usuario'=> Auth::id(),\n\t\t\t\t'usuario'=> Auth::user()->usuario,\n\t\t\t\t'email' => Auth::user()->email,\n\t\t\t\t'tipo_usuario' => Auth::user()->cod_tipo_usuario,\n\t\t\t)\n\t\t);\n\t}", "public function getallutilisateur()\n\t\t\t{\n\t\t\t\t$data = $this->id_utilisateur;\n\t\t\t\t$data = $data.$this->username_utilisateur;\n\t\t\t\t$data = $data.$this->password_utilisateur;\n $data = $data.$this->xp_utilisateur;\n $data = $data.$this->points_utilisateur;\n\t\t\t\t$data = $data.$this->mail_utilisateur;\n\t\t\t\t$data = $data.$this->niv_util;\n\t\t\t\t$data = $data.$this->nom_image;\n\t\t\t\t$data = $data.$this->etat_utilisateur;\n\n\t\t\t\treturn $data;\n\t\t\t}", "private function obtenerPorDatos()\r\n {\r\n if ($this->nombre && $this->sector) {\r\n $consulta = \"SELECT * FROM aula WHERE nombre='{$this->nombre}' AND sector='{$this->sector}'\";\r\n $resultado = Conexion::getInstancia()->obtener($consulta);\r\n if (gettype($resultado[0]) == \"array\") {\r\n $fila = $resultado[0];\r\n $this->id = $fila['id'];\r\n $this->nombre = $fila['nombre'];\r\n $this->sector = $fila['sector'];\r\n return array(2, \"Se obtuvo la información del aula correctamente\");\r\n }\r\n return $resultado;\r\n }\r\n Log::guardar(\"INF\", \"AULA --> OBTENER POR DATOS :NOMBRE O SECTOR INVALIDO\");\r\n return array(0, \"No se pudo hacer referencia al aula por su nombre y sector\");\r\n }", "public function setPosteo()\r\n {\r\n $query = \"SELECT USUARIO_ID, TITULO, CONTENIDO FROM POSTEOS WHERE POSTEO_ID = :posteo_id\";\r\n $stmt = DBConnection::getStatement($query);\r\n $stmt->execute(['posteo_id' => $this->posteo_id]);\r\n if ($datos = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\r\n $this->usuario_id = $datos['USUARIO_ID'];\r\n $this->titulo = $datos['TITULO'];\r\n $this->contenido = $datos['CONTENIDO'];\r\n\r\n };\r\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function admin_meus_dados() {\n $id = $this->ControleAcesso->usuario('id');\n if (!empty($this->request->data)) {\n //Alterar dados se senha\n if (!empty($this->request->data['AutenticacaoUsuario']['password'])) {\n $this->AutenticacaoUsuario->create($this->request->data);\n if ($this->AutenticacaoUsuario->validates()) {\n $this->request->data['AutenticacaoUsuario']['password'] = sha1($this->request->data['AutenticacaoUsuario']['password']);\n if ($this->AutenticacaoUsuario->save($this->request->data, false)) {\n unset($this->request->data['AutenticacaoUsuario']['password']);\n unset($this->request->data['AutenticacaoUsuario']['passwd_confirm']);\n $this->alerta('Dados atualizados');\n } else {\n $this->alerta('Erro ao salvar, tente novamente');\n }\n } else {\n $this->alerta('Não foi possível salvar, corrija os erros indicados abaixo');\n }\n //Alterar somente dados\n } else {\n unset($this->request->data['AutenticacaoUsuario']['password']);\n if ($this->AutenticacaoUsuario->save($this->request->data)) {\n $this->alerta('Dados atualizados');\n } else {\n $this->alerta('Erro, tente novamente');\n }\n }\n } else {\n $this->request->data = $this->AutenticacaoUsuario->read(null, $id);\n unset($this->request->data['AutenticacaoUsuario']['password']);\n }\n }", "function mostrar_usuario(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM usuario WHERE id_uso='$id'\";\n\t\t\t$consulta=mysql_query($sql);\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->nombre = $resultado['nombre_uso'];\n\t\t\t$this->apellido = $resultado['apellido_uso'];\n\t\t\t$this->correo = $resultado['correo_uso'];\n\t\t\t$this->login = $resultado['login_uso'];\n\t\t\t$this->nivel = $resultado['nivel_uso'];\n\t\t\t$this->tipo = $resultado['tipo_uso'];\n\t\t\t\n\t\t} \n\t}", "static function obtenerUsuarios() {\n self::abrirBD();\n $stmt = self::$conexion->prepare('SELECT usuario.correo, usuario.pwd, usuario.nombre, usuario.apellido, asignarrol.idRol, usuario.edad, usuario.foto , usuario.activo FROM usuario,asignarrol where asignarrol.usuario=usuario.correo');\n if ($stmt->execute()) {\n $result = $stmt->get_result();\n if ($result->num_rows > 0) {\n while ($fila = $result->fetch_assoc()) {\n $u = new Usuario($fila['correo'], $fila['pwd'], $fila['nombre'], $fila['apellido'], $fila['idRol'], $fila['edad'], $fila['foto'], $fila['activo']);\n $v[] = $u;\n }\n }\n } else {\n echo 'fallo';\n }\n $stmt->close();\n self::cerrarBD();\n return $v;\n }", "function carrega_informacoes_usuario_chat(){\n\t\t\n\t\t// seta usuario de chat de sessao\n\t\t$idusuario = retorne_usuario_chat();\n\t\t\n\t\t// valida idusuario\n\t\tif($idusuario == null){\n\t\t\t\n\t\t\t// retorno nulo\n\t\t\treturn null;\n\t\t\t\n\t\t};\n\t\t\n\t\t// nome de usuario\n\t\t$nome_usuario = retorne_nome_usuario($idusuario);\n\t\t\n\t\t// usuario online\n\t\t$usuario_online = retorne_usuario_online($idusuario);\n\t\t\n\t\t// valida usuario online\n\t\tif($usuario_online == true){\n\t\t\t\n\t\t\t$imagem_servidor[0] = retorne_imagem_servidor(23);\n\t\t\n\t\t}else{\n\t\t\n\t\t\t$imagem_servidor[0] = retorne_imagem_servidor(22);\n\t\t\n\t\t};\n\t\t\n\t\t// atualiza o array\n\t\t$array_retorno['nome'] = $nome_usuario;\n\t\t$array_retorno['online_offline'] = $imagem_servidor[0];\n\t\t\n\t\t// retorno\n\t\treturn json_encode($array_retorno);\n\t\t\n\t\t}", "public function generarUsuario() {\r\n $pdo = Database::connect();\r\n $sql = \"select max(ID_USU) as cod from INV_TAB_USUARIOS\";\r\n $consulta = $pdo->prepare($sql);\r\n $consulta->execute();\r\n $res = $consulta->fetch(PDO::FETCH_ASSOC);\r\n $nuevoCod = '';\r\n if ($res['cod'] == NULL) {\r\n $nuevoCod = 'USUA-0001';\r\n } else { \r\n $rest= ((substr($res['cod'], -4))+1).''; // Separacion de la parte numerica USUA-0023 --> 23\r\n // Ciclo que completa el codigo segun lo retornado para completar los 9 caracteres \r\n // USUA-00 --> 67, USUA-0 --> 786\r\n if($rest >1 && $rest <=9){\r\n $nuevoCod = 'USUA-000'.$rest;\r\n }else{\r\n if($rest >=10 && $rest <=99){\r\n $nuevoCod = 'USUA-00'.$rest;\r\n }else{\r\n if($rest >=100 && $rest <=999){\r\n $nuevoCod = 'USUA-0'.$rest;\r\n }else{\r\n $nuevoCod = 'USUA-'.$rest; \r\n } \r\n } \r\n }\r\n }\r\n Database::disconnect();\r\n return $nuevoCod; // RETORNO DEL NUEVO CODIGO DE USUARIO\r\n }", "function nuevoIdInventarioUsuario() {\n\t\t$conUltimo=\"select id_inventario_usuario from inventario_usuario order by id_inventario_usuario desc limit 1\";\n\t\t$cons=new consecutivo(\"IIU\",$conUltimo);\n\t\t$this->idInventarioUsuario=$cons->retornar();\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the most recent value from the specified sequence in the database. This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
public function lastSequenceId($sequenceName) { $this->_connect(); return $this->fetchOne('SELECT ' . $this->quoteIdentifier($sequenceName, true) . '.CURRVAL FROM dual'); }
[ "protected function getLastSequenceValue(): ?int\n {\n $column = static::getSequenceColumnName();\n\n return $this->getSequence()->max($column);\n }", "public function lastSequenceId($sequenceName)\n {\n $this->_connect();\n $sql = 'SELECT '.$this->quoteIdentifier($sequenceName, true).'.CURRVAL FROM dual';\n\n return $this->fetchOne($sql);\n }", "public function getMaximumValue(array $sequence)\r\n\t{\r\n\t\tif (empty($sequence))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn max($sequence);\r\n\t}", "protected static function getLastSequence() {\n $botsCollection = new BotCollection();\n $botsCollection->add_sort('sequence', 'DESC');\n $botsCollection->load();\n\n $count = $botsCollection->get_count();\n if ($count != 0) {\n $data = &$botsCollection->items[0];\n return $data->get_data(\"sequence\");\n } else {\n return 'AAA0000';\n }\n }", "function getNextSequence()\n\t{\n\t\t$this->_makeSequence();\n\n\t\t$query = sprintf(\"select \\\"%ssequence\\\".\\\"nextval\\\" as \\\"seq\\\" from db_root\", $this->prefix);\n\t\t$result = $this->_query($query);\n\t\t$output = $this->_fetch($result);\n\n\t\treturn $output->seq;\n\t}", "public function getMaximumSequence()\n {\n $qb = $this->createQueryBuilder('l')\n ->select('l.sequence')\n ->orderBy('l.sequence', 'DESC')\n ->setMaxResults(1)\n ;\n\n $result = $qb->getQuery()->getOneOrNullResult();\n return ($result !== null) ? $result['sequence'] : 0;\n }", "public function getSeqNextValue($sequence);", "public static function lastId ($table, $primary = NULL)\n\t{\n\t\t$db = self::singleton ();\n\n\t\t$array = explode ('.', $table);\n\n\t\tif (sizeof ($array) == 2)\n\t\t{\n\t\t\t$table = $array [1];\n\t\t\t$schema = $array [0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table = $array [0];\n\t\t\t$schema = $db->getSchema ();\n\t\t}\n\n\t\tif (is_string ($primary) && trim ($primary) != '')\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$db->exec (\"BEGIN\");\n\n\t\t\t\t$sth = $db->prepare (\"SELECT pg_get_serial_sequence ('\". $schema .\".\". $table .\"', '\". $primary .\"') AS seq\");\n\n\t\t\t\t$sth->execute ();\n\n\t\t\t\t$obj = $sth->fetch (PDO::FETCH_OBJ);\n\n\t\t\t\tif (!$obj || is_null ($obj->seq))\n\t\t\t\t\tthrow new Exception ('Impossible to recovery sequence to column ['. $primary .'] on table ['. $schema .\".\". $table .'].');\n\n\t\t\t\t$sth = $db->prepare (\"SELECT last_value FROM \". $obj->seq);\n\n\t\t\t\t$sth->execute ();\n\n\t\t\t\t$db->exec (\"COMMIT\");\n\n\t\t\t\t$result = $sth->fetch (PDO::FETCH_OBJ);\n\n\t\t\t\tif ($result)\n\t\t\t\t\treturn $result->last_value;\n\n\t\t\t\ttoLog ('Impossible to get last sequence value to ['. $obj->seq .'].');\n\t\t\t}\n\t\t\tcatch (PDOException $e)\n\t\t\t{\n\t\t\t\t$db->exec (\"ROLLBACK\");\n\n\t\t\t\ttoLog ($e->getMessage ());\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$db->exec (\"ROLLBACK\");\n\n\t\t\t\ttoLog ($e->getMessage ());\n\t\t\t}\n\n\t\t$sql = \"SELECT a.adsrc AS seq\n\t\t\t\tFROM pg_class c\n\t\t\t\tJOIN pg_attrdef a ON c.oid = a.adrelid\n\t\t\t\tJOIN pg_namespace n ON c.relnamespace = n.oid\n\t\t\t\tWHERE c.relname = '\". $table .\"' AND n.nspname = '\". $schema .\"' AND a.adsrc ~ '^nextval'\";\n\n\t\t$sth = $db->prepare ($sql);\n\n\t\t$sth->execute ();\n\n\t\t$result = FALSE;\n\n\t\twhile ($obj = $sth->fetch (PDO::FETCH_OBJ))\n\t\t{\n\t\t\tif (is_null ($obj->seq) || is_numeric ($obj->seq) || !$obj->seq)\n\t\t\t\tcontinue;\n\n\t\t\t$sequence = str_replace (array ('::text', '::regclass', 'nextval(', ':', '(', ')', ' ', '\"', '\\''), '', trim ($obj->seq));\n\n\t\t\t$sequence = array_pop (explode ('.', $sequence));\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$db->exec (\"BEGIN\");\n\n\t\t\t\t$sthAux = $db->prepare (\"SELECT last_value FROM \". $schema .\".\". $sequence);\n\n\t\t\t\t$sthAux->execute ();\n\n\t\t\t\t$db->exec (\"COMMIT\");\n\n\t\t\t\t$result = $sthAux->fetch (PDO::FETCH_OBJ);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch (PDOException $e)\n\t\t\t{\n\t\t\t\t$db->exec (\"ROLLBACK\");\n\t\t\t}\n\t\t}\n\n\t\tif (!$result)\n\t\t\treturn NULL;\n\n\t\treturn $result->last_value;\n\t}", "private function getNextSequence(): string\n {\n $select = $this->connection->select();\n $select->from($this->meta->getSequenceTable(), 'MAX(sequence_value)');\n $lastValue = ($this->connection->fetchOne($select)) ?: 0;\n\n return $this->insertToSequence($lastValue + $this->meta->getActiveProfile()->getStep());\n }", "public function getLastSequence()\n {\n return $this->lastSequence;\n }", "public function lastInsertId($sequence=null)\n\t{\n\t\tif(!$sequence)\n\t\t\treturn parent::lastInsertId();\n\t\treturn parent::lastInsertId($sequence);\n\t}", "public static function getMaximumSequence()\n\t{\n\t\treturn (int) BackendModel::getContainer()->get('database')->getVar(\n\t\t\t'SELECT MAX(i.sequence)\n\t\t\t FROM navigation_block AS i'\n\t\t);\n\t}", "public function lastInsertId($sequence = null)\n {\n if (!$sequence) {\n return parent::lastInsertId();\n }\n\n return parent::lastInsertId($sequence);\n }", "static public function last()\n {\n return static::fetchOneWhere('1=1 ORDER BY ' . static::_quote_identifier(static::$_primary_column_name) . ' DESC');\n }", "function next_seq($seq) {\n\t\n\t\t$sql = \"SELECT NEXTVAL('\".$seq.\"');\";\n\t\t$info = $this->single($sql);\n\t\treturn $info[\"nextval\"];\n\t\n\t}", "public function getNextSequenceValue(): int\n {\n $column = static::getSequenceColumnName();\n $maxSequenceValue = $this->getSequence()->max($column);\n\n return $this->getSequence()->count() === 0\n ? static::getInitialSequenceValue()\n : $maxSequenceValue + 1;\n }", "public function repairTableSequence()\n {\n return $this->getConnection()->fetchColumn(\"SELECT setval('\" . $this->getTableSequenceName() . \"', (SELECT MAX(\" . $this->getUniqueId() . \") FROM \" . $this->getTableName() . \"))\");\n }", "public function getSequence() {\n\t\treturn $this->getData('seq');\n\t}", "public static function getNextId($sequence) {\n\t\t$seq = DB::getCollection(static::$collectionName)->findAndModify(\n\t\t\t\tarray('_id' => $sequence),\n\t\t\t\tarray('$inc' => array('seq' => 1)),\n\t\t\t\tnull,\n\t\t\t\tarray('new' => true, 'upsert' => true)\n\t\t);\n\t\treturn $seq['seq'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns full select by $additionalFields.
public function getItemsSelect(array $additionalFields): array { $select = $this->getItemsSelectPreset(); if(!empty($additionalFields)) { $select = array_merge($select, $additionalFields); } return $select; }
[ "public function select(...$fields) : QueryBuilder;", "final static function getSelectQuery()\n {\n $basic = [\n 'id' => static::$prefix . 'id',\n 'location' => static::$prefix . 'location',\n 'state' => static::$prefix . 'state',\n ];\n if (!static::$autoremovePrefix) {\n $basic = array_values($basic);\n }\n\n return self::DB()->select(array_merge($basic, static::$customFields));\n }", "public function getSelectFields();", "public function select($fields = []) {\n\t\t$this->_queryOptions['fields'] = array_merge($this->_queryOptions['fields'], $fields);\n\t}", "public function get_sql_select();", "function alsoSelect($fields) {\n is_array($fields) or $fields = func_get_args();\n $this->select( array_merge((array) $this->table->selects, $fields) );\n return $this;\n }", "protected function _getBaseSelect()\n {\n $baseSelect = new Zend_Db_Select(self::getDefaultAdapter());\n $fields = $this->getMapper()->getFields();\n\n if(empty($fields) && !empty($this->_logger))\n {\n $this->_logger->log(\n \"\\r\\n--------------------------- [\" . get_class($this) . '::_getBaseSelect] ----------------------' .\n \"\\r\\n FIELDS NOT FOUND !!!!!!\n \\r\\n---------------------------------------------------------------------------------------------\\r\\n\",\n Zend_Log::DEBUG\n );\n }\n $baseSelect\n ->from($this->_name, $fields);\n\n $joinedEntities = self::_getJoins($this->getMapper());\n\n foreach($joinedEntities as $join)\n {\n if($join->type == self::JOIN_INNER)\n {\n $baseSelect->joinInner(\n $join->table, '(' . $join->rule . ')', $join->fields\n );\n }\n else\n {\n $baseSelect->joinLeft(\n $join->table, '(' . $join->rule . ')', $join->fields\n );\n }\n }\n $this->_logQuery($baseSelect, '_getBaseSelect');\n return $baseSelect;\n }", "private function _buildFieldsForSelect()\n {\n // ----------------------------------------------------------\n // Select which fields to return in the query on the focus table\n // ----------------------------------------------------------\n $focus = strtolower($this->_focus);\n $fAlias = DaoMap::$map[$focus]['_']['alias'];\n $fields = array();\n $fields[] = '`' . $fAlias . '`.`id`';\n foreach (DaoMap::$map[$focus] as $field => $properties)\n {\n //entity metadata\n if (trim($field) === '_')\n continue;\n \n //if this is not a relationship\n if (!isset($properties['rel']))\n {\n $fields[] = '`' . $fAlias . '`.`' . $field . '`';\n continue;\n }\n \n //if this is a relationship\n switch ($properties['rel'])\n {\n // Don't return any of these field types\n case DaoMap::ONE_TO_MANY:\n case DaoMap::MANY_TO_MANY:\n {\n break;\n }\n default:\n $field .= 'Id';\n $fields[] = '`' . $fAlias . '`.`' . $field . '`';\n break;\n }\n }\n return $fields;\n }", "public function select($fields = [], $overwrite = false);", "protected function _initSelectFields()\n {\n $columns = $this->_select->getPart(Zend_Db_Select::COLUMNS);\n $columnsToSelect = array();\n foreach ($columns as $columnEntry) {\n list($correlationName, $column, $alias) = $columnEntry;\n if ($correlationName !== 'main_table') { // Add joined fields to select\n if ($column instanceof Zend_Db_Expr) {\n $column = $column->__toString();\n }\n $key = ($alias !== null ? $alias : $column);\n $columnsToSelect[$key] = $columnEntry;\n }\n }\n\n $columns = $columnsToSelect;\n\n $columnsToSelect = array_keys($columnsToSelect);\n\n if ($this->_fieldsToSelect !== null) {\n $insertIndex = 0;\n foreach ($this->_fieldsToSelect as $alias => $field) {\n if (!is_string($alias)) {\n $alias = null;\n }\n\n if ($field instanceof Zend_Db_Expr) {\n $column = $field->__toString();\n } else {\n $column = $field;\n }\n\n if (($alias !== null && in_array($alias, $columnsToSelect)) ||\n // If field already joined from another table\n ($alias === null && isset($alias, $columnsToSelect))) {\n continue;\n }\n\n $columnEntry = array('main_table', $field, $alias);\n array_splice($columns, $insertIndex, 0, array($columnEntry)); // Insert column\n $insertIndex ++;\n\n }\n } else {\n array_unshift($columns, array('main_table', '*', null));\n }\n\n $this->_select->setPart(Zend_Db_Select::COLUMNS, $columns);\n\n return $this;\n }", "public static function selectFields() {\n\t\treturn [\n\t\t\t'event_id',\n\t\t\t'event_type',\n\t\t\t'event_variant',\n\t\t\t'event_agent_id',\n\t\t\t'event_agent_ip',\n\t\t\t'event_extra',\n\t\t\t'event_page_id',\n\t\t\t'event_deleted',\n\t\t];\n\t}", "public function selectFields(string ...$fields)\n {\n $newModifiedRows = [];\n\n $this->iterate(function($index, $row) use(&$fields, &$newModifiedRows){\n foreach ($row as $field => $value) {\n if(in_array($field, $fields)){\n $newModifiedRows[$index][$field] = $value;\n }\n }\n });\n $this->modifiedRows = $newModifiedRows;\n\n return $this;\n }", "public function get_sql_select() {\n $this->init_customfield_data();\n return $this->sql_select;\n }", "public static function selectFields() {\n\t\treturn array_merge(\n\t\t\tRevision::selectFields(),\n\t\t\tarray( 'fr_rev_id', 'fr_page_id', 'fr_rev_timestamp',\n\t\t\t\t'fr_user', 'fr_timestamp', 'fr_quality', 'fr_tags', 'fr_flags',\n\t\t\t\t'fr_img_name', 'fr_img_sha1', 'fr_img_timestamp' )\n\t\t);\n\t}", "public function buildSelectQuery() {\n\n $sql = $this->builder->select(\n $this->metadata->getTable(),\n $this->metadata->getModelName(),\n $this->getFields()\n );\n\n $sql .= $this->jointures;\n\n if ($this->where) $sql .= $this->builder->addWhere($this->where);\n if ($this->order) $sql .= $this->order;\n\n if ($this->limit) {\n\n $sql .= $this->builder->addLimitOffset();\n $this->parameters[] = $this->limit;\n $this->parameters[] = $this->offset;\n }\n\n return $sql;\n }", "public function getSelectFields()\n\t{\n\t\treturn $this->selectFields;\n\t}", "protected function convertSelectFields() {\n sdp(__FUNCTION__);\n sdp($this->sql_object->tables, '$this->sql_object->tables');\n sdp($this->sql_object->fields, '$this->sql_object->fields');\n\n // Save first table items.\n $table0 = $this->sql_object->tables[0];\n // Select all fields.\n // @todo An asterisk may occur in other parts of the field list with a table qualifier.\n // Individual fields from a table may be added in addition to an asterisk on that table.\n if (FALSE && $this->sql_object->fields[0]->name == '*') {\n $this->output[] = \" ->fields()\";\n }\n // Select individual fields.\n else {\n // Group fields by table. If no table is set for a field, then use the first table.\n // If field has an alias, then the field needs to be grouped individually.\n $all_fields = $table_fields = $aliased_fields = array();\n foreach ($this->sql_object->fields as $id => $field) {\n if ($field->name == '*') {\n // If no table is set for a field, then use the first table.\n $table_alias = $field->table ? $field->table : ($table0->alias ? $table0->alias : $table0->name);\n // Always add to output in case individual fields from the table are also included.\n $this->output[] = \" ->fields('$table_alias')\";\n }\n elseif ($field->alias) {\n $aliased_fields[] = $field;\n }\n else {\n if ($field->table) {\n $table_fields[$field->table][] = $field->name;\n }\n else {\n $table_fields[$this->sql_object->tables[0]->alias][] = $field->name;\n }\n }\n }\n\n // Add fields for each table.\n if ($table_fields) {\n foreach ($table_fields as $table_alias => $fields) {\n $this->output[] = \" ->fields('$table_alias', array('\" . join(\"', '\", $fields) . \"'))\";\n }\n }\n\n // Add aliased fields.\n if ($aliased_fields) {\n // End the current expression as addField() returns a field object not a\n // select query object.\n $this->output[count($this->output) - 1] .= ';';\n foreach ($aliased_fields as $field) {\n // If no table is set for a field, then use the first table.\n $table_alias = $field->table ? $field->table : ($table0->alias ? $table0->alias : $table0->name);\n $this->output[] = \"\\$query->addField('$table_alias', '\" . $field->name . \"', '\" . $field->alias . \"');\";\n }\n }\n }\n }", "public function select($fields, $condition);", "public function select() {\r\n\t\t$this->sql_query = \"SELECT \".$this->field.\" FROM \".$this->table_name.\" \".(implode(\" \",$this->sql));\r\n\t\treturn $this->querysql();\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the [methodofpaymentid] column value.
public function getMethodofpaymentid() { return $this->methodofpaymentid; }
[ "public function getPaymentMethodId();", "public function getPaymentMethodId() {\n\t\treturn $this->paymentMethodId;\n\t}", "public function getPaymentMethodId()\n {\n return $this->getParameter('paymentMethodId');\n }", "protected function getFingerprintByPaymentMethodId()\n {\n return $this->getPaymentMethod()\n ? $this->getPaymentMethod()->getMethodId()\n : 0;\n }", "public function getPaymentId();", "public function getPaymentMethod()\n {\n $paymentMethods = $this->paymentMethodRepository->allForPlugin(LidlPaymentMethodService::PLUGIN_KEY);\n\n if (!is_null($paymentMethods)) {\n foreach ($paymentMethods as $paymentMethod) {\n if ($paymentMethod->paymentKey == LidlPaymentMethodService::PAYMENT_KEY) {\n return $paymentMethod->id;\n }\n }\n }\n\n return 'no_paymentmethod_found';\n }", "public function getPaymentIdColumn()\n {\n if (isset($this->config['payment_id_column'])) {\n return $this->config['payment_id_column'];\n }\n\n return 'stripe_card_id';\n }", "function getStripePaymentMethodId() {\n\t\tglobal $page;\n\n\t\t$payment_methods = $page->paymentMethods();\n\t\t$stripe_index = arrayKeyValue($payment_methods, \"gateway\", \"stripe\");\n\t\tif($stripe_index !== false) {\n\t\t\treturn $payment_methods[$stripe_index][\"id\"];\n\t\t}\n\n\t\treturn false;\n\t}", "public function getPaymentId()\n {\n return $this->paymentId;\n }", "public function getPaymentId()\n {\n return $this->getParameter('paymentid');\n }", "public function getPaymentId()\n {\n return $this->getParameter('paymentId');\n }", "public function getDeliveryMethodId()\n\t{\n\t\t$retval = '';\n\t\tif (isset($this->data[self::KEY_DELIVERY_METHOD_ID])) {\n\t\t\t$retval = $this->data[self::KEY_DELIVERY_METHOD_ID];\n\t\t}\n\t\treturn $retval;\n\t}", "public function getPayment_no()\n {\n return $this->payment_no;\n }", "public function getOrderPaymentId();", "public function getMpPaymentId();", "public function getPaymentMethod() \n {\n return $this->_fields['PaymentMethod']['FieldValue'];\n }", "public function getPaymentCode()\n {\n return $this->payment_code;\n }", "private function getPaymentId()\n {\n return Session::get('mall.payment.id');\n }", "public function getPaymentMethod();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the default element decorators
abstract protected function addDefaultElementDecorators();
[ "protected function addDefaultElementDecorators()\n {\n $this->setDecorators(array(\n 'FormElements',\n array('Form', array('class'=>'form'))));\n\n $this->setElementDecorators(array(\n array('ViewHelper'),\n array('Description', array('tag' => 'p', 'class'=>'help-block')),\n array('Errors', array('class'=> 'alert alert-danger')),\n array('Label'),\n array('HtmlTag', array(\n 'tag' => 'div',\n 'class'=> array(\n 'callback' => function($decorator) {\n if($decorator->getElement()->hasErrors()) {\n return 'form-group has-error';\n } else {\n return 'form-group';\n }\n })\n ))\n ));\n\n $this->setDisplayGroupDecorators(array(\n 'FormElements',\n 'Fieldset',\n ));\n }", "abstract protected function addCustomElementDecorators();", "public function initDefaultElementsDecorators()\t{\n \n \n $this->addPrefixPath('App_Form_Decorator', 'App/Form/Decorator/', 'decorator'); \n \n\t\t// Standard\n\t\t$standardDecorators = array(\n\t\t\t'ViewHelper',\n array('ErrorSpan', array('tag' => 'span')),\n array('decorator' => array('InputWrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'controls')), \n array('Label','options' => array('class' => 'control-label')),\n\t\t\t array('decorator' => array('Wrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'control-group')) \n\t\t) ;\n\t\t\n\t\t$this->setDefaultElementsDecorators($this->_standardElements, $standardDecorators) ;\n\n\t\t// Hidden\n\t\t$hiddenDecorators = array(\n\t\t\t'ViewHelper',\n\t\t\tarray('decorator' => array('Wrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'hiddenHolder')) \n\t\t) ;\n\n\t\t$this->setDefaultElementsDecorators($this->_hiddenElements, $hiddenDecorators) ;\n\n\t\t// Buttons\n\t\t$actionDecorators = array(\n\t\t\t'ViewHelper', \n\t\t\tarray('decorator' => array('Wrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'form-actions')) \n\t\t) ;\n\n\t\t$this->setDefaultElementsDecorators($this->_actionElements, $actionDecorators) ;\n\n\t\t// Multi Form Elements\n\t\t$multiDecorators = array(\n\t\t\t'ViewHelper',\n\t\t\tarray('decorator' => array('MultiWrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'controls')),\n\t\t\tarray('Label','options' => array('class' => 'control-label')), \n\t\t\tarray('decorator' => array('Wrapper' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'control-group')) \n\t\t) ;\n\n\t\t$this->setDefaultElementsDecorators($this->_multiElements, $multiDecorators) ;\n \n\t}", "public static function addDefaultDecorators(Zend_Form_Element $element)\n {\n $fqName = $element->getName();\n if( null !== ($belongsTo = $element->getBelongsTo()) ) {\n $fqName = $belongsTo . '-' . $fqName;\n }\n $element\n ->addDecorator('Description', array('tag' => 'p', 'class' => 'description', 'placement' => 'PREPEND'))\n ->addDecorator('HtmlTag', array('tag' => 'div', 'id' => $fqName . '-element', 'class' => 'form-element'))\n ->addDecorator('Label', array('tag' => 'div', 'tagOptions' => array('id' => $fqName . '-label', 'class' => 'form-label')))\n ->addDecorator('HtmlTag2', array('tag' => 'div', 'id' => $fqName . '-wrapper', 'class' => 'form-wrapper'));\n }", "public function loadDefaultDecorators()\n {\n if ($this->loadDefaultDecoratorsIsDisabled()) {\n return;\n }\n\n $decorators = $this->getDecorators();\n if (empty($decorators)) {\n $this->addDecorator(\"PrepareElements\")\n ->addDecorator(\"FormVisibleElements\")\n ->addDecorator(\"HtmlTag\", array(\"tag\" => \"ol\", \"class\" => \"bear-form\"))\n ->addDecorator(\"FormHiddenElements\")\n ->addDecorator(\"Form\")\n ->addDecorator(\"FormErrors\", array(\"placement\" => \"prepend\"));\n }\n }", "public function loadDefaultDecorators()\n {\n $this->setDecorators(\n array(\n 'FormElements',\n array('Form', array('class' => 'gotchange-form')),\n array('HtmlTag', array('tag' => 'div', 'class' => 'form'))\n )\n );\n }", "public function loadDefaultDecorators() {\n\n\t\t/* on ajoute un emplacement e decorateurs à l'élément */\n\t\t$this->addPrefixPath('Sea_Form_Decorator', 'Sea/Form/Decorator', 'decorator');\n\t\t\n\t\t$this->setDecorators(array(\tarray('SeaErrors'),\n\t\t\t\t\t\t\t\t\tarray('ViewHelper', array('placement' => 'PREPEND')),\n\t\t\t\t\t\t array(array('input' => 'HtmlTag'), array('tag' => 'td', 'class' => 'form-input')),\n\t\t\t\t\t\t\t\t array('SeaLabel'),\n\t\t\t\t\t\t\t\t array(array('div' => 'HtmlTag'), array('tag' => 'tr'))));\n\t\t\n\t}", "public function loadDefaultDecorators() {\n\n\t\t/* on ajoute un emplacement e decorateurs à l'élément */\n\t\t$this->addPrefixPath('Sea_Form_Decorator', 'Sea/Form/Decorator', 'decorator');\n\n\t\t$this->setDecorators(array(\tarray('SeaErrors'),\n\t\t\t\t\t\t\t\t\tarray('ViewHelper', array('placement' => 'PREPEND')),\n\t\t\t\t\t\t\t\t\tarray('Image'),\n\t\t\t\t\t\t array(array('input' => 'HtmlTag'), array('tag' => 'td', 'class' => 'form-input')),\n\t\t\t\t\t\t\t\t array('SeaLabel'),\n\t\t\t\t\t\t\t\t array(array('div' => 'HtmlTag'), array('tag' => 'tr'))));\n\n\t}", "public function loadDefaultDecorators ()\n {\n $this->setDecorators([['ViewScript', ['viewScript' => 'forms/quotegen/quote/profitability-form.phtml']], 'Form']);\n }", "protected function _initDecorators() {\n\t\t$this->setDecorators(array(\n\t\t\t'FormElements',\n\t\t\t'Form'\n\t\t));\n\t\t$this->removeDecorator('HtmlTag');\n\n\t\t//setting up decorators for all form elements\n\t\t//changing html wrapper DtDd to p\n\t\t$this->setElementDecorators(array(\n\t\t\t'ViewHelper',\n\t\t\t'Errors',\n\t\t\t'Label',\n\t\t\tarray('HtmlTag', array('tag' => 'p'))\n\t\t));\n\t\t// remove Label decorator from submit button\n\t\t$this->getElement('doSearch')->removeDecorator('Label');\n\t\t$this->getElement('resultsPageId')->removeDecorator('HtmlTag');\n\t}", "public function getDefaultElementDecorator()\n {\n return $this->defaultElementDecorator;\n }", "protected function _addCustomDecorators() {}", "public function getDefaultElementDecorators($className)\t{\n\t\treturn $this->_defaultElementDecorators[$className] ;\n\t}", "public function getDefaultDecorator();", "public function loadDefaultDecorators()\n {\n if ($this->loadDefaultDecoratorsIsDisabled()) {\n return $this;\n }\n parent::loadDefaultDecorators();\n $this->addDecorator('Label', array(\n 'tag' => 'dt',\n 'disableFor' => true\n ));\n return $this;\n }", "public function loadDefaultDecorators()\n {\n if ($this->loadDefaultDecoratorsIsDisabled()) {\n return $this;\n }\n parent::loadDefaultDecorators();\n $this->removeDecorator('Label');\n \t$this->removeDecorator('DtDdWrapper');\n return $this;\n }", "public function loadDefaultDecorators()\n {\n \t// nothing for now..\n\t\treturn;\n }", "public function fixDecorators()\n {\n //Needed for alternating rows\n $this->_alternate = new \\MUtil_Lazy_Alternate(array('odd', 'even'));\n\n foreach ($this as $name => $element) {\n if ($element instanceof \\MUtil_Form_Element_Html) {\n $this->_fixDecoratorHtml($element);\n\n } elseif ($element instanceof \\Zend_Form_Element_Hidden || $element instanceof \\Zend_Form_Element_Submit) {\n $this->_fixDecoratorHiddenSubmit($element);\n\n } elseif ($element instanceof \\Zend_Form_Element) {\n $this->_fixDecoratorElement($element);\n\n } elseif ($element instanceof \\Zend_Form_DisplayGroup) {\n $this->_fixDecoratorDisplayGroup($element);\n\n }\n }\n }", "public function decorate()\n {\n $this->element->addClass('panel');\n\n $context = 'default';\n if ($this->element->hasContext()) {\n $context = $this->element->getContext();\n }\n\n $this->element->addClass('panel-'.$context);\n\n $this->element->headerWrapper->addClass('panel-heading');\n $this->element->footerWrapper->addClass('panel-footer');\n $this->element->contentWrapper->addClass('panel-body');\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hidden Overwrite of the FormHelper hidden method to allow for not locking the field when using the Security Component We add a new argument of secureValue (default to true), if set to false, hidden field values can be changed Thanks to
function hidden($fieldName, $options = array()) { $secure = $secureValue = true; if (isset($options['secure'])) { $secure = $options['secure']; unset($options['secure']); } if (isset($options['secureValue'])) { $secureValue = $options['secureValue']; unset($options['secureValue']); } $options = $this->Form->_initInputField($fieldName, array_merge( $options, array('secure' => false) )); $model = $this->model(); if ($fieldName !== '_method' && $model !== '_Token' && $secure && $secureValue) { $this->Form->__secure(null, '' . $options['value']); } elseif ($fieldName !== '_method' && $model !== '_Token' && $secure && !$secureValue) { $this->Form->__secure(); } return sprintf( $this->Html->tags['hidden'], $options['name'], $this->Form->_parseAttributes($options, array('name', 'class'), '', ' ') ); }
[ "function testHiddenCanUnsecureTheValue() {\n\t\tMock::generatePartial('FormHelper', 'MockFormHelperSecure', array('__secure'));\n\t\t$this->helper->Form = new MockFormHelperSecure();\n\n\t\t$this->helper->hidden('Test.foo', array('secureValue'));\n\t\t$this->helper->Form->expectOnce('__secure', array());\n\t}", "private function updateSecureValue()\n {\n if (null === $this->get(self::KEY_SECURE)) {\n $this->set(self::KEY_SECURE, $this->request->isSecure());\n }\n }", "function addHiddenSecurityFields ()\r\n\t{\r\n\t\t# Firstly (since username may be in use as a key) create a hidden username if required and a username is supplied\r\n\t\t$userCheckInUse = ($this->settings['user'] && $this->settings['userKey']);\r\n\t\tif ($userCheckInUse) {\r\n\t\t\t$securityFields['user'] = $this->settings['user'];\r\n\t\t}\r\n\t\t\r\n\t\t# Create a hidden timestamp if necessary\r\n\t\tif ($this->settings['timestamping']) {\r\n\t\t\t$securityFields['timestamp'] = $this->timestamp;\r\n\t\t}\r\n\t\t\r\n\t\t# Create a hidden IP field if necessary\r\n\t\tif ($this->settings['ipLogging']) {\r\n\t\t\t$securityFields['ip'] = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\t\r\n\t\t# Make an internal call to the external interface\r\n\t\t#!# Add security-verifications as a reserved word\r\n\t\tif (isSet ($securityFields)) {\r\n\t\t\t$this->hidden (array (\r\n\t\t\t 'name'\t=> 'security-verifications',\r\n\t\t\t\t'values'\t=> $securityFields,\r\n\t\t\t));\r\n\t\t}\r\n\t}", "private function prepareHiddenInput(){\r\n\t echo (isset($this->settings['before_field']))? $this->settings['before_field']:null; //Aded by WCD\r\n\t\techo '<input type=\"hidden\" ';\r\n\t\techo 'name = \"'.$this->name.'\" ';\r\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\r\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\r\n echo (isset($this->settings['style']))? $this->settings['style']:null; //Aded by WCD\r\n\t\techo ' />';\r\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null; //Aded by WCD\t\r\n\t}", "function input_hidden($name, $value) {\r\n\t\t$this->data = $this->tag(\"input\", array(\"type\" => \"hidden\", \"name\" => $name, \"id\" => $name, \"value\" => $value));\r\n\t}", "function dsf_form_hidden($name, $value = '', $parameters = '') {\n $field = '<input type=\"hidden\" name=\"' . dsf_output_string($name) . '\" id=\"' . dsf_output_string($name) . '\"';\n\t\n if (dsf_not_null($value)) {\n $field .= ' value=\"' . dsf_output_string($value) . '\"';\n }\n\n if (dsf_not_null($parameters)) $field .= ' ' . $parameters;\n\n $field .= ' />';\n\n return $field;\n }", "private function inputHidden()\n {\n ?>\n <input type=\"hidden\" name=\"_token\" value=\"<?= $this->key_csfr ?>\"/>\n <?php\n }", "function neatline_hiddenElement($name, $value)\n{\n\n $element = new Zend_Form_Element_Hidden($name);\n $element->setValue($value)\n ->setDecorators(array('ViewHelper'));\n\n return $element;\n\n}", "static function hidden_input($name,$value){\n\t\treturn \"<input type='hidden' name='$name' value='$value'/>\";\n\t}", "function hidden_field_tag($name,$value=null, $options=array())\n{\n $options['type'] = 'hidden';\n\treturn text_field_tag($name, $value, $options);\n}", "public function set_hidden($value = true)\r\n\t{\n\t\tif (!$value) {\n\t\t\treturn $this->remove_attr('hidden');\n\t\t}\n\r\n\t\treturn $this->set_attr('hidden', 'hidden');\r\n\t}", "function addHiddenField($name,$value) {\r\n $element['type'] = 'hidden';\r\n $element['name'] = $name;\r\n $element['value'] = $value;\r\n $element['code'] = \"<input type='hidden' name='{$element['name']}' value='{$element['value']}'>\";\r\n\r\n return $this->addElement($element);\r\n }", "function open_hidden($value){\n \tglobal $inputval;\n \tglobal $in;\n// echo $this->attributes['VAR'].\":\".$value.\"<hr>\";\n \tif ($value=='sysdate'){\n \t\t$value=date(\"dmY\");\n \t}\n \t\tif ($value=='') {\n \t\t\tif (count($this->values)>0)\n \t\t\t\tforeach($this->values as $key => $val) {\n\t \t\t\t\t$value=$key;\n\t \t\t\t\t$inputval[$this->attributes['VAR']]=$value;\n\t \t\t\t\t#echo \"<hr> \".$this->attributes['VAR'].\" ==$value\";\n\t \t\t\t}\n \t\t\t}\n \t\t\tif ($in[$this->attributes['VAR']]!='') $value=$in[$this->attributes['VAR']];\n \t\t#\techo $this->attributes['VAR'].\" - $value<hr>\";\n if (isset($in['TB_COLL']) && $in['TB_COLL']!='') $this->input_field='<input type=\"hidden\" name=\"TB_COLL_'.$in['ID_REF'].'_'.$this->attributes['VAR'].'\" value=\"'.$value.'\"/>';\n else $this->input_field='<input type=\"hidden\" name=\"'.$this->attributes['VAR'].'\" value=\"'.$value.'\"/>';\n\n }", "public function render_hidden_input()\n {\n }", "public function load_hidden()\n {\n echo \"<input type='hidden' name='$this->name' id='$this->id'\"\n .(($this->class) ? \" class='$this->class'\" : \"\")\n .(($this->placeholder) ? \" placeholder='$this->placeholder'\" : \"\")\n .\" value='$this->value'/>\";\n }", "public function add_protected_value( $name, $value ) {\n\t\t// We need to cast the $value as a string, so that when the values are\n\t\t// sorted to build the nonce action string prior to the form submission\n\t\t// the order is the same as after the form has posted (& all the values\n\t\t// have been converted to strings during the form submission)\n\t\t$this->protected_hidden_fields[ $name ] = (string) $value;\n\t}", "public function setAsHidden();", "private function hidden_terra_field( $name, $value ) {\n\t\t$this->hidden_field( $name, $value, 'terra-' );\n\t}", "function addHiddenField($id,$name,$value,$form)\r\n\t{\r\n\t\t$type = 'hidden';\r\n\t\t$class = 'hidden';\r\n\r\n\t\treturn $this->addTrayElement($type,$id,$name,$value,$class,$form);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the gifted products as product objects in an array
public function getGiftedAsProducts() { return $this->_itemCollection->getItems(); }
[ "public function getProducts(){\n return Data::productArray();\n }", "public function product()\n {\n return array_product($this->items);\n }", "public function products() {\n return \\ProductGroups::with('products')->get()->toArray();\n }", "public function getProductArray() {\n $newList= [];\n\n for($i= 0; $i < $this->size(); $i++) {\n array_push(\n $newList,\n $this->getProduct($i)->getItem()\n );\n }\n\n return $newList;\n }", "public function getSimpleProducts(): array;", "public function product() {\n\t\treturn array_product($this->_data);\n\t}", "public function getProducts()\n {\n $productIds = [];\n foreach ($this->getReviews() as $review) {\n $productIds[$review->getEntityPkValue()] = true;\n }\n \n return $this->productCollectionFactory->create()\n ->addAttributeToSelect('name')\n ->addIdFilter(array_keys($productIds));\n }", "public function order_products()\n {\n $products = array();\n foreach ($this->products->groupBy('id') as $key => $order_products) {\n $product = $order_products->first();\n $product->quantity = $order_products->count();\n $product->personalizable = false;\n array_push($products, $product);\n }\n $creations = $this->creations_products()->toArray();\n\n return array_merge($products, $creations);\n }", "public function getProducts(){\n Bugzilla_DAO::connectDatabase();\n $handler = Bugzilla_DAO::getDB()->prepare(\"SELECT p.name as name, GROUP_CONCAT( c.name SEPARATOR '~' ) as comps FROM products p, components c WHERE c.product_id = p.id GROUP BY p.name\");\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n\n $results = array();\n while ($row = $handler->fetch(PDO::FETCH_ASSOC)) {\n array_push($results, Product::invokePlainComponents($row['name'], $row['comps']));\n }\n return $results;\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function getProducts()\n {\n $order = $this->getOrder();\n $products = [];\n\n foreach ($order->getAllVisibleItems() as $item) {\n $product = [\n 'id' => $item->getProductId(),\n 'quantity' => (int) $item->getQtyOrdered(),\n 'price' => (float) $item->getBasePrice(),\n ];\n\n $products[] = $product;\n }\n\n return json_encode($products);\n }", "public function products()\n {\n return $this->wishlist()->first()->products();\n }", "public function getGiftWrapProductDetail() {\n\t\t\n\t\t$detail['product_id'] = 238;\n\t\t$detail['variety_id'] = 380;\n\t\t$detail['price_gross'] = 2.10;\n\t\t$detail['image'] = 'var/files/products/gift_wrap.png';\n\t\t$detail['title'] = 'JING Gift Wrap';\n\t\t\n\t\t$gift_wrap_products[] = $detail;\n\t\t\n\t\t$detail['product_id'] = 238;\n\t\t$detail['variety_id'] = 686;\n\t\t$detail['price_gross'] = 2.10;\n\t\t$detail['image'] = 'var/files/Packs/11065KH_Giftbox1.jpg';\n\t\t$detail['title'] = 'JING Gift Bag';\n\t\t\n\t\t$gift_wrap_products[] = $detail;\n\t\t\n\t\treturn $gift_wrap_products;\n\t}", "public static function get_products() {\n\n $products = (new CatalogProduct)\n ->with('meta')\n ->references('meta')\n ->orderBy('meta.name', 'desc')\n ->get()\n ;\n #die;\n\n #Helper::smartQueries(1);\n #die;\n\n #$products = DicLib::extracts($products, null, true, false);\n\n Helper::tad($products);\n\n return $products;\n }", "public function getProducts();", "public function get_products()\n {\n return $this->desiredProducts ? $this->desiredProducts : $this->products;\n }", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function getProducts()\n\t{\n\t\t/**\n\t\t* todo\n\t\t*/ \n\t}", "public function getProductsForTemplate() {\r\n\t\t$dbr = wfGetDB(DB_SLAVE);\r\n\t\t$product = PonyDocsProduct::GetProducts();\r\n\t\t$productAry = array();\r\n\r\n\t\tforeach ($product as $p) {\r\n\r\n\t\t\t// Only add product to list if it has versions visible to this user\r\n\t\t\t$valid = FALSE;\r\n\t\t\t$versions = PonyDocsProductVersion::LoadVersionsForProduct($p->getShortName());\r\n\t\t\tif (!empty($versions)) {\r\n\t\t\t\t$valid = TRUE;\r\n\t\t\t} elseif (empty($versions)) {\r\n\t\t\t\t// Check for children with visibile versions\r\n\t\t\t\tforeach (PonyDocsProduct::getChildProducts($p->getShortName()) as $childProductName) {\r\n\t\t\t\t\t$childVersions = PonyDocsProductVersion::LoadVersionsForProduct($childProductName);\r\n\t\t\t\t\tif (!empty($childVersions)) {\r\n\t\t\t\t\t\t$valid = TRUE;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($valid) {\r\n\t\t\t\t$productAry[$p->getShortname()] = array(\r\n\t\t\t\t\t'name' => $p->getShortName(),\r\n\t\t\t\t\t'label' => $p->getLongName(),\r\n\t\t\t\t\t'description' => $p->getDescription(),\r\n\t\t\t\t\t'parent' => $p->getParent(),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $productAry;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
AWeberEntry should be an AWeberResponse
public function testShouldBeAnAWeberResponse() { $this->assertTrue(is_a($this->entry, 'AWeberResponse')); }
[ "public function get_aweber_object() {\r\n\r\n\t\t// Include AWeber API library.\r\n\t\t$this->include_api();\r\n\r\n\t\t// Get API tokens.\r\n\t\t$tokens = $this->get_api_tokens();\r\n\r\n\t\t// If tokens are empty, return.\r\n\t\tif ( empty( $tokens['application_key'] ) && empty( $tokens['application_secret'] ) && empty( $tokens['request_token'] ) && empty( $tokens['oauth_verifier'] ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Initialize new AWeber API object.\r\n\t\t$aweber = new AWeberAPI( $tokens['application_key'], $tokens['application_secret'] );\r\n\r\n\t\t// Assign AWeber credentials to object.\r\n\t\t$aweber->user->requestToken = $tokens['request_token'];\r\n\t\t$aweber->user->verifier = $tokens['oauth_verifier'];\r\n\t\t$aweber->user->accessToken = $this->get_access_token();\r\n\t\t$aweber->user->tokenSecret = $this->get_access_token_secret();\r\n\r\n\t\treturn $aweber;\r\n\r\n\t}", "public function testEntryByRequest()\n {\n }", "public function test_api_entry_retrieval() {\n\t\t$entry = $this->get_test_entry( true );\n\n\t\t$atts = array(\n\t\t\t'id' => $entry->id,\n\t\t\t'fields' => FrmField::get_all_for_form( $entry->form_id, '', 'include' ),\n\t\t\t'user_info' => false,\n\t\t\t'format' => 'array',\n\t\t\t'include_blank' => true,\n\t\t);\n\n\t\t$data_array = FrmEntriesController::show_entry_shortcode( $atts );\n\t\t$expected_array = $this->expected_array( $entry, $atts );\n\n\t\t$this->compare_array( $expected_array, $data_array );\n\t}", "public function setUp() {\n $this->adapter = get_mock_adapter();\n $url = '/accounts/1/lists/303449';\n $data = $this->adapter->request('GET', $url);\n $this->entry = new AWeberEntry($data, $url, $this->adapter);\n }", "public function testGettingSingleBeerInformationUsingActualAPI()\n {\n // create a new PunkAPI object. Don't pass in a custom handle with\n // mocks for API replies. By omitting the handle parameters, we'll\n // ensure that the PunkAPI object actually contacts the Punk API\n // for the beer information\n $punkAPI = new PunkAPI();\n\n // attempt to retrieve the information for the beer with id 5\n // (should return a Beer object)\n $beer = $punkAPI->single(5);\n\n // check that we've got a beer object back\n $this->assertInstanceOf(\n Beer::class,\n $beer,\n \"PunkAPI->single() didn't return a Beer object.\"\n );\n }", "public function getAber($param);", "public function testCreateSuccessWithAdapter() {\n \n // Define the fake AWeber API responses.\n $getCollectionRsp = \n<<<EOT\n{\"total_size\": 0, \"start\": 0, \"entries\": [], \"resource_type_link\" : \"https://api.aweber.com/1.0/#custom_field-page-resource\"}\nEOT;\n\n $postCustomFieldRsp =\n<<<EOT\nHTTP/1.1 201 Created\\r\\nLocation: https://api.aweber.com/1.0/accounts/12345/lists/67890/custom_fields/1\\r\\n\\r\\n\nEOT;\n\n $getCustomFieldRsp =\n<<<EOT\nHTTP/1.1 200 Ok\\r\\nDate: Mon, 30 Dec 2013 19:16:13 GMT\\r\\nContent-Type: application/json\\r\\nContent-Length: 225\\r\\n\\r\\n\\r\\n{\"name\": \"Field With Spaces\", \"is_subscriber_updateable\": false, \"self_link\": \"https://api.aweber.com/1.0/accounts/12345/lists/67890/custom_fields/1\", \"resource_type_link\": \"https://api.aweber.com/1.0/#custom_field\", \"id\": 1}\nEOT;\n\n \n // Create the AWeber object\n $consumerKey = \"consumerkey\";\n $consumerSecret = \"consumersecret\";\n $aweber = new AWeberAPI($consumerKey, $consumerSecret);\n\n // Set up the cURL Stub\n $stub = $this->getMock('CurlObject');\n $stub->expects($this->any())\n ->method('execute')\n ->will($this->onConsecutiveCalls($postCustomFieldRsp,\n $getCustomFieldRsp));\n $aweber->adapter->curl = $stub;\n\n // Create an empty custom field collection to work on.\n $url = \"/accounts/12345/lists/67890/custom_fields\"; \n $data = json_decode($getCollectionRsp, true); \n $custom_fields = new AWeberCollection($data, $url, $aweber->adapter);\n \n // Finally the actual unit test. Create the new custom field\n $rsp = $custom_fields->create(array('name' => 'Field With Spaces'));\n $this->assertEquals($rsp->data['name'],'Field With Spaces'); \n }", "public function testCanAccessBeerDetail()\n {\n $beer = factory(Beer::class)->create();\n\n $this->get('/beers/' . $beer->id)->assertStatus(200);\n }", "public function testResponseContents()\n {\n $response = self :: $beerMapResponse->asArray();\n\n $this->assertArrayHasKey(\"description\", $response);\n $this->assertArrayHasKey(\"numFound\", $response);\n $this->assertArrayHasKey(\"payload\", $response);\n $this->assertGreaterThan(20, count($response[\"payload\"]));\n\n $breweries = $response[\"payload\"];\n for ($i = 0; $i < 3; $i++) {\n $this->assertArrayHasKey('id', $breweries[$i]);\n $this->assertNotNull('name', $breweries[$i]);\n $this->assertNotNull('reviewlink', $breweries[$i]);\n $this->assertNotNull('city', $breweries[$i]);\n $this->assertNotNull('street', $breweries[$i]);\n }\n }", "public function testGetOneBeerWithAValidId()\n {\n // read the json for a single beer response from the local file\n $singleBeerJson = file_get_contents('tests/single_beer_json.json');\n\n // create a mock and queue a single response\n $mock = new MockHandler(\n [\n new Response(200, [], $singleBeerJson)\n ]\n );\n $handlerStack = HandlerStack::create($mock);\n\n // create a new Guzzle\\Http client, configured to use the custom handler\n // stack we've just created\n $client = new Client(\n [\n 'handler' => $handlerStack\n ]\n );\n\n // create a new PunkAPI object and inject the client with mocks into\n // the PunkAPI constructor\n $punkAPI = new PunkAPI($client);\n\n // attempt to retrieve the information for the beer with id 1\n // (should return a Beer object)\n $beer = $punkAPI->single(1);\n\n // check that we've got a beer object back\n $this->assertInstanceOf(\n Beer::class,\n $beer,\n \"PunkAPI->single() didn't return a Beer object.\"\n );\n }", "public function renderRichResponseItem();", "public function testWeCanGetABeerObjectFromTheBeerCollectionObject()\n {\n $this->assertInstanceOf(\n Beer::class,\n $this->collectionOfBeers->current(),\n \"BeerCollection->current() doesn't return a Beer object.\"\n );\n }", "public function testGettingASingleBeerWithAnInvalidId()\n {\n // create a mock and queue a single response\n $mock = new MockHandler(\n [\n new Response(404, [], '')\n ]\n );\n $handlerStack = HandlerStack::create($mock);\n\n // create a new Guzzle\\Http client, configured to use the custom handler\n // stack we've just created\n $client = new Client(\n [\n 'handler' => $handlerStack\n ]\n );\n\n // create a new PunkAPI object and inject the client with mocks into\n // the PunkAPI constructor\n $punkAPI = new PunkAPI($client);\n\n // test whether an exception is thrown by PunkAPI->single() when we\n // attempt to retrieve the single beer information with an invalid\n // beer id\n $this->expectException(GuzzleHttp\\Exception\\ClientException::class);\n\n // attempt to retrieve the information for the beer with id 99500\n // (should return a Beer object)\n $beer = $punkAPI->single(strval(99500));\n }", "private function hitBee($bee){\n $this->hit = $this->beehive[$bee];\n switch(strtolower($this->hit['type'])){\n case 'queen':\n $this->hit['life'] -= 8;\n break;\n case 'worker':\n $this->hit['life'] -= 10;\n break;\n case 'drone':\n $this->hit['life'] -= 12;\n break;\n }\n if($this->hit['life'] <=0){\n // The bee died\n $this->killBee($bee);\n } else {\n $this->beehive[$bee] = $this->hit;\n }\n }", "public function renderRichResponseItem()\n {\n }", "public function add_to_aweber_list($post_data = array(),$list_id = null ){\n\n \t\t$aweber = new AWeberAPI($this->aweber_consumerKey, $this->aweber_consumerSecret);\n // dd($aweber);\n\n\t\ttry {\n\n\t\t $account = $aweber->getAccount($this->aweber_accessKey , $this->aweber_accessSecret);\n\t\t $lists = $account->lists->find(array('name' => $list_id));\n\t\t $list = $lists[0];\n\n\t\t # lets create some custom fields on your list!\n\t\t $custom_fields = $list->custom_fields;\n\t\t // try {\n\t\t // # setup your custom fields\n\t\t // $custom_fields->create(array('name' => 'Car'));\n\t\t // $custom_fields->create(array('name' => 'Color'));\n\t\t // }\n\t\t // catch(AWeberAPIException $exc) {\n\t\t // # errors would be raised if we already had these fields, or\n\t\t // # we couldnt add anymore, so skip it and keep going\n\t\t // # uncomment the line below to see any errors related to custom fields:\n\t\t // # handle_errors($exc);\n\t\t // }\n\t\t //$ip = $_SERVER[\"REMOTE_HOST\"] ?: gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\n\t\t # create a subscriber\n\t\t $params = array(\n\t\t 'email' => $post_data['email'],\n\t\t 'ip_address' => '127.0.0.1',\n\t\t 'ad_tracking' => 'client_lib_example',\n\t\t 'last_followup_message_number_sent' => 0,\n\t\t 'misc_notes' => 'my cool app',\n\t\t 'name' => $post_data['name'],\n\t\t 'tags' => array('digitalkheops')\n\n\t\t );\n\n\t\t $subscribers = $list->subscribers;\n\n\t\t $paramss = array(\n\t\t 'email' => $post_data['email']\n\n\t\t );\n\t\t $found_subscribers = $subscribers->find($paramss);\n\t\t //dd($found_subscribers);\n\n\t\t if($found_subscribers->data['total_size']==0){\n\t\t \t$new_subscriber = $subscribers->create($params);\n\t\t }\n\t\t \n\n\t\t # success!\n\t\t //print \"A new subscriber was added to the $list->name list!\";\n\t\t return true;\n\n\t\t} catch(AWeberAPIException $exc) {\n\t\t return false;\n\t\t}\n\n}", "public function testGettingARandomBeer()\n {\n // read the json for a single beer response from the local file\n $randomBeerJson = file_get_contents('tests/single_beer_json.json');\n\n // create a mock and queue a single response\n $mock = new MockHandler(\n [\n new Response(200, [], $randomBeerJson)\n ]\n );\n $handlerStack = HandlerStack::create($mock);\n\n // create a new Guzzle\\Http client, configured to use the custom handler\n // stack we've just created\n $client = new Client(\n [\n 'handler' => $handlerStack\n ]\n );\n\n // create a new PunkAPI object and inject the client with mocks into\n // the PunkAPI constructor\n $punkAPI = new PunkAPI($client);\n\n // attempt to retrieve the information for a random beer\n // (should return a Beer object)\n $beer = $punkAPI->random();\n\n // check that we've got a beer object back\n $this->assertInstanceOf(\n Beer::class,\n $beer,\n \"PunkAPI->random() didn't return a Beer object.\"\n );\n }", "public function wear()\n {\n if ($this->vars['id'] === '*') {\n $ids = array();\n } else {\n $ids = explode(',', $this->vars['id']);\n }\n\n $this->jsonOutput($this->model->getWearStructure($ids, $this->page->request->get->brugertype));\n }", "public function TrackingRequest($entry)\n {\n\n $entity = new \\SimpleXMLElement($entry);\n\n $children = $entity->children();\n\n $parsedEntity = array();\n\n foreach ($children as $child)\n {\n $name = $child->getName();\n\n switch ($name)\n {\n case 'title':\n $parsedEntity['title'] = $child->__toString();\n break;\n\n case 'id':\n $parsedEntity['id'] = $child->__toString();\n break;\n\n case 'updated':\n $parsedEntity['updated'] = $child->__toString();\n break;\n\n case 'author':\n\n $author = $child->children();\n\n if ($author->count() > 0)\n {\n foreach ($author as $auth)\n {\n $parsedEntity['author'][] = $auth->__toString();\n }\n }\n break;\n\n case 'content':\n $parsedEntity['content'] = $this->contentHandler($child);\n break;\n\n case 'link':\n\n $parsedEntity['link'][] = $this->parseLink($child);\n\n break;\n }\n }\n\n // Name SPaced APP protocol\n $children = $entity->children('app', true);\n foreach ($children as $child)\n {\n switch($child->getName())\n {\n case 'control':\n $parsedEntity['draft'] = $this->parseAppControl($child);\n break;\n }\n }\n\n // If no draft control present must be added\n if(!array_key_exists('draft', $parsedEntity))\n {\n $parsedEntity['draft'] = false;\n }\n\n\n return $parsedEntity;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the template root path
public function getTemplateRootPath() { return $this->getDirectoryName($this->templateRootPath); }
[ "protected function getTemplateRoot()\n {\n $root = str_replace($this->document_root_basedir, $this->template_basedir, $_SERVER['DOCUMENT_ROOT']);\n if(substr($root, -1, 1) === '/') {\n $root = substr_replace($root, '', -1);\n }\n return $root;\n }", "public function get_template_root()\n {\n }", "protected function getTemplatesRootPath()\n {\n $path = ltrim($this->factoryConfig['templates_path'], DIRECTORY_SEPARATOR);\n\n return sprintf(\n '%s%s',\n $this->wire('config')->paths->site,\n rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR\n );\n }", "public static function get_root_url () {\r\n\t\treturn get_template_directory_uri();\r\n\t}", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "function mountain_template_path() {\n\treturn Mountain_Wrapper::$main_template;\n}", "function absolute_path_to_template(){\n return ROOT . $this->relative_path_to_template();\n }", "private static function getPath()\n {\n return dirname(dirname(__DIR__)).'/templates';\n }", "public static function get_template_path() {\n return DIR.'app/templates/'.Session::get('template').'/';\n }", "public function getTemplatePath();", "public function getBaseTemplatePath() {\n return $this->getTemplatePath(\n $this->_routes[$this->routeName][\"baseTemplate\"] ?: $this->_settings[\"baseTemplateName\"]\n );\n }", "public static function get_template_path()\n {\n return apply_filters( 'es_get_templates_path', ES_TEMPLATES );\n }", "public static function currentRootpath()\n {\n static $root;\n if (!$root) {\n $root = static::cleanSlashed(dirname(Server::get('SCRIPT_FILENAME')));\n }\n return $root;\n }", "protected function get_template_path() {\n\t\treturn (string) $this->template_path;\n\t}", "public function templatePath()\n {\n return self::$baseTemplatePath . '/' . trim($this->templateName(), '/');\n }", "function getTemplatesFolderPath()\n {\n // check the servers current OS\n if (PHP_OS == \"Linux\") {\n $sub = \"/\";\n } else {\n $sub = \"\\\\\";\n }\n\n // start building the path\n $path = $this->sitePath() . $sub . $this->templatesFolder() . $sub . $sub;\n\n // return the path\n return $path;\n }", "public function getTemplatesFolder(): string\n {\n return basePath(self::$templatesFolder);\n }", "public function getTemplateDir();", "abstract public function getTemplatePath();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes config.php and siblings in "legacy" folder and symlinks them to ezpublish_legacy
public static function legacyConfigFiles( Event $event ) { $io = $event->getIO(); $io->write( "\n" . __METHOD__ . "\nSymlinking config.php file(s) to legacy folder" ); $baseDir = getcwd(); $legacyPath = $baseDir . "/" . self::getLegacyPath( $event ); $legacyTargetDir = $legacyPath; $legacyConfigDir = self::getSetting( 'legacy-configfiles-dir', $event, 'legacy' ); $i = 0; $configs = glob( $legacyConfigDir . "/config*" ); foreach( $configs as $c ) { if ( is_dir( $c ) ) continue; $i++; $symlink = $legacyTargetDir . "/" . basename( $c ); if ( file_exists( $symlink ) && !self::is_link( $symlink ) ) { if ( !rename( $symlink, $symlink . ".bak" ) ) throw new \Exception( "Config file ". basename($c) . " in ezpublish_legacy folder exists and is not a symlink" ); } if (!self::is_link( $symlink ) ) { $io->write( "Symlinking config file: " . basename( $c ) ); symlink($c, $symlink); } else { $io->write( "Config file: " . basename( $c ) . " is already a symlink" ); } } $io->write( "Symlink config.php done ($i files found)\n" ); }
[ "public static function legacySettings( Event $event )\n {\n $io = $event->getIO();\n $io->write( \"\\n\" . __METHOD__ . \"\\nSymlinking settings to ezpublish_legacy folder\" );\n\n $baseDir = getcwd();\n\n $legacyPath = $baseDir . \"/\" . self::getLegacyPath( $event );\n $legacySettingsPath = $legacyPath . \"/settings\";\n $projectSettingsPath = $baseDir . \"/\" . self::getSetting( 'legacy-settings-dir', $event, 'legacy/settings' );\n\n if ( !is_dir( $legacySettingsPath ) )\n throw new \\Exception( \"We are missing the eZ legacy settings dir. Move legacy code to ezpublish_legacy folder\" );\n\n if ( file_exists( $projectSettingsPath . \"/override\") && !self::is_link( $legacySettingsPath . \"/override\") )\n {\n if ( !rename( $legacySettingsPath . \"/override\", $legacySettingsPath . \"/override.bak\" ) )\n throw new \\Exception(\"Settings/override in ezpublish_legacy folder exists and is not a symlink\");\n }\n\n /// @todo check if symlink exists and has wrong target...\n\n if ( file_exists( $projectSettingsPath . \"/override\") && !self::is_link( $legacySettingsPath . \"/override\" ) )\n {\n $io->write( \"Symlinking 'override' settings\" );\n symlink( $projectSettingsPath . \"/override\", $legacySettingsPath . \"/override\" );\n\t }\n\n # Todo - Handle better for initial setup\n $i = 0;\n $siteaccesses = glob( $projectSettingsPath . \"/siteaccess/*\" );\n foreach( $siteaccesses as $siteaccess )\n {\n // skip files in there!\n if ( !is_dir( $siteaccess ) )\n continue;\n\n $i++;\n $symlink = $legacySettingsPath . \"/siteaccess/\" . basename( $siteaccess );\n\n if ( file_exists( $symlink ) && !self::is_link( $symlink ) )\n {\n if ( !rename( $symlink, $symlink . \".bak\" ) )\n throw new \\Exception( \"Siteaccess \". basename( $siteaccess ) . \" in ezpublish_legacy folder exists and is not a symlink\" );\n }\n\n if( !self::is_link( $symlink ) )\n {\n $io->write( \"Symlinking siteaccess: \" . basename( $siteaccess ) );\n symlink( $siteaccess, $symlink );\n }\n else\n {\n $io->write( \"Siteaccess: \" . basename( $siteaccess ) . \" is already a symlink\" );\n }\n }\n\n $io->write( \"Symlink of legacy settings completed ($i siteaccesses found).\\n\" );\n }", "function cms_config_upgrade()\n{\n\t#Get my lazy on and just do some regex magic...\n\t$newfiledir = dirname(CONFIG_FILE_LOCATION);\n\t$newfilename = CONFIG_FILE_LOCATION;\n\t$oldconfiglines = array();\n\t$oldconfig = cms_config_load();\n\tif (is_writable($newfilename) || is_writable($newfiledir))\n\t{\n\t\t$handle = fopen($newfilename, \"r\");\n\t\tif ($handle)\n\t\t{\n\t\t\twhile (!feof($handle))\n\t\t\t{\n\t\t\t\t$oldconfiglines[] = fgets($handle, 4096);\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\t$handle = fopen($newfilename, \"w\");\n\t\t\tif ($handle)\n\t\t\t{\n\t\t\t\tforeach ($oldconfiglines as $oneline)\n\t\t\t\t{\n\t\t\t\t\t/** from some ancient version? */\n\t\t\t\t\t$newline = trim(preg_replace('/\\$this-\\>(\\S+)/', '$config[\"$1\"]', $oneline));\n\n\t\t\t\t\t/* uploads_url, remove root url */\n\t\t\t\t\tif(preg_match( '/\\$config\\[\\'uploads_url\\'\\]/' , $oneline) ) {\n\t\t\t\t\t\t$newline = str_replace($oldconfig['root_url'], '', $oneline);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* image_uploads_url, remove root url */\n\t\t\t\t\tif(preg_match('/\\$config\\[\\'image_uploads_url\\'\\]/',$oneline)) {\n\t\t\t\t\t\t$newline = str_replace($oldconfig['root_url'], '', $oneline);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tif ($newline != \"?>\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$newline .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($handle, $newline);\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "function cms_config_upgrade()\n{\n\t#Get my lazy on and just do some regex magic...\n\t$newfiledir = dirname(CONFIG_FILE_LOCATION);\n\t$newfilename = CONFIG_FILE_LOCATION;\n\t$oldconfiglines = array();\n\tif (is_writable($newfilename) || is_writable($newfiledir))\n\t{\n\t\t$handle = fopen($newfilename, \"r\");\n\t\tif ($handle)\n\t\t{\n\t\t\twhile (!feof($handle))\n\t\t\t{\n\t\t\t\tarray_push($oldconfiglines,fgets($handle, 4096));\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\t$handle = fopen($newfilename, \"w\");\n\t\t\tif ($handle)\n\t\t\t{\n\t\t\t\tforeach ($oldconfiglines as $oneline)\n\t\t\t\t{\n\t\t\t\t\t$newline = trim(preg_replace('/\\$this-\\>(\\S+)/', '$config[\"$1\"]', $oneline));\n\t\t\t\t\tif ($newline != \"?>\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$newline .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($handle, $newline);\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}\n}", "public static function symlinks() {\n $symlink_settings = Install::getPath(array('composer', 'symlink_settings.yml'));\n $custom = Yaml::parse(file_get_contents($symlink_settings));\n if (!empty($custom)) {\n foreach ($custom as $type => $link) {\n // Creates folder if it doesn't exist.\n if (!file_exists($type)) {\n mkdir($type, 0777, TRUE);\n }\n if (!file_exists(Install::getPath(array('web', $link)))) {\n mkdir(Install::getPath(array('web', $link)), 0777, TRUE);\n }\n // Creates symlinks.\n Install::_symlink(Install::getPath(array('composer', $type)), Install::getPath(array('web', $link)));\n }\n }\n }", "private function initializeSymlinks()\n {\n if ($this->pluginConfig->get('prepare-web-dir') === false) {\n $this->io->writeError('<warning>Config option prepare-web-dir has been deprecated.</warning>');\n $this->io->writeError(' <warning>It will be removed with typo3/cms-composer-installers 2.0.</warning>');\n return;\n }\n $this->io->writeError('<info>Establishing links to TYPO3 entry scripts in web directory.</info>', true, IOInterface::VERBOSE);\n\n $relativeWebDir = $this->pluginConfig->get('web-dir', $this->pluginConfig::RELATIVE_PATHS);\n if (empty($relativeWebDir) || $relativeWebDir === '.') {\n $this->io->writeError('<warning>Setting web-dir to the composer root directory is highly discouraged for security reasons.</warning>');\n $this->io->writeError(' <warning>The default value for this option will change to \"web\" as of typo3/cms-composer-installers 2.0.</warning>');\n }\n $webDir = $this->filesystem->normalizePath($this->pluginConfig->get('web-dir'));\n $this->filesystem->ensureDirectoryExists($webDir);\n $localRepository = $this->composer->getRepositoryManager()->getLocalRepository();\n $package = $localRepository->findPackage('typo3/cms', new EmptyConstraint());\n\n $sourcesDir = $this->composer->getInstallationManager()->getInstallPath($package);\n $backendDir = $webDir . DIRECTORY_SEPARATOR . self::TYPO3_DIR;\n $this->symlinks = [\n $sourcesDir . DIRECTORY_SEPARATOR . self::TYPO3_INDEX_PHP => $webDir . DIRECTORY_SEPARATOR . self::TYPO3_INDEX_PHP,\n $sourcesDir . DIRECTORY_SEPARATOR . self::TYPO3_DIR => $backendDir,\n ];\n }", "private function configPublisher()\n {\n // When users execute Laravel's vendor:publish command, the config file will be copied to the specified location\n $this->publishes([\n __DIR__ . '/Config/nextpack.php' => config_path('nextpack.php'),\n ]);\n }", "protected function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/../../config/installer.php' => base_path('config/installer.php'),\n ], 'installer_config');\n }", "public function testShellAliasMultipleConfigFiles() {\n $options = array(\n 'config' => UNISH_SANDBOX . \"/b\" . PATH_SEPARATOR . UNISH_SANDBOX,\n 'alias-path' => UNISH_SANDBOX,\n );\n $this->drush('also', array(), $options);\n $expected = \"alternate config file included too\";\n $output = $this->getOutput();\n $this->assertEquals($expected, $output);\n }", "public static function getLegacyConfigPath(): string\n {\n return self::getPublicPath() . '/typo3conf';\n }", "private function publishConfig()\n {\n if (!file_exists(getcwd().'/config/lcrud.php')) {\n $this->copyDirectory(__DIR__.'/../../config', getcwd().'/config');\n $this->info(\"\\n\\nLumen config file have been published\");\n } else {\n $this->error('Lumen config files has already been published');\n }\n }", "public function rebuildUrlConfig()\n\t{\n\t\t\n\t\t$modules = eRouter::adminReadModules(); // get all available locations, non installed plugins will be ignored\n\t\t$config = eRouter::adminBuildConfig(e107::getPref('url_config'), $modules); // merge with current config\n\t\t$locations = eRouter::adminBuildLocations($modules); // rebuild locations pref\n\t\t$aliases = eRouter::adminSyncAliases(e107::getPref('url_aliases'), $config); // rebuild aliases\n\t\t\t\n\t\t// set new values, changes should be saved outside this methods\n\t\te107::getConfig()\n\t\t\t->set('url_aliases', $aliases)\n\t\t\t->set('url_config', $config)\n\t\t\t->set('url_modules', $modules)\n\t\t\t->set('url_locations', $locations);\n\t\t\t\t\n\t\teRouter::clearCache();\n\t}", "public function configExportOld() {\n $this->_exec(\"$this->drush_cmd -y cex --destination=\" . $this->config_old_directory);\n }", "protected function registerPublishableFiles()\n {\n $this->publishes([\n __DIR__.\"/../config/{$this->name}.php\" => config_path(\"{$this->name}.php\"),\n ], 'config');\n }", "private function publishConfig()\n {\n $this->publishes([\n __DIR__.'/../config/' => base_path('config'),\n ]);\n }", "public function testSymlinks()\n {\n\n $this->composer->setConfig(new Config(false, __DIR__ . '/ExcludeFolders/Symlinks'));\n\n $expectedTerminalOutput = '<info>Added \"vendor/sample/package\" to PhpStorm config at \"'\n . getcwd() . '/tests/ExcludeFolders/Symlinks/.idea/valid.iml\".</info>';\n\n $this->io\n ->expects($this->exactly(1))\n ->method('write')\n ->withConsecutive(\n [$expectedTerminalOutput]\n );\n\n $this->package->setExtra([\n \"symlinks\" => [\n \"vendor/sample/package\" => \"symlink\"\n ]\n ]);\n\n $fileToWrite = getcwd() . '/tests/ExcludeFolders/Symlinks/.idea/valid.iml';\n $expectedFileOutput = file_get_contents(getcwd() . '/tests/ExcludeFolders/Symlinks/expected.iml');\n\n $this->filesystem->expects($this->once())\n ->method('dumpFile')\n ->with($fileToWrite, $expectedFileOutput);\n\n ExcludeFolders::update($this->event, $this->filesystem);\n }", "private function publishConfig()\n {\n $path = $this->getConfigPath();\n $this->publishes([$path => config_path('AtomicPanel.php')], 'atomic-config');\n }", "protected static function copyBuildConfigFiles(CommandEvent $event)\n {\n $rootDir = getcwd();\n $fs = new Filesystem();\n $fs->mirror(\n self::getSkeletonPath() . 'build-config',\n $rootDir . '/build-config',\n null,\n array('override' => true)\n );\n }", "protected function _createSymbolicLinks()\r\n\t{\r\n\t\t/**\r\n\t\t * Dojo\r\n\t\t */\r\n\t\tif($this->_config->dojo->path) {\r\n\t\t\t$dojoLibPath = ROOT_PATH . DIRECTORY_SEPARATOR .'public';\r\n\t\t\t$dojoLibPath .= DIRECTORY_SEPARATOR . 'scripts';\r\n\t\t\t$dojoLibPath .= DIRECTORY_SEPARATOR . 'dojo';\r\n\t\t\t$dojoLibPath .= DIRECTORY_SEPARATOR . 'library';\r\n\t\t\t\r\n\t\t\tif(!is_dir($dojoLibPath)) {\r\n\t\t\t\tif($this->_isWindows()){\r\n\t\t\t\t\t$call = 'mklink /D ' . $dojoLibPath . ' ' . $this->_config->dojo->path;\r\n \t\t\texec($call);\r\n \t\t} else {\r\n\t\t\t\t\t$call = 'ln -s ' . $this->_config->dojo->path . ' ' . $dojoLibPath;\r\n \t\t\tshell_exec($call);\r\n \t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Tinymce\r\n\t\t */\r\n\t\tif(isset($this->_config->tinymce->path)) {\r\n\t\t\tif($this->_config->tinymce->path) {\r\n\t\t\t\t\r\n\t\t\t\t$tinymceLibPath = ROOT_PATH . DIRECTORY_SEPARATOR .'public';\r\n\t\t\t\t$tinymceLibPath .= DIRECTORY_SEPARATOR . 'scripts';\r\n\t\t\t\t$tinymceLibPath .= DIRECTORY_SEPARATOR . 'tiny_mce';\r\n\t\t\t\t\r\n\t\t\t\tif(!is_dir($tinymceLibPath)) {\r\n\t\t\t\t\tif($this->_isWindows()){\r\n\t\t\t\t\t\t$call = 'mklink /D ' . $tinymceLibPath . ' ' . $this->_config->tinymce->path;\r\n\t \t\t\texec($call);\r\n\t \t\t} else {\r\n\t\t\t\t\t\t$call = 'ln -s ' . $this->_config->tinymce->path . ' ' . $tinymceLibPath;\r\n\t \t\t\tshell_exec($call);\r\n\t \t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "private function publishConfig()\n {\n $this->publishes([\n __DIR__.'/../../config/beyondauth.php' => config_path('beyondauth.php'),\n ], 'config');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
executes a statment that retreives a single data value and returns the value retrieved
function sqlValue($statment){ if(!$res = sql($statment, $eo)) return FALSE; if(!$row = db_fetch_array($res)) return FALSE; return $row[0]; }
[ "function get_value() {\r\n $rs = $this->query(func_get_args());\r\n if (!$rs) return false;\r\n $row = mysql_fetch_row($rs);\r\n $this->free();\r\n return $row[0];\r\n }", "function _fetchValue($queryname, $data=array()) {\n\t\t$return = false;\n\t\ttry {\n\t\t\tif($this->queries[$queryname]->execute($data)) {\n\t\t\t\tif(!$this->queries[$queryname]->rowCount())\n\t\t\t\t\treturn false; // fail if we did not get a value\n\t\t\t\t$return = $this->queries[$queryname]->fetchColumn();\n\t\t\t\t$this->queries[$queryname]->closeCursor();\n\t\t\t}\n\t\t} catch(PDOException $e) {\n\t\t\tprint_r($this->queries[$queryname]->errorInfo());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $return;\n\t}", "function executeFetchOne(){\n\t\t\t$this->execute();\n\t\t\t$r = $this->fetch();\n\t\t\t$this->closeCursor();\n\t\t\treturn $r;\n\t\t}", "function fetchSingle() {\r\n\t\t$result = null;\r\n\t\tif(!is_null($this->__result)) {\r\n\t\t\t$result = @pg_fetch_row($this->__result);\r\n\t\t\tif($result)\r\n\t\t\t\t$result = $result[0];\r\n\t\t\telse\r\n\t\t\t\t$this->__result = null;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "function getSingleValue($table,$column,$id) {\n\tglobal $database;\n\t$value = $database->get($table, $column, [\"id\" => $id]);\n\treturn $value;\n}", "function fetchValue2($fullquery) { return $this->fetchValue(\"\",\"\",\"\",$fullquery); }", "public function get_one()\n\t{\n if ( $r = call_user_func_array([$this, 'query'], func_get_args()) ){\n return $r->fetchColumn(0);\n\t\t}\n return false;\n\t}", "public function fetchSingleScalar()\n {\n return $this->execute(RecordManager::FETCH_SINGLE_SCALAR);\n }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function run()\n {\n $result = $this->__invoke()->fetch();\n $field = $this->table->{$this->field};\n\n return $field->dataFromDatabase($result[0]);\n }", "public function get_one(){\n if ( $r = call_user_func_array([$this, 'query'], func_get_args()) ){\n return $r->fetchColumn(0);\n }\n return false;\n }", "function executeSingle()\r\n\t{\r\n\t\t$results = $this->execute();\r\n\t\tif (count($results) == 1)\r\n\t\t{\r\n\t\t\treturn $results[0];\r\n\t\t}\r\n\t\t\r\n\t\tif (count($results) == 0)\r\n\t\t{\r\n\t\t\tthrow new DataNotFoundException();\r\n\t\t}\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new DataItemException(\"Ambiguous singleton query\");\r\n\t\t}\r\n\t}", "function getticketvalue($instruction){\n $result=mysqli_query($conn,$instruction);\n if(!$result)\n printf(\"error in getvalue\");\n $row=mysqli_fetch_array($result,MYSQLI_BOTH);\n}", "public function readone(){\r $query=\"select * from `\".$this->table_name.\"` where `id`='\".$this->booking_id.\"'\";\r $result=mysqli_query($this->conn,$query);\r $value=mysqli_fetch_row($result);\r return $value;\r }", "public function XAGsingle(){\r\n $this->execute();\r\n return $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n }", "function clients_select_getData($ctlData,$clientID) {\t\n\t## db object\n\t$db_connection = new DB_Sql();\n\t\n\t$query = \"SELECT \".$ctlData['IDENTIFIER'].\" FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" WHERE id='$clientID'\";\n\t$result_pointer = $db_connection->query($query);\t\n\t\n\t$value ='';\n\tif($db_connection->next_record()) {\n\t\t$value = $db_connection->Record[$ctlData['IDENTIFIER']];\n\t}\t\n\treturn $value;\n}", "function get_value($key,$res_id)\n\t{\n\t\treturn $res_id == $this->data['res_id'] ? $this->data[$key] :\n\t\t\t$this->db->select($this->table_name,$key,array('res_id' => $res_id),__LINE__,__FILE__)->fetchColumn();\n\t}", "public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "function getSingleFieldValue($tablename, $fieldname, $idname, $id)\n{\n\tglobal $log, $adb;\n\t$log->debug(\"Entering into function getSingleFieldValue()\");\n\t$result = $adb->query(\"select $fieldname from $tablename where $idname = $id\");\n\t$fieldval = $adb->query_result($result,0,$fieldname);\n\n\t$log->debug(\"Exit from function getSingleFieldValue()\");\n\n\treturn $fieldval;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a count of active vs inactive posts, used to show some stats around the admin pages.
public function getCounts() { $counts = Cache::read('posts_count', 'blog'); if ($counts !== false) { return $counts; } $counts['active'] = $this->find('count', array( 'conditions' => array( $this->alias . '.active' => 1 ), 'contain' => false )); $counts['pending'] = $this->find('count', array( 'conditions' => array( $this->alias . '.active' => 0 ), 'contain' => false )); Cache::write('posts_count', $counts, 'blog'); return $counts; }
[ "public function total_Inactive_Post()\n {\n $this->db->select('count(tbl_posts.id) as total_inactive_posts');\n $this->db->where('status', '0');\n $this->db->where('is_deleted', '1');\n $query = $this->db->get('tbl_posts');\n return $query->result();\n }", "public function getActiveCategoriesWithCountPosts()\n {\n return $this->model->active()->withCount(['posts' => function($query) { return $query->visible(); }])->get();\n }", "function acadp_get_user_total_active_listings() {\n\n\tglobal $wpdb;\n\n\t$where = get_posts_by_author_sql( 'acadp_listings', true, get_current_user_id(), true );\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) FROM $wpdb->posts $where\" );\n\n \treturn $count;\n\n}", "public function getActiveCount() {\n $query = $this->connection->select(self::TABLE, 'ta');\n $query->condition('deal_status', self::DEAL_STATUS_AVAILABLE);\n return $query->countQuery()->execute()->fetchField();\n }", "function wp_statistics_countpages() {\r\n\t\r\n\t\t$count_pages = wp_count_posts('page');\r\n\t\t\r\n\t\t$ret = 0;\r\n\t\t\r\n\t\tif( is_object($count_pages) ) { $ret = $count_pages->publish; }\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "public function countActive()\n {\n return Specials::model()->countByAttributes(array('status'=>1));\n }", "public function showPostsCount()\n {\n $key = 'show_posts_count';\n if (!$this->hasData($key)) {\n $this->setData($key, (bool)$this->_scopeConfig->getValue(\n 'mfblog/sidebar/'.$this->_widgetKey.'/show_posts_count',\n ScopeInterface::SCOPE_STORE\n ));\n }\n return $this->getData($key);\n }", "public function getActiveAdTagsCount();", "public function getAllWithPostsCounts();", "function wpcampus_get_interested_count() {\n\treturn GFAPI::count_entries( 1, array(\n\t\t'status' => 'active',\n\t));\n}", "public function getPostCount()\r\n {\r\n return Yii::app()->db->createCommand()\r\n ->select('count(*) as num')\r\n ->from(Post::model()->tableName() .' p')\r\n ->join(Thread::model()->tableName() .' t', 't.id=p.thread_id')\r\n ->where('t.forum_id=:id', array(':id'=>$this->id))\r\n ->queryScalar();\r\n }", "function statistics_extended_active_count($group=null){\r\n\tglobal $CONFIG;\r\n\t$query_tpl =\"SELECT COUNT(*) as members FROM {$CONFIG->dbprefix}users_entity ue \";\r\n\t$query_tpl.=\"JOIN {$CONFIG->dbprefix}entities e ON e.guid=ue.guid WHERE e.enabled='yes' AND \";\r\n\r\n\tif(!empty($group)){\r\n\t\t$query_tpl.=\" e.guid IN (SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) AND \";\r\n\t}\r\n\t$query_tpl.=\" last_login {{CONDITION}} 0\";\r\n\t// Active users\r\n\t$query = str_replace(\"{{CONDITION}}\",\"!=\",$query_tpl);\r\n\t$count = get_data_row($query);\r\n\t$active = $count->members;\r\n\r\n\t$query = str_replace(\"{{CONDITION}}\",\"=\",$query_tpl);\r\n\t$count = get_data_row($query);\r\n\t$inactive = $count->members;\r\n\r\n\treturn array($active,$inactive);\r\n}", "public function get_pending_posts_count()\n {\n if (!check_user_permission('manage_all_posts')) {\n $this->db->where('posts.user_id', user()->id);\n }\n\n $this->db->where('posts.visibility', 0);\n $this->db->where('posts.status', 1);\n $this->db->where('posts.created_at <= CURRENT_TIMESTAMP()');\n $query = $this->db->get('posts');\n return $query->num_rows();\n }", "function get_post_count() {\n\tglobal $wp_query;\n\treturn $wp_query->post_count;\n}", "public function get_paginated_pending_posts_count()\n {\n $this->filter_posts();\n $this->db->where('posts.visibility', 0);\n $this->db->where('posts.status', 1);\n $this->db->where('posts.created_at <= CURRENT_TIMESTAMP()');\n $query = $this->db->get('posts');\n return $query->num_rows();\n }", "function clpr_count_posts( $post_type, $status_type = 'publish' ) {\n\n\t$count_total = 0;\n\t$count_posts = wp_count_posts( $post_type );\n\n\tif ( is_array( $status_type ) ) {\n\t\tforeach ( $status_type as $status ) {\n\t\t\t$count_total += $count_posts->$status;\n\t\t}\n\t} else {\n\t\t$count_total = $count_posts->$status_type;\n\t}\n\n\treturn number_format( $count_total );\n}", "public function action_counts() {\n\t\tglobal $wpdb;\n\n\t\t$sql = \"SELECT a.status, count(a.status) as 'count'\";\n\t\t$sql .= \" FROM {$wpdb->actionscheduler_actions} a\";\n\t\t$sql .= \" GROUP BY a.status\";\n\n\t\t$actions_count_by_status = array();\n\t\t$action_stati_and_labels = $this->get_status_labels();\n\n\t\tforeach ( $wpdb->get_results( $sql ) as $action_data ) {\n\t\t\t// Ignore any actions with invalid status\n\t\t\tif ( array_key_exists( $action_data->status, $action_stati_and_labels ) ) {\n\t\t\t\t$actions_count_by_status[ $action_data->status ] = $action_data->count;\n\t\t\t}\n\t\t}\n\n\t\treturn $actions_count_by_status;\n\t}", "function ungrouped_posts_count() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$p2pg = PostGroups::post2postgroup_table();\r\n\r\n\t\t$orExtra = '';\r\n\t\tif (is_user_logged_in()) {\r\n\t\t\tif(current_user_can(\"read_private_posts\")) {\r\n\t\t\t\t$orExtra = \"OR post_status = 'private'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $wpdb->get_var(\"\r\n\t\t\tSELECT COUNT(*) FROM $wpdb->posts \r\n\t\t\tWHERE post_type = 'post' AND (post_status = 'publish' $orExtra)\r\n\t\t\tAND ID NOT IN (SELECT post_id from $p2pg)\");\r\n\t}", "public static function getCountActiveTasks(){\n $count = \\DB::table('tasks')\n ->where('status', '1')\n ->get()\n ->count();\n return $count;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Form for editing a webhook.
function webhook_form($form, $form_state, $webhook) { ctools_include('plugins'); $form['whid'] = array( '#type' => 'value', '#value' => $webhook->whid, ); $form['title'] = array( '#type' => 'textfield', '#title' => t('Name'), '#description' => t('The name of the webhook.'), '#default_value' => $webhook->title, '#maxlength' => 100, '#required' => TRUE, ); $form['machine_name'] = array( '#type' => 'machine_name', '#title' => t('Machine Name'), '#description' => t('Choose a unique identifier. This can not be changed once set. This will also be used as the URL.'), '#default_value' => $webhook->machine_name, '#maxlength' => 50, '#required' => TRUE, '#disabled' => !empty($webhook->title), '#machine_name' => array( 'exists' => 'webhook_edit_machine_name_value_exists', 'source' => array('title'), ), ); $form['description'] = array( '#type' => 'textarea', '#title' => t('Description'), '#default_value' => $webhook->description, '#description' => t('Descrive the webhook.'), ); $form['unserializer'] = array( '#type' => 'select', '#title' => t('Unserializer'), '#default_value' => $webhook->unserializer, '#options' => webhook_get_unserlizer_list(), '#required' => TRUE, '#description' => t('Select plugin to be used to unserialize the request data.'), ); $form['processor'] = array( '#type' => 'select', '#title' => t('Processor'), '#default_value' => $webhook->processor, '#options' => webhook_get_processor_list(), '#required' => TRUE, '#description' => t('Select plugin to be used to process the data from the request.'), ); $form['processor_config'] = array( // Future use for Ajax forms. ); $form['enabled'] = array( '#type' => 'select', '#title' => t('Enabled'), '#default_value' => (int) $webhook->enabled, '#options' => array(t('No'), t('Yes')), '#required' => TRUE, '#description' => t('Is this webhook enabled?'), ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Save', ); return $form; }
[ "function webhook_edit($whid) {\n $webhook = webhook_load($whid);\n\n if (!$webhook) {\n drupal_set_message(t('Invalid webhook.'));\n return drupal_goto('admin/config/services/webhook');\n }\n\n return drupal_get_form('webhook_form', $webhook);\n}", "private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }", "public function __viewEdit() {\n\t\t\tif(\n\t\t\t\tisset($this->_context[0]) && $this->_context[0] === 'edit' && \n\t\t\t\tisset($this->_context[1]) && is_numeric($this->_context[1])\n\t\t\t) {\n\t\t\t\t$webHook = Symphony::Database()->fetch('\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t`id`,\n\t\t\t\t\t\t`label`,\n\t\t\t\t\t\t`section_id`,\n\t\t\t\t\t\t`verb`,\n\t\t\t\t\t\t`callback`,\n\t\t\t\t\t\t`is_active` \n\t\t\t\t\tFROM `sym_extensions_webhooks`\n\t\t\t\t\tWHERE `id` = ' . (int) $this->_context[1]\n\t\t\t\t);\n\n\t\t\t\tif(false == $webHook) {\n\t\t\t\t\t$this->pageAlert(\n\t\t\t\t\t\t__('The WebHook you specified could not be located.'),\n\t\t\t\t\t\tAlert::ERROR\n\t\t\t\t\t);\n\t\t\t\t\treturn $this->__viewIndex();\n\t\t\t\t}\n\n\t\t\t\tif(isset($this->_context[2]) && $this->_context[2] == 'created') {\n\t\t\t\t\t$this->pageAlert(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'WebHook created at %1$s. <a href=\"%2$s\" accesskey=\"c\">Create another?</a> <a href=\"%3$s\" accesskey=\"a\">View all WebHooks</a>',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tWidget::Time()->generate(__SYM_TIME_FORMAT__),\n\t\t\t\t\t\t\t\tSYMPHONY_URL . '/extension/webhooks/hooks/new/',\n\t\t\t\t\t\t\t\tSYMPHONY_URL . '/extension/webhooks/hooks/'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tAlert::SUCCESS\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $this->__viewNew($_POST['fields'] = $webHook[0]);\n\t\t\t\t\n\t\t\t}\n\t\t}", "public function edit_form(){\n\t\t?>\n\t\t<form action=\"<?php echo get_save_url($this->page) ?>\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>Editing</legend>\n\t\t\t\t<label for=\"text\">Content:</label><br>\n\t\t\t\t<textarea cols=\"78\" rows=\"20\" name=\"text\" id=\"text\"><?php echo $this->file->data; ?></textarea>\n\t\t\t\t<br>\n\n\t\t\t\t<input type=\"submit\" name=\"preview\" value=\"Preview\">\n\t\t\t\t<input type=\"submit\" name=\"save\" value=\"Save\">\n\t\t\t\t<input type=\"hidden\" name=\"updated\" value=\"<?php echo $this->file->time; ?>\">\n\t\t\t</fieldset>\n\t\t</form>\n\t\t<?php\n\t}", "public function actionOEmbedEdit()\n {\n\n $form = new OEmbedProviderForm;\n\n $prefix = Yii::app()->request->getParam('prefix');\n $providers = UrlOembed::getProviders();\n\n if (isset($providers[$prefix])) {\n $form->prefix = $prefix;\n $form->endpoint = $providers[$prefix];\n }\n\n // uncomment the following code to enable ajax-based validation\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'oembed-edit-form') {\n echo CActiveForm::validate($form);\n Yii::app()->end();\n }\n\n if (isset($_POST['OEmbedProviderForm'])) {\n $_POST['OEmbedProviderForm'] = Yii::app()->input->stripClean($_POST['OEmbedProviderForm']);\n $form->attributes = $_POST['OEmbedProviderForm'];\n\n if ($form->validate()) {\n\n if ($prefix && isset($providers[$prefix])) {\n unset($providers[$prefix]);\n }\n $providers[$form->prefix] = $form->endpoint;\n UrlOembed::setProviders($providers);\n\n $this->redirect(Yii::app()->createUrl('//admin/setting/oembed'));\n }\n }\n\n $this->render('oembed_edit', array('model' => $form, 'prefix' => $prefix));\n }", "public function edit()\n {\n $instance_id = $this->input->get('instance_id', TRUE);\n if ($this->_subdomain_check_route()) {\n return;\n }\n if ($this->_launched_check_route()) {\n return;\n }\n if ($this->_active_check_route()) {\n return;\n }\n if ($this->_paywall_check_route()) {\n return;\n }\n if ($this->_online_only_check_route()) {\n return;\n }\n if (empty($instance_id)) {\n return show_error('No instance provided to edit and/or no return url provided to return to.', 404);\n }\n $edit_obj = $this->_get_edit_obj($instance_id);\n\n if(!$edit_obj) {\n return show_error(\"Couldn't find instance for subdomain \". $this->subdomain . \" and\n instance id \" . $instance_id, 404);\n }\n\n $form = $this->_get_form();\n if ($this->_authentication_route($form, '/edit?instance_id='.$instance_id )) {\n return;\n }\n if ($this->_form_null_check_route($form)) {\n return;\n }\n\n $data = array\n (\n 'title_component'=>'webform edit', \n 'html_title'=> $form->title,\n 'form'=> $form->html,\n 'form_data'=> $form->default_instance,\n 'form_data_to_edit' => $edit_obj->instance_xml,\n 'return_url' => $edit_obj->return_url,\n 'iframe' => $this->iframe,\n 'edit' => true,\n 'offline_storage' => FALSE,\n 'logo_url' => $this->account->logo_url($this->server_url),\n 'stylesheets'=> $this->_get_stylesheets($form->theme)\n );\n\n $data['scripts'] = (ENVIRONMENT === 'production') \n ? array(array('src' => '/build/js/webform-edit-combined.min.js'))\n : array(array('src' => '/lib/bower-components/requirejs/require.js', 'data-main' => '/src/js/main-webform-edit.js'));\n\n $this->load->view('webform_view', $data);\n }", "public function webhook() {\n\n\n\n }", "public function getUpdateForm();", "public function editAction()\n {\n /* @var $repo \\Trismegiste\\SocialBundle\\Repository\\TicketRepository */\n $repo = $this->get('social.ticket.repository');\n $fee = $repo->findEntranceFee();\n $form = $this->createForm(new EntranceFeeType(), $fee);\n\n $form->handleRequest($this->getRequest());\n if ($form->isValid()) {\n $newFee = $form->getData();\n try {\n $repo->persistEntranceFee($newFee);\n $this->pushFlash('notice', 'Entrance fee saved');\n\n // return to the same page\n return $this->redirectRouteOk('admin_entrancefee_edit');\n } catch (\\MongoException $e) {\n $this->pushFlash('warning', 'Cannot save entrance fee');\n }\n }\n\n return $this->render('TrismegisteSocialBundle:Admin:fee_form.html.twig', [\n 'form' => $form->createView()\n ]);\n }", "public function getWebhookUrlForm()\n\t{\n\t\t$objForm = $this->getServiceLocator()->get(\"FrontCore\\Models\\SystemFormsModel\")\n\t\t->getSystemForm(\"Core\\Forms\\SystemForms\\Webhooks\\WebhooksUrlForm\");\n\t\t\n\t\treturn $objForm;\n\t}", "public function webhook() {\n \n\t\t\n \n\t \t}", "function webhook_form_submit($form, &$form_state) {\n $values = $form_state['values'];\n $keys = array('title', 'machine_name', 'description', 'unserializer', 'processor', 'enabled');\n $webhook = array();\n foreach ($keys as $key) {\n $webhook[$key] = $values[$key];\n }\n\n // We don't currently use config.\n $webhook['config'] = array('IGNORE ME');\n\n if (!empty($values['whid'])) {\n $webhook['whid'] = $values['whid'];\n webhook_update($webhook);\n drupal_set_message(t(\"Webhook '@title' updated.\", array('@title' => $webhook['title'])));\n }\n else {\n webhook_insert($webhook);\n drupal_set_message(t(\"Webhook '@title' created.\", array('@title' => $webhook['title'])));\n }\n\n $form_state['redirect'] = 'admin/config/services/webhook';\n}", "function _edit_form(Doku_Event $event, $param) {\n\t\t$preview = $event->data->findElementById('edbtn__preview');\n\t\tif ($preview !== false) {\n\t\t\t$event->data->insertElement($preview+1,\n\t\t\t\tform_makeButton('submit', 'changes', $this->getLang('changes'),\n\t\t\t\t\tarray('id' => 'edbtn__changes', 'accesskey' => 'c', 'tabindex' => '5')));\n\t\t}\n\t}", "public function edit_form()\n {\n return View::make(\"app.edit\");\n }", "public function editAction()\n {\n // Get id from url params and check if record exist\n $params = $this->router->getParams();\n if (isset($params[0]) && $firewall = Firewalls::findFirst($params[0])) {\n // Set title, pick view and send variables\n $this->tag->setTitle(__('firewalls') . ' / ' . __('Edit'));\n $this->view->pick('firewalls/write');\n $this->view->setVars([\n 'status' => Firewalls::status(true),\n ]);\n\n // Check if the form has been sent\n if ($this->request->isPost() === true && $this->request->hasPost('submit')) {\n $valid = $firewall->write('update');\n\n // Check if data are valid\n if ($valid instanceof Firewalls) {\n $this->flashSession->success($this->tag->linkTo(['#', 'class' => 'close', 'title' => __(\"Close\"), '×']) . '<strong>' . __('Success') . '!</strong> ' . __(\"The data has been saved.\"));\n } else {\n $this->view->setVar('errors', $valid);\n $this->flashSession->warning($this->tag->linkTo(['#', 'class' => 'close', 'title' => __(\"Close\"), '×']) . '<strong>' . __('Warning') . '!</strong> ' . __(\"Please correct the errors.\"));\n }\n } else {\n $diff = [\n 'status' => $firewall->status == Firewalls::COMPILED ? Firewalls::ACTIVE : $firewall->status\n ];\n // Values to fill out the form\n $this->tag->setDefaults(array_merge(get_object_vars($firewall), $diff));\n }\n } else {\n parent::notFoundAction();\n }\n }", "public function formPlayerEdit($player_id){\n // Get the player to edit\n $target_player = PlayerLoader::fetch($player_id); \n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all users\n $users = UserLoader::fetchAll();\n \n foreach ($users as $user_id => $user){\n $user_list[$user_id] = $user->export(); \n }\n \n if ($render == \"modal\")\n $template = \"components/player-info-modal.html\";\n else\n $template = \"components/player-info-panel.html\";\n \n // Determine authorized fields\n $fields = ['player_name', 'user_name']; \n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){ \n $show_fields[] = $field; \n }\n \n // Always disallow editing username\n $disabled_fields[] = \"user_name\";\n \n // Load validator rules\n $validators = new \\Fortress\\ClientSideValidator($this->_app->config('schema.path') . \"/forms/player-update.json\");\n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Edit Player\",\n \"submit_button\" => \"Update player\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/players/u/$player_id\",\n \"target_player\" => $target_player,\n \"user_list\" => $user_list, \n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "public function webhook(Request $request)\n {\n }", "public function editpoll_submit(){\n SiteController::loggedInCheck();\n\n\t\tif (isset($_POST['Cancel'])) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\texit();\n\t\t}\n\n\t\t$pollid = $_POST['pollid'];\n\t\t$poll = Poll::loadById($pollid);\n\n\t\t$title = $_POST['title'];\n\t\t$options = $_POST['options'];\n\t\t$timestamp = date(\"Y-m-d\", time());\n\n\t\t$poll->set('title', $title);\n\t\t$poll->set('timestamp', $timestamp);\n\t\t$poll->save();\n\n //remove old options\n $old_options = Poll::getPollOptions();\n foreach($old_options as $opt){\n $opt->delete();\n }\n\n //update options\n foreach ($options as $option){\n $poll_option = new PollOption();\n $poll_option->set('pollId', $pollid);\n $poll_option->set('poll_option', $option);\n $poll_option->save();\n }\n\n\t\theader('Location: '.BASE_URL);\n\t}", "public function webhook()\n\t\t{\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation tspAsyncWithHttpInfo Get Account's TSP Information
public function tspAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\InlineResponse20044'; $request = $this->tspRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } ); }
[ "public function tspWithHttpInfo()\n {\n $request = $this->tspRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Zoom\\Api\\Model\\Tsp200Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\Zoom\\Api\\Model\\Tsp200Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Zoom\\Api\\Model\\Tsp200Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Zoom\\Api\\Model\\Tsp200Response';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Zoom\\Api\\Model\\Tsp200Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function userTSPAsyncWithHttpInfo($user_id, $tsp_id)\n {\n $returnType = '\\Zoom\\Api\\Model\\TSPAccount';\n $request = $this->userTSPRequest($user_id, $tsp_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function timestampGetTsaListAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TsaDTO[]';\n $request = $this->timestampGetTsaListRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function slpTokenInfoAsyncWithHttpInfo($slp_token_info_request)\n {\n $returnType = '\\Mainnet\\Model\\SlpTokenInfoResponse';\n $request = $this->slpTokenInfoRequest($slp_token_info_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getTlsActivationAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\TlsActivationResponse';\n $request = $this->getTlsActivationRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function getTlsActivationWithHttpInfo($options)\n {\n $request = $this->getTlsActivationRequest($options);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n if ('GET' != 'GET' && 'GET' != 'HEAD') {\n $header = $response->getHeader('Fastly-RateLimit-Remaining');\n if (count($header) > 0) {\n $this->config->setRateLimitRemaining($header[0]);\n }\n\n $header = $response->getHeader('Fastly-RateLimit-Reset');\n if (count($header) > 0) {\n $this->config->setRateLimitReset($header[0]);\n }\n } \n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Fastly\\Model\\TlsActivationResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Fastly\\Model\\TlsActivationResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Fastly\\Model\\TlsActivationResponse';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Fastly\\Model\\TlsActivationResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function tpps_api_call($type, $id = NULL, array $query = array()) {\n global $base_url;\n $path = $base_url . \"/tpps/api/$type\";\n if (!empty($id)) {\n $path .= \"/$id\";\n }\n if (!empty($query)) {\n $args = array();\n foreach ($query as $key => $val) {\n $args[] = \"$key=$val\";\n }\n $path .= \"?\" . implode(\"&\", $args);\n }\n $response = file_get_contents($path);\n return json_decode($response);\n}", "public function createTlsActivationAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\TlsActivationResponse';\n $request = $this->createTlsActivationRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function accountDetailsAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->accountDetailsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function timestampGetTsaProtocolListAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TsaProtocolDTO[]';\n $request = $this->timestampGetTsaProtocolListRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function userTSPUpdateAsyncWithHttpInfo($user_id, $tsp_id, $tsp_account1)\n {\n $returnType = '';\n $request = $this->userTSPUpdateRequest($user_id, $tsp_id, $tsp_account1);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function get()\n {\n $segment = $this->findSegment(static::SEG_ACCOUNT_INFORMATION);\n\t\t$details = $this->splitSegment($segment, false);\n\t\t#print_r($details);\n\t\t$request = new TANRequest();\n\t\t$request->setProcessID($details[3]);\n\t\t\n\t\treturn $request;\n }", "public function topologyTagGetAsyncWithHttpInfo()\n {\n $returnType = '\\tpn\\Model\\Topology[]';\n $request = $this->topologyTagGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function updateTlsActivationAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\TlsActivationResponse';\n $request = $this->updateTlsActivationRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function tspUpdateAsyncWithHttpInfo($tsp_update_request)\n {\n $returnType = '';\n $request = $this->tspUpdateRequest($tsp_update_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function tspUpdateWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->tspUpdateRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function v1PropertyTemplatesPoliciesGetAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesPoliciesGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getIdentityprovidersOktaAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\Okta';\n $request = $this->getIdentityprovidersOktaRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make composite product id from ($id and $options)
private function _getCompositeId($id, $options) { if(!empty($options)) { asort($options); $optionsString = implode('-', $options); return "{$id}.{$optionsString}"; } else { return "$id.0"; } }
[ "function fn_generate_cart_id($product_id, $extra, $only_selectable = false)\n{\n\t$_cid = array();\n\n\tif (!empty($extra['product_options']) && is_array($extra['product_options'])) {\n\t\tforeach ($extra['product_options'] as $k => $v) {\n\t\t\t\n\t\t\tif ($only_selectable == true && ((string)intval($v) != $v || db_get_field(\"SELECT inventory FROM ?:product_options WHERE option_id = ?i\", $k) != 'Y')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$_cid[] = $v;\n\t\t}\n\t}\n\n\tif (isset($extra['exclude_from_calculate'])) {\n\t\t$_cid[] = $extra['exclude_from_calculate'];\n\t}\n\n\t\n\n\tnatsort($_cid);\n\tarray_unshift($_cid, $product_id);\n\t$cart_id = fn_crc32(implode('_', $_cid));\n\n\treturn $cart_id;\n}", "protected function processId()\n {\n if ($id = $this->_processAttribute('URBITINVENTORYFEED_ATTRIBUTE_ID')) {\n $this->id = (string)$id . (empty($this->combination) ? '' : '-' . $this->getCombId());\n } elseif (empty($this->combination)) {\n $this->id = (string)$this->getProduct()->id;\n } else {\n $combinations = $this->getCombination();\n $true = isset($combinations['reference']) && $combinations['reference'];\n $cid = $this->getCombId();\n\n $this->id = $true ? $combinations['reference'] . '-' . $cid : $this->getProduct()->id . '-' . $cid;\n }\n }", "abstract protected function getOptionId();", "protected function _makeDataId($options)\n {\n $components = array('Username', 'Rolename', 'Get', 'Post', 'Session', 'Files', 'Cookies', 'Locale');\n $result = '';\n foreach ($components as $component) {\n $lower = strtolower($component);\n $partialResult = $this->_makePartialDataId(\n $component,\n isset($options['cache_with_' . $lower]) ? $options['cache_with_' . $lower] : true,\n isset($options['make_id_with_' . $lower]) ? $options['make_id_with_' . $lower] : false\n );\n\n if ($partialResult === false) {\n return false;\n }\n\n $result = $result . $partialResult;\n }\n\n // if compression is enabled adjust ID to indicate its use\n if ($options['compress']) {\n $result .= $this->_canCompress();\n }\n\n return 'action_data_' . md5($this->_makeUriId() . $result);\n }", "public function getOptionId();", "public function getId()\n {\n // The offer id will consist of the base URL stripped of the schema and the store view id plus the product id.\n $formattedBase = preg_replace('/(.*)\\:\\/\\/(.*?)((\\/index\\.php\\/?$)|$|(\\/index.php\\/admin\\/?))/is', '$2', Mage::getBaseUrl());\n $id = $formattedBase . '*' . $this->_storeId . '*' . $this->_productId;\n // if this is a child product, we add the child SKU\n if ($this->isChildProduct()) {\n $id = $id . '*' . $this->_getChildProduct()->getSku();\n }\n return $id;\n }", "function getProdKey ( $id, $options, &$cartid ) {\n\n\t\t$unique = $id;\n\n\t\tif( ! isset($this->Prods[$unique]) ) {\n\t\t\t// this product is not yet in the cart\n\t\t\t$cartid = $unique;\n\t\t\treturn false;\n\t\t}\n\n\t\t// product is in the cart, check the options\n\t\tforeach( $this->Prods as $k => $v ) {\n\n\t\t\tif( $v['productid'] == $id && $v['options'] == $options ) {\n\t\t\t\t// this product + options is already in the cart\n\t\t\t\t$cartid = $k;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// extract last used sequence number\n\t\t\t\t$pos = strpos( $k, SEP );\n\t\t\t\t$seq = ($pos === false ? 0 : substr($k, $pos + 1) );\n\t\t\t}\n\t\t}\n\n\t\t// not found, make new key, use letter for javascript compatability\n\t\t$cartid = $unique . SEP . ($seq + 1);\n\t\treturn false;\n\t}", "function getMixableId();", "private function get_product_to_duplicate($id)\n {\n }", "public abstract function generateOperationIdFor(OperationInterface $op);", "protected function configureId(): void\n {\n $this->id = sprintf(\n $this->options['id_format'],\n $this->options['server_name'],\n $this->options['pid'],\n implode(',', $this->queues)\n );\n }", "static function replicate($id)\n {\n if(!$variant = MongoLib::findOne_viewable('variants', $id))\n return ErrorLib::set_error(\"You do not have permission to view that variant.\"); \n\n // all clear!\n\n $new_id = self::add($variant['product']); \n\n if($variant['start_time'] && $variant['end_time']) \n self::set_times($new_id, array($variant['start_time']->sec, $variant['end_time']->sec));\n\n self::validize($variant);\n\n return $new_id;\n }", "function tp_generate_choice_id($choice, $index, $special_id)\r\n{\r\n // Generate a unique ID\r\n $id = md5(session_id() . $index . $special_id . $choice->type);\r\n /**\r\n * Choice ID\r\n * \r\n * @since 2.0.0\r\n * @filter tp_poll_generate_choice_id\r\n * @param ID\r\n * @param Choice object\r\n * @param Choice index\r\n */\r\n $choice->id = apply_tp_filters('tp_poll_generate_choice_id', $id, $choice, $index);\r\n}", "public function generateProduct($prd_id){\n\t\t\n\t}", "private function buildWebscaleId($id)\n {\n return str_replace('=', '', base64_encode($id));\n }", "public function get_product_id()\n {\n }", "private function autoGenProductID(){\n\t\t//\n\t\t$IDs = db::select('*', 'Products');\n\t\t$IDs = end($IDs);\n\t\t$IDs = $IDs[0];\n\t\t//To-do, test als statement werkt. Als het werkt kijk hoe de id heet en tel er 1 bij op en return dat nummer\n\t\treturn $IDs+1;\n\t}", "public function id() {\n\t\treturn $this->column('variant_option_uuid');\n\t}", "protected function wrap_id() {\n\t\tif ( ! empty( $this->option( 'wrap_attributes/id' ) ) ) {\n\t\t\treturn $this->option( 'wrap_attributes/id' );\n\t\t}\n\t\treturn ( ! empty( $this->option( 'wrap_id' ) ) ) ? $this->option( 'wrap_id' ) : $this->js_field_id();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a welcome string depending on access level
function welcomeMessage($accessLevel) { switch($accessLevel) { case UserAccessLevel::BoardDirector: $welcomeString = "Hello Board Director. Are you ready to waste all our money? You can manage user permissions within the side bar."; break; case UserAccessLevel::BoardMember: $welcomeString = "Wassup board member? The master list can be managed within the side bar."; break; case UserAccessLevel::CafeManager: $welcomeString = "Welcome Manager. Hope you are ready to work for that extra 50 cents an hour! You can manage your restuarants menu below."; break; case UserAccessLevel::CafeStaff: $welcomeString = "Hello comrade. Get ready for strenuous working time. Your shifts can be seen within the side bar."; break; case UserAccessLevel::UserStaff: $welcomeString = "Welcome to UTAS Eats. Staff discounts coming soon. Watch this space. See our available menus below."; break; case UserAccessLevel::UserStudent: $welcomeString = "Welcome to UTAS Eats. We hope the service will make getting food between your classes a breeze! See our available menus below."; break; default: $welcomeString = "You are not logged in. You should not be able to see this page"; } return $welcomeString; }
[ "private function show_welcome() {\n\t\t// Set welcome modal.\n\t\tshush_toolkit()->settings->update(\n\t\t\t'show_welcome',\n\t\t\ttrue,\n\t\t\t'misc',\n\t\t\tGeneral::is_networkwide()\n\t\t);\n\t}", "function acpperms_xml_show_welcome()\n\t{\n\t\t//-------------------------------\n\t\t// INIT\n\t\t//-------------------------------\n\t\t\n\t\t$content = '';\n\t\t\n\t\t//-------------------------------\n\t\t// Check...\n\t\t//-------------------------------\n\t\t\n\t\treturn $this->html->acp_xml_welcome( $this->member_info );\n\t}", "private function writeWelcome()\n {\n $message = sprintf(\n \"<info>%s</info> - %s <comment>%s</comment>.\\n\",\n Trans::__('nut.greeting'),\n Trans::__('nut.version'),\n Version::VERSION\n );\n $this->io->text($message);\n }", "function showWelcomePage() {\n\t\t$this->setCacheLevelNone();\n\t\t\n\t\t$this->getEngine()->assign('oUser', utilityOutputWrapper::wrap($this->getModel()->getUser()));\n\t\t\n\t\t$this->render($this->getTpl('welcome'));\n\t}", "public function welcomeMessage(){\n\n // TODO: change message string concatenation\n $current_user = \\Drupal::currentuser();\n\n // Generate customized welcome message with username and current date.\n $welcome_message = 'Hello ' . $current_user->getDisplayName() . '</br>';\n $welcome_message .= 'Today is ' . date(\"l M d, Y G:i\", time());\n\n return $welcome_message;\n }", "public function _welcome() {\n\t\t// Do nothing.\n\t}", "private function getWelcomeMsg() {\n $msg = \"\";\n $logged_in = \\Drupal::currentUser()->isAuthenticated();\n if($logged_in) {\n $this->getCurrentUserName();\n $msg = \"Welcome, \" . $this->getCurrentUserName() . \"!\";\n } else {\n $msg = \"<a href='user/login' class='menu__link menu__link--link is-active'>Log In</a>\";\n }\n return $msg;\n }", "protected function Welcome(){\n switch(Irc_Socket::$eLine[1]){\n }\n }", "private function welcomeMessage()\n {\n $message = <<<EOD\n===================================\n****** {$this->gameTitle} ******\n===================================\nEOD;\n $this->displayMessage($message);\n }", "protected function welcome()\n {\n $this->info('>> Welcome to '.$this->appName.' autosetup <<');\n }", "public function greet()\n {\n if ($this->security->isAuthenticated())\n {\n $identity = $this->security->getIdentity();\n return \"Welcome, \" . $identity->givenName;\n }\n else\n {\n return \"Welcome, visitor\";\n }\n }", "function display_welcome_link(){\n\t\n\t\tif (\n\t\t\t(!in_array(14, $_SESSION['logged_user']['permissions']))\n\t\t ){\n\t\t\t\t$allow_pahro_access = false;\n\t\t}else{\n\t\t\t\t$allow_pahro_access = true;\t\t\t\n\t\t}\n\t\treturn $allow_pahro_access;\n\t}", "public function prepare_welcome_notice() {\n\t\tset_transient( 'block_lab_show_welcome', 'true', 1 );\n\t}", "public function welcome() {\n\n // Bail if activating from network, or bulk\n if ( is_network_admin() || isset( $_GET['activate-multi'] ) )\n return;\n\n global $pagenow;\n\n if (isset($_GET['activated'] ) && $pagenow == \"themes.php\" ) {\n\n $upgrade = get_option( 'projects_version_upgraded_from' );\n\n if( ! $upgrade ) { // First time install\n wp_safe_redirect( admin_url( 'index.php?page=projects-getting-started' ) ); exit;\n } else { // Update\n wp_safe_redirect( admin_url( 'index.php?page=projects-about' ) ); exit;\n }\n }\n\n }", "private function printWelcome()\n {\n print \"\n ______ __ _ \n / __/ /___ _____ _____/ /( )___ \n _\\ \\/ __/ // / _ `/ __/ __//(_-< \n /___/\\__/\\_,_/\\_,_/_/ \\__/ /___/ \n ___ __ __ ___ \n / _ \\___ ____ ____ _____ _______/ / / |/ /__ ____ ___ ____ ____ ____\n / ___/ _ `(_-<(_-< |/|/ / _ \\/ __/ _ / / /|_/ / _ `/ _ \\/ _ `/ _ `/ -_) __/\n /_/ \\_,_/___/___/__,__/\\___/_/ \\_,_/ /_/ /_/\\_,_/_//_/\\_,_/\\_, /\\__/_/ \n /___/ \" . PHP_EOL;\n }", "public function always_show_welcome_panel()\n {\n $user_id = get_current_user_id();\n\n if (1 != get_user_meta($user_id, 'show_welcome_panel', true))\n update_user_meta($user_id, 'show_welcome_panel', 1);\n }", "function homeland_welcome_text() {\n\t\t$homeland_welcome_button = get_option('homeland_welcome_button');\t\n\t\t$homeland_welcome_header = stripslashes( get_option('homeland_welcome_header') );\n\t\t$homeland_welcome_text = stripslashes( get_option('homeland_welcome_text') );\n\t\t$homeland_welcome_link = get_option('homeland_welcome_link');\n\t\t?>\n\n\t\t\t<section class=\"welcome-block\">\n\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t<h2><?php echo $homeland_welcome_header; ?></h2>\n\t\t\t\t\t<label><?php echo $homeland_welcome_text; ?></label>\n\t\t\t\t\t<a href=\"<?php echo $homeland_welcome_link; ?>\" class=\"view-property\">\n\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\tif(!empty( $homeland_welcome_button )) : echo $homeland_welcome_button;\n\t\t\t\t\t\t\telse : esc_attr( _e( 'View Properties', CODEEX_THEME_NAME ) ); \n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t<?php\n\t}", "public function welcome() {\n\t\tglobal $pagenow;\n\t\tif ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) {\n\t\t\twp_redirect( admin_url( 'admin.php?page=wpex-about' ) );\n\t\t\texit;\n\t\t}\n\t}", "public function showWelcome()\n\t{\n\t\tif (! Sentry::check())\n\t\t{\n\t\t\treturn View::make('pages.welcome');\n\t\t} else {\n\t\t\treturn Redirect::to('/');\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if arg includes a list.
protected function includesList(Node $arg): bool { $type = data_get($arg, 'type'); if ($type instanceof ListTypeNode) { return true; } elseif (!is_null($type)) { return $this->includesList($type); } return false; }
[ "public static function inList($input, array $list) {\n return in_array($input, $list, true);\n }", "function x_is_list($arr, bool $include_empty_array=true)\n{\n return is_array($arr) && !x_is_assoc($arr) && ($include_empty_array ? 1 : !empty($arr));\n}", "public function isList(): bool\n {\n return is_list_array($this->data);\n }", "function isList() {\n\t\treturn true;\n\t}", "function contains(...$args)\n{\n\t$array = array_shift($args);\n\tif( is_array($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( in_array($a,$array) )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tif( is_string($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( stripos($array,$a) !== false )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tWdfException::Raise('First argument needs to be of type array or string');\n return false;\n}", "private function isList($input) {\n return (\n mb_substr($input, 0, 1) === '['\n && mb_substr($input, -1) === ']'\n && mb_substr(\n $input,\n 1 + self::LENGTH_DIGITS,\n self::DELIMITER_LENGTH\n ) === ':'\n );\n }", "protected function validates_inclusion_in($campo, $list){\n\t\t$this->connect();\n\t\tif(!is_array($this->validates_inclusion)){\n\t\t\t$this->validates_inclusion = array();\n\t\t}\n\t\t$this->validates_inclusion[$campo] = $list;\n\t\treturn true;\n\t}", "function is_list(string $data,string $separator=\",\") {\n // Check if it is a comma separated list inside the string\n if(strpos($data, $separator) !== false) {\n return true;\n } else {\n return false;\n }\n }", "public function hasArgumentsList()\n {\n return $this->arguments !== null;\n }", "public static function validateInList($value, array $list)\r\n\t{\r\n\t\treturn in_array($value, $list);\r\n\t}", "protected static function inList($list, $item) {\n\t\treturn (strpos(',' . $list . ',', ',' . $item . ',') !== FALSE ? TRUE : FALSE);\n\t}", "protected function _isValidList($list)\n {\n if (!is_array($list) && !($list instanceof \\Traversable)) {\n return false;\n }\n\n return true;\n }", "public function isList()\n\t{\n\t\treturn count($this) > 1 || $this->_forceList;\n\t}", "public function hasValidArguments($args): bool;", "public function isList()\n {\n return $this->object === 'list';\n }", "function snax_is_post_a_list( $post_id = 0 ) {\n\t$format = snax_get_post_format( $post_id );\n\n\treturn in_array( $format, array( 'list', 'ranked_list', 'classic_list' ) );\n}", "public function isInList(): bool\n {\n return $this->getListifyPosition() !== null;\n }", "static protected function _is_list ( array $array ) {\n\t\tforeach ( array_keys( $array ) as $key )\n\t\t\tif ( ! is_int( $key ) )\n\t\t\t\treturn false;\n\t\treturn true;\n\t}", "protected static function inList($list, $item)\n {\n return strpos(',' . $list . ',', ',' . $item . ',') !== FALSE;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter a menu so that it can be handed to _wp_menu_output(). This method basically emulates the filtering that WordPress does in /wpadmin/includes/menu.php, with a few additions of our own. Removes inaccessible items and superfluous separators. Sets accessible items to a capability that the user is guaranteed to have to prevent _wp_menu_output() from choking on pluginspecific capabilities like "cap1,cap2+not:cap3". Adds positiondependent CSS classes.
private function filter_menu($menu, $submenu) { global $_wp_menu_nopriv; //Caution: Modifying this array could lead to unexpected consequences. //Remove sub-menus which the user shouldn't be able to access, //and ensure the rest are visible. foreach ($submenu as $parent => $items) { foreach ($items as $index => $data) { if ( ! $this->current_user_can($data[1]) ) { unset($submenu[$parent][$index]); $_wp_submenu_nopriv[$parent][$data[2]] = true; } else { //The menu might be set to some kind of special capability that is only valid //within this plugin and not WP in general. Ensure WP doesn't choke on it. //(This is safe - we'll double-check the caps when the user tries to access a page.) $submenu[$parent][$index][1] = 'exist'; //All users have the 'exist' cap. } } if ( empty($submenu[$parent]) ) { unset($submenu[$parent]); } } //Remove menus that have no accessible sub-menus and require privileges that the user does not have. //Ensure the rest are visible. Run re-parent loop again. foreach ( $menu as $id => $data ) { if ( ! $this->current_user_can($data[1]) ) { $_wp_menu_nopriv[$data[2]] = true; } else { $menu[$id][1] = 'exist'; } //If there is only one submenu and it is has same destination as the parent, //remove the submenu. if ( ! empty( $submenu[$data[2]] ) && 1 == count ( $submenu[$data[2]] ) ) { $subs = $submenu[$data[2]]; $first_sub = array_shift($subs); if ( $data[2] == $first_sub[2] ) { unset( $submenu[$data[2]] ); } } //If submenu is empty... if ( empty($submenu[$data[2]]) ) { // And user doesn't have privs, remove menu. if ( isset( $_wp_menu_nopriv[$data[2]] ) ) { unset($menu[$id]); } } } unset($id, $data, $subs, $first_sub); //Remove any duplicated separators $separator_found = false; foreach ( $menu as $id => $data ) { if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) { if (false == $separator_found) { $separator_found = true; } else { unset($menu[$id]); $separator_found = false; } } else { $separator_found = false; } } unset($id, $data); //Remove the last menu item if it is a separator. $last_menu_key = array_keys( $menu ); $last_menu_key = array_pop( $last_menu_key ); if (!empty($menu) && 'wp-menu-separator' == $menu[$last_menu_key][4]) { unset($menu[$last_menu_key]); } unset( $last_menu_key ); //Add display-specific classes like "menu-top-first" and others. $menu = add_menu_classes($menu); return array($menu, $submenu); }
[ "public function processAdminMenu()\n {\n collect($this->settings['menu_items'])->each(function ($setting, $menuItem) {\n $global = $setting['enabled'][0];\n $environment = $setting['enabled'][1];\n $capability = $setting['enabled'][2];\n\n /**\n * Remove menu items\n *\n * ...if global is set but isn't set to display\n */\n if (isset($global) && $global !== \"display\") {\n remove_menu_page($this->menuSlugs[$menuItem]['menuItem']);\n\n /**\n * ...if environment is set but isn't set to display\n */\n } elseif (!empty($environment) && !$this->clear($environment)) {\n remove_menu_page($this->menuSlugs[$menuItem]['menuItem']);\n\n /**\n * ...or, current user capabilities are set but user does not have them\n */\n } elseif (!empty($capability) && !$this->clear($capability)) {\n remove_menu_page($this->menuSlugs[$menuItem]['menuItem']);\n\n /**\n * Otherwise, the parent menu doesn't need to be hidden\n * and it makes sense to continue checking its children for validity\n */\n } else {\n $this->processSubMenuItems($setting, $menuItem);\n }\n\n /**\n * If the user is on the page of the menu item\n * and it has been fully disabled (not just visually hidden)\n * return an error message\n */\n global $pagenow;\n\n $currentSlug = $this->menuSlugs[$menuItem]['menuItem'];\n\n if ($pagenow == $currentSlug && $global==\"removed\") {\n wp_die(__('This feature is not enabled.'), '', [\n 'response' => 403,\n ]);\n }\n });\n }", "public function filter_admin_sidebar_menu_items() {\n global $menu, $submenu_file, $typenow;\n\n $hr_menu = array_filter( $menu, function ( $item ) {\n return __( 'HR Recruitment', 'wp-erp-rec' ) === $item[0];\n } );\n\n $recruitment_pages = [\n 'post-new.php?post_type=erp_hr_questionnaire',\n 'edit.php?post_type=erp_hr_questionnaire'\n ];\n\n if ( in_array( $submenu_file , $recruitment_pages ) ) {\n $submenu_file = 'edit.php?post_type=erp_hr_questionnaire';\n $typenow = null;\n $_SERVER['PHP_SELF'] = 'edit.php?post_type=erp_hr_recruitment';\n\n add_filter( 'parent_file', function () {\n return 'edit.php?post_type=erp_hr_questionnaire';\n } );\n }\n\n $hr_menu_position = key( $hr_menu );\n\n unset( $menu[ $hr_menu_position ] );\n }", "function modify_menu_items() \n\t{\n\t\tglobal $submenu, $menu, $wpdb;\n\t\t$options = $this->options_obj->get(); \n\t\tif ( $options['privacy_override'] == 'no' && !is_site_admin() && $wpdb->blogid != 1 ) {\n\t\t\tunset( $submenu['options-general.php'][35] );\n\t\t}\n\t}", "public function filter_wp_get_nav_menu_items($items, $menu, $args)\n {\n }", "function filterMenus($menu) {\n\t\t\t$menu = str_replace('current_page_item', 'on active current_page_item', $menu);\n\t\t\t$menu = str_replace('current-page-ancestor', 'on active current-page-ancestor', $menu);\n\t\t\t$menu = str_replace('current_page_parent', 'on active current_page_parent', $menu);\n\t\t\t$menu = str_replace('</ul>', '', $menu);\n\t\t\t$menu = preg_replace('(\\<ul(/?[^\\>]+)\\>)', '',$menu);\n\t\t\treturn $menu;\n\t\t}", "function remove_admin_menu_items() {\n /**\n * Check has user \"Show all admin menu items\" checked in their profile.\n */\n $allow_all_menu_items = get_user_option( '_meom_dodo_allow_all_menu_items', get_current_user_id() );\n\n if ( $allow_all_menu_items ) {\n return;\n }\n\n /**\n * Filters the hidden admin menu items.\n *\n * @param array $removed_admin_menu_items Default hidden admin menu items.\n */\n $removed_admin_menu_items =\n \\apply_filters(\n 'meom_dodo_removed_admin_menu_items',\n [\n 'plugins.php',\n 'edit.php?post_type=acf-field-group',\n 'edit-comments.php',\n 'themes.php',\n ]\n );\n\n foreach ( $removed_admin_menu_items as $removed_admin_menu_item ) {\n remove_menu_page( \\esc_attr( $removed_admin_menu_item ) );\n }\n\n // Add nav back as top level menu item.\n add_menu_page( \\esc_html__( 'Menus', 'meom-dodo' ), \\esc_html__( 'Menus', 'meom-dodo' ), 'manage_options', 'nav-menus.php', '', 'dashicons-menu', 25 );\n}", "function _remove_blocked_menu_items($menu)\n\t{\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn $menu;\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tunset($menu['content']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_publish'))\n\t\t\t{\n\t\t\t\tunset($menu['content']['publish']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_edit'))\n\t\t\t{\n\t\t\t\tunset($menu['content']['edit']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_files'))\n\t\t\t{\n\t\t\t\tunset($menu['content']['files']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! ee()->cp->allowed_group('can_admin_upload_prefs'))\n\t\t\t\t{\n\t\t\t\t\tunset($menu['content']['files'][0]);\n\t\t\t\t\tunset($menu['content']['files']['file_upload_preferences']);\n\t\t\t\t\tunset($menu['content']['files']['file_watermark_preferences']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_design'))\n\t\t{\n\t\t\tunset($menu['design']);\n\t\t}\n\t\telse // Unset module themes they do not have access to\n\t\t{\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_modules'))\n\t\t\t{\n\t\t\t\tunset($menu['design']['themes']['forum_themes']);\n\t\t\t\tunset($menu['design']['themes']['wiki_themes']);\n\t\t\t}\n\t\t\telseif (ee()->session->userdata('group_id') != 1)\n\t\t\t{\n\t\t\t\t$allowed_modules = array_keys(ee()->session->userdata('assigned_modules'));\n\n\t\t\t\tif (count($allowed_modules) == 0)\n\t\t\t\t{\n\t\t\t\t\tunset($menu['design']['themes']['forum_themes']);\n\t\t\t\t\tunset($menu['design']['themes']['wiki_themes']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$m_names = array();\n\t\t\t\t\tee()->db->select('module_name');\n\t\t\t\t\tee()->db->where_in('module_id', $allowed_modules);\n\t\t\t\t\t$query = ee()->db->get('modules');\n\n\n\t\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m_names[] = $row['module_name'].'_themes';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! in_array('forum_themes', $m_names))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($menu['design']['themes']['forum_themes']);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! in_array('wiki_themes', $m_names))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($menu['design']['themes']['wiki_themes']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_mbr_templates'))\n\t\t\t{\n\t\t\t\tunset($menu['design']['themes']['member_profile_templates']);\n\n\t\t\t\tif (empty($menu['design']['themes']))\n\t\t\t\t{\n\t\t\t\t\tunset($menu['design']['themes']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_design'))\n\t\t\t{\n\t\t\t\tunset($menu['design']['message_pages']);\n\t\t\t\tunset($menu['design']['templates']['template_preferences']);\n\t\t\t\tunset($menu['design']['templates']['global_preferences']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_templates'))\n\t\t\t{\n\t\t\t\tunset($menu['design']['templates']['edit_templates'][lang('nav_create_template')]);\n\t\t\t\tunset($menu['design']['templates']['edit_templates'][0]);\n\t\t\t\tunset($menu['design']['templates']['create_template']);\n\t\t\t\tunset($menu['design']['templates']['snippets']);\n\t\t\t\tunset($menu['design']['templates']['sync_templates']);\n\t\t\t\tunset($menu['design']['templates']['global_variables']);\n\t\t\t\tunset($menu['design']['templates'][0]);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_addons'))\n\t\t{\n\t\t\tunset($menu['addons']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_modules'))\n\t\t\t{\n\t\t\t\tunset($menu['addons']['modules']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_accessories'))\n\t\t\t{\n\t\t\t\tunset($menu['addons']['accessories']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_extensions'))\n\t\t\t{\n\t\t\t\tunset($menu['addons']['extensions']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_plugins'))\n\t\t\t{\n\t\t\t\tunset($menu['addons']['plugins']);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_fieldtypes'))\n\t\t\t{\n\t\t\t\tunset($menu['addons']['fieldtypes']);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_members'))\n\t\t{\n\t\t\tunset($menu['members']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$member_divider_3 = TRUE;\n\t\t\t$unset_count = 0;\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_members'))\n\t\t\t{\n\t\t\t\tunset($menu['members']['ip_search']);\n\t\t\t\tunset($menu['members']['register_member']);\n\t\t\t\tunset($menu['members']['activate_pending_members']);\n\t\t\t\tunset($menu['members']['custom_member_fields']);\n\t\t\t\tunset($menu['members']['member_config']);\n\t\t\t\tunset($menu['members'][1]);\n\t\t\t\tunset($menu['members'][3]);\n\t\t\t\t$unset_count++;\n\n\t\t\t\t$member_divider_3 = FALSE;\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_ban_users'))\n\t\t\t{\n\t\t\t\tunset($menu['members']['user_banning']);\n\t\t\t\t$unset_count++;\n\n\t\t\t\tif ($member_divider_3 == FALSE)\n\t\t\t\t{\n\t\t\t\t\tunset($menu['members'][2]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_admin_mbr_groups'))\n\t\t\t{\n\t\t\t\tunset($menu['members']['member_groups']);\n\t\t\t\t$unset_count++;\n\t\t\t}\n\n\t\t\tif ($unset_count == 3)\n\t\t\t{\n\t\t\t\tunset($menu['members'][0]);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_admin'))\n\t\t{\n\t\t\tunset($menu['admin']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_sys_prefs'))\n\t\t\t{\n\t\t\t\tunset($menu['admin']['general_configuration']);\n\t\t\t\tunset($menu['admin']['localization_settings']);\n\t\t\t\tunset($menu['admin']['email_configuration']);\n\t\t\t\tunset($menu['admin']['admin_system']);\n\t\t\t\tunset($menu['admin']['security_and_privacy']);\n\n\t\t\t\tunset($menu['admin'][1]);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_content_prefs'))\n\t\t\t{\n\t\t\t\tunset($menu['admin']['channel_management']);\n\t\t\t\tunset($menu['admin']['admin_content']);\n\t\t\t\tunset($menu['admin'][0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! ee()->cp->allowed_group('can_admin_channels'))\n\t\t\t\t{\n\t\t\t\t\tunset($menu['admin']['channel_management']);\n\t\t\t\t\tunset($menu['admin']['admin_content']);\n\t\t\t\t\tunset($menu['admin'][0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! ee()->cp->allowed_group('can_access_tools'))\n\t\t{\n\t\t\tunset($menu['tools']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tools_divider = FALSE;\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_comm'))\n\t\t\t{\n\t\t\t\tunset($menu['tools']['tools_communicate']);\n\t\t\t\tunset($menu['tools'][0]);\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_data'))\n\t\t\t{\n\t\t\t\tunset($menu['tools']['tools_data']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tools_divider = TRUE;\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_utilities'))\n\t\t\t{\n\t\t\t\tunset($menu['tools']['tools_utilities']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tools_divider = TRUE;\n\t\t\t}\n\n\t\t\tif ( ! ee()->cp->allowed_group('can_access_logs'))\n\t\t\t{\n\t\t\t\tunset($menu['tools']['tools_logs']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tools_divider = TRUE;\n\t\t\t}\n\n\t\t\tif ( ! $tools_divider)\n\t\t\t{\n\t\t\t\tunset($menu['tools'][0]);\n\t\t\t}\n\t\t}\n\n\t\treturn $menu;\n\t}", "protected function filter($menu = [])\n {\n $menu = collect($menu)->filter(function ($item) {\n return $item instanceof \\WP_Post;\n })->all();\n\n _wp_menu_item_classes_by_context($menu);\n\n return collect($menu)->map(function ($item) {\n $item->classes = collect($item->classes)->filter(function ($class) {\n return ! Str::contains($class, $this->classes);\n })->implode(' ');\n\n foreach ($item as $key => $value) {\n if (! $value) {\n $item->{$key} = false;\n }\n }\n\n return $item;\n });\n }", "function remove_menu_items() {\n\tif ( !current_user_can('manage_options') ) {\n\t global $menu;\n \t\t$restricted = array(__('Links'), __('Tools'), __('Comments'), __('Appearance'), __('Profile'), __('Media'));\n \t\tend ($menu);\n \t\twhile (prev($menu)){\n \t$value = explode(' ',$menu[key($menu)][0]);\n \tif(in_array($value[0] != NULL?$value[0]:\"\" , $restricted)){\n \tunset($menu[key($menu)]);}\n \t}\n\t}\n}", "function jj_filter_private_pages_from_menu ($items, $args) {\r\n foreach ($items as $ix => $obj) {\r\n if (!is_user_logged_in () && 'private' == get_post_status ($obj->object_id)) {\r\n unset ($items[$ix]);\r\n }\r\n }\r\n return $items;\r\n}", "protected function filter_classes() {\n\n\t\t$this->classes = apply_filters( 'nav_menu_css_class', $this->classes, $this );\n\n\t}", "private function product_menu_filter( ){\n\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_product_menu_filter.php' ) )\t\n\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option('ec_option_base_layout') . '/ec_product_menu_filter.php' );\n\t\telse\n\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option('ec_option_latest_layout') . '/ec_product_menu_filter.php' );\n\t}", "public function archive_menu_filter( $items, $menu, $args )\n {\n foreach ( $items as &$item )\n {\n // Only make the wp_setup_nav_menu_item() call for archive items.\n if ( $item->type == 'custom' && in_array( 'type-archive', $item->classes ) )\n $item = $this->setup_archive_item( $item );\n }\n return $items;\n }", "public function filter_wp_nav_menu_args($args)\n {\n }", "public function removeMenuItem()\n {\n if ($this->acfExists()) {\n $this->addFilter('acf/settings/show_admin', '__return_false');\n }\n }", "function filter_wp_nav_menu_items( $nav_menu_items ) {\n\treturn array_filter(\n\t\t$nav_menu_items,\n\t\tfunction( $nav_menu_item ) {\n\t\t\t$user_visibility = get_post_meta( $nav_menu_item->ID, META_KEY, true );\n\t\t\t$should_show = (\n\t\t\t\tempty( $user_visibility )\n\t\t\t\t||\n\t\t\t\t( 'logged_in' === $user_visibility && is_user_logged_in() )\n\t\t\t\t||\n\t\t\t\t( 'logged_out' === $user_visibility && ! is_user_logged_in() )\n\t\t\t);\n\t\t\tif ( ! $should_show ) {\n\t\t\t\t$nav_menu_item = null;\n\t\t\t}\n\t\t\treturn $nav_menu_item;\n\t\t}\n\t);\n}", "public function removeAdminMenuItems()\n {\n remove_menu_page('index.php'); // Dashboard\n remove_menu_page('edit.php'); // Posts\n remove_menu_page('edit.php?post_type=page'); // Pages\n remove_menu_page('edit-comments.php'); // Comments\n remove_menu_page('themes.php'); // Appearance\n remove_menu_page('tools.php'); // Tools\n remove_menu_page('upload.php'); // Media\n\n if (!current_user_can('administrator')) {\n remove_menu_page('options-general.php'); // Settings\n }\n }", "public static function manage_admin_menu_items() {\n remove_menu_page( 'index.php' );\n // remove_menu_page( 'upload.php' ); // Remove 'Media' upload menu item\n if ( is_multisite() ) {\n add_menu_page( 'My Sites', 'My Sites', 'edit_others_pages', 'my-sites.php', '', '', 75 );\n }\n static::admin_menu_remove_first_separator();\n }", "function anud_hide_future_menu_items( $items, $menu, $args ) {\n// foreach ( $items as $key => $item ) {\n// wp_die( $item->post_class );\n// wp_die( json_encode($item) );\n// if ( $item->slug == 'library' ) {\n// unset( $items[$key] );\n// }\n// }\n return $items;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtains a new inputs object. Includes setters appropriate for this ListFolderContents Choreo.
public function newInputs($inputs = array()) { return new Dropbox_FilesAndMetadata_ListFolderContents_Inputs($inputs); }
[ "public function newInputs($inputs = array())\n {\n return new Box_Folders_GetFolderInformation_Inputs($inputs);\n }", "public function newInputs($inputs = array())\n {\n return new Box_Folders_CopyFolder_Inputs($inputs);\n }", "public function getFolderContents() {\n return $this->folder_contents;\n }", "public function newInputs($inputs = array())\n {\n return new Box_Folders_UpdateFolder_Inputs($inputs);\n }", "public function getMessageItemList(FolderKey $folderKey, MessageItemListResourceQuery $query): MessageItemList;", "public function fetch_folder_contents($parent_folder_id) {\n // get all child content\n $content = $this->find(array('parent_folder_id=?', $parent_folder_id), array('order' => 'arrangement'));\n $content_data = array();\n\n // iterate over each content object\n foreach ($content as $item) {\n // folder content type\n if ($item->target_type == $this->content_types['folder'])\n $result = $this->folder->fetch($item->target_id);\n // editor content type\n if ($item->target_type == $this->content_types['editor'])\n $result = $this->editor->fetch($item->target_id);\n // file content type\n if ($item->target_type == $this->content_types['file'])\n $result = $this->file->fetch($item->target_id);\n\n // add to array for displaying\n $result['type'] = array_search($item->target_type, $this->content_types);\n array_push($content_data, $result);\n\n }\n\n // set content to be displayed\n $this->f3->set('content_items', $content_data);\n }", "public function newInputs($inputs = array())\n {\n return new Box_Folders_DeleteFolder_Inputs($inputs);\n }", "public function newInputs($inputs = array())\n {\n return new Box_Folders_ZipFolder_Inputs($inputs);\n }", "private function doGetFolderContents() {\n\n $options = [];\n $options['http']['header'] = $this->header_forauth . \"\\r\\n\";\n $context = stream_context_create($options);\n $result = file_get_contents($this->box_api_folder_url, FALSE, $context);\n\n // put raw contents into variable for later processing\n $this->folder_contents = json_decode($result);\n\n if (!$this->folder_contents) {\n error_log(__CLASS__ . \": Failed to get any usable results from $this->box_api_folder_url \");\n }\n }", "function getFolderContent(){\n\n\t\t$folderPath=\"includes/uploads/\";\n\t\t$folderContent = scandir($folderPath);\n\n\n\t\t$html=\"\";\n\n\t\t$checkBoxDefaultStart=\"<div class='styled-input--diamond'><div class='styled-input-single'>\";\n $checkBoxDefaultEnd=\"</div></div>\";\n \n\n\t\tfor($i=2;$i<sizeof($folderContent);$i++){\n\n\t\t\t$file=$folderContent[$i];\n\t\t\t$itemBoxHtml=\"\";\n\n\t\t\tif(is_dir($folderPath.$file)){\n\t\t\t\t$image=\"<img src='images/folder_icon.svg' class='folderIcon' alt='\".$folderContent[$i].\"'>\";\n\n\t\t\t\t$itemSelectBox=\"<input type='checkbox' id='\".$folderContent[$i].\"' class='checkboxItemSelector folderFileItem' name='itemSelector' value='\".$folderContent[$i].\"'>\";\n\t\t\t\t$itemSelectBox=$itemSelectBox.\"<label for='\".$folderContent[$i].\"'></label>\";\n\t\t\t\t$itemSelectBox=$checkBoxDefaultStart.$itemSelectBox.$checkBoxDefaultEnd;\n\n\t\t\t\t$objectHtml=\"<div for='\".$folderContent[$i].\"' class='subFolderLink'>\".$image.\"<p>\".$folderContent[$i].\"</p></div>\";\n\t\t\t\t$itemBoxHtml=\"<div class='folderObjectBox'>\".$objectHtml.$itemSelectBox.\"</div>\";\n\t\t\t}else{\n\t\t\t\t$image=\"<img src='images/image_file_icon.svg' class='fileIcon' alt='\".$folderContent[$i].\"'>\";\n\n\t\t\t\t$itemSelectBox=\"<input type='checkbox' id='\".$folderContent[$i].\"' class='checkboxItemSelector objectFileItem' name='itemSelector' value='\".$folderContent[$i].\"'>\";\n\t\t\t\t$itemSelectBox=$itemSelectBox.\"<label for='\".$folderContent[$i].\"'></label>\";\n\t\t\t\t$itemSelectBox=$checkBoxDefaultStart.$itemSelectBox.$checkBoxDefaultEnd;\n\n\t\t\t\t$objectHtml=\"<div data-filename='\".$folderContent[$i].\"' class='folderItem' data-filepath='\".$file.\"'>\".$image.\"<p>\".$folderContent[$i].\"</p></div>\";\n\t\t\t\t$itemBoxHtml=\"<div class='folderObjectBox'>\".$objectHtml.$itemSelectBox.\"</div>\";\n\t\t\t}\n\n\t\t\t$html=$html.$itemBoxHtml;\n\n\t\t}\n\t\t\n\t\t//echo $html;\n return $html;\n\t}", "public function convertFromObjectInFolderList(ObjectInFolderListInterface $objectInFolder);", "public function folderLooksRequest($folder_id, $fields = null)\n {\n // verify the required parameter 'folder_id' is set\n if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $folder_id when calling folderLooks'\n );\n }\n\n $resourcePath = '/folders/{folder_id}/looks';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n if('form' === 'form' && is_array($fields)) {\n foreach($fields as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['fields'] = $fields;\n }\n }\n\n\n // path params\n if ($folder_id !== null) {\n $resourcePath = str_replace(\n '{' . 'folder_id' . '}',\n ObjectSerializer::toPathValue($folder_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function getFolderList(){\n return $this->folderContainer;\n }", "public function set_folder_data()\r\n\t{\r\n\t\t$folder = new Plugin\\Folder($this->folder_id);\r\n\t\t\r\n\t\t$this->folders_list = $folder->get_folders();\r\n\t\t$this->folder_list = $folder->get_paths($this->folder_id, false);\r\n\t\t$this->folder_hidden = $folder->get_hidden($this->folder_id, $this->per_page, $this->page_num);\r\n\t\t$this->folder_tree = $folder->view_tree();\r\n\t}", "public function newInputs($inputs = array())\n {\n return new FilesAnywhere_CreateFolder_Inputs($inputs);\n }", "protected function folderLooksRequest($folder_id, $fields = null)\n {\n // verify the required parameter 'folder_id' is set\n if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $folder_id when calling folderLooks'\n );\n }\n\n $resourcePath = '/folders/{folder_id}/looks';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n // path params\n if ($folder_id !== null) {\n $resourcePath = str_replace(\n '{' . 'folder_id' . '}',\n ObjectSerializer::toPathValue($folder_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function listContentLibraryItemsRequest($q = null, $id = null, $deleted = null, $folderUuid = null, $count = null, $page = null, $tag = null)\n {\n if ($count !== null && $count < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$count\" when calling ContentLibraryItemsApi.listContentLibraryItems, must be bigger than or equal to 1.');\n }\n\n if ($page !== null && $page < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$page\" when calling ContentLibraryItemsApi.listContentLibraryItems, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/public/v1/content-library-items';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($q !== null) {\n if('form' === 'form' && is_array($q)) {\n foreach($q as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['q'] = $q;\n }\n }\n // query params\n if ($id !== null) {\n if('form' === 'form' && is_array($id)) {\n foreach($id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['id'] = $id;\n }\n }\n // query params\n if ($deleted !== null) {\n if('form' === 'form' && is_array($deleted)) {\n foreach($deleted as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['deleted'] = $deleted;\n }\n }\n // query params\n if ($folderUuid !== null) {\n if('form' === 'form' && is_array($folderUuid)) {\n foreach($folderUuid as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['folder_uuid'] = $folderUuid;\n }\n }\n // query params\n if ($count !== null) {\n if('form' === 'form' && is_array($count)) {\n foreach($count as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['count'] = $count;\n }\n }\n // query params\n if ($page !== null) {\n if('form' === 'form' && is_array($page)) {\n foreach($page as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['page'] = $page;\n }\n }\n // query params\n if ($tag !== null) {\n if('form' === 'form' && is_array($tag)) {\n foreach($tag as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tag'] = $tag;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() != null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function folderChildren($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $folder = $this->Folder->load($id);\n\n $userDao = $this->_getUser($args);\n $folders = $this->Folder->getChildrenFoldersFiltered($folder, $userDao);\n $items = $this->Folder->getItemsFiltered($folder, $userDao);\n\n return array('folders' => $folders, 'items' => $items);\n }", "public function fetchFolderList()\n {\n $client = new Client($this->getUrl());\n $args = array(\n 'sid' => new Value($this->getSid()),\n );\n\n $response = $client->send(new Request('folder.list', array(new Value($args, \"struct\"))));\n $response = json_decode(json_encode($response), true);\n if (isset($response['val']['me']['struct']['folders']['me']['array'])) {\n return array_combine(\n array_map(function($o) {\n return $o['me']['struct']['id']['me']['int'];\n }, $response['val']['me']['struct']['folders']['me']['array']),\n array_map(function($o) {\n return $o['me']['struct']['name']['me']['string'];\n }, $response['val']['me']['struct']['folders']['me']['array'])\n );\n } else {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ensure variable is build correctly.
private function variableCheck() { }
[ "public function testVariableCreate()\n {\n }", "function checkVars() {\r\n\t\t$result = array();\r\n\t\tforeach ($this->Vars as $key => $value) {\r\n\t\t\tif ($this->defaultVars[$key] === $this->Vars[$key]) continue;\r\n\t\t\tif (in_array($key, array_keys($this->defaultVars))) {\r\n\t\t\t\tif (in_array($this->defaultVars[$key], array('yes', 'no'))) {\r\n\t\t\t\t\t$result[$key] = $this->convBoolean($this->Vars[$key]);\r\n\t\t\t\t\tif ($result[$key] === false) unset($result[$key]);\r\n\t\t\t\t} elseif (is_int($this->defaultVars[$key])) {\r\n\t\t\t\t\t$result[$key] = intval($this->Vars[$key]);\r\n\t\t\t\t\tif ($result[$key] === null) unset($result[$key]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tswitch (strlen(strval($this->Vars[$key]))) {\r\n\t\t\t\t\t\tCASE 6:\r\n\t\t\t\t\t\t\t$result[$key] = strtoupper(strval($this->Vars[$key]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tCASE 3:\r\n\t\t\t\t\t\t\t$temp1 = substr(strtoupper(strval($this->Vars[$key])), 0, 1);\r\n\t\t\t\t\t\t\t$temp2 = substr(strtoupper(strval($this->Vars[$key])), 1, 1);\r\n\t\t\t\t\t\t\t$temp3 = substr(strtoupper(strval($this->Vars[$key])), 2, 1);\r\n\t\t\t\t\t\t\t$result[$key] = $temp1.$temp1.$temp2.$temp2.$temp3.$temp3;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tCASE 0:\r\n\t\t\t\t\t\t\t$result[$key] = null;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$result[$key] = substr(strtoupper(strval($this->Vars[$key])).'000000', 0, 6);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (empty($result[$key])) unset($result[$key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($this->defaultVars[$key] === $result[$key]) unset($result[$key]);\r\n\t\t}\r\n\t\tif (!isset($result['width'])) $result['width'] = $this->defaultVars['width'];\r\n\t\t$this->Vars = $result;\r\n\t\tunset($result);\r\n\t\treturn true;\r\n\t}", "function variable_check($var) {\n\t\t\n\t\t// is variable set?\n\n\t\tif (isset($var)) {\n\t\t\treturn \"$var is set \\n\";\n\t\t}\n\t\t\n\t\telseif (empty($var)) {\n\t\t\treturn \"$var is not set \\n\";\n\t\t}\n\t\n\n}", "private function validateValue()\n {\n if ($this->value === null) {\n // value is null this means that default value should be assigned\n if ($this->isArray()) {\n $this->value = [];\n } else {\n $this->value = \"\";\n }\n }\n\n if ($this->isReference()) {\n // if variable is reference, then it always contains string and\n // does not have to be validated\n return;\n } else {\n if ($this->isArray()) {\n // noop, array can be defined with regexp\n } else {\n if (!is_scalar($this->value)) {\n throw new ExerciseConfigException(\"Variable '{$this->name}' should be scalar\");\n }\n }\n }\n }", "public function getBuildVars();", "public function testVariableShow()\n {\n }", "protected function buildIsUnique() {\n }", "public function isVar(): bool\n {\n return false;\n }", "public function testMoyVar()\n {\n //set variable var_rewrite to 'value1': Moy variable var_rewrite is available, and\n //the value can be rewrite\n Moy::set('var_rewrite', 'value1');\n $this->assertEquals(true, Moy::has('var_rewrite'));\n $this->assertEquals('value1', Moy::get('var_rewrite'));\n Moy::set('var_rewrite', 'value2');\n $this->assertEquals('value2', Moy::get('var_rewrite'));\n\n //set variable var_readonly to 'cannot change': Moy variable var_readonly is available,\n //and the value can not be rewrite\n Moy::set('var_readonly', 'cannot change', true);\n $this->assertEquals(true, Moy::has('var_readonly'));\n $this->assertEquals(true, Moy::readonly('var_readonly'));\n Moy::set('var_readonly', 'useless');\n $this->assertEquals('cannot change', Moy::get('var_readonly'));\n }", "function check_if_set($variable_name){\n\tif (isset($variable_name)){\n\t\techo \"SET\";\n\t} elseif (empty($variable_name)) {\n\t\techo \"EMPTY\";\n\t}\n\techo PHP_EOL;\n}", "public function testExists()\n {\n $vars = SG_Variables::getInstance();\n $this->assertFalse($vars->exists(self::VARIABLE_NAME));\n $this->assertFalse(isset($vars->{self::VARIABLE_NAME}));\n \n $vars->set(self::VARIABLE_NAME, self::VARIABLE_VALUE);\n \n $this->assertTrue($vars->exists(self::VARIABLE_NAME));\n $this->assertTrue(isset($vars->{self::VARIABLE_NAME}));\n }", "function varIsNULL() {\r\n\t\tself::$content .= \"NULL\";\r\n\t}", "public function checkVar(string $name) : bool {\n if(!$this->validate_variables){\n return true;\n }\n $original_name = $name;\n if($name instanceof SandboxedString){\n $name = strval($name);\n }\n if(!$name){\n $this->validationError('Sandboxed code attempted to call unnamed variable!', Error::VALID_VAR_ERROR, null, '');\n }\n if(is_callable($this->validation['variable'])){\n return call_user_func_array($this->validation['variable'], [$name, $this]);\n }\n if(!isset($this->definitions['variables'][$name])){\n if(count($this->whitelist['variables'])){\n if(!isset($this->whitelist['variables'][$name])){\n $this->validationError(\"Sandboxed code attempted to call non-whitelisted variable: $original_name\", Error::WHITELIST_VAR_ERROR, null, $original_name);\n }\n } else if(count($this->blacklist['variables'])){\n if(isset($this->blacklist['variables'][$name])){\n $this->validationError(\"Sandboxed code attempted to call blacklisted variable: $original_name\", Error::BLACKLIST_VAR_ERROR, null, $original_name);\n }\n } else if(!$this->allow_variables){\n $this->validationError(\"Sandboxed code attempted to call invalid variable: $original_name\", Error::VALID_VAR_ERROR, null, $original_name);\n }\n }\n return true;\n }", "function check_variable($array){\n\t/** check variable exist and not empty **/\n\t\tif(!(empty($array)) && isset($array) && $array != ''){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "abstract protected function _build();", "public function other_detailsCheckVars()\n {\n trigger_error('DEBUG CART: Running other_detailsCheckVars');\n// $this->site->page_id = 12;\n// $this->site->get_text();\n\n $specific_item = null;\n if (count(geoOrderItem::getParentTypesFor($this->item->getType())) > 0) {\n //this is a child which won't be auto called by parent,\n //so force it to call\n $specific_item = $this->item->getType();\n }\n geoOrderItem::callUpdate('geoCart_other_detailsCheckVars', null, $specific_item);\n //$this->errors ++;//force there to be errors\n }", "private function isValidForBuild()\n {\n return $this->filterType !== null;\n }", "protected function assertAllMandatoryVariablesHaveValue() : void\n {\n foreach ($this->document->getOperations() as $operation) {\n foreach ($this->document->getVariableReferencesInOperation($operation) as $variableReference) {\n $variable = $variableReference->getVariable();\n /**\n * Extended Spec: dynamic variable references will contain\n * no variable. No need to return error here, since for\n * static variables it will already fail in `assertAllVariablesExist`\n */\n if ($variable === null) {\n continue;\n }\n if (!$variable->isRequired() || \\array_key_exists($variable->getName(), $this->context->getVariableValues()) || $variable->hasDefaultValue()) {\n continue;\n }\n throw new InvalidRequestException(new FeedbackItemResolution(GraphQLSpecErrorFeedbackItemProvider::class, GraphQLSpecErrorFeedbackItemProvider::E_5_8_5, [$variableReference->getName()]), $variableReference);\n }\n }\n }", "private function variable_iniciada($variable) {\n if (isset($variable) && !empty($variable)) {\n return true;\n } else {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start buffering PHP output.
public function startOutputBuffering() { ob_start(); }
[ "protected function start_output_buffering()\n {\n }", "public static function outputBufferStart()\n {\n ob_start();\n }", "public function begin()\n {\n $this->buffering = true;\n ob_start();\n }", "public function bufferStart() {\n\t\tob_start( array( $this, 'obCallback' ) );\n\t}", "public function begin()\n {\n $this->capturing = true;\n\n ob_start();\n }", "public function startContent() {\n ob_start();\n }", "public static function startStream(){\n try{\n //try to change the server functions first\n // Turn off output buffering\n ini_set('output_buffering', 'off');\n // Turn off PHP output compression\n ini_set('zlib.output_compression', false);\n // Implicitly flush the buffer(s)\n ini_set('implicit_flush', true); \n }catch(Exception $e){\n \n } \n //Flush (send) the output buffer and turn off output buffering\n while (@ob_end_flush()); \n ob_implicit_flush(true);\n \n //now add browser tweaks\n echo str_pad(\"\",1024,\" \");\n echo \"<br />\";\n ob_flush();\n flush();\n sleep(1);\n }", "public function app_output_buffer() {\n\t\tob_start();\n\t}", "public function ob_start()\n {\n $this->ob_level++;\n $this->ob[$this->ob_level] = \"\";\n }", "public function bindStart() {\n\t\tob_start();\n\t}", "protected function resetOutputBuffering() {\n $olh = ob_list_handlers();\n if (empty($olh)) {\n ob_end_clean();\n }\n ob_start();\n }", "function ob_flush () {}", "public function ReStartOutputChecking()\r\n {\r\n ob_flush();\r\n }", "protected function startCaching() {\n $this->isCachingRequest = TRUE;\n ob_start();\n }", "public static function outputBufferFlush()\n {\n ob_end_flush();\n }", "public function process_buffer() {\n\n\t\t\tob_start( array( $this, 'process_img_tags' ) );\n\t\t}", "function maybe_start_output_buffer() {\n\t\tif ( isset( $_POST['dbhe_hook'] ) ) {\n\t\t\tob_start();\n\t\t\tadd_action( 'wp_footer', array( $this, 'print_search_result' ), 999 );\n\t\t}\n\t}", "public function startOutputCapture($key)\n {\n ob_start();\n }", "public function startOutput($comment=''){\r\n $this->startActive = true;\r\n $this->checkComment = $comment;\r\n //start line\r\n $backtrace = debug_backtrace();\r\n $this->startLine = $backtrace[0]['line'];\r\n $currFileName = $backtrace[0]['file'];\r\n $this->cacheScriptFile($currFileName);\r\n //ob_start\r\n $this->expectOutput();\r\n //time\r\n $this->startMcTime = microtime(true);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation bulkDeleteIfcPropertiesAsyncWithHttpInfo Delete many Property of a model
public function bulkDeleteIfcPropertiesAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk) { $returnType = ''; $request = $this->bulkDeleteIfcPropertiesRequest($cloud_pk, $ifc_pk, $project_pk); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
[ "public function restPropertiesMultipleOptionsDeleteAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->restPropertiesMultipleOptionsDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function testBulkDeleteIfcPropertyDefinitions()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function restPimAttributesDeleteAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restPimAttributesDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function bulkDeletePropertySetWithHttpInfo($cloud_pk, $ifc_pk, $project_pk)\n {\n $request = $this->bulkDeletePropertySetRequest($cloud_pk, $ifc_pk, $project_pk);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function bulkDeleteIfcPropertiesAsync($cloud_pk, $ifc_pk, $project_pk)\n {\n return $this->bulkDeleteIfcPropertiesAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function restPimAttributesNamesDeleteAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restPimAttributesNamesDeleteRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function restPropertiesMultipleOptionsDeleteAsync()\n {\n return $this->restPropertiesMultipleOptionsDeleteAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function bulkDeleteIfcPropertyDefinitionsAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk)\n {\n $returnType = '';\n $request = $this->bulkDeleteIfcPropertyDefinitionsRequest($cloud_pk, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function restPimAttributesDeleteWithHttpInfo()\n {\n $request = $this->restPimAttributesDeleteRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function deletePropertySetWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $request = $this->deletePropertySetRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "abstract public function deleteAllProperties(&$models);", "public function batchDeleteAction()\n {\n throw new ApiException\\BatchInterfaceNotImplementedException('Batch operations not implemented by this resource');\n }", "public function bulkDeleteIfcPropertyDefinitions($cloud_pk, $ifc_pk, $project_pk)\n {\n $this->bulkDeleteIfcPropertyDefinitionsWithHttpInfo($cloud_pk, $ifc_pk, $project_pk);\n }", "public function deleteAllProperties() {}", "public function bulkDeleteIfcPropertyDefinitionsWithHttpInfo($cloud_pk, $ifc_pk, $project_pk)\n {\n $request = $this->bulkDeleteIfcPropertyDefinitionsRequest($cloud_pk, $ifc_pk, $project_pk);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function bulkDeleteIfcClassificationsAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk)\n {\n $returnType = '';\n $request = $this->bulkDeleteIfcClassificationsRequest($cloud_pk, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function bulkDeleteIfcUnitsRequest($cloud_pk, $ifc_pk, $project_pk)\n {\n // verify the required parameter 'cloud_pk' is set\n if ($cloud_pk === null || (is_array($cloud_pk) && count($cloud_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_pk when calling bulkDeleteIfcUnits'\n );\n }\n // verify the required parameter 'ifc_pk' is set\n if ($ifc_pk === null || (is_array($ifc_pk) && count($ifc_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ifc_pk when calling bulkDeleteIfcUnits'\n );\n }\n // verify the required parameter 'project_pk' is set\n if ($project_pk === null || (is_array($project_pk) && count($project_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_pk when calling bulkDeleteIfcUnits'\n );\n }\n\n $resourcePath = '/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit/bulk_destroy';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_pk' . '}',\n ObjectSerializer::toPathValue($cloud_pk),\n $resourcePath\n );\n }\n // path params\n if ($ifc_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'ifc_pk' . '}',\n ObjectSerializer::toPathValue($ifc_pk),\n $resourcePath\n );\n }\n // path params\n if ($project_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'project_pk' . '}',\n ObjectSerializer::toPathValue($project_pk),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteIfcProperty()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function physicalInventoryReviewDeleteByKeysAsyncWithHttpInfo($ids)\n {\n $returnType = '';\n $request = $this->physicalInventoryReviewDeleteByKeysRequest($ids);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the attribute filter callback
public function setAttributeCallback($callback): HtmlCleaner { $this->filterCallbacks[self::FILTER_ATTRIBUTE] = $callback; return $this; }
[ "function set_attr_filter( $attr_filter ){\t\n\t\t$this->attr_filter = $attr_filter;\n\t}", "public function setDataFilterCallback($function)\n {\n $this->_dataFilterCallback = $function;\n }", "public function setFilter(?CustomerCustomAttributeFilterValue $filter): void\n {\n $this->filter = $filter;\n }", "public function applyAttributeFilter($criteria, $attribute)\n {\n }", "public function setFilter($filter){}", "public function setClassFilter(\\Closure $filter) {\n\t\t$this->classFilter = $filter;\n\t}", "public function setAttributeFilter(array $attributefilter)\n {\n if (! empty($attributefilter) && is_array($attributefilter)) {\n $this->whereAttributeClause = \" AND LOWER(ptav.attribute_value) LIKE '%{$attributefilter['value']}%' \";\n $this->whereAttributeClause .= \" AND LOWER(ptav.attribute_name) LIKE '%{$attributefilter['name']}%' \";\n }\n }", "function setFilter($filter)\n\t{\n\t\t$this->filter = $filter;\n\t}", "protected function getAttributeFilter()\n {\n if ($this->attributeFilter) {\n return $this->attributeFilter;\n }\n\n return function ($key, $value) {\n if (in_array($key, $this->getNonScalarAttributes())) {\n return !is_scalar($value);\n }\n\n if (Helper::endsWith($key, '_id') && trim($value) === '') {\n return false;\n }\n\n return is_scalar($value) || $value instanceof DateTime;\n };\n }", "public static function setClassFilter(\\Closure $filter) {\n\t\tself::$classFilter = $filter;\n\t}", "public function setTagCallback($callback): HtmlCleaner {\n\t\t\t$this->filterCallbacks[self::FILTER_TAG] = $callback;\n\n\t\t\treturn $this;\n\t\t}", "public function setFilter($filter) {\n\t\t$this->filter = $filter;\n\t}", "public function setFilter($attribute,$values,$exclude=false) {\r\n\t\t\tassert(is_string($attribute));\r\n\t\t\tassert(is_array($values));\r\n\t\t\tassert(count($values));\r\n\t\t\tif(is_array($values) && count($values)):\r\n\t\t\t\tforeach($values as $value) assert(is_numeric($value));\r\n\t\t\t\t$this->_filters[] = array(\r\n\t\t\t\t\t'type' => self::FILTER_VALUES,\r\n\t\t\t\t\t'attr' => $attribute,\r\n\t\t\t\t\t'exclude' => $exclude,\r\n\t\t\t\t\t'values' => $values\r\n\t\t\t\t);\r\n\t\t\tendif;\r\n\t\t}", "public function setAttributeCallback($callback)\n {\n $this->attributeCallback = $callback;\n\n return $this;\n }", "public function setAttrValidator($func)\n {\n $this->_attrValidator = $func;\n }", "public function filterByAttribute($query, Attribute $attribute, $value): void;", "public function set($filter, array $config)\n {\n $this->filters[$filter] = $config;\n }", "public function hook()\n {\n \\add_filter(\n $this->tag,\n $this->callback,\n $this->priority,\n $this->acceptedParams\n );\n }", "public function applyFilter();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the ID of the press.
function setId($pressId) { $this->setData('pressId', $pressId); }
[ "public function setId($value) { $this->_id = $value; }", "public function setId($value) { $this->id = $value;}", "function setID($id) {\r\n $this->id = $id;\r\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "function set_id($id){\n $this->id->value = $id;\n }", "function setPressId($pressId) {\n\t\treturn $this->setData('pressId', $pressId);\n\t}", "public function setID($id) {\n $this->ID = $id;\n }", "public function setId()\n {\n \t$this->id = self::$increment;\n \tself::$increment++;\n }", "public function SetID( $id ) {\n\t\t$this->SetAttribute( 'id', $id );\n\t}", "public function setID( $id = null ) {\n\t\tif ( defined( 'WPINC' ) )\n\t\t\t$this->_post_id = $id ? $id : get_the_ID();\n\t}", "function setId($n){\n $this->id = $n;\n }", "public function set_id( $id ) {\n\t\t$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();\n\t}", "public function setId($did){\n $this->edge_key=$did;\n }", "public function set_id($value){\n $this->set_info('player_id', intval($value));\n }", "public function setID($id){\r\r\n\t\t$this->edit_id = $id;\r\r\n\t}", "public function testSetId() {\n\t\techo (\"\\n********************Test SetId()*********************************************************\\n\");\n\t\t\n\t\t$this->chromosome->setId ( 2 );\n\t\t$this->assertEquals ( 2, $this->chromosome->getId () );\n\t}", "public function setID($v)\n { return $this->set('id', $v ? $v : JSONMessage::generateID()); }", "public function setID($_id){\n\t\t\t$this->id = $_id;\n\t\t\t\n\t\t\t// Set the chemical\n\t\t\t$this->equipment = new Equipment($this->dbi);\n\t\t\t$this->equipment->setByID($this->id);\n\t\t}", "function setId($new_id)\n {\n $this->id = (int) $new_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getTodoItemWithHttpInfo Retrieves a todo resource.
public function getTodoItemWithHttpInfo($id) { $returnType = '\Swagger\Client\Model\TodoJsonldTaskRead'; $request = $this->getTodoItemRequest($id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\TodoJsonldTaskRead', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function deleteTodoItemWithHttpInfo($id)\n {\n $returnType = '';\n $request = $this->deleteTodoItemRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function getOrderItemItemWithHttpInfo($id)\n {\n $request = $this->getOrderItemItemRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\TrackMage\\Client\\Swagger\\Model\\OrderItemGetOrderItem' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\TrackMage\\Client\\Swagger\\Model\\OrderItemGetOrderItem', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\TrackMage\\Client\\Swagger\\Model\\OrderItemGetOrderItem';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\TrackMage\\Client\\Swagger\\Model\\OrderItemGetOrderItem',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function putTodoItemWithHttpInfo($body, $id)\n {\n $returnType = '\\Swagger\\Client\\Model\\TodoJsonldTaskRead';\n $request = $this->putTodoItemRequest($body, $id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\TodoJsonldTaskRead',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getTodoItemAsyncWithHttpInfo($id)\n {\n $returnType = '\\Swagger\\Client\\Model\\TodoJsonldTaskRead';\n $request = $this->getTodoItemRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getWithHttpInfo($item_id)\n {\n // verify the required parameter 'item_id' is set\n if ($item_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $item_id when calling get');\n }\n // parse inputs\n $resourcePath = \"/item/{itemId}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // path params\n if ($item_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"itemId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($item_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('Authorization');\n if (strlen($apiKey) !== 0) {\n $headerParams['Authorization'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\eSagu\\Amzn\\RePricing\\V1\\Model\\RepricingItemDTO',\n '/item/{itemId}'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\eSagu\\Amzn\\RePricing\\V1\\Model\\RepricingItemDTO', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\eSagu\\Amzn\\RePricing\\V1\\Model\\RepricingItemDTO', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function processInfoGetTaskInfoByProcessWithHttpInfo($process_id)\n {\n $returnType = '\\Swagger\\Client\\Model\\TaskInfoDTO[]';\n $request = $this->processInfoGetTaskInfoByProcessRequest($process_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\TaskInfoDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getItemWithHttpInfo($merchant_item_oid, $_expand = null, $_placeholders = null)\n {\n return $this->getItemWithHttpInfoRetry(true , $merchant_item_oid, $_expand, $_placeholders);\n }", "public function processInfoGetNoteInfoByProcessWithHttpInfo($process_id)\n {\n $returnType = '\\Swagger\\Client\\Model\\NoteWorkInfoDTO[]';\n $request = $this->processInfoGetNoteInfoByProcessRequest($process_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\NoteWorkInfoDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function deleteOrderItemItemWithHttpInfo($id)\n {\n $request = $this->deleteOrderItemItemRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function getOrderItemDecorationDetailsWithHttpInfo($content_type, $order_id, $item_id, $deco_id)\n {\n $returnType = '';\n $request = $this->getOrderItemDecorationDetailsRequest($content_type, $order_id, $item_id, $deco_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "protected function getTodoItemFixture() {\n $todoItem = new TodoItem();\n $todoItem->setId(1100);\n $todoItem->setName('Test todo item');\n $todoItem->setDescription('this item was generated as part of an automated test');\n $todoItem->setPriority(1);\n $todoItem->setCreatedAt(time());\n $todoItem->setCompleted(false);\n\n return $todoItem;\n }", "public function showCustomerInvoiceNoteWithHttpInfo($number, $note_id)\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\Note';\n $request = $this->showCustomerInvoiceNoteRequest($number, $note_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse()->getBody()->getContents()\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\RackbeatApp\\Client\\Model\\Note',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getAttributesWithHttpInfo()\n {\n $returnType = '\\SendinBlue\\Client\\Model\\GetAttributes';\n $request = $this->getAttributesRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\SendinBlue\\Client\\Model\\GetAttributes',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function purchaseOrderItemsGetPurchaseOrderItemAsyncWithHttpInfo($org_code, $number, $item_sequence)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\PurchaseOrderItemsModel';\n $request = $this->purchaseOrderItemsGetPurchaseOrderItemRequest($org_code, $number, $item_sequence);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getItemActivityByIdAsyncWithHttpInfo($item_activity_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\ItemActivity';\n $request = $this->getItemActivityByIdRequest($item_activity_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getItemTagsWithHttpInfo($item_id)\n {\n $returnType = '';\n $request = $this->getItemTagsRequest($item_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function createOrderItemDecorationAsyncWithHttpInfo($body, $order_id, $item_id)\n {\n $returnType = '';\n $request = $this->createOrderItemDecorationRequest($body, $order_id, $item_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function deleteTodoItem($id)\n {\n $this->deleteTodoItemWithHttpInfo($id);\n }", "public function listOrderItemDecorationsWithHttpInfo($content_type, $order_id, $item_id)\n {\n $returnType = '';\n $request = $this->listOrderItemDecorationsRequest($content_type, $order_id, $item_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the Users Billing Information
public function setBillingInfo($arrBillInfo){ $this->billingInfo = $arrBillInfo; }
[ "public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }", "public function testUpdateBillingInfo()\n {\n }", "public function addBillingData()\n {\n $this->apiOrder->setBillingAddress($this->wcBillingAddress());\n }", "public function userBilling()\n {\n if ($this->request->is(['patch', 'post', 'put'])) {\n $userId = $this->request->data('billing.user_id');\n $data = $this->request->data('billing');\n if (isset($this->loggedUser->user_setting->price)) {\n $data['amount'] = $this->loggedUser->user_setting->price;\n } else {\n $data['amount'] = '75.00';\n }\n\n try {\n $authHandler = new AuthNetHandler();\n if ($subscription_id = $authHandler->createSubscription($data)) {\n $this->loadModel('UserSubscriptions');\n $subscription = $this->UserSubscriptions->newEntity();\n $subscription->user_id = $userId;\n $subscription->subscription_id = $subscription_id;\n $subscription->gateway = 'AuthNet';\n\n $this->UserSubscriptions->save($subscription);\n }\n\n $this->Flash->success(__('The subscription has been created.'));\n } catch (AuthNetException $e) {\n $this->Flash->error($e->getMessage());\n } catch (\\Exception $e) {\n $this->Flash->error('Unable to contact payment gateway, please try later.');\n Log::write('alert', $e);\n }\n\n if (isset($subscription_id) and $subscription_id) {\n $user = $this->Users->get($userId);\n $user->status = 'active';\n $this->Users->save($user);\n }\n\n return $this->redirect(\"/reseller/dashboard/view/$userId\");\n }\n }", "private function set_billing_address() {\n\t\t$address = new Address( $this->sf_order->getBillingAddress() );\n\t\t$this->billing_address = $address->get_formatted_address();\n\t\t//If the billing address phone is empty, get the shipping one to display phone on the BO\n\t\tif ( empty( $this->billing_address['phone'] ) ) {\n\t\t\t$this->billing_address['phone'] = $this->shipping_address['phone'];\n\t\t}\n\t}", "protected function InitBillingAddress()\n {\n $inputFilterUtil = $this->getInputFilterUtil();\n\n /** @var array<string, mixed> $billingAddressData */\n $billingAddressData = $inputFilterUtil->getFilteredPostInput(TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING);\n if (null !== $billingAddressData) {\n $this->SetBillingAddressData($billingAddressData);\n $this->bUserDataSubmission = true;\n } else {\n $shippingAddressData = $inputFilterUtil->getFilteredPostInput(TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING);\n if (null !== $shippingAddressData && TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING == $this->AddressUsedAsPrimaryAddress()) {\n $this->SetBillingAddressData($this->GetShippingAddressData());\n } else {\n $oUser = self::getExtranetUserProvider()->getActiveUser();\n $oBilling = $oUser->GetBillingAddress();\n $aBilling = array();\n if ($oBilling) {\n $aBilling = $oBilling->sqlData;\n }\n $this->SetBillingAddressData($aBilling);\n }\n }\n }", "public function copyBillingToShipping()\n {\n $this->setShippingFirstName($this->getBillingFirstName());\n $this->setShippingLastName($this->getBillingLastName());\n $this->setShippingAddress($this->getBillingAddress());\n $this->setShippingCity($this->getBillingCity());\n $this->setShippingState($this->getBillingState());\n $this->setShippingPostalCode($this->getBillingPostalCode());\n $this->setShippingCountry($this->getBillingCountry());\n }", "public function set_user_data() {\n\t\tglobal $current_user;\n\n\t\t$this->current_user = $current_user;\n\n\t\t$this->debug();\n\t}", "public function setBillingFilled($isFilled){\n Mage::getConfig()\n ->saveConfig(self::XML_PATH . self::BILLING_INFO_FILLED, intval($isFilled));\n }", "private function fillUserWithDetails() {\n\t\t$email = $this->user->getEmail();\n\t\t$this->user = $this->usersRepository->getUser($email);\n\t}", "public function saveBillingDetails()\n {\n $detail = $this->booking->billing()->create(Arr::except($this->data['billingDetail'], ['address']));\n\n $detail->address()->create(Arr::only($this->data['billingDetail'], ['address']));\n }", "function _save_user_details()\n\t{\n\t\t$txn_id = $this->session->userdata('txn_id');\n\t\t$this->database->SaveUserIdOnCheckout($this->tank_auth->get_user_id(), $txn_id);\n\n\t\t//Address must be there else _validate_address() will fail\n\t}", "protected function updateBillingDetail()\n {\n $search = [\n 'detailable_type' => \\App\\Models\\User::class,\n 'detailable_id' => $this->user->id\n ];\n //Format contactNumber value in json form according to 64robots/nova-fields\n $contactNumber['code'] = $this->request->billingDetail['code'];\n $contactNumber['number'] = $this->request->billingDetail['number'];\n $contact['contactNumber'] = $contactNumber;\n \n $this->billingDetail = BillingDetail::updateOrCreate(\n $search,\n array_merge($search, $contact, Arr::only($this->request->billingDetail, [\n 'firstName',\n 'lastName',\n 'email',\n 'companyName',\n ]))\n );\n }", "public static function billsCustomers()\n {\n static::$billsCustomers = true;\n }", "public function getDefaultBilling(){\n\n include_once $_SERVER['DOCUMENT_ROOT'] . '/Storage.php';\n $db = Storage::getInstance();\n $mysqli = $db->getConnection();\n\n session_start();\n\n if(isset($_SESSION['login_user'])){\n $user = $_SESSION['login_user'];\n }\n\n $sql_query = \"SELECT * FROM billing WHERE user='$user'\";\n $result = $mysqli->query( $sql_query );\n\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $name = $row['name'];\n $street = $row['street'];\n $city = $row['city'];\n $state = $row['state'];\n $zip = $row['zip'];\n $country = $row['country'];\n $wrap = $row['wrap'];\n }\n }\n\n if(isset($name)) {\n $this->model->setDefaultName($name);\n $this->model->setDefaultStreet($street);\n $this->model->setDefaultCity($city);\n $this->model->setDefaultState($state);\n $this->model->setDefaultZip($zip);\n $this->model->setDefaultCountry($country);\n $this->model->setDefaultWrap($wrap);\n }\n }", "function pmproaffl_save_billing_fields_from_request( $user_id ) {\n $meta_keys = array( \"bfirstname\", \"blastname\", \"baddress1\", \"baddress2\", \"bcity\", \"bstate\", \"bzipcode\", \"bcountry\", \"bphone\", \"bemail\" );\n \n // grab the data from $_REQUEST\n $meta_values = array();\n foreach( $meta_keys as $key ) {\n if ( ! empty( $_REQUEST[$key] ) ) {\n $meta_values[] = sanitize_text_field( $_REQUEST[$key] );\n } else {\n $meta_values[] = '';\n }\n }\n \n // Need prefixes before saving. Cheaper than str_replacing when grabbing from $_REQUEST\n foreach( $meta_keys as $key => $value ) {\n $meta_keys[$key] = 'pmpro_' . $value;\n }\n \n pmpro_replaceUserMeta( $user_id, $meta_keys, $meta_values );\n}", "public function setBillingName($billToName);", "public function setBillingData($time_billable, $bill_date = null)\n\t{\n\t\t$this->setTimeBillable($time_billable);\n\t\tif ($bill_date === null) {\n\t\t\t$bill_date = time();\n\t\t}\n\t\t$this->setBillDate($bill_date);\n\t}", "public function getBillingInfo(){\n return $this->billingInfo;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all portfolio templates as array
public function getPortfolioTemplates() { return $this->getTemplateGroup('portfolio_'); }
[ "function templates()\n {\n return[];\n }", "function templates()\n {\n return [];\n }", "public function getTemplates();", "public function getAllTemplates ()\n {\n $db = $this->getModel('db');\n $sql = \"SELECT id_template, chemin FROM `$this->table_cms_template` \";\n $result = array();\n $stmt = $db->query($sql);\n for (true; $res = $db->fetch_assoc($stmt); true) {\n $result[$res['id_template']] = $res['chemin'];\n }\n return $result;\n }", "public function toTwigCollection()\r\n {\r\n $templates = array();\r\n foreach ($this->toArray() as $template) {\r\n $templates[$template->getName()] = $template->getFile()->read();\r\n }\r\n\r\n return $templates;\r\n }", "private function getTemplates(){\n $templates = [];\n if(func_num_args()){\n foreach(func_get_args() as $templateName){\n $templates[] = $this->getSingleTemplate($templateName);\n }\n }\n return $templates;\n }", "public function getAll() {\n\t\treturn $this->crm_template_repo->all();\n\t}", "public function all()\n {\n return $this->templates;\n }", "public static function getTemplates(){\n return array(\n 'index'=>array(\n 'name'=>'Default Template',\n 'theme'=>'reports'\n ),\n 'pretty'=>array(\n 'name'=>'Pretty Template',\n 'theme'=>'simple'\n ),\n );\n }", "public function getAllLandingPageTemplateContent() {\n $templates = $this->getAllLandingPageTemplates();\n $all = [];\n foreach ($templates as $template) {\n $endpoint = \"/rest/asset/v1/landingPageTemplate/{$template->id}/content.json\";\n if ($this->debugMode) {\n print \"{$endpoint}: {$template->name} ... \";\n }\n $response = $this->makeGetRequest($endpoint);\n $all[$template->id] = [\n 'template' => $template,\n 'response' => $response->result[0],\n ];\n\n if ($this->debugMode) {\n print 'done' . PHP_EOL;\n }\n if (!$response->__loadedFromCache) {\n sleep($this->sleepSeconds);\n }\n }\n\n return $all;\n }", "public static function get_available_templates( $type ) {\n $paths = glob( get_template_directory() . \"/portfolio/$type*.php\" );\n $names = array();\n\n foreach ( $paths as $path ) {\n $file_data = get_file_data( $path, array( 'Portfolio Style' ) );\n $names[] = $file_data[0];\n }\n\n return $names;\n }", "protected function getPageTemplates()\n {\n return array();\n }", "public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}", "public function get_all_crumbly_templates()\n {\n $cache =& $this->_get_cache();\n\n if ( ! array_key_exists('crumbly_templates', $cache))\n {\n $db_templates = $this->EE->db\n ->select('label, template_id')\n ->get_where('crumbly_templates',\n array('site_id' => $this->get_site_id()));\n\n $templates = array();\n\n foreach ($db_templates->result_array() AS $db_template)\n {\n $templates[] = new Crumbly_template($db_template);\n }\n\n $cache['crumbly_templates'] = $templates;\n }\n\n return $cache['crumbly_templates'];\n }", "public static function getTemplates(): array\n {\n return self::getViewsList('pages');\n }", "public function index(){\n\t\t$templates = Kohana::list_files('templates');\n\t\t$list = array();\n\t\t\n\t\tfunction extract_template_name($arr){\n\t\t\tif(!is_array($arr)){\n\t\t\t\t// Get name of template\n\t\t\t\tpreg_match(\"/templates\\/(.*).mustache/\", $arr, $match);\n\t\t\t\t// Replace /'s to comply to Kohana naming convention and prevent routing issues\n\t\t\t\treturn str_replace(\"/\", \"_\", $match[1]);\n\t\t\t} else {\n\t\t\t\t$list = array_map(\"extract_template_name\", $arr);\n\t\t\t\t// Un-nest sub-arrays.\n\t\t\t\tforeach($list as $key => $val){\n\t\t\t\t\tif(is_array($val)){\n\t\t\t\t\t\tunset($list[$key]);\n\t\t\t\t\t\t$list = array_merge($list, $val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Because un-nesting we return a single dimension list here\n\t\t\t\treturn $list;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array_values(extract_template_name($templates));\n\t}", "public function getTemplateArray() : array\n\t{\n\t\t$templateFilesystem = new Filesystem\\Filesystem();\n\t\t$templateFilesystem->init('templates', false,\n\t\t[\n\t\t\t'admin',\n\t\t\t'console',\n\t\t\t'install'\n\t\t]);\n\t\t$templateFilesystemArray = $templateFilesystem->getSortArray();\n\t\t$templateArray =\n\t\t[\n\t\t\t$this->_language->get('select') => 'null'\n\t\t];\n\n\t\t/* process filesystem */\n\n\t\tforeach ($templateFilesystemArray as $value)\n\t\t{\n\t\t\t$templateArray[$value] = $value;\n\t\t}\n\t\treturn $templateArray;\n\t}", "public static function getAllTemplateUsed() {\n return self::pluck('template')->all();\n }", "public function getPageTemplates()\n {\n return response()->json(MyHelpers::getPageTemplates(), 200);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculate trends for all melee leagues. to be done by cronjob.
function calculate_clan_trends() { //TODO }
[ "public function trending(Request $request)\n {\n try {\n $district = $request->get('district');\n\n $query = Report\n ::selectRaw(\"count(*) as no_of_reports, disease_id, sum(no_of_victims) as no_of_victims, district, min(to_char(reports.created_at, 'Mon dd, yyyy')) as first_reported, epidemic_id, max(to_char(reports.created_at, 'Mon dd, yyyy')) as last_reported\")\n ->join('epidemics', 'reports.epidemic_id', '=', 'epidemics.id')\n ->whereRaw('epidemics.end_date IS NULL');\n\n if ($district && $request->user()->isNormal()) {\n $query->where('district', $district);\n }\n\n $running = $query->groupBy('disease_id', 'district', 'epidemic_id')->get();\n\n foreach ($running as &$report) {\n $report->district = $this->getMinDistance($request, $report, 'trending');\n }\n\n return [\n 'success' => true,\n 'diseases' => $this->formatReports($running, 'trending'),\n ];\n\n } catch (\\Exception $e) {\n \\Log::error($e);\n\n return [\n 'success' => 'false',\n ];\n }\n }", "public function updateTrends(){\n try\n\t\t{\n\t\t\t$sql = \"UPDATE new_matches_emails.RECEIVER m , twowaymatch.TRENDS t SET HASTRENDS = '1' WHERE m.PROFILEID =t.PROFILEID and ((t.INITIATED + t.ACCEPTED)>20)\";\n $prep = $this->db->prepare($sql);\n $prep->execute();\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tthrow new jsException($e);\n\t\t}\n }", "public function calcStats()\n {\n $this->calcMin();\n $this->calcMax();\n $this->calcAvg();\n for ($i = 0; $i < 6; $i++) {\n $this->calcAvg($i);\n }\n }", "public function calcRRStats() {\n $dbh = Database::getInstance();\n $teams = $this->getTeams()->Teams;\n $standings = [];\n\n /**\n * I go over each team in the tournament and calculate their matches won and matches played\n * this information is then added to an array which is sorted later, PHP side\n *\n * TODO: I took the lazy, slower approach by loading it team by team. Ideally all of this work would be done on the database server which is optimized for this\n */\n foreach ($teams as $team) {\n\n $data = new Entity();\n $data->addToData(['Team_ID' => $team['Team_ID']]);\n $data->addToData(['Team_Name' => $team['Team_Name']]);\n\n $sql = \"SELECT COUNT(*) as Matches_Won\n FROM Matches\n WHERE Winning_Team_ID = ?\n AND Tournament_ID = ?\n AND Round IS NULL\n ORDER BY Round DESC\";\n $sth = $dbh->prepare($sql);\n $sth->execute([$team['Team_ID'], $this->Tournament_ID]);\n $data->addToData(['Matches_Won' => $sth->fetch()['Matches_Won']]);\n\n $sql = \"SELECT COUNT(*) as Matches_Played\n FROM Matches\n WHERE (Team_A_ID = ? OR Team_B_ID = ?)\n AND Tournament_ID = ?\n AND Round IS NULL\n AND Status = 2\n ORDER BY Round DESC\";\n $sth = $dbh->prepare($sql);\n $sth->execute([$team['Team_ID'], $team['Team_ID'], $this->Tournament_ID]);\n $data->addToData(['Matches_Played' => $sth->fetch()['Matches_Played']]);\n array_push($standings, $data);\n }\n\n //TODO: This would be faster if it was one query and sorted on the DB server\n //Sort the array based on the number of matches won\n usort($standings, function ($a, $b) {\n return $b->Matches_Won - $a->Matches_Won;\n });\n return $standings;\n }", "public function updateTrends(){\n try\n\t\t{\n\t\t\t$sql = \"UPDATE matchalerts.MATCHALERTS_TO_BE_SENT m , twowaymatch.TRENDS t SET HASTRENDS = '1' WHERE m.PROFILEID =t.PROFILEID and ((t.INITIATED + t.ACCEPTED)>20)\";\n $prep = $this->db->prepare($sql);\n $prep->execute();\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tthrow new jsException($e);\n\t\t}\n }", "function trends() {\n\t\t$url = \"http://search.twitter.com/trends.json\";\n\t\treturn json_decode($this->__process_request($url, NULL, false, false));\n\t}", "function TournamentCalculateGroupStandings() {\n global $leagueID, $dbaseMatchData, $dbaseGroups, $dbase;\n\n // Loop through the results and create the \n // standings for each team.\n\n // Create a standing for each team\n $standings = array();\n $query = \"SELECT * FROM $dbaseGroups WHERE lid='$leagueID'\";\n $res = $dbase->query($query);\n while ($line = mysql_fetch_array($res)) {\n $team = $line[\"team\"];\n $grp = $line[\"grp\"];\n\n $standings[$team] = new Standing($grp, $team);\n }\n\n $today = getTodaysDate();\n $query = \"SELECT * FROM $dbaseMatchData AS a WHERE matchdate<'$today' AND a.lid='$leagueID' AND homescore IS NOT NULL and matchid>='1' and matchid<='24'\";\n $res = $dbase->query($query);\n\n\n while ($line = mysql_fetch_array($res)) {\n $ht = $line[\"hometeam\"];\n $at = $line[\"awayteam\"];\n $hs = $line[\"homescore\"];\n $as = $line[\"awayscore\"];\n\n //echo \"$ht $hs v $as $at<br>\";\n $standings[$ht]->updateStats($hs, $as);\n $standings[$at]->updateStats($as, $hs);\n }\n\n // Now put the data into the dbase table.\n while (list($key,$val) = each($standings)) {\n $val->persist();\n }\n\n // Now calculate the teams for the later stages\n SetKnockoutTeams();\n }", "private function calculateUserPoints(){\n $mytipsRepository = new MytipsRepository();\n $encounterRepository = new EncounterRepository();\n $userRepository = new UserRepository();\n $tips = $mytipsRepository->readAll();\n $encounters = $encounterRepository->getEncountersAlreadyPlayed(date(\"Y-m-d\"));\n foreach($tips as $tip){\n foreach($encounters as $encounter){\n if($encounter->id == $tip->begegnung_id){\n $user = $userRepository->readById($tip->benutzer_id);\n if($encounter->homegoals == $tip->homegoals){\n $user->punkte = $user->punkte + 1;\n }\n \n if($encounter->awaygoals == $tip->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n\n if($tip->homegoals > $tip->awaygoals && $encounter->homegoals > $encounter->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n\n if($tip->homegoals < $tip->awaygoals && $encounter->homegoals < $encounter->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n $userRepository->updateUserPoints($user->id, $user->punkte);\n $mytipsRepository->deleteById($tip->id);\n }\n }\n }\n }", "private function calculateAndPopulateData(): void\n {\n $manager = new AlgorithmManager;\n\n $this->algorithm = $manager->getFor($this->data->rater->data()->ageGroup, $this->data->meetings);\n\n // INFO: Get the expected treatment response (etr) for each meeting.\n $flattenMeeting = $this->algorithm->flattenMeeting;\n $maxMeetings = $this->algorithm->maxMeetings;\n $centeredAt20 = $this->data->firstRating->data()->score - 20;\n $interceptMean = $this->algorithm->interceptMean + ($this->algorithm->intake * $centeredAt20);\n $linearMean = $this->algorithm->linearMean + ($this->algorithm->linearByIntake * $centeredAt20);\n $quadraticMean = $this->algorithm->quadraticMean + ($this->algorithm->quadraticByIntake * $centeredAt20);\n $cubicMean = $this->algorithm->cubicMean + ($this->algorithm->cubicByIntake * $centeredAt20);\n $intercept = 1;\n\n // INFO: Make sure that the entire etr is always presented.\n if ($this->data->meetings < $maxMeetings) {\n $this->data->meetings = $maxMeetings;\n }\n\n // INFO: Add the intake session.\n $value = $this->data->firstRating->data()->score;\n $this->data->values[] = $value;\n $this->data->valuesAsString[] = number_format($value, 1);\n\n // INFO: Add the remaining values.\n for ($i = 1; $i < $this->data->meetings; $i++) {\n $meeting = $i;\n\n if ($meeting >= $flattenMeeting) {\n $meeting = $flattenMeeting;\n }\n\n $linear\t= $meeting;\n $quadratic = $linear * $linear;\n $cubic = $linear * $linear * $linear;\n $value = ($interceptMean * $intercept) + ($linearMean * $linear) + ($quadraticMean * $quadratic) + ($cubicMean * $cubic);\n\n $roundedValue = round($value, 1, PHP_ROUND_HALF_UP);\n $this->data->values[] = $roundedValue;\n $this->data->valuesAsString[] = number_format($roundedValue, 1);\n }\n }", "public function getLeaderboardDistanceScores();", "public function evaluate_lthr_list(){\n\t\t\t\t\t\t\n\t\t$this->db->join('tlhr_eval_ratings', 'tlhr_eval_ratings.tlhr_id = qpeteamleadtohr.tlhr_id');\n\t\t$this->db->join('tlhr_eval_factors', 'tlhr_eval_factors.tlhr_eval_fact_id = tlhr_eval_ratings.tlhr_eval_fact_id');\n\t\t$this->db->join('tlhr_categories', 'tlhr_categories.tlhr_cat_id = tlhr_eval_factors.tlhr_eval_cat');\n\t\t$this->db->join('user', 'user.User_id = qpeteamleadtohr.tlhr_name');\n\t\t$this->db->join('departments', 'departments.dept_id = qpeteamleadtohr.tlhr_department');\n\t\t$this->db->join('projects', 'projects.project_id = qpeteamleadtohr.tlhr_project');\n\t\t$this->db->join('designations', 'designations.designation_id = qpeteamleadtohr.tlhr_designation');\n\t\t\n\t\t$this->db->group_by(\"qpeteamleadtohr.tlhr_id\");\n\t\t$query = $this->db->get('qpeteamleadtohr');\n\n\t\treturn $query->result_array();\n\t}", "function initStat()\n{\n\tinclude './data.php';\n\n\t// всего голов забито в чемпионате\n\t$iallGoalsScored = 0;\n\n\t// всего голов пропущено в чемпионате\n\t$iallGoalsSkiped = 0;\n\n\t// всего игр в чемпионате\n\t$iallMatches = 0;\n\t// командные коэффициенты \n\t$aAvgTeam = array();\n\tforeach ($data as $iTID => $aTeam) {\n\t\t$iallGoalsScored += $aTeam['goals']['scored'];\n\t\t$iallGoalsSkiped += $aTeam['goals']['skiped'];\n\t\t$iallMatches += $aTeam['games'];\n\t\tif($aTeam['games']){\n\t\t\t$aAvgTeam[$iTID]['favgTeamScored'] = $aTeam['goals']['scored'] / $aTeam['games'];\n\t\t\t$aAvgTeam[$iTID]['favgTeamSkiped'] = $aTeam['goals']['skiped'] / $aTeam['games'];\n\t\t}\n\t}\n\t// среднее количество голов в чемпионате\n\t$favgGoalsScored = $iallGoalsScored/$iallMatches;\n\t$favgGoalsSkiped = $iallGoalsSkiped/$iallMatches;\n\n\t// сила атаки и защиты команды\n\t$aRetVals = array();\n\tforeach ($aAvgTeam as $iTID => $aAVGS) {\n\t\t$aRetVals['team'][$iTID]['fratioAtacking'] = $aAVGS['favgTeamScored'] / $favgGoalsScored;\n\t\t$aRetVals['team'][$iTID]['fratioDefending'] = $aAVGS['favgTeamSkiped'] / $favgGoalsSkiped;\n\t}\t\n\t$aRetVals['favgGoalsScored'] = $favgGoalsScored;\n\t$aRetVals['favgGoalsSkiped'] = $favgGoalsSkiped;\n\n\treturn $aRetVals;\n}", "public function CalculateEachBet(){\n\t\t$each_bet = $this->single_bet_info;\n\n\t\t// Home/Away\n\t\tif($each_bet->market_name == \"Home/Away\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap\n\t\tif($each_bet->market_name == \"Asian Handicap\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Total Points\n\t\tif($each_bet->market_name == \"Total Points\"){\n\t\t\t$this->setScore();\n\t\t\t$total_points = (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->calculateTotalHomeAway($total_points);\n\t\t}\n\t\t\n\t\t// Odd/Even\n\t\tif($each_bet->market_name == \"Odd/Even\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// 1x2\n\t\tif($each_bet->market_name == \"1x2\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateMatchWinner($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (1st Half)\n\t\tif($each_bet->market_name == \"Asian Handicap (1st Half)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (2nd Half)\n\t\tif($each_bet->market_name == \"Asian Handicap (2nd Half)\"){\n\t\t\t$this->setScore('st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (Including OT)\n\t\tif($each_bet->market_name == \"Asian Handicap (Including OT)\"){\n\t\t\t$this->setScore('ot');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Overtime\n\t\tif($each_bet->market_name == \"Overtime\"){\n\t\t\t$this->setScore('ot');\n\t\t\t$home_ft = (int)$this->home_score;\n\t\t\t$away_ft = (int)$this->away_score;\n\t\t\t$this->setScore();\n\t\t\t$home_qtr = (int)$this->home_score;\n\t\t\t$away_qtr = (int)$this->away_score;\n\t\t\t$this->calculateOverTime($home_qtr,$away_qtr,$home_ft,$away_ft);\n\t\t}\n\t\t\n\t\t// Odd/Even (Including OT)\n\t\tif($each_bet->market_name == \"Odd/Even (Including OT)\"){\n\t\t\t$this->setScore('ot');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (1st Half)\n\t\tif($each_bet->market_name == \"Odd/Even (1st Half)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (2nd Half)\n\t\tif($each_bet->market_name == \"Odd/Even (2nd Half)\"){\n\t\t\t$this->setScore('st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (1st Quarter)\n\t\tif($each_bet->market_name == \"Odd/Even (1st Quarter)\"){\n\t\t\t$this->setScore('1st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (2nd Quarter)\n\t\tif($each_bet->market_name == \"Odd/Even (2nd Quarter)\"){\n\t\t\t$this->setScore('2nd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (3rd Quarter)\n\t\tif($each_bet->market_name == \"Odd/Even (3rd Quarter)\"){\n\t\t\t$this->setScore('3rd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Odd/Even (4th Quarter)\n\t\tif($each_bet->market_name == \"Odd/Even (4th Quarter)\"){\n\t\t\t$this->setScore('4th');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEven($home,$away);\n\t\t}\n\t\t\n\t\t// Double Chance\n\t\tif($each_bet->market_name == \"Double Chance\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateDoubleChance($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (1st Half)\n\t\tif($each_bet->market_name == \"Home/Away (1st Half)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (2nd Half )\n\t\tif($each_bet->market_name == \"Home/Away (2nd Half )\"){\n\t\t\t$this->setScore('st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (1st Quarter)\n\t\tif($each_bet->market_name == \"Home/Away (1st Quarter)\"){\n\t\t\t$this->setScore('1st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (2nd Quarter)\n\t\tif($each_bet->market_name == \"Home/Away (2nd Quarter)\"){\n\t\t\t$this->setScore('2nd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (3rd Quarter)\n\t\tif($each_bet->market_name == \"Home/Away (3rd Quarter)\"){\n\t\t\t$this->setScore('3rd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Home/Away (4th Quarter)\n\t\tif($each_bet->market_name == \"Home/Away (4th Quarter)\"){\n\t\t\t$this->setScore('4th');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateHomeAway($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (1st Quarter)\n\t\tif($each_bet->market_name == \"Asian Handicap (1st Quarter)\"){\n\t\t\t$this->setScore('1st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (2nd Quarter)\n\t\tif($each_bet->market_name == \"Asian Handicap (2nd Quarter)\"){\n\t\t\t$this->setScore('2nd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (3rd Quarter)\n\t\tif($each_bet->market_name == \"Asian Handicap (3rd Quarter)\"){\n\t\t\t$this->setScore('3rd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Asian Handicap (4th Quarter)\n\t\tif($each_bet->market_name == \"Asian Handicap (4th Quarter)\"){\n\t\t\t$this->setScore('4th');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateAsianHandicap($home,$away);\n\t\t}\n\t\t\n\t\t// Half Time/Full Time\n\t\tif($each_bet->market_name == \"Half Time/Full Time\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home_ht = (int)$this->home_score;\n\t\t\t$away_ht = (int)$this->away_score;\n\t\t\t$this->setScore();\n\t\t\t$home_ft = (int)$this->home_score;\n\t\t\t$away_ft = (int)$this->away_score;\n\t\t\t$this->calculateHTFT($home_ht,$away_ht,$home_ft,$away_ft);\n\t\t}\n\t\t\n\t\t// Half Time/Full Time (Including OT)\n\t\tif($each_bet->market_name == \"Half Time/Full Time (Including OT)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home_ht = (int)$this->home_score;\n\t\t\t$away_ht = (int)$this->away_score;\n\t\t\t$this->setScore('ot');\n\t\t\t$home_ft = (int)$this->home_score;\n\t\t\t$away_ft = (int)$this->away_score;\n\t\t\t$this->calculateHTFT($home_ht,$away_ht,$home_ft,$away_ft);\n\t\t}\n\t\t\n\t\t// Highest Scoring Half\n\t\tif($each_bet->market_name == \"Highest Scoring Half\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$first_half = (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->setScore('st');\n\t\t\t$second_half = (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->calculateHighestScoringHalf($first,$second);\n\t\t}\n\t\t\n\t\t// Highest Scoring Quarter\n\t\tif($each_bet->market_name == \"Highest Scoring Quarter\"){\n\t\t\t$total_score\t\t\t\t\t= array();\n\t\t\t$this->setScore('1st');\n\t\t\t$total_score['1st Quarter'] \t= (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->setScore('2nd');\n\t\t\t$total_score['2nd Quarter'] \t= (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->setScore('3rd');\n\t\t\t$total_score['3rd Quarter'] \t= (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->setScore('4th');\n\t\t\t$total_score['4th Quarter'] \t= (int)$this->home_score + (int)$this->away_score;\n\t\t\t$this->calculateHighestScoringQuarter($total_score);\n\t\t}\n\t\t\n\t\t// Home To Win Both Halves\n\t\tif($each_bet->market_name == \"Home To Win Both Halves\"){\n $this->setScore('ht');\n\t\t\t$ht_home = (int)$this->home_score;\n $ht_away = (int)$this->away_score;\n $this->setScore('st');\n\t\t\t$ft_home = (int)$this->home_score;\n $ft_away = (int)$this->away_score;\n\t\t\t$this->calculateHomeWinBothHalves($ht_home,$ht_away,$ft_home,$ft_away);\n\t\t}\n\t\t\n\t\t// Away To Win Both Halves\n\t\tif($each_bet->market_name == \"Away To Win Both Halves\"){\n $this->setScore('ht');\n\t\t\t$ht_home = (int)$this->home_score;\n $ht_away = (int)$this->away_score;\n $this->setScore('st');\n\t\t\t$ft_home = (int)$this->home_score;\n $ft_away = (int)$this->away_score;\n\t\t\t$this->calculateAwayWinBothHalves($ht_home,$ht_away,$ft_home,$ft_away);\n\t\t}\n\t\t\n\t\t// Home To Win All Quarters\n\t\tif($each_bet->market_name == \"Home To Win All Quarters\"){\n $this->setScore('1st');\n\t\t\t$score['home_first'] = (int)$this->home_score;\n\t\t\t$score['away_first'] = (int)$this->away_score;\n\t\t\t$this->setScore('2nd');\n\t\t\t$score['home_second'] = (int)$this->home_score;\n\t\t\t$score['away_second'] = (int)$this->away_score;\n\t\t\t$this->setScore('3rd');\n\t\t\t$score['home_third'] = (int)$this->home_score;\n\t\t\t$score['away_third'] = (int)$this->away_score;\n\t\t\t$this->setScore('4th');\n\t\t\t$score['home_forth'] = (int)$this->home_score;\n\t\t\t$score['away_forth'] = (int)$this->away_score;\n\t\t\t$this->calculateHomeWinAllQuarters($score);\n\t\t}\n\t\t\n\t\t// Away To Win All Quarters\n\t\tif($each_bet->market_name == \"Away To Win All Quarters\"){\n $this->setScore('1st');\n\t\t\t$score['home_first'] = (int)$this->home_score;\n\t\t\t$score['away_first'] = (int)$this->away_score;\n\t\t\t$this->setScore('2nd');\n\t\t\t$score['home_second'] = (int)$this->home_score;\n\t\t\t$score['away_second'] = (int)$this->away_score;\n\t\t\t$this->setScore('3rd');\n\t\t\t$score['home_third'] = (int)$this->home_score;\n\t\t\t$score['away_third'] = (int)$this->away_score;\n\t\t\t$this->setScore('4th');\n\t\t\t$score['home_forth'] = (int)$this->home_score;\n\t\t\t$score['away_forth'] = (int)$this->away_score;\n\t\t\t$this->calculateAwayWinAllQuarters($score);\n\t\t}\n\t\t\n\t\t// Home Odd/Even\n\t\tif($each_bet->market_name == \"Home Odd/Even\"){\n\t\t\t$this->setScore();\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\n\t\t// Home Odd/Even (1st Half)\n\t\tif($each_bet->market_name == \"Home Odd/Even (1st Half)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\n\t\t// Home Odd/Even (2nd Half)\n\t\tif($each_bet->market_name == \"Home Odd/Even (2nd Half)\"){\n\t\t\t$this->setScore('st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Home Odd/Even (1st Quarter)\n\t\tif($each_bet->market_name == \"Home Odd/Even (1st Quarter)\"){\n\t\t\t$this->setScore('1st');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Home Odd/Even (2nd Quarter)\n\t\tif($each_bet->market_name == \"Home Odd/Even (2nd Quarter)\"){\n\t\t\t$this->setScore('2nd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Home Odd/Even (3rd Quarter)\n\t\tif($each_bet->market_name == \"Home Odd/Even (3rd Quarter)\"){\n\t\t\t$this->setScore('3rd');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Home Odd/Even (4th Quarter)\n\t\tif($each_bet->market_name == \"Home Odd/Even (4th Quarter)\"){\n\t\t\t$this->setScore('4th');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Home Odd/Even (Including OT)\n\t\tif($each_bet->market_name == \"Home Odd/Even (Including OT)\"){\n\t\t\t$this->setScore('ot');\n\t\t\t$home = (int)$this->home_score;\n\t\t\t$this->calculateOddEvenEach($home);\n\t\t}\n\t\t\n\t\t// Away Odd/Even\n\t\tif($each_bet->market_name == \"Away Odd/Even\"){\n\t\t\t$this->setScore();\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\n\t\t// Away Odd/Even (1st Half)\n\t\tif($each_bet->market_name == \"Away Odd/Even (1st Half)\"){\n\t\t\t$this->setScore('ht');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\n\t\t// Away Odd/Even (2nd Half)\n\t\tif($each_bet->market_name == \"Away Odd/Even (2nd Half)\"){\n\t\t\t$this->setScore('st');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t\t\n\t\t// Away Odd/Even (1st Quarter)\n\t\tif($each_bet->market_name == \"Away Odd/Even (1st Quarter)\"){\n\t\t\t$this->setScore('1st');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t\t\n\t\t// Away Odd/Even (2nd Quarter)\n\t\tif($each_bet->market_name == \"Away Odd/Even (2nd Quarter)\"){\n\t\t\t$this->setScore('2nd');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t\t\n\t\t// Away Odd/Even (3rd Quarter)\n\t\tif($each_bet->market_name == \"Away Odd/Even (3rd Quarter)\"){\n\t\t\t$this->setScore('3rd');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t\t\n\t\t// Away Odd/Even (4th Quarter)\n\t\tif($each_bet->market_name == \"Away Odd/Even (4th Quarter)\"){\n\t\t\t$this->setScore('4th');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t\t\n\t\t// Away Odd/Even (Including OT)\n\t\tif($each_bet->market_name == \"Away Odd/Even (Including OT)\"){\n\t\t\t$this->setScore('ot');\n\t\t\t$away = (int)$this->away_score;\n\t\t\t$this->calculateOddEvenEach($away);\n\t\t}\n\t}", "function adviceVOData($schoolID, $schoolGraph){\n $base = new BaseModel;\n // get the current year and detract 2 to get the desired year from the DB\n $today = date(\"Y\"); \n $month = date(\"m\");\n if($month <= 8){\n $year= $today-1;\n $year2 = $year.\"-\".$today;\n }else{\n $year = $today;\n $year2 = $year.\"-\".$today+1;\n \n } \n $getFunction = \"getAdviceVOData\";\n $advice = $base->showItem($getFunction, $schoolID, $year);\n $counter = count($advice);\n $i=0;\n $aantallaag = 0;\n $zwaartelaag =0;\n $aantalgoed = 0;\n $aantalhoog= 0;\n $zwaartehoog =0;\n \n //Checks if the advice is lower, correct or higher and calulates the differences.\n foreach($advice as $value){\n if($advice[$i][\"ILTLevel\"] < $advice[$i][\"adviceLevel\"]){\n $aantallaag = $aantallaag + 1;\n $laagdiff = abs($advice[$i][\"adviceLevel\"] - $advice[$i][\"ILTLevel\"]);\n $zwaartelaag = $zwaartelaag + $laagdiff;\n $i++;\n }elseif($advice[$i][\"ILTLevel\"] == $advice[$i][\"adviceLevel\"]){\n $aantalgoed = $aantalgoed + 1;\n $i++;\n }elseif($advice[$i][\"ILTLevel\"] > $advice[$i][\"adviceLevel\"]){\n $aantalhoog = $aantalhoog + 1;\n $hoogdiff= abs($advice[$i][\"ILTLevel\"] - $advice[$i][\"adviceLevel\"]);\n $zwaartehoog = $zwaartehoog + $hoogdiff;\n $i++;\n }else{$i++;}\n }\n $hoogafwijking = $zwaartehoog / $aantalhoog;\n $laagafwijking = $zwaartelaag / $aantallaag;\n //echo $counter.\"<br />\".$aantallaag.\"<br />\".$aantalgoed.\"<br />\".$aantalhoog.\"<br />\";\n $hoogafwijking = round($hoogafwijking, 2);\n $laagafwijking = round($laagafwijking, 2);\n // echo $hoogafwijking.\"<-\";\n // echo $laagafwijking.\"<-\";\n ?>\n<script>\n var aantallaag<?php echo$schoolGraph;?> = \"<?php echo$aantallaag; ?> te laag\";\n var aantalgoed<?php echo$schoolGraph;?> = \"<?php echo$aantalgoed. \" v/d \" .$counter; ?> is goed geplaatst\";\n var aantalhoog<?php echo$schoolGraph;?> = \"<?php echo$aantalhoog; ?> te hoog\";\n var laagafwijking<?php echo$schoolGraph;?> = <?php echo$laagafwijking; ?>;\n var hoogafwijking<?php echo$schoolGraph;?> = <?php echo$hoogafwijking; ?>;\n var adviceYear<?php echo$schoolGraph;?> = <?php echo$year;?>;\n </script>\n\n <?php \n}", "function compute_all_interest($date) {\n global $debug;\n global $debug_interest;\n if ($debug) { echo \"compute_all_interest('$date');\\n\";}\n $money = 0;\n foreach ($this->list as $name => $loan) {\n if ($debug_interest) { echo \"Loans compute_all_interest, $date, $name\\n\"; }\n $money += $loan->compute_interest($date);\n }\n return $money;\n }", "function getStatsPerDay($year) {\n $data = array();\n $bookingDatesOfCurrentYear = getBookingDatesOfYear($year);\n foreach($bookingDatesOfCurrentYear as $date) { // a day\n\t\n\t\t// echo(\"$date<br>\\n\");\n $donations = 0;\n $total = 0; \n $food = 0; \n $school = 0; \n $articles = array();\n \n $bookingIds = getBookingIdsOfDate($date, false); \n foreach($bookingIds as $bookingId) { // a booking\n $booking = getBooking($bookingId);\n// \t echo(\"<pre>\"); print_r($booking); echo(\"</pre>\");\n foreach ($booking['articles'] as $articleId => $article) { // articles \n\t\t\t\t//echo(\"$articleId, \" . ($articleId * 10));\n\t\t\t\t//print_r($articles);\n\t\t\t\t//print_r($articles[$articleId]);\n\t\t\t\tif (is_array($articles[$articleId]) and !array_key_exists('quantity', $articles[$articleId])) {\n\t\t\t\t\t$articles[$articleId]['quantity'] = 0;\n\t\t\t\t}\n\t\t\t\t$articles[$articleId]['quantity'] += $article['quantity'];\n $articles[$articleId]['price'] = $article['price']; // not summed up since it is per 1 pc.\n\t\t\t\t\n\t\t\t\tif ($articleId == 200) { // Food\n\t\t\t\t\t//print_r($article);\n\t\t\t\t\t$food += $article['quantity']; // equals the costs on food\n\t\t\t\t}\n\t\t\t\t\n// \t\t\t\tif ($articleId == 200) { // School\n// \t\t\t\t\t//print_r($article);\n// \t\t\t\t\t$school += $article['total'];\n// \t\t\t\t}\n }\n $donations += $booking['donation'];\n $total += $booking['total'];\n\t if ($booking['school']) {\n\t\t$school += $booking['total']; // Count school bookings total additionally\n\t }\n\t \n } \n \n// $total += $donations;\n $data[$date]['donations'] = $donations;\n $data[$date]['total'] = $total;\n $data[$date]['food'] = $food;\n $data[$date]['school'] = $school;\n\t\t\n// \techo(\"donations, total, food, school: $donations, $total, $food, $school<br>\\n\");\n// \tif ($school > 0) {\n// \t echo(\"SCHOOL: $school<br>\");\n// \t}\n }\n \n ksort($data);\n\t\n\t//print_r($data);\n return $data;\n}", "public function TeamStats($log_key, $time_key, $user_type_key){\n $dbq = db_query(\"SELECT DISTINCT user_stats_team_id FROM lk_verlag_stats WHERE user_stats_team_id != 0 AND stats_date='\". $time_key .\"' AND stats_user_type='\". $user_type_key.\"'\");\n foreach($dbq as $all){\n $team_id = $all -> user_stats_team_id;\n $team = \\LK\\get_team($team_id);\n\n $dbq3 = db_query(\"SELECT count(*) as count FROM lk_verlag_stats WHERE user_stats_team_id='\". $team_id .\"' AND stats_date='\". $time_key .\"' AND stats_user_type='\". $user_type_key.\"'\");\n $result3 = $dbq3 -> fetchObject();\n $this->logSummary($team_id, $log_key, $time_key, 'active_users', (int)$result3 -> count);\n $this->logSummary($team_id, $log_key, $time_key, 'activated_users', $team->getUserActive_count());\n\n\n $dbq4 = db_query(\"SELECT sum(page_sessions) as page_sessions, sum(page_hits) as page_hits, sum(page_time) as page_time FROM lk_verlag_stats WHERE user_stats_team_id='\". $team_id .\"' AND stats_date='\". $time_key .\"' AND stats_user_type='\". $user_type_key.\"'\");\n $result4 = $dbq4 -> fetchObject();\n\n $this->logSummary($team_id, $log_key, $time_key, 'page_sessions', (int)$result4 -> page_sessions);\n $this->logSummary($team_id, $log_key, $time_key, 'page_hits', (int)$result4 -> page_hits);\n $this->logSummary($team_id, $log_key, $time_key, 'page_time', (int)$result4 -> page_time);\n }\n }", "public function getTeamleadersStatisticsForOrganisation(Organisation $organisation);", "function teamActivity ($id, $nDays){\n if ($id > 0)\n $w = \"AND (team1=$id OR team2=$id)\";\n\n $set = sqlQuery (\"select team1, team2, UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(tsactual) as age FROM bzl_match\n WHERE tsactual > DATE_SUB(NOW(), INTERVAL $nDays day) $w\n ORDER BY tsactual desc\");\n\n $k = (2 / (1 + $nDays)) / $nDays;\n $spd = (24*60*60);\n $accum = array();\n while ($row = mysql_fetch_array ($set)){\n $weight = $k * ($nDays - ($row[2] / $spd));\n $accum[$row[0]] += $weight; \n $accum[$row[1]] += $weight; \n }\n if ($id > 0)\n return $accum [$id];\n return $accum;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Collect all information for the active theme.
function _clean_theme_collector() { $themes = list_themes(); $active_themes = array(); global $theme_info; // If there is a base theme, collect the names of all themes that may have // data files to load. if (isset($theme_info->base_theme)) { global $base_theme_info; foreach ($base_theme_info as $base){ $active_themes[$base->name] = $themes[$base->name]; $active_themes[$base->name]->path = drupal_get_path('theme', $base->name); } } // Add the active theme to the list of themes that may have data files. $active_themes[$theme_info->name] = $themes[$theme_info->name]; $active_themes[$theme_info->name]->path = drupal_get_path('theme', $theme_info->name); return $active_themes; }
[ "private function get_theme_info()\n {\n }", "public function get_theme_info()\n {\n }", "public function themeInfo()\n {\n return array(\n \"name\"=>\"\", //Name of theme\n \"version\"=>\"\",\n \"base\"=>\"\", // For example: bs4\n \"cssClass\"=>\"\",//cssClass that will be attached to widget\n ); \n }", "function current_theme_info()\n{\n}", "public function get_theme_info() {\n return array(\n 'theme_name' => $this->theme_name,\n 'theme_version' => $this->theme_version,\n );\n }", "public function theme_data()\n\t{\n\t\treturn $this->_theme_data;\n\t}", "protected function loadThemeData()\n {\n $data = IdeasShop::returnCacheData('theme_data', function() {\n $data['galleries'] = $this->loadGalleries();\n $data['welcome'] = $this->loadWelcome();\n $data['featured'] = $this->loadFeaturedProduct();\n $data['testimonials'] = $this->loadTestimonials();\n $data['ship_slide'] = $this->loadShipSlide();\n $data['arrivals'] = $this->loadLastedArrivals();\n $data['category'] = $this->loadCategory();\n $data['is_bestseller'] = $this->loadBestseller();\n $data['seo_title'] = Config::getConfigByKey('seo_title');\n $data['seo_keyword'] = Config::getConfigByKey('seo_keyword');\n $data['seo_description'] = Config::getConfigByKey('seo_description');\n return $data;\n });\n return $data;\n }", "function realestate_theme_info() {\n return array(\n 'name' => 'Osclass realestate Theme'\n ,'version' => '2.1.0'\n ,'description' => 'This is the Osclass realestate theme'\n ,'author_name' => 'Osclass Team'\n ,'author_url' => 'http://osclass.org'\n ,'locations' => array('header', 'footer')\n );\n }", "function install_theme_information() {}", "public function all()\n {\n return $this->themes;\n }", "public function getTheme();", "public function getThemes();", "function twitter_theme_info() {\n return array(\n 'name' => 'Isha'\n ,'version' => '1.0'\n ,'description' => 'main theme'\n ,'author_name' => 'playandbay team'\n ,'author_url' => 'http://playandbay.com'\n ,'locations' => array('header', 'footer')\n );\n }", "function political_theme_info_page() {\n\t// Get theme details.\n\t$theme = wp_get_theme();\n\t?>\n\t<div class=\"wrap theme-info-wrap\">\n\t\t<h1><?php printf( esc_html__( 'Welcome to %1$s %2$s', 'political' ), esc_html($theme->display( 'Name' )), esc_html($theme->display( 'Version' ) )); ?></h1>\n\t\t<div class=\"theme-description\"><p><?php echo esc_html($theme->display( 'Description' )); ?></p></div>\n\t\t<h2 class=\"nav-tab-wrapper wp-clearfix\">\n\t\t\t<a target=\"_blank\" href=\"<?php echo esc_url('https://wpcomb.com/political-theme/'); ?>\" class=\"nav-tab\"><?php echo esc_html__('Free vs PRO', 'political'); ?></a>\n\t\t\t<a target=\"_blank\" href=\"<?php echo esc_url('http://wpcomb.com/themes/political/'); ?>\" class=\"nav-tab\"><?php echo esc_html__('Live Demo', 'political'); ?></a>\n\t\t\t<a target=\"_blank\" href=\"<?php echo esc_url('http://docs.wpcomb.com/political'); ?>\" class=\"nav-tab\"><?php echo esc_html__('Documentation', 'political'); ?></a>\n\t\t\t<a href=\"https://wordpress.org/support/theme/political/reviews/#new-post\" class=\"nav-tab\"><?php echo esc_html__('Rate this Theme', 'political'); ?></a>\n\t\t\t<a href=\"<?php echo esc_url(home_url().'/wp-admin/themes.php?page=tgmpa-install-plugins'); ?>\" class=\"nav-tab\"><?php echo esc_html__('Recomended Plugins', 'political'); ?></a>\n\t\t</h2>\n\t\t<div id=\"getting-started\">\n\t\t\t<div class=\"columns-wrapper clearfix\">\n\t\t\t\t<div class=\"column column-half clearfix\">\n\t\t\t\t\t<div class=\"section\">\n\t\t\t\t\t\t<h3 class=\"title\"><?php printf( esc_html__( 'Getting Started with %s', 'political' ), esc_html($theme->display( 'Name' )) ); ?></h3>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<a href=\"https://wpcomb.com/political-theme/\" target=\"_blank\" class=\"button button-primary button-hero\"><?php esc_html_e( 'Get Political PRO now', 'political' ); ?></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"section\">\n\t\t\t\t\t\t<h4><?php esc_html_e( 'Theme Options', 'political' ); ?></h4>\n\t\t\t\t\t\t<p class=\"about\">\n\t\t\t\t\t\t\t<?php printf( esc_html__( '%s makes use of the Customizer for all theme settings. Click on \"Customize Theme\" to open the Customizer now.', 'political' ), esc_html($theme->display( 'Name' )) ); ?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url(wp_customize_url()); ?>\" class=\"button button-primary\"><?php esc_html_e( 'Customize Theme', 'political' ); ?></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"column column-half clearfix\">\n\t\t\t\t\t<img class=\"screenshot\" width=\"500\" src=\"<?php echo esc_url(get_template_directory_uri() . '/screenshot.png'); ?>\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\n}", "public function get_all_themes() {\r\n\t\tMainWP_Child_Stats::get_instance()->get_all_themes();\r\n\t}", "function themes() { return array(); }", "function _site_collect_theme_settings() {\n $settings = [];\n\n // Header bar\n $settings['header_bar']['tour_url'] = theme_get_setting('tour_url');\n $settings['header_bar']['contact_url'] = theme_get_setting('contact_url');\n\n // Contact information\n $settings['contact_information']['business_owner_name'] = theme_get_setting('business_owner_name');\n $settings['contact_information']['business_startup_year'] = theme_get_setting('business_startup_year');\n $settings['contact_information']['address'] = theme_get_setting('address');\n $settings['contact_information']['zipcode'] = theme_get_setting('zipcode');\n $settings['contact_information']['city'] = theme_get_setting('city');\n $settings['contact_information']['phone_system'] = theme_get_setting('phone_system');\n $settings['contact_information']['phone_readable'] = theme_get_setting('phone_readable');\n $settings['contact_information']['email'] = theme_get_setting('email');\n $settings['contact_information']['working_hours'] = theme_get_setting('working_hours');\n\n // Social\n $settings['social']['facebook']['active'] = theme_get_setting('facebook');\n $settings['social']['facebook']['url'] = theme_get_setting('facebook_url');\n $settings['social']['facebook']['tooltip'] = theme_get_setting('facebook_tooltip');\n $settings['social']['twitter']['active'] = theme_get_setting('twitter');\n $settings['social']['twitter']['url'] = theme_get_setting('twitter_url');\n $settings['social']['twitter']['tooltip'] = theme_get_setting('twitter_tooltip');\n $settings['social']['googleplus']['active'] = theme_get_setting('googleplus');\n $settings['social']['googleplus']['url'] = theme_get_setting('googleplus_url');\n $settings['social']['googleplus']['tooltip'] = theme_get_setting('googleplus_tooltip');\n $settings['social']['instagram']['active'] = theme_get_setting('instagram');\n $settings['social']['instagram']['url'] = theme_get_setting('instagram_url');\n $settings['social']['instagram']['tooltip'] = theme_get_setting('instagram_tooltip');\n $settings['social']['linkedin']['active'] = theme_get_setting('linkedin');\n $settings['social']['linkedin']['url'] = theme_get_setting('linkedin_url');\n $settings['social']['linkedin']['tooltip'] = theme_get_setting('linkedin_tooltip');\n $settings['social']['pinterest']['active'] = theme_get_setting('pinterest');\n $settings['social']['pinterest']['url'] = theme_get_setting('pinterest_url');\n $settings['social']['pinterest']['tooltip'] = theme_get_setting('pinterest_tooltip');\n $settings['social']['vimeo']['active'] = theme_get_setting('vimeo');\n $settings['social']['vimeo']['url'] = theme_get_setting('vimeo_url');\n $settings['social']['vimeo']['tooltip'] = theme_get_setting('vimeo_tooltip');\n $settings['social']['youtube']['active'] = theme_get_setting('youtube');\n $settings['social']['youtube']['url'] = theme_get_setting('youtube_url');\n $settings['social']['youtube']['tooltip'] = theme_get_setting('youtube_tooltip');\n\n return $settings;\n}", "private function get_theme_services() : void {\n\n if( $this->services == null ) {\n\n $this->services = $this->themeclass->get_service_classes();\n\n }\n \n }", "protected function loadInfo()\n {\n $this->info = include $this->activeThemePath() . '/info.php';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transfers the current items from the bulk login screen
public function bulklogintransferreportAction() { //Don't display a new view $this->_helper->viewRenderer->setNoRender(); //Don't use the default layout since this isn't a view call $this->_helper->layout->disableLayout(); $transferlist = TransferNamespace::getTransferList(TransferNamespace::LOGIN); $this->transfer($transferlist, RecordNamespace::LOGIN); }
[ "private function moveItems()\n {\n if ($sessionItems = $this->sessionStorage->load()) {\n $items = array_merge($this->loadDb(), $sessionItems);\n $this->saveDb($items);\n $this->sessionStorage->save([]);\n }\n }", "private function saveItems()\n {\n $this->storage->save($this->items);\n }", "private function saveItems()\n {\n $this->storage->save($this->items);\n }", "public function sl_admin_bulk_import()\n {\n if (isset($_REQUEST['action'])) {\n if ($_REQUEST['action'] == 'sl_location_export_cbf') {\n do_action('sl_location_export', 'sl_location_export_cbf');\n }\n }\n global $wpdb;\n global $current_user;\n $sl_tb_stores = $this->sl_return_dbTable('SRO');\n $sl_tb_importdata = $this->sl_return_dbTable('IOD');\n $sql_SetStr = \"SELECT * FROM `$sl_tb_stores`\";\n $sl_select_obj = $wpdb->get_results($sql_SetStr);\n $sl_stores_count = $wpdb->num_rows; ?>\n\t\t<div class=\"wrap\">\n\t\t\t<?php\n include 'admin/tbl.sl_import_export_store.php'; ?>\n\t\t</div>\n\t\t<?php\n }", "public function transferCartToCurrentUser(): void\n {\n $itemCountAfterTransfer = 0;\n\n if ($this->sessionCartExists() === false || $this->isUserLoggedIn() === false) {\n return;\n }\n\n $this->logger->debug(sprintf('Cart transfer requested for cart %s to user %s', $this->cartSession->getSyliusCartId(), $this->getLoggedInUserEmail()), LogEnvironment::fromMethodName(__METHOD__));\n\n $this->currentCart = $this->retrieveExistingCartByCartId($this->cartSession->getSyliusCartId());\n\n if (!$this->currentCart instanceof Cart) {\n $this->logger->warning(sprintf('Cart with id %s not found while trying to transfer it to user %s', $this->cartSession->getSyliusCartId(), $this->getLoggedInUserEmail()), LogEnvironment::fromMethodName(__METHOD__));\n return;\n }\n\n if ($this->currentCart->getCustomerEMail() === $this->getLoggedInUserEmail()) {\n $this->logger->debug('The customer mail is equal to the current user mail - nothing to do.', LogEnvironment::fromMethodName(__METHOD__));\n return;\n }\n\n $anonymousCart = $this->currentCart;\n\n $existingUserCart = $this->retrieveExistingCartByCustomerMail();\n if ($existingUserCart instanceof Cart) {\n $userCart = $existingUserCart->getSyliusCart();\n $itemCountAfterTransfer = count($existingUserCart->getItems());\n } else {\n $userCart = (new SyliusCart())->setCustomer($this->getLoggedInUserEmail());\n /** @var SyliusCart $userCart */\n $userCart = $this->cartResource->add($userCart);\n }\n\n foreach ($anonymousCart->getItems() as $anonymousCartItem) {\n $userCartItem = (new CartItem())\n ->setCartId($userCart->getId())\n ->setVariant($anonymousCartItem->getVariant())\n ->setQuantity($anonymousCartItem->getQuantity());\n $this->getCartItemResource()->add($userCartItem);\n $itemCountAfterTransfer++;\n }\n\n $this->getCartResource()->delete((string)$anonymousCart->getCartId());\n\n $this->logger->info(sprintf('Copied %s items from anonymous cart %s to user %s (CartId: %s)', count($anonymousCart->getItems()), $anonymousCart->getCartId(), $this->getLoggedInUserEmail(), $userCart->getId()), LogEnvironment::fromMethodName(__METHOD__));\n\n $this->currentCart = new Cart($userCart);\n\n $this->updateCartSession($userCart);\n\n $this->cartSession->setCartItemCount($itemCountAfterTransfer);\n }", "public function pushItems(): void {\n $items = $this->local_item_repository->findAll();\n \n foreach($items as $item) {\n $this->database_item_repository->addItem($item);\n }\n }", "public function bulklogouttransferreportAction() \n {\n \t//Don't display a new view\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t//Don't use the default layout since this isn't a view call\n\t\t$this->_helper->layout->disableLayout();\n\t\t\n\t\t$transferlist = TransferNamespace::getTransferList(TransferNamespace::LOGOUT);\n\n\t\t$this->transfer($transferlist, RecordNamespace::LOGOUT);\n }", "public function syncAccounts();", "protected function initialSync() {\n $oUsers = oxNew(\"oxuserlist\");\n /* @var $oUsers oxuserlist */\n $oUsers->getList();\n $cUser = 0;\n $cOrders = 0;\n $cSavedBaskets = 0;\n $cWishLists = 0;\n $cNoticeList = 0;\n $cNewsletterOptIns = 0;\n $cEmailOptIns = 0;\n foreach ($oUsers as $oUser) {\n $cUser++;\n hdio2c_sync::saveSync(\"newUser\", $oUser->getId());\n\n $savedBasket = $oUser->getBasket('savedbasket');\n if ($sid = $savedBasket->getId()) {\n hdio2c_sync::saveSync(\"savedbasket\", $savedBasket->getId());\n $cSavedBaskets++;\n }\n\n $noticeList = $oUser->getBasket('noticelist');\n if ($wid = $noticeList->getId()) {\n hdio2c_sync::saveSync(\"noticelist\", $wid);\n $cNoticeList++;\n }\n\n $wishList = $oUser->getBasket('wishlist');\n if ($nid = $wishList->getId()) {\n hdio2c_sync::saveSync(\"wishlist\", $nid);\n $cWishLists++;\n }\n\n $oOrders = $oUser->getOrders();\n foreach ($oOrders as $oOrder) {\n $cOrders++;\n hdio2c_sync::saveSync(\"newOrder\", $oOrder->getId());\n }\n $oNewsletter = $oUser->getNewsSubscription();\n if ($oNewsletter->getOptinStatus() > 0) {\n $cNewsletterOptIns++;\n hdio2c_sync::saveSync(\"newsletterOptIn\", $oUser->getId());\n if ($oNewsletter->getOptInEmailStatus() > 0) {\n $cEmailOptIns++;\n hdio2c_sync::saveSync(\"emailOptIn\", $oUser->getId());\n }\n }\n }\n\n $result = new stdClass();\n $result->Users = $cUser;\n $result->Orders = $cOrders;\n $result->SavedBaskets = $cSavedBaskets;\n $result->WishLists = $cWishLists;\n $result->NoticeLists = $cNoticeList;\n $result->NewsletterAbos = $cNewsletterOptIns;\n $result->NewsletterAbosWithDoubleOtIn = $cEmailOptIns;\n $this->_oSmarty->assign(\"json\", json_encode($result));\n }", "public function testBatchTransferCollectionItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function bulkuploadAction() {\n /**\n * Check license key\n */\n Mage::helper ('marketplace')->checkMarketplaceKey();\n \n /**\n * Check whether seller or not\n */\n $this->checkWhetherSellerOrNot ();\n \n try {\n /**\n * New zend File Uploader\n */\n $uploadsData = new Zend_File_Transfer_Adapter_Http ();\n $filesDataArray = $uploadsData->getFileInfo ();\n \n /**\n * Checking whether csv exist or not\n */\n if (! empty ( $filesDataArray )) {\n $this->saveBulkUploadFiles ( $filesDataArray );\n }\n } catch ( Exception $e ) {\n /**\n * Display error message for csv file upload\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/product/manage' );\n return;\n }\n \n }", "function transferListStep2(){\n\tglobal $debug, $message, $success, $Dbc, $returnThis;\n\t$output = '';\n\ttry{\n\t\t$emailValidate = emailValidate($_POST['intendedEmail']);\n\t\tif(empty($_POST['listId'])){\n\t\t\tthrow new Adrlist_CustomException('','$_POST[\\'listId\\'] is empty.');\n\t\t}elseif($emailValidate === false){\n\t\t\tthrow new Adrlist_CustomException('The email address you entered is not valid.','$_POST[\\'intendedEmailAddress\\'] is not valid.');\n\t\t}elseif(empty($_POST['intendedEmail'])){\n\t\t\tthrow new Adrlist_CustomException('','$_POST[\\'intendedEmail\\'] is empty.');\n\t\t}elseif(empty($_POST['intendedEmailRetype'])){\n\t\t\tthrow new Adrlist_CustomException('','$_POST[\\'intendedEmailRetype\\'] is empty.');\n\t\t}elseif($_POST['intendedEmail'] != $_POST['intendedEmailRetype']){\n\t\t\tthrow new Adrlist_CustomException('The email addresses don\\'t match.','$_POST[\\'intendedEmail\\'] != $_POST[\\'intendedEmailRetype\\']');\n\t\t}elseif($_POST['intendedEmail'] == $_SESSION['primaryEmail'] || $_POST['intendedEmail'] == $_SESSION['secondaryEmail']){\n\t\t\tthrow new Adrlist_CustomException('The email address you entered is linked to your account.','$_POST[\\'intendedEmail\\'] == user\\'s email.');\n\t\t}\n\t\t$Dbc->beginTransaction();\n\t\t//Check for a pending transfer.\n\t\t$pendingTransferStmt = $Dbc->prepare(\"SELECT\n\ttlId AS 'tlId'\nFROM\n\ttransferList\nWHERE\n\tlistId = ?\");\n\t\t$pendingTransferStmt->execute(array($_POST['listId']));\n\t\t$pendingTransferRow = $pendingTransferStmt->fetch(PDO::FETCH_ASSOC);\n\t\tif(empty($pendingTransferRow['tlId'])){\n\t\t\t//Verify the user has a sufficient role to transfer the list.\n\t\t\t$listInfo = getListInfo($_SESSION['userId'],$_POST['listId']);\n\t\t\t$debug->printArray($listInfo,'$listInfo');\n\t\t\tif($listInfo === false || $listInfo['listRoleId'] < 4){\n\t\t\t\t$message .= 'Your role does not allow you to transfer this list.<br>';\n\t\t\t}else{\n\t\t\t\t//Insert a record of transfer.\n\t\t\t\t$transferListCode = sha1($_POST['intendedEmail'] . time());\n\t\t\t\t$insertTransferStmt = $Dbc->prepare(\"INSERT INTO\n\ttransferList\nSET\n\tintendedEmail = ?,\n\ttransferListCode = ?,\n\tlistId = ?,\n\tsenderId = ?,\n\tsentDate = ?\");\n\t\t\t\t$insertTransferParams = array($_POST['intendedEmail'],$transferListCode,$_POST['listId'],$_SESSION['userId'],DATETIME);\n\t\t\t\t$insertTransferStmt->execute($insertTransferParams);\n\t\t\t\t//Email the recipient.\n\t\t\t\t$subject = $_SESSION['firstName'] . ' ' . $_SESSION['lastName'] . ' has transferred an ADR list to you at ' . THENAMEOFTHESITE;\n\t\t\t\t$bodyText = $_SESSION['firstName'] . ' ' . $_SESSION['lastName'] . ' has transferred the ADR list \"' . $listInfo['listName'] . '\" to you at ' . THENAMEOFTHESITE . '. Log in to your account to view this list: ' . LINKLOGIN . '\n';\n\t\t\t\t$bodyHtml = '\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#FFFFFF\">\n\t<tr>\n\t\t<td align=\"center\"><font face=\"' . FONT . '\" size=\"' . SIZE3 . '\">' . $_SESSION['firstName'] . ' ' . $_SESSION['lastName'] . ' has transferred the ADR list \"' . $listInfo['listName'] . '\" to you at ' . THENAMEOFTHESITE . '. Log in to your account to view this list: <a href=\"' . LINKLOGIN . '\">' . LINKLOGIN . '</a></td>\n\t</tr>\n</table>\t\t\n';\n\t\t\t\tif(email(EMAILDONOTREPLY,$_POST['intendedEmail'],$subject,$bodyHtml,$bodyText)){\n\t\t\t\t\t$message .= 'The list \"' . $listInfo['listName'] . '\" will be transferred to the user at ' . $_POST['intendedEmail'] . '.';\n\t\t\t\t\tif(MODE == 'transferListStep2'){\n\t\t\t\t\t\t$success = true;\n\t\t\t\t\t}\n\t\t\t\t\t$Dbc->commit();\n\t\t\t\t}else{\n\t\t\t\t\t$Dbc->rollback();\n\t\t\t\t\terror(__LINE__,'We ran into trouble trying to send an email to the user. Please verify the email address and try sharing this list again.');\n\t\t\t\t}\n\t\t\t\t//Email the sender.\n\t\t\t\t$subject = 'You have transferred an ADR list at' . THENAMEOFTHESITE;\n\t\t\t\t$bodyText = 'You transferred the ADR list \"' . $listInfo['listName'] . '\" to the user at ' . $_POST['intendedEmail'] . ' at ' . THENAMEOFTHESITE . '. Log in to your account to view this list: ' . LINKLOGIN . '\n';\n\t\t\t\t$bodyHtml = '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#FFFFFF\">\n\t<tr>\n\t\t<td align=\"center\"><font face=\"' . FONT . '\" size=\"' . SIZE3 . '\">You transferred the ADR list \"' . $listInfo['listName'] . '\" to the user at ' . $_POST['intendedEmail'] . ' at ' . THENAMEOFTHESITE . '. Log in to your account to view this list: <a href=\"' . LINKLOGIN . '\">' . LINKLOGIN . '</a></td>\n\t</tr>\n</table>\n';\n\t\t\t\temail($_SESSION['primaryEmail'],$_SESSION['primaryEmail'],$subject,$bodyHtml,$bodyText);\n\t\t\t}\n\t\t}else{\n\t\t\t$message .= 'There is already a transfer pending for this list.';\n\t\t}\n\t}catch(Adrlist_CustomException $e){\n\t}catch(PDOException $e){\n\t\terror(__LINE__,'','<pre>' . $e . '</pre>');\n\t}\n\tif(MODE == 'transferListStep2'){\n\t\treturnData();\n\t}\n}", "public function imported_user() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'users',\n\t\t\t'delta' => 1,\n\t\t));\n\t}", "function synchronizeItems($username,$password,$data,$storeid=1,$OptionsBoost,$others)\r\n\t{\r\n\t\tglobal $registry,$language,$objEcc,$version;\r\n\t\t#check for authorisation\r\n\t\t$set_option_boost = $OptionsBoost;\r\n\t\t$status = $this->CheckUser($username,$password);\r\n\t\t\r\n\t\tif($status!==0)\r\n\t\t{\r\n\t\t\treturn $status;\r\n\t\t }\r\n\t\t\t\r\n\t\t$Items = new WG_Items();\r\n\t\t\t\r\n\t\t$requestArray = $data;\r\n\t $pos = strpos($others,'/');\r\n if($pos)\r\n {\r\n $array_others = explode(\"/\",$others);\r\n\t\t\t \r\n }else{\r\n\t \t\t $array_others=array();\r\n\t\t\t\t$array_others[0]=$others; \r\n\t\t}\r\n\t\tif (!is_array($requestArray))\r\n\t\t{\r\n\t\t\t\t$Items->setStatusCode('9997');\r\n\t\t\t\t$Items->setStatusMessage('Unknown request or request not in proper format');\t\t\t\t\r\n\t\t\t\treturn $this->response($Items->getItems());\t\t\t\t\r\n\t\t}\r\n\t\r\n\t\tif (count($requestArray) == 0)\r\n\t\t{\r\n\t\t\t\t$Items->setStatusCode('9996');\r\n\t\t\t\t$Items->setStatusMessage('REQUEST array(s) doesnt have correct input format');\t\t\t\t\r\n\t\t\t\treturn $this->response($Items->getItems());\t\t\t\t\r\n\t\t}\r\n\t\t $Items->setStatusCode('0');\r\n\t\t $Items->setStatusMessage('All Ok');\r\n\t\t $itemsCount = 0;\r\n\t\t $itemsProcessed = 0;\r\n\t\t // Go throught items\r\n\t\r\n\t\t $_err_message_arr = Array();\r\n\t\t foreach($requestArray as $k=>$v4)//request\r\n\t\t{\r\n\t\t\t\t$itemsCount++;\r\n\t\t\t\t$Item = new WG_Item();\r\n\t\t\t\t$status =\"Success\";\r\n\t\t\t\t$productID = $v4['ProductID'];\r\n\t\t\t\t$sku = $v4['Sku'];\r\n\t\t\t\t$productName = $v4['ProductName'];\r\n\t\t\t\t$qty = $v4['Qty'];\r\n\t\t\t\t$price = $v4['Price'];\r\n\t\t\t\t$updated_attrib=0;\r\n\t\t\t\t\r\n\t\t\t\tif(isset($v4['ItemVariants']) && is_array($v4['ItemVariants']))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($v4['ItemVariants'] as $var)//request\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$v4['Sku'] = $vsku =$var['Sku']; \r\n\t\t\t\t\t\t$varient_id = $var['VarientID'];\r\n\t\t\t\t\t\t$varient_qty = $var['Quantity'];\r\n\t\t\t\t\t\t$varient_price = $var['UnitPrice'];\r\n\t\t\t\t\t\tif(isset($set_option_boost) && $set_option_boost!='')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($varient_price) && $varient_price!='')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$sql = \"update \" . DB_PREFIX . \"product_option_value set price = '\".$varient_price.\"' WHERE product_option_value_id ='\".$varient_id.\"' and ob_sku= '\".$vsku.\"'\";\r\n\t\t\t\t\t\t\t\t$query = $objEcc->db->query($sql);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(isset($varient_qty) && $varient_qty!='')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$sql = \"update \" . DB_PREFIX . \"product_option_value set quantity = '\" . $varient_qty . \"' WHERE product_option_value_id ='\".$varient_id.\"' and ob_sku= '\".$vsku.\"'\";\r\n\t\t\t\t\t\t\t\t$query = $objEcc->db->query($sql);\r\n\t\t\t\t\t\t\t}\t\r\n\t\r\n\t\t\t\t\t\t\tif ($status ==\"\") $status =\"Success\";\t\r\n\t\t\t\t\t\t\t$Item->setStatus($status);\r\n\t\t\t\t\t\t\t$Item->setProductID($v4['ProductID']);\r\n\t\t\t\t\t\t\t$Item->setSku(htmlentities($v4['Sku']));\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$Items->setItems($Item->getItem());\t\t\t\t\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tforeach($array_others as $ot)\r\n\t\t\t\t{\r\n\t\t\t\tif ($updated_attrib ==0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$status =\"\";\r\n\t\t\t\t\t$sql = \"SELECT count(*) as isProductExist FROM \" . DB_PREFIX . \"product p WHERE product_id ='\".$productID.\"'\";\r\n\t\t\t\t\t$query = $objEcc->db->query($sql);\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$itemFound = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!$query->row['isProductExist']) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$status =\"Product not found\";\r\n\t\t\t\t\t\t$itemFound = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tif(($others==\"QTY\" || $others==\"BOTH\"|| $ot==\"QTY\")&& $itemFound)\r\n\t\t\t\t\t{\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$sql= \"UPDATE \" . DB_PREFIX . \"product SET quantity = '\".$qty.\"' where product_id='\".$productID.\"'\";\r\n\t\t\t\t\t\t$objEcc->db->query($sql);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(($others==\"PRICE\" || $others==\"BOTH\"|| $ot==\"PRICE\") && $itemFound)\r\n\t\t\t\t\t{\t\t\t\r\n\t\t\t\t\t\t$sql= \"UPDATE \" . DB_PREFIX . \"product SET price = '\".$price.\"' where product_id='\".$productID.\"'\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$objEcc->db->query($sql);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$itemsProcessed++; \t\r\n\t\t\t\t\tif ($status ==\"\") $status =\"Success\";\t\r\n\t\r\n\t\t\t\t\t$Item->setStatus($status);\r\n\t\t\t\t\t$Item->setProductID($v4['ProductID']);\r\n\t\t\t\t\t$Item->setSku(htmlentities($v4['Sku']));\t\t\t\t\t\t\t\r\n\t\t\t\t\t$Items->setItems($Item->getItem());\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse if($updated_attrib == $k+1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$itemsProcessed++; \r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t }\r\n\t\treturn $this->response($Items->getItems());\r\n\t}", "public function importAccounts($data);", "public function index_onBulkAction()\n {\n if (\n ($bulkAction = post('action')) &&\n ($checkedIds = post('checked')) &&\n is_array($checkedIds) &&\n count($checkedIds)\n ) {\n\n foreach ($checkedIds as $userId) {\n if (!$user = User::withTrashed()->find($userId)) {\n continue;\n }\n\n switch ($bulkAction) {\n case 'delete':\n $user->forceDelete();\n break;\n\n case 'deactivate':\n $user->delete();\n break;\n\n case 'restore':\n $user->restore();\n break;\n\n case 'ban':\n $user->ban();\n break;\n\n case 'unban':\n $user->unban();\n break;\n }\n }\n\n Flash::success(Lang::get('app::lang.users.'.$bulkAction.'_selected_success'));\n }\n else {\n Flash::error(Lang::get('app::lang.users.'.$bulkAction.'_selected_empty'));\n }\n\n return $this->listRefresh();\n }", "protected function saveItems()\n {\n $this->eventAccessObjectBackend->saveObject($this->items);\n }", "public function index_onBulkAction()\n {\n if (\n ($bulkAction = post('action')) &&\n ($checkedIds = post('checked')) &&\n is_array($checkedIds) &&\n count($checkedIds)\n ) {\n\n foreach ($checkedIds as $userId) {\n if (!$user = User::withTrashed()->find($userId)) {\n continue;\n }\n\n switch ($bulkAction) {\n case 'delete':\n $user->forceDelete();\n break;\n\n case 'deactivate':\n $user->delete();\n break;\n\n case 'restore':\n $user->restore();\n break;\n\n case 'ban':\n $user->ban();\n break;\n\n case 'unban':\n $user->unban();\n break;\n }\n }\n\n Flash::success(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_success'));\n }\n else {\n Flash::error(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_empty'));\n }\n\n return $this->listRefresh();\n }", "function TransferProfiles()\n {\n $moduleaccesses=array();\n foreach (array_keys($this->ModuleDependencies) as $module)\n {\n $access=$this->ReadPHPArray($this->MyMod_Setup_Profiles_File($module));\n\n $access=$access[ \"Access\" ];\n\n $moduleaccesses[ $module ]=array();\n foreach ($this->GetListOfProfiles() as $profile)\n {\n $moduleaccesses[ $module ][ $profile ]=$access[ $profile ];\n }\n }\n\n if (isset($this->DBHash[ \"Mod\" ]) && $this->DBHash[ \"Mod\" ])\n {\n $file=$this->MyMod_Setup_Profiles_File();\n $this->WritePHPArray($file,$moduleaccesses);\n\n print $this->H(4,\"System Accesses written to \".$file);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setSllandline() Set the value of [slmobile] column. Mobile phone No in SL
public function setSlmobile($v) { if ($v !== null) { $v = (string) $v; } if ($this->slmobile !== $v) { $this->slmobile = $v; $this->modifiedColumns[] = OnlinecustomerPeer::SLMOBILE; } return $this; }
[ "public function getSlmobile()\n\t{\n\t\treturn $this->slmobile;\n\t}", "public function set_mobile_phone($p_mobile_phone){\n\t\t$this->v_mobile_phone = $p_mobile_phone;\n\t}", "protected function setMobile($value=true) { $this->_is_mobile = $value; }", "function setMobile($mobile) {\n $this->mobile = $mobile;\n }", "public function set_mobile_phone($mobile_phone) {\r\n $this->mobile_phone = $mobile_phone;\r\n }", "public function setMobilePhone(?string $value): void {\n $this->getBackingStore()->set('mobilePhone', $value);\n }", "protected function setMobile($value = true)\n {\n $this->_is_mobile = $value;\n }", "public static function set_mobile()\n\t{\n\t\tself::$_mobile = true ;\n\t}", "public function setMobile(string $mobile): self;", "function setLineSeparator($ls)\n {\n $this->ls = $ls;\n }", "public function getSllandline()\n\t{\n\t\treturn $this->sllandline;\n\t}", "public function setPhone($phone){\n $this->phone = $phone;\n if($this->id != 0){\n $sql = \"UPDATE `tbl_sinhvien` SET `phone` = '$phone' WHERE id = '$this->$id'\";\n $this->db->executeQuery($sql);\n }\n\t}", "public function setPhone($value)\n {\n Yii::trace('setPhone()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__phone', $value);\n }", "function setSecondaryPhone($p)\n {\n $this->__secondaryphone = $p;\n }", "protected function setMobile($isMobile = true)\n {\n $this->_isMobile = $isMobile == true;\n }", "public function setLine($line);", "public function setLinkMobilephone($value) {\n return $this->set(self::LINK_MOBILEPHONE, $value);\n }", "function setLSCCode($code)\n {\n $this->__lsccode = $code ;\n }", "public function setLineNumber($_line) {\n\t\t$this->line = $_line;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of expandSpace
public function setExpandSpace($expandSpace) { $this->expandSpace = $expandSpace; return $this; }
[ "public function getExpandSpace()\n {\n return $this->expandSpace;\n }", "public function setExpand($value) {}", "protected function spaceShortcut()\n {\n\n $spaceKey = $this->positionInLayout(chr(32));\n $space = $this->getElement($spaceKey);\n $elmTwo = $this->elmTwo;\n\n $this->elmTwo = $space;\n $this->getPath($this->elmOne, $this->elmTwo);\n\n $this->elmTwo = $elmTwo;\n $pathToSpace = $this->path;\n\n $this->path = array();\n\n $elmOne = $this->elmOne;\n $this->elmOne = $space;\n $this->getPath($space, $this->elmTwo);\n $this->elmOne = $elmOne;\n\n $pathFromSpace = $this->path;\n\n $this->path = array();\n $this->path['space']['to'] = $pathToSpace;\n $this->path['space']['from'] = $pathFromSpace;\n $this->path['space']['score'] = $this->getScore($pathToSpace)+$this->getScore($pathFromSpace);\n\n }", "public function expand();", "public function setNumSpaces($numSpaces) {\n\t\t$this->spaces = str_repeat(' ', $numSpaces);\n\t\t$this->numSpaces = $numSpaces;\n\t}", "public function set_spacing_sizes()\n {\n }", "private function expandDimension()\n\t{\n\t\t$this->sortDimension();\n\n\t\t$newPocketDimension = $this->pocketDimension;\n\t\tforeach($this->pocketDimension as $w => $wDim)\n\t\t{\n\t\t\tforeach($this->pocketDimension[$w] as $z => $zDim)\n\t\t\t{\n\t\t\t\tforeach($this->pocketDimension[$w][$z] as $y => $yDim)\n\t\t\t\t{\n\t\t\t\t\tforeach($this->pocketDimension[$w][$z][$y] as $x => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setNearbyInactive($w,$z,$y,$x,$newPocketDimension);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t$this->pocketDimension = $newPocketDimension;\n\t\tunset($newPocketDimension);\n\t}", "public function setNumSpaces($numSpaces)\n {\n $this->spaces = str_repeat(' ', $numSpaces);\n $this->numSpaces = $numSpaces;\n }", "function setExpand($a_node_id)\n\t{\n\t\t// IF ISN'T SET CREATE SESSION VARIABLE\n\t\tif(!is_array($_SESSION[\"mexpand\"]))\n\t\t{\n\t\t\t$_SESSION[\"mexpand\"] = array();\n\t\t}\n\t\t// IF $_GET[\"expand\"] is positive => expand this node\n\t\tif($a_node_id > 0 && !in_array($a_node_id,$_SESSION[\"mexpand\"]))\n\t\t{\n\t\t\tarray_push($_SESSION[\"mexpand\"],$a_node_id);\n\t\t}\n\t\t// IF $_GET[\"expand\"] is negative => compress this node\n\t\tif($a_node_id < 0)\n\t\t{\n\t\t\t$key = array_keys($_SESSION[\"mexpand\"],-(int) $a_node_id);\n\t\t\tunset($_SESSION[\"mexpand\"][$key[0]]);\n\t\t}\n\t\t$this->expanded = $_SESSION[\"mexpand\"];\n\t}", "function set_unit_spacing( $on = true ) {\n\t\t$this->settings['unitSpacing'] = $on;\n\t}", "abstract protected function initialExpand();", "public function setExpandRows($value){}", "public static function setExpandOptions($options)\n {\n \tself::$expandOptions = $options;\n }", "protected function updateSettingCollapseExpand()\n {\n $current_setting = Configuration::get('HSMA_COLLAPSE_EXPAND_GROUPS');\n switch ($current_setting) {\n case HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND));\n break;\n case HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND_FIRST:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND_FIRST), 'position = 0');\n break;\n case HsMaDisplayStyle::DISPLAY_GROUPS_COLLAPSE:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_COLLAPSE));\n break;\n default:\n $result = true;\n break;\n }\n if ($result) {\n Configuration::deleteByName('HSMA_COLLAPSE_EXPAND_GROUPS');\n }\n return $result;\n }", "public function setSpace($var)\n {\n GPBUtil::checkString($var, True);\n $this->Space = $var;\n\n return $this;\n }", "public function setSpacing($spacing)\n {\n $this->fixedSpacing = true;\n $this->spacing = (int) $spacing;\n }", "public function setSpace($space = self::SPACE_PRESERVE) {\n\t\treturn $this->attrib('xml:space', $space);\n\t}", "public function forceExpanded()\n\t{\n\t \treturn true;\n\t}", "function AssignSpacer(wxSize $size, $w, $h){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SELECT song_info_change_len(siid INTEGER(11), silen TIME)
public function song_info_change_len($siid,$silen){ $ans=mysql_query("SELECT song_info_change_len(".$siid.",".$silen.");",$this->connect); if($ans==0){ return 1; } }
[ "function get_local_audio_length($filename) {\n $getID3 = new getID3;\n $fileinfo = $getID3->analyze($filename);\n\n return round($fileinfo['playtime_seconds'], 2);\n}", "function getReplayLengthSeconds(){\n return ((int)($this->replay_length/10));\n }", "abstract protected function getTrackPregapLength(int $pos): string;", "public function getChangeFreq(): string;", "function wpfc_mp3_duration($mp3_url) {\n\trequire_once plugin_dir_path( __FILE__ ) . '/includes/getid3/getid3.php'; \n\t$filename = tempnam('/tmp','getid3');\n\tif (file_put_contents($filename, file_get_contents($mp3_url, false, null, 0, 300000))) {\n\t\t $getID3 = new getID3;\n\t\t $ThisFileInfo = $getID3->analyze($filename);\n\t\t unlink($filename);\n\t}\n\n\t$bitratez=$ThisFileInfo[audio][bitrate]; // get the bitrate from the audio file\n\n\t$headers = get_headers($mp3_url, 1); // Get the headers from the remote file\n\t\t\t\tif ((!array_key_exists(\"Content-Length\", $headers))) { return false; } // Get the content length from the remote file\n\t\t\t\t$filesize= round($headers[\"Content-Length\"]/1000); // Make the failesize into kilobytes & round it\n\n\t$contentLengthKBITS=$filesize*8; // make kbytes into kbits\n\t$bitrate=$bitratez/1000; //convert bits/sec to kbit/sec\n\t$seconds=$contentLengthKBITS/$bitrate; // Calculate seconds in song\n\n\t$playtime_mins = floor($seconds/60); // get the minutes of the playtime string\n\t$playtime_secs = $seconds % 60; // get the seconds for the playtime string\n\tif(strlen($playtime_secs)=='1'){$zero='0';} // if the string is a multiple of 10, we need to add a 0 for visual reasons\n\t$playtime_secs = $zero.$playtime_secs; // add the zero if nessecary\n\t$playtime_string=$playtime_mins.':'.$playtime_secs; // create the playtime string\n\n\t\treturn $playtime_string;\n}", "function wpfc_mp3_duration($mp3_url) {\r\n\tif ( ! class_exists( 'getID3' ) ) {\r\n\t\trequire_once WPFC_SERMONS . '/includes/getid3/getid3.php'; \r\n\t}\r\n\t$filename = tempnam('/tmp','getid3');\r\n\tif (file_put_contents($filename, file_get_contents($mp3_url, false, null, 0, 300000))) {\r\n\t\t $getID3 = new getID3;\r\n\t\t $ThisFileInfo = $getID3->analyze($filename);\r\n\t\t unlink($filename);\r\n\t}\r\n\r\n\t$bitratez=$ThisFileInfo[audio][bitrate]; // get the bitrate from the audio file\r\n\r\n\t$headers = get_headers($mp3_url, 1); // Get the headers from the remote file\r\n\t\t\t\tif ((!array_key_exists(\"Content-Length\", $headers))) { return false; } // Get the content length from the remote file\r\n\t\t\t\t$content_length = (int)$headers[\"Content-Length\"]; \r\n\t\t\t\t$filesize= round($content_length/1000); // Make the filesize into kilobytes & round it\r\n\r\n\t$contentLengthKBITS=$filesize*8; // make kbytes into kbits\r\n\t$bitrate=$bitratez/1000; //convert bits/sec to kbit/sec\r\n\t$seconds=$contentLengthKBITS/$bitrate; // Calculate seconds in song\r\n\r\n\t$playtime_mins = floor($seconds/60); // get the minutes of the playtime string\r\n\t$playtime_secs = $seconds % 60; // get the seconds for the playtime string\r\n\tif(strlen($playtime_secs)=='1'){$zero='0';} // if the string is a multiple of 10, we need to add a 0 for visual reasons\r\n\t$playtime_secs = $zero.$playtime_secs; // add the zero if necessary\r\n\t$playtime_string=$playtime_mins.':'.$playtime_secs; // create the playtime string\r\n\r\n\t\treturn $playtime_string;\r\n}", "function getCurTrackLength(){\n\t\tglobal $jbArr;\n\t\t\n\t\t// First let's get the full status from the player\n\t\t$status = getATStatus();\n\t\t\n\t\t// Now let's get the length\n\t\t$length = substr($status,strpos($status,\"TotalTime=\")+strlen(\"TotalTime=\"));\n\t\t$length = substr($length,0,strpos($length,\"\\n\"));\n\t\t\n\t\treturn $length;\n\t\t\n\t\t// Now let's get the location\n\t\t$cur = substr($status,strpos($status,\"CurrPlayTime=\")+strlen(\"CurrPlayTime=\"));\n\t\t$cur = substr($cur,0,strpos($cur,\"\\n\"));\n\t\t\n\t\treturn $cur;\n\t}", "public function DurationSong($song) {\n $audio = new MP3File($song);\n $duration = MP3File::formatTime($audio->getDurationEstimate());\n return($duration);\n }", "abstract public function field_len($no);", "function getCurTrackLength(){\n\t\tglobal $jbArr;\n\t\t\n\t\t// let's connect to the player\n\t\t$jukebox = new slim($jbArr[$_SESSION['jb_id']]['server'],$jbArr[$_SESSION['jb_id']]['port']);\n\t\t\n\t\t// Now let's make sure it's playing\n\t\tif (trim(str_replace(\"playlist tracks \",\"\",$jukebox->execute(\"playlist tracks ?\"))) == 0){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn $jukebox->get(\"curlength\");\n\t}", "public function getLengthInSeconds() {\n\t\t$parts = explode(':', $this->getLength()->format('H:i:s'));\n\n\t\treturn $parts[0] * 3600 + $parts[1] * 60 + $parts[2];\n\t}", "function extracto_longitud($length){\n return 20;\n}", "function mediaFileDuration($mediFileInfo) {\n //mail('charbel@paravision.org','test', print_r($mediFileInfo, 1));\n //$duration = floor($mediFileInfo['streams'][0]['duration']);\n $duration = floor($mediFileInfo['format']['duration']);\n\n $duration_string = gmdate('H:i:s', $duration);\n\n return array($duration, $duration_string);\n}", "public static function getPlaylistLength() {\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\tSUM(playlist_song.length) AS totallength\r\n\t\t\t\tFROM\r\n\t\t\t\t\tplaylist_playlistentry\r\n\t\t\t\t\tLEFT JOIN playlist_song ON (playlist_playlistentry.song_id = playlist_song.id)\";\r\n\t\treturn DB::query(Database::SELECT, $sql)->execute()->get('totallength',0);\r\n\t}", "function setLength($time)\n\t{\n\t\t$this->_length = (int) $time;\n\t}", "function length_sql($table='')\n\t{\n\t\tif ($this->db->Type == 'maxdb' || $this->db->Type == 'sapdb')\n\t\t{\n\t\t\treturn '1';\n\t\t}\n\t\treturn 'LENGTH('.$table.'wiki_body)';\n\t}", "function convert_duration($mili){\n\t// $minutes = floor($seconds / 60);\n\n\t// // $minutes = floor($mili / 60);\n\t// // $minutes = $minutes % 60;\n\n\t// $time = $minutes . ':' . $seconds;\n\t$input = $mili;\n\n\t$usec = $input % 1000;\n\t$input = floor($mili / 1000);\n\n\t$seconds = $input % 60;\n\t$input = floor($input / 60);\n\n\t$minutes = $input % 60;\n\t$input = floor($input / 60);\n\n\n\t$time = $minutes.':'.$seconds;\n\treturn $time;\n}", "public function song_info_change_genre($siid,$sigenre){\r\n \t$ans=mysql_query(\"SELECT song_info_change_genre(\".$siid.\",\".$sigenre.\");\",$this->connect);\r\n\t\tif($ans==0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n \t}", "function getReplayLengthMinutes(){\n return floor($this->replay_length/600);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }